@taprootio/espalier 3.1.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,6 +11,15 @@ import { EspalierElementBase } from "../shared/esp-element-base.js";
11
11
  * </esp-box>
12
12
  * ```
13
13
  *
14
+ * **What esp-box is not:** a full-bleed page band. The box is a *card* —
15
+ * it paints its own raised surface (`--esp-color-layer-1`), carries
16
+ * padding, and fills its container's height. A band is
17
+ * [`esp-section`](/components/section): it paints the local canvas edge
18
+ * to edge with a centered well and hosts a theme zone (`context="…"`)
19
+ * with nothing to neutralize. Keep boxes for what they are for — cards,
20
+ * panels, and form surfaces — and replace any pre-3.2 "neutralized box"
21
+ * band with a bare section.
22
+ *
14
23
  * @customElement esp-box
15
24
  * @slot - The default slot holds elements to display in the box.
16
25
  *
@@ -25,6 +34,7 @@ import { EspalierElementBase } from "../shared/esp-element-base.js";
25
34
  * @cssprop --esp-box-background - Adds a layer in the background of the box. Intended for background images or gradients.
26
35
  * @cssprop --esp-box-background-opacity - The opacity of the background layer.
27
36
  * @cssprop --esp-size-box-padding - The padding inside the box.
37
+ * @cssprop --esp-box-shadow - The box's drop shadow. Defaults to the theme's `--esp-shadow-1` elevation.
28
38
  *
29
39
  * ```html
30
40
  * <style>
