efficient-easel 26.15.0 → 26.16.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 (47) hide show
  1. package/dist/{canvas-typing--FlIZwbT.d.ts → canvas-typing-CD1aeYnk.d.ts} +7 -0
  2. package/dist/{chunk-NUJEHA6A.js → chunk-3W2O22DZ.js} +10 -10
  3. package/dist/{chunk-IHOTVWDE.js → chunk-5U6DUZE2.js} +3 -3
  4. package/dist/{chunk-3ZGOVNVH.js → chunk-6DUCOSHW.js} +1 -1
  5. package/dist/{chunk-PG7G7ELT.js → chunk-BFJAEQZ6.js} +1 -1
  6. package/dist/{chunk-YMK3MZJK.js → chunk-JDQSRKJG.js} +1 -1
  7. package/dist/{chunk-WMC6FE3G.js → chunk-LWFE6QDN.js} +11 -11
  8. package/dist/{chunk-3BQT7FC7.js → chunk-MNQDOSAX.js} +2 -2
  9. package/dist/chunk-OGG6FMBA.js +17 -0
  10. package/dist/chunk-RN5AYO53.js +1 -0
  11. package/dist/chunk-RQO3UDKP.js +8 -0
  12. package/dist/{chunk-2EDOL4IW.js → chunk-T5U2UZO6.js} +35 -35
  13. package/dist/chunk-TXNCWF67.js +4 -0
  14. package/dist/{chunk-7U4HEUZM.js → chunk-W2S2VJOQ.js} +1 -1
  15. package/dist/{chunk-5OYP3C2K.js → chunk-XFI3UPB2.js} +1 -1
  16. package/dist/chunk-YTF65TZA.js +5 -0
  17. package/dist/copy/index.d.ts +2 -2
  18. package/dist/copy/index.js +13 -13
  19. package/dist/easel/index.d.ts +1 -1
  20. package/dist/easel/index.js +1 -1
  21. package/dist/fields/index.js +1 -1
  22. package/dist/screen/components/AddBlockRow.js +1 -1
  23. package/dist/screen/components/AddSidePanel.js +1 -1
  24. package/dist/screen/components/ScreenChrome.js +1 -1
  25. package/dist/screen/components/ScreenMount.js +1 -1
  26. package/dist/screen/components/ScreenStoreProvider.js +1 -1
  27. package/dist/screen/components/SectionScreenShell.js +17 -17
  28. package/dist/screen/components/usePartBridge.js +1 -1
  29. package/dist/screen/index.js +1 -1
  30. package/dist/screen/lib/document/block-set-host.js +1 -1
  31. package/dist/screen/lib/document/block-size-fields.js +1 -1
  32. package/dist/screen/lib/document/box-fields.js +1 -1
  33. package/dist/screen/lib/document/button-fields.js +1 -1
  34. package/dist/screen/lib/document/image-fields.js +5 -5
  35. package/dist/screen/lib/document/shadow-fields.js +2 -2
  36. package/dist/screen/lib/document/style-fields.js +1 -1
  37. package/dist/screen/lib/document/use-section-ops.js +1 -1
  38. package/dist/screen/lib/key-scope.js +1 -1
  39. package/dist/screen/lib/screen-parts.js +1 -1
  40. package/dist/strings/index.js +1 -1
  41. package/dist/text-styles/index.js +1 -1
  42. package/package.json +1 -1
  43. package/dist/chunk-K6TDOXHR.js +0 -17
  44. package/dist/chunk-L4DFCNDQ.js +0 -5
  45. package/dist/chunk-M4SOZEZR.js +0 -4
  46. package/dist/chunk-RWGOCHH7.js +0 -1
  47. package/dist/chunk-VVHDUTAE.js +0 -8
