efficient-easel 2.0.0 → 2.2.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.
Files changed (30) hide show
  1. package/dist/{chunk-LEGBBCOH.js → chunk-4TMMEBAG.js} +1 -1
  2. package/dist/chunk-5TRBCPRB.js +5 -0
  3. package/dist/{chunk-PBVC2VGH.js → chunk-6OY2THZH.js} +1 -1
  4. package/dist/{chunk-4CJP57AY.js → chunk-AAT3O7PK.js} +1 -1
  5. package/dist/{chunk-PJP46U5L.js → chunk-FOBGSFFS.js} +8 -8
  6. package/dist/{chunk-6AMS5BQH.js → chunk-RC6DD4XP.js} +3 -3
  7. package/dist/chunk-TSQUEJZB.js +5 -0
  8. package/dist/{chunk-LC7N3GZS.js → chunk-UAVNI3BU.js} +1 -1
  9. package/dist/{chunk-IJ3OOBDY.js → chunk-UEM66O42.js} +41 -41
  10. package/dist/{chunk-IJGHMGG4.js → chunk-VB5LRSGJ.js} +1 -1
  11. package/dist/{chunk-E2L2XVRX.js → chunk-VETFIYQR.js} +23 -23
  12. package/dist/easel/index.d.ts +1 -1
  13. package/dist/fields/index.d.ts +5 -2
  14. package/dist/fields/index.js +1 -1
  15. package/dist/screen/components/AddBlockRow.js +1 -1
  16. package/dist/screen/components/AddSidePanel.js +1 -1
  17. package/dist/screen/components/MediaSidePanel.js +1 -1
  18. package/dist/screen/components/ScreenChrome.js +1 -1
  19. package/dist/screen/components/ScreenMount.js +1 -1
  20. package/dist/screen/components/ScreenStoreProvider.js +1 -1
  21. package/dist/screen/components/SectionScreenShell.js +16 -16
  22. package/dist/screen/components/usePartBridge.js +1 -1
  23. package/dist/screen/index.js +1 -1
  24. package/dist/screen/lib/puck/use-section-ops.js +1 -1
  25. package/dist/screen/lib/screen-parts.js +1 -1
  26. package/dist/text-styles/index.js +10 -10
  27. package/dist/{types-DQp_i3dE.d.ts → types-CWxUxPGO.d.ts} +9 -0
  28. package/package.json +3 -3
  29. package/dist/chunk-LACBURK5.js +0 -5
  30. package/dist/chunk-PT6NPMWV.js +0 -5
