efficient-web-builder 57.1.0 → 59.0.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 (244) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/dist/editor/components/SectionIcon.js +1 -1
  3. package/dist/editor/components/WebsiteScreenParts.js +1 -1
  4. package/dist/editor/components/storefront-editor.css +30 -0
  5. package/dist/editor/lib/animation/hover-fields.js +1 -1
  6. package/dist/editor/lib/document/ColourControl.js +1 -1
  7. package/dist/editor/lib/document/blocks/general/CardList/fields.js +1 -1
  8. package/dist/editor/lib/document/blocks/general/Cards/fields.js +1 -1
  9. package/dist/editor/lib/document/blocks/general/Chart/fields.js +1 -1
  10. package/dist/editor/lib/document/blocks/general/Contents/fields.js +1 -1
  11. package/dist/editor/lib/document/blocks/general/Countdown/fields.js +1 -1
  12. package/dist/editor/lib/document/blocks/general/Divider/fields.js +1 -1
  13. package/dist/editor/lib/document/blocks/general/FAQ/fields.js +1 -1
  14. package/dist/editor/lib/document/blocks/general/Flex/fields.js +1 -1
  15. package/dist/editor/lib/document/blocks/general/ListSearch/fields.d.ts +2 -0
  16. package/dist/editor/lib/document/blocks/general/ListSearch/fields.js +1 -0
  17. package/dist/editor/lib/document/blocks/general/Mockup/fields.js +2 -2
  18. package/dist/editor/lib/document/blocks/general/index.d.ts +2 -2
  19. package/dist/editor/lib/document/blocks/general/index.js +1 -1
  20. package/dist/editor/lib/document/box-fields.d.ts +1 -0
  21. package/dist/editor/lib/document/box-fields.js +1 -1
  22. package/dist/editor/lib/document/card-display-chips.d.ts +7 -5
  23. package/dist/editor/lib/document/card-display-chips.js +1 -1
  24. package/dist/editor/lib/document/card-row-fields.d.ts +2 -1
  25. package/dist/editor/lib/document/card-row-fields.js +1 -1
  26. package/dist/editor/lib/document/controls.d.ts +13 -1
  27. package/dist/editor/lib/document/controls.js +1 -1
  28. package/dist/editor/lib/sections/text-layouts.js +1 -1
  29. package/dist/format/lib/animation/hover.js +1 -1
  30. package/dist/format/lib/content/accordion-row-style.d.ts +10 -0
  31. package/dist/format/lib/content/accordion-row-style.js +1 -0
  32. package/dist/format/lib/content/box-angle.d.ts +9 -0
  33. package/dist/format/lib/content/box-angle.js +1 -0
  34. package/dist/format/lib/content/box-background.d.ts +3 -0
  35. package/dist/format/lib/content/box-background.js +1 -1
  36. package/dist/format/lib/content/box-layout.d.ts +3 -0
  37. package/dist/format/lib/content/box-layout.js +1 -1
  38. package/dist/format/lib/content/card-columns.d.ts +1 -0
  39. package/dist/format/lib/content/card-columns.js +1 -0
  40. package/dist/format/lib/content/card-place.d.ts +4 -0
  41. package/dist/format/lib/content/card-place.js +1 -1
  42. package/dist/format/lib/content/card-state.d.ts +17 -0
  43. package/dist/format/lib/content/card-state.js +1 -1
  44. package/dist/format/lib/content/card-template.d.ts +3 -0
  45. package/dist/format/lib/content/card-template.js +1 -1
  46. package/dist/format/lib/content/copies-in-box.d.ts +2 -0
  47. package/dist/format/lib/content/copies-in-box.js +1 -0
  48. package/dist/format/lib/content/gallery-layout.d.ts +13 -1
  49. package/dist/format/lib/content/gallery-layout.js +1 -1
  50. package/dist/format/lib/content/list-query.d.ts +7 -0
  51. package/dist/format/lib/content/list-query.js +1 -0
  52. package/dist/format/lib/content/page-background.js +1 -1
  53. package/dist/format/lib/content/part-display.js +1 -1
  54. package/dist/format/lib/content/section-background.js +1 -1
  55. package/dist/format/lib/content/view-hide-class.d.ts +11 -0
  56. package/dist/format/lib/content/view-hide-class.js +1 -0
  57. package/dist/format/lib/document/blocks/general/Chart/meta.d.ts +1 -0
  58. package/dist/format/lib/document/blocks/general/Chart/meta.js +1 -1
  59. package/dist/format/lib/document/blocks/general/Countdown/meta.d.ts +1 -0
  60. package/dist/format/lib/document/blocks/general/Countdown/meta.js +1 -1
  61. package/dist/format/lib/document/blocks/general/FAQ/card-seed.d.ts +7 -0
  62. package/dist/format/lib/document/blocks/general/FAQ/card-seed.js +1 -0
  63. package/dist/format/lib/document/blocks/general/FAQ/meta.d.ts +6 -0
  64. package/dist/format/lib/document/blocks/general/FAQ/meta.js +1 -1
  65. package/dist/format/lib/document/blocks/general/ListSearch/meta.d.ts +6 -0
  66. package/dist/format/lib/document/blocks/general/ListSearch/meta.js +1 -0
  67. package/dist/format/lib/document/blocks/general/Mockup/meta.d.ts +1 -0
  68. package/dist/format/lib/document/blocks/general/Mockup/meta.js +1 -1
  69. package/dist/format/lib/document/blocks/general/PaymentBadges/meta.d.ts +6 -0
  70. package/dist/format/lib/document/blocks/general/PaymentBadges/meta.js +1 -1
  71. package/dist/format/lib/document/blocks/general/metas.d.ts +1 -0
  72. package/dist/format/lib/document/blocks/general/metas.js +1 -1
  73. package/dist/format/lib/document/blocks/general/text-part-shapes.json +28 -0
  74. package/dist/format/lib/document/box-footer.js +1 -1
  75. package/dist/format/lib/document/card-row-keys.d.ts +14 -0
  76. package/dist/format/lib/document/card-row-keys.js +1 -0
  77. package/dist/format/lib/document/cards-template-on-read.d.ts +1 -1
  78. package/dist/format/lib/document/cards-template-on-read.js +1 -1
  79. package/dist/format/lib/document/container-blocks.js +1 -1
  80. package/dist/format/lib/document/general-order.d.ts +1 -1
  81. package/dist/format/lib/document/general-order.js +1 -1
  82. package/dist/format/lib/document/list-search-scopes.d.ts +4 -0
  83. package/dist/format/lib/document/list-search-scopes.js +1 -0
  84. package/dist/format/lib/document/neutralization-contracts.js +1 -1
  85. package/dist/format/lib/document/part-inks.d.ts +6 -2
  86. package/dist/format/lib/document/part-inks.js +1 -1
  87. package/dist/format/lib/document/section-catalog.js +2 -2
  88. package/dist/format/lib/document/theme-slots.d.ts +20 -0
  89. package/dist/format/lib/document/theme-slots.js +1 -0
  90. package/dist/format/lib/editor-words-catalogue.d.ts +10 -0
  91. package/dist/format/lib/editor-words-catalogue.js +4 -4
  92. package/dist/format/lib/editor-words-kept.js +1 -1
  93. package/dist/format/lib/sections/hero-single-to-hero.js +1 -1
  94. package/dist/format/lib/theme.d.ts +1 -0
  95. package/dist/format/lib/theme.js +4 -4
  96. package/dist/render/components/BoxAccordionRow.d.ts +3 -1
  97. package/dist/render/components/BoxAccordionRow.js +1 -1
  98. package/dist/render/components/BoxTabPaneContext.d.ts +5 -0
  99. package/dist/render/components/BoxTabPaneContext.js +1 -1
  100. package/dist/render/components/CardRowContext.d.ts +3 -1
  101. package/dist/render/components/CardRowContext.js +1 -1
  102. package/dist/render/components/Cards.d.ts +2 -1
  103. package/dist/render/components/Cards.js +1 -1
  104. package/dist/render/components/CategoryBar.d.ts +1 -1
  105. package/dist/render/components/CategoryBar.js +1 -1
  106. package/dist/render/components/ChartSection.d.ts +2 -1
  107. package/dist/render/components/ChartSection.js +1 -1
  108. package/dist/render/components/ContactLocations.js +2 -2
  109. package/dist/render/components/ContentsList.d.ts +3 -3
  110. package/dist/render/components/ContentsList.js +1 -1
  111. package/dist/render/components/Countdown.d.ts +2 -1
  112. package/dist/render/components/Countdown.js +1 -1
  113. package/dist/render/components/Divider.d.ts +1 -2
  114. package/dist/render/components/Divider.js +1 -1
  115. package/dist/render/components/DocBody.js +5 -5
  116. package/dist/render/components/DocMasthead.js +1 -1
  117. package/dist/render/components/DocMetaCards.js +1 -1
  118. package/dist/render/components/DocTabs.js +1 -1
  119. package/dist/render/components/Eyebrow.d.ts +2 -1
  120. package/dist/render/components/Eyebrow.js +1 -1
  121. package/dist/render/components/FAQ.d.ts +6 -1
  122. package/dist/render/components/FAQ.js +1 -1
  123. package/dist/render/components/FeaturedCover.d.ts +2 -1
  124. package/dist/render/components/FeaturedCover.js +1 -1
  125. package/dist/render/components/Flex.d.ts +3 -1
  126. package/dist/render/components/Flex.js +1 -1
  127. package/dist/render/components/Footprint.js +1 -1
  128. package/dist/render/components/HeroGroup.d.ts +1 -1
  129. package/dist/render/components/HeroGroup.js +1 -1
  130. package/dist/render/components/HeroPictures.js +1 -1
  131. package/dist/render/components/HeroSection.js +1 -1
  132. package/dist/render/components/HeroSingle.js +1 -1
  133. package/dist/render/components/HeroSlide.d.ts +1 -1
  134. package/dist/render/components/HeroSlide.js +1 -1
  135. package/dist/render/components/InBoxContext.d.ts +1 -1
  136. package/dist/render/components/InBoxContext.js +1 -1
  137. package/dist/render/components/IntegrationsSection.js +1 -1
  138. package/dist/render/components/IntroBleed.js +1 -1
  139. package/dist/render/components/JoinBox.js +1 -1
  140. package/dist/render/components/KeyFeatures.js +1 -1
  141. package/dist/render/components/ListSearchBox.d.ts +7 -0
  142. package/dist/render/components/ListSearchBox.js +1 -0
  143. package/dist/render/components/LocationMap.d.ts +2 -1
  144. package/dist/render/components/LocationMap.js +1 -1
  145. package/dist/render/components/Logo.d.ts +3 -1
  146. package/dist/render/components/Logo.js +1 -1
  147. package/dist/render/components/LogoBlock.js +1 -1
  148. package/dist/render/components/LongRead.js +1 -1
  149. package/dist/render/components/Manifesto.js +1 -1
  150. package/dist/render/components/Masthead.js +1 -1
  151. package/dist/render/components/MockupSection.d.ts +2 -1
  152. package/dist/render/components/MockupSection.js +1 -1
  153. package/dist/render/components/ParagraphsA.d.ts +2 -1
  154. package/dist/render/components/ParagraphsA.js +1 -1
  155. package/dist/render/components/PostCard.d.ts +2 -1
  156. package/dist/render/components/PostCard.js +1 -1
  157. package/dist/render/components/ProcessSteps.js +1 -1
  158. package/dist/render/components/Prose.js +1 -1
  159. package/dist/render/components/SectionAnimation.d.ts +3 -2
  160. package/dist/render/components/SectionAnimation.js +1 -1
  161. package/dist/render/components/SectionEyebrow.d.ts +2 -1
  162. package/dist/render/components/SectionEyebrow.js +1 -1
  163. package/dist/render/components/Series.js +1 -1
  164. package/dist/render/components/SiteGutterFrame.d.ts +2 -2
  165. package/dist/render/components/SiteGutterFrame.js +1 -1
  166. package/dist/render/components/Spacer.js +1 -1
  167. package/dist/render/components/SpecStrip.js +1 -1
  168. package/dist/render/components/StatsParagraph.js +1 -1
  169. package/dist/render/components/Testimonials.js +1 -1
  170. package/dist/render/components/TickerSection.js +1 -1
  171. package/dist/render/components/Timeline.js +1 -1
  172. package/dist/render/components/TimelineTrack.js +1 -1
  173. package/dist/render/components/TitleWithButtons.js +1 -1
  174. package/dist/render/components/ViewHideRoot.d.ts +23 -0
  175. package/dist/render/components/ViewHideRoot.js +1 -0
  176. package/dist/render/lib/content/block-size.d.ts +0 -2
  177. package/dist/render/lib/content/block-size.js +1 -1
  178. package/dist/render/lib/content/page-contents.js +1 -1
  179. package/dist/render/lib/document/blocks/general/CardList/render.js +1 -1
  180. package/dist/render/lib/document/blocks/general/Cards/render.js +1 -1
  181. package/dist/render/lib/document/blocks/general/Chart/render.js +1 -1
  182. package/dist/render/lib/document/blocks/general/Contents/render.js +1 -1
  183. package/dist/render/lib/document/blocks/general/Countdown/render.js +1 -1
  184. package/dist/render/lib/document/blocks/general/CustomHTML/render.js +1 -1
  185. package/dist/render/lib/document/blocks/general/Divider/render.js +1 -1
  186. package/dist/render/lib/document/blocks/general/Eyebrow/render.js +1 -1
  187. package/dist/render/lib/document/blocks/general/FAQ/render.js +1 -1
  188. package/dist/render/lib/document/blocks/general/FeaturedCover/render.js +1 -1
  189. package/dist/render/lib/document/blocks/general/Flex/render.js +1 -1
  190. package/dist/render/lib/document/blocks/general/ListSearch/render.d.ts +2 -0
  191. package/dist/render/lib/document/blocks/general/ListSearch/render.js +1 -0
  192. package/dist/render/lib/document/blocks/general/LocationMap/render.js +1 -1
  193. package/dist/render/lib/document/blocks/general/Mockup/render.js +2 -2
  194. package/dist/render/lib/document/blocks/general/OrderSummary/card-seed.d.ts +2 -0
  195. package/dist/render/lib/document/blocks/general/OrderSummary/card-seed.js +1 -0
  196. package/dist/render/lib/document/blocks/general/ParagraphsA/render.js +1 -1
  197. package/dist/render/lib/document/blocks/general/PaymentBadges/render.js +1 -1
  198. package/dist/render/lib/document/blocks/general/PostCard/render.js +1 -1
  199. package/dist/render/lib/document/blocks/general/SectionHeader/render.js +1 -1
  200. package/dist/render/lib/document/blocks/general/renders.d.ts +1 -0
  201. package/dist/render/lib/document/blocks/general/renders.js +1 -1
  202. package/dist/render/lib/document/blocks/general/section-to-box-row-parts.d.ts +3 -1
  203. package/dist/render/lib/document/blocks/general/section-to-box-row-parts.js +1 -1
  204. package/dist/render/lib/document/blocks/general/section-to-box-rows-cards.d.ts +3 -0
  205. package/dist/render/lib/document/blocks/general/section-to-box-rows-cards.js +1 -1
  206. package/dist/render/lib/document/blocks/general/section-to-box-rows-checkout.d.ts +2 -0
  207. package/dist/render/lib/document/blocks/general/section-to-box-rows-checkout.js +1 -0
  208. package/dist/render/lib/document/blocks/general/section-to-box-rows-docbody.js +2 -2
  209. package/dist/render/lib/document/blocks/general/section-to-box-rows-head.d.ts +12 -0
  210. package/dist/render/lib/document/blocks/general/section-to-box-rows-head.js +1 -1
  211. package/dist/render/lib/document/blocks/general/section-to-box-rows-locations.js +1 -1
  212. package/dist/render/lib/document/blocks/general/section-to-box-rows-logos.d.ts +1 -0
  213. package/dist/render/lib/document/blocks/general/section-to-box-rows-logos.js +1 -1
  214. package/dist/render/lib/document/blocks/general/section-to-box-rows-promo.d.ts +2 -0
  215. package/dist/render/lib/document/blocks/general/section-to-box-rows-promo.js +1 -0
  216. package/dist/render/lib/document/blocks/general/section-to-box-rows-proof.d.ts +2 -0
  217. package/dist/render/lib/document/blocks/general/section-to-box-rows-proof.js +1 -0
  218. package/dist/render/lib/document/blocks/general/section-to-box-rows-stats.js +1 -1
  219. package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
  220. package/dist/render/lib/document/head-core-boxes.js +1 -1
  221. package/dist/render/lib/document/page-render.js +1 -1
  222. package/dist/render/lib/document/passes/block-size.js +1 -1
  223. package/dist/render/lib/document/passes/borders.js +1 -1
  224. package/dist/render/lib/document/passes/box-join.js +1 -1
  225. package/dist/render/lib/document/passes/cell-width.js +1 -1
  226. package/dist/render/lib/document/passes/corners.js +1 -1
  227. package/dist/render/lib/document/passes/head-core.js +1 -1
  228. package/dist/render/lib/document/passes/hidden-nodes.d.ts +2 -0
  229. package/dist/render/lib/document/passes/hidden-nodes.js +1 -0
  230. package/dist/render/lib/document/passes/index.js +1 -1
  231. package/dist/render/lib/document/passes/section-anchor.js +1 -1
  232. package/dist/render/lib/document/passes/section-animation.js +1 -1
  233. package/dist/render/lib/document/passes/section-height.js +1 -1
  234. package/dist/render/lib/document/passes/section-padding.js +1 -1
  235. package/dist/render/lib/document/passes/section-sticky.js +1 -1
  236. package/dist/render/lib/document/passes/section-theme.js +1 -1
  237. package/dist/render/lib/document/passes/section-width.js +1 -1
  238. package/dist/render/lib/document/slot-counts.js +1 -1
  239. package/dist/render/lib/sections/section-to-box.js +1 -1
  240. package/package.json +3 -3
  241. package/dist/editor/lib/document/theme-swatches.d.ts +0 -3
  242. package/dist/editor/lib/document/theme-swatches.js +0 -1
  243. package/dist/format/lib/document/passes/hidden-nodes.d.ts +0 -2
  244. package/dist/format/lib/document/passes/hidden-nodes.js +0 -1
@@ -1,3 +1,4 @@
1
+ import { type ViewTier } from "efficient-easel/draw";
1
2
  import { type BlockShowWhenFacts, type ShowWhenRule } from "../../../format/lib/document/show-when-attach.js";
2
3
  export declare const NOT_CARD_OF_TEMPLATE = "notCardOfTemplate";
3
4
  export declare const ON_A_CARD: ShowWhenRule;
@@ -10,27 +11,28 @@ type Card = {
10
11
  type?: unknown;
11
12
  props: Record<string, unknown>;
12
13
  };