@@ -1,10 +1,10 @@
1
- var n=function(s,e,r,i){var a=arguments.length,o=a<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,r,i);else for(var p=s.length-1;p>=0;p--)(l=s[p])&&(o=(a<3?l(o):a>3?l(e,r,o):l(e,r))||o);return a>3&&o&&Object.defineProperty(e,r,o),o};import{css as c,html as b}from"lit";import{customElement as v,property as h}from"lit/decorators.js";import{classMap as f}from"lit/directives/class-map.js";import{EspalierElementBase as d}from"../shared/esp-element-base.js";let t=class extends d{constructor(){super(...arguments),this.fullScreen=!1}render(){const{fullScreen:e}=this;return b`
1
+ var n=function(t,e,r,i){var a=arguments.length,o=a<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,i);else for(var p=t.length-1;p>=0;p--)(l=t[p])&&(o=(a<3?l(o):a>3?l(e,r,o):l(e,r))||o);return a>3&&o&&Object.defineProperty(e,r,o),o};import{css as c,html as v}from"lit";import{customElement as b,property as h}from"lit/decorators.js";import{classMap as f}from"lit/directives/class-map.js";import{EspalierElementBase as d}from"../shared/esp-element-base.js";let s=class extends d{constructor(){super(...arguments),this.fullScreen=!1}render(){const{fullScreen:e}=this;return v`
2
2
  <div class=${f({"esp-box":!0,"full-screen":e})}>
3
3
  <div part="box">
4
4
  <slot></slot>
5
5
  </div>
6
6
  </div>
7
- `}};t.styles=[...d.styles,c`
7
+ `}};s.styles=[...d.styles,c`
8
8
  :host {
9
9
  display: block;
10
10
  }
@@ -12,7 +12,7 @@ var n=function(s,e,r,i){var a=arguments.length,o=a<3?e:i===null?i=Object.getOwnP
12
12
  .esp-box {
13
13
  background-color: var(--esp-color-box-background, var(--esp-color-layer-1));
14
14
  border-radius: var(--esp-size-border-radius);
15
- box-shadow: 1px 1px 4px var(--esp-color-shadow);
15
+ box-shadow: var(--esp-box-shadow, var(--esp-shadow-1, 1px 1px 4px var(--esp-color-shadow)));
16
16
  overflow: visible;
17
17
  position: relative;
18
18
  height: 100%;
@@ -61,4 +61,4 @@ var n=function(s,e,r,i){var a=arguments.length,o=a<3?e:i===null?i=Object.getOwnP
61
61
  }
62
62
  }
63
63
  }
64
- `],n([h({attribute:"full-screen",type:Boolean})],t.prototype,"fullScreen",void 0),t=n([v("esp-box")],t);export{t as EspalierBox};
64
+ `],n([h({attribute:"full-screen",type:Boolean})],s.prototype,"fullScreen",void 0),s=n([b("esp-box")],s);export{s as EspalierBox};
package/dist/index.d.ts CHANGED
@@ -21,6 +21,9 @@ export * from "./help/esp-help-button.js";
21
21
  export * from "./help/esp-help-provider.js";
22
22
  export * from "./header/index.js";
23
23
  export * from "./page/esp-page.js";
24
+ export * from "./section/esp-section.js";
25
+ export * from "./stack/esp-stack.js";
26
+ export * from "./row/esp-row.js";
24
27
  export * from "./popover/esp-popover.js";
25
28
  export * from "./dialog/esp-dialog.js";
26
29
  export * from "./empty-state/esp-empty-state.js";
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export*from"./box/esp-box.js";export*from"./action-menu/esp-action-menu.js";export*from"./action-menu/esp-action-menu-item.js";export*from"./avatar/esp-avatar.js";export*from"./avatar/esp-profile-chip.js";export*from"./badge/esp-badge.js";export*from"./checkbox/esp-checkbox.js";export*from"./checkbox/esp-checkbox-group.js";export*from"./data-cell/esp-data-cell.js";export*from"./radio-button/esp-radio-button.js";export*from"./radio-button/esp-radio-button-group.js";export*from"./repeater/esp-repeater.js";export*from"./breadcrumbs/esp-breadcrumbs.js";export*from"./button/esp-button.js";export*from"./button/esp-button-group.js";export*from"./color-picker/esp-color-picker.js";export*from"./flyout/esp-flyout.js";export*from"./form/esp-form.js";export*from"./form-item/esp-form-item.js";export*from"./help/esp-help-button.js";export*from"./help/esp-help-provider.js";export*from"./header/index.js";export*from"./page/esp-page.js";export*from"./popover/esp-popover.js";export*from"./dialog/esp-dialog.js";export*from"./empty-state/esp-empty-state.js";export*from"./image-upload/esp-image-upload.js";export*from"./file-upload/esp-file-upload.js";export*from"./font-picker/esp-font-picker.js";export*from"./focus-picker/esp-focus-picker.js";export*from"./footer/index.js";export*from"./grid/esp-grid.js";export*from"./image/esp-image.js";export*from"./image/image-focus.js";export*from"./lightbox/esp-lightbox.js";export*from"./info/esp-info.js";export*from"./input/esp-input.js";export*from"./textarea/esp-textarea.js";export*from"./pickers/esp-pick-one.js";export*from"./pickers/esp-pick-some.js";export*from"./pickers/esp-picker-menu.js";export*from"./pickers/esp-picker-item.js";export*from"./root/esp-root.js";export*from"./menu/index.js";export*from"./burger/esp-burger.js";export*from"./date-picker/esp-date-picker.js";export*from"./details/esp-details.js";export*from"./details/esp-details-group.js";export*from"./tabs/esp-tab.js";export*from"./tabs/esp-tab-group.js";export*from"./slider/esp-slider.js";export*from"./switch/esp-switch.js";export*from"./toaster/esp-toaster.js";export*from"./tooltip/esp-tooltip.js";export*from"./progress/esp-progress.js";export*from"./search/esp-search.js";export*from"./status-indicator/esp-status-indicator.js";export*from"./tree/esp-tree.js";export*from"./tree/esp-tree-item.js";import{DEFAULT_ICON_SPRITE_URL as xr,DEFAULT_ICON_VIEW_BOX as Tr,INTENT_VARIANTS as ar,normalizeIntentVariant as _r,getIconHref as Ar,getIconHrefForHost as Er,getIconSpriteUrl as lr}from"./shared/intent-values.js";import{EspalierElementBase as Ir}from"./shared/esp-element-base.js";import{VALIDITY_CHANGED_EVENT as sr}from"./shared/validation.js";import{FormFieldController as gr}from"./shared/form-field-controller.js";import{traverseToClosest as Fr}from"./shared/utilities.js";import{showToast as Nr}from"./shared/toast-events.js";import{showFlyout as hr,closeFlyout as Pr}from"./shared/flyout-events.js";import{requestHelp as ur}from"./shared/help-events.js";import{getEspBus as Ur}from"./shared/bus-events.js";export*from"./shared/events.js";import{getImageDetails as Hr,releasePreviewUrl as Vr}from"./image-upload/image-helpers.js";import{calculatePhotoLayout as Gr}from"./shared/justified-layout.js";import{encodeTheme as vr,parseTheme as yr,mergePartials as Wr,layerThemes as wr,validateThemePair as Br,buildTaprootLightTheme as Yr,buildTaprootDarkTheme as kr,NESTED_THEME_KEYS as qr}from"./shared/theme.js";import{auditDataPalette as Kr,generateSequentialRamp as Xr,generateDivergingRamp as jr,COLOR_VISION_SIMULATIONS as Jr,DATA_SERIES_KEYS as Qr,DEFAULT_DATA_PALETTE as Zr,DEFAULT_DATA_RAMP_STEPS as $r,DEFAULT_DIVERGING_NEUTRAL as ro,MAX_DATA_RAMP_STEPS as oo,MIN_DATA_COLOR_DISTANCE as eo,MIN_DATA_RAMP_LIGHTNESS_STEP as to,MIN_DATA_RAMP_STEPS as mo}from"./shared/data-colors.js";import{WEIGHT_LABELS as fo,extractWeights as xo,normalizeWeight as To,bestAvailableWeight as ao,extractFamily as _o,getFallbackFont as Ao}from"./shared/font-helpers.js";import{getGoogleFonts as lo}from"./font-picker/esp-font-picker.js";import{themeFitReport as Io,themeFitRows as So,printThemeFitReport as so}from"./shared/theme-fit-report.js";export{Jr as COLOR_VISION_SIMULATIONS,Qr as DATA_SERIES_KEYS,Zr as DEFAULT_DATA_PALETTE,$r as DEFAULT_DATA_RAMP_STEPS,ro as DEFAULT_DIVERGING_NEUTRAL,xr as DEFAULT_ICON_SPRITE_URL,Tr as DEFAULT_ICON_VIEW_BOX,Ir as EspalierElementBase,gr as FormFieldController,ar as INTENT_VARIANTS,oo as MAX_DATA_RAMP_STEPS,eo as MIN_DATA_COLOR_DISTANCE,to as MIN_DATA_RAMP_LIGHTNESS_STEP,mo as MIN_DATA_RAMP_STEPS,qr as NESTED_THEME_KEYS,sr as VALIDITY_CHANGED_EVENT,fo as WEIGHT_LABELS,Kr as auditDataPalette,ao as bestAvailableWeight,kr as buildTaprootDarkTheme,Yr as buildTaprootLightTheme,Gr as calculatePhotoLayout,Pr as closeFlyout,vr as encodeTheme,_o as extractFamily,xo as extractWeights,jr as generateDivergingRamp,Xr as generateSequentialRamp,Ur as getEspBus,Ao as getFallbackFont,lo as getGoogleFonts,Ar as getIconHref,Er as getIconHrefForHost,lr as getIconSpriteUrl,Hr as getImageDetails,wr as layerThemes,Wr as mergePartials,_r as normalizeIntentVariant,To as normalizeWeight,yr as parseTheme,so as printThemeFitReport,Vr as releasePreviewUrl,ur as requestHelp,hr as showFlyout,Nr as showToast,Io as themeFitReport,So as themeFitRows,Fr as traverseToClosest,Br as validateThemePair};
1
+ export*from"./box/esp-box.js";export*from"./action-menu/esp-action-menu.js";export*from"./action-menu/esp-action-menu-item.js";export*from"./avatar/esp-avatar.js";export*from"./avatar/esp-profile-chip.js";export*from"./badge/esp-badge.js";export*from"./checkbox/esp-checkbox.js";export*from"./checkbox/esp-checkbox-group.js";export*from"./data-cell/esp-data-cell.js";export*from"./radio-button/esp-radio-button.js";export*from"./radio-button/esp-radio-button-group.js";export*from"./repeater/esp-repeater.js";export*from"./breadcrumbs/esp-breadcrumbs.js";export*from"./button/esp-button.js";export*from"./button/esp-button-group.js";export*from"./color-picker/esp-color-picker.js";export*from"./flyout/esp-flyout.js";export*from"./form/esp-form.js";export*from"./form-item/esp-form-item.js";export*from"./help/esp-help-button.js";export*from"./help/esp-help-provider.js";export*from"./header/index.js";export*from"./page/esp-page.js";export*from"./section/esp-section.js";export*from"./stack/esp-stack.js";export*from"./row/esp-row.js";export*from"./popover/esp-popover.js";export*from"./dialog/esp-dialog.js";export*from"./empty-state/esp-empty-state.js";export*from"./image-upload/esp-image-upload.js";export*from"./file-upload/esp-file-upload.js";export*from"./font-picker/esp-font-picker.js";export*from"./focus-picker/esp-focus-picker.js";export*from"./footer/index.js";export*from"./grid/esp-grid.js";export*from"./image/esp-image.js";export*from"./image/image-focus.js";export*from"./lightbox/esp-lightbox.js";export*from"./info/esp-info.js";export*from"./input/esp-input.js";export*from"./textarea/esp-textarea.js";export*from"./pickers/esp-pick-one.js";export*from"./pickers/esp-pick-some.js";export*from"./pickers/esp-picker-menu.js";export*from"./pickers/esp-picker-item.js";export*from"./root/esp-root.js";export*from"./menu/index.js";export*from"./burger/esp-burger.js";export*from"./date-picker/esp-date-picker.js";export*from"./details/esp-details.js";export*from"./details/esp-details-group.js";export*from"./tabs/esp-tab.js";export*from"./tabs/esp-tab-group.js";export*from"./slider/esp-slider.js";export*from"./switch/esp-switch.js";export*from"./toaster/esp-toaster.js";export*from"./tooltip/esp-tooltip.js";export*from"./progress/esp-progress.js";export*from"./search/esp-search.js";export*from"./status-indicator/esp-status-indicator.js";export*from"./tree/esp-tree.js";export*from"./tree/esp-tree-item.js";import{DEFAULT_ICON_SPRITE_URL as _r,DEFAULT_ICON_VIEW_BOX as Ar,INTENT_VARIANTS as Er,normalizeIntentVariant as lr,getIconHref as ir,getIconHrefForHost as Ir,getIconSpriteUrl as Sr}from"./shared/intent-values.js";import{EspalierElementBase as Dr}from"./shared/esp-element-base.js";import{VALIDITY_CHANGED_EVENT as nr}from"./shared/validation.js";import{FormFieldController as Lr}from"./shared/form-field-controller.js";import{traverseToClosest as Rr}from"./shared/utilities.js";import{showToast as Pr}from"./shared/toast-events.js";import{showFlyout as ur,closeFlyout as Mr}from"./shared/flyout-events.js";import{requestHelp as Or}from"./shared/help-events.js";import{getEspBus as Hr}from"./shared/bus-events.js";export*from"./shared/events.js";import{getImageDetails as Gr,releasePreviewUrl as br}from"./image-upload/image-helpers.js";import{calculatePhotoLayout as yr}from"./shared/justified-layout.js";import{encodeTheme as wr,parseTheme as Br,mergePartials as Yr,layerThemes as kr,validateThemePair as qr,buildTaprootLightTheme as zr,buildTaprootDarkTheme as Kr,NESTED_THEME_KEYS as Xr}from"./shared/theme.js";import{auditDataPalette as Jr,generateSequentialRamp as Qr,generateDivergingRamp as Zr,COLOR_VISION_SIMULATIONS as $r,DATA_SERIES_KEYS as ro,DEFAULT_DATA_PALETTE as oo,DEFAULT_DATA_RAMP_STEPS as eo,DEFAULT_DIVERGING_NEUTRAL as to,MAX_DATA_RAMP_STEPS as mo,MIN_DATA_COLOR_DISTANCE as po,MIN_DATA_RAMP_LIGHTNESS_STEP as fo,MIN_DATA_RAMP_STEPS as xo}from"./shared/data-colors.js";import{WEIGHT_LABELS as ao,extractWeights as _o,normalizeWeight as Ao,bestAvailableWeight as Eo,extractFamily as lo,getFallbackFont as io}from"./shared/font-helpers.js";import{getGoogleFonts as So}from"./font-picker/esp-font-picker.js";import{themeFitReport as Do,themeFitRows as go,printThemeFitReport as no}from"./shared/theme-fit-report.js";export{$r as COLOR_VISION_SIMULATIONS,ro as DATA_SERIES_KEYS,oo as DEFAULT_DATA_PALETTE,eo as DEFAULT_DATA_RAMP_STEPS,to as DEFAULT_DIVERGING_NEUTRAL,_r as DEFAULT_ICON_SPRITE_URL,Ar as DEFAULT_ICON_VIEW_BOX,Dr as EspalierElementBase,Lr as FormFieldController,Er as INTENT_VARIANTS,mo as MAX_DATA_RAMP_STEPS,po as MIN_DATA_COLOR_DISTANCE,fo as MIN_DATA_RAMP_LIGHTNESS_STEP,xo as MIN_DATA_RAMP_STEPS,Xr as NESTED_THEME_KEYS,nr as VALIDITY_CHANGED_EVENT,ao as WEIGHT_LABELS,Jr as auditDataPalette,Eo as bestAvailableWeight,Kr as buildTaprootDarkTheme,zr as buildTaprootLightTheme,yr as calculatePhotoLayout,Mr as closeFlyout,wr as encodeTheme,lo as extractFamily,_o as extractWeights,Zr as generateDivergingRamp,Qr as generateSequentialRamp,Hr as getEspBus,io as getFallbackFont,So as getGoogleFonts,ir as getIconHref,Ir as getIconHrefForHost,Sr as getIconSpriteUrl,Gr as getImageDetails,kr as layerThemes,Yr as mergePartials,lr as normalizeIntentVariant,Ao as normalizeWeight,Br as parseTheme,no as printThemeFitReport,br as releasePreviewUrl,Or as requestHelp,ur as showFlyout,Pr as showToast,Do as themeFitReport,go as themeFitRows,Rr as traverseToClosest,qr as validateThemePair};
@@ -163,8 +163,13 @@ export interface PageWorkspaceResizeDetail {
163
163
  * while preview or in-grid help competes for space. Defaults to `30rem`.
164
164
  * @cssprop --esp-page-main-max-width - Maximum width of the main content well.
165
165
  * Defaults from `kind`: `1536px` (wide), `768px` (narrow), or unbounded (full).
166
- * An explicit value overrides every kind default, including `full`. Surplus
167
- * width beyond it becomes canvas gutters.
166
+ * An explicit value overrides every kind default, including `full`
167
+ * except `site`, whose main region is always unbounded because sections
168
+ * own their wells.
169
+ * Surplus width beyond it becomes canvas gutters.
170
+ * @cssprop --esp-page-well-max-width - The shared content-column width in
171
+ * `kind="site"`: the header and footer alignment contract and every
172
+ * `esp-section` well default to it. Defaults to `72rem`.
168
173
  * @cssprop --esp-page-max-width - Legacy fallback for
169
174
  * `--esp-page-main-max-width`.
170
175
  * @cssprop --esp-page-background-image - The background image to
@@ -439,14 +444,24 @@ export declare class EspalierPage extends EspalierElementBase {
439
444
  * - `wide` (default) — constrains the main content well to 1536px.
440
445
  * Optimized for high-density dashboards and complex data grids.
441
446
  * - `narrow` — constrains the main content well to 768px and applies
442
- * a `max-inline-size: 66ch` reading measure. Optimized for
443
- * long-form reading content.
447
+ * a `max-inline-size: var(--esp-measure, 66ch)` reading measure.
448
+ * Optimized for long-form reading content.
444
449
  * - `full` — no max-width constraint unless
445
450
  * `--esp-page-main-max-width` is explicitly configured. Optimized for
446
451
  * immersive canvases like maps or design tools and finite authoring
447
452
  * workspaces that opt back into a cap.
453
+ * - `site` — the marketing-page shell (ESP0174): the main region
454
+ * always spans the full viewport width with no gutters, so slotted
455
+ * `esp-section` bands run edge to edge and center their own wells.
456
+ * The header and footer alignment contract is published from
457
+ * `--esp-page-well-max-width` instead of a main cap, so bar
458
+ * content, section wells, and footer content share one column.
459
+ * The sidebar/right rail slots are unsupported in this kind (a
460
+ * rail would offset the sections while the chrome keeps centering
461
+ * on the viewport, splitting the shared column) — a populated rail
462
+ * warns once.
448
463
  */
449
- kind: "wide" | "narrow" | "full";
464
+ kind: "wide" | "narrow" | "full" | "site";
450
465
  /**
451
466
  * Horizontal alignment of the content **surface** (left aside + main
452
467
  * well + right aside) within the page once the viewport is wider than
@@ -461,8 +476,9 @@ export declare class EspalierPage extends EspalierElementBase {
461
476
  * - `end` — the surface hugs the trailing edge; spare width collects in
462
477
  * the leading gutter.
463
478
  *
464
- * Has no effect when an unconfigured `kind="full"` leaves main unbounded,
465
- * or on viewports narrower than the complete visible workspace cap.
479
+ * Has no effect when an unconfigured `kind="full"` or `kind="site"`
480
+ * leaves main unbounded, or on viewports narrower than the complete
481
+ * visible workspace cap.
466
482
  */
467
483
  align: "start" | "center" | "end";
468
484
  /**
@@ -1,4 +1,4 @@
1
- var M=function(q,e,t,i){var a=arguments.length,s=a<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(q,e,t,i);else for(var r=q.length-1;r>=0;r--)(o=q[r])&&(s=(a<3?o(s):a>3?o(e,t,s):o(e,t))||s);return a>3&&s&&Object.defineProperty(e,t,s),s};import{css as re,html as oe,nothing as ee}from"lit";import{customElement as ne,property as _,state as H}from"lit/decorators.js";import{classMap as le}from"lit/directives/class-map.js";import{createRef as R,ref as z}from"lit/directives/ref.js";import{EspalierElementBase as te}from"../shared/esp-element-base.js";import{BiDirectionalStickyController as N}from"./bi-directional-sticky-controller.js";import{getEspBus as pe}from"../shared/bus-events.js";import{RafThrottle as ie}from"../shared/raf-throttle.js";import{InlineBounds as he,PaneProbes as j,probeWidth as de,WidthRange as G}from"./workspace-width.js";import{slotHasContent as ce}from"../shared/slot-content.js";import"../toaster/esp-toaster.js";const ae='esp-footer, footer, [role~="contentinfo"]',ue="(max-width: 50em)",l=1,ge=5,me=12,ve=48,we=48,fe=16,ye=64,be=250,ke=250,We=40;let x=class extends te{constructor(){super(),this.dialogZone=R(),this.flyoutSlot=R(),this.footerSlot=R(),this.previewSlot=R(),this.previewSpace=R(),this.previewMinWidthProbe=R(),this.previewDefaultWidthProbe=R(),this.previewMaxWidthProbe=R(),this.previewProbes=new j(this.previewMinWidthProbe,this.previewDefaultWidthProbe,this.previewMaxWidthProbe),this.flyoutMinWidthProbe=R(),this.flyoutDefaultWidthProbe=R(),this.flyoutMaxWidthProbe=R(),this.flyoutProbes=new j(this.flyoutMinWidthProbe,this.flyoutDefaultWidthProbe,this.flyoutMaxWidthProbe),this.mainMinWidthProbe=R(),this.mainConfiguredMaxWidthProbe=R(),this.mainMaxWidthProbe=R(),this.mainProbes=new j(this.mainMinWidthProbe,this.mainMaxWidthProbe,this.mainMaxWidthProbe),this.resizeStepProbe=R(),this.resizeLargeStepProbe=R(),this.previewObservedWidths=new WeakMap,this.previewSyncFrame=new ie(()=>this.runScheduledPreviewLayout()),this.previewSyncGeneration=0,this.previewSyncTask=Promise.resolve(),this.previewOverlayRecoveryRequested=!1,this.previewHeader=null,this.previewMenu=null,this.previewCollapsedSidebarWidth=0,this.previewNavigationCollapseTask=null,this.flyoutOverlayPromotionWidth=null,this.flyoutOverlayRecoveryReady=!1,this.flyoutOverlayRecoveryGeneration=0,this.preferredPreviewWidth=null,this.preferredFlyoutWidth=null,this.flyoutFullHeightActive=!1,this.resizeSession=null,this.workspaceKeyboardSettlementTimer=null,this.workspaceRecenteringFrame=new ie(()=>this.applyWorkspaceRecentering()),this.pendingRecenterLeading=0,this.workspaceRecenteringTimer=null,this.footerWrapperIsLandmark=!0,this.allocatedPreviewWidth=0,this.allocatedFlyoutWidth=0,this.onWorkspaceResizePointerDown=(e,t)=>{if(t.button!==0||!this.separatorIsAvailable(e))return;const i=t.currentTarget,a=this.shadowRoot?.querySelector(".esp-page-main")?.getBoundingClientRect().width??0,s=this.renderedWorkspaceWidths();this.endWorkspaceResize(),this.finishWorkspaceKeyboardResize(!1),this.suspendPreviewLayoutForWorkspaceResize();const o=i.getBoundingClientRect(),r=this.holdWorkspacePosition();this.toggleAttribute("data-workspace-resizing",!0);const{leading:n,trailing:d}=this.workspaceLogicalGutterWidths(),m=d>l?n+d:0,h=d>l?Math.max(1,m/d):1;this.resizeSession={separator:e,pointerId:t.pointerId,target:i,startClientX:t.clientX,startPreviewWidth:s.previewWidth,startFlyoutWidth:s.flyoutWidth,startMainWidth:a,startNavigationAllowance:this.previewNavigationResizeAllowance(),startOuterGrowthCapacity:m,trailingExpansionScale:h,trailingGroupPushDelta:0,startHandleClientX:o.left+o.width/2,startLeadingGutterWidth:r,heldLeadingGutterWidth:r,direction:this.workspaceResizeDirection()};try{i.setPointerCapture?.(t.pointerId)}catch{}t.preventDefault()},this.onWorkspaceResizePointerMove=e=>{const t=this.resizeSession;if(!t||t.pointerId!==e.pointerId)return;e.preventDefault();const i=e.clientX-t.startClientX,a=i*t.direction,s=t.separator==="main-preview"||t.separator==="preview-flyout"&&!this.previewVisible;t.trailingGroupPushDelta=s&&a>0?Math.min(a,t.startOuterGrowthCapacity/t.trailingExpansionScale,this.mainResizeGrowthCapacity(t.startMainWidth)):0,this.applyWorkspaceResize(t.separator,i,"pointer",t.startPreviewWidth,t.startFlyoutWidth,t.startMainWidth,t.startNavigationAllowance,t.startOuterGrowthCapacity,t.trailingExpansionScale,t.direction),this.align!=="start"&&!this.seedWorkspaceResizeLeadingGutter(t)&&this.trackWorkspaceResizePointer(t)},this.onWorkspaceResizePointerEnd=e=>{!this.resizeSession||this.resizeSession.pointerId!==e.pointerId||(e.preventDefault(),this.endWorkspaceResize())},this.onWorkspaceResizeBlur=e=>{this.hasAttribute("data-workspace-keyboard-adjusting")&&(e.relatedTarget instanceof Element&&e.relatedTarget.classList.contains("esp-page-workspace-resize-handle")||this.finishWorkspaceKeyboardResize())},this.onWorkspaceResizeKeyDown=(e,t)=>{if(t.key!=="ArrowLeft"&&t.key!=="ArrowRight"||!this.separatorIsAvailable(e))return;t.preventDefault(),this.hasAttribute("data-workspace-keyboard-adjusting")||this.suspendPreviewLayoutForWorkspaceResize();const i=(t.key==="ArrowLeft"?-1:1)*this.resizeStep(t.shiftKey),a=this.shadowRoot?.querySelector(".esp-page-main")?.getBoundingClientRect().width??0,s=this.renderedWorkspaceWidths();this.applyWorkspaceResize(e,i,"keyboard",s.previewWidth,s.flyoutWidth,a,this.previewNavigationResizeAllowance(),(()=>{const o=this.workspaceLogicalGutterWidths();return o.leading+o.trailing})(),1,this.workspaceResizeDirection())},this.schedulePreviewLayout=(e=!1)=>{!this.isConnected||!this.hasUpdated||(this.previewOverlayRecoveryRequested||=e===!0,!(this.resizeSession||this.hasAttribute("data-workspace-keyboard-adjusting")||this.hasAttribute("data-workspace-position-held"))&&(this.previewSyncGeneration+=1,this.previewSyncFrame.restart()))},this.onPreviewMediaChange=()=>this.schedulePreviewLayout(!0),this.onPreviewResize=e=>{let t=!1;for(const i of e){const a=i.contentRect.width;if(i.target instanceof HTMLElement&&i.target.classList.contains("esp-page-left")){a>l&&!this.hasAttribute("data-preview-navigation-collapsed")&&(this.previewCollapsedSidebarWidth=a);continue}const s=this.previewObservedWidths.get(i.target);this.previewObservedWidths.set(i.target,a),t||=s===void 0||Math.abs(s-a)>.25}t&&this.schedulePreviewLayout(!0)},this.kind="wide",this.align="start",this.contained=!1,this.headerPosition="normal",this.fixedMenus=!1,this.previewOpen=!1,this.previewLabel="Preview",this.previewCollapseSidebar=!1,this.workspaceResizable=!1,this.previewVisible=!1,this.previewReclaiming=!1,new N(this,".esp-page-left > .sticky-wrapper"),new N(this,".esp-page-right > .sticky-wrapper"),new N(this,".esp-page-flyout > .sticky-wrapper",{topOffset:()=>this.flyoutFullHeightActive?0:void 0}),new N(this,".esp-page-preview > .sticky-wrapper",{topOffset:()=>0}),this.addEventListener("flyout-state-changed",e=>this.syncFlyoutState(e))}connectedCallback(){const e=Array.from(this.children).filter(t=>t.getAttribute("slot")==="footer");this.footerWrapperIsLandmark=!e.some(t=>this.footerElementProvidesLandmark(t)),super.connectedCallback(),this.syncMainMaximumConfiguration(),this.hasUpdated&&queueMicrotask(()=>this.setupPreviewLayoutObserver())}disconnectedCallback(){this.finishWorkspaceKeyboardResize(!1),this.endWorkspaceResize(),this.clearWorkspaceRecenteringState(),this.previewResizeObserver?.disconnect(),this.previewResizeObserver=void 0,this.previewMediaQuery?.removeEventListener("change",this.onPreviewMediaChange),this.previewMediaQuery=void 0,this.previewSyncFrame.cancel(),this.previewSyncGeneration+=1,this.previewOverlayRecoveryRequested=!1,this.toggleAttribute("data-preview-measuring",!1),this.toggleAttribute("data-preview-validating",!1),this.toggleAttribute("data-workspace-keyboard-adjusting",!1),this.toggleAttribute("descendant-flyout-overlay-open",!1),this.clearFlyoutOverlayRecovery(),this.setPreviewLayoutState(!1,!1),this.setWorkspaceWidths(0,0),this.preferredPreviewWidth=null,this.preferredFlyoutWidth=null,this.previewNavigationCollapseTask=null,this.setPreviewNavigationCollapse(!1),super.disconnectedCallback()}syncFlyoutState(e){if(e&&e.target?.closest?.("esp-page")!==this){this.syncDescendantFlyoutOverlayState();return}const t=r=>{const n=r;return(typeof n.mode=="string"?n.mode:r.getAttribute("mode"))==="overlay"||n.pageOverlayRequested===!0},i=r=>{const n=r.open;return typeof n=="boolean"?n:r.hasAttribute("open")},a=r=>r.anchor!=null,s=r=>{const n=r.fullHeight;return typeof n=="boolean"?n:r.hasAttribute("full-height")},o=(this.flyoutSlot.value?.assignedElements()??[]).filter(r=>r.tagName==="ESP-FLYOUT");for(const r of o){const n=r,d=typeof n.mode=="string"?n.mode:r.getAttribute("mode");n.pageOverlayRequested&&(!i(r)||d!=="auto")&&(n.pageOverlayRequested=!1)}o.some(r=>r.pageOverlayRequested===!0)||this.clearFlyoutOverlayRecovery(),this.toggleAttribute("flyout-open",o.some(r=>i(r)&&!t(r))),this.toggleAttribute("flyout-overlay-open",o.some(r=>i(r)&&t(r))),this.toggleAttribute("flyout-anchored",o.some(r=>i(r)&&a(r))),this.flyoutFullHeightActive=o.some(r=>i(r)&&!t(r)&&s(r)),this.toggleAttribute("flyout-full-height",this.flyoutFullHeightActive),this.resizeSession&&(this.hasAttribute("flyout-overlay-open")||this.resizeSession.separator==="preview-flyout"&&!this.hasAttribute("flyout-open"))&&this.endWorkspaceResize(),this.requestUpdate(),this.schedulePreviewLayout()}syncDescendantFlyoutOverlayState(){const e=Array.from(this.querySelectorAll("esp-flyout")).some(t=>{if(t.closest("esp-page")===this)return!1;const i=t,a=typeof i.open=="boolean"?i.open:t.hasAttribute("open"),s=typeof i.mode=="string"?i.mode:t.getAttribute("mode");return a&&(s==="overlay"||i.pageOverlayRequested===!0||t.getAttribute("aria-modal")==="true")});this.toggleAttribute("descendant-flyout-overlay-open",e)}assignedFlyouts(){return(this.flyoutSlot.value?.assignedElements()??[]).filter(e=>e.tagName==="ESP-FLYOUT")}openAutoFlyouts(){return this.assignedFlyouts().filter(e=>{const t=typeof e.open=="boolean"?e.open:e.hasAttribute("open"),i=typeof e.mode=="string"?e.mode:e.getAttribute("mode");return t&&i!=="overlay"})}async setPageFlyoutOverlay(e){let t=!1;const i=new Set(this.openAutoFlyouts());for(const a of this.assignedFlyouts()){const s=e&&i.has(a);a.pageOverlayRequested!==s&&(a.pageOverlayRequested=s,t=!0)}return t&&await Promise.all(this.assignedFlyouts().map(a=>a.updateComplete??Promise.resolve())),e||this.clearFlyoutOverlayRecovery(),t}clearFlyoutOverlayRecovery(){this.flyoutOverlayPromotionWidth=null,this.flyoutOverlayRecoveryReady=!1,this.flyoutOverlayRecoveryGeneration+=1}armFlyoutOverlayRecovery(){const e=++this.flyoutOverlayRecoveryGeneration;this.flyoutOverlayRecoveryReady=!1,requestAnimationFrame(()=>{requestAnimationFrame(()=>{e!==this.flyoutOverlayRecoveryGeneration||!this.openAutoFlyouts().some(t=>t.pageOverlayRequested===!0)||(this.flyoutOverlayPromotionWidth=this.visiblePageInlineBounds().width,this.flyoutOverlayRecoveryReady=!0)})})}previewHasContent(){const e=this.previewSlot.value;return e?ce(e):Array.from(this.childNodes).some(t=>t instanceof Element&&t.getAttribute("slot")==="preview"&&!t.hasAttribute("hidden"))}getPreviewNavigationPair(){if(!this.previewCollapseSidebar)return null;const e=Array.from(this.children),t=e.find(o=>o.slot==="header"&&o.tagName==="ESP-HEADER"),i=e.find(o=>o.slot==="sidebar"&&o.tagName==="ESP-MENU");if(!t||!i||!i.id)return null;const a=typeof t.drawerTarget=="string"?t.drawerTarget:t.getAttribute("drawer-target")??"",s=typeof i.mode=="string"?i.mode:i.getAttribute("mode");return a!==i.id||s!=="vertical"||!("previewCollapseRequested"in t)||!("previewCollapseRequested"in i)?null:{header:t,menu:i}}async setPreviewNavigationCollapse(e){const t=e?this.getPreviewNavigationPair():null,i=t!==null&&this.previewHeader===t.header&&this.previewMenu===t.menu,a=this.previewHeader&&this.previewHeader!==t?.header?this.previewHeader:null,s=this.previewMenu&&this.previewMenu!==t?.menu?this.previewMenu:null;if(a&&(a.previewCollapseRequested=!1),s&&(s.previewCollapseRequested=!1),this.previewHeader=t?.header??null,this.previewMenu=t?.menu??null,this.toggleAttribute("data-preview-navigation-collapsed",!1),await a?.updateComplete,await s?.updateComplete,!t)return!1;const o=i?this.previewCollapsedSidebarWidth:this.shadowRoot?.querySelector(".esp-page-left")?.getBoundingClientRect().width??0;return t.header.previewCollapseRequested=!0,t.menu.previewCollapseRequested=!0,await t.header.updateComplete,await t.menu.updateComplete,t.menu.hasExternalDrawerControl===!0?(this.previewCollapsedSidebarWidth=o,this.toggleAttribute("data-preview-navigation-collapsed",!0),!0):(t.header.previewCollapseRequested=!1,t.menu.previewCollapseRequested=!1,await t.header.updateComplete,await t.menu.updateComplete,this.previewHeader=null,this.previewMenu=null,!1)}requestPreviewNavigationCollapse(){if(this.hasAttribute("data-preview-navigation-collapsed")||this.previewNavigationCollapseTask)return;const e=this.setPreviewNavigationCollapse(!0);this.previewNavigationCollapseTask=e,e.then(()=>{this.previewNavigationCollapseTask===e&&(this.previewNavigationCollapseTask=null)},()=>{this.previewNavigationCollapseTask===e&&(this.previewNavigationCollapseTask=null)})}scheduleWorkspaceSettlement(e=null){const t=()=>{this.schedulePreviewLayout(),e&&requestAnimationFrame(()=>{this.previewSyncTask.then(()=>{const s=this.shadowRoot?.activeElement,o=this.ownerDocument.activeElement;!this.isConnected||!e.isConnected||s&&s!==e||o!==this&&o!==this.ownerDocument.body||getComputedStyle(e).display!=="none"&&e.focus({preventScroll:!0})})})},i=this.previewNavigationCollapseTask;if(!i){t();return}i.then(()=>t(),()=>t())}clearWorkspaceKeyboardSettlementTimer(){this.workspaceKeyboardSettlementTimer!==null&&(clearTimeout(this.workspaceKeyboardSettlementTimer),this.workspaceKeyboardSettlementTimer=null)}finishWorkspaceKeyboardResize(e=!0){this.clearWorkspaceKeyboardSettlementTimer();const t=this.hasAttribute("data-workspace-keyboard-adjusting");this.toggleAttribute("data-workspace-keyboard-adjusting",!1),t&&e&&!this.resizeSession&&this.scheduleWorkspaceSettlement()}deferWorkspaceKeyboardSettlement(){this.clearWorkspaceKeyboardSettlementTimer(),this.workspaceKeyboardSettlementTimer=setTimeout(()=>{if(this.workspaceKeyboardSettlementTimer=null,!this.hasAttribute("data-workspace-keyboard-adjusting"))return;const e=this.shadowRoot?.activeElement,t=e instanceof HTMLElement&&e.classList.contains("esp-page-workspace-resize-handle")?e:null;this.toggleAttribute("data-workspace-keyboard-adjusting",!1),this.resizeSession||this.scheduleWorkspaceSettlement(t)},be)}suspendPreviewLayoutForWorkspaceResize(){this.previewSyncFrame.cancel(),this.previewSyncGeneration+=1,this.toggleAttribute("data-preview-measuring",!1),this.toggleAttribute("data-preview-validating",!1)}setPreviewLayoutState(e,t){this.previewVisible=e,this.previewReclaiming=e&&t,e||this.endWorkspaceResize()}setWorkspaceWidths(e,t,i=!1){const a=Math.max(0,e),s=Math.max(0,t);this.style.setProperty("--_esp-page-preview-used-width",`${a}px`),this.style.setProperty("--_esp-page-flyout-used-width",`${s}px`),this.toggleAttribute("data-workspace-targeted",i),this.allocatedPreviewWidth=a,this.allocatedFlyoutWidth=s}clampWidth(e,t,i){return G.of(t,i).clamp(e)}visiblePageInlineBounds(){const e=this.getBoundingClientRect();let t=e.left,i=e.right;const a=window.visualViewport,s=a?.offsetLeft??0,o=a?.width??document.documentElement.clientWidth;o>0&&(t=Math.max(t,s),i=Math.min(i,s+o));const r=this.getRootNode();let n=this.parentElement??(r instanceof ShadowRoot?r.host:null);for(;n;){const d=getComputedStyle(n).overflowX;if(["auto","clip","hidden","scroll"].includes(d)){const h=n.getBoundingClientRect();t=Math.max(t,h.left),i=Math.min(i,h.right)}const m=n.getRootNode();n=n.parentElement??(m instanceof ShadowRoot?m.host:null)}return new he(t,i)}probeWidth(e){return de(e)}optionalWidth(e,t){return getComputedStyle(this).getPropertyValue(e).trim()===""?null:this.probeWidth(t)}syncMainMaximumConfiguration(){const e=getComputedStyle(this).getPropertyValue("--esp-page-main-max-width").trim()!=="";this.toggleAttribute("data-main-max-configured",e)}workspaceWidthCapacity(e,t,i=0){const a=this.shadowRoot?.querySelector(".esp-page-left")?.getBoundingClientRect().width??0,s=this.shadowRoot?.querySelector(".esp-page-right")?.getBoundingClientRect().width??0,o=Math.max(0,this.visiblePageInlineBounds().width-a-s-Math.max(0,i));return this.workspaceWidthCapacityForAvailable(o,e,t)}workspaceWidthCapacityForAvailable(e,t,i){const a=Math.max(0,e),s=i>0?Math.min(a,i):a;return{natural:Math.max(0,a-s),maximum:Math.max(0,a-Math.max(0,t))}}workspaceTargetWidth(e,t,i){return Math.min(e.maximum,Math.max(t,i,e.natural))}allocateWorkspaceWidths(e,t,i,a,s,o,r,n=null,d=null){const m=Math.max(0,e),h=Math.max(0,a),u=Math.max(h,s),y=Math.max(0,o),W=Math.max(y,r),v=t?this.preferredPreviewWidth??(n===null?null:this.clampWidth(n,h,u)):null,w=i?this.preferredFlyoutWidth??(d===null?null:this.clampWidth(d,y,W)):null;let c=0,p=0;t&&i?(c=Math.min(u,Math.max(h,m-y)),p=Math.min(W,Math.max(y,m-c))):t?c=Math.min(u,Math.max(h,m)):i&&(p=Math.min(W,Math.max(y,m))),t&&v!==null&&(c=this.clampWidth(v,h,u),i&&w===null&&(p=this.clampWidth(m-c,y,W))),i&&w!==null&&(p=this.clampWidth(w,y,W),t&&v===null&&(c=this.clampWidth(m-p,h,u)));let b=c+p-m;if(b>0&&i){const P=Math.min(b,Math.max(0,p-y));p-=P,b-=P}return b>0&&t&&(c-=Math.min(b,Math.max(0,c-h))),{previewWidth:c,flyoutWidth:p}}workspaceResizeDirection(){return getComputedStyle(this).direction==="rtl"?-1:1}trailingWorkspaceSeparator(){return this.hasAttribute("flyout-open")&&!this.hasAttribute("flyout-overlay-open")?"flyout-end":this.previewVisible?"preview-end":null}trailingWorkspacePane(){const e=this.trailingWorkspaceSeparator()==="flyout-end"?".esp-page-flyout":this.trailingWorkspaceSeparator()==="preview-end"?".esp-page-preview":null;return e?this.shadowRoot?.querySelector(e)??null:null}workspaceLogicalGutterWidths(){const e=Math.max(0,this.shadowRoot?.querySelector(".esp-page-canvas--left")?.getBoundingClientRect().width??0),t=this.trailingWorkspacePane();if(!t)return{leading:e,trailing:0};const i=this.visiblePageInlineBounds(),a=t.getBoundingClientRect(),s=this.workspaceResizeDirection()===1?i.right-a.right:a.left-i.left;return{leading:e,trailing:Math.max(0,s)}}syncTrailingWorkspaceResizeAvailability(){const{trailing:e}=this.workspaceLogicalGutterWidths();this.toggleAttribute("data-workspace-trailing-edge-exposed",this.trailingWorkspaceSeparator()!==null&&e>l)}trailingPaneResizeRange(e,t,i){const a=e==="preview-end"?this.previewMinWidthProbe:this.flyoutMinWidthProbe,s=e==="preview-end"?this.previewMaxWidthProbe:this.flyoutMaxWidthProbe,o=Math.max(0,this.probeWidth(a)),r=Math.max(o,this.probeWidth(s));return G.of(o,r).cappedAt(Math.max(0,t)+Math.max(0,i))}resizeStep(e){const t=this.probeWidth(e?this.resizeLargeStepProbe:this.resizeStepProbe);return t>0?t:e?ye:fe}previewNavigationResizeAllowance(){if(this.hasAttribute("data-preview-navigation-collapsed")||this.getPreviewNavigationPair()===null)return 0;const e=Math.max(0,this.shadowRoot?.querySelector(".esp-page-left")?.getBoundingClientRect().width??0);return e>l&&(this.previewCollapsedSidebarWidth=e),e>l?e:this.previewCollapsedSidebarWidth}renderedWorkspaceWidths(){const e=this.shadowRoot?.querySelector(".esp-page-preview"),t=this.shadowRoot?.querySelector(".esp-page-flyout");return{previewWidth:this.allocatedPreviewWidth>0?this.allocatedPreviewWidth:e?.getBoundingClientRect().width??0,flyoutWidth:this.allocatedFlyoutWidth>0?this.allocatedFlyoutWidth:t?.getBoundingClientRect().width??0}}mainPreviewResizeRange(e=this.renderedWorkspaceWidths().previewWidth,t=this.shadowRoot?.querySelector(".esp-page-main")?.getBoundingClientRect().width??0,i=this.previewNavigationResizeAllowance()){const a=this.previewProbes.minimum,s=this.previewProbes.maximum,o=this.mainProbes.minimum,r=Math.max(0,t+e),n=Math.max(0,r+i-o);return G.of(a,Math.max(a,Math.min(s,n)))}previewFlyoutResizeRange(e=this.renderedWorkspaceWidths().previewWidth,t=this.renderedWorkspaceWidths().flyoutWidth){const i=this.previewProbes.minimum,a=this.previewProbes.maximum,s=this.flyoutProbes.minimum,o=this.flyoutProbes.maximum,r=e+t;return G.of(Math.max(i,r-o),Math.max(i,Math.min(a,r-s)))}separatorIsAvailable(e){return!this.workspaceResizable||this.hasAttribute("flyout-overlay-open")?!1:e==="main-preview"?this.previewVisible:e==="preview-end"||e==="flyout-end"?this.trailingWorkspaceSeparator()===e&&(this.hasAttribute("data-workspace-trailing-edge-exposed")||this.hasAttribute("data-workspace-position-held")||this.hasAttribute("data-workspace-keyboard-adjusting")):this.hasAttribute("flyout-open")}flyoutOnlyResizeRange(e=this.renderedWorkspaceWidths().flyoutWidth,t=this.shadowRoot?.querySelector(".esp-page-main")?.getBoundingClientRect().width??0){const i=this.flyoutProbes.minimum,a=this.flyoutProbes.maximum,s=this.mainProbes.minimum,o=this.probeWidth(this.mainMaxWidthProbe),r=Math.max(0,t+e),n=o>0?Math.max(0,r-o):0,d=Math.max(i,n);return G.of(d,Math.min(a,r-s))}mainResizeGrowthCapacity(e){return this.kind==="full"&&!this.hasAttribute("data-main-max-configured")?Number.POSITIVE_INFINITY:Math.max(0,this.probeWidth(this.mainMaxWidthProbe)-e)}applyWorkspaceResize(e,t,i,a,s,o,r,n,d,m){if(!this.separatorIsAvailable(e))return;const h=t*m,u=n/d,y=e==="main-preview"||e==="preview-flyout"&&!this.previewVisible,W=i==="pointer"&&y&&h>0?Math.min(h,u,this.mainResizeGrowthCapacity(o)):0;let v=e,w=a,c=s;if(e==="preview-end"||e==="flyout-end"){const p=e==="preview-end"?a:s,b=this.trailingPaneResizeRange(e,p,n),P=p+(h>0?h*d:h),C=b.clamp(P);e==="preview-end"?(w=C,this.preferredPreviewWidth=C):(c=C,this.preferredFlyoutWidth=C)}else if(e==="main-preview"){const p=this.mainPreviewResizeRange(a,o,r),b=a-(h-W);w=p.clamp(b),this.preferredPreviewWidth=w;const P=this.mainProbes.minimum,C=this.probeWidth(this.mainMaxWidthProbe),k=this.kind==="full"&&!this.hasAttribute("data-main-max-configured")?0:C,g=this.workspaceWidthCapacity(P,k);r>0&&w+c>g.natural+l&&this.requestPreviewNavigationCollapse();const F=this.previewProbes.minimum,A=Math.max(0,F-b),O=p.min<=F+l;if(A>0&&O&&s>0){const E=this.flyoutProbes.minimum,L=this.flyoutProbes.maximum;c=this.clampWidth(s-A,E,L),this.preferredFlyoutWidth=c}else s>0&&(this.preferredFlyoutWidth??=s)}else if(!this.previewVisible)v="main-flyout",c=this.flyoutOnlyResizeRange(s,o).clamp(s-(h-W)),w=0,this.preferredFlyoutWidth=c;else{const p=this.previewProbes.minimum,b=this.previewProbes.maximum,P=this.flyoutProbes.minimum,C=this.flyoutProbes.maximum;if(h>=0){const k=Math.max(0,s-P),g=Math.min(h,u),F=Math.max(0,h-g),A=g*d+F,O=k+n;w=this.clampWidth(a+A,p,Math.min(b,a+O));const E=Math.max(0,w-a),L=Math.min(E,n);c=s-Math.min(Math.max(0,E-L),k)}else{const k=this.previewFlyoutResizeRange(a,s),g=a+h;w=k.clamp(g),c=a+s-w;const F=Math.max(0,p-g),A=k.min<=p+l;if(F>0&&A){const O=this.mainProbes.minimum,E=Math.max(0,o-O);c=this.clampWidth(c+Math.min(F,E),P,C)}}this.preferredPreviewWidth=w,this.preferredFlyoutWidth=c}this.setWorkspaceWidths(w,c,!0),this.requestUpdate(),this.previewVisible&&this.setPreviewLayoutState(!0,!0),i==="keyboard"&&(this.toggleAttribute("data-workspace-keyboard-adjusting",!0),this.deferWorkspaceKeyboardSettlement()),this.dispatchEvent(new CustomEvent("esp-page-workspace-resize",{bubbles:!0,composed:!0,detail:{separator:v,source:i,previewWidth:w,flyoutWidth:c}}))}appliedSeparatorInlineDelta(e){if(e.separator==="preview-end"){const a=this.allocatedPreviewWidth-e.startPreviewWidth;return a>0?a/e.trailingExpansionScale:a}if(e.separator==="flyout-end"){const a=this.allocatedFlyoutWidth-e.startFlyoutWidth;return a>0?a/e.trailingExpansionScale:a}if(e.separator==="main-preview")return e.trailingGroupPushDelta+e.startPreviewWidth-this.allocatedPreviewWidth+(e.startFlyoutWidth-this.allocatedFlyoutWidth);const t=e.startFlyoutWidth-this.allocatedFlyoutWidth;if(!this.previewVisible)return e.trailingGroupPushDelta+t;if(this.allocatedPreviewWidth<e.startPreviewWidth)return t;const i=Math.max(0,this.allocatedPreviewWidth+this.allocatedFlyoutWidth-e.startPreviewWidth-e.startFlyoutWidth);return t+i/e.trailingExpansionScale}clearWorkspaceRecenteringState(){this.workspaceRecenteringFrame.cancel(),this.workspaceRecenteringTimer!==null&&(clearTimeout(this.workspaceRecenteringTimer),this.workspaceRecenteringTimer=null),this.toggleAttribute("data-workspace-position-held",!1),this.style.removeProperty("--_esp-page-resize-leading-gutter-width")}holdWorkspacePosition(){const e=this.workspaceLogicalGutterWidths().leading;return this.clearWorkspaceRecenteringState(),this.style.setProperty("--_esp-page-resize-leading-gutter-width",`${e}px`),this.toggleAttribute("data-workspace-position-held",!0),e}trackWorkspaceResizePointer(e){const t=e.startHandleClientX+this.appliedSeparatorInlineDelta(e)*e.direction;for(let i=0;i<3;i+=1){const a=e.target.getBoundingClientRect(),s=a.left+a.width/2,o=(t-s)*e.direction;if(Math.abs(o)<=.25)return;const r=Math.max(0,e.heldLeadingGutterWidth+o);if(Math.abs(r-e.heldLeadingGutterWidth)<=.25)return;e.heldLeadingGutterWidth=r,this.style.setProperty("--_esp-page-resize-leading-gutter-width",`${e.heldLeadingGutterWidth}px`)}}seedWorkspaceResizeLeadingGutter(e){if(this.align==="start")return!1;const t=this.appliedSeparatorInlineDelta(e);if(t<=0)return!1;let i=0;if(e.separator==="preview-end"||e.separator==="flyout-end")i=this.allocatedPreviewWidth-e.startPreviewWidth+this.allocatedFlyoutWidth-e.startFlyoutWidth;else if(e.separator==="preview-flyout"&&this.previewVisible)i=this.allocatedPreviewWidth-e.startPreviewWidth;else{const a=Math.max(0,e.startPreviewWidth-this.allocatedPreviewWidth+e.startFlyoutWidth-this.allocatedFlyoutWidth),s=this.probeWidth(this.mainMaxWidthProbe),o=this.kind==="full"&&!this.hasAttribute("data-main-max-configured")?Number.POSITIVE_INFINITY:Math.max(0,s-e.startMainWidth);i=Math.min(e.trailingGroupPushDelta+a,o)}return e.heldLeadingGutterWidth=Math.max(0,e.startLeadingGutterWidth+t-i),this.style.setProperty("--_esp-page-resize-leading-gutter-width",`${e.heldLeadingGutterWidth}px`),!0}finishWorkspaceRecentering(){this.clearWorkspaceRecenteringState(),this.syncTrailingWorkspaceResizeAvailability(),this.isConnected&&this.scheduleWorkspaceSettlement()}beginWorkspaceRecentering(){const e=this.workspaceLogicalGutterWidths(),t=e.leading+e.trailing,i=this.align==="center"?t/2:this.align==="end"?t:0;if(Math.abs(i-e.leading)<=l){this.finishWorkspaceRecentering();return}this.pendingRecenterLeading=i,this.workspaceRecenteringFrame.restart()}applyWorkspaceRecentering(){this.resizeSession||!this.hasAttribute("data-workspace-position-held")||(this.style.setProperty("--_esp-page-resize-leading-gutter-width",`${this.pendingRecenterLeading}px`),this.workspaceRecenteringTimer=setTimeout(()=>this.finishWorkspaceRecentering(),ke+We))}endWorkspaceResize(){const e=this.resizeSession;this.resizeSession=null,this.toggleAttribute("data-workspace-resizing",!1),e?.target.hasPointerCapture?.(e.pointerId)&&e.target.releasePointerCapture(e.pointerId),e&&this.beginWorkspaceRecentering()}previewFitsWithinPage(e,t,i,a,s,o){const r=this.shadowRoot?.querySelector(".esp-page-main"),n=this.shadowRoot?.querySelector(".esp-page-preview"),d=this.shadowRoot?.querySelector(".esp-page-flyout");if(!r||!n||!d)return!1;const m=this.visiblePageInlineBounds(),h=r.getBoundingClientRect(),u=n.getBoundingClientRect(),y=d.getBoundingClientRect(),W=Math.max(t,i),v=Math.max(s,o),w=u.width+l>=t&&u.width<=W+l,c=!a||y.width+l>=s&&y.width<=v+l,p=u.left+l>=m.left&&u.right<=m.right+l&&(!a||y.left+l>=m.left&&y.right<=m.right+l),b=getComputedStyle(this).direction==="rtl"?h.left+l>=u.right&&(!a||u.left+l>=y.right):h.right<=u.left+l&&(!a||u.right<=y.left+l);return h.width+l>=e&&w&&c&&p&&b}flyoutFitsWithinPage(e,t,i){const a=this.shadowRoot?.querySelector(".esp-page-main"),s=this.shadowRoot?.querySelector(".esp-page-flyout");if(!a||!s)return!1;const o=this.visiblePageInlineBounds(),r=a.getBoundingClientRect(),n=s.getBoundingClientRect(),d=Math.max(t,i),m=n.width+l>=t&&n.width<=d+l,h=n.left+l>=o.left&&n.right<=o.right+l,u=getComputedStyle(this).direction==="rtl"?r.left+l>=n.right:r.right<=n.left+l;return r.width+l>=e&&m&&h&&u}workspaceMinimumsCanFit(e,t,i,a,s){const o=this.visiblePageInlineBounds().width;if(o<=0||e<=0||t&&i<=0||a&&s<=0)return!1;const r=this.shadowRoot?.querySelector(".esp-page-left")?.getBoundingClientRect().width??0,n=this.shadowRoot?.querySelector(".esp-page-right")?.getBoundingClientRect().width??0,m=(t&&this.getPreviewNavigationPair()!==null?0:r)+n+e+(t?i:0)+(a?s:0);return o+l>=m}workspaceGeometrySample(){const e=this.visiblePageInlineBounds(),t=this.shadowRoot?.querySelector(".esp-page-main")?.getBoundingClientRect(),i=this.shadowRoot?.querySelector(".esp-page-preview")?.getBoundingClientRect(),a=this.shadowRoot?.querySelector(".esp-page-flyout")?.getBoundingClientRect();return[e.left,e.right,e.width,t?.left??0,t?.right??0,t?.width??0,i?.left??0,i?.right??0,i?.width??0,a?.left??0,a?.right??0,a?.width??0]}workspaceGeometryMatches(e,t){return e.length===t.length&&e.every((i,a)=>Math.abs(i-(t[a]??i))<=l)}workspaceCandidateIsMeasurable(e,t){const i=this.shadowRoot?.querySelector(".esp-page-preview")?.getBoundingClientRect().width??0,a=this.shadowRoot?.querySelector(".esp-page-flyout")?.getBoundingClientRect().width??0;return(!e||i>l)&&(!t||a>l)}async candidateFitsAfterLayoutSettles(e,t,i){if(await this.updateComplete,e!==this.previewSyncGeneration||!this.isConnected)return null;let a=null,s=0;for(let o=0;o<me;o+=1){if(await new Promise(n=>requestAnimationFrame(()=>n())),e!==this.previewSyncGeneration||!this.isConnected)return null;if(t())return!0;if(!i()){a=null,s=0;continue}const r=this.workspaceGeometrySample();if(s=a&&this.workspaceGeometryMatches(a,r)?s+1:1,s>=ge)return!1;a=r}return null}async promoteFlyoutIfClipped(e,t,i,a){if(i<=0)return!1;const s=await this.candidateFitsAfterLayoutSettles(e,()=>this.flyoutFitsWithinPage(t,i,a),()=>this.workspaceCandidateIsMeasurable(!1,!0));return s===null?!0:s?!1:(await this.promoteFlyoutToOverlay(),!0)}async promoteFlyoutToOverlay(){this.setPreviewLayoutState(!1,!1),this.setWorkspaceWidths(0,0),this.flyoutOverlayPromotionWidth===null&&(this.flyoutOverlayPromotionWidth=this.visiblePageInlineBounds().width,this.armFlyoutOverlayRecovery()),await this.setPageFlyoutOverlay(!0)}async syncPreviewLayout(e,t=!0){if(e!==this.previewSyncGeneration||!this.isConnected||this.resizeSession||this.hasAttribute("data-workspace-keyboard-adjusting")||this.hasAttribute("data-workspace-position-held"))return;let i=!1;const a=this.previewVisible;this.toggleAttribute("data-preview-measuring",!0);try{const s=this.previewOpen&&this.previewHasContent(),o=this.previewMediaQuery?.matches??!1,r=this.hasAttribute("flyout-overlay-open"),n=this.hasAttribute("flyout-open"),d=this.hasAttribute("data-preview-navigation-collapsed"),m=this.getPreviewNavigationPair(),h=m===null?0:d?this.previewCollapsedSidebarWidth:this.shadowRoot?.querySelector(".esp-page-left")?.getBoundingClientRect().width??0,u=this.probeWidth(this.previewMinWidthProbe),y=this.optionalWidth("--esp-page-preview-default-width",this.previewDefaultWidthProbe),W=this.probeWidth(this.previewMaxWidthProbe),v=this.probeWidth(this.flyoutMinWidthProbe),w=this.optionalWidth("--esp-page-flyout-default-width",this.flyoutDefaultWidthProbe),c=this.probeWidth(this.flyoutMaxWidthProbe),p=this.probeWidth(this.mainMinWidthProbe);this.syncMainMaximumConfiguration();const b=this.probeWidth(this.mainMaxWidthProbe),P=this.kind==="full"&&!this.hasAttribute("data-main-max-configured")?0:b,C=this.openAutoFlyouts().some(S=>S.pageOverlayRequested===!0);if(this.setPreviewLayoutState(!1,!1),this.setWorkspaceWidths(0,0),C){const S=this.visiblePageInlineBounds().width,T=this.flyoutOverlayPromotionWidth===null||S>=this.flyoutOverlayPromotionWidth+ve;!o&&t&&this.flyoutOverlayRecoveryReady&&T&&this.workspaceMinimumsCanFit(p,s,u,!0,v)?await this.setPageFlyoutOverlay(!1):o&&await this.setPageFlyoutOverlay(!1);return}if(await this.updateComplete,e!==this.previewSyncGeneration)return;const k=s&&!o&&!r,g=n&&!o;if(p>0&&(!k||u>0)&&(!g||v>0)&&(k||g)&&!this.workspaceMinimumsCanFit(p,k,u,g,v)){g&&await this.promoteFlyoutToOverlay();return}const A=(k?u:0)+(g?v:0),L=k&&this.preferredPreviewWidth!==null||g&&this.preferredFlyoutWidth!==null||(k&&y!==null||g&&w!==null),U=(k?this.preferredPreviewWidth===null?u:this.clampWidth(this.preferredPreviewWidth,u,W):0)+(g?this.preferredFlyoutWidth===null?v:this.clampWidth(this.preferredFlyoutWidth,v,c):0),f=S=>{const T=this.workspaceTargetWidth(S,A,U),B=this.allocateWorkspaceWidths(T,k,g,u,W,v,c,y,w),K=S.maximum+p,Z=Math.max(0,K-S.natural),se=B.previewWidth+B.flyoutWidth,J=Math.max(0,Math.min(Z,K-se));return{allocation:B,mainWidth:J,reclaimsMain:J+l<Z}},D=(S,T)=>Math.abs(S.mainWidth-T.mainWidth)>l||Math.abs(S.allocation.previewWidth-T.allocation.previewWidth)>l||Math.abs(S.allocation.flyoutWidth-T.allocation.flyoutWidth)>l,V=this.workspaceWidthCapacity(p,P,d?h:0),I=f(V);let $=I.allocation;if(this.setWorkspaceWidths($.previewWidth,$.flyoutWidth,L),!k||u<=0){g&&await this.promoteFlyoutIfClipped(e,p,v,c);return}if(m!==null&&h>l){const S=V.maximum+p,T=this.workspaceWidthCapacityForAvailable(S+h,p,P),B=f(T);(d?D(f(this.workspaceWidthCapacityForAvailable(Math.max(0,S-we),p,P)),B):I.reclaimsMain&&D(I,B))?i=await this.setPreviewNavigationCollapse(!0):await this.setPreviewNavigationCollapse(!1)}else await this.setPreviewNavigationCollapse(!1);if(e!==this.previewSyncGeneration)return;const Y=this.workspaceWidthCapacity(p,P);if(Y.maximum+l<A){this.setPreviewLayoutState(!1,!1),this.setWorkspaceWidths(0,g?v:0),i=!1,g&&await this.promoteFlyoutToOverlay();return}const X=f(Y);if($=X.allocation,this.setWorkspaceWidths($.previewWidth,$.flyoutWidth,L),a||this.toggleAttribute("data-preview-validating",!0),this.setPreviewLayoutState(!0,X.reclaimsMain),await this.updateComplete,e!==this.previewSyncGeneration)return;const Q=await this.candidateFitsAfterLayoutSettles(e,()=>this.previewFitsWithinPage(p,u,W,g,v,c),()=>this.workspaceCandidateIsMeasurable(!0,g));if(Q===null)return;Q?this.toggleAttribute("data-preview-validating",!1):(this.setPreviewLayoutState(!1,!1),this.setWorkspaceWidths(0,g?v:0),i=!1,g&&await this.promoteFlyoutToOverlay())}finally{e===this.previewSyncGeneration&&!i&&await this.setPreviewNavigationCollapse(!1),e===this.previewSyncGeneration&&(this.toggleAttribute("data-preview-measuring",!1),this.toggleAttribute("data-preview-validating",!1),this.syncTrailingWorkspaceResizeAvailability(),this.requestUpdate())}}runScheduledPreviewLayout(){const e=this.previewSyncGeneration,t=this.previewOverlayRecoveryRequested;this.previewOverlayRecoveryRequested=!1,this.previewSyncTask=this.previewSyncTask.then(()=>this.syncPreviewLayout(e,t)).catch(()=>{})}setupPreviewLayoutObserver(){if(this.isConnected){if(!this.previewMediaQuery&&typeof window.matchMedia=="function"&&(this.previewMediaQuery=window.matchMedia(ue),this.previewMediaQuery.addEventListener("change",this.onPreviewMediaChange)),!this.previewResizeObserver&&typeof ResizeObserver<"u"){this.previewResizeObserver=new ResizeObserver(this.onPreviewResize),this.previewResizeObserver.observe(this);const e=this.shadowRoot?.querySelector(".esp-page-left");e&&this.previewResizeObserver.observe(e);for(const t of[this.previewMinWidthProbe,this.previewDefaultWidthProbe,this.previewMaxWidthProbe,this.flyoutMinWidthProbe,this.flyoutDefaultWidthProbe,this.flyoutMaxWidthProbe,this.mainMinWidthProbe,this.mainConfiguredMaxWidthProbe,this.mainMaxWidthProbe,this.resizeStepProbe,this.resizeLargeStepProbe])t.value&&this.previewResizeObserver.observe(t.value)}this.schedulePreviewLayout(!0)}}footerElementProvidesLandmark(e){return e.matches(ae)||e.querySelector(ae)!==null}syncFooterLandmark(){const t=(this.footerSlot.value?.assignedElements({flatten:!0})??[]).some(i=>this.footerElementProvidesLandmark(i));this.footerWrapperIsLandmark=!t}showPreview(){this.previewOpen=!0}closePreview(){this.previewOpen=!1}togglePreview(){this.previewOpen=!this.previewOpen}AddDialog(e){this.dialogZone.value?.appendChild(e)}firstUpdated(e){super.firstUpdated(e),this.syncFlyoutState(),this.setupPreviewLayoutObserver()}updated(e){super.updated(e),(e.has("fixedMenus")||e.has("headerPosition"))&&pe().publish("fixed-menus-changed",{fixed:this.fixedMenus||this.headerPosition==="fixed"}),(e.has("previewOpen")||e.has("previewCollapseSidebar")||e.has("align"))&&this.schedulePreviewLayout(!0),e.has("workspaceResizable")&&!this.workspaceResizable&&(this.finishWorkspaceKeyboardResize(),this.endWorkspaceResize(),this.clearWorkspaceRecenteringState())}render(){const e=this.fixedMenus||this.headerPosition==="fixed",t=!e&&this.headerPosition==="sticky",i=this.mainPreviewResizeRange(),a=this.previewProbes.minimum,s=this.flyoutProbes.minimum,o=this.flyoutProbes.maximum,r=this.mainProbes.minimum,n=this.probeWidth(this.mainMaxWidthProbe),d=this.shadowRoot?.querySelector(".esp-page-main")?.getBoundingClientRect().width??0,m=this.hasAttribute("flyout-open"),h=d+this.allocatedPreviewWidth,u=i.min<=a+l,y=m&&u?Math.max(0,this.allocatedFlyoutWidth-s):0,W=Math.max(r,h-i.max),v=Math.max(W,Math.max(r,h-i.min)+y),w=n>0?Math.max(W,Math.min(Math.max(r,n),v)):v,c=n>0&&d+l>=n?`${Math.round(d)}px main, ${Math.round(this.allocatedPreviewWidth)}px preview`:ee;let p,b;if(this.previewVisible){const f=this.previewFlyoutResizeRange(),D=this.allocatedPreviewWidth+this.allocatedFlyoutWidth,I=f.min<=a+l?Math.max(0,d-r):0;p=Math.max(s,D-f.max),b=Math.max(p,Math.min(o,D-f.min+I))}else{const f=this.flyoutOnlyResizeRange();p=f.min,b=f.max}const P=this.previewVisible?"preview-flyout-resize-handle":"main-flyout-resize-handle",C=this.previewVisible?"Resize preview and help panes":"Resize help pane",k=this.previewVisible?`${Math.round(this.allocatedPreviewWidth)}px preview, ${Math.round(this.allocatedFlyoutWidth)}px help`:`${Math.round(this.allocatedFlyoutWidth)}px help`,g=m?"flyout-end":"preview-end",F=g==="flyout-end"?this.allocatedFlyoutWidth:this.allocatedPreviewWidth,A=this.workspaceLogicalGutterWidths(),O=this.trailingPaneResizeRange(g,F,A.leading+A.trailing),E=g==="flyout-end"?"flyout-end-resize-handle":"preview-end-resize-handle",L=g==="flyout-end"?"Resize help pane from its outer edge":"Resize preview pane from its outer edge";return oe`
1
+ var M=function(q,e,t,i){var a=arguments.length,s=a<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(q,e,t,i);else for(var r=q.length-1;r>=0;r--)(o=q[r])&&(s=(a<3?o(s):a>3?o(e,t,s):o(e,t))||s);return a>3&&s&&Object.defineProperty(e,t,s),s};import{css as re,html as oe,nothing as ee}from"lit";import{customElement as ne,property as _,state as H}from"lit/decorators.js";import{classMap as le}from"lit/directives/class-map.js";import{createRef as R,ref as z}from"lit/directives/ref.js";import{EspalierElementBase as te}from"../shared/esp-element-base.js";import{BiDirectionalStickyController as N}from"./bi-directional-sticky-controller.js";import{getEspBus as he}from"../shared/bus-events.js";import{RafThrottle as ie}from"../shared/raf-throttle.js";import{InlineBounds as pe,PaneProbes as U,probeWidth as de,WidthRange as G}from"./workspace-width.js";import{slotHasContent as ce}from"../shared/slot-content.js";import"../toaster/esp-toaster.js";const ae='esp-footer, footer, [role~="contentinfo"]',ue="(max-width: 50em)",l=1,ge=5,me=12,ve=48,we=48,fe=16,ye=64,be=250,ke=250,We=40;let x=class extends te{constructor(){super(),this.dialogZone=R(),this.flyoutSlot=R(),this.footerSlot=R(),this.previewSlot=R(),this.previewSpace=R(),this.previewMinWidthProbe=R(),this.previewDefaultWidthProbe=R(),this.previewMaxWidthProbe=R(),this.previewProbes=new U(this.previewMinWidthProbe,this.previewDefaultWidthProbe,this.previewMaxWidthProbe),this.flyoutMinWidthProbe=R(),this.flyoutDefaultWidthProbe=R(),this.flyoutMaxWidthProbe=R(),this.flyoutProbes=new U(this.flyoutMinWidthProbe,this.flyoutDefaultWidthProbe,this.flyoutMaxWidthProbe),this.mainMinWidthProbe=R(),this.mainConfiguredMaxWidthProbe=R(),this.mainMaxWidthProbe=R(),this.mainProbes=new U(this.mainMinWidthProbe,this.mainMaxWidthProbe,this.mainMaxWidthProbe),this.resizeStepProbe=R(),this.resizeLargeStepProbe=R(),this.previewObservedWidths=new WeakMap,this.previewSyncFrame=new ie(()=>this.runScheduledPreviewLayout()),this.previewSyncGeneration=0,this.previewSyncTask=Promise.resolve(),this.previewOverlayRecoveryRequested=!1,this.previewHeader=null,this.previewMenu=null,this.previewCollapsedSidebarWidth=0,this.previewNavigationCollapseTask=null,this.flyoutOverlayPromotionWidth=null,this.flyoutOverlayRecoveryReady=!1,this.flyoutOverlayRecoveryGeneration=0,this.preferredPreviewWidth=null,this.preferredFlyoutWidth=null,this.flyoutFullHeightActive=!1,this.resizeSession=null,this.workspaceKeyboardSettlementTimer=null,this.workspaceRecenteringFrame=new ie(()=>this.applyWorkspaceRecentering()),this.pendingRecenterLeading=0,this.workspaceRecenteringTimer=null,this.footerWrapperIsLandmark=!0,this.allocatedPreviewWidth=0,this.allocatedFlyoutWidth=0,this.onWorkspaceResizePointerDown=(e,t)=>{if(t.button!==0||!this.separatorIsAvailable(e))return;const i=t.currentTarget,a=this.shadowRoot?.querySelector(".esp-page-main")?.getBoundingClientRect().width??0,s=this.renderedWorkspaceWidths();this.endWorkspaceResize(),this.finishWorkspaceKeyboardResize(!1),this.suspendPreviewLayoutForWorkspaceResize();const o=i.getBoundingClientRect(),r=this.holdWorkspacePosition();this.toggleAttribute("data-workspace-resizing",!0);const{leading:n,trailing:d}=this.workspaceLogicalGutterWidths(),m=d>l?n+d:0,p=d>l?Math.max(1,m/d):1;this.resizeSession={separator:e,pointerId:t.pointerId,target:i,startClientX:t.clientX,startPreviewWidth:s.previewWidth,startFlyoutWidth:s.flyoutWidth,startMainWidth:a,startNavigationAllowance:this.previewNavigationResizeAllowance(),startOuterGrowthCapacity:m,trailingExpansionScale:p,trailingGroupPushDelta:0,startHandleClientX:o.left+o.width/2,startLeadingGutterWidth:r,heldLeadingGutterWidth:r,direction:this.workspaceResizeDirection()};try{i.setPointerCapture?.(t.pointerId)}catch{}t.preventDefault()},this.onWorkspaceResizePointerMove=e=>{const t=this.resizeSession;if(!t||t.pointerId!==e.pointerId)return;e.preventDefault();const i=e.clientX-t.startClientX,a=i*t.direction,s=t.separator==="main-preview"||t.separator==="preview-flyout"&&!this.previewVisible;t.trailingGroupPushDelta=s&&a>0?Math.min(a,t.startOuterGrowthCapacity/t.trailingExpansionScale,this.mainResizeGrowthCapacity(t.startMainWidth)):0,this.applyWorkspaceResize(t.separator,i,"pointer",t.startPreviewWidth,t.startFlyoutWidth,t.startMainWidth,t.startNavigationAllowance,t.startOuterGrowthCapacity,t.trailingExpansionScale,t.direction),this.align!=="start"&&!this.seedWorkspaceResizeLeadingGutter(t)&&this.trackWorkspaceResizePointer(t)},this.onWorkspaceResizePointerEnd=e=>{!this.resizeSession||this.resizeSession.pointerId!==e.pointerId||(e.preventDefault(),this.endWorkspaceResize())},this.onWorkspaceResizeBlur=e=>{this.hasAttribute("data-workspace-keyboard-adjusting")&&(e.relatedTarget instanceof Element&&e.relatedTarget.classList.contains("esp-page-workspace-resize-handle")||this.finishWorkspaceKeyboardResize())},this.onWorkspaceResizeKeyDown=(e,t)=>{if(t.key!=="ArrowLeft"&&t.key!=="ArrowRight"||!this.separatorIsAvailable(e))return;t.preventDefault(),this.hasAttribute("data-workspace-keyboard-adjusting")||this.suspendPreviewLayoutForWorkspaceResize();const i=(t.key==="ArrowLeft"?-1:1)*this.resizeStep(t.shiftKey),a=this.shadowRoot?.querySelector(".esp-page-main")?.getBoundingClientRect().width??0,s=this.renderedWorkspaceWidths();this.applyWorkspaceResize(e,i,"keyboard",s.previewWidth,s.flyoutWidth,a,this.previewNavigationResizeAllowance(),(()=>{const o=this.workspaceLogicalGutterWidths();return o.leading+o.trailing})(),1,this.workspaceResizeDirection())},this.schedulePreviewLayout=(e=!1)=>{!this.isConnected||!this.hasUpdated||(this.previewOverlayRecoveryRequested||=e===!0,!(this.resizeSession||this.hasAttribute("data-workspace-keyboard-adjusting")||this.hasAttribute("data-workspace-position-held"))&&(this.previewSyncGeneration+=1,this.previewSyncFrame.restart()))},this.onPreviewMediaChange=()=>this.schedulePreviewLayout(!0),this.onPreviewResize=e=>{let t=!1;for(const i of e){const a=i.contentRect.width;if(i.target instanceof HTMLElement&&i.target.classList.contains("esp-page-left")){a>l&&!this.hasAttribute("data-preview-navigation-collapsed")&&(this.previewCollapsedSidebarWidth=a);continue}const s=this.previewObservedWidths.get(i.target);this.previewObservedWidths.set(i.target,a),t||=s===void 0||Math.abs(s-a)>.25}t&&this.schedulePreviewLayout(!0)},this.kind="wide",this.align="start",this.contained=!1,this.headerPosition="normal",this.fixedMenus=!1,this.previewOpen=!1,this.previewLabel="Preview",this.previewCollapseSidebar=!1,this.workspaceResizable=!1,this.previewVisible=!1,this.previewReclaiming=!1,this.warnedSiteRails=!1,new N(this,".esp-page-left > .sticky-wrapper"),new N(this,".esp-page-right > .sticky-wrapper"),new N(this,".esp-page-flyout > .sticky-wrapper",{topOffset:()=>this.flyoutFullHeightActive?0:void 0}),new N(this,".esp-page-preview > .sticky-wrapper",{topOffset:()=>0}),this.addEventListener("flyout-state-changed",e=>this.syncFlyoutState(e))}connectedCallback(){const e=Array.from(this.children).filter(t=>t.getAttribute("slot")==="footer");this.footerWrapperIsLandmark=!e.some(t=>this.footerElementProvidesLandmark(t)),super.connectedCallback(),this.syncMainMaximumConfiguration(),this.hasUpdated&&queueMicrotask(()=>this.setupPreviewLayoutObserver())}disconnectedCallback(){this.finishWorkspaceKeyboardResize(!1),this.endWorkspaceResize(),this.clearWorkspaceRecenteringState(),this.previewResizeObserver?.disconnect(),this.previewResizeObserver=void 0,this.previewMediaQuery?.removeEventListener("change",this.onPreviewMediaChange),this.previewMediaQuery=void 0,this.previewSyncFrame.cancel(),this.previewSyncGeneration+=1,this.previewOverlayRecoveryRequested=!1,this.toggleAttribute("data-preview-measuring",!1),this.toggleAttribute("data-preview-validating",!1),this.toggleAttribute("data-workspace-keyboard-adjusting",!1),this.toggleAttribute("descendant-flyout-overlay-open",!1),this.clearFlyoutOverlayRecovery(),this.setPreviewLayoutState(!1,!1),this.setWorkspaceWidths(0,0),this.preferredPreviewWidth=null,this.preferredFlyoutWidth=null,this.previewNavigationCollapseTask=null,this.setPreviewNavigationCollapse(!1),super.disconnectedCallback()}syncFlyoutState(e){if(e&&e.target?.closest?.("esp-page")!==this){this.syncDescendantFlyoutOverlayState();return}const t=r=>{const n=r;return(typeof n.mode=="string"?n.mode:r.getAttribute("mode"))==="overlay"||n.pageOverlayRequested===!0},i=r=>{const n=r.open;return typeof n=="boolean"?n:r.hasAttribute("open")},a=r=>r.anchor!=null,s=r=>{const n=r.fullHeight;return typeof n=="boolean"?n:r.hasAttribute("full-height")},o=(this.flyoutSlot.value?.assignedElements()??[]).filter(r=>r.tagName==="ESP-FLYOUT");for(const r of o){const n=r,d=typeof n.mode=="string"?n.mode:r.getAttribute("mode");n.pageOverlayRequested&&(!i(r)||d!=="auto")&&(n.pageOverlayRequested=!1)}o.some(r=>r.pageOverlayRequested===!0)||this.clearFlyoutOverlayRecovery(),this.toggleAttribute("flyout-open",o.some(r=>i(r)&&!t(r))),this.toggleAttribute("flyout-overlay-open",o.some(r=>i(r)&&t(r))),this.toggleAttribute("flyout-anchored",o.some(r=>i(r)&&a(r))),this.flyoutFullHeightActive=o.some(r=>i(r)&&!t(r)&&s(r)),this.toggleAttribute("flyout-full-height",this.flyoutFullHeightActive),this.resizeSession&&(this.hasAttribute("flyout-overlay-open")||this.resizeSession.separator==="preview-flyout"&&!this.hasAttribute("flyout-open"))&&this.endWorkspaceResize(),this.requestUpdate(),this.schedulePreviewLayout()}syncDescendantFlyoutOverlayState(){const e=Array.from(this.querySelectorAll("esp-flyout")).some(t=>{if(t.closest("esp-page")===this)return!1;const i=t,a=typeof i.open=="boolean"?i.open:t.hasAttribute("open"),s=typeof i.mode=="string"?i.mode:t.getAttribute("mode");return a&&(s==="overlay"||i.pageOverlayRequested===!0||t.getAttribute("aria-modal")==="true")});this.toggleAttribute("descendant-flyout-overlay-open",e)}assignedFlyouts(){return(this.flyoutSlot.value?.assignedElements()??[]).filter(e=>e.tagName==="ESP-FLYOUT")}openAutoFlyouts(){return this.assignedFlyouts().filter(e=>{const t=typeof e.open=="boolean"?e.open:e.hasAttribute("open"),i=typeof e.mode=="string"?e.mode:e.getAttribute("mode");return t&&i!=="overlay"})}async setPageFlyoutOverlay(e){let t=!1;const i=new Set(this.openAutoFlyouts());for(const a of this.assignedFlyouts()){const s=e&&i.has(a);a.pageOverlayRequested!==s&&(a.pageOverlayRequested=s,t=!0)}return t&&await Promise.all(this.assignedFlyouts().map(a=>a.updateComplete??Promise.resolve())),e||this.clearFlyoutOverlayRecovery(),t}clearFlyoutOverlayRecovery(){this.flyoutOverlayPromotionWidth=null,this.flyoutOverlayRecoveryReady=!1,this.flyoutOverlayRecoveryGeneration+=1}armFlyoutOverlayRecovery(){const e=++this.flyoutOverlayRecoveryGeneration;this.flyoutOverlayRecoveryReady=!1,requestAnimationFrame(()=>{requestAnimationFrame(()=>{e!==this.flyoutOverlayRecoveryGeneration||!this.openAutoFlyouts().some(t=>t.pageOverlayRequested===!0)||(this.flyoutOverlayPromotionWidth=this.visiblePageInlineBounds().width,this.flyoutOverlayRecoveryReady=!0)})})}previewHasContent(){const e=this.previewSlot.value;return e?ce(e):Array.from(this.childNodes).some(t=>t instanceof Element&&t.getAttribute("slot")==="preview"&&!t.hasAttribute("hidden"))}getPreviewNavigationPair(){if(!this.previewCollapseSidebar)return null;const e=Array.from(this.children),t=e.find(o=>o.slot==="header"&&o.tagName==="ESP-HEADER"),i=e.find(o=>o.slot==="sidebar"&&o.tagName==="ESP-MENU");if(!t||!i||!i.id)return null;const a=typeof t.drawerTarget=="string"?t.drawerTarget:t.getAttribute("drawer-target")??"",s=typeof i.mode=="string"?i.mode:i.getAttribute("mode");return a!==i.id||s!=="vertical"||!("previewCollapseRequested"in t)||!("previewCollapseRequested"in i)?null:{header:t,menu:i}}async setPreviewNavigationCollapse(e){const t=e?this.getPreviewNavigationPair():null,i=t!==null&&this.previewHeader===t.header&&this.previewMenu===t.menu,a=this.previewHeader&&this.previewHeader!==t?.header?this.previewHeader:null,s=this.previewMenu&&this.previewMenu!==t?.menu?this.previewMenu:null;if(a&&(a.previewCollapseRequested=!1),s&&(s.previewCollapseRequested=!1),this.previewHeader=t?.header??null,this.previewMenu=t?.menu??null,this.toggleAttribute("data-preview-navigation-collapsed",!1),await a?.updateComplete,await s?.updateComplete,!t)return!1;const o=i?this.previewCollapsedSidebarWidth:this.shadowRoot?.querySelector(".esp-page-left")?.getBoundingClientRect().width??0;return t.header.previewCollapseRequested=!0,t.menu.previewCollapseRequested=!0,await t.header.updateComplete,await t.menu.updateComplete,t.menu.hasExternalDrawerControl===!0?(this.previewCollapsedSidebarWidth=o,this.toggleAttribute("data-preview-navigation-collapsed",!0),!0):(t.header.previewCollapseRequested=!1,t.menu.previewCollapseRequested=!1,await t.header.updateComplete,await t.menu.updateComplete,this.previewHeader=null,this.previewMenu=null,!1)}requestPreviewNavigationCollapse(){if(this.hasAttribute("data-preview-navigation-collapsed")||this.previewNavigationCollapseTask)return;const e=this.setPreviewNavigationCollapse(!0);this.previewNavigationCollapseTask=e,e.then(()=>{this.previewNavigationCollapseTask===e&&(this.previewNavigationCollapseTask=null)},()=>{this.previewNavigationCollapseTask===e&&(this.previewNavigationCollapseTask=null)})}scheduleWorkspaceSettlement(e=null){const t=()=>{this.schedulePreviewLayout(),e&&requestAnimationFrame(()=>{this.previewSyncTask.then(()=>{const s=this.shadowRoot?.activeElement,o=this.ownerDocument.activeElement;!this.isConnected||!e.isConnected||s&&s!==e||o!==this&&o!==this.ownerDocument.body||getComputedStyle(e).display!=="none"&&e.focus({preventScroll:!0})})})},i=this.previewNavigationCollapseTask;if(!i){t();return}i.then(()=>t(),()=>t())}clearWorkspaceKeyboardSettlementTimer(){this.workspaceKeyboardSettlementTimer!==null&&(clearTimeout(this.workspaceKeyboardSettlementTimer),this.workspaceKeyboardSettlementTimer=null)}finishWorkspaceKeyboardResize(e=!0){this.clearWorkspaceKeyboardSettlementTimer();const t=this.hasAttribute("data-workspace-keyboard-adjusting");this.toggleAttribute("data-workspace-keyboard-adjusting",!1),t&&e&&!this.resizeSession&&this.scheduleWorkspaceSettlement()}deferWorkspaceKeyboardSettlement(){this.clearWorkspaceKeyboardSettlementTimer(),this.workspaceKeyboardSettlementTimer=setTimeout(()=>{if(this.workspaceKeyboardSettlementTimer=null,!this.hasAttribute("data-workspace-keyboard-adjusting"))return;const e=this.shadowRoot?.activeElement,t=e instanceof HTMLElement&&e.classList.contains("esp-page-workspace-resize-handle")?e:null;this.toggleAttribute("data-workspace-keyboard-adjusting",!1),this.resizeSession||this.scheduleWorkspaceSettlement(t)},be)}suspendPreviewLayoutForWorkspaceResize(){this.previewSyncFrame.cancel(),this.previewSyncGeneration+=1,this.toggleAttribute("data-preview-measuring",!1),this.toggleAttribute("data-preview-validating",!1)}setPreviewLayoutState(e,t){this.previewVisible=e,this.previewReclaiming=e&&t,e||this.endWorkspaceResize()}setWorkspaceWidths(e,t,i=!1){const a=Math.max(0,e),s=Math.max(0,t);this.style.setProperty("--_esp-page-preview-used-width",`${a}px`),this.style.setProperty("--_esp-page-flyout-used-width",`${s}px`),this.toggleAttribute("data-workspace-targeted",i),this.allocatedPreviewWidth=a,this.allocatedFlyoutWidth=s}clampWidth(e,t,i){return G.of(t,i).clamp(e)}visiblePageInlineBounds(){const e=this.getBoundingClientRect();let t=e.left,i=e.right;const a=window.visualViewport,s=a?.offsetLeft??0,o=a?.width??document.documentElement.clientWidth;o>0&&(t=Math.max(t,s),i=Math.min(i,s+o));const r=this.getRootNode();let n=this.parentElement??(r instanceof ShadowRoot?r.host:null);for(;n;){const d=getComputedStyle(n).overflowX;if(["auto","clip","hidden","scroll"].includes(d)){const p=n.getBoundingClientRect();t=Math.max(t,p.left),i=Math.min(i,p.right)}const m=n.getRootNode();n=n.parentElement??(m instanceof ShadowRoot?m.host:null)}return new pe(t,i)}probeWidth(e){return de(e)}optionalWidth(e,t){return getComputedStyle(this).getPropertyValue(e).trim()===""?null:this.probeWidth(t)}syncMainMaximumConfiguration(){const e=getComputedStyle(this).getPropertyValue("--esp-page-main-max-width").trim()!=="";this.toggleAttribute("data-main-max-configured",e)}workspaceWidthCapacity(e,t,i=0){const a=this.shadowRoot?.querySelector(".esp-page-left")?.getBoundingClientRect().width??0,s=this.shadowRoot?.querySelector(".esp-page-right")?.getBoundingClientRect().width??0,o=Math.max(0,this.visiblePageInlineBounds().width-a-s-Math.max(0,i));return this.workspaceWidthCapacityForAvailable(o,e,t)}workspaceWidthCapacityForAvailable(e,t,i){const a=Math.max(0,e),s=i>0?Math.min(a,i):a;return{natural:Math.max(0,a-s),maximum:Math.max(0,a-Math.max(0,t))}}workspaceTargetWidth(e,t,i){return Math.min(e.maximum,Math.max(t,i,e.natural))}allocateWorkspaceWidths(e,t,i,a,s,o,r,n=null,d=null){const m=Math.max(0,e),p=Math.max(0,a),u=Math.max(p,s),y=Math.max(0,o),W=Math.max(y,r),v=t?this.preferredPreviewWidth??(n===null?null:this.clampWidth(n,p,u)):null,w=i?this.preferredFlyoutWidth??(d===null?null:this.clampWidth(d,y,W)):null;let c=0,h=0;t&&i?(c=Math.min(u,Math.max(p,m-y)),h=Math.min(W,Math.max(y,m-c))):t?c=Math.min(u,Math.max(p,m)):i&&(h=Math.min(W,Math.max(y,m))),t&&v!==null&&(c=this.clampWidth(v,p,u),i&&w===null&&(h=this.clampWidth(m-c,y,W))),i&&w!==null&&(h=this.clampWidth(w,y,W),t&&v===null&&(c=this.clampWidth(m-h,p,u)));let b=c+h-m;if(b>0&&i){const P=Math.min(b,Math.max(0,h-y));h-=P,b-=P}return b>0&&t&&(c-=Math.min(b,Math.max(0,c-p))),{previewWidth:c,flyoutWidth:h}}workspaceResizeDirection(){return getComputedStyle(this).direction==="rtl"?-1:1}trailingWorkspaceSeparator(){return this.hasAttribute("flyout-open")&&!this.hasAttribute("flyout-overlay-open")?"flyout-end":this.previewVisible?"preview-end":null}trailingWorkspacePane(){const e=this.trailingWorkspaceSeparator()==="flyout-end"?".esp-page-flyout":this.trailingWorkspaceSeparator()==="preview-end"?".esp-page-preview":null;return e?this.shadowRoot?.querySelector(e)??null:null}workspaceLogicalGutterWidths(){const e=Math.max(0,this.shadowRoot?.querySelector(".esp-page-canvas--left")?.getBoundingClientRect().width??0),t=this.trailingWorkspacePane();if(!t)return{leading:e,trailing:0};const i=this.visiblePageInlineBounds(),a=t.getBoundingClientRect(),s=this.workspaceResizeDirection()===1?i.right-a.right:a.left-i.left;return{leading:e,trailing:Math.max(0,s)}}syncTrailingWorkspaceResizeAvailability(){const{trailing:e}=this.workspaceLogicalGutterWidths();this.toggleAttribute("data-workspace-trailing-edge-exposed",this.trailingWorkspaceSeparator()!==null&&e>l)}trailingPaneResizeRange(e,t,i){const a=e==="preview-end"?this.previewMinWidthProbe:this.flyoutMinWidthProbe,s=e==="preview-end"?this.previewMaxWidthProbe:this.flyoutMaxWidthProbe,o=Math.max(0,this.probeWidth(a)),r=Math.max(o,this.probeWidth(s));return G.of(o,r).cappedAt(Math.max(0,t)+Math.max(0,i))}resizeStep(e){const t=this.probeWidth(e?this.resizeLargeStepProbe:this.resizeStepProbe);return t>0?t:e?ye:fe}previewNavigationResizeAllowance(){if(this.hasAttribute("data-preview-navigation-collapsed")||this.getPreviewNavigationPair()===null)return 0;const e=Math.max(0,this.shadowRoot?.querySelector(".esp-page-left")?.getBoundingClientRect().width??0);return e>l&&(this.previewCollapsedSidebarWidth=e),e>l?e:this.previewCollapsedSidebarWidth}renderedWorkspaceWidths(){const e=this.shadowRoot?.querySelector(".esp-page-preview"),t=this.shadowRoot?.querySelector(".esp-page-flyout");return{previewWidth:this.allocatedPreviewWidth>0?this.allocatedPreviewWidth:e?.getBoundingClientRect().width??0,flyoutWidth:this.allocatedFlyoutWidth>0?this.allocatedFlyoutWidth:t?.getBoundingClientRect().width??0}}mainPreviewResizeRange(e=this.renderedWorkspaceWidths().previewWidth,t=this.shadowRoot?.querySelector(".esp-page-main")?.getBoundingClientRect().width??0,i=this.previewNavigationResizeAllowance()){const a=this.previewProbes.minimum,s=this.previewProbes.maximum,o=this.mainProbes.minimum,r=Math.max(0,t+e),n=Math.max(0,r+i-o);return G.of(a,Math.max(a,Math.min(s,n)))}previewFlyoutResizeRange(e=this.renderedWorkspaceWidths().previewWidth,t=this.renderedWorkspaceWidths().flyoutWidth){const i=this.previewProbes.minimum,a=this.previewProbes.maximum,s=this.flyoutProbes.minimum,o=this.flyoutProbes.maximum,r=e+t;return G.of(Math.max(i,r-o),Math.max(i,Math.min(a,r-s)))}separatorIsAvailable(e){return!this.workspaceResizable||this.hasAttribute("flyout-overlay-open")?!1:e==="main-preview"?this.previewVisible:e==="preview-end"||e==="flyout-end"?this.trailingWorkspaceSeparator()===e&&(this.hasAttribute("data-workspace-trailing-edge-exposed")||this.hasAttribute("data-workspace-position-held")||this.hasAttribute("data-workspace-keyboard-adjusting")):this.hasAttribute("flyout-open")}flyoutOnlyResizeRange(e=this.renderedWorkspaceWidths().flyoutWidth,t=this.shadowRoot?.querySelector(".esp-page-main")?.getBoundingClientRect().width??0){const i=this.flyoutProbes.minimum,a=this.flyoutProbes.maximum,s=this.mainProbes.minimum,o=this.probeWidth(this.mainMaxWidthProbe),r=Math.max(0,t+e),n=o>0?Math.max(0,r-o):0,d=Math.max(i,n);return G.of(d,Math.min(a,r-s))}mainTrackUnbounded(){return this.kind==="site"||this.kind==="full"&&!this.hasAttribute("data-main-max-configured")}mainResizeGrowthCapacity(e){return this.mainTrackUnbounded()?Number.POSITIVE_INFINITY:Math.max(0,this.probeWidth(this.mainMaxWidthProbe)-e)}applyWorkspaceResize(e,t,i,a,s,o,r,n,d,m){if(!this.separatorIsAvailable(e))return;const p=t*m,u=n/d,y=e==="main-preview"||e==="preview-flyout"&&!this.previewVisible,W=i==="pointer"&&y&&p>0?Math.min(p,u,this.mainResizeGrowthCapacity(o)):0;let v=e,w=a,c=s;if(e==="preview-end"||e==="flyout-end"){const h=e==="preview-end"?a:s,b=this.trailingPaneResizeRange(e,h,n),P=h+(p>0?p*d:p),C=b.clamp(P);e==="preview-end"?(w=C,this.preferredPreviewWidth=C):(c=C,this.preferredFlyoutWidth=C)}else if(e==="main-preview"){const h=this.mainPreviewResizeRange(a,o,r),b=a-(p-W);w=h.clamp(b),this.preferredPreviewWidth=w;const P=this.mainProbes.minimum,C=this.probeWidth(this.mainMaxWidthProbe),k=this.mainTrackUnbounded()?0:C,g=this.workspaceWidthCapacity(P,k);r>0&&w+c>g.natural+l&&this.requestPreviewNavigationCollapse();const F=this.previewProbes.minimum,A=Math.max(0,F-b),E=h.min<=F+l;if(A>0&&E&&s>0){const O=this.flyoutProbes.minimum,L=this.flyoutProbes.maximum;c=this.clampWidth(s-A,O,L),this.preferredFlyoutWidth=c}else s>0&&(this.preferredFlyoutWidth??=s)}else if(!this.previewVisible)v="main-flyout",c=this.flyoutOnlyResizeRange(s,o).clamp(s-(p-W)),w=0,this.preferredFlyoutWidth=c;else{const h=this.previewProbes.minimum,b=this.previewProbes.maximum,P=this.flyoutProbes.minimum,C=this.flyoutProbes.maximum;if(p>=0){const k=Math.max(0,s-P),g=Math.min(p,u),F=Math.max(0,p-g),A=g*d+F,E=k+n;w=this.clampWidth(a+A,h,Math.min(b,a+E));const O=Math.max(0,w-a),L=Math.min(O,n);c=s-Math.min(Math.max(0,O-L),k)}else{const k=this.previewFlyoutResizeRange(a,s),g=a+p;w=k.clamp(g),c=a+s-w;const F=Math.max(0,h-g),A=k.min<=h+l;if(F>0&&A){const E=this.mainProbes.minimum,O=Math.max(0,o-E);c=this.clampWidth(c+Math.min(F,O),P,C)}}this.preferredPreviewWidth=w,this.preferredFlyoutWidth=c}this.setWorkspaceWidths(w,c,!0),this.requestUpdate(),this.previewVisible&&this.setPreviewLayoutState(!0,!0),i==="keyboard"&&(this.toggleAttribute("data-workspace-keyboard-adjusting",!0),this.deferWorkspaceKeyboardSettlement()),this.dispatchEvent(new CustomEvent("esp-page-workspace-resize",{bubbles:!0,composed:!0,detail:{separator:v,source:i,previewWidth:w,flyoutWidth:c}}))}appliedSeparatorInlineDelta(e){if(e.separator==="preview-end"){const a=this.allocatedPreviewWidth-e.startPreviewWidth;return a>0?a/e.trailingExpansionScale:a}if(e.separator==="flyout-end"){const a=this.allocatedFlyoutWidth-e.startFlyoutWidth;return a>0?a/e.trailingExpansionScale:a}if(e.separator==="main-preview")return e.trailingGroupPushDelta+e.startPreviewWidth-this.allocatedPreviewWidth+(e.startFlyoutWidth-this.allocatedFlyoutWidth);const t=e.startFlyoutWidth-this.allocatedFlyoutWidth;if(!this.previewVisible)return e.trailingGroupPushDelta+t;if(this.allocatedPreviewWidth<e.startPreviewWidth)return t;const i=Math.max(0,this.allocatedPreviewWidth+this.allocatedFlyoutWidth-e.startPreviewWidth-e.startFlyoutWidth);return t+i/e.trailingExpansionScale}clearWorkspaceRecenteringState(){this.workspaceRecenteringFrame.cancel(),this.workspaceRecenteringTimer!==null&&(clearTimeout(this.workspaceRecenteringTimer),this.workspaceRecenteringTimer=null),this.toggleAttribute("data-workspace-position-held",!1),this.style.removeProperty("--_esp-page-resize-leading-gutter-width")}holdWorkspacePosition(){const e=this.workspaceLogicalGutterWidths().leading;return this.clearWorkspaceRecenteringState(),this.style.setProperty("--_esp-page-resize-leading-gutter-width",`${e}px`),this.toggleAttribute("data-workspace-position-held",!0),e}trackWorkspaceResizePointer(e){const t=e.startHandleClientX+this.appliedSeparatorInlineDelta(e)*e.direction;for(let i=0;i<3;i+=1){const a=e.target.getBoundingClientRect(),s=a.left+a.width/2,o=(t-s)*e.direction;if(Math.abs(o)<=.25)return;const r=Math.max(0,e.heldLeadingGutterWidth+o);if(Math.abs(r-e.heldLeadingGutterWidth)<=.25)return;e.heldLeadingGutterWidth=r,this.style.setProperty("--_esp-page-resize-leading-gutter-width",`${e.heldLeadingGutterWidth}px`)}}seedWorkspaceResizeLeadingGutter(e){if(this.align==="start")return!1;const t=this.appliedSeparatorInlineDelta(e);if(t<=0)return!1;let i=0;if(e.separator==="preview-end"||e.separator==="flyout-end")i=this.allocatedPreviewWidth-e.startPreviewWidth+this.allocatedFlyoutWidth-e.startFlyoutWidth;else if(e.separator==="preview-flyout"&&this.previewVisible)i=this.allocatedPreviewWidth-e.startPreviewWidth;else{const a=Math.max(0,e.startPreviewWidth-this.allocatedPreviewWidth+e.startFlyoutWidth-this.allocatedFlyoutWidth),s=this.probeWidth(this.mainMaxWidthProbe),o=this.mainTrackUnbounded()?Number.POSITIVE_INFINITY:Math.max(0,s-e.startMainWidth);i=Math.min(e.trailingGroupPushDelta+a,o)}return e.heldLeadingGutterWidth=Math.max(0,e.startLeadingGutterWidth+t-i),this.style.setProperty("--_esp-page-resize-leading-gutter-width",`${e.heldLeadingGutterWidth}px`),!0}finishWorkspaceRecentering(){this.clearWorkspaceRecenteringState(),this.syncTrailingWorkspaceResizeAvailability(),this.isConnected&&this.scheduleWorkspaceSettlement()}beginWorkspaceRecentering(){const e=this.workspaceLogicalGutterWidths(),t=e.leading+e.trailing,i=this.align==="center"?t/2:this.align==="end"?t:0;if(Math.abs(i-e.leading)<=l){this.finishWorkspaceRecentering();return}this.pendingRecenterLeading=i,this.workspaceRecenteringFrame.restart()}applyWorkspaceRecentering(){this.resizeSession||!this.hasAttribute("data-workspace-position-held")||(this.style.setProperty("--_esp-page-resize-leading-gutter-width",`${this.pendingRecenterLeading}px`),this.workspaceRecenteringTimer=setTimeout(()=>this.finishWorkspaceRecentering(),ke+We))}endWorkspaceResize(){const e=this.resizeSession;this.resizeSession=null,this.toggleAttribute("data-workspace-resizing",!1),e?.target.hasPointerCapture?.(e.pointerId)&&e.target.releasePointerCapture(e.pointerId),e&&this.beginWorkspaceRecentering()}previewFitsWithinPage(e,t,i,a,s,o){const r=this.shadowRoot?.querySelector(".esp-page-main"),n=this.shadowRoot?.querySelector(".esp-page-preview"),d=this.shadowRoot?.querySelector(".esp-page-flyout");if(!r||!n||!d)return!1;const m=this.visiblePageInlineBounds(),p=r.getBoundingClientRect(),u=n.getBoundingClientRect(),y=d.getBoundingClientRect(),W=Math.max(t,i),v=Math.max(s,o),w=u.width+l>=t&&u.width<=W+l,c=!a||y.width+l>=s&&y.width<=v+l,h=u.left+l>=m.left&&u.right<=m.right+l&&(!a||y.left+l>=m.left&&y.right<=m.right+l),b=getComputedStyle(this).direction==="rtl"?p.left+l>=u.right&&(!a||u.left+l>=y.right):p.right<=u.left+l&&(!a||u.right<=y.left+l);return p.width+l>=e&&w&&c&&h&&b}flyoutFitsWithinPage(e,t,i){const a=this.shadowRoot?.querySelector(".esp-page-main"),s=this.shadowRoot?.querySelector(".esp-page-flyout");if(!a||!s)return!1;const o=this.visiblePageInlineBounds(),r=a.getBoundingClientRect(),n=s.getBoundingClientRect(),d=Math.max(t,i),m=n.width+l>=t&&n.width<=d+l,p=n.left+l>=o.left&&n.right<=o.right+l,u=getComputedStyle(this).direction==="rtl"?r.left+l>=n.right:r.right<=n.left+l;return r.width+l>=e&&m&&p&&u}workspaceMinimumsCanFit(e,t,i,a,s){const o=this.visiblePageInlineBounds().width;if(o<=0||e<=0||t&&i<=0||a&&s<=0)return!1;const r=this.shadowRoot?.querySelector(".esp-page-left")?.getBoundingClientRect().width??0,n=this.shadowRoot?.querySelector(".esp-page-right")?.getBoundingClientRect().width??0,m=(t&&this.getPreviewNavigationPair()!==null?0:r)+n+e+(t?i:0)+(a?s:0);return o+l>=m}workspaceGeometrySample(){const e=this.visiblePageInlineBounds(),t=this.shadowRoot?.querySelector(".esp-page-main")?.getBoundingClientRect(),i=this.shadowRoot?.querySelector(".esp-page-preview")?.getBoundingClientRect(),a=this.shadowRoot?.querySelector(".esp-page-flyout")?.getBoundingClientRect();return[e.left,e.right,e.width,t?.left??0,t?.right??0,t?.width??0,i?.left??0,i?.right??0,i?.width??0,a?.left??0,a?.right??0,a?.width??0]}workspaceGeometryMatches(e,t){return e.length===t.length&&e.every((i,a)=>Math.abs(i-(t[a]??i))<=l)}workspaceCandidateIsMeasurable(e,t){const i=this.shadowRoot?.querySelector(".esp-page-preview")?.getBoundingClientRect().width??0,a=this.shadowRoot?.querySelector(".esp-page-flyout")?.getBoundingClientRect().width??0;return(!e||i>l)&&(!t||a>l)}async candidateFitsAfterLayoutSettles(e,t,i){if(await this.updateComplete,e!==this.previewSyncGeneration||!this.isConnected)return null;let a=null,s=0;for(let o=0;o<me;o+=1){if(await new Promise(n=>requestAnimationFrame(()=>n())),e!==this.previewSyncGeneration||!this.isConnected)return null;if(t())return!0;if(!i()){a=null,s=0;continue}const r=this.workspaceGeometrySample();if(s=a&&this.workspaceGeometryMatches(a,r)?s+1:1,s>=ge)return!1;a=r}return null}async promoteFlyoutIfClipped(e,t,i,a){if(i<=0)return!1;const s=await this.candidateFitsAfterLayoutSettles(e,()=>this.flyoutFitsWithinPage(t,i,a),()=>this.workspaceCandidateIsMeasurable(!1,!0));return s===null?!0:s?!1:(await this.promoteFlyoutToOverlay(),!0)}async promoteFlyoutToOverlay(){this.setPreviewLayoutState(!1,!1),this.setWorkspaceWidths(0,0),this.flyoutOverlayPromotionWidth===null&&(this.flyoutOverlayPromotionWidth=this.visiblePageInlineBounds().width,this.armFlyoutOverlayRecovery()),await this.setPageFlyoutOverlay(!0)}async syncPreviewLayout(e,t=!0){if(e!==this.previewSyncGeneration||!this.isConnected||this.resizeSession||this.hasAttribute("data-workspace-keyboard-adjusting")||this.hasAttribute("data-workspace-position-held"))return;let i=!1;const a=this.previewVisible;this.toggleAttribute("data-preview-measuring",!0);try{const s=this.previewOpen&&this.previewHasContent(),o=this.previewMediaQuery?.matches??!1,r=this.hasAttribute("flyout-overlay-open"),n=this.hasAttribute("flyout-open"),d=this.hasAttribute("data-preview-navigation-collapsed"),m=this.getPreviewNavigationPair(),p=m===null?0:d?this.previewCollapsedSidebarWidth:this.shadowRoot?.querySelector(".esp-page-left")?.getBoundingClientRect().width??0,u=this.probeWidth(this.previewMinWidthProbe),y=this.optionalWidth("--esp-page-preview-default-width",this.previewDefaultWidthProbe),W=this.probeWidth(this.previewMaxWidthProbe),v=this.probeWidth(this.flyoutMinWidthProbe),w=this.optionalWidth("--esp-page-flyout-default-width",this.flyoutDefaultWidthProbe),c=this.probeWidth(this.flyoutMaxWidthProbe),h=this.probeWidth(this.mainMinWidthProbe);this.syncMainMaximumConfiguration();const b=this.probeWidth(this.mainMaxWidthProbe),P=this.mainTrackUnbounded()?0:b,C=this.openAutoFlyouts().some(S=>S.pageOverlayRequested===!0);if(this.setPreviewLayoutState(!1,!1),this.setWorkspaceWidths(0,0),C){const S=this.visiblePageInlineBounds().width,T=this.flyoutOverlayPromotionWidth===null||S>=this.flyoutOverlayPromotionWidth+ve;!o&&t&&this.flyoutOverlayRecoveryReady&&T&&this.workspaceMinimumsCanFit(h,s,u,!0,v)?await this.setPageFlyoutOverlay(!1):o&&await this.setPageFlyoutOverlay(!1);return}if(await this.updateComplete,e!==this.previewSyncGeneration)return;const k=s&&!o&&!r,g=n&&!o;if(h>0&&(!k||u>0)&&(!g||v>0)&&(k||g)&&!this.workspaceMinimumsCanFit(h,k,u,g,v)){g&&await this.promoteFlyoutToOverlay();return}const A=(k?u:0)+(g?v:0),L=k&&this.preferredPreviewWidth!==null||g&&this.preferredFlyoutWidth!==null||(k&&y!==null||g&&w!==null),j=(k?this.preferredPreviewWidth===null?u:this.clampWidth(this.preferredPreviewWidth,u,W):0)+(g?this.preferredFlyoutWidth===null?v:this.clampWidth(this.preferredFlyoutWidth,v,c):0),f=S=>{const T=this.workspaceTargetWidth(S,A,j),B=this.allocateWorkspaceWidths(T,k,g,u,W,v,c,y,w),K=S.maximum+h,Z=Math.max(0,K-S.natural),se=B.previewWidth+B.flyoutWidth,J=Math.max(0,Math.min(Z,K-se));return{allocation:B,mainWidth:J,reclaimsMain:J+l<Z}},D=(S,T)=>Math.abs(S.mainWidth-T.mainWidth)>l||Math.abs(S.allocation.previewWidth-T.allocation.previewWidth)>l||Math.abs(S.allocation.flyoutWidth-T.allocation.flyoutWidth)>l,V=this.workspaceWidthCapacity(h,P,d?p:0),I=f(V);let $=I.allocation;if(this.setWorkspaceWidths($.previewWidth,$.flyoutWidth,L),!k||u<=0){g&&await this.promoteFlyoutIfClipped(e,h,v,c);return}if(m!==null&&p>l){const S=V.maximum+h,T=this.workspaceWidthCapacityForAvailable(S+p,h,P),B=f(T);(d?D(f(this.workspaceWidthCapacityForAvailable(Math.max(0,S-we),h,P)),B):I.reclaimsMain&&D(I,B))?i=await this.setPreviewNavigationCollapse(!0):await this.setPreviewNavigationCollapse(!1)}else await this.setPreviewNavigationCollapse(!1);if(e!==this.previewSyncGeneration)return;const Y=this.workspaceWidthCapacity(h,P);if(Y.maximum+l<A){this.setPreviewLayoutState(!1,!1),this.setWorkspaceWidths(0,g?v:0),i=!1,g&&await this.promoteFlyoutToOverlay();return}const X=f(Y);if($=X.allocation,this.setWorkspaceWidths($.previewWidth,$.flyoutWidth,L),a||this.toggleAttribute("data-preview-validating",!0),this.setPreviewLayoutState(!0,X.reclaimsMain),await this.updateComplete,e!==this.previewSyncGeneration)return;const Q=await this.candidateFitsAfterLayoutSettles(e,()=>this.previewFitsWithinPage(h,u,W,g,v,c),()=>this.workspaceCandidateIsMeasurable(!0,g));if(Q===null)return;Q?this.toggleAttribute("data-preview-validating",!1):(this.setPreviewLayoutState(!1,!1),this.setWorkspaceWidths(0,g?v:0),i=!1,g&&await this.promoteFlyoutToOverlay())}finally{e===this.previewSyncGeneration&&!i&&await this.setPreviewNavigationCollapse(!1),e===this.previewSyncGeneration&&(this.toggleAttribute("data-preview-measuring",!1),this.toggleAttribute("data-preview-validating",!1),this.syncTrailingWorkspaceResizeAvailability(),this.requestUpdate())}}runScheduledPreviewLayout(){const e=this.previewSyncGeneration,t=this.previewOverlayRecoveryRequested;this.previewOverlayRecoveryRequested=!1,this.previewSyncTask=this.previewSyncTask.then(()=>this.syncPreviewLayout(e,t)).catch(()=>{})}setupPreviewLayoutObserver(){if(this.isConnected){if(!this.previewMediaQuery&&typeof window.matchMedia=="function"&&(this.previewMediaQuery=window.matchMedia(ue),this.previewMediaQuery.addEventListener("change",this.onPreviewMediaChange)),!this.previewResizeObserver&&typeof ResizeObserver<"u"){this.previewResizeObserver=new ResizeObserver(this.onPreviewResize),this.previewResizeObserver.observe(this);const e=this.shadowRoot?.querySelector(".esp-page-left");e&&this.previewResizeObserver.observe(e);for(const t of[this.previewMinWidthProbe,this.previewDefaultWidthProbe,this.previewMaxWidthProbe,this.flyoutMinWidthProbe,this.flyoutDefaultWidthProbe,this.flyoutMaxWidthProbe,this.mainMinWidthProbe,this.mainConfiguredMaxWidthProbe,this.mainMaxWidthProbe,this.resizeStepProbe,this.resizeLargeStepProbe])t.value&&this.previewResizeObserver.observe(t.value)}this.schedulePreviewLayout(!0)}}footerElementProvidesLandmark(e){return e.matches(ae)||e.querySelector(ae)!==null}syncFooterLandmark(){const t=(this.footerSlot.value?.assignedElements({flatten:!0})??[]).some(i=>this.footerElementProvidesLandmark(i));this.footerWrapperIsLandmark=!t}showPreview(){this.previewOpen=!0}closePreview(){this.previewOpen=!1}togglePreview(){this.previewOpen=!this.previewOpen}AddDialog(e){this.dialogZone.value?.appendChild(e)}firstUpdated(e){super.firstUpdated(e),this.syncFlyoutState(),this.setupPreviewLayoutObserver()}updated(e){super.updated(e),(e.has("fixedMenus")||e.has("headerPosition"))&&he().publish("fixed-menus-changed",{fixed:this.fixedMenus||this.headerPosition==="fixed"}),(e.has("previewOpen")||e.has("previewCollapseSidebar")||e.has("align"))&&this.schedulePreviewLayout(!0),e.has("workspaceResizable")&&!this.workspaceResizable&&(this.finishWorkspaceKeyboardResize(),this.endWorkspaceResize(),this.clearWorkspaceRecenteringState()),this.warnSiteRailSlots()}warnSiteRailSlots(){this.kind!=="site"||this.warnedSiteRails||!["sidebar","right"].some(t=>(this.shadowRoot?.querySelector(`slot[name="${t}"]`)?.assignedElements({flatten:!0}).length??0)>0)||(this.warnedSiteRails=!0,console.warn('Espalier page: kind="site" does not compose with the sidebar/right rails \u2014 sections span the full viewport and the shared well column ignores rail width. Use kind="wide" for railed layouts, or remove the rail slots from a site page.'))}render(){const e=this.fixedMenus||this.headerPosition==="fixed",t=!e&&this.headerPosition==="sticky",i=this.mainPreviewResizeRange(),a=this.previewProbes.minimum,s=this.flyoutProbes.minimum,o=this.flyoutProbes.maximum,r=this.mainProbes.minimum,n=this.probeWidth(this.mainMaxWidthProbe),d=this.shadowRoot?.querySelector(".esp-page-main")?.getBoundingClientRect().width??0,m=this.hasAttribute("flyout-open"),p=d+this.allocatedPreviewWidth,u=i.min<=a+l,y=m&&u?Math.max(0,this.allocatedFlyoutWidth-s):0,W=Math.max(r,p-i.max),v=Math.max(W,Math.max(r,p-i.min)+y),w=n>0?Math.max(W,Math.min(Math.max(r,n),v)):v,c=n>0&&d+l>=n?`${Math.round(d)}px main, ${Math.round(this.allocatedPreviewWidth)}px preview`:ee;let h,b;if(this.previewVisible){const f=this.previewFlyoutResizeRange(),D=this.allocatedPreviewWidth+this.allocatedFlyoutWidth,I=f.min<=a+l?Math.max(0,d-r):0;h=Math.max(s,D-f.max),b=Math.max(h,Math.min(o,D-f.min+I))}else{const f=this.flyoutOnlyResizeRange();h=f.min,b=f.max}const P=this.previewVisible?"preview-flyout-resize-handle":"main-flyout-resize-handle",C=this.previewVisible?"Resize preview and help panes":"Resize help pane",k=this.previewVisible?`${Math.round(this.allocatedPreviewWidth)}px preview, ${Math.round(this.allocatedFlyoutWidth)}px help`:`${Math.round(this.allocatedFlyoutWidth)}px help`,g=m?"flyout-end":"preview-end",F=g==="flyout-end"?this.allocatedFlyoutWidth:this.allocatedPreviewWidth,A=this.workspaceLogicalGutterWidths(),E=this.trailingPaneResizeRange(g,F,A.leading+A.trailing),O=g==="flyout-end"?"flyout-end-resize-handle":"preview-end-resize-handle",L=g==="flyout-end"?"Resize help pane from its outer edge":"Resize preview pane from its outer edge";return oe`
2
2
  <div part="wrapper" class="esp-page ${le({"fixed-menus":e,"fixed-header":e,"sticky-header":t})}">
3
3
  <div part="canvas" class="esp-page-canvas esp-page-canvas--left" aria-hidden="true"></div>
4
4
  <div part="canvas" class="esp-page-canvas esp-page-canvas--right" aria-hidden="true"></div>
@@ -120,7 +120,7 @@ var M=function(q,e,t,i){var a=arguments.length,s=a<3?e:i===null?i=Object.getOwnP
120
120
  role="separator"
121
121
  aria-orientation="vertical"
122
122
  aria-label=${C}
123
- aria-valuemin=${Math.round(p)}
123
+ aria-valuemin=${Math.round(h)}
124
124
  aria-valuemax=${Math.round(b)}
125
125
  aria-valuenow=${Math.round(this.allocatedFlyoutWidth)}
126
126
  aria-valuetext=${k}
@@ -134,13 +134,13 @@ var M=function(q,e,t,i){var a=arguments.length,s=a<3?e:i===null?i=Object.getOwnP
134
134
  @blur=${this.onWorkspaceResizeBlur}
135
135
  ></div>
136
136
  <div
137
- part=${E}
137
+ part=${O}
138
138
  class="esp-page-workspace-resize-handle esp-page-workspace-end-resize-handle"
139
139
  role="separator"
140
140
  aria-orientation="vertical"
141
141
  aria-label=${L}
142
- aria-valuemin=${Math.round(O.min)}
143
- aria-valuemax=${Math.round(O.max)}
142
+ aria-valuemin=${Math.round(E.min)}
143
+ aria-valuemax=${Math.round(E.max)}
144
144
  aria-valuenow=${Math.round(F)}
145
145
  tabindex="0"
146
146
  @pointerdown=${f=>this.onWorkspaceResizePointerDown(g,f)}
@@ -248,6 +248,14 @@ var M=function(q,e,t,i){var a=arguments.length,s=a<3?e:i===null?i=Object.getOwnP
248
248
  }
249
249
 
250
250
 
251
+ :host([kind="site"]) {
252
+ --_esp-page-resolved-max-width: none;
253
+ --_esp-page-main-track: 1fr;
254
+ --_esp-page-gutter-left: 0fr;
255
+ --_esp-page-gutter-right: 0fr;
256
+ }
257
+
258
+
251
259
  :host([flyout-open]) {
252
260
  --_esp-page-flyout-min: var(--_esp-page-flyout-resolved-min-width);
253
261
  }
@@ -274,7 +282,9 @@ var M=function(q,e,t,i){var a=arguments.length,s=a<3?e:i===null?i=Object.getOwnP
274
282
  }
275
283
 
276
284
  :host([kind="full"]:not([data-main-max-configured])[flyout-open]),
277
- :host([kind="full"]:not([data-main-max-configured])[preview-reclaiming]) {
285
+ :host([kind="full"]:not([data-main-max-configured])[preview-reclaiming]),
286
+ :host([kind="site"][flyout-open]),
287
+ :host([kind="site"][preview-reclaiming]) {
278
288
  --_esp-page-main-track: minmax(var(--_esp-page-main-min-width), 1fr);
279
289
  }
280
290
 
@@ -294,7 +304,9 @@ var M=function(q,e,t,i){var a=arguments.length,s=a<3?e:i===null?i=Object.getOwnP
294
304
  }
295
305
 
296
306
  :host([kind="full"]:not([data-main-max-configured])[flyout-open]),
297
- :host([kind="full"]:not([data-main-max-configured])[preview-reclaiming]) {
307
+ :host([kind="full"]:not([data-main-max-configured])[preview-reclaiming]),
308
+ :host([kind="site"][flyout-open]),
309
+ :host([kind="site"][preview-reclaiming]) {
298
310
  --_esp-page-main-track: 1fr;
299
311
  }
300
312
 
@@ -390,6 +402,17 @@ var M=function(q,e,t,i){var a=arguments.length,s=a<3?e:i===null?i=Object.getOwnP
390
402
  }
391
403
 
392
404
 
405
+ :host([kind="site"]) slot[name="header"]::slotted(esp-header) {
406
+ --esp-header-content-max-width: var(--esp-page-well-max-width, 72rem);
407
+ --esp-header-content-lead: 0.5;
408
+ }
409
+
410
+ :host([kind="site"]) slot[name="footer"]::slotted(esp-footer) {
411
+ --esp-footer-content-max-width: var(--esp-page-well-max-width, 72rem);
412
+ --esp-footer-content-lead: 0.5;
413
+ }
414
+
415
+
393
416
  :host([contained]) .esp-page > div.esp-page-top,
394
417
  :host([contained]) .esp-page > div.esp-page-footer {
395
418
  grid-column: surface;
@@ -397,18 +420,22 @@ var M=function(q,e,t,i){var a=arguments.length,s=a<3?e:i===null?i=Object.getOwnP
397
420
 
398
421
 
399
422
  :host([contained]) slot[name="header"]::slotted(esp-header) {
400
- --esp-header-content-max-width: 100%;
401
423
  --esp-header-shadow: none;
402
424
  }
403
425
 
404
- :host([contained]) slot[name="footer"]::slotted(esp-footer) {
426
+
427
+ :host([contained]:not([kind="site"])) slot[name="header"]::slotted(esp-header) {
428
+ --esp-header-content-max-width: 100%;
429
+ }
430
+
431
+ :host([contained]:not([kind="site"])) slot[name="footer"]::slotted(esp-footer) {
405
432
  --esp-footer-content-max-width: 100%;
406
433
  }
407
434
 
408
435
  :host([kind="narrow"]) .esp-page > div.esp-page-main {
409
436
 
410
437
  > ::slotted(*) {
411
- max-inline-size: 66ch;
438
+ max-inline-size: var(--esp-measure, 66ch);
412
439
  }
413
440
  }
414
441
 
@@ -1,6 +1,6 @@
1
1
  import { LitElement, type PropertyValues } from "lit";
2
2
  import { type SchemeEvents, type SeedColorRoot } from "../shared/bus-events.js";
3
- import { type EspalierTheme } from "../shared/theme.js";
3
+ import { type EspalierTheme, type PartialTheme } from "../shared/theme.js";
4
4
  import { type ImageTextureDefinition } from "../shared/image-texture-registry.js";
5
5
  export { registerImageTexture, registeredImageTextures, BUILT_IN_IMAGE_TEXTURES, type ImageTextureDefinition, } from "../shared/image-texture-registry.js";
6
6
  export type GoogleFontLoadingPolicy = "auto" | "none";
@@ -136,6 +136,29 @@ export declare class EspalierRoot extends LitElement implements SeedColorRoot {
136
136
  * @type {string}
137
137
  */
138
138
  darkThemeAttr: string;
139
+ /**
140
+ * Object form of the light theme (ESP0174). Assigning a partial theme
141
+ * object encodes it into {@link lightThemeAttr} — the same pipeline
142
+ * the `light-theme` attribute feeds, so both entry points stay one
143
+ * source of truth. Reading decodes the currently mounted partial, or
144
+ * `null` when none is set.
145
+ *
146
+ * Registered as a reactive property (not just an accessor pair) so a
147
+ * value assigned BEFORE the element upgrades — the classic
148
+ * pre-definition own-property shadow — is captured and re-applied
149
+ * through this setter when the upgrade runs.
150
+ *
151
+ * ```js
152
+ * document.querySelector("esp-root").lightTheme = { seedColor: "#78486A" };
153
+ * ```
154
+ */
155
+ get lightTheme(): PartialTheme | null;
156
+ set lightTheme(theme: PartialTheme | null);
157
+ /**
158
+ * Object form of the dark theme (ESP0174) — see {@link lightTheme}.
159
+ */
160
+ get darkTheme(): PartialTheme | null;
161
+ set darkTheme(theme: PartialTheme | null);
139
162
  /**
140
163
  * Root path for locally-cached font CSS files used by
141
164
  * `<esp-font-picker>` to load font previews.
@@ -1,4 +1,4 @@
1
- var a=function(d,e,t,o){var l=arguments.length,s=l<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(d,e,t,o);else for(var n=d.length-1;n>=0;n--)(r=d[n])&&(s=(l<3?r(s):l>3?r(e,t,s):r(e,t))||s);return l>3&&s&&Object.defineProperty(e,t,s),s},h;import{css as k,html as b,LitElement as C}from"lit";import{customElement as E,property as c}from"lit/decorators.js";import{getEspBus as p}from"../shared/bus-events.js";import{subscribeToRootEvent as T}from"../shared/root-event-subscription.js";import{DEFAULT_LIGHT_THEME as g,DEFAULT_DARK_THEME as f,parseTheme as y,mergeTheme as v}from"../shared/theme.js";import{computeThemeProperties as x}from"./helpers/compute-theme-properties.js";import{registerImageTexture as R,registeredImageTextures as D}from"../shared/image-texture-registry.js";import{registerImageTexture as W,registeredImageTextures as _,BUILT_IN_IMAGE_TEXTURES as H}from"../shared/image-texture-registry.js";let i=h=class extends C{constructor(){super(...arguments),this.schemeBacker="",this.schemeExplicitlySet=!1,this.resolvingDefaultScheme=!1,this.themeEventsReady=!1,this.systemSchemeQuery=null,this.lastSeedColor="",this.resolvedLightTheme={...g},this.resolvedDarkTheme={...f},this.appliedDataRampProperties=new Set,this.documentClickRegistrationActive=!1,this.correlationId=globalThis.crypto?.randomUUID?.()??Math.random().toString(36),this.lightThemeAttr="",this.darkThemeAttr="",this.fontCSSRoot="/css/fonts/",this.fontDefinitionsUrl="",this.googleFontLoading="auto",this.iconSpriteUrl="/assets/icons.svg",this.defaultScheme="light",this.resizeObserver=new ResizeObserver(()=>{p().publish("window-resized",{emWidth:window.innerWidth/parseFloat(getComputedStyle(document.documentElement).fontSize),emHeight:window.innerHeight/parseFloat(getComputedStyle(document.documentElement).fontSize),pxWidth:window.innerWidth,pxHeight:window.innerHeight})}),this.handleSystemSchemeChange=e=>{this.schemeExplicitlySet||this.defaultScheme!=="system"||(this.resolvingDefaultScheme=!0,this.scheme=e.matches?"dark":"light",this.resolvingDefaultScheme=!1)}}static registerTexture(e,t){R(e,t)}static registeredTextures(){return D()}subscribeScoped(e,t){return T(this,e,t)}get scheme(){return this.schemeBacker}set scheme(e){const t=e==="dark"?"dark":e==="light"?"light":"",o=this.schemeBacker,l=this.schemeExplicitlySet;this.resolvingDefaultScheme||(this.schemeExplicitlySet=t.length>0);const s=t||this.resolveDefaultScheme();l!==this.schemeExplicitlySet&&this.isConnected&&this.syncSystemSchemeListener(),s!==o&&(this.schemeBacker=s,this.requestUpdate("scheme",o),this.themeEventsReady&&p().publish("scheme-changed",{scheme:s,correlationId:this.correlationId}))}get seedColor(){return this.activeTheme.seedColor}static extractFamily(e){if(!e)return"";const t=e.match(/^"([^"]+)"|^'([^']+)'/);return t&&(t[1]||t[2])||""}injectGoogleFontLink(e,t,o){const l="data-esp-font",s=`${this.correlationId}-${e}`,r=document.head.querySelector(`link[${l}="${s}"]`);if(this.googleFontLoading==="none"){r?.remove();return}if(r&&t&&r.dataset.espFamily===t&&r.dataset.espWeight===(o??"")||(r?.remove(),!t))return;const n=encodeURIComponent(t),u=o==="bold"?"700":o==="normal"?"400":o,S=u&&u!=="400"?`:wght@${u}`:"",m=document.createElement("link");m.rel="stylesheet",m.href=`https://fonts.googleapis.com/css2?family=${n}${S}&display=swap`,m.setAttribute(l,s),m.dataset.espFamily=t,m.dataset.espWeight=o??"",document.head.appendChild(m)}syncGoogleFontLinks(){this.googleFontLoading==="none"&&this.removeRuntimeGoogleFontLinks();const e=this.activeTheme;this.injectGoogleFontLink("body",h.extractFamily(e.fontBody),e.fontWeightBody),this.injectGoogleFontLink("headings",h.extractFamily(e.fontHeadings),e.fontWeightHeadings),this.injectGoogleFontLink("brand",h.extractFamily(e.fontBrand),e.fontWeightBrand),this.injectGoogleFontLink("monospace",h.extractFamily(e.fontMonospace),e.fontWeightMonospace)}removeRuntimeGoogleFontLinks(){for(const e of document.head.querySelectorAll(`link[data-esp-font^="${this.correlationId}-"]`))e.remove();for(const e of document.head.querySelectorAll(`link[data-esp-font-picker-root="${CSS.escape(this.correlationId)}"]`))e.remove()}get activeTheme(){return this.scheme==="dark"?this.resolvedDarkTheme:this.resolvedLightTheme}resolveThemes(){const e=this.lightThemeAttr?y(this.lightThemeAttr):null;this.resolvedLightTheme=e?v(g,e):{...g};const t=this.darkThemeAttr?y(this.darkThemeAttr):null;this.resolvedDarkTheme=t?v(f,t):{...f}}connectedCallback(){super.connectedCallback(),this.registerDocumentClickBridge(),this.resizeObserver.observe(this),this.hasUpdated&&(this.applyDefaultScheme(),this.syncGoogleFontLinks())}willUpdate(e){const t=["lightThemeAttr","darkThemeAttr"];(!this.lastSeedColor||t.some(n=>e.has(n)))&&(this.resolveThemes(),this.themeEventsReady&&p().publish("theme-changed",{correlationId:this.correlationId}));const l=x(this.activeTheme,this.scheme==="dark"?"dark":"light"),s=new Set(Object.keys(l).filter(n=>n.startsWith("--esp-color-ramp-")));for(const n of this.appliedDataRampProperties)s.has(n)||this.style.removeProperty(n);for(const[n,u]of Object.entries(l))this.style.setProperty(n,u);this.appliedDataRampProperties=s;const r=this.activeTheme.seedColor;this.themeEventsReady&&this.lastSeedColor&&this.lastSeedColor!==r&&p().publish("seed-color-changed",{seedColor:r,correlationId:this.correlationId}),this.lastSeedColor=r,this.themeEventsReady&&e.has("iconSpriteUrl")&&p().publish("icon-sprite-url-changed",{iconSpriteUrl:this.iconSpriteUrl,correlationId:this.correlationId}),this.syncGoogleFontLinks()}firstUpdated(){const e=this.activeTheme.stylesheets;if(e.length)for(const t of e){const o=document.createElement("link");o.rel="stylesheet",o.href=t,document.head.appendChild(o)}if(!document.getElementById("esp-root-base-styles")){const t=document.createElement("style");t.id="esp-root-base-styles",t.textContent=h.lightDomStyles,document.head.appendChild(t)}this.applyDefaultScheme(),this.lastSeedColor=this.activeTheme.seedColor,this.themeEventsReady=!0}updated(e){(e.has("defaultScheme")||e.has("scheme"))&&!this.schemeExplicitlySet&&this.applyDefaultScheme()}disconnectedCallback(){this.unregisterDocumentClickBridge(),this.systemSchemeQuery?.removeEventListener("change",this.handleSystemSchemeChange),this.systemSchemeQuery=null,this.resizeObserver.disconnect(),this.removeRuntimeGoogleFontLinks(),super.disconnectedCallback()}registerDocumentClickBridge(){this.documentClickRegistrationActive||(this.documentClickRegistrationActive=!0,h.connectedRootCount+=1,h.connectedRootCount===1&&document.addEventListener("click",h.handleDocumentClick))}unregisterDocumentClickBridge(){this.documentClickRegistrationActive&&(this.documentClickRegistrationActive=!1,h.connectedRootCount=Math.max(0,h.connectedRootCount-1),h.connectedRootCount===0&&document.removeEventListener("click",h.handleDocumentClick))}applyDefaultScheme(){this.schemeExplicitlySet||(this.resolvingDefaultScheme=!0,this.scheme=this.resolveDefaultScheme(),this.resolvingDefaultScheme=!1,this.syncSystemSchemeListener())}resolveDefaultScheme(){return this.defaultScheme==="dark"||this.defaultScheme==="system"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"}syncSystemSchemeListener(){if(this.schemeExplicitlySet||this.defaultScheme!=="system"||!window.matchMedia){this.systemSchemeQuery?.removeEventListener("change",this.handleSystemSchemeChange),this.systemSchemeQuery=null;return}this.systemSchemeQuery||(this.systemSchemeQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.systemSchemeQuery.addEventListener("change",this.handleSystemSchemeChange))}render(){return b`<slot></slot>`}};i.connectedRootCount=0,i.handleDocumentClick=d=>{const e=d.composedPath().filter(t=>t instanceof HTMLElement&&t.tagName==="ESP-POPOVER");p().publish("close-popovers",{source:d.target??void 0,skipPopovers:e})},i.lightDomStyles=`
1
+ var a=function(d,e,t,o){var l=arguments.length,s=l<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(d,e,t,o);else for(var n=d.length-1;n>=0;n--)(r=d[n])&&(s=(l<3?r(s):l>3?r(e,t,s):r(e,t))||s);return l>3&&s&&Object.defineProperty(e,t,s),s},h;import{css as b,html as T,LitElement as C}from"lit";import{customElement as E,property as c}from"lit/decorators.js";import{getEspBus as p}from"../shared/bus-events.js";import{subscribeToRootEvent as x}from"../shared/root-event-subscription.js";import{DEFAULT_LIGHT_THEME as f,DEFAULT_DARK_THEME as y,encodeTheme as v,parseTheme as g,mergeTheme as S}from"../shared/theme.js";import{computeThemeProperties as R}from"./helpers/compute-theme-properties.js";import{registerImageTexture as D,registeredImageTextures as L}from"../shared/image-texture-registry.js";import{registerImageTexture as _,registeredImageTextures as H,BUILT_IN_IMAGE_TEXTURES as M}from"../shared/image-texture-registry.js";let i=h=class extends C{constructor(){super(...arguments),this.schemeBacker="",this.schemeExplicitlySet=!1,this.resolvingDefaultScheme=!1,this.themeEventsReady=!1,this.systemSchemeQuery=null,this.lastSeedColor="",this.resolvedLightTheme={...f},this.resolvedDarkTheme={...y},this.appliedDataRampProperties=new Set,this.documentClickRegistrationActive=!1,this.correlationId=globalThis.crypto?.randomUUID?.()??Math.random().toString(36),this.lightThemeAttr="",this.darkThemeAttr="",this.fontCSSRoot="/css/fonts/",this.fontDefinitionsUrl="",this.googleFontLoading="auto",this.iconSpriteUrl="/assets/icons.svg",this.defaultScheme="light",this.resizeObserver=new ResizeObserver(()=>{p().publish("window-resized",{emWidth:window.innerWidth/parseFloat(getComputedStyle(document.documentElement).fontSize),emHeight:window.innerHeight/parseFloat(getComputedStyle(document.documentElement).fontSize),pxWidth:window.innerWidth,pxHeight:window.innerHeight})}),this.handleSystemSchemeChange=e=>{this.schemeExplicitlySet||this.defaultScheme!=="system"||(this.resolvingDefaultScheme=!0,this.scheme=e.matches?"dark":"light",this.resolvingDefaultScheme=!1)}}static registerTexture(e,t){D(e,t)}static registeredTextures(){return L()}subscribeScoped(e,t){return x(this,e,t)}get lightTheme(){return this.lightThemeAttr?g(this.lightThemeAttr):null}set lightTheme(e){this.lightThemeAttr=e?v(e):""}get darkTheme(){return this.darkThemeAttr?g(this.darkThemeAttr):null}set darkTheme(e){this.darkThemeAttr=e?v(e):""}get scheme(){return this.schemeBacker}set scheme(e){const t=e==="dark"?"dark":e==="light"?"light":"",o=this.schemeBacker,l=this.schemeExplicitlySet;this.resolvingDefaultScheme||(this.schemeExplicitlySet=t.length>0);const s=t||this.resolveDefaultScheme();l!==this.schemeExplicitlySet&&this.isConnected&&this.syncSystemSchemeListener(),s!==o&&(this.schemeBacker=s,this.requestUpdate("scheme",o),this.themeEventsReady&&p().publish("scheme-changed",{scheme:s,correlationId:this.correlationId}))}get seedColor(){return this.activeTheme.seedColor}static extractFamily(e){if(!e)return"";const t=e.match(/^"([^"]+)"|^'([^']+)'/);return t&&(t[1]||t[2])||""}injectGoogleFontLink(e,t,o){const l="data-esp-font",s=`${this.correlationId}-${e}`,r=document.head.querySelector(`link[${l}="${s}"]`);if(this.googleFontLoading==="none"){r?.remove();return}if(r&&t&&r.dataset.espFamily===t&&r.dataset.espWeight===(o??"")||(r?.remove(),!t))return;const n=encodeURIComponent(t),u=o==="bold"?"700":o==="normal"?"400":o,k=u&&u!=="400"?`:wght@${u}`:"",m=document.createElement("link");m.rel="stylesheet",m.href=`https://fonts.googleapis.com/css2?family=${n}${k}&display=swap`,m.setAttribute(l,s),m.dataset.espFamily=t,m.dataset.espWeight=o??"",document.head.appendChild(m)}syncGoogleFontLinks(){this.googleFontLoading==="none"&&this.removeRuntimeGoogleFontLinks();const e=this.activeTheme;this.injectGoogleFontLink("body",h.extractFamily(e.fontBody),e.fontWeightBody),this.injectGoogleFontLink("headings",h.extractFamily(e.fontHeadings),e.fontWeightHeadings),this.injectGoogleFontLink("brand",h.extractFamily(e.fontBrand),e.fontWeightBrand),this.injectGoogleFontLink("monospace",h.extractFamily(e.fontMonospace),e.fontWeightMonospace)}removeRuntimeGoogleFontLinks(){for(const e of document.head.querySelectorAll(`link[data-esp-font^="${this.correlationId}-"]`))e.remove();for(const e of document.head.querySelectorAll(`link[data-esp-font-picker-root="${CSS.escape(this.correlationId)}"]`))e.remove()}get activeTheme(){return this.scheme==="dark"?this.resolvedDarkTheme:this.resolvedLightTheme}resolveThemes(){const e=this.lightThemeAttr?g(this.lightThemeAttr):null;this.resolvedLightTheme=e?S(f,e):{...f};const t=this.darkThemeAttr?g(this.darkThemeAttr):null;this.resolvedDarkTheme=t?S(y,t):{...y}}connectedCallback(){super.connectedCallback(),this.registerDocumentClickBridge(),this.resizeObserver.observe(this),this.hasUpdated&&(this.applyDefaultScheme(),this.syncGoogleFontLinks())}willUpdate(e){const t=["lightThemeAttr","darkThemeAttr"];(!this.lastSeedColor||t.some(n=>e.has(n)))&&(this.resolveThemes(),this.themeEventsReady&&p().publish("theme-changed",{correlationId:this.correlationId}));const l=R(this.activeTheme,this.scheme==="dark"?"dark":"light"),s=new Set(Object.keys(l).filter(n=>n.startsWith("--esp-color-ramp-")));for(const n of this.appliedDataRampProperties)s.has(n)||this.style.removeProperty(n);for(const[n,u]of Object.entries(l))this.style.setProperty(n,u);this.appliedDataRampProperties=s;const r=this.activeTheme.seedColor;this.themeEventsReady&&this.lastSeedColor&&this.lastSeedColor!==r&&p().publish("seed-color-changed",{seedColor:r,correlationId:this.correlationId}),this.lastSeedColor=r,this.themeEventsReady&&e.has("iconSpriteUrl")&&p().publish("icon-sprite-url-changed",{iconSpriteUrl:this.iconSpriteUrl,correlationId:this.correlationId}),this.syncGoogleFontLinks()}firstUpdated(){const e=this.activeTheme.stylesheets;if(e.length)for(const t of e){const o=document.createElement("link");o.rel="stylesheet",o.href=t,document.head.appendChild(o)}if(!document.getElementById("esp-root-base-styles")){const t=document.createElement("style");t.id="esp-root-base-styles",t.textContent=h.lightDomStyles,document.head.appendChild(t)}this.applyDefaultScheme(),this.lastSeedColor=this.activeTheme.seedColor,this.themeEventsReady=!0}updated(e){(e.has("defaultScheme")||e.has("scheme"))&&!this.schemeExplicitlySet&&this.applyDefaultScheme()}disconnectedCallback(){this.unregisterDocumentClickBridge(),this.systemSchemeQuery?.removeEventListener("change",this.handleSystemSchemeChange),this.systemSchemeQuery=null,this.resizeObserver.disconnect(),this.removeRuntimeGoogleFontLinks(),super.disconnectedCallback()}registerDocumentClickBridge(){this.documentClickRegistrationActive||(this.documentClickRegistrationActive=!0,h.connectedRootCount+=1,h.connectedRootCount===1&&document.addEventListener("click",h.handleDocumentClick))}unregisterDocumentClickBridge(){this.documentClickRegistrationActive&&(this.documentClickRegistrationActive=!1,h.connectedRootCount=Math.max(0,h.connectedRootCount-1),h.connectedRootCount===0&&document.removeEventListener("click",h.handleDocumentClick))}applyDefaultScheme(){this.schemeExplicitlySet||(this.resolvingDefaultScheme=!0,this.scheme=this.resolveDefaultScheme(),this.resolvingDefaultScheme=!1,this.syncSystemSchemeListener())}resolveDefaultScheme(){return this.defaultScheme==="dark"||this.defaultScheme==="system"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"}syncSystemSchemeListener(){if(this.schemeExplicitlySet||this.defaultScheme!=="system"||!window.matchMedia){this.systemSchemeQuery?.removeEventListener("change",this.handleSystemSchemeChange),this.systemSchemeQuery=null;return}this.systemSchemeQuery||(this.systemSchemeQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.systemSchemeQuery.addEventListener("change",this.handleSystemSchemeChange))}render(){return T`<slot></slot>`}};i.connectedRootCount=0,i.handleDocumentClick=d=>{const e=d.composedPath().filter(t=>t instanceof HTMLElement&&t.tagName==="ESP-POPOVER");p().publish("close-popovers",{source:d.target??void 0,skipPopovers:e})},i.lightDomStyles=`
2
2
 
3
3
  esp-root {
4
4
  font-family: var(--esp-font-body);
@@ -121,8 +121,8 @@ var a=function(d,e,t,o){var l=arguments.length,s=l<3?e:o===null?o=Object.getOwnP
121
121
  max-width: 100%;
122
122
  display: block;
123
123
  }
124
- `,i.styles=k`
124
+ `,i.styles=b`
125
125
  :host {
126
126
  display: block;
127
127
  }
128
- `,a([c({attribute:!1})],i.prototype,"correlationId",void 0),a([c({attribute:"light-theme"})],i.prototype,"lightThemeAttr",void 0),a([c({attribute:"dark-theme"})],i.prototype,"darkThemeAttr",void 0),a([c({attribute:"font-css-root",type:String})],i.prototype,"fontCSSRoot",void 0),a([c({attribute:"font-definitions-url",type:String})],i.prototype,"fontDefinitionsUrl",void 0),a([c({attribute:"google-font-loading",type:String})],i.prototype,"googleFontLoading",void 0),a([c({attribute:"icon-sprite-url",type:String})],i.prototype,"iconSpriteUrl",void 0),a([c({attribute:"default-scheme",type:String,reflect:!0})],i.prototype,"defaultScheme",void 0),a([c({attribute:"scheme",type:String,reflect:!0})],i.prototype,"scheme",null),i=h=a([E("esp-root")],i);export{H as BUILT_IN_IMAGE_TEXTURES,i as EspalierRoot,W as registerImageTexture,_ as registeredImageTextures};
128
+ `,a([c({attribute:!1})],i.prototype,"correlationId",void 0),a([c({attribute:"light-theme"})],i.prototype,"lightThemeAttr",void 0),a([c({attribute:"dark-theme"})],i.prototype,"darkThemeAttr",void 0),a([c({attribute:!1})],i.prototype,"lightTheme",null),a([c({attribute:!1})],i.prototype,"darkTheme",null),a([c({attribute:"font-css-root",type:String})],i.prototype,"fontCSSRoot",void 0),a([c({attribute:"font-definitions-url",type:String})],i.prototype,"fontDefinitionsUrl",void 0),a([c({attribute:"google-font-loading",type:String})],i.prototype,"googleFontLoading",void 0),a([c({attribute:"icon-sprite-url",type:String})],i.prototype,"iconSpriteUrl",void 0),a([c({attribute:"default-scheme",type:String,reflect:!0})],i.prototype,"defaultScheme",void 0),a([c({attribute:"scheme",type:String,reflect:!0})],i.prototype,"scheme",null),i=h=a([E("esp-root")],i);export{M as BUILT_IN_IMAGE_TEXTURES,i as EspalierRoot,_ as registerImageTexture,H as registeredImageTextures};