@@ -1,4 +1,4 @@
1
- import{blockRuns as e}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as s}from"./chunk-LACBURK5.js";import{DropdownMenu as r}from"efficient-shell/ui";import{jsxs as t,Fragment as l,jsx as i}from"react/jsx-runtime";function c({choices:c,onPick:n}){const{Icon:a}=s(),o=e(c).flatMap(e=>[...e.group?[{type:"label",key:`group:${e.group}`,label:/* @__PURE__ */t(l,{children:[e.group," ",
1
+ import{blockRuns as e}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as s}from"./chunk-5TRBCPRB.js";import{DropdownMenu as r}from"efficient-shell/ui";import{jsxs as t,Fragment as l,jsx as i}from"react/jsx-runtime";function c({choices:c,onPick:n}){const{Icon:a}=s(),o=e(c).flatMap(e=>[...e.group?[{type:"label",key:`group:${e.group}`,label:/* @__PURE__ */t(l,{children:[e.group," ",
2
2
  /* @__PURE__ */i("span",{className:"sf-menugroup-count",children:e.items.length})]})}]:[],...e.items.map(e=>({key:e.type,label:e.label,icon:/* @__PURE__ */i("span",{className:"sf-chip",children:/* @__PURE__ */i(a,{type:e.type,size:13})}),onSelect:()=>n(e.type)}))]);/* @__PURE__ */
3
3
  return i(r,{align:"start",triggerClassName:"sf-add-card",items:o,trigger:/* @__PURE__ */t(l,{children:[
4
4
  /* @__PURE__ */i("span",{className:"sf-plus sf-plus--sm",children:"+"}),"Add block"]})})}export{c as AddBlockRow};
@@ -0,0 +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-PYCLHOSA.js";import{Inspector as i}from"./chunk-VETFIYQR.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},L={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},S={first:null,last:null,firstGroup:null,lastGroup:null,isSectionGroup:()=>!1,sectionGroupZone:()=>"",panelOf:()=>null};function C(){/* @__PURE__ */
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 D=o({});function G({parts:n,children:e}){/* @__PURE__ */
4
+ return s(D.Provider,{value:n,children:e})}function I(){return u(D)}function N(){return(I().useOwnerName??g)()}function T(){return(I().useDocumentLabel??y)()}function x(n,e,t,r){return(I().useBridges??v)(n,e,t,r)}function A(n){return(I().useStandaloneBridges??v)(n)}function B(n,e){(I().useDocumentPass??b)(n,e)}function F(){return I().blockRules??O}function R(){return I().blockLook??L}function V(){return I().devices??j}function Y(){return I().leftView??w}function E(){return I().pinned??S}function H(){return I().saveSwitch??!0}function K(n){e(!0===I().pickFollowsSelection,n)}function Q(){return I().add??h}function W(){return I().storageNamespace||void 0}function Z(){return I().styleClipboard??null}function q(){return I().nodeKeys??!0}function z(){return I().notify??null}function J(){return I().Canvas??C}function M(){return I().CanvasHead??null}function U(){return I().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 I().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,Q as useScreenAdd,R as useScreenBlockLook,F as useScreenBlockRules,x as useScreenBridges,U as useScreenCanvasDrag,J as useScreenCanvasFrame,M as useScreenCanvasHead,_ as useScreenCanvasTarget,V as useScreenDevices,T as useScreenDocumentLabel,B as useScreenDocumentPass,nn as useScreenInspectorPanel,Y as useScreenLeftView,q as useScreenNodeKeys,z as useScreenNotify,N as useScreenOwnerName,I as useScreenParts,K as useScreenPickFollowsSelection,E as useScreenPinned,H as useScreenSaveSwitch,W as useScreenStorageNamespace,Z as useScreenStyleClipboard,A as useStandaloneScreenBridges};
@@ -1,4 +1,4 @@
1
- import{useScreenOwnerName as e}from"./chunk-LACBURK5.js";import{settlePanelPick as n}from"./chunk-R6WTQWAC.js";import{MediaPanelHead as i,mediaPickKind as c}from"./chunk-OXYGFK2B.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-5TRBCPRB.js";import{settlePanelPick as n}from"./chunk-R6WTQWAC.js";import{MediaPanelHead as i,mediaPickKind as c}from"./chunk-OXYGFK2B.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,2 +1,2 @@
1
- import{ScreenPartsProvider as t}from"./chunk-LACBURK5.js";import{useEaselHost as r}from"./chunk-U3JP4VGF.js";import{createEasel as e,EaselProvider as n}from"./chunk-PYCLHOSA.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-5TRBCPRB.js";import{useEaselHost as r}from"./chunk-U3JP4VGF.js";import{createEasel as e,EaselProvider as n}from"./chunk-PYCLHOSA.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,9 +1,9 @@
1
- import{DEFAULT_FIELDS_WORDS as e}from"./chunk-FPOKPNO4.js";import{useWords as l}from"./chunk-MFIRYGHW.js";import{SearchableSelect as a,Select as i,Slider as n}from"efficient-shell/ui";import{jsx as r,jsxs as s}from"react/jsx-runtime";import{useId as o,useRef as t}from"react";function u(e,l){return e.find(e=>Object.is(e.value,l))}var d=e=>String(e);function c(n){const{id:o,options:t,placeholder:u,readOnly:c=!1,ariaLabel:v,ariaLabelledBy:m,searchable:p=!1,searchPlaceholder:h,groupCount:b=!1,renderOption:f}=n,g=l("fields",e),N=m?{"aria-labelledby":m}:v?{"aria-label":v}:{},y=t.some(e=>void 0!==e.thumb),O=y||void 0!==f||t.some(e=>void 0!==e.meta),C=e=>""===e?void 0:t[Number(e)],j=(e,l)=>{const a=C(e.value);return a?/* @__PURE__ */s("span",{className:"es-fsel-row",children:[y?/* @__PURE__ */r("span",{className:"es-fsel-thumb","aria-hidden":"true",children:a.thumb?/* @__PURE__ */r("img",{src:a.thumb,alt:"",loading:"lazy"}):null}):null,
2
- /* @__PURE__ */r("span",{className:"es-fsel-label",children:f?f(a,{active:l.active??!1,chosen:l.selected}):a.label}),void 0===a.meta||p?null:/* @__PURE__ */r("span",{className:"es-fsel-meta","aria-hidden":"true",children:a.meta})]}):e.label},x=[];let V=null;if(t.forEach((e,l)=>{const a={value:d(l),label:e.label,...e.disabled?{disabled:!0}:{},...p&&e.meta?{sublabel:e.meta}:{}};void 0===e.group?(V=null,x.push(a)):V&&V.label===e.group?V.options.push(a):(V={label:e.group,options:[a]},x.push(V))}),b)for(const e of x)"options"in e&&(e.label=`${e.label} ${e.options.length}`);const I=e=>e.flatMap(e=>{const l=C(e.value);return l?[l]:[]});if(p){const l={id:o,options:x,placeholder:h??u??g.search??e.search,disabled:c,renderOption:O?j:void 0,...N};if(!0===n.multiple){const e=Array.isArray(n.value)?n.value:[],i=n.onChange;/* @__PURE__ */
1
+ import{DEFAULT_FIELDS_WORDS as e}from"./chunk-FPOKPNO4.js";import{useWords as l}from"./chunk-MFIRYGHW.js";import{SearchableSelect as a,Select as i,Slider as n}from"efficient-shell/ui";import{jsx as r,jsxs as s}from"react/jsx-runtime";import{useId as o,useRef as t}from"react";function u(e,l){return e.find(e=>Object.is(e.value,l))}var d=e=>String(e);function c(n){const{id:o,options:t,placeholder:u,readOnly:c=!1,ariaLabel:v,ariaLabelledBy:m,searchable:p=!1,searchPlaceholder:h,groupCount:b=!1,renderOption:f}=n,g=l("fields",e),N=m?{"aria-labelledby":m}:v?{"aria-label":v}:{},x=t.some(e=>void 0!==e.thumb),y=x||void 0!==f||t.some(e=>void 0!==e.meta),O=e=>""===e?void 0:t[Number(e)],C=(e,l)=>{const a=O(e.value);return a?/* @__PURE__ */s("span",{className:"es-fsel-row",children:[x?/* @__PURE__ */r("span",{className:"es-fsel-thumb","aria-hidden":"true",children:a.thumb?/* @__PURE__ */r("img",{src:a.thumb,alt:"",loading:"lazy"}):null}):null,
2
+ /* @__PURE__ */r("span",{className:"es-fsel-label",children:f?f(a,{active:l.active??!1,chosen:l.selected}):a.label}),void 0===a.meta||p?null:/* @__PURE__ */r("span",{className:"es-fsel-meta","aria-hidden":"true",children:a.meta})]}):e.label},j=[];let V=null;if(t.forEach((e,l)=>{const a={value:d(l),label:e.label,...e.disabled?{disabled:!0}:{},...p&&e.meta?{sublabel:e.meta}:{}};void 0===e.group?(V=null,j.push(a)):V&&V.label===e.group?V.options.push(a):(V={label:e.group,options:[a]},j.push(V))}),b)for(const e of j)"options"in e&&(e.label=`${e.label} ${e.options.length}`);const I=e=>e.flatMap(e=>{const l=O(e.value);return l?[l]:[]});if(p){const l={id:o,options:j,placeholder:h??u??g.search??e.search,disabled:c,renderOption:y?C:void 0,...N};if(!0===n.multiple){const e=Array.isArray(n.value)?n.value:[],i=n.onChange;/* @__PURE__ */
3
3
  return r("div",{className:"es-fsel",children:/* @__PURE__ */r(a,{...l,multiple:!0,value:t.flatMap((l,a)=>e.some(e=>Object.is(e,l.value))?[d(a)]:[]),onChange:e=>i(t.filter((l,a)=>e.includes(d(a))).map(e=>e.value))})})}const i=t.findIndex(e=>Object.is(e.value,n.value)),s=n.onChange;/* @__PURE__ */
4
- return r("div",{className:"es-fsel",children:/* @__PURE__ */r(a,{...l,value:i>=0?d(i):"",clearable:!1,onChange:e=>{const l=C(e);l&&!Object.is(l.value,n.value)&&s(l.value)}})})}const M={id:o,size:"sm",className:"es-fsel-button",options:x,placeholder:u??g.choose,readOnly:c,renderOption:O?j:void 0,...N};if(!0===n.multiple){const e=Array.isArray(n.value)?n.value:[],l=l=>e.some(e=>Object.is(e,l.value)),a=t.flatMap((e,a)=>l(e)?[d(a)]:[]),s=n.onChange;/* @__PURE__ */
5
- return r("div",{className:"es-fsel",children:/* @__PURE__ */r(i,{...M,multiple:!0,value:a,renderValue:n.renderValue?e=>n.renderValue(I(e)):void 0,onChange:e=>s(t.filter((l,a)=>e.includes(d(a))).map(e=>e.value))})})}const F=t.findIndex(e=>Object.is(e.value,n.value)),P=n.onChange;/* @__PURE__ */
6
- return r("div",{className:"es-fsel",children:/* @__PURE__ */r(i,{...M,value:F>=0?d(F):"",renderValue:n.renderValue?e=>n.renderValue(I(e)[0]):void 0,onChange:e=>{const l=C(e);l&&!Object.is(l.value,n.value)&&P(l.value)}})})}function v({id:e,label:l,value:a,onChange:i,min:u,max:d,step:c=1,shiftStep:v,styleValue:m,unit:p,sliderMin:h,sliderMax:b,auto:f,readOnly:g=!1}){const N=o(),y=e??N,O="number"==typeof a&&Number.isFinite(a)?a:void 0,C=void 0!==f&&void 0===O,j=!C&&void 0===O&&void 0!==m,x=Number((h-c).toFixed(6)),V=t(!1),I=e=>{V.current="range"===e.target.type},M=e=>{g||e===O||i(e)};/* @__PURE__ */
7
- return s("div",{className:"es-fslider"+(j||C?" is-style":""),onChangeCapture:I,onKeyDownCapture:I,onPointerDownCapture:I,children:[
8
- /* @__PURE__ */r("label",{className:"es-fslider-name",htmlFor:y,children:l}),
9
- /* @__PURE__ */r(n,{id:y,label:l,value:O??null,onChange:e=>{if(null===e)return M(void 0);M(void 0!==f&&V.current&&e<h?void 0:e)},min:void 0!==f?x:h,max:b,inputMin:u??-1e9,inputMax:d??Number.POSITIVE_INFINITY,step:c,shiftStep:v,suffix:p&&!C?p:void 0,emptyLabel:f??(void 0===m?"":void 0),placeholderValue:void 0===f?m:void 0,stepFrom:void 0!==f?x:void 0,disabled:g,size:"sm"})]})}export{c as FieldSelect,v as FieldSlider,u as optionFor};
4
+ return r("div",{className:"es-fsel",children:/* @__PURE__ */r(a,{...l,value:i>=0?d(i):"",clearable:!1,onChange:e=>{const l=O(e);l&&!Object.is(l.value,n.value)&&s(l.value)}})})}const M={id:o,size:"sm",className:"es-fsel-button",options:j,placeholder:u??g.choose,readOnly:c,renderOption:y?C:void 0,...N};if(!0===n.multiple){const e=Array.isArray(n.value)?n.value:[],l=l=>e.some(e=>Object.is(e,l.value)),a=t.flatMap((e,a)=>l(e)?[d(a)]:[]),s=n.onChange;/* @__PURE__ */
5
+ return r("div",{className:"es-fsel",children:/* @__PURE__ */r(i,{...M,multiple:!0,value:a,renderValue:n.renderValue?e=>n.renderValue(I(e)):void 0,valueText:n.valueText?e=>n.valueText(I(e)):void 0,onChange:e=>s(t.filter((l,a)=>e.includes(d(a))).map(e=>e.value))})})}const T=t.findIndex(e=>Object.is(e.value,n.value)),F=n.onChange;/* @__PURE__ */
6
+ return r("div",{className:"es-fsel",children:/* @__PURE__ */r(i,{...M,value:T>=0?d(T):"",renderValue:n.renderValue?e=>n.renderValue(I(e)[0]):void 0,valueText:n.valueText?e=>n.valueText(I(e)[0]):void 0,onChange:e=>{const l=O(e);l&&!Object.is(l.value,n.value)&&F(l.value)}})})}function v({id:e,label:l,value:a,onChange:i,min:u,max:d,step:c=1,shiftStep:v,styleValue:m,unit:p,sliderMin:h,sliderMax:b,auto:f,readOnly:g=!1}){const N=o(),x=e??N,y="number"==typeof a&&Number.isFinite(a)?a:void 0,O=void 0!==f&&void 0===y,C=!O&&void 0===y&&void 0!==m,j=Number((h-c).toFixed(6)),V=t(!1),I=e=>{V.current="range"===e.target.type},M=e=>{g||e===y||i(e)};/* @__PURE__ */
7
+ return s("div",{className:"es-fslider"+(C||O?" is-style":""),onChangeCapture:I,onKeyDownCapture:I,onPointerDownCapture:I,children:[
8
+ /* @__PURE__ */r("label",{className:"es-fslider-name",htmlFor:x,children:l}),
9
+ /* @__PURE__ */r(n,{id:x,label:l,value:y??null,onChange:e=>{if(null===e)return M(void 0);M(void 0!==f&&V.current&&e<h?void 0:e)},min:void 0!==f?j:h,max:b,inputMin:u??-1e9,inputMax:d??Number.POSITIVE_INFINITY,step:c,shiftStep:v,suffix:p&&!O?p:void 0,emptyLabel:f??(void 0===m?"":void 0),placeholderValue:void 0===f?m:void 0,stepFrom:void 0!==f?j:void 0,disabled:g,size:"sm"})]})}export{c as FieldSelect,v as FieldSlider,u as optionFor};
@@ -1,7 +1,7 @@
1
- import{clientOnly as n}from"./chunk-GXQCZJOP.js";import{ScreenStoreProvider as e}from"./chunk-4CJP57AY.js";import{ScreenChrome as r}from"./chunk-IJ3OOBDY.js";import{ScreenDocumentProvider as a,useScreenDocument as i}from"./chunk-ONRYLR2D.js";import{DEFAULT_SCREEN_WORDS as s}from"./chunk-E2O2MRZR.js";import{documentPermissions as o}from"./chunk-THWO5YVZ.js";import{useWords as t}from"./chunk-MFIRYGHW.js";import{useMemo as c}from"react";import{Dialog as d,Button as l}from"efficient-shell/ui";import{jsx as m,jsxs as g,Fragment as h}from"react/jsx-runtime";var v=n(e),f=n(r);function p({saving:n,onCancel:e,onDiscard:r,onSave:a}){/* @__PURE__ */
1
+ import{clientOnly as n}from"./chunk-GXQCZJOP.js";import{ScreenStoreProvider as e}from"./chunk-AAT3O7PK.js";import{ScreenChrome as r}from"./chunk-UEM66O42.js";import{ScreenDocumentProvider as a,useScreenDocument as i}from"./chunk-ONRYLR2D.js";import{DEFAULT_SCREEN_WORDS as s}from"./chunk-E2O2MRZR.js";import{documentPermissions as o}from"./chunk-THWO5YVZ.js";import{useWords as t}from"./chunk-MFIRYGHW.js";import{useMemo as c}from"react";import{Dialog as d,Button as l}from"efficient-shell/ui";import{jsx as m,jsxs as g,Fragment as h}from"react/jsx-runtime";var v=n(e),f=n(r);function p({saving:n,onCancel:e,onDiscard:r,onSave:a}){/* @__PURE__ */
2
2
  return m(d,{open:!0,role:"alertdialog",size:"sm",title:"Unsaved changes",onClose:e,footer:/* @__PURE__ */g(h,{children:[
3
3
  /* @__PURE__ */m(l,{variant:"secondary",onClick:e,children:"Cancel"}),
4
4
  /* @__PURE__ */m(l,{variant:"ghost-danger",onClick:r,children:"Discard & leave"}),
5
5
  /* @__PURE__ */m(l,{variant:"primary",loading:n,onClick:a,children:n?"Saving…":"Save & leave"})]}),children:"Your most recent edits haven’t finished saving yet. Save them before switching, or leave and discard them."})}function u({target:n,addressing:e,onHostMessage:r,children:i}){/* @__PURE__ */
6
- return m(a,{target:n,addressing:e,onHostMessage:r,children:i})}var C=(n,e)=>/* @__PURE__ */g(h,{children:[n,e]});function k({config:n,parts:e,wrap:r=C}){const{data:a,error:d,redirecting:l,ready:g,saveStatus:h,readOnly:u,onChange:k,pendingNav:N,cancelPendingNav:j,discardAndNavigate:O,saveAndNavigate:S}=i(),Y=c(()=>o(!u),[u]),y=t("screen",s);return l?/* @__PURE__ */m("div",{className:"sf-msg",children:y.loading}):d?/* @__PURE__ */m("div",{className:"sf-msg sf-msg--error",children:d}):g?a?r(
7
- /* @__PURE__ */m(v,{config:n,data:a,onChange:k,permissions:Y,parts:e,children:/* @__PURE__ */m(f,{})}),N&&/* @__PURE__ */m(p,{saving:"saving"===h,onCancel:j,onDiscard:O,onSave:()=>{S()}})):/* @__PURE__ */m("div",{className:"sf-msg",children:y.loading}):/* @__PURE__ */m("div",{className:"sf-msg",children:y.waitingForAuthorization})}export{k as DocumentScreen,u as ScreenMount};
6
+ return m(a,{target:n,addressing:e,onHostMessage:r,children:i})}var k=(n,e)=>/* @__PURE__ */g(h,{children:[n,e]});function C({config:n,parts:e,wrap:r=k}){const{data:a,error:d,redirecting:l,ready:g,saveStatus:h,readOnly:u,onChange:C,pendingNav:N,cancelPendingNav:j,discardAndNavigate:O,saveAndNavigate:S}=i(),y=c(()=>o(!u),[u]),A=t("screen",s);return l?/* @__PURE__ */m("div",{className:"sf-msg",children:A.loading}):d?/* @__PURE__ */m("div",{className:"sf-msg sf-msg--error",children:d}):g?a?r(
7
+ /* @__PURE__ */m(v,{config:n,data:a,onChange:C,permissions:y,parts:e,children:/* @__PURE__ */m(f,{})}),N&&/* @__PURE__ */m(p,{saving:"saving"===h,onCancel:j,onDiscard:O,onSave:()=>{S()}})):/* @__PURE__ */m("div",{className:"sf-msg",children:A.loading}):/* @__PURE__ */m("div",{className:"sf-msg",children:A.waitingForAuthorization})}export{C as DocumentScreen,u as ScreenMount};
@@ -0,0 +1,5 @@
1
+ import{blockTypesIn as e}from"./chunk-5ZBY24K7.js";import{buildPaletteSections as t,pinnedSection as o,paletteWithoutPinned as n,categoryLabel as i}from"./chunk-PA3PNTVV.js";import{sectionTemplatesOf as s}from"./chunk-BVN33R76.js";import{SidePanelHead as r,PanelModeExit as c}from"./chunk-BSSKAEFF.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-5TRBCPRB.js";import{DEFAULT_SCREEN_WORDS as d}from"./chunk-E2O2MRZR.js";import{useEasel as f}from"./chunk-PYCLHOSA.js";import{useWords as u}from"./chunk-MFIRYGHW.js";import{AddPanel as k}from"./chunk-6HHHBBSY.js";import{useState as h,useEffect as y,useMemo as b}from"react";import{AddIcon as j}from"efficient-shell/icons/efficient";import{jsx as B,jsxs as g,Fragment as $}from"react/jsx-runtime";var O=e=>`section:${e}`,H=e=>`block:${e}`,v=e=>`template:${e}`;function R({blocks:R,blocksOnly:x,at:A,onAdd:S,itemFor:C,session:F,siteWide:I,onClose:L,onHide:V,readOnly:N}){const P=f(e=>e.config),T=p(),{labelAtLevel:Y,categoryLabel:D,firstSection:E,Icon:w,Thumbnail:z}=T,{blockIsOffered:K}=m(),M=u("screen",d).add,Q=l(),[W,Z]=h([]);y(()=>{let t=!1;const o=e=>K(e,Q);return s(Q).list().then(n=>{if(t)return;const i=P.components;Z(n.filter(t=>t.node?.type&&i[t.node.type]&&e(t.node).every(o)))}).catch(()=>{}),()=>{t=!0}},[P,Q]);const G=b(()=>t(P,T),[P]),J=e=>({type:O(e.type),label:e.name,cover:/* @__PURE__ */B(z,{type:e.type}),title:e.desc?`${e.name} — ${e.desc}`:M.tile({name:e.name}),keywords:[e.alias??"",e.desc,e.type,e.catLabel].filter(Boolean)}),q=b(()=>{const e=[];if(R&&R.choices.length>0&&a(R.choices).forEach((t,o)=>{e.push({key:`blocks:${o}`,title:0===o?`${M.inside({name:R.parentName})}${t.group?` · ${t.group}`:""}`:t.group??"",tiles:t.items.map(e=>({type:H(e.type),label:e.label,icon:/* @__PURE__ */B(w,{type:e.type,size:18}),title:M.tile({name:e.label})}))})}),x)return e;const t=o(G,E);t&&e.push({key:"start",title:M.startBlank,tiles:[J(t)]}),W.length>0&&e.push({key:"templates",title:M.templates,tiles:W.map(e=>{return{type:v(e.id),label:e.name,cover:/* @__PURE__ */B(z,{type:e.node.type}),keywords:[(t=e.node.type,Y(t,"section",P.components[t]?.label??t)),e.node.type]};var t})});const s=n(G,E);for(const t of Object.keys(P.categories??{})){const o=s.filter(e=>e.cat===t);0!==o.length&&e.push({key:`category:${t}`,title:i(P,t,D),tiles:o.map(J)})}return e},[R,x,W,G,P,M]),U=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=W.find(e=>e.id===n);return e?{kind:"template",template:e}:null}return null};/* @__PURE__ */
2
+ return g($,{children:[
3
+ /* @__PURE__ */B(r,{icon:/* @__PURE__ */B(j,{size:15}),title:M.title,context:x?M.contextBlocks:M.contextAll,actions:/* @__PURE__ */B(c,{label:M.done,description:M.doneDescription,onClick:L}),onHide:V}),
4
+ /* @__PURE__ */g("div",{className:"sf-addside sf-scroll",children:[
5
+ /* @__PURE__ */B(k,{groups:q,session:F,itemFor:e=>C(U(e)??{kind:"section",type:e}),onInsert:e=>{const t=U(e);t&&S(t)},at:A,hint:x?M.hintBlocks:M.hint,searchLabel:x?M.searchBlocks:M.searchSections,readOnly:N}),I&&!x?I:null]})]})}export{R as AddSidePanel,H as blockKey,O as sectionKey,v as templateKey};
@@ -1 +1 @@
1
- import{useScreenBlockRules as e}from"./chunk-LACBURK5.js";import{newNodeId as t,ROOT_ZONE as n}from"./chunk-PLVEGYK6.js";import{useEasel as o,useEaselApi as r}from"./chunk-PYCLHOSA.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-5TRBCPRB.js";import{newNodeId as t,ROOT_ZONE as n}from"./chunk-PLVEGYK6.js";import{useEasel as o,useEaselApi as r}from"./chunk-PYCLHOSA.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,64 +1,64 @@
1
- import{dedupeSlotChildren as e}from"./chunk-26OOWIJJ.js";import{styleClipboardOf as n}from"./chunk-ZV6OYSZ7.js";import{markedTreeNodeId as t,revealSelectedTreeRow as o,sameSelector as r}from"./chunk-FGNR22NY.js";import{cloneNodeWithFreshIds as i}from"./chunk-2GVCAIPX.js";import{rootRowName as l,slotChildRowName as s,slotChildRenameProp as d,sectionRenameProp as c}from"./chunk-TBF5CVPA.js";import{scrollPreviewToSection as a,gotoPreviewSlide as p,scrollPreviewToTop as u}from"./chunk-4ES5JGGX.js";import{useEaselKeyTarget as f,useEaselUndoKeys as h,editorRootFocus as m}from"./chunk-PT6V53OO.js";import{SlotChildActionsProvider as g}from"./chunk-KCBEE2MC.js";import{screenStorageKeys as y,DEFAULT_PANEL_W as k,clampPanelWidth as S}from"./chunk-2JIWFFXA.js";import{usePartBridge as v}from"./chunk-IJGHMGG4.js";import{useSectionOps as x}from"./chunk-LC7N3GZS.js";import{useNodeClipboard as b,useNodeContextMenu as w}from"./chunk-HGTPLCTQ.js";import{PageEditGuardNotices as z}from"./chunk-35Q5HMJZ.js";import{useScreenDocument as B}from"./chunk-ONRYLR2D.js";import{requestMediaPick as C}from"./chunk-KG7RJWOK.js";import{heldStyle as O,styleShortcut as $}from"./chunk-V7U33NF2.js";import{AddChildRow as N}from"./chunk-5545A3PC.js";import{AddSidePanel as I}from"./chunk-PT6NPMWV.js";import{SidePanelHead as P,PanelShowStrip as T}from"./chunk-BSSKAEFF.js";import{MediaSidePanel as A}from"./chunk-PBVC2VGH.js";import{useScreenSaveSwitch as M,useScreenNodeKeys as R,useScreenPinned as j,useScreenDocumentLabel as L,useScreenCanvasFrame as E,useScreenInspectorPanel as V,useScreenDevices as H,useScreenPickFollowsSelection as F,useScreenLeftView as D,useScreenAdd as G,SELECTION_MODE as U,sameInspectorMode as W,useScreenBridges as Y,useScreenBlockRules as J,useScreenBlockLook as K,useScreenStorageNamespace as _,useScreenNotify as X,useScreenCanvasHead as q,isSlotMode as Z,useScreenStyleClipboard as Q,useScreenDocumentPass as ee,useScreenCanvasDrag as ne,ScreenCanvasTargetProvider as te,isPinnedFirst as oe,isPinnedLast as re,screenSlotsOf as ie}from"./chunk-LACBURK5.js";import{ROOT_ZONE as le,blockNodeActions as se,TREE_MAX_DEPTH as de,childSlotsOf as ce,slotFieldsOf as ae,slotChildrenIn as pe,nestsInTree as ue,newNodeId as fe}from"./chunk-PLVEGYK6.js";import{useMediaPanel as he,usePanelPick as me,useCancelPanelPick as ge}from"./chunk-R6WTQWAC.js";import{useEaselHost as ye,useHostEscape as ke}from"./chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as Se}from"./chunk-E2O2MRZR.js";import{useEasel as ve,useEaselApi as xe}from"./chunk-PYCLHOSA.js";import{TreeRow as be,Subtree as we,LayersTree as ze,TreeGroupLabel as Be,TreeRowAction as Ce,TreeSeam as Oe}from"./chunk-UFY6RNMT.js";import{toItemSelector as $e,useNodeOps as Ne}from"./chunk-D2BCHTQR.js";import{LayersIcon as Ie,MediaIcon as Pe}from"./chunk-4VJATVVR.js";import{saveIndicator as Te}from"./chunk-H6DDIBQ4.js";import{EaselTopBar as Ae,TopBarRail as Me,TopBarCluster as Re,EaselIconButton as je,TopBarDivider as Le,DeviceSwitch as Ee,InspectorIconButton as Ve,PanelResizeHandle as He,MAX_PANEL_W as Fe,MIN_PANEL_W as De,panelWidthVars as Ge,SaveState as Ue,SaveStateToggle as We}from"./chunk-OXYGFK2B.js";import{useWords as Ye}from"./chunk-MFIRYGHW.js";import{CanvasDragLayer as Je}from"./chunk-6HHHBBSY.js";import{createDragSession as Ke,useTreeDrag as _e,gapToMoveIndex as Xe}from"./chunk-67GNT6PF.js";import{useCanvasFrame as qe,BLOCK_SELECTOR as Ze,useCanvasEvent as Qe}from"./chunk-PAELDYYS.js";import{zoneKey as en,ROOT_ID as nn,ROOT_SLOT as tn,parseZoneKey as on,DataError as rn}from"./chunk-KRXQM65X.js";import{useRef as ln,useMemo as sn,useState as dn,useEffect as cn,useCallback as an,useLayoutEffect as pn,Fragment as un}from"react";import{Tooltip as fn,Button as hn,toast as mn}from"efficient-shell/ui";import{UndoIcon as gn,RedoIcon as yn,TrashIcon as kn,EyeOffIcon as Sn,EyeIcon as vn,DuplicateIcon as xn}from"efficient-shell/icons/efficient";import{jsx as bn,jsxs as wn,Fragment as zn}from"react/jsx-runtime";function Bn({saveState:e,notSaving:n,readOnlyReason:t,toggle:o,onToggle:r,onRetry:i}){if(null!==t)/* @__PURE__ */return bn(Ue,{tone:"off",label:t,role:"status"});if(n)/* @__PURE__ */
2
- return bn(Ue,{tone:e.pending?"off-unsaved":"off",label:"Not saving — see the notice above",role:"status"});const{tone:l,label:s}=Te(e),d=e.failed&&!e.paused&&/* @__PURE__ */bn(hn,{variant:"secondary",size:"sm",onClick:i,children:"Retry now"});/* @__PURE__ */
1
+ import{dedupeSlotChildren as e}from"./chunk-26OOWIJJ.js";import{styleClipboardOf as n}from"./chunk-ZV6OYSZ7.js";import{markedTreeNodeId as t,revealSelectedTreeRow as o,sameSelector as r}from"./chunk-FGNR22NY.js";import{cloneNodeWithFreshIds as i}from"./chunk-2GVCAIPX.js";import{rootRowName as l,slotChildRowName as s,slotChildRenameProp as d,sectionRenameProp as c}from"./chunk-TBF5CVPA.js";import{scrollPreviewToSection as a,gotoPreviewSlide as p,scrollPreviewToTop as u}from"./chunk-4ES5JGGX.js";import{useEaselKeyTarget as f,useEaselUndoKeys as h,editorRootFocus as m}from"./chunk-PT6V53OO.js";import{SlotChildActionsProvider as g}from"./chunk-KCBEE2MC.js";import{screenStorageKeys as y,DEFAULT_PANEL_W as k,clampPanelWidth as S}from"./chunk-2JIWFFXA.js";import{usePartBridge as v}from"./chunk-VB5LRSGJ.js";import{useSectionOps as x}from"./chunk-UAVNI3BU.js";import{useNodeClipboard as b,useNodeContextMenu as w}from"./chunk-HGTPLCTQ.js";import{PageEditGuardNotices as z}from"./chunk-35Q5HMJZ.js";import{useScreenDocument as B}from"./chunk-ONRYLR2D.js";import{requestMediaPick as C}from"./chunk-KG7RJWOK.js";import{heldStyle as O,styleShortcut as $}from"./chunk-V7U33NF2.js";import{AddChildRow as N}from"./chunk-5545A3PC.js";import{AddSidePanel as I}from"./chunk-TSQUEJZB.js";import{SidePanelHead as T,PanelShowStrip as P}from"./chunk-BSSKAEFF.js";import{MediaSidePanel as A}from"./chunk-6OY2THZH.js";import{useScreenSaveSwitch as R,useScreenNodeKeys as M,useScreenPinned as j,useScreenDocumentLabel as E,useScreenCanvasFrame as L,useScreenInspectorPanel as V,useScreenDevices as H,useScreenPickFollowsSelection as F,useScreenLeftView as D,useScreenAdd as U,SELECTION_MODE as G,sameInspectorMode as W,useScreenBridges as Y,useScreenBlockRules as J,useScreenBlockLook as _,useScreenStorageNamespace as K,useScreenNotify as X,useScreenCanvasHead as Z,isSlotMode as q,useScreenStyleClipboard as Q,useScreenDocumentPass as ee,useScreenCanvasDrag as ne,ScreenCanvasTargetProvider as te,isPinnedFirst as oe,isPinnedLast as re,screenSlotsOf as ie}from"./chunk-5TRBCPRB.js";import{ROOT_ZONE as le,blockNodeActions as se,TREE_MAX_DEPTH as de,childSlotsOf as ce,slotFieldsOf as ae,slotChildrenIn as pe,nestsInTree as ue,newNodeId as fe}from"./chunk-PLVEGYK6.js";import{useMediaPanel as he,usePanelPick as me,useCancelPanelPick as ge}from"./chunk-R6WTQWAC.js";import{useEaselHost as ye,useHostEscape as ke}from"./chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as Se}from"./chunk-E2O2MRZR.js";import{useEasel as ve,useEaselApi as xe}from"./chunk-PYCLHOSA.js";import{TreeRow as be,Subtree as we,LayersTree as ze,TreeGroupLabel as Be,TreeRowAction as Ce,TreeSeam as Oe}from"./chunk-UFY6RNMT.js";import{toItemSelector as $e,useNodeOps as Ne}from"./chunk-D2BCHTQR.js";import{LayersIcon as Ie,MediaIcon as Te}from"./chunk-4VJATVVR.js";import{saveIndicator as Pe}from"./chunk-H6DDIBQ4.js";import{EaselTopBar as Ae,TopBarRail as Re,TopBarCluster as Me,EaselIconButton as je,TopBarDivider as Ee,DeviceSwitch as Le,InspectorIconButton as Ve,PanelResizeHandle as He,MAX_PANEL_W as Fe,MIN_PANEL_W as De,panelWidthVars as Ue,SaveState as Ge,SaveStateToggle as We}from"./chunk-OXYGFK2B.js";import{useWords as Ye}from"./chunk-MFIRYGHW.js";import{CanvasDragLayer as Je}from"./chunk-6HHHBBSY.js";import{createDragSession as _e,useTreeDrag as Ke,gapToMoveIndex as Xe}from"./chunk-67GNT6PF.js";import{useCanvasFrame as Ze,BLOCK_SELECTOR as qe,useCanvasEvent as Qe}from"./chunk-PAELDYYS.js";import{zoneKey as en,ROOT_ID as nn,ROOT_SLOT as tn,parseZoneKey as on,DataError as rn}from"./chunk-KRXQM65X.js";import{useRef as ln,useMemo as sn,useState as dn,useEffect as cn,useCallback as an,useLayoutEffect as pn,Fragment as un}from"react";import{Tooltip as fn,Button as hn,toast as mn}from"efficient-shell/ui";import{UndoIcon as gn,RedoIcon as yn,TrashIcon as kn,EyeOffIcon as Sn,EyeIcon as vn,DuplicateIcon as xn}from"efficient-shell/icons/efficient";import{jsx as bn,jsxs as wn,Fragment as zn}from"react/jsx-runtime";function Bn({saveState:e,notSaving:n,readOnlyReason:t,toggle:o,onToggle:r,onRetry:i}){if(null!==t)/* @__PURE__ */return bn(Ge,{tone:"off",label:t,role:"status"});if(n)/* @__PURE__ */
2
+ return bn(Ge,{tone:e.pending?"off-unsaved":"off",label:"Not saving — see the notice above",role:"status"});const{tone:l,label:s}=Pe(e),d=e.failed&&!e.paused&&/* @__PURE__ */bn(hn,{variant:"secondary",size:"sm",onClick:i,children:"Retry now"});/* @__PURE__ */
3
3
  return wn(zn,o?{children:[
4
- /* @__PURE__ */bn(We,{pressed:e.paused,onToggle:r,title:e.paused?"Auto-save is off — click to turn it back on (saves your held edits)":"Auto-save is on — click to pause it",children:/* @__PURE__ */bn(Ue,{tone:l,label:s})}),d]}:{children:[
5
- /* @__PURE__ */bn(Ue,{tone:l,label:s,role:"status"}),d]})}function Cn({expand:e}){/* @__PURE__ */
4
+ /* @__PURE__ */bn(We,{pressed:e.paused,onToggle:r,title:e.paused?"Auto-save is off — click to turn it back on (saves your held edits)":"Auto-save is on — click to pause it",children:/* @__PURE__ */bn(Ge,{tone:l,label:s})}),d]}:{children:[
5
+ /* @__PURE__ */bn(Ge,{tone:l,label:s,role:"status"}),d]})}function Cn({expand:e}){/* @__PURE__ */
6
6
  return bn("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */wn(zn,e?{children:[
7
7
  /* @__PURE__ */bn("path",{d:"M8 9l4-4 4 4"}),
8
8
  /* @__PURE__ */bn("path",{d:"M8 15l4 4 4-4"})]}:{children:[
9
9
  /* @__PURE__ */bn("path",{d:"M8 4l4 4 4-4"}),
10
10
  /* @__PURE__ */bn("path",{d:"M8 20l4-4 4 4"}),
11
- /* @__PURE__ */bn("path",{d:"M5 12h14"})]})})}function On(e,n,t){const o=t-n;if(o<6)return null;if(o<26)return{top:Math.round((n+t)/2),height:Math.round(o)};return{top:Math.round(Math.min(Math.max(e,n+13),t-13))}}var $n="__rungs";var Nn="screen:band",In={duplicate:!0,delete:!0};function Pn(){const Te=ye(),{target:Ue,docId:We,capabilities:Pn,currentSlug:Tn,siteId:An,onPublish:Mn,saveState:Rn,saveConflict:jn,retrySave:Ln,toggleAutoSave:En,readOnly:Vn,readOnlyReason:Hn=null}=B(),Fn=M(),Dn=R(),{mediaEditing:Gn,hasEditGuard:Un,hasPinnedChrome:Wn}=Pn,{appState:Yn,dispatch:Jn,history:Kn,selectedItem:_n,getSelectorForId:Xn,config:qn}=ve(e=>e),Zn=j(),{first:Qn,firstGroup:et,lastGroup:nt,isSectionGroup:tt,sectionGroupZone:ot,panelOf:rt}=Zn,it=rt(Qn),lt=e=>oe(Zn,e),st=e=>re(Zn,e),dt="node"===Zn.firstRow,ct=Zn.band??null,at=Ye("screen",Se),pt=L()??`/${Tn}`,ut=E(),ft=V(),ht=x({readOnly:Vn}),mt=x({readOnly:Vn,foldIntoHistory:!0}),gt=ln(null),yt=xe(),kt=sn(()=>({...ht,select:e=>{gt.current=e,ht.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=yt.config;gt.current=$e(e,t,n)}ht.commitDocument(e,n)}}),[ht,yt]),St=Yn.ui,vt=St.leftSideBarVisible,xt=St.rightSideBarVisible,{options:bt,widths:wt,initial:zt,fluid:Bt,fit:Ct}=H(),[Ot,$t]=dn(zt),Nt=he(),It=Gn&&null!==Nt,Pt=me(),Tt=ge();F(_n?.props.id);const{read:At,write:Mt,forSelection:Rt}=D(),[jt,Lt]=dn(At);cn(()=>{Mt(jt)},[jt]);const[Et,Vt]=dn(0),Ht=ln(null),Ft=ln(null),Dt=qe(Ft,{readySelector:Ze}),Gt=f(Ft);h(Ft,Dt);const[Ut,Wt]=dn(!1),Yt=ln(!1),Jt=ln(!1),[Kt,_t]=dn(null),Xt=G(),qt=e=>_t(null===e?null:{zone:le,index:e}),[Zt,Qt]=dn([]),[eo,no]=dn(U),to="puck"===eo.kind,oo=Ut&&!Kt&&Xt.railTarget?Xt.railTarget(Yn.data,{node:_n??null,mode:eo}):null,ro=oo?{zone:en(oo),index:oo.index}:null,io=Kt??ro,lo=io&&io.zone===le?io.index:null,so=t(eo,_n?.props.id),[co,ao]=dn(null);cn(()=>{co&&(o(),ao(null))},[co]);const po=ln(Xn);po.current=Xn;const uo=an((e,{scroll:n})=>{Lt(n=>Rt(e,n)),n&&ao(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=po.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&Do(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),fo=ln(null);cn(()=>{const e=fo.current;fo.current=null;const n=null==_n?.props.id?null:String(_n.props.id);no(e&&e.id===n?e.mode:rt(_n?.type)??U);const t=_n?.props.id,o=gt.current;if(gt.current=null,!t)return;const i=Xn(t);uo(String(t),{scroll:!r(o,i??null,le)})},[_n?.props.id,uo]);const ho=an(e=>{no(n=>W(n,e)?n:e),Jn({type:"setUi",ui:{rightSideBarVisible:!0}})},[Jn]),mo=ln(()=>{});mo.current=(e,n)=>{const t=e?Ar(e.zone??le)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==_n?.props.id?null:String(_n.props.id);no(e=>W(e,n)?e:n),o!==r&&(fo.current={id:o,mode:n},kt.select(e))};const go=an((e,n)=>mo.current(e,n),[]),yo={kind:eo.kind,mode:eo,open:ho,show:e=>no(e),reveal:()=>{xt||Jn({type:"setUi",ui:{rightSideBarVisible:!0}})},select:go},ko=Y(yo,{data:Yn.data,selected:_n??null,zoneOf:e=>Xn(e)?.zone,readOnly:Boolean(Vn),select:e=>{no(U),kt.select({index:e})},replace:(e,n)=>kt.replaceComponent(le,e,n),scrollTo:e=>ri(e)},{device:Ot,refreshes:Et},{setView:Lt,reveal:()=>{vt||Jn({type:"setUi",ui:{leftSideBarVisible:!0}})}}),So=ko.pinnedSource??!1,vo=ko.resolveLeftView?ko.resolveLeftView(jt,It):"media"===jt&&It?jt:"sections",xo=J(),{isLockedBlock:bo,duplicateBlocked:wo,nestDepth:zo,newSectionNode:Bo,canAddTo:Co,blockIsOffered:Oo}=xo,$o=K(),{labelAtLevel:No,Icon:Io,useProducts:Po}=$o,To=$o.rowName?(e,n,t)=>$o.rowName(e,n,t):void 0,Ao=an(e=>{Jn({type:"setUi",ui:{rightSideBarVisible:!0}}),a(e),uo(e,{scroll:!0})},[Jn,uo]),{selectNode:Mo,openPartId:Ro}=v({mode:eo,setMode:no,onOpenPart:Ao}),[jo,Lo]=dn(null);ke(null!==jo,()=>Lo(null));const Eo=y(_()),Vo=Eo.collapsed,Ho=Eo.panelWidths,[Fo,Do]=dn(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(Vo);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
12
- return new Set}});cn(()=>{try{window.localStorage.setItem(Vo,JSON.stringify([...Fo]))}catch{}},[Fo]);const[Go,Uo]=dn(()=>{if("undefined"==typeof window)return{...k};try{const e=window.localStorage.getItem(Ho);if(!e)return{...k};const n=JSON.parse(e);return{left:S(Number(n.left)||k.left),right:S(Number(n.right)||k.right)}}catch{return{...k}}});cn(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(Ho,JSON.stringify(Go))}catch{}},300);return()=>clearTimeout(e)},[Go]);const Wo=an((e,n)=>Uo(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),Yo=an(e=>Wo("left",e),[Wo]),Jo=an(e=>Wo("right",e),[Wo]),Ko=e=>Fo.has(e),_o=e=>Do(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),Xo=ln(!1),qo=ln(null);cn(()=>{if(Xo.current&&!Ut){const e=qo.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??Ft.current?.querySelector(`button[aria-label="${CSS.escape(at.add.title)}"]`))?.focus(),qo.current=null}Xo.current=Ut},[Ut]),cn(()=>{if(!Ut||!Gt)return;const e=e=>{"Escape"===e.key&&fi()};return Gt.addEventListener("keydown",e),()=>Gt.removeEventListener("keydown",e)},[Ut,Gt]),ke(Ut,()=>fi()),cn(()=>{!vt&&Ut&&(Wt(!1),_t(null),Yt.current=!1)},[vt]),cn(()=>{if(!Pt)return Jt.current&&Jn({type:"setUi",ui:{leftSideBarVisible:!1}}),void(Jt.current=!1);Ut&&(Wt(!1),_t(null),Jt.current=Yt.current,Yt.current=!1),vt||(Jt.current=!0,Jn({type:"setUi",ui:{leftSideBarVisible:!0}}))},[Pt]),cn(()=>{!vt&&Pt&&(Jt.current=!1,Tt())},[vt]),cn(()=>{if(!Pt||!Gt)return;const e=e=>{"Escape"===e.key&&Tt()};return Gt.addEventListener("keydown",e),()=>Gt.removeEventListener("keydown",e)},[Pt,Gt]),ke(null!==Pt,()=>Tt());const Zo=X(),Qo=(e,n="success")=>{Zo?Zo(e,"error"===n?"error":"info"):"error"===n?mn.error(e,{duration:3200,sound:!1}):mn.success(e,{duration:1900,sound:!1})},er=ln(null),[nr,tr]=dn(0),[or,rr]=dn(0),ir=q(),lr=ln(null),sr=e=>Math.max(0,e.clientHeight-(lr.current?.offsetHeight??0));cn(()=>{const e=er.current;if(!e)return;const n=()=>{tr(e.clientWidth),rr(sr(e))};n();const t=new ResizeObserver(n);return t.observe(e),lr.current&&t.observe(lr.current),()=>t.disconnect()},[]),pn(()=>{er.current&&(tr(er.current.clientWidth),rr(sr(er.current)))},[Go,vt,xt]);const dr=Ot===Bt?nr>0?nr:wt[Bt]:wt[Ot],cr=nr>0?Math.min(nr/dr,"shrink"===Ct?1:2):1,ar=dr*cr,pr=nr>0&&ar>nr+1,ur={width:ar,height:or||"100%",flex:"none",position:"relative"},fr={width:dr,height:or?or/cr:"100%",maxHeight:"none",transform:1!==cr?`scale(${cr})`:void 0,transformOrigin:"top left"},hr=()=>Jn({type:"setUi",ui:{leftSideBarVisible:!vt}}),mr=()=>Jn({type:"setUi",ui:{rightSideBarVisible:!xt}}),gr=e=>{Ut&&(Wt(!1),_t(null),Yt.current=!1,vt&&jt===e)||Pt&&(Jt.current=!1,Tt(),vt&&jt===e)||(vt&&jt===e?hr():(Lt(e),vt||Jn({type:"setUi",ui:{leftSideBarVisible:!0}})))},yr=()=>{C(Te,{accept:"image/*",title:"Media library"})},kr=()=>{no(U),kt.select(null),u()},Sr=()=>{no(it??U),xt||Jn({type:"setUi",ui:{rightSideBarVisible:!0}})},vr=Yn.data.content??[],xr=()=>{const e=vr.findIndex(lt),n=vr.findIndex(st);return{floor:e>=0?e+1:0,cap:n>=0?n:vr.length}},br=qn,wr=xo.stripCopy,zr=e=>i(e,wr),Br=b(),Cr=Ne({data:Yn.data,config:br,readOnly:Boolean(Vn),clipboard:Br,strip:wr?e=>wr(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==nn||e.slot!==tn)return{min:0,max:n-1};const{floor:t,cap:o}=xr();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&no(U);const t=void 0===n||"node"===n?.kind?n:null;kt.commitDocument(e,t)}}),Or=e=>qn.components[e]?.label??e,$r=an(e=>qn.components[e]?.defaultProps??{},[qn]),Nr=e=>No(e,"section",Or(e)),Ir=e=>l({type:e.type,props:e.props??{}},Nr(e.type),To),{nodeAddresses:Pr,zoneItems:Tr}=sn(()=>{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>=de)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of ce(qn,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(vr,le,0),{nodeAddresses:e,zoneItems:n}},[vr,qn]),Ar=an(e=>Tr.get(e)??[],[Tr]),Mr=e=>{const n=Pr.get(e);return n?Ar(n.zone)[n.index]:void 0},Rr=e=>ie(xo,qn,e),jr=e=>{if(!xo.slotsOf||e===le)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=Mr(e.slice(0,n));if(!t)return null;const o=Rr(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}},Lr=(()=>{if(!Z(eo))return null;const e=`${eo.nodeId}:${eo.slot}`;return jr(e)?.slot.panel===eo.kind?e:null})(),Er=ln(null);cn(()=>{const e=Er.current;if(Er.current=null,!Lr||!Z(eo))return;const n=eo.nodeId;uo(n,{scroll:e!==Lr}),Do(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[eo]);const Vr=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void(e=>{const n=Pr.get(e);n&&(n.zone===le?ii(n.index):Ri(n.zone,n.index,e,Mr(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))})(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&Lr!==i&&(Er.current=i),go(null,r),xt||Jn({type:"setUi",ui:{rightSideBarVisible:!0}}),ri(o)},Hr=(e,n,t)=>{const o=`${e}:${n}`;if(Do(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;Lr!==o&&(Er.current=o);go(null,{kind:t,nodeId:e,slot:n})},Fr=(e,n,t)=>{if(Vn||!xo.moveSlot)return;const o=Mr(e),r=o?Rr(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:$n,index:n},s=Xe(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=xo.moveSlot(e,n,s);"string"==typeof d&&Hr(e,d,i.panel)},Dr=Po(),Gr=sn(()=>{const e=/* @__PURE__ */new Map;for(const n of Dr??[])e.set(n.slug,n.name);return e},[Dr]),Ur=e=>s(e,Or,$o.plainText,e=>Gr.get(e),$o.rowName),Wr=(e,n)=>{const t=qn.components[e.type]?.fields,o=n===le||Qi(n)?"section":"block",r=n===le&&(lt(e)||st(e)||tt(e.type)),i="block"===o?d(t):r?null:c(t);return $o.renamePropOf?$o.renamePropOf(e,o,i):i},Yr=(e,n,t,o)=>{if(!(!Vn&&jo?.zone===e&&jo.index===n))return;const r=(t,o)=>{Lo(null),o&&((e,n,t)=>{const o=Ar(e)[n];if(!o)return;const r=Wr(o,e);r&&kt.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
13
- return bn("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":"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)},Jr=n(Q()),Kr=Jr.scope({target:Ue,siteId:An,docId:We}),_r=qn,Xr=(e,n)=>n===le?Nr(e):Or(e),qr=(e,n,t)=>{const o=Jr.plan(Kr,t,Xr(t.type,e),_r);o&&(o.changed&&kt.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),Qo(o.message))},Zr=w({nodesIn:Ar,nodeAt:(e,n)=>Ar(e)[n]??null,labelOf:(e,n)=>n===le?Nr(e):Or(e),renamePropOf:Wr,beginRename:(e,n)=>Lo({zone:e,index:n}),history:{hasPast:Kn.hasPast,hasFuture:Kn.hasFuture,back:()=>Kn.back(),forward:()=>Kn.forward()},openAddSection:()=>{kt.select(null),pi(null)},openPageSettings:()=>{kt.select(null),no(U)},pageSettingsLabel:at.pageSettings,readOnly:Boolean(Vn),collapseAll:()=>Do(new Set(Ar(le).map(e=>String(e.props.id)))),onPasteRefused:e=>Qo(e?at.pasteRefused({name:e.label}):"Your browser won’t let us read the clipboard — press ⌘V","error"),canPasteAt:(e,n)=>nl(e,n),menuRows:ko.menuRows,isLocked:e=>bo(e.type),duplicateBlocked:e=>wo(Yn.data,e),permits:e=>se(qn,e.type),canAddTo:Co,nodeOps:Cr,isPinned:(e,n)=>n===le&&(lt(e)||st(e)),sectionBand:xr,openAddInside:(e,n)=>{e===le?ii(n):kt.select({zone:e,index:n}),pi(null)},locate:e=>Pr.get(e)??null,rowNameOf:(e,n)=>n===le?Ir(e):Ur(e),selectAt:(e,n,t,o)=>{e===le?ii(n):Ri(e,n,t,o??"")},slotRung:e=>{const n=jr(e);return n?.slot.panel?{label:n.slot.label,select:()=>Vr(n.node,n.slot,!1)}:null},style:{held:()=>O(Kr),canCopy:e=>Jr.rows(_r,e).some(e=>!1!==e.counted),copy:(e,n)=>Jr.copy(Kr,e,Xr(e.type,n),_r),paste:(e,n,t)=>qr(e,n,t)},keys:Dn?{target:Gt,selected:()=>{const e=Yn.ui.itemSelector;return e?{zone:e.zone??le,index:e.index}:null},held:()=>Br.get(),readOnly:Boolean(Vn),onDone:({done:e,name:n})=>{"copied"===e&&Qo(at.copied({name:n}))}}:void 0},Dt),Qr=ln({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});cn(()=>{Qr.current={copy:(e,n)=>Jr.copy(Kr,e,Xr(e.type,n),_r),paste:qr,at:()=>{const e=Yn.ui.itemSelector;if(!e)return null;const n=e.zone??le,t=Ar(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean(Vn)}});const ei=an(e=>{const n=$(e);if(!n)return;const t=Qr.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))},[]);cn(()=>{if(!Gt)return;const e=e=>ei(e);return Gt.addEventListener("keydown",e),()=>Gt.removeEventListener("keydown",e)},[ei,Gt]),Qe(Dt,"keydown",ei);const ni=vr.map(e=>e.props.id).join("|");cn(()=>{const e=Dt?.document??null,n=Dt?.window??null;let t=0;const o=[],r=()=>{if(!e)return void Qt(e=>e.length?[]:e);const n=vr.findIndex(st),t=n>=0?n:vr.length,o=n=>{const t=vr[n]?.props?.id;return null==t?null:e.querySelector(`[data-puck-component="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(Ze)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=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=On(l&&s?(s.bottom+l.top)/2:l?l.top:s.bottom,Math.max(-1/0,...r(t).map(e=>e.bottom)),Math.min(1/0,...r(n).map(e=>e.top)));d&&i.push({...d,index:e})}Qt(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()}},[Dt,ni,Ot,cr,vt,xt,_n?.props.id]);const ti=Dt?.document??null,oi=Dt?.window??null;cn(()=>{const e=Ht.current;if(!e||!ti||!oi)return;const n=[],t=()=>{const n=ti.querySelector(`[data-puck-component="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&oi.scrollTo({left:oi.scrollX,top:oi.scrollY+t,behavior:"instant"}),!0};return Ht.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[ti,oi]);const ri=e=>{ko.holdCanvasOn?ko.holdCanvasOn(e):a(e)},ii=e=>{no(U),kt.select({index:e}),ko.sectionPressed?.(vr[e]);const n=vr[e]?.props?.id;n&&ri(n)},li=e=>{const{floor:n,cap:t}=xr(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=_n&&eo.kind!==it?.kind?vr.findIndex(e=>e.props.id===_n.props.id):-1;return o(r>=0?r+1:t)},si=(e,n)=>{const{floor:t,cap:o}=xr(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(kt.reorderComponent(le,e,i),kt.select({index:i}),{moved:!0,dest:i})},di=(e,n,t,o)=>{no(U),kt.select(o?{index:o.index,zone:o.zone}:{index:e}),a(n),Qo(`Added “${t}” section`)},ci=(e,n)=>{const t=li(n),o=Bo(e,{nodeDefaults:$r,newNodeId:fe,sectionLabel:Nr,blockIsOffered:Oo}),r=o?kt.insertNode(le,t,o):kt.insertSection(e,t);return di(t,r,Nr(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 ce(qn,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=Co(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},ai=(e,n,t)=>{const o=li(t),r=kt.insertNode(le,o,n);return di(o,r,e),o},pi=e=>ui(le,e),ui=(e,n)=>{qo.current=document.activeElement??null,Pt&&(Yt.current=Jt.current,Jt.current=!1,Tt()),_t(null===n?null:{zone:e,index:n}),Wt(!0),vt||(Yt.current=!0,Jn({type:"setUi",ui:{leftSideBarVisible:!0}}))},fi=()=>{Wt(!1),_t(null),Yt.current&&Jn({type:"setUi",ui:{leftSideBarVisible:!1}}),Yt.current=!1},hi=(e,n,t)=>{if("section"===e.kind)kt.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;kt.insertNode(n,t,zr(e.template.node))}no(U),kt.select({index:t,zone:n})},mi=(e,n)=>$o.rowName?n?lt(e)?$o.rowName(e,"section",at.header):st(e)?$o.rowName(e,"section",at.footer):tt(e.type)?$o.rowName(e,"section",Or(e.type)):Ir(e):Ur(e):n?Nr(e.type):Or(e.type),gi=e=>n=>{e()},yi=()=>ko.editPinnedSource?.(),ki=(e,n,t)=>{if(Vn)return null;const o=Ar(e)[n];return o&&!se(qn,o.type).delete?null:/* @__PURE__ */bn(Ce,{kind:"delete",label:`Delete ${t}`,onClick:()=>((e,n)=>{const t=Ar(e)[n]?.props?.id;null!=t&&Cr.remove(String(t))})(e,n),children:/* @__PURE__ */bn(kn,{size:15})})},Si=e=>$o.rowPreview?.(e)||void 0,vi=e=>$o.rowMarks?.(e)??void 0,xi=(e,n,t)=>$o.rowActions?.(e,n,t)??null,bi=(e,n,t,o)=>{if(Vn)return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
14
- return bn(Ce,{kind:"eye",label:r?`Show ${o}`:`Hide ${o}`,onClick:()=>zi(e,n,t),children:/* @__PURE__ */bn(r?Sn:vn,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},wi=e=>{const n=Nr(vr[e]?.type??""),t=n?at.addSectionBefore({name:n}):at.addSectionHere;return xl(le,e,()=>pi(e),t)},zi=(e,n,t)=>{kt.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},Bi=e=>ae(qn,e),Ci=e=>ce(qn,e),Oi=e=>xo.slotsOf?Rr(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:pe(e,n.slot)})):[{slot:null,rung:null,kids:Ci(e)}],$i=e=>xo.slotsOf?Oi(e).flatMap(e=>e.kids):Ci(e),Ni=e=>Boolean(xo.slotsOf)&&Rr(e).some(e=>e.rung),Ii=(e,n,t)=>null===t?void 0===n?Co(e):Co(e,n):Co(e,n,t),Pi=(e,n,t)=>{const o=ue(qn,e.type,n)&&(t||$i(e).length>0||Ni(e));return{collapsible:o,folded:o&&Ko(String(e.props.id))}},Ti=(e,n,t)=>Oi(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>Pi(e,r,t(e.type)).collapsible?[String(e.props.id),...Ti(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),Ai=e=>$i(e).length>0||Ni(e)||Boolean(Co(e.type)),Mi=e=>Boolean(Co(e)),Ri=(e,n,t,o)=>{if(no(U),Co(o)?.spec?.slider){const t=e.split(":")[0];p(t,n),kt.select({index:n,zone:e}),a(t)}else kt.select({index:n,zone:e}),ri(t)},ji=(e,n,t,o,r)=>{const i=`${e}:${n}`;kt.insertComponent(i,t,o),Co(r)?.spec?.slider?requestAnimationFrame(()=>{p(e,o),kt.select({index:o,zone:i})}):kt.select({index:o,zone:i})},Li=(e,n,t)=>{kt.insertComponent(e,n,t),no(U),kt.select({index:t,zone:e})},Ei=ln(/* @__PURE__ */new Set);cn(()=>{vr.forEach(e=>{const n=Co(e.type)?.spec;if(!n)return;const t=e.props.id;if(Ei.current.has(t))return;Ei.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($r)).forEach((e,t)=>mt.seedChild(o,t,n.childType,e))})},[vr,mt,$r]);const Vi=ln(/* @__PURE__ */new Set);cn(()=>{vr.forEach((n,t)=>{const o=n.props.id;if(Vi.current.has(o))return;const r=e(n,Bi(n.type));Vi.current.add(o),r&&mt.replaceComponent(le,t,{...n,props:r})})},[vr,mt]),ee(mt,qn);const Hi=vr.findIndex(st),Fi=Hi>=0?vr[Hi]:null,Di=dt?vr.findIndex(lt):-1,Gi=Di>=0?vr[Di]:null,Ui=vr.find(e=>e.type===et)??null,Wi=vr.find(e=>e.type===nt)??null,Yi=Hi>=0?Hi:vr.length,Ji=[];vr.forEach(e=>{st(e)||(Ai(e)&&Ji.push(String(e.props.id)),Ji.push(...Ti(e,1,Mi)))}),Fi&&(Ji.push(String(Fi.props.id)),Ji.push(...Ti(Fi,1,Mi)));const Ki=Ji.length>0&&Ji.every(e=>Fo.has(e)),_i=e=>{const n=$o.blockRowName(e,Or);return $o.rowName?$o.rowName(e,"block",n):n},Xi=(e,n,t,o)=>{const r=Ar(e)[t];if(!r)return;const i={...on(e),index:t},l={...on(n),index:Math.min(Math.max(o,0),Ar(n).length)},s=Xe(i,l);if(e!==n||s!==t)try{Cr.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof rn))throw e}},qi=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of Ci(e))n.add(r),t(o)};for(const t of Bi(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},Zi=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=Pr.get(n);if(!e)return null;if(e.zone===le)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},Qi=e=>{const n=e.slice(0,e.indexOf(":")),t=vr.find(e=>tt(e.type)&&String(e.props.id)===n);return t&&ot(n)===e?t:null},el=(e,n,t)=>{if(e.rung){const t=Mr(e.rung.nodeId),o=t?Rr(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===$n&&n.index>=0&&n.index<=o}if(n.slot===$n)return!1;if(e.add)return ol(e.add,n);const o=en(n);if(tt(e.type))return!1;const r=Qi(o),i=Qi(e.zone);if(r||i)return!(!r||!i)&&(n.index>=0&&n.index<=Ar(o).length);if(e.zone===le||o===le){if(e.zone!==o)return!1;const{floor:t,cap:r}=xr();return n.index>=t&&n.index<=r}if(n.index<0||n.index>Ar(o).length)return!1;if(e.zone===o)return!0;const l=Fi&&!Zn.lastIsOpen?String(Fi.props.id):null;return(!l||Zi(e.zone)!==l&&Zi(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??Ar(e)[t];if(!r)return!1;const i=n.split(":")[0],l=Pr.get(i),s=l?Ar(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&qi(r).has(n))return!1;const d=Co(s.type,zo(Yn?.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?.(Ar(n),r))})(e.zone,o,e.index,t)},nl=(e,n)=>{const t=en(e.from);if(t===en(n))return!0;const o=e.node;return el({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},tl=e=>{const n=e.slice(0,e.indexOf(":")),t=Pr.get(n),o=t?Ar(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=Co(o.type,zo(Yn?.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:Or(r.spec.childType)}]:[]),l=jr(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:mi(o,t.zone===le)}},ol=(e,n)=>{const t=en(n);if("block"!==e.kind){if(Qi(t))return n.index>=0&&n.index<=Ar(t).length;if(t!==le)return!1;const{floor:e,cap:o}=xr();return n.index>=e&&n.index<=o}if(t===le)return!1;const o=tl(t);return!(!o||!o.choices.some(n=>n.type===e.type))&&!o.target.spec?.addBlocked?.(Ar(t))},rl=(e,n)=>{e.rung?Fr(e.rung.nodeId,e.index,n.index):e.add?((e,n)=>{if("block"!==e.kind&&Qi(en(n)))return void hi(e,en(n),n.index);if("section"===e.kind)return void ci(e.type,n.index);if("template"===e.kind)return void ai(e.template.name,zr(e.template.node),n.index);const t=en(n),o=tl(t);o&&(o.target.spec?ji(o.parentId,o.target.slot,e.type,n.index,o.parent.type):Li(t,e.type,n.index))})(e.add,n):e.zone===le?si(e.index,n.index):Xi(e.zone,en(n),e.index,n.index)},[il]=dn(()=>Ke()),ll=_e({keyOf:e=>e.id,readOnly:Boolean(Vn),session:il,canDrop:el,onDrop:rl,onStep:(e,n)=>{e.rung?Fr(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===le?((e,n)=>{const t=Nr(vr[e]?.type??""),o=si(e,n<0?e-1:e+2);if(!o.moved)return void Qo(`“${t}” is already ${n<0?"first":"last"}`);const{floor:r,cap:i}=xr();Qo(`Moved “${t}” to position ${o.dest-r+1} of ${i-r}`)})(e.index,n):Xi(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),sl=an(e=>{const{floor:n,cap:t}=xr(),o=[];for(const r of e.nodes){const e=en(r.place),i=Ar(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(lt(i)||st(i)||bo(i.type))continue;if(tt(i.type))continue;const l=Boolean(Qi(e)),s=e===le||l;e===le&&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?Nr(i.type):Ur(i),from:r.place})}return{sources:o,zones:e.zones.filter(e=>e.children.length>0||Boolean(tl(en(e.list))?.choices.length)||Boolean(Qi(en(e.list))))}},[Yn.data]),dl=e=>{no(U),kt.select(e.zone===le?{index:e.index}:{index:e.index,zone:e.zone})},cl=ne(),al=()=>({data:Yn.data,device:Ot,ops:kt,inspector:yo}),pl=cl?.model,ul=sn(()=>pl?e=>pl(e,sl(e),al()):sl,[pl,sl,Ot]),fl=cl?.measure,hl=fl?(e,n)=>fl(e,n,al()):void 0,ml=cl?.canDrop,gl=ml?(e,n)=>ml(e,n,el,al()):el,yl=cl?.drop,kl=yl?(e,n)=>yl(e,n,rl,al()):rl,Sl=cl?.pick,vl=Sl?e=>Sl(e,dl,al()):dl,xl=(e,n,t,o)=>/* @__PURE__ */bn(Oe,{...Vn?{}:ll.seam({place:{...on(e),index:n}}),onAdd:Vn?void 0:t,label:o},`seam:${e}:${n}`),bl={rowClick:gi,isCollapsed:Ko,toggleCollapse:_o},wl=e=>{const n=String(e.props.id),t=vr.findIndex(e=>String(e.props.id)===n),o=ot(n),r=Ar(o),i=Ko(n),l=Or(e.type),s=$o.rowName?$o.rowName(e,"section",l):l,d=e=>xl(o,e,()=>ui(o,e),at.addSectionHere);/* @__PURE__ */
11
+ /* @__PURE__ */bn("path",{d:"M5 12h14"})]})})}function On(e,n,t){const o=t-n;if(o<6)return null;if(o<26)return{top:Math.round((n+t)/2),height:Math.round(o)};return{top:Math.round(Math.min(Math.max(e,n+13),t-13))}}var $n="__rungs";var Nn="screen:band",In={duplicate:!0,delete:!0};function Tn(){const Pe=ye(),{target:Ge,docId:We,capabilities:Tn,currentSlug:Pn,siteId:An,onPublish:Rn,saveState:Mn,saveConflict:jn,retrySave:En,toggleAutoSave:Ln,readOnly:Vn,readOnlyReason:Hn=null}=B(),Fn=R(),Dn=M(),{mediaEditing:Un,hasEditGuard:Gn,hasPinnedChrome:Wn}=Tn,{appState:Yn,dispatch:Jn,history:_n,selectedItem:Kn,getSelectorForId:Xn,config:Zn}=ve(e=>e),qn=j(),{first:Qn,firstGroup:et,lastGroup:nt,isSectionGroup:tt,sectionGroupZone:ot,panelOf:rt}=qn,it=rt(Qn),lt=e=>oe(qn,e),st=e=>re(qn,e),dt="node"===qn.firstRow,ct=qn.band??null,at=Ye("screen",Se),pt=E()??`/${Pn}`,ut=L(),ft=V(),ht=x({readOnly:Vn}),mt=x({readOnly:Vn,foldIntoHistory:!0}),gt=ln(null),yt=xe(),kt=sn(()=>({...ht,select:e=>{gt.current=e,ht.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=yt.config;gt.current=$e(e,t,n)}ht.commitDocument(e,n)}}),[ht,yt]),St=Yn.ui,vt=St.leftSideBarVisible,xt=St.rightSideBarVisible,{options:bt,widths:wt,initial:zt,fluid:Bt,fit:Ct}=H(),[Ot,$t]=dn(zt),Nt=he(),It=Un&&null!==Nt,Tt=me(),Pt=ge();F(Kn?.props.id);const{read:At,write:Rt,forSelection:Mt}=D(),[jt,Et]=dn(At);cn(()=>{Rt(jt)},[jt]);const[Lt,Vt]=dn(0),Ht=ln(null),Ft=ln(null),Dt=Ze(Ft,{readySelector:qe}),Ut=f(Ft);h(Ft,Dt);const[Gt,Wt]=dn(!1),Yt=ln(!1),Jt=ln(!1),[_t,Kt]=dn(null),Xt=U(),Zt=e=>Kt(null===e?null:{zone:le,index:e}),[qt,Qt]=dn([]),[eo,no]=dn(G),to="puck"===eo.kind,oo=Gt&&!_t&&Xt.railTarget?Xt.railTarget(Yn.data,{node:Kn??null,mode:eo}):null,ro=oo?{zone:en(oo),index:oo.index}:null,io=_t??ro,lo=io&&io.zone===le?io.index:null,so=t(eo,Kn?.props.id),[co,ao]=dn(null);cn(()=>{co&&(o(),ao(null))},[co]);const po=ln(Xn);po.current=Xn;const uo=an((e,{scroll:n})=>{Et(n=>Mt(e,n)),n&&ao(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=po.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&Do(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),fo=ln(null);cn(()=>{const e=fo.current;fo.current=null;const n=null==Kn?.props.id?null:String(Kn.props.id);no(e&&e.id===n?e.mode:rt(Kn?.type)??G);const t=Kn?.props.id,o=gt.current;if(gt.current=null,!t)return;const i=Xn(t);uo(String(t),{scroll:!r(o,i??null,le)})},[Kn?.props.id,uo]);const ho=an(e=>{no(n=>W(n,e)?n:e),Jn({type:"setUi",ui:{rightSideBarVisible:!0}})},[Jn]),mo=ln(()=>{});mo.current=(e,n)=>{const t=e?Ar(e.zone??le)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==Kn?.props.id?null:String(Kn.props.id);no(e=>W(e,n)?e:n),o!==r&&(fo.current={id:o,mode:n},kt.select(e))};const go=an((e,n)=>mo.current(e,n),[]),yo={kind:eo.kind,mode:eo,open:ho,show:e=>no(e),reveal:()=>{xt||Jn({type:"setUi",ui:{rightSideBarVisible:!0}})},select:go},ko=Y(yo,{data:Yn.data,selected:Kn??null,zoneOf:e=>Xn(e)?.zone,readOnly:Boolean(Vn),select:e=>{no(G),kt.select({index:e})},replace:(e,n)=>kt.replaceComponent(le,e,n),scrollTo:e=>ri(e)},{device:Ot,refreshes:Lt},{setView:Et,reveal:()=>{vt||Jn({type:"setUi",ui:{leftSideBarVisible:!0}})}}),So=ko.pinnedSource??!1,vo=ko.resolveLeftView?ko.resolveLeftView(jt,It):"media"===jt&&It?jt:"sections",xo=J(),{isLockedBlock:bo,duplicateBlocked:wo,nestDepth:zo,newSectionNode:Bo,canAddTo:Co,blockIsOffered:Oo}=xo,$o=_(),{labelAtLevel:No,Icon:Io,useProducts:To}=$o,Po=$o.rowName?(e,n,t)=>$o.rowName(e,n,t):void 0,Ao=an(e=>{Jn({type:"setUi",ui:{rightSideBarVisible:!0}}),a(e),uo(e,{scroll:!0})},[Jn,uo]),{selectNode:Ro,openPartId:Mo}=v({mode:eo,setMode:no,onOpenPart:Ao}),[jo,Eo]=dn(null);ke(null!==jo,()=>Eo(null));const Lo=y(K()),Vo=Lo.collapsed,Ho=Lo.panelWidths,[Fo,Do]=dn(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(Vo);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
12
+ return new Set}});cn(()=>{try{window.localStorage.setItem(Vo,JSON.stringify([...Fo]))}catch{}},[Fo]);const[Uo,Go]=dn(()=>{if("undefined"==typeof window)return{...k};try{const e=window.localStorage.getItem(Ho);if(!e)return{...k};const n=JSON.parse(e);return{left:S(Number(n.left)||k.left),right:S(Number(n.right)||k.right)}}catch{return{...k}}});cn(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(Ho,JSON.stringify(Uo))}catch{}},300);return()=>clearTimeout(e)},[Uo]);const Wo=an((e,n)=>Go(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),Yo=an(e=>Wo("left",e),[Wo]),Jo=an(e=>Wo("right",e),[Wo]),_o=e=>Fo.has(e),Ko=e=>Do(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),Xo=ln(!1),Zo=ln(null);cn(()=>{if(Xo.current&&!Gt){const e=Zo.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??Ft.current?.querySelector(`button[aria-label="${CSS.escape(at.add.title)}"]`))?.focus(),Zo.current=null}Xo.current=Gt},[Gt]),cn(()=>{if(!Gt||!Ut)return;const e=e=>{"Escape"===e.key&&fi()};return Ut.addEventListener("keydown",e),()=>Ut.removeEventListener("keydown",e)},[Gt,Ut]),ke(Gt,()=>fi()),cn(()=>{!vt&&Gt&&(Wt(!1),Kt(null),Yt.current=!1)},[vt]),cn(()=>{if(!Tt)return Jt.current&&Jn({type:"setUi",ui:{leftSideBarVisible:!1}}),void(Jt.current=!1);Gt&&(Wt(!1),Kt(null),Jt.current=Yt.current,Yt.current=!1),vt||(Jt.current=!0,Jn({type:"setUi",ui:{leftSideBarVisible:!0}}))},[Tt]),cn(()=>{!vt&&Tt&&(Jt.current=!1,Pt())},[vt]),cn(()=>{if(!Tt||!Ut)return;const e=e=>{"Escape"===e.key&&Pt()};return Ut.addEventListener("keydown",e),()=>Ut.removeEventListener("keydown",e)},[Tt,Ut]),ke(null!==Tt,()=>Pt());const qo=X(),Qo=(e,n="success")=>{qo?qo(e,"error"===n?"error":"info"):"error"===n?mn.error(e,{duration:3200,sound:!1}):mn.success(e,{duration:1900,sound:!1})},er=ln(null),[nr,tr]=dn(0),[or,rr]=dn(0),ir=Z(),lr=ln(null),sr=e=>Math.max(0,e.clientHeight-(lr.current?.offsetHeight??0));cn(()=>{const e=er.current;if(!e)return;const n=()=>{tr(e.clientWidth),rr(sr(e))};n();const t=new ResizeObserver(n);return t.observe(e),lr.current&&t.observe(lr.current),()=>t.disconnect()},[]),pn(()=>{er.current&&(tr(er.current.clientWidth),rr(sr(er.current)))},[Uo,vt,xt]);const dr=Ot===Bt?nr>0?nr:wt[Bt]:wt[Ot],cr=nr>0?Math.min(nr/dr,"shrink"===Ct?1:2):1,ar=dr*cr,pr=nr>0&&ar>nr+1,ur={width:ar,height:or||"100%",flex:"none",position:"relative"},fr={width:dr,height:or?or/cr:"100%",maxHeight:"none",transform:1!==cr?`scale(${cr})`:void 0,transformOrigin:"top left"},hr=()=>Jn({type:"setUi",ui:{leftSideBarVisible:!vt}}),mr=()=>Jn({type:"setUi",ui:{rightSideBarVisible:!xt}}),gr=e=>{Gt&&(Wt(!1),Kt(null),Yt.current=!1,vt&&jt===e)||Tt&&(Jt.current=!1,Pt(),vt&&jt===e)||(vt&&jt===e?hr():(Et(e),vt||Jn({type:"setUi",ui:{leftSideBarVisible:!0}})))},yr=()=>{C(Pe,{accept:"image/*",title:"Media library"})},kr=()=>{no(G),kt.select(null),u()},Sr=()=>{no(it??G),xt||Jn({type:"setUi",ui:{rightSideBarVisible:!0}})},vr=Yn.data.content??[],xr=()=>{const e=vr.findIndex(lt),n=vr.findIndex(st);return{floor:e>=0?e+1:0,cap:n>=0?n:vr.length}},br=Zn,wr=xo.stripCopy,zr=e=>i(e,wr),Br=b(),Cr=Ne({data:Yn.data,config:br,readOnly:Boolean(Vn),clipboard:Br,strip:wr?e=>wr(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==nn||e.slot!==tn)return{min:0,max:n-1};const{floor:t,cap:o}=xr();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&no(G);const t=void 0===n||"node"===n?.kind?n:null;kt.commitDocument(e,t)}}),Or=e=>Zn.components[e]?.label??e,$r=an(e=>Zn.components[e]?.defaultProps??{},[Zn]),Nr=e=>No(e,"section",Or(e)),Ir=e=>l({type:e.type,props:e.props??{}},Nr(e.type),Po),{nodeAddresses:Tr,zoneItems:Pr}=sn(()=>{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>=de)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of ce(Zn,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(vr,le,0),{nodeAddresses:e,zoneItems:n}},[vr,Zn]),Ar=an(e=>Pr.get(e)??[],[Pr]),Rr=e=>{const n=Tr.get(e);return n?Ar(n.zone)[n.index]:void 0},Mr=e=>ie(xo,Zn,e),jr=e=>{if(!xo.slotsOf||e===le)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=Rr(e.slice(0,n));if(!t)return null;const o=Mr(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}},Er=(()=>{if(!q(eo))return null;const e=`${eo.nodeId}:${eo.slot}`;return jr(e)?.slot.panel===eo.kind?e:null})(),Lr=ln(null);cn(()=>{const e=Lr.current;if(Lr.current=null,!Er||!q(eo))return;const n=eo.nodeId;uo(n,{scroll:e!==Er}),Do(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[eo]);const Vr=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void(e=>{const n=Tr.get(e);n&&(n.zone===le?ii(n.index):Mi(n.zone,n.index,e,Rr(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))})(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&Er!==i&&(Lr.current=i),go(null,r),xt||Jn({type:"setUi",ui:{rightSideBarVisible:!0}}),ri(o)},Hr=(e,n,t)=>{const o=`${e}:${n}`;if(Do(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;Er!==o&&(Lr.current=o);go(null,{kind:t,nodeId:e,slot:n})},Fr=(e,n,t)=>{if(Vn||!xo.moveSlot)return;const o=Rr(e),r=o?Mr(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:$n,index:n},s=Xe(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=xo.moveSlot(e,n,s);"string"==typeof d&&Hr(e,d,i.panel)},Dr=To(),Ur=sn(()=>{const e=/* @__PURE__ */new Map;for(const n of Dr??[])e.set(n.slug,n.name);return e},[Dr]),Gr=e=>s(e,Or,$o.plainText,e=>Ur.get(e),$o.rowName),Wr=(e,n)=>{const t=Zn.components[e.type]?.fields,o=n===le||Qi(n)?"section":"block",r=n===le&&(lt(e)||st(e)||tt(e.type)),i="block"===o?d(t):r?null:c(t);return $o.renamePropOf?$o.renamePropOf(e,o,i):i},Yr=(e,n,t,o)=>{if(!(!Vn&&jo?.zone===e&&jo.index===n))return;const r=(t,o)=>{Eo(null),o&&((e,n,t)=>{const o=Ar(e)[n];if(!o)return;const r=Wr(o,e);r&&kt.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
13
+ return bn("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":"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)},Jr=n(Q()),_r=Jr.scope({target:Ge,siteId:An,docId:We}),Kr=Zn,Xr=(e,n)=>n===le?Nr(e):Or(e),Zr=(e,n,t)=>{const o=Jr.plan(_r,t,Xr(t.type,e),Kr);o&&(o.changed&&kt.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),Qo(o.message))},qr=w({nodesIn:Ar,nodeAt:(e,n)=>Ar(e)[n]??null,labelOf:(e,n)=>n===le?Nr(e):Or(e),renamePropOf:Wr,beginRename:(e,n)=>Eo({zone:e,index:n}),history:{hasPast:_n.hasPast,hasFuture:_n.hasFuture,back:()=>_n.back(),forward:()=>_n.forward()},openAddSection:()=>{kt.select(null),pi(null)},openPageSettings:()=>{kt.select(null),no(G)},pageSettingsLabel:at.pageSettings,readOnly:Boolean(Vn),collapseAll:()=>Do(new Set(Ar(le).map(e=>String(e.props.id)))),onPasteRefused:e=>Qo(e?at.pasteRefused({name:e.label}):"Your browser won’t let us read the clipboard — press ⌘V","error"),canPasteAt:(e,n)=>nl(e,n),menuRows:ko.menuRows,isLocked:e=>bo(e.type),duplicateBlocked:e=>wo(Yn.data,e),permits:e=>se(Zn,e.type),canAddTo:Co,nodeOps:Cr,isPinned:(e,n)=>n===le&&(lt(e)||st(e)),sectionBand:xr,openAddInside:(e,n)=>{e===le?ii(n):kt.select({zone:e,index:n}),pi(null)},locate:e=>Tr.get(e)??null,rowNameOf:(e,n)=>n===le?Ir(e):Gr(e),selectAt:(e,n,t,o)=>{e===le?ii(n):Mi(e,n,t,o??"")},slotRung:e=>{const n=jr(e);return n?.slot.panel?{label:n.slot.label,select:()=>Vr(n.node,n.slot,!1)}:null},style:{held:()=>O(_r),canCopy:e=>Jr.rows(Kr,e).some(e=>!1!==e.counted),copy:(e,n)=>Jr.copy(_r,e,Xr(e.type,n),Kr),paste:(e,n,t)=>Zr(e,n,t)},keys:Dn?{target:Ut,selected:()=>{const e=Yn.ui.itemSelector;return e?{zone:e.zone??le,index:e.index}:null},held:()=>Br.get(),readOnly:Boolean(Vn),onDone:({done:e,name:n})=>{"copied"===e&&Qo(at.copied({name:n}))}}:void 0},Dt),Qr=ln({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});cn(()=>{Qr.current={copy:(e,n)=>Jr.copy(_r,e,Xr(e.type,n),Kr),paste:Zr,at:()=>{const e=Yn.ui.itemSelector;if(!e)return null;const n=e.zone??le,t=Ar(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean(Vn)}});const ei=an(e=>{const n=$(e);if(!n)return;const t=Qr.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))},[]);cn(()=>{if(!Ut)return;const e=e=>ei(e);return Ut.addEventListener("keydown",e),()=>Ut.removeEventListener("keydown",e)},[ei,Ut]),Qe(Dt,"keydown",ei);const ni=vr.map(e=>e.props.id).join("|");cn(()=>{const e=Dt?.document??null,n=Dt?.window??null;let t=0;const o=[],r=()=>{if(!e)return void Qt(e=>e.length?[]:e);const n=vr.findIndex(st),t=n>=0?n:vr.length,o=n=>{const t=vr[n]?.props?.id;return null==t?null:e.querySelector(`[data-puck-component="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(qe)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=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=On(l&&s?(s.bottom+l.top)/2:l?l.top:s.bottom,Math.max(-1/0,...r(t).map(e=>e.bottom)),Math.min(1/0,...r(n).map(e=>e.top)));d&&i.push({...d,index:e})}Qt(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()}},[Dt,ni,Ot,cr,vt,xt,Kn?.props.id]);const ti=Dt?.document??null,oi=Dt?.window??null;cn(()=>{const e=Ht.current;if(!e||!ti||!oi)return;const n=[],t=()=>{const n=ti.querySelector(`[data-puck-component="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&oi.scrollTo({left:oi.scrollX,top:oi.scrollY+t,behavior:"instant"}),!0};return Ht.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[ti,oi]);const ri=e=>{ko.holdCanvasOn?ko.holdCanvasOn(e):a(e)},ii=e=>{no(G),kt.select({index:e}),ko.sectionPressed?.(vr[e]);const n=vr[e]?.props?.id;n&&ri(n)},li=e=>{const{floor:n,cap:t}=xr(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=Kn&&eo.kind!==it?.kind?vr.findIndex(e=>e.props.id===Kn.props.id):-1;return o(r>=0?r+1:t)},si=(e,n)=>{const{floor:t,cap:o}=xr(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(kt.reorderComponent(le,e,i),kt.select({index:i}),{moved:!0,dest:i})},di=(e,n,t,o)=>{no(G),kt.select(o?{index:o.index,zone:o.zone}:{index:e}),a(n),Qo(`Added “${t}” section`)},ci=(e,n)=>{const t=li(n),o=Bo(e,{nodeDefaults:$r,newNodeId:fe,sectionLabel:Nr,blockIsOffered:Oo}),r=o?kt.insertNode(le,t,o):kt.insertSection(e,t);return di(t,r,Nr(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 ce(Zn,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=Co(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},ai=(e,n,t)=>{const o=li(t),r=kt.insertNode(le,o,n);return di(o,r,e),o},pi=e=>ui(le,e),ui=(e,n)=>{Zo.current=document.activeElement??null,Tt&&(Yt.current=Jt.current,Jt.current=!1,Pt()),Kt(null===n?null:{zone:e,index:n}),Wt(!0),vt||(Yt.current=!0,Jn({type:"setUi",ui:{leftSideBarVisible:!0}}))},fi=()=>{Wt(!1),Kt(null),Yt.current&&Jn({type:"setUi",ui:{leftSideBarVisible:!1}}),Yt.current=!1},hi=(e,n,t)=>{if("section"===e.kind)kt.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;kt.insertNode(n,t,zr(e.template.node))}no(G),kt.select({index:t,zone:n})},mi=(e,n)=>$o.rowName?n?lt(e)?$o.rowName(e,"section",at.header):st(e)?$o.rowName(e,"section",at.footer):tt(e.type)?$o.rowName(e,"section",Or(e.type)):Ir(e):Gr(e):n?Nr(e.type):Or(e.type),gi=e=>n=>{e()},yi=()=>ko.editPinnedSource?.(),ki=(e,n,t)=>{if(Vn)return null;const o=Ar(e)[n];return o&&!se(Zn,o.type).delete?null:/* @__PURE__ */bn(Ce,{kind:"delete",label:`Delete ${t}`,onClick:()=>((e,n)=>{const t=Ar(e)[n]?.props?.id;null!=t&&Cr.remove(String(t))})(e,n),children:/* @__PURE__ */bn(kn,{size:15})})},Si=e=>$o.rowPreview?.(e)||void 0,vi=e=>$o.rowMarks?.(e)??void 0,xi=(e,n,t)=>$o.rowActions?.(e,n,t)??null,bi=(e,n,t,o)=>{if(Vn)return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
14
+ return bn(Ce,{kind:"eye",label:r?`Show ${o}`:`Hide ${o}`,onClick:()=>zi(e,n,t),children:/* @__PURE__ */bn(r?Sn:vn,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},wi=e=>{const n=Nr(vr[e]?.type??""),t=n?at.addSectionBefore({name:n}):at.addSectionHere;return xl(le,e,()=>pi(e),t)},zi=(e,n,t)=>{kt.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},Bi=e=>ae(Zn,e),Ci=e=>ce(Zn,e),Oi=e=>xo.slotsOf?Mr(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:pe(e,n.slot)})):[{slot:null,rung:null,kids:Ci(e)}],$i=e=>xo.slotsOf?Oi(e).flatMap(e=>e.kids):Ci(e),Ni=e=>Boolean(xo.slotsOf)&&Mr(e).some(e=>e.rung),Ii=(e,n,t)=>null===t?void 0===n?Co(e):Co(e,n):Co(e,n,t),Ti=(e,n,t)=>{const o=ue(Zn,e.type,n)&&(t||$i(e).length>0||Ni(e));return{collapsible:o,folded:o&&_o(String(e.props.id))}},Pi=(e,n,t)=>Oi(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>Ti(e,r,t(e.type)).collapsible?[String(e.props.id),...Pi(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),Ai=e=>$i(e).length>0||Ni(e)||Boolean(Co(e.type)),Ri=e=>Boolean(Co(e)),Mi=(e,n,t,o)=>{if(no(G),Co(o)?.spec?.slider){const t=e.split(":")[0];p(t,n),kt.select({index:n,zone:e}),a(t)}else kt.select({index:n,zone:e}),ri(t)},ji=(e,n,t,o,r)=>{const i=`${e}:${n}`;kt.insertComponent(i,t,o),Co(r)?.spec?.slider?requestAnimationFrame(()=>{p(e,o),kt.select({index:o,zone:i})}):kt.select({index:o,zone:i})},Ei=(e,n,t)=>{kt.insertComponent(e,n,t),no(G),kt.select({index:t,zone:e})},Li=ln(/* @__PURE__ */new Set);cn(()=>{vr.forEach(e=>{const n=Co(e.type)?.spec;if(!n)return;const t=e.props.id;if(Li.current.has(t))return;Li.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($r)).forEach((e,t)=>mt.seedChild(o,t,n.childType,e))})},[vr,mt,$r]);const Vi=ln(/* @__PURE__ */new Set);cn(()=>{vr.forEach((n,t)=>{const o=n.props.id;if(Vi.current.has(o))return;const r=e(n,Bi(n.type));Vi.current.add(o),r&&mt.replaceComponent(le,t,{...n,props:r})})},[vr,mt]),ee(mt,Zn);const Hi=vr.findIndex(st),Fi=Hi>=0?vr[Hi]:null,Di=dt?vr.findIndex(lt):-1,Ui=Di>=0?vr[Di]:null,Gi=vr.find(e=>e.type===et)??null,Wi=vr.find(e=>e.type===nt)??null,Yi=Hi>=0?Hi:vr.length,Ji=[];vr.forEach(e=>{st(e)||(Ai(e)&&Ji.push(String(e.props.id)),Ji.push(...Pi(e,1,Ri)))}),Fi&&(Ji.push(String(Fi.props.id)),Ji.push(...Pi(Fi,1,Ri)));const _i=Ji.length>0&&Ji.every(e=>Fo.has(e)),Ki=e=>{const n=$o.blockRowName(e,Or);return $o.rowName?$o.rowName(e,"block",n):n},Xi=(e,n,t,o)=>{const r=Ar(e)[t];if(!r)return;const i={...on(e),index:t},l={...on(n),index:Math.min(Math.max(o,0),Ar(n).length)},s=Xe(i,l);if(e!==n||s!==t)try{Cr.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof rn))throw e}},Zi=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of Ci(e))n.add(r),t(o)};for(const t of Bi(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},qi=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=Tr.get(n);if(!e)return null;if(e.zone===le)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},Qi=e=>{const n=e.slice(0,e.indexOf(":")),t=vr.find(e=>tt(e.type)&&String(e.props.id)===n);return t&&ot(n)===e?t:null},el=(e,n,t)=>{if(e.rung){const t=Rr(e.rung.nodeId),o=t?Mr(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===$n&&n.index>=0&&n.index<=o}if(n.slot===$n)return!1;if(e.add)return ol(e.add,n);const o=en(n);if(tt(e.type))return!1;const r=Qi(o),i=Qi(e.zone);if(r||i)return!(!r||!i)&&(n.index>=0&&n.index<=Ar(o).length);if(e.zone===le||o===le){if(e.zone!==o)return!1;const{floor:t,cap:r}=xr();return n.index>=t&&n.index<=r}if(n.index<0||n.index>Ar(o).length)return!1;if(e.zone===o)return!0;const l=Fi&&!qn.lastIsOpen?String(Fi.props.id):null;return(!l||qi(e.zone)!==l&&qi(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??Ar(e)[t];if(!r)return!1;const i=n.split(":")[0],l=Tr.get(i),s=l?Ar(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&Zi(r).has(n))return!1;const d=Co(s.type,zo(Yn?.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?.(Ar(n),r))})(e.zone,o,e.index,t)},nl=(e,n)=>{const t=en(e.from);if(t===en(n))return!0;const o=e.node;return el({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},tl=e=>{const n=e.slice(0,e.indexOf(":")),t=Tr.get(n),o=t?Ar(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=Co(o.type,zo(Yn?.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:Or(r.spec.childType)}]:[]),l=jr(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:mi(o,t.zone===le)}},ol=(e,n)=>{const t=en(n);if("block"!==e.kind){if(Qi(t))return n.index>=0&&n.index<=Ar(t).length;if(t!==le)return!1;const{floor:e,cap:o}=xr();return n.index>=e&&n.index<=o}if(t===le)return!1;const o=tl(t);return!(!o||!o.choices.some(n=>n.type===e.type))&&!o.target.spec?.addBlocked?.(Ar(t))},rl=(e,n)=>{e.rung?Fr(e.rung.nodeId,e.index,n.index):e.add?((e,n)=>{if("block"!==e.kind&&Qi(en(n)))return void hi(e,en(n),n.index);if("section"===e.kind)return void ci(e.type,n.index);if("template"===e.kind)return void ai(e.template.name,zr(e.template.node),n.index);const t=en(n),o=tl(t);o&&(o.target.spec?ji(o.parentId,o.target.slot,e.type,n.index,o.parent.type):Ei(t,e.type,n.index))})(e.add,n):e.zone===le?si(e.index,n.index):Xi(e.zone,en(n),e.index,n.index)},[il]=dn(()=>_e()),ll=Ke({keyOf:e=>e.id,readOnly:Boolean(Vn),session:il,canDrop:el,onDrop:rl,onStep:(e,n)=>{e.rung?Fr(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===le?((e,n)=>{const t=Nr(vr[e]?.type??""),o=si(e,n<0?e-1:e+2);if(!o.moved)return void Qo(`“${t}” is already ${n<0?"first":"last"}`);const{floor:r,cap:i}=xr();Qo(`Moved “${t}” to position ${o.dest-r+1} of ${i-r}`)})(e.index,n):Xi(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),sl=an(e=>{const{floor:n,cap:t}=xr(),o=[];for(const r of e.nodes){const e=en(r.place),i=Ar(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(lt(i)||st(i)||bo(i.type))continue;if(tt(i.type))continue;const l=Boolean(Qi(e)),s=e===le||l;e===le&&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?Nr(i.type):Gr(i),from:r.place})}return{sources:o,zones:e.zones.filter(e=>e.children.length>0||Boolean(tl(en(e.list))?.choices.length)||Boolean(Qi(en(e.list))))}},[Yn.data]),dl=e=>{no(G),kt.select(e.zone===le?{index:e.index}:{index:e.index,zone:e.zone})},cl=ne(),al=()=>({data:Yn.data,device:Ot,ops:kt,inspector:yo}),pl=cl?.model,ul=sn(()=>pl?e=>pl(e,sl(e),al()):sl,[pl,sl,Ot]),fl=cl?.measure,hl=fl?(e,n)=>fl(e,n,al()):void 0,ml=cl?.canDrop,gl=ml?(e,n)=>ml(e,n,el,al()):el,yl=cl?.drop,kl=yl?(e,n)=>yl(e,n,rl,al()):rl,Sl=cl?.pick,vl=Sl?e=>Sl(e,dl,al()):dl,xl=(e,n,t,o)=>/* @__PURE__ */bn(Oe,{...Vn?{}:ll.seam({place:{...on(e),index:n}}),onAdd:Vn?void 0:t,label:o},`seam:${e}:${n}`),bl={rowClick:gi,isCollapsed:_o,toggleCollapse:Ko},wl=e=>{const n=String(e.props.id),t=vr.findIndex(e=>String(e.props.id)===n),o=ot(n),r=Ar(o),i=_o(n),l=Or(e.type),s=$o.rowName?$o.rowName(e,"section",l):l,d=e=>xl(o,e,()=>ui(o,e),at.addSectionHere);/* @__PURE__ */
15
15
  return wn(zn,{children:[
16
- /* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(Io,{type:e.type,size:13}),name:s,preview:Si(e),marks:vi(e),onSelect:()=>ii(t),nameSlot:Yr(le,t,n,s),selected:so===n,actions:xi(e,le,t)??void 0,rowProps:{"data-node-id":n,onClick:gi(()=>ii(t))},fold:{open:!i,label:"section",onToggle:()=>_o(n)}}),!i&&/* @__PURE__ */wn(we,{children:[r.map((n,t)=>{const r=String(n.props.id),i=Ir(n),l=Ai(n),s=l&&Ko(r),c=()=>Ri(o,t,r,e.type),{rowProps:a,...p}=ll.row({item:{id:r,zone:o,index:t,type:n.type},place:{...on(o),index:t}},{"data-node-id":r,onClick:gi(c)});/* @__PURE__ */
16
+ /* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(Io,{type:e.type,size:13}),name:s,preview:Si(e),marks:vi(e),onSelect:()=>ii(t),nameSlot:Yr(le,t,n,s),selected:so===n,actions:xi(e,le,t)??void 0,rowProps:{"data-node-id":n,onClick:gi(()=>ii(t))},fold:{open:!i,label:"section",onToggle:()=>Ko(n)}}),!i&&/* @__PURE__ */wn(we,{children:[r.map((n,t)=>{const r=String(n.props.id),i=Ir(n),l=Ai(n),s=l&&_o(r),c=()=>Mi(o,t,r,e.type),{rowProps:a,...p}=ll.row({item:{id:r,zone:o,index:t,type:n.type},place:{...on(o),index:t}},{"data-node-id":r,onClick:gi(c)});/* @__PURE__ */
17
17
  return wn(un,{children:[d(t),
18
- /* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(Io,{type:n.type,size:13}),name:i,preview:Si(n),marks:vi(n),onSelect:c,nameSlot:Yr(o,t,r,i),selected:so===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>_o(r)}:void 0,actions:/* @__PURE__ */wn(zn,{children:[ki(o,t,i),xi(n,o,t),bi(o,t,n,i)]}),rowProps:a}),l&&!s&&/* @__PURE__ */bn(we,{children:Cl(n,2)})]},r)}),d(r.length)]})]})},zl=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=ll.dragging,d=!Ko(l)&&s?.rung?.nodeId!==i,c={...on(l),index:0},a=s&&!s.rung&&el(s,c)?c:void 0,p=()=>Vr(e,n,!0),{rowProps:u,...f}=ll.row({item:{id:`rung:${l}`,zone:`${i}:${$n}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:$n,index:t},into:a,canDrag:Boolean(xo.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:gi(p)}),h=Vn?null:xo.slotActions?.(e,n.slot);/* @__PURE__ */
18
+ /* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(Io,{type:n.type,size:13}),name:i,preview:Si(n),marks:vi(n),onSelect:c,nameSlot:Yr(o,t,r,i),selected:so===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>Ko(r)}:void 0,actions:/* @__PURE__ */wn(zn,{children:[ki(o,t,i),xi(n,o,t),bi(o,t,n,i)]}),rowProps:a}),l&&!s&&/* @__PURE__ */bn(we,{children:Cl(n,2)})]},r)}),d(r.length)]})]})},zl=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=ll.dragging,d=!_o(l)&&s?.rung?.nodeId!==i,c={...on(l),index:0},a=s&&!s.rung&&el(s,c)?c:void 0,p=()=>Vr(e,n,!0),{rowProps:u,...f}=ll.row({item:{id:`rung:${l}`,zone:`${i}:${$n}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:$n,index:t},into:a,canDrag:Boolean(xo.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:gi(p)}),h=Vn?null:xo.slotActions?.(e,n.slot);/* @__PURE__ */
19
19
  return wn(un,{children:[n.heading,
20
- /* @__PURE__ */bn(be,{icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:Lr===l,...f,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>_o(l)},actions:h&&h.length>0?/* @__PURE__ */bn(zn,{children:h.map((t,o)=>/* @__PURE__ */bn(Ce,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if(Vn||t.disabled)return;const o=String(e.props.id),r=e=>{"string"==typeof e&&Hr(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__ */bn(kn,{size:15}):/* @__PURE__ */bn(xn,{size:15})},`${o}:${t.kind}`))}):void 0,rowProps:u}),d&&/* @__PURE__ */bn(we,{children:r})]},l)},Bl=(e,n)=>{const t=Oi(e),o=t.filter(e=>e.rung).length;let r=0;/* @__PURE__ */
21
- return bn(zn,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=Ii(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(tl(c)?.choices.length),p=(e,n)=>a?xl(e,n,()=>ui(e,n),"Add block here"):xl(e,n),u=/* @__PURE__ */wn(zn,{children:[i.map(({child:n,zone:t,index:o})=>{const r=so===String(n.props.id),{collapsible:i,folded:s}=Pi(n,l,Mi(n.type)),d=String(n.props.id),c=_i(n),a=()=>Ri(t,o,d,e.type),{rowProps:u,...f}=ll.row({item:{id:d,zone:t,index:o,type:n.type},place:{...on(t),index:o}},{"data-node-id":d,onClick:gi(a)});/* @__PURE__ */
20
+ /* @__PURE__ */bn(be,{icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:Er===l,...f,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>Ko(l)},actions:h&&h.length>0?/* @__PURE__ */bn(zn,{children:h.map((t,o)=>/* @__PURE__ */bn(Ce,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if(Vn||t.disabled)return;const o=String(e.props.id),r=e=>{"string"==typeof e&&Hr(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__ */bn(kn,{size:15}):/* @__PURE__ */bn(xn,{size:15})},`${o}:${t.kind}`))}):void 0,rowProps:u}),d&&/* @__PURE__ */bn(we,{children:r})]},l)},Bl=(e,n)=>{const t=Oi(e),o=t.filter(e=>e.rung).length;let r=0;/* @__PURE__ */
21
+ return bn(zn,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=Ii(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(tl(c)?.choices.length),p=(e,n)=>a?xl(e,n,()=>ui(e,n),"Add block here"):xl(e,n),u=/* @__PURE__ */wn(zn,{children:[i.map(({child:n,zone:t,index:o})=>{const r=so===String(n.props.id),{collapsible:i,folded:s}=Ti(n,l,Ri(n.type)),d=String(n.props.id),c=Ki(n),a=()=>Mi(t,o,d,e.type),{rowProps:u,...f}=ll.row({item:{id:d,zone:t,index:o,type:n.type},place:{...on(t),index:o}},{"data-node-id":d,onClick:gi(a)});/* @__PURE__ */
22
22
  return wn(un,{children:[0===o&&p(t,0),
23
- /* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(Io,{type:n.type,size:13}),name:c,preview:Si(n),marks:vi(n),onSelect:a,nameSlot:Yr(t,o,d,c),selected:r,hidden:Boolean(n.props._hidden),...f,fold:i?{open:!s,label:"group",onToggle:()=>_o(d)}:void 0,actions:/* @__PURE__ */wn(zn,{children:[ki(t,o,c),xi(n,t,o),bi(t,o,n,c)]}),rowProps:u}),i&&!s&&/* @__PURE__ */bn(we,{children:Bl(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?zl(e,t.rung,r++,o,u):/* @__PURE__ */bn(un,{children:u},t.slot??"")})})},Cl=(e,n)=>{const t=zo(Yn?.data,e.type,String(e.props.id)),o=Oi(e),r=o.filter(e=>e.rung).length;let i=0;/* @__PURE__ */
24
- return bn(zn,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=Ii(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)?()=>ji(e.props.id,c.slot,c.childType,t,e.type):n===h?()=>ui(n,t):void 0;return xl(n,t,o,n===f&&c?c.addLabel:"Add block here")},g=null===o.slot?null:`${u}:${o.slot}`,y=Boolean(c&&!c.fixed&&(null===g||g===f)),k=/* @__PURE__ */wn(zn,{children:[l.map(({child:n,zone:t,index:o})=>{const r=so===String(n.props.id),i=Ur(n),l=String(n.props.id),{collapsible:d,folded:c}=Pi(n,s,Mi(n.type)),a=Bi(n.type),p=1===a.length?`${l}:${a[0]}`:null,u=p?{...on(p),index:Ar(p).length}:void 0,f=ll.dragging,h=u&&f&&el(f,u)?u:void 0,g=()=>Ri(t,o,l,e.type),{rowProps:y,...k}=ll.row({item:{id:l,zone:t,index:o,type:n.type},place:{...on(t),index:o},into:h,canDrag:!bo(n.type)},{"data-node-id":l,onClick:gi(g)});/* @__PURE__ */
23
+ /* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(Io,{type:n.type,size:13}),name:c,preview:Si(n),marks:vi(n),onSelect:a,nameSlot:Yr(t,o,d,c),selected:r,hidden:Boolean(n.props._hidden),...f,fold:i?{open:!s,label:"group",onToggle:()=>Ko(d)}:void 0,actions:/* @__PURE__ */wn(zn,{children:[ki(t,o,c),xi(n,t,o),bi(t,o,n,c)]}),rowProps:u}),i&&!s&&/* @__PURE__ */bn(we,{children:Bl(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?zl(e,t.rung,r++,o,u):/* @__PURE__ */bn(un,{children:u},t.slot??"")})})},Cl=(e,n)=>{const t=zo(Yn?.data,e.type,String(e.props.id)),o=Oi(e),r=o.filter(e=>e.rung).length;let i=0;/* @__PURE__ */
24
+ return bn(zn,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=Ii(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)?()=>ji(e.props.id,c.slot,c.childType,t,e.type):n===h?()=>ui(n,t):void 0;return xl(n,t,o,n===f&&c?c.addLabel:"Add block here")},g=null===o.slot?null:`${u}:${o.slot}`,y=Boolean(c&&!c.fixed&&(null===g||g===f)),k=/* @__PURE__ */wn(zn,{children:[l.map(({child:n,zone:t,index:o})=>{const r=so===String(n.props.id),i=Gr(n),l=String(n.props.id),{collapsible:d,folded:c}=Ti(n,s,Ri(n.type)),a=Bi(n.type),p=1===a.length?`${l}:${a[0]}`:null,u=p?{...on(p),index:Ar(p).length}:void 0,f=ll.dragging,h=u&&f&&el(f,u)?u:void 0,g=()=>Mi(t,o,l,e.type),{rowProps:y,...k}=ll.row({item:{id:l,zone:t,index:o,type:n.type},place:{...on(t),index:o},into:h,canDrag:!bo(n.type)},{"data-node-id":l,onClick:gi(g)});/* @__PURE__ */
25
25
  return wn(un,{children:[0===o&&m(t,0),
26
- /* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(Io,{type:n.type,size:13}),name:i,preview:Si(n),marks:vi(n),onSelect:g,nameSlot:Yr(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...k,fold:d?{open:!c,label:"group",onToggle:()=>_o(l)}:void 0,actions:bo(n.type)?xi(n,t,o)??void 0:/* @__PURE__ */wn(zn,{children:[ki(t,o,i),xi(n,t,o),bi(t,o,n,i)]}),rowProps:y}),d&&!c&&/* @__PURE__ */bn(we,{children:Cl(n,s+1)}),m(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&c&&
27
- /* @__PURE__ */bn(N,{small:!0,label:c.addLabel,blocked:c.addBlocked?.(a)??null,onAdd:()=>ji(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?zl(e,o.rung,i++,r,k):/* @__PURE__ */bn(un,{children:k},o.slot??"")})})},Ol=(()=>{if(!_n||!to)return null;const e=String(_n.type),n=String(_n.props.id),t=Co(e,zo(Yn?.data,e,n));if(!t||"footer"===t.source)return null;const o=vr.some(e=>String(e.props?.id)===n),r=Array.isArray(_n.props[t.slot])?_n.props[t.slot]:[];if(t.spec?.addBlocked?.(r))return null;const i=t.choices??(t.spec?[{type:t.spec.childType,label:Or(t.spec.childType)}]:[]);return 0===i.length?null:{parentName:mi(_n,o),choices:i,onPick:o=>{t.spec?ji(n,t.slot,o,r.length,e):Li(`${n}:${t.slot}`,o,r.length)}}})(),$l=io&&io.zone!==le&&!Qi(io.zone)?io.zone:null,Nl=!0===Xt.blocksFirst,Il=$l?tl($l):Nl&&io?null:Ol,Pl=Boolean(Kt&&$l)||Nl&&Boolean(Il&&Il.choices.length>0),Tl=Ut||null!==Pt,Al=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:vt&&!Tl&&vo===e.id,onSelect:()=>gr(e.id)}:e,Ml=[{id:"add",label:at.add.title,icon:/* @__PURE__ */bn("span",{className:"sf-rail-plus","aria-hidden":"true",children:"+"}),active:Ut,onSelect:()=>Ut?fi():pi(null)},...(ko.railLead??[]).map(Al),{id:"sections",label:"Layers",icon:/* @__PURE__ */bn(Ie,{}),active:vt&&!Tl&&"sections"===vo,onSelect:()=>gr("sections")},...(ko.railTrail??[]).map(Al)];It?Ml.push({id:"media",label:at.railMedia,icon:/* @__PURE__ */bn(Pe,{}),active:vt&&!Ut&&(null!==Pt||"media"===vo),onSelect:()=>gr("media")}):Gn&&Ml.push({id:"media",label:at.railMedia,icon:/* @__PURE__ */bn(Pe,{}),onSelect:yr});const Rl=[...ko.railLead??[],...ko.railTrail??[]].find(e=>"panel"in e&&e.id===vo),jl=Boolean(ct?.foldable)&&!So,Ll=ct?.label??(Un?at.pageSections:at.templateSections),El=jl&&Ko(Nn),Vl=/* @__PURE__ */wn(zn,{children:[vr.map((e,n)=>{if(lt(e)||st(e)||tt(e.type))return null;const t=so===String(e.props.id),o=Boolean(e.props._hidden);Ci(e);const r=String(e.props.id),i=ko.hasOwnRows?.(e)??!1,l=Ai(e)||i,s=l&&Ko(r),{rowProps:d,...c}=ll.row({item:{id:r,zone:le,index:n,type:e.type},place:{...on(le),index:n}},{"data-node-id":r,onClick:gi(()=>ii(n))});/* @__PURE__ */
26
+ /* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(Io,{type:n.type,size:13}),name:i,preview:Si(n),marks:vi(n),onSelect:g,nameSlot:Yr(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...k,fold:d?{open:!c,label:"group",onToggle:()=>Ko(l)}:void 0,actions:bo(n.type)?xi(n,t,o)??void 0:/* @__PURE__ */wn(zn,{children:[ki(t,o,i),xi(n,t,o),bi(t,o,n,i)]}),rowProps:y}),d&&!c&&/* @__PURE__ */bn(we,{children:Cl(n,s+1)}),m(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&c&&
27
+ /* @__PURE__ */bn(N,{small:!0,label:c.addLabel,blocked:c.addBlocked?.(a)??null,onAdd:()=>ji(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?zl(e,o.rung,i++,r,k):/* @__PURE__ */bn(un,{children:k},o.slot??"")})})},Ol=(()=>{if(!Kn||!to)return null;const e=String(Kn.type),n=String(Kn.props.id),t=Co(e,zo(Yn?.data,e,n));if(!t||"footer"===t.source)return null;const o=vr.some(e=>String(e.props?.id)===n),r=Array.isArray(Kn.props[t.slot])?Kn.props[t.slot]:[];if(t.spec?.addBlocked?.(r))return null;const i=t.choices??(t.spec?[{type:t.spec.childType,label:Or(t.spec.childType)}]:[]);return 0===i.length?null:{parentName:mi(Kn,o),choices:i,onPick:o=>{t.spec?ji(n,t.slot,o,r.length,e):Ei(`${n}:${t.slot}`,o,r.length)}}})(),$l=io&&io.zone!==le&&!Qi(io.zone)?io.zone:null,Nl=!0===Xt.blocksFirst,Il=$l?tl($l):Nl&&io?null:Ol,Tl=Boolean(_t&&$l)||Nl&&Boolean(Il&&Il.choices.length>0),Pl=Gt||null!==Tt,Al=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:vt&&!Pl&&vo===e.id,onSelect:()=>gr(e.id)}:e,Rl=[{id:"add",label:at.add.title,icon:/* @__PURE__ */bn("span",{className:"sf-rail-plus","aria-hidden":"true",children:"+"}),active:Gt,onSelect:()=>Gt?fi():pi(null)},...(ko.railLead??[]).map(Al),{id:"sections",label:"Layers",icon:/* @__PURE__ */bn(Ie,{}),active:vt&&!Pl&&"sections"===vo,onSelect:()=>gr("sections")},...(ko.railTrail??[]).map(Al)];It?Rl.push({id:"media",label:at.railMedia,icon:/* @__PURE__ */bn(Te,{}),active:vt&&!Gt&&(null!==Tt||"media"===vo),onSelect:()=>gr("media")}):Un&&Rl.push({id:"media",label:at.railMedia,icon:/* @__PURE__ */bn(Te,{}),onSelect:yr});const Ml=[...ko.railLead??[],...ko.railTrail??[]].find(e=>"panel"in e&&e.id===vo),jl=Boolean(ct?.foldable)&&!So,El=ct?.label??(Gn?at.pageSections:at.templateSections),Ll=jl&&_o(Nn),Vl=/* @__PURE__ */wn(zn,{children:[vr.map((e,n)=>{if(lt(e)||st(e)||tt(e.type))return null;const t=so===String(e.props.id),o=Boolean(e.props._hidden);Ci(e);const r=String(e.props.id),i=ko.hasOwnRows?.(e)??!1,l=Ai(e)||i,s=l&&_o(r),{rowProps:d,...c}=ll.row({item:{id:r,zone:le,index:n,type:e.type},place:{...on(le),index:n}},{"data-node-id":r,onClick:gi(()=>ii(n))});/* @__PURE__ */
28
28
  return wn(un,{children:[n>0&&wi(n),
29
- /* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(Io,{type:e.type,size:13}),name:Ir(e),preview:Si(e),marks:vi(e),onSelect:()=>ii(n),nameSlot:Yr(le,n,r,Ir(e)),selected:t,hidden:o,...c,fold:l?{open:!s,label:"section",onToggle:()=>_o(r)}:void 0,actions:/* @__PURE__ */wn(zn,{children:[ki(le,n,Ir(e)),xi(e,le,n),bi(le,n,e,Ir(e))]}),rowProps:d}),Ai(e)&&!s&&/* @__PURE__ */wn(we,{children:[Cl(e,1),ko.partRows?.(e,bl)]}),i&&!s&&/* @__PURE__ */bn(we,{children:ko.ownRows?.(e,n,bl)})]},String(e.props.id??n))}),!So&&Yi>0&&wi(Yi),ct?.addAtEnd&&!So&&!Vn&&/* @__PURE__ */bn(N,{small:!0,label:at.addSection,blocked:null,onAdd:()=>pi(Yi)})]}),Hl=(e,n,t)=>{const o=String(e.props.id),r=$i(e).length>0||Ni(e)||Boolean(Co(e.type)),i=r&&Ko(o),l="header"===t?at.header:at.footer,s=$o.rowName?$o.rowName(e,"section",l):l;/* @__PURE__ */
29
+ /* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(Io,{type:e.type,size:13}),name:Ir(e),preview:Si(e),marks:vi(e),onSelect:()=>ii(n),nameSlot:Yr(le,n,r,Ir(e)),selected:t,hidden:o,...c,fold:l?{open:!s,label:"section",onToggle:()=>Ko(r)}:void 0,actions:/* @__PURE__ */wn(zn,{children:[ki(le,n,Ir(e)),xi(e,le,n),bi(le,n,e,Ir(e))]}),rowProps:d}),Ai(e)&&!s&&/* @__PURE__ */wn(we,{children:[Cl(e,1),ko.partRows?.(e,bl)]}),i&&!s&&/* @__PURE__ */bn(we,{children:ko.ownRows?.(e,n,bl)})]},String(e.props.id??n))}),!So&&Yi>0&&wi(Yi),ct?.addAtEnd&&!So&&!Vn&&/* @__PURE__ */bn(N,{small:!0,label:at.addSection,blocked:null,onAdd:()=>pi(Yi)})]}),Hl=(e,n,t)=>{const o=String(e.props.id),r=$i(e).length>0||Ni(e)||Boolean(Co(e.type)),i=r&&_o(o),l="header"===t?at.header:at.footer,s=$o.rowName?$o.rowName(e,"section",l):l;/* @__PURE__ */
30
30
  return wn(zn,{children:[
31
- /* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(Io,{type:t,size:13}),name:s,preview:Si(e),marks:vi(e),onSelect:()=>ii(n),nameSlot:Yr(le,n,o,s),selected:so===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>_o(o)}:void 0,actions:xi(e,le,n)??void 0,rowProps:{"data-node-id":o,onClick:gi(()=>ii(n))}}),r&&!i&&/* @__PURE__ */bn(we,{children:Bl(e,1)})]})};return(ko.wrap??(e=>e))(
32
- /* @__PURE__ */bn(te,{target:Dt,children:/* @__PURE__ */wn("div",{ref:Ft,className:"sf-editor es-editor",style:Ge(Go),onContextMenu:Zr.onEditorContextMenu,...m(Te),children:[
31
+ /* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(Io,{type:t,size:13}),name:s,preview:Si(e),marks:vi(e),onSelect:()=>ii(n),nameSlot:Yr(le,n,o,s),selected:so===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>Ko(o)}:void 0,actions:xi(e,le,n)??void 0,rowProps:{"data-node-id":o,onClick:gi(()=>ii(n))}}),r&&!i&&/* @__PURE__ */bn(we,{children:Bl(e,1)})]})};return(ko.wrap??(e=>e))(
32
+ /* @__PURE__ */bn(te,{target:Dt,children:/* @__PURE__ */wn("div",{ref:Ft,className:"sf-editor es-editor",style:Ue(Uo),onContextMenu:qr.onEditorContextMenu,...m(Pe),children:[
33
33
  /* @__PURE__ */wn(Ae,{children:[
34
- /* @__PURE__ */bn(Me,{items:Ml,ariaLabel:"Left panel views"}),
35
- /* @__PURE__ */wn(Re,{children:[
36
- /* @__PURE__ */bn(je,{label:"Undo",disabled:Boolean(Vn)||!Kn.hasPast,onClick:()=>Kn.back(),children:/* @__PURE__ */bn(gn,{})}),
37
- /* @__PURE__ */bn(je,{label:"Redo",disabled:Boolean(Vn)||!Kn.hasFuture,onClick:()=>Kn.forward(),children:/* @__PURE__ */bn(yn,{})}),
38
- /* @__PURE__ */bn(Le,{}),
39
- /* @__PURE__ */bn(Ee,{devices:bt,value:Ot,onChange:$t})]}),
40
- /* @__PURE__ */wn(Re,{kind:"right",style:{minWidth:300},children:[
41
- /* @__PURE__ */bn(Bn,{saveState:Rn,notSaving:Boolean(Vn)||null!=jn,readOnlyReason:Hn,toggle:Fn,onToggle:En,onRetry:Ln}),ko.barLead?.(),
42
- /* @__PURE__ */bn(fn,{content:"Refresh the preview (reloads the canvas, keeps your place)",side:"bottom",children:/* @__PURE__ */bn(hn,{variant:"secondary",onClick:()=>{Ht.current=(()=>{const e=Dt?.document;if(!e)return null;const n=vr.findIndex(st),t=n>=0?n:vr.length;let o=null;for(let n=0;n<t;n++){const t=vr[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=_n?.props?.id??vr[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),Vt(e=>e+1)},children:"Refresh"})}),ko.barTrail?.(),ko.barMain?ko.barMain():/* @__PURE__ */bn(hn,{variant:"primary",disabled:null!==Hn,onClick:()=>{Mn(Yn.data)},children:at.done})]})]}),
34
+ /* @__PURE__ */bn(Re,{items:Rl,ariaLabel:"Left panel views"}),
35
+ /* @__PURE__ */wn(Me,{children:[
36
+ /* @__PURE__ */bn(je,{label:"Undo",disabled:Boolean(Vn)||!_n.hasPast,onClick:()=>_n.back(),children:/* @__PURE__ */bn(gn,{})}),
37
+ /* @__PURE__ */bn(je,{label:"Redo",disabled:Boolean(Vn)||!_n.hasFuture,onClick:()=>_n.forward(),children:/* @__PURE__ */bn(yn,{})}),
38
+ /* @__PURE__ */bn(Ee,{}),
39
+ /* @__PURE__ */bn(Le,{devices:bt,value:Ot,onChange:$t})]}),
40
+ /* @__PURE__ */wn(Me,{kind:"right",style:{minWidth:300},children:[
41
+ /* @__PURE__ */bn(Bn,{saveState:Mn,notSaving:Boolean(Vn)||null!=jn,readOnlyReason:Hn,toggle:Fn,onToggle:Ln,onRetry:En}),ko.barLead?.(),
42
+ /* @__PURE__ */bn(fn,{content:"Refresh the preview (reloads the canvas, keeps your place)",side:"bottom",children:/* @__PURE__ */bn(hn,{variant:"secondary",onClick:()=>{Ht.current=(()=>{const e=Dt?.document;if(!e)return null;const n=vr.findIndex(st),t=n>=0?n:vr.length;let o=null;for(let n=0;n<t;n++){const t=vr[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=Kn?.props?.id??vr[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),Vt(e=>e+1)},children:"Refresh"})}),ko.barTrail?.(),ko.barMain?ko.barMain():/* @__PURE__ */bn(hn,{variant:"primary",disabled:null!==Hn,onClick:()=>{Rn(Yn.data)},children:at.done})]})]}),
43
43
  /* @__PURE__ */bn(z,{}),
44
44
  /* @__PURE__ */wn("div",{className:"sf-body",children:[vt?/* @__PURE__ */wn(zn,{children:[
45
- /* @__PURE__ */bn("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":at.leftPanel,children:Ut?/* @__PURE__ */bn(I,{blocks:Il,blocksOnly:Pl,at:Kt?{label:(e=>{const n=Qi(e.zone);if(n)return at.add.addingTo({name:$o.rowName?mi(n,!0):Or(n.type)});if(e.zone===le){const n=vr[e.index];return n&&!st(n)?at.add.addingBefore({name:mi(n,!0)}):at.add.addingAtEnd}const t=tl(e.zone);return t?at.add.addingTo({name:t.parentName}):at.add.addingHere})(Kt),onClear:()=>_t(null)}:void 0,onAdd:e=>{const n=io,t=(e,n)=>{Kt&&_t({zone:e,index:n})};if(n&&"block"!==e.kind&&Qi(n.zone))return hi(e,n.zone,n.index),void t(n.zone,n.index+1);if("section"===e.kind)return(e=>{if(null===lo)return void ci(e);const n=ci(e,lo);Kt&&qt(n+1)})(e.type);if("template"===e.kind)return((e,n)=>{if(null===lo)return void ai(e,n);const t=ai(e,n,lo);Kt&&qt(t+1)})(e.template.name,zr(e.template.node));if(n&&n.zone!==le){const o=tl(n.zone);if(!o)return;return o.target.spec?ji(o.parentId,o.target.slot,e.type,n.index,o.parent.type):Li(n.zone,e.type,n.index),void t(n.zone,n.index+1)}Ol?.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:il,siteWide:ko.addPanelRow?.(fi),onClose:fi,onHide:hr,readOnly:Boolean(Vn)}):Pt&&Nt?
46
- /* @__PURE__ */bn(A,{panel:Nt,pick:Pt,onHide:hr}):Rl?Rl.panel({onHide:hr,notify:Qo}):"media"===vo&&Nt?/* @__PURE__ */bn(A,{panel:Nt,pick:null,onHide:hr}):/* @__PURE__ */wn(zn,{children:[
47
- /* @__PURE__ */bn(P,{icon:/* @__PURE__ */bn(Ie,{}),title:"Layers",context:pt,actions:Ji.length>0?/* @__PURE__ */bn(Ve,{label:Ki?"Expand all sections":"Collapse all sections",onClick:()=>Do(e=>{const n=new Set(Ji);return Ki?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...Ji])}),children:/* @__PURE__ */bn(Cn,{expand:Ki})}):void 0,onHide:hr}),
45
+ /* @__PURE__ */bn("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":at.leftPanel,children:Gt?/* @__PURE__ */bn(I,{blocks:Il,blocksOnly:Tl,at:_t?{label:(e=>{const n=Qi(e.zone);if(n)return at.add.addingTo({name:$o.rowName?mi(n,!0):Or(n.type)});if(e.zone===le){const n=vr[e.index];return n&&!st(n)?at.add.addingBefore({name:mi(n,!0)}):at.add.addingAtEnd}const t=tl(e.zone);return t?at.add.addingTo({name:t.parentName}):at.add.addingHere})(_t),onClear:()=>Kt(null)}:void 0,onAdd:e=>{const n=io,t=(e,n)=>{_t&&Kt({zone:e,index:n})};if(n&&"block"!==e.kind&&Qi(n.zone))return hi(e,n.zone,n.index),void t(n.zone,n.index+1);if("section"===e.kind)return(e=>{if(null===lo)return void ci(e);const n=ci(e,lo);_t&&Zt(n+1)})(e.type);if("template"===e.kind)return((e,n)=>{if(null===lo)return void ai(e,n);const t=ai(e,n,lo);_t&&Zt(t+1)})(e.template.name,zr(e.template.node));if(n&&n.zone!==le){const o=tl(n.zone);if(!o)return;return o.target.spec?ji(o.parentId,o.target.slot,e.type,n.index,o.parent.type):Ei(n.zone,e.type,n.index),void t(n.zone,n.index+1)}Ol?.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:il,siteWide:ko.addPanelRow?.(fi),onClose:fi,onHide:hr,readOnly:Boolean(Vn)}):Tt&&Nt?
46
+ /* @__PURE__ */bn(A,{panel:Nt,pick:Tt,onHide:hr}):Ml?Ml.panel({onHide:hr,notify:Qo}):"media"===vo&&Nt?/* @__PURE__ */bn(A,{panel:Nt,pick:null,onHide:hr}):/* @__PURE__ */wn(zn,{children:[
47
+ /* @__PURE__ */bn(T,{icon:/* @__PURE__ */bn(Ie,{}),title:"Layers",context:pt,actions:Ji.length>0?/* @__PURE__ */bn(Ve,{label:_i?"Expand all sections":"Collapse all sections",onClick:()=>Do(e=>{const n=new Set(Ji);return _i?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...Ji])}),children:/* @__PURE__ */bn(Cn,{expand:_i})}):void 0,onHide:hr}),
48
48
  /* @__PURE__ */wn(ze,{className:"sf-tree sf-scroll",children:[
49
- /* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(Io,{type:"page",size:13}),name:at.pageSettings,onSelect:kr,selected:!_n&&to,rowProps:{onClick:gi(kr)}}),Ui&&/* @__PURE__ */wn(zn,{children:[
50
- /* @__PURE__ */bn(Be,{children:at.header}),wl(Ui)]}),!So&&Wn&&/* @__PURE__ */wn(zn,{children:[
51
- /* @__PURE__ */bn(Be,{children:at.header}),!dt&&/* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(Io,{type:"header",size:13}),name:at.header,onSelect:Sr,selected:eo.kind===it?.kind,rowProps:{onClick:gi(Sr)}})]}),!So&&Gi&&Hl(Gi,Di,"header"),!So&&!jl&&/* @__PURE__ */bn(Be,{children:Ll}),jl?/* @__PURE__ */wn(zn,{children:[
52
- /* @__PURE__ */bn(be,{icon:null,name:Ll,fold:{open:!El,label:Ll,onToggle:()=>_o(Nn)}}),!El&&/* @__PURE__ */bn(we,{children:Vl})]}):Vl,Wn&&/* @__PURE__ */bn(Be,{children:at.footer}),Fi&&Hl(Fi,Hi,"footer"),!So&&!Fi&&Wn&&/* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(Io,{type:"footer",size:13}),name:at.footer,onSelect:yi,rowProps:{onClick:gi(yi),title:"Edit the site footer"}}),Wi&&wl(Wi),ko.treeFoot?.()]})]})}),
53
- /* @__PURE__ */bn(He,{side:"left",width:Go.left,min:De,max:Fe,defaultWidth:k.left,label:at.resizeLeftPanel,onResize:Yo})]}):/* @__PURE__ */bn(T,{side:"left",onShow:hr}),
49
+ /* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(Io,{type:"page",size:13}),name:at.pageSettings,onSelect:kr,selected:!Kn&&to,rowProps:{onClick:gi(kr)}}),Gi&&/* @__PURE__ */wn(zn,{children:[
50
+ /* @__PURE__ */bn(Be,{children:at.header}),wl(Gi)]}),!So&&Wn&&/* @__PURE__ */wn(zn,{children:[
51
+ /* @__PURE__ */bn(Be,{children:at.header}),!dt&&/* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(Io,{type:"header",size:13}),name:at.header,onSelect:Sr,selected:eo.kind===it?.kind,rowProps:{onClick:gi(Sr)}})]}),!So&&Ui&&Hl(Ui,Di,"header"),!So&&!jl&&/* @__PURE__ */bn(Be,{children:El}),jl?/* @__PURE__ */wn(zn,{children:[
52
+ /* @__PURE__ */bn(be,{icon:null,name:El,fold:{open:!Ll,label:El,onToggle:()=>Ko(Nn)}}),!Ll&&/* @__PURE__ */bn(we,{children:Vl})]}):Vl,Wn&&/* @__PURE__ */bn(Be,{children:at.footer}),Fi&&Hl(Fi,Hi,"footer"),!So&&!Fi&&Wn&&/* @__PURE__ */bn(be,{icon:/* @__PURE__ */bn(Io,{type:"footer",size:13}),name:at.footer,onSelect:yi,rowProps:{onClick:gi(yi),title:"Edit the site footer"}}),Wi&&wl(Wi),ko.treeFoot?.()]})]})}),
53
+ /* @__PURE__ */bn(He,{side:"left",width:Uo.left,min:De,max:Fe,defaultWidth:k.left,label:at.resizeLeftPanel,onResize:Yo})]}):/* @__PURE__ */bn(P,{side:"left",onShow:hr}),
54
54
  /* @__PURE__ */wn("div",{ref:er,className:"sf-center sf-scroll","data-sf-canvas-head":ir?"":void 0,style:{overflowX:pr?"auto":"hidden",overflowY:"hidden"},children:[ir&&/* @__PURE__ */bn("div",{ref:lr,className:"sf-canvas-head",children:/* @__PURE__ */bn(ir,{device:Ot})}),
55
55
  /* @__PURE__ */bn("div",{className:"sf-frame-scaler",style:ur,children:/* @__PURE__ */bn("div",{className:"sf-frame "+(Ot===Bt?"":`sf-frame--${Ot}`),style:fr,children:/* @__PURE__ */wn("div",{className:"sf-preview-host",children:[
56
- /* @__PURE__ */bn(ut,{},Et),
57
- /* @__PURE__ */bn(Je,{canvas:Dt,session:il,model:ul,measure:hl,canDrop:gl,onDrop:kl,onPick:vl,onZoneAdd:e=>{const n=en(e),t=jr(n);t&&Vr(t.node,t.slot,!1),ui(n,0)},zoneAddLabel:at.canvasAddBlock,readOnly:Boolean(Vn),revision:Yn.data}),Zt.length>0&&/* @__PURE__ */bn("div",{className:"sf-preview-gaps","aria-hidden":"true",children:Zt.map(e=>/* @__PURE__ */wn("button",{type:"button",tabIndex:-1,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},onClick:()=>pi(e.index),children:[
56
+ /* @__PURE__ */bn(ut,{},Lt),
57
+ /* @__PURE__ */bn(Je,{canvas:Dt,session:il,model:ul,measure:hl,canDrop:gl,onDrop:kl,onPick:vl,onZoneAdd:e=>{const n=en(e),t=jr(n);t&&Vr(t.node,t.slot,!1),ui(n,0)},zoneAddLabel:at.canvasAddBlock,readOnly:Boolean(Vn),revision:Yn.data}),qt.length>0&&/* @__PURE__ */bn("div",{className:"sf-preview-gaps","aria-hidden":"true",children:qt.map(e=>/* @__PURE__ */wn("button",{type:"button",tabIndex:-1,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},onClick:()=>pi(e.index),children:[
58
58
  /* @__PURE__ */bn("span",{className:"sf-preview-gap-line"}),
59
59
  /* @__PURE__ */wn("span",{className:"sf-preview-gap-pill",children:[
60
60
  /* @__PURE__ */bn("span",{className:"sf-preview-gap-plus",children:"+"}),
61
61
  /* @__PURE__ */bn("span",{className:"sf-preview-gap-label",children:"Add section"})]})]},e.index))})]})})})]}),xt?/* @__PURE__ */wn(zn,{children:[
62
- /* @__PURE__ */bn(g,{value:{selectChild:Ri,addChild:ji,childRowName:Ur,blockRowName:_i},children:/* @__PURE__ */bn(ft,{mode:eo,onOpenWebsiteSettings:ko.openSettings??(()=>{}),onOpenSiteStyles:ko.openStyles,onSelectNode:Mo,onNotify:Qo,onHidePanel:mr,nodeActions:_n?se(qn,_n.type):In})}),
63
- /* @__PURE__ */bn(He,{side:"right",width:Go.right,min:De,max:Fe,defaultWidth:k.right,label:"Resize settings panel",onResize:Jo})]}):
64
- /* @__PURE__ */bn(T,{side:"right",onShow:mr})]}),Zr.menu]})}))}export{Pn as ScreenChrome};
62
+ /* @__PURE__ */bn(g,{value:{selectChild:Mi,addChild:ji,childRowName:Gr,blockRowName:Ki},children:/* @__PURE__ */bn(ft,{mode:eo,onOpenWebsiteSettings:ko.openSettings??(()=>{}),onOpenSiteStyles:ko.openStyles,onSelectNode:Ro,onNotify:Qo,onHidePanel:mr,nodeActions:Kn?se(Zn,Kn.type):In})}),
63
+ /* @__PURE__ */bn(He,{side:"right",width:Uo.right,min:De,max:Fe,defaultWidth:k.right,label:"Resize settings panel",onResize:Jo})]}):
64
+ /* @__PURE__ */bn(P,{side:"right",onShow:mr})]}),qr.menu]})}))}export{Tn as ScreenChrome};
@@ -1 +1 @@
1
- import{useSectionOps as o}from"./chunk-LC7N3GZS.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-LACBURK5.js";import{useEasel as p}from"./chunk-PYCLHOSA.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-UAVNI3BU.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-5TRBCPRB.js";import{useEasel as p}from"./chunk-PYCLHOSA.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,23 +1,23 @@
1
- import{FieldSelect as e}from"./chunk-PJP46U5L.js";import{TreeSeam as n}from"./chunk-UFY6RNMT.js";import{SettingsField as l,SETTINGS_BUCKETS as t,SettingsTabs as a,SettingsGroup as r}from"./chunk-YNOZ5NXW.js";import{DEFAULT_TREE_WORDS as i}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as o}from"./chunk-QTLAVDJE.js";import{EaselMenuItems as s}from"./chunk-EA2HTX37.js";import{FieldNumber as c}from"./chunk-7SQF6LZL.js";import{SettingsSegmented as u}from"./chunk-QLD57GBB.js";import{DEFAULT_FIELDS_WORDS as d}from"./chunk-FPOKPNO4.js";import{useWords as m}from"./chunk-MFIRYGHW.js";import{useTreeDrag as p,gapToMoveIndex as h}from"./chunk-67GNT6PF.js";import{withTip as b}from"./chunk-P2VEMZH5.js";import{Textarea as f,Input as g,SortableList as v,ListRow as y,ContextMenu as x,tabPanelId as k,tabButtonId as w,SearchableSelect as N,Select as O}from"efficient-shell/ui";import{useRef as C,useState as j,useLayoutEffect as S,useId as D}from"react";import{jsx as I,jsxs as P}from"react/jsx-runtime";import{ChevronIcon as $,LockIcon as F,MoveUpIcon as L,MoveDownIcon as M,DuplicateIcon as T,TrashIcon as E}from"efficient-shell/icons/efficient";function z({id:e,value:n,onChange:l,placeholder:t,multiline:a=!1,rows:r=3,readOnly:i=!1,ariaLabel:o,ariaLabelledBy:s}){const c=n??"";return a?/* @__PURE__ */I(f,{id:e,size:"sm",className:"es-fin",value:c,rows:r,placeholder:t,readOnly:i,"aria-label":o,"aria-labelledby":s,onChange:e=>l(e.target.value)}):/* @__PURE__ */I(g,{id:e,size:"sm",className:"es-fin",type:"text",value:c,placeholder:t,readOnly:i,"aria-label":o,"aria-labelledby":s,onChange:e=>l(e.target.value)})}function R(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 A(e,n){return e.filter((e,l)=>l!==n)}function B(e){return null===e||"object"!=typeof e?e:JSON.parse(JSON.stringify(e))}var Y='input, textarea, select, button, [contenteditable]:not([contenteditable="false"]), [tabindex]',K={parentId:"list",slot:"items"};function J({label:e,icon:l,noun:t,items:a,onChange:r,newItem:o,summary:c,itemName:u,thumb:f,min:g=0,max:k,readOnly:w=!1,open:N,onOpen:O,renderItem:D,renderRow:z,canRemove:J,lockedReason:Q,fixed:G=!1,removeOnRow:U=!0,canDuplicate:V,above:W,head:X=!0}){const Z=m("fields",d).list,q=m("tree",i),_=t??Z.item,ee=!w&&!G&&("number"!=typeof k||a.length<k),ne=a.length<=g,le=e=>!!J&&!J(a[e],e),te=e=>!w&&!G&&U&&!ne&&!le(e),ae=e=>ee&&(!V||V(a[e],e)),re=(e,n)=>u?u(e,n):Z.itemName({noun:_,n:n+1}),ie=C([]),oe=C(null),[se,ce]=j(null),ue=C(null),[de,me]=j(null),[pe,he]=j("");S(()=>{const e=oe.current;if(!e)return;oe.current=null;const n=ie.current[e.index]?.querySelectorAll(Y)[e.nth]??ie.current[e.index];if(n?.focus(),n&&null!==e.start&&"setSelectionRange"in n)try{n.setSelectionRange(e.start,e.end)}catch{}});const be=(e,n)=>{if(n<0||n>=a.length||n===e)return;const l=ie.current[e],t=l?.ownerDocument.activeElement;if(l&&t&&l.contains(t)){const e=[...l.querySelectorAll(Y)].indexOf(t),a=t;oe.current={index:n,nth:e,start:"number"==typeof a.selectionStart?a.selectionStart:null,end:"number"==typeof a.selectionEnd?a.selectionEnd:null}}r(H(a,e,n));const i=function(e,n,l){return null===e?null:e===n?l:n<e&&l>=e?e-1:n>e&&l<=e?e+1:e}(N,e,n);i!==N&&O(i),he(Z.moved({n:n+1,total:a.length}))},fe=e=>{ee&&(r(R(a,e,o())),z?(oe.current={index:e,nth:0,start:null,end:null},null!==N&&N>=e&&O(N+1)):O(e))},ge=e=>{te(e)&&(r(A(a,e)),N===e?O(null):null!==N&&N>e&&O(N-1))},ve=p({keyOf:e=>String(e),canDrop:(e,n)=>n.parentId===K.parentId&&n.slot===K.slot,onDrop:(e,n)=>{const l=h({...K,index:e},n);l!==e&&be(e,l)},onStep:(e,n)=>be(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:Z.moveUp,icon:/* @__PURE__ */I(L,{size:14}),shortcut:"⌥↑",onClick:()=>be(e,e-1)}),e<a.length-1&&n.push({label:Z.moveDown,icon:/* @__PURE__ */I(M,{size:14}),shortcut:"⌥↓",onClick:()=>be(e,e+1)}),ae(e)&&n.push({label:Z.duplicate,icon:/* @__PURE__ */I(T,{size:14}),onClick:()=>(e=>{ae(e)&&(r(R(a,e+1,B(a[e]))),null!==N&&N>e&&O(N+1))})(e)}),te(e)&&n.push({label:Z.delete,icon:/* @__PURE__ */I(E,{size:14}),danger:!0,onClick:()=>ge(e)}),n},xe=(e,n,l,t)=>{w||0===ye(e).length||me({index:e,x:n,y:l,owner:t})},ke=e=>n=>{const l=a.slice();l[e]=n,r(l)};/* @__PURE__ */
2
- return P("div",{className:"es-list",children:[X?/* @__PURE__ */P("div",{className:"es-list-head",children:[
3
- /* @__PURE__ */P("span",{className:"es-list-label",children:[l?/* @__PURE__ */I("span",{className:"es-field-icon","aria-hidden":"true",children:l}):null,e]}),
4
- /* @__PURE__ */I("span",{className:"es-list-count",children:a.length})]}):null,W?/* @__PURE__ */I("div",{className:"es-list-above",children:W}):null,a.length?/* @__PURE__ */P(v,{"aria-label":e,spacing:"comfortable",className:"es-list-rows",rootProps:ve.rootProps(),children:[a.map((e,l)=>{const t=ve.row({item:l,place:{...K,index:l}}),a=t.draggable&&se!==l,r=!z&&N===l,i=!w&&!G&&U&&le(l),o=["es-list-row",z?"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__ */I(n,{...ve.seam({place:{...K,index:l}}),onAdd:ee?()=>fe(l):void 0,label:Z.addHere({noun:_})},`seam-${l}`):null,
5
- /* @__PURE__ */I(y,{className:o,flat:!!z,active:r,draggable:t.draggable,dragHint:q.dragHint,dragging:t.dragging,drop:"before"===t.drop||"after"===t.drop?t.drop:void 0,onMove:t.draggable?e=>be(l,"up"===e?l-1:l+1):void 0,rowRef:e=>{ie.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,ue.current=n&&!a?n:null,ce(a?l:null)},onDragStart:e=>{const n=ue.current;ue.current=null,n&&n.ownerDocument.activeElement===n&&n.blur(),t.rowProps.onDragStart?.(e)},onContextMenu:e=>{w||(e.preventDefault(),e.stopPropagation(),xe(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 xe(l,a.left+24,a.bottom,e.currentTarget)}t.rowProps.onKeyDown?.(e)}},actions:w||G||!U?void 0:i?b(Q?Q(e,l):Z.locked,/* @__PURE__ */I("span",{className:"es-list-lock",role:"img","aria-label":Q?Q(e,l):Z.locked,children:/* @__PURE__ */I(F,{size:13})})):b(Z.deleteItem({noun:_}),/* @__PURE__ */I("button",{type:"button",className:"es-list-x","aria-label":Z.deleteItem({noun:_}),disabled:!te(l),onClick:()=>ge(l),children:"×"})),below:r?/* @__PURE__ */I("div",{className:"es-list-item",children:D(e,l,ke(l))}):void 0,children:z?/* @__PURE__ */I("div",{className:"es-list-row-main",children:z(e,l,ke(l))}):/* @__PURE__ */P("button",{type:"button",className:"es-list-open","aria-expanded":r,onClick:()=>O(r?null:l),children:[f?/* @__PURE__ */I("span",{className:"es-list-thumb","aria-hidden":"true",children:f(e,l)}):null,
6
- /* @__PURE__ */I("span",{className:"es-list-row-name",children:re(e,l)}),/* @__PURE__ */I("span",c?{className:"es-list-row-summary",children:c(e,l)}:{className:"es-list-row-summary"}),
7
- /* @__PURE__ */I($,{size:14,className:"es-list-chev","aria-hidden":"true"})]})},l)]}),
8
- /* @__PURE__ */I(n,{...ve.seam({place:{...K,index:a.length}})})]}):null,w||G?null:/* @__PURE__ */I("button",{type:"button",className:"es-list-add",disabled:!ee,onClick:()=>fe(a.length),children:Z.add({noun:_})}),
9
- /* @__PURE__ */I("span",{className:"es-list-said","aria-live":"polite",children:pe}),de&&de.index<a.length?
10
- /* @__PURE__ */I(x,{at:{x:de.x,y:de.y},owner:de.owner,onClose:()=>me(null),children:/* @__PURE__ */I(s,{items:ye(de.index),onClose:()=>me(null)})}):null]})}var Q=(e,n)=>"string"==typeof e.label&&e.label?e.label:n;function G({field:e,name:n,id:l,value:t,onChange:a,readOnly:i,context:o,renderers:s}){const[c,u]=j(!0),d=t&&"object"==typeof t?t:{};/* @__PURE__ */
11
- return I(r,{id:`${l}-group`,title:Q(e,n),open:c,onToggle:u,children:Object.entries(e.objectFields).map(([e,t])=>/* @__PURE__ */I(V,{field:t,name:`${n}.${e}`,id:`${l}-${e}`,value:d[e],onChange:n=>a({...d,[e]:n}),readOnly:i,context:o,renderers:s},e))})}function U({field:e,name:n,id:l,value:t,onChange:a,readOnly:r,context:i,renderers:o,openItem:s,onOpenItem:c}){const[u,d]=j(null),m=c?s??null:u,p=c??d,h=Array.isArray(t)?t:[],b=e.getItemSummary;/* @__PURE__ */
12
- return I(J,{label:Q(e,n),icon:e.icon,noun:"string"==typeof e.noun?e.noun:void 0,items:h,onChange:a,newItem:()=>B({...e.defaultItemProps??{}}),summary:b?(e,n)=>b(e,n):void 0,min:e.min,max:e.max,readOnly:r,open:m,onOpen:p,renderItem:(t,a,s)=>Object.entries(e.arrayFields).map(([e,c])=>/* @__PURE__ */I(V,{field:c,name:`${n}[${a}].${e}`,id:`${l}-${a}-${e}`,value:t?.[e],onChange:n=>s({...t,[e]:n}),readOnly:r,context:i,renderers:o},e))})}function V(n){const{field:t,name:a,id:r,value:i,onChange:o,readOnly:s,context:d,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:i,onChange:o,readOnly:s});switch(t.type){case"custom":{const e={...d,field:t,name:a,id:r,value:i,onChange:o,readOnly:s};return t.render(e)}case"text":case"textarea":/* @__PURE__ */
13
- return I(l,{label:Q(t,a),htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */I(z,{id:r,value:"string"==typeof i?i:null==i?"":String(i),onChange:o,placeholder:t.placeholder,multiline:"textarea"===t.type,readOnly:s})});case"number":/* @__PURE__ */
14
- return I(l,{label:Q(t,a),htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */I(c,{id:r,value:"number"==typeof i?i:void 0,onChange:o,min:t.min,max:t.max,step:t.step,placeholder:t.placeholder,readOnly:s})});case"select":{const n=`${r}-label`;/* @__PURE__ */
15
- return I(l,{label:Q(t,a),labelId:n,htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */I(e,{id:r,value:i,options:t.options,onChange:o,readOnly:s,ariaLabelledBy:n})})}case"radio":/* @__PURE__ */
16
- return I(l,{label:Q(t,a),icon:t.icon,hint:t.hint,children:/* @__PURE__ */I(u,{ariaLabel:Q(t,a),value:i,options:t.options.map(e=>({id:e.value,label:e.label,icon:e.icon,disabled:e.disabled||s})),onChange:e=>{s||o(e)}})});case"object":/* @__PURE__ */
17
- return I(G,{...n,field:t});case"array":/* @__PURE__ */
18
- return I(U,{...n,field:t});case"slot":return null}}var W=e=>t.includes(e);function X(e){let n=t[0];const l=[],a=/* @__PURE__ */new Set;for(const[t,r]of Object.entries(e))r&&(W(r.bucket)&&(n=r.bucket),r.marker||!1===r.visible||(l.push({name:t,field:r,bucket:n}),"slot"!==r.type&&a.add(n)));return{rows:l,buckets:t.filter(e=>a.has(e))}}function Z(e){return new Map(X(e).rows.map(e=>[e.name,e.bucket]))}function q({fields:e,values:n,onChange:l,readOnly:t=!1,context:r,tab:i,onTab:s,tabs:c=!0,tabIcons:u,renderers:d,idPrefix:p,ariaLabel:h,children:b}){const f=m("panel",o),g=D(),v=p??`es-insp${g.replace(/:/g,"")}`,y=X(e),[x,N]=j(void 0),O=i??x,C=O&&y.buckets.includes(O)?O:y.buckets[0],[S,$]=j(null),F=S&&S.panel===v&&y.rows.some(e=>e.name===S.name)?S:null,L=c&&y.buckets.length>1,M=L&&C?k(v,C):`${v}-rows`;/* @__PURE__ */
19
- return P("div",{className:"es-insp",children:[L?/* @__PURE__ */I("div",{className:"es-insp-tabs",children:/* @__PURE__ */I(a,{ariaLabel:h??f.settings,activeId:C,onSelect:e=>{const n=e;void 0===i&&N(n),s?.(n)},items:y.buckets.map(e=>({id:e,label:f.buckets[e],icon:u?.[e]})),idPrefix:v})}):null,
20
- /* @__PURE__ */P("div",{className:"es-insp-rows",id:M,role:L?"tabpanel":void 0,"aria-labelledby":L&&C?w(v,C):void 0,children:[y.rows.map(({name:e,field:a,bucket:i})=>/* @__PURE__ */I("div",{className:"es-insp-row","data-field":e,"data-bucket":i,hidden:!(!L||i===C)||void 0,children:/* @__PURE__ */I(V,{field:a,name:e,id:`${v}-${e}`,value:n[e],onChange:n=>l(e,n),readOnly:t,context:r,renderers:d,openItem:F&&F.name===e?F.index:null,onOpenItem:n=>$(null===n?null:{panel:v,name:e,index:n})})},e)),b]})]})}function _(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}function ee({value:e,onChange:n,kinds:l,rules:t,filtersFor:a,label:r,readOnly:i}){const o=m("fields",d).link??d.link,[s,c]=j(null),[u,p]=j(null),h=s&&s.against===e?s.kind:t.kindOf(e),b=l.filter(e=>!e.hideWhenEmpty||_(e.target).length>0||e.value===h),f=b.find(e=>"text"===e.target.type),v=b.find(e=>e.value===h)??f??b[0];if(!v)return null;const y="text"!==v.target.type,x=y?t.targetOf(e):e,k=_(v.target),w=k.find(e=>e.value===x),C=e=>({value:e,label:o.unavailable({value:e})}),S="select"===v.target.type&&x&&a?a(x):null,D=S?t.readFilter(e):null,$=D?S?.find(e=>e.param===D.param):void 0,F=u&&u.against===e?u.text:e,L=!y&&""!==F.trim()&&!t.isSafe(F),M=(e,l)=>{c(n=>n?{...n,against:e}:n),void 0===l?n(e):n(e,l)},T=e=>{if(!e)return M("");const n=k.find(n=>n.value===e);M(e,n?.label)},E=(e,n)=>n&&!e.some(e=>e.value===n)?[C(n),...e]:[...e],z=(e,n,l,t,a)=>{const r=[];for(const e of l){const n=r[r.length-1],l={value:e.value,label:e.label};e.group?n&&"options"in n&&n.label===e.group?n.options.push(l):r.push({label:e.group,options:[l]}):r.push(l)}if(a){const a=l.some(e=>""===e.value);/* @__PURE__ */
21
- return I(N,{"aria-label":e,value:n,options:r,disabled:i,clearable:a,placeholder:l.find(e=>""===e.value)?.label,onChange:t})}/* @__PURE__ */
22
- return I(O,{size:"sm","aria-label":e,value:n,options:r,readOnly:i,onChange:t})};let R;if("text"===v.target.type)R=/* @__PURE__ */I(g,{size:"sm",type:"text",className:"es-fin",invalid:L,"aria-label":o.address,placeholder:o.addressPlaceholder,value:F,readOnly:i,onChange:n=>(n=>{const l=n.trim();l?t.isSafe(n)?(p({text:n,against:l}),M(l)):p({text:n,against:e}):(p({text:n,against:""}),M(""))})(n.target.value)});else{const e="groups"===v.target.type?v.target.groups.flatMap(e=>e.options.map(n=>({value:n.value,label:n.label,group:e.label}))):v.target.options.map(e=>({value:e.value,label:e.label})),n=[{value:"",label:v.target.placeholder},...E(e,x)];R=z(v.label,x,n,T,e.length>10)}/* @__PURE__ */
23
- return P("div",{className:"es-flink",role:r?"group":void 0,"aria-label":r,children:[z(o.linkType,v.value,b.map(e=>({value:e.value,label:e.label})),l=>{p(null);const t=b.find(e=>e.value===l);if(!t||"text"===t.target.type)return void c({kind:l,against:e});const a=_(t.target)[0];c({kind:l,against:a?a.value:""}),a?n(a.value,a.label):n("")},!1),R,S&&z(o.filter,D?.param??"",[{value:"",label:o.noFilter},...D&&!$?[C(D.param)]:[],...S.map(e=>({value:e.param,label:e.label}))],e=>{if(!e)return M(x,w?.label);const n=S?.find(n=>n.param===e),l=n?.values[0];l&&M(t.withFilter(x,{param:e,value:l.value}),l.label)},!1),S&&D&&z(o.value,D.value,E(($?.values??[]).map(e=>({value:e.value,label:e.label})),D.value),e=>{if(!D)return;const n=$?.values.find(n=>n.value===e);M(t.withFilter(x,{param:D.param,value:e}),n?.label)},($?.values.length??0)>10),L&&/* @__PURE__ */I("p",{className:"es-flink-error",role:"alert",children:o.unsafe}),v.hint&&/* @__PURE__ */I("p",{className:"es-flink-hint",children:v.hint}),S&&/* @__PURE__ */I("p",{className:"es-flink-hint",children:o.filterHint})]})}export{z as FieldText,q as Inspector,V as InspectorField,ee as LinkPicker,J as ListField,Z as bucketsOf,B as copyItem,R as insertAt,Q as labelOf,H as moveTo,X as planFields,A as removeAt};
1
+ import{FieldSelect as e}from"./chunk-FOBGSFFS.js";import{TreeSeam as n}from"./chunk-UFY6RNMT.js";import{SettingsField as l,SETTINGS_BUCKETS as t,SettingsTabs as a,SettingsGroup as r}from"./chunk-YNOZ5NXW.js";import{DEFAULT_TREE_WORDS as i}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as o}from"./chunk-QTLAVDJE.js";import{EaselMenuItems as s}from"./chunk-EA2HTX37.js";import{FieldNumber as c}from"./chunk-7SQF6LZL.js";import{SettingsSegmented as u}from"./chunk-QLD57GBB.js";import{DEFAULT_FIELDS_WORDS as d}from"./chunk-FPOKPNO4.js";import{useWords as m}from"./chunk-MFIRYGHW.js";import{useTreeDrag as p,gapToMoveIndex as h}from"./chunk-67GNT6PF.js";import{withTip as b}from"./chunk-P2VEMZH5.js";import{Textarea as f,Input as g,SortableList as v,ListRow as y,ContextMenu as x,tabPanelId as k,tabButtonId as w,SearchableSelect as N,Select as O}from"efficient-shell/ui";import{useRef as C,useState as S,useLayoutEffect as j,useId as D}from"react";import{jsx as F,jsxs as I}from"react/jsx-runtime";import{ChevronIcon as $,LockIcon as P,MoveUpIcon as M,MoveDownIcon as T,DuplicateIcon as L,TrashIcon as E}from"efficient-shell/icons/efficient";function z({id:e,value:n,onChange:l,placeholder:t,multiline:a=!1,rows:r=3,readOnly:i=!1,ariaLabel:o,ariaLabelledBy:s}){const c=n??"";return a?/* @__PURE__ */F(f,{id:e,size:"sm",className:"es-fin",value:c,rows:r,placeholder:t,readOnly:i,"aria-label":o,"aria-labelledby":s,onChange:e=>l(e.target.value)}):/* @__PURE__ */F(g,{id:e,size:"sm",className:"es-fin",type:"text",value:c,placeholder:t,readOnly:i,"aria-label":o,"aria-labelledby":s,onChange:e=>l(e.target.value)})}function R(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 A(e,n){return e.filter((e,l)=>l!==n)}function B(e){return null===e||"object"!=typeof e?e:JSON.parse(JSON.stringify(e))}var Y='input, textarea, select, button, [contenteditable]:not([contenteditable="false"]), [tabindex]',K={parentId:"list",slot:"items"};function G({label:e,icon:l,noun:t,items:a,onChange:r,newItem:o,summary:c,itemName:u,thumb:f,min:g=0,max:k,readOnly:w=!1,open:N,onOpen:O,renderItem:D,renderRow:z,canRemove:G,lockedReason:Q,fixed:J=!1,removeOnRow:V=!0,canDuplicate:W,above:X,head:Z=!0}){const q=m("fields",d).list,U=m("tree",i),_=t??q.item,ee=!w&&!J&&("number"!=typeof k||a.length<k),ne=a.length<=g,le=e=>!!G&&!G(a[e],e),te=e=>!w&&!J&&V&&!ne&&!le(e),ae=e=>ee&&(!W||W(a[e],e)),re=(e,n)=>u?u(e,n):q.itemName({noun:_,n:n+1}),ie=C([]),oe=C(null),[se,ce]=S(null),ue=C(null),[de,me]=S(null),[pe,he]=S("");j(()=>{const e=oe.current;if(!e)return;oe.current=null;const n=ie.current[e.index]?.querySelectorAll(Y)[e.nth]??ie.current[e.index];if(n?.focus(),n&&null!==e.start&&"setSelectionRange"in n)try{n.setSelectionRange(e.start,e.end)}catch{}});const be=(e,n)=>{if(n<0||n>=a.length||n===e)return;const l=ie.current[e],t=l?.ownerDocument.activeElement;if(l&&t&&l.contains(t)){const e=[...l.querySelectorAll(Y)].indexOf(t),a=t;oe.current={index:n,nth:e,start:"number"==typeof a.selectionStart?a.selectionStart:null,end:"number"==typeof a.selectionEnd?a.selectionEnd:null}}r(H(a,e,n));const i=function(e,n,l){return null===e?null:e===n?l:n<e&&l>=e?e-1:n>e&&l<=e?e+1:e}(N,e,n);i!==N&&O(i),he(q.moved({n:n+1,total:a.length}))},fe=e=>{ee&&(r(R(a,e,o())),z?(oe.current={index:e,nth:0,start:null,end:null},null!==N&&N>=e&&O(N+1)):O(e))},ge=e=>{te(e)&&(r(A(a,e)),N===e?O(null):null!==N&&N>e&&O(N-1))},ve=p({keyOf:e=>String(e),canDrop:(e,n)=>n.parentId===K.parentId&&n.slot===K.slot,onDrop:(e,n)=>{const l=h({...K,index:e},n);l!==e&&be(e,l)},onStep:(e,n)=>be(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__ */F(M,{size:14}),shortcut:"⌥↑",onClick:()=>be(e,e-1)}),e<a.length-1&&n.push({label:q.moveDown,icon:/* @__PURE__ */F(T,{size:14}),shortcut:"⌥↓",onClick:()=>be(e,e+1)}),ae(e)&&n.push({label:q.duplicate,icon:/* @__PURE__ */F(L,{size:14}),onClick:()=>(e=>{ae(e)&&(r(R(a,e+1,B(a[e]))),null!==N&&N>e&&O(N+1))})(e)}),te(e)&&n.push({label:q.delete,icon:/* @__PURE__ */F(E,{size:14}),danger:!0,onClick:()=>ge(e)}),n},xe=(e,n,l,t)=>{w||0===ye(e).length||me({index:e,x:n,y:l,owner:t})},ke=e=>n=>{const l=a.slice();l[e]=n,r(l)};/* @__PURE__ */
2
+ return I("div",{className:"es-list",children:[Z?/* @__PURE__ */I("div",{className:"es-list-head",children:[
3
+ /* @__PURE__ */I("span",{className:"es-list-label",children:[l?/* @__PURE__ */F("span",{className:"es-field-icon","aria-hidden":"true",children:l}):null,e]}),
4
+ /* @__PURE__ */F("span",{className:"es-list-count",children:a.length})]}):null,X?/* @__PURE__ */F("div",{className:"es-list-above",children:X}):null,a.length?/* @__PURE__ */I(v,{"aria-label":e,spacing:"comfortable",className:"es-list-rows",rootProps:ve.rootProps(),children:[a.map((e,l)=>{const t=ve.row({item:l,place:{...K,index:l}}),a=t.draggable&&se!==l,r=!z&&N===l,i=!w&&!J&&V&&le(l),o=["es-list-row",z?"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__ */F(n,{...ve.seam({place:{...K,index:l}}),onAdd:ee?()=>fe(l):void 0,label:q.addHere({noun:_})},`seam-${l}`):null,
5
+ /* @__PURE__ */F(y,{className:o,flat:!!z,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=>be(l,"up"===e?l-1:l+1):void 0,rowRef:e=>{ie.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,ue.current=n&&!a?n:null,ce(a?l:null)},onDragStart:e=>{const n=ue.current;ue.current=null,n&&n.ownerDocument.activeElement===n&&n.blur(),t.rowProps.onDragStart?.(e)},onContextMenu:e=>{w||(e.preventDefault(),e.stopPropagation(),xe(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 xe(l,a.left+24,a.bottom,e.currentTarget)}t.rowProps.onKeyDown?.(e)}},actions:w||J||!V?void 0:i?b(Q?Q(e,l):q.locked,/* @__PURE__ */F("span",{className:"es-list-lock",role:"img","aria-label":Q?Q(e,l):q.locked,children:/* @__PURE__ */F(P,{size:13})})):b(q.deleteItem({noun:_}),/* @__PURE__ */F("button",{type:"button",className:"es-list-x","aria-label":q.deleteItem({noun:_}),disabled:!te(l),onClick:()=>ge(l),children:"×"})),below:r?/* @__PURE__ */F("div",{className:"es-list-item",children:D(e,l,ke(l))}):void 0,children:z?/* @__PURE__ */F("div",{className:"es-list-row-main",children:z(e,l,ke(l))}):/* @__PURE__ */I("button",{type:"button",className:"es-list-open","aria-expanded":r,onClick:()=>O(r?null:l),children:[f?/* @__PURE__ */F("span",{className:"es-list-thumb","aria-hidden":"true",children:f(e,l)}):null,
6
+ /* @__PURE__ */F("span",{className:"es-list-row-name",children:re(e,l)}),/* @__PURE__ */F("span",c?{className:"es-list-row-summary",children:c(e,l)}:{className:"es-list-row-summary"}),
7
+ /* @__PURE__ */F($,{size:14,className:"es-list-chev","aria-hidden":"true"})]})},l)]}),
8
+ /* @__PURE__ */F(n,{...ve.seam({place:{...K,index:a.length}})})]}):null,w||J?null:/* @__PURE__ */F("button",{type:"button",className:"es-list-add",disabled:!ee,onClick:()=>fe(a.length),children:q.add({noun:_})}),
9
+ /* @__PURE__ */F("span",{className:"es-list-said","aria-live":"polite",children:pe}),de&&de.index<a.length?
10
+ /* @__PURE__ */F(x,{at:{x:de.x,y:de.y},owner:de.owner,onClose:()=>me(null),children:/* @__PURE__ */F(s,{items:ye(de.index),onClose:()=>me(null)})}):null]})}var Q=(e,n)=>"string"==typeof e.label&&e.label?e.label:n;function J({field:e,name:n,id:l,value:t,onChange:a,readOnly:i,context:o,renderers:s}){const[c,u]=S(!0),d=t&&"object"==typeof t?t:{};/* @__PURE__ */
11
+ return F(r,{id:`${l}-group`,title:Q(e,n),open:c,onToggle:u,children:Object.entries(e.objectFields).map(([e,t])=>/* @__PURE__ */F(W,{field:t,name:`${n}.${e}`,id:`${l}-${e}`,value:d[e],onChange:n=>a({...d,[e]:n}),readOnly:i,context:o,renderers:s},e))})}function V({field:e,name:n,id:l,value:t,onChange:a,readOnly:r,context:i,renderers:o,openItem:s,onOpenItem:c}){const[u,d]=S(null),m=c?s??null:u,p=c??d,h=Array.isArray(t)?t:[],b=e.getItemSummary;/* @__PURE__ */
12
+ return F(G,{label:Q(e,n),icon:e.icon,noun:"string"==typeof e.noun?e.noun:void 0,items:h,onChange:a,newItem:()=>B({...e.defaultItemProps??{}}),summary:b?(e,n)=>b(e,n):void 0,min:e.min,max:e.max,readOnly:r,open:m,onOpen:p,renderItem:(t,a,s)=>Object.entries(e.arrayFields).map(([e,c])=>/* @__PURE__ */F(W,{field:c,name:`${n}[${a}].${e}`,id:`${l}-${a}-${e}`,value:t?.[e],onChange:n=>s({...t,[e]:n}),readOnly:r,context:i,renderers:o},e))})}function W(n){const{field:t,name:a,id:r,value:i,onChange:o,readOnly:s,context:d,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:i,onChange:o,readOnly:s});switch(t.type){case"custom":{const e={...d,field:t,name:a,id:r,value:i,onChange:o,readOnly:s};return t.render(e)}case"text":case"textarea":/* @__PURE__ */
13
+ return F(l,{label:Q(t,a),htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */F(z,{id:r,value:"string"==typeof i?i:null==i?"":String(i),onChange:o,placeholder:t.placeholder,multiline:"textarea"===t.type,readOnly:s})});case"number":/* @__PURE__ */
14
+ return F(l,{label:Q(t,a),htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */F(c,{id:r,value:"number"==typeof i?i:void 0,onChange:o,min:t.min,max:t.max,step:t.step,placeholder:t.placeholder,readOnly:s})});case"select":{const n=`${r}-label`;/* @__PURE__ */
15
+ return F(l,{label:Q(t,a),labelId:n,htmlFor:r,icon:t.icon,hint:t.hint,children:/* @__PURE__ */F(e,{id:r,value:i,options:t.options,onChange:o,readOnly:s,ariaLabelledBy:n})})}case"radio":/* @__PURE__ */
16
+ return F(l,{label:Q(t,a),icon:t.icon,hint:t.hint,children:/* @__PURE__ */F(u,{ariaLabel:Q(t,a),value:i,options:t.options.map(e=>({id:e.value,label:e.label,icon:e.icon,disabled:e.disabled||s})),onChange:e=>{s||o(e)}})});case"object":/* @__PURE__ */
17
+ return F(J,{...n,field:t});case"array":/* @__PURE__ */
18
+ return F(V,{...n,field:t});case"slot":return null}}var X=e=>t.includes(e);function Z(e){let n=t[0];const l=[],a=/* @__PURE__ */new Set;for(const[t,r]of Object.entries(e))r&&(X(r.bucket)&&(n=r.bucket),r.marker||!1===r.visible||(l.push({name:t,field:r,bucket:n}),"slot"!==r.type&&a.add(n)));return{rows:l,buckets:t.filter(e=>a.has(e))}}function q(e){return new Map(Z(e).rows.map(e=>[e.name,e.bucket]))}function U({fields:e,values:n,onChange:l,readOnly:t=!1,context:r,tab:i,onTab:s,tabs:c=!0,tabIcons:u,renderers:d,idPrefix:p,ariaLabel:h,children:b}){const f=m("panel",o),g=D(),v=p??`es-insp${g.replace(/:/g,"")}`,y=Z(e),[x,N]=S(void 0),O=i??x,C=O&&y.buckets.includes(O)?O:y.buckets[0],[j,$]=S(null),P=j&&j.panel===v&&y.rows.some(e=>e.name===j.name)?j:null,M=c&&y.buckets.length>1,T=M&&C?k(v,C):`${v}-rows`;/* @__PURE__ */
19
+ return I("div",{className:"es-insp",children:[M?/* @__PURE__ */F("div",{className:"es-insp-tabs",children:/* @__PURE__ */F(a,{ariaLabel:h??f.settings,activeId:C,onSelect:e=>{const n=e;void 0===i&&N(n),s?.(n)},items:y.buckets.map(e=>({id:e,label:f.buckets[e],icon:u?.[e]})),idPrefix:v})}):null,
20
+ /* @__PURE__ */I("div",{className:"es-insp-rows",id:T,role:M?"tabpanel":void 0,"aria-labelledby":M&&C?w(v,C):void 0,children:[y.rows.map(({name:e,field:a,bucket:i})=>/* @__PURE__ */F("div",{className:"es-insp-row","data-field":e,"data-bucket":i,hidden:!(!M||i===C)||void 0,children:/* @__PURE__ */F(W,{field:a,name:e,id:`${v}-${e}`,value:n[e],onChange:n=>l(e,n),readOnly:t,context:r,renderers:d,openItem:P&&P.name===e?P.index:null,onOpenItem:n=>$(null===n?null:{panel:v,name:e,index:n})})},e)),b]})]})}function _(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}function ee({value:e,onChange:n,kinds:l,rules:t,filtersFor:a,label:r,readOnly:i}){const o=m("fields",d).link??d.link,[s,c]=S(null),[u,p]=S(null),h=s&&s.against===e?s.kind:t.kindOf(e),b=l.filter(e=>!e.hideWhenEmpty||_(e.target).length>0||e.value===h),f=b.find(e=>"text"===e.target.type),v=b.find(e=>e.value===h)??f??b[0];if(!v)return null;const y="text"!==v.target.type,x=y?t.targetOf(e):e,k=_(v.target),w=k.find(e=>e.value===x),C=e=>({value:e,label:o.unavailable({value:e})}),j="select"===v.target.type&&x&&a?a(x):null,D=j?t.readFilter(e):null,$=D?j?.find(e=>e.param===D.param):void 0,P=u&&u.against===e?u.text:e,M=!y&&""!==P.trim()&&!t.isSafe(P),T=(e,l)=>{c(n=>n?{...n,against:e}:n),void 0===l?n(e):n(e,l)},L=e=>{if(!e)return T("");const n=k.find(n=>n.value===e);T(e,n?.label)},E=(e,n)=>n&&!e.some(e=>e.value===n)?[C(n),...e]:[...e],z=(e,n,l,t,a)=>{const r=[];for(const e of l){const n=r[r.length-1],l={value:e.value,label:e.label};e.group?n&&"options"in n&&n.label===e.group?n.options.push(l):r.push({label:e.group,options:[l]}):r.push(l)}if(a){const a=l.some(e=>""===e.value);/* @__PURE__ */
21
+ return F(N,{"aria-label":e,value:n,options:r,disabled:i,clearable:a,placeholder:l.find(e=>""===e.value)?.label,onChange:t})}/* @__PURE__ */
22
+ return F(O,{size:"sm","aria-label":e,value:n,options:r,readOnly:i,onChange:t})};let R;if("text"===v.target.type)R=/* @__PURE__ */F(g,{size:"sm",type:"text",className:"es-fin",invalid:M,"aria-label":o.address,placeholder:o.addressPlaceholder,value:P,readOnly:i,onChange:n=>(n=>{const l=n.trim();l?t.isSafe(n)?(p({text:n,against:l}),T(l)):p({text:n,against:e}):(p({text:n,against:""}),T(""))})(n.target.value)});else{const e="groups"===v.target.type?v.target.groups.flatMap(e=>e.options.map(n=>({value:n.value,label:n.label,group:e.label}))):v.target.options.map(e=>({value:e.value,label:e.label})),n=[{value:"",label:v.target.placeholder},...E(e,x)];R=z(v.label,x,n,L,e.length>10)}/* @__PURE__ */
23
+ return I("div",{className:"es-flink",role:r?"group":void 0,"aria-label":r,children:[z(o.linkType,v.value,b.map(e=>({value:e.value,label:e.label})),l=>{p(null);const t=b.find(e=>e.value===l);if(!t||"text"===t.target.type)return void c({kind:l,against:e});const a=_(t.target)[0];c({kind:l,against:a?a.value:""}),a?n(a.value,a.label):n("")},!1),R,j&&z(o.filter,D?.param??"",[{value:"",label:o.noFilter},...D&&!$?[C(D.param)]:[],...j.map(e=>({value:e.param,label:e.label}))],e=>{if(!e)return T(x,w?.label);const n=j?.find(n=>n.param===e),l=n?.values[0];l&&T(t.withFilter(x,{param:e,value:l.value}),l.label)},!1),j&&D&&z(o.value,D.value,E(($?.values??[]).map(e=>({value:e.value,label:e.label})),D.value),e=>{if(!D)return;const n=$?.values.find(n=>n.value===e);T(t.withFilter(x,{param:D.param,value:e}),n?.label)},($?.values.length??0)>10),M&&/* @__PURE__ */F("p",{className:"es-flink-error",role:"alert",children:o.unsafe}),v.hint&&/* @__PURE__ */F("p",{className:"es-flink-hint",children:v.hint}),j&&/* @__PURE__ */F("p",{className:"es-flink-hint",children:o.filterHint})]})}export{z as FieldText,U as Inspector,W as InspectorField,ee as LinkPicker,G as ListField,q as bucketsOf,B as copyItem,R as insertAt,Q as labelOf,H as moveTo,Z as planFields,A as removeAt};
@@ -8,7 +8,7 @@ import { c as ResolveTrigger, a as ResolveCache, R as ResolvableItem } from '../
8
8
  import * as react from 'react';
9
9
  import { ReactNode, CSSProperties, ComponentType, ReactElement } from 'react';
10
10
  import { b as NodeOpsHost, C as ClipboardEntry } from '../useNodeOps-BF0fQsif.js';
11
- import { I as InspectorFields } from '../types-DQp_i3dE.js';
11
+ import { I as InspectorFields } from '../types-CWxUxPGO.js';
12
12
  import '../buckets-CuLM47h9.js';
13
13
 
14
14
  interface EaselOptions<C extends EaselConfig = EaselConfig> {
@@ -1,8 +1,8 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
3
  import { S as SettingsBucket } from '../buckets-CuLM47h9.js';
4
- import { I as InspectorFields, a as InspectorFieldDef, F as FieldRenderer, b as FieldTextProps, c as FieldNumberProps, d as FieldSliderProps, e as FieldSelectManyProps, f as FieldSelectOneProps, g as FieldOption } from '../types-DQp_i3dE.js';
5
- export { A as ArrayFieldDef, C as CustomFieldDef, h as CustomFieldRenderProps, i as FieldSelectProps, N as NumberFieldDef, O as ObjectFieldDef, R as RadioFieldDef, S as SelectFieldDef, j as SlotFieldDef, T as TextFieldDef, k as TextareaFieldDef } from '../types-DQp_i3dE.js';
4
+ import { I as InspectorFields, a as InspectorFieldDef, F as FieldRenderer, b as FieldTextProps, c as FieldNumberProps, d as FieldSliderProps, e as FieldSelectManyProps, f as FieldSelectOneProps, g as FieldOption } from '../types-CWxUxPGO.js';
5
+ export { A as ArrayFieldDef, C as CustomFieldDef, h as CustomFieldRenderProps, i as FieldSelectProps, N as NumberFieldDef, O as ObjectFieldDef, R as RadioFieldDef, S as SelectFieldDef, j as SlotFieldDef, T as TextFieldDef, k as TextareaFieldDef } from '../types-CWxUxPGO.js';
6
6
  import { R as ResolvableItem } from '../resolve-D68pb3Bx.js';
7
7
  export { F as FieldsWords } from '../words-D8kf071T.js';
8
8
  export { b as LinkFilter, a as LinkFilterField, c as LinkKindChoice, L as LinkOption, d as LinkOptionGroup, e as LinkPicker, f as LinkPickerProps, g as LinkRules, h as LinkTarget } from '../LinkPicker-hPEr1MJx.js';
@@ -374,6 +374,9 @@ declare function optionFor<V>(options: readonly FieldOption<V>[], value: V | und
374
374
  * the chosen option(s). The label stays what a screen reader
375
375
  * reads. Not called while nothing is chosen (the placeholder
376
376
  * shows), nor by a searchable list, whose field is its search.
377
+ * valueText the words read in place of the label when the drawing says
378
+ * something else: `Select`'s `valueText` (efficient-shell
379
+ * 4.180.0). Has no effect without `renderValue`.
377
380
  * readOnly `Select`'s `readOnly`: the read-only ground, focusable, never
378
381
  * opens. A searchable list has no read-only form: `disabled`.
379
382
  *
@@ -1 +1 @@
1
- export{FieldText,Inspector,InspectorField,LinkPicker,ListField,bucketsOf,copyItem,insertAt,labelOf,moveTo,planFields,removeAt}from"../chunk-E2L2XVRX.js";export{FieldSelect,FieldSlider,optionFor}from"../chunk-PJP46U5L.js";import"../chunk-UFY6RNMT.js";import"../chunk-YNOZ5NXW.js";import"../chunk-K56YDHYQ.js";import"../chunk-QTLAVDJE.js";export{useResolvedFields}from"../chunk-YRLPFZW3.js";import"../chunk-EA2HTX37.js";export{FieldNumber}from"../chunk-7SQF6LZL.js";import"../chunk-QLD57GBB.js";import"../chunk-FPOKPNO4.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-VETFIYQR.js";export{FieldSelect,FieldSlider,optionFor}from"../chunk-FOBGSFFS.js";import"../chunk-UFY6RNMT.js";import"../chunk-YNOZ5NXW.js";import"../chunk-K56YDHYQ.js";import"../chunk-QTLAVDJE.js";export{useResolvedFields}from"../chunk-YRLPFZW3.js";import"../chunk-EA2HTX37.js";export{FieldNumber}from"../chunk-7SQF6LZL.js";import"../chunk-QLD57GBB.js";import"../chunk-FPOKPNO4.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-LEGBBCOH.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-LACBURK5.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-PYCLHOSA.js";import"../../chunk-AELNNAFM.js";import"../../chunk-E2L2XVRX.js";import"../../chunk-PJP46U5L.js";import"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-7SQF6LZL.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{AddBlockRow as default}from"../../chunk-4TMMEBAG.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-5TRBCPRB.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-PYCLHOSA.js";import"../../chunk-AELNNAFM.js";import"../../chunk-VETFIYQR.js";import"../../chunk-FOBGSFFS.js";import"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-7SQF6LZL.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{blockKey,AddSidePanel as default,sectionKey,templateKey}from"../../chunk-PT6NPMWV.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-BSSKAEFF.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-LACBURK5.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-E2O2MRZR.js";import"../../chunk-PYCLHOSA.js";import"../../chunk-AELNNAFM.js";import"../../chunk-E2L2XVRX.js";import"../../chunk-PJP46U5L.js";import"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-OXYGFK2B.js";import"../../chunk-ZJEBF4NB.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-7SQF6LZL.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-6HHHBBSY.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-PAELDYYS.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{blockKey,AddSidePanel as default,sectionKey,templateKey}from"../../chunk-TSQUEJZB.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-BSSKAEFF.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-5TRBCPRB.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-E2O2MRZR.js";import"../../chunk-PYCLHOSA.js";import"../../chunk-AELNNAFM.js";import"../../chunk-VETFIYQR.js";import"../../chunk-FOBGSFFS.js";import"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-OXYGFK2B.js";import"../../chunk-ZJEBF4NB.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-7SQF6LZL.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-6HHHBBSY.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-PAELDYYS.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{MediaSidePanel as default}from"../../chunk-PBVC2VGH.js";import"../../chunk-LACBURK5.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-PYCLHOSA.js";import"../../chunk-AELNNAFM.js";import"../../chunk-E2L2XVRX.js";import"../../chunk-PJP46U5L.js";import"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-OXYGFK2B.js";import"../../chunk-ZJEBF4NB.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-7SQF6LZL.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{MediaSidePanel as default}from"../../chunk-6OY2THZH.js";import"../../chunk-5TRBCPRB.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-PYCLHOSA.js";import"../../chunk-AELNNAFM.js";import"../../chunk-VETFIYQR.js";import"../../chunk-FOBGSFFS.js";import"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-OXYGFK2B.js";import"../../chunk-ZJEBF4NB.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-7SQF6LZL.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{ScreenChrome as default}from"../../chunk-IJ3OOBDY.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-ZV6OYSZ7.js";import"../../chunk-FGNR22NY.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-PWZOS45R.js";import"../../chunk-7F52SZOI.js";import"../../chunk-R2HLPNQF.js";import"../../chunk-TBF5CVPA.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-PT6V53OO.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-2JIWFFXA.js";import"../../chunk-IJGHMGG4.js";import"../../chunk-LC7N3GZS.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-HGTPLCTQ.js";import"../../chunk-35Q5HMJZ.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-ONRYLR2D.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-V7U33NF2.js";import"../../chunk-5545A3PC.js";import"../../chunk-PT6NPMWV.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-BSSKAEFF.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-PBVC2VGH.js";import"../../chunk-LACBURK5.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-E2O2MRZR.js";import"../../chunk-PYCLHOSA.js";import"../../chunk-AELNNAFM.js";import"../../chunk-E2L2XVRX.js";import"../../chunk-PJP46U5L.js";import"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-BXMXTO36.js";import"../../chunk-EA2HTX37.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-4VJATVVR.js";import"../../chunk-BDTITTMW.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-OXYGFK2B.js";import"../../chunk-ZJEBF4NB.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-7SQF6LZL.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-6HHHBBSY.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-PAELDYYS.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{ScreenChrome as default}from"../../chunk-UEM66O42.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-ZV6OYSZ7.js";import"../../chunk-FGNR22NY.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-PWZOS45R.js";import"../../chunk-7F52SZOI.js";import"../../chunk-R2HLPNQF.js";import"../../chunk-TBF5CVPA.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-PT6V53OO.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-2JIWFFXA.js";import"../../chunk-VB5LRSGJ.js";import"../../chunk-UAVNI3BU.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-HGTPLCTQ.js";import"../../chunk-35Q5HMJZ.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-ONRYLR2D.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-V7U33NF2.js";import"../../chunk-5545A3PC.js";import"../../chunk-TSQUEJZB.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-BSSKAEFF.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-6OY2THZH.js";import"../../chunk-5TRBCPRB.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-E2O2MRZR.js";import"../../chunk-PYCLHOSA.js";import"../../chunk-AELNNAFM.js";import"../../chunk-VETFIYQR.js";import"../../chunk-FOBGSFFS.js";import"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-BXMXTO36.js";import"../../chunk-EA2HTX37.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-4VJATVVR.js";import"../../chunk-BDTITTMW.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-OXYGFK2B.js";import"../../chunk-ZJEBF4NB.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-7SQF6LZL.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-6HHHBBSY.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-PAELDYYS.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{DocumentScreen,ScreenMount as default}from"../../chunk-6AMS5BQH.js";import"../../chunk-GXQCZJOP.js";import"../../chunk-4CJP57AY.js";import"../../chunk-IJ3OOBDY.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-ZV6OYSZ7.js";import"../../chunk-FGNR22NY.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-PWZOS45R.js";import"../../chunk-7F52SZOI.js";import"../../chunk-R2HLPNQF.js";import"../../chunk-TBF5CVPA.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-PT6V53OO.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-2JIWFFXA.js";import"../../chunk-IJGHMGG4.js";import"../../chunk-LC7N3GZS.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-HGTPLCTQ.js";import"../../chunk-35Q5HMJZ.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-ONRYLR2D.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-V7U33NF2.js";import"../../chunk-5545A3PC.js";import"../../chunk-PT6NPMWV.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-BSSKAEFF.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-PBVC2VGH.js";import"../../chunk-LACBURK5.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-E2O2MRZR.js";import"../../chunk-PYCLHOSA.js";import"../../chunk-AELNNAFM.js";import"../../chunk-E2L2XVRX.js";import"../../chunk-PJP46U5L.js";import"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-BXMXTO36.js";import"../../chunk-EA2HTX37.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-4VJATVVR.js";import"../../chunk-BDTITTMW.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-OXYGFK2B.js";import"../../chunk-ZJEBF4NB.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-7SQF6LZL.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-6HHHBBSY.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-PAELDYYS.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{DocumentScreen,ScreenMount as default}from"../../chunk-RC6DD4XP.js";import"../../chunk-GXQCZJOP.js";import"../../chunk-AAT3O7PK.js";import"../../chunk-UEM66O42.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-ZV6OYSZ7.js";import"../../chunk-FGNR22NY.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-PWZOS45R.js";import"../../chunk-7F52SZOI.js";import"../../chunk-R2HLPNQF.js";import"../../chunk-TBF5CVPA.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-PT6V53OO.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-2JIWFFXA.js";import"../../chunk-VB5LRSGJ.js";import"../../chunk-UAVNI3BU.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-HGTPLCTQ.js";import"../../chunk-35Q5HMJZ.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-ONRYLR2D.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-V7U33NF2.js";import"../../chunk-5545A3PC.js";import"../../chunk-TSQUEJZB.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-BSSKAEFF.js";import"../../chunk-KQMML6JM.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-6OY2THZH.js";import"../../chunk-5TRBCPRB.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-E2O2MRZR.js";import"../../chunk-PYCLHOSA.js";import"../../chunk-AELNNAFM.js";import"../../chunk-VETFIYQR.js";import"../../chunk-FOBGSFFS.js";import"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-BXMXTO36.js";import"../../chunk-EA2HTX37.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-4VJATVVR.js";import"../../chunk-BDTITTMW.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-OXYGFK2B.js";import"../../chunk-ZJEBF4NB.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-7SQF6LZL.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-6HHHBBSY.js";import"../../chunk-O2NLQBFX.js";import"../../chunk-67GNT6PF.js";import"../../chunk-PAELDYYS.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{ScreenStoreProvider as default}from"../../chunk-4CJP57AY.js";import"../../chunk-LACBURK5.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-PYCLHOSA.js";import"../../chunk-AELNNAFM.js";import"../../chunk-E2L2XVRX.js";import"../../chunk-PJP46U5L.js";import"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-7SQF6LZL.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{ScreenStoreProvider as default}from"../../chunk-AAT3O7PK.js";import"../../chunk-5TRBCPRB.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-PYCLHOSA.js";import"../../chunk-AELNNAFM.js";import"../../chunk-VETFIYQR.js";import"../../chunk-FOBGSFFS.js";import"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-7SQF6LZL.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1,16 +1,16 @@
1
- import{AddBlockRow as e}from"../../chunk-LEGBBCOH.js";import{slotChildRowName as n}from"../../chunk-TBF5CVPA.js";import{scrollPreviewToSection as o,gotoPreviewSlide as r}from"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import{useEaselUndoKeys as t}from"../../chunk-PT6V53OO.js";import{SlotChildActionsProvider as s}from"../../chunk-KCBEE2MC.js";import{DEFAULT_PANEL_W as i}from"../../chunk-2JIWFFXA.js";import{usePartBridge as c}from"../../chunk-IJGHMGG4.js";import{useSectionOps as p}from"../../chunk-LC7N3GZS.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import{useScreenDocument as l}from"../../chunk-ONRYLR2D.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import{MediaSidePanel as m}from"../../chunk-PBVC2VGH.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 N,useScreenBlockRules as y}from"../../chunk-LACBURK5.js";import{nestsInTree as S,slotFieldsOf as C}from"../../chunk-PLVEGYK6.js";import{useMediaPanel as O,usePanelPick as x,useCancelPanelPick as A}from"../../chunk-R6WTQWAC.js";import{useHostEscape as B}from"../../chunk-U3JP4VGF.js";import"../../chunk-E2O2MRZR.js";import{useEasel as P}from"../../chunk-PYCLHOSA.js";import"../../chunk-AELNNAFM.js";import"../../chunk-E2L2XVRX.js";import"../../chunk-PJP46U5L.js";import{LayersTree as R,Subtree as L,TreeRow as E,TreeRowAction as v,TreeSeam as H}from"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-BDTITTMW.js";import{saveIndicator as g}from"../../chunk-H6DDIBQ4.js";import{SaveState as z,panelWidthVars as M}from"../../chunk-OXYGFK2B.js";import"../../chunk-ZJEBF4NB.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-7SQF6LZL.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-6HHHBBSY.js";import"../../chunk-O2NLQBFX.js";import{useTreeDrag as T}from"../../chunk-67GNT6PF.js";import"../../chunk-PAELDYYS.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-P2VEMZH5.js";import{zoneKey as F,parseZoneKey as Y}from"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";import{useState as b,useRef as D,useEffect as G,useCallback as w,Fragment as V}from"react";import{Tooltip as X}from"efficient-shell/ui";import{TrashIcon as J}from"efficient-shell/icons/efficient";import{jsxs as W,jsx as Z,Fragment as $}from"react/jsx-runtime";var K=e=>n=>{n.target.closest("button, input")||e()},I={rowClick:K};function Q(){const{saveState:Q,readOnly:U,readOnlyReason:q=null}=l(),_=p(),{appState:ee,selectedItem:ne,config:oe}=P(e=>e),[re,te]=b(d),{first:se,last:ie,panelOf:ce}=a(),pe=ce(se),le=u(),me=h(),de=ee.data.content?.[0]??null,ae=de?.props.id??null,ue=de?.type===se,he=de?.type===ie,ke=D(null),fe=D(null);t(fe);const je=O(),Ne=x(),ye=A();k(ne?.props.id),G(()=>{const e=fe.current;if(!Ne||!e)return;const n=e=>{"Escape"===e.key&&ye()};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)},[Ne]),B(null!==Ne,()=>ye()),G(()=>{ae&&ke.current!==ae&&(ke.current=ae,ue?te(pe??d):ne||_.select({index:0}))},[ae,ne,_,ue]);const Se=w(e=>te(n=>f(n,e)?n:e),[]),Ce=j({kind:re.kind,mode:re,open:Se,show:e=>te(e),reveal:()=>{},select:(e,n)=>{te(e=>f(e,n)?e:n),_.select(e)}}),{selectNode:Oe}=c({mode:re,setMode:te,onOpenPart:o}),xe=N(),{labelAtLevel:Ae,Icon:Be}=xe,{canAddTo:Pe}=y(),Re=e=>oe.components[e]?.label??e,Le=e=>Ae(e,"section",Re(e)),Ee=!ue&&"puck"===re.kind&&ne?.props.id===ae,ve=de?Pe(de.type)?.spec??null:null,He=de&&ve?`${de.props.id}:${ve.slot}`:null,ge=de&&ve&&Array.isArray(de.props[ve.slot])?de.props[ve.slot]:[],ze=e=>n(e,Re,xe.plainText),Me=(e,n)=>{de&&ve&&He&&(te(d),ve.slider?(r(String(de.props.id),e),_.select({index:e,zone:He}),o(String(de.props.id))):(_.select({index:e,zone:He}),o(n)))},Te=()=>{if(!de||!ve||!He)return;const e=ge.length;_.insertComponent(He,ve.childType,e),te(d),ve.slider?requestAnimationFrame(()=>{r(String(de.props.id),e),_.select({index:e,zone:He})}):_.select({index:e,zone:He})},Fe=e=>C(oe,e),Ye=e=>{const{parentId:n,slot:o}=Y(e),r=e=>{if(!e)return null;if(String(e.props.id)===n)return e;for(const n of Fe(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(de)?.props[o];return Array.isArray(t)?t.length:0},be=(e,n,o)=>{const r=Math.min(Math.max(o,0),Ye(e)),t=n<r?r-1:r;t!==n&&(_.reorderComponent(e,n,t),te(d),_.select({index:t,zone:e}))},De=T({keyOf:e=>e.id,readOnly:Boolean(U),canDrop:(e,n)=>F(n)===e.zone&&n.index>=0&&n.index<=Ye(e.zone),onDrop:(e,n)=>be(e.zone,e.index,n.index),onStep:(e,n)=>be(e.zone,e.index,n<0?e.index-1:e.index+2)}),Ge=(e,n)=>/* @__PURE__ */Z(H,{...U?{}:De.seam({place:{...Y(e),index:n}})},`seam:${e}:${n}`),we=e=>xe.blockRowName(e,Re),Ve=(e,n,r)=>{te(d),_.select({index:n,zone:e}),o(r)},Xe=(e,n,o)=>{_.insertComponent(e,n,o),te(d),_.select({index:o,zone:e})},Je=(n,o,r)=>/* @__PURE__ */Z(e,{choices:r,onPick:e=>Xe(n,e,o)}),We=(e,n)=>{const o=Fe((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=Pe(e.type),s=t?.choices??null,i="footer"===t?.source?we:ze;/* @__PURE__ */
2
- return W($,{children:[o.map(({child:e,zone:o,index:r})=>{const t=ne?.props.id===e.props.id,s=S(oe,e.type,n),c=i(e),p=String(e.props.id),l=()=>Ve(o,r,p),{rowProps:m,...a}=De.row({item:{id:p,zone:o,index:r},place:{...Y(o),index:r}},{onClick:K(l)});/* @__PURE__ */
3
- return W(V,{children:[0===r&&Ge(o,0),
4
- /* @__PURE__ */Z(E,{icon:/* @__PURE__ */Z(Be,{type:e.type,size:13}),name:c,selected:t,onSelect:l,...a,actions:/* @__PURE__ */Z(v,{kind:"delete",label:`Delete ${c}`,onClick:()=>{return e=o,n=r,_.removeComponent(e,n),te(d),void _.select(null);var e,n},children:/* @__PURE__ */Z(J,{size:13})}),rowProps:m}),s&&/* @__PURE__ */Z(L,{children:We(e,n+1)}),Ge(o,r+1)]},String(e.props.id??`${o}-${r}`))}),t&&s?Je(`${e.props.id}:${t.slot}`,o.length,s):null]})},Ze="HeroSingle"===de?.type,$e=Boolean(de)&&(Boolean(ve)||he||ue||Ze);/* @__PURE__ */
5
- return W("div",{ref:fe,className:"sf-editor es-editor",style:M(i),children:[
6
- /* @__PURE__ */Z("div",{className:"sf-section-bar",children:/* @__PURE__ */Z(z,null!==q?{tone:"off",label:q,role:"status"}:{...g(Q),role:"status"})}),
7
- /* @__PURE__ */W("div",{className:"sf-body",children:[Ne&&je?/* @__PURE__ */Z("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:/* @__PURE__ */Z(m,{panel:je,pick:Ne})}):$e&&de&&/* @__PURE__ */W("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:[
8
- /* @__PURE__ */Z("div",{className:"sf-panel-head",children:/* @__PURE__ */Z(X,{content:ue?"Header settings":`${Le(de.type)} settings`,side:"bottom",children:/* @__PURE__ */Z("button",{type:"button",className:"sf-panel-title sf-panel-title--btn "+(Ee?"is-selected":""),"aria-pressed":Ee,onClick:()=>{ue?te(pe??d):(te(d),_.select({index:0}))},children:Le(de.type)})})}),
9
- /* @__PURE__ */Z(R,{className:"sf-tree sf-scroll",rootProps:De.rootProps(),children:/* @__PURE__ */Z(L,{children:ue?
10
- /* @__PURE__ */Z(E,{icon:/* @__PURE__ */Z(Be,{type:"header",size:13}),name:"Header settings",selected:re.kind===pe?.kind,onSelect:()=>te(pe??d),rowProps:{onClick:K(()=>te(pe??d))}}):ve?/* @__PURE__ */W($,{children:[ge.map((e,n)=>{const o=ne?.props.id===e.props.id,r=ze(e),t=String(e.props.id),s=()=>Me(n,t),{rowProps:i,...c}=De.row({item:{id:t,zone:He,index:n},place:{...Y(He),index:n}},{onClick:K(s)});/* @__PURE__ */
11
- return W(V,{children:[0===n&&Ge(He,0),
12
- /* @__PURE__ */Z(E,{icon:/* @__PURE__ */Z(Be,{type:e.type,size:13}),name:r,selected:o,onSelect:s,...c,actions:/* @__PURE__ */Z(v,{kind:"delete",label:`Delete ${r}`,onClick:()=>{return e=n,void(He&&(_.removeComponent(He,e),te(d),_.select(null)));var e},children:/* @__PURE__ */Z(J,{size:13})}),rowProps:i}),Ge(He,n+1)]},String(e.props.id??n))}),
13
- /* @__PURE__ */W("button",{type:"button",className:"sf-add-card",onClick:Te,children:[
14
- /* @__PURE__ */Z("span",{className:"sf-plus sf-plus--sm",children:"+"}),ve.addLabel]}),ae?Ce.partRows?.(de,I):null]}):We(de,1)})})]}),
15
- /* @__PURE__ */Z("div",{className:"sf-center",children:/* @__PURE__ */Z("div",{className:"sf-preview-host",children:/* @__PURE__ */Z(le,{})})}),
16
- /* @__PURE__ */Z(s,{value:{selectChild:(e,n,o,r)=>"section"===Pe(r)?.source?Me(n,o):Ve(e,n,o),addChild:(e,n,o,r,t)=>"section"===Pe(t)?.source?Te():Xe(`${e}:${n}`,o,r),childRowName:ze,blockRowName:we},children:/* @__PURE__ */Z(me,{mode:re,onOpenWebsiteSettings:Ce.openSettings??(()=>{}),onSelectNode:Oe,hideNodeActions:!0})})]})]})}export{Q as default};
1
+ import{AddBlockRow as e}from"../../chunk-4TMMEBAG.js";import{slotChildRowName as n}from"../../chunk-TBF5CVPA.js";import{scrollPreviewToSection as o,gotoPreviewSlide as r}from"../../chunk-4ES5JGGX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import{useEaselUndoKeys as t}from"../../chunk-PT6V53OO.js";import{SlotChildActionsProvider as s}from"../../chunk-KCBEE2MC.js";import{DEFAULT_PANEL_W as i}from"../../chunk-2JIWFFXA.js";import{usePartBridge as c}from"../../chunk-VB5LRSGJ.js";import{useSectionOps as p}from"../../chunk-UAVNI3BU.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import{useScreenDocument as l}from"../../chunk-ONRYLR2D.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import{MediaSidePanel as m}from"../../chunk-6OY2THZH.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 N,useScreenBlockRules as y}from"../../chunk-5TRBCPRB.js";import{nestsInTree as S,slotFieldsOf as O}from"../../chunk-PLVEGYK6.js";import{useMediaPanel as B,usePanelPick as C,useCancelPanelPick as R}from"../../chunk-R6WTQWAC.js";import{useHostEscape as A}from"../../chunk-U3JP4VGF.js";import"../../chunk-E2O2MRZR.js";import{useEasel as x}from"../../chunk-PYCLHOSA.js";import"../../chunk-AELNNAFM.js";import"../../chunk-VETFIYQR.js";import"../../chunk-FOBGSFFS.js";import{LayersTree as P,Subtree as T,TreeRow as E,TreeRowAction as F,TreeSeam as v}from"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-BDTITTMW.js";import{saveIndicator as L}from"../../chunk-H6DDIBQ4.js";import{SaveState as H,panelWidthVars as M}from"../../chunk-OXYGFK2B.js";import"../../chunk-ZJEBF4NB.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-7SQF6LZL.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-6HHHBBSY.js";import"../../chunk-O2NLQBFX.js";import{useTreeDrag as Y}from"../../chunk-67GNT6PF.js";import"../../chunk-PAELDYYS.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-P2VEMZH5.js";import{zoneKey as g,parseZoneKey as z}from"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";import{useState as b,useRef as D,useEffect as w,useCallback as V,Fragment as G}from"react";import{Tooltip as W}from"efficient-shell/ui";import{TrashIcon as Z}from"efficient-shell/icons/efficient";import{jsxs as $,jsx as I,Fragment as J}from"react/jsx-runtime";var Q=e=>n=>{n.target.closest("button, input")||e()},X={rowClick:Q};function K(){const{saveState:K,readOnly:U,readOnlyReason:q=null}=l(),_=p(),{appState:ee,selectedItem:ne,config:oe}=x(e=>e),[re,te]=b(d),{first:se,last:ie,panelOf:ce}=a(),pe=ce(se),le=u(),me=h(),de=ee.data.content?.[0]??null,ae=de?.props.id??null,ue=de?.type===se,he=de?.type===ie,ke=D(null),fe=D(null);t(fe);const je=B(),Ne=C(),ye=R();k(ne?.props.id),w(()=>{const e=fe.current;if(!Ne||!e)return;const n=e=>{"Escape"===e.key&&ye()};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)},[Ne]),A(null!==Ne,()=>ye()),w(()=>{ae&&ke.current!==ae&&(ke.current=ae,ue?te(pe??d):ne||_.select({index:0}))},[ae,ne,_,ue]);const Se=V(e=>te(n=>f(n,e)?n:e),[]),Oe=j({kind:re.kind,mode:re,open:Se,show:e=>te(e),reveal:()=>{},select:(e,n)=>{te(e=>f(e,n)?e:n),_.select(e)}}),{selectNode:Be}=c({mode:re,setMode:te,onOpenPart:o}),Ce=N(),{labelAtLevel:Re,Icon:Ae}=Ce,{canAddTo:xe}=y(),Pe=e=>oe.components[e]?.label??e,Te=e=>Re(e,"section",Pe(e)),Ee=!ue&&"puck"===re.kind&&ne?.props.id===ae,Fe=de?xe(de.type)?.spec??null:null,ve=de&&Fe?`${de.props.id}:${Fe.slot}`:null,Le=de&&Fe&&Array.isArray(de.props[Fe.slot])?de.props[Fe.slot]:[],He=e=>n(e,Pe,Ce.plainText),Me=(e,n)=>{de&&Fe&&ve&&(te(d),Fe.slider?(r(String(de.props.id),e),_.select({index:e,zone:ve}),o(String(de.props.id))):(_.select({index:e,zone:ve}),o(n)))},Ye=()=>{if(!de||!Fe||!ve)return;const e=Le.length;_.insertComponent(ve,Fe.childType,e),te(d),Fe.slider?requestAnimationFrame(()=>{r(String(de.props.id),e),_.select({index:e,zone:ve})}):_.select({index:e,zone:ve})},ge=e=>O(oe,e),ze=e=>{const{parentId:n,slot:o}=z(e),r=e=>{if(!e)return null;if(String(e.props.id)===n)return e;for(const n of ge(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(de)?.props[o];return Array.isArray(t)?t.length:0},be=(e,n,o)=>{const r=Math.min(Math.max(o,0),ze(e)),t=n<r?r-1:r;t!==n&&(_.reorderComponent(e,n,t),te(d),_.select({index:t,zone:e}))},De=Y({keyOf:e=>e.id,readOnly:Boolean(U),canDrop:(e,n)=>g(n)===e.zone&&n.index>=0&&n.index<=ze(e.zone),onDrop:(e,n)=>be(e.zone,e.index,n.index),onStep:(e,n)=>be(e.zone,e.index,n<0?e.index-1:e.index+2)}),we=(e,n)=>/* @__PURE__ */I(v,{...U?{}:De.seam({place:{...z(e),index:n}})},`seam:${e}:${n}`),Ve=e=>Ce.blockRowName(e,Pe),Ge=(e,n,r)=>{te(d),_.select({index:n,zone:e}),o(r)},We=(e,n,o)=>{_.insertComponent(e,n,o),te(d),_.select({index:o,zone:e})},Ze=(n,o,r)=>/* @__PURE__ */I(e,{choices:r,onPick:e=>We(n,e,o)}),$e=(e,n)=>{const o=ge((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=xe(e.type),s=t?.choices??null,i="footer"===t?.source?Ve:He;/* @__PURE__ */
2
+ return $(J,{children:[o.map(({child:e,zone:o,index:r})=>{const t=ne?.props.id===e.props.id,s=S(oe,e.type,n),c=i(e),p=String(e.props.id),l=()=>Ge(o,r,p),{rowProps:m,...a}=De.row({item:{id:p,zone:o,index:r},place:{...z(o),index:r}},{onClick:Q(l)});/* @__PURE__ */
3
+ return $(G,{children:[0===r&&we(o,0),
4
+ /* @__PURE__ */I(E,{icon:/* @__PURE__ */I(Ae,{type:e.type,size:13}),name:c,selected:t,onSelect:l,...a,actions:/* @__PURE__ */I(F,{kind:"delete",label:`Delete ${c}`,onClick:()=>{return e=o,n=r,_.removeComponent(e,n),te(d),void _.select(null);var e,n},children:/* @__PURE__ */I(Z,{size:13})}),rowProps:m}),s&&/* @__PURE__ */I(T,{children:$e(e,n+1)}),we(o,r+1)]},String(e.props.id??`${o}-${r}`))}),t&&s?Ze(`${e.props.id}:${t.slot}`,o.length,s):null]})},Ie="HeroSingle"===de?.type,Je=Boolean(de)&&(Boolean(Fe)||he||ue||Ie);/* @__PURE__ */
5
+ return $("div",{ref:fe,className:"sf-editor es-editor",style:M(i),children:[
6
+ /* @__PURE__ */I("div",{className:"sf-section-bar",children:/* @__PURE__ */I(H,null!==q?{tone:"off",label:q,role:"status"}:{...L(K),role:"status"})}),
7
+ /* @__PURE__ */$("div",{className:"sf-body",children:[Ne&&je?/* @__PURE__ */I("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:/* @__PURE__ */I(m,{panel:je,pick:Ne})}):Je&&de&&/* @__PURE__ */$("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:[
8
+ /* @__PURE__ */I("div",{className:"sf-panel-head",children:/* @__PURE__ */I(W,{content:ue?"Header settings":`${Te(de.type)} settings`,side:"bottom",children:/* @__PURE__ */I("button",{type:"button",className:"sf-panel-title sf-panel-title--btn "+(Ee?"is-selected":""),"aria-pressed":Ee,onClick:()=>{ue?te(pe??d):(te(d),_.select({index:0}))},children:Te(de.type)})})}),
9
+ /* @__PURE__ */I(P,{className:"sf-tree sf-scroll",rootProps:De.rootProps(),children:/* @__PURE__ */I(T,{children:ue?
10
+ /* @__PURE__ */I(E,{icon:/* @__PURE__ */I(Ae,{type:"header",size:13}),name:"Header settings",selected:re.kind===pe?.kind,onSelect:()=>te(pe??d),rowProps:{onClick:Q(()=>te(pe??d))}}):Fe?/* @__PURE__ */$(J,{children:[Le.map((e,n)=>{const o=ne?.props.id===e.props.id,r=He(e),t=String(e.props.id),s=()=>Me(n,t),{rowProps:i,...c}=De.row({item:{id:t,zone:ve,index:n},place:{...z(ve),index:n}},{onClick:Q(s)});/* @__PURE__ */
11
+ return $(G,{children:[0===n&&we(ve,0),
12
+ /* @__PURE__ */I(E,{icon:/* @__PURE__ */I(Ae,{type:e.type,size:13}),name:r,selected:o,onSelect:s,...c,actions:/* @__PURE__ */I(F,{kind:"delete",label:`Delete ${r}`,onClick:()=>{return e=n,void(ve&&(_.removeComponent(ve,e),te(d),_.select(null)));var e},children:/* @__PURE__ */I(Z,{size:13})}),rowProps:i}),we(ve,n+1)]},String(e.props.id??n))}),
13
+ /* @__PURE__ */$("button",{type:"button",className:"sf-add-card",onClick:Ye,children:[
14
+ /* @__PURE__ */I("span",{className:"sf-plus sf-plus--sm",children:"+"}),Fe.addLabel]}),ae?Oe.partRows?.(de,X):null]}):$e(de,1)})})]}),
15
+ /* @__PURE__ */I("div",{className:"sf-center",children:/* @__PURE__ */I("div",{className:"sf-preview-host",children:/* @__PURE__ */I(le,{})})}),
16
+ /* @__PURE__ */I(s,{value:{selectChild:(e,n,o,r)=>"section"===xe(r)?.source?Me(n,o):Ge(e,n,o),addChild:(e,n,o,r,t)=>"section"===xe(t)?.source?Ye():We(`${e}:${n}`,o,r),childRowName:He,blockRowName:Ve},children:/* @__PURE__ */I(me,{mode:re,onOpenWebsiteSettings:Oe.openSettings??(()=>{}),onSelectNode:Be,hideNodeActions:!0})})]})]})}export{K as default};
@@ -1 +1 @@
1
- export{usePartBridge}from"../../chunk-IJGHMGG4.js";import"../../chunk-LC7N3GZS.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-LACBURK5.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-PYCLHOSA.js";import"../../chunk-AELNNAFM.js";import"../../chunk-E2L2XVRX.js";import"../../chunk-PJP46U5L.js";import"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-7SQF6LZL.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{usePartBridge}from"../../chunk-VB5LRSGJ.js";import"../../chunk-UAVNI3BU.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-5TRBCPRB.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-PYCLHOSA.js";import"../../chunk-AELNNAFM.js";import"../../chunk-VETFIYQR.js";import"../../chunk-FOBGSFFS.js";import"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-7SQF6LZL.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ZNCEOSXO.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-6AMS5BQH.js";import"../chunk-GXQCZJOP.js";export{ScreenStoreProvider}from"../chunk-4CJP57AY.js";import"../chunk-IJ3OOBDY.js";import"../chunk-26OOWIJJ.js";import"../chunk-ZV6OYSZ7.js";import"../chunk-FGNR22NY.js";import"../chunk-ZE7I3PLX.js";import"../chunk-2GVCAIPX.js";import"../chunk-PWZOS45R.js";import"../chunk-7F52SZOI.js";import"../chunk-R2HLPNQF.js";import"../chunk-TBF5CVPA.js";import"../chunk-4ES5JGGX.js";import"../chunk-IQ5TA7AM.js";import"../chunk-DUVRZ456.js";import"../chunk-6W7WLPZH.js";import"../chunk-PT6V53OO.js";import"../chunk-KCBEE2MC.js";import"../chunk-2JIWFFXA.js";import"../chunk-IJGHMGG4.js";import"../chunk-LC7N3GZS.js";import"../chunk-IYT6NN2J.js";import"../chunk-HGTPLCTQ.js";import"../chunk-35Q5HMJZ.js";import"../chunk-BSPCSC45.js";import"../chunk-I54UCYOU.js";import"../chunk-GOTN2KY4.js";import"../chunk-R5L2E7JX.js";import"../chunk-ONRYLR2D.js";import"../chunk-S4AWJX4Q.js";import"../chunk-ERR437B5.js";import"../chunk-KG7RJWOK.js";import"../chunk-GMCZXMOV.js";export{NO_DOCUMENT_ADDRESSING}from"../chunk-RLBXE4EU.js";import"../chunk-HNKB2ZYR.js";import"../chunk-CLOS6SSX.js";import"../chunk-VPFNZ7TB.js";import"../chunk-LOMEH6DG.js";import"../chunk-V7U33NF2.js";import"../chunk-5545A3PC.js";import"../chunk-PT6NPMWV.js";import"../chunk-5ZBY24K7.js";import"../chunk-PA3PNTVV.js";import"../chunk-BVN33R76.js";import"../chunk-BSSKAEFF.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-PBVC2VGH.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-LACBURK5.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-E2O2MRZR.js";import"../chunk-PYCLHOSA.js";import"../chunk-AELNNAFM.js";import"../chunk-E2L2XVRX.js";import"../chunk-PJP46U5L.js";import"../chunk-UFY6RNMT.js";import"../chunk-YNOZ5NXW.js";import"../chunk-K56YDHYQ.js";import"../chunk-QTLAVDJE.js";import"../chunk-YRLPFZW3.js";import"../chunk-BXMXTO36.js";import"../chunk-EA2HTX37.js";import"../chunk-OSPUG6S6.js";import"../chunk-WK3AFPXY.js";import"../chunk-D2BCHTQR.js";import"../chunk-4VJATVVR.js";import"../chunk-BDTITTMW.js";import"../chunk-H6DDIBQ4.js";import"../chunk-OXYGFK2B.js";import"../chunk-ZJEBF4NB.js";import"../chunk-THWO5YVZ.js";import"../chunk-RE4LP46F.js";import"../chunk-MJM6SFD3.js";import"../chunk-2OAZYSWJ.js";import"../chunk-7SQF6LZL.js";import"../chunk-QLD57GBB.js";import"../chunk-FPOKPNO4.js";import"../chunk-MFIRYGHW.js";import"../chunk-6HHHBBSY.js";import"../chunk-O2NLQBFX.js";import"../chunk-67GNT6PF.js";import"../chunk-PAELDYYS.js";import"../chunk-ZNCEOSXO.js";import"../chunk-P2VEMZH5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
1
+ import"../chunk-GZO72N3Q.js";export{DocumentScreen,ScreenMount}from"../chunk-RC6DD4XP.js";import"../chunk-GXQCZJOP.js";export{ScreenStoreProvider}from"../chunk-AAT3O7PK.js";import"../chunk-UEM66O42.js";import"../chunk-26OOWIJJ.js";import"../chunk-ZV6OYSZ7.js";import"../chunk-FGNR22NY.js";import"../chunk-ZE7I3PLX.js";import"../chunk-2GVCAIPX.js";import"../chunk-PWZOS45R.js";import"../chunk-7F52SZOI.js";import"../chunk-R2HLPNQF.js";import"../chunk-TBF5CVPA.js";import"../chunk-4ES5JGGX.js";import"../chunk-IQ5TA7AM.js";import"../chunk-DUVRZ456.js";import"../chunk-6W7WLPZH.js";import"../chunk-PT6V53OO.js";import"../chunk-KCBEE2MC.js";import"../chunk-2JIWFFXA.js";import"../chunk-VB5LRSGJ.js";import"../chunk-UAVNI3BU.js";import"../chunk-IYT6NN2J.js";import"../chunk-HGTPLCTQ.js";import"../chunk-35Q5HMJZ.js";import"../chunk-BSPCSC45.js";import"../chunk-I54UCYOU.js";import"../chunk-GOTN2KY4.js";import"../chunk-R5L2E7JX.js";import"../chunk-ONRYLR2D.js";import"../chunk-S4AWJX4Q.js";import"../chunk-ERR437B5.js";import"../chunk-KG7RJWOK.js";import"../chunk-GMCZXMOV.js";export{NO_DOCUMENT_ADDRESSING}from"../chunk-RLBXE4EU.js";import"../chunk-HNKB2ZYR.js";import"../chunk-CLOS6SSX.js";import"../chunk-VPFNZ7TB.js";import"../chunk-LOMEH6DG.js";import"../chunk-V7U33NF2.js";import"../chunk-5545A3PC.js";import"../chunk-TSQUEJZB.js";import"../chunk-5ZBY24K7.js";import"../chunk-PA3PNTVV.js";import"../chunk-BVN33R76.js";import"../chunk-BSSKAEFF.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-6OY2THZH.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-5TRBCPRB.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-E2O2MRZR.js";import"../chunk-PYCLHOSA.js";import"../chunk-AELNNAFM.js";import"../chunk-VETFIYQR.js";import"../chunk-FOBGSFFS.js";import"../chunk-UFY6RNMT.js";import"../chunk-YNOZ5NXW.js";import"../chunk-K56YDHYQ.js";import"../chunk-QTLAVDJE.js";import"../chunk-YRLPFZW3.js";import"../chunk-BXMXTO36.js";import"../chunk-EA2HTX37.js";import"../chunk-OSPUG6S6.js";import"../chunk-WK3AFPXY.js";import"../chunk-D2BCHTQR.js";import"../chunk-4VJATVVR.js";import"../chunk-BDTITTMW.js";import"../chunk-H6DDIBQ4.js";import"../chunk-OXYGFK2B.js";import"../chunk-ZJEBF4NB.js";import"../chunk-THWO5YVZ.js";import"../chunk-RE4LP46F.js";import"../chunk-MJM6SFD3.js";import"../chunk-2OAZYSWJ.js";import"../chunk-7SQF6LZL.js";import"../chunk-QLD57GBB.js";import"../chunk-FPOKPNO4.js";import"../chunk-MFIRYGHW.js";import"../chunk-6HHHBBSY.js";import"../chunk-O2NLQBFX.js";import"../chunk-67GNT6PF.js";import"../chunk-PAELDYYS.js";import"../chunk-ZNCEOSXO.js";import"../chunk-P2VEMZH5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{useSectionOps}from"../../../chunk-LC7N3GZS.js";import"../../../chunk-LACBURK5.js";import"../../../chunk-PLVEGYK6.js";import"../../../chunk-R6WTQWAC.js";import"../../../chunk-U3JP4VGF.js";import"../../../chunk-PYCLHOSA.js";import"../../../chunk-AELNNAFM.js";import"../../../chunk-E2L2XVRX.js";import"../../../chunk-PJP46U5L.js";import"../../../chunk-UFY6RNMT.js";import"../../../chunk-YNOZ5NXW.js";import"../../../chunk-K56YDHYQ.js";import"../../../chunk-QTLAVDJE.js";import"../../../chunk-YRLPFZW3.js";import"../../../chunk-EA2HTX37.js";import"../../../chunk-D2BCHTQR.js";import"../../../chunk-7SQF6LZL.js";import"../../../chunk-QLD57GBB.js";import"../../../chunk-FPOKPNO4.js";import"../../../chunk-MFIRYGHW.js";import"../../../chunk-67GNT6PF.js";import"../../../chunk-ZNCEOSXO.js";import"../../../chunk-P2VEMZH5.js";import"../../../chunk-KRXQM65X.js";import"../../../chunk-NKB3KVAB.js";
1
+ export{useSectionOps}from"../../../chunk-UAVNI3BU.js";import"../../../chunk-5TRBCPRB.js";import"../../../chunk-PLVEGYK6.js";import"../../../chunk-R6WTQWAC.js";import"../../../chunk-U3JP4VGF.js";import"../../../chunk-PYCLHOSA.js";import"../../../chunk-AELNNAFM.js";import"../../../chunk-VETFIYQR.js";import"../../../chunk-FOBGSFFS.js";import"../../../chunk-UFY6RNMT.js";import"../../../chunk-YNOZ5NXW.js";import"../../../chunk-K56YDHYQ.js";import"../../../chunk-QTLAVDJE.js";import"../../../chunk-YRLPFZW3.js";import"../../../chunk-EA2HTX37.js";import"../../../chunk-D2BCHTQR.js";import"../../../chunk-7SQF6LZL.js";import"../../../chunk-QLD57GBB.js";import"../../../chunk-FPOKPNO4.js";import"../../../chunk-MFIRYGHW.js";import"../../../chunk-67GNT6PF.js";import"../../../chunk-ZNCEOSXO.js";import"../../../chunk-P2VEMZH5.js";import"../../../chunk-KRXQM65X.js";import"../../../chunk-NKB3KVAB.js";
@@ -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-LACBURK5.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-PYCLHOSA.js";import"../../chunk-AELNNAFM.js";import"../../chunk-E2L2XVRX.js";import"../../chunk-PJP46U5L.js";import"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-7SQF6LZL.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ZNCEOSXO.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-5TRBCPRB.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-PYCLHOSA.js";import"../../chunk-AELNNAFM.js";import"../../chunk-VETFIYQR.js";import"../../chunk-FOBGSFFS.js";import"../../chunk-UFY6RNMT.js";import"../../chunk-YNOZ5NXW.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-QTLAVDJE.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-EA2HTX37.js";import"../../chunk-D2BCHTQR.js";import"../../chunk-7SQF6LZL.js";import"../../chunk-QLD57GBB.js";import"../../chunk-FPOKPNO4.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-ZNCEOSXO.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1,20 +1,20 @@
1
- import{hexReadout as e,ColourWindow as n,typedHex as t}from"../chunk-FPAVNX3Y.js";import{DEFAULT_TEXT_STYLES_WORDS as s}from"../chunk-M6F6LS3H.js";export{DEFAULT_TEXT_STYLES_WORDS}from"../chunk-M6F6LS3H.js";import"../chunk-ZAOM6PFH.js";import{FieldSelect as i,FieldSlider as a}from"../chunk-PJP46U5L.js";import"../chunk-FPOKPNO4.js";import{useWords as l}from"../chunk-MFIRYGHW.js";import{withTip as r}from"../chunk-P2VEMZH5.js";import{hsvToHex as o,Tooltip as d,ColorSwatch as c,IconButton as u}from"efficient-shell/ui";import{useState as m,useRef as f,useId as h,useEffect as p,Fragment as v}from"react";import{ChevronIcon as g,TrashIcon as k,BoldIcon as y,ItalicIcon as b,CaseLowerIcon as x,CaseUpperIcon as w,CaseNormalIcon as S}from"efficient-shell/icons/efficient";import{jsxs as N,jsx as C,Fragment as M}from"react/jsx-runtime";var z=["font","color","size","weight","emphasis","lineSpacing","letterSpacing","paragraphSpacing","letterCase","largestSize"],O=["font","color","size","weight","lineSpacing","letterSpacing","paragraphSpacing","letterCase"],$=["heading","body"],j=7,A={heading:3,body:5},F={min:5,max:void 0,sliderMin:12,sliderMax:72,step:1,shiftStep:10,unit:"px"},L={size:F,weight:{min:100,max:900,sliderMin:300,sliderMax:900,step:100,shiftStep:100,unit:""},lineSpacing:{min:50,max:250,sliderMin:50,sliderMax:250,step:1,shiftStep:10,unit:"%"},letterSpacing:{min:-10,max:void 0,sliderMin:-5,sliderMax:10,step:.1,shiftStep:1,unit:"px"},paragraphSpacing:{min:0,max:void 0,sliderMin:0,sliderMax:48,step:1,shiftStep:10,unit:"px"},largestSize:F},E=(e,n)=>`${"heading"===e?"Heading":"Body"} ${n}`;function W(e=({kind:e,n:n})=>E(e,n)){return $.flatMap(n=>Array.from({length:A[n]},(t,s)=>({id:`${n}-${s+1}`,kind:n,name:e({kind:n,n:s+1}),values:{}})))}function H(e,n,t=j){return e.filter(e=>e.kind===n).length<t}function P(e,n){const t=new RegExp(`^${n}-([1-9]\\d*)$`).exec(e);return t?Number(t[1]):void 0}function B(e){const n=P(e.id,e.kind);return void 0!==n&&n<=A[e.kind]}function D(e,n,t={}){const{max:s=j,name:i=({kind:e,n:n})=>E(e,n),make:a}=t;if(!H(e,n,s))return null;const l=e.filter(e=>e.kind===n);let r=l.length+1;const o=new Set(e.map(e=>e.name));for(;o.has(i({kind:n,n:r}));)r+=1;const d=new Set(e.map(e=>e.id));let c=Math.max(r,...l.map(e=>(P(e.id,n)??0)+1));for(;d.has(`${n}-${c}`);)c+=1;const u=l.at(-1),m=a?a(n,r):{id:`${n}-${c}`,kind:n,name:i({kind:n,n:r}),values:{...u?.values??{}}},f=u?e.indexOf(u)+1:"heading"===n?0:e.length;return{styles:[...e.slice(0,f),m,...e.slice(f)],added:m}}function I(e,n,t={}){const{name:s=({kind:e,n:n})=>E(e,n)}=t,i=e.find(e=>e.id===n);if(!i||B(i))return null;const a=e.filter(e=>e.kind===i.kind),l=a.indexOf(i),r=/* @__PURE__ */new Map;return a.forEach((e,n)=>{n>l&&e.name===s({kind:e.kind,n:n+1})&&r.set(e,s({kind:e.kind,n:n}))}),{styles:e.filter(e=>e!==i).map(e=>r.has(e)?{...e,name:r.get(e)}:e),removed:i}}function R(e,n){const t=e.find(e=>e.id===n);if(t)return t;for(const t of $){const s=P(n,t);if(void 0===s)continue;let i;for(const n of e){const e=n.kind===t?P(n.id,t):void 0;void 0!==e&&e<s&&(!i||e>i.n)&&(i={n:e,style:n})}return i?.style}}function T(e,n,t){return e.map(e=>{if(e.id!==n)return e;const s={...e.values};for(const[e,n]of Object.entries(t))void 0===n?delete s[e]:s[e]=n;return{...e,values:s}})}function q(e){return Math.min(20,Math.max(12,Math.round(.5*e+6)))}function U(e,n){const t=n.weights;return[t.thin,t.extraLight,t.light,t.regular,t.medium,t.semibold,t.bold,t.extraBold,t.black][Math.min(8,Math.max(0,Math.round(e/100)-1))]}function V(e,n,t,s={}){const i=n.find(n=>n.value===e.font)?.label??e.font??"",a=void 0===e.size?s.autoSize?t.auto:"":t.px({n:e.size});return t.summary({font:i,size:a,weight:U(e.weight??400,t)})}var Y=`conic-gradient(${[0,60,120,180,240,300,0].map(e=>o({h:e,s:1,v:1})).join(", ")})`;function _({value:t,hex:s,colours:i,label:a,followsWord:l,anyWord:r,onChange:o,readOnly:u=!1}){const[v,g]=m(!1),k=f(null),y=f(null),b=h(),x=void 0!==t&&i.some(e=>e.key===t),w=void 0!==t&&!x;return p(()=>{if(!v)return;const e=k.current?.ownerDocument;if(!e)return;const n=e=>{k.current&&!k.current.contains(e.target)&&g(!1)};return e.addEventListener("click",n,!0),()=>e.removeEventListener("click",n,!0)},[v]),/* @__PURE__ */N("div",{ref:k,className:"es-ts-set","data-ts-setting":"color",children:[
1
+ import{hexReadout as e,ColourWindow as n,typedHex as t}from"../chunk-FPAVNX3Y.js";import{DEFAULT_TEXT_STYLES_WORDS as s}from"../chunk-M6F6LS3H.js";export{DEFAULT_TEXT_STYLES_WORDS}from"../chunk-M6F6LS3H.js";import"../chunk-ZAOM6PFH.js";import{FieldSelect as i,FieldSlider as a}from"../chunk-FOBGSFFS.js";import"../chunk-FPOKPNO4.js";import{useWords as l}from"../chunk-MFIRYGHW.js";import{withTip as r}from"../chunk-P2VEMZH5.js";import{hsvToHex as o,Tooltip as d,ColorSwatch as c,IconButton as u}from"efficient-shell/ui";import{useState as m,useRef as f,useId as h,useEffect as p,Fragment as v}from"react";import{ChevronIcon as g,TrashIcon as k,BoldIcon as y,ItalicIcon as b,CaseLowerIcon as x,CaseUpperIcon as w,CaseNormalIcon as S}from"efficient-shell/icons/efficient";import{jsxs as N,jsx as C,Fragment as M}from"react/jsx-runtime";var z=["font","color","size","weight","emphasis","lineSpacing","letterSpacing","paragraphSpacing","letterCase","largestSize"],O=["font","color","size","weight","lineSpacing","letterSpacing","paragraphSpacing","letterCase"],$=["heading","body"],F=7,j={heading:3,body:5},A={min:5,max:void 0,sliderMin:12,sliderMax:72,step:1,shiftStep:10,unit:"px"},L={size:A,weight:{min:100,max:900,sliderMin:300,sliderMax:900,step:100,shiftStep:100,unit:""},lineSpacing:{min:50,max:250,sliderMin:50,sliderMax:250,step:1,shiftStep:10,unit:"%"},letterSpacing:{min:-10,max:void 0,sliderMin:-5,sliderMax:10,step:.1,shiftStep:1,unit:"px"},paragraphSpacing:{min:0,max:void 0,sliderMin:0,sliderMax:48,step:1,shiftStep:10,unit:"px"},largestSize:A},E=(e,n)=>`${"heading"===e?"Heading":"Body"} ${n}`;function W(e=({kind:e,n:n})=>E(e,n)){return $.flatMap(n=>Array.from({length:j[n]},(t,s)=>({id:`${n}-${s+1}`,kind:n,name:e({kind:n,n:s+1}),values:{}})))}function B(e,n,t=F){return e.filter(e=>e.kind===n).length<t}function H(e,n){const t=new RegExp(`^${n}-([1-9]\\d*)$`).exec(e);return t?Number(t[1]):void 0}function D(e){const n=H(e.id,e.kind);return void 0!==n&&n<=j[e.kind]}function I(e,n,t={}){const{max:s=F,name:i=({kind:e,n:n})=>E(e,n),make:a}=t;if(!B(e,n,s))return null;const l=e.filter(e=>e.kind===n);let r=l.length+1;const o=new Set(e.map(e=>e.name));for(;o.has(i({kind:n,n:r}));)r+=1;const d=new Set(e.map(e=>e.id));let c=Math.max(r,...l.map(e=>(H(e.id,n)??0)+1));for(;d.has(`${n}-${c}`);)c+=1;const u=l.at(-1),m=a?a(n,r):{id:`${n}-${c}`,kind:n,name:i({kind:n,n:r}),values:{...u?.values??{}}},f=u?e.indexOf(u)+1:"heading"===n?0:e.length;return{styles:[...e.slice(0,f),m,...e.slice(f)],added:m}}function R(e,n,t={}){const{name:s=({kind:e,n:n})=>E(e,n)}=t,i=e.find(e=>e.id===n);if(!i||D(i))return null;const a=e.filter(e=>e.kind===i.kind),l=a.indexOf(i),r=/* @__PURE__ */new Map;return a.forEach((e,n)=>{n>l&&e.name===s({kind:e.kind,n:n+1})&&r.set(e,s({kind:e.kind,n:n}))}),{styles:e.filter(e=>e!==i).map(e=>r.has(e)?{...e,name:r.get(e)}:e),removed:i}}function T(e,n){const t=e.find(e=>e.id===n);if(t)return t;for(const t of $){const s=H(n,t);if(void 0===s)continue;let i;for(const n of e){const e=n.kind===t?H(n.id,t):void 0;void 0!==e&&e<s&&(!i||e>i.n)&&(i={n:e,style:n})}return i?.style}}function P(e,n,t){return e.map(e=>{if(e.id!==n)return e;const s={...e.values};for(const[e,n]of Object.entries(t))void 0===n?delete s[e]:s[e]=n;return{...e,values:s}})}function q(e){return Math.min(20,Math.max(12,Math.round(.5*e+6)))}function V(e,n){const t=n.weights;return[t.thin,t.extraLight,t.light,t.regular,t.medium,t.semibold,t.bold,t.extraBold,t.black][Math.min(8,Math.max(0,Math.round(e/100)-1))]}function Y(e,n,t,s={}){const i=n.find(n=>n.value===e.font)?.label??e.font??"",a=void 0===e.size?s.autoSize?t.auto:"":t.px({n:e.size});return t.summary({font:i,size:a,weight:V(e.weight??400,t)})}var _=`conic-gradient(${[0,60,120,180,240,300,0].map(e=>o({h:e,s:1,v:1})).join(", ")})`;function G({value:t,hex:s,colours:i,label:a,followsWord:l,anyWord:r,onChange:o,readOnly:u=!1}){const[v,g]=m(!1),k=f(null),y=f(null),b=h(),x=void 0!==t&&i.some(e=>e.key===t),w=void 0!==t&&!x;return p(()=>{if(!v)return;const e=k.current?.ownerDocument;if(!e)return;const n=e=>{k.current&&!k.current.contains(e.target)&&g(!1)};return e.addEventListener("click",n,!0),()=>e.removeEventListener("click",n,!0)},[v]),/* @__PURE__ */N("div",{ref:k,className:"es-ts-set","data-ts-setting":"color",children:[
2
2
  /* @__PURE__ */N("div",{className:"es-ts-top",children:[
3
3
  /* @__PURE__ */C("span",{className:"es-ts-sub",children:a}),
4
4
  /* @__PURE__ */C("span",{className:"es-ts-colour-read",children:s?e(s):l})]}),
5
5
  /* @__PURE__ */N("div",{className:"es-ts-swatches",role:"group","aria-label":a,children:[i.map(n=>/* @__PURE__ */C(d,{content:`${n.name} · ${e(n.value)}`,children:/* @__PURE__ */C(c,{color:n.value,size:"sm",className:"es-ts-swatch","aria-label":n.name,selected:t===n.key,disabled:u,onClick:()=>o(n.key)})},n.key)),
6
- /* @__PURE__ */C(d,{content:r,children:/* @__PURE__ */C(c,{ref:y,color:Y,size:"sm",className:"es-ts-swatch es-ts-swatch--any","aria-label":r,selected:w,"aria-expanded":v,"aria-controls":v?b:void 0,disabled:u,onClick:()=>g(e=>!e)})})]}),v?/* @__PURE__ */C(n,{id:b,value:s??"",onChange:e=>o(e),label:a,readOnly:u,onClose:()=>{g(!1),y.current?.focus()}}):null]})}function K({styles:e,onChange:n,fonts:t,colours:i=[],settings:a=O,auto:o=[],fallback:d,sample:c,openId:u,defaultOpenId:y=null,onOpenChange:b,onAdd:x,rowActions:w,onRemove:S,max:M=j,readOnly:A=!1}){const F=l("textStyles",s),L=h(),[E,W]=m(y),P=void 0!==u?u:E,R=e=>{void 0===u&&W(e),b?.(e)},U=new Set(o),Y=z.filter(e=>a.includes(e)),_=f(null),[K,X]=m(null);p(()=>{if(!K||!_.current)return;const e=[..._.current.querySelectorAll(".es-ts-item")].find(e=>e.dataset.tsId===K.id),n=e?e.querySelector(".es-ts-row"):_.current.querySelector(`.es-ts-add[data-ts-kind="${K.kind}"]`);n?.focus(),X(null)},[K]);/* @__PURE__ */
7
- return C("div",{className:"es-ts",ref:_,children:$.map(s=>{const a=e.filter(e=>e.kind===s),l=`${L}-${s}`,o=!H(e,s,M),u=!A&&!o;/* @__PURE__ */
6
+ /* @__PURE__ */C(d,{content:r,children:/* @__PURE__ */C(c,{ref:y,color:_,size:"sm",className:"es-ts-swatch es-ts-swatch--any","aria-label":r,selected:w,"aria-expanded":v,"aria-controls":v?b:void 0,disabled:u,onClick:()=>g(e=>!e)})})]}),v?/* @__PURE__ */C(n,{id:b,value:s??"",onChange:e=>o(e),label:a,readOnly:u,onClose:()=>{g(!1),y.current?.focus()}}):null]})}function K({styles:e,onChange:n,fonts:t,colours:i=[],settings:a=O,auto:o=[],fallback:d,sample:c,openId:u,defaultOpenId:y=null,onOpenChange:b,onAdd:x,rowActions:w,onRemove:S,max:M=F,readOnly:j=!1}){const A=l("textStyles",s),L=h(),[E,W]=m(y),H=void 0!==u?u:E,T=e=>{void 0===u&&W(e),b?.(e)},V=new Set(o),_=z.filter(e=>a.includes(e)),G=f(null),[K,U]=m(null);p(()=>{if(!K||!G.current)return;const e=[...G.current.querySelectorAll(".es-ts-item")].find(e=>e.dataset.tsId===K.id),n=e?e.querySelector(".es-ts-row"):G.current.querySelector(`.es-ts-add[data-ts-kind="${K.kind}"]`);n?.focus(),U(null)},[K]);/* @__PURE__ */
7
+ return C("div",{className:"es-ts",ref:G,children:$.map(s=>{const a=e.filter(e=>e.kind===s),l=`${L}-${s}`,o=!B(e,s,M),u=!j&&!o;/* @__PURE__ */
8
8
  return N("section",{className:"es-ts-section","aria-labelledby":l,children:[
9
- /* @__PURE__ */C("div",{className:"es-ts-group",id:l,children:F.groups[s]}),a.map(s=>{const a=P===s.id,l={...d?.(s)??{},...s.values},o=t.find(e=>e.value===l.font),u=`${L}-open-${s.id}`,m=w?.(s),f=null!=m&&!1!==m,h=Boolean(S)&&!A&&!B(s),p={fontFamily:o?.family,fontSize:`${q(l.size??16)}px`,fontWeight:l.weight,fontStyle:l.italic?"italic":void 0};/* @__PURE__ */
9
+ /* @__PURE__ */C("div",{className:"es-ts-group",id:l,children:A.groups[s]}),a.map(s=>{const a=H===s.id,l={...d?.(s)??{},...s.values},o=t.find(e=>e.value===l.font),u=`${L}-open-${s.id}`,m=w?.(s),f=null!=m&&!1!==m,h=Boolean(S)&&!j&&!D(s),p={fontFamily:o?.family,fontSize:`${q(l.size??16)}px`,fontWeight:l.weight,fontStyle:l.italic?"italic":void 0};/* @__PURE__ */
10
10
  return N(v,{children:[
11
11
  /* @__PURE__ */N("div",{className:"es-ts-item","data-ts-id":s.id,children:[
12
- /* @__PURE__ */N("button",{type:"button",className:"es-ts-row","aria-expanded":a,"aria-controls":a?u:void 0,onClick:()=>R(a?null:s.id),children:[
12
+ /* @__PURE__ */N("button",{type:"button",className:"es-ts-row","aria-expanded":a,"aria-controls":a?u:void 0,onClick:()=>T(a?null:s.id),children:[
13
13
  /* @__PURE__ */C("span",{className:"es-ts-chev","aria-hidden":"true",children:/* @__PURE__ */C(g,{size:12})}),
14
14
  /* @__PURE__ */C("span",{className:"es-ts-name",style:p,children:s.name}),
15
- /* @__PURE__ */C("span",{className:"es-ts-meta",children:V(l,t,F,{autoSize:U.has("size")&&void 0===s.values.size})})]}),h||f?/* @__PURE__ */N("div",{className:"es-ts-actions",children:[h?r(F.remove,/* @__PURE__ */C("button",{type:"button",className:"es-ts-del","aria-label":F.removeNamed({name:s.name}),onClick:()=>(t=>{if(A||!S)return;const s=I(e,t.id,{name:F.styleName});if(!s)return;const i=e.filter(e=>e.kind===t.kind),a=i[i.indexOf(t)+1];P===t.id&&R(null),n(s.styles),S(s.removed),X({id:a?.id??null,kind:t.kind})})(s),children:/* @__PURE__ */C(k,{size:14,"aria-hidden":"true"})})):null,f?m:null]}):null]}),a?/* @__PURE__ */C("div",{className:"es-ts-open",id:u,children:/* @__PURE__ */C(G,{style:s,values:l,fonts:t,colours:i,settings:Y,autoSet:U,sample:c??F.sample,words:F,readOnly:A,set:t=>n(T(e,s.id,t))})}):null]},s.id)}),r(!A&&o?F.full({kind:s,max:M}):void 0,/* @__PURE__ */N("button",{type:"button",className:"es-ts-add","data-ts-kind":s,disabled:A,"aria-disabled":!(A||!o)||void 0,"aria-describedby":!A&&o?`${L}-full-${s}`:void 0,onClick:()=>{u&&(t=>{if(A)return;const s=D(e,t,{max:M,name:F.styleName,make:x});s&&n(s.styles)})(s)},children:[
16
- /* @__PURE__ */C("span",{className:"es-ts-add-word",children:F.add[s]}),
17
- /* @__PURE__ */C("span",{className:"es-ts-count",children:F.count({n:a.length,max:M})})]})),A||!o?null:/* @__PURE__ */C("span",{id:`${L}-full-${s}`,className:"es-vh",children:F.full({kind:s,max:M})})]},s)})})}var X={none:S,upper:w,lower:x},Z={none:"none",upper:"uppercase",lower:"lowercase"};function G({style:e,values:n,fonts:s,colours:i,settings:l,autoSet:o,sample:d,words:c,readOnly:m,set:f}){const h=e.values,p=s.find(e=>e.value===n.font),v=function(e,n){return e?n.find(n=>n.key===e)?.value??t(e)??void 0:void 0}(n.color,i),g=e=>"largestSize"===e||o.has(e),k=e=>g(e)?h[e]:n[e],x=k("size"),w=k("lineSpacing"),S=k("letterSpacing"),z=g("letterCase")?h.letterCase:n.letterCase,O={fontFamily:p?.family,fontSize:void 0===x?void 0:`${x}px`,fontWeight:n.weight,fontStyle:n.italic?"italic":void 0,lineHeight:void 0===w?void 0:String(w/100),letterSpacing:void 0===S?void 0:`${S}px`,color:v,textTransform:z?Z[z]:void 0},$=e=>{const t=L[e],s=g(e);/* @__PURE__ */
15
+ /* @__PURE__ */C("span",{className:"es-ts-meta",children:Y(l,t,A,{autoSize:V.has("size")&&void 0===s.values.size})})]}),h||f?/* @__PURE__ */N("div",{className:"es-ts-actions",children:[h?r(A.remove,/* @__PURE__ */C("button",{type:"button",className:"es-ts-del","aria-label":A.removeNamed({name:s.name}),onClick:()=>(t=>{if(j||!S)return;const s=R(e,t.id,{name:A.styleName});if(!s)return;const i=e.filter(e=>e.kind===t.kind),a=i[i.indexOf(t)+1];H===t.id&&T(null),n(s.styles),S(s.removed),U({id:a?.id??null,kind:t.kind})})(s),children:/* @__PURE__ */C(k,{size:14,"aria-hidden":"true"})})):null,f?m:null]}):null]}),a?/* @__PURE__ */C("div",{className:"es-ts-open",id:u,children:/* @__PURE__ */C(Z,{style:s,values:l,fonts:t,colours:i,settings:_,autoSet:V,sample:c??A.sample,words:A,readOnly:j,set:t=>n(P(e,s.id,t))})}):null]},s.id)}),r(!j&&o?A.full({kind:s,max:M}):void 0,/* @__PURE__ */N("button",{type:"button",className:"es-ts-add","data-ts-kind":s,disabled:j,"aria-disabled":!(j||!o)||void 0,"aria-describedby":!j&&o?`${L}-full-${s}`:void 0,onClick:()=>{u&&(t=>{if(j)return;const s=I(e,t,{max:M,name:A.styleName,make:x});s&&n(s.styles)})(s)},children:[
16
+ /* @__PURE__ */C("span",{className:"es-ts-add-word",children:A.add[s]}),
17
+ /* @__PURE__ */C("span",{className:"es-ts-count",children:A.count({n:a.length,max:M})})]})),j||!o?null:/* @__PURE__ */C("span",{id:`${L}-full-${s}`,className:"es-vh",children:A.full({kind:s,max:M})})]},s)})})}var U={none:S,upper:w,lower:x},X={none:"none",upper:"uppercase",lower:"lowercase"};function Z({style:e,values:n,fonts:s,colours:i,settings:l,autoSet:o,sample:d,words:c,readOnly:m,set:f}){const h=e.values,p=s.find(e=>e.value===n.font),v=function(e,n){return e?n.find(n=>n.key===e)?.value??t(e)??void 0:void 0}(n.color,i),g=e=>"largestSize"===e||o.has(e),k=e=>g(e)?h[e]:n[e],x=k("size"),w=k("lineSpacing"),S=k("letterSpacing"),z=g("letterCase")?h.letterCase:n.letterCase,O={fontFamily:p?.family,fontSize:void 0===x?void 0:`${x}px`,fontWeight:n.weight,fontStyle:n.italic?"italic":void 0,lineHeight:void 0===w?void 0:String(w/100),letterSpacing:void 0===S?void 0:`${S}px`,color:v,textTransform:z?X[z]:void 0},$=e=>{const t=L[e],s=g(e);/* @__PURE__ */
18
18
  return C("div",{className:"es-ts-slider","data-ts-setting":e,children:/* @__PURE__ */C(a,{label:c.settings[e],value:h[e],onChange:n=>f({[e]:n}),min:t.min,max:t.max,step:t.step,shiftStep:t.shiftStep,sliderMin:t.sliderMin,sliderMax:t.sliderMax,unit:t.unit||void 0,styleValue:s?void 0:n[e],auto:s?c.auto:void 0,readOnly:m})},e)};/* @__PURE__ */
19
19
  return N(M,{children:[
20
20
  /* @__PURE__ */C("div",{className:"es-ts-preview",style:O,"aria-label":c.preview,children:d}),l.map(t=>{switch(t){case"font":/* @__PURE__ */
@@ -27,7 +27,7 @@ return C(ee,{value:h.letterCase??n.letterCase,auto:g("letterCase"),words:c,readO
27
27
  return N("div",{className:"es-ts-set","data-ts-setting":"font",children:[
28
28
  /* @__PURE__ */C("span",{className:"es-ts-sub",id:l,children:t.settings.font}),
29
29
  /* @__PURE__ */C(i,{value:e,options:n.map(e=>({label:e.label,value:e.value})),onChange:e=>a({font:e}),ariaLabelledBy:l,readOnly:s})]})}function Q({value:e,hex:n,colours:t,words:s,readOnly:i,set:a}){/* @__PURE__ */
30
- return C(_,{value:e,hex:n,colours:t,label:s.settings.color,followsWord:s.colour.follows,anyWord:s.colour.any,readOnly:i,onChange:e=>a({color:e})})}function ee({value:e,auto:n,words:t,readOnly:s,set:i}){const a=n?["auto","none","upper","lower"]:["none","upper","lower"],l=e??(n?"auto":"none"),o=f([]),d=e=>i({letterCase:"auto"===e?void 0:e});/* @__PURE__ */
30
+ return C(G,{value:e,hex:n,colours:t,label:s.settings.color,followsWord:s.colour.follows,anyWord:s.colour.any,readOnly:i,onChange:e=>a({color:e})})}function ee({value:e,auto:n,words:t,readOnly:s,set:i}){const a=n?["auto","none","upper","lower"]:["none","upper","lower"],l=e??(n?"auto":"none"),o=f([]),d=e=>i({letterCase:"auto"===e?void 0:e});/* @__PURE__ */
31
31
  return N("div",{className:"es-ts-set","data-ts-setting":"letterCase",children:[
32
32
  /* @__PURE__ */C("span",{className:"es-ts-sub",children:t.settings.letterCase}),
33
- /* @__PURE__ */C("div",{className:"es-ts-icons",role:"radiogroup","aria-label":t.settings.letterCase,onKeyDown:e=>{const n="ArrowRight"===e.key||"ArrowDown"===e.key?1:"ArrowLeft"===e.key||"ArrowUp"===e.key?-1:0;if(!n||s)return;e.preventDefault();const t=(a.indexOf(l)+n+a.length)%a.length;d(a[t]),o.current[t]?.focus()},children:a.map((e,n)=>{const i=e===l;if("auto"===e)return r(t.case.autoTitle,/* @__PURE__ */C(u,{ref:e=>{o.current[n]=e},role:"radio",pressed:i,className:"es-ts-icon es-ts-icon--word","aria-checked":i,"aria-label":t.case.auto,tabIndex:i?0:-1,disabled:s,onClick:()=>d(e),children:t.case.auto},e));const a=X[e];return r(t.case[e],/* @__PURE__ */C(u,{ref:e=>{o.current[n]=e},role:"radio",pressed:i,className:"es-ts-icon","aria-checked":i,"aria-label":t.case[e],tabIndex:i?0:-1,disabled:s,onClick:()=>d(e),children:/* @__PURE__ */C(a,{size:16})},e))})})]})}export{O as CAMPAIGN_TEXT_STYLE_SETTINGS,_ as ColourSwatchRow,A as TEXT_STYLE_DEFAULT_COUNT,$ as TEXT_STYLE_KINDS,j as TEXT_STYLE_MAX,L as TEXT_STYLE_RANGES,z as TEXT_STYLE_SETTINGS,K as TextStylesList,D as addTextStyle,H as canAddTextStyle,W as defaultTextStyles,V as describeTextStyle,B as isDefaultTextStyle,I as removeTextStyle,R as resolveTextStyle,q as textStyleRowSize,T as updateTextStyle,U as weightWord};
33
+ /* @__PURE__ */C("div",{className:"es-ts-icons",role:"radiogroup","aria-label":t.settings.letterCase,onKeyDown:e=>{const n="ArrowRight"===e.key||"ArrowDown"===e.key?1:"ArrowLeft"===e.key||"ArrowUp"===e.key?-1:0;if(!n||s)return;e.preventDefault();const t=(a.indexOf(l)+n+a.length)%a.length;d(a[t]),o.current[t]?.focus()},children:a.map((e,n)=>{const i=e===l;if("auto"===e)return r(t.case.autoTitle,/* @__PURE__ */C(u,{ref:e=>{o.current[n]=e},role:"radio",pressed:i,className:"es-ts-icon es-ts-icon--word","aria-checked":i,"aria-label":t.case.auto,tabIndex:i?0:-1,disabled:s,onClick:()=>d(e),children:t.case.auto},e));const a=U[e];return r(t.case[e],/* @__PURE__ */C(u,{ref:e=>{o.current[n]=e},role:"radio",pressed:i,className:"es-ts-icon","aria-checked":i,"aria-label":t.case[e],tabIndex:i?0:-1,disabled:s,onClick:()=>d(e),children:/* @__PURE__ */C(a,{size:16})},e))})})]})}export{O as CAMPAIGN_TEXT_STYLE_SETTINGS,G as ColourSwatchRow,j as TEXT_STYLE_DEFAULT_COUNT,$ as TEXT_STYLE_KINDS,F as TEXT_STYLE_MAX,L as TEXT_STYLE_RANGES,z as TEXT_STYLE_SETTINGS,K as TextStylesList,I as addTextStyle,B as canAddTextStyle,W as defaultTextStyles,Y as describeTextStyle,D as isDefaultTextStyle,R as removeTextStyle,T as resolveTextStyle,q as textStyleRowSize,P as updateTextStyle,V as weightWord};
@@ -131,6 +131,13 @@ interface FieldSelectOneProps<V = unknown> extends FieldSelectBase<V> {
131
131
  onChange: (value: V) => void;
132
132
  /** Draws the closed control's value in place of the chosen label. */
133
133
  renderValue?: (chosen: FieldOption<V> | undefined) => ReactNode;
134
+ /**
135
+ * The words a screen reader reads for what `renderValue` draws, when the
136
+ * drawing says something other than the chosen label (a list that offers
137
+ * "No style" under a box that reads "Custom"). Without it the label is read.
138
+ * Needs efficient-shell 4.180.0; on an older shell the label is still read.
139
+ */
140
+ valueText?: (chosen: FieldOption<V> | undefined) => string;
134
141
  }
135
142
  /**
136
143
  * Several of a set (`multiple`). The value is a list, saved in the order the
@@ -143,6 +150,8 @@ interface FieldSelectManyProps<V = unknown> extends FieldSelectBase<V> {
143
150
  onChange: (value: V[]) => void;
144
151
  /** Draws the closed control's value in place of the labels of what is on. */
145
152
  renderValue?: (on: FieldOption<V>[]) => ReactNode;
153
+ /** The words a screen reader reads for what `renderValue` draws; see the one-of-a-set form. */
154
+ valueText?: (on: FieldOption<V>[]) => string;
146
155
  }
147
156
  type FieldSelectProps<V = unknown> = FieldSelectOneProps<V> | FieldSelectManyProps<V>;
148
157
  interface FieldMeta {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efficient-easel",
3
- "version": "2.0.0",
3
+ "version": "2.2.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",
@@ -517,7 +517,7 @@
517
517
  "dist"
518
518
  ],
519
519
  "peerDependencies": {
520
- "efficient-shell": "^4.171.0",
520
+ "efficient-shell": "^4.171.0 || ^5.0.0",
521
521
  "react": ">=18",
522
522
  "react-dom": ">=18"
523
523
  },
@@ -527,7 +527,7 @@
527
527
  "@types/node": "^22.0.0",
528
528
  "@types/react": "^18.2.0",
529
529
  "@types/react-dom": "^18.2.0",
530
- "efficient-shell": "^4.171.0",
530
+ "efficient-shell": "^4.180.0",
531
531
  "esbuild": "^0.27.0",
532
532
  "jsdom": "^26.1.0",
533
533
  "react": "^18.2.0",
@@ -1,5 +0,0 @@
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-PYCLHOSA.js";import{Inspector as i}from"./chunk-E2L2XVRX.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},S={first:null,last:null,firstGroup:null,lastGroup:null,isSectionGroup:()=>!1,sectionGroupZone:()=>"",panelOf:()=>null};function C(){/* @__PURE__ */
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 D=o({});function G({parts:n,children:e}){/* @__PURE__ */
4
- return s(D.Provider,{value:n,children:e})}function N(){return u(D)}function x(){return(N().useOwnerName??g)()}function A(){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 R(n,e){(N().useDocumentPass??b)(n,e)}function T(){return N().blockRules??L}function F(){return N().blockLook??O}function V(){return N().devices??j}function E(){return N().leftView??w}function H(){return N().pinned??S}function K(){return N().saveSwitch??!0}function W(n){e(!0===N().pickFollowsSelection,n)}function X(){return N().add??h}function Y(){return N().storageNamespace||void 0}function Q(){return N().styleClipboard??null}function Z(){return N().nodeKeys??!0}function q(){return N().notify??null}function z(){return N().Canvas??C}function J(){return N().CanvasHead??null}function M(){return N().canvasDrag??null}var U=o(null);function $({target:n,children:e}){/* @__PURE__ */
5
- return s(U.Provider,{value:n,children:e})}function _(){return u(U)}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,X as useScreenAdd,F as useScreenBlockLook,T as useScreenBlockRules,B as useScreenBridges,M as useScreenCanvasDrag,z as useScreenCanvasFrame,J as useScreenCanvasHead,_ as useScreenCanvasTarget,V as useScreenDevices,A as useScreenDocumentLabel,R as useScreenDocumentPass,nn as useScreenInspectorPanel,E as useScreenLeftView,Z as useScreenNodeKeys,q as useScreenNotify,x as useScreenOwnerName,N as useScreenParts,W as useScreenPickFollowsSelection,H as useScreenPinned,K as useScreenSaveSwitch,Y as useScreenStorageNamespace,Q as useScreenStyleClipboard,I as useStandaloneScreenBridges};
@@ -1,5 +0,0 @@
1
- import{blockTypesIn as e}from"./chunk-5ZBY24K7.js";import{buildPaletteSections as t,pinnedSection as o,paletteWithoutPinned as n,categoryLabel as i}from"./chunk-PA3PNTVV.js";import{sectionTemplatesOf as s}from"./chunk-BVN33R76.js";import{SidePanelHead as r,PanelModeExit as c}from"./chunk-BSSKAEFF.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-LACBURK5.js";import{DEFAULT_SCREEN_WORDS as d}from"./chunk-E2O2MRZR.js";import{useEasel as f}from"./chunk-PYCLHOSA.js";import{useWords as u}from"./chunk-MFIRYGHW.js";import{AddPanel as k}from"./chunk-6HHHBBSY.js";import{useState as h,useEffect as y,useMemo as b}from"react";import{AddIcon as j}from"efficient-shell/icons/efficient";import{jsx as g,jsxs as B,Fragment as $}from"react/jsx-runtime";var O=e=>`section:${e}`,H=e=>`block:${e}`,v=e=>`template:${e}`;function A({blocks:A,blocksOnly:x,at:L,onAdd:R,itemFor:S,session:C,siteWide:F,onClose:I,onHide:V,readOnly:N}){const Y=f(e=>e.config),D=p(),{labelAtLevel:E,categoryLabel:K,firstSection:P,Icon:T,Thumbnail:w}=D,{blockIsOffered:z}=m(),M=u("screen",d).add,Q=l(),[W,Z]=h([]);y(()=>{let t=!1;const o=e=>z(e,Q);return s(Q).list().then(n=>{if(t)return;const i=Y.components;Z(n.filter(t=>t.node?.type&&i[t.node.type]&&e(t.node).every(o)))}).catch(()=>{}),()=>{t=!0}},[Y,Q]);const G=b(()=>t(Y,D),[Y]),J=e=>({type:O(e.type),label:e.name,cover:/* @__PURE__ */g(w,{type:e.type}),title:e.desc?`${e.name} — ${e.desc}`:M.tile({name:e.name}),keywords:[e.alias??"",e.desc,e.type,e.catLabel].filter(Boolean)}),U=b(()=>{const e=[];if(A&&A.choices.length>0&&a(A.choices).forEach((t,o)=>{e.push({key:`blocks:${o}`,title:0===o?`${M.inside({name:A.parentName})}${t.group?` · ${t.group}`:""}`:t.group??"",tiles:t.items.map(e=>({type:H(e.type),label:e.label,icon:/* @__PURE__ */g(T,{type:e.type,size:18}),title:M.tile({name:e.label})}))})}),x)return e;const t=o(G,P);t&&e.push({key:"start",title:M.startBlank,tiles:[J(t)]}),W.length>0&&e.push({key:"templates",title:M.templates,tiles:W.map(e=>{return{type:v(e.id),label:e.name,cover:/* @__PURE__ */g(w,{type:e.node.type}),keywords:[(t=e.node.type,E(t,"section",Y.components[t]?.label??t)),e.node.type]};var t})});const s=n(G,P);for(const t of Object.keys(Y.categories??{})){const o=s.filter(e=>e.cat===t);0!==o.length&&e.push({key:`category:${t}`,title:i(Y,t,K),tiles:o.map(J)})}return e},[A,x,W,G,Y,M]),q=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=W.find(e=>e.id===n);return e?{kind:"template",template:e}:null}return null};/* @__PURE__ */
2
- return B($,{children:[
3
- /* @__PURE__ */g(r,{icon:/* @__PURE__ */g(j,{size:15}),title:M.title,context:x?M.contextBlocks:M.contextAll,actions:/* @__PURE__ */g(c,{label:M.done,description:M.doneDescription,onClick:I}),onHide:V}),
4
- /* @__PURE__ */B("div",{className:"sf-addside sf-scroll",children:[
5
- /* @__PURE__ */g(k,{groups:U,session:C,itemFor:e=>S(q(e)??{kind:"section",type:e}),onInsert:e=>{const t=q(e);t&&R(t)},at:L,hint:x?M.hintBlocks:M.hint,searchLabel:x?M.searchBlocks:M.searchSections,readOnly:N}),F&&!x?F:null]})]})}export{A as AddSidePanel,H as blockKey,O as sectionKey,v as templateKey};