13
- export declare function cardDisplayParts(card: Card, locked?: (child: Child) => boolean): Child[];
14
- export declare function cardDisplayItems(card: Card, label: (child: Child) => string, locked?: (child: Child) => boolean): {
14
+ export declare function cardDisplayParts(card: Card, locked?: (child: Child) => boolean, view?: ViewTier): Child[];
15
+ export declare function cardDisplayItems(card: Card, label: (child: Child) => string, locked?: (child: Child) => boolean, view?: ViewTier): {
15
16
  id: string;
16
17
  label: string;
17
18
  shown: boolean;
18
19
  }[];
19
- export declare function withChildShown<C extends Card>(card: C, id: string, shown: boolean): C;
20
+ export declare function withChildShown<C extends Card>(card: C, id: string, shown: boolean, view?: ViewTier): C;
20
21
  type ChipOwner = {
21
22
  type?: unknown;
22
23
  props?: Record<string, unknown>;
23
24
  } | null | undefined;
24
25
  export declare function cardChipLabel(child: Child, ownerType: string | undefined, layers: (child: Child) => string, owner?: ChipOwner): string;
25
- export declare function CardDisplayChips({ card, ownerType, owner, labelOf, write, readOnly, }: {
26
+ export declare function CardDisplayChips({ card, ownerType, owner, labelOf, write, readOnly, view, }: {
26
27
  card: Card;
27
28
  ownerType: string | undefined;
28
29
  owner?: ChipOwner;
29
30
  labelOf: (type: string) => string;
30
31
  write: (next: (latest: Card) => Card) => void;
31
32
  readOnly?: boolean;
33
+ view?: ViewTier;
32
34
  }): import("react").JSX.Element;
33
- export declare function cardDisplayField(): {
35
+ export declare function cardDisplayField(view: ViewTier): {
34
36
  type: "custom";
35
37
  render: ({ readOnly }: {
36
38
  readOnly?: boolean;
@@ -1 +1 @@
1
- "use client";import{jsx as d}from"react/jsx-runtime";import{isNodeList as N}from"efficient-easel/data";import{useEasel as O}from"efficient-easel/easel";import{slotChildName as g,slotChildRowName as h}from"efficient-easel/draw";import{cardTemplateCardOwner as _,cardTemplateField as D,namedRowField as S}from"../../../format/lib/content/card-template.js";import{DisplayRow as C,useSelectedPatch as T}from"./controls.js";import{websiteNodeIsLocked as b}from"./locked-blocks.js";import{stripMarkup as A}from"../../../format/lib/markup.js";import{sourceRowName as E}from"../../../format/lib/document/source-row-name.js";import{withShowWhen as F}from"../../../format/lib/document/show-when-attach.js";import{deviceField as L}from"efficient-easel/screen/lib/document/device-fields";import{NoControlMark as M}from"efficient-easel/screen/lib/document/panel-no-control-mark";const x="notCardOfTemplate",P={not:{context:x,is:!0}},Z={[x]:(e,n)=>{const t=_(n.appState,e.props?.id);return t===void 0?void 0:t===null}};function m(e){const n=e.props?.content;return N(n)?n:[]}const c=e=>!!e.props?._hidden;function R(e,n=()=>!1){return m(e).flatMap(t=>typeof t?.props?.id!="string"?[]:m(t).length&&!c(t)?R(t,n):n(t)?[]:[t])}function k(e,n,t){const p=R(e,t).map(r=>({child:r,name:n(r)})),s=new Set(p.map(r=>r.name)),a=new Set;return p.map(({child:r,name:i})=>{let u=i;if(a.has(i)){let o=2;for(;s.has(`${i} ${o}`);)o+=1;u=`${i} ${o}`,s.add(u)}return a.add(i),{id:r.props.id,label:u,shown:!c(r)}})}function w(e,n){return m(e).flatMap(t=>c(t)?n(t)?[]:[t,...w(t,n)]:w(t,n))}function y(e,n,t){const p=m(e);let s=!1;const a=p.map(r=>{if(s)return r;let i;if(r?.props?.id===n){if(t?!("_hidden"in r.props):c(r))return r;const{_hidden:u,...o}=r.props;i={...r,props:t?o:{...o,_hidden:!0}}}else i=y(r,n,t);return s=i!==r,i});return s?{...e,props:{...e.props,content:a}}:e}function $(e,n,t,p){return g(e).trim()?t(e):D(n,S(e.props),p)?.label??t(e)}const B="This page is read-only.";function I({card:e,ownerType:n,owner:t,labelOf:p,write:s,readOnly:a}){const r=o=>h(o,p,A,void 0,E),i=o=>b(o.type,o),u=k(e,o=>$(o,n,r,t),i);return u.length?d(C,{parts:u,changed:u.some(o=>!o.shown),shown:o=>u.find(f=>f.id===o)?.shown??!0,disabledReason:a?B:void 0,onPress:(o,f)=>s(l=>y(l,o,f)),onReset:()=>s(o=>w(o,i).reduce((f,l)=>y(f,String(l.props.id),!0),o))}):d(M,{})}function j(){try{const e=O(s=>s),n=e.config.components??{},t=e.selectedItem;if(!t)return null;const p=_(e.appState,t.props?.id);return{labelOf:s=>n[s]?.label??s,card:t,ownerType:typeof p?.type=="string"?p.type:void 0,owner:p}}catch{return null}}function v({readOnly:e}){const n=j(),t=T();return n?d(I,{...n,readOnly:e,write:p=>{e||t(s=>{const a={...n.card,props:s},r=p(a);return r===a?null:{content:r.props.content}})}}):d(C,{parts:[],changed:!1,shown:()=>!0,onPress:()=>{},onReset:()=>{}})}function ee(){return F(L("desktop",{type:"custom",render:({readOnly:e})=>d(v,{readOnly:e})}),P)}export{Z as CARD_BOX_FACTS,I as CardDisplayChips,x as NOT_CARD_OF_TEMPLATE,P as ON_A_CARD,$ as cardChipLabel,ee as cardDisplayField,k as cardDisplayItems,R as cardDisplayParts,y as withChildShown};
1
+ "use client";import{jsx as c}from"react/jsx-runtime";import{isNodeList as b}from"efficient-easel/data";import{useEasel as N}from"efficient-easel/easel";import{hiddenInView as D,hiddenKeyOf as h,hidePatch as S,slotChildName as _,slotChildRowName as A}from"efficient-easel/draw";import{cardTemplateCardOwner as k,cardTemplateField as T,namedRowField as P}from"../../../format/lib/content/card-template.js";import{DisplayRow as g,useSelectedPatch as j}from"./controls.js";import{websiteNodeIsLocked as E}from"./locked-blocks.js";import{stripMarkup as F}from"../../../format/lib/markup.js";import{sourceRowName as L}from"../../../format/lib/document/source-row-name.js";import{withShowWhen as M}from"../../../format/lib/document/show-when-attach.js";import{deviceField as I}from"efficient-easel/screen/lib/document/device-fields";import{NoControlMark as $}from"efficient-easel/screen/lib/document/panel-no-control-mark";const w="notCardOfTemplate",B={not:{context:w,is:!0}},ae={[w]:(e,n)=>{const t=k(n.appState,e.props?.id);return t===void 0?void 0:t===null}};function m(e){const n=e.props?.content;return b(n)?n:[]}const l=(e,n)=>D(e.props??{},n),H=(e,n)=>e.props?.[h(n)]!==void 0;function x(e,n=()=>!1,t="desktop"){return m(e).flatMap(o=>typeof o?.props?.id!="string"?[]:m(o).length&&!l(o,t)?x(o,n,t):n(o)?[]:[o])}function K(e,n,t,o="desktop"){const r=x(e,t,o).map(p=>({child:p,name:n(p)})),i=new Set(r.map(p=>p.name)),s=new Set;return r.map(({child:p,name:u})=>{let f=u;if(s.has(u)){let a=2;for(;i.has(`${u} ${a}`);)a+=1;f=`${u} ${a}`,i.add(f)}return s.add(u),{id:p.props.id,label:f,shown:!l(p,o)}})}function y(e,n,t){const o=r=>t==="desktop"?l(r,t):H(r,t);return m(e).flatMap(r=>o(r)?n(r)?[]:[r,...y(r,n,t)]:y(r,n,t))}function V(e,n){const t={...e};for(const[r,i]of Object.entries(n))i===void 0||r===h("desktop")&&i===!1?delete t[r]:t[r]=i;return Object.keys(t).length===Object.keys(e).length&&Object.keys(t).every(r=>t[r]===e[r])?e:t}function O(e,n,t){const o=m(e);let r=!1;const i=o.map(s=>{if(r)return s;let p=s;if(s?.props?.id===n){const u=V(s.props,t(s.props));u!==s.props&&(p={...s,props:u})}else p=O(s,n,t);return r=p!==s,p});return r?{...e,props:{...e.props,content:i}}:e}function R(e,n,t,o="desktop"){return O(e,n,r=>o==="desktop"&&l({props:r},o)===!t?{}:S(r,o,!t))}function W(e,n,t){return t==="desktop"?R(e,n,!0,t):O(e,n,()=>({[h(t)]:void 0}))}function X(e,n,t,o){return _(e).trim()?t(e):T(n,P(e.props),o)?.label??t(e)}const Y="This page is read-only.";function q({card:e,ownerType:n,owner:t,labelOf:o,write:r,readOnly:i,view:s="desktop"}){const p=a=>A(a,o,F,void 0,L),u=a=>E(a.type,a),f=K(e,a=>X(a,n,p,t),u,s);return f.length?c(g,{parts:f,changed:y(e,u,s).length>0,shown:a=>f.find(d=>d.id===a)?.shown??!0,disabledReason:i?Y:void 0,onPress:(a,d)=>r(C=>R(C,a,d,s)),onReset:()=>r(a=>y(a,u,s).reduce((d,C)=>W(d,String(C.props.id),s),a))}):c($,{})}function z(){try{const e=N(r=>r),n=e.config.components??{},t=e.selectedItem;if(!t)return null;const o=k(e.appState,t.props?.id);return{labelOf:r=>n[r]?.label??r,card:t,ownerType:typeof o?.type=="string"?o.type:void 0,owner:o}}catch{return null}}function G({readOnly:e,view:n}){const t=z(),o=j();return t?c(q,{...t,view:n,readOnly:e,write:r=>{e||o(i=>{const s={...t.card,props:i},p=r(s);return p===s?null:{content:p.props.content}})}}):c(g,{parts:[],changed:!1,shown:()=>!0,onPress:()=>{},onReset:()=>{}})}function ie(e){return M(I(e,{type:"custom",render:({readOnly:n})=>c(G,{readOnly:n,view:e})}),B)}export{ae as CARD_BOX_FACTS,q as CardDisplayChips,w as NOT_CARD_OF_TEMPLATE,B as ON_A_CARD,X as cardChipLabel,ie as cardDisplayField,K as cardDisplayItems,x as cardDisplayParts,R as withChildShown};
@@ -1,11 +1,12 @@
1
1
  import { type CardRowFieldKind, type CardRowFieldSpec } from "../../../format/lib/content/card-template.js";
2
+ import { type CustomField } from "./controls.js";
2
3
  import { type SelectField } from "efficient-easel/screen/lib/document/box-fields";
3
4
  import { type BlockShowWhenFacts, type ShowWhenRule } from "../../../format/lib/document/show-when-attach.js";
4
5
  export declare const OUTSIDE_CARD_TEMPLATE = "outsideCardTemplate";
5
6
  export declare const IN_CARD_TEMPLATE: ShowWhenRule;
6
7
  export declare const CARD_ROW_FACTS: BlockShowWhenFacts;
7
8
  export declare function cardRowField(label: string, kind: CardRowFieldKind): SelectField;
8
- export declare function cardRowItemField(f: CardRowFieldSpec): import("./controls.js").CustomField<string> | import("./controls.js").CustomField<import("efficient-easel/draw").HidableValue>;
9
+ export declare function cardRowItemField(f: CardRowFieldSpec): CustomField<string> | CustomField<import("efficient-easel/draw").HidableValue>;
9
10
  export declare function cardRowFields<Fields extends Record<string, unknown>>(fields: Fields, data: {
10
11
  props?: Record<string, unknown>;
11
12
  }, params: {
@@ -1 +1 @@
1
- import{jsx as w}from"react/jsx-runtime";import{GroundIcon as k,ListIcon as M}from"efficient-easel/icons";import{FieldGlyph as P}from"../../components/FieldGlyph.js";import{CARD_LIST_FIELDS as W,CARD_LIST_TYPE as x,cardListFieldsOf as B,cardListShows as G,cardTemplateFieldsOf as N,cardTemplateOwner as b}from"../../../format/lib/content/card-template.js";import{colorInput as $,copyText as J,plainText as U,plainTextarea as Y,withOffPage as q}from"./controls.js";import{recordRowFields as F}from"../../../format/lib/content/record-row.js";import{recordTypesRevision as z}from"../../../format/lib/content/record-types.js";import{editorRecordType as H}from"../../../format/lib/document/editor-page-context.js";import{blockSourcesRevision as Q,declaredBlockSource as I}from"../../../format/lib/content/block-sources.js";import{select as V}from"./box-fields.js";import{withShowWhen as X}from"../../../format/lib/document/show-when-attach.js";function L(o){const e=o?.data?.root,t=H(e?.props)??"";return t&&F(t,"text").length?t:""}const O="outsideCardTemplate",Z={not:{context:O,is:!0}},mo={[O]:(o,e)=>{const t=b(e.appState,o.props?.id);if(t!==void 0)return t===null&&!L(e.appState)}};function wo(o,e){const t=e==="link"?w(P,{noun:"link"}):e==="colour"?w(k,{}):w(M,{}),a={...V(o,t,[e==="colour"?{label:"Manual",value:""}:{label:"Typed here",value:""}],""),cardRowKind:e};return X(a,Z)}function fo(o){return o.kind==="link"?q(U(o.label)):o.kind==="colour"?$(o.label,"",w(k,{})):o.multiline?Y(o.label):J(o.label)}function oo(o){return!!(o&&typeof o=="object"&&"cardRowKind"in o)}const A=new WeakMap;function Ro(o,e,t){const a=Object.keys(o).filter(n=>oo(o[n]));if(!a.length)return o;const f=e.props??{},r=b(t.appState,f.id),s=typeof r?.type=="string"?r.type:"",l=a.map(n=>typeof f[n]=="string"?f[n].trim():""),C=I(r?.props),c=s===x?b(t.appState,r?.props?.id):null,E=c?G(r?.props,c.type):"",K=c?I(c.props):"",D=c?`${String(c.type??"")}\0${K}`:"",v=s===x&&!c?JSON.stringify(r?.props?.[W]??null):"",R=r?"":L(t.appState),g=[s,C,E,D,v,Q(),R,z(),...l].join("\0");let d=A.get(o);d||A.set(o,d=new Map);const h=d.get(g);if(h)return h;const m={...o};return a.forEach((n,u)=>{const p=o[n],y=s===x?B(t.appState,r,p.cardRowKind):s?N(r,p.cardRowKind):F(R,p.cardRowKind);if(!y.length&&!l[u]&&(!s&&R||p.cardRowKind==="colour")){delete m[n];return}const T=l[u]&&!y.some(i=>i.key===l[u])?l[u]:"",_=p.cardRowKind==="list",j=(i,S)=>_&&S===0&&i.key!==l[u]?"":i.key;m[n]={...p,options:[..._?[]:p.options,...y.map((i,S)=>({label:i.label,value:j(i,S)})),...T?[{label:T,value:T}]:[]]}}),d.set(g,m),m}export{mo as CARD_ROW_FACTS,Z as IN_CARD_TEMPLATE,O as OUTSIDE_CARD_TEMPLATE,wo as cardRowField,Ro as cardRowFields,fo as cardRowItemField};
1
+ import{jsx as d}from"react/jsx-runtime";import{GroundIcon as _,ListIcon as M}from"efficient-easel/icons";import{FieldGlyph as P}from"../../components/FieldGlyph.js";import{CARD_LIST_FIELDS as W,CARD_LIST_TYPE as h,cardListFieldsOf as B,cardListShows as G,cardTemplateFieldsOf as N,cardTemplateOwner as b}from"../../../format/lib/content/card-template.js";import{copyText as $,plainText as J,plainTextarea as U,ThemeFillRow as Y,withOffPage as q}from"./controls.js";import{recordRowFields as k}from"../../../format/lib/content/record-row.js";import{recordTypesRevision as z}from"../../../format/lib/content/record-types.js";import{editorRecordType as H}from"../../../format/lib/document/editor-page-context.js";import{blockSourcesRevision as Q,declaredBlockSource as C}from"../../../format/lib/content/block-sources.js";import{select as V}from"./box-fields.js";import{withShowWhen as X}from"../../../format/lib/document/show-when-attach.js";function I(o){const t=o?.data?.root,e=H(t?.props)??"";return e&&k(e,"text").length?e:""}const L="outsideCardTemplate",Z={not:{context:L,is:!0}},wo={[L]:(o,t)=>{const e=b(t.appState,o.props?.id);if(e!==void 0)return e===null&&!I(t.appState)}};function fo(o,t){const e=t==="link"?d(P,{noun:"link"}):t==="colour"?d(_,{}):d(M,{}),a={...V(o,e,[t==="colour"?{label:"Manual",value:""}:{label:"Typed here",value:""}],""),cardRowKind:t};return X(a,Z)}function yo(o){return o.kind==="link"?q(J(o.label)):o.kind==="colour"?oo(o.label):o.multiline?U(o.label):$(o.label)}function oo(o){return{type:"custom",render:({value:t,onChange:e})=>d(Y,{label:o,icon:d(_,{}),value:t,shown:typeof t=="string"?t:"",onChange:e})}}function to(o){return!!(o&&typeof o=="object"&&"cardRowKind"in o)}const O=new WeakMap;function Ro(o,t,e){const a=Object.keys(o).filter(n=>to(o[n]));if(!a.length)return o;const f=t.props??{},r=b(e.appState,f.id),s=typeof r?.type=="string"?r.type:"",l=a.map(n=>typeof f[n]=="string"?f[n].trim():""),A=C(r?.props),c=s===h?b(e.appState,r?.props?.id):null,E=c?G(r?.props,c.type):"",K=c?C(c.props):"",D=c?`${String(c.type??"")}\0${K}`:"",j=s===h&&!c?JSON.stringify(r?.props?.[W]??null):"",y=r?"":I(e.appState),x=[s,A,E,D,j,Q(),y,z(),...l].join("\0");let m=O.get(o);m||O.set(o,m=new Map);const g=m.get(x);if(g)return g;const w={...o};return a.forEach((n,u)=>{const p=o[n],R=s===h?B(e.appState,r,p.cardRowKind):s?N(r,p.cardRowKind):k(y,p.cardRowKind);if(!R.length&&!l[u]&&(!s&&y||p.cardRowKind==="colour")){delete w[n];return}const T=l[u]&&!R.some(i=>i.key===l[u])?l[u]:"",F=p.cardRowKind==="list",v=(i,S)=>F&&S===0&&i.key!==l[u]?"":i.key;w[n]={...p,options:[...F?[]:p.options,...R.map((i,S)=>({label:i.label,value:v(i,S)})),...T?[{label:T,value:T}]:[]]}}),m.set(x,w),w}export{wo as CARD_ROW_FACTS,Z as IN_CARD_TEMPLATE,L as OUTSIDE_CARD_TEMPLATE,fo as cardRowField,Ro as cardRowFields,yo as cardRowItemField};
@@ -7,11 +7,13 @@ import { FOLD_FIELD_MARKER, LINK_FIELD_MARKER, MEDIA_FIELD_MARKER, SCAFFOLD_FIEL
7
7
  import { type ShowWhenRule } from "../../../render/lib/document/show-when.js";
8
8
  import { type SettingsBorderValue } from "efficient-easel/panel";
9
9
  import { type AlignmentPoint, FOCAL_DEFAULT } from "efficient-shell/ui";
10
+ import { type ColourChoice } from "./ColourControl.js";
10
11
  import type { GeocodeState } from "../../../format/lib/content/contact.js";
11
12
  import { type SectionHeightMode, type SectionHeightUnit } from "../../../format/lib/content/section-min-height.js";
12
13
  import { type DirectionContainer } from "../../../format/lib/content/container-direction.js";
14
+ import { normalizeThemeColors } from "../../../format/lib/theme.js";
13
15
  import { GAP_FIELD_CONTAINER, type GapContainer } from "../../../format/lib/content/container-gap.js";
14
- import { type SectionBackground } from "../../../format/lib/content/section-background.js";
16
+ import { type SectionBackground, type SectionBandColours } from "../../../format/lib/content/section-background.js";
15
17
  import { type TypeRole, type TypeSizeValue } from "../../../format/lib/content/section-type-size.js";
16
18
  import { type WidthMode } from "../../../format/lib/content/section-width.js";
17
19
  import type { Bucket, DesignGroup } from "./field-groups.js";
@@ -139,6 +141,7 @@ export declare function Swatches({ swatches, current, onPick, names, }: {
139
141
  names?: Readonly<Record<string, string>>;
140
142
  }): import("react").JSX.Element;
141
143
  export declare function backgroundField(label: string, builtIn: SectionBackground, followsBand?: boolean): CustomField<SectionBackground>;
144
+ export declare function sectionBandChoices(stored: SectionBackground, builtIn: SectionBackground, colors: ReturnType<typeof normalizeThemeColors>, n: number, band: SectionBandColours, onChange: (next: SectionBackground) => void): ColourChoice[];
142
145
  export declare function cardImageBackgroundField(label: string, builtIn: string): CustomField<unknown>;
143
146
  export declare function sectionThemeFields(readValue?: (v: unknown) => unknown, followLabel?: string): Record<string, CustomField<unknown>>;
144
147
  export declare function Slider({ min, max, step, value, onChange, suffix, readout, notch, ariaLabel, disabled, placeholder, placeholderWord, onClear, }: {
@@ -269,7 +272,16 @@ export declare function toggle(label: string, fallback: boolean, icon?: ReactNod
269
272
  export declare function pageBackgroundField(): CustomField<string>;
270
273
  export declare function checkbox(label: string, fallback: boolean): CustomField<boolean>;
271
274
  export declare function colorInput(label: string, fallback: string, icon?: ReactElement): CustomField<string>;
275
+ export declare function ThemeFillRow({ label, icon, id, value, shown, onChange, }: {
276
+ label: string;
277
+ icon?: ReactElement;
278
+ id?: string;
279
+ value: unknown;
280
+ shown: string;
281
+ onChange: (next: string) => void;
282
+ }): import("react").JSX.Element;
272
283
  export declare function boxFillField(): CustomField<string>;
284
+ export declare function fillSlotChoices(value: string, colors: ReturnType<typeof normalizeThemeColors>, n: number, onChange: (next: string) => void): ColourChoice[];
273
285
  export declare function boxThemeIndexOf(data: unknown, id: string, own: unknown): number | null;
274
286
  export declare const FOCAL_POINTS: {
275
287
  value: string;
@@ -1 +1 @@
1
- "use client";import{jsx as i,jsxs as N,Fragment as k}from"react/jsx-runtime";import{cloneElement as Pe,createContext as Kt,useContext as ve,useEffect as $t,useId as Be,useRef as V,useState as z}from"react";import{useEasel as te,useSelectedHost as M}from"efficient-easel/easel";import{toDateKey as Xt,fromDateKey as jt}from"efficient-shell/format";import{say as l,editorEaselWords as S}from"../../../format/lib/editor-words.js";import{LOADING_SHOWS_LABELS as De,firstFrameHint as Vt,loadingShowsOf as zt,loadingStillHint as Yt}from"../../../format/lib/hero-video.js";import{pageFramesFor as qt,usePageVideoFrames as Jt}from"../page-video-frames.js";import{ScreenDocumentContext as Zt}from"efficient-easel/screen/components/ScreenDocumentContext";import{readHidable as He,hidableText as Ge}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as de,LINK_FIELD_MARKER as Me,MEDIA_FIELD_MARKER as Ue,SCAFFOLD_FIELD_MARKER as We,TEXT_FIELD_MARKER as T,foldMetaOf as ue,textFieldIdentifier as Qt}from"efficient-easel/draw";import en from"../../components/ApplyCornersToSiblings.js";import{withShowWhen as Ke}from"../../../render/lib/document/show-when.js";import tn from"../../components/TemplateFieldRow.js";import{CARD_IMAGE_RADIUS_STEP as nn,CORNER_RADIUS_MAX as $e,CORNER_RADIUS_MIN as U}from"../../../format/lib/content/card-image-shape.js";import{IMAGE_CORNER_STEP as on,IMAGE_CORNERS_LABEL as rn}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as ln}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as sn,GALLERY_LAYOUTS as ne,GALLERY_LAYOUT_KEYS as an,galleryChoices as Xe,galleryPictureCells as cn}from"../../../format/lib/content/gallery-layout.js";import{shellGlyphOf as dn}from"./shell-glyph.js";import{anchorSiblingsOf as un,placementPoints as pn}from"../../../format/lib/hero-group-placement.js";import fn from"../../components/AnchorField.js";import hn from"../../components/SourceStatus.js";import{AdjustIcon as mn,EyeIcon as gn,AnimationIcon as bn,BackgroundIcon as wn,BorderAllIcon as xn,BlockSectionIcon as Sn,ColumnWidthsIcon as pe,ColumnsIcon as je,CornerIcon as yn,DirectionDownIcon as Cn,DirectionLeftIcon as _n,DirectionRightIcon as Rn,DirectionUpIcon as On,EditIcon as Tn,GapIcon as In,GridIcon as En,GroundIcon as fe,HashIcon as Ve,HeightIcon as kn,ImageIcon as Fn,ListIcon as An,LocationIcon as ze,PaddingBottomIcon as Ye,PaddingLeftIcon as qe,PaddingRightIcon as Je,PaddingTopIcon as Ze,PageIcon as Ln,StickyIcon as Nn,SearchIcon as Pn,SquareIcon as vn,TypeIcon as Bn,WidthIcon as Dn}from"efficient-easel/icons";import{FieldGlyph as Qe}from"../../components/FieldGlyph.js";import{resolvePageBackground as Hn}from"../../../format/lib/content/page-background.js";import{boxFillOf as Gn}from"../../../format/lib/content/box-background.js";import{CORNER_SIDES as et,CORNER_SIDE_POINTS as Mn,hasOwnSectionCorners as Un,normalizeCornerSides as tt}from"../../../format/lib/content/section-corners.js";import{enclosingPath as Wn,enclosingSection as Kn}from"./enclosing-section.js";import{SettingsDefaultReset as y,SettingsDrill as $n,SettingsField as w,SettingsGroup as Xn,SettingsGroupSub as jn,SettingsSegmented as Vn,SettingsBorder as zn,SettingsSidesEach as Yn,SettingsSwitch as he,borderSides as qn,borderStartEach as Jn}from"efficient-easel/panel";import{ListField as Zn}from"efficient-easel/fields";import{DisplayChips as Qn}from"efficient-shell/ui";import{desktopDisplayChanged as eo,partShownOnDesktop as to,partShownOnPhone as no,phoneDisplayChanged as oo,withDesktopPart as ro,withPhonePart as io}from"../../../format/lib/content/part-display.js";import{AlignmentGrid as lo,Checkbox as so,ColorSwatch as ao,CornersInput as co,DatePicker as uo,DateTimePicker as po,FOCAL_DEFAULT as fo,IconPicker as nt,COLUMN_COUNT_MAX as ot,COLUMN_SHARE_MIN as ho,COLUMN_SHARES_EQUAL as mo,resolveColumnShares as rt,WidthsBar as go,useShellStrings as bo,IconButton as it,InputNumber as lt,Slider as wo,Tooltip as me}from"efficient-shell/ui";import{LOOKUP_BUSY_NOTE as xo}from"./geocode-resolve.js";import{ColourRow as st,InheritedColourRow as ge}from"./ColourControl.js";import{keptByRow as So}from"efficient-easel/screen/lib/document/style-fields";import at from"./MarkupToolbar.js";import{deviceField as R}from"efficient-easel/screen/lib/document/device-fields";import{NO_CONTROL_FIELD as yo,NoControlMark as Co,noControlField as ct}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{OWN_BOX_FIELD as _o}from"../../../format/lib/document/own-box.js";import{PHONE_CLEAR as Ro,resolvePhoneValue as be}from"../../../format/lib/document/phone-override.js";import{phoneKey as F,tabletKey as W}from"efficient-easel/draw";import{SuppressibleText as Oo}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as To,CARD_OUTLINE_OPTIONS as Io,DEFAULT_CARD_INDEX_FORMAT as Eo,DEFAULT_CARD_OUTLINE as ko}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as Fo,DEFAULT_COVER_INDEX as Ao}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as Lo}from"efficient-easel/draw";import No from"../../components/MediaUploadField.js";import Po from"../../components/MultiSelectField.js";import vo from"../../components/SectionThemePicker.js";import Bo from"../../components/SearchSelectField.js";import Do from"../../components/StorefrontLinkField.js";import{UiIcon as dt}from"efficient-easel/draw/client";import{SECTION_PADDING as I}from"../../../render/lib/content/section-padding.js";import{buttonWordsSummary as Ho}from"../../../render/lib/content/button-look.js";import{usePreviewParts as Go}from"efficient-easel/draw/client";import{encodePartId as Mo}from"efficient-easel/draw";import{DEFAULT_EASEL_STRINGS as Uo,useEaselStrings as Wo}from"efficient-easel/strings";import{hasPhoneHeight as Ko,hasTabletHeight as we,resolveSectionMinHeight as $o,resolveTabletHeight as Xo}from"../../../format/lib/content/section-min-height.js";import{SECTION_STICK_DISTANCE as oe,SECTION_STICK_LABEL as xe,hasPhoneStick as jo,hasTabletStick as Vo,resolveSectionStick as ut}from"../../../format/lib/content/section-sticky.js";import{SECTION_MIN_HEIGHT as zo,SECTION_MIN_HEIGHT_GROUP_LABEL as Y,SECTION_SCREEN_PCT as Yo}from"../../../format/lib/content/section-min-height.js";import{containerDirectionPoints as qo,resolveContainerDirection as pt}from"../../../format/lib/content/container-direction.js";import{BOX_BLOCK_SPACING_LABEL as Jo,BOX_BLOCK_SPACING_POINTS as ft,BOX_PHONE_ROW_LABEL as ht,BOX_COLUMNS_MAX as Zo,BOX_COLUMNS_MIN as mt,BOX_PHONE_ROW_MAX as Qo,BOX_PHONE_ROW_MIN as Se,BOX_SHARE_CHOICES as gt,BOX_SHARE_LABEL as K,boxShareChoiceOf as bt,boxShareWidthsOf as ye,BOX_SHARE_PHONE_DEFAULT as er,BOX_SHARE_PHONE_POINTS as tr}from"../../../format/lib/content/box-layout.js";import{usePreviewHeader as v}from"../../../render/components/PreviewHeaderContext.js";import{BORDER_MAX as nr,borderBySide as wt}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as or,normalizeTheme as xt,normalizeThemeColors as rr,sectionBandTone as ir,surfaceTwoTone as lr}from"../../../format/lib/theme.js";import{CONTAINER_GAP as St,CONTAINER_GAP_BUILT_IN as sr,CONTAINER_GAP_PHONE as Ce,GAP_FIELD_CONTAINER as _e,followsSitePhoneGap as ar,hasOwnContainerGap as cr,hasOwnPhoneGap as Re,resolveContainerGap as yt,resolvePhoneContainerGap as Ct}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as dr,CARD_IMAGE_BG_OFF as ur,CARD_IMAGE_BG_SWATCH_NAMES as pr,CARD_IMAGE_BG_SWATCHES as fr,isCardImageBackgroundInheriting as hr,cardImageBackgroundChoice as mr,THEME_CARD_IMAGE_BG as gr}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as br,SECTION_BG_NO_FILL as wr,sectionBackgroundChoice as xr,THEME_SECTION_BG as Oe,isSectionBackgroundEmpty as Sr,sectionBackgroundHex as _t}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as yr,nestedAccentValue as Rt,resolveSectionAccent as re}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as Cr,TYPE_SIZE_INHERIT as _r,isTypeSizeInheriting as Rr}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as Or,WIDTH_CHOICE_LABEL as Tr,WIDTH_INHERIT as Ir}from"../../../format/lib/content/section-width.js";import{useFoldHeadingLevel as Er}from"./panel-heading-scope.js";import{useEaselSession as kr}from"efficient-easel/screen/lib/session-context";import{backendOf as Fr}from"../website-session.js";import{BOX_GAP as Ar,describedAs as E,group as O,iconOf as q,sharedStyleKinds as J}from"efficient-easel/screen/lib/document/box-fields";import{VIEW_KEY_ACCESS as Te,onDesktopWords as B,phoneTwinFields as ie}from"efficient-easel/screen/lib/document/box-fields";import{directionField as Lr,gapField as Ie,iconPickerRow as Nr,pickerCellIcon as Pr,pickerNoneIcon as vr,Segmented as Ee,segmented as Br,select as Z,slider as $}from"./box-fields.js";function Os({children:e}){return i("div",{className:"sf-field-label",children:typeof e=="string"?l(e):e})}function D(e,t){return l("{value} from {from}",{value:e,from:t})}function Dr(){const{blockGap:e}=v();return e===null?l("this container's own spacing"):D(`${e}px`,l("Styles"))}function Hr({inherited:e,onReset:t,label:n}){return i(y,{words:S()?.panel,label:l(n),changed:!e,detail:Dr(),onReset:t})}function Gr(e){return Ie({...Ar,builtIn:sr[e],resolve:(t,n)=>yt(e,t,n?.siteGap),action:(t,n)=>i(Hr,{inherited:!cr(e,t),onReset:()=>n(void 0),label:"Gap"}),mark:{[_e]:e}})}function Mr(e){return Ke(R("mobile",{[_e]:e,type:"custom",render:t=>i(Kr,{container:e,...t})}),Ot)}function Ur(e){return Ke(R("tablet",{[_e]:e,type:"custom",render:t=>i(Wr,{container:e,...t})}),Ot)}const Ot={not:{field:"gap",in:Array.from({length:-St.min},(e,t)=>St.min+t)}};function Ts(e){return{gap:R("desktop",Gr(e)),[W("gap")]:Ur(e),[F("gap")]:Mr(e)}}function Wr({container:e,...t}){const[n]=A("gap"),{siteGap:o}=t.field??{},r=Math.max(Ce.min,yt(e,n,o));return Ie({...Ce,builtIn:r,resolve:a=>Re(a)?a:r,action:(a,c)=>i(y,{words:S()?.panel,label:l("Gap"),changed:Re(a),detail:B(d=>l(d),`${r}px`),onReset:()=>c(void 0)})}).render(t)}function Kr({container:e,...t}){const[n]=A("gap"),{siteGap:o,siteGapPhone:r}=t.field??{},s=Ct(e,void 0,n,o,r);return Ie({...Ce,builtIn:s,resolve:c=>Ct(e,c,n,o,r),action:(c,d)=>i(y,{words:S()?.panel,label:l("Gap"),changed:Re(c),detail:D(`${s}px`,ar(e,n,r)?l("Styles"):l("Desktop")),onReset:()=>d(void 0)})}).render(t)}function Is(e){return Lr({offered:qo(e),fallback:pt(e,void 0),resolve:t=>pt(e,t)})}function Es(e,t){return pn(t?un(e,t):[],t)}function $r({inherited:e,onReset:t,label:n}){return i(y,{words:S()?.panel,label:l(n),changed:!e,detail:D(l("Full"),l("the page")),onReset:t})}function H({value:e,onChange:t,label:n,placeholder:o,hint:r,multiline:s,hideable:a=!0,markup:c=!0}){const{text:d,hidden:f}=He(e),h=V(null),p=V(null),u=_=>t(a?{text:_,hidden:f}:_),g=()=>t({text:d,hidden:!f}),m=a&&f,C=Be(),x=r?Yr(r)?i("span",{className:"sf-hint-while-typing",children:l(r)}):l(r):void 0,b=f?l("Show {label} on the slide",{label:l(n)}):l("Hide {label} on the slide",{label:l(n)});return i(w,{label:l(n),icon:i(Bn,{}),htmlFor:C,className:m?"is-hidden":void 0,hint:x,action:a?i(me,{content:b,children:i(it,{"aria-pressed":f,"aria-label":b,onClick:g,children:f?i(dt,{name:"eye-off",size:14}):i(dt,{name:"eye",size:14})})}):void 0,children:N("div",{className:"sf-copybox",children:[c&&i(at,{target:s?p:h,value:d,onChange:u}),s?i("textarea",{id:C,ref:p,value:d,placeholder:o===void 0?void 0:l(o),onChange:_=>u(_.target.value)}):i("input",{id:C,ref:h,type:"text",value:d,placeholder:o===void 0?void 0:l(o),onChange:_=>u(_.target.value)})]})})}function ks(e,t){return{...e,[We]:t}}function Fs(e){const t=e[T];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[T]:{...t,offPage:!0}}}function As(e){return!e||typeof e!="object"?!1:e[T]?.offPage===!0}const Tt="sfPanelOnly";function Ls(e){if(!e[T])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[Tt]:!0}}function Ns(e){return!!e&&typeof e=="object"&&e[Tt]===!0}function Ps(e){const t=e[T];if(!t)throw new Error("withIdentifier: the field holds no authored text");return{...e,[T]:{...t,identifier:!0}}}import{TEXT_CONTROL_KINDS as Va,SCALAR_TEXT_CONTROLS as za}from"efficient-easel/draw";function vs(e,t){if(!e[T])throw new Error("inOwnBox: the field holds no authored text");const{[yo]:o,...r}=e;return{...r,[_o]:!0,render:t}}const Xr=new Set(Lo),Q={type:"radio",options:[{value:!0},{value:!1}]},It={text:{type:"object",objectFields:{text:{type:"text"},hidden:Q}},textarea:{type:"object",objectFields:{text:{type:"textarea"},hidden:Q}},plainText:{type:"text"},copyText:{type:"text"},plainTextarea:{type:"textarea"},textList:{type:"array",arrayFields:{text:{type:"text"}}}},G=(e,t)=>{const n=E({...t,[T]:e},{...It[e.control],label:e.label});if(!Xr.has(e.control))return n;const o=t.render;return{...ct(n,"authored-copy"),render:r=>i(Oo,{name:r.name,children:o(r)})}},Bs="Everything else on this block comes from the linked post. Unlink it to edit by hand.",jr={field:"source.slug",set:!0},Ds={not:jr},Vr="Select a word, then press the highlighter.",zr=new Set([Vr]),Yr=e=>zr.has(e);function Hs(e,t,n){return G({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n})})}function Gs(e,t,n){return G({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0})})}function Ms(e,t,n){return G({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function Us(e,t,n){return G({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1})})}function Ws(e){return{type:"custom",[Me]:{label:e},...E({},{type:"text",label:e}),render:({value:t,onChange:n})=>i(Do,{value:Ge(t),onChange:n,label:e})}}function Ks(e,t,n){return G({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const $s={Design:mn,Animation:bn};function Xs(e){return{type:"custom",render:()=>i(qr,{text:e})}}function qr({text:e}){return i("p",{className:"sf-note",children:l(e)})}function js(e){return ue(e)!==null&&e?.tabs!==void 0}const Et=new Map;function Vs(e,t){const n=`${e}\0${t?t.join(""):""}`,o=Et.get(n)??{type:"custom",tabs:t,[de]:{label:e,level:1},bucket:e,marker:!0,render:()=>i(k,{})};return Et.set(n,o),o}const kt=new Map;function zs(e){const t=kt.get(e)??{type:"custom",[de]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>i(k,{})};return kt.set(e,t),t}function Jr(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function Ys(e,t){return Jr(e)===t?e:{...e,marker:!0,fold:t,render:()=>i(k,{})}}function qs(e){const t=e;if(t.marker===!0&&t.fold===void 0)return e;const{fold:n,...o}=e;return{...o,marker:!0,render:()=>i(k,{})}}function Js({title:e,children:t}){const[n,o]=z(()=>!ke.has(e));return i(Xn,{title:e,open:n,onToggle:r=>{o(r),r?ke.delete(e):ke.add(e)},children:t})}const ke=new Set;function Zs({label:e}){return i(jn,{title:l(e),level:Er(2)})}function Zr({swatches:e,current:t,onPick:n,names:o}){const r=e.find(c=>c.toLowerCase()===t.toLowerCase()),s=r?o?.[r]:void 0,a=s?l(s):t;return N("div",{className:"sf-swatches",children:[e.map(c=>{const d=o?.[c]?l(o[c]):c;return i(me,{content:d,children:i(ao,{color:c,selected:t.toLowerCase()===c.toLowerCase(),onClick:()=>n(c),"aria-label":d})},c)}),i("span",{className:"sf-swatch-hex",children:a})]})}function Qs(e,t,n=!1){return{type:"custom",render:({value:o,onChange:r})=>i(Qr,{label:e,builtIn:t,followsBand:n,value:o,onChange:r})}}function Qr({label:e,builtIn:t,followsBand:n,value:o,onChange:r}){const s=typeof o=="string"?o:void 0,{colors:a,n:c}=Wt(),d={background:a.background,surface:a.surface,surface2:lr(a),band:ir(a)},f=n?Oe:t,h=Sr(s,t,f),p=_t(void 0,f,d),u=n?br:void 0,g=xr(s,t),m=f===Oe?l("the theme's section background"):l("Theme {n} background",{n:c});return i(ge,{label:l(e),icon:i(wn,{}),value:h?"":_t(s,t,d),inherited:p,resetTo:D(p.toUpperCase(),m),onChange:r,onReset:()=>r(u),choices:[{label:l("No fill"),color:"",selected:g==="none",onPick:()=>r(wr)},{label:`${l("Section band")} · ${d.band.toUpperCase()}`,color:d.band,selected:g==="band",onPick:()=>r(Oe)}]})}function ei(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const r=n,s=hr(r,t);return i(w,{label:l(e),icon:i(fe,{}),changed:!s,action:i(y,{words:S()?.panel,label:l(e),changed:!s,detail:l("the theme's image stage"),onReset:()=>o(dr)}),children:Zr({swatches:fr,current:s?gr:mr(r,t),onPick:o,names:pr})})}}}function ea(e=n=>n,t){return J({_gSectionTheme:O(yr),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>i(vo,{value:e(n),onChange:o,followLabel:t})}})}function ee({min:e,max:t,step:n,value:o,onChange:r,suffix:s="",readout:a=!0,notch:c,ariaLabel:d,disabled:f=!1,placeholder:h,placeholderWord:p,onClear:u}){const g=c!==void 0&&Number.isFinite(c)&&c>=e&&c<=t;return i("div",{className:g?"sf-slider has-notch":"sf-slider",style:g?{"--sf-notch":(c-e)/(t-e)}:void 0,children:i(wo,{min:e,max:t,step:n,value:o,...o===null&&h!==void 0?{placeholderValue:h}:{},...p?{emptyLabel:l(p)}:{},suffix:s||void 0,showInput:a,label:d===void 0?void 0:l(d),disabled:f,size:"sm",boxSize:"md",className:"sf-slider-track",onChange:m=>{m===null?u?.():m!==o&&r(m)}})})}function Ft(e,t){const{min:n,max:o,step:r=1,unsetLabel:s,hint:a,restTrack:c,unsetMark:d,icon:f,unit:h="px"}=t;return{type:"custom",render:({value:p,onChange:u})=>{const g=typeof p=="number"?p:null,m=g===null;return i(w,{label:l(e),icon:f?q(f):void 0,value:m?d||s===void 0?void 0:l(s):`${g}${h}`,changed:!m,action:d?Pe(d,{changed:!m,onReset:()=>u(null)}):i(y,{words:S()?.panel,label:l(e),changed:!m,onReset:()=>u(null)}),hint:typeof a=="string"?l(a):a,children:c?c({min:n,max:o,step:r,px:g,label:e,onChange:u}):ee({min:n,max:o,step:r,value:g??n,readout:!1,ariaLabel:e,onChange:u})})}}}const le="Corners";function Fe(e){return{type:"custom",render:({value:t,onChange:n})=>{const o=typeof t=="number"&&Number.isFinite(t)?t:null,r=o!==null;return i(w,{label:l(le),icon:i(yn,{}),changed:r,action:Pe(e.mark,{changed:r,onReset:()=>n(null)}),hint:e.hint,children:i(ni,{tier:e,px:o,onRadius:n})})}}}function A(e){const t=M();return[t?.values?.[e],n=>t?.onChange(e,n)]}function At(){return ct({type:"custom",render:()=>i(Co,{})},"always")}function ti(){const e=M();return t=>e?.onChangeMany(t)}function ni({tier:e,px:t,onRadius:n}){const o=e.useFollowed(),[r,s]=A(e.sidesKey),a=tt(r)??[...et];return i(co,{label:l(le),value:a,corners:Mn,onChange:c=>{const d=tt(c)??[];s(d.length===et.length?null:d)},radius:t,onRadiusChange:n,radiusMin:U,radiusMax:$e,radiusStep:e.step??1,radiusPlaceholder:String(o)})}function Lt(){return At()}function oi({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=v(),r=typeof o=="number"?`${o}px`:l("not set");return i(y,{words:S()?.panel,label:l(e),changed:t,detail:o==null?l("the built-in corners"):D(r,l("Styles")),onReset:n})}function ri(){const{cornerRadiusPx:e}=v();return typeof e=="number"?e:U}function ii(){return Fe({sidesKey:"sectionCornerSides",useFollowed:ri,mark:i(oi,{label:le}),hint:li})}const li="Follows Styles ▸ Basics ▸ Corners until you set a number here.";function ta(){return J({_gShape:O("Shape"),sectionCorners:ii(),sectionCornerSides:Lt(),...X("sectionBorder",Nt)})}const si=()=>({width:l("Border width"),sides:{top:l("Border top"),right:l("Border right"),bottom:l("Border bottom"),left:l("Border left")},style:l("Border style"),styles:{solid:l("Solid"),dashed:l("Dashed"),dotted:l("Dotted")},color:l("Border color"),unit:"px"});function ai(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function ci(){let e;try{const t=xt(v().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||or.line}function di({value:e,onChange:t,placeholder:n,presets:o,sides:r=!0,styles:s=!0,above:a={}}){const c=e&&typeof e=="object"?e:{},[d,f]=z(()=>r?Jn(c,a):!1),h=si(),p=u=>ai(r&&s?u:{width:u.width,color:u.color,...s?{style:u.style}:{}});return i(w,{label:l("Border"),icon:i(xn,{}),action:r?i(Yn,{each:d,label:l("Each side"),onChange:f}):void 0,children:i(zn,{label:l("Border"),value:c,each:d,onChange:u=>t(p(u)),placeholder:n,presets:o,words:h,styles:s,max:nr})})}function ui({value:e,onChange:t,view:n}){const[o]=A("sectionBorder"),[r]=A(W("sectionBorder")),s=ci(),a=d=>d&&typeof d=="object"?d:{},c=n==="phone"?{...wt(a(o)),...wt(a(r))}:n==="tablet"?a(o):{};return i(di,{value:e,onChange:t,placeholder:{sides:qn(c),style:c.style??"solid",color:c.color||s},presets:[s],above:c})}function na(e){return R(e,Nt(e==="mobile"?"phone":e))}function Nt(e){return{type:"custom",render:({value:t,onChange:n})=>i(ui,{value:t,onChange:n,view:e})}}function X(e,t){const n=(o,r)=>ie(e,t(o),Te)[r];return{[e]:n("desktop",e),[W(e)]:n("tablet",W(e)),[F(e)]:n("phone",F(e))}}function oa(e){return{type:"custom",render:()=>i(pi,{partKey:e})}}function pi({partKey:e}){const[t]=A("id"),[n]=A("_partStyles"),{textStyles:o}=v(),r=Wo();let s=null;try{s=Go().select}catch{s=null}const a=n&&typeof n=="object"?n[e]:void 0,c=Array.isArray(o)?o:null;return i($n,{name:l("Text"),preview:Ho(a,c,{noStyle:l("No style"),styleName:r.textStyles.styleName,cases:(r.copy.panel??Uo.copy.panel).cases}),onOpen:()=>{s&&typeof t=="string"&&s(Mo(t,e))}})}function Pt(e){const{cornerRadiusPx:t}=v(),n=typeof t=="number"?t:e;let o=null;try{const{appState:s,selectedItem:a}=te(d=>d),c=a?.props?.id?String(a.props.id):void 0;o=c?Kn(s?.data,c)?.props??null:null}catch{o=null}if(!o)return n;const r=o.sectionCorners;return Un(r)?r:n}function fi({label:e,changed:t=!1,onReset:n=()=>{}}){const o=Pt(U);return i(y,{words:S()?.panel,label:l(e),changed:t,detail:D(`${o}px`,l("the section")),onReset:n})}function hi(){return i(k,{children:l("Follows the section's Corners until you set a number here.")})}function mi(){return Fe({sidesKey:"cardCornerSides",useFollowed:()=>Pt(U),mark:i(fi,{label:le}),hint:i(hi,{})})}function gi(){return{type:"custom",render:()=>i(en,{})}}function ra(e){return{...e,render:t=>i(tn,{render:e.render,props:t})}}function ia(){return{_gShape:O("Shape"),cardCorners:mi(),cardCornerSides:Lt(),cardCornersApplyAll:gi()}}function bi(){return E({type:"custom",render:e=>i(xi,{...e})},{type:"select",label:K,options:[{value:"content",label:"Fit content"},{value:"equal",label:"Equal"},{value:[50],label:"Custom: the width of each block in %, the last block left out"}]})}function wi(e,t){const n=bt(e);if(n!=="custom")return l(gt.find(r=>r.value===n)?.label??"");const o=rt(ye(e,t),t);return o?[...o,100-o.reduce((r,s)=>r+s,0)].join(" / "):l("Custom")}function xi(e){const{value:t,onChange:n}=e,[o]=A("content"),r=Array.isArray(o)?o.length:0,s="follows"in e,a=t!=null,c=a?t:s?e.follows:void 0,d=bt(c),f=r>=2&&r<=ot,h=()=>[...mo[r]??[]],p=V(null),u=b=>{const _=p.current;_&&JSON.stringify(b)===JSON.stringify(_.shares)?n(_.value):b&&n(b)},g=b=>{b===d||b==="custom"&&!f||n(b==="custom"?h():b)},m=l("The width bar works for 2 to {count} blocks.",{count:ot}),C=a&&(s||t!=="content"),x=bo().widths.hint(r,ho);return i(w,{label:l(K),icon:i(pe,{}),changed:C,hint:d!=="custom"?void 0:f?x:m,action:i(y,{words:S()?.panel,label:l(K),changed:C,disabled:e.readOnly===!0,detail:s?B(b=>l(b),wi(e.follows,r),e.followsView):l("Fit content"),onReset:()=>n(void 0)}),children:N("div",{className:"sf-share-row",children:[i("div",{className:"sf-share-pick",children:i(nt,{label:l(K),value:d,options:gt.map(b=>({value:b.value,label:b.value==="custom"&&!f?m:l(b.label),icon:Pr(i("span",{className:"sf-gallery-pic sf-share-pic",children:vt(b.weights).map((_,j)=>i("i",{style:{gridColumn:`span ${_}`}},j))}),l(b.label),b.value==="custom"&&!f?m:l(b.label))})),onChange:g,columns:3,cell:Bt,tooltips:!1,disabled:e.readOnly===!0})}),d==="custom"&&f?i("div",{onFocus:()=>{p.current={value:t,shares:rt(ye(c,r),r)}},onBlur:()=>{p.current=null},children:i(go,{label:l(K),count:r,value:ye(c,r),onChange:u,readOnly:e.readOnly===!0})}):null]})})}function vt(e){if(!e)return[3,4];const t=e.reduce((n,o)=>n+o,0);return e.map(n=>Math.round(n/t*12))}function la(){return Z(Jo,i(In,{}),ft,ft[0].value)}function sa(){return R("mobile",Nr(K,i(pe,{}),tr.map(e=>({label:e.label,value:e.value,picture:i("span",{className:"sf-gallery-pic sf-share-pic",children:vt(e.weights).map((t,n)=>i("i",{style:{gridColumn:`span ${t}`}},n))})})),er,{columns:2,cell:Bt}))}const Bt={width:"5.75rem",height:"3.25rem"};function aa(){return ie("share",bi(),Te)[W("share")]}function Si(){return R("mobile",$(ht,i(je,{}),Se,Qo,1,Se,"",{clear:{phoneFollows:!1,hint:Se}}))}const Dt={read:e=>e.phoneRow,write:(e,t,n)=>({phoneRow:n}),fieldKey:()=>"phoneRow",ownField:!0};function ca(){const e=$(ht,i(je,{}),mt,Zo,1,mt,"",{clear:{emptyLabel:"Auto"}}),t=ie("columns",e,{...Dt,tablet:Te.tablet}),n=ie("columns",e,Dt,{phoneRow:Si()});return{...t,phoneRow:n.phoneRow}}function da(e,t,n,o,r,s){return{type:"custom",render:({value:a,onChange:c})=>i(w,{label:l(e),icon:i(Qe,{noun:s}),action:i(y,{words:S()?.panel,label:l(e),changed:!Rr(a),detail:l("the Text style in Styles"),onReset:()=>c(_r),defaultAction:{onPress:()=>c(Cr),title:l("Keep this section's own built-in size"),icon:i(Sn,{})}}),children:ee({min:t,max:n,step:o,value:typeof a=="number"?a:r,suffix:"px",ariaLabel:e,onChange:c})})}}function ua(){return{_gCellWidth:O("Cell width"),gridSpan:Z("Positions",i(pe,{}),[{label:"Auto",value:""},...Array.from({length:ln},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}function L(){let e=null,t=null;try{e=ve(yi),t=te(n=>n).selectedItem}catch{t=null}return e??t?.props??{}}const yi=Kt(null);function Ci({min:e,max:t,step:n,px:o,label:r,onChange:s,desktopKey:a,fallback:c}){const d=L()[a],f=be(void 0,d,c);return i(k,{children:ee({min:e,max:t,step:n,value:be(o,d,c),readout:!1,ariaLabel:r,notch:f,onChange:s})})}function _i({label:e,desktopKey:t,fallback:n,unit:o="px",changed:r=!1,onReset:s=()=>{}}){const a=L()[t],c=be(void 0,a,n);return i(y,{words:S()?.panel,label:l(e),changed:r,detail:B(d=>l(d),`${c}${o}`),onReset:s})}function Ri(e){return Ft(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unit:e.unit,unsetLabel:"Follows Desktop",unsetMark:i(_i,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback,unit:e.unit}),restTrack:t=>i(Ci,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}const Oi={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},Ti={Top:Ze,Bottom:Ye,Left:qe,Right:Je},Ii=e=>{const t=Ti[e];return i(t,{})};function pa(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,r=x=>Oi[x],s=x=>$(r("Top"),i(Ze,{}),I.min,I.max,I.step,x,"px"),a=(x,b,_,j=I)=>R("mobile",Ri({label:r(x),icon:Ii(x),desktopKey:b,min:j.min,max:j.max,step:j.step,fallback:_})),c=e.top??I.min,d=e.bottom??I.min,f="sectionPaddingLeft",h="sectionPaddingRight",p=e.sideBounds??I,u=e.side??p.min,g=e.sidePhone??u,m=e.phone===!0,C=x=>m?R("desktop",x):x;return J({...o?{_gSpacing:O("Padding")}:{},[t]:C(s(c)),...m?{[F(t)]:a("Top",t,c)}:{},...e.only==="top"?{}:{[n]:C($(r("Bottom"),i(Ye,{}),I.min,I.max,I.step,d,"px")),...m?{[F(n)]:a("Bottom",n,d)}:{}},...e.sides?{[f]:C($(r("Left"),i(qe,{}),p.min,p.max,p.step,u,"px")),...m?{[F(f)]:a("Left",f,g,p)}:{},[h]:C($(r("Right"),i(Je,{}),p.min,p.max,p.step,u,"px")),...m?{[F(h)]:a("Right",h,g,p)}:{}}:{}})}function fa(e,t){const n=Object.fromEntries(Object.entries(t).map(([s,a])=>[s,s in e&&ue(a)?e[s]:a])),o={};let r=!1;for(const[s,a]of Object.entries(e)){if(s in t){r||Object.assign(o,n),r=!0;continue}o[s]=a}return r||Object.assign(o,n),o}const se="Width";function ha(e,t=Or,n=!0){const o=t.map(r=>({label:Tr[r],value:r}));return J({...n?{_gWidth:O(se)}:{},widthMode:{type:"custom",render:({onChange:r,field:s})=>i(w,{label:l(se),icon:i(Dn,{}),action:n?i($r,{inherited:s?.inherited??!1,onReset:()=>r(Ir),label:se}):void 0,children:Ee({options:o,value:s?.currentValue||e,onChange:r,ariaLabel:se})})}})}function ma(){const e=(o,r)=>({type:"custom",render:({value:s,onChange:a})=>i(Ei,{value:s,onChange:a,view:o,badge:r})}),t=o=>({type:"custom",render:({value:r,onChange:s,field:a})=>i(Fi,{value:r,onChange:s,unit:a?.unit,view:o})}),n=o=>{const r=Br("Unit",i(Ve,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");if(o==="desktop")return r;const s=r.render;return{...r,render:a=>i(Ai,{props:a,draw:s,view:o})}};return J({_gHeight:O(Y),...X("sectionHeightMode",o=>o==="desktop"?e(o):e(o,r=>i(Li,{view:o,onClear:()=>r(void 0)}))),...X("sectionHeightValue",t),...X("sectionHeightUnit",n)})}function Ei({value:e,onChange:t,view:n,badge:o}){const r=L(),s=c=>["auto","fixed","screen"].includes(c),a=ae(n,r)?.mode??"auto";return i(w,{label:Y,icon:q(i(kn,{})),action:o?o(t):void 0,children:Ee({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:s(e)?e:a,onChange:t,ariaLabel:Y})})}function Ht(e,t){return e==="phone"&&we(t)?Xo(t):$o(t)}function ae(e,t){return e==="desktop"||(e==="tablet"?we(t):Ko(t))?null:Ht(e,t)}const P=(e,t)=>e==="tablet"?W(t):F(t);function ki(e,t,n,o){const r=ae(e,t);return!r||e==="desktop"?null:o===void 0?{}:{[P(e,"sectionHeightMode")]:r.mode,...r.mode==="fixed"?{[P(e,"sectionHeightUnit")]:r.unit}:{},...n==="sectionHeightUnit"?{[P(e,"sectionHeightValue")]:r.value}:{},[P(e,n)]:o}}function Gt(e,t,n){const o=M(),r=ae(e,L());return!o||!r?{followed:null,write:n}:{followed:r,write:a=>o.onChangeMany(c=>{const d=ki(e,c,t,a);return d===null?{[e==="desktop"?t:P(e,t)]:a}:Object.keys(d).length?d:null})}}function Fi({value:e,onChange:t,unit:n,view:o}){const{followed:r,write:s}=Gt(o,"sectionHeightValue",t),a=(r?r.unit:n)==="%"?"%":"px",c=a==="%"?Yo:zo;return i("div",{className:"sf-field",children:ee({min:c.min,max:c.max,step:c.step,value:r?null:typeof e=="number"?e:c.fallback,...r?{placeholder:r.value}:{},suffix:a,ariaLabel:Y,onChange:s})})}function Ai({props:e,draw:t,view:n}){const{followed:o,write:r}=Gt(n,"sectionHeightUnit",e.onChange);return t({...e,...o?{value:void 0,storedValue:void 0,follows:o.unit}:{},onChange:r})}function Li({view:e,onClear:t}){const n=L(),o=ae(e,n)===null,r=e==="phone"&&we(n),s=Ht(e,n),a=B(c=>l(c),s.mode==="auto"?l("Auto"):`${s.value}${s.unit}`,r?"tablet":"desktop");return i(y,{words:S()?.panel,label:l(Y),changed:o,detail:a,onReset:t})}function ga(){const e=n=>({type:"custom",render:({value:o,onChange:r,id:s,name:a})=>i(vi,{value:o,onChange:r,labelId:`${s??a??"stickTop"}-label`,view:n})}),t=n=>({type:"custom",render:({value:o,onChange:r})=>i(Ni,{value:o,onChange:r,view:n})});return{_gStick:O(xe),...X("stickTop",e),...X("stickTopDistance",t)}}function Ni({value:e,onChange:t,view:n}){const o=M(),r=L(),s=n==="desktop"||Ae(n,r)?null:Mt(n,ut(r)),a=s&&o?c=>o.onChangeMany(d=>{const f=Pi(n,d,c);return f===null?{[P(n,"stickTopDistance")]:c}:Object.keys(f).length?f:null}):t;return i("div",{className:"sf-field",children:ee({min:oe.min,max:oe.max,step:oe.step,value:s?null:typeof e=="number"?e:oe.fallback,...s?{placeholder:s.distance}:{},suffix:"px",ariaLabel:l("Distance from top"),onChange:a})})}function Ae(e,t){return e==="tablet"?Vo(t):jo(t)}function Mt(e,t){return e==="phone"?{on:t.tablet,distance:t.tabletDistance}:{on:t.desktop,distance:t.desktopDistance}}function Pi(e,t,n){return e==="desktop"||Ae(e,t)?null:n===void 0?{}:{[P(e,"stickTop")]:!0,[P(e,"stickTopDistance")]:n}}function vi({value:e,onChange:t,labelId:n,view:o}){const r=L(),s=ut(r),a=o==="phone"?s.phone:o==="tablet"?s.tablet:e===!0,c=o==="phone"&&s.ownTablet,d=o==="desktop"?null:Mt(o,s),f=d?.on?`${d.distance}px`:l("Off");return i(w,{label:l(xe),labelId:n,icon:q(i(Nn,{})),action:N(k,{children:[o!=="desktop"?i(y,{words:S()?.panel,label:l(xe),changed:Ae(o,r),detail:B(h=>l(h),f,c?"tablet":"desktop"),onReset:()=>t(void 0)}):null,i(he,{checked:a,onChange:t,ariaLabelledBy:n})]})})}const Ut="e.g. about";function ba(){return{_gAnchor:O("Anchor"),anchor:G({control:"plainText",label:"Name",placeholder:Ut},{type:"custom",render:({value:e,onChange:t})=>i(fn,{value:e,onChange:t,nameBox:(n,o)=>i(H,{value:n,onChange:o,label:"Name",placeholder:Ut,hideable:!1,markup:!1})})})}}function wa(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:s,name:a})=>{const c=`${s??a??e}-datetime`,d=Date.parse(typeof o=="string"?o:"");return i(w,{label:l(e),icon:t,htmlFor:c,hint:n===void 0?void 0:l(n),children:i(po,{id:c,value:Number.isFinite(d)?new Date(d):null,onChange:f=>r(f?f.toISOString():"")})})}}}function xa(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:s,name:a})=>{const c=`${s??a??e}-date`;return i(w,{label:l(e),icon:t,htmlFor:c,hint:n===void 0?void 0:l(n),children:i(uo,{id:c,value:jt(typeof o=="string"?o:null),onChange:d=>r(d?Xt(d):"")})})}}}function Bi(e,t,n,o){return{type:"custom",...E({},{...Q,label:e}),render:r=>{const{value:s,onChange:a,id:c,name:d}=r,f="follows"in r,h=r,p=typeof s=="boolean",u=typeof h.follows=="boolean"?h.follows:t,g=p?s:f?u:t,m=`${c??d??e}-label`,C=h.readOnly===!0,x=i(he,{checked:g,onChange:a,disabled:C,ariaLabelledBy:m});return i(w,{label:l(e),labelId:m,icon:n,hint:o===void 0?void 0:l(o),action:f?N(k,{children:[i(y,{words:S()?.panel,label:l(e),changed:p,detail:h.followsNoView?l(u?"On":"Off"):B(b=>l(b),l(u?"On":"Off"),h.followsView),disabled:C,onReset:()=>a(void 0)}),x]}):x})}}}function Sa(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const r=`${String(n??o??"pageBackground")}-colour`;return i(st,{label:l("Background"),icon:i(Ln,{}),id:r,value:Hn(e),onChange:t})}}}function ya(e,t){return{type:"custom",...E({},{...Q,label:e}),render:({value:n,onChange:o,id:r})=>{const s=typeof n=="boolean"?n:t,a=`${r??e}-checkbox`;return i(w,{label:l(e),htmlFor:a,className:"sf-checkbox",action:i(so,{id:a,checked:s,onChange:o})})}}}function Ca(e,t,n){return{type:"custom",render:({value:o,onChange:r})=>i(st,{label:l(e),icon:n,value:o||t,onChange:r})}}function _a(){return{type:"custom",render:e=>{const{value:t,onChange:n}=e,o=e;return i(Di,{value:typeof t=="string"?t:"",onChange:n,twin:"follows"in e?{follows:o.follows,view:o.followsView}:void 0})}}}function Di({value:e,onChange:t,twin:n}){const{hex:o,n:r}=Gi(),s=D(o.toUpperCase(),l("Theme {n} background",{n:r}));if(n){const a=Gn(n.follows);return i(ge,{label:l("Fill"),icon:i(fe,{}),value:e,inherited:a??o,resetTo:B(c=>l(c),a?a.toUpperCase():s,n.view),onChange:t,onReset:()=>t(void 0)})}return i(ge,{label:l("Fill"),icon:i(fe,{}),value:e,inherited:o,resetTo:s,onChange:t,onReset:()=>t("")})}function Hi(e,t,n){if((e?.content??[]).some(a=>a?.props?.id===t))return re(n);const r=Wn(e,t);if(r.length===0)return null;const s=re(Rt(n));if(s!==null)return s;for(let a=r.length-1;a>0;a-=1){const c=re(Rt(r[a].sectionAccent));if(c!==null)return c}return re(r[0].sectionAccent)}function Gi(){const{colors:e,n:t}=Wt();return{hex:e.background,n:t}}function Wt(){const e=xt(v().theme),[t]=A("sectionAccent");let n=null;try{const{appState:r,selectedItem:s}=te(c=>c),a=s?.props?.id?String(s.props.id):void 0;n=a?Hi(r?.data,a,t):null}catch{n=null}const o=n!==null&&e.themes[n]?n:e.selected;return{colors:rr(e.themes[o]),n:o+1}}const Mi=[{value:"0% 0%",label:"Top left"},{value:"50% 0%",label:"Top"},{value:"100% 0%",label:"Top right"},{value:"0% 50%",label:"Left"},{value:"50% 50%",label:"Center"},{value:"100% 50%",label:"Right"},{value:"0% 100%",label:"Bottom left"},{value:"50% 100%",label:"Bottom"},{value:"100% 100%",label:"Bottom right"}];function Ui({label:e,value:t,onChange:n,points:o=Mi}){const r=o.map(s=>({...s,label:l(s.label),...s.title?{title:l(s.title)}:null}));return i(lo,{label:l(e),value:t,points:r,onChange:n})}function Ra(){return At()}const Oa={top:i(On,{}),right:i(Rn,{}),bottom:i(Cn,{}),left:i(_n,{})};function Ta(e,t,n,o,r,s,a){const c=p=>t.find(u=>u.value===p),d=p=>({value:p,label:"",disabled:!0,title:o}),f=p=>{const u=t.find(m=>m.cell===p);if(!u)return d(`missing-${p}`);const g=s?.[p];return g?{value:u.value,label:u.label,icon:g}:{value:u.value,label:u.label}},h=[d("corner-top-left"),f("top"),d("corner-top-right"),f("left"),d("centre"),f("right"),d("corner-bottom-left"),f("bottom"),d("corner-bottom-right")];return{type:"custom",render:({value:p,onChange:u})=>{const g=t.some(m=>m.value===p)?p:n;return i(w,{label:l(e),icon:r,value:c(g)?.label?l(c(g).label):a?l(a):"",children:Ui({label:e,value:g,onChange:u,points:h})})}}}function Ia(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:r,field:s})=>i(Po,{label:e,options:(s.options??t).map(a=>({...a,label:l(a.label)})),value:Array.isArray(o)?o:[],onChange:r,...n?{emptyLabel:l(n)}:{}})}}function Ea(e,t,n,o){return{type:"custom",options:t,fallback:n,...E({},{type:"select",label:e}),render:({value:r,onChange:s,field:a})=>i(Bo,{label:e,options:(a.options??t).map(c=>({...c,label:l(c.label)})),fallback:a.fallback??n,value:r,onChange:s,placeholder:o===void 0?void 0:l(o)})}}function ka(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const r={value:n,onChange:o,...t};return i(e,{...r})}}}const Fa=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function Aa(e,t,n){const o=Object.keys(De).map(r=>({label:De[r],value:r,picture:n[r]}));return{type:"custom",...E({},{type:"radio",label:e,options:o.map(r=>({value:r.value,label:r.label}))}),render:({onChange:r})=>i(Ki,{label:e,icon:t,options:o,onChange:r})}}function Wi(e,t,n){const o=Vt(e,t,n);if(o!==void 0)return o==="save-makes-frame"?l("A frame is made from this video when you save the page."):o==="starts-dark"?l("This video starts dark, so no frame was made. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="outside"?l("This video is on another website, so no frame can be made. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="unsupported"?l("This video's file type gives no frame. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="failed"?l("No frame could be made from this video. It is tried again the next time you save the page. The slide shows its background colour while the video loads."):o==="image-no-frame"?l("The slide shows your Image while the video loads, because this video has no frame."):void 0;const r=Yt(e);return r==="frame-missing-image"?l("This video has no frame yet. The slide shows its image until one is made."):r==="frame-missing-surface"?l("This video has no frame yet. The slide shows its background colour until one is made."):r==="image-missing-frame"?l("No image yet. The slide shows the video's frame until you choose one."):r==="image-missing-surface"?l("No image yet. The slide shows its background colour until you choose one."):void 0}function Ki({label:e,icon:t,options:n,onChange:o}){const r=M(),s=r?.values??{},a=zt(s),c=ve(Zt),d=Jt(c?.docId??null);let f=null;try{f=te(p=>p.appState.data)}catch{f=null}const h=qt(r?.id,f,d);return i(w,{label:l(e),icon:q(t),hint:Wi(s,h,c?.hasUnsavedEdits??!1),children:Ee({options:n,value:a,onChange:o,ariaLabel:e})})}function La(e,t,n,o={}){const r={type:"custom",[Ue]:!0,render:({value:s,onChange:a,name:c})=>i(No,{value:s||"",onChange:a,fieldKey:c,label:e,accept:t,placeholder:n,focusKey:o.focus,focusWhen:o.focusWhen,frameKey:o.frame}),...o.focus?{focusKey:o.focus}:{},...o.focusWhen?{focusWhen:o.focusWhen}:{}};return o.focus?R("each",r):r}const Na={HeroSingle:["imageFocal"],HeroSlide:["videoFrame"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function $i(e){const t=l(e.status??"");return e.ok&&typeof e.lat=="number"&&typeof e.lng=="number"?`${t} · ${e.lat.toFixed(4)}, ${e.lng.toFixed(4)}`:t}function Pa({value:e,onChange:t,label:n}){const o=e||{},r=M(),s=r?r.values!==r.node.props:!0,a=!!o.pending&&s,c=!!o.pending&&!s,d=!!Fr(kr()).geocode,f=Be(),h=(p,u)=>t({...o,[p]:u??void 0});return N(k,{children:[i(w,{label:l(n),icon:i(ze,{}),action:d?i(me,{content:l("Find from the address (OpenStreetMap)"),children:i(it,{"aria-label":l("Find from the address"),"aria-busy":a||void 0,disabled:a,onClick:()=>t({...o,pending:!0,ok:!1,status:"Finding…"}),children:i(Pn,{})})}):void 0,children:d&&o.status?i(hn,{compact:!0,oneLine:!0,spaced:!1,status:a?"busy":o.ok&&!c?"found":"notfound",statusText:a?l("Finding…"):c?l(xo):l(o.status),hint:$i(o)}):null}),i(w,{label:l("Enter by hand"),labelId:f,icon:i(Tn,{}),action:i(he,{checked:!!o.manual,onChange:p=>t({...o,manual:p}),ariaLabelledBy:f})}),o.manual&&i(w,{label:l("Latitude, longitude"),icon:i(ze,{}),children:N("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,width:"100%",minWidth:0},children:[i(lt,{value:typeof o.lat=="number"?o.lat:null,onChange:p=>h("lat",p),min:-90,max:90,step:1e-4,placeholder:l("Latitude")}),i(lt,{value:typeof o.lng=="number"?o.lng:null,onChange:p=>h("lng",p),min:-180,max:180,step:1e-4,placeholder:l("Longitude")})]})})]})}function Xi(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function ji(e,t,n){const o=e.map(r=>({text:r?.text??""}));return t===null||t<0||t>=e.length?o:o.map((r,s)=>s===t?{text:n}:r)}function va(e,t){return e===null?null:t>e?e:null}function Vi(e,t,n){if(n===null||n>=t.length)return null;for(let o=0;o<n;o+=1)if(e[o]!==t[o])return null;return e[n]!==t[n]&&t.includes(e[n])||e[n]!==t[n]&&t.length!==e.length?null:n}const Ba={label:"Ticker items",icon:i(An,{})};function Da(e,t,n,o){return{type:"custom",[T]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},...E({},{...It.textList,label:e}),render:({value:r,onChange:s})=>i(zi,{label:e,icon:q(t),items:Array.isArray(r)?r:[],placeholder:n,onChange:s,markup:o==="markup"})}}function zi({label:e,icon:t,items:n,placeholder:o,onChange:r,markup:s=!1}){const a=V(null),[c,d]=z(null),f=p=>p.map(u=>({text:u?.text??""})),h=p=>{const u=Vi(n,p,c);u===null&&(a.current=null),d(u),r(f(p))};return i(Zn,{label:l(e),icon:t,noun:l("item"),items:n,onChange:h,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:s?i(at,{target:a,value:Xi(n,c),onChange:p=>r(ji(n,c??-1,p)),disabled:c===null,label:c===null?l("Formatting — click a row first"):l("Formatting — row {n}",{n:c+1})}):void 0,renderRow:(p,u,g)=>i("input",{type:"text",className:s&&c===u?"sf-list-marking":void 0,value:p?.text??"",placeholder:l(o),"aria-label":l("{label} {n}",{label:l(e),n:u+1}),onChange:m=>g({text:m.target.value}),onFocus:m=>{a.current=m.currentTarget,d(u)}})})}function Ha(e,t){const n=`${e.label} — row ${t+1}`;return G({control:"plainText",label:n,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:l("{label} — row {n}",{label:l(e.label),n:t+1}),placeholder:e.placeholder,hideable:!1,markup:e.rendering==="markup"})})}function Ga(e){return{_gCards:O("Cards"),coverIndex:Z("Cover image",i(Fn,{}),Fo,String(Ao),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:ei("Image background",ur),cardImage:Ji()}}function Ma(){return{outline:Z("Card outline",i(vn,{}),Io,ko),indexBadge:Z("Card number",i(Ve,{}),To,Eo),showBadge:Bi("Product badge",!0,i(Qe,{noun:"tag"}))}}function Ua(e){const t=e?.defaults??{showCardSizes:!0,showCardBuy:!0,showCardPage:!0},n=r=>({...Q,label:ce.find(s=>s.id===r).label}),o=r=>E(So(Le),n(r));return{_gShowOnCard:O("Show on a card"),[Le]:E({type:"custom",render:()=>i(Yi,{rest:{showCardPrice:!0,showCardFinishes:!0,...t}})},n(Le)),showCardFinishes:o("showCardFinishes"),showCardSizes:o("showCardSizes"),showCardBuy:o("showCardBuy"),showCardPage:o("showCardPage")}}const Le="showCardPrice",ce=[{id:"showCardPrice",label:"Price"},{id:"showCardFinishes",label:"Finish swatches"},{id:"showCardSizes",label:"Sizes"},{id:"showCardBuy",label:"Buy button"},{id:"showCardPage",label:"Page button"}];function Yi({rest:e}){const t=L(),n=ti(),o=a=>typeof t[a]=="boolean"?t[a]:void 0,r=a=>o(a)??e[a],s=ce.some(({id:a})=>o(a)!==void 0&&o(a)!==e[a]);return i(Ne,{parts:ce,changed:s,shown:r,onPress:(a,c)=>n({[a]:c}),onReset:()=>n(Object.fromEntries(ce.map(({id:a})=>[a,void 0])))})}function Wa(e,t="display"){const n=F(t);return{[t]:R("desktop",{type:"custom",render:({value:o,onChange:r})=>i(Ne,{parts:e,changed:eo(o),shown:s=>to(o,s),onPress:(s,a)=>r(ro(o,s,a)),onReset:()=>r(void 0)})}),[n]:R("mobile",{type:"custom",render:({value:o,onChange:r})=>i(qi,{parts:e,desktopKey:t,value:o,onChange:r})})}}function Ne({parts:e,changed:t,shown:n,onPress:o,onReset:r,detail:s,disabledReason:a}){const c=l("Display");return i(w,{label:c,icon:i(gn,{}),changed:t,action:i(y,{words:S()?.panel,label:c,changed:t,detail:s,onReset:r}),children:i(Qn,{label:c,items:e.map(d=>({id:d.id,label:l(d.label),shown:n(d.id),...a?{disabled:!0,disabledReason:l(a)}:{}})),onChange:o})})}function qi({parts:e,desktopKey:t,value:n,onChange:o}){const r=L()[t];return i(Ne,{parts:e,changed:oo(n),shown:s=>no(r,n,s),onPress:(s,a)=>o(io(n,s,a)),onReset:()=>o(Ro),detail:l("the same as Desktop")})}function Ji(){return Ft("Card image",{min:U,max:$e,step:nn,hint:"Rounds the picture. The card's own corner is in Styles."})}function Ka(){return Fe({sidesKey:"cornerSides",step:on,useFollowed:()=>U,mark:i(Zi,{label:rn}),hint:l("Rounds the picture. Left alone it stays square.")})}function Zi({label:e,changed:t=!1,onReset:n=()=>{}}){return i(y,{words:S()?.panel,label:l(e),changed:t,onReset:n})}function $a(){return{type:"custom",render:({value:e,onChange:t})=>i(nl,{value:typeof e=="string"?e:"",onChange:t})}}function Qi({layout:e,width:t}){return i("span",{"aria-hidden":"true",style:{display:"grid",width:t,gridTemplateColumns:"repeat(12, minmax(0, 1fr))",gridAutoRows:6,gridAutoFlow:"row dense",gap:2},children:cn(e).map(([n,o],r)=>i("i",{className:"block rounded-xs bg-current opacity-60",style:{gridColumn:`span ${n}`,gridRow:`span ${o}`}},r))})}const el={width:"3.5rem",height:"2.5rem"},tl=200;function nl({value:e,onChange:t}){const[n,o]=z(null),[r,s]=z(4),a=V(null);$t(()=>{const u=a.current;if(!u||typeof ResizeObserver!="function")return;const g=()=>s(u.getBoundingClientRect().width>=tl?4:3);g();const m=new ResizeObserver(g);return m.observe(u),()=>m.disconnect()},[]);const c=e&&e in ne?e:"",d=Xe(n,c),f=Xe(n,"").length,h=dn("no-symbol"),p=[{value:"",label:l("Not chosen"),icon:vr(h,l("Not chosen"))},...d.map(u=>({value:u,label:l(ne[u].label),icon:i(Qi,{layout:ne[u],width:40})}))];return i(w,{label:l("Layout"),icon:i(En,{}),value:c?l(ne[c].label):void 0,children:i("div",{ref:a,style:{flex:"1 1 auto",minWidth:0},children:i(nt,{label:l("Layout"),value:c,options:p,onChange:t,columns:r,cell:el,header:N("div",{className:"mb-2 flex flex-col gap-1",style:{minWidth:"11rem"},children:[i("span",{className:"text-2xs text-ink-faint",children:l("Photos in a row")}),i(Vn,{options:[{id:"all",label:l("All")},...sn.map(u=>({id:String(u),label:String(u)}))],value:n===null?"all":String(n),ariaLabel:l("Photos in a row"),onChange:u=>o(u==="all"?null:Number(u))}),i("span",{className:"text-2xs text-ink-faint",children:l("{n} of {total} layouts",{n:f,total:an.length})})]})})})})}export{jr as BOUND_TO_POST,Bs as BOUND_TO_POST_NOTE,$s as BUCKET_ICONS,Na as CUSTOM_FIELD_MEDIA,Pa as CoordsField,Ot as DESKTOP_GAP_NOT_OVERLAP,Ne as DisplayRow,Oa as EDGE_ARROWS,fo as FOCAL_DEFAULT,Mi as FOCAL_POINTS,de as FOLD_FIELD_MARKER,Ui as FocalPicker,Zs as GroupLabel,Vr as HIGHLIGHT_HINT,H as HidableTextField,Me as LINK_FIELD_MARKER,Os as Label,Ue as MEDIA_FIELD_MARKER,Fa as MEDIA_TYPE_OPTIONS,Ds as NOT_BOUND_TO_POST,Js as PanelBand,qr as PanelNoteLine,yi as RowPropsContext,We as SCAFFOLD_FIELD_MARKER,za as SCALAR_TEXT_CONTROLS,Hr as SiteGapDefaultReset,ee as Slider,Zr as Swatches,Va as TEXT_CONTROL_KINDS,T as TEXT_FIELD_MARKER,Ba as TICKER_ITEMS_ROW,zi as TextListField,se as WIDTH_LABEL,$r as WidthDefaultReset,Vi as aimAfterListChange,ba as anchorFields,D as backTo,Qs as backgroundField,la as boxBlockSpacingField,ca as boxColumnsFields,_a as boxFillField,Si as boxPhoneRowField,bi as boxShareField,sa as boxSharePhoneField,aa as boxShareTabletField,Hi as boxThemeIndexOf,Vs as bucketHeader,oa as buttonWordsEntryField,mi as cardCornersField,ei as cardImageBackgroundField,Ji as cardImageField,Ga as cardMediaFields,ia as cardShapeFields,Ua as cardShowFields,Ma as cardStyleFields,ua as cellWidthFields,ya as checkbox,Ca as colorInput,Is as containerDirectionField,Gr as containerGapField,Mr as containerGapPhoneField,Ts as containerGapRows,Ur as containerGapTabletField,$i as coordsResultTip,Us as copyText,Lt as cornerSidesField,Fe as cornersRowField,xa as date,wa as dateTime,zs as designGroupHeader,Wa as displayFields,Ta as edgePad,va as focusAfterRemove,Ra as focusKeptField,Ys as foldMarker,ue as foldMetaOf,Jr as foldTitleOf,ki as followedHeightPatch,Pi as followedStickPatch,$a as galleryLayoutField,ma as heightFields,ae as heightFollowedBy,Es as heroGroupPlacementPoints,Ge as hidableText,Yr as hintIsWhileTyping,Ka as imageCornersField,vs as inOwnBox,js as isBucketHeader,At as keptBy,Ws as linkField,Wi as loadingRowHint,Aa as loadingShowsField,Ia as multiSelect,Sa as pageBackgroundField,Xs as panelNote,Ri as phoneOverrideField,Ms as plainText,Ks as plainTextarea,Ft as pxField,qs as quietMarker,He as readHidable,Xi as rowText,Ea as searchSelect,na as sectionBorderField,ii as sectionCornersField,ta as sectionShapeFields,ea as sectionThemeFields,ji as setRowText,da as sizeField,ka as sourceField,pa as spacingFields,ga as stickFields,fa as swapPadding,ra as templateField,Hs as text,Qt as textFieldIdentifier,As as textFieldOffPage,Ns as textFieldPanelOnly,Da as textList,Ha as textListRowField,Gs as textarea,Bi as toggle,La as upload,ti as useSelectedPatch,L as useSelectedProps,A as useSelectedSibling,Dr as useSiteGapDetail,ha as widthField,Ps as withIdentifier,Fs as withOffPage,Ls as withPanelOnly,ks as withScaffold};
1
+ "use client";import{jsx as i,jsxs as N,Fragment as k}from"react/jsx-runtime";import{cloneElement as Ge,createContext as zt,useContext as Me,useEffect as Yt,useId as Ue,useRef as V,useState as z}from"react";import{useEasel as te,useSelectedHost as M}from"efficient-easel/easel";import{toDateKey as qt,fromDateKey as Jt}from"efficient-shell/format";import{say as l,editorEaselWords as y}from"../../../format/lib/editor-words.js";import{LOADING_SHOWS_LABELS as We,firstFrameHint as Zt,loadingShowsOf as Qt,loadingStillHint as en}from"../../../format/lib/hero-video.js";import{pageFramesFor as tn,usePageVideoFrames as nn}from"../page-video-frames.js";import{ScreenDocumentContext as on}from"efficient-easel/screen/components/ScreenDocumentContext";import{readHidable as Ke,hidableText as $e}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as pe,LINK_FIELD_MARKER as Xe,MEDIA_FIELD_MARKER as je,SCAFFOLD_FIELD_MARKER as Ve,TEXT_FIELD_MARKER as O,foldMetaOf as fe,textFieldIdentifier as rn}from"efficient-easel/draw";import ln from"../../components/ApplyCornersToSiblings.js";import{withShowWhen as ze}from"../../../render/lib/document/show-when.js";import sn from"../../components/TemplateFieldRow.js";import{CARD_IMAGE_RADIUS_STEP as an,CORNER_RADIUS_MAX as Ye,CORNER_RADIUS_MIN as U}from"../../../format/lib/content/card-image-shape.js";import{IMAGE_CORNER_STEP as cn,IMAGE_CORNERS_LABEL as dn}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as un}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as pn,GALLERY_LAYOUTS as ne,GALLERY_LAYOUT_KEYS as fn,galleryChoices as qe,galleryLayoutRatio as hn,galleryPictureCells as mn}from"../../../format/lib/content/gallery-layout.js";import{shellGlyphOf as gn}from"./shell-glyph.js";import{anchorSiblingsOf as bn,placementPoints as wn}from"../../../format/lib/hero-group-placement.js";import xn from"../../components/AnchorField.js";import Sn from"../../components/SourceStatus.js";import{AdjustIcon as yn,EyeIcon as Cn,AnimationIcon as _n,BackgroundIcon as Je,BorderAllIcon as Rn,BlockSectionIcon as Tn,ColumnWidthsIcon as he,ColumnsIcon as Ze,CornerIcon as On,DirectionDownIcon as In,DirectionLeftIcon as En,DirectionRightIcon as kn,DirectionUpIcon as Fn,EditIcon as An,GapIcon as Ln,GridIcon as Nn,GroundIcon as me,HashIcon as Qe,HeightIcon as Pn,ImageIcon as vn,ListIcon as Bn,LocationIcon as et,PaddingBottomIcon as tt,PaddingLeftIcon as nt,PaddingRightIcon as ot,PaddingTopIcon as rt,PageIcon as Dn,StickyIcon as Hn,SearchIcon as Gn,SquareIcon as Mn,TypeIcon as Un,WidthIcon as Wn}from"efficient-easel/icons";import{FieldGlyph as it}from"../../components/FieldGlyph.js";import{resolvePageBackground as Kn}from"../../../format/lib/content/page-background.js";import{boxFillOf as $n,boxFillSlot as ge}from"../../../format/lib/content/box-background.js";import{CORNER_SIDES as lt,CORNER_SIDE_POINTS as Xn,hasOwnSectionCorners as jn,normalizeCornerSides as st}from"../../../format/lib/content/section-corners.js";import{enclosingPath as Vn,enclosingSection as zn}from"./enclosing-section.js";import{SettingsDefaultReset as C,SettingsDrill as Yn,SettingsField as S,SettingsGroup as qn,SettingsGroupSub as Jn,SettingsSegmented as Zn,SettingsBorder as Qn,SettingsSidesEach as eo,SettingsSwitch as be,borderSides as to,borderStartEach as no}from"efficient-easel/panel";import{ListField as oo}from"efficient-easel/fields";import{DisplayChips as ro}from"efficient-shell/ui";import{desktopDisplayChanged as io,partShownOnDesktop as lo,partShownOnPhone as so,phoneDisplayChanged as ao,withDesktopPart as co,withPhonePart as uo}from"../../../format/lib/content/part-display.js";import{AlignmentGrid as po,Checkbox as fo,ColorSwatch as ho,CornersInput as mo,DatePicker as go,DateTimePicker as bo,FOCAL_DEFAULT as wo,IconPicker as at,COLUMN_COUNT_MAX as ct,COLUMN_SHARE_MIN as xo,COLUMN_SHARES_EQUAL as So,resolveColumnShares as dt,WidthsBar as yo,useShellStrings as Co,IconButton as ut,InputNumber as pt,Slider as _o,Tooltip as we}from"efficient-shell/ui";import{LOOKUP_BUSY_NOTE as Ro}from"./geocode-resolve.js";import{ColourRow as oe,InheritedColourRow as ft}from"./ColourControl.js";import{fillThemeColors as To,slotFill as re}from"../../../format/lib/document/theme-slots.js";import{fillSlotNamed as xe}from"../../../format/lib/document/part-inks.js";import{keptByRow as Oo}from"efficient-easel/screen/lib/document/style-fields";import ht from"./MarkupToolbar.js";import{deviceField as R}from"efficient-easel/screen/lib/document/device-fields";import{NO_CONTROL_FIELD as Io,NoControlMark as Eo,noControlField as mt}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{OWN_BOX_FIELD as ko}from"../../../format/lib/document/own-box.js";import{PHONE_CLEAR as Fo,resolvePhoneValue as Se}from"../../../format/lib/document/phone-override.js";import{phoneKey as F,tabletKey as W}from"efficient-easel/draw";import{SuppressibleText as Ao}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as Lo,CARD_OUTLINE_OPTIONS as No,DEFAULT_CARD_INDEX_FORMAT as Po,DEFAULT_CARD_OUTLINE as vo}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as Bo,DEFAULT_COVER_INDEX as Do}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as Ho}from"efficient-easel/draw";import Go from"../../components/MediaUploadField.js";import Mo from"../../components/MultiSelectField.js";import Uo from"../../components/SectionThemePicker.js";import Wo from"../../components/SearchSelectField.js";import Ko from"../../components/StorefrontLinkField.js";import{UiIcon as gt}from"efficient-easel/draw/client";import{SECTION_PADDING as I}from"../../../render/lib/content/section-padding.js";import{buttonWordsSummary as $o}from"../../../render/lib/content/button-look.js";import{usePreviewParts as Xo}from"efficient-easel/draw/client";import{encodePartId as jo}from"efficient-easel/draw";import{DEFAULT_EASEL_STRINGS as Vo,useEaselStrings as zo}from"efficient-easel/strings";import{hasPhoneHeight as Yo,hasTabletHeight as ye,resolveSectionMinHeight as qo,resolveTabletHeight as Jo}from"../../../format/lib/content/section-min-height.js";import{SECTION_STICK_DISTANCE as ie,SECTION_STICK_LABEL as Ce,hasPhoneStick as Zo,hasTabletStick as Qo,resolveSectionStick as bt}from"../../../format/lib/content/section-sticky.js";import{SECTION_MIN_HEIGHT as er,SECTION_MIN_HEIGHT_GROUP_LABEL as Y,SECTION_SCREEN_PCT as tr}from"../../../format/lib/content/section-min-height.js";import{containerDirectionPoints as nr,resolveContainerDirection as wt}from"../../../format/lib/content/container-direction.js";import{BOX_BLOCK_SPACING_LABEL as or,BOX_BLOCK_SPACING_POINTS as xt,BOX_PHONE_ROW_LABEL as St,BOX_COLUMNS_MAX as rr,BOX_COLUMNS_MIN as yt,BOX_PHONE_ROW_MAX as ir,BOX_PHONE_ROW_MIN as _e,BOX_SHARE_CHOICES as Ct,BOX_SHARE_LABEL as K,boxShareChoiceOf as _t,boxShareWidthsOf as Re,BOX_SHARE_PHONE_DEFAULT as lr,BOX_SHARE_PHONE_POINTS as sr}from"../../../format/lib/content/box-layout.js";import{usePreviewHeader as v}from"../../../render/components/PreviewHeaderContext.js";import{BORDER_MAX as ar,borderBySide as Rt}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as cr,normalizeTheme as Tt,normalizeThemeColors as dr,sectionBandTone as ur,surfaceTwoTone as pr}from"../../../format/lib/theme.js";import{CONTAINER_GAP as Ot,CONTAINER_GAP_BUILT_IN as fr,CONTAINER_GAP_PHONE as Te,GAP_FIELD_CONTAINER as Oe,followsSitePhoneGap as hr,hasOwnContainerGap as mr,hasOwnPhoneGap as Ie,resolveContainerGap as It,resolvePhoneContainerGap as Et}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as gr,CARD_IMAGE_BG_OFF as br,CARD_IMAGE_BG_SWATCH_NAMES as wr,CARD_IMAGE_BG_SWATCHES as xr,isCardImageBackgroundInheriting as Sr,cardImageBackgroundChoice as yr,THEME_CARD_IMAGE_BG as Cr}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as _r,SECTION_BG_NO_FILL as Rr,sectionBackgroundChoice as Tr,THEME_SECTION_BG as Ee,isSectionBackgroundEmpty as Or,sectionBackgroundHex as kt}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as Ir,nestedAccentValue as Ft,resolveSectionAccent as le}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as Er,TYPE_SIZE_INHERIT as kr,isTypeSizeInheriting as Fr}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as Ar,WIDTH_CHOICE_LABEL as Lr,WIDTH_INHERIT as Nr}from"../../../format/lib/content/section-width.js";import{useFoldHeadingLevel as Pr}from"./panel-heading-scope.js";import{useEaselSession as vr}from"efficient-easel/screen/lib/session-context";import{backendOf as Br}from"../website-session.js";import{BOX_GAP as Dr,describedAs as E,group as T,iconOf as q,sharedStyleKinds as J}from"efficient-easel/screen/lib/document/box-fields";import{VIEW_KEY_ACCESS as ke,onDesktopWords as B,phoneTwinFields as se}from"efficient-easel/screen/lib/document/box-fields";import{directionField as Hr,gapField as Fe,iconPickerRow as Gr,pickerCellIcon as Mr,pickerNoneIcon as Ur,Segmented as Ae,segmented as Wr,select as Z,slider as $}from"./box-fields.js";function Ps({children:e}){return i("div",{className:"sf-field-label",children:typeof e=="string"?l(e):e})}function D(e,t){return l("{value} from {from}",{value:e,from:t})}function Kr(){const{blockGap:e}=v();return e===null?l("this container's own spacing"):D(`${e}px`,l("Styles"))}function $r({inherited:e,onReset:t,label:n}){return i(C,{words:y()?.panel,label:l(n),changed:!e,detail:Kr(),onReset:t})}function Xr(e){return Fe({...Dr,builtIn:fr[e],resolve:(t,n)=>It(e,t,n?.siteGap),action:(t,n)=>i($r,{inherited:!mr(e,t),onReset:()=>n(void 0),label:"Gap"}),mark:{[Oe]:e}})}function jr(e){return ze(R("mobile",{[Oe]:e,type:"custom",render:t=>i(Yr,{container:e,...t})}),At)}function Vr(e){return ze(R("tablet",{[Oe]:e,type:"custom",render:t=>i(zr,{container:e,...t})}),At)}const At={not:{field:"gap",in:Array.from({length:-Ot.min},(e,t)=>Ot.min+t)}};function vs(e){return{gap:R("desktop",Xr(e)),[W("gap")]:Vr(e),[F("gap")]:jr(e)}}function zr({container:e,...t}){const[n]=A("gap"),{siteGap:o}=t.field??{},r=Math.max(Te.min,It(e,n,o));return Fe({...Te,builtIn:r,resolve:a=>Ie(a)?a:r,action:(a,c)=>i(C,{words:y()?.panel,label:l("Gap"),changed:Ie(a),detail:B(d=>l(d),`${r}px`),onReset:()=>c(void 0)})}).render(t)}function Yr({container:e,...t}){const[n]=A("gap"),{siteGap:o,siteGapPhone:r}=t.field??{},s=Et(e,void 0,n,o,r);return Fe({...Te,builtIn:s,resolve:c=>Et(e,c,n,o,r),action:(c,d)=>i(C,{words:y()?.panel,label:l("Gap"),changed:Ie(c),detail:D(`${s}px`,hr(e,n,r)?l("Styles"):l("Desktop")),onReset:()=>d(void 0)})}).render(t)}function Bs(e){return Hr({offered:nr(e),fallback:wt(e,void 0),resolve:t=>wt(e,t)})}function Ds(e,t){return wn(t?bn(e,t):[],t)}function qr({inherited:e,onReset:t,label:n}){return i(C,{words:y()?.panel,label:l(n),changed:!e,detail:D(l("Full"),l("the page")),onReset:t})}function H({value:e,onChange:t,label:n,placeholder:o,hint:r,multiline:s,hideable:a=!0,markup:c=!0}){const{text:d,hidden:f}=Ke(e),m=V(null),p=V(null),u=_=>t(a?{text:_,hidden:f}:_),g=()=>t({text:d,hidden:!f}),h=a&&f,w=Ue(),x=r?ti(r)?i("span",{className:"sf-hint-while-typing",children:l(r)}):l(r):void 0,b=f?l("Show {label} on the slide",{label:l(n)}):l("Hide {label} on the slide",{label:l(n)});return i(S,{label:l(n),icon:i(Un,{}),htmlFor:w,className:h?"is-hidden":void 0,hint:x,action:a?i(we,{content:b,children:i(ut,{"aria-pressed":f,"aria-label":b,onClick:g,children:f?i(gt,{name:"eye-off",size:14}):i(gt,{name:"eye",size:14})})}):void 0,children:N("div",{className:"sf-copybox",children:[c&&i(ht,{target:s?p:m,value:d,onChange:u}),s?i("textarea",{id:w,ref:p,value:d,placeholder:o===void 0?void 0:l(o),onChange:_=>u(_.target.value)}):i("input",{id:w,ref:m,type:"text",value:d,placeholder:o===void 0?void 0:l(o),onChange:_=>u(_.target.value)})]})})}function Hs(e,t){return{...e,[Ve]:t}}function Gs(e){const t=e[O];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[O]:{...t,offPage:!0}}}function Ms(e){return!e||typeof e!="object"?!1:e[O]?.offPage===!0}const Lt="sfPanelOnly";function Us(e){if(!e[O])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[Lt]:!0}}function Ws(e){return!!e&&typeof e=="object"&&e[Lt]===!0}function Ks(e){const t=e[O];if(!t)throw new Error("withIdentifier: the field holds no authored text");return{...e,[O]:{...t,identifier:!0}}}import{TEXT_CONTROL_KINDS as nc,SCALAR_TEXT_CONTROLS as oc}from"efficient-easel/draw";function $s(e,t){if(!e[O])throw new Error("inOwnBox: the field holds no authored text");const{[Io]:o,...r}=e;return{...r,[ko]:!0,render:t}}const Jr=new Set(Ho),Q={type:"radio",options:[{value:!0},{value:!1}]},Nt={text:{type:"object",objectFields:{text:{type:"text"},hidden:Q}},textarea:{type:"object",objectFields:{text:{type:"textarea"},hidden:Q}},plainText:{type:"text"},copyText:{type:"text"},plainTextarea:{type:"textarea"},textList:{type:"array",arrayFields:{text:{type:"text"}}}},G=(e,t)=>{const n=E({...t,[O]:e},{...Nt[e.control],label:e.label});if(!Jr.has(e.control))return n;const o=t.render;return{...mt(n,"authored-copy"),render:r=>i(Ao,{name:r.name,children:o(r)})}},Xs="Everything else on this block comes from the linked post. Unlink it to edit by hand.",Zr={field:"source.slug",set:!0},js={not:Zr},Qr="Select a word, then press the highlighter.",ei=new Set([Qr]),ti=e=>ei.has(e);function Vs(e,t,n){return G({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n})})}function zs(e,t,n){return G({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0})})}function Ys(e,t,n){return G({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function qs(e,t,n){return G({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1})})}function Js(e){return{type:"custom",[Xe]:{label:e},...E({},{type:"text",label:e}),render:({value:t,onChange:n})=>i(Ko,{value:$e(t),onChange:n,label:e})}}function Zs(e,t,n){return G({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const Qs={Design:yn,Animation:_n};function ea(e){return{type:"custom",render:()=>i(ni,{text:e})}}function ni({text:e}){return i("p",{className:"sf-note",children:l(e)})}function ta(e){return fe(e)!==null&&e?.tabs!==void 0}const Pt=new Map;function na(e,t){const n=`${e}\0${t?t.join(""):""}`,o=Pt.get(n)??{type:"custom",tabs:t,[pe]:{label:e,level:1},bucket:e,marker:!0,render:()=>i(k,{})};return Pt.set(n,o),o}const vt=new Map;function oa(e){const t=vt.get(e)??{type:"custom",[pe]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>i(k,{})};return vt.set(e,t),t}function oi(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function ra(e,t){return oi(e)===t?e:{...e,marker:!0,fold:t,render:()=>i(k,{})}}function ia(e){const t=e;if(t.marker===!0&&t.fold===void 0)return e;const{fold:n,...o}=e;return{...o,marker:!0,render:()=>i(k,{})}}function la({title:e,children:t}){const[n,o]=z(()=>!Le.has(e));return i(qn,{title:e,open:n,onToggle:r=>{o(r),r?Le.delete(e):Le.add(e)},children:t})}const Le=new Set;function sa({label:e}){return i(Jn,{title:l(e),level:Pr(2)})}function ri({swatches:e,current:t,onPick:n,names:o}){const r=e.find(c=>c.toLowerCase()===t.toLowerCase()),s=r?o?.[r]:void 0,a=s?l(s):t;return N("div",{className:"sf-swatches",children:[e.map(c=>{const d=o?.[c]?l(o[c]):c;return i(we,{content:d,children:i(ho,{color:c,selected:t.toLowerCase()===c.toLowerCase(),onClick:()=>n(c),"aria-label":d})},c)}),i("span",{className:"sf-swatch-hex",children:a})]})}function aa(e,t,n=!1){return{type:"custom",render:({value:o,onChange:r})=>i(ii,{label:e,builtIn:t,followsBand:n,value:o,onChange:r})}}function ii({label:e,builtIn:t,followsBand:n,value:o,onChange:r}){const s=typeof o=="string"?o:void 0,{colors:a,n:c}=Be(),d={background:a.background,surface:a.surface,surface2:pr(a),band:ur(a)},f=n?Ee:t,m=Or(s,t,f),p=kt(void 0,f,d),u=n?_r:void 0,g=f===Ee?l("the theme's section background"):l("Theme {n} background",{n:c}),h=li(s,t,a,c,d,r),w=D(p.toUpperCase(),g),x=xe(s),b=x?re(x,a,c):null;return b?i(oe,{label:l(e),icon:i(Je,{}),value:b.hex,caption:b.words,onChange:r,changed:!0,onReset:()=>r(u),resetTo:w,choices:h}):i(ft,{label:l(e),icon:i(Je,{}),value:m?"":kt(s,t,d),inherited:p,resetTo:w,onChange:r,onReset:()=>r(u),choices:h})}function li(e,t,n,o,r,s){const a=Tr(e,t);return[{label:l("No fill"),color:"",selected:a==="none",onPick:()=>s(Rr)},{label:`${l("Section band")} · ${r.band.toUpperCase()}`,color:r.band,selected:a==="band",onPick:()=>s(Ee)},...ve(xe(e)??"",n,o,s)]}function si(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const r=n,s=Sr(r,t);return i(S,{label:l(e),icon:i(me,{}),changed:!s,action:i(C,{words:y()?.panel,label:l(e),changed:!s,detail:l("the theme's image stage"),onReset:()=>o(gr)}),children:ri({swatches:xr,current:s?Cr:yr(r,t),onPick:o,names:wr})})}}}function ca(e=n=>n,t){return J({_gSectionTheme:T(Ir),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>i(Uo,{value:e(n),onChange:o,followLabel:t})}})}function ee({min:e,max:t,step:n,value:o,onChange:r,suffix:s="",readout:a=!0,notch:c,ariaLabel:d,disabled:f=!1,placeholder:m,placeholderWord:p,onClear:u}){const g=c!==void 0&&Number.isFinite(c)&&c>=e&&c<=t;return i("div",{className:g?"sf-slider has-notch":"sf-slider",style:g?{"--sf-notch":(c-e)/(t-e)}:void 0,children:i(_o,{min:e,max:t,step:n,value:o,...o===null&&m!==void 0?{placeholderValue:m}:{},...p?{emptyLabel:l(p)}:{},suffix:s||void 0,showInput:a,label:d===void 0?void 0:l(d),disabled:f,size:"sm",boxSize:"md",className:"sf-slider-track",onChange:h=>{h===null?u?.():h!==o&&r(h)}})})}function Bt(e,t){const{min:n,max:o,step:r=1,unsetLabel:s,hint:a,restTrack:c,unsetMark:d,icon:f,unit:m="px"}=t;return{type:"custom",render:({value:p,onChange:u})=>{const g=typeof p=="number"?p:null,h=g===null;return i(S,{label:l(e),icon:f?q(f):void 0,value:h?d||s===void 0?void 0:l(s):`${g}${m}`,changed:!h,action:d?Ge(d,{changed:!h,onReset:()=>u(null)}):i(C,{words:y()?.panel,label:l(e),changed:!h,onReset:()=>u(null)}),hint:typeof a=="string"?l(a):a,children:c?c({min:n,max:o,step:r,px:g,label:e,onChange:u}):ee({min:n,max:o,step:r,value:g??n,readout:!1,ariaLabel:e,onChange:u})})}}}const ae="Corners";function Ne(e){return{type:"custom",render:({value:t,onChange:n})=>{const o=typeof t=="number"&&Number.isFinite(t)?t:null,r=o!==null;return i(S,{label:l(ae),icon:i(On,{}),changed:r,action:Ge(e.mark,{changed:r,onReset:()=>n(null)}),hint:e.hint,children:i(ci,{tier:e,px:o,onRadius:n})})}}}function A(e){const t=M();return[t?.values?.[e],n=>t?.onChange(e,n)]}function Dt(){return mt({type:"custom",render:()=>i(Eo,{})},"always")}function ai(){const e=M();return t=>e?.onChangeMany(t)}function ci({tier:e,px:t,onRadius:n}){const o=e.useFollowed(),[r,s]=A(e.sidesKey),a=st(r)??[...lt];return i(mo,{label:l(ae),value:a,corners:Xn,onChange:c=>{const d=st(c)??[];s(d.length===lt.length?null:d)},radius:t,onRadiusChange:n,radiusMin:U,radiusMax:Ye,radiusStep:e.step??1,radiusPlaceholder:String(o)})}function Ht(){return Dt()}function di({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=v(),r=typeof o=="number"?`${o}px`:l("not set");return i(C,{words:y()?.panel,label:l(e),changed:t,detail:o==null?l("the built-in corners"):D(r,l("Styles")),onReset:n})}function ui(){const{cornerRadiusPx:e}=v();return typeof e=="number"?e:U}function pi(){return Ne({sidesKey:"sectionCornerSides",useFollowed:ui,mark:i(di,{label:ae}),hint:fi})}const fi="Follows Styles ▸ Basics ▸ Corners until you set a number here.";function da(){return J({_gShape:T("Shape"),sectionCorners:pi(),sectionCornerSides:Ht(),...X("sectionBorder",Gt)})}const hi=()=>({width:l("Border width"),sides:{top:l("Border top"),right:l("Border right"),bottom:l("Border bottom"),left:l("Border left")},style:l("Border style"),styles:{solid:l("Solid"),dashed:l("Dashed"),dotted:l("Dotted")},color:l("Border color"),unit:"px"});function mi(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function gi(){let e;try{const t=Tt(v().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||cr.line}function bi({value:e,onChange:t,placeholder:n,presets:o,sides:r=!0,styles:s=!0,above:a={}}){const c=e&&typeof e=="object"?e:{},[d,f]=z(()=>r?no(c,a):!1),m=hi(),p=u=>mi(r&&s?u:{width:u.width,color:u.color,...s?{style:u.style}:{}});return i(S,{label:l("Border"),icon:i(Rn,{}),action:r?i(eo,{each:d,label:l("Each side"),onChange:f}):void 0,children:i(Qn,{label:l("Border"),value:c,each:d,onChange:u=>t(p(u)),placeholder:n,presets:o,words:m,styles:s,max:ar})})}function wi({value:e,onChange:t,view:n}){const[o]=A("sectionBorder"),[r]=A(W("sectionBorder")),s=gi(),a=d=>d&&typeof d=="object"?d:{},c=n==="phone"?{...Rt(a(o)),...Rt(a(r))}:n==="tablet"?a(o):{};return i(bi,{value:e,onChange:t,placeholder:{sides:to(c),style:c.style??"solid",color:c.color||s},presets:[s],above:c})}function ua(e){return R(e,Gt(e==="mobile"?"phone":e))}function Gt(e){return{type:"custom",render:({value:t,onChange:n})=>i(wi,{value:t,onChange:n,view:e})}}function X(e,t){const n=(o,r)=>se(e,t(o),ke)[r];return{[e]:n("desktop",e),[W(e)]:n("tablet",W(e)),[F(e)]:n("phone",F(e))}}function pa(e){return{type:"custom",render:()=>i(xi,{partKey:e})}}function xi({partKey:e}){const[t]=A("id"),[n]=A("_partStyles"),{textStyles:o}=v(),r=zo();let s=null;try{s=Xo().select}catch{s=null}const a=n&&typeof n=="object"?n[e]:void 0,c=Array.isArray(o)?o:null;return i(Yn,{name:l("Text"),preview:$o(a,c,{noStyle:l("No style"),styleName:r.textStyles.styleName,cases:(r.copy.panel??Vo.copy.panel).cases}),onOpen:()=>{s&&typeof t=="string"&&s(jo(t,e))}})}function Mt(e){const{cornerRadiusPx:t}=v(),n=typeof t=="number"?t:e;let o=null;try{const{appState:s,selectedItem:a}=te(d=>d),c=a?.props?.id?String(a.props.id):void 0;o=c?zn(s?.data,c)?.props??null:null}catch{o=null}if(!o)return n;const r=o.sectionCorners;return jn(r)?r:n}function Si({label:e,changed:t=!1,onReset:n=()=>{}}){const o=Mt(U);return i(C,{words:y()?.panel,label:l(e),changed:t,detail:D(`${o}px`,l("the section")),onReset:n})}function yi(){return i(k,{children:l("Follows the section's Corners until you set a number here.")})}function Ci(){return Ne({sidesKey:"cardCornerSides",useFollowed:()=>Mt(U),mark:i(Si,{label:ae}),hint:i(yi,{})})}function _i(){return{type:"custom",render:()=>i(ln,{})}}function fa(e){return{...e,render:t=>i(sn,{render:e.render,props:t})}}function ha(){return{_gShape:T("Shape"),cardCorners:Ci(),cardCornerSides:Ht(),cardCornersApplyAll:_i()}}function Ri(){return E({type:"custom",render:e=>i(Oi,{...e})},{type:"select",label:K,options:[{value:"content",label:"Fit content"},{value:"equal",label:"Equal"},{value:[50],label:"Custom: the width of each block in %, the last block left out"}]})}function Ti(e,t){const n=_t(e);if(n!=="custom")return l(Ct.find(r=>r.value===n)?.label??"");const o=dt(Re(e,t),t);return o?[...o,100-o.reduce((r,s)=>r+s,0)].join(" / "):l("Custom")}function Oi(e){const{value:t,onChange:n}=e,[o]=A("content"),r=Array.isArray(o)?o.length:0,s="follows"in e,a=t!=null,c=a?t:s?e.follows:void 0,d=_t(c),f=r>=2&&r<=ct,m=()=>[...So[r]??[]],p=V(null),u=b=>{const _=p.current;_&&JSON.stringify(b)===JSON.stringify(_.shares)?n(_.value):b&&n(b)},g=b=>{b===d||b==="custom"&&!f||n(b==="custom"?m():b)},h=l("The width bar works for 2 to {count} blocks.",{count:ct}),w=a&&(s||t!=="content"),x=Co().widths.hint(r,xo);return i(S,{label:l(K),icon:i(he,{}),changed:w,hint:d!=="custom"?void 0:f?x:h,action:i(C,{words:y()?.panel,label:l(K),changed:w,disabled:e.readOnly===!0,detail:s?B(b=>l(b),Ti(e.follows,r),e.followsView):l("Fit content"),onReset:()=>n(void 0)}),children:N("div",{className:"sf-share-row",children:[i("div",{className:"sf-share-pick",children:i(at,{label:l(K),value:d,options:Ct.map(b=>({value:b.value,label:b.value==="custom"&&!f?h:l(b.label),icon:Mr(i("span",{className:"sf-gallery-pic sf-share-pic",children:Ut(b.weights).map((_,j)=>i("i",{style:{gridColumn:`span ${_}`}},j))}),l(b.label),b.value==="custom"&&!f?h:l(b.label))})),onChange:g,columns:3,cell:Wt,tooltips:!1,disabled:e.readOnly===!0})}),d==="custom"&&f?i("div",{onFocus:()=>{p.current={value:t,shares:dt(Re(c,r),r)}},onBlur:()=>{p.current=null},children:i(yo,{label:l(K),count:r,value:Re(c,r),onChange:u,readOnly:e.readOnly===!0})}):null]})})}function Ut(e){if(!e)return[3,4];const t=e.reduce((n,o)=>n+o,0);return e.map(n=>Math.round(n/t*12))}function ma(){return Z(or,i(Ln,{}),xt,xt[0].value)}function ga(){return R("mobile",Gr(K,i(he,{}),sr.map(e=>({label:e.label,value:e.value,picture:i("span",{className:"sf-gallery-pic sf-share-pic",children:Ut(e.weights).map((t,n)=>i("i",{style:{gridColumn:`span ${t}`}},n))})})),lr,{columns:2,cell:Wt}))}const Wt={width:"5.75rem",height:"3.25rem"};function ba(){return se("share",Ri(),ke)[W("share")]}function Ii(){return R("mobile",$(St,i(Ze,{}),_e,ir,1,_e,"",{clear:{phoneFollows:!1,hint:_e}}))}const Kt={read:e=>e.phoneRow,write:(e,t,n)=>({phoneRow:n}),fieldKey:()=>"phoneRow",ownField:!0};function wa(){const e=$(St,i(Ze,{}),yt,rr,1,yt,"",{clear:{emptyLabel:"Auto"}}),t=se("columns",e,{...Kt,tablet:ke.tablet}),n=se("columns",e,Kt,{phoneRow:Ii()});return{...t,phoneRow:n.phoneRow}}function xa(e,t,n,o,r,s){return{type:"custom",render:({value:a,onChange:c})=>i(S,{label:l(e),icon:i(it,{noun:s}),action:i(C,{words:y()?.panel,label:l(e),changed:!Fr(a),detail:l("the Text style in Styles"),onReset:()=>c(kr),defaultAction:{onPress:()=>c(Er),title:l("Keep this section's own built-in size"),icon:i(Tn,{})}}),children:ee({min:t,max:n,step:o,value:typeof a=="number"?a:r,suffix:"px",ariaLabel:e,onChange:c})})}}function Sa(){return{_gCellWidth:T("Cell width"),gridSpan:Z("Positions",i(he,{}),[{label:"Auto",value:""},...Array.from({length:un},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}function L(){let e=null,t=null;try{e=Me(Ei),t=te(n=>n).selectedItem}catch{t=null}return e??t?.props??{}}const Ei=zt(null);function ki({min:e,max:t,step:n,px:o,label:r,onChange:s,desktopKey:a,fallback:c}){const d=L()[a],f=Se(void 0,d,c);return i(k,{children:ee({min:e,max:t,step:n,value:Se(o,d,c),readout:!1,ariaLabel:r,notch:f,onChange:s})})}function Fi({label:e,desktopKey:t,fallback:n,unit:o="px",changed:r=!1,onReset:s=()=>{}}){const a=L()[t],c=Se(void 0,a,n);return i(C,{words:y()?.panel,label:l(e),changed:r,detail:B(d=>l(d),`${c}${o}`),onReset:s})}function Ai(e){return Bt(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unit:e.unit,unsetLabel:"Follows Desktop",unsetMark:i(Fi,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback,unit:e.unit}),restTrack:t=>i(ki,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}const Li={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},Ni={Top:rt,Bottom:tt,Left:nt,Right:ot},Pi=e=>{const t=Ni[e];return i(t,{})};function ya(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,r=x=>Li[x],s=x=>$(r("Top"),i(rt,{}),I.min,I.max,I.step,x,"px"),a=(x,b,_,j=I)=>R("mobile",Ai({label:r(x),icon:Pi(x),desktopKey:b,min:j.min,max:j.max,step:j.step,fallback:_})),c=e.top??I.min,d=e.bottom??I.min,f="sectionPaddingLeft",m="sectionPaddingRight",p=e.sideBounds??I,u=e.side??p.min,g=e.sidePhone??u,h=e.phone===!0,w=x=>h?R("desktop",x):x;return J({...o?{_gSpacing:T("Padding")}:{},[t]:w(s(c)),...h?{[F(t)]:a("Top",t,c)}:{},...e.only==="top"?{}:{[n]:w($(r("Bottom"),i(tt,{}),I.min,I.max,I.step,d,"px")),...h?{[F(n)]:a("Bottom",n,d)}:{}},...e.sides?{[f]:w($(r("Left"),i(nt,{}),p.min,p.max,p.step,u,"px")),...h?{[F(f)]:a("Left",f,g,p)}:{},[m]:w($(r("Right"),i(ot,{}),p.min,p.max,p.step,u,"px")),...h?{[F(m)]:a("Right",m,g,p)}:{}}:{}})}function Ca(e,t){const n=Object.fromEntries(Object.entries(t).map(([s,a])=>[s,s in e&&fe(a)?e[s]:a])),o={};let r=!1;for(const[s,a]of Object.entries(e)){if(s in t){r||Object.assign(o,n),r=!0;continue}o[s]=a}return r||Object.assign(o,n),o}const ce="Width";function _a(e,t=Ar,n=!0){const o=t.map(r=>({label:Lr[r],value:r}));return J({...n?{_gWidth:T(ce)}:{},widthMode:{type:"custom",render:({onChange:r,field:s})=>i(S,{label:l(ce),icon:i(Wn,{}),action:n?i(qr,{inherited:s?.inherited??!1,onReset:()=>r(Nr),label:ce}):void 0,children:Ae({options:o,value:s?.currentValue||e,onChange:r,ariaLabel:ce})})}})}function Ra(){const e=(o,r)=>({type:"custom",render:({value:s,onChange:a})=>i(vi,{value:s,onChange:a,view:o,badge:r})}),t=o=>({type:"custom",render:({value:r,onChange:s,field:a})=>i(Di,{value:r,onChange:s,unit:a?.unit,view:o})}),n=o=>{const r=Wr("Unit",i(Qe,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");if(o==="desktop")return r;const s=r.render;return{...r,render:a=>i(Hi,{props:a,draw:s,view:o})}};return J({_gHeight:T(Y),...X("sectionHeightMode",o=>o==="desktop"?e(o):e(o,r=>i(Gi,{view:o,onClear:()=>r(void 0)}))),...X("sectionHeightValue",t),...X("sectionHeightUnit",n)})}function vi({value:e,onChange:t,view:n,badge:o}){const r=L(),s=c=>["auto","fixed","screen"].includes(c),a=de(n,r)?.mode??"auto";return i(S,{label:Y,icon:q(i(Pn,{})),action:o?o(t):void 0,children:Ae({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:s(e)?e:a,onChange:t,ariaLabel:Y})})}function $t(e,t){return e==="phone"&&ye(t)?Jo(t):qo(t)}function de(e,t){return e==="desktop"||(e==="tablet"?ye(t):Yo(t))?null:$t(e,t)}const P=(e,t)=>e==="tablet"?W(t):F(t);function Bi(e,t,n,o){const r=de(e,t);return!r||e==="desktop"?null:o===void 0?{}:{[P(e,"sectionHeightMode")]:r.mode,...r.mode==="fixed"?{[P(e,"sectionHeightUnit")]:r.unit}:{},...n==="sectionHeightUnit"?{[P(e,"sectionHeightValue")]:r.value}:{},[P(e,n)]:o}}function Xt(e,t,n){const o=M(),r=de(e,L());return!o||!r?{followed:null,write:n}:{followed:r,write:a=>o.onChangeMany(c=>{const d=Bi(e,c,t,a);return d===null?{[e==="desktop"?t:P(e,t)]:a}:Object.keys(d).length?d:null})}}function Di({value:e,onChange:t,unit:n,view:o}){const{followed:r,write:s}=Xt(o,"sectionHeightValue",t),a=(r?r.unit:n)==="%"?"%":"px",c=a==="%"?tr:er;return i("div",{className:"sf-field",children:ee({min:c.min,max:c.max,step:c.step,value:r?null:typeof e=="number"?e:c.fallback,...r?{placeholder:r.value}:{},suffix:a,ariaLabel:Y,onChange:s})})}function Hi({props:e,draw:t,view:n}){const{followed:o,write:r}=Xt(n,"sectionHeightUnit",e.onChange);return t({...e,...o?{value:void 0,storedValue:void 0,follows:o.unit}:{},onChange:r})}function Gi({view:e,onClear:t}){const n=L(),o=de(e,n)===null,r=e==="phone"&&ye(n),s=$t(e,n),a=B(c=>l(c),s.mode==="auto"?l("Auto"):`${s.value}${s.unit}`,r?"tablet":"desktop");return i(C,{words:y()?.panel,label:l(Y),changed:o,detail:a,onReset:t})}function Ta(){const e=n=>({type:"custom",render:({value:o,onChange:r,id:s,name:a})=>i(Wi,{value:o,onChange:r,labelId:`${s??a??"stickTop"}-label`,view:n})}),t=n=>({type:"custom",render:({value:o,onChange:r})=>i(Mi,{value:o,onChange:r,view:n})});return{_gStick:T(Ce),...X("stickTop",e),...X("stickTopDistance",t)}}function Mi({value:e,onChange:t,view:n}){const o=M(),r=L(),s=n==="desktop"||Pe(n,r)?null:jt(n,bt(r)),a=s&&o?c=>o.onChangeMany(d=>{const f=Ui(n,d,c);return f===null?{[P(n,"stickTopDistance")]:c}:Object.keys(f).length?f:null}):t;return i("div",{className:"sf-field",children:ee({min:ie.min,max:ie.max,step:ie.step,value:s?null:typeof e=="number"?e:ie.fallback,...s?{placeholder:s.distance}:{},suffix:"px",ariaLabel:l("Distance from top"),onChange:a})})}function Pe(e,t){return e==="tablet"?Qo(t):Zo(t)}function jt(e,t){return e==="phone"?{on:t.tablet,distance:t.tabletDistance}:{on:t.desktop,distance:t.desktopDistance}}function Ui(e,t,n){return e==="desktop"||Pe(e,t)?null:n===void 0?{}:{[P(e,"stickTop")]:!0,[P(e,"stickTopDistance")]:n}}function Wi({value:e,onChange:t,labelId:n,view:o}){const r=L(),s=bt(r),a=o==="phone"?s.phone:o==="tablet"?s.tablet:e===!0,c=o==="phone"&&s.ownTablet,d=o==="desktop"?null:jt(o,s),f=d?.on?`${d.distance}px`:l("Off");return i(S,{label:l(Ce),labelId:n,icon:q(i(Hn,{})),action:N(k,{children:[o!=="desktop"?i(C,{words:y()?.panel,label:l(Ce),changed:Pe(o,r),detail:B(m=>l(m),f,c?"tablet":"desktop"),onReset:()=>t(void 0)}):null,i(be,{checked:a,onChange:t,ariaLabelledBy:n})]})})}const Vt="e.g. about";function Oa(){return{_gAnchor:T("Anchor"),anchor:G({control:"plainText",label:"Name",placeholder:Vt},{type:"custom",render:({value:e,onChange:t})=>i(xn,{value:e,onChange:t,nameBox:(n,o)=>i(H,{value:n,onChange:o,label:"Name",placeholder:Vt,hideable:!1,markup:!1})})})}}function Ia(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:s,name:a})=>{const c=`${s??a??e}-datetime`,d=Date.parse(typeof o=="string"?o:"");return i(S,{label:l(e),icon:t,htmlFor:c,hint:n===void 0?void 0:l(n),children:i(bo,{id:c,value:Number.isFinite(d)?new Date(d):null,onChange:f=>r(f?f.toISOString():"")})})}}}function Ea(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:s,name:a})=>{const c=`${s??a??e}-date`;return i(S,{label:l(e),icon:t,htmlFor:c,hint:n===void 0?void 0:l(n),children:i(go,{id:c,value:Jt(typeof o=="string"?o:null),onChange:d=>r(d?qt(d):"")})})}}}function Ki(e,t,n,o){return{type:"custom",...E({},{...Q,label:e}),render:r=>{const{value:s,onChange:a,id:c,name:d}=r,f="follows"in r,m=r,p=typeof s=="boolean",u=typeof m.follows=="boolean"?m.follows:t,g=p?s:f?u:t,h=`${c??d??e}-label`,w=m.readOnly===!0,x=i(be,{checked:g,onChange:a,disabled:w,ariaLabelledBy:h});return i(S,{label:l(e),labelId:h,icon:n,hint:o===void 0?void 0:l(o),action:f?N(k,{children:[i(C,{words:y()?.panel,label:l(e),changed:p,detail:m.followsNoView?l(u?"On":"Off"):B(b=>l(b),l(u?"On":"Off"),m.followsView),disabled:w,onReset:()=>a(void 0)}),x]}):x})}}}function ka(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const r=`${String(n??o??"pageBackground")}-colour`;return i($i,{label:"Background",icon:i(Dn,{}),id:r,value:e,shown:Kn(e),onChange:t})}}}function Fa(e,t){return{type:"custom",...E({},{...Q,label:e}),render:({value:n,onChange:o,id:r})=>{const s=typeof n=="boolean"?n:t,a=`${r??e}-checkbox`;return i(S,{label:l(e),htmlFor:a,className:"sf-checkbox",action:i(fo,{id:a,checked:s,onChange:o})})}}}function Aa(e,t,n){return{type:"custom",render:({value:o,onChange:r})=>i(oe,{label:l(e),icon:n,value:o||t,onChange:r})}}function $i({label:e,icon:t,id:n,value:o,shown:r,onChange:s}){const{colors:a,n:c}=Be(),d=xe(o),f=d?re(d,a,c):null;return i(oe,{label:l(e),icon:t,id:n,value:f?f.hex:r,caption:f?.words,onChange:s,choices:ve(d??"",a,c,s)})}function La(){return{type:"custom",render:e=>{const{value:t,onChange:n}=e,o=e;return i(Xi,{value:typeof t=="string"?t:"",onChange:n,twin:"follows"in e?{follows:o.follows,view:o.followsView}:void 0})}}}function ve(e,t,n,o){const r=ge(e);return To(t,n).map(s=>({label:s.label,color:s.value,selected:r===s.name,onPick:()=>o(s.name)}))}function Xi({value:e,onChange:t,twin:n}){const{colors:o,n:r}=Be(),s=o.background,a=D(s.toUpperCase(),l("Theme {n} background",{n:r})),c=ge(e),d=c?re(c,o,r):null,f=ve(e,o,r,t),m=n?()=>t(void 0):()=>t("");let p=s,u=a;if(n){const g=ge(n.follows),h=$n(n.follows),w=g?re(g,o,r):h?{hex:h,words:h.toUpperCase()}:null;p=w?.hex??s,u=B(x=>l(x),w?w.words:a,n.view)}return d?i(oe,{label:l("Fill"),icon:i(me,{}),value:d.hex,caption:d.words,onChange:t,changed:!0,onReset:m,resetTo:u,choices:f}):i(ft,{label:l("Fill"),icon:i(me,{}),value:e,inherited:p,resetTo:u,onChange:t,onReset:m,choices:f})}function ji(e,t,n){if((e?.content??[]).some(a=>a?.props?.id===t))return le(n);const r=Vn(e,t);if(r.length===0)return null;const s=le(Ft(n));if(s!==null)return s;for(let a=r.length-1;a>0;a-=1){const c=le(Ft(r[a].sectionAccent));if(c!==null)return c}return le(r[0].sectionAccent)}function Be(){const e=Tt(v().theme),[t]=A("sectionAccent");let n=null;try{const{appState:r,selectedItem:s}=te(c=>c),a=s?.props?.id?String(s.props.id):void 0;n=a?ji(r?.data,a,t):null}catch{n=null}const o=n!==null&&e.themes[n]?n:e.selected;return{colors:dr(e.themes[o]),n:o+1}}const Vi=[{value:"0% 0%",label:"Top left"},{value:"50% 0%",label:"Top"},{value:"100% 0%",label:"Top right"},{value:"0% 50%",label:"Left"},{value:"50% 50%",label:"Center"},{value:"100% 50%",label:"Right"},{value:"0% 100%",label:"Bottom left"},{value:"50% 100%",label:"Bottom"},{value:"100% 100%",label:"Bottom right"}];function zi({label:e,value:t,onChange:n,points:o=Vi}){const r=o.map(s=>({...s,label:l(s.label),...s.title?{title:l(s.title)}:null}));return i(po,{label:l(e),value:t,points:r,onChange:n})}function Na(){return Dt()}const Pa={top:i(Fn,{}),right:i(kn,{}),bottom:i(In,{}),left:i(En,{})};function va(e,t,n,o,r,s,a){const c=p=>t.find(u=>u.value===p),d=p=>({value:p,label:"",disabled:!0,title:o}),f=p=>{const u=t.find(h=>h.cell===p);if(!u)return d(`missing-${p}`);const g=s?.[p];return g?{value:u.value,label:u.label,icon:g}:{value:u.value,label:u.label}},m=[d("corner-top-left"),f("top"),d("corner-top-right"),f("left"),d("centre"),f("right"),d("corner-bottom-left"),f("bottom"),d("corner-bottom-right")];return{type:"custom",render:({value:p,onChange:u})=>{const g=t.some(h=>h.value===p)?p:n;return i(S,{label:l(e),icon:r,value:c(g)?.label?l(c(g).label):a?l(a):"",children:zi({label:e,value:g,onChange:u,points:m})})}}}function Ba(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:r,field:s})=>i(Mo,{label:e,options:(s.options??t).map(a=>({...a,label:l(a.label)})),value:Array.isArray(o)?o:[],onChange:r,...n?{emptyLabel:l(n)}:{}})}}function Da(e,t,n,o){return{type:"custom",options:t,fallback:n,...E({},{type:"select",label:e}),render:({value:r,onChange:s,field:a})=>i(Wo,{label:e,options:(a.options??t).map(c=>({...c,label:l(c.label)})),fallback:a.fallback??n,value:r,onChange:s,placeholder:o===void 0?void 0:l(o)})}}function Ha(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const r={value:n,onChange:o,...t};return i(e,{...r})}}}const Ga=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function Ma(e,t,n){const o=Object.keys(We).map(r=>({label:We[r],value:r,picture:n[r]}));return{type:"custom",...E({},{type:"radio",label:e,options:o.map(r=>({value:r.value,label:r.label}))}),render:({onChange:r})=>i(qi,{label:e,icon:t,options:o,onChange:r})}}function Yi(e,t,n){const o=Zt(e,t,n);if(o!==void 0)return o==="save-makes-frame"?l("A frame is made from this video when you save the page."):o==="starts-dark"?l("This video starts dark, so no frame was made. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="outside"?l("This video is on another website, so no frame can be made. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="unsupported"?l("This video's file type gives no frame. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="failed"?l("No frame could be made from this video. It is tried again the next time you save the page. The slide shows its background colour while the video loads."):o==="image-no-frame"?l("The slide shows your Image while the video loads, because this video has no frame."):void 0;const r=en(e);return r==="frame-missing-image"?l("This video has no frame yet. The slide shows its image until one is made."):r==="frame-missing-surface"?l("This video has no frame yet. The slide shows its background colour until one is made."):r==="image-missing-frame"?l("No image yet. The slide shows the video's frame until you choose one."):r==="image-missing-surface"?l("No image yet. The slide shows its background colour until you choose one."):void 0}function qi({label:e,icon:t,options:n,onChange:o}){const r=M(),s=r?.values??{},a=Qt(s),c=Me(on),d=nn(c?.docId??null);let f=null;try{f=te(p=>p.appState.data)}catch{f=null}const m=tn(r?.id,f,d);return i(S,{label:l(e),icon:q(t),hint:Yi(s,m,c?.hasUnsavedEdits??!1),children:Ae({options:n,value:a,onChange:o,ariaLabel:e})})}function Ua(e,t,n,o={}){const r={type:"custom",[je]:!0,render:({value:s,onChange:a,name:c})=>i(Go,{value:s||"",onChange:a,fieldKey:c,label:e,accept:t,placeholder:n,focusKey:o.focus,focusWhen:o.focusWhen,frameKey:o.frame}),...o.focus?{focusKey:o.focus}:{},...o.focusWhen?{focusWhen:o.focusWhen}:{}};return o.focus?R("each",r):r}const Wa={HeroSingle:["imageFocal"],HeroSlide:["videoFrame"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function Ji(e){const t=l(e.status??"");return e.ok&&typeof e.lat=="number"&&typeof e.lng=="number"?`${t} · ${e.lat.toFixed(4)}, ${e.lng.toFixed(4)}`:t}function Ka({value:e,onChange:t,label:n}){const o=e||{},r=M(),s=r?r.values!==r.node.props:!0,a=!!o.pending&&s,c=!!o.pending&&!s,d=!!Br(vr()).geocode,f=Ue(),m=(p,u)=>t({...o,[p]:u??void 0});return N(k,{children:[i(S,{label:l(n),icon:i(et,{}),action:d?i(we,{content:l("Find from the address (OpenStreetMap)"),children:i(ut,{"aria-label":l("Find from the address"),"aria-busy":a||void 0,disabled:a,onClick:()=>t({...o,pending:!0,ok:!1,status:"Finding…"}),children:i(Gn,{})})}):void 0,children:d&&o.status?i(Sn,{compact:!0,oneLine:!0,spaced:!1,status:a?"busy":o.ok&&!c?"found":"notfound",statusText:a?l("Finding…"):c?l(Ro):l(o.status),hint:Ji(o)}):null}),i(S,{label:l("Enter by hand"),labelId:f,icon:i(An,{}),action:i(be,{checked:!!o.manual,onChange:p=>t({...o,manual:p}),ariaLabelledBy:f})}),o.manual&&i(S,{label:l("Latitude, longitude"),icon:i(et,{}),children:N("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,width:"100%",minWidth:0},children:[i(pt,{value:typeof o.lat=="number"?o.lat:null,onChange:p=>m("lat",p),min:-90,max:90,step:1e-4,placeholder:l("Latitude")}),i(pt,{value:typeof o.lng=="number"?o.lng:null,onChange:p=>m("lng",p),min:-180,max:180,step:1e-4,placeholder:l("Longitude")})]})})]})}function Zi(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function Qi(e,t,n){const o=e.map(r=>({text:r?.text??""}));return t===null||t<0||t>=e.length?o:o.map((r,s)=>s===t?{text:n}:r)}function $a(e,t){return e===null?null:t>e?e:null}function el(e,t,n){if(n===null||n>=t.length)return null;for(let o=0;o<n;o+=1)if(e[o]!==t[o])return null;return e[n]!==t[n]&&t.includes(e[n])||e[n]!==t[n]&&t.length!==e.length?null:n}const Xa={label:"Ticker items",icon:i(Bn,{})};function ja(e,t,n,o){return{type:"custom",[O]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},...E({},{...Nt.textList,label:e}),render:({value:r,onChange:s})=>i(tl,{label:e,icon:q(t),items:Array.isArray(r)?r:[],placeholder:n,onChange:s,markup:o==="markup"})}}function tl({label:e,icon:t,items:n,placeholder:o,onChange:r,markup:s=!1}){const a=V(null),[c,d]=z(null),f=p=>p.map(u=>({text:u?.text??""})),m=p=>{const u=el(n,p,c);u===null&&(a.current=null),d(u),r(f(p))};return i(oo,{label:l(e),icon:t,noun:l("item"),items:n,onChange:m,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:s?i(ht,{target:a,value:Zi(n,c),onChange:p=>r(Qi(n,c??-1,p)),disabled:c===null,label:c===null?l("Formatting — click a row first"):l("Formatting — row {n}",{n:c+1})}):void 0,renderRow:(p,u,g)=>i("input",{type:"text",className:s&&c===u?"sf-list-marking":void 0,value:p?.text??"",placeholder:l(o),"aria-label":l("{label} {n}",{label:l(e),n:u+1}),onChange:h=>g({text:h.target.value}),onFocus:h=>{a.current=h.currentTarget,d(u)}})})}function Va(e,t){const n=`${e.label} — row ${t+1}`;return G({control:"plainText",label:n,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:l("{label} — row {n}",{label:l(e.label),n:t+1}),placeholder:e.placeholder,hideable:!1,markup:e.rendering==="markup"})})}function za(e){return{_gCards:T("Cards"),coverIndex:Z("Cover image",i(vn,{}),Bo,String(Do),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:si("Image background",br),cardImage:rl()}}function Ya(){return{outline:Z("Card outline",i(Mn,{}),No,vo),indexBadge:Z("Card number",i(Qe,{}),Lo,Po),showBadge:Ki("Product badge",!0,i(it,{noun:"tag"}))}}function qa(e){const t=e?.defaults??{showCardSizes:!0,showCardBuy:!0,showCardPage:!0},n=r=>({...Q,label:ue.find(s=>s.id===r).label}),o=r=>E(Oo(De),n(r));return{_gShowOnCard:T("Show on a card"),[De]:E({type:"custom",render:()=>i(nl,{rest:{showCardPrice:!0,showCardFinishes:!0,...t}})},n(De)),showCardFinishes:o("showCardFinishes"),showCardSizes:o("showCardSizes"),showCardBuy:o("showCardBuy"),showCardPage:o("showCardPage")}}const De="showCardPrice",ue=[{id:"showCardPrice",label:"Price"},{id:"showCardFinishes",label:"Finish swatches"},{id:"showCardSizes",label:"Sizes"},{id:"showCardBuy",label:"Buy button"},{id:"showCardPage",label:"Page button"}];function nl({rest:e}){const t=L(),n=ai(),o=a=>typeof t[a]=="boolean"?t[a]:void 0,r=a=>o(a)??e[a],s=ue.some(({id:a})=>o(a)!==void 0&&o(a)!==e[a]);return i(He,{parts:ue,changed:s,shown:r,onPress:(a,c)=>n({[a]:c}),onReset:()=>n(Object.fromEntries(ue.map(({id:a})=>[a,void 0])))})}function Ja(e,t="display"){const n=F(t);return{[t]:R("desktop",{type:"custom",render:({value:o,onChange:r})=>i(He,{parts:e,changed:io(o),shown:s=>lo(o,s),onPress:(s,a)=>r(co(o,s,a)),onReset:()=>r(void 0)})}),[n]:R("mobile",{type:"custom",render:({value:o,onChange:r})=>i(ol,{parts:e,desktopKey:t,value:o,onChange:r})})}}function He({parts:e,changed:t,shown:n,onPress:o,onReset:r,detail:s,disabledReason:a}){const c=l("Display");return i(S,{label:c,icon:i(Cn,{}),changed:t,action:i(C,{words:y()?.panel,label:c,changed:t,detail:s,onReset:r}),children:i(ro,{label:c,items:e.map(d=>({id:d.id,label:l(d.label),shown:n(d.id),...a?{disabled:!0,disabledReason:l(a)}:{}})),onChange:o})})}function ol({parts:e,desktopKey:t,value:n,onChange:o}){const r=L()[t];return i(He,{parts:e,changed:ao(n),shown:s=>so(r,n,s),onPress:(s,a)=>o(uo(n,s,a)),onReset:()=>o(Fo),detail:l("the same as Desktop")})}function rl(){return Bt("Card image",{min:U,max:Ye,step:an,hint:"Rounds the picture. The card's own corner is in Styles."})}function Za(){return Ne({sidesKey:"cornerSides",step:cn,useFollowed:()=>U,mark:i(il,{label:dn}),hint:l("Rounds the picture. Left alone it stays square.")})}function il({label:e,changed:t=!1,onReset:n=()=>{}}){return i(C,{words:y()?.panel,label:l(e),changed:t,onReset:n})}function Qa(){return{type:"custom",render:({value:e,onChange:t})=>i(cl,{value:typeof e=="string"?e:"",onChange:t})}}function ll({layout:e,width:t}){const n=hn(e),o=n?`${n[0]}/${n[1]}`:void 0;return i("span",{"aria-hidden":"true",style:{display:"grid",width:t,gridTemplateColumns:"repeat(12, minmax(0, 1fr))",gridAutoRows:o?"auto":6,gridAutoFlow:"row dense",gap:2},children:mn(e).map(([r,s],a)=>i("i",{className:"block rounded-xs bg-current opacity-60",style:{gridColumn:`span ${r}`,gridRow:`span ${s}`,aspectRatio:o}},a))})}const sl={width:"3.5rem",height:"2.5rem"},al=200;function cl({value:e,onChange:t}){const[n,o]=z(null),[r,s]=z(4),a=V(null);Yt(()=>{const u=a.current;if(!u||typeof ResizeObserver!="function")return;const g=()=>s(u.getBoundingClientRect().width>=al?4:3);g();const h=new ResizeObserver(g);return h.observe(u),()=>h.disconnect()},[]);const c=e&&e in ne?e:"",d=qe(n,c),f=qe(n,"").length,m=gn("no-symbol"),p=[{value:"",label:l("Not chosen"),icon:Ur(m,l("Not chosen"))},...d.map(u=>({value:u,label:l(ne[u].label),icon:i(ll,{layout:ne[u],width:40})}))];return i(S,{label:l("Layout"),icon:i(Nn,{}),value:c?l(ne[c].label):void 0,children:i("div",{ref:a,style:{flex:"1 1 auto",minWidth:0},children:i(at,{label:l("Layout"),value:c,options:p,onChange:t,columns:r,cell:sl,header:N("div",{className:"mb-2 flex flex-col gap-1",style:{minWidth:"11rem"},children:[i("span",{className:"text-2xs text-ink-faint",children:l("Photos in a row")}),i(Zn,{options:[{id:"all",label:l("All")},...pn.map(u=>({id:String(u),label:String(u)}))],value:n===null?"all":String(n),ariaLabel:l("Photos in a row"),onChange:u=>o(u==="all"?null:Number(u))}),i("span",{className:"text-2xs text-ink-faint",children:l("{n} of {total} layouts",{n:f,total:fn.length})})]})})})})}export{Zr as BOUND_TO_POST,Xs as BOUND_TO_POST_NOTE,Qs as BUCKET_ICONS,Wa as CUSTOM_FIELD_MEDIA,Ka as CoordsField,At as DESKTOP_GAP_NOT_OVERLAP,He as DisplayRow,Pa as EDGE_ARROWS,wo as FOCAL_DEFAULT,Vi as FOCAL_POINTS,pe as FOLD_FIELD_MARKER,zi as FocalPicker,sa as GroupLabel,Qr as HIGHLIGHT_HINT,H as HidableTextField,Xe as LINK_FIELD_MARKER,Ps as Label,je as MEDIA_FIELD_MARKER,Ga as MEDIA_TYPE_OPTIONS,js as NOT_BOUND_TO_POST,la as PanelBand,ni as PanelNoteLine,Ei as RowPropsContext,Ve as SCAFFOLD_FIELD_MARKER,oc as SCALAR_TEXT_CONTROLS,$r as SiteGapDefaultReset,ee as Slider,ri as Swatches,nc as TEXT_CONTROL_KINDS,O as TEXT_FIELD_MARKER,Xa as TICKER_ITEMS_ROW,tl as TextListField,$i as ThemeFillRow,ce as WIDTH_LABEL,qr as WidthDefaultReset,el as aimAfterListChange,Oa as anchorFields,D as backTo,aa as backgroundField,ma as boxBlockSpacingField,wa as boxColumnsFields,La as boxFillField,Ii as boxPhoneRowField,Ri as boxShareField,ga as boxSharePhoneField,ba as boxShareTabletField,ji as boxThemeIndexOf,na as bucketHeader,pa as buttonWordsEntryField,Ci as cardCornersField,si as cardImageBackgroundField,rl as cardImageField,za as cardMediaFields,ha as cardShapeFields,qa as cardShowFields,Ya as cardStyleFields,Sa as cellWidthFields,Fa as checkbox,Aa as colorInput,Bs as containerDirectionField,Xr as containerGapField,jr as containerGapPhoneField,vs as containerGapRows,Vr as containerGapTabletField,Ji as coordsResultTip,qs as copyText,Ht as cornerSidesField,Ne as cornersRowField,Ea as date,Ia as dateTime,oa as designGroupHeader,Ja as displayFields,va as edgePad,ve as fillSlotChoices,$a as focusAfterRemove,Na as focusKeptField,ra as foldMarker,fe as foldMetaOf,oi as foldTitleOf,Bi as followedHeightPatch,Ui as followedStickPatch,Qa as galleryLayoutField,Ra as heightFields,de as heightFollowedBy,Ds as heroGroupPlacementPoints,$e as hidableText,ti as hintIsWhileTyping,Za as imageCornersField,$s as inOwnBox,ta as isBucketHeader,Dt as keptBy,Js as linkField,Yi as loadingRowHint,Ma as loadingShowsField,Ba as multiSelect,ka as pageBackgroundField,ea as panelNote,Ai as phoneOverrideField,Ys as plainText,Zs as plainTextarea,Bt as pxField,ia as quietMarker,Ke as readHidable,Zi as rowText,Da as searchSelect,li as sectionBandChoices,ua as sectionBorderField,pi as sectionCornersField,da as sectionShapeFields,ca as sectionThemeFields,Qi as setRowText,xa as sizeField,Ha as sourceField,ya as spacingFields,Ta as stickFields,Ca as swapPadding,fa as templateField,Vs as text,rn as textFieldIdentifier,Ms as textFieldOffPage,Ws as textFieldPanelOnly,ja as textList,Va as textListRowField,zs as textarea,Ki as toggle,Ua as upload,ai as useSelectedPatch,L as useSelectedProps,A as useSelectedSibling,Kr as useSiteGapDetail,_a as widthField,Ks as withIdentifier,Gs as withOffPage,Us as withPanelOnly,Hs as withScaffold};
@@ -1 +1 @@
1
- import{convertSection as S,pressesAsBox as l,SECTION_TO_BOX_PRESS as g,sectionToBoxRow as T}from"../../../render/lib/sections/section-to-box.js";import{SECTION_PRESETS as _,presetFor as k}from"../../../format/lib/sections/section-presets.js";import{GENERAL_SECTION_TO_BOX as N}from"../../../render/lib/document/blocks/general/section-to-box-rows.js";import{statsBoxSeed as P,statsPressSeed as B,statsSeedRows as L}from"../../../render/lib/document/blocks/general/section-to-box-rows-stats.js";import{logosPressStarter as R}from"../../../render/lib/document/blocks/general/section-to-box-rows-logos.js";import{pageHeaderPressStarter as j}from"../../../render/lib/document/blocks/general/section-to-box-rows-pageheader.js";import{milestoneTimelinePressStarter as w,storyTimelinePressStarter as v}from"../../../render/lib/document/blocks/general/section-to-box-rows-timeline.js";import{seedNodes as A}from"../../../format/lib/document/seed-parts.js";import{propsWithPartStyleValue as C}from"../../../render/lib/document/part-styles.js";import{isNodeList as f}from"efficient-easel/data";const U=Object.keys(N),O={Logos:R,DocMasthead:j,Timeline:v,TimelineTrack:w};function u(t,r,e){const o={};for(const n of Object.keys(r(t.type)))o[n]=void 0;for(const[n,s]of Object.entries(t.props))o[n]=f(s)?s.map(p=>u(p,r,e)):s;return o.id=e(t.type),{type:t.type,props:o}}const h=t=>({...t?.theme?{theme:t.theme}:{},press:!0});function W(t,r,e=0,o=()=>({})){return(n,s,p)=>{const{nodes:i}=S({type:t,props:{...n(t),...o(),id:s(t)}},r,h(p));return u(i[e],n,s)}}const X={Stats:G};function G(){const t=T("StatsParagraph");return t?(r,e,o)=>{const{nodes:n}=S({type:"StatsParagraph",props:{...r("StatsParagraph"),...B(),id:e("StatsParagraph")}},t,h(o)),s=n[0],p=f(s.props.content)?s.props.content.filter(m=>m.props?.cardStyle===void 0):[],i=x(P(L(),"table")),c=p.map(b),a=u({...s,props:{...s.props,content:[...c,i]}},r,e);return{...a,props:{...a.props,name:"Stats section"}}}:null}function b(t){if(t.props?.name==="Words"){const r=f(t.props.content)?t.props.content.map(M):t.props.content;return{...t,props:{...t.props,widthFitPhone:"fill",content:r}}}return f(t.props?.content)?{...t,props:{...t.props,content:t.props.content.map(b)}}:t}function M(t){return t.type!=="Text"?t:{...t,props:C({...t.props,alignTablet:"left"},"text","alignTablet","left")}}const x=t=>A([t],(r,e)=>`${r}-seed-${e}`)[0];function Y(t,r){if(!l(t,r))return null;const e=X[t];if(e)return e();const o=T(t);return o?W(t,o,0,O[t]):null}function $(t){return(r,e,o)=>{const n=s=>{if(s.type==="Stats"){const c=u(x(P([],"list")),r,e);return{...c,props:{...c.props,name:"Numbers"}}}let p=!1;const i={};for(const[c,a]of Object.entries(s.props))if(f(a)){const m=a.map(n);p||=m.some((E,y)=>E!==a[y]),i[c]=m}else i[c]=a;return p?{type:s.type,props:i}:s};return n(t(r,e,o))}}function Z(t,r=g){const e=k(t);return e?$(e):Y(t,r)}function F(){return[...Object.keys(_),...U.filter(t=>l(t)),...Object.keys(O).filter(t=>l(t))]}export{O as MERGE_LAYOUTS,U as TEXT_LAYOUTS,W as conversionPreset,Z as layoutPresetFor,F as layoutTypes};
1
+ import{convertSection as P,pressesAsBox as S,SECTION_TO_BOX_PRESS as _,sectionToBoxRow as l}from"../../../render/lib/sections/section-to-box.js";import{SECTION_PRESETS as R,presetFor as k}from"../../../format/lib/sections/section-presets.js";import{GENERAL_SECTION_TO_BOX as d}from"../../../render/lib/document/blocks/general/section-to-box-rows.js";import{statsBoxSeed as T,statsPressSeed as B,statsSeedRows as C}from"../../../render/lib/document/blocks/general/section-to-box-rows-stats.js";import{logosPressStarter as N,paymentPressStarter as w}from"../../../render/lib/document/blocks/general/section-to-box-rows-logos.js";import{cardsPressStarter as L}from"../../../render/lib/document/blocks/general/section-to-box-rows-cards.js";import{pageHeaderPressStarter as j}from"../../../render/lib/document/blocks/general/section-to-box-rows-pageheader.js";import{milestoneTimelinePressStarter as v,storyTimelinePressStarter as A}from"../../../render/lib/document/blocks/general/section-to-box-rows-timeline.js";import{seedNodes as U}from"../../../format/lib/document/seed-parts.js";import{propsWithPartStyleValue as W}from"../../../render/lib/document/part-styles.js";import{isNodeList as m}from"efficient-easel/data";const X=Object.keys(d),E={Logos:N,DocMasthead:j,Timeline:A,TimelineTrack:v},D={PaymentBadges:w};function u(t,r,e){const o={};for(const n of Object.keys(r(t.type)))o[n]=void 0;for(const[n,s]of Object.entries(t.props))o[n]=m(s)?s.map(p=>u(p,r,e)):s;return o.id=e(t.type),{type:t.type,props:o}}const O=t=>({...t?.theme?{theme:t.theme}:{},press:!0});function b(t,r,e=0,o=()=>({})){return(n,s,p)=>{const{nodes:i}=P({type:t,props:{...n(t),...o(),id:s(t)}},r,O(p));return u(i[e],n,s)}}const G={Stats:Y,Cards:M};function M(){const t=l("Cards");if(!t)return null;const r=b("Cards",t,0,L);return(e,o,n)=>{const s=r(e,o,n);return{...s,props:{...s.props,name:"Cards section"}}}}function Y(){const t=l("StatsParagraph");return t?(r,e,o)=>{const{nodes:n}=P({type:"StatsParagraph",props:{...r("StatsParagraph"),...B(),id:e("StatsParagraph")}},t,O(o)),s=n[0],p=m(s.props.content)?s.props.content.filter(f=>f.props?.cardStyle===void 0):[],i=x(T(C(),"table")),c=p.map(h),a=u({...s,props:{...s.props,content:[...c,i]}},r,e);return{...a,props:{...a.props,name:"Stats section"}}}:null}function h(t){if(t.props?.name==="Words"){const r=m(t.props.content)?t.props.content.map($):t.props.content;return{...t,props:{...t.props,widthFitPhone:"fill",content:r}}}return m(t.props?.content)?{...t,props:{...t.props,content:t.props.content.map(h)}}:t}function $(t){return t.type!=="Text"?t:{...t,props:W({...t.props,alignTablet:"left"},"text","alignTablet","left")}}const x=t=>U([t],(r,e)=>`${r}-seed-${e}`)[0];function H(t,r){if(!S(t,r))return null;const e=G[t];if(e)return e();const o=l(t);return o?b(t,o,0,E[t]??D[t]):null}function I(t){return(r,e,o)=>{const n=s=>{if(s.type==="Stats"){const c=u(x(T([],"list")),r,e);return{...c,props:{...c.props,name:"Numbers"}}}let p=!1;const i={};for(const[c,a]of Object.entries(s.props))if(m(a)){const f=a.map(n);p||=f.some((y,g)=>y!==a[g]),i[c]=f}else i[c]=a;return p?{type:s.type,props:i}:s};return n(t(r,e,o))}}function st(t,r=_){const e=k(t);return e?I(e):H(t,r)}function ot(){return[...Object.keys(R),...X.filter(t=>S(t)),...Object.keys(E).filter(t=>S(t))]}export{E as MERGE_LAYOUTS,X as TEXT_LAYOUTS,b as conversionPreset,st as layoutPresetFor,ot as layoutTypes};
@@ -1 +1 @@
1
- import{HOVER_MOTION as E,hoverKindsOf as u,motionSeconds as a}from"efficient-shell/format";import{finiteNumber as s}from"../finite-number.js";const i="hover",y="_gHover",A={none:"None",nextImage:"Show next image",rotate:"Rotate",zoom:"Zoom",lift:"Lift",mono:"Black and white"},H=u(["none","lift"]);function P(n){const e=n[i];return H.includes(e)?e:"none"}const R=u(["none","rotate"]),r={kind:i,angle:"hoverAngle",duration:"hoverDuration",delay:"hoverDelay"},l="spinOnHover",p={min:0,max:360,step:1},x={ProductGrid:"rotate",RelatedProducts:"rotate",AlloyWheelsListing:"none"},L=Object.keys(x);function v(n){return x[n]??"none"}const I=E.rotateFallbackDeg;function g(n,e){const t=n[r.kind];if(R.includes(t))return t;const o=n[l];return typeof o=="boolean"?o?"rotate":"none":e}function h(n){const e=s(n);return e===void 0?I:Math.min(p.max,Math.max(p.min,e))}function M(n,e){const t=v(e),o=g(n,t);return{kind:o,angle:o==="rotate"?h(n[r.angle]):null,duration:a("hover","duration",o==="rotate"?n[r.duration]:void 0),delay:a("hover","delay",o==="rotate"?n[r.delay]:void 0)}}function U(n){const e={field:r.kind,in:[...R]};return{any:[{field:r.kind,is:"rotate"},{all:[{not:e},n==="rotate"?{not:{field:l,is:!1}}:{field:l,is:!0}]}]}}const O=u(["none","mono"]),S=u(["none","nextImage","mono"]),_={ImageBlock:"none",Manifesto:"none",Split:"none",ContactLocations:"mono"},B=Object.keys(_);function k(n){return _[n]??"none"}const m={zoom:"hoverZoom",darken:"hoverDarken"},d={min:100,max:150,step:1,unit:"%"},c=["nextImage"];function D(n,e){if(!c.includes(e))return null;const t=s(n[m.zoom]);if(t===void 0)return null;const o=Math.min(d.max,Math.max(d.min,t));return o===d.min?null:String(o/100)}function N(n,e){if(!c.includes(e))return null;const t=s(n[m.darken]);return t!==void 0&&t>0?t:null}const V=["ImageBlock"];function C(n,e,t=O){const o=n[i];return t.includes(o)?o:e}function G(n,e=""){const t=V.includes(e)?S:O,o=C(n,k(e),t),f=o!=="none";return{kind:o,duration:a("hover","duration",f?n[r.duration]:void 0),delay:a("hover","delay",f?n[r.delay]:void 0),...c.includes(o)?{zoom:D(n,o),darken:N(n,o)}:{}}}function Y(){return{field:i,in:[...c]}}function b(n){return n==="none"?{field:i,in:["mono","nextImage"]}:{not:{field:i,is:"none"}}}export{p as CARD_HOVER_ANGLE,r as CARD_HOVER_KEYS,R as CARD_HOVER_KINDS,L as CARD_HOVER_SECTIONS,I as CARD_HOVER_TURN,y as HOVER_GROUP_KEY,i as HOVER_KEY,A as HOVER_KIND_LABELS,V as NEXT_PICTURE_BLOCKS,S as NEXT_PICTURE_HOVER_KINDS,l as OLD_SPIN_KEY,H as PART_HOVER_KINDS,B as PICTURE_HOVER_BLOCKS,m as PICTURE_HOVER_KEYS,O as PICTURE_HOVER_KINDS,d as PICTURE_HOVER_ZOOM,h as cardHoverAngleOf,g as cardHoverKindOf,M as cardHoverOf,v as cardHoverResting,U as cardRotatesRule,P as hoverOf,C as pictureHoverKindOf,Y as pictureHoverMovesRule,G as pictureHoverOf,k as pictureHoverResting,b as pictureHoverRunsRule,D as pictureHoverZoomOf};
1
+ import{HOVER_MOTION as E,hoverKindsOf as u,motionSeconds as a}from"efficient-shell/format";import{ANGLE_RANGE as H}from"../content/box-angle.js";import{finiteNumber as s}from"../finite-number.js";const i="hover",P="_gHover",L={none:"None",nextImage:"Show next image",rotate:"Rotate",zoom:"Zoom",lift:"Lift",mono:"Black and white"},v=u(["none","lift"]);function M(n){const e=n[i];return v.includes(e)?e:"none"}const R=u(["none","rotate"]),r={kind:i,angle:"hoverAngle",duration:"hoverDuration",delay:"hoverDelay"},l="spinOnHover",p=H,_={ProductGrid:"rotate",RelatedProducts:"rotate",AlloyWheelsListing:"none"},U=Object.keys(_);function I(n){return _[n]??"none"}const N=E.rotateFallbackDeg;function g(n,e){const t=n[r.kind];if(R.includes(t))return t;const o=n[l];return typeof o=="boolean"?o?"rotate":"none":e}function h(n){const e=s(n);return e===void 0?N:Math.min(p.max,Math.max(p.min,e))}function G(n,e){const t=I(e),o=g(n,t);return{kind:o,angle:o==="rotate"?h(n[r.angle]):null,duration:a("hover","duration",o==="rotate"?n[r.duration]:void 0),delay:a("hover","delay",o==="rotate"?n[r.delay]:void 0)}}function B(n){const e={field:r.kind,in:[...R]};return{any:[{field:r.kind,is:"rotate"},{all:[{not:e},n==="rotate"?{not:{field:l,is:!1}}:{field:l,is:!0}]}]}}const O=u(["none","mono"]),S=u(["none","nextImage","mono"]),m={ImageBlock:"none",Manifesto:"none",Split:"none",ContactLocations:"mono"},Y=Object.keys(m);function k(n){return m[n]??"none"}const x={zoom:"hoverZoom",darken:"hoverDarken"},d={min:100,max:150,step:1,unit:"%"},c=["nextImage"];function D(n,e){if(!c.includes(e))return null;const t=s(n[x.zoom]);if(t===void 0)return null;const o=Math.min(d.max,Math.max(d.min,t));return o===d.min?null:String(o/100)}function V(n,e){if(!c.includes(e))return null;const t=s(n[x.darken]);return t!==void 0&&t>0?t:null}const C=["ImageBlock"];function K(n,e,t=O){const o=n[i];return t.includes(o)?o:e}function b(n,e=""){const t=C.includes(e)?S:O,o=K(n,k(e),t),f=o!=="none";return{kind:o,duration:a("hover","duration",f?n[r.duration]:void 0),delay:a("hover","delay",f?n[r.delay]:void 0),...c.includes(o)?{zoom:D(n,o),darken:V(n,o)}:{}}}function z(){return{field:i,in:[...c]}}function Z(n){return n==="none"?{field:i,in:["mono","nextImage"]}:{not:{field:i,is:"none"}}}export{p as CARD_HOVER_ANGLE,r as CARD_HOVER_KEYS,R as CARD_HOVER_KINDS,U as CARD_HOVER_SECTIONS,N as CARD_HOVER_TURN,P as HOVER_GROUP_KEY,i as HOVER_KEY,L as HOVER_KIND_LABELS,C as NEXT_PICTURE_BLOCKS,S as NEXT_PICTURE_HOVER_KINDS,l as OLD_SPIN_KEY,v as PART_HOVER_KINDS,Y as PICTURE_HOVER_BLOCKS,x as PICTURE_HOVER_KEYS,O as PICTURE_HOVER_KINDS,d as PICTURE_HOVER_ZOOM,h as cardHoverAngleOf,g as cardHoverKindOf,G as cardHoverOf,I as cardHoverResting,B as cardRotatesRule,M as hoverOf,K as pictureHoverKindOf,z as pictureHoverMovesRule,b as pictureHoverOf,k as pictureHoverResting,Z as pictureHoverRunsRule,D as pictureHoverZoomOf};
@@ -0,0 +1,10 @@
1
+ export declare const ACCORDION_ROW_STYLE_PROP = "rowStyle";
2
+ export type AccordionRowStyle = "plain" | "numbered";
3
+ export declare const ACCORDION_ROW_STYLE_POINTS: readonly {
4
+ label: string;
5
+ value: AccordionRowStyle;
6
+ }[];
7
+ export declare function accordionRowStyleOf(value: unknown): AccordionRowStyle;
8
+ export declare const QA_ROW_SUMMARY_CLASS = "flex cursor-pointer list-none items-center gap-6 py-7 [&::-webkit-details-marker]:hidden max-view-wide:gap-4 max-view-wide:py-5";
9
+ export declare const QA_ROW_NUMBER_CLASS = "font-mono text-[length:var(--size-label,14px)] tracking-[0.2em] text-accent";
10
+ export declare const QA_ROW_ANSWER_CLASS = "pb-8 pl-11 pr-8 max-view-wide:pl-0 max-view-wide:pr-0";
@@ -0,0 +1 @@
1
+ const t="rowStyle",n=[{label:"Plain",value:"plain"},{label:"Numbered",value:"numbered"}];function r(e){return e==="numbered"?"numbered":"plain"}const o="flex cursor-pointer list-none items-center gap-6 py-7 [&::-webkit-details-marker]:hidden max-view-wide:gap-4 max-view-wide:py-5",i="font-mono text-[length:var(--size-label,14px)] tracking-[0.2em] text-accent",a="pb-8 pl-11 pr-8 max-view-wide:pl-0 max-view-wide:pr-0";export{n as ACCORDION_ROW_STYLE_POINTS,t as ACCORDION_ROW_STYLE_PROP,a as QA_ROW_ANSWER_CLASS,i as QA_ROW_NUMBER_CLASS,o as QA_ROW_SUMMARY_CLASS,r as accordionRowStyleOf};
@@ -0,0 +1,9 @@
1
+ export declare const ANGLE_RANGE: {
2
+ readonly min: 0;
3
+ readonly max: 360;
4
+ readonly step: 1;
5
+ };
6
+ export declare const BOX_ANGLE_PROP = "angle";
7
+ export declare function boxAngleStyle(value: unknown): {
8
+ rotate: string;
9
+ } | null;
@@ -0,0 +1 @@
1
+ import{finiteNumber as m}from"../finite-number.js";const n={min:0,max:360,step:1},i="angle";function a(o){const e=m(o);if(e===void 0)return null;const t=Math.min(n.max,Math.max(n.min,e));return t===n.min||t===n.max?null:{rotate:`${t}deg`}}export{n as ANGLE_RANGE,i as BOX_ANGLE_PROP,a as boxAngleStyle};
@@ -1,4 +1,5 @@
1
1
  import type { CSSProperties } from "react";
2
+ import { type FillColorSlot } from "efficient-shell/markup";
2
3
  import type { SourceRow } from "./block-sources.js";
3
4
  import { type ViewVarNames } from "./view-var-split.js";
4
5
  export declare const CARD_SHADOW_CLASS = "sf-card";
@@ -31,6 +32,8 @@ export declare const BOX_CARD_SIDE: {
31
32
  export declare function isBackgroundBox(src?: string | null): boolean;
32
33
  export declare function boxDarkenStyle(darken: unknown, style?: unknown): CSSProperties | null;
33
34
  export declare const boxFillOf: (value: unknown) => string | null;
35
+ export declare const boxPaintOf: (value: unknown) => string | null;
36
+ export declare const boxFillSlot: (value: unknown) => FillColorSlot | null;
34
37
  export declare const BOX_SWATCH_PROP = "swatch";
35
38
  export declare function boxSwatchFill(props: Record<string, unknown> | null | undefined, row: SourceRow | null | undefined): string | null;
36
39
  export declare const BOX_FILL_VIEWS: ViewVarNames;
@@ -1 +1 @@
1
- import{parseHexColor as h}from"efficient-shell/format";import{namedRowField as _,rowFieldText as g}from"./card-template.js";import{scrim as f}from"./scrim.js";import{viewVarSplit as b}from"./view-var-split.js";const E="sf-card",x={min:0,max:100,step:5,fallback:0,unit:"%"},k=[{label:"Even",value:"even"},{label:"From the bottom",value:"bottom"}],y="68%",N={desktop:20,phone:20,side:40,sidePhone:24},P="sf-box-sides",V={min:0,max:200,step:10};function X(t){return typeof t=="string"&&t.trim()!==""}function S(t,e){const n=typeof t=="number"?t:Number.parseFloat(String(t??""));if(!Number.isFinite(n)||n<=0)return null;const r=(Math.min(x.max,Math.max(x.min,n))/100).toFixed(2);return e!=="bottom"?{background:f(Number(r))}:{background:`linear-gradient(0deg, ${f(Number(r))} 0%, ${f(0)} ${y})`}}const p=t=>typeof t=="string"?h(t.trim()):null,O="swatch";function I(t,e){return e?p(g(e,_(t,O))):null}const A={tabletClass:"sf-fill-tablet",tabletVar:"--sf-fill-tablet",phoneClass:"sf-fill-phone",phoneVar:"--sf-fill-phone"};function R(t,e,n){return b(A,p(t),p(e),p(n))}const F={tabletClass:"sf-wash-tablet",tabletVar:"--sf-wash-tablet",phoneClass:"sf-wash-phone",phoneVar:"--sf-wash-phone"};function W(t){const e=S(t.darken,t.darkenStyle);if(!e)return{className:"",style:{}};const n=(o,d)=>String(S(o,d)?.background??"none"),s=o=>(typeof o=="number"||typeof o=="string"&&o.trim()!=="")&&Number.isFinite(Number(o))?o:void 0,r=o=>k.some(d=>d.value===o)?o:void 0,[a,l,i,c]=[s(t.darkenTablet),r(t.darkenStyleTablet),s(t.darkenPhone),r(t.darkenStylePhone)],u=a??t.darken,m=l??t.darkenStyle;return b(F,String(e.background),a!==void 0||l!==void 0?n(u,m):null,i!==void 0||c!==void 0?n(i??u,c??m):null)}function L(t,e){const n={"top-left":["start","start"],"top-center":["center","start"],"top-right":["end","start"],left:["start","center"],center:["center","center"],right:["end","center"],"bottom-left":["start","end"],"bottom-center":["center","end"],"bottom-right":["end","end"]},[s,r]=n[t]??n.center,[a,l]=e==="column"?[r,s]:[s,r],i={start:"justify-start",center:"justify-center",end:"justify-end"},c={start:"items-start",center:"items-center",end:"items-end"};return`${i[a]} ${c[l]}`}export{N as BOX_CARD_PAD,V as BOX_CARD_SIDE,x as BOX_DARKEN,k as BOX_DARKEN_STYLES,A as BOX_FILL_VIEWS,P as BOX_OWNS_SIDES_CLASS,O as BOX_SWATCH_PROP,F as BOX_WASH_VIEWS,E as CARD_SHADOW_CLASS,S as boxDarkenStyle,p as boxFillOf,R as boxFillViews,L as boxPlacementClasses,I as boxSwatchFill,W as boxWashViews,X as isBackgroundBox};
1
+ import{parseHexColor as k}from"efficient-shell/format";import{fillColorRole as _}from"efficient-shell/markup";import{namedRowField as g,rowFieldText as y}from"./card-template.js";import{fillInkCss as O,fillSlotNamed as C,inkTokenOf as F,partColourName as A}from"../document/part-inks.js";import{scrim as u}from"./scrim.js";import{viewVarSplit as b}from"./view-var-split.js";const L="sf-card",x={min:0,max:100,step:5,fallback:0,unit:"%"},T=[{label:"Even",value:"even"},{label:"From the bottom",value:"bottom"}],D="68%",$={desktop:20,phone:20,side:40,sidePhone:24},H="sf-box-sides",M={min:0,max:200,step:10};function j(t){return typeof t=="string"&&t.trim()!==""}function S(t,n){const e=typeof t=="number"?t:Number.parseFloat(String(t??""));if(!Number.isFinite(e)||e<=0)return null;const s=(Math.min(x.max,Math.max(x.min,e))/100).toFixed(2);return n!=="bottom"?{background:u(Number(s))}:{background:`linear-gradient(0deg, ${u(Number(s))} 0%, ${u(0)} ${D})`}}const h=t=>typeof t=="string"?k(t.trim()):null,p=t=>{const n=h(t);if(n!==null||typeof t!="string")return n;const e=t.trim();return e&&!e.startsWith("#")&&O(e)||null},w=t=>{if(typeof t!="string")return null;const n=_(A(t.trim()));return n?.kind==="slot"?n.slot:null},N="swatch";function K(t,n){if(!n)return null;const e=y(n,g(t,N)),r=C(e);return h(e)??(r&&F(r)||null)}const B={tabletClass:"sf-fill-tablet",tabletVar:"--sf-fill-tablet",phoneClass:"sf-fill-phone",phoneVar:"--sf-fill-phone"};function Y(t,n,e){return b(B,p(t),p(n),p(e))}const E={tabletClass:"sf-wash-tablet",tabletVar:"--sf-wash-tablet",phoneClass:"sf-wash-phone",phoneVar:"--sf-wash-phone"};function z(t){const n=S(t.darken,t.darkenStyle);if(!n)return{className:"",style:{}};const e=(o,f)=>String(S(o,f)?.background??"none"),r=o=>(typeof o=="number"||typeof o=="string"&&o.trim()!=="")&&Number.isFinite(Number(o))?o:void 0,s=o=>T.some(f=>f.value===o)?o:void 0,[l,a,i,c]=[r(t.darkenTablet),s(t.darkenStyleTablet),r(t.darkenPhone),s(t.darkenStylePhone)],m=l??t.darken,d=a??t.darkenStyle;return b(E,String(n.background),l!==void 0||a!==void 0?e(m,d):null,i!==void 0||c!==void 0?e(i??m,c??d):null)}function J(t,n){const e={"top-left":["start","start"],"top-center":["center","start"],"top-right":["end","start"],left:["start","center"],center:["center","center"],right:["end","center"],"bottom-left":["start","end"],"bottom-center":["center","end"],"bottom-right":["end","end"]},[r,s]=e[t]??e.center,[l,a]=n==="column"?[s,r]:[r,s],i={start:"justify-start",center:"justify-center",end:"justify-end"},c={start:"items-start",center:"items-center",end:"items-end"};return`${i[l]} ${c[a]}`}export{$ as BOX_CARD_PAD,M as BOX_CARD_SIDE,x as BOX_DARKEN,T as BOX_DARKEN_STYLES,B as BOX_FILL_VIEWS,H as BOX_OWNS_SIDES_CLASS,N as BOX_SWATCH_PROP,E as BOX_WASH_VIEWS,L as CARD_SHADOW_CLASS,S as boxDarkenStyle,h as boxFillOf,w as boxFillSlot,Y as boxFillViews,p as boxPaintOf,J as boxPlacementClasses,K as boxSwatchFill,z as boxWashViews,j as isBackgroundBox};
@@ -103,6 +103,9 @@ export declare function boxRowColumnsClass(box: {
103
103
  line?: unknown;
104
104
  columns?: unknown;
105
105
  }): string;
106
+ export declare const ACCORDION_COLUMN_COUNTS: readonly number[];
107
+ export declare const ACCORDION_PHONE_COLUMN_COUNTS: readonly number[];
108
+ export declare function boxAccordionColumnsClass(columns: unknown, phoneRow: unknown, touching?: boolean): string;
106
109
  export declare function boxPhoneRowOneLine(wrapPhone: unknown, wrapTablet?: unknown): boolean;
107
110
  export declare function boxPhoneRowClasses(perRow: unknown, sharePhone?: unknown, wrapPhone?: unknown, wrapTablet?: unknown): string;
108
111
  export declare function boxPhoneCellsShareLine(perRow: unknown, sharePhone: unknown): boolean;