@@ -0,0 +1,17 @@
1
+ import{deviceField as e}from"./chunk-BLE3U2GS.js";import{noControlField as n,NoControlMark as t}from"./chunk-22I55W37.js";import{describedAs as l}from"./chunk-LX23TCTP.js";import{withStyleKind as o}from"./chunk-CWELHADJ.js";import{phoneKey as a}from"./chunk-E52W3M5I.js";import{foldMetaOf as i,FOLD_FIELD_MARKER as r}from"./chunk-ANPOR6EY.js";import{useSelectedHost as s,useEasel as u}from"./chunk-3W2O22DZ.js";import{sidesStartEach as c,SidesInput as d,SidesEachToggle as p}from"./chunk-CLAADE4J.js";import{SettingsDefaultReset as f}from"./chunk-2T22IY3J.js";import{DEFAULT_PANEL_WORDS as b}from"./chunk-56ID6FKZ.js";import{FieldSelect as m}from"./chunk-KFWNGPW3.js";import{SettingsSwitch as h}from"./chunk-OECWLNKJ.js";import{SettingsField as v}from"./chunk-MIX7EGRG.js";import{SettingsSegmented as g}from"./chunk-DX3VILZ3.js";import{useWords as y}from"./chunk-MFIRYGHW.js";import{useState as k}from"react";import{AlignmentIcon as w,BoxJustifyIcon as x,WrapIcon as C,ArrowRightIcon as j,GapIcon as F,WidthIcon as L,PlacementIcon as O,NudgeIcon as S,DesktopIcon as E,BoxXEndIcon as P,BoxXCenterIcon as R,BoxXStartIcon as A,PaddingAllIcon as M,BoxYBetweenIcon as W,BoxYStretchIcon as I,BoxYEndIcon as K,BoxYCenterIcon as B,BoxYStartIcon as $,BoxXBetweenIcon as G,BoxXStretchIcon as N,BoxItemAlignmentIcon as T}from"efficient-shell/icons/efficient";import{textAlignOptions as V,AlignmentGrid as J,PositionInput as D,Slider as H}from"efficient-shell/ui";import{jsx as _,Fragment as z,jsxs as X}from"react/jsx-runtime";var Y=e=>e;function Z(e,n){return e("{value} on desktop").replace("{value}",n)}var U=()=>{};function q(){return null}function Q(e){if(!e.trim())throw new Error("noGlyph() needs a reason naming the ruling that decided it.");/* @__PURE__ */
2
+ return _(q,{},e)}function ee(e){return e.type===q}function ne(e){return ee(e)?void 0:e}function te(e){for(const[n,t]of Object.entries(e))t&&"object"==typeof t&&!i(t)&&o(t,`section:${n}`);return e}function le(e,n){return{type:"custom",[r]:{label:e,level:n},marker:!0,fold:e,render:()=>/* @__PURE__ */_(z,{})}}function oe(e){return le(e,2)}function ae(e){return le(e,1)}var ie=[{label:"Start",value:"start"},{label:"Center",value:"center"},{label:"Space between",value:"between"},{label:"End",value:"end"}],re=[{label:"Start",value:"start"},{label:"Center",value:"center"},{label:"End",value:"end"},{label:"Stretch",value:"stretch"}],se="Wrap",ue=[{label:"Wrap",value:"wrap"},{label:"No wrap",value:"nowrap"}],ce="Direction",de=[{label:"Stacked",value:"column"},{label:"One row",value:"row"}],pe={min:-32,max:64,step:2,builtIn:0},fe={min:30,max:100,step:5,fallback:60},be=["top-left","top-center","top-right","left","center","right","bottom-left","bottom-center","bottom-right"],me="bottom-left",he={"top-left":"Top left","top-center":"Top center","top-right":"Top right",left:"Left",center:"Center",right:"Right","bottom-left":"Bottom left","bottom-center":"Bottom center","bottom-right":"Bottom right"},ve=be.map(e=>({value:e,label:he[e]}));function ge(e,n=me){return be.includes(e)?e:n}var ye=40,ke=e=>"number"==typeof e?e:null;function we(e,n,t){const l={};for(const o of["x","y"])t[o]!==n[o]&&(l[e[o]]=t[o]??void 0);return l}var xe=["top","right","bottom","left"],Ce={top:"sectionPaddingTop",right:"sectionPaddingRight",bottom:"sectionPaddingBottom",left:"sectionPaddingLeft"},je=e=>"number"==typeof e?e:null;function Fe(e,n,t){const l={};for(const o of xe)t[o]!==n[o]&&(l[e[o]]=t[o]??void 0);return l}function Le(e){if("number"==typeof e)return{top:e,right:e,bottom:e,left:e};const n=e&&"object"==typeof e?e:{};return Object.fromEntries(xe.map(e=>[e,je(n[e])]))}function Oe(e){const n={};for(const t of xe)"number"==typeof e[t]&&(n[t]=e[t]);return Object.keys(n).length?n:void 0}function Se(e,n={}){const t=n=>{const t=n[e];return t&&"object"==typeof t?t:{}},l=e=>Object.hasOwn(n,e)?n[e]:e;return{read:(e,n)=>t(e)[l(n)],write:(n,o,a)=>{const i={...t(n)};return void 0===a?delete i[l(o)]:i[l(o)]=a,{[e]:Object.keys(i).length?i:void 0}}}}function Ee(e,n,t){const l=Pe(e),o=s();if(t)return[t.value,t.onChange];const a=o?.values??{};return[e.read(a,n),e=>l([[n,e]])]}function Pe(e){const n=s();return t=>{n&&n.onChangeMany(n=>{let l={};for(const[o,a]of t)l={...l,...e.write({...n,...l},o,a)};return l})}}var Re={read:(e,n)=>e[n],write:(e,n,t)=>({[n]:t})},Ae={fieldKey:a,ownField:!0,read:(e,n)=>e[a(n)],write:(e,n,t)=>({[a(n)]:t})};function Me(e){return{...Se(e),fieldKey:n=>`_${e}_${n}`}}function We({row:e,desktopKey:n,access:t,props:l}){const o=s(),a=o?.values?.[n],[i,r]=Ee(t,n);return t.ownField?e.render({...l,follows:a,twinAccess:t}):e.render({...l,value:i,storedValue:i,follows:a,twinAccess:t,onChange:r})}function Ie(n,t,l=Ae,o={}){const a=o.phoneRow??t,i={...a,render:e=>/* @__PURE__ */_(We,{row:a,desktopKey:n,access:l,props:e})};return{[n]:e("desktop",t),[l.fieldKey(n)]:e("mobile",i)}}var Ke=["left","center","right"];function Be(e,{options:n,value:t,onChange:l,ariaLabel:o,disabled:a=!1}){/* @__PURE__ */
3
+ return _(g,{options:n.map(n=>n.picture?{id:n.value,label:n.picture,title:e(n.title??n.label)}:{id:n.value,label:e(n.label),title:void 0===n.title?void 0:e(n.title)}),value:t,onChange:l,ariaLabel:e(o),disabled:a})}function $e(e,{label:n,value:t,onChange:l,points:o}){const a=o.find(e=>e.disabled),i=o.map(n=>({...n,label:e(n.label),...n.title?{title:e(n.title)}:null}));/* @__PURE__ */
4
+ return _(v,{label:e(n),icon:/* @__PURE__ */_(O,{}),hint:a?.title?e(a.title):void 0,children:/* @__PURE__ */_(J,{label:e(n),value:t,points:i,onChange:l})})}function Ge({say:e,label:n,value:t,onChange:l,pointsFor:o}){const{appState:a,selectedItem:i}=u(e=>e),r=i?.props?.id?String(i.props.id):void 0;return $e(e,{label:n,value:t,onChange:l,points:o(a?.data,r)})}function Ne({say:e,o:n}){const t=s(),l=y("panel",b),o=t?.values??{},a={x:ke(o[n.keys.x]),y:ke(o[n.keys.y])},i=e(n.label??"Position"),r=Boolean(a.x||a.y),u=e=>{const l=we(n.keys,a,e);Object.keys(l).length&&t?.onChangeMany(l)},c=/* @__PURE__ */_(D,{label:i,value:a,onChange:u,words:{x:e("Left and right"),y:e("Up and down"),unit:"px"},placeholder:{x:"0",y:"0"},min:n.min,max:n.max,step:n.step??1}),d=/* @__PURE__ */_(f,{words:l,label:i,changed:r,detail:"0 px, 0 px",onReset:()=>u({x:null,y:null})});return null===n.label?/* @__PURE__ */X("div",{className:"sf-position-line",children:[c,d]}):/* @__PURE__ */_(v,{label:i,icon:/* @__PURE__ */_(S,{}),changed:r,action:d,children:c})}var Te={x:{start:/* @__PURE__ */_(A,{}),center:/* @__PURE__ */_(R,{}),end:/* @__PURE__ */_(P,{}),stretch:/* @__PURE__ */_(N,{}),between:/* @__PURE__ */_(G,{})},y:{start:/* @__PURE__ */_($,{}),center:/* @__PURE__ */_(B,{}),end:/* @__PURE__ */_(K,{}),stretch:/* @__PURE__ */_(I,{}),between:/* @__PURE__ */_(W,{})}},Ve=e=>"row"===e?"row":"column";function Je({say:e,kind:n,label:t,options:l,value:o,onChange:a,o:i}){const r=s(),u="justify"===n==("row"===(i.runs??Ve)(r?.values?.[i.directionKey??"direction"]))?"x":"y";return Be(e,{options:l.map(e=>({label:e.label,value:e.value,picture:Te[u][e.value]})),value:o,onChange:a,ariaLabel:t})}function De(e,n){const t=(e.useFallback??U)(n);return Object.fromEntries(xe.map(n=>[n,t?.[n]??e.fallback[n]]))}function He({say:e,tier:n,o:t,props:l}){const o=De(t,l),a=s(),i=a?.values??{},r="mobile"===n?t.phoneKeys:t.keys,u=Object.fromEntries(xe.map(e=>[e,je(i[r[e]])])),c="mobile"===n?Object.fromEntries(xe.map(e=>[e,je(i[t.keys[e]])])):null;/* @__PURE__ */
5
+ return _(ze,{say:e,o:t,fallback:o,value:u,follows:c,readOnly:l.readOnly,onChange:e=>{const n=Fe(r,u,e);Object.keys(n).length&&a?.onChangeMany(n)}})}function _e({say:e,o:n,props:t}){const l=De(n,t);/* @__PURE__ */
6
+ return _(ze,{say:e,o:n,fallback:l,value:Le(t.value),follows:"follows"in t?Le(t.follows):null,readOnly:t.readOnly,onChange:e=>t.onChange(Oe(e))})}function ze({say:e,o:n,fallback:t,value:l,follows:o,readOnly:a,onChange:i}){const r=Object.fromEntries(xe.map(e=>[e,String(o?.[e]??t[e])])),[s,u]=k(()=>c(l,r)),m=y("panel",b),h=xe.map(e=>r[e]),g=`${1===new Set(h).size?h[0]:h.join(" / ")}px`;/* @__PURE__ */
7
+ return _(v,{label:e(n.label),icon:n.icon??/* @__PURE__ */_(M,{}),action:/* @__PURE__ */X(z,{children:[
8
+ /* @__PURE__ */_(p,{each:s,label:e("Each side"),onChange:u,disabled:a}),
9
+ /* @__PURE__ */_(f,{words:m,label:e(n.label),changed:xe.some(e=>"number"==typeof l[e]),detail:o?Z(e,g):g,disabled:a,onReset:()=>i({top:null,right:null,bottom:null,left:null})})]}),children:/* @__PURE__ */_(d,{label:e(n.label),each:s,value:l,placeholder:r,min:n.min,max:n.max,step:n.step,readOnly:a,onChange:i,words:{sides:{top:e("Padding top"),right:e("Padding right"),bottom:e("Padding bottom"),left:e("Padding left")},vertical:e("Top and bottom"),horizontal:e("Left and right"),unit:"px"}})})}var Xe=e=>""===e||"px"===e?e:` ${e}`;function Ye({label:e,value:n,onChange:t,min:l,max:o,step:a=1,unit:i="",hint:r,emptyLabel:s,inputMax:u,readOnly:c=!1,clears:d,detail:p,resetWords:b}){const m="number"==typeof n,h=d?/* @__PURE__ */_(f,{label:e,changed:m,detail:p??s??(void 0===r?void 0:`${r}${Xe(i)}`),disabled:c,onReset:()=>t(void 0),...b?{words:b}:{}}):void 0;return{track:/* @__PURE__ */_("div",{className:"sf-slider",children:/* @__PURE__ */_(H,{min:l,max:o,step:a,value:n,suffix:i||void 0,showInput:!0,label:e,disabled:c,...d&&void 0!==r?{placeholderValue:r}:{},...s?{emptyLabel:s}:{},...void 0!==u?{inputMax:u}:{},size:"sm",boxSize:"md",className:"sf-slider-track",onChange:e=>{null===e?d&&m&&t(void 0):e!==n&&t(e)}})}),reset:h}}function Ze({caption:e,label:n,value:t,hint:l,emptyLabel:o,...a}){const i=void 0!==l||void 0!==o,r="number"==typeof t,{track:s,reset:u}=Ye({...a,label:n,value:r?t:i?null:a.min,hint:l,emptyLabel:o,clears:i});/* @__PURE__ */
10
+ return _(v,{label:e??n,action:u,children:s})}function Ue({draw:e,props:n,useMax:t,useHint:l}){return e(n,{max:(t??U)(n),hint:(l??U)(n)})}function qe(o=Y){function i(e,n,t,a,i,r,s="",u){const c="function"==typeof u?{action:u}:u??{},{action:d,clear:p}=c,f=(l,u)=>{const f="storedValue"in l?l.storedValue:l.value,b="follows"in l,m=b&&!1!==p?.phoneFollows,h=b||void 0!==p,g="number"==typeof l.value,y=void 0===p?r:u.hint??("function"==typeof p.hint?p.hint(l):p.hint)??r,k=m&&"number"==typeof l.follows?l.follows:y,w=Xe(s),x=!p?.emptyLabel||m&&"number"==typeof l.follows?void 0:p.emptyLabel,C=x??`${k}${w}`,j="function"==typeof c.hint?c.hint(l):c.hint,{track:F,reset:L}=Ye({label:o(e),value:g?l.value:h?null:r,onChange:e=>l.onChange(e),min:t,max:u.max??a,step:i,unit:s,hint:h?k:void 0,emptyLabel:x,inputMax:c.inputMax,readOnly:!0===l.readOnly,clears:h,detail:m?Z(o,C):C});/* @__PURE__ */
11
+ return _(v,{label:o(e),icon:ne(n),hint:void 0===j?void 0:o(j),action:h?L:d?d(f,l.onChange):void 0,children:F})},b=c.useMax,m=p?.useHint;return{type:"custom",...l({},{type:"number",label:e}),render:b||m?e=>/* @__PURE__ */_(Ue,{draw:f,props:e,useMax:b,useHint:m}):e=>f(e,{})}}function r(e){return Be(o,e)}function s(e,n,t,a,i={}){const s=t.map(e=>"string"==typeof e?{label:e,value:e}:e);return{type:"custom",...l({},{type:"radio",label:e,options:s.map(e=>({value:e.value,label:e.label}))}),render:t=>{const{value:l,onChange:u,field:c}=t,d=s.some(e=>e.value===l),p=!0===t.readOnly;if("follows"in t&&!s.some(e=>""===e.value)){const c=i.phoneRest?i.phoneRest(t.follows):t.follows,b=s.find(e=>e.value===c)??s.find(e=>e.value===a);/* @__PURE__ */
12
+ return _(v,{label:o(e),icon:ne(n),action:/* @__PURE__ */_(f,{label:o(e),changed:d,detail:Z(o,o(b?.label??"")),disabled:p,onReset:()=>u(void 0)}),children:r({options:s,value:d?l:b?.value??a,onChange:u,ariaLabel:e,disabled:p})})}const b="follows"in t&&i.followsLabel?i.followsLabel(t.follows):void 0;/* @__PURE__ */
13
+ return _(v,{label:o(e),icon:ne(n),action:"follows"in t&&i.followsLabel?/* @__PURE__ */_(f,{label:o(e),changed:null!=l&&""!==l,detail:void 0===b?void 0:Z(o,o(b)),disabled:p,onReset:()=>u(void 0)}):void 0,children:r({options:s,value:d?l:l||c?.currentValue||a,onChange:u,ariaLabel:e,disabled:p})})}}}function u(e,n){return n.phone?e.unshift({label:"Match desktop",value:"",picture:/* @__PURE__ */_(E,{})}):n.inherit&&e.unshift({label:n.inherit,value:""}),e}function c(e,n){return n.inherit||n.phone?{...e,render:n=>e.render({...n,onChange:e=>n.onChange(""===e?void 0:e)})}:e}function d(n,t,l,o){if(o.access){const e=o.inherit?"":o.fallback??"left",a=l({...o,phone:!1}),i=n=>{const t="string"==typeof n&&""!==n&&a.some(e=>e.value===n)?n:e;return a.find(e=>e.value===t)?.label};return Ie(n,t(o,e),o.access,{phoneRow:t({...o,phone:!0},"",i)})}return{[n]:e("desktop",t(o)),[a(n)]:e("mobile",t({...o,phone:!0},""))}}function p(e){return u(V(e.allow??Ke).map(e=>({label:e.label,value:e.value,picture:e.icon})),e)}function b(e,n=e.fallback??"left",t){return c(s(e.label??"Text alignment",/* @__PURE__ */_(w,{}),p(e),n,t?{followsLabel:t}:{}),e)}function g(e){const n={left:Te.x.start,center:Te.x.center,right:Te.x.end};return u(V((e.allow??Ke).filter(e=>e in n)).map(e=>({label:e.label,value:e.value,picture:n[e.value]})),e)}function y(e,n=e.fallback??"left",t){return c(s(e.label??"Block alignment",/* @__PURE__ */_(x,{}),g(e),n,t?{followsLabel:t}:{}),e)}function k(e,n,t,a,i,r){return{type:"custom",options:a,fallback:i,...l({},{type:"radio",label:n,options:a.map(e=>({value:e.value,label:e.label}))}),render:({value:l,onChange:s,field:u})=>{const c=u.options??a,d=u.fallback??i,p=c.some(e=>e.value===l)?l:d;/* @__PURE__ */
14
+ return _(v,{label:o(n),icon:ne(t),children:/* @__PURE__ */_(Je,{say:o,kind:e,label:n,options:c,value:p,onChange:s,o:r})})}}}function O(e={}){return k("justify","Justify",/* @__PURE__ */_(x,{}),ie,ie[0].value,e)}function S(e={}){return k("align","Item alignment",/* @__PURE__ */_(T,{}),re,"stretch",e)}function P(){const e=se;return{type:"custom",options:ue,fallback:ue[1].value,...l({},{type:"radio",label:e,options:ue.map(e=>({value:e.value,label:e.label}))}),render:({value:n,onChange:t,id:l,name:a})=>{const i=`${l??a??e}-label`;/* @__PURE__ */
15
+ return _(v,{label:o(e),labelId:i,icon:/* @__PURE__ */_(C,{}),action:/* @__PURE__ */_(h,{checked:(r=n,!0===r||"wrap"===r),onChange:e=>t(e?ue[0].value:ue[1].value),ariaLabelledBy:i})});var r}}}function R({offered:e,fallback:n,resolve:t}){const l=t??(t=>e.some(e=>e.value===t)?t:n),o=s(ce,
16
+ /* @__PURE__ */_(j,{}),e.map(e=>({label:e.label,value:e.value})),l(void 0));return{type:"custom",render:e=>o.render({...e,value:l(e.value),onChange:n=>e.onChange(n)})}}function A({min:e,max:n,step:t,builtIn:l,resolve:o,action:a,mark:r}){const s=i("Gap",/* @__PURE__ */_(F,{}),e,n,t,l,"px",a),u=o??(e=>"number"==typeof e?e:l);return{...r,type:"custom",render:e=>s.render({...e,value:u(e.value,e.field),storedValue:e.value,onChange:n=>e.onChange(n)})}}function M(e,{fallback:n=me,pointsFor:t}={}){return{type:"custom",render:({value:l,onChange:a})=>{const i=ge(l,n);return t?/* @__PURE__ */_(Ge,{say:o,label:e,value:i,onChange:a,pointsFor:t}):$e(o,{label:e,value:i,onChange:a,points:ve})}}}function W(e){return{[e.keys.x]:{type:"custom",render:()=>/* @__PURE__ */_(Ne,{say:o,o:e})},[e.keys.y]:{...n({type:"custom",render:()=>/* @__PURE__ */_(t,{})},"always"),reachedBy:e.keys.x}}}function I(l={}){const i={...Ce,...l.keys},r={keys:i,phoneKeys:Object.fromEntries(xe.map(e=>[e,a(i[e])])),fallback:{top:0,right:0,bottom:0,left:0,...l.fallback},useFallback:l.useFallback,label:l.label??"Padding",icon:l.icon,min:l.min??0,max:l.max??200,step:l.step??4},s=!1!==l.phone,u=!1===l.group?{}:{_gSpacing:oe("Padding")};if(l.object){const e={type:"custom",render:e=>/* @__PURE__ */_(_e,{say:o,o:r,props:e})};return te({...u,...s?Ie(l.object.key,e,l.object.phone):{[l.object.key]:e}})}const c=n=>{const t={type:"custom",render:e=>/* @__PURE__ */_(He,{say:o,tier:n,o:r,props:e})};return s?e(n,t):t},d=()=>n({type:"custom",render:()=>/* @__PURE__ */_(t,{})},"always"),p=xe.filter(e=>"top"!==e);return te({...u,[r.keys.top]:c("desktop"),...s?{[r.phoneKeys.top]:c("mobile")}:{},...Object.fromEntries(p.map(e=>[r.keys[e],{...d(),reachedBy:r.keys.top}])),...s?Object.fromEntries(p.map(n=>[r.phoneKeys[n],e("mobile",d())])):{}})}return{slider:i,select:function(e,n,t,a,i){const{note:r,phoneRest:s}="string"==typeof i?{note:i,phoneRest:void 0}:i??{};return{type:"custom",options:t,fallback:a,...r?{note:r}:{},...l({},{type:"select",label:e}),render:l=>{const{value:i,onChange:u,field:c}=l,d=c.options??t,p=c.fallback??a,b=d.some(e=>e.value===i),h="follows"in l,g=h?s?s(l.follows):l.follows:void 0,y=h?d.find(e=>e.value===g)??d.find(e=>e.value===p):void 0,k=b?i:y?.value??p,w=!0===l.readOnly;/* @__PURE__ */
17
+ return _(v,{label:o(e),icon:ne(n),action:h?/* @__PURE__ */_(f,{label:o(e),changed:null!=i&&""!==i,detail:y?Z(o,o(y.label)):void 0,disabled:w,onReset:()=>u(void 0)}):void 0,children:/* @__PURE__ */_(m,{value:k,ariaLabel:o(e),readOnly:w,onChange:u,options:[...r?[{label:o(r),value:"\0note",disabled:!0}]:[],...d.map(e=>({label:o(e.label),value:e.value}))]})})}}},Segmented:r,segmented:s,boxJustifyField:O,boxAlignField:S,boxWrapField:P,directionField:R,gapField:A,placementField:M,PlacementGridView:function(e){return $e(o,e)},positionFields:W,sidesPaddingFields:I,alignmentField:function(e={},n=e.fallback??"left"){return b(e,n)},alignmentFields:function(e="align",n={}){return d(e,b,p,n)},AlignmentStrip:function({opts:e={},value:n,onChange:t,ariaLabel:l,disabled:o=!1}){return r({options:p(e),value:n,onChange:t,ariaLabel:l,disabled:o})},blockAlignmentField:function(e={},n=e.fallback??"left"){return y(e,n)},blockAlignmentFields:function(e="align",n={}){return d(e,y,g,n)},BlockAlignmentStrip:function({opts:e={},value:n,onChange:t,ariaLabel:l,disabled:o=!1}){return r({options:g(e),value:n,onChange:t,ariaLabel:l,disabled:o})},boxFieldSet:function(e={}){const n=e.width??fe,t=e.nudge?.limit??40,l=e.direction??{offered:de,fallback:"column"},o=l.resolve??(e=>l.offered.some(n=>n.value===e)?e:l.fallback),a={runs:e=>"row"===o(e)?"row":"column"};return{_gLayout:oe("Layout"),placement:M("Placement",e.placement),width:i("Width",/* @__PURE__ */_(L,{}),n.min,n.max,n.step,n.fallback,"%"),direction:R(l),gap:A(e.gap??pe),justify:O(a),align:S(a),wrap:P(),_gNudge:oe("Nudge"),...W({keys:e.nudge?.keys??{x:"nudgeX",y:"nudgeY"},min:-t,max:t,label:null}),...I(e.padding)}}}}var{slider:Qe,select:en,Segmented:nn,segmented:tn,boxJustifyField:ln,boxAlignField:on,boxWrapField:an,directionField:rn,gapField:sn,placementField:un,PlacementGridView:cn,positionFields:dn,sidesPaddingFields:pn,alignmentField:fn,alignmentFields:bn,AlignmentStrip:mn,blockAlignmentField:hn,blockAlignmentFields:vn,BlockAlignmentStrip:gn,boxFieldSet:yn}=qe();export{he as ANCHOR_LABELS,mn as AlignmentStrip,re as BOX_ALIGN_POINTS,de as BOX_DIRECTIONS,ce as BOX_DIRECTION_LABEL,pe as BOX_GAP,ie as BOX_JUSTIFY_POINTS,ye as BOX_NUDGE_LIMIT,be as BOX_PLACEMENTS,me as BOX_PLACEMENT_DEFAULT,fe as BOX_WIDTH,se as BOX_WRAP_LABEL,ue as BOX_WRAP_POINTS,gn as BlockAlignmentStrip,Re as FLAT_ACCESS,ve as OPEN_PLACEMENT_POINTS,Ae as PHONE_KEY_ACCESS,cn as PlacementGridView,Ce as SIDE_PAD_KEYS,nn as Segmented,Ze as SliderControl,fn as alignmentField,bn as alignmentFields,hn as blockAlignmentField,vn as blockAlignmentFields,on as boxAlignField,qe as boxFieldBuilders,yn as boxFieldSet,ln as boxJustifyField,an as boxWrapField,rn as directionField,sn as gapField,oe as group,ne as iconOf,ee as isNoGlyph,Q as noGlyph,ge as normaliseBoxPlacement,Se as objectAccess,Z as onDesktopWords,Me as phoneObjectAccess,Ie as phoneTwinFields,un as placementField,dn as positionFields,we as positionPatch,ae as section,tn as segmented,en as select,te as sharedStyleKinds,Le as sidesFromObject,pn as sidesPaddingFields,Fe as sidesPaddingPatch,Oe as sidesToObject,Qe as slider,Pe as useAccessPatch,Ee as useAccessValue};
@@ -0,0 +1 @@
1
+ import{styleFieldBuilders as e,keptByRow as s}from"./chunk-TXNCWF67.js";import{boxFieldBuilders as o,PHONE_KEY_ACCESS as l,phoneTwinFields as r,section as i}from"./chunk-OGG6FMBA.js";import{deviceField as t}from"./chunk-BLE3U2GS.js";import{BUTTON_STYLE_KEYS as c,BUTTON_PAD_KEYS as n}from"./chunk-PLTTPHK5.js";import{TextColorIcon as u,GroundIcon as d}from"efficient-shell/icons/efficient";import{jsx as f}from"react/jsx-runtime";function a(a){const p=o(a.say),F=e(a.say),y=c,m=a.style,k=a.phone??l;return{...a.padding&&{_dSize:i("Size"),...p.sidesPaddingFields({keys:n,group:!1,...a.padding})},_dDesign:i("Design"),[y.fill]:F.colourField({key:y.fill,access:m,label:"Fill color",icon:/* @__PURE__ */f(d,{}),useFollows:a.follows.useFill,usePresets:a.usePresets,resetTo:a.resetTo,opacity:{key:y.fillOpacity,useUnset:a.follows.useFillOpacity}}),[y.fillOpacity]:s(y.fill),[y.border]:F.borderField({key:y.border,access:m,useFollows:a.follows.useBorder}),[y.text]:F.colourField({key:y.text,access:m,label:"Text color",icon:/* @__PURE__ */f(u,{}),useFollows:a.follows.useText,usePresets:a.usePresets,resetTo:a.resetTo}),[y.corners]:F.cornersField({key:y.corners,access:m,sidesKey:y.cornerSides,useFollows:a.follows.useCorners,useFollowsSides:a.follows.useCornerSides}),[y.cornerSides]:s(y.corners),_dLayout:i("Layout"),...r("align",p.blockAlignmentField({phone:!0},""),k),align:t("desktop",p.blockAlignmentField())}}export{a as buttonFieldSet};
@@ -0,0 +1,8 @@
1
+ import{buildPaletteSections as e,pinnedSection as t,categoryLabel as n}from"./chunk-GDO4QJ4G.js";import{blockTypesIn as o}from"./chunk-IZGFJWH4.js";import{sectionTemplatesOf as r}from"./chunk-N7E6264U.js";import{sharedSectionsOf as l}from"./chunk-N3MJOHAG.js";import{SidePanelHead as i,PanelModeExit as s}from"./chunk-SBVIW3KJ.js";import{blockRuns as c}from"./chunk-RUQOIQWI.js";import{useScreenBlockLook as a,useScreenBlockRules as p,useScreenPinned as d}from"./chunk-YTF65TZA.js";import{useEaselSession as m}from"./chunk-YM4UEGBV.js";import{DEFAULT_SCREEN_WORDS as f}from"./chunk-C4TJN6GR.js";import{useEasel as u}from"./chunk-3W2O22DZ.js";import{easelMenuEntries as y}from"./chunk-FIVU2COQ.js";import{useWords as h}from"./chunk-MFIRYGHW.js";import{AddPanel as k}from"./chunk-SQTVXE5D.js";import{DEFAULT_DRAG_WORDS as g}from"./chunk-TQ5Y6S2X.js";import{useState as b,useEffect as v,useMemo as j,useRef as w}from"react";import{SharedIcon as C,AddIcon as O}from"efficient-shell/icons/efficient";import{ContextMenu as T,toast as I,Dialog as $,Button as E}from"efficient-shell/ui";import{jsx as F,jsxs as x,Fragment as G}from"react/jsx-runtime";function S({name:e,pages:t,onDelete:n,onCancel:o}){const r=h("screen",f).shared,[l,i]=b(!1),s=w(null);/* @__PURE__ */
2
+ return F($,{open:!0,role:"alertdialog",size:"sm",title:r.deleteTitle({name:e}),onClose:o,initialFocus:s,footer:/* @__PURE__ */x(G,{children:[
3
+ /* @__PURE__ */F(E,{ref:s,variant:"secondary",onClick:o,children:r.cancel}),
4
+ /* @__PURE__ */F(E,{variant:"danger",loading:l,onClick:()=>{(async()=>{i(!0);try{await n()}finally{i(!1)}})()},children:r.deleteShared})]}),children:r.deleteMessage({count:t})})}var W=e=>`section:${e}`,D=e=>`block:${e}`,M=e=>`template:${e}`,Q=e=>`shared:${e}`,A=e=>`preset:${e}`;function B({at:w,placeBlocks:$,canTake:E,onPick:B,itemFor:H,session:J,siteWide:N,onClose:z,onHide:L,readOnly:R}){const U=u(e=>e.config),V=a(),{labelAtLevel:Y,categoryLabel:Z,firstSection:P,Icon:X,Thumbnail:_}=V,{blockIsOffered:K,canAddTo:q}=p(),ee=h("screen",f).add,te=h("drag",g).add,ne=m(),[oe,re]=b([]);v(()=>{let e=!1;const t=e=>K(e,ne);return r(ne).list().then(n=>{if(e)return;const r=U.components;re(n.filter(e=>e.node?.type&&r[e.node.type]&&o(e.node).every(t)))}).catch(()=>{}),()=>{e=!0}},[U,ne]);const le=d().shared,ie=h("screen",f).shared,[se,ce]=b([]),[ae,pe]=b(0);v(()=>{if(!le)return;let e=!1;const t=e=>K(e,ne);return l(ne).list().then(n=>{if(e)return;const r=U.components;ce(n.filter(e=>e.node?.type&&r[e.node.type]&&o(e.node).every(t)))}).catch(()=>{}),()=>{e=!0}},[U,ne,ae]);const[de,me]=b(null),[fe,ue]=b(null),ye=j(()=>e(U,V),[U]),he=e=>Y(e,"section",U.components[e]?.label??e),ke=e=>({type:e.preset?A(e.preset.key):W(e.type),label:e.name,cover:/* @__PURE__ */F(_,{type:e.type}),title:e.desc?`${e.name} — ${e.desc}`:ee.tile({name:e.name}),keywords:[e.alias??"",e.desc,e.type,e.catLabel].filter(Boolean)}),ge=e=>{const t=e.indexOf(":"),n=e.slice(0,t),o=e.slice(t+1);if("section"===n)return{kind:"section",type:o};if("block"===n)return{kind:"block",type:o};if("template"===n){const e=oe.find(e=>e.id===o);return e?{kind:"template",template:e}:null}if("shared"===n){const e=se.find(e=>e.id===o);return e?{kind:"shared",section:e}:null}if("preset"===n){const e=ye.find(e=>e.preset?.key===o)?.preset;return e?{kind:"preset",preset:e}:null}return null},be=e=>/* @__PURE__ */F("span",{className:"es-add-glyph-cover",children:/* @__PURE__ */F(X,{type:e,size:26})}),ve=j(()=>{const e=t(ye,P),o=/* @__PURE__ */new Map,r=e=>{e.retired||o.has(e.type)||!K(e.type,ne)||o.set(e.type,e)};for(const t of e?[e]:ye.filter(e=>!e.preset)){const e=q(t.type)?.choices??[];e.forEach(r),e.forEach(e=>q(e.type,1)?.choices?.forEach(r))}$?.forEach(r);const l=new Set(ye.filter(e=>!e.preset).map(e=>e.type)),i=[...o.values()].filter(e=>!l.has(e.type)),s=e=>({type:D(e.type),label:e.label,cover:be(e.type),title:ee.tile({name:e.label}),keywords:[e.group??"",e.type].filter(Boolean)}),a=e=>!e.preset&&o.has(e.type)?{...ke(e),cover:be(e.type)}:ke(e),p=[];se.length>0&&p.push({key:"shared",title:ie.group,tiles:se.map(e=>({type:Q(e.id),label:e.title,cover:/* @__PURE__ */F(_,{type:e.node.type}),mark:/* @__PURE__ */F(C,{size:12}),title:ie.onPages({count:e.used_on.length}),keywords:[he(e.node.type),e.node.type]}))}),oe.length>0&&p.push({key:"templates",title:ee.templates,tiles:oe.map(e=>({type:M(e.id),label:e.name,cover:/* @__PURE__ */F(_,{type:e.node.type}),keywords:[he(e.node.type),e.node.type]}))});const d=i.filter(e=>!e.group);let m=!1;for(const t of Object.keys(U.categories??{})){const o=ye.filter(e=>e.cat===t);if(0===o.length)continue;const r=e&&o.some(t=>t.type===e.type)?e:null,l=(r?[r,...o.filter(e=>e.type!==r.type)]:o).map(a);r&&!m&&(l.splice(1,0,...d.map(s)),m=!0),p.push({key:`category:${t}`,title:n(U,t,Z),tiles:l})}const f=p.find(e=>e.key?.startsWith("category:"));if(!m&&f&&d.length>0&&(f.tiles=[...f.tiles,...d.map(s)],m=!0),c(i.filter(e=>e.group||!m)).forEach((e,t)=>{p.push({key:`blocks:${t}`,title:e.group??"",tiles:e.items.map(s)})}),!E)return p;const u=p.map(e=>({...e,tiles:e.tiles.map(e=>{const t=ge(e.type),n=t?E(t):null;return n?{...e,disabled:!0,disabledReason:n}:e})})),y=e=>e.tiles.some(e=>!e.disabled);return[...u.filter(y),...u.filter(e=>!y(e))]},[oe,se,ie,ye,U,ee,E,$,ne]);/* @__PURE__ */
5
+ return x(G,{children:[
6
+ /* @__PURE__ */F(i,{icon:/* @__PURE__ */F(O,{size:15}),title:ee.title,context:ee.contextAll,actions:/* @__PURE__ */F(s,{label:ee.done,description:ee.doneDescription,onClick:z}),onHide:L}),
7
+ /* @__PURE__ */x("div",{className:"sf-addside sf-scroll",children:[
8
+ /* @__PURE__ */F(k,{groups:ve,session:J,itemFor:e=>H(ge(e)??{kind:"section",type:e}),onInsert:B?e=>{const t=ge(e);t&&B(t)}:void 0,onTileMenu:(e,t)=>{const n=ge(e);return"shared"===n?.kind&&!R&&(me({section:n.section,...t}),!0)},at:w,hint:ee.hint,searchLabel:ee.search,readOnly:R,words:te}),N??null]}),de?/* @__PURE__ */F(T,{at:{x:de.x,y:de.y},owner:de.owner,onClose:()=>me(null),"aria-label":de.section.title,items:y([{label:ie.deleteShared,danger:!0,onClick:()=>{ue(de.section),me(null)}}])}):null,fe?/* @__PURE__ */F(S,{name:fe.title,pages:fe.used_on.length,onDelete:()=>(async e=>{try{await l(ne).remove(e.id)}catch{return void I.error(ie.deleteFailed)}ue(null),le?.removed?.(e),ce(t=>t.filter(t=>t.id!==e.id)),pe(e=>e+1)})(fe),onCancel:()=>ue(null)}):null]})}export{B as AddSidePanel,D as blockKey,A as presetKey,W as sectionKey,Q as sharedKey,M as templateKey};
@@ -1,64 +1,64 @@
1
- import{markedTreeNodeId as e,revealSelectedTreeRow as n,sameSelector as t}from"./chunk-UMBNBCL4.js";import{cloneNodeWithFreshIds as o}from"./chunk-OXZDSOZV.js";import{dedupeSlotChildren as r}from"./chunk-7OCEPOEJ.js";import{styleClipboardOf as i}from"./chunk-U4TG43PD.js";import{scrollPreviewToSection as l,gotoPreviewSlide as s}from"./chunk-LUOY3A3Q.js";import{useEaselKeyTarget as d,useEaselUndoKeys as a,useEaselSaveKey as c,editorRootFocus as p}from"./chunk-PG7G7ELT.js";import{SlotChildActionsProvider as u}from"./chunk-KCBEE2MC.js";import{screenStorageKeys as f,DEFAULT_PANEL_W as h,clampPanelWidth as m}from"./chunk-6EDVZBUO.js";import{usePartBridge as g}from"./chunk-5OYP3C2K.js";import{useSectionOps as y}from"./chunk-3ZGOVNVH.js";import{PageEditGuardNotices as b}from"./chunk-MGEXTIZH.js";import{ScreenSaveIcon as v,ScreenMainButton as k}from"./chunk-PVBDKBJB.js";import{useBrowserOffline as S}from"./chunk-RKTF5XLP.js";import{useScreenDocument as w}from"./chunk-CPIWSFGR.js";import{requestMediaPick as x}from"./chunk-JIP5JNRB.js";import{AddChildRow as z}from"./chunk-5545A3PC.js";import{AddSidePanel as C}from"./chunk-VVHDUTAE.js";import{keepsSharedSections as O,sharedSectionsOf as N}from"./chunk-N3MJOHAG.js";import{PanelHideButton as B,SidePanelHead as I,PanelShowStrip as P}from"./chunk-SBVIW3KJ.js";import{offeredChoices as $}from"./chunk-RUQOIQWI.js";import{useScreenSaveSwitch as T,useScreenNodeKeys as M,useScreenPinned as j,useScreenDocumentLabel as E,useScreenCanvasFrame as L,useScreenInspectorPanel as A,useScreenDevices as R,useScreenPickFollowsSelection as D,useScreenLeftView as F,SELECTION_MODE as V,isSelectionMode as H,sameInspectorMode as W,useScreenBridges as U,useScreenBlockRules as J,useScreenBlockLook as Y,useScreenStorageNamespace as G,useScreenNotify as X,useScreenCanvasHead as K,isSlotMode as Q,useScreenStyleClipboard as Z,useScreenDocumentPass as _,useScreenCanvasDrag as q,ScreenCanvasTargetProvider as ee,isPinnedFirst as ne,isPinnedLast as te,screenSlotsOf as oe,shownChildSlotsOf as re}from"./chunk-L4DFCNDQ.js";import{MediaPopup as ie}from"./chunk-T2RINM7R.js";import{useMediaPanel as le,usePanelPick as se,useMediaBrowsing as de,useOpenMediaBrowse as ae,useMediaPlace as ce}from"./chunk-NCXYC7WI.js";import{useNodeClipboard as pe,useNodeContextMenu as ue}from"./chunk-H4TUOPI7.js";import{useEaselSession as fe}from"./chunk-YM4UEGBV.js";import{useEaselHost as he,useHostEscape as me}from"./chunk-LX23TCTP.js";import{LayersIcon as ge,MediaIcon as ye}from"./chunk-XFYFKITX.js";import{DEFAULT_SCREEN_WORDS as be}from"./chunk-C4TJN6GR.js";import{heldStyle as ve,styleShortcut as ke}from"./chunk-CWELHADJ.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as Se}from"./chunk-6WY6ZXJG.js";import{rootRowName as we,slotChildRowName as xe,slotChildRenameProp as ze,sectionRenameProp as Ce}from"./chunk-5NHQ452C.js";import{ROOT_ZONE as Oe,blockNodeActions as Ne,TREE_MAX_DEPTH as Be,childSlotsOf as Ie,slotFieldsOf as Pe,newNodeId as $e,slotChildrenIn as Te,nestsInTree as Me}from"./chunk-TCAAOYQY.js";import{useEasel as je,useEaselApi as Ee,useSettledAction as Le,subscribeLateWrites as Ae,CanvasPartsContext as Re,partHasOwnBox as De,CanvasPassThroughContext as Fe,CanvasSharedContext as Ve}from"./chunk-NUJEHA6A.js";import{TreeRow as He,Subtree as We,LayersTree as Ue,TreeGroupLabel as Je,TreeRowAction as Ye,TreeSeam as Ge}from"./chunk-WHS6Y55E.js";import{DEFAULT_TREE_WORDS as Xe}from"./chunk-K56YDHYQ.js";import{DEFAULT_NODE_MENU_WORDS as Ke}from"./chunk-WK3AFPXY.js";import{toItemSelector as Qe,useNodeOps as Ze,clickPick as _e}from"./chunk-QTHQPJWA.js";import{EaselTopBar as qe,EaselIconButton as en,TopBarCluster as nn,DeviceSwitch as tn,InspectorIconButton as on,PanelResizeHandle as rn,MAX_PANEL_W as ln,MIN_PANEL_W_BY_SIDE as sn,panelWidthVars as dn}from"./chunk-VBEVZZTV.js";import{DEFAULT_NOTICE_WORDS as an,DEFAULT_CHROME_WORDS as cn}from"./chunk-AJSDWWJW.js";import{holderOf as pn,nameOrSomeone as un}from"./chunk-YYD257TD.js";import{DEFAULT_LOCK_WORDS as fn}from"./chunk-RE4LP46F.js";import{useWords as hn}from"./chunk-MFIRYGHW.js";import{insertSeams as mn,CanvasDragLayer as gn,CanvasInsert as yn}from"./chunk-SQTVXE5D.js";import{DEFAULT_DRAG_WORDS as bn}from"./chunk-TQ5Y6S2X.js";import{createDragSession as vn,useTreeDrag as kn,gapToMoveIndex as Sn}from"./chunk-3XECMGXX.js";import{useCanvasFrame as wn,LIST_SELECTOR as xn,BLOCK_SELECTOR as zn,useCanvasTyping as Cn,useCanvasEvent as On}from"./chunk-TOKMFZPB.js";import{nodeIdAt as Nn,frameRectToHost as Bn,BLOCK_ATTRIBUTE as In,drawnBox as Pn}from"./chunk-FR7EEKFF.js";import{queryMainCopy as $n}from"./chunk-7UFKEX72.js";import{ROOT_ID as Tn,ROOT_SLOT as Mn,zoneKey as jn,parseZoneKey as En,find as Ln,DataError as An}from"./chunk-EUFDQ4KL.js";import{useRef as Rn,useMemo as Dn,useState as Fn,useEffect as Vn,useCallback as Hn,useLayoutEffect as Wn,useContext as Un,Fragment as Jn,useId as Yn}from"react";import{ColoredBadge as Gn,Button as Xn,Tabs as Kn,toast as Qn,readMediaFileDrag as Zn,Tooltip as _n,groupColors as qn,Dialog as et,FormField as nt,Input as tt,MEDIA_FILE_DRAG_TYPE as ot}from"efficient-shell/ui";import{UndoIcon as rt,RedoIcon as it,RefreshIcon as lt,AddIcon as st,TrashIcon as dt,EyeOffIcon as at,EyeIcon as ct,SharedIcon as pt,DuplicateIcon as ut}from"efficient-shell/icons/efficient";import{jsx as ft,jsxs as ht,Fragment as mt}from"react/jsx-runtime";var gt="media-file";function yt({name:e,onMake:n,onCancel:t}){const o=hn("screen",be).shared,[r,i]=Fn(e),[l,s]=Fn(!1),d=Yn(),a=Rn(null),c=async()=>{const e=r.trim();if(e&&!l){s(!0);try{await n(e)}finally{s(!1)}}};/* @__PURE__ */
1
+ import{markedTreeNodeId as e,revealSelectedTreeRow as n,sameSelector as t}from"./chunk-UMBNBCL4.js";import{cloneNodeWithFreshIds as o}from"./chunk-OXZDSOZV.js";import{dedupeSlotChildren as r}from"./chunk-7OCEPOEJ.js";import{styleClipboardOf as i}from"./chunk-U4TG43PD.js";import{scrollPreviewToSection as l,gotoPreviewSlide as s}from"./chunk-LUOY3A3Q.js";import{useEaselKeyTarget as d,useEaselUndoKeys as a,useEaselSaveKey as c,editorRootFocus as p}from"./chunk-BFJAEQZ6.js";import{SlotChildActionsProvider as u}from"./chunk-KCBEE2MC.js";import{screenStorageKeys as f,DEFAULT_PANEL_W as h,clampPanelWidth as m}from"./chunk-6EDVZBUO.js";import{usePartBridge as g}from"./chunk-XFI3UPB2.js";import{useSectionOps as y}from"./chunk-6DUCOSHW.js";import{PageEditGuardNotices as b}from"./chunk-MGEXTIZH.js";import{ScreenSaveIcon as v,ScreenMainButton as k}from"./chunk-PVBDKBJB.js";import{useBrowserOffline as S}from"./chunk-RKTF5XLP.js";import{useScreenDocument as w}from"./chunk-CPIWSFGR.js";import{requestMediaPick as x}from"./chunk-JIP5JNRB.js";import{AddChildRow as z}from"./chunk-5545A3PC.js";import{AddSidePanel as C}from"./chunk-RQO3UDKP.js";import{keepsSharedSections as O,sharedSectionsOf as B}from"./chunk-N3MJOHAG.js";import{PanelHideButton as I,SidePanelHead as N,PanelShowStrip as P}from"./chunk-SBVIW3KJ.js";import{offeredChoices as $}from"./chunk-RUQOIQWI.js";import{useScreenSaveSwitch as T,useScreenNodeKeys as M,useScreenPinned as j,useScreenDocumentLabel as E,useScreenCanvasFrame as L,useScreenInspectorPanel as A,useScreenDevices as R,useScreenPickFollowsSelection as F,useScreenLeftView as D,SELECTION_MODE as V,isSelectionMode as W,sameInspectorMode as H,useScreenBridges as U,useScreenBlockRules as J,useScreenBlockLook as X,useScreenStorageNamespace as Y,useScreenNotify as G,useScreenCanvasHead as K,isSlotMode as Q,useScreenStyleClipboard as Z,useScreenDocumentPass as _,useScreenCanvasDrag as q,ScreenCanvasTargetProvider as ee,isPinnedFirst as ne,isPinnedLast as te,screenSlotsOf as oe,shownChildSlotsOf as re}from"./chunk-YTF65TZA.js";import{MediaPopup as ie}from"./chunk-T2RINM7R.js";import{useMediaPanel as le,usePanelPick as se,useMediaBrowsing as de,useOpenMediaBrowse as ae,useMediaPlace as ce}from"./chunk-NCXYC7WI.js";import{useNodeClipboard as pe,useNodeContextMenu as ue}from"./chunk-H4TUOPI7.js";import{useEaselSession as fe}from"./chunk-YM4UEGBV.js";import{useEaselHost as he,useHostEscape as me}from"./chunk-LX23TCTP.js";import{LayersIcon as ge,MediaIcon as ye}from"./chunk-XFYFKITX.js";import{DEFAULT_SCREEN_WORDS as be}from"./chunk-C4TJN6GR.js";import{heldStyle as ve,styleShortcut as ke}from"./chunk-CWELHADJ.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as Se}from"./chunk-6WY6ZXJG.js";import{rootRowName as we,slotChildRowName as xe,slotChildRenameProp as ze,sectionRenameProp as Ce}from"./chunk-5NHQ452C.js";import{ROOT_ZONE as Oe,blockNodeActions as Be,TREE_MAX_DEPTH as Ie,childSlotsOf as Ne,slotFieldsOf as Pe,newNodeId as $e,slotChildrenIn as Te,nestsInTree as Me}from"./chunk-TCAAOYQY.js";import{useEasel as je,useEaselApi as Ee,useSettledAction as Le,subscribeLateWrites as Ae,CanvasPartsContext as Re,partHasOwnBox as Fe,CanvasPassThroughContext as De,CanvasSharedContext as Ve}from"./chunk-3W2O22DZ.js";import{TreeRow as We,Subtree as He,LayersTree as Ue,TreeGroupLabel as Je,TreeRowAction as Xe,TreeSeam as Ye}from"./chunk-WHS6Y55E.js";import{DEFAULT_TREE_WORDS as Ge}from"./chunk-K56YDHYQ.js";import{DEFAULT_NODE_MENU_WORDS as Ke}from"./chunk-WK3AFPXY.js";import{toItemSelector as Qe,useNodeOps as Ze,clickPick as _e}from"./chunk-QTHQPJWA.js";import{EaselTopBar as qe,EaselIconButton as en,TopBarCluster as nn,DeviceSwitch as tn,InspectorIconButton as on,PanelResizeHandle as rn,MAX_PANEL_W as ln,MIN_PANEL_W_BY_SIDE as sn,panelWidthVars as dn}from"./chunk-VBEVZZTV.js";import{DEFAULT_NOTICE_WORDS as an,DEFAULT_CHROME_WORDS as cn}from"./chunk-AJSDWWJW.js";import{holderOf as pn,nameOrSomeone as un}from"./chunk-YYD257TD.js";import{DEFAULT_LOCK_WORDS as fn}from"./chunk-RE4LP46F.js";import{useWords as hn}from"./chunk-MFIRYGHW.js";import{insertSeams as mn,CanvasDragLayer as gn,CanvasInsert as yn}from"./chunk-SQTVXE5D.js";import{DEFAULT_DRAG_WORDS as bn}from"./chunk-TQ5Y6S2X.js";import{createDragSession as vn,useTreeDrag as kn,gapToMoveIndex as Sn}from"./chunk-3XECMGXX.js";import{useCanvasFrame as wn,LIST_SELECTOR as xn,BLOCK_SELECTOR as zn,useCanvasTyping as Cn,useCanvasEvent as On}from"./chunk-TOKMFZPB.js";import{nodeIdAt as Bn,frameRectToHost as In,BLOCK_ATTRIBUTE as Nn,drawnBox as Pn}from"./chunk-FR7EEKFF.js";import{queryMainCopy as $n}from"./chunk-7UFKEX72.js";import{ROOT_ID as Tn,ROOT_SLOT as Mn,zoneKey as jn,parseZoneKey as En,find as Ln,DataError as An}from"./chunk-EUFDQ4KL.js";import{useRef as Rn,useMemo as Fn,useState as Dn,useEffect as Vn,useCallback as Wn,useLayoutEffect as Hn,useContext as Un,Fragment as Jn,useId as Xn}from"react";import{ColoredBadge as Yn,Button as Gn,Tabs as Kn,toast as Qn,readMediaFileDrag as Zn,Tooltip as _n,groupColors as qn,Dialog as et,FormField as nt,Input as tt,MEDIA_FILE_DRAG_TYPE as ot}from"efficient-shell/ui";import{UndoIcon as rt,RedoIcon as it,RefreshIcon as lt,AddIcon as st,TrashIcon as dt,EyeOffIcon as at,EyeIcon as ct,SharedIcon as pt,DuplicateIcon as ut}from"efficient-shell/icons/efficient";import{jsx as ft,jsxs as ht,Fragment as mt}from"react/jsx-runtime";var gt="media-file";function yt({name:e,onMake:n,onCancel:t}){const o=hn("screen",be).shared,[r,i]=Dn(e),[l,s]=Dn(!1),d=Xn(),a=Rn(null),c=async()=>{const e=r.trim();if(e&&!l){s(!0);try{await n(e)}finally{s(!1)}}};/* @__PURE__ */
2
2
  return ft(et,{open:!0,size:"sm",title:o.makeShared,description:o.makeSharedHint,onClose:t,initialFocus:a,footer:/* @__PURE__ */ht(mt,{children:[
3
- /* @__PURE__ */ft(Xn,{variant:"secondary",onClick:t,children:o.cancel}),
4
- /* @__PURE__ */ft(Xn,{variant:"primary",loading:l,disabled:!r.trim(),onClick:()=>{c()},children:o.makeShared})]}),children:/* @__PURE__ */ft("form",{onSubmit:e=>{e.preventDefault(),c()},children:/* @__PURE__ */ft(nt,{label:o.name,htmlFor:d,children:/* @__PURE__ */ft(tt,{id:d,ref:a,value:r,onChange:e=>i(e.target.value)})})})})}var bt=/* @__PURE__ */new WeakSet;function vt(e,n,t){const o=Ln(e,n,t);if(!o)return null;const r=o.path.find(e=>"root"!==e.parentId);return r?r.parentId:t}function kt(e,n,t){const o=o=>o>=t.left&&o+e.width<=t.left+t.width&&n.every(n=>n.right<=o||n.left>=o+e.width||n.bottom<=e.top||n.top>=e.top+e.height);if(n.every(n=>n.right<=e.left||n.left>=e.left+e.width||n.bottom<=e.top||n.top>=e.top+e.height))return e.left;const r=n.map(e=>e.right+4).filter(n=>n>e.left&&o(n));if(r.length)return Math.min(...r);const i=n.map(n=>n.left-4-e.width).filter(n=>n<e.left&&o(n));return i.length?Math.max(...i):e.left}function St({canvas:e,tabs:n,onSelect:t,onPointer:o}){const r=Rn(null),[i,l]=Fn({}),s=Rn({id:null,places:{},measure:null});s.current.places=i;const d=!(null===s.current.id||n.some(e=>e.id===s.current.id)&&i[s.current.id]);Vn(()=>{d&&(s.current.id=null,o(null))},[d,o]),Vn(()=>()=>{null!==s.current.id&&o(null)},[o]);const a=n.map(e=>`${e.id}:${e.below?1:e.above?2:0}:${e.label}:${e.reach??""}`).join("|");return Wn(()=>{const t=e?.document,o=e?.window,i=e?.frame;if(!t||!o||!i||0===n.length)return void l(e=>0===Object.keys(e).length?e:{});let d=0;const a=()=>{d=0;const e=r.current;if(!e)return;const a=Bn(i,{left:0,top:0,width:o.innerWidth,height:o.innerHeight},e),p={};let u=!1;const f=e.getBoundingClientRect(),h=[...e.parentElement?.querySelectorAll(".es-canvas-handle.is-shown:not(.is-dragging), .es-canvas-tag, .es-canvas-hint")??[]].map(e=>{const n=e.getBoundingClientRect();return{left:n.left-f.left,top:n.top-f.top,right:n.right-f.left,bottom:n.bottom-f.top}});for(const r of n){const n=o.CSS?.escape?o.CSS.escape(r.id):JSON.stringify(r.id).slice(1,-1),l=$n(t,`[${In}="${n}"]`),d=l?Pn(l):null;if(!d||0===d.height){p[r.id]=null;continue}const c=Bn(i,{left:d.left,top:d.top,width:d.width,height:d.height},e),f=c.top+c.height;if(f<a.top||c.top>a.top+a.height){p[r.id]=null;continue}const m=!0===r.above&&c.top-4>a.top,g=r.below?f+4:m?c.top-4:Math.max(c.top,a.top)+6,y=e.querySelector(`[data-band-tab="${n}"]`);y||(u=!0);const b=Math.max(c.left,a.left)+(r.above?0:6),v=y?.offsetHeight??0,k=y?.offsetWidth??0,S=m?g-v:g,w=s.current.id===r.id?s.current.places[r.id]:null,x=w?w.left:kt({left:b,top:S,width:k,height:v},h,a);k>0&&v>0&&h.push({left:x,top:S,right:x+k,bottom:S+v}),p[r.id]={left:x,top:g,above:m}}l(e=>function(e,n){const t=Object.keys(e);return t.length===Object.keys(n).length&&t.every(t=>{const o=e[t],r=n[t];return o===r||!!o&&!!r&&o.left===r.left&&o.top===r.top&&o.above===r.above})}(e,p)?e:p),u&&c()},c=()=>{d||(d=o.requestAnimationFrame(a))};s.current.measure=c,a(),o.addEventListener("scroll",c,!0),o.addEventListener("resize",c);const p=new o.MutationObserver(c);p.observe(t.body,{childList:!0,subtree:!0,attributes:!0});const u=r.current?.parentElement,f=u?.ownerDocument.defaultView?.MutationObserver,h=f?new f(c):null;return u&&h?.observe(u,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","style"]}),()=>{d&&o.cancelAnimationFrame(d),o.removeEventListener("scroll",c,!0),o.removeEventListener("resize",c),p.disconnect(),h?.disconnect(),s.current.measure=null}},[e,a]),/* @__PURE__ */ft("div",{ref:r,className:"es-band-tabs","aria-hidden":"true",children:n.map(e=>{const n=i[e.id];return n?/* @__PURE__ */ft("span",{className:"es-band-tab"+(n.above?" is-above":""),"data-band-tab":e.id,style:{left:n.left,top:n.top},onMouseEnter:()=>{s.current.id=e.id,o(e.id)},onMouseLeave:()=>{s.current.id=null,o(null),s.current.measure?.()},onClick:n=>{n.stopPropagation(),t(e.id)},children:e.reach?
5
- /* @__PURE__ */ft(_n,{content:e.reach,children:/* @__PURE__ */ht(Gn,{colorClass:qn("success","solid"),size:"sm",children:[
6
- /* @__PURE__ */ft("span",{className:"es-band-tab-mark",children:/* @__PURE__ */ft(pt,{size:12})}),e.label]})}):/* @__PURE__ */ft(Gn,{colorClass:qn("info","solid"),size:"sm",children:e.label})},e.id):null})})}function wt({expand:e}){/* @__PURE__ */
3
+ /* @__PURE__ */ft(Gn,{variant:"secondary",onClick:t,children:o.cancel}),
4
+ /* @__PURE__ */ft(Gn,{variant:"primary",loading:l,disabled:!r.trim(),onClick:()=>{c()},children:o.makeShared})]}),children:/* @__PURE__ */ft("form",{onSubmit:e=>{e.preventDefault(),c()},children:/* @__PURE__ */ft(nt,{label:o.name,htmlFor:d,children:/* @__PURE__ */ft(tt,{id:d,ref:a,value:r,onChange:e=>i(e.target.value)})})})})}var bt=/* @__PURE__ */new WeakSet;function vt(e,n,t){const o=Ln(e,n,t);if(!o)return null;const r=o.path.find(e=>"root"!==e.parentId);return r?r.parentId:t}function kt(e,n,t){const o=o=>o>=t.left&&o+e.width<=t.left+t.width&&n.every(n=>n.right<=o||n.left>=o+e.width||n.bottom<=e.top||n.top>=e.top+e.height);if(n.every(n=>n.right<=e.left||n.left>=e.left+e.width||n.bottom<=e.top||n.top>=e.top+e.height))return e.left;const r=n.map(e=>e.right+4).filter(n=>n>e.left&&o(n));if(r.length)return Math.min(...r);const i=n.map(n=>n.left-4-e.width).filter(n=>n<e.left&&o(n));return i.length?Math.max(...i):e.left}function St({canvas:e,tabs:n,onSelect:t,onPointer:o}){const r=Rn(null),[i,l]=Dn({}),s=Rn({id:null,places:{},measure:null});s.current.places=i;const d=!(null===s.current.id||n.some(e=>e.id===s.current.id)&&i[s.current.id]);Vn(()=>{d&&(s.current.id=null,o(null))},[d,o]),Vn(()=>()=>{null!==s.current.id&&o(null)},[o]);const a=n.map(e=>`${e.id}:${e.below?1:e.above?2:0}:${e.label}:${e.reach??""}`).join("|");return Hn(()=>{const t=e?.document,o=e?.window,i=e?.frame;if(!t||!o||!i||0===n.length)return void l(e=>0===Object.keys(e).length?e:{});let d=0;const a=()=>{d=0;const e=r.current;if(!e)return;const a=In(i,{left:0,top:0,width:o.innerWidth,height:o.innerHeight},e),p={};let u=!1;const f=e.getBoundingClientRect(),h=[...e.parentElement?.querySelectorAll(".es-canvas-handle.is-shown:not(.is-dragging), .es-canvas-tag, .es-canvas-hint")??[]].map(e=>{const n=e.getBoundingClientRect();return{left:n.left-f.left,top:n.top-f.top,right:n.right-f.left,bottom:n.bottom-f.top}});for(const r of n){const n=o.CSS?.escape?o.CSS.escape(r.id):JSON.stringify(r.id).slice(1,-1),l=$n(t,`[${Nn}="${n}"]`),d=l?Pn(l):null;if(!d||0===d.height){p[r.id]=null;continue}const c=In(i,{left:d.left,top:d.top,width:d.width,height:d.height},e),f=c.top+c.height;if(f<a.top||c.top>a.top+a.height){p[r.id]=null;continue}const m=!0===r.above&&c.top-4>a.top,g=r.below?f+4:m?c.top-4:Math.max(c.top,a.top)+6,y=e.querySelector(`[data-band-tab="${n}"]`);y||(u=!0);const b=Math.max(c.left,a.left)+(r.above?0:6),v=y?.offsetHeight??0,k=y?.offsetWidth??0,S=m?g-v:g,w=s.current.id===r.id?s.current.places[r.id]:null,x=w?w.left:kt({left:b,top:S,width:k,height:v},h,a);k>0&&v>0&&h.push({left:x,top:S,right:x+k,bottom:S+v}),p[r.id]={left:x,top:g,above:m}}l(e=>function(e,n){const t=Object.keys(e);return t.length===Object.keys(n).length&&t.every(t=>{const o=e[t],r=n[t];return o===r||!!o&&!!r&&o.left===r.left&&o.top===r.top&&o.above===r.above})}(e,p)?e:p),u&&c()},c=()=>{d||(d=o.requestAnimationFrame(a))};s.current.measure=c,a(),o.addEventListener("scroll",c,!0),o.addEventListener("resize",c);const p=new o.MutationObserver(c);p.observe(t.body,{childList:!0,subtree:!0,attributes:!0});const u=r.current?.parentElement,f=u?.ownerDocument.defaultView?.MutationObserver,h=f?new f(c):null;return u&&h?.observe(u,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","style"]}),()=>{d&&o.cancelAnimationFrame(d),o.removeEventListener("scroll",c,!0),o.removeEventListener("resize",c),p.disconnect(),h?.disconnect(),s.current.measure=null}},[e,a]),/* @__PURE__ */ft("div",{ref:r,className:"es-band-tabs","aria-hidden":"true",children:n.map(e=>{const n=i[e.id];return n?/* @__PURE__ */ft("span",{className:"es-band-tab"+(n.above?" is-above":""),"data-band-tab":e.id,style:{left:n.left,top:n.top},onMouseEnter:()=>{s.current.id=e.id,o(e.id)},onMouseLeave:()=>{s.current.id=null,o(null),s.current.measure?.()},onClick:n=>{n.stopPropagation(),t(e.id)},children:e.reach?
5
+ /* @__PURE__ */ft(_n,{content:e.reach,children:/* @__PURE__ */ht(Yn,{colorClass:qn("success","solid"),size:"sm",children:[
6
+ /* @__PURE__ */ft("span",{className:"es-band-tab-mark",children:/* @__PURE__ */ft(pt,{size:12})}),e.label]})}):/* @__PURE__ */ft(Yn,{colorClass:qn("info","solid"),size:"sm",children:e.label})},e.id):null})})}function wt({expand:e}){/* @__PURE__ */
7
7
  return ft("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */ht(mt,e?{children:[
8
8
  /* @__PURE__ */ft("path",{d:"M8 9l4-4 4 4"}),
9
9
  /* @__PURE__ */ft("path",{d:"M8 15l4 4 4-4"})]}:{children:[
10
10
  /* @__PURE__ */ft("path",{d:"M8 4l4 4 4-4"}),
11
11
  /* @__PURE__ */ft("path",{d:"M8 20l4-4 4 4"}),
12
- /* @__PURE__ */ft("path",{d:"M5 12h14"})]})})}var xt=`${xn}, ${zn}`;function zt(e,n,t){const o=t-n;if(o<6)return null;if(o<24)return{top:Math.round((n+t)/2),height:Math.round(o)};return{top:Math.round(Math.min(Math.max(e,n+12),t-12))}}var Ct="__rungs",Ot=e=>"template"===e.kind?e.template.id:"shared"===e.kind?e.section.id:"preset"===e.kind?e.preset.key:e.type;var Nt="screen:band",Bt={duplicate:!0,delete:!0},It=()=>null;function Pt(){const xn=he(),Bn=xn.panels?.Toolbar,In=(xn.panels?.useRight??It)(),{target:Pn,docId:Yn,capabilities:_n,currentSlug:qn,siteId:et,onPublish:nt,saveState:tt,saveConflict:pt,retrySave:kt,toggleAutoSave:Pt,flushSave:$t,access:Tt,saveUnreachable:Mt=!1,readOnly:jt,readOnlyReason:Et=null}=w(),Lt=T(),At=M(),{mediaEditing:Rt,hasEditGuard:Dt,hasPinnedChrome:Ft}=_n,{appState:Vt,dispatch:Ht,history:Wt,selectedItem:Ut,getSelectorForId:Jt,config:Yt}=je(e=>e),Gt=j(),{first:Xt,firstGroup:Kt,lastGroup:Qt,isSectionGroup:Zt,sectionGroupZone:_t,panelOf:qt}=Gt,eo=qt(Xt),no=e=>ne(Gt,e),to=e=>te(Gt,e),oo="node"===Gt.firstRow,ro=Gt.band??null,io=hn("screen",be),lo=hn("tree",Xe),so=hn("drag",bn),ao=hn("notice",an),co=hn("lock",fn),po=hn("menu",Ke),uo=hn("styleClipboard",Se),fo=hn("chrome",cn),ho=E()??`/${qn}`,mo=L(),go=A(),yo=y({readOnly:jt}),bo=y({readOnly:jt,foldIntoHistory:!0}),vo=Rn(null),ko=Ee(),So=Dn(()=>({...yo,select:e=>{vo.current=e,yo.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=ko.config;vo.current=Qe(e,t,n)}yo.commitDocument(e,n)}}),[yo,ko]),wo=Vt.ui,xo=wo.leftSideBarVisible,zo=wo.rightSideBarVisible,{options:Co,widths:Oo,initial:No,fluid:Bo,fit:Io}=R(),[Po,$o]=Fn(No),To=le(),Mo=Rt&&null!==To;se(),de();const jo=ae();D(Ut?.props.id);const{read:Eo,write:Lo,forSelection:Ao}=F(),[Ro,Do]=Fn(Eo);Vn(()=>{Lo(Ro)},[Ro]);const[Fo,Vo]=Fn(0),Ho=Rn(null),Wo=Rn(null),Uo=wn(Wo,{readySelector:xt}),Jo=Cn(Uo),Yo=d(Wo);a(Wo,Uo);const Go=S(),Xo=pn(Tt),Ko={state:tt,offline:Go||tt.failed&&Mt,readOnlyReason:Et,editing:Xo?ao.editing({name:un(Xo.name,co),noun:io.noun}):null,conflict:null!=pt,notSaving:io.bar.notSaving},Qo=Le({onPress:()=>{jt||(tt.failed?kt():$t())}}).onPress;c(Wo,Uo,Qo);const[Zo,_o]=Fn(!1),qo=Rn(!1),[er,nr]=Fn(null),[tr,or]=Fn([]),[rr,ir]=Fn(V);H(rr);const lr=e(rr,Ut?.props.id),[sr,dr]=Fn(null);Vn(()=>{sr&&(n(),dr(null))},[sr]);const ar=Rn(Jt);ar.current=Jt;const cr=Hn((e,{scroll:n})=>{Do(n=>Ao(e,n)),n&&dr(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=ar.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&Fr(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),pr=Rn(null);Vn(()=>{const e=pr.current;pr.current=null;const n=null==Ut?.props.id?null:String(Ut.props.id);ir(t=>e&&e.id===n?e.mode:"part"===t.kind&&"nodeId"in t&&t.nodeId===n?t:qt(Ut?.type)??V);const o=Ut?.props.id,r=vo.current;if(vo.current=null,!o)return;const i=Jt(o);cr(String(o),{scroll:!t(r,i??null,Oe)})},[Ut?.props.id,cr]);const ur=Hn(e=>{ir(n=>W(n,e)?n:e),Ht({type:"setUi",ui:{rightSideBarVisible:!0}})},[Ht]),fr=Rn(()=>{});fr.current=(e,n)=>{const t=e?Ai(e.zone??Oe)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==Ut?.props.id?null:String(Ut.props.id);ir(e=>W(e,n)?e:n),o!==r&&(pr.current={id:o,mode:n},So.select(e))};const hr=Hn((e,n)=>fr.current(e,n),[]),mr={kind:rr.kind,mode:rr,open:ur,show:e=>ir(e),reveal:()=>{zo||Ht({type:"setUi",ui:{rightSideBarVisible:!0}})},select:hr},gr=U(mr,{data:Vt.data,selected:Ut??null,zoneOf:e=>Jt(e)?.zone,readOnly:Boolean(jt),select:e=>{ir(V),So.select({index:e})},replace:(e,n)=>So.replaceComponent(Oe,e,n),scrollTo:e=>l(e)},{device:Po,refreshes:Fo},{setView:Do,reveal:()=>{xo||Ht({type:"setUi",ui:{leftSideBarVisible:!0}})}}),yr=gr.resolveLeftView?gr.resolveLeftView(Ro):"sections",br=J(),{isLockedBlock:vr,duplicateBlocked:kr,nestDepth:Sr,newSectionNode:wr,canAddTo:xr,blockIsOffered:zr}=br,Cr=e=>({id:String(e.props.id??""),data:Vt?.data}),Or=Y(),{labelAtLevel:Nr,Icon:Br,useProducts:Ir}=Or,Pr=Or.rowName?(e,n,t)=>Or.rowName(e,n,t):void 0,$r=Hn(e=>{Ht({type:"setUi",ui:{rightSideBarVisible:!0}}),l(e),cr(e,{scroll:!0})},[Ht,cr]),{selectNode:Tr,openPartId:Mr}=g({mode:rr,setMode:ir,onOpenPart:$r}),[jr,Er]=Fn(null);me(null!==jr,()=>Er(null));const Lr=f(G()),Ar=Lr.collapsed,Rr=Lr.panelWidths,[Dr,Fr]=Fn(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(Ar);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
13
- return new Set}});Vn(()=>{try{window.localStorage.setItem(Ar,JSON.stringify([...Dr]))}catch{}},[Dr]);const[Vr,Hr]=Fn(()=>{if("undefined"==typeof window)return{...h};try{const e=window.localStorage.getItem(Rr);if(!e)return{...h};const n=JSON.parse(e);return{left:m(Number(n.left)||h.left,"left"),right:m(Number(n.right)||h.right,"right")}}catch{return{...h}}});Vn(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(Rr,JSON.stringify(Vr))}catch{}},300);return()=>clearTimeout(e)},[Vr]);const Wr=Hn((e,n)=>Hr(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),Ur=Hn(e=>Wr("left",e),[Wr]),Jr=Hn(e=>Wr("right",e),[Wr]),Yr=e=>Dr.has(e),Gr=e=>Fr(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),Xr=Rn(!1),Kr=Rn(null);Vn(()=>{if(Xr.current&&!Zo){const e=Kr.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??Wo.current?.querySelector(`button[aria-label="${CSS.escape(io.add.title)}"]`))?.focus(),Kr.current=null}Xr.current=Zo},[Zo]),Vn(()=>{if(!Zo||!Yo)return;const e=e=>{"Escape"===e.key&&gl()};return Yo.addEventListener("keydown",e),()=>Yo.removeEventListener("keydown",e)},[Zo,Yo]),me(Zo,()=>gl()),Vn(()=>{!xo&&Zo&&(_o(!1),nr(null),qo.current=!1)},[xo]);const Qr=X(),Zr=(e,n="success",t)=>{if(Qr)return void(t?Qr(e,"error"===n?"error":"info",t):Qr(e,"error"===n?"error":"info"));const o={sound:!1,action:t?.action,onClose:t?.onClose};"error"===n?Qn.error(e,{...o,duration:t?.duration??3200}):Qn.success(e,{...o,duration:t?.duration??1900})},_r=Le(gr.mainAction??{label:io.done,onPress:()=>{nt(ko.getState().appState.data)}}),qr=Rn(Zr);qr.current=Zr,Vn(()=>Ae(ko,()=>qr.current(io.writeLate,"error")),[ko,io]);const ei=Rn(null),[ni,ti]=Fn(0),[oi,ri]=Fn(0),ii=K(),li=Rn(null),si=e=>Math.max(0,e.clientHeight-(li.current?.offsetHeight??0));Vn(()=>{const e=ei.current;if(!e)return;const n=()=>{ti(e.clientWidth),ri(si(e))};n();const t=new ResizeObserver(n);return t.observe(e),li.current&&t.observe(li.current),()=>t.disconnect()},[]),Wn(()=>{ei.current&&(ti(ei.current.clientWidth),ri(si(ei.current)))},[Vr,xo,zo]);const di=Po===Bo?ni>0?ni:Oo[Bo]:Oo[Po],ai=ni>0?Math.min(ni/di,"shrink"===Io?1:2):1,ci=di*ai,pi=ni>0&&ci>ni+1,ui={width:ci,height:oi||"100%",flex:"none",position:"relative"},fi={width:di,height:oi?oi/ai:"100%",maxHeight:"none",transform:1!==ai?`scale(${ai})`:void 0,transformOrigin:"top left"},hi=()=>Ht({type:"setUi",ui:{leftSideBarVisible:!xo}}),mi=()=>Ht({type:"setUi",ui:{rightSideBarVisible:!zo}}),gi=e=>{Zo&&(_o(!1),nr(null),qo.current=!1,xo&&Ro===e)||(Do(e),xo||Ht({type:"setUi",ui:{leftSideBarVisible:!0}}))},yi=()=>{ir(eo??V),zo||Ht({type:"setUi",ui:{rightSideBarVisible:!0}})},bi=Vt.data.content??[],vi=()=>{const e=bi.findIndex(no),n=bi.findIndex(to);return{floor:e>=0?e+1:0,cap:n>=0?n:bi.length}},ki=Yt,Si=br.stripCopy,wi=e=>o(e,Si),xi=pe(),zi=Ze({data:Vt.data,config:ki,readOnly:Boolean(jt),clipboard:xi,strip:Si?e=>Si(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==Tn||e.slot!==Mn)return{min:0,max:n-1};const{floor:t,cap:o}=vi();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&ir(V);const t=void 0===n||"node"===n?.kind?n:null;So.commitDocument(e,t)}}),Ci=fe(),[Oi,Ni]=Fn(null),Bi=e=>{const n=bi.find(n=>String(n.props.id)===e),t=Gt.shared;n&&t&&zi.swap(e,t.detach(n))},Ii=e=>{const n=Ln(Vt.data,Yt,e);if(!n)return!1;const t=jn(n.place),o=n.node,r=t===Oe?ji(o):Ki(o),i=t===Oe?Gt.shared?.usedOn(o):null;return!!zi.remove(e)&&(Zr(i?io.shared.removed({count:Math.max(0,i.length-1)}):io.deleted({name:r}),"success",{duration:8e3,action:{label:io.bar.undo,onClick:()=>{zi.restore(n.node,n.place)}}}),!0)},Pi={...zi,remove:Ii},$i=e=>Nr(e,"block",Yt.components[e]?.label??e),Ti=Hn(e=>Yt.components[e]?.defaultProps??{},[Yt]),Mi=e=>Nr(e,"section",$i(e)),ji=e=>we({type:e.type,props:e.props??{}},Mi(e.type),Pr),{nodeAddresses:Ei,zoneItems:Li}=Dn(()=>{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>=Be)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of Ie(Yt,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(bi,Oe,0),{nodeAddresses:e,zoneItems:n}},[bi,Yt]),Ai=Hn(e=>Li.get(e)??[],[Li]),Ri=e=>{const n=Ei.get(e);return n?Ai(n.zone)[n.index]:void 0},Di=e=>oe(br,Yt,e),Fi=e=>{if(!br.slotsOf||e===Oe)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=Ri(e.slice(0,n));if(!t)return null;const o=Di(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}},Vi=(()=>{if(!Q(rr))return null;const e=`${rr.nodeId}:${rr.slot}`;return Fi(e)?.slot.panel===rr.kind?e:null})(),Hi=Rn(null);Vn(()=>{const e=Hi.current;if(Hi.current=null,!Vi||!Q(rr))return;const n=rr.nodeId;cr(n,{scroll:e!==Vi}),Fr(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[rr]);const Wi=e=>{const n=Ei.get(e);n&&(n.zone===Oe?al(n.index):Ll(n.zone,n.index,e,Ri(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))},Ui=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void Wi(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&Vi!==i&&(Hi.current=i),hr(null,r),zo||Ht({type:"setUi",ui:{rightSideBarVisible:!0}}),l(o)},Ji=(e,n,t)=>{const o=`${e}:${n}`;if(Fr(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;Vi!==o&&(Hi.current=o);hr(null,{kind:t,nodeId:e,slot:n})},Yi=(e,n,t)=>{if(jt||!br.moveSlot)return;const o=Ri(e),r=o?Di(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:Ct,index:n},s=Sn(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=br.moveSlot(e,n,s);"string"==typeof d&&Ji(e,d,i.panel)},Gi=Ir(),Xi=Dn(()=>{const e=/* @__PURE__ */new Map;for(const n of Gi??[])e.set(n.slug,n.name);return e},[Gi]),Ki=e=>xe(e,$i,Or.plainText,e=>Xi.get(e),Or.rowName),Qi=(e,n)=>{const t=Yt.components[e.type]?.fields,o=n===Oe||ds(n)?"section":"block",r=n===Oe&&(no(e)||to(e)||Zt(e.type)),i="block"===o?ze(t):r?null:Ce(t);return Or.renamePropOf?Or.renamePropOf(e,o,i):i},Zi=(e,n,t,o)=>{if(!(!jt&&jr?.zone===e&&jr.index===n))return;const r=(t,o)=>{Er(null),o&&((e,n,t)=>{const o=Ai(e)[n];if(!o)return;const r=Qi(o,e);r&&So.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
14
- return ft("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":io.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)},_i=i(Z(),uo),qi=_i.scope({target:Pn,siteId:et,docId:Yn}),el=Yt,nl=(e,n)=>n===Oe?Mi(e):$i(e),tl=(e,n,t)=>{const o=_i.plan(qi,t,nl(t.type,e),el);o&&(o.changed&&So.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),Zr(o.message))},ol=ue({nodesIn:Ai,nodeAt:(e,n)=>Ai(e)[n]??null,labelOf:(e,n)=>n===Oe?Mi(e):$i(e),renamePropOf:Qi,beginRename:(e,n)=>Er({zone:e,index:n}),history:{hasPast:Wt.hasPast,hasFuture:Wt.hasFuture,back:()=>Wt.back(),forward:()=>Wt.forward()},openPageStyles:gr.openPageStyles,pageStylesLabel:io.pageStyles,words:{menu:po,styleClipboard:uo,screen:io.menu},readOnly:Boolean(jt),collapseAll:()=>Fr(new Set(Ai(Oe).map(e=>String(e.props.id)))),onPasteRefused:e=>Zr(e?io.pasteRefused({name:e.label}):io.menu.clipboardRefused,"error"),canPasteAt:(e,n)=>ps(e,n),copyItem:gr.onCopyItem,menuRows:(e,n,t)=>{const o=gr.menuRows?.(e,n,t)??null,r=((e,n)=>{const t=Gt.shared;if(!t||n!==Oe)return null;const o=t.usedOn(e);if(o){const n={pick:[{label:io.shared.onPages({count:o.length}),onClick:()=>{},children:o.map(e=>({label:e.title,onClick:()=>t.openPage(e)}))}]};return jt||vr(e.type,e)?n:{...n,change:[{label:io.shared.detach,onClick:()=>Bi(e.props.id)}],remove:[{label:io.shared.removeFromPage,danger:!0,onClick:()=>{Ii(e.props.id)}}]}}return jt||no(e)||to(e)||Zt(e.type)?null:O(Ci)?{change:[{label:io.shared.makeShared,onClick:()=>Ni({id:e.props.id,name:ji(e)})}]}:null})(e,n);if(!r)return o;return Object.fromEntries(["pick","make","change","remove"].map(e=>[e,[...o?.[e]??[],...r[e]??[]]]).filter(([,e])=>e.length>0))},isLocked:e=>vr(e.type,e),duplicateBlocked:e=>kr(Vt.data,e),permits:e=>{const n=Ne(Yt,e.type);return Gt.shared?.usedOn(e)?{...n,delete:!1}:n},nodeOps:Pi,isPinned:(e,n)=>n===Oe&&(no(e)||to(e)),sectionBand:vi,locate:e=>Ei.get(e)??null,rowNameOf:(e,n)=>n===Oe?ji(e):Ki(e),selectAt:(e,n,t,o)=>{e===Oe?al(n):Ll(e,n,t,o??"")},slotRung:e=>{const n=Fi(e);return n?.slot.panel?{label:n.slot.label,select:()=>Ui(n.node,n.slot,!1)}:null},style:{held:()=>ve(qi),canCopy:e=>_i.rows(el,e).some(e=>!1!==e.counted),copy:(e,n)=>_i.copy(qi,e,nl(e.type,n),el),paste:(e,n,t)=>tl(e,n,t)},keys:At?{target:Yo,selected:()=>{const e=Vt.ui.itemSelector;return e?{zone:e.zone??Oe,index:e.index}:null},held:()=>xi.get(),readOnly:Boolean(jt),onDone:({done:e,name:n})=>{"copied"===e&&Zr(io.copied({name:n}))}}:void 0},Uo),rl=Rn({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});Vn(()=>{rl.current={copy:(e,n)=>_i.copy(qi,e,nl(e.type,n),el),paste:tl,at:()=>{const e=Vt.ui.itemSelector;if(!e)return null;const n=e.zone??Oe,t=Ai(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean(jt)}});const il=Hn(e=>{const n=ke(e);if(!n)return;const t=rl.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))},[]);Vn(()=>{if(!Yo)return;const e=e=>il(e);return Yo.addEventListener("keydown",e),()=>Yo.removeEventListener("keydown",e)},[il,Yo]),On(Uo,"keydown",il);const ll=bi.map(e=>e.props.id).join("|");Vn(()=>{const e=Uo?.document??null,n=Uo?.window??null;let t=0;const o=[],r=()=>{if(!e)return void or(e=>e.length?[]:e);const n=bi.findIndex(to),t=n>=0?n:bi.length,o=n=>{const t=bi[n]?.props?.id;return null==t?null:$n(e,`[data-easel-block="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(zn)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=bi.length>0&&!no(bi[0])?0:1;e<=t;e++){const n=o(e),t=o(e-1),l=n?.getBoundingClientRect()??null,s=t?.getBoundingClientRect()??null;if(!l&&!s)continue;const d=zt(l&&s?(s.bottom+l.top)/2:l?0===e?l.top+12:l.top:s.bottom,Math.max(0===e?0:-1/0,...r(t).map(e=>e.bottom)),Math.min(1/0,...r(n).map(e=>e.top)));d&&i.push({...d,index:e})}or(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()}},[Uo,ll,Po,ai,xo,zo,Ut?.props.id]);const sl=Uo?.document??null,dl=Uo?.window??null;Vn(()=>{const e=Ho.current;if(!e||!sl||!dl)return;const n=[],t=()=>{const n=$n(sl,`[data-easel-block="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&dl.scrollTo({left:dl.scrollX,top:dl.scrollY+t,behavior:"instant"}),!0};return Ho.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[sl,dl]);const al=e=>{ir(V),So.select({index:e}),gr.sectionPressed?.(bi[e]);const n=bi[e]?.props?.id;n&&l(n)},cl=e=>{const{floor:n,cap:t}=vi(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=Ut&&rr.kind!==eo?.kind?bi.findIndex(e=>e.props.id===Ut.props.id):-1;return o(r>=0?r+1:t)},pl=(e,n)=>{const{floor:t,cap:o}=vi(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(So.reorderComponent(Oe,e,i),So.select({index:i}),{moved:!0,dest:i})},ul=(e,n,t,o)=>{ir(V),So.select(o?{index:o.index,zone:o.zone}:{index:e}),l(n),Zr(io.sectionAdded({name:t}))},fl=(e,n)=>{const t=cl(n),o=wr(e,{nodeDefaults:Ti,newNodeId:$e,sectionLabel:Mi,blockIsOffered:zr}),r=o?So.insertNode(Oe,t,o):So.insertSection(e,t);return ul(t,r,Mi(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:a}of Ie(Yt,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=xr(e.type,l,d.slice(d.lastIndexOf(":")+1),Cr(e)),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:a,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},hl=e=>ml(Oe,e),ml=(e,n)=>{Kr.current=document.activeElement??null,nr(null===n?null:{zone:e,index:n}),_o(!0),xo||(qo.current=!0,Ht({type:"setUi",ui:{leftSideBarVisible:!0}}))},gl=()=>{_o(!1),nr(null),qo.current&&Ht({type:"setUi",ui:{leftSideBarVisible:!1}}),qo.current=!1},yl=(e,n)=>Or.rowName?n?no(e)?Or.rowName(e,"section",io.header):to(e)?Or.rowName(e,"section",io.footer):Zt(e.type)?Or.rowName(e,"section",$i(e.type)):ji(e):Ki(e):n?Mi(e.type):$i(e.type),bl=e=>n=>{e()},vl=(e,n,t)=>{if(jt)return null;const o=Ai(e)[n];return o&&!Ne(Yt,o.type).delete||o&&vr(o.type,o)?null:/* @__PURE__ */ft(Ye,{kind:"delete",label:e===Oe&&o&&Gt.shared?.usedOn(o)?io.shared.removeFromPage:io.deleteNamed({name:t}),onClick:()=>((e,n)=>{const t=Ai(e)[n]?.props?.id;null!=t&&Ii(String(t))})(e,n),children:/* @__PURE__ */ft(dt,{size:15})})},kl=e=>Or.rowPreview?.(e)||void 0,Sl=e=>Or.rowMarks?.(e)??void 0,wl=(e,n,t)=>Or.rowActions?.(e,n,t)??null,xl=(e,n,t,o)=>{if(jt)return null;if(vr(t.type,t))return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
15
- return ft(Ye,{kind:"eye",label:r?io.showNamed({name:o}):io.hideNamed({name:o}),onClick:()=>Cl(e,n,t),children:/* @__PURE__ */ft(r?at:ct,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},zl=e=>sd(Oe,e),Cl=(e,n,t)=>{So.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},Ol=e=>Pe(Yt,e),Nl=e=>Ie(Yt,e),Bl=e=>br.slotsOf?Di(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:Te(e,n.slot)})):[{slot:null,rung:null,kids:re(Yt,e)}],Il=e=>br.slotsOf?Bl(e).flatMap(e=>e.kids):re(Yt,e),Pl=e=>Boolean(br.slotsOf)&&Di(e).some(e=>e.rung),$l=(e,n,t)=>xr(e.type,n,t??void 0,Cr(e)),Tl=(e,n,t)=>{const o=Me(Yt,e.type,n)&&(t||Il(e).length>0||Pl(e));return{collapsible:o,folded:o&&Yr(String(e.props.id))}},Ml=(e,n,t)=>Bl(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>Tl(e,r,t(e.type)).collapsible?[String(e.props.id),...Ml(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),jl=e=>Il(e).length>0||Pl(e)||Boolean(xr(e.type)),El=e=>Boolean(xr(e)),Ll=(e,n,t,o)=>{if(ir(V),xr(o)?.spec?.slider){const t=e.split(":")[0];s(t,n),So.select({index:n,zone:e}),l(t)}else So.select({index:n,zone:e}),l(t)},Al=(e,n,t,o,r)=>{const i=`${e}:${n}`;So.insertComponent(i,t,o),xr(r)?.spec?.slider?requestAnimationFrame(()=>{s(e,o),So.select({index:o,zone:i})}):So.select({index:o,zone:i})},Rl=Rn(/* @__PURE__ */new Set);Vn(()=>{bi.forEach(e=>{const n=xr(e.type)?.spec;if(!n)return;const t=e.props.id;if(Rl.current.has(t))return;Rl.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(Ti)).forEach((e,t)=>bo.seedChild(o,t,n.childType,e))})},[bi,bo,Ti]);const Dl=Rn(/* @__PURE__ */new Set);Vn(()=>{bi.forEach((e,n)=>{const t=e.props.id;if(Dl.current.has(t))return;const o=r(e,Ol(e.type));Dl.current.add(t),o&&bo.replaceComponent(Oe,n,{...e,props:o})})},[bi,bo]),_(bo,Yt);const Fl=bi.findIndex(to),Vl=Fl>=0?bi[Fl]:null,Hl=oo?bi.findIndex(no):-1,Wl=Hl>=0?bi[Hl]:null,Ul=Gt.groupTab,Jl=Dn(()=>Ul?e=>Zt(e.type):void 0,[Ul]),Yl=Boolean(Gt.groupBadge),Gl=Gt.sharedReach,Xl=e=>Gl?.(e)??void 0,Kl=Dn(()=>Gl?new Set(bi.filter(e=>Xl(e)).map(e=>String(e.props.id))):null,[bi,Gl]),Ql=Dn(()=>Kl?e=>Kl.has(e):void 0,[Kl]),Zl=Gt.first?Gl?.({type:Gt.first,props:{id:""}})??void 0:void 0,_l=Gt.groupBadge?/* @__PURE__ */ft("span",{className:"es-tree-group-badge",children:/* @__PURE__ */ft(Gn,{tone:"info",size:"xs",children:Gt.groupBadge})}):void 0,ql=bi.find(e=>e.type===Kt)??null,es=bi.find(e=>e.type===Qt)??null,ns=Fl>=0?Fl:bi.length,ts=[];bi.forEach(e=>{to(e)||(jl(e)&&ts.push(String(e.props.id)),ts.push(...Ml(e,1,El)))}),Vl&&(ts.push(String(Vl.props.id)),ts.push(...Ml(Vl,1,El)));const os=ts.length>0&&ts.every(e=>Dr.has(e)),rs=e=>{const n=Or.blockRowName(e,$i);return Or.rowName?Or.rowName(e,"block",n):n},is=(e,n,t,o)=>{const r=Ai(e)[t];if(!r)return;const i={...En(e),index:t},l={...En(n),index:Math.min(Math.max(o,0),Ai(n).length)},s=Sn(i,l);if(e!==n||s!==t)try{zi.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof An))throw e}},ls=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of Nl(e))n.add(r),t(o)};for(const t of Ol(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},ss=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=Ei.get(n);if(!e)return null;if(e.zone===Oe)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},ds=e=>{const n=e.slice(0,e.indexOf(":")),t=bi.find(e=>Zt(e.type)&&String(e.props.id)===n);return t&&_t(n)===e?t:null},as=(e,n)=>{const t=ds(e);return!t||(!Gt.groupAccepts||Gt.groupAccepts(t.type,n,Ai(e).length))},cs=(e,n,t)=>{if(e.rung){const t=Ri(e.rung.nodeId),o=t?Di(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===Ct&&n.index>=0&&n.index<=o}if(n.slot===Ct)return!1;if(e.add)return hs(e.add,n);const o=jn(n);if(Zt(e.type))return!1;const r=ds(o),i=ds(e.zone);if(r||i)return!(!r||!i)&&(!(r!==i&&!as(o,e.type))&&(n.index>=0&&n.index<=Ai(o).length));if(e.zone===Oe||o===Oe){if(e.zone!==o)return!1;const{floor:t,cap:r}=vi();return n.index>=t&&n.index<=r}if(n.index<0||n.index>Ai(o).length)return!1;if(e.zone===o)return!0;const l=Vl&&!Gt.lastIsOpen?String(Vl.props.id):null;return(!l||ss(e.zone)!==l&&ss(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??Ai(e)[t];if(!r)return!1;const i=n.split(":")[0],l=Ei.get(i),s=l?Ai(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&ls(r).has(n))return!1;const d=xr(s.type,Sr(Vt?.data,s.type,i),n.slice(n.lastIndexOf(":")+1),Cr(s));return!!d&&(!!(d.choices?d.choices.some(e=>e.type===r.type):d.spec?.childType===r.type)&&!d.spec?.addBlocked?.(Ai(n),r))})(e.zone,o,e.index,t)},ps=(e,n)=>{const t=jn(e.from),o=e.node;return t===jn(n)?as(t,o.type):cs({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},us=e=>{const n=e.slice(0,e.indexOf(":")),t=Ei.get(n),o=t?Ai(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=xr(o.type,Sr(Vt?.data,o.type,n),e.slice(e.lastIndexOf(":")+1),Cr(o));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:$i(r.spec.childType)}]:[])),l=Fi(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:yl(o,t.zone===Oe)}},fs=(e,n)=>{if("section"!==e.kind)return e;const t=jn(n);return t===Oe||ds(t)?e:us(t)?.choices.some(n=>n.type===e.type)?{kind:"block",type:e.type}:e},hs=(e,n)=>{const t=fs(e,n),o=jn(n);if("shared"===t.kind){if(o!==Oe||!Gt.shared?.nodeOf(t.section))return!1;const{floor:e,cap:r}=vi();return n.index>=e&&n.index<=r}if("block"!==t.kind){if(ds(o)){if("preset"===t.kind)return!1;const e="section"===t.kind?t.type:t.template.node.type;return as(o,e)&&n.index>=0&&n.index<=Ai(o).length}if(o!==Oe)return!1;const{floor:e,cap:r}=vi();return n.index>=e&&n.index<=r}if(o===Oe)return!1;const r=us(o);return!(!r||!r.choices.some(e=>e.type===t.type))&&!r.target.spec?.addBlocked?.(Ai(o))},ms=(e,n)=>{const t=fs(e,n);if("block"!==t.kind&&ds(jn(n)))return void((e,n,t)=>{const o="section"===e.kind?e.type:"template"===e.kind?e.template.node.type:null;if(o&&as(n,o)){if("section"===e.kind)So.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;So.insertNode(n,t,wi(e.template.node))}ir(V),So.select({index:t,zone:n})}})(t,jn(n),n.index);if("section"===t.kind)return void fl(t.type,n.index);if("template"===t.kind)return void((e,n,t)=>{const o=cl(t),r=So.insertNode(Oe,o,n);ul(o,r,e)})(t.template.name,wi(t.template.node),n.index);if("preset"===t.kind)return void((e,n,t)=>{const o=n({nodeDefaults:Ti,newNodeId:$e,sectionLabel:Mi,blockIsOffered:zr});if(!o)return;const r=cl(t),i=So.insertNode(Oe,r,o);ul(r,i,e)})(t.preset.label,t.preset.insert,n.index);if("shared"===t.kind){const e=Gt.shared?.nodeOf(t.section);if(!e)return;const o=cl(n.index);return void(zi.restore(e,{parentId:Tn,slot:Mn,index:o})&&ul(o,e.props.id,t.section.title))}const o=jn(n),r=us(o);r&&(r.target.spec?Al(r.parentId,r.target.slot,t.type,n.index,r.parent.type):((e,n,t)=>{So.insertComponent(e,n,t),ir(V),So.select({index:t,zone:e})})(o,t.type,n.index))},gs=(e,n)=>{e.media?function(e){const n=td();if(!n||!qs)return;rd(n).then(n=>{n&&function(e,n){if(!qs)return;const t=qs.create(e,{nodeDefaults:Ti,newNodeId:$e,sectionLabel:Mi,blockIsOffered:zr}),o=jn(n);if(o===Oe){const e=cl(n.index),o=So.insertNode(Oe,e,t);return void ul(e,o,Mi(t.type))}So.insertNode(o,n.index,t),ir(V),So.select({index:n.index,zone:o})}(n,e)})}(n):e.rung?Yi(e.rung.nodeId,e.index,n.index):e.add?ms(e.add,n):e.zone===Oe?pl(e.index,n.index):is(e.zone,jn(n),e.index,n.index)},[ys]=Fn(()=>vn()),bs=kn({keyOf:e=>e.id,readOnly:Boolean(jt),session:ys,canDrop:cs,onDrop:gs,onStep:(e,n)=>{e.rung?Yi(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===Oe?((e,n)=>{const t=Mi(bi[e]?.type??""),o=pl(e,n<0?e-1:e+2);if(!o.moved)return void Zr(n<0?io.sectionFirst({name:t}):io.sectionLast({name:t}));const{floor:r,cap:i}=vi();Zr(io.sectionMoved({name:t,n:o.dest-r+1,total:i-r}))})(e.index,n):is(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),vs=Hn(e=>{const{floor:n,cap:t}=vi(),o=[];for(const r of e.nodes){const e=jn(r.place),i=Ai(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(no(i)||to(i)||vr(i.type,i))continue;if(Zt(i.type))continue;const l=Boolean(ds(e)),s=e===Oe||l;e===Oe&&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?Mi(i.type):Ki(i),from:r.place})}const r=e.zones.flatMap(e=>{const n=jn(e.list);if(n===Oe&&0===e.children.length)return[{...e,addLabel:io.addSection,addAlways:!0}];const t=us(n),o=t?.target.spec?.addLabel;return e.children.length>0||Boolean(t?.choices.length)||Boolean(ds(n))?[o?{...e,addLabel:o}:e]:[]}),i=r.flatMap(e=>{const n=jn(e.list),t=n===Oe||ds(n)?null:us(n);return t?.choices.length?mn(e,t.target.spec?.addLabel??io.addBlockHere):[]});return{sources:o,zones:r,seams:i}},[Vt.data]),ks=null==Ut?.props.id?null:String(Ut.props.id),Ss=Un(Re),ws=Ss?.selected()&&Uo?.document&&ks?Ss.selectedPart?.(Uo.document)??null:null,xs=ws&&ks&&De(Vt.data,Yt,ks,ws)?ws:null,zs=xs?.label?{element:xs.element,label:xs.label}:null,Cs=null!==xs,Os=Hn(e=>{const n=Yt,t=e=>!e.item.rung&&null!==Ln(Vt.data,n,e.item.id),o=e[e.length-1];if(!t(o))return o;const r=n=>e.find(e=>t(e)&&e.item.id===n),i=r(ks);return i?Cs?null:i:r(_e(Vt.data,n,o.item.id,ks,Jl))??o},[Vt.data,Yt,ks,Jl,Cs]),[Ns,Bs]=Fn(null),[Is,Ps]=Fn(null),[$s,Ts]=Fn(null),Ms=Or.canvasTab,js=Boolean(Ul||Gl||Ms);On(Uo,"mouseover",e=>{if(!js)return;const n=Nn(e.target),t=n?vt(Vt.data,Yt,n):null;t!==Ns&&Bs(t),Ms&&n!==$s&&Ts(n)}),On(Uo,"mouseout",e=>{js&&!e.relatedTarget&&(Bs(null),Ts(null))});const Es=e=>no(e)||to(e)||Zt(e.type),Ls=e=>{const n=Zt(e.type)?$i(e.type):no(e)?io.header:to(e)?io.footer:null;return null===n?ji(e):Or.rowName?Or.rowName(e,"section",n):n},As=[];if(js){const e=ks?vt(Vt.data,Yt,ks):null;for(const n of/* @__PURE__ */new Set([e,Ns,Is])){const e=n?bi.find(e=>String(e.props.id)===n):void 0;if(!e)continue;const t=no(e)||e.type===Kt,o=Xl(e);if(o){As.push({id:String(e.props.id),label:Ls(e),below:t,reach:o});continue}if(!Ul||!Es(e))continue;const r=Ul(e);r&&As.push({id:String(e.props.id),label:r,below:t})}for(const e of Ms?/* @__PURE__ */new Set([ks,$s]):[]){const n=e?Ri(e):void 0,t=n?Ms(n):null;t&&!As.some(n=>n.id===e)&&As.push({id:e,label:t,below:!1,above:!0})}}const Rs=fe(),Ds=Rn(null);Vn(()=>{const e=Gt.changeNotice;if(!e)return;const n=JSON.stringify(bi.filter(Es)),t=Ds.current;if(Ds.current={doc:Yn,bands:n,index:Wt.index},!t||t.doc!==Yn||t.bands===n)return;Wt.hasPast&&Wt.index>=t.index&&!bt.has(Rs)&&(bt.add(Rs),Zr(e,"success",{action:{label:io.bar.undo,onClick:()=>Wt.back()},duration:8e3}))},[bi]);const Fs=e=>{ir(V),So.select(e.zone===Oe?{index:e.index}:{index:e.index,zone:e.zone})},Vs=q(),Hs=()=>({data:Vt.data,device:Po,ops:So,inspector:mr}),Ws=Vs?.model,Us=Dn(()=>Ws?e=>Ws(e,vs(e),Hs()):vs,[Ws,vs,Po]),Js=Vs?.measure,Ys=Js?(e,n)=>Js(e,n,Hs()):void 0,Gs=Vs?.canDrop,Xs=Gs?(e,n)=>Gs(e,n,cs,Hs()):cs,Ks=Vs?.drop,Qs=Ks?(e,n)=>Ks(e,n,gs,Hs()):gs,Zs=Vs?.pick,_s=Zs?e=>Zs(e,Fs,Hs()):Fs,qs=Vs?.media??null,ed=Rn(null),nd=Dn(()=>qs?{id:gt,zone:"",index:-1,type:qs.adds.type,add:{kind:qs.adds.kind,type:qs.adds.type},media:!0}:null,[qs]);Vn(()=>{if(!nd||jt||"undefined"==typeof document)return;const e=e=>{(e=>Array.from(e.dataTransfer?.types??[]).includes(ot))(e)&&(ed.current=null,ys.start({key:gt,item:nd}))},n=e=>{ys.get()?.item.media&&(ed.current=Zn(e.dataTransfer))},t=()=>{ys.get()?.item.media&&ys.end()};return document.addEventListener("dragstart",e),document.addEventListener("drop",n,!0),document.addEventListener("dragend",t,!0),()=>{document.removeEventListener("dragstart",e),document.removeEventListener("drop",n,!0),document.removeEventListener("dragend",t,!0)}},[nd,jt,ys]);const td=()=>{const e=ed.current;return ed.current=null,e},od=ce(),rd=async e=>{if(!od)return e;const n=await od(e);return n?{...e,id:n.id,url:n.url}:null};const id=(e,n)=>{if(!qs)return;const t=Ln(ko.getState().appState.data,ki,n);if(!t)return;const o=t.node;So.replaceComponent(jn(t.place),t.place.index,{...o,props:{...qs.replace(o,e),id:o.props.id}})},ld=e=>{const n=jn(e),t=Fi(n);t&&Ui(t.node,t.slot,!1),ml(n,e.index)},sd=(e,n)=>/* @__PURE__ */ft(Ge,{...jt?{}:bs.seam({place:{...En(e),index:n}})},`seam:${e}:${n}`),dd={rowClick:bl,isCollapsed:Yr,toggleCollapse:Gr},ad=e=>{const n=String(e.props.id),t=bi.findIndex(e=>String(e.props.id)===n),o=_t(n),r=Ai(o),i=Yr(n),l=$i(e.type),s=Or.rowName?Or.rowName(e,"section",l):l,d=e=>sd(o,e);/* @__PURE__ */
12
+ /* @__PURE__ */ft("path",{d:"M5 12h14"})]})})}var xt=`${xn}, ${zn}`;function zt(e,n,t){const o=t-n;if(o<6)return null;if(o<24)return{top:Math.round((n+t)/2),height:Math.round(o)};return{top:Math.round(Math.min(Math.max(e,n+12),t-12))}}var Ct="__rungs",Ot=e=>"template"===e.kind?e.template.id:"shared"===e.kind?e.section.id:"preset"===e.kind?e.preset.key:e.type;var Bt="screen:band",It={duplicate:!0,delete:!0},Nt=()=>null;function Pt(){const xn=he(),In=xn.panels?.Toolbar,Nn=(xn.panels?.useRight??Nt)(),{target:Pn,docId:Xn,capabilities:_n,currentSlug:qn,siteId:et,onPublish:nt,saveState:tt,saveConflict:pt,retrySave:kt,toggleAutoSave:Pt,flushSave:$t,access:Tt,saveUnreachable:Mt=!1,readOnly:jt,readOnlyReason:Et=null}=w(),Lt=T(),At=M(),{mediaEditing:Rt,hasEditGuard:Ft,hasPinnedChrome:Dt}=_n,{appState:Vt,dispatch:Wt,history:Ht,selectedItem:Ut,getSelectorForId:Jt,config:Xt}=je(e=>e),Yt=j(),{first:Gt,firstGroup:Kt,lastGroup:Qt,isSectionGroup:Zt,sectionGroupZone:_t,panelOf:qt}=Yt,eo=qt(Gt),no=e=>ne(Yt,e),to=e=>te(Yt,e),oo="node"===Yt.firstRow,ro=Yt.band??null,io=hn("screen",be),lo=hn("tree",Ge),so=hn("drag",bn),ao=hn("notice",an),co=hn("lock",fn),po=hn("menu",Ke),uo=hn("styleClipboard",Se),fo=hn("chrome",cn),ho=E()??`/${qn}`,mo=L(),go=A(),yo=y({readOnly:jt}),bo=y({readOnly:jt,foldIntoHistory:!0}),vo=Rn(null),ko=Ee(),So=Fn(()=>({...yo,select:e=>{vo.current=e,yo.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=ko.config;vo.current=Qe(e,t,n)}yo.commitDocument(e,n)}}),[yo,ko]),wo=Vt.ui,xo=wo.leftSideBarVisible,zo=wo.rightSideBarVisible,{options:Co,widths:Oo,initial:Bo,fluid:Io,fit:No}=R(),[Po,$o]=Dn(Bo),To=le(),Mo=Rt&&null!==To;se(),de();const jo=ae();F(Ut?.props.id);const{read:Eo,write:Lo,forSelection:Ao}=D(),[Ro,Fo]=Dn(Eo);Vn(()=>{Lo(Ro)},[Ro]);const[Do,Vo]=Dn(0),Wo=Rn(null),Ho=Rn(null),Uo=wn(Ho,{readySelector:xt}),Jo=Cn(Uo),Xo=d(Ho);a(Ho,Uo);const Yo=S(),Go=pn(Tt),Ko={state:tt,offline:Yo||tt.failed&&Mt,readOnlyReason:Et,editing:Go?ao.editing({name:un(Go.name,co),noun:io.noun}):null,conflict:null!=pt,notSaving:io.bar.notSaving},Qo=Le({onPress:()=>{jt||(tt.failed?kt():$t())}}).onPress;c(Ho,Uo,Qo);const[Zo,_o]=Dn(!1),qo=Rn(!1),[er,nr]=Dn(null),[tr,or]=Dn([]),[rr,ir]=Dn(V);W(rr);const lr=e(rr,Ut?.props.id),[sr,dr]=Dn(null);Vn(()=>{sr&&(n(),dr(null))},[sr]);const ar=Rn(Jt);ar.current=Jt;const cr=Wn((e,{scroll:n})=>{Fo(n=>Ao(e,n)),n&&dr(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=ar.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&Dr(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),pr=Rn(null);Vn(()=>{const e=pr.current;pr.current=null;const n=null==Ut?.props.id?null:String(Ut.props.id);ir(t=>e&&e.id===n?e.mode:"part"===t.kind&&"nodeId"in t&&t.nodeId===n?t:qt(Ut?.type)??V);const o=Ut?.props.id,r=vo.current;if(vo.current=null,!o)return;const i=Jt(o);cr(String(o),{scroll:!t(r,i??null,Oe)})},[Ut?.props.id,cr]);const ur=Wn(e=>{ir(n=>H(n,e)?n:e),Wt({type:"setUi",ui:{rightSideBarVisible:!0}})},[Wt]),fr=Rn(()=>{});fr.current=(e,n)=>{const t=e?Ai(e.zone??Oe)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==Ut?.props.id?null:String(Ut.props.id);ir(e=>H(e,n)?e:n),o!==r&&(pr.current={id:o,mode:n},So.select(e))};const hr=Wn((e,n)=>fr.current(e,n),[]),mr={kind:rr.kind,mode:rr,open:ur,show:e=>ir(e),reveal:()=>{zo||Wt({type:"setUi",ui:{rightSideBarVisible:!0}})},select:hr},gr=U(mr,{data:Vt.data,selected:Ut??null,zoneOf:e=>Jt(e)?.zone,readOnly:Boolean(jt),select:e=>{ir(V),So.select({index:e})},replace:(e,n)=>So.replaceComponent(Oe,e,n),scrollTo:e=>l(e)},{device:Po,refreshes:Do},{setView:Fo,reveal:()=>{xo||Wt({type:"setUi",ui:{leftSideBarVisible:!0}})}}),yr=gr.resolveLeftView?gr.resolveLeftView(Ro):"sections",br=J(),{isLockedBlock:vr,duplicateBlocked:kr,nestDepth:Sr,newSectionNode:wr,canAddTo:xr,blockIsOffered:zr}=br,Cr=e=>({id:String(e.props.id??""),data:Vt?.data}),Or=X(),{labelAtLevel:Br,Icon:Ir,useProducts:Nr}=Or,Pr=Or.rowName?(e,n,t)=>Or.rowName(e,n,t):void 0,$r=Wn(e=>{Wt({type:"setUi",ui:{rightSideBarVisible:!0}}),l(e),cr(e,{scroll:!0})},[Wt,cr]),{selectNode:Tr,openPartId:Mr}=g({mode:rr,setMode:ir,onOpenPart:$r}),[jr,Er]=Dn(null);me(null!==jr,()=>Er(null));const Lr=f(Y()),Ar=Lr.collapsed,Rr=Lr.panelWidths,[Fr,Dr]=Dn(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(Ar);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
13
+ return new Set}});Vn(()=>{try{window.localStorage.setItem(Ar,JSON.stringify([...Fr]))}catch{}},[Fr]);const[Vr,Wr]=Dn(()=>{if("undefined"==typeof window)return{...h};try{const e=window.localStorage.getItem(Rr);if(!e)return{...h};const n=JSON.parse(e);return{left:m(Number(n.left)||h.left,"left"),right:m(Number(n.right)||h.right,"right")}}catch{return{...h}}});Vn(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(Rr,JSON.stringify(Vr))}catch{}},300);return()=>clearTimeout(e)},[Vr]);const Hr=Wn((e,n)=>Wr(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),Ur=Wn(e=>Hr("left",e),[Hr]),Jr=Wn(e=>Hr("right",e),[Hr]),Xr=e=>Fr.has(e),Yr=e=>Dr(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),Gr=Rn(!1),Kr=Rn(null);Vn(()=>{if(Gr.current&&!Zo){const e=Kr.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??Ho.current?.querySelector(`button[aria-label="${CSS.escape(io.add.title)}"]`))?.focus(),Kr.current=null}Gr.current=Zo},[Zo]),Vn(()=>{if(!Zo||!Xo)return;const e=e=>{"Escape"===e.key&&gl()};return Xo.addEventListener("keydown",e),()=>Xo.removeEventListener("keydown",e)},[Zo,Xo]),me(Zo,()=>gl()),Vn(()=>{!xo&&Zo&&(_o(!1),nr(null),qo.current=!1)},[xo]);const Qr=G(),Zr=(e,n="success",t)=>{if(Qr)return void(t?Qr(e,"error"===n?"error":"info",t):Qr(e,"error"===n?"error":"info"));const o={sound:!1,action:t?.action,onClose:t?.onClose};"error"===n?Qn.error(e,{...o,duration:t?.duration??3200}):Qn.success(e,{...o,duration:t?.duration??1900})},_r=Le(gr.mainAction??{label:io.done,onPress:()=>{nt(ko.getState().appState.data)}}),qr=Rn(Zr);qr.current=Zr,Vn(()=>Ae(ko,()=>qr.current(io.writeLate,"error")),[ko,io]);const ei=Rn(null),[ni,ti]=Dn(0),[oi,ri]=Dn(0),ii=K(),li=Rn(null),si=e=>Math.max(0,e.clientHeight-(li.current?.offsetHeight??0));Vn(()=>{const e=ei.current;if(!e)return;const n=()=>{ti(e.clientWidth),ri(si(e))};n();const t=new ResizeObserver(n);return t.observe(e),li.current&&t.observe(li.current),()=>t.disconnect()},[]),Hn(()=>{ei.current&&(ti(ei.current.clientWidth),ri(si(ei.current)))},[Vr,xo,zo]);const di=Po===Io?ni>0?ni:Oo[Io]:Oo[Po],ai=ni>0?Math.min(ni/di,"shrink"===No?1:2):1,ci=di*ai,pi=ni>0&&ci>ni+1,ui={width:ci,height:oi||"100%",flex:"none",position:"relative"},fi={width:di,height:oi?oi/ai:"100%",maxHeight:"none",transform:1!==ai?`scale(${ai})`:void 0,transformOrigin:"top left"},hi=()=>Wt({type:"setUi",ui:{leftSideBarVisible:!xo}}),mi=()=>Wt({type:"setUi",ui:{rightSideBarVisible:!zo}}),gi=e=>{Zo&&(_o(!1),nr(null),qo.current=!1,xo&&Ro===e)||(Fo(e),xo||Wt({type:"setUi",ui:{leftSideBarVisible:!0}}))},yi=()=>{ir(eo??V),zo||Wt({type:"setUi",ui:{rightSideBarVisible:!0}})},bi=Vt.data.content??[],vi=()=>{const e=bi.findIndex(no),n=bi.findIndex(to);return{floor:e>=0?e+1:0,cap:n>=0?n:bi.length}},ki=Xt,Si=br.stripCopy,wi=e=>o(e,Si),xi=pe(),zi=Ze({data:Vt.data,config:ki,readOnly:Boolean(jt),clipboard:xi,strip:Si?e=>Si(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==Tn||e.slot!==Mn)return{min:0,max:n-1};const{floor:t,cap:o}=vi();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&ir(V);const t=void 0===n||"node"===n?.kind?n:null;So.commitDocument(e,t)}}),Ci=fe(),[Oi,Bi]=Dn(null),Ii=e=>{const n=bi.find(n=>String(n.props.id)===e),t=Yt.shared;n&&t&&zi.swap(e,t.detach(n))},Ni=e=>{const n=Ln(Vt.data,Xt,e);if(!n)return!1;const t=jn(n.place),o=n.node,r=t===Oe?ji(o):Ki(o),i=t===Oe?Yt.shared?.usedOn(o):null;return!!zi.remove(e)&&(Zr(i?io.shared.removed({count:Math.max(0,i.length-1)}):io.deleted({name:r}),"success",{duration:8e3,action:{label:io.bar.undo,onClick:()=>{zi.restore(n.node,n.place)}}}),!0)},Pi={...zi,remove:Ni},$i=e=>Br(e,"block",Xt.components[e]?.label??e),Ti=Wn(e=>Xt.components[e]?.defaultProps??{},[Xt]),Mi=e=>Br(e,"section",$i(e)),ji=e=>we({type:e.type,props:e.props??{}},Mi(e.type),Pr),{nodeAddresses:Ei,zoneItems:Li}=Fn(()=>{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>=Ie)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of Ne(Xt,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(bi,Oe,0),{nodeAddresses:e,zoneItems:n}},[bi,Xt]),Ai=Wn(e=>Li.get(e)??[],[Li]),Ri=e=>{const n=Ei.get(e);return n?Ai(n.zone)[n.index]:void 0},Fi=e=>oe(br,Xt,e),Di=e=>{if(!br.slotsOf||e===Oe)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=Ri(e.slice(0,n));if(!t)return null;const o=Fi(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}},Vi=(()=>{if(!Q(rr))return null;const e=`${rr.nodeId}:${rr.slot}`;return Di(e)?.slot.panel===rr.kind?e:null})(),Wi=Rn(null);Vn(()=>{const e=Wi.current;if(Wi.current=null,!Vi||!Q(rr))return;const n=rr.nodeId;cr(n,{scroll:e!==Vi}),Dr(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[rr]);const Hi=e=>{const n=Ei.get(e);n&&(n.zone===Oe?al(n.index):Ll(n.zone,n.index,e,Ri(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))},Ui=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void Hi(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&Vi!==i&&(Wi.current=i),hr(null,r),zo||Wt({type:"setUi",ui:{rightSideBarVisible:!0}}),l(o)},Ji=(e,n,t)=>{const o=`${e}:${n}`;if(Dr(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;Vi!==o&&(Wi.current=o);hr(null,{kind:t,nodeId:e,slot:n})},Xi=(e,n,t)=>{if(jt||!br.moveSlot)return;const o=Ri(e),r=o?Fi(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:Ct,index:n},s=Sn(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=br.moveSlot(e,n,s);"string"==typeof d&&Ji(e,d,i.panel)},Yi=Nr(),Gi=Fn(()=>{const e=/* @__PURE__ */new Map;for(const n of Yi??[])e.set(n.slug,n.name);return e},[Yi]),Ki=e=>xe(e,$i,Or.plainText,e=>Gi.get(e),Or.rowName),Qi=(e,n)=>{const t=Xt.components[e.type]?.fields,o=n===Oe||ds(n)?"section":"block",r=n===Oe&&(no(e)||to(e)||Zt(e.type)),i="block"===o?ze(t):r?null:Ce(t);return Or.renamePropOf?Or.renamePropOf(e,o,i):i},Zi=(e,n,t,o)=>{if(!(!jt&&jr?.zone===e&&jr.index===n))return;const r=(t,o)=>{Er(null),o&&((e,n,t)=>{const o=Ai(e)[n];if(!o)return;const r=Qi(o,e);r&&So.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
14
+ return ft("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":io.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)},_i=i(Z(),uo),qi=_i.scope({target:Pn,siteId:et,docId:Xn}),el=Xt,nl=(e,n)=>n===Oe?Mi(e):$i(e),tl=(e,n,t)=>{const o=_i.plan(qi,t,nl(t.type,e),el);o&&(o.changed&&So.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),Zr(o.message))},ol=ue({nodesIn:Ai,nodeAt:(e,n)=>Ai(e)[n]??null,labelOf:(e,n)=>n===Oe?Mi(e):$i(e),renamePropOf:Qi,beginRename:(e,n)=>Er({zone:e,index:n}),history:{hasPast:Ht.hasPast,hasFuture:Ht.hasFuture,back:()=>Ht.back(),forward:()=>Ht.forward()},openPageStyles:gr.openPageStyles,pageStylesLabel:io.pageStyles,words:{menu:po,styleClipboard:uo,screen:io.menu},readOnly:Boolean(jt),collapseAll:()=>Dr(new Set(Ai(Oe).map(e=>String(e.props.id)))),onPasteRefused:e=>Zr(e?io.pasteRefused({name:e.label}):io.menu.clipboardRefused,"error"),canPasteAt:(e,n)=>ps(e,n),copyItem:gr.onCopyItem,menuRows:(e,n,t)=>{const o=gr.menuRows?.(e,n,t)??null,r=((e,n)=>{const t=Yt.shared;if(!t||n!==Oe)return null;const o=t.usedOn(e);if(o){const n={pick:[{label:io.shared.onPages({count:o.length}),onClick:()=>{},children:o.map(e=>({label:e.title,onClick:()=>t.openPage(e)}))}]};return jt||vr(e.type,e)?n:{...n,change:[{label:io.shared.detach,onClick:()=>Ii(e.props.id)}],remove:[{label:io.shared.removeFromPage,danger:!0,onClick:()=>{Ni(e.props.id)}}]}}return jt||no(e)||to(e)||Zt(e.type)?null:O(Ci)?{change:[{label:io.shared.makeShared,onClick:()=>Bi({id:e.props.id,name:ji(e)})}]}:null})(e,n);if(!r)return o;return Object.fromEntries(["pick","make","change","remove"].map(e=>[e,[...o?.[e]??[],...r[e]??[]]]).filter(([,e])=>e.length>0))},isLocked:e=>vr(e.type,e),duplicateBlocked:e=>kr(Vt.data,e),permits:e=>{const n=Be(Xt,e.type);return Yt.shared?.usedOn(e)?{...n,delete:!1}:n},nodeOps:Pi,isPinned:(e,n)=>n===Oe&&(no(e)||to(e)),sectionBand:vi,locate:e=>Ei.get(e)??null,rowNameOf:(e,n)=>n===Oe?ji(e):Ki(e),selectAt:(e,n,t,o)=>{e===Oe?al(n):Ll(e,n,t,o??"")},slotRung:e=>{const n=Di(e);return n?.slot.panel?{label:n.slot.label,select:()=>Ui(n.node,n.slot,!1)}:null},style:{held:()=>ve(qi),canCopy:e=>_i.rows(el,e).some(e=>!1!==e.counted),copy:(e,n)=>_i.copy(qi,e,nl(e.type,n),el),paste:(e,n,t)=>tl(e,n,t)},keys:At?{target:Xo,selected:()=>{const e=Vt.ui.itemSelector;return e?{zone:e.zone??Oe,index:e.index}:null},held:()=>xi.get(),readOnly:Boolean(jt),onDone:({done:e,name:n})=>{"copied"===e&&Zr(io.copied({name:n}))}}:void 0},Uo),rl=Rn({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});Vn(()=>{rl.current={copy:(e,n)=>_i.copy(qi,e,nl(e.type,n),el),paste:tl,at:()=>{const e=Vt.ui.itemSelector;if(!e)return null;const n=e.zone??Oe,t=Ai(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean(jt)}});const il=Wn(e=>{const n=ke(e);if(!n)return;const t=rl.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))},[]);Vn(()=>{if(!Xo)return;const e=e=>il(e);return Xo.addEventListener("keydown",e),()=>Xo.removeEventListener("keydown",e)},[il,Xo]),On(Uo,"keydown",il);const ll=bi.map(e=>e.props.id).join("|");Vn(()=>{const e=Uo?.document??null,n=Uo?.window??null;let t=0;const o=[],r=()=>{if(!e)return void or(e=>e.length?[]:e);const n=bi.findIndex(to),t=n>=0?n:bi.length,o=n=>{const t=bi[n]?.props?.id;return null==t?null:$n(e,`[data-easel-block="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(zn)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=bi.length>0&&!no(bi[0])?0:1;e<=t;e++){const n=o(e),t=o(e-1),l=n?.getBoundingClientRect()??null,s=t?.getBoundingClientRect()??null;if(!l&&!s)continue;const d=zt(l&&s?(s.bottom+l.top)/2:l?0===e?l.top+12:l.top:s.bottom,Math.max(0===e?0:-1/0,...r(t).map(e=>e.bottom)),Math.min(1/0,...r(n).map(e=>e.top)));d&&i.push({...d,index:e})}or(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()}},[Uo,ll,Po,ai,xo,zo,Ut?.props.id]);const sl=Uo?.document??null,dl=Uo?.window??null;Vn(()=>{const e=Wo.current;if(!e||!sl||!dl)return;const n=[],t=()=>{const n=$n(sl,`[data-easel-block="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&dl.scrollTo({left:dl.scrollX,top:dl.scrollY+t,behavior:"instant"}),!0};return Wo.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[sl,dl]);const al=e=>{ir(V),So.select({index:e}),gr.sectionPressed?.(bi[e]);const n=bi[e]?.props?.id;n&&l(n)},cl=e=>{const{floor:n,cap:t}=vi(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=Ut&&rr.kind!==eo?.kind?bi.findIndex(e=>e.props.id===Ut.props.id):-1;return o(r>=0?r+1:t)},pl=(e,n)=>{const{floor:t,cap:o}=vi(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(So.reorderComponent(Oe,e,i),So.select({index:i}),{moved:!0,dest:i})},ul=(e,n,t,o)=>{ir(V),So.select(o?{index:o.index,zone:o.zone}:{index:e}),l(n),Zr(io.sectionAdded({name:t}))},fl=(e,n)=>{const t=cl(n),o=wr(e,{nodeDefaults:Ti,newNodeId:$e,sectionLabel:Mi,blockIsOffered:zr}),r=o?So.insertNode(Oe,t,o):So.insertSection(e,t);return ul(t,r,Mi(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:a}of Ne(Xt,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=xr(e.type,l,d.slice(d.lastIndexOf(":")+1),Cr(e)),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:a,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},hl=e=>ml(Oe,e),ml=(e,n)=>{Kr.current=document.activeElement??null,nr(null===n?null:{zone:e,index:n}),_o(!0),xo||(qo.current=!0,Wt({type:"setUi",ui:{leftSideBarVisible:!0}}))},gl=()=>{_o(!1),nr(null),qo.current&&Wt({type:"setUi",ui:{leftSideBarVisible:!1}}),qo.current=!1},yl=(e,n)=>Or.rowName?n?no(e)?Or.rowName(e,"section",io.header):to(e)?Or.rowName(e,"section",io.footer):Zt(e.type)?Or.rowName(e,"section",$i(e.type)):ji(e):Ki(e):n?Mi(e.type):$i(e.type),bl=e=>n=>{e()},vl=(e,n,t)=>{if(jt)return null;const o=Ai(e)[n];return o&&!Be(Xt,o.type).delete||o&&vr(o.type,o)?null:/* @__PURE__ */ft(Xe,{kind:"delete",label:e===Oe&&o&&Yt.shared?.usedOn(o)?io.shared.removeFromPage:io.deleteNamed({name:t}),onClick:()=>((e,n)=>{const t=Ai(e)[n]?.props?.id;null!=t&&Ni(String(t))})(e,n),children:/* @__PURE__ */ft(dt,{size:15})})},kl=e=>Or.rowPreview?.(e)||void 0,Sl=e=>Or.rowMarks?.(e)??void 0,wl=(e,n,t)=>Or.rowActions?.(e,n,t)??null,xl=(e,n,t,o)=>{if(jt)return null;if(vr(t.type,t))return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
15
+ return ft(Xe,{kind:"eye",label:r?io.showNamed({name:o}):io.hideNamed({name:o}),onClick:()=>Cl(e,n,t),children:/* @__PURE__ */ft(r?at:ct,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},zl=e=>sd(Oe,e),Cl=(e,n,t)=>{So.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},Ol=e=>Pe(Xt,e),Bl=e=>Ne(Xt,e),Il=e=>br.slotsOf?Fi(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:Te(e,n.slot)})):[{slot:null,rung:null,kids:re(Xt,e)}],Nl=e=>br.slotsOf?Il(e).flatMap(e=>e.kids):re(Xt,e),Pl=e=>Boolean(br.slotsOf)&&Fi(e).some(e=>e.rung),$l=(e,n,t)=>xr(e.type,n,t??void 0,Cr(e)),Tl=(e,n,t)=>{const o=Me(Xt,e.type,n)&&(t||Nl(e).length>0||Pl(e));return{collapsible:o,folded:o&&Xr(String(e.props.id))}},Ml=(e,n,t)=>Il(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>Tl(e,r,t(e.type)).collapsible?[String(e.props.id),...Ml(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),jl=e=>Nl(e).length>0||Pl(e)||Boolean(xr(e.type)),El=e=>Boolean(xr(e)),Ll=(e,n,t,o)=>{if(ir(V),xr(o)?.spec?.slider){const t=e.split(":")[0];s(t,n),So.select({index:n,zone:e}),l(t)}else So.select({index:n,zone:e}),l(t)},Al=(e,n,t,o,r)=>{const i=`${e}:${n}`;So.insertComponent(i,t,o),xr(r)?.spec?.slider?requestAnimationFrame(()=>{s(e,o),So.select({index:o,zone:i})}):So.select({index:o,zone:i})},Rl=Rn(/* @__PURE__ */new Set);Vn(()=>{bi.forEach(e=>{const n=xr(e.type)?.spec;if(!n)return;const t=e.props.id;if(Rl.current.has(t))return;Rl.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(Ti)).forEach((e,t)=>bo.seedChild(o,t,n.childType,e))})},[bi,bo,Ti]);const Fl=Rn(/* @__PURE__ */new Set);Vn(()=>{bi.forEach((e,n)=>{const t=e.props.id;if(Fl.current.has(t))return;const o=r(e,Ol(e.type));Fl.current.add(t),o&&bo.replaceComponent(Oe,n,{...e,props:o})})},[bi,bo]),_(bo,Xt);const Dl=bi.findIndex(to),Vl=Dl>=0?bi[Dl]:null,Wl=oo?bi.findIndex(no):-1,Hl=Wl>=0?bi[Wl]:null,Ul=Yt.groupTab,Jl=Fn(()=>Ul?e=>Zt(e.type):void 0,[Ul]),Xl=Boolean(Yt.groupBadge),Yl=Yt.sharedReach,Gl=e=>Yl?.(e)??void 0,Kl=Fn(()=>Yl?new Set(bi.filter(e=>Gl(e)).map(e=>String(e.props.id))):null,[bi,Yl]),Ql=Fn(()=>Kl?e=>Kl.has(e):void 0,[Kl]),Zl=Yt.first?Yl?.({type:Yt.first,props:{id:""}})??void 0:void 0,_l=Yt.groupBadge?/* @__PURE__ */ft("span",{className:"es-tree-group-badge",children:/* @__PURE__ */ft(Yn,{tone:"info",size:"xs",children:Yt.groupBadge})}):void 0,ql=bi.find(e=>e.type===Kt)??null,es=bi.find(e=>e.type===Qt)??null,ns=Dl>=0?Dl:bi.length,ts=[];bi.forEach(e=>{to(e)||(jl(e)&&ts.push(String(e.props.id)),ts.push(...Ml(e,1,El)))}),Vl&&(ts.push(String(Vl.props.id)),ts.push(...Ml(Vl,1,El)));const os=ts.length>0&&ts.every(e=>Fr.has(e)),rs=e=>{const n=Or.blockRowName(e,$i);return Or.rowName?Or.rowName(e,"block",n):n},is=(e,n,t,o)=>{const r=Ai(e)[t];if(!r)return;const i={...En(e),index:t},l={...En(n),index:Math.min(Math.max(o,0),Ai(n).length)},s=Sn(i,l);if(e!==n||s!==t)try{zi.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof An))throw e}},ls=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of Bl(e))n.add(r),t(o)};for(const t of Ol(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},ss=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=Ei.get(n);if(!e)return null;if(e.zone===Oe)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},ds=e=>{const n=e.slice(0,e.indexOf(":")),t=bi.find(e=>Zt(e.type)&&String(e.props.id)===n);return t&&_t(n)===e?t:null},as=(e,n)=>{const t=ds(e);return!t||(!Yt.groupAccepts||Yt.groupAccepts(t.type,n,Ai(e).length))},cs=(e,n,t)=>{if(e.rung){const t=Ri(e.rung.nodeId),o=t?Fi(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===Ct&&n.index>=0&&n.index<=o}if(n.slot===Ct)return!1;if(e.add)return hs(e.add,n);const o=jn(n);if(Zt(e.type))return!1;const r=ds(o),i=ds(e.zone);if(r||i)return!(!r||!i)&&(!(r!==i&&!as(o,e.type))&&(n.index>=0&&n.index<=Ai(o).length));if(e.zone===Oe||o===Oe){if(e.zone!==o)return!1;const{floor:t,cap:r}=vi();return n.index>=t&&n.index<=r}if(n.index<0||n.index>Ai(o).length)return!1;if(e.zone===o)return!0;const l=Vl&&!Yt.lastIsOpen?String(Vl.props.id):null;return(!l||ss(e.zone)!==l&&ss(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??Ai(e)[t];if(!r)return!1;const i=n.split(":")[0],l=Ei.get(i),s=l?Ai(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&ls(r).has(n))return!1;const d=xr(s.type,Sr(Vt?.data,s.type,i),n.slice(n.lastIndexOf(":")+1),Cr(s));return!!d&&(!!(d.choices?d.choices.some(e=>e.type===r.type):d.spec?.childType===r.type)&&!d.spec?.addBlocked?.(Ai(n),r))})(e.zone,o,e.index,t)},ps=(e,n)=>{const t=jn(e.from),o=e.node;return t===jn(n)?as(t,o.type):cs({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},us=e=>{const n=e.slice(0,e.indexOf(":")),t=Ei.get(n),o=t?Ai(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=xr(o.type,Sr(Vt?.data,o.type,n),e.slice(e.lastIndexOf(":")+1),Cr(o));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:$i(r.spec.childType)}]:[])),l=Di(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:yl(o,t.zone===Oe)}},fs=(e,n)=>{if("section"!==e.kind)return e;const t=jn(n);return t===Oe||ds(t)?e:us(t)?.choices.some(n=>n.type===e.type)?{kind:"block",type:e.type}:e},hs=(e,n)=>{const t=fs(e,n),o=jn(n);if("shared"===t.kind){if(o!==Oe||!Yt.shared?.nodeOf(t.section))return!1;const{floor:e,cap:r}=vi();return n.index>=e&&n.index<=r}if("block"!==t.kind){if(ds(o)){if("preset"===t.kind)return!1;const e="section"===t.kind?t.type:t.template.node.type;return as(o,e)&&n.index>=0&&n.index<=Ai(o).length}if(o!==Oe)return!1;const{floor:e,cap:r}=vi();return n.index>=e&&n.index<=r}if(o===Oe)return!1;const r=us(o);return!(!r||!r.choices.some(e=>e.type===t.type))&&!r.target.spec?.addBlocked?.(Ai(o))},ms=(e,n)=>{const t=fs(e,n);if("block"!==t.kind&&ds(jn(n)))return void((e,n,t)=>{const o="section"===e.kind?e.type:"template"===e.kind?e.template.node.type:null;if(o&&as(n,o)){if("section"===e.kind)So.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;So.insertNode(n,t,wi(e.template.node))}ir(V),So.select({index:t,zone:n})}})(t,jn(n),n.index);if("section"===t.kind)return void fl(t.type,n.index);if("template"===t.kind)return void((e,n,t)=>{const o=cl(t),r=So.insertNode(Oe,o,n);ul(o,r,e)})(t.template.name,wi(t.template.node),n.index);if("preset"===t.kind)return void((e,n,t)=>{const o=n({nodeDefaults:Ti,newNodeId:$e,sectionLabel:Mi,blockIsOffered:zr});if(!o)return;const r=cl(t),i=So.insertNode(Oe,r,o);ul(r,i,e)})(t.preset.label,t.preset.insert,n.index);if("shared"===t.kind){const e=Yt.shared?.nodeOf(t.section);if(!e)return;const o=cl(n.index);return void(zi.restore(e,{parentId:Tn,slot:Mn,index:o})&&ul(o,e.props.id,t.section.title))}const o=jn(n),r=us(o);r&&(r.target.spec?Al(r.parentId,r.target.slot,t.type,n.index,r.parent.type):((e,n,t)=>{So.insertComponent(e,n,t),ir(V),So.select({index:t,zone:e})})(o,t.type,n.index))},gs=(e,n)=>{e.media?function(e){const n=td();if(!n||!qs)return;rd(n).then(n=>{n&&function(e,n){if(!qs)return;const t=qs.create(e,{nodeDefaults:Ti,newNodeId:$e,sectionLabel:Mi,blockIsOffered:zr}),o=jn(n);if(o===Oe){const e=cl(n.index),o=So.insertNode(Oe,e,t);return void ul(e,o,Mi(t.type))}So.insertNode(o,n.index,t),ir(V),So.select({index:n.index,zone:o})}(n,e)})}(n):e.rung?Xi(e.rung.nodeId,e.index,n.index):e.add?ms(e.add,n):e.zone===Oe?pl(e.index,n.index):is(e.zone,jn(n),e.index,n.index)},[ys]=Dn(()=>vn()),bs=kn({keyOf:e=>e.id,readOnly:Boolean(jt),session:ys,canDrop:cs,onDrop:gs,onStep:(e,n)=>{e.rung?Xi(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===Oe?((e,n)=>{const t=Mi(bi[e]?.type??""),o=pl(e,n<0?e-1:e+2);if(!o.moved)return void Zr(n<0?io.sectionFirst({name:t}):io.sectionLast({name:t}));const{floor:r,cap:i}=vi();Zr(io.sectionMoved({name:t,n:o.dest-r+1,total:i-r}))})(e.index,n):is(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),vs=Wn(e=>{const{floor:n,cap:t}=vi(),o=[];for(const r of e.nodes){const e=jn(r.place),i=Ai(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(no(i)||to(i)||vr(i.type,i))continue;if(Zt(i.type))continue;const l=Boolean(ds(e)),s=e===Oe||l;e===Oe&&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?Mi(i.type):Ki(i),from:r.place})}const r=e.zones.flatMap(e=>{const n=jn(e.list);if(n===Oe&&0===e.children.length)return[{...e,addLabel:io.addSection,addAlways:!0}];const t=us(n),o=t?.target.spec?.addLabel;return e.children.length>0||Boolean(t?.choices.length)||Boolean(ds(n))?[o?{...e,addLabel:o}:e]:[]}),i=r.flatMap(e=>{const n=jn(e.list),t=n===Oe||ds(n)?null:us(n);return t?.choices.length?mn(e,t.target.spec?.addLabel??io.addBlockHere):[]});return{sources:o,zones:r,seams:i}},[Vt.data]),ks=null==Ut?.props.id?null:String(Ut.props.id),Ss=Un(Re),ws=Ss?.selected()&&Uo?.document&&ks?Ss.selectedPart?.(Uo.document)??null:null,xs=ws&&ks&&Fe(Vt.data,Xt,ks,ws)?ws:null,zs=xs?.label?{element:xs.element,label:xs.label}:null,Cs=null!==xs,Os=Wn(e=>{const n=Xt,t=e=>!e.item.rung&&null!==Ln(Vt.data,n,e.item.id),o=e[e.length-1];if(!t(o))return o;const r=n=>e.find(e=>t(e)&&e.item.id===n),i=r(ks);return i?Cs?null:i:r(_e(Vt.data,n,o.item.id,ks,Jl))??o},[Vt.data,Xt,ks,Jl,Cs]),[Bs,Is]=Dn(null),[Ns,Ps]=Dn(null),[$s,Ts]=Dn(null),Ms=Or.canvasTab,js=Boolean(Ul||Yl||Ms);On(Uo,"mouseover",e=>{if(!js)return;const n=Bn(e.target),t=n?vt(Vt.data,Xt,n):null;t!==Bs&&Is(t),Ms&&n!==$s&&Ts(n)}),On(Uo,"mouseout",e=>{js&&!e.relatedTarget&&(Is(null),Ts(null))});const Es=e=>no(e)||to(e)||Zt(e.type),Ls=e=>{const n=Zt(e.type)?$i(e.type):no(e)?io.header:to(e)?io.footer:null;return null===n?ji(e):Or.rowName?Or.rowName(e,"section",n):n},As=[];if(js){const e=ks?vt(Vt.data,Xt,ks):null;for(const n of/* @__PURE__ */new Set([e,Bs,Ns])){const e=n?bi.find(e=>String(e.props.id)===n):void 0;if(!e)continue;const t=no(e)||e.type===Kt,o=Gl(e);if(o){As.push({id:String(e.props.id),label:Ls(e),below:t,reach:o});continue}if(!Ul||!Es(e))continue;const r=Ul(e);r&&As.push({id:String(e.props.id),label:r,below:t})}for(const e of Ms?/* @__PURE__ */new Set([ks,$s]):[]){const n=e?Ri(e):void 0,t=n?Ms(n):null;t&&!As.some(n=>n.id===e)&&As.push({id:e,label:t,below:!1,above:!0})}}const Rs=fe(),Fs=Rn(null);Vn(()=>{const e=Yt.changeNotice;if(!e)return;const n=JSON.stringify(bi.filter(Es)),t=Fs.current;if(Fs.current={doc:Xn,bands:n,index:Ht.index},!t||t.doc!==Xn||t.bands===n)return;Ht.hasPast&&Ht.index>=t.index&&!bt.has(Rs)&&(bt.add(Rs),Zr(e,"success",{action:{label:io.bar.undo,onClick:()=>Ht.back()},duration:8e3}))},[bi]);const Ds=e=>{ir(V),So.select(e.zone===Oe?{index:e.index}:{index:e.index,zone:e.zone})},Vs=q(),Ws=()=>({data:Vt.data,device:Po,ops:So,inspector:mr}),Hs=Vs?.model,Us=Fn(()=>Hs?e=>Hs(e,vs(e),Ws()):vs,[Hs,vs,Po]),Js=Vs?.measure,Xs=Js?(e,n)=>Js(e,n,Ws()):void 0,Ys=Vs?.canDrop,Gs=Ys?(e,n)=>Ys(e,n,cs,Ws()):cs,Ks=Vs?.drop,Qs=Ks?(e,n)=>Ks(e,n,gs,Ws()):gs,Zs=Vs?.pick,_s=Zs?e=>Zs(e,Ds,Ws()):Ds,qs=Vs?.media??null,ed=Rn(null),nd=Fn(()=>qs?{id:gt,zone:"",index:-1,type:qs.adds.type,add:{kind:qs.adds.kind,type:qs.adds.type},media:!0}:null,[qs]);Vn(()=>{if(!nd||jt||"undefined"==typeof document)return;const e=e=>{(e=>Array.from(e.dataTransfer?.types??[]).includes(ot))(e)&&(ed.current=null,ys.start({key:gt,item:nd}))},n=e=>{ys.get()?.item.media&&(ed.current=Zn(e.dataTransfer))},t=()=>{ys.get()?.item.media&&ys.end()};return document.addEventListener("dragstart",e),document.addEventListener("drop",n,!0),document.addEventListener("dragend",t,!0),()=>{document.removeEventListener("dragstart",e),document.removeEventListener("drop",n,!0),document.removeEventListener("dragend",t,!0)}},[nd,jt,ys]);const td=()=>{const e=ed.current;return ed.current=null,e},od=ce(),rd=async e=>{if(!od)return e;const n=await od(e);return n?{...e,id:n.id,url:n.url}:null};const id=(e,n)=>{if(!qs)return;const t=Ln(ko.getState().appState.data,ki,n);if(!t)return;const o=t.node;So.replaceComponent(jn(t.place),t.place.index,{...o,props:{...qs.replace(o,e),id:o.props.id}})},ld=e=>{const n=jn(e),t=Di(n);t&&Ui(t.node,t.slot,!1),ml(n,e.index)},sd=(e,n)=>/* @__PURE__ */ft(Ye,{...jt?{}:bs.seam({place:{...En(e),index:n}})},`seam:${e}:${n}`),dd={rowClick:bl,isCollapsed:Xr,toggleCollapse:Yr},ad=e=>{const n=String(e.props.id),t=bi.findIndex(e=>String(e.props.id)===n),o=_t(n),r=Ai(o),i=Xr(n),l=$i(e.type),s=Or.rowName?Or.rowName(e,"section",l):l,d=e=>sd(o,e);/* @__PURE__ */
16
16
  return ht(mt,{children:[
17
- /* @__PURE__ */ft(He,{words:lo,icon:/* @__PURE__ */ft(Br,{type:e.type,size:13}),name:s,preview:kl(e),marks:Sl(e),onSelect:()=>al(t),nameSlot:Zi(Oe,t,n,s),selected:lr===n,badge:Xl(e)?void 0:_l,shared:Xl(e),actions:wl(e,Oe,t)??void 0,rowProps:{"data-node-id":n,onClick:bl(()=>al(t))},fold:{open:!i,label:"section",onToggle:()=>Gr(n)}}),!i&&/* @__PURE__ */ht(We,{children:[r.map((n,t)=>{const r=String(n.props.id),i=ji(n),l=jl(n),s=l&&Yr(r),a=()=>Ll(o,t,r,e.type),{rowProps:c,...p}=bs.row({item:{id:r,zone:o,index:t,type:n.type},place:{...En(o),index:t}},{"data-node-id":r,onClick:bl(a)});/* @__PURE__ */
17
+ /* @__PURE__ */ft(We,{words:lo,icon:/* @__PURE__ */ft(Ir,{type:e.type,size:13}),name:s,preview:kl(e),marks:Sl(e),onSelect:()=>al(t),nameSlot:Zi(Oe,t,n,s),selected:lr===n,badge:Gl(e)?void 0:_l,shared:Gl(e),actions:wl(e,Oe,t)??void 0,rowProps:{"data-node-id":n,onClick:bl(()=>al(t))},fold:{open:!i,label:"section",onToggle:()=>Yr(n)}}),!i&&/* @__PURE__ */ht(He,{children:[r.map((n,t)=>{const r=String(n.props.id),i=ji(n),l=jl(n),s=l&&Xr(r),a=()=>Ll(o,t,r,e.type),{rowProps:c,...p}=bs.row({item:{id:r,zone:o,index:t,type:n.type},place:{...En(o),index:t}},{"data-node-id":r,onClick:bl(a)});/* @__PURE__ */
18
18
  return ht(Jn,{children:[d(t),
19
- /* @__PURE__ */ft(He,{words:lo,icon:/* @__PURE__ */ft(Br,{type:n.type,size:13}),name:i,preview:kl(n),marks:Sl(n),onSelect:a,nameSlot:Zi(o,t,r,i),selected:lr===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>Gr(r)}:void 0,actions:/* @__PURE__ */ht(mt,{children:[vl(o,t,i),wl(n,o,t),xl(o,t,n,i)]}),rowProps:c}),l&&!s&&/* @__PURE__ */ft(We,{children:ud(n,2)})]},r)}),d(r.length)]})]})},cd=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=bs.dragging,d=!Yr(l)&&s?.rung?.nodeId!==i,a={...En(l),index:0},c=s&&!s.rung&&cs(s,a)?a:void 0,p=()=>Ui(e,n,!0),{rowProps:u,...f}=bs.row({item:{id:`rung:${l}`,zone:`${i}:${Ct}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:Ct,index:t},into:c,canDrag:Boolean(br.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:bl(p)}),h=jt?null:br.slotActions?.(e,n.slot);/* @__PURE__ */
19
+ /* @__PURE__ */ft(We,{words:lo,icon:/* @__PURE__ */ft(Ir,{type:n.type,size:13}),name:i,preview:kl(n),marks:Sl(n),onSelect:a,nameSlot:Zi(o,t,r,i),selected:lr===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>Yr(r)}:void 0,actions:/* @__PURE__ */ht(mt,{children:[vl(o,t,i),wl(n,o,t),xl(o,t,n,i)]}),rowProps:c}),l&&!s&&/* @__PURE__ */ft(He,{children:ud(n,2)})]},r)}),d(r.length)]})]})},cd=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=bs.dragging,d=!Xr(l)&&s?.rung?.nodeId!==i,a={...En(l),index:0},c=s&&!s.rung&&cs(s,a)?a:void 0,p=()=>Ui(e,n,!0),{rowProps:u,...f}=bs.row({item:{id:`rung:${l}`,zone:`${i}:${Ct}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:Ct,index:t},into:c,canDrag:Boolean(br.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:bl(p)}),h=jt?null:br.slotActions?.(e,n.slot);/* @__PURE__ */
20
20
  return ht(Jn,{children:[n.heading,
21
- /* @__PURE__ */ft(He,{words:lo,icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:Vi===l,...f,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>Gr(l)},actions:h&&h.length>0?/* @__PURE__ */ft(mt,{children:h.map((t,o)=>/* @__PURE__ */ft(Ye,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if(jt||t.disabled)return;const o=String(e.props.id),r=e=>{"string"==typeof e&&Ji(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__ */ft(dt,{size:15}):/* @__PURE__ */ft(ut,{size:15})},`${o}:${t.kind}`))}):void 0,rowProps:u}),d&&/* @__PURE__ */ft(We,{children:r})]},l)},pd=(e,n)=>{const t=Bl(e),o=t.filter(e=>e.rung).length;let r=0;/* @__PURE__ */
21
+ /* @__PURE__ */ft(We,{words:lo,icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:Vi===l,...f,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>Yr(l)},actions:h&&h.length>0?/* @__PURE__ */ft(mt,{children:h.map((t,o)=>/* @__PURE__ */ft(Xe,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if(jt||t.disabled)return;const o=String(e.props.id),r=e=>{"string"==typeof e&&Ji(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__ */ft(dt,{size:15}):/* @__PURE__ */ft(ut,{size:15})},`${o}:${t.kind}`))}):void 0,rowProps:u}),d&&/* @__PURE__ */ft(He,{children:r})]},l)},pd=(e,n)=>{const t=Il(e),o=t.filter(e=>e.rung).length;let r=0;/* @__PURE__ */
22
22
  return ft(mt,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=$l(e,void 0,t.slot),d=s?`${e.props.id}:${s.slot}`:null,a=null===t.slot?null:`${e.props.id}:${t.slot}`,c=(e,n)=>sd(e,n),p=/* @__PURE__ */ht(mt,{children:[i.map(({child:n,zone:t,index:o})=>{const r=lr===String(n.props.id),{collapsible:i,folded:s}=Tl(n,l,El(n.type)),d=String(n.props.id),a=rs(n),p=()=>Ll(t,o,d,e.type),{rowProps:u,...f}=bs.row({item:{id:d,zone:t,index:o,type:n.type},place:{...En(t),index:o}},{"data-node-id":d,onClick:bl(p)});/* @__PURE__ */
23
23
  return ht(Jn,{children:[0===o&&c(t,0),
24
- /* @__PURE__ */ft(He,{words:lo,icon:/* @__PURE__ */ft(Br,{type:n.type,size:13}),name:a,preview:kl(n),marks:Sl(n),onSelect:p,nameSlot:Zi(t,o,d,a),selected:r,hidden:Boolean(n.props._hidden),...f,fold:i?{open:!s,label:"group",onToggle:()=>Gr(d)}:void 0,actions:/* @__PURE__ */ht(mt,{children:[vl(t,o,a),wl(n,t,o),xl(t,o,n,a)]}),rowProps:u}),i&&!s&&/* @__PURE__ */ft(We,{children:pd(n,l+1)}),c(t,o+1)]},String(n.props.id??`${t}-${o}`))}),null===a?d&&!i.some(e=>e.zone===d)?c(d,0):null:0!==i.length||!t.rung&&d!==a?null:c(a,0)]});return t.rung?cd(e,t.rung,r++,o,p):/* @__PURE__ */ft(Jn,{children:p},t.slot??"")})})},ud=(e,n)=>{const t=Sr(Vt?.data,e.type,String(e.props.id)),o=Bl(e),r=o.filter(e=>e.rung).length;let i=0;/* @__PURE__ */
24
+ /* @__PURE__ */ft(We,{words:lo,icon:/* @__PURE__ */ft(Ir,{type:n.type,size:13}),name:a,preview:kl(n),marks:Sl(n),onSelect:p,nameSlot:Zi(t,o,d,a),selected:r,hidden:Boolean(n.props._hidden),...f,fold:i?{open:!s,label:"group",onToggle:()=>Yr(d)}:void 0,actions:/* @__PURE__ */ht(mt,{children:[vl(t,o,a),wl(n,t,o),xl(t,o,n,a)]}),rowProps:u}),i&&!s&&/* @__PURE__ */ft(He,{children:pd(n,l+1)}),c(t,o+1)]},String(n.props.id??`${t}-${o}`))}),null===a?d&&!i.some(e=>e.zone===d)?c(d,0):null:0!==i.length||!t.rung&&d!==a?null:c(a,0)]});return t.rung?cd(e,t.rung,r++,o,p):/* @__PURE__ */ft(Jn,{children:p},t.slot??"")})})},ud=(e,n)=>{const t=Sr(Vt?.data,e.type,String(e.props.id)),o=Il(e),r=o.filter(e=>e.rung).length;let i=0;/* @__PURE__ */
25
25
  return ft(mt,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=$l(e,t,o.slot),a=d?.spec??null,c=a&&Array.isArray(e.props[a.slot])?e.props[a.slot]:[],p=d&&d.choices?{slot:d.slot,choices:d.choices}:null,u=String(e.props.id),f=a&&!a.fixed?`${u}:${a.slot}`:null,h=p?`${u}:${p.slot}`:null,m=(e,n)=>sd(e,n),g=null===o.slot?null:`${u}:${o.slot}`,y=Boolean(a&&!a.fixed&&(null===g||g===f)),b=/* @__PURE__ */ht(mt,{children:[l.map(({child:n,zone:t,index:o})=>{const r=lr===String(n.props.id),i=Ki(n),l=String(n.props.id),{collapsible:d,folded:a}=Tl(n,s,El(n.type)),c=Ol(n.type),p=1===c.length?`${l}:${c[0]}`:null,u=p?{...En(p),index:Ai(p).length}:void 0,f=bs.dragging,h=u&&f&&cs(f,u)?u:void 0,g=()=>Ll(t,o,l,e.type),{rowProps:y,...b}=bs.row({item:{id:l,zone:t,index:o,type:n.type},place:{...En(t),index:o},into:h,canDrag:!vr(n.type,n)},{"data-node-id":l,onClick:bl(g)});/* @__PURE__ */
26
26
  return ht(Jn,{children:[0===o&&m(t,0),
27
- /* @__PURE__ */ft(He,{words:lo,icon:/* @__PURE__ */ft(Br,{type:n.type,size:13}),name:i,preview:kl(n),marks:Sl(n),onSelect:g,nameSlot:Zi(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...b,fold:d?{open:!a,label:"group",onToggle:()=>Gr(l)}:void 0,actions:vr(n.type,n)?wl(n,t,o)??void 0:/* @__PURE__ */ht(mt,{children:[vl(t,o,i),wl(n,t,o),xl(t,o,n,i)]}),rowProps:y}),d&&!a&&/* @__PURE__ */ft(We,{children:ud(n,s+1)}),m(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&a&&
28
- /* @__PURE__ */ft(z,{small:!0,label:a.addLabel,blocked:a.addBlocked?.(c)??null,onAdd:()=>Al(e.props.id,a.slot,a.childType,c.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?cd(e,o.rung,i++,r,b):/* @__PURE__ */ft(Jn,{children:b},o.slot??"")})})},fd=Zo,hd=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:xo&&!fd&&yr===e.id,onSelect:()=>gi(e.id)}:e,md=[...(gr.railLead??[]).map(hd),{id:"sections",label:io.layers,icon:/* @__PURE__ */ft(ge,{}),active:xo&&!fd&&"sections"===yr,onSelect:()=>gi("sections")},...(gr.railTrail??[]).map(hd)],gd=Mo?{onPress:jo}:Rt?{onPress:()=>{x(xn,{accept:"image/*",title:fo.mediaLibrary})}}:null,yd={value:md.find(e=>!0===e.active)?.id??"",press:e=>{const n=md.find(n=>n.id===e);n&&!n.disabled&&!0!==n.active&&n.onSelect?.()},items:md.map(e=>({id:e.id,icon:e.icon,label:/* @__PURE__ */ft("span",{className:"sr-only",children:e.label}),tooltip:e.label,disabled:e.disabled}))},bd=[...gr.railLead??[],...gr.railTrail??[]].find(e=>"panel"in e&&e.id===yr),vd=Boolean(ro?.foldable),kd=ro?.label??(Dt?io.pageSections:io.templateSections),Sd=vd&&Yr(Nt),wd=/* @__PURE__ */ht(mt,{children:[bi.map((e,n)=>{if(no(e)||to(e)||Zt(e.type))return null;const t=lr===String(e.props.id),o=Boolean(e.props._hidden);Nl(e);const r=String(e.props.id),i=gr.hasOwnRows?.(e)??!1,l=jl(e)||i,s=l&&Yr(r),d=Ol(e.type),a=1===d.length?`${r}:${d[0]}`:null,c=a?{...En(a),index:Ai(a).length}:void 0,p=bs.dragging,u=c&&p&&cs(p,c)?c:void 0,{rowProps:f,...h}=bs.row({item:{id:r,zone:Oe,index:n,type:e.type},place:{...En(Oe),index:n},into:u,canDrag:!vr(e.type,e)},{"data-node-id":r,onClick:bl(()=>al(n))});/* @__PURE__ */
27
+ /* @__PURE__ */ft(We,{words:lo,icon:/* @__PURE__ */ft(Ir,{type:n.type,size:13}),name:i,preview:kl(n),marks:Sl(n),onSelect:g,nameSlot:Zi(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...b,fold:d?{open:!a,label:"group",onToggle:()=>Yr(l)}:void 0,actions:vr(n.type,n)?wl(n,t,o)??void 0:/* @__PURE__ */ht(mt,{children:[vl(t,o,i),wl(n,t,o),xl(t,o,n,i)]}),rowProps:y}),d&&!a&&/* @__PURE__ */ft(He,{children:ud(n,s+1)}),m(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&a&&
28
+ /* @__PURE__ */ft(z,{small:!0,label:a.addLabel,blocked:a.addBlocked?.(c)??null,onAdd:()=>Al(e.props.id,a.slot,a.childType,c.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?cd(e,o.rung,i++,r,b):/* @__PURE__ */ft(Jn,{children:b},o.slot??"")})})},fd=Zo,hd=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:xo&&!fd&&yr===e.id,onSelect:()=>gi(e.id)}:e,md=[...(gr.railLead??[]).map(hd),{id:"sections",label:io.layers,icon:/* @__PURE__ */ft(ge,{}),active:xo&&!fd&&"sections"===yr,onSelect:()=>gi("sections")},...(gr.railTrail??[]).map(hd)],gd=Mo?{onPress:jo}:Rt?{onPress:()=>{x(xn,{accept:"image/*",title:fo.mediaLibrary})}}:null,yd={value:md.find(e=>!0===e.active)?.id??"",press:e=>{const n=md.find(n=>n.id===e);n&&!n.disabled&&!0!==n.active&&n.onSelect?.()},items:md.map(e=>({id:e.id,icon:e.icon,label:/* @__PURE__ */ft("span",{className:"sr-only",children:e.label}),tooltip:e.label,disabled:e.disabled}))},bd=[...gr.railLead??[],...gr.railTrail??[]].find(e=>"panel"in e&&e.id===yr),vd=Boolean(ro?.foldable),kd=ro?.label??(Ft?io.pageSections:io.templateSections),Sd=vd&&Xr(Bt),wd=/* @__PURE__ */ht(mt,{children:[bi.map((e,n)=>{if(no(e)||to(e)||Zt(e.type))return null;const t=lr===String(e.props.id),o=Boolean(e.props._hidden);Bl(e);const r=String(e.props.id),i=gr.hasOwnRows?.(e)??!1,l=jl(e)||i,s=l&&Xr(r),d=Ol(e.type),a=1===d.length?`${r}:${d[0]}`:null,c=a?{...En(a),index:Ai(a).length}:void 0,p=bs.dragging,u=c&&p&&cs(p,c)?c:void 0,{rowProps:f,...h}=bs.row({item:{id:r,zone:Oe,index:n,type:e.type},place:{...En(Oe),index:n},into:u,canDrag:!vr(e.type,e)},{"data-node-id":r,onClick:bl(()=>al(n))});/* @__PURE__ */
29
29
  return ht(Jn,{children:[n>0&&zl(n),
30
- /* @__PURE__ */ft(He,{words:lo,icon:/* @__PURE__ */ft(Br,{type:e.type,size:13}),name:ji(e),preview:kl(e),marks:Sl(e),shared:Xl(e),onSelect:()=>al(n),nameSlot:Zi(Oe,n,r,ji(e)),selected:t,hidden:o,...h,fold:l?{open:!s,label:"section",onToggle:()=>Gr(r)}:void 0,actions:/* @__PURE__ */ht(mt,{children:[vl(Oe,n,ji(e)),wl(e,Oe,n),xl(Oe,n,e,ji(e))]}),rowProps:f}),jl(e)&&!s&&/* @__PURE__ */ht(We,{children:[ud(e,1),gr.partRows?.(e,dd)]}),i&&!s&&/* @__PURE__ */ft(We,{children:gr.ownRows?.(e,n,dd)})]},String(e.props.id??n))}),ns>0&&zl(ns)]}),xd=(e,n,t)=>{const o=String(e.props.id),r=Il(e).length>0||Pl(e)||Boolean(xr(e.type)),i=r&&Yr(o),l="header"===t?io.header:io.footer,s=Or.rowName?Or.rowName(e,"section",l):l;/* @__PURE__ */
30
+ /* @__PURE__ */ft(We,{words:lo,icon:/* @__PURE__ */ft(Ir,{type:e.type,size:13}),name:ji(e),preview:kl(e),marks:Sl(e),shared:Gl(e),onSelect:()=>al(n),nameSlot:Zi(Oe,n,r,ji(e)),selected:t,hidden:o,...h,fold:l?{open:!s,label:"section",onToggle:()=>Yr(r)}:void 0,actions:/* @__PURE__ */ht(mt,{children:[vl(Oe,n,ji(e)),wl(e,Oe,n),xl(Oe,n,e,ji(e))]}),rowProps:f}),jl(e)&&!s&&/* @__PURE__ */ht(He,{children:[ud(e,1),gr.partRows?.(e,dd)]}),i&&!s&&/* @__PURE__ */ft(He,{children:gr.ownRows?.(e,n,dd)})]},String(e.props.id??n))}),ns>0&&zl(ns)]}),xd=(e,n,t)=>{const o=String(e.props.id),r=Nl(e).length>0||Pl(e)||Boolean(xr(e.type)),i=r&&Xr(o),l="header"===t?io.header:io.footer,s=Or.rowName?Or.rowName(e,"section",l):l;/* @__PURE__ */
31
31
  return ht(mt,{children:[
32
- /* @__PURE__ */ft(He,{words:lo,icon:/* @__PURE__ */ft(Br,{type:t,size:13}),name:s,preview:kl(e),marks:Sl(e),badge:Xl(e)?void 0:_l,shared:Xl(e),onSelect:()=>al(n),nameSlot:Zi(Oe,n,o,s),selected:lr===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>Gr(o)}:void 0,actions:wl(e,Oe,n)??void 0,rowProps:{"data-node-id":o,onClick:bl(()=>al(n))}}),r&&!i&&/* @__PURE__ */ft(We,{children:pd(e,1)})]})};return(gr.wrap??(e=>e))(
33
- /* @__PURE__ */ft(ee,{target:Uo,children:/* @__PURE__ */ht("div",{ref:Wo,className:"sf-editor es-editor",style:dn(Vr),onContextMenu:ol.onEditorContextMenu,...p(xn),children:[
32
+ /* @__PURE__ */ft(We,{words:lo,icon:/* @__PURE__ */ft(Ir,{type:t,size:13}),name:s,preview:kl(e),marks:Sl(e),badge:Gl(e)?void 0:_l,shared:Gl(e),onSelect:()=>al(n),nameSlot:Zi(Oe,n,o,s),selected:lr===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>Yr(o)}:void 0,actions:wl(e,Oe,n)??void 0,rowProps:{"data-node-id":o,onClick:bl(()=>al(n))}}),r&&!i&&/* @__PURE__ */ft(He,{children:pd(e,1)})]})};return(gr.wrap??(e=>e))(
33
+ /* @__PURE__ */ft(ee,{target:Uo,children:/* @__PURE__ */ht("div",{ref:Ho,className:"sf-editor es-editor",style:dn(Vr),onContextMenu:ol.onEditorContextMenu,...p(xn),children:[
34
34
  /* @__PURE__ */ht(qe,{children:[
35
- /* @__PURE__ */ht("div",{className:"es-cluster es-cluster--left",children:[gd?/* @__PURE__ */ft(Xn,{variant:"secondary",className:"es-barbtn",leftIcon:/* @__PURE__ */ft(ye,{}),onClick:gd.onPress,children:io.railMedia}):null,
36
- /* @__PURE__ */ft(en,{label:io.bar.undo,disabled:Boolean(jt)||!Wt.hasPast,onClick:()=>Wt.back(),children:/* @__PURE__ */ft(rt,{})}),
37
- /* @__PURE__ */ft(en,{label:io.bar.redo,disabled:Boolean(jt)||!Wt.hasFuture,onClick:()=>Wt.forward(),children:/* @__PURE__ */ft(it,{})})]}),
35
+ /* @__PURE__ */ht("div",{className:"es-cluster es-cluster--left",children:[gd?/* @__PURE__ */ft(Gn,{variant:"secondary",className:"es-barbtn",leftIcon:/* @__PURE__ */ft(ye,{}),onClick:gd.onPress,children:io.railMedia}):null,
36
+ /* @__PURE__ */ft(en,{label:io.bar.undo,disabled:Boolean(jt)||!Ht.hasPast,onClick:()=>Ht.back(),children:/* @__PURE__ */ft(rt,{})}),
37
+ /* @__PURE__ */ft(en,{label:io.bar.redo,disabled:Boolean(jt)||!Ht.hasFuture,onClick:()=>Ht.forward(),children:/* @__PURE__ */ft(it,{})})]}),
38
38
  /* @__PURE__ */ht(nn,{children:[
39
39
  /* @__PURE__ */ft(tn,{devices:Co,value:Po,onChange:$o}),
40
- /* @__PURE__ */ft(en,{label:io.bar.refresh,tip:io.bar.refreshTip,onClick:()=>{Ho.current=(()=>{const e=Uo?.document;if(!e)return null;const n=bi.findIndex(to),t=n>=0?n:bi.length;let o=null;for(let n=0;n<t;n++){const t=bi[n]?.props?.id;if(null==t)continue;const r=$n(e,`[data-easel-block="${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=Ut?.props?.id??bi[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),Vo(e=>e+1)},children:/* @__PURE__ */ft(lt,{})}),gr.barView?.()]}),
40
+ /* @__PURE__ */ft(en,{label:io.bar.refresh,tip:io.bar.refreshTip,onClick:()=>{Wo.current=(()=>{const e=Uo?.document;if(!e)return null;const n=bi.findIndex(to),t=n>=0?n:bi.length;let o=null;for(let n=0;n<t;n++){const t=bi[n]?.props?.id;if(null==t)continue;const r=$n(e,`[data-easel-block="${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=Ut?.props?.id??bi[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),Vo(e=>e+1)},children:/* @__PURE__ */ft(lt,{})}),gr.barView?.()]}),
41
41
  /* @__PURE__ */ht(nn,{kind:"right",style:{minWidth:300},children:[
42
- /* @__PURE__ */ft(v,{input:Ko,words:io.saveStatus}),Bn?/* @__PURE__ */ft(Bn,{}):null,gr.barLead?.(),gr.barTrail?.(),gr.mainAction||!gr.barMain?/* @__PURE__ */ft(k,{input:Ko,action:_r,readOnly:Boolean(jt),saveSwitch:Lt,onToggleAutoSave:Pt,onSaveNow:Qo,bar:io.bar,words:io.saveStatus}):gr.barMain()]})]}),
42
+ /* @__PURE__ */ft(v,{input:Ko,words:io.saveStatus}),In?/* @__PURE__ */ft(In,{}):null,gr.barLead?.(),gr.barTrail?.(),gr.mainAction||!gr.barMain?/* @__PURE__ */ft(k,{input:Ko,action:_r,readOnly:Boolean(jt),saveSwitch:Lt,onToggleAutoSave:Pt,onSaveNow:Qo,bar:io.bar,words:io.saveStatus}):gr.barMain()]})]}),
43
43
  /* @__PURE__ */ft(b,{}),
44
44
  /* @__PURE__ */ht("div",{className:"sf-body",children:[xo?/* @__PURE__ */ht(mt,{children:[
45
45
  /* @__PURE__ */ht("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":io.leftPanel,children:[
46
46
  /* @__PURE__ */ht("div",{className:"es-paneltabs es-paneltabs--with-hide",children:[
47
- /* @__PURE__ */ft(B,{side:"left",onHide:hi}),
47
+ /* @__PURE__ */ft(I,{side:"left",onHide:hi}),
48
48
  /* @__PURE__ */ft("span",{className:"es-paneltabs-divider","aria-hidden":"true"}),
49
- /* @__PURE__ */ft(Kn,{variant:"underline",block:!0,"aria-label":io.bar.views,value:yd.value,onChange:yd.press,items:yd.items})]}),Zo?/* @__PURE__ */ft(C,{at:er?{label:(e=>{const n=ds(e.zone);if(n)return io.add.addingTo({name:Or.rowName?yl(n,!0):$i(n.type)});if(e.zone===Oe){const n=bi[e.index];return n&&!to(n)?io.add.addingBefore({name:yl(n,!0)}):io.add.addingAtEnd}const t=us(e.zone);return t?io.add.addingTo({name:t.parentName}):io.add.addingHere})(er),onClear:()=>nr(null)}:void 0,placeBlocks:er&&er.zone!==Oe?us(er.zone)?.choices:void 0,canTake:er?e=>{if(!er)return null;const n={...En(er.zone),index:er.index};if(hs(e,n))return null;if("shared"===e.kind&&er.zone===Oe&&!Gt.shared?.nodeOf(e.section))return io.shared.alreadyHere;const t=ds(er.zone);if(t)return io.add.notInside({name:yl(t,!0)});if(er.zone===Oe)return io.add.onlySections;const o=us(er.zone);return o?io.add.notInside({name:o.parentName}):io.add.onlySections}:void 0,onPick:er?e=>{if(!er)return;const n={...En(er.zone),index:er.index};hs(e,n)&&(ms(e,n),gl())}:void 0,itemFor:e=>({id:`new:${e.kind}:${Ot(e)}`,zone:"",index:-1,type:"template"===e.kind?e.template.node.type:"shared"===e.kind?e.section.node.type:Ot(e),add:e}),session:ys,siteWide:gr.addPanelRow?.(gl),onClose:gl,readOnly:Boolean(jt)}):bd?bd.panel({onHide:hi,notify:Zr}):/* @__PURE__ */ht(mt,{children:[
50
- /* @__PURE__ */ft(I,{icon:/* @__PURE__ */ft(ge,{}),title:io.layers,context:ho,actions:/* @__PURE__ */ht(mt,{children:[!jt&&/* @__PURE__ */ft(on,{label:io.add.title,onClick:()=>hl(null),children:/* @__PURE__ */ft(st,{size:15})}),
51
- /* @__PURE__ */ft(on,{label:os?io.expandAll:io.collapseAll,title:0===ts.length?io.nothingToFold:void 0,disabled:0===ts.length,onClick:()=>Fr(e=>{const n=new Set(ts);return os?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...ts])}),children:/* @__PURE__ */ft(wt,{expand:os})})]})}),
52
- /* @__PURE__ */ht(Ue,{className:"sf-tree sf-scroll",words:lo,children:[ql&&/* @__PURE__ */ht(mt,{children:[!Yl&&/* @__PURE__ */ft(Je,{children:io.header}),ad(ql)]}),Ft&&!(Yl&&ql)&&/* @__PURE__ */ht(mt,{children:[!Yl&&/* @__PURE__ */ft(Je,{children:io.header}),!oo&&/* @__PURE__ */ft(He,{words:lo,icon:/* @__PURE__ */ft(Br,{type:"header",size:13}),name:io.header,badge:Zl?void 0:_l,shared:Zl,onSelect:yi,selected:rr.kind===eo?.kind,rowProps:{onClick:bl(yi)}})]}),Wl&&!(Yl&&ql)&&xd(Wl,Hl,"header"),!vd&&/* @__PURE__ */ft(Je,{children:kd}),vd?/* @__PURE__ */ht(mt,{children:[
53
- /* @__PURE__ */ft(He,{words:lo,icon:null,name:kd,fold:{open:!Sd,label:kd,onToggle:()=>Gr(Nt)}}),!Sd&&/* @__PURE__ */ft(We,{children:wd})]}):wd,Ft&&!Yl&&/* @__PURE__ */ft(Je,{children:io.footer}),Vl&&!(Yl&&es)&&xd(Vl,Fl,"footer"),es&&ad(es),gr.treeFoot?.()]})]})]}),
49
+ /* @__PURE__ */ft(Kn,{variant:"underline",block:!0,"aria-label":io.bar.views,value:yd.value,onChange:yd.press,items:yd.items})]}),Zo?/* @__PURE__ */ft(C,{at:er?{label:(e=>{const n=ds(e.zone);if(n)return io.add.addingTo({name:Or.rowName?yl(n,!0):$i(n.type)});if(e.zone===Oe){const n=bi[e.index];return n&&!to(n)?io.add.addingBefore({name:yl(n,!0)}):io.add.addingAtEnd}const t=us(e.zone);return t?io.add.addingTo({name:t.parentName}):io.add.addingHere})(er),onClear:()=>nr(null)}:void 0,placeBlocks:er&&er.zone!==Oe?us(er.zone)?.choices:void 0,canTake:er?e=>{if(!er)return null;const n={...En(er.zone),index:er.index};if(hs(e,n))return null;if("shared"===e.kind&&er.zone===Oe&&!Yt.shared?.nodeOf(e.section))return io.shared.alreadyHere;const t=ds(er.zone);if(t)return io.add.notInside({name:yl(t,!0)});if(er.zone===Oe)return io.add.onlySections;const o=us(er.zone);return o?io.add.notInside({name:o.parentName}):io.add.onlySections}:void 0,onPick:er?e=>{if(!er)return;const n={...En(er.zone),index:er.index};hs(e,n)&&(ms(e,n),gl())}:void 0,itemFor:e=>({id:`new:${e.kind}:${Ot(e)}`,zone:"",index:-1,type:"template"===e.kind?e.template.node.type:"shared"===e.kind?e.section.node.type:Ot(e),add:e}),session:ys,siteWide:gr.addPanelRow?.(gl),onClose:gl,readOnly:Boolean(jt)}):bd?bd.panel({onHide:hi,notify:Zr}):/* @__PURE__ */ht(mt,{children:[
50
+ /* @__PURE__ */ft(N,{icon:/* @__PURE__ */ft(ge,{}),title:io.layers,context:ho,actions:/* @__PURE__ */ht(mt,{children:[!jt&&/* @__PURE__ */ft(on,{label:io.add.title,onClick:()=>hl(null),children:/* @__PURE__ */ft(st,{size:15})}),
51
+ /* @__PURE__ */ft(on,{label:os?io.expandAll:io.collapseAll,title:0===ts.length?io.nothingToFold:void 0,disabled:0===ts.length,onClick:()=>Dr(e=>{const n=new Set(ts);return os?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...ts])}),children:/* @__PURE__ */ft(wt,{expand:os})})]})}),
52
+ /* @__PURE__ */ht(Ue,{className:"sf-tree sf-scroll",words:lo,children:[ql&&/* @__PURE__ */ht(mt,{children:[!Xl&&/* @__PURE__ */ft(Je,{children:io.header}),ad(ql)]}),Dt&&!(Xl&&ql)&&/* @__PURE__ */ht(mt,{children:[!Xl&&/* @__PURE__ */ft(Je,{children:io.header}),!oo&&/* @__PURE__ */ft(We,{words:lo,icon:/* @__PURE__ */ft(Ir,{type:"header",size:13}),name:io.header,badge:Zl?void 0:_l,shared:Zl,onSelect:yi,selected:rr.kind===eo?.kind,rowProps:{onClick:bl(yi)}})]}),Hl&&!(Xl&&ql)&&xd(Hl,Wl,"header"),!vd&&/* @__PURE__ */ft(Je,{children:kd}),vd?/* @__PURE__ */ht(mt,{children:[
53
+ /* @__PURE__ */ft(We,{words:lo,icon:null,name:kd,fold:{open:!Sd,label:kd,onToggle:()=>Yr(Bt)}}),!Sd&&/* @__PURE__ */ft(He,{children:wd})]}):wd,Dt&&!Xl&&/* @__PURE__ */ft(Je,{children:io.footer}),Vl&&!(Xl&&es)&&xd(Vl,Dl,"footer"),es&&ad(es),gr.treeFoot?.()]})]})]}),
54
54
  /* @__PURE__ */ft(rn,{side:"left",width:Vr.left,min:sn.left,max:ln,defaultWidth:h.left,label:io.resizeLeftPanel,onResize:Ur})]}):/* @__PURE__ */ft(P,{side:"left",onShow:hi}),
55
55
  /* @__PURE__ */ht("div",{ref:ei,className:"sf-center sf-scroll","data-sf-canvas-head":ii?"":void 0,style:{overflowX:pi?"auto":"hidden",overflowY:"hidden"},children:[ii&&/* @__PURE__ */ft("div",{ref:li,className:"sf-canvas-head",children:/* @__PURE__ */ft(ii,{device:Po})}),
56
56
  /* @__PURE__ */ht("div",{className:"sf-frame-scaler",style:ui,children:[
57
- /* @__PURE__ */ft("div",{className:"sf-frame "+(Po===Bo?"":`sf-frame--${Po}`),style:fi,children:/* @__PURE__ */ht("div",{className:"sf-preview-host",children:[
58
- /* @__PURE__ */ft(Fe.Provider,{value:Jl,children:/* @__PURE__ */ft(Ve.Provider,{value:Ql,children:/* @__PURE__ */ft(mo,{},Fo)})}),
59
- /* @__PURE__ */ft(gn,{canvas:Uo,session:ys,model:Us,measure:Ys,canDrop:Xs,onDrop:Qs,choose:Os,tag:zs,onPick:_s,dropOn:qs?{accepts:(e,n)=>{if(!e.media||!qs||n.item.rung)return!1;const t=Ln(Vt.data,ki,n.item.id);return null!==t&&qs.takes(t.node)},onDrop:(e,n)=>(e=>{const n=td();n&&qs&&rd(n).then(n=>{n&&id(n,e.item.id)})})(n),label:()=>io.canvasReplaceImage}:void 0,onZoneAdd:ld,onSeamAdd:ld,zoneAddLabel:io.canvasAddBlock,words:so.canvas,readOnly:Boolean(jt),revision:Vt.data}),tr.length>0&&!Jo&&/* @__PURE__ */ft("div",{className:"sf-preview-gaps",children:tr.map(e=>
60
- /* @__PURE__ */ft(yn,{index:e.index,label:io.addSectionHere,onInsert:()=>hl(e.index),className:void 0===e.height?"sf-preview-gap":"sf-preview-gap sf-preview-gap--tight",style:void 0===e.height?{top:e.top}:{top:e.top,height:e.height}},e.index))})]})}),js?/* @__PURE__ */ft(St,{canvas:Uo,tabs:As,onSelect:Wi,onPointer:Ps}):null]})]}),zo?/* @__PURE__ */ht(mt,{children:[In?
61
- /* @__PURE__ */ft("div",{className:"es-sidepanel es-sidepanel--right","data-es-host-panel":"",children:In}):/* @__PURE__ */ft(mt,{children:/* @__PURE__ */ft(u,{value:{selectChild:Ll,addChild:Al,childRowName:Ki,blockRowName:rs},children:/* @__PURE__ */ft(go,{mode:rr,onOpenWebsiteSettings:gr.openSettings??(()=>{}),onOpenSiteStyles:gr.openStyles,onOpenPageStyles:gr.openPageStyles,onSelectNode:Tr,onNotify:Zr,onHidePanel:mi,nodeActions:Ut?Ne(Yt,Ut.type):Bt})})}),
57
+ /* @__PURE__ */ft("div",{className:"sf-frame "+(Po===Io?"":`sf-frame--${Po}`),style:fi,children:/* @__PURE__ */ht("div",{className:"sf-preview-host",children:[
58
+ /* @__PURE__ */ft(De.Provider,{value:Jl,children:/* @__PURE__ */ft(Ve.Provider,{value:Ql,children:/* @__PURE__ */ft(mo,{},Do)})}),
59
+ /* @__PURE__ */ft(gn,{canvas:Uo,session:ys,model:Us,measure:Xs,canDrop:Gs,onDrop:Qs,choose:Os,tag:zs,onPick:_s,dropOn:qs?{accepts:(e,n)=>{if(!e.media||!qs||n.item.rung)return!1;const t=Ln(Vt.data,ki,n.item.id);return null!==t&&qs.takes(t.node)},onDrop:(e,n)=>(e=>{const n=td();n&&qs&&rd(n).then(n=>{n&&id(n,e.item.id)})})(n),label:()=>io.canvasReplaceImage}:void 0,onZoneAdd:ld,onSeamAdd:ld,zoneAddLabel:io.canvasAddBlock,words:so.canvas,readOnly:Boolean(jt),revision:Vt.data}),tr.length>0&&!Jo&&/* @__PURE__ */ft("div",{className:"sf-preview-gaps",children:tr.map(e=>
60
+ /* @__PURE__ */ft(yn,{index:e.index,label:io.addSectionHere,onInsert:()=>hl(e.index),className:void 0===e.height?"sf-preview-gap":"sf-preview-gap sf-preview-gap--tight",style:void 0===e.height?{top:e.top}:{top:e.top,height:e.height}},e.index))})]})}),js?/* @__PURE__ */ft(St,{canvas:Uo,tabs:As,onSelect:Hi,onPointer:Ps}):null]})]}),zo?/* @__PURE__ */ht(mt,{children:[Nn?
61
+ /* @__PURE__ */ft("div",{className:"es-sidepanel es-sidepanel--right","data-es-host-panel":"",children:Nn}):/* @__PURE__ */ft(mt,{children:/* @__PURE__ */ft(u,{value:{selectChild:Ll,addChild:Al,childRowName:Ki,blockRowName:rs},children:/* @__PURE__ */ft(go,{mode:rr,onOpenWebsiteSettings:gr.openSettings??(()=>{}),onOpenSiteStyles:gr.openStyles,onOpenPageStyles:gr.openPageStyles,onSelectNode:Tr,onNotify:Zr,onHidePanel:mi,nodeActions:Ut?Be(Xt,Ut.type):It})})}),
62
62
  /* @__PURE__ */ft(rn,{side:"right",width:Vr.right,min:sn.right,max:ln,defaultWidth:h.right,label:io.resizeSettingsPanel,onResize:Jr})]}):
63
63
  /* @__PURE__ */ft(P,{side:"right",onShow:mi})]}),ol.menu,
64
- /* @__PURE__ */ft(ie,{}),Oi?/* @__PURE__ */ft(yt,{name:Oi.name,onMake:e=>(async(e,n)=>{const t=bi.find(n=>String(n.props.id)===e),o=Gt.shared;if(!t||!o)return;let r;try{r=await N(Ci).create(n,t)}catch{return void Zr(io.shared.makeFailed,"error")}o.adopt(t,r),Ni(null)})(Oi.id,e),onCancel:()=>Ni(null)}):null]})}))}export{Pt as ScreenChrome};
64
+ /* @__PURE__ */ft(ie,{}),Oi?/* @__PURE__ */ft(yt,{name:Oi.name,onMake:e=>(async(e,n)=>{const t=bi.find(n=>String(n.props.id)===e),o=Yt.shared;if(!t||!o)return;let r;try{r=await B(Ci).create(n,t)}catch{return void Zr(io.shared.makeFailed,"error")}o.adopt(t,r),Bi(null)})(Oi.id,e),onCancel:()=>Bi(null)}):null]})}))}export{Pt as ScreenChrome};
@@ -0,0 +1,4 @@
1
+ import{useAccessPatch as e,FLAT_ACCESS as o,onDesktopWords as r,useAccessValue as t}from"./chunk-OGG6FMBA.js";import{noControlField as s,NoControlMark as l}from"./chunk-22I55W37.js";import{normalizeCornerSides as n,CORNER_SIDES as i}from"./chunk-PLTTPHK5.js";import{CornersInput as c,BorderInput as a,SettingsColour as d}from"./chunk-CLAADE4J.js";import{SettingsDefaultReset as u}from"./chunk-2T22IY3J.js";import{DEFAULT_PANEL_WORDS as p,DEFAULT_COLOUR_ROW_WORDS as y}from"./chunk-56ID6FKZ.js";import{SettingsField as h}from"./chunk-MIX7EGRG.js";import{useWords as f}from"./chunk-MFIRYGHW.js";import{CornerIcon as m,BorderAllIcon as b}from"efficient-shell/icons/efficient";import{jsx as w}from"react/jsx-runtime";var g=e=>e;function v(e,o){const r=o.twinAccess;return r?{key:e.key,access:r,ownField:r.ownField}:e}function k(e,r){const s=!e.access||e.ownField?{value:r.value,onChange:r.onChange}:void 0;return t(e.access??o,e.key,s)}function F(e,r){return t(e.access??o,r??"")}function j(e){return{...s({type:"custom",render:()=>/* @__PURE__ */w(l,{})},"always"),reachedBy:e}}function B({o:t,say:s,props:l}){const n=f("colourRow",y),i=f("panel",p),c=t.useFollows(),a=t.usePresets?.(),u=t.opacity?.useUnset?.()??100,h=v(t,l),[m,b]=k(h,l),[g,j]=F(h,t.opacity?.key),B=e(h.access??o),C="string"==typeof m?m:"",O="number"==typeof g,A="follows"in l,T=(A&&"string"==typeof l.follows&&""!==l.follows?l.follows:void 0)??c,x=t.access||A?void 0:"";/* @__PURE__ */
2
+ return w(d,{label:s(t.label),icon:t.icon,hint:t.hint,value:C,onChange:e=>b(""===e?x:e),inherited:T,presets:a,changed:""!==C||O,onReset:()=>{O&&t.opacity?B([[t.key,x],[t.opacity.key,void 0]]):b(x)},resetTo:A?r(s,T.toUpperCase()):t.resetTo?t.resetTo(c.toUpperCase()):c.toUpperCase(),...t.opacity?{opacity:O?g:u,onOpacityChange:e=>j(e)}:{},readOnly:l.readOnly,words:n,resetWords:i})}var C=20;function O({o:e,say:o,props:t}){const s=e.useFollows(),[l,n]=k(v(e,t),t),i=l&&"object"==typeof l?l:{},c="follows"in t,d=c&&t.follows&&"object"==typeof t.follows?t.follows:{},p="number"==typeof d.width?d.width:s.width,y="string"==typeof d.color&&""!==d.color?d.color:s.color,f=Object.keys(i).length>0,m={width:o("Border width"),sides:{top:o("Border top"),right:o("Border right"),bottom:o("Border bottom"),left:o("Border left")},style:o("Border style"),styles:{solid:o("Solid"),dashed:o("Dashed"),dotted:o("Dotted")},color:o("Border color"),unit:"px"};/* @__PURE__ */
3
+ return w(h,{label:o("Border"),icon:/* @__PURE__ */w(b,{}),action:c?/* @__PURE__ */w(u,{label:o("Border"),changed:f,detail:r(o,`${p}px`),disabled:t.readOnly,onReset:()=>n(void 0)}):void 0,children:/* @__PURE__ */w(a,{label:o("Border"),value:i,each:!1,onChange:o=>n(function(e){const o=Object.fromEntries(Object.entries(e).filter(([,e])=>null!=e&&""!==e));return Object.keys(o).length?o:void 0}(e.styles?{width:o.width,color:o.color,style:o.style}:{width:o.width,color:o.color})),placeholder:{sides:{top:p,right:p,bottom:p,left:p},style:d.style??"solid",color:y},presets:[y],words:m,styles:e.styles??!1,max:20,readOnly:t.readOnly})})}var A=40,T=()=>null;function x({o:r,say:t,props:s}){const l=f("panel",p),a=r.useFollows(),[d,y]=k(r,s),[b,g]=F(r,r.sidesKey),v=e(r.access??o),j=r.access?void 0:null,B="number"==typeof d&&Number.isFinite(d)?d:null,C=n((r.useFollowsSides??T)())??[...i],O=n(b)??C,A=[{value:"tl",label:t("Top left")},{value:"tr",label:t("Top right")},{value:"bl",label:t("Bottom left")},{value:"br",label:t("Bottom right")}];/* @__PURE__ */
4
+ return w(h,{label:t("Corners"),icon:/* @__PURE__ */w(m,{}),changed:null!==B||Array.isArray(b),action:/* @__PURE__ */w(u,{label:t("Corners"),changed:null!==B||Array.isArray(b),detail:`${a}px`,onReset:()=>Array.isArray(b)?v([[r.key,j],[r.sidesKey,j]]):y(j),words:l}),children:/* @__PURE__ */w(c,{label:t("Corners"),value:O,corners:A,onChange:e=>{const o=i.filter(o=>e.includes(o)),r=o.length===C.length&&o.every(e=>C.includes(e));g(r?j:o)},radius:B,onRadiusChange:e=>y(e??j),radiusMin:0,radiusMax:40,radiusStep:r.step??1,radiusPlaceholder:String(a),disabled:s.readOnly})})}function R(e=g){return{colourField:o=>({type:"custom",render:r=>/* @__PURE__ */w(B,{o:o,say:e,props:r})}),borderField:o=>({type:"custom",render:r=>/* @__PURE__ */w(O,{o:o,say:e,props:r})}),cornersField:o=>({type:"custom",render:r=>/* @__PURE__ */w(x,{o:o,say:e,props:r})})}}var{colourField:G,borderField:I,cornersField:M}=R();export{C as BORDER_WIDTH_MAX,A as CORNER_RADIUS_MAX,I as borderField,G as colourField,M as cornersField,j as keptByRow,R as styleFieldBuilders};
@@ -1,4 +1,4 @@
1
- import{blockRuns as e,offeredChoices as s}from"./chunk-RUQOIQWI.js";import{useScreenBlockLook as t}from"./chunk-L4DFCNDQ.js";import{DEFAULT_SCREEN_WORDS as l}from"./chunk-C4TJN6GR.js";import{useWords as r}from"./chunk-MFIRYGHW.js";import{ItemCount as n,DropdownMenu as c}from"efficient-shell/ui";import{jsxs as a,jsx as o,Fragment as i}from"react/jsx-runtime";function m({choices:m,onPick:p}){const{Icon:u}=t(),f=r("screen",l),h=e(s(m)).flatMap(e=>[...e.group?[{type:"label",key:`group:${e.group}`,label:/* @__PURE__ */a("span",{className:"flex w-full items-center gap-2",children:[
1
+ import{blockRuns as e,offeredChoices as s}from"./chunk-RUQOIQWI.js";import{useScreenBlockLook as t}from"./chunk-YTF65TZA.js";import{DEFAULT_SCREEN_WORDS as l}from"./chunk-C4TJN6GR.js";import{useWords as r}from"./chunk-MFIRYGHW.js";import{ItemCount as n,DropdownMenu as c}from"efficient-shell/ui";import{jsxs as a,jsx as o,Fragment as i}from"react/jsx-runtime";function m({choices:m,onPick:p}){const{Icon:u}=t(),f=r("screen",l),h=e(s(m)).flatMap(e=>[...e.group?[{type:"label",key:`group:${e.group}`,label:/* @__PURE__ */a("span",{className:"flex w-full items-center gap-2",children:[
2
2
  /* @__PURE__ */o("span",{children:e.group}),
3
3
  /* @__PURE__ */o(n,{count:e.items.length,label:f.blockCount({count:e.items.length}),className:"ml-auto"})]})}]:[],...e.items.map(e=>({key:e.type,label:e.label,icon:/* @__PURE__ */o("span",{className:"sf-chip",children:/* @__PURE__ */o(u,{type:e.type,size:13})}),onSelect:()=>p(e.type)}))]);/* @__PURE__ */
4
4
  return o(c,{align:"start",triggerClassName:"sf-add-card",items:h,trigger:/* @__PURE__ */a(i,{children:[
@@ -1 +1 @@
1
- import{useSectionOps as o}from"./chunk-3ZGOVNVH.js";import{SELECTION_MODE as e}from"./chunk-L4DFCNDQ.js";import{decodePartId as r,encodePartId as t}from"./chunk-R4AUZVA3.js";import{useEasel as n}from"./chunk-NUJEHA6A.js";import{usePreviewParts as p}from"./chunk-467WWV4I.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}=n(o=>o),f=o(),{setSelectedPartId:k,setSelectHandler:l}=p(),I=d(o=>{const t=r(o);if(!t)return;const{nodeId:n,propKey:p}=t;p?(i(o=>s(o)&&o.nodeId===n&&o.propKey===p?o:{kind:"part",nodeId:n,propKey:p}),a?.(n)):i(o=>"part"===o.kind?e:o)},[i,a]);c(()=>{l(I)},[l,I]);const h=s(m)?t(m.nodeId,m.propKey):null;c(()=>{k(h)},[h,k]);return{selectNode:d(o=>{i(()=>e);const r=u(o);r&&f.select(r)},[i,u,f]),openPartId:h}}export{m as usePartBridge};
1
+ import{useSectionOps as o}from"./chunk-6DUCOSHW.js";import{SELECTION_MODE as e}from"./chunk-YTF65TZA.js";import{decodePartId as r,encodePartId as t}from"./chunk-R4AUZVA3.js";import{useEasel as n}from"./chunk-3W2O22DZ.js";import{usePreviewParts as p}from"./chunk-467WWV4I.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}=n(o=>o),f=o(),{setSelectedPartId:k,setSelectHandler:l}=p(),I=d(o=>{const t=r(o);if(!t)return;const{nodeId:n,propKey:p}=t;p?(i(o=>s(o)&&o.nodeId===n&&o.propKey===p?o:{kind:"part",nodeId:n,propKey:p}),a?.(n)):i(o=>"part"===o.kind?e:o)},[i,a]);c(()=>{l(I)},[l,I]);const h=s(m)?t(m.nodeId,m.propKey):null;c(()=>{k(h)},[h,k]);return{selectNode:d(o=>{i(()=>e);const r=u(o);r&&f.select(r)},[i,u,f]),openPartId:h}}export{m as usePartBridge};
@@ -0,0 +1,5 @@
1
+ import{usePickFollowsSelection as n}from"./chunk-NCXYC7WI.js";import{slotFieldsOf as e,slotChildrenIn as t}from"./chunk-TCAAOYQY.js";import{EaselCanvas as r,useSelectedFields as o}from"./chunk-3W2O22DZ.js";import{Inspector as i}from"./chunk-LWFE6QDN.js";import{fieldIsShown as u}from"./chunk-BPXEFVSQ.js";import{createContext as l,useContext as s}from"react";import{DesktopIcon as c}from"efficient-shell/icons/efficient";import{jsx as f}from"react/jsx-runtime";var a={kind:"selection"};function d(n){return"selection"===n.kind}function p(n,e){if(d(n)&&d(e))return!0;const t=n,r=e,o=Object.keys(t);return o.length===Object.keys(r).length&&o.every(n=>Object.is(t[n],r[n]))}function m(n){const e=n;return"string"==typeof e.nodeId&&"string"==typeof e.slot}function k(n,t){const r=n.components?.[t.type]?.fields??{};return e(n,t.type).filter(n=>u(r[n],{values:t.props}))}function h(n,e){return k(n,e).flatMap(n=>t(e,n))}function v(n,e,t){const r=n.slotsOf?.(t);return r||k(e,t).map(n=>({slot:n,label:n,rung:!1}))}function y(n,e){return n.isFirst?n.isFirst(e):e.type===n.first}function g(n,e){return n.isLast?n.isLast(e):e.type===n.last}var b={},O=()=>b,j=()=>"",w=()=>null,C=()=>{},L={isLockedBlock:()=>!1,duplicateBlocked:()=>null,nestDepth:()=>0,newSectionNode:()=>null,canAddTo:()=>null,blockIsOffered:()=>!0},S={labelAtLevel:(n,e,t)=>t,descriptions:{},categoryLabel:()=>{},firstSection:null,blockRowName:(n,e)=>e(n.type),plainText:n=>n,Icon:()=>null,Thumbnail:()=>null,useProducts:()=>null},D={options:[{id:"desktop",label:"Desktop",icon:/* @__PURE__ */f(c,{})}],initial:"desktop",fluid:"desktop",widths:{desktop:2e3}},N={read:()=>"sections",write:()=>{},forSelection:(n,e)=>n?"sections":e},P={first:null,last:null,firstGroup:null,lastGroup:null,isSectionGroup:()=>!1,sectionGroupZone:()=>"",panelOf:()=>null};function B(){/* @__PURE__ */
2
+ return f(r,{height:"fill"})}function F(){const{id:n,fields:e,values:t,readOnly:r,onChange:u}=o();/* @__PURE__ */
3
+ return f("div",{className:"es-sidepanel es-sidepanel--right",children:/* @__PURE__ */f(i,{fields:e,values:t,onChange:u,readOnly:r,idPrefix:n})})}var I=l({});function x({parts:n,children:e}){/* @__PURE__ */
4
+ return f(I.Provider,{value:n,children:e})}function A(){return s(I)}function G(){return(A().useOwnerName??j)()}function T(){return(A().useDocumentLabel??w)()}function Q(n,e,t,r){return(A().useBridges??O)(n,e,t,r)}function W(n){return(A().useStandaloneBridges??O)(n)}function Y(n,e){(A().useDocumentPass??C)(n,e)}function E(){return A().blockRules??L}function R(){return A().blockLook??S}function V(){return A().devices??D}function X(){return A().leftView??N}function Z(){return A().pinned??P}function H(){return A().saveSwitch??!0}function K(e){n(!0===A().pickFollowsSelection,e)}function M(){return A().storageNamespace||void 0}function q(){return A().styleClipboard??null}function z(){return A().nodeKeys??!0}function J(){return A().notify??null}function U(){return A().Canvas??B}function $(){return A().CanvasHead??null}function _(){return A().canvasDrag??null}var nn=l(null);function en({target:n,children:e}){/* @__PURE__ */
5
+ return f(nn.Provider,{value:n,children:e})}function tn(){return s(nn)}function rn(){return A().Inspector??F}export{a as SELECTION_MODE,en as ScreenCanvasTargetProvider,x as ScreenPartsProvider,y as isPinnedFirst,g as isPinnedLast,d as isSelectionMode,m as isSlotMode,p as sameInspectorMode,v as screenSlotsOf,h as shownChildSlotsOf,k as shownSlotFieldsOf,R as useScreenBlockLook,E as useScreenBlockRules,Q as useScreenBridges,_ as useScreenCanvasDrag,U as useScreenCanvasFrame,$ as useScreenCanvasHead,tn as useScreenCanvasTarget,V as useScreenDevices,T as useScreenDocumentLabel,Y as useScreenDocumentPass,rn as useScreenInspectorPanel,X as useScreenLeftView,z as useScreenNodeKeys,J as useScreenNotify,G as useScreenOwnerName,A as useScreenParts,K as useScreenPickFollowsSelection,Z as useScreenPinned,H as useScreenSaveSwitch,M as useScreenStorageNamespace,q as useScreenStyleClipboard,W as useStandaloneScreenBridges};
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
- import { c as CopyBoxProps, d as CopyCell, T as TextBoxHandle } from '../canvas-typing--FlIZwbT.js';
3
- export { e as COPY_CELLS, b as CanvasTypingEnd, f as CanvasTypingOptions, g as CanvasTypingSession, h as ColorWindow, i as CopyBoxAlign, j as CopyBoxFooter, C as CopyBoxLastTool, k as CopyCase, l as CopyCellPreset, m as CopyCells, a as CopyThemeColor, M as MarkWriter, S as SelectionSource, n as TextAreaHandle, o as TextMap, p as ToolbarMark, q as colorRunOf, r as insertSelection, s as markSelection, t as startCanvasTyping, u as textMap } from '../canvas-typing--FlIZwbT.js';
2
+ import { c as CopyBoxProps, d as CopyCell, T as TextBoxHandle } from '../canvas-typing-CD1aeYnk.js';
3
+ export { e as COPY_CELLS, b as CanvasTypingEnd, f as CanvasTypingOptions, g as CanvasTypingSession, h as ColorWindow, i as CopyBoxAlign, j as CopyBoxFooter, C as CopyBoxLastTool, k as CopyCase, l as CopyCellPreset, m as CopyCells, a as CopyThemeColor, M as MarkWriter, S as SelectionSource, n as TextAreaHandle, o as TextMap, p as ToolbarMark, q as colorRunOf, r as insertSelection, s as markSelection, t as startCanvasTyping, u as textMap } from '../canvas-typing-CD1aeYnk.js';
4
4
  import { TextAlign } from 'efficient-shell/ui';
5
5
  export { TextToolbar, TextToolbarProps } from 'efficient-shell/ui';
6
6
  import { F as FieldOption } from '../types-CVHwspYM.js';