efficient-easel 8.2.1 → 8.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,57 @@
1
+ import{cloneNodeWithFreshIds as e}from"./chunk-2GVCAIPX.js";import{dedupeSlotChildren as n}from"./chunk-26OOWIJJ.js";import{styleClipboardOf as t}from"./chunk-BRDCD4LK.js";import{markedTreeNodeId as o,revealSelectedTreeRow as r,sameSelector as i}from"./chunk-FGNR22NY.js";import{rootRowName as l,slotChildRowName as s,slotChildRenameProp as d,sectionRenameProp as c}from"./chunk-BHRC3ASL.js";import{scrollPreviewToSection as a,gotoPreviewSlide as p,scrollPreviewToTop as u}from"./chunk-4ES5JGGX.js";import{useEaselKeyTarget as f,useEaselUndoKeys as h,useEaselSaveKey as m,editorRootFocus as g}from"./chunk-OWW44DVK.js";import{SlotChildActionsProvider as y}from"./chunk-KCBEE2MC.js";import{screenStorageKeys as k,DEFAULT_PANEL_W as S,clampPanelWidth as v}from"./chunk-DPKWJTNX.js";import{usePartBridge as b}from"./chunk-HA33IXEU.js";import{useSectionOps as x}from"./chunk-VF6TCI62.js";import{useNodeClipboard as w,useNodeContextMenu as z}from"./chunk-D6N77AOS.js";import{PageEditGuardNotices as C}from"./chunk-NCQSBU3O.js";import{ScreenSaveIcon as B,ScreenMainButton as O}from"./chunk-HDUAODXJ.js";import{useBrowserOffline as I}from"./chunk-RKTF5XLP.js";import{useScreenDocument as N}from"./chunk-THZ46DC5.js";import{requestMediaPick as A}from"./chunk-KG7RJWOK.js";import{heldStyle as $,styleShortcut as T}from"./chunk-V7U33NF2.js";import{AddChildRow as P}from"./chunk-5545A3PC.js";import{AddSidePanel as M}from"./chunk-KIA6EKAM.js";import{SidePanelHead as j,PanelShowStrip as L}from"./chunk-XTJCKV6Z.js";import{useEaselSession as E}from"./chunk-O7Q4DDJT.js";import{MediaSidePanel as R}from"./chunk-NOD4ATKF.js";import{useScreenSaveSwitch as V,useScreenNodeKeys as F,useScreenPinned as D,useScreenDocumentLabel as H,useScreenCanvasFrame as W,useScreenInspectorPanel as U,useScreenDevices as J,useScreenPickFollowsSelection as G,useScreenLeftView as K,useScreenAdd as X,SELECTION_MODE as Y,sameInspectorMode as q,useScreenBridges as _,useScreenBlockRules as Q,useScreenBlockLook as Z,useScreenStorageNamespace as ee,useScreenNotify as ne,useScreenCanvasHead as te,isSlotMode as oe,useScreenStyleClipboard as re,useScreenDocumentPass as ie,useScreenCanvasDrag as le,ScreenCanvasTargetProvider as se,isPinnedFirst as de,isPinnedLast as ce,screenSlotsOf as ae}from"./chunk-CWTAS5R6.js";import{ROOT_ZONE as pe,blockNodeActions as ue,TREE_MAX_DEPTH as fe,childSlotsOf as he,slotFieldsOf as me,slotChildrenIn as ge,nestsInTree as ye,newNodeId as ke}from"./chunk-PLVEGYK6.js";import{useMediaPanel as Se,usePanelPick as ve,useCancelPanelPick as be}from"./chunk-R6WTQWAC.js";import{useEaselHost as xe,useHostEscape as we}from"./chunk-U3JP4VGF.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as ze}from"./chunk-6WY6ZXJG.js";import{DEFAULT_SCREEN_WORDS as Ce}from"./chunk-JTUUIVBZ.js";import{useEasel as Be,useEaselApi as Oe,CanvasPassThroughContext as Ie}from"./chunk-K5744MTM.js";import{TreeRow as Ne,Subtree as Ae,LayersTree as $e,TreeGroupLabel as Te,TreeRowAction as Pe,TreeSeam as Me}from"./chunk-4JSBIW5H.js";import{DEFAULT_TREE_WORDS as je}from"./chunk-K56YDHYQ.js";import{DEFAULT_NODE_MENU_WORDS as Le}from"./chunk-WK3AFPXY.js";import{toItemSelector as Ee,useNodeOps as Re,clickPick as Ve}from"./chunk-ECM5F6JJ.js";import{LayersIcon as Fe,MediaIcon as De}from"./chunk-4VJATVVR.js";import{EaselTopBar as He,TopBarRail as We,TopBarCluster as Ue,EaselIconButton as Je,TopBarDivider as Ge,DeviceSwitch as Ke,InspectorIconButton as Xe,PanelResizeHandle as Ye,MAX_PANEL_W as qe,MIN_PANEL_W as _e,panelWidthVars as Qe}from"./chunk-QVUVDBGA.js";import{DEFAULT_NOTICE_WORDS as Ze,DEFAULT_CHROME_WORDS as en}from"./chunk-Y2G7CU6A.js";import{holderOf as nn,nameOrSomeone as tn}from"./chunk-THWO5YVZ.js";import{DEFAULT_LOCK_WORDS as on}from"./chunk-RE4LP46F.js";import{useWords as rn}from"./chunk-MFIRYGHW.js";import{insertSeams as ln,CanvasDragLayer as sn,CanvasInsert as dn}from"./chunk-FCLW4LEN.js";import{DEFAULT_DRAG_WORDS as cn}from"./chunk-O2NLQBFX.js";import{createDragSession as an,useTreeDrag as pn,gapToMoveIndex as un}from"./chunk-67GNT6PF.js";import{useCanvasFrame as fn,LIST_SELECTOR as hn,BLOCK_SELECTOR as mn,useCanvasEvent as gn,nodeIdAt as yn,frameRectToHost as kn,BLOCK_ATTRIBUTE as Sn,drawnBox as vn}from"./chunk-ILXP5VX5.js";import{zoneKey as bn,ROOT_ID as xn,ROOT_SLOT as wn,parseZoneKey as zn,find as Cn,DataError as Bn}from"./chunk-KRXQM65X.js";import{useRef as On,useMemo as In,useState as Nn,useEffect as An,useCallback as $n,useLayoutEffect as Tn,Fragment as Pn}from"react";import{ColoredBadge as Mn,toast as jn,groupColors as Ln}from"efficient-shell/ui";import{UndoIcon as En,RedoIcon as Rn,RefreshIcon as Vn,TrashIcon as Fn,EyeOffIcon as Dn,EyeIcon as Hn,DuplicateIcon as Wn}from"efficient-shell/icons/efficient";import{jsx as Un,jsxs as Jn,Fragment as Gn}from"react/jsx-runtime";var Kn=/* @__PURE__ */new WeakSet;function Xn(e,n,t){const o=Cn(e,n,t);if(!o)return null;const r=o.path.find(e=>"root"!==e.parentId);return r?r.parentId:t}function Yn({canvas:e,tabs:n,onSelect:t}){const o=On(null),[r,i]=Nn({}),l=n.map(e=>`${e.id}:${e.below?1:0}`).join("|");return Tn(()=>{const t=e?.document,r=e?.window,l=e?.frame;if(!t||!r||!l||0===n.length)return void i({});let s=0;const d=()=>{s=0;const e=o.current;if(!e)return;const d=kn(l,{left:0,top:0,width:r.innerWidth,height:r.innerHeight},e),c={};for(const o of n){const n=t.querySelector(`[${Sn}="${r.CSS?.escape?r.CSS.escape(o.id):o.id}"]`),i=n?vn(n):null;if(!i||0===i.height){c[o.id]=null;continue}const s=kn(l,{left:i.left,top:i.top,width:i.width,height:i.height},e),a=s.top+s.height;if(a<d.top||s.top>d.top+d.height){c[o.id]=null;continue}const p=o.below?a+4:Math.max(s.top,d.top)+6;c[o.id]={left:Math.max(s.left,d.left)+6,top:p}}i(c)},c=()=>{s||(s=r.requestAnimationFrame(d))};d(),r.addEventListener("scroll",c,!0),r.addEventListener("resize",c);const a=new r.MutationObserver(c);return a.observe(t.body,{childList:!0,subtree:!0,attributes:!0}),()=>{s&&r.cancelAnimationFrame(s),r.removeEventListener("scroll",c,!0),r.removeEventListener("resize",c),a.disconnect()}},[e,l]),/* @__PURE__ */Un("div",{ref:o,className:"es-band-tabs","aria-hidden":"true",children:n.map(e=>{const n=r[e.id];return n?/* @__PURE__ */Un("span",{className:"es-band-tab","data-band-tab":e.id,style:{left:n.left,top:n.top},onClick:n=>{n.stopPropagation(),t(e.id)},children:/* @__PURE__ */Un(Mn,{colorClass:Ln("info","solid"),size:"sm",children:e.label})},e.id):null})})}function qn({expand:e}){/* @__PURE__ */
2
+ return Un("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */Jn(Gn,e?{children:[
3
+ /* @__PURE__ */Un("path",{d:"M8 9l4-4 4 4"}),
4
+ /* @__PURE__ */Un("path",{d:"M8 15l4 4 4-4"})]}:{children:[
5
+ /* @__PURE__ */Un("path",{d:"M8 4l4 4 4-4"}),
6
+ /* @__PURE__ */Un("path",{d:"M8 20l4-4 4 4"}),
7
+ /* @__PURE__ */Un("path",{d:"M5 12h14"})]})})}var _n=`${hn}, ${mn}`;function Qn(e,n,t){const o=t-n;if(o<6)return null;if(o<24)return{top:Math.round((n+t)/2),height:Math.round(o)};return{top:Math.round(Math.min(Math.max(e,n+12),t-12))}}var Zn="__rungs";var et="screen:band",nt={duplicate:!0,delete:!0};function tt(){const hn=xe(),{target:kn,docId:Sn,capabilities:vn,currentSlug:Ln,siteId:tt,onPublish:ot,saveState:rt,saveConflict:it,retrySave:lt,toggleAutoSave:st,flushSave:dt,access:ct,saveUnreachable:at=!1,readOnly:pt,readOnlyReason:ut=null}=N(),ft=V(),ht=F(),{mediaEditing:mt,hasEditGuard:gt,hasPinnedChrome:yt}=vn,{appState:kt,dispatch:St,history:vt,selectedItem:bt,getSelectorForId:xt,config:wt}=Be(e=>e),zt=D(),{first:Ct,firstGroup:Bt,lastGroup:Ot,isSectionGroup:It,sectionGroupZone:Nt,panelOf:At}=zt,$t=At(Ct),Tt=e=>de(zt,e),Pt=e=>ce(zt,e),Mt="node"===zt.firstRow,jt=zt.band??null,Lt=rn("screen",Ce),Et=rn("tree",je),Rt=rn("drag",cn),Vt=rn("notice",Ze),Ft=rn("lock",on),Dt=rn("menu",Le),Ht=rn("styleClipboard",ze),Wt=rn("chrome",en),Ut=H()??`/${Ln}`,Jt=W(),Gt=U(),Kt=x({readOnly:pt}),Xt=x({readOnly:pt,foldIntoHistory:!0}),Yt=On(null),qt=Oe(),_t=In(()=>({...Kt,select:e=>{Yt.current=e,Kt.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=qt.config;Yt.current=Ee(e,t,n)}Kt.commitDocument(e,n)}}),[Kt,qt]),Qt=kt.ui,Zt=Qt.leftSideBarVisible,eo=Qt.rightSideBarVisible,{options:no,widths:to,initial:oo,fluid:ro,fit:io}=J(),[lo,so]=Nn(oo),co=Se(),ao=mt&&null!==co,po=ve(),uo=be();G(bt?.props.id);const{read:fo,write:ho,forSelection:mo}=K(),[go,yo]=Nn(fo);An(()=>{ho(go)},[go]);const[ko,So]=Nn(0),vo=On(null),bo=On(null),xo=fn(bo,{readySelector:_n}),wo=f(bo);h(bo,xo);const zo=I(),Co=nn(ct),Bo={state:rt,offline:zo||rt.failed&&at,readOnlyReason:ut,editing:Co?Vt.editing({name:tn(Co.name,Ft),noun:Lt.noun}):null,conflict:null!=it,notSaving:Lt.bar.notSaving},Oo=()=>{pt||(rt.failed?lt():dt())};m(bo,xo,Oo);const[Io,No]=Nn(!1),Ao=On(!1),$o=On(!1),[To,Po]=Nn(null),Mo=X(),jo=e=>Po(null===e?null:{zone:pe,index:e}),[Lo,Eo]=Nn([]),[Ro,Vo]=Nn(Y),Fo="puck"===Ro.kind,Do=Io&&!To&&Mo.railTarget?Mo.railTarget(kt.data,{node:bt??null,mode:Ro}):null,Ho=Do?{zone:bn(Do),index:Do.index}:null,Wo=To??Ho,Uo=Wo&&Wo.zone===pe?Wo.index:null,Jo=o(Ro,bt?.props.id),[Go,Ko]=Nn(null);An(()=>{Go&&(r(),Ko(null))},[Go]);const Xo=On(xt);Xo.current=xt;const Yo=$n((e,{scroll:n})=>{yo(n=>mo(e,n)),n&&Ko(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=Xo.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&Cr(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),qo=On(null);An(()=>{const e=qo.current;qo.current=null;const n=null==bt?.props.id?null:String(bt.props.id);Vo(t=>e&&e.id===n?e.mode:"part"===t.kind&&"nodeId"in t&&t.nodeId===n?t:At(bt?.type)??Y);const t=bt?.props.id,o=Yt.current;if(Yt.current=null,!t)return;const r=xt(t);Yo(String(t),{scroll:!i(o,r??null,pe)})},[bt?.props.id,Yo]);const _o=$n(e=>{Vo(n=>q(n,e)?n:e),St({type:"setUi",ui:{rightSideBarVisible:!0}})},[St]),Qo=On(()=>{});Qo.current=(e,n)=>{const t=e?ki(e.zone??pe)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==bt?.props.id?null:String(bt.props.id);Vo(e=>q(e,n)?e:n),o!==r&&(qo.current={id:o,mode:n},_t.select(e))};const Zo=$n((e,n)=>Qo.current(e,n),[]),er={kind:Ro.kind,mode:Ro,open:_o,show:e=>Vo(e),reveal:()=>{eo||St({type:"setUi",ui:{rightSideBarVisible:!0}})},select:Zo},nr=_(er,{data:kt.data,selected:bt??null,zoneOf:e=>xt(e)?.zone,readOnly:Boolean(pt),select:e=>{Vo(Y),_t.select({index:e})},replace:(e,n)=>_t.replaceComponent(pe,e,n),scrollTo:e=>Wi(e)},{device:lo,refreshes:ko},{setView:yo,reveal:()=>{Zt||St({type:"setUi",ui:{leftSideBarVisible:!0}})}}),tr=nr.pinnedSource??!1,or=nr.resolveLeftView?nr.resolveLeftView(go,ao):"media"===go&&ao?go:"sections",rr=Q(),{isLockedBlock:ir,duplicateBlocked:lr,nestDepth:sr,newSectionNode:dr,canAddTo:cr,blockIsOffered:ar}=rr,pr=Z(),{labelAtLevel:ur,Icon:fr,useProducts:hr}=pr,mr=pr.rowName?(e,n,t)=>pr.rowName(e,n,t):void 0,gr=$n(e=>{St({type:"setUi",ui:{rightSideBarVisible:!0}}),a(e),Yo(e,{scroll:!0})},[St,Yo]),{selectNode:yr,openPartId:kr}=b({mode:Ro,setMode:Vo,onOpenPart:gr}),[Sr,vr]=Nn(null);we(null!==Sr,()=>vr(null));const br=k(ee()),xr=br.collapsed,wr=br.panelWidths,[zr,Cr]=Nn(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(xr);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
8
+ return new Set}});An(()=>{try{window.localStorage.setItem(xr,JSON.stringify([...zr]))}catch{}},[zr]);const[Br,Or]=Nn(()=>{if("undefined"==typeof window)return{...S};try{const e=window.localStorage.getItem(wr);if(!e)return{...S};const n=JSON.parse(e);return{left:v(Number(n.left)||S.left),right:v(Number(n.right)||S.right)}}catch{return{...S}}});An(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(wr,JSON.stringify(Br))}catch{}},300);return()=>clearTimeout(e)},[Br]);const Ir=$n((e,n)=>Or(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),Nr=$n(e=>Ir("left",e),[Ir]),Ar=$n(e=>Ir("right",e),[Ir]),$r=e=>zr.has(e),Tr=e=>Cr(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),Pr=On(!1),Mr=On(null);An(()=>{if(Pr.current&&!Io){const e=Mr.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??bo.current?.querySelector(`button[aria-label="${CSS.escape(Lt.add.title)}"]`))?.focus(),Mr.current=null}Pr.current=Io},[Io]),An(()=>{if(!Io||!wo)return;const e=e=>{"Escape"===e.key&&Qi()};return wo.addEventListener("keydown",e),()=>wo.removeEventListener("keydown",e)},[Io,wo]),we(Io,()=>Qi()),An(()=>{!Zt&&Io&&(No(!1),Po(null),Ao.current=!1)},[Zt]),An(()=>{if(!po)return $o.current&&St({type:"setUi",ui:{leftSideBarVisible:!1}}),void($o.current=!1);Io&&(No(!1),Po(null),$o.current=Ao.current,Ao.current=!1),Zt||($o.current=!0,St({type:"setUi",ui:{leftSideBarVisible:!0}}))},[po]),An(()=>{!Zt&&po&&($o.current=!1,uo())},[Zt]),An(()=>{if(!po||!wo)return;const e=e=>{"Escape"===e.key&&uo()};return wo.addEventListener("keydown",e),()=>wo.removeEventListener("keydown",e)},[po,wo]),we(null!==po,()=>uo());const jr=ne(),Lr=(e,n="success",t)=>{if(jr)return void(t?jr(e,"error"===n?"error":"info",t):jr(e,"error"===n?"error":"info"));const o={sound:!1,action:t?.action,onClose:t?.onClose};"error"===n?jn.error(e,{...o,duration:t?.duration??3200}):jn.success(e,{...o,duration:t?.duration??1900})},Er=On(null),[Rr,Vr]=Nn(0),[Fr,Dr]=Nn(0),Hr=te(),Wr=On(null),Ur=e=>Math.max(0,e.clientHeight-(Wr.current?.offsetHeight??0));An(()=>{const e=Er.current;if(!e)return;const n=()=>{Vr(e.clientWidth),Dr(Ur(e))};n();const t=new ResizeObserver(n);return t.observe(e),Wr.current&&t.observe(Wr.current),()=>t.disconnect()},[]),Tn(()=>{Er.current&&(Vr(Er.current.clientWidth),Dr(Ur(Er.current)))},[Br,Zt,eo]);const Jr=lo===ro?Rr>0?Rr:to[ro]:to[lo],Gr=Rr>0?Math.min(Rr/Jr,"shrink"===io?1:2):1,Kr=Jr*Gr,Xr=Rr>0&&Kr>Rr+1,Yr={width:Kr,height:Fr||"100%",flex:"none",position:"relative"},qr={width:Jr,height:Fr?Fr/Gr:"100%",maxHeight:"none",transform:1!==Gr?`scale(${Gr})`:void 0,transformOrigin:"top left"},_r=()=>St({type:"setUi",ui:{leftSideBarVisible:!Zt}}),Qr=()=>St({type:"setUi",ui:{rightSideBarVisible:!eo}}),Zr=e=>{Io&&(No(!1),Po(null),Ao.current=!1,Zt&&go===e)||po&&($o.current=!1,uo(),Zt&&go===e)||(Zt&&go===e?_r():(yo(e),Zt||St({type:"setUi",ui:{leftSideBarVisible:!0}})))},ei=()=>{A(hn,{accept:"image/*",title:Wt.mediaLibrary})},ni=()=>{Vo(Y),_t.select(null),u()},ti=()=>{Vo($t??Y),eo||St({type:"setUi",ui:{rightSideBarVisible:!0}})},oi=kt.data.content??[],ri=()=>{const e=oi.findIndex(Tt),n=oi.findIndex(Pt);return{floor:e>=0?e+1:0,cap:n>=0?n:oi.length}},ii=wt,li=rr.stripCopy,si=n=>e(n,li),di=w(),ci=Re({data:kt.data,config:ii,readOnly:Boolean(pt),clipboard:di,strip:li?e=>li(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==xn||e.slot!==wn)return{min:0,max:n-1};const{floor:t,cap:o}=ri();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&Vo(Y);const t=void 0===n||"node"===n?.kind?n:null;_t.commitDocument(e,t)}}),ai=e=>{const n=Cn(kt.data,wt,e);if(!n)return!1;const t=bn(n.place),o=n.node,r=t===pe?mi(o):Ni(o);return!!ci.remove(e)&&(Lr(Lt.deleted({name:r}),"success",{duration:8e3,action:{label:Lt.bar.undo,onClick:()=>{ci.restore(n.node,n.place)}}}),!0)},pi={...ci,remove:ai},ui=e=>ur(e,"block",wt.components[e]?.label??e),fi=$n(e=>wt.components[e]?.defaultProps??{},[wt]),hi=e=>ur(e,"section",ui(e)),mi=e=>l({type:e.type,props:e.props??{}},hi(e.type),mr),{nodeAddresses:gi,zoneItems:yi}=In(()=>{const e=/* @__PURE__ */new Map,n=/* @__PURE__ */new Map,t=(o,r,i)=>{n.set(r,o),o.forEach((n,o)=>{const l=String(n.props?.id??"");if(l&&e.set(l,{zone:r,index:o}),i>=fe)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of he(wt,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(oi,pe,0),{nodeAddresses:e,zoneItems:n}},[oi,wt]),ki=$n(e=>yi.get(e)??[],[yi]),Si=e=>{const n=gi.get(e);return n?ki(n.zone)[n.index]:void 0},vi=e=>ae(rr,wt,e),bi=e=>{if(!rr.slotsOf||e===pe)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=Si(e.slice(0,n));if(!t)return null;const o=vi(t).filter(e=>e.rung),r=o.findIndex(t=>t.slot===e.slice(n+1));return r<0?null:{node:t,slot:o[r],position:r}},xi=(()=>{if(!oe(Ro))return null;const e=`${Ro.nodeId}:${Ro.slot}`;return bi(e)?.slot.panel===Ro.kind?e:null})(),wi=On(null);An(()=>{const e=wi.current;if(wi.current=null,!xi||!oe(Ro))return;const n=Ro.nodeId;Yo(n,{scroll:e!==xi}),Cr(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[Ro]);const zi=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void(e=>{const n=gi.get(e);n&&(n.zone===pe?Ui(n.index):vl(n.zone,n.index,e,Si(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))})(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&xi!==i&&(wi.current=i),Zo(null,r),eo||St({type:"setUi",ui:{rightSideBarVisible:!0}}),Wi(o)},Ci=(e,n,t)=>{const o=`${e}:${n}`;if(Cr(n=>{if(!n.has(o)&&!n.has(e))return n;const t=new Set(n);return t.delete(o),t.delete(e),t}),!t)return;xi!==o&&(wi.current=o);Zo(null,{kind:t,nodeId:e,slot:n})},Bi=(e,n,t)=>{if(pt||!rr.moveSlot)return;const o=Si(e),r=o?vi(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:Zn,index:n},s=un(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=rr.moveSlot(e,n,s);"string"==typeof d&&Ci(e,d,i.panel)},Oi=hr(),Ii=In(()=>{const e=/* @__PURE__ */new Map;for(const n of Oi??[])e.set(n.slug,n.name);return e},[Oi]),Ni=e=>s(e,ui,pr.plainText,e=>Ii.get(e),pr.rowName),Ai=(e,n)=>{const t=wt.components[e.type]?.fields,o=n===pe||Hl(n)?"section":"block",r=n===pe&&(Tt(e)||Pt(e)||It(e.type)),i="block"===o?d(t):r?null:c(t);return pr.renamePropOf?pr.renamePropOf(e,o,i):i},$i=(e,n,t,o)=>{if(!(!pt&&Sr?.zone===e&&Sr.index===n))return;const r=(t,o)=>{vr(null),o&&((e,n,t)=>{const o=ki(e)[n];if(!o)return;const r=Ai(o,e);r&&_t.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
9
+ return Un("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":Lt.rename,onClick:e=>e.stopPropagation(),onBlur:e=>r(e.currentTarget.value,!0),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),r(e.currentTarget.value,!0)):"Escape"===e.key&&(e.preventDefault(),r("",!1))}},t)},Ti=t(re(),Ht),Pi=Ti.scope({target:kn,siteId:tt,docId:Sn}),Mi=wt,ji=(e,n)=>n===pe?hi(e):ui(e),Li=(e,n,t)=>{const o=Ti.plan(Pi,t,ji(t.type,e),Mi);o&&(o.changed&&_t.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),Lr(o.message))},Ei=z({nodesIn:ki,nodeAt:(e,n)=>ki(e)[n]??null,labelOf:(e,n)=>n===pe?hi(e):ui(e),renamePropOf:Ai,beginRename:(e,n)=>vr({zone:e,index:n}),history:{hasPast:vt.hasPast,hasFuture:vt.hasFuture,back:()=>vt.back(),forward:()=>vt.forward()},openAddSection:()=>{_t.select(null),qi(null)},openPageSettings:()=>{_t.select(null),Vo(Y)},pageSettingsLabel:Lt.pageSettings,words:{menu:Dt,styleClipboard:Ht,screen:Lt.menu},readOnly:Boolean(pt),collapseAll:()=>Cr(new Set(ki(pe).map(e=>String(e.props.id)))),onPasteRefused:e=>Lr(e?Lt.pasteRefused({name:e.label}):Lt.menu.clipboardRefused,"error"),canPasteAt:(e,n)=>Jl(e,n),menuRows:nr.menuRows,isLocked:e=>ir(e.type),duplicateBlocked:e=>lr(kt.data,e),permits:e=>ue(wt,e.type),canAddTo:cr,nodeOps:pi,isPinned:(e,n)=>n===pe&&(Tt(e)||Pt(e)),sectionBand:ri,openAddInside:(e,n)=>{e===pe?Ui(n):_t.select({zone:e,index:n}),qi(null)},locate:e=>gi.get(e)??null,rowNameOf:(e,n)=>n===pe?mi(e):Ni(e),selectAt:(e,n,t,o)=>{e===pe?Ui(n):vl(e,n,t,o??"")},slotRung:e=>{const n=bi(e);return n?.slot.panel?{label:n.slot.label,select:()=>zi(n.node,n.slot,!1)}:null},style:{held:()=>$(Pi),canCopy:e=>Ti.rows(Mi,e).some(e=>!1!==e.counted),copy:(e,n)=>Ti.copy(Pi,e,ji(e.type,n),Mi),paste:(e,n,t)=>Li(e,n,t)},keys:ht?{target:wo,selected:()=>{const e=kt.ui.itemSelector;return e?{zone:e.zone??pe,index:e.index}:null},held:()=>di.get(),readOnly:Boolean(pt),onDone:({done:e,name:n})=>{"copied"===e&&Lr(Lt.copied({name:n}))}}:void 0},xo),Ri=On({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});An(()=>{Ri.current={copy:(e,n)=>Ti.copy(Pi,e,ji(e.type,n),Mi),paste:Li,at:()=>{const e=kt.ui.itemSelector;if(!e)return null;const n=e.zone??pe,t=ki(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean(pt)}});const Vi=$n(e=>{const n=T(e);if(!n)return;const t=Ri.current,o=t.at();o&&(e.preventDefault(),"copy"===n?t.copy(o.node,o.zone):t.readOnly||t.paste(o.zone,o.index,o.node))},[]);An(()=>{if(!wo)return;const e=e=>Vi(e);return wo.addEventListener("keydown",e),()=>wo.removeEventListener("keydown",e)},[Vi,wo]),gn(xo,"keydown",Vi);const Fi=oi.map(e=>e.props.id).join("|");An(()=>{const e=xo?.document??null,n=xo?.window??null;let t=0;const o=[],r=()=>{if(!e)return void Eo(e=>e.length?[]:e);const n=oi.findIndex(Pt),t=n>=0?n:oi.length,o=n=>{const t=oi[n]?.props?.id;return null==t?null:e.querySelector(`[data-puck-component="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(mn)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=oi.length>0&&!Tt(oi[0])?0:1;e<=t;e++){const n=o(e),t=o(e-1),l=n?.getBoundingClientRect()??null,s=t?.getBoundingClientRect()??null;if(!l&&!s)continue;const d=Qn(l&&s?(s.bottom+l.top)/2:l?0===e?l.top+12:l.top:s.bottom,Math.max(0===e?0:-1/0,...r(t).map(e=>e.bottom)),Math.min(1/0,...r(n).map(e=>e.top)));d&&i.push({...d,index:e})}Eo(e=>function(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t].top!==n[t].top||e[t].index!==n[t].index||e[t].height!==n[t].height)return!1;return!0}(e,i)?e:i)},i=()=>{cancelAnimationFrame(t),t=requestAnimationFrame(r)};if(!e||!n)return void r();n.addEventListener("scroll",i,{passive:!0});const l=new ResizeObserver(i);return l.observe(e.documentElement),r(),o.push(setTimeout(r,150),setTimeout(r,450)),()=>{cancelAnimationFrame(t),o.forEach(clearTimeout),n.removeEventListener("scroll",i),l.disconnect()}},[xo,Fi,lo,Gr,Zt,eo,bt?.props.id]);const Di=xo?.document??null,Hi=xo?.window??null;An(()=>{const e=vo.current;if(!e||!Di||!Hi)return;const n=[],t=()=>{const n=Di.querySelector(`[data-puck-component="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&Hi.scrollTo({left:Hi.scrollX,top:Hi.scrollY+t,behavior:"instant"}),!0};return vo.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[Di,Hi]);const Wi=e=>{nr.holdCanvasOn?nr.holdCanvasOn(e):a(e)},Ui=e=>{Vo(Y),_t.select({index:e}),nr.sectionPressed?.(oi[e]);const n=oi[e]?.props?.id;n&&Wi(n)},Ji=e=>{const{floor:n,cap:t}=ri(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=bt&&Ro.kind!==$t?.kind?oi.findIndex(e=>e.props.id===bt.props.id):-1;return o(r>=0?r+1:t)},Gi=(e,n)=>{const{floor:t,cap:o}=ri(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(_t.reorderComponent(pe,e,i),_t.select({index:i}),{moved:!0,dest:i})},Ki=(e,n,t,o)=>{Vo(Y),_t.select(o?{index:o.index,zone:o.zone}:{index:e}),a(n),Lr(Lt.sectionAdded({name:t}))},Xi=(e,n)=>{const t=Ji(n),o=dr(e,{nodeDefaults:fi,newNodeId:ke,sectionLabel:hi,blockIsOffered:ar}),r=o?_t.insertNode(pe,t,o):_t.insertSection(e,t);return Ki(t,r,hi(e),o?((e,n,t)=>{if(e.type===t)return null;const o={at:null},r=(e,n,i)=>{const l=i.filter(n=>n===e.type).length;for(const{child:s,zone:d,index:c}of he(wt,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=cr(e.type,l,d.slice(d.lastIndexOf(":")+1)),i=r?.choices??(r?.spec?[{type:r.spec.childType,label:r.spec.childType}]:[]);null!==r&&"footer"!==r.source&&`${e.props.id}:${r.slot}`===d&&i.some(e=>e.type===t)&&(o.at={zone:d,index:c,depth:n})}r(s,n+1,[...i,e.type])}};return r({type:e.type,props:{...e.props,id:n}},1,[]),o.at?{zone:o.at.zone,index:o.at.index}:null})(o,r,e):null),t},Yi=(e,n,t)=>{const o=Ji(t),r=_t.insertNode(pe,o,n);return Ki(o,r,e),o},qi=e=>_i(pe,e),_i=(e,n)=>{Mr.current=document.activeElement??null,po&&(Ao.current=$o.current,$o.current=!1,uo()),Po(null===n?null:{zone:e,index:n}),No(!0),Zt||(Ao.current=!0,St({type:"setUi",ui:{leftSideBarVisible:!0}}))},Qi=()=>{No(!1),Po(null),Ao.current&&St({type:"setUi",ui:{leftSideBarVisible:!1}}),Ao.current=!1},Zi=(e,n,t)=>{const o="section"===e.kind?e.type:"template"===e.kind?e.template.node.type:null;if(o&&Wl(n,o)){if("section"===e.kind)_t.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;_t.insertNode(n,t,si(e.template.node))}Vo(Y),_t.select({index:t,zone:n})}},el=(e,n)=>pr.rowName?n?Tt(e)?pr.rowName(e,"section",Lt.header):Pt(e)?pr.rowName(e,"section",Lt.footer):It(e.type)?pr.rowName(e,"section",ui(e.type)):mi(e):Ni(e):n?hi(e.type):ui(e.type),nl=e=>n=>{e()},tl=()=>nr.editPinnedSource?.(),ol=(e,n,t)=>{if(pt)return null;const o=ki(e)[n];return o&&!ue(wt,o.type).delete?null:/* @__PURE__ */Un(Pe,{kind:"delete",label:Lt.deleteNamed({name:t}),onClick:()=>((e,n)=>{const t=ki(e)[n]?.props?.id;null!=t&&ai(String(t))})(e,n),children:/* @__PURE__ */Un(Fn,{size:15})})},rl=e=>pr.rowPreview?.(e)||void 0,il=e=>pr.rowMarks?.(e)??void 0,ll=(e,n,t)=>pr.rowActions?.(e,n,t)??null,sl=(e,n,t,o)=>{if(pt)return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
10
+ return Un(Pe,{kind:"eye",label:r?Lt.showNamed({name:o}):Lt.hideNamed({name:o}),onClick:()=>cl(e,n,t),children:/* @__PURE__ */Un(r?Dn:Hn,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},dl=e=>{const n=hi(oi[e]?.type??""),t=n?Lt.addSectionBefore({name:n}):Lt.addSectionHere;return vs(pe,e,()=>qi(e),t)},cl=(e,n,t)=>{_t.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},al=e=>me(wt,e),pl=e=>he(wt,e),ul=e=>rr.slotsOf?vi(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:ge(e,n.slot)})):[{slot:null,rung:null,kids:pl(e)}],fl=e=>rr.slotsOf?ul(e).flatMap(e=>e.kids):pl(e),hl=e=>Boolean(rr.slotsOf)&&vi(e).some(e=>e.rung),ml=(e,n,t)=>null===t?void 0===n?cr(e):cr(e,n):cr(e,n,t),gl=(e,n,t)=>{const o=ye(wt,e.type,n)&&(t||fl(e).length>0||hl(e));return{collapsible:o,folded:o&&$r(String(e.props.id))}},yl=(e,n,t)=>ul(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>gl(e,r,t(e.type)).collapsible?[String(e.props.id),...yl(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),kl=e=>fl(e).length>0||hl(e)||Boolean(cr(e.type)),Sl=e=>Boolean(cr(e)),vl=(e,n,t,o)=>{if(Vo(Y),cr(o)?.spec?.slider){const t=e.split(":")[0];p(t,n),_t.select({index:n,zone:e}),a(t)}else _t.select({index:n,zone:e}),Wi(t)},bl=(e,n,t,o,r)=>{const i=`${e}:${n}`;_t.insertComponent(i,t,o),cr(r)?.spec?.slider?requestAnimationFrame(()=>{p(e,o),_t.select({index:o,zone:i})}):_t.select({index:o,zone:i})},xl=(e,n,t)=>{_t.insertComponent(e,n,t),Vo(Y),_t.select({index:t,zone:e})},wl=On(/* @__PURE__ */new Set);An(()=>{oi.forEach(e=>{const n=cr(e.type)?.spec;if(!n)return;const t=e.props.id;if(wl.current.has(t))return;wl.current.add(t);if((Array.isArray(e.props[n.slot])?e.props[n.slot]:[]).length>0)return;if(n.skipSeed?.(e.props))return;const o=`${t}:${n.slot}`,r=n.legacy?.(e.props)??[];(r.length?r:n.seeds(fi)).forEach((e,t)=>Xt.seedChild(o,t,n.childType,e))})},[oi,Xt,fi]);const zl=On(/* @__PURE__ */new Set);An(()=>{oi.forEach((e,t)=>{const o=e.props.id;if(zl.current.has(o))return;const r=n(e,al(e.type));zl.current.add(o),r&&Xt.replaceComponent(pe,t,{...e,props:r})})},[oi,Xt]),ie(Xt,wt);const Cl=oi.findIndex(Pt),Bl=Cl>=0?oi[Cl]:null,Ol=Mt?oi.findIndex(Tt):-1,Il=Ol>=0?oi[Ol]:null,Nl=zt.groupTab,Al=In(()=>Nl?e=>It(e.type):void 0,[Nl]),$l=Boolean(zt.groupBadge),Tl=zt.groupBadge?/* @__PURE__ */Un("span",{className:"es-tree-group-badge",children:/* @__PURE__ */Un(Mn,{tone:"info",size:"xs",children:zt.groupBadge})}):void 0,Pl=oi.find(e=>e.type===Bt)??null,Ml=oi.find(e=>e.type===Ot)??null,jl=Cl>=0?Cl:oi.length,Ll=[];oi.forEach(e=>{Pt(e)||(kl(e)&&Ll.push(String(e.props.id)),Ll.push(...yl(e,1,Sl)))}),Bl&&(Ll.push(String(Bl.props.id)),Ll.push(...yl(Bl,1,Sl)));const El=Ll.length>0&&Ll.every(e=>zr.has(e)),Rl=e=>{const n=pr.blockRowName(e,ui);return pr.rowName?pr.rowName(e,"block",n):n},Vl=(e,n,t,o)=>{const r=ki(e)[t];if(!r)return;const i={...zn(e),index:t},l={...zn(n),index:Math.min(Math.max(o,0),ki(n).length)},s=un(i,l);if(e!==n||s!==t)try{ci.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof Bn))throw e}},Fl=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of pl(e))n.add(r),t(o)};for(const t of al(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},Dl=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=gi.get(n);if(!e)return null;if(e.zone===pe)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},Hl=e=>{const n=e.slice(0,e.indexOf(":")),t=oi.find(e=>It(e.type)&&String(e.props.id)===n);return t&&Nt(n)===e?t:null},Wl=(e,n)=>{const t=Hl(e);return!t||(!zt.groupAccepts||zt.groupAccepts(t.type,n,ki(e).length))},Ul=(e,n,t)=>{if(e.rung){const t=Si(e.rung.nodeId),o=t?vi(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===Zn&&n.index>=0&&n.index<=o}if(n.slot===Zn)return!1;if(e.add)return Kl(e.add,n);const o=bn(n);if(It(e.type))return!1;const r=Hl(o),i=Hl(e.zone);if(r||i)return!(!r||!i)&&(!(r!==i&&!Wl(o,e.type))&&(n.index>=0&&n.index<=ki(o).length));if(e.zone===pe||o===pe){if(e.zone!==o)return!1;const{floor:t,cap:r}=ri();return n.index>=t&&n.index<=r}if(n.index<0||n.index>ki(o).length)return!1;if(e.zone===o)return!0;const l=Bl&&!zt.lastIsOpen?String(Bl.props.id):null;return(!l||Dl(e.zone)!==l&&Dl(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??ki(e)[t];if(!r)return!1;const i=n.split(":")[0],l=gi.get(i),s=l?ki(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&Fl(r).has(n))return!1;const d=cr(s.type,sr(kt?.data,s.type,i),n.slice(n.lastIndexOf(":")+1));return!!d&&(!!(d.choices?d.choices.some(e=>e.type===r.type):d.spec?.childType===r.type)&&!d.spec?.addBlocked?.(ki(n),r))})(e.zone,o,e.index,t)},Jl=(e,n)=>{const t=bn(e.from),o=e.node;return t===bn(n)?Wl(t,o.type):Ul({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},Gl=e=>{const n=e.slice(0,e.indexOf(":")),t=gi.get(n),o=t?ki(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=cr(o.type,sr(kt?.data,o.type,n),e.slice(e.lastIndexOf(":")+1));if(!r||`${n}:${r.slot}`!==e)return null;if("footer"===r.source)return null;const i=r.choices??(r.spec?[{type:r.spec.childType,label:ui(r.spec.childType)}]:[]),l=bi(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:el(o,t.zone===pe)}},Kl=(e,n)=>{const t=bn(n);if("block"!==e.kind){if(Hl(t)){const o="section"===e.kind?e.type:e.template.node.type;return Wl(t,o)&&n.index>=0&&n.index<=ki(t).length}if(t!==pe)return!1;const{floor:o,cap:r}=ri();return n.index>=o&&n.index<=r}if(t===pe)return!1;const o=Gl(t);return!(!o||!o.choices.some(n=>n.type===e.type))&&!o.target.spec?.addBlocked?.(ki(t))},Xl=(e,n)=>{e.rung?Bi(e.rung.nodeId,e.index,n.index):e.add?((e,n)=>{if("block"!==e.kind&&Hl(bn(n)))return void Zi(e,bn(n),n.index);if("section"===e.kind)return void Xi(e.type,n.index);if("template"===e.kind)return void Yi(e.template.name,si(e.template.node),n.index);const t=bn(n),o=Gl(t);o&&(o.target.spec?bl(o.parentId,o.target.slot,e.type,n.index,o.parent.type):xl(t,e.type,n.index))})(e.add,n):e.zone===pe?Gi(e.index,n.index):Vl(e.zone,bn(n),e.index,n.index)},[Yl]=Nn(()=>an()),ql=pn({keyOf:e=>e.id,readOnly:Boolean(pt),session:Yl,canDrop:Ul,onDrop:Xl,onStep:(e,n)=>{e.rung?Bi(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===pe?((e,n)=>{const t=hi(oi[e]?.type??""),o=Gi(e,n<0?e-1:e+2);if(!o.moved)return void Lr(n<0?Lt.sectionFirst({name:t}):Lt.sectionLast({name:t}));const{floor:r,cap:i}=ri();Lr(Lt.sectionMoved({name:t,n:o.dest-r+1,total:i-r}))})(e.index,n):Vl(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),_l=$n(e=>{const{floor:n,cap:t}=ri(),o=[];for(const r of e.nodes){const e=bn(r.place),i=ki(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(Tt(i)||Pt(i)||ir(i.type))continue;if(It(i.type))continue;const l=Boolean(Hl(e)),s=e===pe||l;e===pe&&t-n<2||o.push({key:r.id,item:{id:r.id,zone:e,index:r.place.index,type:i.type},box:r.box,label:s?hi(i.type):Ni(i),from:r.place})}const r=e.zones.flatMap(e=>{const n=bn(e.list);return n===pe&&0===e.children.length?[{...e,addLabel:Lt.addSection,addAlways:!0}]:e.children.length>0||Boolean(Gl(n)?.choices.length)||Boolean(Hl(n))?[e]:[]}),i=r.flatMap(e=>{const n=bn(e.list);return n===pe||Hl(n)||!Gl(n)?.choices.length?[]:ln(e,Lt.addBlockHere)});return{sources:o,zones:r,seams:i}},[kt.data]),Ql=null==bt?.props.id?null:String(bt.props.id),Zl=$n(e=>{const n=wt,t=e=>!e.item.rung&&null!==Cn(kt.data,n,e.item.id),o=e[e.length-1];if(!t(o))return o;const r=n=>e.find(e=>t(e)&&e.item.id===n),i=r(Ql);return i||(r(Ve(kt.data,n,o.item.id,Ql,Al))??o)},[kt.data,wt,Ql,Al]),[es,ns]=Nn(null);gn(xo,"mouseover",e=>{if(!Nl)return;const n=yn(e.target),t=n?Xn(kt.data,wt,n):null;t!==es&&ns(t)}),gn(xo,"mouseout",e=>{Nl&&!e.relatedTarget&&ns(null)});const ts=e=>Tt(e)||Pt(e)||It(e.type),os=[];if(Nl){const e=Ql?Xn(kt.data,wt,Ql):null;for(const n of/* @__PURE__ */new Set([e,es])){const e=n?oi.find(e=>String(e.props.id)===n):void 0;if(!e||!ts(e))continue;const t=Nl(e);t&&os.push({id:String(e.props.id),label:t,below:Tt(e)||e.type===Bt})}}const rs=E(),is=On(null);An(()=>{const e=zt.changeNotice;if(!e)return;const n=JSON.stringify(oi.filter(ts)),t=is.current;if(is.current={doc:Sn,bands:n,index:vt.index},!t||t.doc!==Sn||t.bands===n)return;vt.hasPast&&vt.index>=t.index&&!Kn.has(rs)&&(Kn.add(rs),Lr(e,"success",{action:{label:Lt.bar.undo,onClick:()=>vt.back()},duration:8e3}))},[oi]);const ls=e=>{Vo(Y),_t.select(e.zone===pe?{index:e.index}:{index:e.index,zone:e.zone})},ss=le(),ds=()=>({data:kt.data,device:lo,ops:_t,inspector:er}),cs=ss?.model,as=In(()=>cs?e=>cs(e,_l(e),ds()):_l,[cs,_l,lo]),ps=ss?.measure,us=ps?(e,n)=>ps(e,n,ds()):void 0,fs=ss?.canDrop,hs=fs?(e,n)=>fs(e,n,Ul,ds()):Ul,ms=ss?.drop,gs=ms?(e,n)=>ms(e,n,Xl,ds()):Xl,ys=ss?.pick,ks=ys?e=>ys(e,ls,ds()):ls,Ss=e=>{const n=bn(e),t=bi(n);t&&zi(t.node,t.slot,!1),_i(n,e.index)},vs=(e,n,t,o)=>/* @__PURE__ */Un(Me,{...pt?{}:ql.seam({place:{...zn(e),index:n}}),onAdd:pt?void 0:t,label:o},`seam:${e}:${n}`),bs={rowClick:nl,isCollapsed:$r,toggleCollapse:Tr},xs=e=>{const n=String(e.props.id),t=oi.findIndex(e=>String(e.props.id)===n),o=Nt(n),r=ki(o),i=$r(n),l=ui(e.type),s=pr.rowName?pr.rowName(e,"section",l):l,d=e=>vs(o,e,()=>_i(o,e),Lt.addSectionHere);/* @__PURE__ */
11
+ return Jn(Gn,{children:[
12
+ /* @__PURE__ */Un(Ne,{words:Et,icon:/* @__PURE__ */Un(fr,{type:e.type,size:13}),name:s,preview:rl(e),marks:il(e),onSelect:()=>Ui(t),nameSlot:$i(pe,t,n,s),selected:Jo===n,badge:Tl,actions:ll(e,pe,t)??void 0,rowProps:{"data-node-id":n,onClick:nl(()=>Ui(t))},fold:{open:!i,label:"section",onToggle:()=>Tr(n)}}),!i&&/* @__PURE__ */Jn(Ae,{children:[r.map((n,t)=>{const r=String(n.props.id),i=mi(n),l=kl(n),s=l&&$r(r),c=()=>vl(o,t,r,e.type),{rowProps:a,...p}=ql.row({item:{id:r,zone:o,index:t,type:n.type},place:{...zn(o),index:t}},{"data-node-id":r,onClick:nl(c)});/* @__PURE__ */
13
+ return Jn(Pn,{children:[d(t),
14
+ /* @__PURE__ */Un(Ne,{words:Et,icon:/* @__PURE__ */Un(fr,{type:n.type,size:13}),name:i,preview:rl(n),marks:il(n),onSelect:c,nameSlot:$i(o,t,r,i),selected:Jo===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>Tr(r)}:void 0,actions:/* @__PURE__ */Jn(Gn,{children:[ol(o,t,i),ll(n,o,t),sl(o,t,n,i)]}),rowProps:a}),l&&!s&&/* @__PURE__ */Un(Ae,{children:Cs(n,2)})]},r)}),d(r.length)]})]})},ws=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=ql.dragging,d=!$r(l)&&s?.rung?.nodeId!==i,c={...zn(l),index:0},a=s&&!s.rung&&Ul(s,c)?c:void 0,p=()=>zi(e,n,!0),{rowProps:u,...f}=ql.row({item:{id:`rung:${l}`,zone:`${i}:${Zn}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:Zn,index:t},into:a,canDrag:Boolean(rr.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:nl(p)}),h=pt?null:rr.slotActions?.(e,n.slot);/* @__PURE__ */
15
+ return Jn(Pn,{children:[n.heading,
16
+ /* @__PURE__ */Un(Ne,{words:Et,icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:xi===l,...f,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>Tr(l)},actions:h&&h.length>0?/* @__PURE__ */Un(Gn,{children:h.map((t,o)=>/* @__PURE__ */Un(Pe,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if(pt||t.disabled)return;const o=String(e.props.id),r=e=>{"string"==typeof e&&Ci(o,e,n.panel)},i=t.run();i&&"function"==typeof i.then?i.then(r):r(i)})(e,n,t),children:"delete"===t.kind?/* @__PURE__ */Un(Fn,{size:15}):/* @__PURE__ */Un(Wn,{size:15})},`${o}:${t.kind}`))}):void 0,rowProps:u}),d&&/* @__PURE__ */Un(Ae,{children:r})]},l)},zs=(e,n)=>{const t=ul(e),o=t.filter(e=>e.rung).length;let r=0;/* @__PURE__ */
17
+ return Un(Gn,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=ml(e.type,void 0,t.slot),d=s?`${e.props.id}:${s.slot}`:null,c=null===t.slot?null:`${e.props.id}:${t.slot}`,a=null!==c&&Boolean(Gl(c)?.choices.length),p=(e,n)=>a?vs(e,n,()=>_i(e,n),Lt.addBlockHere):vs(e,n),u=/* @__PURE__ */Jn(Gn,{children:[i.map(({child:n,zone:t,index:o})=>{const r=Jo===String(n.props.id),{collapsible:i,folded:s}=gl(n,l,Sl(n.type)),d=String(n.props.id),c=Rl(n),a=()=>vl(t,o,d,e.type),{rowProps:u,...f}=ql.row({item:{id:d,zone:t,index:o,type:n.type},place:{...zn(t),index:o}},{"data-node-id":d,onClick:nl(a)});/* @__PURE__ */
18
+ return Jn(Pn,{children:[0===o&&p(t,0),
19
+ /* @__PURE__ */Un(Ne,{words:Et,icon:/* @__PURE__ */Un(fr,{type:n.type,size:13}),name:c,preview:rl(n),marks:il(n),onSelect:a,nameSlot:$i(t,o,d,c),selected:r,hidden:Boolean(n.props._hidden),...f,fold:i?{open:!s,label:"group",onToggle:()=>Tr(d)}:void 0,actions:/* @__PURE__ */Jn(Gn,{children:[ol(t,o,c),ll(n,t,o),sl(t,o,n,c)]}),rowProps:u}),i&&!s&&/* @__PURE__ */Un(Ae,{children:zs(n,l+1)}),p(t,o+1)]},String(n.props.id??`${t}-${o}`))}),null===c?d&&!i.some(e=>e.zone===d)?p(d,0):null:0!==i.length||!t.rung&&d!==c?null:p(c,0)]});return t.rung?ws(e,t.rung,r++,o,u):/* @__PURE__ */Un(Pn,{children:u},t.slot??"")})})},Cs=(e,n)=>{const t=sr(kt?.data,e.type,String(e.props.id)),o=ul(e),r=o.filter(e=>e.rung).length;let i=0;/* @__PURE__ */
20
+ return Un(Gn,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=ml(e.type,t,o.slot),c=d?.spec??null,a=c&&Array.isArray(e.props[c.slot])?e.props[c.slot]:[],p=d&&d.choices?{slot:d.slot,choices:d.choices}:null,u=String(e.props.id),f=c&&!c.fixed?`${u}:${c.slot}`:null,h=p?`${u}:${p.slot}`:null,m=(n,t)=>{const o=n===f&&c&&!c.addBlocked?.(a)?()=>bl(e.props.id,c.slot,c.childType,t,e.type):n===h?()=>_i(n,t):void 0;return vs(n,t,o,n===f&&c?c.addLabel:Lt.addBlockHere)},g=null===o.slot?null:`${u}:${o.slot}`,y=Boolean(c&&!c.fixed&&(null===g||g===f)),k=/* @__PURE__ */Jn(Gn,{children:[l.map(({child:n,zone:t,index:o})=>{const r=Jo===String(n.props.id),i=Ni(n),l=String(n.props.id),{collapsible:d,folded:c}=gl(n,s,Sl(n.type)),a=al(n.type),p=1===a.length?`${l}:${a[0]}`:null,u=p?{...zn(p),index:ki(p).length}:void 0,f=ql.dragging,h=u&&f&&Ul(f,u)?u:void 0,g=()=>vl(t,o,l,e.type),{rowProps:y,...k}=ql.row({item:{id:l,zone:t,index:o,type:n.type},place:{...zn(t),index:o},into:h,canDrag:!ir(n.type)},{"data-node-id":l,onClick:nl(g)});/* @__PURE__ */
21
+ return Jn(Pn,{children:[0===o&&m(t,0),
22
+ /* @__PURE__ */Un(Ne,{words:Et,icon:/* @__PURE__ */Un(fr,{type:n.type,size:13}),name:i,preview:rl(n),marks:il(n),onSelect:g,nameSlot:$i(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...k,fold:d?{open:!c,label:"group",onToggle:()=>Tr(l)}:void 0,actions:ir(n.type)?ll(n,t,o)??void 0:/* @__PURE__ */Jn(Gn,{children:[ol(t,o,i),ll(n,t,o),sl(t,o,n,i)]}),rowProps:y}),d&&!c&&/* @__PURE__ */Un(Ae,{children:Cs(n,s+1)}),m(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&c&&
23
+ /* @__PURE__ */Un(P,{small:!0,label:c.addLabel,blocked:c.addBlocked?.(a)??null,onAdd:()=>bl(e.props.id,c.slot,c.childType,a.length,e.type)}),null===g?h&&!l.some(e=>e.zone===h)?m(h,0):null:0!==l.length||(o.rung?y:g!==h)?null:m(g,0)]});return o.rung?ws(e,o.rung,i++,r,k):/* @__PURE__ */Un(Pn,{children:k},o.slot??"")})})},Bs=(()=>{if(!bt||!Fo)return null;const e=String(bt.type),n=String(bt.props.id),t=cr(e,sr(kt?.data,e,n));if(!t||"footer"===t.source)return null;const o=oi.some(e=>String(e.props?.id)===n),r=Array.isArray(bt.props[t.slot])?bt.props[t.slot]:[];if(t.spec?.addBlocked?.(r))return null;const i=t.choices??(t.spec?[{type:t.spec.childType,label:ui(t.spec.childType)}]:[]);return 0===i.length?null:{parentName:el(bt,o),choices:i,onPick:o=>{t.spec?bl(n,t.slot,o,r.length,e):xl(`${n}:${t.slot}`,o,r.length)}}})(),Os=Wo&&Wo.zone!==pe&&!Hl(Wo.zone)?Wo.zone:null,Is=!0===Mo.blocksFirst,Ns=Os?Gl(Os):Is&&Wo?null:Bs,As=Wo&&Hl(Wo.zone)?Wo.zone:null,$s=As&&zt.groupAccepts?e=>Wl(As,e):void 0,Ts=Boolean(To&&Os)||Is&&Boolean(Ns&&Ns.choices.length>0),Ps=Io||null!==po,Ms=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:Zt&&!Ps&&or===e.id,onSelect:()=>Zr(e.id)}:e,js=[{id:"add",label:Lt.add.title,icon:/* @__PURE__ */Un("span",{className:"sf-rail-plus","aria-hidden":"true",children:"+"}),active:Io,onSelect:()=>Io?Qi():qi(null)},...(nr.railLead??[]).map(Ms),{id:"sections",label:Lt.layers,icon:/* @__PURE__ */Un(Fe,{}),active:Zt&&!Ps&&"sections"===or,onSelect:()=>Zr("sections")},...(nr.railTrail??[]).map(Ms)];ao?js.push({id:"media",label:Lt.railMedia,icon:/* @__PURE__ */Un(De,{}),active:Zt&&!Io&&(null!==po||"media"===or),onSelect:()=>Zr("media")}):mt&&js.push({id:"media",label:Lt.railMedia,icon:/* @__PURE__ */Un(De,{}),onSelect:ei});const Ls=[...nr.railLead??[],...nr.railTrail??[]].find(e=>"panel"in e&&e.id===or),Es=Boolean(jt?.foldable)&&!tr,Rs=jt?.label??(gt?Lt.pageSections:Lt.templateSections),Vs=Es&&$r(et),Fs=/* @__PURE__ */Jn(Gn,{children:[oi.map((e,n)=>{if(Tt(e)||Pt(e)||It(e.type))return null;const t=Jo===String(e.props.id),o=Boolean(e.props._hidden);pl(e);const r=String(e.props.id),i=nr.hasOwnRows?.(e)??!1,l=kl(e)||i,s=l&&$r(r),d=al(e.type),c=1===d.length?`${r}:${d[0]}`:null,a=c?{...zn(c),index:ki(c).length}:void 0,p=ql.dragging,u=a&&p&&Ul(p,a)?a:void 0,{rowProps:f,...h}=ql.row({item:{id:r,zone:pe,index:n,type:e.type},place:{...zn(pe),index:n},into:u},{"data-node-id":r,onClick:nl(()=>Ui(n))});/* @__PURE__ */
24
+ return Jn(Pn,{children:[n>0&&dl(n),
25
+ /* @__PURE__ */Un(Ne,{words:Et,icon:/* @__PURE__ */Un(fr,{type:e.type,size:13}),name:mi(e),preview:rl(e),marks:il(e),onSelect:()=>Ui(n),nameSlot:$i(pe,n,r,mi(e)),selected:t,hidden:o,...h,fold:l?{open:!s,label:"section",onToggle:()=>Tr(r)}:void 0,actions:/* @__PURE__ */Jn(Gn,{children:[ol(pe,n,mi(e)),ll(e,pe,n),sl(pe,n,e,mi(e))]}),rowProps:f}),kl(e)&&!s&&/* @__PURE__ */Jn(Ae,{children:[Cs(e,1),nr.partRows?.(e,bs)]}),i&&!s&&/* @__PURE__ */Un(Ae,{children:nr.ownRows?.(e,n,bs)})]},String(e.props.id??n))}),!tr&&jl>0&&dl(jl),jt?.addAtEnd&&!tr&&!pt&&/* @__PURE__ */Un(P,{small:!0,label:Lt.addSection,blocked:null,onAdd:()=>qi(jl)})]}),Ds=(e,n,t)=>{const o=String(e.props.id),r=fl(e).length>0||hl(e)||Boolean(cr(e.type)),i=r&&$r(o),l="header"===t?Lt.header:Lt.footer,s=pr.rowName?pr.rowName(e,"section",l):l;/* @__PURE__ */
26
+ return Jn(Gn,{children:[
27
+ /* @__PURE__ */Un(Ne,{words:Et,icon:/* @__PURE__ */Un(fr,{type:t,size:13}),name:s,preview:rl(e),marks:il(e),badge:Tl,onSelect:()=>Ui(n),nameSlot:$i(pe,n,o,s),selected:Jo===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>Tr(o)}:void 0,actions:ll(e,pe,n)??void 0,rowProps:{"data-node-id":o,onClick:nl(()=>Ui(n))}}),r&&!i&&/* @__PURE__ */Un(Ae,{children:zs(e,1)})]})};return(nr.wrap??(e=>e))(
28
+ /* @__PURE__ */Un(se,{target:xo,children:/* @__PURE__ */Jn("div",{ref:bo,className:"sf-editor es-editor",style:Qe(Br),onContextMenu:Ei.onEditorContextMenu,...g(hn),children:[
29
+ /* @__PURE__ */Jn(He,{children:[
30
+ /* @__PURE__ */Un(We,{items:js,ariaLabel:Lt.bar.views}),
31
+ /* @__PURE__ */Jn(Ue,{children:[
32
+ /* @__PURE__ */Un(Je,{label:Lt.bar.undo,disabled:Boolean(pt)||!vt.hasPast,onClick:()=>vt.back(),children:/* @__PURE__ */Un(En,{})}),
33
+ /* @__PURE__ */Un(Je,{label:Lt.bar.redo,disabled:Boolean(pt)||!vt.hasFuture,onClick:()=>vt.forward(),children:/* @__PURE__ */Un(Rn,{})}),
34
+ /* @__PURE__ */Un(Ge,{}),
35
+ /* @__PURE__ */Un(Ke,{devices:no,value:lo,onChange:so}),
36
+ /* @__PURE__ */Un(Je,{label:Lt.bar.refresh,tip:Lt.bar.refreshTip,onClick:()=>{vo.current=(()=>{const e=xo?.document;if(!e)return null;const n=oi.findIndex(Pt),t=n>=0?n:oi.length;let o=null;for(let n=0;n<t;n++){const t=oi[n]?.props?.id;if(null==t)continue;const r=e.querySelector(`[data-puck-component="${CSS.escape(String(t))}"]`);if(!r)continue;const i=r.getBoundingClientRect().top;i<=4&&(null===o||i>o.offset)&&(o={id:String(t),offset:i})}if(!o){const e=bt?.props?.id??oi[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),So(e=>e+1)},children:/* @__PURE__ */Un(Vn,{})})]}),
37
+ /* @__PURE__ */Jn(Ue,{kind:"right",style:{minWidth:300},children:[
38
+ /* @__PURE__ */Un(B,{input:Bo,words:Lt.saveStatus}),nr.barLead?.(),nr.barTrail?.(),nr.mainAction||!nr.barMain?/* @__PURE__ */Un(O,{input:Bo,action:nr.mainAction??{label:Lt.done,onPress:()=>{ot(kt.data)}},readOnly:Boolean(pt),saveSwitch:ft,onToggleAutoSave:st,onSaveNow:Oo,bar:Lt.bar,words:Lt.saveStatus}):nr.barMain()]})]}),
39
+ /* @__PURE__ */Un(C,{}),
40
+ /* @__PURE__ */Jn("div",{className:"sf-body",children:[Zt?/* @__PURE__ */Jn(Gn,{children:[
41
+ /* @__PURE__ */Un("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":Lt.leftPanel,children:Io?/* @__PURE__ */Un(M,{blocks:Ns,blocksOnly:Ts,sectionAccepts:$s,at:To?{label:(e=>{const n=Hl(e.zone);if(n)return Lt.add.addingTo({name:pr.rowName?el(n,!0):ui(n.type)});if(e.zone===pe){const n=oi[e.index];return n&&!Pt(n)?Lt.add.addingBefore({name:el(n,!0)}):Lt.add.addingAtEnd}const t=Gl(e.zone);return t?Lt.add.addingTo({name:t.parentName}):Lt.add.addingHere})(To),onClear:()=>Po(null)}:void 0,onAdd:e=>{const n=Wo,t=(e,n)=>{To&&Po({zone:e,index:n})};if(n&&"block"!==e.kind&&Hl(n.zone))return Zi(e,n.zone,n.index),void t(n.zone,n.index+1);if("section"===e.kind)return(e=>{if(null===Uo)return void Xi(e);const n=Xi(e,Uo);To&&jo(n+1)})(e.type);if("template"===e.kind)return((e,n)=>{if(null===Uo)return void Yi(e,n);const t=Yi(e,n,Uo);To&&jo(t+1)})(e.template.name,si(e.template.node));if(n&&n.zone!==pe){const o=Gl(n.zone);if(!o)return;return o.target.spec?bl(o.parentId,o.target.slot,e.type,n.index,o.parent.type):xl(n.zone,e.type,n.index),void t(n.zone,n.index+1)}Bs?.onPick(e.type)},itemFor:e=>({id:`new:${e.kind}:${"template"===e.kind?e.template.id:e.type}`,zone:"",index:-1,type:"template"===e.kind?e.template.node.type:e.type,add:e}),session:Yl,siteWide:nr.addPanelRow?.(Qi),onClose:Qi,onHide:_r,readOnly:Boolean(pt)}):po&&co?
42
+ /* @__PURE__ */Un(R,{panel:co,pick:po,onHide:_r}):Ls?Ls.panel({onHide:_r,notify:Lr}):"media"===or&&co?/* @__PURE__ */Un(R,{panel:co,pick:null,onHide:_r}):/* @__PURE__ */Jn(Gn,{children:[
43
+ /* @__PURE__ */Un(j,{icon:/* @__PURE__ */Un(Fe,{}),title:Lt.layers,context:Ut,actions:
44
+ /* @__PURE__ */Un(Xe,{label:El?Lt.expandAll:Lt.collapseAll,title:0===Ll.length?Lt.nothingToFold:void 0,disabled:0===Ll.length,onClick:()=>Cr(e=>{const n=new Set(Ll);return El?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...Ll])}),children:/* @__PURE__ */Un(qn,{expand:El})}),onHide:_r}),
45
+ /* @__PURE__ */Jn($e,{className:"sf-tree sf-scroll",words:Et,children:[
46
+ /* @__PURE__ */Un(Ne,{words:Et,icon:/* @__PURE__ */Un(fr,{type:"page",size:13}),name:Lt.pageSettings,onSelect:ni,selected:!bt&&Fo,rowProps:{onClick:nl(ni)}}),Pl&&/* @__PURE__ */Jn(Gn,{children:[!$l&&/* @__PURE__ */Un(Te,{children:Lt.header}),xs(Pl)]}),!tr&&yt&&!($l&&Pl)&&/* @__PURE__ */Jn(Gn,{children:[!$l&&/* @__PURE__ */Un(Te,{children:Lt.header}),!Mt&&/* @__PURE__ */Un(Ne,{words:Et,icon:/* @__PURE__ */Un(fr,{type:"header",size:13}),name:Lt.header,badge:Tl,onSelect:ti,selected:Ro.kind===$t?.kind,rowProps:{onClick:nl(ti)}})]}),!tr&&Il&&!($l&&Pl)&&Ds(Il,Ol,"header"),!tr&&!Es&&/* @__PURE__ */Un(Te,{children:Rs}),Es?/* @__PURE__ */Jn(Gn,{children:[
47
+ /* @__PURE__ */Un(Ne,{words:Et,icon:null,name:Rs,fold:{open:!Vs,label:Rs,onToggle:()=>Tr(et)}}),!Vs&&/* @__PURE__ */Un(Ae,{children:Fs})]}):Fs,yt&&!$l&&/* @__PURE__ */Un(Te,{children:Lt.footer}),Bl&&!($l&&Ml)&&Ds(Bl,Cl,"footer"),!tr&&!Bl&&yt&&!$l&&/* @__PURE__ */Un(Ne,{words:Et,icon:/* @__PURE__ */Un(fr,{type:"footer",size:13}),name:Lt.footer,onSelect:tl,rowProps:{onClick:nl(tl),title:Lt.editFooter}}),Ml&&xs(Ml),nr.treeFoot?.()]})]})}),
48
+ /* @__PURE__ */Un(Ye,{side:"left",width:Br.left,min:_e,max:qe,defaultWidth:S.left,label:Lt.resizeLeftPanel,onResize:Nr})]}):/* @__PURE__ */Un(L,{side:"left",onShow:_r}),
49
+ /* @__PURE__ */Jn("div",{ref:Er,className:"sf-center sf-scroll","data-sf-canvas-head":Hr?"":void 0,style:{overflowX:Xr?"auto":"hidden",overflowY:"hidden"},children:[Hr&&/* @__PURE__ */Un("div",{ref:Wr,className:"sf-canvas-head",children:/* @__PURE__ */Un(Hr,{device:lo})}),
50
+ /* @__PURE__ */Jn("div",{className:"sf-frame-scaler",style:Yr,children:[
51
+ /* @__PURE__ */Un("div",{className:"sf-frame "+(lo===ro?"":`sf-frame--${lo}`),style:qr,children:/* @__PURE__ */Jn("div",{className:"sf-preview-host",children:[
52
+ /* @__PURE__ */Un(Ie.Provider,{value:Al,children:/* @__PURE__ */Un(Jt,{},ko)}),
53
+ /* @__PURE__ */Un(sn,{canvas:xo,session:Yl,model:as,measure:us,canDrop:hs,onDrop:gs,choose:Zl,onPick:ks,onZoneAdd:Ss,onSeamAdd:Ss,zoneAddLabel:Lt.canvasAddBlock,words:Rt.canvas,readOnly:Boolean(pt),revision:kt.data}),Lo.length>0&&/* @__PURE__ */Un("div",{className:"sf-preview-gaps",children:Lo.map(e=>
54
+ /* @__PURE__ */Un(dn,{index:e.index,label:Lt.addSectionHere,onInsert:()=>qi(e.index),className:void 0===e.height?"sf-preview-gap":"sf-preview-gap sf-preview-gap--tight",style:void 0===e.height?{top:e.top}:{top:e.top,height:e.height}},e.index))})]})}),Nl?/* @__PURE__ */Un(Yn,{canvas:xo,tabs:os,onSelect:e=>{const n=oi.findIndex(n=>String(n.props.id)===e);n>=0&&Ui(n)}}):null]})]}),eo?/* @__PURE__ */Jn(Gn,{children:[
55
+ /* @__PURE__ */Un(y,{value:{selectChild:vl,addChild:bl,childRowName:Ni,blockRowName:Rl},children:/* @__PURE__ */Un(Gt,{mode:Ro,onOpenWebsiteSettings:nr.openSettings??(()=>{}),onOpenSiteStyles:nr.openStyles,onSelectNode:yr,onNotify:Lr,onHidePanel:Qr,nodeActions:bt?ue(wt,bt.type):nt})}),
56
+ /* @__PURE__ */Un(Ye,{side:"right",width:Br.right,min:_e,max:qe,defaultWidth:S.right,label:Lt.resizeSettingsPanel,onResize:Ar})]}):
57
+ /* @__PURE__ */Un(L,{side:"right",onShow:Qr})]}),Ei.menu]})}))}export{tt as ScreenChrome};
@@ -1,5 +1,5 @@
1
- import{slotFieldsOf as n}from"./chunk-PLVEGYK6.js";import{usePickFollowsSelection as e}from"./chunk-R6WTQWAC.js";import{EaselCanvas as t,useSelectedFields as r}from"./chunk-K5744MTM.js";import{Inspector as i}from"./chunk-PEDDDWSG.js";import{createContext as o,useContext as u}from"react";import{DesktopIcon as l}from"efficient-shell/icons/efficient";import{jsx as s}from"react/jsx-runtime";var c={kind:"puck"};function f(n,e){const t=n,r=e,i=Object.keys(t);return i.length===Object.keys(r).length&&i.every(n=>Object.is(t[n],r[n]))}function a(n){const e=n;return"string"==typeof e.nodeId&&"string"==typeof e.slot}function d(e,t,r){const i=e.slotsOf?.(r);return i||n(t,r.type).map(n=>({slot:n,label:n,rung:!1}))}function p(n,e){return n.isFirst?n.isFirst(e):e.type===n.first}function m(n,e){return n.isLast?n.isLast(e):e.type===n.last}var k={},h={},v=()=>k,g=()=>"",y=()=>null,b=()=>{},O={isLockedBlock:()=>!1,duplicateBlocked:()=>null,nestDepth:()=>0,newSectionNode:()=>null,canAddTo:()=>null,blockIsOffered:()=>!0},j={labelAtLevel:(n,e,t)=>t,descriptions:{},categoryLabel:()=>{},firstSection:null,blockRowName:(n,e)=>e(n.type),plainText:n=>n,Icon:()=>null,Thumbnail:()=>null,useProducts:()=>null},w={options:[{id:"desktop",label:"Desktop",icon:/* @__PURE__ */s(l,{})}],initial:"desktop",fluid:"desktop",widths:{desktop:2e3}},D={read:()=>"sections",write:()=>{},forSelection:(n,e)=>n?"sections":e},L={first:null,last:null,firstGroup:null,lastGroup:null,isSectionGroup:()=>!1,sectionGroupZone:()=>"",panelOf:()=>null};function S(){/* @__PURE__ */
1
+ import{slotFieldsOf as n}from"./chunk-PLVEGYK6.js";import{usePickFollowsSelection as e}from"./chunk-R6WTQWAC.js";import{EaselCanvas as t,useSelectedFields as r}from"./chunk-K5744MTM.js";import{Inspector as i}from"./chunk-UCLVWF5E.js";import{createContext as o,useContext as u}from"react";import{DesktopIcon as l}from"efficient-shell/icons/efficient";import{jsx as s}from"react/jsx-runtime";var c={kind:"puck"};function f(n,e){const t=n,r=e,i=Object.keys(t);return i.length===Object.keys(r).length&&i.every(n=>Object.is(t[n],r[n]))}function a(n){const e=n;return"string"==typeof e.nodeId&&"string"==typeof e.slot}function d(e,t,r){const i=e.slotsOf?.(r);return i||n(t,r.type).map(n=>({slot:n,label:n,rung:!1}))}function p(n,e){return n.isFirst?n.isFirst(e):e.type===n.first}function m(n,e){return n.isLast?n.isLast(e):e.type===n.last}var k={},h={},v=()=>k,g=()=>"",y=()=>null,b=()=>{},L={isLockedBlock:()=>!1,duplicateBlocked:()=>null,nestDepth:()=>0,newSectionNode:()=>null,canAddTo:()=>null,blockIsOffered:()=>!0},O={labelAtLevel:(n,e,t)=>t,descriptions:{},categoryLabel:()=>{},firstSection:null,blockRowName:(n,e)=>e(n.type),plainText:n=>n,Icon:()=>null,Thumbnail:()=>null,useProducts:()=>null},j={options:[{id:"desktop",label:"Desktop",icon:/* @__PURE__ */s(l,{})}],initial:"desktop",fluid:"desktop",widths:{desktop:2e3}},w={read:()=>"sections",write:()=>{},forSelection:(n,e)=>n?"sections":e},C={first:null,last:null,firstGroup:null,lastGroup:null,isSectionGroup:()=>!1,sectionGroupZone:()=>"",panelOf:()=>null};function S(){/* @__PURE__ */
2
2
  return s(t,{height:"fill"})}function P(){const{id:n,fields:e,values:t,readOnly:o,onChange:u}=r();/* @__PURE__ */
3
- return s("div",{className:"es-sidepanel es-sidepanel--right",children:/* @__PURE__ */s(i,{fields:e,values:t,onChange:u,readOnly:o,idPrefix:n})})}var C=o({});function G({parts:n,children:e}){/* @__PURE__ */
4
- return s(C.Provider,{value:n,children:e})}function N(){return u(C)}function T(){return(N().useOwnerName??g)()}function x(){return(N().useDocumentLabel??y)()}function B(n,e,t,r){return(N().useBridges??v)(n,e,t,r)}function I(n){return(N().useStandaloneBridges??v)(n)}function A(n,e){(N().useDocumentPass??b)(n,e)}function F(){return N().blockRules??O}function K(){return N().blockLook??j}function R(){return N().devices??w}function W(){return N().leftView??D}function E(){return N().pinned??L}function M(){return N().saveSwitch??!0}function V(n){e(!0===N().pickFollowsSelection,n)}function H(){return N().add??h}function Q(){return N().storageNamespace||void 0}function Y(){return N().styleClipboard??null}function Z(){return N().nodeKeys??!0}function q(){return N().notify??null}function z(){return N().Canvas??S}function J(){return N().CanvasHead??null}function U(){return N().canvasDrag??null}var X=o(null);function $({target:n,children:e}){/* @__PURE__ */
5
- return s(X.Provider,{value:n,children:e})}function _(){return u(X)}function nn(){return N().Inspector??P}export{c as SELECTION_MODE,$ as ScreenCanvasTargetProvider,G as ScreenPartsProvider,p as isPinnedFirst,m as isPinnedLast,a as isSlotMode,f as sameInspectorMode,d as screenSlotsOf,H as useScreenAdd,K as useScreenBlockLook,F as useScreenBlockRules,B as useScreenBridges,U as useScreenCanvasDrag,z as useScreenCanvasFrame,J as useScreenCanvasHead,_ as useScreenCanvasTarget,R as useScreenDevices,x as useScreenDocumentLabel,A as useScreenDocumentPass,nn as useScreenInspectorPanel,W as useScreenLeftView,Z as useScreenNodeKeys,q as useScreenNotify,T as useScreenOwnerName,N as useScreenParts,V as useScreenPickFollowsSelection,E as useScreenPinned,M as useScreenSaveSwitch,Q as useScreenStorageNamespace,Y as useScreenStyleClipboard,I as useStandaloneScreenBridges};
3
+ return s("div",{className:"es-sidepanel es-sidepanel--right",children:/* @__PURE__ */s(i,{fields:e,values:t,onChange:u,readOnly:o,idPrefix:n})})}var D=o({});function G({parts:n,children:e}){/* @__PURE__ */
4
+ return s(D.Provider,{value:n,children:e})}function N(){return u(D)}function T(){return(N().useOwnerName??g)()}function x(){return(N().useDocumentLabel??y)()}function B(n,e,t,r){return(N().useBridges??v)(n,e,t,r)}function F(n){return(N().useStandaloneBridges??v)(n)}function I(n,e){(N().useDocumentPass??b)(n,e)}function A(){return N().blockRules??L}function K(){return N().blockLook??O}function R(){return N().devices??j}function V(){return N().leftView??w}function W(){return N().pinned??C}function E(){return N().saveSwitch??!0}function M(n){e(!0===N().pickFollowsSelection,n)}function H(){return N().add??h}function Q(){return N().storageNamespace||void 0}function U(){return N().styleClipboard??null}function Y(){return N().nodeKeys??!0}function Z(){return N().notify??null}function q(){return N().Canvas??S}function z(){return N().CanvasHead??null}function J(){return N().canvasDrag??null}var X=o(null);function $({target:n,children:e}){/* @__PURE__ */
5
+ return s(X.Provider,{value:n,children:e})}function _(){return u(X)}function nn(){return N().Inspector??P}export{c as SELECTION_MODE,$ as ScreenCanvasTargetProvider,G as ScreenPartsProvider,p as isPinnedFirst,m as isPinnedLast,a as isSlotMode,f as sameInspectorMode,d as screenSlotsOf,H as useScreenAdd,K as useScreenBlockLook,A as useScreenBlockRules,B as useScreenBridges,J as useScreenCanvasDrag,q as useScreenCanvasFrame,z as useScreenCanvasHead,_ as useScreenCanvasTarget,R as useScreenDevices,x as useScreenDocumentLabel,I as useScreenDocumentPass,nn as useScreenInspectorPanel,V as useScreenLeftView,Y as useScreenNodeKeys,Z as useScreenNotify,T as useScreenOwnerName,N as useScreenParts,M as useScreenPickFollowsSelection,W as useScreenPinned,E as useScreenSaveSwitch,Q as useScreenStorageNamespace,U as useScreenStyleClipboard,F as useStandaloneScreenBridges};
@@ -1,2 +1,2 @@
1
- import{ScreenPartsProvider as t}from"./chunk-FJRAYUCX.js";import{useEaselHost as r}from"./chunk-U3JP4VGF.js";import{createEasel as e,EaselProvider as n}from"./chunk-K5744MTM.js";import{useState as o,useEffect as s}from"react";import{jsx as i}from"react/jsx-runtime";function a({config:a,data:c,onChange:m,permissions:p,parts:f,children:u}){const[h]=o(()=>e({config:a,data:c,permissions:p}));s(()=>{h.setConfig(a)},[h,a]),s(()=>{if(!m)return;let t=h.getState().appState.data;return h.subscribe(()=>{const r=h.getState().appState.data;r!==t&&(t=r,m(r))})},[h,m]),s(()=>{p&&h.setPermissions(p)},[h,p]);const d=r();/* @__PURE__ */
1
+ import{ScreenPartsProvider as t}from"./chunk-CWTAS5R6.js";import{useEaselHost as r}from"./chunk-U3JP4VGF.js";import{createEasel as e,EaselProvider as n}from"./chunk-K5744MTM.js";import{useState as o,useEffect as s}from"react";import{jsx as i}from"react/jsx-runtime";function a({config:a,data:c,onChange:m,permissions:p,parts:f,children:u}){const[h]=o(()=>e({config:a,data:c,permissions:p}));s(()=>{h.setConfig(a)},[h,a]),s(()=>{if(!m)return;let t=h.getState().appState.data;return h.subscribe(()=>{const r=h.getState().appState.data;r!==t&&(t=r,m(r))})},[h,m]),s(()=>{p&&h.setPermissions(p)},[h,p]);const d=r();/* @__PURE__ */
2
2
  return i(n,{easel:h,hotkeys:d.ownsDocument,children:/* @__PURE__ */i(t,{parts:f,children:u})})}export{a as ScreenStoreProvider};
@@ -1 +1 @@
1
- import{useSectionOps as o}from"./chunk-NMUS2VVD.js";import{decodePartId as e,encodePartId as r}from"./chunk-IYT6NN2J.js";import{usePreviewParts as t}from"./chunk-I54UCYOU.js";import{SELECTION_MODE as n}from"./chunk-FJRAYUCX.js";import{useEasel as p}from"./chunk-K5744MTM.js";import{useCallback as d,useEffect as c}from"react";var s=o=>"part"===o.kind;function m({mode:m,setMode:i,onOpenPart:a}){const{getSelectorForId:u}=p(o=>o),I=o(),{setSelectedPartId:f,setSelectHandler:k}=t(),l=d(o=>{const r=e(o);if(!r)return;const{nodeId:t,propKey:p}=r;p?(i(o=>s(o)&&o.nodeId===t&&o.propKey===p?o:{kind:"part",nodeId:t,propKey:p}),a?.(t)):i(o=>"part"===o.kind?n:o)},[i,a]);c(()=>{k(l)},[k,l]);const h=s(m)?r(m.nodeId,m.propKey):null;c(()=>{f(h)},[h,f]);return{selectNode:d(o=>{i(()=>n);const e=u(o);e&&I.select(e)},[i,u,I]),openPartId:h}}export{m as usePartBridge};
1
+ import{useSectionOps as o}from"./chunk-VF6TCI62.js";import{decodePartId as e,encodePartId as r}from"./chunk-IYT6NN2J.js";import{usePreviewParts as t}from"./chunk-I54UCYOU.js";import{SELECTION_MODE as n}from"./chunk-CWTAS5R6.js";import{useEasel as p}from"./chunk-K5744MTM.js";import{useCallback as d,useEffect as c}from"react";var s=o=>"part"===o.kind;function m({mode:m,setMode:i,onOpenPart:I}){const{getSelectorForId:a}=p(o=>o),u=o(),{setSelectedPartId:f,setSelectHandler:k}=t(),l=d(o=>{const r=e(o);if(!r)return;const{nodeId:t,propKey:p}=r;p?(i(o=>s(o)&&o.nodeId===t&&o.propKey===p?o:{kind:"part",nodeId:t,propKey:p}),I?.(t)):i(o=>"part"===o.kind?n:o)},[i,I]);c(()=>{k(l)},[k,l]);const h=s(m)?r(m.nodeId,m.propKey):null;c(()=>{f(h)},[h,f]);return{selectNode:d(o=>{i(()=>n);const e=a(o);e&&u.select(e)},[i,a,u]),openPartId:h}}export{m as usePartBridge};
@@ -1,4 +1,4 @@
1
- import{blockRuns as e}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as r}from"./chunk-FJRAYUCX.js";import{DEFAULT_SCREEN_WORDS as s}from"./chunk-JTUUIVBZ.js";import{useWords as t}from"./chunk-MFIRYGHW.js";import{DropdownMenu as n}from"efficient-shell/ui";import{jsxs as c,Fragment as i,jsx as o}from"react/jsx-runtime";function l({choices:l,onPick:p}){const{Icon:a}=r(),m=t("screen",s),u=e(l).flatMap(e=>[...e.group?[{type:"label",key:`group:${e.group}`,label:/* @__PURE__ */c(i,{children:[e.group," ",
1
+ import{blockRuns as e}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as r}from"./chunk-CWTAS5R6.js";import{DEFAULT_SCREEN_WORDS as s}from"./chunk-JTUUIVBZ.js";import{useWords as t}from"./chunk-MFIRYGHW.js";import{DropdownMenu as n}from"efficient-shell/ui";import{jsxs as c,Fragment as i,jsx as o}from"react/jsx-runtime";function l({choices:l,onPick:p}){const{Icon:a}=r(),m=t("screen",s),u=e(l).flatMap(e=>[...e.group?[{type:"label",key:`group:${e.group}`,label:/* @__PURE__ */c(i,{children:[e.group," ",
2
2
  /* @__PURE__ */o("span",{className:"sf-menugroup-count",children:e.items.length})]})}]:[],...e.items.map(e=>({key:e.type,label:e.label,icon:/* @__PURE__ */o("span",{className:"sf-chip",children:/* @__PURE__ */o(a,{type:e.type,size:13})}),onSelect:()=>p(e.type)}))]);/* @__PURE__ */
3
3
  return o(n,{align:"start",triggerClassName:"sf-add-card",items:u,trigger:/* @__PURE__ */c(i,{children:[
4
4
  /* @__PURE__ */o("span",{className:"sf-plus sf-plus--sm",children:"+"}),m.addBlockMenu]})})}export{l as AddBlockRow};
@@ -0,0 +1,5 @@
1
+ import{buildPaletteSections as e,pinnedSection as t,paletteWithoutPinned as o,categoryLabel as n}from"./chunk-PA3PNTVV.js";import{blockTypesIn as i}from"./chunk-5ZBY24K7.js";import{sectionTemplatesOf as s}from"./chunk-BVN33R76.js";import{SidePanelHead as r,PanelModeExit as c}from"./chunk-XTJCKV6Z.js";import{useEaselSession as l}from"./chunk-O7Q4DDJT.js";import{blockRuns as a}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as p,useScreenBlockRules as m}from"./chunk-CWTAS5R6.js";import{DEFAULT_SCREEN_WORDS as d}from"./chunk-JTUUIVBZ.js";import{useEasel as f}from"./chunk-K5744MTM.js";import{useWords as u}from"./chunk-MFIRYGHW.js";import{AddPanel as k}from"./chunk-FCLW4LEN.js";import{DEFAULT_DRAG_WORDS as y}from"./chunk-O2NLQBFX.js";import{useState as h,useEffect as b,useMemo as j}from"react";import{AddIcon as g}from"efficient-shell/icons/efficient";import{jsx as $,jsxs as B,Fragment as O}from"react/jsx-runtime";var v=e=>`section:${e}`,L=e=>`block:${e}`,T=e=>`template:${e}`;function V({blocks:V,blocksOnly:x,at:A,sectionAccepts:C,onAdd:I,itemFor:N,session:F,siteWide:H,onClose:R,onHide:W,readOnly:w}){const D=f(e=>e.config),J=p(),{labelAtLevel:K,categoryLabel:M,firstSection:Q,Icon:S,Thumbnail:Z}=J,{blockIsOffered:z}=m(),E=u("screen",d).add,P=u("drag",y).add,U=l(),[X,Y]=h([]);b(()=>{let e=!1;const t=e=>z(e,U);return s(U).list().then(o=>{if(e)return;const n=D.components;Y(o.filter(e=>e.node?.type&&n[e.node.type]&&i(e.node).every(t)))}).catch(()=>{}),()=>{e=!0}},[D,U]);const G=j(()=>e(D,J),[D]),q=e=>({type:v(e.type),label:e.name,cover:/* @__PURE__ */$(Z,{type:e.type}),title:e.desc?`${e.name} — ${e.desc}`:E.tile({name:e.name}),keywords:[e.alias??"",e.desc,e.type,e.catLabel].filter(Boolean)}),_=j(()=>{const e=[];if(V&&V.choices.length>0&&a(V.choices).forEach((t,o)=>{e.push({key:`blocks:${o}`,title:0===o?`${E.inside({name:V.parentName})}${t.group?` · ${t.group}`:""}`:t.group??"",tiles:t.items.map(e=>({type:L(e.type),label:e.label,icon:/* @__PURE__ */$(S,{type:e.type,size:18}),title:E.tile({name:e.label})}))})}),x)return e;const i=e=>!C||C(e),s=t(G,Q);s&&i(s.type)&&e.push({key:"start",title:E.startBlank,tiles:[q(s)]});const r=X.filter(e=>i(e.node.type));r.length>0&&e.push({key:"templates",title:E.templates,tiles:r.map(e=>{return{type:T(e.id),label:e.name,cover:/* @__PURE__ */$(Z,{type:e.node.type}),keywords:[(t=e.node.type,K(t,"section",D.components[t]?.label??t)),e.node.type]};var t})});const c=o(G,Q);for(const t of Object.keys(D.categories??{})){const o=c.filter(e=>e.cat===t&&i(e.type));0!==o.length&&e.push({key:`category:${t}`,title:n(D,t,M),tiles:o.map(q)})}return e},[V,x,X,G,D,E,C]),ee=e=>{const t=e.indexOf(":"),o=e.slice(0,t),n=e.slice(t+1);if("section"===o)return{kind:"section",type:n};if("block"===o)return{kind:"block",type:n};if("template"===o){const e=X.find(e=>e.id===n);return e?{kind:"template",template:e}:null}return null};/* @__PURE__ */
2
+ return B(O,{children:[
3
+ /* @__PURE__ */$(r,{icon:/* @__PURE__ */$(g,{size:15}),title:E.title,context:x?E.contextBlocks:E.contextAll,actions:/* @__PURE__ */$(c,{label:E.done,description:E.doneDescription,onClick:R}),onHide:W}),
4
+ /* @__PURE__ */B("div",{className:"sf-addside sf-scroll",children:[
5
+ /* @__PURE__ */$(k,{groups:_,session:F,itemFor:e=>N(ee(e)??{kind:"section",type:e}),onInsert:e=>{const t=ee(e);t&&I(t)},at:A,hint:x?E.hintBlocks:E.hint,searchLabel:x?E.searchBlocks:E.searchSections,readOnly:w,words:P}),H&&!x?H:null]})]})}export{V as AddSidePanel,L as blockKey,v as sectionKey,T as templateKey};
@@ -1,4 +1,4 @@
1
- import{useScreenOwnerName as e}from"./chunk-FJRAYUCX.js";import{settlePanelPick as n}from"./chunk-R6WTQWAC.js";import{MediaPanelHead as i,mediaPickKind as c}from"./chunk-QVUVDBGA.js";import{jsxs as o,Fragment as r,jsx as t}from"react/jsx-runtime";function l({panel:l,pick:d,onHide:m}){const p=e();/* @__PURE__ */
1
+ import{useScreenOwnerName as e}from"./chunk-CWTAS5R6.js";import{settlePanelPick as n}from"./chunk-R6WTQWAC.js";import{MediaPanelHead as i,mediaPickKind as c}from"./chunk-QVUVDBGA.js";import{jsxs as o,Fragment as r,jsx as t}from"react/jsx-runtime";function l({panel:l,pick:d,onHide:m}){const p=e();/* @__PURE__ */
2
2
  return o(r,{children:[
3
3
  /* @__PURE__ */t(i,{context:p,pick:d?{kind:c(d.accept),field:d.title||void 0}:null,onCancel:()=>d&&n(d.requestId,null),onHide:m}),
4
4
  /* @__PURE__ */t("div",{className:"sf-media-panel",children:/* @__PURE__ */t(l,{pick:d,onPick:e=>d&&n(d.requestId,e)})})]})}export{l as MediaSidePanel};
@@ -1,21 +1,21 @@
1
- import{FieldSelect as e}from"./chunk-OZ72A6MY.js";import{TreeSeam as n}from"./chunk-4JSBIW5H.js";import{SettingsField as l,SETTINGS_BUCKETS as t,SettingsGroup as a}from"./chunk-GZH4UVDH.js";import{DEFAULT_TREE_WORDS as r}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as o}from"./chunk-KFV7N2DJ.js";import{EaselMenuItems as i}from"./chunk-EA2HTX37.js";import{FieldNumber as s}from"./chunk-66LWADFP.js";import{SettingsSegmented as c}from"./chunk-QLD57GBB.js";import{DEFAULT_FIELDS_WORDS as d}from"./chunk-FFYXVAAL.js";import{useWords as u}from"./chunk-MFIRYGHW.js";import{useTreeDrag as m,gapToMoveIndex as p}from"./chunk-67GNT6PF.js";import{withTip as h}from"./chunk-P2VEMZH5.js";import{Textarea as f,Input as b,SortableList as g,ListRow as v,ContextMenu as y,tabPanelId as k,Tabs as x,tabButtonId as w}from"efficient-shell/ui";export{LinkPicker}from"efficient-shell/ui";import{useRef as N,useState as C,useLayoutEffect as O,useId as $}from"react";import{jsx as j,jsxs as D}from"react/jsx-runtime";import{ChevronIcon as S,LockIcon as I,MoveUpIcon as L,MoveDownIcon as P,DuplicateIcon as F,TrashIcon as A}from"efficient-shell/icons/efficient";function M({id:e,value:n,onChange:l,placeholder:t,multiline:a=!1,rows:r=3,readOnly:o=!1,ariaLabel:i,ariaLabelledBy:s}){const c=n??"";return a?/* @__PURE__ */j(f,{id:e,size:"sm",className:"es-fin",value:c,rows:r,placeholder:t,readOnly:o,"aria-label":i,"aria-labelledby":s,onChange:e=>l(e.target.value)}):/* @__PURE__ */j(b,{id:e,size:"sm",className:"es-fin",type:"text",value:c,placeholder:t,readOnly:o,"aria-label":i,"aria-labelledby":s,onChange:e=>l(e.target.value)})}function T(e,n,l){const t=e.slice();return t.splice(Math.max(0,Math.min(n,t.length)),0,l),t}function H(e,n,l){const t=e.slice(),[a]=t.splice(n,1);return t.splice(Math.max(0,Math.min(l,t.length)),0,a),t}function z(e,n){return e.filter((e,l)=>l!==n)}function E(e){return null===e||"object"!=typeof e?e:JSON.parse(JSON.stringify(e))}var R='input, textarea, select, button, [contenteditable]:not([contenteditable="false"]), [tabindex]',B={parentId:"list",slot:"items"};function Y({label:e,icon:l,noun:t,items:a,onChange:o,newItem:s,summary:c,itemName:f,thumb:b,min:k=0,max:x,readOnly:w=!1,open:$,onOpen:M,renderItem:Y,renderRow:K,canRemove:V,lockedReason:G,fixed:J=!1,removeOnRow:Z=!0,canDuplicate:W,above:X,head:q=!0}){const Q=u("fields",d).list,U=u("tree",r),_=t??Q.item,ee=!w&&!J&&("number"!=typeof x||a.length<x),ne=a.length<=k,le=e=>!!V&&!V(a[e],e),te=e=>!w&&!J&&Z&&!ne&&!le(e),ae=e=>ee&&(!W||W(a[e],e)),re=(e,n)=>f?f(e,n):Q.itemName({noun:_,n:n+1}),oe=N([]),ie=N(null),[se,ce]=C(null),de=N(null),[ue,me]=C(null),[pe,he]=C("");O(()=>{const e=ie.current;if(!e)return;ie.current=null;const n=oe.current[e.index]?.querySelectorAll(R)[e.nth]??oe.current[e.index];if(n?.focus(),n&&null!==e.start&&"setSelectionRange"in n)try{n.setSelectionRange(e.start,e.end)}catch{}});const fe=(e,n)=>{if(n<0||n>=a.length||n===e)return;const l=oe.current[e],t=l?.ownerDocument.activeElement;if(l&&t&&l.contains(t)){const e=[...l.querySelectorAll(R)].indexOf(t),a=t;ie.current={index:n,nth:e,start:"number"==typeof a.selectionStart?a.selectionStart:null,end:"number"==typeof a.selectionEnd?a.selectionEnd:null}}o(H(a,e,n));const r=function(e,n,l){return null===e?null:e===n?l:n<e&&l>=e?e-1:n>e&&l<=e?e+1:e}($,e,n);r!==$&&M(r),he(Q.moved({n:n+1,total:a.length}))},be=e=>{ee&&(o(T(a,e,s())),K?(ie.current={index:e,nth:0,start:null,end:null},null!==$&&$>=e&&M($+1)):M(e))},ge=e=>{te(e)&&(o(z(a,e)),$===e?M(null):null!==$&&$>e&&M($-1))},ve=m({keyOf:e=>String(e),canDrop:(e,n)=>n.parentId===B.parentId&&n.slot===B.slot,onDrop:(e,n)=>{const l=p({...B,index:e},n);l!==e&&fe(e,l)},onStep:(e,n)=>fe(e,e+n),canStep:(e,n)=>e+n>=0&&e+n<a.length,readOnly:w}),ye=e=>{const n=[];return e>0&&n.push({label:Q.moveUp,icon:/* @__PURE__ */j(L,{size:14}),shortcut:"⌥↑",onClick:()=>fe(e,e-1)}),e<a.length-1&&n.push({label:Q.moveDown,icon:/* @__PURE__ */j(P,{size:14}),shortcut:"⌥↓",onClick:()=>fe(e,e+1)}),ae(e)&&n.push({label:Q.duplicate,icon:/* @__PURE__ */j(F,{size:14}),onClick:()=>(e=>{ae(e)&&(o(T(a,e+1,E(a[e]))),null!==$&&$>e&&M($+1))})(e)}),te(e)&&n.push({label:Q.delete,icon:/* @__PURE__ */j(A,{size:14}),danger:!0,onClick:()=>ge(e)}),n},ke=(e,n,l,t)=>{w||0===ye(e).length||me({index:e,x:n,y:l,owner:t})},xe=e=>n=>{const l=a.slice();l[e]=n,o(l)};/* @__PURE__ */
1
+ import{TreeSeam as e}from"./chunk-4JSBIW5H.js";import{FieldSelect as n}from"./chunk-OZ72A6MY.js";import{SettingsField as l,SETTINGS_BUCKETS as t,SettingsGroup as a}from"./chunk-GZH4UVDH.js";import{DEFAULT_TREE_WORDS as r}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as o}from"./chunk-KFV7N2DJ.js";import{EaselMenuItems as i}from"./chunk-EA2HTX37.js";import{FieldNumber as s}from"./chunk-66LWADFP.js";import{SettingsSegmented as c}from"./chunk-QLD57GBB.js";import{DEFAULT_FIELDS_WORDS as d}from"./chunk-FFYXVAAL.js";import{useWords as u}from"./chunk-MFIRYGHW.js";import{useTreeDrag as m,gapToMoveIndex as p}from"./chunk-67GNT6PF.js";import{withTip as h}from"./chunk-P2VEMZH5.js";import{Textarea as f,Input as b,SortableList as g,ListRow as v,ContextMenu as y,tabPanelId as k,Tabs as x,tabButtonId as w}from"efficient-shell/ui";export{LinkPicker}from"efficient-shell/ui";import{useRef as N,useState as C,useLayoutEffect as O,useId as $}from"react";import{jsx as j,jsxs as D}from"react/jsx-runtime";import{ChevronIcon as S,LockIcon as I,MoveUpIcon as L,MoveDownIcon as P,DuplicateIcon as F,TrashIcon as A}from"efficient-shell/icons/efficient";function M({id:e,value:n,onChange:l,placeholder:t,multiline:a=!1,rows:r=3,readOnly:o=!1,ariaLabel:i,ariaLabelledBy:s}){const c=n??"";return a?/* @__PURE__ */j(f,{id:e,size:"sm",className:"es-fin",value:c,rows:r,placeholder:t,readOnly:o,"aria-label":i,"aria-labelledby":s,onChange:e=>l(e.target.value)}):/* @__PURE__ */j(b,{id:e,size:"sm",className:"es-fin",type:"text",value:c,placeholder:t,readOnly:o,"aria-label":i,"aria-labelledby":s,onChange:e=>l(e.target.value)})}function T(e,n,l){const t=e.slice();return t.splice(Math.max(0,Math.min(n,t.length)),0,l),t}function H(e,n,l){const t=e.slice(),[a]=t.splice(n,1);return t.splice(Math.max(0,Math.min(l,t.length)),0,a),t}function z(e,n){return e.filter((e,l)=>l!==n)}function E(e){return null===e||"object"!=typeof e?e:JSON.parse(JSON.stringify(e))}var R='input, textarea, select, button, [contenteditable]:not([contenteditable="false"]), [tabindex]',B={parentId:"list",slot:"items"};function Y({label:n,icon:l,noun:t,items:a,onChange:o,newItem:s,summary:c,itemName:f,thumb:b,min:k=0,max:x,readOnly:w=!1,open:$,onOpen:M,renderItem:Y,renderRow:K,canRemove:V,lockedReason:G,fixed:J=!1,removeOnRow:Z=!0,canDuplicate:W,above:X,head:q=!0}){const Q=u("fields",d).list,U=u("tree",r),_=t??Q.item,ee=!w&&!J&&("number"!=typeof x||a.length<x),ne=a.length<=k,le=e=>!!V&&!V(a[e],e),te=e=>!w&&!J&&Z&&!ne&&!le(e),ae=e=>ee&&(!W||W(a[e],e)),re=(e,n)=>f?f(e,n):Q.itemName({noun:_,n:n+1}),oe=N([]),ie=N(null),[se,ce]=C(null),de=N(null),[ue,me]=C(null),[pe,he]=C("");O(()=>{const e=ie.current;if(!e)return;ie.current=null;const n=oe.current[e.index]?.querySelectorAll(R)[e.nth]??oe.current[e.index];if(n?.focus(),n&&null!==e.start&&"setSelectionRange"in n)try{n.setSelectionRange(e.start,e.end)}catch{}});const fe=(e,n)=>{if(n<0||n>=a.length||n===e)return;const l=oe.current[e],t=l?.ownerDocument.activeElement;if(l&&t&&l.contains(t)){const e=[...l.querySelectorAll(R)].indexOf(t),a=t;ie.current={index:n,nth:e,start:"number"==typeof a.selectionStart?a.selectionStart:null,end:"number"==typeof a.selectionEnd?a.selectionEnd:null}}o(H(a,e,n));const r=function(e,n,l){return null===e?null:e===n?l:n<e&&l>=e?e-1:n>e&&l<=e?e+1:e}($,e,n);r!==$&&M(r),he(Q.moved({n:n+1,total:a.length}))},be=e=>{ee&&(o(T(a,e,s())),K?(ie.current={index:e,nth:0,start:null,end:null},null!==$&&$>=e&&M($+1)):M(e))},ge=e=>{te(e)&&(o(z(a,e)),$===e?M(null):null!==$&&$>e&&M($-1))},ve=m({keyOf:e=>String(e),canDrop:(e,n)=>n.parentId===B.parentId&&n.slot===B.slot,onDrop:(e,n)=>{const l=p({...B,index:e},n);l!==e&&fe(e,l)},onStep:(e,n)=>fe(e,e+n),canStep:(e,n)=>e+n>=0&&e+n<a.length,readOnly:w}),ye=e=>{const n=[];return e>0&&n.push({label:Q.moveUp,icon:/* @__PURE__ */j(L,{size:14}),shortcut:"⌥↑",onClick:()=>fe(e,e-1)}),e<a.length-1&&n.push({label:Q.moveDown,icon:/* @__PURE__ */j(P,{size:14}),shortcut:"⌥↓",onClick:()=>fe(e,e+1)}),ae(e)&&n.push({label:Q.duplicate,icon:/* @__PURE__ */j(F,{size:14}),onClick:()=>(e=>{ae(e)&&(o(T(a,e+1,E(a[e]))),null!==$&&$>e&&M($+1))})(e)}),te(e)&&n.push({label:Q.delete,icon:/* @__PURE__ */j(A,{size:14}),danger:!0,onClick:()=>ge(e)}),n},ke=(e,n,l,t)=>{w||0===ye(e).length||me({index:e,x:n,y:l,owner:t})},xe=e=>n=>{const l=a.slice();l[e]=n,o(l)};/* @__PURE__ */
2
2
  return D("div",{className:"es-list",children:[q?/* @__PURE__ */D("div",{className:"es-list-head",children:[
3
- /* @__PURE__ */D("span",{className:"es-list-label",children:[l?/* @__PURE__ */j("span",{className:"es-field-icon","aria-hidden":"true",children:l}):null,e]}),
4
- /* @__PURE__ */j("span",{className:"es-list-count",children:a.length})]}):null,X?/* @__PURE__ */j("div",{className:"es-list-above",children:X}):null,a.length?/* @__PURE__ */D(g,{"aria-label":e,spacing:"comfortable",className:"es-list-rows",rootProps:ve.rootProps(),children:[a.map((e,l)=>{const t=ve.row({item:l,place:{...B,index:l}}),a=t.draggable&&se!==l,r=!K&&$===l,o=!w&&!J&&Z&&le(l),i=["es-list-row",K?"is-inline":"is-item",r?"is-open":"",a?"is-draggable":"",t.dragging?"is-dragging":"",t.drop?`is-drop-${t.drop}`:""].filter(Boolean).join(" ");return[l>0?/* @__PURE__ */j(n,{...ve.seam({place:{...B,index:l}}),onAdd:ee?()=>be(l):void 0,label:Q.addHere({noun:_})},`seam-${l}`):null,
5
- /* @__PURE__ */j(v,{className:i,flat:!!K,active:r,draggable:t.draggable,dragHint:U.dragHint,dragging:t.dragging,drop:"before"===t.drop||"after"===t.drop?t.drop:void 0,onMove:t.draggable?e=>fe(l,"up"===e?l-1:l+1):void 0,rowRef:e=>{oe.current[l]=e},rowProps:{...t.rowProps,draggable:a||void 0,onPointerDown:e=>{const n=e.target.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])'),a=!!n&&n===n.ownerDocument.activeElement;e.currentTarget.draggable=t.draggable&&!a,de.current=n&&!a?n:null,ce(a?l:null)},onDragStart:e=>{const n=de.current;de.current=null,n&&n.ownerDocument.activeElement===n&&n.blur(),t.rowProps.onDragStart?.(e)},onContextMenu:e=>{w||(e.preventDefault(),e.stopPropagation(),ke(l,e.clientX,e.clientY,e.currentTarget))},onKeyDown:e=>{if("ContextMenu"===e.key||e.shiftKey&&"F10"===e.key){e.preventDefault();const n=e.currentTarget.ownerDocument,t=e=>e.preventDefault();n.addEventListener("contextmenu",t,{capture:!0,once:!0}),n.defaultView?.setTimeout(()=>n.removeEventListener("contextmenu",t,{capture:!0}),500);const a=e.currentTarget.getBoundingClientRect();return void ke(l,a.left+24,a.bottom,e.currentTarget)}t.rowProps.onKeyDown?.(e)}},actions:w||J||!Z?void 0:o?h(G?G(e,l):Q.locked,/* @__PURE__ */j("span",{className:"es-list-lock",role:"img","aria-label":G?G(e,l):Q.locked,children:/* @__PURE__ */j(I,{size:13})})):h(Q.deleteItem({noun:_}),/* @__PURE__ */j("button",{type:"button",className:"es-list-x","aria-label":Q.deleteItem({noun:_}),disabled:!te(l),onClick:()=>ge(l),children:"×"})),below:r?/* @__PURE__ */j("div",{className:"es-list-item",children:Y(e,l,xe(l))}):void 0,children:K?/* @__PURE__ */j("div",{className:"es-list-row-main",children:K(e,l,xe(l))}):/* @__PURE__ */D("button",{type:"button",className:"es-list-open","aria-expanded":r,onClick:()=>M(r?null:l),children:[b?/* @__PURE__ */j("span",{className:"es-list-thumb","aria-hidden":"true",children:b(e,l)}):null,
6
- /* @__PURE__ */j("span",{className:"es-list-row-name",children:re(e,l)}),/* @__PURE__ */j("span",c?{className:"es-list-row-summary",children:c(e,l)}:{className:"es-list-row-summary"}),
3
+ /* @__PURE__ */D("span",{className:"es-list-label",children:[l?/* @__PURE__ */j("span",{className:"es-field-icon","aria-hidden":"true",children:l}):null,n]}),
4
+ /* @__PURE__ */j("span",{className:"es-list-count",children:a.length})]}):null,X?/* @__PURE__ */j("div",{className:"es-list-above",children:X}):null,a.length?/* @__PURE__ */D(g,{"aria-label":n,spacing:"comfortable",className:"es-list-rows",rootProps:ve.rootProps(),children:[a.map((n,l)=>{const t=ve.row({item:l,place:{...B,index:l}}),a=t.draggable&&se!==l,r=!K&&$===l,o=!w&&!J&&Z&&le(l),i=["es-list-row",K?"is-inline":"is-item",r?"is-open":"",a?"is-draggable":"",t.dragging?"is-dragging":"",t.drop?`is-drop-${t.drop}`:""].filter(Boolean).join(" ");return[l>0?/* @__PURE__ */j(e,{...ve.seam({place:{...B,index:l}}),onAdd:ee?()=>be(l):void 0,label:Q.addHere({noun:_})},`seam-${l}`):null,
5
+ /* @__PURE__ */j(v,{className:i,flat:!!K,active:r,draggable:t.draggable,dragHint:U.dragHint,dragging:t.dragging,drop:"before"===t.drop||"after"===t.drop?t.drop:void 0,onMove:t.draggable?e=>fe(l,"up"===e?l-1:l+1):void 0,rowRef:e=>{oe.current[l]=e},rowProps:{...t.rowProps,draggable:a||void 0,onPointerDown:e=>{const n=e.target.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])'),a=!!n&&n===n.ownerDocument.activeElement;e.currentTarget.draggable=t.draggable&&!a,de.current=n&&!a?n:null,ce(a?l:null)},onDragStart:e=>{const n=de.current;de.current=null,n&&n.ownerDocument.activeElement===n&&n.blur(),t.rowProps.onDragStart?.(e)},onContextMenu:e=>{w||(e.preventDefault(),e.stopPropagation(),ke(l,e.clientX,e.clientY,e.currentTarget))},onKeyDown:e=>{if("ContextMenu"===e.key||e.shiftKey&&"F10"===e.key){e.preventDefault();const n=e.currentTarget.ownerDocument,t=e=>e.preventDefault();n.addEventListener("contextmenu",t,{capture:!0,once:!0}),n.defaultView?.setTimeout(()=>n.removeEventListener("contextmenu",t,{capture:!0}),500);const a=e.currentTarget.getBoundingClientRect();return void ke(l,a.left+24,a.bottom,e.currentTarget)}t.rowProps.onKeyDown?.(e)}},actions:w||J||!Z?void 0:o?h(G?G(n,l):Q.locked,/* @__PURE__ */j("span",{className:"es-list-lock",role:"img","aria-label":G?G(n,l):Q.locked,children:/* @__PURE__ */j(I,{size:13})})):h(Q.deleteItem({noun:_}),/* @__PURE__ */j("button",{type:"button",className:"es-list-x","aria-label":Q.deleteItem({noun:_}),disabled:!te(l),onClick:()=>ge(l),children:"×"})),below:r?/* @__PURE__ */j("div",{className:"es-list-item",children:Y(n,l,xe(l))}):void 0,children:K?/* @__PURE__ */j("div",{className:"es-list-row-main",children:K(n,l,xe(l))}):/* @__PURE__ */D("button",{type:"button",className:"es-list-open","aria-expanded":r,onClick:()=>M(r?null:l),children:[b?/* @__PURE__ */j("span",{className:"es-list-thumb","aria-hidden":"true",children:b(n,l)}):null,
6
+ /* @__PURE__ */j("span",{className:"es-list-row-name",children:re(n,l)}),/* @__PURE__ */j("span",c?{className:"es-list-row-summary",children:c(n,l)}:{className:"es-list-row-summary"}),
7
7
  /* @__PURE__ */j(S,{size:14,className:"es-list-chev","aria-hidden":"true"})]})},l)]}),
8
- /* @__PURE__ */j(n,{...ve.seam({place:{...B,index:a.length}})})]}):null,w||J?null:/* @__PURE__ */j("button",{type:"button",className:"es-list-add",disabled:!ee,onClick:()=>be(a.length),children:Q.add({noun:_})}),
8
+ /* @__PURE__ */j(e,{...ve.seam({place:{...B,index:a.length}})})]}):null,w||J?null:/* @__PURE__ */j("button",{type:"button",className:"es-list-add",disabled:!ee,onClick:()=>be(a.length),children:Q.add({noun:_})}),
9
9
  /* @__PURE__ */j("span",{className:"es-list-said","aria-live":"polite",children:pe}),ue&&ue.index<a.length?
10
10
  /* @__PURE__ */j(y,{at:{x:ue.x,y:ue.y},owner:ue.owner,onClose:()=>me(null),children:/* @__PURE__ */j(i,{items:ye(ue.index),onClose:()=>me(null)})}):null]})}var K=e=>e<6?e+1:6,V=(e,n)=>"string"==typeof e.label&&e.label?e.label:n;function G({field:e,name:n,id:l,value:t,onChange:r,readOnly:o,context:i,renderers:s,headingLevel:c=3}){const[d,u]=C(!0),m=t&&"object"==typeof t?t:{};/* @__PURE__ */
11
11
  return j(a,{id:`${l}-group`,title:V(e,n),open:d,onToggle:u,level:c,children:Object.entries(e.objectFields).map(([e,t])=>/* @__PURE__ */j(Z,{field:t,name:`${n}.${e}`,id:`${l}-${e}`,value:m[e],onChange:n=>r({...m,[e]:n}),readOnly:o,context:i,renderers:s,headingLevel:K(c)},e))})}function J({field:e,name:n,id:l,value:t,onChange:a,readOnly:r,context:o,renderers:i,openItem:s,onOpenItem:c,headingLevel:d}){const[u,m]=C(null),p=c?s??null:u,h=c??m,f=Array.isArray(t)?t:[],b=e.getItemSummary;/* @__PURE__ */
12
- return j(Y,{label:V(e,n),icon:e.icon,noun:"string"==typeof e.noun?e.noun:void 0,items:f,onChange:a,newItem:()=>E({...e.defaultItemProps??{}}),summary:b?(e,n)=>b(e,n):void 0,min:e.min,max:e.max,readOnly:r,open:p,onOpen:h,renderItem:(t,a,s)=>Object.entries(e.arrayFields).map(([e,c])=>/* @__PURE__ */j(Z,{field:c,name:`${n}[${a}].${e}`,id:`${l}-${a}-${e}`,value:t?.[e],onChange:n=>s({...t,[e]:n}),readOnly:r,context:o,renderers:i,headingLevel:d},e))})}function Z(n){const{field:t,name:a,id:r,value:o,onChange:i,readOnly:d,context:u,renderers:m}=n;if(!t||t.marker||!1===t.visible)return null;const p=m?.[t.type];if(p)return p({field:t,name:a,id:r,value:o,onChange:i,readOnly:d});switch(t.type){case"custom":{const e={...u,field:t,name:a,id:r,value:o,onChange:i,readOnly:d};return t.render(e)}case"text":case"textarea":/* @__PURE__ */
12
+ return j(Y,{label:V(e,n),icon:e.icon,noun:"string"==typeof e.noun?e.noun:void 0,items:f,onChange:a,newItem:()=>E({...e.defaultItemProps??{}}),summary:b?(e,n)=>b(e,n):void 0,min:e.min,max:e.max,readOnly:r,open:p,onOpen:h,renderItem:(t,a,s)=>Object.entries(e.arrayFields).map(([e,c])=>/* @__PURE__ */j(Z,{field:c,name:`${n}[${a}].${e}`,id:`${l}-${a}-${e}`,value:t?.[e],onChange:n=>s({...t,[e]:n}),readOnly:r,context:o,renderers:i,headingLevel:d},e))})}function Z(e){const{field:t,name:a,id:r,value:o,onChange:i,readOnly:d,context:u,renderers:m}=e;if(!t||t.marker||!1===t.visible)return null;const p=m?.[t.type];if(p)return p({field:t,name:a,id:r,value:o,onChange:i,readOnly:d});switch(t.type){case"custom":{const e={...u,field:t,name:a,id:r,value:o,onChange:i,readOnly:d};return t.render(e)}case"text":case"textarea":/* @__PURE__ */
13
13
  return j(l,{label:V(t,a),htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */j(M,{id:r,value:"string"==typeof o?o:null==o?"":String(o),onChange:i,placeholder:t.placeholder,multiline:"textarea"===t.type,readOnly:d})});case"number":/* @__PURE__ */
14
- return j(l,{label:V(t,a),htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */j(s,{id:r,value:"number"==typeof o?o:void 0,onChange:i,min:t.min,max:t.max,step:t.step,placeholder:t.placeholder,readOnly:d})});case"select":{const n=`${r}-label`;/* @__PURE__ */
15
- return j(l,{label:V(t,a),labelId:n,htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */j(e,{id:r,value:o,options:t.options,onChange:i,readOnly:d,ariaLabelledBy:n})})}case"radio":/* @__PURE__ */
14
+ return j(l,{label:V(t,a),htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */j(s,{id:r,value:"number"==typeof o?o:void 0,onChange:i,min:t.min,max:t.max,step:t.step,placeholder:t.placeholder,readOnly:d})});case"select":{const e=`${r}-label`;/* @__PURE__ */
15
+ return j(l,{label:V(t,a),labelId:e,htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */j(n,{id:r,value:o,options:t.options,onChange:i,readOnly:d,ariaLabelledBy:e})})}case"radio":/* @__PURE__ */
16
16
  return j(l,{label:V(t,a),icon:t.icon,hint:t.hint,children:/* @__PURE__ */j(c,{ariaLabel:V(t,a),value:o,options:t.options.map(e=>({id:e.value,label:e.label,icon:e.icon,disabled:e.disabled||d})),onChange:e=>{d||i(e)}})});case"object":/* @__PURE__ */
17
- return j(G,{...n,field:t});case"array":/* @__PURE__ */
18
- return j(J,{...n,field:t});case"slot":return null}}var W=e=>t.includes(e);function X(e){let n,l=t[0];const a=[],r=/* @__PURE__ */new Set;for(const[t,o]of Object.entries(e))o&&(W(o.bucket)&&((o.marker||o.bucket!==l)&&(n=void 0),l=o.bucket),o.marker&&"string"==typeof o.fold?n={key:t,title:o.fold}:o.marker&&!1===o.fold&&(n=void 0),o.marker||!1===o.visible||(a.push(n?{name:t,field:o,bucket:l,fold:n}:{name:t,field:o,bucket:l}),"slot"!==o.type&&r.add(l)));return{rows:a,buckets:t.filter(e=>r.has(e))}}function q(e){return new Map(X(e).rows.map(e=>[e.name,e.bucket]))}function Q(e){const n=[];for(const l of e){const e=n[n.length-1];e&&e.fold?.key===l.fold?.key?e.rows.push(l):n.push({fold:l.fold,rows:[l]})}return n}function U({fields:e,values:n,onChange:l,readOnly:t=!1,context:r,tab:i,onTab:s,tabs:c=!0,tabIcons:d,renderers:m,idPrefix:p,ariaLabel:h,lead:f,children:b,leadFold:g,closedFolds:v,onFold:y,headingLevel:N=3}){const O=u("panel",o),S=$(),I=p??`es-insp${S.replace(/:/g,"")}`,L=X(e),[P,F]=C(void 0),A=i??P,M=A&&L.buckets.includes(A)?A:L.buckets[0],[T,H]=C(null),z=T&&T.panel===I&&L.rows.some(e=>e.name===T.name)?T:null,E=c&&L.buckets.length>1,R=E&&M?k(I,M):`${I}-rows`,[B,Y]=C(()=>/* @__PURE__ */new Set),V=v??B,G=(e,n)=>{/* @__PURE__ */return j(a,{title:e.title,open:!V.has(e.key),onToggle:n=>((e,n)=>{void 0===v&&Y(l=>{const t=new Set(l);return n?t.delete(e):t.add(e),t}),y?.(e,n)})(e.key,n),id:`${I}-fold-${l=e.key,[...l].map(e=>/[A-Za-z0-9_-]/.test(e)?e:`-u${e.codePointAt(0).toString(16)}-`).join("")}`,level:N,children:n});var l},J=e=>E&&e!==M,W=({name:e,field:a,bucket:o,fold:i})=>/* @__PURE__ */j("div",{className:"es-insp-row","data-field":e,"data-bucket":o,hidden:!!J(o)||void 0,children:/* @__PURE__ */j(Z,{field:a,name:e,id:`${I}-${e}`,value:n[e],onChange:n=>l(e,n),readOnly:t,context:r,renderers:m,openItem:z&&z.name===e?z.index:null,onOpenItem:n=>H(null===n?null:{panel:I,name:e,index:n}),headingLevel:i?K(N):N})},e);/* @__PURE__ */
17
+ return j(G,{...e,field:t});case"array":/* @__PURE__ */
18
+ return j(J,{...e,field:t});case"slot":return null}}var W=e=>t.includes(e);function X(e){let n,l=t[0];const a=[],r=/* @__PURE__ */new Set;for(const[t,o]of Object.entries(e))o&&(W(o.bucket)&&((o.marker||o.bucket!==l)&&(n=void 0),l=o.bucket),o.marker&&"string"==typeof o.fold?n={key:t,title:o.fold}:o.marker&&!1===o.fold&&(n=void 0),o.marker||!1===o.visible||(a.push(n?{name:t,field:o,bucket:l,fold:n}:{name:t,field:o,bucket:l}),"slot"!==o.type&&r.add(l)));return{rows:a,buckets:t.filter(e=>r.has(e))}}function q(e){return new Map(X(e).rows.map(e=>[e.name,e.bucket]))}function Q(e){const n=[];for(const l of e){const e=n[n.length-1];e&&e.fold?.key===l.fold?.key?e.rows.push(l):n.push({fold:l.fold,rows:[l]})}return n}function U({fields:e,values:n,onChange:l,readOnly:t=!1,context:r,tab:i,onTab:s,tabs:c=!0,tabIcons:d,renderers:m,idPrefix:p,ariaLabel:h,lead:f,children:b,leadFold:g,closedFolds:v,onFold:y,headingLevel:N=3}){const O=u("panel",o),S=$(),I=p??`es-insp${S.replace(/:/g,"")}`,L=X(e),[P,F]=C(void 0),A=i??P,M=A&&L.buckets.includes(A)?A:L.buckets[0],[T,H]=C(null),z=T&&T.panel===I&&L.rows.some(e=>e.name===T.name)?T:null,E=c&&L.buckets.length>1,R=E&&M?k(I,M):`${I}-rows`,[B,Y]=C(()=>/* @__PURE__ */new Set),V=v??B,G=(e,n)=>{/* @__PURE__ */return j(a,{title:e.title,open:!V.has(e.key),onToggle:n=>((e,n)=>{void 0===v&&Y(l=>{const t=new Set(l);return n?t.delete(e):t.add(e),t}),y?.(e,n)})(e.key,n),id:`${I}-fold-${l=e.key,[...l].map(e=>/[A-Za-z0-9_-]/.test(e)?e:`-u${e.codePointAt(0).toString(16)}-`).join("")}`,level:N,children:n});var l},J=e=>E&&e!==M,W=({name:e,field:a,bucket:o,fold:i})=>/* @__PURE__ */j("div",{className:"es-insp-row","data-field":e,"data-bucket":o,hidden:!!J(o)||void 0,children:/* @__PURE__ */j(Z,{field:a,name:e,id:`${I}-${e}`,value:n[e],onChange:n=>l(e,n),readOnly:t,context:r,renderers:m,openItem:z&&z.name===e?z.index:null,onOpenItem:n=>H(null===n?null:{panel:I,name:e,index:n}),headingLevel:i?K(N):N})},e);/* @__PURE__ */
19
19
  return D("div",{className:"es-insp",children:[E?/* @__PURE__ */j("div",{className:"es-insp-tabs",children:/* @__PURE__ */j(x,{variant:"underline",block:!0,"aria-label":h??O.settings,idPrefix:I,value:M,onChange:e=>{const n=e;void 0===i&&F(n),s?.(n)},items:L.buckets.map(e=>{const n=O.buckets[e],l=d?.[e];return l?{id:e,icon:l,label:/* @__PURE__ */j("span",{className:"sr-only",children:n}),tooltip:n}:{id:e,label:n}})})}):null,
20
20
  /* @__PURE__ */D("div",{className:"es-insp-rows",id:R,role:E?"tabpanel":void 0,"aria-labelledby":E&&M?w(I,M):void 0,children:[f?g?/* @__PURE__ */j("div",{className:"es-insp-band","data-fold":g.key,children:G(g,f)}):f:null,Q(L.rows).map((e,n)=>{if(!e.fold)return e.rows.map(W);const l=e.rows[0].bucket,t=e.rows.every(e=>"slot"===e.field.type);/* @__PURE__ */
21
21
  return j("div",{className:"es-insp-band","data-fold":e.fold.key,"data-bucket":l,hidden:!(!J(l)&&!t)||void 0,children:G(e.fold,e.rows.map(W))},`fold-${e.fold.key}-${n}`)}),b]})]})}export{M as FieldText,U as Inspector,Z as InspectorField,Y as ListField,q as bucketsOf,E as copyItem,T as insertAt,V as labelOf,H as moveTo,X as planFields,z as removeAt};
@@ -1 +1 @@
1
- import{useScreenBlockRules as e}from"./chunk-FJRAYUCX.js";import{newNodeId as t,ROOT_ZONE as n}from"./chunk-PLVEGYK6.js";import{useEasel as o,useEaselApi as r}from"./chunk-K5744MTM.js";import{useMemo as s}from"react";function i(i={}){const{dispatch:p}=o(e=>e),d=r(),c=!0===i.readOnly,a=e().resolveOnInsert,l=!0===(i.resolveOnInsert??a),m=!0===i.foldIntoHistory;return s(()=>{const e=m?e=>p({...e,recordHistory:!1}):p,o=(n,o,r)=>{const s=t(o);return c||e({type:"insert",componentType:o,destinationZone:n,destinationIndex:r,id:s}),s},r=e=>(l&&!c&&d.resolveNode(e,{trigger:"insert"}),e),s=(t,n,o)=>{c||e({type:"replace",destinationZone:t,destinationIndex:n,data:o})},i=(e,t,n)=>r(o(e,t,n));return{insertComponent:i,insertSection:(e,t)=>i(n,e,t),replaceComponent:s,seedChild:(e,t,n,i)=>{const p=o(e,n,t);s(e,t,{type:n,props:{id:p,...i}}),r(p)},insertNode:(e,t,n)=>{const i=o(e,n.type,t);return s(e,t,{type:n.type,props:{...n.props,id:i}}),r(i)},removeComponent:(t,n)=>{c||e({type:"remove",index:n,zone:t})},reorderComponent:(t,n,o)=>{c||e({type:"reorder",sourceIndex:n,destinationIndex:o,destinationZone:t})},duplicateComponent:(t,n)=>{c||e({type:"duplicate",sourceIndex:n,sourceZone:t})},select:e=>p({type:"setUi",ui:{itemSelector:e}}),setDocument:t=>{c||e({type:"setData",data:t})},commitDocument:(t,n)=>{c||(m?d.batch(()=>{e({type:"setData",data:t}),void 0!==n&&("slot"===n?.kind?d.selectSlot({parentId:n.parentId,slot:n.slot}):d.select(n?n.id:null))}):d.run({data:t,select:n}))}}},[p,c,l,d,m])}export{i as useSectionOps};
1
+ import{useScreenBlockRules as e}from"./chunk-CWTAS5R6.js";import{newNodeId as t,ROOT_ZONE as n}from"./chunk-PLVEGYK6.js";import{useEasel as o,useEaselApi as r}from"./chunk-K5744MTM.js";import{useMemo as s}from"react";function i(i={}){const{dispatch:p}=o(e=>e),d=r(),c=!0===i.readOnly,a=e().resolveOnInsert,l=!0===(i.resolveOnInsert??a),m=!0===i.foldIntoHistory;return s(()=>{const e=m?e=>p({...e,recordHistory:!1}):p,o=(n,o,r)=>{const s=t(o);return c||e({type:"insert",componentType:o,destinationZone:n,destinationIndex:r,id:s}),s},r=e=>(l&&!c&&d.resolveNode(e,{trigger:"insert"}),e),s=(t,n,o)=>{c||e({type:"replace",destinationZone:t,destinationIndex:n,data:o})},i=(e,t,n)=>r(o(e,t,n));return{insertComponent:i,insertSection:(e,t)=>i(n,e,t),replaceComponent:s,seedChild:(e,t,n,i)=>{const p=o(e,n,t);s(e,t,{type:n,props:{id:p,...i}}),r(p)},insertNode:(e,t,n)=>{const i=o(e,n.type,t);return s(e,t,{type:n.type,props:{...n.props,id:i}}),r(i)},removeComponent:(t,n)=>{c||e({type:"remove",index:n,zone:t})},reorderComponent:(t,n,o)=>{c||e({type:"reorder",sourceIndex:n,destinationIndex:o,destinationZone:t})},duplicateComponent:(t,n)=>{c||e({type:"duplicate",sourceIndex:n,sourceZone:t})},select:e=>p({type:"setUi",ui:{itemSelector:e}}),setDocument:t=>{c||e({type:"setData",data:t})},commitDocument:(t,n)=>{c||(m?d.batch(()=>{e({type:"setData",data:t}),void 0!==n&&("slot"===n?.kind?d.selectSlot({parentId:n.parentId,slot:n.slot}):d.select(n?n.id:null))}):d.run({data:t,select:n}))}}},[p,c,l,d,m])}export{i as useSectionOps};
@@ -1,7 +1,7 @@
1
- import{clientOnly as r}from"./chunk-GXQCZJOP.js";import{ScreenStoreProvider as n}from"./chunk-EJZ4RIRW.js";import{ScreenChrome as e}from"./chunk-KSKKRGNQ.js";import{ScreenDocumentProvider as i,useScreenDocument as a}from"./chunk-THZ46DC5.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-JTUUIVBZ.js";import{documentPermissions as s}from"./chunk-THWO5YVZ.js";import{useWords as c}from"./chunk-MFIRYGHW.js";import{useMemo as t,useState as d,useRef as l,useEffect as m,useCallback as g}from"react";import{Dialog as h,Button as f}from"efficient-shell/ui";import{jsx as u,jsxs as p,Fragment as v}from"react/jsx-runtime";var k=r(n),C=r(e);function N({onCancel:r,onDiscard:n,onSave:e}){const i=c("screen",o).leave,[a,s]=d(!1),t=l(!0);m(()=>(t.current=!0,()=>{t.current=!1}),[]);const k=g(async()=>{s(!0);try{await e()}finally{t.current&&s(!1)}},[e]);/* @__PURE__ */
1
+ import{clientOnly as r}from"./chunk-GXQCZJOP.js";import{ScreenStoreProvider as n}from"./chunk-DQZYXC3V.js";import{ScreenChrome as e}from"./chunk-7CIFWFP2.js";import{ScreenDocumentProvider as i,useScreenDocument as a}from"./chunk-THZ46DC5.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-JTUUIVBZ.js";import{documentPermissions as s}from"./chunk-THWO5YVZ.js";import{useWords as c}from"./chunk-MFIRYGHW.js";import{useMemo as t,useState as d,useRef as l,useEffect as m,useCallback as g}from"react";import{Dialog as h,Button as f}from"efficient-shell/ui";import{jsx as u,jsxs as p,Fragment as v}from"react/jsx-runtime";var C=r(n),k=r(e);function j({onCancel:r,onDiscard:n,onSave:e}){const i=c("screen",o).leave,[a,s]=d(!1),t=l(!0);m(()=>(t.current=!0,()=>{t.current=!1}),[]);const C=g(async()=>{s(!0);try{await e()}finally{t.current&&s(!1)}},[e]);/* @__PURE__ */
2
2
  return u(h,{open:!0,role:"alertdialog",size:"sm",title:i.title,onClose:r,footer:/* @__PURE__ */p(v,{children:[
3
3
  /* @__PURE__ */u(f,{variant:"secondary",onClick:r,children:i.cancel}),
4
4
  /* @__PURE__ */u(f,{variant:"ghost-danger",onClick:n,children:i.discard}),
5
- /* @__PURE__ */u(f,{variant:"primary",loading:a,onClick:()=>{k()},children:i.save})]}),children:i.body})}function j({target:r,addressing:n,onHostMessage:e,children:a}){/* @__PURE__ */
6
- return u(i,{target:r,addressing:n,onHostMessage:e,children:a})}var y=(r,n)=>/* @__PURE__ */p(v,{children:[r,n]});function H({config:r,parts:n,wrap:e=y}){const{data:i,error:d,redirecting:l,ready:m,readOnly:g,onChange:h,pendingNav:f,cancelPendingNav:p,discardAndNavigate:v,saveAndNavigate:j}=a(),H=t(()=>s(!g),[g]),Z=c("screen",o);return l?/* @__PURE__ */u("div",{className:"sf-msg",children:Z.loading}):d?/* @__PURE__ */u("div",{className:"sf-msg sf-msg--error",children:d}):m?i?e(
7
- /* @__PURE__ */u(k,{config:r,data:i,onChange:h,permissions:H,parts:n,children:/* @__PURE__ */u(C,{})}),f&&/* @__PURE__ */u(N,{onCancel:p,onDiscard:v,onSave:j})):/* @__PURE__ */u("div",{className:"sf-msg",children:Z.loading}):/* @__PURE__ */u("div",{className:"sf-msg",children:Z.waitingForAuthorization})}export{H as DocumentScreen,j as ScreenMount};
5
+ /* @__PURE__ */u(f,{variant:"primary",loading:a,onClick:()=>{C()},children:i.save})]}),children:i.body})}function y({target:r,addressing:n,onHostMessage:e,children:a}){/* @__PURE__ */
6
+ return u(i,{target:r,addressing:n,onHostMessage:e,children:a})}var N=(r,n)=>/* @__PURE__ */p(v,{children:[r,n]});function H({config:r,parts:n,wrap:e=N}){const{data:i,error:d,redirecting:l,ready:m,readOnly:g,onChange:h,pendingNav:f,cancelPendingNav:p,discardAndNavigate:v,saveAndNavigate:y}=a(),H=t(()=>s(!g),[g]),Z=c("screen",o);return l?/* @__PURE__ */u("div",{className:"sf-msg",children:Z.loading}):d?/* @__PURE__ */u("div",{className:"sf-msg sf-msg--error",children:d}):m?i?e(
7
+ /* @__PURE__ */u(C,{config:r,data:i,onChange:h,permissions:H,parts:n,children:/* @__PURE__ */u(k,{})}),f&&/* @__PURE__ */u(j,{onCancel:p,onDiscard:v,onSave:y})):/* @__PURE__ */u("div",{className:"sf-msg",children:Z.loading}):/* @__PURE__ */u("div",{className:"sf-msg",children:Z.waitingForAuthorization})}export{H as DocumentScreen,y as ScreenMount};
@@ -1 +1 @@
1
- export{FieldText,Inspector,InspectorField,LinkPicker,ListField,bucketsOf,copyItem,insertAt,labelOf,moveTo,planFields,removeAt}from"../chunk-PEDDDWSG.js";export{FieldSelect,FieldSlider,optionFor}from"../chunk-OZ72A6MY.js";import"../chunk-4JSBIW5H.js";import"../chunk-GZH4UVDH.js";import"../chunk-K56YDHYQ.js";import"../chunk-KFV7N2DJ.js";export{useResolvedFields}from"../chunk-YRLPFZW3.js";import"../chunk-EA2HTX37.js";export{FieldNumber}from"../chunk-66LWADFP.js";import"../chunk-QLD57GBB.js";import"../chunk-FFYXVAAL.js";import"../chunk-MFIRYGHW.js";import"../chunk-67GNT6PF.js";import"../chunk-P2VEMZH5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
1
+ export{FieldText,Inspector,InspectorField,LinkPicker,ListField,bucketsOf,copyItem,insertAt,labelOf,moveTo,planFields,removeAt}from"../chunk-UCLVWF5E.js";import"../chunk-4JSBIW5H.js";export{FieldSelect,FieldSlider,optionFor}from"../chunk-OZ72A6MY.js";import"../chunk-GZH4UVDH.js";import"../chunk-K56YDHYQ.js";import"../chunk-KFV7N2DJ.js";export{useResolvedFields}from"../chunk-YRLPFZW3.js";import"../chunk-EA2HTX37.js";export{FieldNumber}from"../chunk-66LWADFP.js";import"../chunk-QLD57GBB.js";import"../chunk-FFYXVAAL.js";import"../chunk-MFIRYGHW.js";import"../chunk-67GNT6PF.js";import"../chunk-P2VEMZH5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{AddBlockRow as default}from"../../chunk-X5SPTRG3.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-FJRAYUCX.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-JTUUIVBZ.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-PEDDDWSG.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-GZH4UVDH.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{AddBlockRow as default}from"../../chunk-IEKQTWQG.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-CWTAS5R6.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-JTUUIVBZ.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-UCLVWF5E.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-GZH4UVDH.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -34,6 +34,10 @@ type AddSidePanelProps<I> = {
34
34
  label: string;
35
35
  onClear: () => void;
36
36
  };
37
+ /** Which sections and saved sections are offered, by the section's type
38
+ * (8.3.0): opened at a group's list, only what the group takes. Absent:
39
+ * every section. */
40
+ sectionAccepts?: (sectionType: string) => boolean;
37
41
  /** Add what a tile names. */
38
42
  onAdd: (key: AddKey) => void;
39
43
  /** The drag item for what a tile names — a drag in the editor's session. */
@@ -49,6 +53,6 @@ type AddSidePanelProps<I> = {
49
53
  onHide?: () => void;
50
54
  readOnly?: boolean;
51
55
  };
52
- declare function AddSidePanel<I>({ blocks, blocksOnly, at, onAdd, itemFor, session, siteWide, onClose, onHide, readOnly, }: AddSidePanelProps<I>): react.JSX.Element;
56
+ declare function AddSidePanel<I>({ blocks, blocksOnly, at, sectionAccepts, onAdd, itemFor, session, siteWide, onClose, onHide, readOnly, }: AddSidePanelProps<I>): react.JSX.Element;
53
57
 
54
58
  export { type AddKey, type AddSidePanelProps, blockKey, AddSidePanel as default, sectionKey, templateKey };
@@ -1 +1 @@
1
- export{blockKey,AddSidePanel as default,sectionKey,templateKey}from"../../chunk-RMB2VGNY.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-BVN33R76.js";import"../../chunk-XTJCKV6Z.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-FJRAYUCX.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-JTUUIVBZ.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-PEDDDWSG.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-GZH4UVDH.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-QVUVDBGA.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-FCLW4LEN.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{blockKey,AddSidePanel as default,sectionKey,templateKey}from"../../chunk-KIA6EKAM.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-BVN33R76.js";import"../../chunk-XTJCKV6Z.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-CWTAS5R6.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-JTUUIVBZ.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-UCLVWF5E.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-GZH4UVDH.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-QVUVDBGA.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-FCLW4LEN.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{MediaSidePanel as default}from"../../chunk-ZVEJ25YG.js";import"../../chunk-FJRAYUCX.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-PEDDDWSG.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-GZH4UVDH.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-QVUVDBGA.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{MediaSidePanel as default}from"../../chunk-NOD4ATKF.js";import"../../chunk-CWTAS5R6.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-UCLVWF5E.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-GZH4UVDH.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-QVUVDBGA.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{ScreenChrome as default}from"../../chunk-KSKKRGNQ.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-BRDCD4LK.js";import"../../chunk-FGNR22NY.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-OGCROOTI.js";import"../../chunk-7F52SZOI.js";import"../../chunk-MQNBD6AB.js";import"../../chunk-BHRC3ASL.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-OWW44DVK.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-DPKWJTNX.js";import"../../chunk-VNN6VB4V.js";import"../../chunk-NMUS2VVD.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-D6N77AOS.js";import"../../chunk-NCQSBU3O.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-HDUAODXJ.js";import"../../chunk-RKTF5XLP.js";import"../../chunk-THZ46DC5.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-V7U33NF2.js";import"../../chunk-5545A3PC.js";import"../../chunk-RMB2VGNY.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-BVN33R76.js";import"../../chunk-XTJCKV6Z.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-ZVEJ25YG.js";import"../../chunk-FJRAYUCX.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-JTUUIVBZ.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-PEDDDWSG.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-GZH4UVDH.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-BXMXTO36.js";import"../../chunk-EA2HTX37.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-4VJATVVR.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-QVUVDBGA.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-FCLW4LEN.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{ScreenChrome as default}from"../../chunk-7CIFWFP2.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-BRDCD4LK.js";import"../../chunk-FGNR22NY.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-OGCROOTI.js";import"../../chunk-7F52SZOI.js";import"../../chunk-MQNBD6AB.js";import"../../chunk-BHRC3ASL.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-OWW44DVK.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-DPKWJTNX.js";import"../../chunk-HA33IXEU.js";import"../../chunk-VF6TCI62.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-D6N77AOS.js";import"../../chunk-NCQSBU3O.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-HDUAODXJ.js";import"../../chunk-RKTF5XLP.js";import"../../chunk-THZ46DC5.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-V7U33NF2.js";import"../../chunk-5545A3PC.js";import"../../chunk-KIA6EKAM.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-BVN33R76.js";import"../../chunk-XTJCKV6Z.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-NOD4ATKF.js";import"../../chunk-CWTAS5R6.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-JTUUIVBZ.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-UCLVWF5E.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-GZH4UVDH.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-BXMXTO36.js";import"../../chunk-EA2HTX37.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-4VJATVVR.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-QVUVDBGA.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-FCLW4LEN.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{DocumentScreen,ScreenMount as default}from"../../chunk-35TOFLH6.js";import"../../chunk-GXQCZJOP.js";import"../../chunk-EJZ4RIRW.js";import"../../chunk-KSKKRGNQ.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-BRDCD4LK.js";import"../../chunk-FGNR22NY.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-OGCROOTI.js";import"../../chunk-7F52SZOI.js";import"../../chunk-MQNBD6AB.js";import"../../chunk-BHRC3ASL.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-OWW44DVK.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-DPKWJTNX.js";import"../../chunk-VNN6VB4V.js";import"../../chunk-NMUS2VVD.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-D6N77AOS.js";import"../../chunk-NCQSBU3O.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-HDUAODXJ.js";import"../../chunk-RKTF5XLP.js";import"../../chunk-THZ46DC5.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-V7U33NF2.js";import"../../chunk-5545A3PC.js";import"../../chunk-RMB2VGNY.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-BVN33R76.js";import"../../chunk-XTJCKV6Z.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-ZVEJ25YG.js";import"../../chunk-FJRAYUCX.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-JTUUIVBZ.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-PEDDDWSG.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-GZH4UVDH.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-BXMXTO36.js";import"../../chunk-EA2HTX37.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-4VJATVVR.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-QVUVDBGA.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-FCLW4LEN.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{DocumentScreen,ScreenMount as default}from"../../chunk-ZG5T7RSV.js";import"../../chunk-GXQCZJOP.js";import"../../chunk-DQZYXC3V.js";import"../../chunk-7CIFWFP2.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-BRDCD4LK.js";import"../../chunk-FGNR22NY.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-OGCROOTI.js";import"../../chunk-7F52SZOI.js";import"../../chunk-MQNBD6AB.js";import"../../chunk-BHRC3ASL.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-OWW44DVK.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-DPKWJTNX.js";import"../../chunk-HA33IXEU.js";import"../../chunk-VF6TCI62.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-D6N77AOS.js";import"../../chunk-NCQSBU3O.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-HDUAODXJ.js";import"../../chunk-RKTF5XLP.js";import"../../chunk-THZ46DC5.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-V7U33NF2.js";import"../../chunk-5545A3PC.js";import"../../chunk-KIA6EKAM.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-BVN33R76.js";import"../../chunk-XTJCKV6Z.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-NOD4ATKF.js";import"../../chunk-CWTAS5R6.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-JTUUIVBZ.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-UCLVWF5E.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-GZH4UVDH.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-BXMXTO36.js";import"../../chunk-EA2HTX37.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-4VJATVVR.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-QVUVDBGA.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-FCLW4LEN.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{ScreenStoreProvider as default}from"../../chunk-EJZ4RIRW.js";import"../../chunk-FJRAYUCX.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-PEDDDWSG.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-GZH4UVDH.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{ScreenStoreProvider as default}from"../../chunk-DQZYXC3V.js";import"../../chunk-CWTAS5R6.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-UCLVWF5E.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-GZH4UVDH.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1,16 +1,16 @@
1
- import{AddBlockRow as e}from"../../chunk-X5SPTRG3.js";import{slotChildRowName as n}from"../../chunk-BHRC3ASL.js";import"../../chunk-6W7WLPZH.js";import{scrollPreviewToSection as o,gotoPreviewSlide as r}from"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import{useEaselUndoKeys as t}from"../../chunk-OWW44DVK.js";import{SlotChildActionsProvider as s}from"../../chunk-KCBEE2MC.js";import{DEFAULT_PANEL_W as i}from"../../chunk-DPKWJTNX.js";import{usePartBridge as c}from"../../chunk-VNN6VB4V.js";import{useSectionOps as p}from"../../chunk-NMUS2VVD.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import{useScreenDocument as l}from"../../chunk-THZ46DC5.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import{MediaSidePanel as m}from"../../chunk-ZVEJ25YG.js";import{SELECTION_MODE as d,useScreenPinned as a,useScreenCanvasFrame as u,useScreenInspectorPanel as h,useScreenPickFollowsSelection as k,sameInspectorMode as f,useStandaloneScreenBridges as j,useScreenBlockLook as S,useScreenBlockRules as y}from"../../chunk-FJRAYUCX.js";import{slotFieldsOf as N,nestsInTree as C}from"../../chunk-PLVEGYK6.js";import{useMediaPanel as A,usePanelPick as x,useCancelPanelPick as B}from"../../chunk-R6WTQWAC.js";import{useHostEscape as P}from"../../chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as D}from"../../chunk-JTUUIVBZ.js";import{useEasel as R}from"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-PEDDDWSG.js";import"../../chunk-OZ72A6MY.js";import{LayersTree as V,Subtree as v,TreeRow as g,TreeRowAction as L,TreeSeam as O}from"../../chunk-4JSBIW5H.js";import"../../chunk-GZH4UVDH.js";import{DEFAULT_TREE_WORDS as w}from"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-NDRZP6YR.js";import{DEFAULT_SAVE_WORDS as z,saveIndicator as E}from"../../chunk-H6DDIBQ4.js";import{SaveState as M,panelWidthVars as W}from"../../chunk-QVUVDBGA.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import{useWords as b}from"../../chunk-MFIRYGHW.js";import"../../chunk-FCLW4LEN.js";import"../../chunk-O2NLQBFX.js";import{useTreeDrag as F}from"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import{zoneKey as J,parseZoneKey as T}from"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";import{useState as X,useRef as Y,useEffect as G,useCallback as H,Fragment as K}from"react";import{Tooltip as Z}from"efficient-shell/ui";import{TrashIcon as I}from"efficient-shell/icons/efficient";import{jsxs as Q,jsx as U,Fragment as $}from"react/jsx-runtime";var q=e=>n=>{n.target.closest("button, input")||e()},_={rowClick:q};function ee(){const{saveState:ee,readOnly:ne,readOnlyReason:oe=null}=l(),re=p(),{appState:te,selectedItem:se,config:ie}=R(e=>e),[ce,pe]=X(d),le=b("screen",D),me=b("tree",w),de=b("save",z),{first:ae,last:ue,panelOf:he}=a(),ke=he(ae),fe=u(),je=h(),Se=te.data.content?.[0]??null,ye=Se?.props.id??null,Ne=Se?.type===ae,Ce=Se?.type===ue,Ae=Y(null),xe=Y(null);t(xe);const Be=A(),Pe=x(),De=B();k(se?.props.id),G(()=>{const e=xe.current;if(!Pe||!e)return;const n=e=>{"Escape"===e.key&&De()};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)},[Pe]),P(null!==Pe,()=>De()),G(()=>{ye&&Ae.current!==ye&&(Ae.current=ye,Ne?pe(ke??d):se||re.select({index:0}))},[ye,se,re,Ne]);const Re=H(e=>pe(n=>f(n,e)?n:e),[]),Ve=j({kind:ce.kind,mode:ce,open:Re,show:e=>pe(e),reveal:()=>{},select:(e,n)=>{pe(e=>f(e,n)?e:n),re.select(e)}}),{selectNode:ve}=c({mode:ce,setMode:pe,onOpenPart:o}),ge=S(),{labelAtLevel:Le,Icon:Oe}=ge,{canAddTo:we}=y(),ze=e=>Le(e,"block",ie.components[e]?.label??e),Ee=e=>Le(e,"section",ze(e)),Me=!Ne&&"puck"===ce.kind&&se?.props.id===ye,We=Se?we(Se.type)?.spec??null:null,be=Se&&We?`${Se.props.id}:${We.slot}`:null,Fe=Se&&We&&Array.isArray(Se.props[We.slot])?Se.props[We.slot]:[],Je=e=>n(e,ze,ge.plainText),Te=(e,n)=>{Se&&We&&be&&(pe(d),We.slider?(r(String(Se.props.id),e),re.select({index:e,zone:be}),o(String(Se.props.id))):(re.select({index:e,zone:be}),o(n)))},Xe=()=>{if(!Se||!We||!be)return;const e=Fe.length;re.insertComponent(be,We.childType,e),pe(d),We.slider?requestAnimationFrame(()=>{r(String(Se.props.id),e),re.select({index:e,zone:be})}):re.select({index:e,zone:be})},Ye=e=>N(ie,e),Ge=e=>{const{parentId:n,slot:o}=T(e),r=e=>{if(!e)return null;if(String(e.props.id)===n)return e;for(const n of Ye(e.type)){const o=Array.isArray(e.props[n])?e.props[n]:[];for(const e of o){const n=r(e);if(n)return n}}return null},t=r(Se)?.props[o];return Array.isArray(t)?t.length:0},He=(e,n,o)=>{const r=Math.min(Math.max(o,0),Ge(e)),t=n<r?r-1:r;t!==n&&(re.reorderComponent(e,n,t),pe(d),re.select({index:t,zone:e}))},Ke=F({keyOf:e=>e.id,readOnly:Boolean(ne),canDrop:(e,n)=>J(n)===e.zone&&n.index>=0&&n.index<=Ge(e.zone),onDrop:(e,n)=>He(e.zone,e.index,n.index),onStep:(e,n)=>He(e.zone,e.index,n<0?e.index-1:e.index+2)}),Ze=(e,n)=>/* @__PURE__ */U(O,{...ne?{}:Ke.seam({place:{...T(e),index:n}})},`seam:${e}:${n}`),Ie=e=>ge.blockRowName(e,ze),Qe=(e,n,r)=>{pe(d),re.select({index:n,zone:e}),o(r)},Ue=(e,n,o)=>{re.insertComponent(e,n,o),pe(d),re.select({index:o,zone:e})},$e=(n,o,r)=>/* @__PURE__ */U(e,{choices:r,onPick:e=>Ue(n,e,o)}),qe=(e,n)=>{const o=Ye((r=e).type).flatMap(e=>(Array.isArray(r.props[e])?r.props[e]:[]).map((n,o)=>({child:n,zone:`${r.props.id}:${e}`,index:o})));var r;const t=we(e.type),s=t?.choices??null,i="footer"===t?.source?Ie:Je;/* @__PURE__ */
2
- return Q($,{children:[o.map(({child:e,zone:o,index:r})=>{const t=se?.props.id===e.props.id,s=C(ie,e.type,n),c=i(e),p=String(e.props.id),l=()=>Qe(o,r,p),{rowProps:m,...a}=Ke.row({item:{id:p,zone:o,index:r},place:{...T(o),index:r}},{onClick:q(l)});/* @__PURE__ */
3
- return Q(K,{children:[0===r&&Ze(o,0),
4
- /* @__PURE__ */U(g,{words:me,icon:/* @__PURE__ */U(Oe,{type:e.type,size:13}),name:c,selected:t,onSelect:l,...a,actions:/* @__PURE__ */U(L,{kind:"delete",label:le.deleteNamed({name:c}),onClick:()=>{return e=o,n=r,re.removeComponent(e,n),pe(d),void re.select(null);var e,n},children:/* @__PURE__ */U(I,{size:13})}),rowProps:m}),s&&/* @__PURE__ */U(v,{children:qe(e,n+1)}),Ze(o,r+1)]},String(e.props.id??`${o}-${r}`))}),t&&s?$e(`${e.props.id}:${t.slot}`,o.length,s):null]})},_e="HeroSingle"===Se?.type,en=Boolean(Se)&&(Boolean(we(Se.type))||Ye(Se.type).length>0),nn=Boolean(Se)&&(Boolean(We)||Ce||Ne||_e||en);/* @__PURE__ */
5
- return Q("div",{ref:xe,className:"sf-editor es-editor",style:W(i),children:[
6
- /* @__PURE__ */U("div",{className:"sf-section-bar",children:/* @__PURE__ */U(M,null!==oe?{tone:"off",label:oe,role:"status"}:{...E(ee,de),role:"status"})}),
7
- /* @__PURE__ */Q("div",{className:"sf-body",children:[Pe&&Be?/* @__PURE__ */U("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:/* @__PURE__ */U(m,{panel:Be,pick:Pe})}):nn&&Se&&/* @__PURE__ */Q("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:[
8
- /* @__PURE__ */U("div",{className:"sf-panel-head",children:/* @__PURE__ */U(Z,{content:Ne?le.headerSettings:le.sectionSettings({name:Ee(Se.type)}),side:"bottom",children:/* @__PURE__ */U("button",{type:"button",className:"sf-panel-title sf-panel-title--btn "+(Me?"is-selected":""),"aria-pressed":Me,onClick:()=>{Ne?pe(ke??d):(pe(d),re.select({index:0}))},children:Ee(Se.type)})})}),
9
- /* @__PURE__ */U(V,{className:"sf-tree sf-scroll",rootProps:Ke.rootProps(),words:me,children:/* @__PURE__ */U(v,{children:Ne?
10
- /* @__PURE__ */U(g,{words:me,icon:/* @__PURE__ */U(Oe,{type:"header",size:13}),name:le.headerSettings,selected:ce.kind===ke?.kind,onSelect:()=>pe(ke??d),rowProps:{onClick:q(()=>pe(ke??d))}}):We?/* @__PURE__ */Q($,{children:[Fe.map((e,n)=>{const o=se?.props.id===e.props.id,r=Je(e),t=String(e.props.id),s=()=>Te(n,t),{rowProps:i,...c}=Ke.row({item:{id:t,zone:be,index:n},place:{...T(be),index:n}},{onClick:q(s)});/* @__PURE__ */
11
- return Q(K,{children:[0===n&&Ze(be,0),
12
- /* @__PURE__ */U(g,{words:me,icon:/* @__PURE__ */U(Oe,{type:e.type,size:13}),name:r,selected:o,onSelect:s,...c,actions:/* @__PURE__ */U(L,{kind:"delete",label:le.deleteNamed({name:r}),onClick:()=>{return e=n,void(be&&(re.removeComponent(be,e),pe(d),re.select(null)));var e},children:/* @__PURE__ */U(I,{size:13})}),rowProps:i}),Ze(be,n+1)]},String(e.props.id??n))}),
13
- /* @__PURE__ */Q("button",{type:"button",className:"sf-add-card",onClick:Xe,children:[
14
- /* @__PURE__ */U("span",{className:"sf-plus sf-plus--sm",children:"+"}),We.addLabel]}),ye?Ve.partRows?.(Se,_):null]}):qe(Se,1)})})]}),
1
+ import{AddBlockRow as e}from"../../chunk-IEKQTWQG.js";import{slotChildRowName as n}from"../../chunk-BHRC3ASL.js";import"../../chunk-6W7WLPZH.js";import{scrollPreviewToSection as o,gotoPreviewSlide as r}from"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import{useEaselUndoKeys as t}from"../../chunk-OWW44DVK.js";import{SlotChildActionsProvider as s}from"../../chunk-KCBEE2MC.js";import{DEFAULT_PANEL_W as i}from"../../chunk-DPKWJTNX.js";import{usePartBridge as c}from"../../chunk-HA33IXEU.js";import{useSectionOps as p}from"../../chunk-VF6TCI62.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import{useScreenDocument as l}from"../../chunk-THZ46DC5.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import{MediaSidePanel as m}from"../../chunk-NOD4ATKF.js";import{SELECTION_MODE as d,useScreenPinned as a,useScreenCanvasFrame as u,useScreenInspectorPanel as h,useScreenPickFollowsSelection as k,sameInspectorMode as f,useStandaloneScreenBridges as j,useScreenBlockLook as y,useScreenBlockRules as S}from"../../chunk-CWTAS5R6.js";import{slotFieldsOf as N,nestsInTree as C}from"../../chunk-PLVEGYK6.js";import{useMediaPanel as A,usePanelPick as x,useCancelPanelPick as B}from"../../chunk-R6WTQWAC.js";import{useHostEscape as v}from"../../chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as P}from"../../chunk-JTUUIVBZ.js";import{useEasel as R}from"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-UCLVWF5E.js";import{LayersTree as L,Subtree as O,TreeRow as W,TreeRowAction as g,TreeSeam as D}from"../../chunk-4JSBIW5H.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-GZH4UVDH.js";import{DEFAULT_TREE_WORDS as E}from"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-NDRZP6YR.js";import{DEFAULT_SAVE_WORDS as T,saveIndicator as w}from"../../chunk-H6DDIBQ4.js";import{SaveState as z,panelWidthVars as F}from"../../chunk-QVUVDBGA.js";import"../../chunk-Y2G7CU6A.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import{useWords as V}from"../../chunk-MFIRYGHW.js";import"../../chunk-FCLW4LEN.js";import"../../chunk-O2NLQBFX.js";import{useTreeDrag as b}from"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import{zoneKey as M,parseZoneKey as H}from"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";import{useState as K,useRef as X,useEffect as I,useCallback as J,Fragment as Y}from"react";import{Tooltip as G}from"efficient-shell/ui";import{TrashIcon as Q}from"efficient-shell/icons/efficient";import{jsxs as Z,jsx as U,Fragment as $}from"react/jsx-runtime";var q=e=>n=>{n.target.closest("button, input")||e()},_={rowClick:q};function ee(){const{saveState:ee,readOnly:ne,readOnlyReason:oe=null}=l(),re=p(),{appState:te,selectedItem:se,config:ie}=R(e=>e),[ce,pe]=K(d),le=V("screen",P),me=V("tree",E),de=V("save",T),{first:ae,last:ue,panelOf:he}=a(),ke=he(ae),fe=u(),je=h(),ye=te.data.content?.[0]??null,Se=ye?.props.id??null,Ne=ye?.type===ae,Ce=ye?.type===ue,Ae=X(null),xe=X(null);t(xe);const Be=A(),ve=x(),Pe=B();k(se?.props.id),I(()=>{const e=xe.current;if(!ve||!e)return;const n=e=>{"Escape"===e.key&&Pe()};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)},[ve]),v(null!==ve,()=>Pe()),I(()=>{Se&&Ae.current!==Se&&(Ae.current=Se,Ne?pe(ke??d):se||re.select({index:0}))},[Se,se,re,Ne]);const Re=J(e=>pe(n=>f(n,e)?n:e),[]),Le=j({kind:ce.kind,mode:ce,open:Re,show:e=>pe(e),reveal:()=>{},select:(e,n)=>{pe(e=>f(e,n)?e:n),re.select(e)}}),{selectNode:Oe}=c({mode:ce,setMode:pe,onOpenPart:o}),We=y(),{labelAtLevel:ge,Icon:De}=We,{canAddTo:Ee}=S(),Te=e=>ge(e,"block",ie.components[e]?.label??e),we=e=>ge(e,"section",Te(e)),ze=!Ne&&"puck"===ce.kind&&se?.props.id===Se,Fe=ye?Ee(ye.type)?.spec??null:null,Ve=ye&&Fe?`${ye.props.id}:${Fe.slot}`:null,be=ye&&Fe&&Array.isArray(ye.props[Fe.slot])?ye.props[Fe.slot]:[],Me=e=>n(e,Te,We.plainText),He=(e,n)=>{ye&&Fe&&Ve&&(pe(d),Fe.slider?(r(String(ye.props.id),e),re.select({index:e,zone:Ve}),o(String(ye.props.id))):(re.select({index:e,zone:Ve}),o(n)))},Ke=()=>{if(!ye||!Fe||!Ve)return;const e=be.length;re.insertComponent(Ve,Fe.childType,e),pe(d),Fe.slider?requestAnimationFrame(()=>{r(String(ye.props.id),e),re.select({index:e,zone:Ve})}):re.select({index:e,zone:Ve})},Xe=e=>N(ie,e),Ie=e=>{const{parentId:n,slot:o}=H(e),r=e=>{if(!e)return null;if(String(e.props.id)===n)return e;for(const n of Xe(e.type)){const o=Array.isArray(e.props[n])?e.props[n]:[];for(const e of o){const n=r(e);if(n)return n}}return null},t=r(ye)?.props[o];return Array.isArray(t)?t.length:0},Je=(e,n,o)=>{const r=Math.min(Math.max(o,0),Ie(e)),t=n<r?r-1:r;t!==n&&(re.reorderComponent(e,n,t),pe(d),re.select({index:t,zone:e}))},Ye=b({keyOf:e=>e.id,readOnly:Boolean(ne),canDrop:(e,n)=>M(n)===e.zone&&n.index>=0&&n.index<=Ie(e.zone),onDrop:(e,n)=>Je(e.zone,e.index,n.index),onStep:(e,n)=>Je(e.zone,e.index,n<0?e.index-1:e.index+2)}),Ge=(e,n)=>/* @__PURE__ */U(D,{...ne?{}:Ye.seam({place:{...H(e),index:n}})},`seam:${e}:${n}`),Qe=e=>We.blockRowName(e,Te),Ze=(e,n,r)=>{pe(d),re.select({index:n,zone:e}),o(r)},Ue=(e,n,o)=>{re.insertComponent(e,n,o),pe(d),re.select({index:o,zone:e})},$e=(n,o,r)=>/* @__PURE__ */U(e,{choices:r,onPick:e=>Ue(n,e,o)}),qe=(e,n)=>{const o=Xe((r=e).type).flatMap(e=>(Array.isArray(r.props[e])?r.props[e]:[]).map((n,o)=>({child:n,zone:`${r.props.id}:${e}`,index:o})));var r;const t=Ee(e.type),s=t?.choices??null,i="footer"===t?.source?Qe:Me;/* @__PURE__ */
2
+ return Z($,{children:[o.map(({child:e,zone:o,index:r})=>{const t=se?.props.id===e.props.id,s=C(ie,e.type,n),c=i(e),p=String(e.props.id),l=()=>Ze(o,r,p),{rowProps:m,...a}=Ye.row({item:{id:p,zone:o,index:r},place:{...H(o),index:r}},{onClick:q(l)});/* @__PURE__ */
3
+ return Z(Y,{children:[0===r&&Ge(o,0),
4
+ /* @__PURE__ */U(W,{words:me,icon:/* @__PURE__ */U(De,{type:e.type,size:13}),name:c,selected:t,onSelect:l,...a,actions:/* @__PURE__ */U(g,{kind:"delete",label:le.deleteNamed({name:c}),onClick:()=>{return e=o,n=r,re.removeComponent(e,n),pe(d),void re.select(null);var e,n},children:/* @__PURE__ */U(Q,{size:13})}),rowProps:m}),s&&/* @__PURE__ */U(O,{children:qe(e,n+1)}),Ge(o,r+1)]},String(e.props.id??`${o}-${r}`))}),t&&s?$e(`${e.props.id}:${t.slot}`,o.length,s):null]})},_e="HeroSingle"===ye?.type,en=Boolean(ye)&&(Boolean(Ee(ye.type))||Xe(ye.type).length>0),nn=Boolean(ye)&&(Boolean(Fe)||Ce||Ne||_e||en);/* @__PURE__ */
5
+ return Z("div",{ref:xe,className:"sf-editor es-editor",style:F(i),children:[
6
+ /* @__PURE__ */U("div",{className:"sf-section-bar",children:/* @__PURE__ */U(z,null!==oe?{tone:"off",label:oe,role:"status"}:{...w(ee,de),role:"status"})}),
7
+ /* @__PURE__ */Z("div",{className:"sf-body",children:[ve&&Be?/* @__PURE__ */U("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:/* @__PURE__ */U(m,{panel:Be,pick:ve})}):nn&&ye&&/* @__PURE__ */Z("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:[
8
+ /* @__PURE__ */U("div",{className:"sf-panel-head",children:/* @__PURE__ */U(G,{content:Ne?le.headerSettings:le.sectionSettings({name:we(ye.type)}),side:"bottom",children:/* @__PURE__ */U("button",{type:"button",className:"sf-panel-title sf-panel-title--btn "+(ze?"is-selected":""),"aria-pressed":ze,onClick:()=>{Ne?pe(ke??d):(pe(d),re.select({index:0}))},children:we(ye.type)})})}),
9
+ /* @__PURE__ */U(L,{className:"sf-tree sf-scroll",rootProps:Ye.rootProps(),words:me,children:/* @__PURE__ */U(O,{children:Ne?
10
+ /* @__PURE__ */U(W,{words:me,icon:/* @__PURE__ */U(De,{type:"header",size:13}),name:le.headerSettings,selected:ce.kind===ke?.kind,onSelect:()=>pe(ke??d),rowProps:{onClick:q(()=>pe(ke??d))}}):Fe?/* @__PURE__ */Z($,{children:[be.map((e,n)=>{const o=se?.props.id===e.props.id,r=Me(e),t=String(e.props.id),s=()=>He(n,t),{rowProps:i,...c}=Ye.row({item:{id:t,zone:Ve,index:n},place:{...H(Ve),index:n}},{onClick:q(s)});/* @__PURE__ */
11
+ return Z(Y,{children:[0===n&&Ge(Ve,0),
12
+ /* @__PURE__ */U(W,{words:me,icon:/* @__PURE__ */U(De,{type:e.type,size:13}),name:r,selected:o,onSelect:s,...c,actions:/* @__PURE__ */U(g,{kind:"delete",label:le.deleteNamed({name:r}),onClick:()=>{return e=n,void(Ve&&(re.removeComponent(Ve,e),pe(d),re.select(null)));var e},children:/* @__PURE__ */U(Q,{size:13})}),rowProps:i}),Ge(Ve,n+1)]},String(e.props.id??n))}),
13
+ /* @__PURE__ */Z("button",{type:"button",className:"sf-add-card",onClick:Ke,children:[
14
+ /* @__PURE__ */U("span",{className:"sf-plus sf-plus--sm",children:"+"}),Fe.addLabel]}),Se?Le.partRows?.(ye,_):null]}):qe(ye,1)})})]}),
15
15
  /* @__PURE__ */U("div",{className:"sf-center",children:/* @__PURE__ */U("div",{className:"sf-preview-host",children:/* @__PURE__ */U(fe,{})})}),
16
- /* @__PURE__ */U(s,{value:{selectChild:(e,n,o,r)=>"section"===we(r)?.source?Te(n,o):Qe(e,n,o),addChild:(e,n,o,r,t)=>"section"===we(t)?.source?Xe():Ue(`${e}:${n}`,o,r),childRowName:Je,blockRowName:Ie},children:/* @__PURE__ */U(je,{mode:ce,onOpenWebsiteSettings:Ve.openSettings??(()=>{}),onSelectNode:ve,hideNodeActions:!0})})]})]})}export{ee as default};
16
+ /* @__PURE__ */U(s,{value:{selectChild:(e,n,o,r)=>"section"===Ee(r)?.source?He(n,o):Ze(e,n,o),addChild:(e,n,o,r,t)=>"section"===Ee(t)?.source?Ke():Ue(`${e}:${n}`,o,r),childRowName:Me,blockRowName:Qe},children:/* @__PURE__ */U(je,{mode:ce,onOpenWebsiteSettings:Le.openSettings??(()=>{}),onSelectNode:Oe,hideNodeActions:!0})})]})]})}export{ee as default};
@@ -1 +1 @@
1
- export{usePartBridge}from"../../chunk-VNN6VB4V.js";import"../../chunk-NMUS2VVD.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-FJRAYUCX.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-PEDDDWSG.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-GZH4UVDH.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{usePartBridge}from"../../chunk-HA33IXEU.js";import"../../chunk-VF6TCI62.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-CWTAS5R6.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-UCLVWF5E.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-GZH4UVDH.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- import"../chunk-GZO72N3Q.js";export{DocumentScreen,ScreenMount}from"../chunk-35TOFLH6.js";import"../chunk-GXQCZJOP.js";export{ScreenStoreProvider}from"../chunk-EJZ4RIRW.js";import"../chunk-KSKKRGNQ.js";import"../chunk-2GVCAIPX.js";import"../chunk-26OOWIJJ.js";import"../chunk-BRDCD4LK.js";import"../chunk-FGNR22NY.js";import"../chunk-ZE7I3PLX.js";import"../chunk-OGCROOTI.js";import"../chunk-7F52SZOI.js";import"../chunk-MQNBD6AB.js";import"../chunk-BHRC3ASL.js";import"../chunk-6W7WLPZH.js";import"../chunk-4ES5JGGX.js";import"../chunk-IQ5TA7AM.js";import"../chunk-DUVRZ456.js";import"../chunk-OWW44DVK.js";import"../chunk-KCBEE2MC.js";import"../chunk-DPKWJTNX.js";import"../chunk-VNN6VB4V.js";import"../chunk-NMUS2VVD.js";import"../chunk-IYT6NN2J.js";import"../chunk-D6N77AOS.js";import"../chunk-NCQSBU3O.js";import"../chunk-BSPCSC45.js";import"../chunk-I54UCYOU.js";import"../chunk-GOTN2KY4.js";import"../chunk-R5L2E7JX.js";import"../chunk-HDUAODXJ.js";import"../chunk-RKTF5XLP.js";import"../chunk-THZ46DC5.js";import"../chunk-GMCZXMOV.js";import"../chunk-CLOS6SSX.js";import"../chunk-S4AWJX4Q.js";import"../chunk-ERR437B5.js";import"../chunk-KG7RJWOK.js";import"../chunk-VPFNZ7TB.js";import"../chunk-LOMEH6DG.js";export{NO_DOCUMENT_ADDRESSING}from"../chunk-RLBXE4EU.js";import"../chunk-HNKB2ZYR.js";import"../chunk-V7U33NF2.js";import"../chunk-5545A3PC.js";import"../chunk-RMB2VGNY.js";import"../chunk-PA3PNTVV.js";import"../chunk-5ZBY24K7.js";import"../chunk-BVN33R76.js";import"../chunk-XTJCKV6Z.js";import"../chunk-KQMML6JM.js";import"../chunk-KCOBHPN6.js";export{EaselSessionProvider,useEaselSession}from"../chunk-O7Q4DDJT.js";export{EFFICIENT_BACKEND,activateEaselSession,backendOf,createEaselSession,currentEaselSession,deactivateEaselSession,efficientClientOpen,isEfficientBackend,provideDefaultBackend,resetAmbientEaselSession,sessionRegistry,setSessionBridgedSite,setSessionDocumentSite}from"../chunk-RSCMJIWS.js";import"../chunk-HQ4VVRIC.js";import"../chunk-ZVEJ25YG.js";export{SELECTION_MODE,ScreenCanvasTargetProvider,ScreenPartsProvider,isPinnedFirst,isPinnedLast,isSlotMode,sameInspectorMode,screenSlotsOf,useScreenAdd,useScreenBlockLook,useScreenBlockRules,useScreenBridges,useScreenCanvasDrag,useScreenCanvasFrame,useScreenCanvasHead,useScreenCanvasTarget,useScreenDevices,useScreenDocumentLabel,useScreenDocumentPass,useScreenInspectorPanel,useScreenLeftView,useScreenNodeKeys,useScreenNotify,useScreenOwnerName,useScreenParts,useScreenPickFollowsSelection,useScreenPinned,useScreenSaveSwitch,useScreenStorageNamespace,useScreenStyleClipboard,useStandaloneScreenBridges}from"../chunk-FJRAYUCX.js";import"../chunk-PLVEGYK6.js";import"../chunk-R6WTQWAC.js";export{DETACHED_EASEL_HOST,EaselHostContext,EaselHostProvider,createEaselHost,useEaselHost,useHostEscape}from"../chunk-U3JP4VGF.js";import"../chunk-6WY6ZXJG.js";import"../chunk-JTUUIVBZ.js";import"../chunk-K5744MTM.js";import"../chunk-TBY3DFKS.js";import"../chunk-PEDDDWSG.js";import"../chunk-OZ72A6MY.js";import"../chunk-4JSBIW5H.js";import"../chunk-GZH4UVDH.js";import"../chunk-K56YDHYQ.js";import"../chunk-KFV7N2DJ.js";import"../chunk-YRLPFZW3.js";import"../chunk-BXMXTO36.js";import"../chunk-EA2HTX37.js";import"../chunk-OSPUG6S6.js";import"../chunk-WK3AFPXY.js";import"../chunk-ECM5F6JJ.js";import"../chunk-4VJATVVR.js";import"../chunk-NDRZP6YR.js";import"../chunk-H6DDIBQ4.js";import"../chunk-QVUVDBGA.js";import"../chunk-Y2G7CU6A.js";import"../chunk-THWO5YVZ.js";import"../chunk-RE4LP46F.js";import"../chunk-MJM6SFD3.js";import"../chunk-2OAZYSWJ.js";import"../chunk-WQASXLXS.js";import"../chunk-66LWADFP.js";import"../chunk-QLD57GBB.js";import"../chunk-FFYXVAAL.js";import"../chunk-546BBOPE.js";import"../chunk-MFIRYGHW.js";import"../chunk-FCLW4LEN.js";import"../chunk-O2NLQBFX.js";import"../chunk-67GNT6PF.js";import"../chunk-ILXP5VX5.js";import"../chunk-P2VEMZH5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
1
+ import"../chunk-GZO72N3Q.js";export{DocumentScreen,ScreenMount}from"../chunk-ZG5T7RSV.js";import"../chunk-GXQCZJOP.js";export{ScreenStoreProvider}from"../chunk-DQZYXC3V.js";import"../chunk-7CIFWFP2.js";import"../chunk-2GVCAIPX.js";import"../chunk-26OOWIJJ.js";import"../chunk-BRDCD4LK.js";import"../chunk-FGNR22NY.js";import"../chunk-ZE7I3PLX.js";import"../chunk-OGCROOTI.js";import"../chunk-7F52SZOI.js";import"../chunk-MQNBD6AB.js";import"../chunk-BHRC3ASL.js";import"../chunk-6W7WLPZH.js";import"../chunk-4ES5JGGX.js";import"../chunk-IQ5TA7AM.js";import"../chunk-DUVRZ456.js";import"../chunk-OWW44DVK.js";import"../chunk-KCBEE2MC.js";import"../chunk-DPKWJTNX.js";import"../chunk-HA33IXEU.js";import"../chunk-VF6TCI62.js";import"../chunk-IYT6NN2J.js";import"../chunk-D6N77AOS.js";import"../chunk-NCQSBU3O.js";import"../chunk-BSPCSC45.js";import"../chunk-I54UCYOU.js";import"../chunk-GOTN2KY4.js";import"../chunk-R5L2E7JX.js";import"../chunk-HDUAODXJ.js";import"../chunk-RKTF5XLP.js";import"../chunk-THZ46DC5.js";import"../chunk-GMCZXMOV.js";import"../chunk-CLOS6SSX.js";import"../chunk-S4AWJX4Q.js";import"../chunk-ERR437B5.js";import"../chunk-KG7RJWOK.js";import"../chunk-VPFNZ7TB.js";import"../chunk-LOMEH6DG.js";export{NO_DOCUMENT_ADDRESSING}from"../chunk-RLBXE4EU.js";import"../chunk-HNKB2ZYR.js";import"../chunk-V7U33NF2.js";import"../chunk-5545A3PC.js";import"../chunk-KIA6EKAM.js";import"../chunk-PA3PNTVV.js";import"../chunk-5ZBY24K7.js";import"../chunk-BVN33R76.js";import"../chunk-XTJCKV6Z.js";import"../chunk-KQMML6JM.js";import"../chunk-KCOBHPN6.js";export{EaselSessionProvider,useEaselSession}from"../chunk-O7Q4DDJT.js";export{EFFICIENT_BACKEND,activateEaselSession,backendOf,createEaselSession,currentEaselSession,deactivateEaselSession,efficientClientOpen,isEfficientBackend,provideDefaultBackend,resetAmbientEaselSession,sessionRegistry,setSessionBridgedSite,setSessionDocumentSite}from"../chunk-RSCMJIWS.js";import"../chunk-HQ4VVRIC.js";import"../chunk-NOD4ATKF.js";export{SELECTION_MODE,ScreenCanvasTargetProvider,ScreenPartsProvider,isPinnedFirst,isPinnedLast,isSlotMode,sameInspectorMode,screenSlotsOf,useScreenAdd,useScreenBlockLook,useScreenBlockRules,useScreenBridges,useScreenCanvasDrag,useScreenCanvasFrame,useScreenCanvasHead,useScreenCanvasTarget,useScreenDevices,useScreenDocumentLabel,useScreenDocumentPass,useScreenInspectorPanel,useScreenLeftView,useScreenNodeKeys,useScreenNotify,useScreenOwnerName,useScreenParts,useScreenPickFollowsSelection,useScreenPinned,useScreenSaveSwitch,useScreenStorageNamespace,useScreenStyleClipboard,useStandaloneScreenBridges}from"../chunk-CWTAS5R6.js";import"../chunk-PLVEGYK6.js";import"../chunk-R6WTQWAC.js";export{DETACHED_EASEL_HOST,EaselHostContext,EaselHostProvider,createEaselHost,useEaselHost,useHostEscape}from"../chunk-U3JP4VGF.js";import"../chunk-6WY6ZXJG.js";import"../chunk-JTUUIVBZ.js";import"../chunk-K5744MTM.js";import"../chunk-TBY3DFKS.js";import"../chunk-UCLVWF5E.js";import"../chunk-4JSBIW5H.js";import"../chunk-OZ72A6MY.js";import"../chunk-GZH4UVDH.js";import"../chunk-K56YDHYQ.js";import"../chunk-KFV7N2DJ.js";import"../chunk-YRLPFZW3.js";import"../chunk-BXMXTO36.js";import"../chunk-EA2HTX37.js";import"../chunk-OSPUG6S6.js";import"../chunk-WK3AFPXY.js";import"../chunk-ECM5F6JJ.js";import"../chunk-4VJATVVR.js";import"../chunk-NDRZP6YR.js";import"../chunk-H6DDIBQ4.js";import"../chunk-QVUVDBGA.js";import"../chunk-Y2G7CU6A.js";import"../chunk-THWO5YVZ.js";import"../chunk-RE4LP46F.js";import"../chunk-MJM6SFD3.js";import"../chunk-2OAZYSWJ.js";import"../chunk-WQASXLXS.js";import"../chunk-66LWADFP.js";import"../chunk-QLD57GBB.js";import"../chunk-FFYXVAAL.js";import"../chunk-546BBOPE.js";import"../chunk-MFIRYGHW.js";import"../chunk-FCLW4LEN.js";import"../chunk-O2NLQBFX.js";import"../chunk-67GNT6PF.js";import"../chunk-ILXP5VX5.js";import"../chunk-P2VEMZH5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{useSectionOps}from"../../../chunk-NMUS2VVD.js";import"../../../chunk-FJRAYUCX.js";import"../../../chunk-PLVEGYK6.js";import"../../../chunk-R6WTQWAC.js";import"../../../chunk-U3JP4VGF.js";import"../../../chunk-K5744MTM.js";import"../../../chunk-TBY3DFKS.js";import"../../../chunk-PEDDDWSG.js";import"../../../chunk-OZ72A6MY.js";import"../../../chunk-4JSBIW5H.js";import"../../../chunk-GZH4UVDH.js";import"../../../chunk-K56YDHYQ.js";import"../../../chunk-KFV7N2DJ.js";import"../../../chunk-YRLPFZW3.js";import"../../../chunk-EA2HTX37.js";import"../../../chunk-ECM5F6JJ.js";import"../../../chunk-WQASXLXS.js";import"../../../chunk-66LWADFP.js";import"../../../chunk-QLD57GBB.js";import"../../../chunk-FFYXVAAL.js";import"../../../chunk-546BBOPE.js";import"../../../chunk-MFIRYGHW.js";import"../../../chunk-67GNT6PF.js";import"../../../chunk-ILXP5VX5.js";import"../../../chunk-P2VEMZH5.js";import"../../../chunk-KRXQM65X.js";import"../../../chunk-NKB3KVAB.js";
1
+ export{useSectionOps}from"../../../chunk-VF6TCI62.js";import"../../../chunk-CWTAS5R6.js";import"../../../chunk-PLVEGYK6.js";import"../../../chunk-R6WTQWAC.js";import"../../../chunk-U3JP4VGF.js";import"../../../chunk-K5744MTM.js";import"../../../chunk-TBY3DFKS.js";import"../../../chunk-UCLVWF5E.js";import"../../../chunk-4JSBIW5H.js";import"../../../chunk-OZ72A6MY.js";import"../../../chunk-GZH4UVDH.js";import"../../../chunk-K56YDHYQ.js";import"../../../chunk-KFV7N2DJ.js";import"../../../chunk-YRLPFZW3.js";import"../../../chunk-EA2HTX37.js";import"../../../chunk-ECM5F6JJ.js";import"../../../chunk-WQASXLXS.js";import"../../../chunk-66LWADFP.js";import"../../../chunk-QLD57GBB.js";import"../../../chunk-FFYXVAAL.js";import"../../../chunk-546BBOPE.js";import"../../../chunk-MFIRYGHW.js";import"../../../chunk-67GNT6PF.js";import"../../../chunk-ILXP5VX5.js";import"../../../chunk-P2VEMZH5.js";import"../../../chunk-KRXQM65X.js";import"../../../chunk-NKB3KVAB.js";
@@ -1084,6 +1084,16 @@ interface ScreenPinnedNodes {
1084
1084
  * undo says nothing. Absent: nothing is said.
1085
1085
  */
1086
1086
  changeNotice?: string;
1087
+ /**
1088
+ * WHAT A GROUP OF SECTIONS TAKES (8.3.0): may a section of `sectionType` go
1089
+ * into a group of `groupType` that holds `countNow` sections BEFORE it goes
1090
+ * in? Asked of every way a section arrives in a group: a new one from Add (a
1091
+ * click on a tile, a drag of one, and which tiles Add shows), a section dragged
1092
+ * there from the other group, and a paste. A section moved within its own group
1093
+ * is not asked: nothing arrives. The website's header takes up to 3 light
1094
+ * sections and its footer up to 6. Absent: a group takes any section, as before.
1095
+ */
1096
+ groupAccepts?: (groupType: string, sectionType: string, countNow: number) => boolean;
1087
1097
  /** The type of the group of sections pinned first, ahead of everything. */
1088
1098
  firstGroup: string | null;
1089
1099
  /** …and of the one pinned last. */
@@ -1 +1 @@
1
- export{SELECTION_MODE,ScreenCanvasTargetProvider,ScreenPartsProvider,isPinnedFirst,isPinnedLast,isSlotMode,sameInspectorMode,screenSlotsOf,useScreenAdd,useScreenBlockLook,useScreenBlockRules,useScreenBridges,useScreenCanvasDrag,useScreenCanvasFrame,useScreenCanvasHead,useScreenCanvasTarget,useScreenDevices,useScreenDocumentLabel,useScreenDocumentPass,useScreenInspectorPanel,useScreenLeftView,useScreenNodeKeys,useScreenNotify,useScreenOwnerName,useScreenParts,useScreenPickFollowsSelection,useScreenPinned,useScreenSaveSwitch,useScreenStorageNamespace,useScreenStyleClipboard,useStandaloneScreenBridges}from"../../chunk-FJRAYUCX.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-PEDDDWSG.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-GZH4UVDH.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{SELECTION_MODE,ScreenCanvasTargetProvider,ScreenPartsProvider,isPinnedFirst,isPinnedLast,isSlotMode,sameInspectorMode,screenSlotsOf,useScreenAdd,useScreenBlockLook,useScreenBlockRules,useScreenBridges,useScreenCanvasDrag,useScreenCanvasFrame,useScreenCanvasHead,useScreenCanvasTarget,useScreenDevices,useScreenDocumentLabel,useScreenDocumentPass,useScreenInspectorPanel,useScreenLeftView,useScreenNodeKeys,useScreenNotify,useScreenOwnerName,useScreenParts,useScreenPickFollowsSelection,useScreenPinned,useScreenSaveSwitch,useScreenStorageNamespace,useScreenStyleClipboard,useStandaloneScreenBridges}from"../../chunk-CWTAS5R6.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-K5744MTM.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-UCLVWF5E.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-OZ72A6MY.js";import"../../chunk-GZH4UVDH.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-WQASXLXS.js";import"../../chunk-66LWADFP.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FFYXVAAL.js";import"../../chunk-546BBOPE.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efficient-easel",
3
- "version": "8.2.1",
3
+ "version": "8.3.0",
4
4
  "description": "Efficient Easel: the EFFICIENT editors' shared engine and chrome: the saved document as pure functions, the published renderer, and the editor frame, panels, Layers tree, text grammar and type-in-place box. Published as editor-shell up to 0.66.0 and as efficient-editor up to 0.95.0.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "Efficient Pty Ltd",
@@ -1,57 +0,0 @@
1
- import{cloneNodeWithFreshIds as e}from"./chunk-2GVCAIPX.js";import{dedupeSlotChildren as n}from"./chunk-26OOWIJJ.js";import{styleClipboardOf as t}from"./chunk-BRDCD4LK.js";import{markedTreeNodeId as o,revealSelectedTreeRow as r,sameSelector as i}from"./chunk-FGNR22NY.js";import{rootRowName as l,slotChildRowName as s,slotChildRenameProp as d,sectionRenameProp as c}from"./chunk-BHRC3ASL.js";import{scrollPreviewToSection as a,gotoPreviewSlide as p,scrollPreviewToTop as u}from"./chunk-4ES5JGGX.js";import{useEaselKeyTarget as f,useEaselUndoKeys as h,useEaselSaveKey as m,editorRootFocus as g}from"./chunk-OWW44DVK.js";import{SlotChildActionsProvider as y}from"./chunk-KCBEE2MC.js";import{screenStorageKeys as S,DEFAULT_PANEL_W as k,clampPanelWidth as b}from"./chunk-DPKWJTNX.js";import{usePartBridge as v}from"./chunk-VNN6VB4V.js";import{useSectionOps as x}from"./chunk-NMUS2VVD.js";import{useNodeClipboard as w,useNodeContextMenu as z}from"./chunk-D6N77AOS.js";import{PageEditGuardNotices as B}from"./chunk-NCQSBU3O.js";import{ScreenSaveIcon as C,ScreenMainButton as N}from"./chunk-HDUAODXJ.js";import{useBrowserOffline as O}from"./chunk-RKTF5XLP.js";import{useScreenDocument as I}from"./chunk-THZ46DC5.js";import{requestMediaPick as $}from"./chunk-KG7RJWOK.js";import{heldStyle as P,styleShortcut as A}from"./chunk-V7U33NF2.js";import{AddChildRow as T}from"./chunk-5545A3PC.js";import{AddSidePanel as M}from"./chunk-RMB2VGNY.js";import{SidePanelHead as j,PanelShowStrip as L}from"./chunk-XTJCKV6Z.js";import{useEaselSession as V}from"./chunk-O7Q4DDJT.js";import{MediaSidePanel as E}from"./chunk-ZVEJ25YG.js";import{useScreenSaveSwitch as R,useScreenNodeKeys as D,useScreenPinned as F,useScreenDocumentLabel as H,useScreenCanvasFrame as W,useScreenInspectorPanel as U,useScreenDevices as J,useScreenPickFollowsSelection as G,useScreenLeftView as X,useScreenAdd as K,SELECTION_MODE as Y,sameInspectorMode as q,useScreenBridges as _,useScreenBlockRules as Z,useScreenBlockLook as Q,useScreenStorageNamespace as ee,useScreenNotify as ne,useScreenCanvasHead as te,isSlotMode as oe,useScreenStyleClipboard as re,useScreenDocumentPass as ie,useScreenCanvasDrag as le,ScreenCanvasTargetProvider as se,isPinnedFirst as de,isPinnedLast as ce,screenSlotsOf as ae}from"./chunk-FJRAYUCX.js";import{ROOT_ZONE as pe,blockNodeActions as ue,TREE_MAX_DEPTH as fe,childSlotsOf as he,slotFieldsOf as me,slotChildrenIn as ge,nestsInTree as ye,newNodeId as Se}from"./chunk-PLVEGYK6.js";import{useMediaPanel as ke,usePanelPick as be,useCancelPanelPick as ve}from"./chunk-R6WTQWAC.js";import{useEaselHost as xe,useHostEscape as we}from"./chunk-U3JP4VGF.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as ze}from"./chunk-6WY6ZXJG.js";import{DEFAULT_SCREEN_WORDS as Be}from"./chunk-JTUUIVBZ.js";import{useEasel as Ce,useEaselApi as Ne,CanvasPassThroughContext as Oe}from"./chunk-K5744MTM.js";import{TreeRow as Ie,Subtree as $e,LayersTree as Pe,TreeGroupLabel as Ae,TreeRowAction as Te,TreeSeam as Me}from"./chunk-4JSBIW5H.js";import{DEFAULT_TREE_WORDS as je}from"./chunk-K56YDHYQ.js";import{DEFAULT_NODE_MENU_WORDS as Le}from"./chunk-WK3AFPXY.js";import{toItemSelector as Ve,useNodeOps as Ee,clickPick as Re}from"./chunk-ECM5F6JJ.js";import{LayersIcon as De,MediaIcon as Fe}from"./chunk-4VJATVVR.js";import{EaselTopBar as He,TopBarRail as We,TopBarCluster as Ue,EaselIconButton as Je,TopBarDivider as Ge,DeviceSwitch as Xe,InspectorIconButton as Ke,PanelResizeHandle as Ye,MAX_PANEL_W as qe,MIN_PANEL_W as _e,panelWidthVars as Ze}from"./chunk-QVUVDBGA.js";import{DEFAULT_NOTICE_WORDS as Qe,DEFAULT_CHROME_WORDS as en}from"./chunk-Y2G7CU6A.js";import{holderOf as nn,nameOrSomeone as tn}from"./chunk-THWO5YVZ.js";import{DEFAULT_LOCK_WORDS as on}from"./chunk-RE4LP46F.js";import{useWords as rn}from"./chunk-MFIRYGHW.js";import{insertSeams as ln,CanvasDragLayer as sn,CanvasInsert as dn}from"./chunk-FCLW4LEN.js";import{DEFAULT_DRAG_WORDS as cn}from"./chunk-O2NLQBFX.js";import{createDragSession as an,useTreeDrag as pn,gapToMoveIndex as un}from"./chunk-67GNT6PF.js";import{useCanvasFrame as fn,LIST_SELECTOR as hn,BLOCK_SELECTOR as mn,useCanvasEvent as gn,nodeIdAt as yn,frameRectToHost as Sn,BLOCK_ATTRIBUTE as kn,drawnBox as bn}from"./chunk-ILXP5VX5.js";import{zoneKey as vn,ROOT_ID as xn,ROOT_SLOT as wn,parseZoneKey as zn,find as Bn,DataError as Cn}from"./chunk-KRXQM65X.js";import{useRef as Nn,useMemo as On,useState as In,useEffect as $n,useCallback as Pn,useLayoutEffect as An,Fragment as Tn}from"react";import{ColoredBadge as Mn,toast as jn,groupColors as Ln}from"efficient-shell/ui";import{UndoIcon as Vn,RedoIcon as En,RefreshIcon as Rn,TrashIcon as Dn,EyeOffIcon as Fn,EyeIcon as Hn,DuplicateIcon as Wn}from"efficient-shell/icons/efficient";import{jsx as Un,jsxs as Jn,Fragment as Gn}from"react/jsx-runtime";var Xn=/* @__PURE__ */new WeakSet;function Kn(e,n,t){const o=Bn(e,n,t);if(!o)return null;const r=o.path.find(e=>"root"!==e.parentId);return r?r.parentId:t}function Yn({canvas:e,tabs:n,onSelect:t}){const o=Nn(null),[r,i]=In({}),l=n.map(e=>`${e.id}:${e.below?1:0}`).join("|");return An(()=>{const t=e?.document,r=e?.window,l=e?.frame;if(!t||!r||!l||0===n.length)return void i({});let s=0;const d=()=>{s=0;const e=o.current;if(!e)return;const d=Sn(l,{left:0,top:0,width:r.innerWidth,height:r.innerHeight},e),c={};for(const o of n){const n=t.querySelector(`[${kn}="${r.CSS?.escape?r.CSS.escape(o.id):o.id}"]`),i=n?bn(n):null;if(!i||0===i.height){c[o.id]=null;continue}const s=Sn(l,{left:i.left,top:i.top,width:i.width,height:i.height},e),a=s.top+s.height;if(a<d.top||s.top>d.top+d.height){c[o.id]=null;continue}const p=o.below?a+4:Math.max(s.top,d.top)+6;c[o.id]={left:Math.max(s.left,d.left)+6,top:p}}i(c)},c=()=>{s||(s=r.requestAnimationFrame(d))};d(),r.addEventListener("scroll",c,!0),r.addEventListener("resize",c);const a=new r.MutationObserver(c);return a.observe(t.body,{childList:!0,subtree:!0,attributes:!0}),()=>{s&&r.cancelAnimationFrame(s),r.removeEventListener("scroll",c,!0),r.removeEventListener("resize",c),a.disconnect()}},[e,l]),/* @__PURE__ */Un("div",{ref:o,className:"es-band-tabs","aria-hidden":"true",children:n.map(e=>{const n=r[e.id];return n?/* @__PURE__ */Un("span",{className:"es-band-tab","data-band-tab":e.id,style:{left:n.left,top:n.top},onClick:n=>{n.stopPropagation(),t(e.id)},children:/* @__PURE__ */Un(Mn,{colorClass:Ln("info","solid"),size:"sm",children:e.label})},e.id):null})})}function qn({expand:e}){/* @__PURE__ */
2
- return Un("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */Jn(Gn,e?{children:[
3
- /* @__PURE__ */Un("path",{d:"M8 9l4-4 4 4"}),
4
- /* @__PURE__ */Un("path",{d:"M8 15l4 4 4-4"})]}:{children:[
5
- /* @__PURE__ */Un("path",{d:"M8 4l4 4 4-4"}),
6
- /* @__PURE__ */Un("path",{d:"M8 20l4-4 4 4"}),
7
- /* @__PURE__ */Un("path",{d:"M5 12h14"})]})})}var _n=`${hn}, ${mn}`;function Zn(e,n,t){const o=t-n;if(o<6)return null;if(o<24)return{top:Math.round((n+t)/2),height:Math.round(o)};return{top:Math.round(Math.min(Math.max(e,n+12),t-12))}}var Qn="__rungs";var et="screen:band",nt={duplicate:!0,delete:!0};function tt(){const hn=xe(),{target:Sn,docId:kn,capabilities:bn,currentSlug:Ln,siteId:tt,onPublish:ot,saveState:rt,saveConflict:it,retrySave:lt,toggleAutoSave:st,flushSave:dt,access:ct,saveUnreachable:at=!1,readOnly:pt,readOnlyReason:ut=null}=I(),ft=R(),ht=D(),{mediaEditing:mt,hasEditGuard:gt,hasPinnedChrome:yt}=bn,{appState:St,dispatch:kt,history:bt,selectedItem:vt,getSelectorForId:xt,config:wt}=Ce(e=>e),zt=F(),{first:Bt,firstGroup:Ct,lastGroup:Nt,isSectionGroup:Ot,sectionGroupZone:It,panelOf:$t}=zt,Pt=$t(Bt),At=e=>de(zt,e),Tt=e=>ce(zt,e),Mt="node"===zt.firstRow,jt=zt.band??null,Lt=rn("screen",Be),Vt=rn("tree",je),Et=rn("drag",cn),Rt=rn("notice",Qe),Dt=rn("lock",on),Ft=rn("menu",Le),Ht=rn("styleClipboard",ze),Wt=rn("chrome",en),Ut=H()??`/${Ln}`,Jt=W(),Gt=U(),Xt=x({readOnly:pt}),Kt=x({readOnly:pt,foldIntoHistory:!0}),Yt=Nn(null),qt=Ne(),_t=On(()=>({...Xt,select:e=>{Yt.current=e,Xt.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=qt.config;Yt.current=Ve(e,t,n)}Xt.commitDocument(e,n)}}),[Xt,qt]),Zt=St.ui,Qt=Zt.leftSideBarVisible,eo=Zt.rightSideBarVisible,{options:no,widths:to,initial:oo,fluid:ro,fit:io}=J(),[lo,so]=In(oo),co=ke(),ao=mt&&null!==co,po=be(),uo=ve();G(vt?.props.id);const{read:fo,write:ho,forSelection:mo}=X(),[go,yo]=In(fo);$n(()=>{ho(go)},[go]);const[So,ko]=In(0),bo=Nn(null),vo=Nn(null),xo=fn(vo,{readySelector:_n}),wo=f(vo);h(vo,xo);const zo=O(),Bo=nn(ct),Co={state:rt,offline:zo||rt.failed&&at,readOnlyReason:ut,editing:Bo?Rt.editing({name:tn(Bo.name,Dt),noun:Lt.noun}):null,conflict:null!=it,notSaving:Lt.bar.notSaving},No=()=>{pt||(rt.failed?lt():dt())};m(vo,xo,No);const[Oo,Io]=In(!1),$o=Nn(!1),Po=Nn(!1),[Ao,To]=In(null),Mo=K(),jo=e=>To(null===e?null:{zone:pe,index:e}),[Lo,Vo]=In([]),[Eo,Ro]=In(Y),Do="puck"===Eo.kind,Fo=Oo&&!Ao&&Mo.railTarget?Mo.railTarget(St.data,{node:vt??null,mode:Eo}):null,Ho=Fo?{zone:vn(Fo),index:Fo.index}:null,Wo=Ao??Ho,Uo=Wo&&Wo.zone===pe?Wo.index:null,Jo=o(Eo,vt?.props.id),[Go,Xo]=In(null);$n(()=>{Go&&(r(),Xo(null))},[Go]);const Ko=Nn(xt);Ko.current=xt;const Yo=Pn((e,{scroll:n})=>{yo(n=>mo(e,n)),n&&Xo(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=Ko.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&Br(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),qo=Nn(null);$n(()=>{const e=qo.current;qo.current=null;const n=null==vt?.props.id?null:String(vt.props.id);Ro(t=>e&&e.id===n?e.mode:"part"===t.kind&&"nodeId"in t&&t.nodeId===n?t:$t(vt?.type)??Y);const t=vt?.props.id,o=Yt.current;if(Yt.current=null,!t)return;const r=xt(t);Yo(String(t),{scroll:!i(o,r??null,pe)})},[vt?.props.id,Yo]);const _o=Pn(e=>{Ro(n=>q(n,e)?n:e),kt({type:"setUi",ui:{rightSideBarVisible:!0}})},[kt]),Zo=Nn(()=>{});Zo.current=(e,n)=>{const t=e?Si(e.zone??pe)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==vt?.props.id?null:String(vt.props.id);Ro(e=>q(e,n)?e:n),o!==r&&(qo.current={id:o,mode:n},_t.select(e))};const Qo=Pn((e,n)=>Zo.current(e,n),[]),er={kind:Eo.kind,mode:Eo,open:_o,show:e=>Ro(e),reveal:()=>{eo||kt({type:"setUi",ui:{rightSideBarVisible:!0}})},select:Qo},nr=_(er,{data:St.data,selected:vt??null,zoneOf:e=>xt(e)?.zone,readOnly:Boolean(pt),select:e=>{Ro(Y),_t.select({index:e})},replace:(e,n)=>_t.replaceComponent(pe,e,n),scrollTo:e=>Wi(e)},{device:lo,refreshes:So},{setView:yo,reveal:()=>{Qt||kt({type:"setUi",ui:{leftSideBarVisible:!0}})}}),tr=nr.pinnedSource??!1,or=nr.resolveLeftView?nr.resolveLeftView(go,ao):"media"===go&&ao?go:"sections",rr=Z(),{isLockedBlock:ir,duplicateBlocked:lr,nestDepth:sr,newSectionNode:dr,canAddTo:cr,blockIsOffered:ar}=rr,pr=Q(),{labelAtLevel:ur,Icon:fr,useProducts:hr}=pr,mr=pr.rowName?(e,n,t)=>pr.rowName(e,n,t):void 0,gr=Pn(e=>{kt({type:"setUi",ui:{rightSideBarVisible:!0}}),a(e),Yo(e,{scroll:!0})},[kt,Yo]),{selectNode:yr,openPartId:Sr}=v({mode:Eo,setMode:Ro,onOpenPart:gr}),[kr,br]=In(null);we(null!==kr,()=>br(null));const vr=S(ee()),xr=vr.collapsed,wr=vr.panelWidths,[zr,Br]=In(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(xr);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
8
- return new Set}});$n(()=>{try{window.localStorage.setItem(xr,JSON.stringify([...zr]))}catch{}},[zr]);const[Cr,Nr]=In(()=>{if("undefined"==typeof window)return{...k};try{const e=window.localStorage.getItem(wr);if(!e)return{...k};const n=JSON.parse(e);return{left:b(Number(n.left)||k.left),right:b(Number(n.right)||k.right)}}catch{return{...k}}});$n(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(wr,JSON.stringify(Cr))}catch{}},300);return()=>clearTimeout(e)},[Cr]);const Or=Pn((e,n)=>Nr(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),Ir=Pn(e=>Or("left",e),[Or]),$r=Pn(e=>Or("right",e),[Or]),Pr=e=>zr.has(e),Ar=e=>Br(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),Tr=Nn(!1),Mr=Nn(null);$n(()=>{if(Tr.current&&!Oo){const e=Mr.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??vo.current?.querySelector(`button[aria-label="${CSS.escape(Lt.add.title)}"]`))?.focus(),Mr.current=null}Tr.current=Oo},[Oo]),$n(()=>{if(!Oo||!wo)return;const e=e=>{"Escape"===e.key&&Zi()};return wo.addEventListener("keydown",e),()=>wo.removeEventListener("keydown",e)},[Oo,wo]),we(Oo,()=>Zi()),$n(()=>{!Qt&&Oo&&(Io(!1),To(null),$o.current=!1)},[Qt]),$n(()=>{if(!po)return Po.current&&kt({type:"setUi",ui:{leftSideBarVisible:!1}}),void(Po.current=!1);Oo&&(Io(!1),To(null),Po.current=$o.current,$o.current=!1),Qt||(Po.current=!0,kt({type:"setUi",ui:{leftSideBarVisible:!0}}))},[po]),$n(()=>{!Qt&&po&&(Po.current=!1,uo())},[Qt]),$n(()=>{if(!po||!wo)return;const e=e=>{"Escape"===e.key&&uo()};return wo.addEventListener("keydown",e),()=>wo.removeEventListener("keydown",e)},[po,wo]),we(null!==po,()=>uo());const jr=ne(),Lr=(e,n="success",t)=>{if(jr)return void(t?jr(e,"error"===n?"error":"info",t):jr(e,"error"===n?"error":"info"));const o={sound:!1,action:t?.action,onClose:t?.onClose};"error"===n?jn.error(e,{...o,duration:t?.duration??3200}):jn.success(e,{...o,duration:t?.duration??1900})},Vr=Nn(null),[Er,Rr]=In(0),[Dr,Fr]=In(0),Hr=te(),Wr=Nn(null),Ur=e=>Math.max(0,e.clientHeight-(Wr.current?.offsetHeight??0));$n(()=>{const e=Vr.current;if(!e)return;const n=()=>{Rr(e.clientWidth),Fr(Ur(e))};n();const t=new ResizeObserver(n);return t.observe(e),Wr.current&&t.observe(Wr.current),()=>t.disconnect()},[]),An(()=>{Vr.current&&(Rr(Vr.current.clientWidth),Fr(Ur(Vr.current)))},[Cr,Qt,eo]);const Jr=lo===ro?Er>0?Er:to[ro]:to[lo],Gr=Er>0?Math.min(Er/Jr,"shrink"===io?1:2):1,Xr=Jr*Gr,Kr=Er>0&&Xr>Er+1,Yr={width:Xr,height:Dr||"100%",flex:"none",position:"relative"},qr={width:Jr,height:Dr?Dr/Gr:"100%",maxHeight:"none",transform:1!==Gr?`scale(${Gr})`:void 0,transformOrigin:"top left"},_r=()=>kt({type:"setUi",ui:{leftSideBarVisible:!Qt}}),Zr=()=>kt({type:"setUi",ui:{rightSideBarVisible:!eo}}),Qr=e=>{Oo&&(Io(!1),To(null),$o.current=!1,Qt&&go===e)||po&&(Po.current=!1,uo(),Qt&&go===e)||(Qt&&go===e?_r():(yo(e),Qt||kt({type:"setUi",ui:{leftSideBarVisible:!0}})))},ei=()=>{$(hn,{accept:"image/*",title:Wt.mediaLibrary})},ni=()=>{Ro(Y),_t.select(null),u()},ti=()=>{Ro(Pt??Y),eo||kt({type:"setUi",ui:{rightSideBarVisible:!0}})},oi=St.data.content??[],ri=()=>{const e=oi.findIndex(At),n=oi.findIndex(Tt);return{floor:e>=0?e+1:0,cap:n>=0?n:oi.length}},ii=wt,li=rr.stripCopy,si=n=>e(n,li),di=w(),ci=Ee({data:St.data,config:ii,readOnly:Boolean(pt),clipboard:di,strip:li?e=>li(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==xn||e.slot!==wn)return{min:0,max:n-1};const{floor:t,cap:o}=ri();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&Ro(Y);const t=void 0===n||"node"===n?.kind?n:null;_t.commitDocument(e,t)}}),ai=e=>{const n=Bn(St.data,wt,e);if(!n)return!1;const t=vn(n.place),o=n.node,r=t===pe?mi(o):Ii(o);return!!ci.remove(e)&&(Lr(Lt.deleted({name:r}),"success",{duration:8e3,action:{label:Lt.bar.undo,onClick:()=>{ci.restore(n.node,n.place)}}}),!0)},pi={...ci,remove:ai},ui=e=>ur(e,"block",wt.components[e]?.label??e),fi=Pn(e=>wt.components[e]?.defaultProps??{},[wt]),hi=e=>ur(e,"section",ui(e)),mi=e=>l({type:e.type,props:e.props??{}},hi(e.type),mr),{nodeAddresses:gi,zoneItems:yi}=On(()=>{const e=/* @__PURE__ */new Map,n=/* @__PURE__ */new Map,t=(o,r,i)=>{n.set(r,o),o.forEach((n,o)=>{const l=String(n.props?.id??"");if(l&&e.set(l,{zone:r,index:o}),i>=fe)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of he(wt,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(oi,pe,0),{nodeAddresses:e,zoneItems:n}},[oi,wt]),Si=Pn(e=>yi.get(e)??[],[yi]),ki=e=>{const n=gi.get(e);return n?Si(n.zone)[n.index]:void 0},bi=e=>ae(rr,wt,e),vi=e=>{if(!rr.slotsOf||e===pe)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=ki(e.slice(0,n));if(!t)return null;const o=bi(t).filter(e=>e.rung),r=o.findIndex(t=>t.slot===e.slice(n+1));return r<0?null:{node:t,slot:o[r],position:r}},xi=(()=>{if(!oe(Eo))return null;const e=`${Eo.nodeId}:${Eo.slot}`;return vi(e)?.slot.panel===Eo.kind?e:null})(),wi=Nn(null);$n(()=>{const e=wi.current;if(wi.current=null,!xi||!oe(Eo))return;const n=Eo.nodeId;Yo(n,{scroll:e!==xi}),Br(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[Eo]);const zi=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void(e=>{const n=gi.get(e);n&&(n.zone===pe?Ui(n.index):bl(n.zone,n.index,e,ki(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))})(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&xi!==i&&(wi.current=i),Qo(null,r),eo||kt({type:"setUi",ui:{rightSideBarVisible:!0}}),Wi(o)},Bi=(e,n,t)=>{const o=`${e}:${n}`;if(Br(n=>{if(!n.has(o)&&!n.has(e))return n;const t=new Set(n);return t.delete(o),t.delete(e),t}),!t)return;xi!==o&&(wi.current=o);Qo(null,{kind:t,nodeId:e,slot:n})},Ci=(e,n,t)=>{if(pt||!rr.moveSlot)return;const o=ki(e),r=o?bi(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:Qn,index:n},s=un(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=rr.moveSlot(e,n,s);"string"==typeof d&&Bi(e,d,i.panel)},Ni=hr(),Oi=On(()=>{const e=/* @__PURE__ */new Map;for(const n of Ni??[])e.set(n.slug,n.name);return e},[Ni]),Ii=e=>s(e,ui,pr.plainText,e=>Oi.get(e),pr.rowName),$i=(e,n)=>{const t=wt.components[e.type]?.fields,o=n===pe||Hl(n)?"section":"block",r=n===pe&&(At(e)||Tt(e)||Ot(e.type)),i="block"===o?d(t):r?null:c(t);return pr.renamePropOf?pr.renamePropOf(e,o,i):i},Pi=(e,n,t,o)=>{if(!(!pt&&kr?.zone===e&&kr.index===n))return;const r=(t,o)=>{br(null),o&&((e,n,t)=>{const o=Si(e)[n];if(!o)return;const r=$i(o,e);r&&_t.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
9
- return Un("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":Lt.rename,onClick:e=>e.stopPropagation(),onBlur:e=>r(e.currentTarget.value,!0),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),r(e.currentTarget.value,!0)):"Escape"===e.key&&(e.preventDefault(),r("",!1))}},t)},Ai=t(re(),Ht),Ti=Ai.scope({target:Sn,siteId:tt,docId:kn}),Mi=wt,ji=(e,n)=>n===pe?hi(e):ui(e),Li=(e,n,t)=>{const o=Ai.plan(Ti,t,ji(t.type,e),Mi);o&&(o.changed&&_t.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),Lr(o.message))},Vi=z({nodesIn:Si,nodeAt:(e,n)=>Si(e)[n]??null,labelOf:(e,n)=>n===pe?hi(e):ui(e),renamePropOf:$i,beginRename:(e,n)=>br({zone:e,index:n}),history:{hasPast:bt.hasPast,hasFuture:bt.hasFuture,back:()=>bt.back(),forward:()=>bt.forward()},openAddSection:()=>{_t.select(null),qi(null)},openPageSettings:()=>{_t.select(null),Ro(Y)},pageSettingsLabel:Lt.pageSettings,words:{menu:Ft,styleClipboard:Ht,screen:Lt.menu},readOnly:Boolean(pt),collapseAll:()=>Br(new Set(Si(pe).map(e=>String(e.props.id)))),onPasteRefused:e=>Lr(e?Lt.pasteRefused({name:e.label}):Lt.menu.clipboardRefused,"error"),canPasteAt:(e,n)=>Ul(e,n),menuRows:nr.menuRows,isLocked:e=>ir(e.type),duplicateBlocked:e=>lr(St.data,e),permits:e=>ue(wt,e.type),canAddTo:cr,nodeOps:pi,isPinned:(e,n)=>n===pe&&(At(e)||Tt(e)),sectionBand:ri,openAddInside:(e,n)=>{e===pe?Ui(n):_t.select({zone:e,index:n}),qi(null)},locate:e=>gi.get(e)??null,rowNameOf:(e,n)=>n===pe?mi(e):Ii(e),selectAt:(e,n,t,o)=>{e===pe?Ui(n):bl(e,n,t,o??"")},slotRung:e=>{const n=vi(e);return n?.slot.panel?{label:n.slot.label,select:()=>zi(n.node,n.slot,!1)}:null},style:{held:()=>P(Ti),canCopy:e=>Ai.rows(Mi,e).some(e=>!1!==e.counted),copy:(e,n)=>Ai.copy(Ti,e,ji(e.type,n),Mi),paste:(e,n,t)=>Li(e,n,t)},keys:ht?{target:wo,selected:()=>{const e=St.ui.itemSelector;return e?{zone:e.zone??pe,index:e.index}:null},held:()=>di.get(),readOnly:Boolean(pt),onDone:({done:e,name:n})=>{"copied"===e&&Lr(Lt.copied({name:n}))}}:void 0},xo),Ei=Nn({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});$n(()=>{Ei.current={copy:(e,n)=>Ai.copy(Ti,e,ji(e.type,n),Mi),paste:Li,at:()=>{const e=St.ui.itemSelector;if(!e)return null;const n=e.zone??pe,t=Si(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean(pt)}});const Ri=Pn(e=>{const n=A(e);if(!n)return;const t=Ei.current,o=t.at();o&&(e.preventDefault(),"copy"===n?t.copy(o.node,o.zone):t.readOnly||t.paste(o.zone,o.index,o.node))},[]);$n(()=>{if(!wo)return;const e=e=>Ri(e);return wo.addEventListener("keydown",e),()=>wo.removeEventListener("keydown",e)},[Ri,wo]),gn(xo,"keydown",Ri);const Di=oi.map(e=>e.props.id).join("|");$n(()=>{const e=xo?.document??null,n=xo?.window??null;let t=0;const o=[],r=()=>{if(!e)return void Vo(e=>e.length?[]:e);const n=oi.findIndex(Tt),t=n>=0?n:oi.length,o=n=>{const t=oi[n]?.props?.id;return null==t?null:e.querySelector(`[data-puck-component="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(mn)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=oi.length>0&&!At(oi[0])?0:1;e<=t;e++){const n=o(e),t=o(e-1),l=n?.getBoundingClientRect()??null,s=t?.getBoundingClientRect()??null;if(!l&&!s)continue;const d=Zn(l&&s?(s.bottom+l.top)/2:l?0===e?l.top+12:l.top:s.bottom,Math.max(0===e?0:-1/0,...r(t).map(e=>e.bottom)),Math.min(1/0,...r(n).map(e=>e.top)));d&&i.push({...d,index:e})}Vo(e=>function(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t].top!==n[t].top||e[t].index!==n[t].index||e[t].height!==n[t].height)return!1;return!0}(e,i)?e:i)},i=()=>{cancelAnimationFrame(t),t=requestAnimationFrame(r)};if(!e||!n)return void r();n.addEventListener("scroll",i,{passive:!0});const l=new ResizeObserver(i);return l.observe(e.documentElement),r(),o.push(setTimeout(r,150),setTimeout(r,450)),()=>{cancelAnimationFrame(t),o.forEach(clearTimeout),n.removeEventListener("scroll",i),l.disconnect()}},[xo,Di,lo,Gr,Qt,eo,vt?.props.id]);const Fi=xo?.document??null,Hi=xo?.window??null;$n(()=>{const e=bo.current;if(!e||!Fi||!Hi)return;const n=[],t=()=>{const n=Fi.querySelector(`[data-puck-component="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&Hi.scrollTo({left:Hi.scrollX,top:Hi.scrollY+t,behavior:"instant"}),!0};return bo.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[Fi,Hi]);const Wi=e=>{nr.holdCanvasOn?nr.holdCanvasOn(e):a(e)},Ui=e=>{Ro(Y),_t.select({index:e}),nr.sectionPressed?.(oi[e]);const n=oi[e]?.props?.id;n&&Wi(n)},Ji=e=>{const{floor:n,cap:t}=ri(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=vt&&Eo.kind!==Pt?.kind?oi.findIndex(e=>e.props.id===vt.props.id):-1;return o(r>=0?r+1:t)},Gi=(e,n)=>{const{floor:t,cap:o}=ri(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(_t.reorderComponent(pe,e,i),_t.select({index:i}),{moved:!0,dest:i})},Xi=(e,n,t,o)=>{Ro(Y),_t.select(o?{index:o.index,zone:o.zone}:{index:e}),a(n),Lr(Lt.sectionAdded({name:t}))},Ki=(e,n)=>{const t=Ji(n),o=dr(e,{nodeDefaults:fi,newNodeId:Se,sectionLabel:hi,blockIsOffered:ar}),r=o?_t.insertNode(pe,t,o):_t.insertSection(e,t);return Xi(t,r,hi(e),o?((e,n,t)=>{if(e.type===t)return null;const o={at:null},r=(e,n,i)=>{const l=i.filter(n=>n===e.type).length;for(const{child:s,zone:d,index:c}of he(wt,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=cr(e.type,l,d.slice(d.lastIndexOf(":")+1)),i=r?.choices??(r?.spec?[{type:r.spec.childType,label:r.spec.childType}]:[]);null!==r&&"footer"!==r.source&&`${e.props.id}:${r.slot}`===d&&i.some(e=>e.type===t)&&(o.at={zone:d,index:c,depth:n})}r(s,n+1,[...i,e.type])}};return r({type:e.type,props:{...e.props,id:n}},1,[]),o.at?{zone:o.at.zone,index:o.at.index}:null})(o,r,e):null),t},Yi=(e,n,t)=>{const o=Ji(t),r=_t.insertNode(pe,o,n);return Xi(o,r,e),o},qi=e=>_i(pe,e),_i=(e,n)=>{Mr.current=document.activeElement??null,po&&($o.current=Po.current,Po.current=!1,uo()),To(null===n?null:{zone:e,index:n}),Io(!0),Qt||($o.current=!0,kt({type:"setUi",ui:{leftSideBarVisible:!0}}))},Zi=()=>{Io(!1),To(null),$o.current&&kt({type:"setUi",ui:{leftSideBarVisible:!1}}),$o.current=!1},Qi=(e,n,t)=>{if("section"===e.kind)_t.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;_t.insertNode(n,t,si(e.template.node))}Ro(Y),_t.select({index:t,zone:n})},el=(e,n)=>pr.rowName?n?At(e)?pr.rowName(e,"section",Lt.header):Tt(e)?pr.rowName(e,"section",Lt.footer):Ot(e.type)?pr.rowName(e,"section",ui(e.type)):mi(e):Ii(e):n?hi(e.type):ui(e.type),nl=e=>n=>{e()},tl=()=>nr.editPinnedSource?.(),ol=(e,n,t)=>{if(pt)return null;const o=Si(e)[n];return o&&!ue(wt,o.type).delete?null:/* @__PURE__ */Un(Te,{kind:"delete",label:Lt.deleteNamed({name:t}),onClick:()=>((e,n)=>{const t=Si(e)[n]?.props?.id;null!=t&&ai(String(t))})(e,n),children:/* @__PURE__ */Un(Dn,{size:15})})},rl=e=>pr.rowPreview?.(e)||void 0,il=e=>pr.rowMarks?.(e)??void 0,ll=(e,n,t)=>pr.rowActions?.(e,n,t)??null,sl=(e,n,t,o)=>{if(pt)return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
10
- return Un(Te,{kind:"eye",label:r?Lt.showNamed({name:o}):Lt.hideNamed({name:o}),onClick:()=>cl(e,n,t),children:/* @__PURE__ */Un(r?Fn:Hn,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},dl=e=>{const n=hi(oi[e]?.type??""),t=n?Lt.addSectionBefore({name:n}):Lt.addSectionHere;return ks(pe,e,()=>qi(e),t)},cl=(e,n,t)=>{_t.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},al=e=>me(wt,e),pl=e=>he(wt,e),ul=e=>rr.slotsOf?bi(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:ge(e,n.slot)})):[{slot:null,rung:null,kids:pl(e)}],fl=e=>rr.slotsOf?ul(e).flatMap(e=>e.kids):pl(e),hl=e=>Boolean(rr.slotsOf)&&bi(e).some(e=>e.rung),ml=(e,n,t)=>null===t?void 0===n?cr(e):cr(e,n):cr(e,n,t),gl=(e,n,t)=>{const o=ye(wt,e.type,n)&&(t||fl(e).length>0||hl(e));return{collapsible:o,folded:o&&Pr(String(e.props.id))}},yl=(e,n,t)=>ul(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>gl(e,r,t(e.type)).collapsible?[String(e.props.id),...yl(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),Sl=e=>fl(e).length>0||hl(e)||Boolean(cr(e.type)),kl=e=>Boolean(cr(e)),bl=(e,n,t,o)=>{if(Ro(Y),cr(o)?.spec?.slider){const t=e.split(":")[0];p(t,n),_t.select({index:n,zone:e}),a(t)}else _t.select({index:n,zone:e}),Wi(t)},vl=(e,n,t,o,r)=>{const i=`${e}:${n}`;_t.insertComponent(i,t,o),cr(r)?.spec?.slider?requestAnimationFrame(()=>{p(e,o),_t.select({index:o,zone:i})}):_t.select({index:o,zone:i})},xl=(e,n,t)=>{_t.insertComponent(e,n,t),Ro(Y),_t.select({index:t,zone:e})},wl=Nn(/* @__PURE__ */new Set);$n(()=>{oi.forEach(e=>{const n=cr(e.type)?.spec;if(!n)return;const t=e.props.id;if(wl.current.has(t))return;wl.current.add(t);if((Array.isArray(e.props[n.slot])?e.props[n.slot]:[]).length>0)return;if(n.skipSeed?.(e.props))return;const o=`${t}:${n.slot}`,r=n.legacy?.(e.props)??[];(r.length?r:n.seeds(fi)).forEach((e,t)=>Kt.seedChild(o,t,n.childType,e))})},[oi,Kt,fi]);const zl=Nn(/* @__PURE__ */new Set);$n(()=>{oi.forEach((e,t)=>{const o=e.props.id;if(zl.current.has(o))return;const r=n(e,al(e.type));zl.current.add(o),r&&Kt.replaceComponent(pe,t,{...e,props:r})})},[oi,Kt]),ie(Kt,wt);const Bl=oi.findIndex(Tt),Cl=Bl>=0?oi[Bl]:null,Nl=Mt?oi.findIndex(At):-1,Ol=Nl>=0?oi[Nl]:null,Il=zt.groupTab,$l=On(()=>Il?e=>Ot(e.type):void 0,[Il]),Pl=Boolean(zt.groupBadge),Al=zt.groupBadge?/* @__PURE__ */Un("span",{className:"es-tree-group-badge",children:/* @__PURE__ */Un(Mn,{tone:"info",size:"xs",children:zt.groupBadge})}):void 0,Tl=oi.find(e=>e.type===Ct)??null,Ml=oi.find(e=>e.type===Nt)??null,jl=Bl>=0?Bl:oi.length,Ll=[];oi.forEach(e=>{Tt(e)||(Sl(e)&&Ll.push(String(e.props.id)),Ll.push(...yl(e,1,kl)))}),Cl&&(Ll.push(String(Cl.props.id)),Ll.push(...yl(Cl,1,kl)));const Vl=Ll.length>0&&Ll.every(e=>zr.has(e)),El=e=>{const n=pr.blockRowName(e,ui);return pr.rowName?pr.rowName(e,"block",n):n},Rl=(e,n,t,o)=>{const r=Si(e)[t];if(!r)return;const i={...zn(e),index:t},l={...zn(n),index:Math.min(Math.max(o,0),Si(n).length)},s=un(i,l);if(e!==n||s!==t)try{ci.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof Cn))throw e}},Dl=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of pl(e))n.add(r),t(o)};for(const t of al(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},Fl=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=gi.get(n);if(!e)return null;if(e.zone===pe)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},Hl=e=>{const n=e.slice(0,e.indexOf(":")),t=oi.find(e=>Ot(e.type)&&String(e.props.id)===n);return t&&It(n)===e?t:null},Wl=(e,n,t)=>{if(e.rung){const t=ki(e.rung.nodeId),o=t?bi(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===Qn&&n.index>=0&&n.index<=o}if(n.slot===Qn)return!1;if(e.add)return Gl(e.add,n);const o=vn(n);if(Ot(e.type))return!1;const r=Hl(o),i=Hl(e.zone);if(r||i)return!(!r||!i)&&(n.index>=0&&n.index<=Si(o).length);if(e.zone===pe||o===pe){if(e.zone!==o)return!1;const{floor:t,cap:r}=ri();return n.index>=t&&n.index<=r}if(n.index<0||n.index>Si(o).length)return!1;if(e.zone===o)return!0;const l=Cl&&!zt.lastIsOpen?String(Cl.props.id):null;return(!l||Fl(e.zone)!==l&&Fl(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??Si(e)[t];if(!r)return!1;const i=n.split(":")[0],l=gi.get(i),s=l?Si(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&Dl(r).has(n))return!1;const d=cr(s.type,sr(St?.data,s.type,i),n.slice(n.lastIndexOf(":")+1));return!!d&&(!!(d.choices?d.choices.some(e=>e.type===r.type):d.spec?.childType===r.type)&&!d.spec?.addBlocked?.(Si(n),r))})(e.zone,o,e.index,t)},Ul=(e,n)=>{const t=vn(e.from);if(t===vn(n))return!0;const o=e.node;return Wl({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},Jl=e=>{const n=e.slice(0,e.indexOf(":")),t=gi.get(n),o=t?Si(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=cr(o.type,sr(St?.data,o.type,n),e.slice(e.lastIndexOf(":")+1));if(!r||`${n}:${r.slot}`!==e)return null;if("footer"===r.source)return null;const i=r.choices??(r.spec?[{type:r.spec.childType,label:ui(r.spec.childType)}]:[]),l=vi(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:el(o,t.zone===pe)}},Gl=(e,n)=>{const t=vn(n);if("block"!==e.kind){if(Hl(t))return n.index>=0&&n.index<=Si(t).length;if(t!==pe)return!1;const{floor:e,cap:o}=ri();return n.index>=e&&n.index<=o}if(t===pe)return!1;const o=Jl(t);return!(!o||!o.choices.some(n=>n.type===e.type))&&!o.target.spec?.addBlocked?.(Si(t))},Xl=(e,n)=>{e.rung?Ci(e.rung.nodeId,e.index,n.index):e.add?((e,n)=>{if("block"!==e.kind&&Hl(vn(n)))return void Qi(e,vn(n),n.index);if("section"===e.kind)return void Ki(e.type,n.index);if("template"===e.kind)return void Yi(e.template.name,si(e.template.node),n.index);const t=vn(n),o=Jl(t);o&&(o.target.spec?vl(o.parentId,o.target.slot,e.type,n.index,o.parent.type):xl(t,e.type,n.index))})(e.add,n):e.zone===pe?Gi(e.index,n.index):Rl(e.zone,vn(n),e.index,n.index)},[Kl]=In(()=>an()),Yl=pn({keyOf:e=>e.id,readOnly:Boolean(pt),session:Kl,canDrop:Wl,onDrop:Xl,onStep:(e,n)=>{e.rung?Ci(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===pe?((e,n)=>{const t=hi(oi[e]?.type??""),o=Gi(e,n<0?e-1:e+2);if(!o.moved)return void Lr(n<0?Lt.sectionFirst({name:t}):Lt.sectionLast({name:t}));const{floor:r,cap:i}=ri();Lr(Lt.sectionMoved({name:t,n:o.dest-r+1,total:i-r}))})(e.index,n):Rl(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),ql=Pn(e=>{const{floor:n,cap:t}=ri(),o=[];for(const r of e.nodes){const e=vn(r.place),i=Si(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(At(i)||Tt(i)||ir(i.type))continue;if(Ot(i.type))continue;const l=Boolean(Hl(e)),s=e===pe||l;e===pe&&t-n<2||o.push({key:r.id,item:{id:r.id,zone:e,index:r.place.index,type:i.type},box:r.box,label:s?hi(i.type):Ii(i),from:r.place})}const r=e.zones.flatMap(e=>{const n=vn(e.list);return n===pe&&0===e.children.length?[{...e,addLabel:Lt.addSection,addAlways:!0}]:e.children.length>0||Boolean(Jl(n)?.choices.length)||Boolean(Hl(n))?[e]:[]}),i=r.flatMap(e=>{const n=vn(e.list);return n===pe||Hl(n)||!Jl(n)?.choices.length?[]:ln(e,Lt.addBlockHere)});return{sources:o,zones:r,seams:i}},[St.data]),_l=null==vt?.props.id?null:String(vt.props.id),Zl=Pn(e=>{const n=wt,t=e=>!e.item.rung&&null!==Bn(St.data,n,e.item.id),o=e[e.length-1];if(!t(o))return o;const r=n=>e.find(e=>t(e)&&e.item.id===n),i=r(_l);return i||(r(Re(St.data,n,o.item.id,_l,$l))??o)},[St.data,wt,_l,$l]),[Ql,es]=In(null);gn(xo,"mouseover",e=>{if(!Il)return;const n=yn(e.target),t=n?Kn(St.data,wt,n):null;t!==Ql&&es(t)}),gn(xo,"mouseout",e=>{Il&&!e.relatedTarget&&es(null)});const ns=e=>At(e)||Tt(e)||Ot(e.type),ts=[];if(Il){const e=_l?Kn(St.data,wt,_l):null;for(const n of/* @__PURE__ */new Set([e,Ql])){const e=n?oi.find(e=>String(e.props.id)===n):void 0;if(!e||!ns(e))continue;const t=Il(e);t&&ts.push({id:String(e.props.id),label:t,below:At(e)||e.type===Ct})}}const os=V(),rs=Nn(null);$n(()=>{const e=zt.changeNotice;if(!e)return;const n=JSON.stringify(oi.filter(ns)),t=rs.current;if(rs.current={doc:kn,bands:n,index:bt.index},!t||t.doc!==kn||t.bands===n)return;bt.hasPast&&bt.index>=t.index&&!Xn.has(os)&&(Xn.add(os),Lr(e,"success",{action:{label:Lt.bar.undo,onClick:()=>bt.back()},duration:8e3}))},[oi]);const is=e=>{Ro(Y),_t.select(e.zone===pe?{index:e.index}:{index:e.index,zone:e.zone})},ls=le(),ss=()=>({data:St.data,device:lo,ops:_t,inspector:er}),ds=ls?.model,cs=On(()=>ds?e=>ds(e,ql(e),ss()):ql,[ds,ql,lo]),as=ls?.measure,ps=as?(e,n)=>as(e,n,ss()):void 0,us=ls?.canDrop,fs=us?(e,n)=>us(e,n,Wl,ss()):Wl,hs=ls?.drop,ms=hs?(e,n)=>hs(e,n,Xl,ss()):Xl,gs=ls?.pick,ys=gs?e=>gs(e,is,ss()):is,Ss=e=>{const n=vn(e),t=vi(n);t&&zi(t.node,t.slot,!1),_i(n,e.index)},ks=(e,n,t,o)=>/* @__PURE__ */Un(Me,{...pt?{}:Yl.seam({place:{...zn(e),index:n}}),onAdd:pt?void 0:t,label:o},`seam:${e}:${n}`),bs={rowClick:nl,isCollapsed:Pr,toggleCollapse:Ar},vs=e=>{const n=String(e.props.id),t=oi.findIndex(e=>String(e.props.id)===n),o=It(n),r=Si(o),i=Pr(n),l=ui(e.type),s=pr.rowName?pr.rowName(e,"section",l):l,d=e=>ks(o,e,()=>_i(o,e),Lt.addSectionHere);/* @__PURE__ */
11
- return Jn(Gn,{children:[
12
- /* @__PURE__ */Un(Ie,{words:Vt,icon:/* @__PURE__ */Un(fr,{type:e.type,size:13}),name:s,preview:rl(e),marks:il(e),onSelect:()=>Ui(t),nameSlot:Pi(pe,t,n,s),selected:Jo===n,badge:Al,actions:ll(e,pe,t)??void 0,rowProps:{"data-node-id":n,onClick:nl(()=>Ui(t))},fold:{open:!i,label:"section",onToggle:()=>Ar(n)}}),!i&&/* @__PURE__ */Jn($e,{children:[r.map((n,t)=>{const r=String(n.props.id),i=mi(n),l=Sl(n),s=l&&Pr(r),c=()=>bl(o,t,r,e.type),{rowProps:a,...p}=Yl.row({item:{id:r,zone:o,index:t,type:n.type},place:{...zn(o),index:t}},{"data-node-id":r,onClick:nl(c)});/* @__PURE__ */
13
- return Jn(Tn,{children:[d(t),
14
- /* @__PURE__ */Un(Ie,{words:Vt,icon:/* @__PURE__ */Un(fr,{type:n.type,size:13}),name:i,preview:rl(n),marks:il(n),onSelect:c,nameSlot:Pi(o,t,r,i),selected:Jo===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>Ar(r)}:void 0,actions:/* @__PURE__ */Jn(Gn,{children:[ol(o,t,i),ll(n,o,t),sl(o,t,n,i)]}),rowProps:a}),l&&!s&&/* @__PURE__ */Un($e,{children:zs(n,2)})]},r)}),d(r.length)]})]})},xs=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=Yl.dragging,d=!Pr(l)&&s?.rung?.nodeId!==i,c={...zn(l),index:0},a=s&&!s.rung&&Wl(s,c)?c:void 0,p=()=>zi(e,n,!0),{rowProps:u,...f}=Yl.row({item:{id:`rung:${l}`,zone:`${i}:${Qn}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:Qn,index:t},into:a,canDrag:Boolean(rr.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:nl(p)}),h=pt?null:rr.slotActions?.(e,n.slot);/* @__PURE__ */
15
- return Jn(Tn,{children:[n.heading,
16
- /* @__PURE__ */Un(Ie,{words:Vt,icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:xi===l,...f,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>Ar(l)},actions:h&&h.length>0?/* @__PURE__ */Un(Gn,{children:h.map((t,o)=>/* @__PURE__ */Un(Te,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if(pt||t.disabled)return;const o=String(e.props.id),r=e=>{"string"==typeof e&&Bi(o,e,n.panel)},i=t.run();i&&"function"==typeof i.then?i.then(r):r(i)})(e,n,t),children:"delete"===t.kind?/* @__PURE__ */Un(Dn,{size:15}):/* @__PURE__ */Un(Wn,{size:15})},`${o}:${t.kind}`))}):void 0,rowProps:u}),d&&/* @__PURE__ */Un($e,{children:r})]},l)},ws=(e,n)=>{const t=ul(e),o=t.filter(e=>e.rung).length;let r=0;/* @__PURE__ */
17
- return Un(Gn,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=ml(e.type,void 0,t.slot),d=s?`${e.props.id}:${s.slot}`:null,c=null===t.slot?null:`${e.props.id}:${t.slot}`,a=null!==c&&Boolean(Jl(c)?.choices.length),p=(e,n)=>a?ks(e,n,()=>_i(e,n),Lt.addBlockHere):ks(e,n),u=/* @__PURE__ */Jn(Gn,{children:[i.map(({child:n,zone:t,index:o})=>{const r=Jo===String(n.props.id),{collapsible:i,folded:s}=gl(n,l,kl(n.type)),d=String(n.props.id),c=El(n),a=()=>bl(t,o,d,e.type),{rowProps:u,...f}=Yl.row({item:{id:d,zone:t,index:o,type:n.type},place:{...zn(t),index:o}},{"data-node-id":d,onClick:nl(a)});/* @__PURE__ */
18
- return Jn(Tn,{children:[0===o&&p(t,0),
19
- /* @__PURE__ */Un(Ie,{words:Vt,icon:/* @__PURE__ */Un(fr,{type:n.type,size:13}),name:c,preview:rl(n),marks:il(n),onSelect:a,nameSlot:Pi(t,o,d,c),selected:r,hidden:Boolean(n.props._hidden),...f,fold:i?{open:!s,label:"group",onToggle:()=>Ar(d)}:void 0,actions:/* @__PURE__ */Jn(Gn,{children:[ol(t,o,c),ll(n,t,o),sl(t,o,n,c)]}),rowProps:u}),i&&!s&&/* @__PURE__ */Un($e,{children:ws(n,l+1)}),p(t,o+1)]},String(n.props.id??`${t}-${o}`))}),null===c?d&&!i.some(e=>e.zone===d)?p(d,0):null:0!==i.length||!t.rung&&d!==c?null:p(c,0)]});return t.rung?xs(e,t.rung,r++,o,u):/* @__PURE__ */Un(Tn,{children:u},t.slot??"")})})},zs=(e,n)=>{const t=sr(St?.data,e.type,String(e.props.id)),o=ul(e),r=o.filter(e=>e.rung).length;let i=0;/* @__PURE__ */
20
- return Un(Gn,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=ml(e.type,t,o.slot),c=d?.spec??null,a=c&&Array.isArray(e.props[c.slot])?e.props[c.slot]:[],p=d&&d.choices?{slot:d.slot,choices:d.choices}:null,u=String(e.props.id),f=c&&!c.fixed?`${u}:${c.slot}`:null,h=p?`${u}:${p.slot}`:null,m=(n,t)=>{const o=n===f&&c&&!c.addBlocked?.(a)?()=>vl(e.props.id,c.slot,c.childType,t,e.type):n===h?()=>_i(n,t):void 0;return ks(n,t,o,n===f&&c?c.addLabel:Lt.addBlockHere)},g=null===o.slot?null:`${u}:${o.slot}`,y=Boolean(c&&!c.fixed&&(null===g||g===f)),S=/* @__PURE__ */Jn(Gn,{children:[l.map(({child:n,zone:t,index:o})=>{const r=Jo===String(n.props.id),i=Ii(n),l=String(n.props.id),{collapsible:d,folded:c}=gl(n,s,kl(n.type)),a=al(n.type),p=1===a.length?`${l}:${a[0]}`:null,u=p?{...zn(p),index:Si(p).length}:void 0,f=Yl.dragging,h=u&&f&&Wl(f,u)?u:void 0,g=()=>bl(t,o,l,e.type),{rowProps:y,...S}=Yl.row({item:{id:l,zone:t,index:o,type:n.type},place:{...zn(t),index:o},into:h,canDrag:!ir(n.type)},{"data-node-id":l,onClick:nl(g)});/* @__PURE__ */
21
- return Jn(Tn,{children:[0===o&&m(t,0),
22
- /* @__PURE__ */Un(Ie,{words:Vt,icon:/* @__PURE__ */Un(fr,{type:n.type,size:13}),name:i,preview:rl(n),marks:il(n),onSelect:g,nameSlot:Pi(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...S,fold:d?{open:!c,label:"group",onToggle:()=>Ar(l)}:void 0,actions:ir(n.type)?ll(n,t,o)??void 0:/* @__PURE__ */Jn(Gn,{children:[ol(t,o,i),ll(n,t,o),sl(t,o,n,i)]}),rowProps:y}),d&&!c&&/* @__PURE__ */Un($e,{children:zs(n,s+1)}),m(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&c&&
23
- /* @__PURE__ */Un(T,{small:!0,label:c.addLabel,blocked:c.addBlocked?.(a)??null,onAdd:()=>vl(e.props.id,c.slot,c.childType,a.length,e.type)}),null===g?h&&!l.some(e=>e.zone===h)?m(h,0):null:0!==l.length||(o.rung?y:g!==h)?null:m(g,0)]});return o.rung?xs(e,o.rung,i++,r,S):/* @__PURE__ */Un(Tn,{children:S},o.slot??"")})})},Bs=(()=>{if(!vt||!Do)return null;const e=String(vt.type),n=String(vt.props.id),t=cr(e,sr(St?.data,e,n));if(!t||"footer"===t.source)return null;const o=oi.some(e=>String(e.props?.id)===n),r=Array.isArray(vt.props[t.slot])?vt.props[t.slot]:[];if(t.spec?.addBlocked?.(r))return null;const i=t.choices??(t.spec?[{type:t.spec.childType,label:ui(t.spec.childType)}]:[]);return 0===i.length?null:{parentName:el(vt,o),choices:i,onPick:o=>{t.spec?vl(n,t.slot,o,r.length,e):xl(`${n}:${t.slot}`,o,r.length)}}})(),Cs=Wo&&Wo.zone!==pe&&!Hl(Wo.zone)?Wo.zone:null,Ns=!0===Mo.blocksFirst,Os=Cs?Jl(Cs):Ns&&Wo?null:Bs,Is=Boolean(Ao&&Cs)||Ns&&Boolean(Os&&Os.choices.length>0),$s=Oo||null!==po,Ps=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:Qt&&!$s&&or===e.id,onSelect:()=>Qr(e.id)}:e,As=[{id:"add",label:Lt.add.title,icon:/* @__PURE__ */Un("span",{className:"sf-rail-plus","aria-hidden":"true",children:"+"}),active:Oo,onSelect:()=>Oo?Zi():qi(null)},...(nr.railLead??[]).map(Ps),{id:"sections",label:Lt.layers,icon:/* @__PURE__ */Un(De,{}),active:Qt&&!$s&&"sections"===or,onSelect:()=>Qr("sections")},...(nr.railTrail??[]).map(Ps)];ao?As.push({id:"media",label:Lt.railMedia,icon:/* @__PURE__ */Un(Fe,{}),active:Qt&&!Oo&&(null!==po||"media"===or),onSelect:()=>Qr("media")}):mt&&As.push({id:"media",label:Lt.railMedia,icon:/* @__PURE__ */Un(Fe,{}),onSelect:ei});const Ts=[...nr.railLead??[],...nr.railTrail??[]].find(e=>"panel"in e&&e.id===or),Ms=Boolean(jt?.foldable)&&!tr,js=jt?.label??(gt?Lt.pageSections:Lt.templateSections),Ls=Ms&&Pr(et),Vs=/* @__PURE__ */Jn(Gn,{children:[oi.map((e,n)=>{if(At(e)||Tt(e)||Ot(e.type))return null;const t=Jo===String(e.props.id),o=Boolean(e.props._hidden);pl(e);const r=String(e.props.id),i=nr.hasOwnRows?.(e)??!1,l=Sl(e)||i,s=l&&Pr(r),d=al(e.type),c=1===d.length?`${r}:${d[0]}`:null,a=c?{...zn(c),index:Si(c).length}:void 0,p=Yl.dragging,u=a&&p&&Wl(p,a)?a:void 0,{rowProps:f,...h}=Yl.row({item:{id:r,zone:pe,index:n,type:e.type},place:{...zn(pe),index:n},into:u},{"data-node-id":r,onClick:nl(()=>Ui(n))});/* @__PURE__ */
24
- return Jn(Tn,{children:[n>0&&dl(n),
25
- /* @__PURE__ */Un(Ie,{words:Vt,icon:/* @__PURE__ */Un(fr,{type:e.type,size:13}),name:mi(e),preview:rl(e),marks:il(e),onSelect:()=>Ui(n),nameSlot:Pi(pe,n,r,mi(e)),selected:t,hidden:o,...h,fold:l?{open:!s,label:"section",onToggle:()=>Ar(r)}:void 0,actions:/* @__PURE__ */Jn(Gn,{children:[ol(pe,n,mi(e)),ll(e,pe,n),sl(pe,n,e,mi(e))]}),rowProps:f}),Sl(e)&&!s&&/* @__PURE__ */Jn($e,{children:[zs(e,1),nr.partRows?.(e,bs)]}),i&&!s&&/* @__PURE__ */Un($e,{children:nr.ownRows?.(e,n,bs)})]},String(e.props.id??n))}),!tr&&jl>0&&dl(jl),jt?.addAtEnd&&!tr&&!pt&&/* @__PURE__ */Un(T,{small:!0,label:Lt.addSection,blocked:null,onAdd:()=>qi(jl)})]}),Es=(e,n,t)=>{const o=String(e.props.id),r=fl(e).length>0||hl(e)||Boolean(cr(e.type)),i=r&&Pr(o),l="header"===t?Lt.header:Lt.footer,s=pr.rowName?pr.rowName(e,"section",l):l;/* @__PURE__ */
26
- return Jn(Gn,{children:[
27
- /* @__PURE__ */Un(Ie,{words:Vt,icon:/* @__PURE__ */Un(fr,{type:t,size:13}),name:s,preview:rl(e),marks:il(e),badge:Al,onSelect:()=>Ui(n),nameSlot:Pi(pe,n,o,s),selected:Jo===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>Ar(o)}:void 0,actions:ll(e,pe,n)??void 0,rowProps:{"data-node-id":o,onClick:nl(()=>Ui(n))}}),r&&!i&&/* @__PURE__ */Un($e,{children:ws(e,1)})]})};return(nr.wrap??(e=>e))(
28
- /* @__PURE__ */Un(se,{target:xo,children:/* @__PURE__ */Jn("div",{ref:vo,className:"sf-editor es-editor",style:Ze(Cr),onContextMenu:Vi.onEditorContextMenu,...g(hn),children:[
29
- /* @__PURE__ */Jn(He,{children:[
30
- /* @__PURE__ */Un(We,{items:As,ariaLabel:Lt.bar.views}),
31
- /* @__PURE__ */Jn(Ue,{children:[
32
- /* @__PURE__ */Un(Je,{label:Lt.bar.undo,disabled:Boolean(pt)||!bt.hasPast,onClick:()=>bt.back(),children:/* @__PURE__ */Un(Vn,{})}),
33
- /* @__PURE__ */Un(Je,{label:Lt.bar.redo,disabled:Boolean(pt)||!bt.hasFuture,onClick:()=>bt.forward(),children:/* @__PURE__ */Un(En,{})}),
34
- /* @__PURE__ */Un(Ge,{}),
35
- /* @__PURE__ */Un(Xe,{devices:no,value:lo,onChange:so}),
36
- /* @__PURE__ */Un(Je,{label:Lt.bar.refresh,tip:Lt.bar.refreshTip,onClick:()=>{bo.current=(()=>{const e=xo?.document;if(!e)return null;const n=oi.findIndex(Tt),t=n>=0?n:oi.length;let o=null;for(let n=0;n<t;n++){const t=oi[n]?.props?.id;if(null==t)continue;const r=e.querySelector(`[data-puck-component="${CSS.escape(String(t))}"]`);if(!r)continue;const i=r.getBoundingClientRect().top;i<=4&&(null===o||i>o.offset)&&(o={id:String(t),offset:i})}if(!o){const e=vt?.props?.id??oi[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),ko(e=>e+1)},children:/* @__PURE__ */Un(Rn,{})})]}),
37
- /* @__PURE__ */Jn(Ue,{kind:"right",style:{minWidth:300},children:[
38
- /* @__PURE__ */Un(C,{input:Co,words:Lt.saveStatus}),nr.barLead?.(),nr.barTrail?.(),nr.mainAction||!nr.barMain?/* @__PURE__ */Un(N,{input:Co,action:nr.mainAction??{label:Lt.done,onPress:()=>{ot(St.data)}},readOnly:Boolean(pt),saveSwitch:ft,onToggleAutoSave:st,onSaveNow:No,bar:Lt.bar,words:Lt.saveStatus}):nr.barMain()]})]}),
39
- /* @__PURE__ */Un(B,{}),
40
- /* @__PURE__ */Jn("div",{className:"sf-body",children:[Qt?/* @__PURE__ */Jn(Gn,{children:[
41
- /* @__PURE__ */Un("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":Lt.leftPanel,children:Oo?/* @__PURE__ */Un(M,{blocks:Os,blocksOnly:Is,at:Ao?{label:(e=>{const n=Hl(e.zone);if(n)return Lt.add.addingTo({name:pr.rowName?el(n,!0):ui(n.type)});if(e.zone===pe){const n=oi[e.index];return n&&!Tt(n)?Lt.add.addingBefore({name:el(n,!0)}):Lt.add.addingAtEnd}const t=Jl(e.zone);return t?Lt.add.addingTo({name:t.parentName}):Lt.add.addingHere})(Ao),onClear:()=>To(null)}:void 0,onAdd:e=>{const n=Wo,t=(e,n)=>{Ao&&To({zone:e,index:n})};if(n&&"block"!==e.kind&&Hl(n.zone))return Qi(e,n.zone,n.index),void t(n.zone,n.index+1);if("section"===e.kind)return(e=>{if(null===Uo)return void Ki(e);const n=Ki(e,Uo);Ao&&jo(n+1)})(e.type);if("template"===e.kind)return((e,n)=>{if(null===Uo)return void Yi(e,n);const t=Yi(e,n,Uo);Ao&&jo(t+1)})(e.template.name,si(e.template.node));if(n&&n.zone!==pe){const o=Jl(n.zone);if(!o)return;return o.target.spec?vl(o.parentId,o.target.slot,e.type,n.index,o.parent.type):xl(n.zone,e.type,n.index),void t(n.zone,n.index+1)}Bs?.onPick(e.type)},itemFor:e=>({id:`new:${e.kind}:${"template"===e.kind?e.template.id:e.type}`,zone:"",index:-1,type:"template"===e.kind?e.template.node.type:e.type,add:e}),session:Kl,siteWide:nr.addPanelRow?.(Zi),onClose:Zi,onHide:_r,readOnly:Boolean(pt)}):po&&co?
42
- /* @__PURE__ */Un(E,{panel:co,pick:po,onHide:_r}):Ts?Ts.panel({onHide:_r,notify:Lr}):"media"===or&&co?/* @__PURE__ */Un(E,{panel:co,pick:null,onHide:_r}):/* @__PURE__ */Jn(Gn,{children:[
43
- /* @__PURE__ */Un(j,{icon:/* @__PURE__ */Un(De,{}),title:Lt.layers,context:Ut,actions:
44
- /* @__PURE__ */Un(Ke,{label:Vl?Lt.expandAll:Lt.collapseAll,title:0===Ll.length?Lt.nothingToFold:void 0,disabled:0===Ll.length,onClick:()=>Br(e=>{const n=new Set(Ll);return Vl?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...Ll])}),children:/* @__PURE__ */Un(qn,{expand:Vl})}),onHide:_r}),
45
- /* @__PURE__ */Jn(Pe,{className:"sf-tree sf-scroll",words:Vt,children:[
46
- /* @__PURE__ */Un(Ie,{words:Vt,icon:/* @__PURE__ */Un(fr,{type:"page",size:13}),name:Lt.pageSettings,onSelect:ni,selected:!vt&&Do,rowProps:{onClick:nl(ni)}}),Tl&&/* @__PURE__ */Jn(Gn,{children:[!Pl&&/* @__PURE__ */Un(Ae,{children:Lt.header}),vs(Tl)]}),!tr&&yt&&!(Pl&&Tl)&&/* @__PURE__ */Jn(Gn,{children:[!Pl&&/* @__PURE__ */Un(Ae,{children:Lt.header}),!Mt&&/* @__PURE__ */Un(Ie,{words:Vt,icon:/* @__PURE__ */Un(fr,{type:"header",size:13}),name:Lt.header,badge:Al,onSelect:ti,selected:Eo.kind===Pt?.kind,rowProps:{onClick:nl(ti)}})]}),!tr&&Ol&&!(Pl&&Tl)&&Es(Ol,Nl,"header"),!tr&&!Ms&&/* @__PURE__ */Un(Ae,{children:js}),Ms?/* @__PURE__ */Jn(Gn,{children:[
47
- /* @__PURE__ */Un(Ie,{words:Vt,icon:null,name:js,fold:{open:!Ls,label:js,onToggle:()=>Ar(et)}}),!Ls&&/* @__PURE__ */Un($e,{children:Vs})]}):Vs,yt&&!Pl&&/* @__PURE__ */Un(Ae,{children:Lt.footer}),Cl&&!(Pl&&Ml)&&Es(Cl,Bl,"footer"),!tr&&!Cl&&yt&&!Pl&&/* @__PURE__ */Un(Ie,{words:Vt,icon:/* @__PURE__ */Un(fr,{type:"footer",size:13}),name:Lt.footer,onSelect:tl,rowProps:{onClick:nl(tl),title:Lt.editFooter}}),Ml&&vs(Ml),nr.treeFoot?.()]})]})}),
48
- /* @__PURE__ */Un(Ye,{side:"left",width:Cr.left,min:_e,max:qe,defaultWidth:k.left,label:Lt.resizeLeftPanel,onResize:Ir})]}):/* @__PURE__ */Un(L,{side:"left",onShow:_r}),
49
- /* @__PURE__ */Jn("div",{ref:Vr,className:"sf-center sf-scroll","data-sf-canvas-head":Hr?"":void 0,style:{overflowX:Kr?"auto":"hidden",overflowY:"hidden"},children:[Hr&&/* @__PURE__ */Un("div",{ref:Wr,className:"sf-canvas-head",children:/* @__PURE__ */Un(Hr,{device:lo})}),
50
- /* @__PURE__ */Jn("div",{className:"sf-frame-scaler",style:Yr,children:[
51
- /* @__PURE__ */Un("div",{className:"sf-frame "+(lo===ro?"":`sf-frame--${lo}`),style:qr,children:/* @__PURE__ */Jn("div",{className:"sf-preview-host",children:[
52
- /* @__PURE__ */Un(Oe.Provider,{value:$l,children:/* @__PURE__ */Un(Jt,{},So)}),
53
- /* @__PURE__ */Un(sn,{canvas:xo,session:Kl,model:cs,measure:ps,canDrop:fs,onDrop:ms,choose:Zl,onPick:ys,onZoneAdd:Ss,onSeamAdd:Ss,zoneAddLabel:Lt.canvasAddBlock,words:Et.canvas,readOnly:Boolean(pt),revision:St.data}),Lo.length>0&&/* @__PURE__ */Un("div",{className:"sf-preview-gaps",children:Lo.map(e=>
54
- /* @__PURE__ */Un(dn,{index:e.index,label:Lt.addSectionHere,onInsert:()=>qi(e.index),className:void 0===e.height?"sf-preview-gap":"sf-preview-gap sf-preview-gap--tight",style:void 0===e.height?{top:e.top}:{top:e.top,height:e.height}},e.index))})]})}),Il?/* @__PURE__ */Un(Yn,{canvas:xo,tabs:ts,onSelect:e=>{const n=oi.findIndex(n=>String(n.props.id)===e);n>=0&&Ui(n)}}):null]})]}),eo?/* @__PURE__ */Jn(Gn,{children:[
55
- /* @__PURE__ */Un(y,{value:{selectChild:bl,addChild:vl,childRowName:Ii,blockRowName:El},children:/* @__PURE__ */Un(Gt,{mode:Eo,onOpenWebsiteSettings:nr.openSettings??(()=>{}),onOpenSiteStyles:nr.openStyles,onSelectNode:yr,onNotify:Lr,onHidePanel:Zr,nodeActions:vt?ue(wt,vt.type):nt})}),
56
- /* @__PURE__ */Un(Ye,{side:"right",width:Cr.right,min:_e,max:qe,defaultWidth:k.right,label:Lt.resizeSettingsPanel,onResize:$r})]}):
57
- /* @__PURE__ */Un(L,{side:"right",onShow:Zr})]}),Vi.menu]})}))}export{tt as ScreenChrome};
@@ -1,5 +0,0 @@
1
- import{buildPaletteSections as e,pinnedSection as t,paletteWithoutPinned as o,categoryLabel as n}from"./chunk-PA3PNTVV.js";import{blockTypesIn as i}from"./chunk-5ZBY24K7.js";import{sectionTemplatesOf as s}from"./chunk-BVN33R76.js";import{SidePanelHead as r,PanelModeExit as c}from"./chunk-XTJCKV6Z.js";import{useEaselSession as l}from"./chunk-O7Q4DDJT.js";import{blockRuns as a}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as p,useScreenBlockRules as m}from"./chunk-FJRAYUCX.js";import{DEFAULT_SCREEN_WORDS as d}from"./chunk-JTUUIVBZ.js";import{useEasel as f}from"./chunk-K5744MTM.js";import{useWords as u}from"./chunk-MFIRYGHW.js";import{AddPanel as k}from"./chunk-FCLW4LEN.js";import{DEFAULT_DRAG_WORDS as h}from"./chunk-O2NLQBFX.js";import{useState as y,useEffect as b,useMemo as j}from"react";import{AddIcon as g}from"efficient-shell/icons/efficient";import{jsx as $,jsxs as B,Fragment as O}from"react/jsx-runtime";var v=e=>`section:${e}`,L=e=>`block:${e}`,V=e=>`template:${e}`;function x({blocks:x,blocksOnly:C,at:F,onAdd:I,itemFor:N,session:T,siteWide:A,onClose:H,onHide:J,readOnly:R}){const w=f(e=>e.config),D=p(),{labelAtLevel:K,categoryLabel:M,firstSection:Q,Icon:U,Thumbnail:W}=D,{blockIsOffered:X}=m(),Y=u("screen",d).add,Z=u("drag",h).add,z=l(),[E,P]=y([]);b(()=>{let e=!1;const t=e=>X(e,z);return s(z).list().then(o=>{if(e)return;const n=w.components;P(o.filter(e=>e.node?.type&&n[e.node.type]&&i(e.node).every(t)))}).catch(()=>{}),()=>{e=!0}},[w,z]);const S=j(()=>e(w,D),[w]),G=e=>({type:v(e.type),label:e.name,cover:/* @__PURE__ */$(W,{type:e.type}),title:e.desc?`${e.name} — ${e.desc}`:Y.tile({name:e.name}),keywords:[e.alias??"",e.desc,e.type,e.catLabel].filter(Boolean)}),q=j(()=>{const e=[];if(x&&x.choices.length>0&&a(x.choices).forEach((t,o)=>{e.push({key:`blocks:${o}`,title:0===o?`${Y.inside({name:x.parentName})}${t.group?` · ${t.group}`:""}`:t.group??"",tiles:t.items.map(e=>({type:L(e.type),label:e.label,icon:/* @__PURE__ */$(U,{type:e.type,size:18}),title:Y.tile({name:e.label})}))})}),C)return e;const i=t(S,Q);i&&e.push({key:"start",title:Y.startBlank,tiles:[G(i)]}),E.length>0&&e.push({key:"templates",title:Y.templates,tiles:E.map(e=>{return{type:V(e.id),label:e.name,cover:/* @__PURE__ */$(W,{type:e.node.type}),keywords:[(t=e.node.type,K(t,"section",w.components[t]?.label??t)),e.node.type]};var t})});const s=o(S,Q);for(const t of Object.keys(w.categories??{})){const o=s.filter(e=>e.cat===t);0!==o.length&&e.push({key:`category:${t}`,title:n(w,t,M),tiles:o.map(G)})}return e},[x,C,E,S,w,Y]),_=e=>{const t=e.indexOf(":"),o=e.slice(0,t),n=e.slice(t+1);if("section"===o)return{kind:"section",type:n};if("block"===o)return{kind:"block",type:n};if("template"===o){const e=E.find(e=>e.id===n);return e?{kind:"template",template:e}:null}return null};/* @__PURE__ */
2
- return B(O,{children:[
3
- /* @__PURE__ */$(r,{icon:/* @__PURE__ */$(g,{size:15}),title:Y.title,context:C?Y.contextBlocks:Y.contextAll,actions:/* @__PURE__ */$(c,{label:Y.done,description:Y.doneDescription,onClick:H}),onHide:J}),
4
- /* @__PURE__ */B("div",{className:"sf-addside sf-scroll",children:[
5
- /* @__PURE__ */$(k,{groups:q,session:T,itemFor:e=>N(_(e)??{kind:"section",type:e}),onInsert:e=>{const t=_(e);t&&I(t)},at:F,hint:C?Y.hintBlocks:Y.hint,searchLabel:C?Y.searchBlocks:Y.searchSections,readOnly:R,words:Z}),A&&!C?A:null]})]})}export{x as AddSidePanel,L as blockKey,v as sectionKey,V as templateKey};