@praxisui/settings-panel 10.0.0-rc.8 → 10.0.0-rc.81

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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, Renderer2, signal, DestroyRef, ViewContainerRef, HostListener, ViewChild, ViewEncapsulation, ChangeDetectionStrategy, Component, InjectionToken, Injector, Injectable, ElementRef, ChangeDetectorRef, ENVIRONMENT_INITIALIZER } from '@angular/core';
2
+ import { inject, Renderer2, signal, DestroyRef, Injector, afterNextRender, ViewContainerRef, HostListener, ViewChild, ViewEncapsulation, ChangeDetectionStrategy, Component, InjectionToken, Injectable, ElementRef, ChangeDetectorRef, ENVIRONMENT_INITIALIZER } from '@angular/core';
3
3
  import * as i2 from '@angular/common';
4
4
  import { CommonModule, NgStyle, NgClass } from '@angular/common';
5
5
  import { InteractivityChecker, CdkTrapFocus } from '@angular/cdk/a11y';
@@ -14,10 +14,10 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
14
14
  import * as i4$1 from '@angular/material/tooltip';
15
15
  import { MatTooltipModule } from '@angular/material/tooltip';
16
16
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
17
- import { filter, switchMap, debounceTime, distinctUntilChanged } from 'rxjs/operators';
18
- import { isObservable, firstValueFrom, of, from, Subject, ReplaySubject, take, takeUntil, BehaviorSubject } from 'rxjs';
17
+ import { finalize, filter, switchMap, map, debounceTime, distinctUntilChanged } from 'rxjs/operators';
18
+ import { firstValueFrom, isObservable, of, from, Subject, ReplaySubject, take, takeUntil, BehaviorSubject } from 'rxjs';
19
19
  import * as i1$2 from '@praxisui/core';
20
- import { providePraxisI18n, PraxisI18nService, PraxisIconButtonComponent, PraxisIconDirective, SETTINGS_PANEL_DATA as SETTINGS_PANEL_DATA$1, PraxisLayerScaleStyleService, SETTINGS_PANEL_BRIDGE, SURFACE_DRAWER_BRIDGE, SURFACE_DRAWER_CONTENT_DATA, SURFACE_DRAWER_REF, GlobalConfigService, FieldControlType, IconPickerService, LoggerService, ComponentMetadataRegistry } from '@praxisui/core';
20
+ import { providePraxisI18n, PraxisI18nService, PraxisContextSwitchGuard, ApiConfigStorage, ASYNC_CONFIG_STORAGE, DeferredAsyncConfigStorage, parseConfigPersistenceError, PraxisIconButtonComponent, PraxisIconDirective, SETTINGS_PANEL_DATA as SETTINGS_PANEL_DATA$1, resolveSidePanelViewportWidth, canExpandSidePanel, clampSidePanelWidthPx, resolveExpandedSidePanelWidthPx, parseSidePanelWidthPx, resolveSidePanelPresetWidth, resolveSidePanelPresetWidthPx, readPersistedSidePanelWidth, writePersistedSidePanelWidth, PraxisLayerScaleStyleService, SETTINGS_PANEL_BRIDGE, SURFACE_DRAWER_BRIDGE, SURFACE_DRAWER_CONTENT_DATA, SURFACE_DRAWER_REF, GlobalConfigService, FieldControlType, IconPickerService, LoggerService, ComponentMetadataRegistry } from '@praxisui/core';
21
21
  import { ConfirmDialogComponent } from '@praxisui/dynamic-fields';
22
22
  import * as i1$1 from '@angular/cdk/overlay';
23
23
  import { ComponentPortal } from '@angular/cdk/portal';
@@ -35,6 +35,8 @@ const PRAXIS_SETTINGS_PANEL_GLOBAL_CONFIG_EDITOR_PT_BR = {
35
35
  'Cache & Persistence': 'Cache & Persistência',
36
36
  Table: 'Tabela',
37
37
  Dialog: 'Dialog',
38
+ 'Dynamic Pages': 'Páginas Dinâmicas',
39
+ 'Global presets for layout, theme, widget shell and canvas grid': 'Presets globais de layout, tema, moldura de widgets e grade de canvas',
38
40
  'Settings saved': 'Configurações salvas',
39
41
  'Save failed.': 'Falha ao salvar configurações.',
40
42
  'Global settings': 'Configurações globais',
@@ -220,6 +222,8 @@ const PRAXIS_SETTINGS_PANEL_GLOBAL_CONFIG_EDITOR_PT_BR = {
220
222
  'Toolbar visível': 'Toolbar visível',
221
223
  'Cache & Persistência': 'Cache & Persistence',
222
224
  Tabela: 'Table',
225
+ 'Páginas Dinâmicas': 'Páginas Dinâmicas',
226
+ 'Definido pela página (sem preset forçado)': 'Definido pela página (sem preset forçado)',
223
227
  Salvar: 'Save',
224
228
  Cancelar: 'Cancel',
225
229
  Redefinir: 'Reset',
@@ -230,6 +234,8 @@ const PRAXIS_SETTINGS_PANEL_GLOBAL_CONFIG_EDITOR_EN_US = {
230
234
  'Cache & Persistence': 'Cache & Persistence',
231
235
  Table: 'Table',
232
236
  Dialog: 'Dialog',
237
+ 'Dynamic Pages': 'Dynamic Pages',
238
+ 'Global presets for layout, theme, widget shell and canvas grid': 'Global presets for layout, theme, widget shell and canvas grid',
233
239
  'Settings saved': 'Settings saved',
234
240
  'Save failed.': 'Save failed.',
235
241
  'Global settings': 'Global settings',
@@ -415,6 +421,8 @@ const PRAXIS_SETTINGS_PANEL_GLOBAL_CONFIG_EDITOR_EN_US = {
415
421
  'Toolbar visível': 'Toolbar visible',
416
422
  'Cache & Persistência': 'Cache & Persistence',
417
423
  Tabela: 'Table',
424
+ 'Páginas Dinâmicas': 'Dynamic Pages',
425
+ 'Definido pela página (sem preset forçado)': 'Page-defined (no forced preset)',
418
426
  Salvar: 'Save',
419
427
  Cancelar: 'Cancel',
420
428
  Redefinir: 'Reset',
@@ -450,6 +458,33 @@ const PRAXIS_SETTINGS_PANEL_EN_US = {
450
458
  Back: 'Back',
451
459
  Apply: 'Apply',
452
460
  'Save & Close': 'Save & Close',
461
+ 'Context navigation': 'Context navigation',
462
+ 'Previous item': 'Previous item',
463
+ 'Next item': 'Next item',
464
+ 'Editing target': 'Editing target',
465
+ 'Editing modes': 'Editing modes',
466
+ 'Resize panel': 'Resize panel',
467
+ 'Scope: Personal': 'Scope: Personal',
468
+ 'Scope: Tenant': 'Scope: Organization (Tenant)',
469
+ 'Switch to tenant scope': 'Switch to tenant scope',
470
+ 'Switch to personal scope': 'Switch to personal scope',
471
+ 'Reset to tenant baseline': 'Reset to tenant baseline',
472
+ 'Discard personal customizations and restore the shared tenant baseline?': 'Discard personal customizations and restore the shared tenant baseline?',
473
+ 'Code: {{code}}': 'Code: {{code}}',
474
+ 'Correlation ID: {{id}}': 'Correlation ID: {{id}}',
475
+ 'Dismiss error': 'Dismiss error',
476
+ 'Save failed: sensitive criteria cannot be shared at tenant scope.': 'Sensitive criteria cannot be published to shared tenant scope. Remove restricted criteria or save at your personal scope.',
477
+ 'Save failed: configuration was modified by another user. Reload and try again.': 'Revision conflict detected (ETag): the configuration changed concurrently. Reload before retrying.',
478
+ 'Save failed: you do not have permission to publish at this scope.': 'Insufficient permissions to publish changes at this configuration scope.',
479
+ 'Save failed: configuration contains validation errors.': 'Configuration failed server validation. Review the fields and try again.',
480
+ 'Save failed: network or persistence acknowledgment error.': 'Connection failed or the storage backend did not acknowledge persistence. Try again.',
481
+ 'Save failed: server error while persisting configuration.': 'Server error while persisting the configuration. Please try again shortly.',
482
+ 'Save failed: unable to persist configuration.': 'Unable to persist the configuration. Please try again shortly.',
483
+ 'Reset failed: configuration was modified by another user. Reload and try again.': 'Revision conflict detected (ETag): the configuration changed concurrently. Reload before resetting.',
484
+ 'Reset failed: you do not have permission to reset at this scope.': 'Insufficient permissions to reset changes at this configuration scope.',
485
+ 'Reset failed: network or persistence acknowledgment error.': 'Connection failed or the storage backend did not acknowledge the reset. Try again.',
486
+ 'Reset failed: server error while resetting configuration.': 'Server error while resetting the configuration. Please try again shortly.',
487
+ 'Reset failed: unable to reset configuration.': 'Unable to reset the configuration. Please try again shortly.',
453
488
  };
454
489
 
455
490
  const PRAXIS_SETTINGS_PANEL_PT_BR = {
@@ -482,6 +517,33 @@ const PRAXIS_SETTINGS_PANEL_PT_BR = {
482
517
  Back: 'Voltar',
483
518
  Apply: 'Aplicar',
484
519
  'Save & Close': 'Salvar e fechar',
520
+ 'Context navigation': 'Navegação contextual',
521
+ 'Previous item': 'Item anterior',
522
+ 'Next item': 'Próximo item',
523
+ 'Editing target': 'Item em edição',
524
+ 'Editing modes': 'Modos de edição',
525
+ 'Resize panel': 'Redimensionar painel',
526
+ 'Scope: Personal': 'Escopo: Pessoal',
527
+ 'Scope: Tenant': 'Escopo: Organização (Tenant)',
528
+ 'Switch to tenant scope': 'Publicar para organização (Tenant)',
529
+ 'Switch to personal scope': 'Salvar apenas no meu perfil',
530
+ 'Reset to tenant baseline': 'Restaurar padrão da organização',
531
+ 'Discard personal customizations and restore the shared tenant baseline?': 'Descartar as personalizações individuais e restaurar o padrão compartilhado da organização (Tenant)?',
532
+ 'Code: {{code}}': 'Código: {{code}}',
533
+ 'Correlation ID: {{id}}': 'Correlação: {{id}}',
534
+ 'Dismiss error': 'Dispensar aviso',
535
+ 'Save failed: sensitive criteria cannot be shared at tenant scope.': 'Critérios sensíveis não podem ser publicados no escopo compartilhado da organização (Tenant). Remova os critérios restritos ou salve no seu escopo pessoal.',
536
+ 'Save failed: configuration was modified by another user. Reload and try again.': 'Conflito de revisão (ETag): outra alteração foi salva antes. Recarregue a configuração e tente novamente.',
537
+ 'Save failed: you do not have permission to publish at this scope.': 'Sem permissão para publicar alterações neste escopo de configuração.',
538
+ 'Save failed: configuration contains validation errors.': 'A configuração falhou na validação do servidor. Revise os campos e tente novamente.',
539
+ 'Save failed: network or persistence acknowledgment error.': 'Falha de conexão ou ausência de confirmação ao persistir a configuração. Tente novamente.',
540
+ 'Save failed: server error while persisting configuration.': 'Erro interno no servidor ao salvar a configuração. Tente novamente em instantes.',
541
+ 'Save failed: unable to persist configuration.': 'Não foi possível salvar a configuração. Tente novamente em instantes.',
542
+ 'Reset failed: configuration was modified by another user. Reload and try again.': 'Conflito de revisão (ETag): outra alteração foi salva antes. Recarregue antes de redefinir.',
543
+ 'Reset failed: you do not have permission to reset at this scope.': 'Sem permissão para redefinir alterações neste escopo de configuração.',
544
+ 'Reset failed: network or persistence acknowledgment error.': 'Falha de conexão ou ausência de confirmação ao redefinir a configuração. Tente novamente.',
545
+ 'Reset failed: server error while resetting configuration.': 'Erro interno no servidor ao redefinir a configuração. Tente novamente em instantes.',
546
+ 'Reset failed: unable to reset configuration.': 'Não foi possível redefinir a configuração. Tente novamente em instantes.',
485
547
  };
486
548
 
487
549
  const PRAXIS_SETTINGS_PANEL_I18N_NAMESPACE = 'praxis-settings-panel';
@@ -543,6 +605,16 @@ function parsePixelWidth(value) {
543
605
  return Number.isFinite(parsed) ? parsed : null;
544
606
  }
545
607
 
608
+ function isScopeErrorAwareStorage(candidate) {
609
+ if (!candidate || typeof candidate !== 'object')
610
+ return false;
611
+ const record = candidate;
612
+ return ('writeScope' in record ||
613
+ 'saveError$' in record ||
614
+ 'evaluateWriteTargetScope' in record ||
615
+ 'canWriteScope' in record ||
616
+ 'canWriteConfig' in record);
617
+ }
546
618
  const DEFAULT_DIAGNOSTICS = {
547
619
  showStatusMessage: true,
548
620
  showDisabledReason: true,
@@ -564,6 +636,12 @@ class SettingsPanelComponent {
564
636
  expanded = false;
565
637
  interactionActive = true;
566
638
  previewTarget;
639
+ contextNavigation;
640
+ configStorageKey;
641
+ showWriteScope = true;
642
+ canSwitchWriteScope = true;
643
+ persistSaveHandler;
644
+ persistResetHandler;
567
645
  previewing = false;
568
646
  previewElement = null;
569
647
  previewScroll = [];
@@ -580,37 +658,156 @@ class SettingsPanelComponent {
580
658
  // the panel's already-checked footer subscribed to those late state changes.
581
659
  dirtyState = signal(false, ...(ngDevMode ? [{ debugName: "dirtyState" }] : /* istanbul ignore next */ []));
582
660
  validState = signal(true, ...(ngDevMode ? [{ debugName: "validState" }] : /* istanbul ignore next */ []));
583
- busyState = signal(false, ...(ngDevMode ? [{ debugName: "busyState" }] : /* istanbul ignore next */ []));
661
+ providerBusyState = signal(false, ...(ngDevMode ? [{ debugName: "providerBusyState" }] : /* istanbul ignore next */ []));
662
+ persistenceBusyState = signal(false, ...(ngDevMode ? [{ debugName: "persistenceBusyState" }] : /* istanbul ignore next */ []));
584
663
  get isDirty() { return this.dirtyState(); }
585
664
  set isDirty(value) { this.dirtyState.set(value); }
586
665
  get isValid() { return this.validState(); }
587
666
  set isValid(value) { this.validState.set(value); }
588
- get isBusy() { return this.busyState(); }
589
- set isBusy(value) { this.busyState.set(value); }
667
+ get isBusy() {
668
+ return this.providerBusyState() || this.persistenceBusyState();
669
+ }
670
+ set isBusy(value) {
671
+ this.providerBusyState.set(value);
672
+ }
590
673
  diagnostics = {
591
674
  ...DEFAULT_DIAGNOSTICS,
592
675
  };
593
676
  lastSavedAt = null;
594
677
  hasAppliedChanges = false;
678
+ saveFailedPendingRetry = false;
679
+ confirmDialogOpen = false;
680
+ saveErrorStreamBound = false;
681
+ get isConfirmDialogOpen() {
682
+ return this.confirmDialogOpen;
683
+ }
595
684
  activePointerId = null;
596
685
  dragStartX = 0;
597
686
  dragStartWidth = 0;
598
687
  collapsedWidthBeforeExpand = null;
599
688
  destroyRef = inject(DestroyRef);
689
+ injector = inject(Injector);
600
690
  i18n = inject(PraxisI18nService);
691
+ contextSwitchGuard = inject(PraxisContextSwitchGuard, { optional: true });
692
+ directApiStorage = inject(ApiConfigStorage, { optional: true });
693
+ asyncConfigStorage = inject(ASYNC_CONFIG_STORAGE, {
694
+ optional: true,
695
+ });
696
+ scopeErrorStorage = this.resolveScopeErrorStorage();
697
+ storageSaveError = signal(null, ...(ngDevMode ? [{ debugName: "storageSaveError" }] : /* istanbul ignore next */ []));
601
698
  applyActionLabel = this.actionLabel('Apply');
602
699
  saveActionLabel = this.actionLabel('Save & Close');
603
700
  contentHost;
701
+ saveErrorBanner;
604
702
  constructor(cdr, dialog, elementRef, overlayContainer) {
605
703
  this.cdr = cdr;
606
704
  this.dialog = dialog;
607
705
  this.elementRef = elementRef;
608
706
  this.overlayContainer = overlayContainer;
707
+ this.contextSwitchGuard?.registerDirtyCheck(this.titleId, () => this.isDirty || this.hasAppliedChanges, { destroyRef: this.destroyRef });
609
708
  this.destroyRef.onDestroy(() => this.restorePreviewPage());
610
709
  }
611
710
  get canInspectPreview() {
612
711
  return !!this.previewTarget && this.interactionActive && this.isValid && !this.isBusy;
613
712
  }
713
+ get hasContextNavigation() {
714
+ const nav = this.contextNavigation;
715
+ return !!(nav && ((nav.targets && nav.targets.length > 0) || (nav.modes && nav.modes.length > 0)));
716
+ }
717
+ get activeTargetIndex() {
718
+ const targets = this.contextNavigation?.targets;
719
+ const activeId = this.contextNavigation?.activeTargetId;
720
+ if (!targets?.length || !activeId)
721
+ return -1;
722
+ return targets.findIndex((target) => target.id === activeId);
723
+ }
724
+ get canSelectPreviousTarget() {
725
+ return this.interactionActive && !this.isBusy && this.activeTargetIndex > 0;
726
+ }
727
+ get canSelectNextTarget() {
728
+ const targets = this.contextNavigation?.targets;
729
+ const idx = this.activeTargetIndex;
730
+ return this.interactionActive && !this.isBusy && !!targets && idx >= 0 && idx < targets.length - 1;
731
+ }
732
+ selectPreviousTarget() {
733
+ const targets = this.contextNavigation?.targets;
734
+ const idx = this.activeTargetIndex;
735
+ if (!targets || idx <= 0)
736
+ return;
737
+ this.selectContextTarget(targets[idx - 1].id);
738
+ }
739
+ selectNextTarget() {
740
+ const targets = this.contextNavigation?.targets;
741
+ const idx = this.activeTargetIndex;
742
+ if (!targets || idx < 0 || idx >= targets.length - 1)
743
+ return;
744
+ this.selectContextTarget(targets[idx + 1].id);
745
+ }
746
+ selectContextTarget(targetId, selectElement) {
747
+ const nav = this.contextNavigation;
748
+ if (!nav?.onSelectTarget ||
749
+ !targetId ||
750
+ targetId === nav.activeTargetId ||
751
+ this.isBusy ||
752
+ !this.interactionActive ||
753
+ !this.isValid) {
754
+ if (selectElement && nav?.activeTargetId) {
755
+ selectElement.value = nav.activeTargetId;
756
+ }
757
+ this.cdr.markForCheck();
758
+ return;
759
+ }
760
+ if (this.canApply) {
761
+ this.onApply();
762
+ if (!this.isValid || this.isBusy) {
763
+ if (selectElement && nav.activeTargetId) {
764
+ selectElement.value = nav.activeTargetId;
765
+ }
766
+ this.cdr.markForCheck();
767
+ return;
768
+ }
769
+ if (this.hasAppliedChanges) {
770
+ this.isDirty = false;
771
+ }
772
+ }
773
+ nav.onSelectTarget(targetId);
774
+ if (selectElement &&
775
+ this.contextNavigation?.activeTargetId &&
776
+ selectElement.value !== this.contextNavigation.activeTargetId) {
777
+ selectElement.value = this.contextNavigation.activeTargetId;
778
+ }
779
+ this.cdr.markForCheck();
780
+ }
781
+ selectContextMode(modeId) {
782
+ const nav = this.contextNavigation;
783
+ if (!nav?.onSelectMode || !modeId || modeId === nav.activeModeId || this.isBusy || !this.interactionActive) {
784
+ return;
785
+ }
786
+ const mode = nav.modes?.find((item) => item.id === modeId);
787
+ if (mode?.disabled) {
788
+ return;
789
+ }
790
+ const currentMode = nav.modes?.find((item) => item.id === nav.activeModeId);
791
+ const sharesEditorGroup = Boolean(mode?.editorGroup && currentMode?.editorGroup && mode.editorGroup === currentMode.editorGroup);
792
+ if (!sharesEditorGroup) {
793
+ if (!this.isValid) {
794
+ this.cdr.markForCheck();
795
+ return;
796
+ }
797
+ if (this.canApply) {
798
+ this.onApply();
799
+ if (!this.isValid || this.isBusy) {
800
+ this.cdr.markForCheck();
801
+ return;
802
+ }
803
+ if (this.hasAppliedChanges) {
804
+ this.isDirty = false;
805
+ }
806
+ }
807
+ }
808
+ nav.onSelectMode(modeId);
809
+ this.cdr.markForCheck();
810
+ }
614
811
  showPreview() {
615
812
  if (!this.canInspectPreview)
616
813
  return;
@@ -650,7 +847,12 @@ class SettingsPanelComponent {
650
847
  this.previewScroll = [];
651
848
  }
652
849
  get canApply() {
653
- return !this.previewing && this.interactionActive && this.isDirty && this.isValid && !this.isBusy;
850
+ return (!this.previewing &&
851
+ this.interactionActive &&
852
+ this.isDirty &&
853
+ this.isValid &&
854
+ !this.isBusy &&
855
+ !this.confirmDialogOpen);
654
856
  }
655
857
  get panelInlineStyles() {
656
858
  return {
@@ -666,7 +868,12 @@ class SettingsPanelComponent {
666
868
  return this.tx('Resize panel');
667
869
  }
668
870
  get canSave() {
669
- return !this.previewing && this.interactionActive && (this.isDirty || this.hasAppliedChanges) && this.isValid && !this.isBusy;
871
+ return (!this.previewing &&
872
+ this.interactionActive &&
873
+ (this.isDirty || this.hasAppliedChanges || this.saveFailedPendingRetry) &&
874
+ this.isValid &&
875
+ !this.isBusy &&
876
+ !this.confirmDialogOpen);
670
877
  }
671
878
  setInteractionActive(active) {
672
879
  if (active === this.interactionActive)
@@ -709,7 +916,7 @@ class SettingsPanelComponent {
709
916
  if (!this.isValid) {
710
917
  return this.tx('The configuration contains errors that need to be fixed.');
711
918
  }
712
- if (!this.isDirty) {
919
+ if (!this.isDirty && !this.hasAppliedChanges && !this.saveFailedPendingRetry) {
713
920
  return this.tx('No changes to apply or save.');
714
921
  }
715
922
  return '';
@@ -728,7 +935,7 @@ class SettingsPanelComponent {
728
935
  return 'busy';
729
936
  if (!this.isValid && this.diagnostics.exposeValidationState)
730
937
  return 'invalid';
731
- if (this.isDirty)
938
+ if (this.isDirty || this.saveFailedPendingRetry)
732
939
  return 'dirty';
733
940
  if (this.hasAppliedChanges)
734
941
  return 'applied';
@@ -756,6 +963,394 @@ class SettingsPanelComponent {
756
963
  }
757
964
  return this.tx('No changes');
758
965
  }
966
+ get activeWriteScope() {
967
+ const scopeSource = this.scopeErrorStorage?.writeScope;
968
+ if (!scopeSource)
969
+ return null;
970
+ return typeof scopeSource === 'function' ? scopeSource() : scopeSource;
971
+ }
972
+ get showWriteScopeControls() {
973
+ return this.showWriteScope && this.activeWriteScope !== null;
974
+ }
975
+ get canToggleWriteScope() {
976
+ if (!this.canSwitchWriteScope ||
977
+ !this.interactionActive ||
978
+ this.isBusy ||
979
+ this.confirmDialogOpen ||
980
+ typeof this.scopeErrorStorage?.setWriteScope !== 'function') {
981
+ return false;
982
+ }
983
+ const nextScope = this.activeWriteScope === 'tenant' ? 'user' : 'tenant';
984
+ const decision = this.scopeErrorStorage?.evaluateWriteTargetScope?.(this.configStorageKey ?? '', { scope: nextScope });
985
+ return decision ? decision.allowed : true;
986
+ }
987
+ resolveTenantResetStorage() {
988
+ const primary = this.asyncConfigStorage;
989
+ if (typeof primary?.deletePersonalOverrideAndReloadTenantBaseline === 'function') {
990
+ return primary;
991
+ }
992
+ if (typeof this.scopeErrorStorage?.deletePersonalOverrideAndReloadTenantBaseline === 'function') {
993
+ return this.scopeErrorStorage;
994
+ }
995
+ return null;
996
+ }
997
+ get canResetPersonalOverride() {
998
+ if (this.activeWriteScope !== 'user' ||
999
+ !this.configStorageKey ||
1000
+ !this.interactionActive ||
1001
+ this.isBusy ||
1002
+ this.confirmDialogOpen ||
1003
+ !this.resolveTenantResetStorage()) {
1004
+ return false;
1005
+ }
1006
+ const decision = this.scopeErrorStorage?.evaluateWriteTargetScope?.(this.configStorageKey, { scope: 'user' });
1007
+ return decision ? decision.allowed : true;
1008
+ }
1009
+ get writeScopeLabel() {
1010
+ return this.activeWriteScope === 'tenant'
1011
+ ? this.tx('Scope: Tenant')
1012
+ : this.tx('Scope: Personal');
1013
+ }
1014
+ get writeScopeToggleLabel() {
1015
+ return this.activeWriteScope === 'tenant'
1016
+ ? this.tx('Switch to personal scope')
1017
+ : this.tx('Switch to tenant scope');
1018
+ }
1019
+ get formattedSaveErrorMessage() {
1020
+ const err = this.storageSaveError();
1021
+ if (!err)
1022
+ return '';
1023
+ const isClear = err.operation === 'clear';
1024
+ const upperCode = err.errorCode?.trim().toUpperCase() ?? '';
1025
+ if (err.errorCode === 'SHARED_CONFIG_SENSITIVE_CRITERIA_DENIED') {
1026
+ return this.tx('Save failed: sensitive criteria cannot be shared at tenant scope.');
1027
+ }
1028
+ if (err.status === 403 ||
1029
+ err.errorCode === 'write_disabled' ||
1030
+ err.errorCode === 'scope_forbidden' ||
1031
+ err.errorCode === 'read_only_mode' ||
1032
+ err.errorCode === 'governance_denied' ||
1033
+ upperCode === 'GOVERNANCE_DENIED' ||
1034
+ upperCode === 'POLICY_DENIED' ||
1035
+ upperCode.includes('GOVERNANCE') ||
1036
+ err.errorCode?.endsWith('_DISABLED') ||
1037
+ upperCode === 'READ_ONLY') {
1038
+ return this.tx(isClear
1039
+ ? 'Reset failed: you do not have permission to reset at this scope.'
1040
+ : 'Save failed: you do not have permission to publish at this scope.');
1041
+ }
1042
+ if (err.status === 422 && !isClear) {
1043
+ return (err.title?.trim() ||
1044
+ this.tx('Save failed: configuration contains validation errors.'));
1045
+ }
1046
+ if (err.status === 409 || err.status === 412) {
1047
+ return this.tx(isClear
1048
+ ? 'Reset failed: configuration was modified by another user. Reload and try again.'
1049
+ : 'Save failed: configuration was modified by another user. Reload and try again.');
1050
+ }
1051
+ if (err.errorCode === 'NETWORK_ERROR' ||
1052
+ err.errorCode === 'WRITE_UNACKNOWLEDGED') {
1053
+ return this.tx(isClear
1054
+ ? 'Reset failed: network or persistence acknowledgment error.'
1055
+ : 'Save failed: network or persistence acknowledgment error.');
1056
+ }
1057
+ if (err.errorCode === 'CLIENT_ERROR') {
1058
+ return (err.detail?.trim() ||
1059
+ err.title?.trim() ||
1060
+ err.message?.trim() ||
1061
+ this.tx(isClear
1062
+ ? 'Reset failed: unable to reset configuration.'
1063
+ : 'Save failed: unable to persist configuration.'));
1064
+ }
1065
+ if (typeof err.status === 'number' && err.status >= 500) {
1066
+ return this.tx(isClear
1067
+ ? 'Reset failed: server error while resetting configuration.'
1068
+ : 'Save failed: server error while persisting configuration.');
1069
+ }
1070
+ return (err.title?.trim() ||
1071
+ this.tx(isClear
1072
+ ? 'Reset failed: unable to reset configuration.'
1073
+ : 'Save failed: unable to persist configuration.'));
1074
+ }
1075
+ get saveErrorFieldMessages() {
1076
+ const err = this.storageSaveError();
1077
+ if (!err)
1078
+ return [];
1079
+ const raw = (err.raw && typeof err.raw === 'object' ? err.raw : null);
1080
+ const rawError = (raw?.['error'] && typeof raw['error'] === 'object' ? raw['error'] : raw);
1081
+ const source = err['fieldErrors'] ??
1082
+ rawError?.['fieldErrors'] ??
1083
+ rawError?.['violations'] ??
1084
+ rawError?.['errors'];
1085
+ const result = [];
1086
+ if (Array.isArray(source)) {
1087
+ for (const item of source) {
1088
+ if (typeof item === 'string' && item.trim()) {
1089
+ result.push(item.trim());
1090
+ }
1091
+ else if (item && typeof item === 'object') {
1092
+ const entry = item;
1093
+ const field = typeof entry['field'] === 'string'
1094
+ ? entry['field'].trim()
1095
+ : typeof entry['propertyPath'] === 'string'
1096
+ ? entry['propertyPath'].trim()
1097
+ : typeof entry['path'] === 'string'
1098
+ ? entry['path'].trim()
1099
+ : '';
1100
+ const msg = typeof entry['message'] === 'string'
1101
+ ? entry['message'].trim()
1102
+ : typeof entry['defaultMessage'] === 'string'
1103
+ ? entry['defaultMessage'].trim()
1104
+ : '';
1105
+ if (msg) {
1106
+ result.push(field ? `${field}: ${msg}` : msg);
1107
+ }
1108
+ }
1109
+ }
1110
+ }
1111
+ else if (source && typeof source === 'object') {
1112
+ for (const [field, val] of Object.entries(source)) {
1113
+ if (typeof val === 'string' && val.trim()) {
1114
+ result.push(`${field}: ${val.trim()}`);
1115
+ }
1116
+ else if (Array.isArray(val)) {
1117
+ for (const msg of val) {
1118
+ if (typeof msg === 'string' && msg.trim()) {
1119
+ result.push(`${field}: ${msg.trim()}`);
1120
+ }
1121
+ }
1122
+ }
1123
+ }
1124
+ }
1125
+ return result;
1126
+ }
1127
+ get canSwitchToPersonalScopeFromError() {
1128
+ const err = this.storageSaveError();
1129
+ if (!err ||
1130
+ err.errorCode !== 'SHARED_CONFIG_SENSITIVE_CRITERIA_DENIED' ||
1131
+ this.activeWriteScope !== 'tenant') {
1132
+ return false;
1133
+ }
1134
+ const key = this.configStorageKey ?? '';
1135
+ const decision = this.scopeErrorStorage?.evaluateWriteTargetScope?.(key, {
1136
+ scope: 'user',
1137
+ });
1138
+ if (decision) {
1139
+ return decision.allowed;
1140
+ }
1141
+ return this.scopeErrorStorage?.canWriteScope?.('user', key) ?? true;
1142
+ }
1143
+ toggleWriteScope() {
1144
+ if (!this.canToggleWriteScope)
1145
+ return;
1146
+ if (typeof this.scopeErrorStorage?.toggleWriteScope === 'function') {
1147
+ this.scopeErrorStorage.toggleWriteScope(this.configStorageKey);
1148
+ }
1149
+ else {
1150
+ const next = this.activeWriteScope === 'tenant' ? 'user' : 'tenant';
1151
+ this.scopeErrorStorage?.setWriteScope?.(next, this.configStorageKey);
1152
+ }
1153
+ this.scopeErrorStorage?.clearSaveError?.();
1154
+ this.cdr.markForCheck();
1155
+ }
1156
+ switchToPersonalScopeFromError() {
1157
+ if (!this.canSwitchToPersonalScopeFromError)
1158
+ return;
1159
+ if (this.configStorageKey) {
1160
+ this.scopeErrorStorage?.setWriteScope?.('user', this.configStorageKey);
1161
+ }
1162
+ else {
1163
+ this.scopeErrorStorage?.setWriteScope?.('user');
1164
+ }
1165
+ this.dismissSaveError();
1166
+ }
1167
+ dismissSaveError() {
1168
+ this.scopeErrorStorage?.clearSaveError?.();
1169
+ this.storageSaveError.set(null);
1170
+ this.cdr.markForCheck();
1171
+ }
1172
+ resetPersonalOverrideToTenant() {
1173
+ const key = this.configStorageKey;
1174
+ const resetStorage = this.resolveTenantResetStorage();
1175
+ const fn = resetStorage?.deletePersonalOverrideAndReloadTenantBaseline;
1176
+ if (!key ||
1177
+ typeof fn !== 'function' ||
1178
+ this.isBusy ||
1179
+ this.destroyRef.destroyed ||
1180
+ !this.interactionActive ||
1181
+ this.confirmDialogOpen) {
1182
+ return;
1183
+ }
1184
+ const dialogData = {
1185
+ title: this.tx('Reset to tenant baseline'),
1186
+ message: this.tx('Discard personal customizations and restore the shared tenant baseline?'),
1187
+ confirmText: this.tx('Reset'),
1188
+ cancelText: this.tx('Cancel'),
1189
+ type: 'warning',
1190
+ icon: 'restart_alt',
1191
+ };
1192
+ this.confirmDialogOpen = true;
1193
+ this.dialog
1194
+ .open(ConfirmDialogComponent, { data: dialogData, autoFocus: false })
1195
+ .afterClosed()
1196
+ .pipe(finalize(() => {
1197
+ this.confirmDialogOpen = false;
1198
+ }), filter((confirmed) => Boolean(confirmed)), takeUntilDestroyed(this.destroyRef))
1199
+ .subscribe(() => {
1200
+ if (this.isBusy || this.destroyRef.destroyed) {
1201
+ return;
1202
+ }
1203
+ const gateError = this.checkWriteGate('clear', 'user');
1204
+ if (gateError) {
1205
+ this.handlePersistenceFailure(gateError, 'clear');
1206
+ return;
1207
+ }
1208
+ this.persistenceBusyState.set(true);
1209
+ this.dismissSaveError();
1210
+ this.cdr.markForCheck();
1211
+ let baselineObs;
1212
+ try {
1213
+ baselineObs = fn.call(resetStorage, key);
1214
+ }
1215
+ catch (syncError) {
1216
+ this.persistenceBusyState.set(false);
1217
+ this.handlePersistenceFailure(syncError, 'clear');
1218
+ if (!this.destroyRef.destroyed) {
1219
+ this.cdr.markForCheck();
1220
+ }
1221
+ return;
1222
+ }
1223
+ firstValueFrom(baselineObs)
1224
+ .then((tenantBaseline) => {
1225
+ if (this.destroyRef.destroyed) {
1226
+ return;
1227
+ }
1228
+ this.saveFailedPendingRetry = false;
1229
+ this.hasAppliedChanges = false;
1230
+ this.lastSavedAt = null;
1231
+ this.isDirty = false;
1232
+ this.ref?.notifyTenantBaselineRestored?.(tenantBaseline ?? null);
1233
+ if (tenantBaseline !== null && tenantBaseline !== undefined) {
1234
+ if (typeof this.contentRef?.instance?.acceptAppliedValue === 'function') {
1235
+ this.contentRef.instance.acceptAppliedValue(tenantBaseline);
1236
+ }
1237
+ else {
1238
+ this.contentRef?.instance?.reset?.();
1239
+ }
1240
+ this.ref?.apply?.(tenantBaseline);
1241
+ }
1242
+ else {
1243
+ this.contentRef?.instance?.reset?.();
1244
+ this.ref?.reset?.();
1245
+ }
1246
+ })
1247
+ .catch((error) => {
1248
+ if (this.destroyRef.destroyed) {
1249
+ return;
1250
+ }
1251
+ this.handlePersistenceFailure(error, 'clear');
1252
+ })
1253
+ .finally(() => {
1254
+ if (this.destroyRef.destroyed) {
1255
+ return;
1256
+ }
1257
+ this.persistenceBusyState.set(false);
1258
+ this.cdr.markForCheck();
1259
+ });
1260
+ });
1261
+ }
1262
+ matchesPanelStorageKey(err) {
1263
+ if (!err)
1264
+ return true;
1265
+ const errKey = err.key?.trim() || '';
1266
+ if (!errKey)
1267
+ return true;
1268
+ const activeKey = this.configStorageKey?.trim() || '';
1269
+ return Boolean(activeKey && errKey === activeKey);
1270
+ }
1271
+ resolveScopeErrorStorage() {
1272
+ if (this.asyncConfigStorage) {
1273
+ const maybeDeferred = this.asyncConfigStorage;
1274
+ const unwrap = maybeDeferred.unwrapDelegate;
1275
+ const resolved = this.asyncConfigStorage instanceof DeferredAsyncConfigStorage ||
1276
+ typeof unwrap === 'function'
1277
+ ? unwrap.call(maybeDeferred)
1278
+ : this.asyncConfigStorage;
1279
+ return isScopeErrorAwareStorage(resolved) ? resolved : null;
1280
+ }
1281
+ return this.directApiStorage;
1282
+ }
1283
+ checkWriteGate(operation, scopeOverride) {
1284
+ const key = this.configStorageKey?.trim() ?? '';
1285
+ const evaluate = this.scopeErrorStorage?.evaluateWriteTargetScope;
1286
+ if (typeof evaluate !== 'function') {
1287
+ return null;
1288
+ }
1289
+ const decision = evaluate.call(this.scopeErrorStorage, key, {
1290
+ scope: scopeOverride ?? this.activeWriteScope ?? undefined,
1291
+ });
1292
+ if (decision.allowed) {
1293
+ return null;
1294
+ }
1295
+ return {
1296
+ operation,
1297
+ key,
1298
+ scope: decision.scope,
1299
+ status: decision.code === 'governance_denied' ? 422 : 403,
1300
+ errorCode: decision.code ?? 'scope_forbidden',
1301
+ title: this.tx(operation === 'clear'
1302
+ ? 'Reset failed: you do not have permission to reset at this scope.'
1303
+ : 'Save failed: you do not have permission to publish at this scope.'),
1304
+ detail: decision.reason ?? undefined,
1305
+ message: decision.reason ??
1306
+ this.tx(operation === 'clear'
1307
+ ? 'Reset failed: you do not have permission to reset at this scope.'
1308
+ : 'Save failed: you do not have permission to publish at this scope.'),
1309
+ timestamp: Date.now(),
1310
+ };
1311
+ }
1312
+ isPrebuiltSaveError(error) {
1313
+ return (Boolean(error) &&
1314
+ typeof error === 'object' &&
1315
+ 'timestamp' in error &&
1316
+ 'status' in error &&
1317
+ 'message' in error &&
1318
+ 'operation' in error);
1319
+ }
1320
+ handlePersistenceFailure(error, operation = 'save') {
1321
+ if (this.destroyRef.destroyed) {
1322
+ return;
1323
+ }
1324
+ const isEmptyError = error instanceof Error && error.name === 'EmptyError';
1325
+ const parsed = this.isPrebuiltSaveError(error)
1326
+ ? error
1327
+ : isEmptyError
1328
+ ? (this.storageSaveError() ??
1329
+ parseConfigPersistenceError(error, {
1330
+ key: this.configStorageKey,
1331
+ scope: this.activeWriteScope ?? undefined,
1332
+ operation,
1333
+ }))
1334
+ : (parseConfigPersistenceError(error, {
1335
+ key: this.configStorageKey,
1336
+ scope: this.activeWriteScope ?? undefined,
1337
+ operation,
1338
+ }) ?? this.storageSaveError());
1339
+ if (operation !== 'clear') {
1340
+ this.saveFailedPendingRetry = true;
1341
+ }
1342
+ this.storageSaveError.set(parsed);
1343
+ this.ref?.reportPersistenceError?.(parsed);
1344
+ this.cdr.markForCheck();
1345
+ afterNextRender(() => {
1346
+ if (this.destroyRef.destroyed)
1347
+ return;
1348
+ const banner = this.saveErrorBanner?.nativeElement;
1349
+ if (banner?.isConnected) {
1350
+ banner.focus({ preventScroll: true });
1351
+ }
1352
+ }, { injector: this.injector });
1353
+ }
759
1354
  tx(text, params) {
760
1355
  const translated = this.i18n.t(text, params, text, PRAXIS_SETTINGS_PANEL_I18N_NAMESPACE);
761
1356
  return translated?.trim() ? translated : text;
@@ -791,7 +1386,36 @@ class SettingsPanelComponent {
791
1386
  instance.isBusy$
792
1387
  .pipe(takeUntilDestroyed(this.destroyRef))
793
1388
  .subscribe((busy) => {
794
- this.isBusy = busy;
1389
+ this.providerBusyState.set(busy);
1390
+ this.cdr.markForCheck();
1391
+ });
1392
+ }
1393
+ if (!this.saveErrorStreamBound) {
1394
+ this.saveErrorStreamBound = true;
1395
+ let replayingInitial = true;
1396
+ this.scopeErrorStorage?.saveError$
1397
+ ?.pipe(takeUntilDestroyed(this.destroyRef))
1398
+ .subscribe((err) => {
1399
+ if (replayingInitial) {
1400
+ return;
1401
+ }
1402
+ if (err && !this.matchesPanelStorageKey(err)) {
1403
+ return;
1404
+ }
1405
+ this.storageSaveError.set(err ?? null);
1406
+ this.cdr.markForCheck();
1407
+ });
1408
+ replayingInitial = false;
1409
+ }
1410
+ const refError$ = ref?.persistenceError$;
1411
+ if (refError$) {
1412
+ refError$
1413
+ .pipe(takeUntilDestroyed(this.destroyRef))
1414
+ .subscribe((err) => {
1415
+ if (err && !this.matchesPanelStorageKey(err)) {
1416
+ return;
1417
+ }
1418
+ this.storageSaveError.set(err);
795
1419
  this.cdr.markForCheck();
796
1420
  });
797
1421
  }
@@ -838,6 +1462,12 @@ class SettingsPanelComponent {
838
1462
  return new Set(Object.keys(declaredInputs));
839
1463
  }
840
1464
  onReset() {
1465
+ if (this.isBusy ||
1466
+ this.destroyRef.destroyed ||
1467
+ !this.interactionActive ||
1468
+ this.confirmDialogOpen) {
1469
+ return;
1470
+ }
841
1471
  const dialogData = {
842
1472
  title: this.tx('Reset Changes'),
843
1473
  message: this.tx('Are you sure you want to reset all changes?'),
@@ -846,16 +1476,58 @@ class SettingsPanelComponent {
846
1476
  type: 'warning',
847
1477
  icon: 'restart_alt',
848
1478
  };
1479
+ this.confirmDialogOpen = true;
849
1480
  this.dialog
850
1481
  .open(ConfirmDialogComponent, { data: dialogData, autoFocus: false })
851
1482
  .afterClosed()
852
- .pipe(filter((confirmed) => confirmed))
1483
+ .pipe(finalize(() => {
1484
+ this.confirmDialogOpen = false;
1485
+ }), filter((confirmed) => Boolean(confirmed)), takeUntilDestroyed(this.destroyRef))
853
1486
  .subscribe(() => {
854
- this.contentRef?.instance?.reset?.();
855
- this.lastSavedAt = null;
856
- this.ref.reset();
1487
+ if (!this.persistResetHandler) {
1488
+ this.finalizeReset();
1489
+ return;
1490
+ }
1491
+ void this.runAsyncResetFlow();
857
1492
  });
858
1493
  }
1494
+ finalizeReset() {
1495
+ this.contentRef?.instance?.reset?.();
1496
+ this.lastSavedAt = null;
1497
+ this.hasAppliedChanges = false;
1498
+ this.saveFailedPendingRetry = false;
1499
+ this.dismissSaveError();
1500
+ this.ref.reset();
1501
+ this.cdr.markForCheck();
1502
+ }
1503
+ async runAsyncResetFlow() {
1504
+ if (!this.persistResetHandler) {
1505
+ this.finalizeReset();
1506
+ return;
1507
+ }
1508
+ const gateError = this.checkWriteGate('clear');
1509
+ if (gateError) {
1510
+ this.handlePersistenceFailure(gateError, 'clear');
1511
+ return;
1512
+ }
1513
+ this.dismissSaveError();
1514
+ this.persistenceBusyState.set(true);
1515
+ this.cdr.markForCheck();
1516
+ try {
1517
+ const result = this.persistResetHandler();
1518
+ if (isObservable(result) || result instanceof Promise) {
1519
+ await this.awaitResult(result);
1520
+ }
1521
+ this.persistenceBusyState.set(false);
1522
+ if (!this.destroyRef.destroyed) {
1523
+ this.finalizeReset();
1524
+ }
1525
+ }
1526
+ catch (error) {
1527
+ this.persistenceBusyState.set(false);
1528
+ this.handlePersistenceFailure(error, 'clear');
1529
+ }
1530
+ }
859
1531
  onApply() {
860
1532
  if (!this.canApply)
861
1533
  return;
@@ -864,6 +1536,7 @@ class SettingsPanelComponent {
864
1536
  // publish a preview based only on the state captured before validation.
865
1537
  if (value === undefined || !this.isValid || this.isBusy || !this.interactionActive)
866
1538
  return;
1539
+ this.saveFailedPendingRetry = false;
867
1540
  this.ref.apply(value);
868
1541
  // Applying can synchronously clear the editor's draft. Saving still needs
869
1542
  // to invoke the provider again, never replay a cached geometry request.
@@ -873,31 +1546,94 @@ class SettingsPanelComponent {
873
1546
  onSave() {
874
1547
  if (!this.canSave)
875
1548
  return;
1549
+ this.dismissSaveError();
876
1550
  const instance = this.contentRef?.instance;
877
- const result = instance?.onSave?.();
878
- if (isObservable(result)) {
879
- firstValueFrom(result)
880
- .then((value) => this.emitSave(value))
881
- .catch(() => { });
1551
+ let rawResult;
1552
+ try {
1553
+ const result = instance?.onSave?.();
1554
+ rawResult =
1555
+ result !== undefined || isObservable(result) || result instanceof Promise
1556
+ ? result
1557
+ : instance?.getSettingsValue?.();
882
1558
  }
883
- else if (result instanceof Promise) {
884
- result.then((value) => this.emitSave(value)).catch(() => { });
1559
+ catch (error) {
1560
+ this.handlePersistenceFailure(error, 'save');
1561
+ return;
885
1562
  }
886
- else if (result !== undefined) {
887
- this.emitSave(result);
1563
+ if (isObservable(rawResult) || rawResult instanceof Promise) {
1564
+ void this.runAsyncSaveFlow(rawResult, false);
1565
+ return;
888
1566
  }
889
- else {
890
- const value = instance?.getSettingsValue?.();
1567
+ if (!this.canProceedWithSave(rawResult)) {
1568
+ return;
1569
+ }
1570
+ if (!this.persistSaveHandler) {
1571
+ this.emitSave(rawResult);
1572
+ return;
1573
+ }
1574
+ void this.runAsyncSaveFlow(rawResult, true);
1575
+ }
1576
+ async runAsyncSaveFlow(rawResult, alreadyResolved) {
1577
+ this.persistenceBusyState.set(true);
1578
+ this.cdr.markForCheck();
1579
+ try {
1580
+ const value = alreadyResolved
1581
+ ? rawResult
1582
+ : await this.awaitResult(rawResult);
1583
+ if (!this.canProceedWithSave(value)) {
1584
+ this.persistenceBusyState.set(false);
1585
+ this.cdr.markForCheck();
1586
+ return;
1587
+ }
1588
+ if (this.persistSaveHandler) {
1589
+ const gateError = this.checkWriteGate('save');
1590
+ if (gateError) {
1591
+ this.persistenceBusyState.set(false);
1592
+ this.handlePersistenceFailure(gateError, 'save');
1593
+ return;
1594
+ }
1595
+ const persisted = this.persistSaveHandler(value);
1596
+ if (isObservable(persisted) || persisted instanceof Promise) {
1597
+ await this.awaitResult(persisted);
1598
+ }
1599
+ if (!this.canProceedWithSave(value)) {
1600
+ this.persistenceBusyState.set(false);
1601
+ this.cdr.markForCheck();
1602
+ return;
1603
+ }
1604
+ }
1605
+ this.persistenceBusyState.set(false);
891
1606
  this.emitSave(value);
892
1607
  }
1608
+ catch (error) {
1609
+ this.persistenceBusyState.set(false);
1610
+ this.handlePersistenceFailure(error, 'save');
1611
+ }
1612
+ }
1613
+ awaitResult(result) {
1614
+ if (isObservable(result)) {
1615
+ return firstValueFrom(result);
1616
+ }
1617
+ if (result instanceof Promise) {
1618
+ return result;
1619
+ }
1620
+ return Promise.resolve(result);
1621
+ }
1622
+ canProceedWithSave(value) {
1623
+ return (value !== undefined &&
1624
+ this.isValid &&
1625
+ !this.providerBusyState() &&
1626
+ this.interactionActive &&
1627
+ !this.destroyRef.destroyed);
893
1628
  }
894
1629
  emitSave(value) {
895
1630
  // Recheck after synchronous validation or asynchronous completion. Dirty
896
1631
  // may legitimately be cleared by a successful provider; it is not a veto.
897
- if (value === undefined || !this.isValid || this.isBusy || !this.interactionActive || this.destroyRef.destroyed)
1632
+ if (!this.canProceedWithSave(value) || this.isBusy)
898
1633
  return;
899
1634
  this.lastSavedAt = Date.now();
900
1635
  this.hasAppliedChanges = false;
1636
+ this.saveFailedPendingRetry = false;
901
1637
  this.isDirty = false;
902
1638
  this.ref.save(value);
903
1639
  this.cdr.markForCheck();
@@ -1011,13 +1747,19 @@ class SettingsPanelComponent {
1011
1747
  }
1012
1748
  }
1013
1749
  onCancel() {
1750
+ if (this.isBusy || this.confirmDialogOpen) {
1751
+ return;
1752
+ }
1014
1753
  this.requestClose('cancel')
1015
- .pipe(filter((confirmed) => confirmed))
1754
+ .pipe(filter((confirmed) => Boolean(confirmed)), takeUntilDestroyed(this.destroyRef))
1016
1755
  .subscribe(() => {
1017
1756
  this.ref.close('cancel');
1018
1757
  });
1019
1758
  }
1020
1759
  requestClose(reason) {
1760
+ if (this.isBusy || this.confirmDialogOpen) {
1761
+ return of(false);
1762
+ }
1021
1763
  if (this.previewing) {
1022
1764
  this.returnFromPreview();
1023
1765
  if (reason === 'esc' || reason === 'backdrop')
@@ -1034,11 +1776,11 @@ class SettingsPanelComponent {
1034
1776
  }));
1035
1777
  }
1036
1778
  handleKeydown(event) {
1037
- if (!this.interactionActive) {
1779
+ if (!this.interactionActive || this.confirmDialogOpen) {
1038
1780
  return;
1039
1781
  }
1040
1782
  if (event.key === 'Escape') {
1041
- if (this.shouldDeferEscape(event)) {
1783
+ if (this.isBusy || this.shouldDeferEscape(event)) {
1042
1784
  return;
1043
1785
  }
1044
1786
  event.preventDefault();
@@ -1048,13 +1790,17 @@ class SettingsPanelComponent {
1048
1790
  this.onCancel();
1049
1791
  }
1050
1792
  else if (event.key === 'Enter' && (event.ctrlKey || event.metaKey)) {
1051
- event.preventDefault();
1052
- this.onSave();
1793
+ if (this.canSave) {
1794
+ event.preventDefault();
1795
+ this.onSave();
1796
+ }
1053
1797
  }
1054
1798
  else if ((event.key === 's' || event.key === 'S') &&
1055
1799
  (event.ctrlKey || event.metaKey)) {
1056
- event.preventDefault();
1057
- this.onSave();
1800
+ if (this.canSave) {
1801
+ event.preventDefault();
1802
+ this.onSave();
1803
+ }
1058
1804
  }
1059
1805
  }
1060
1806
  shouldDeferEscape(event) {
@@ -1130,9 +1876,12 @@ class SettingsPanelComponent {
1130
1876
  }
1131
1877
  }
1132
1878
  confirmDiscardIfNeeded() {
1133
- if (!this.isDirty) {
1879
+ if (!this.isDirty && !this.saveFailedPendingRetry) {
1134
1880
  return of(true);
1135
1881
  }
1882
+ if (this.confirmDialogOpen) {
1883
+ return of(false);
1884
+ }
1136
1885
  const dialogData = {
1137
1886
  title: this.tx('Discard unsaved draft'),
1138
1887
  message: this.tx(this.hasAppliedChanges
@@ -1143,12 +1892,16 @@ class SettingsPanelComponent {
1143
1892
  type: 'warning',
1144
1893
  icon: 'warning',
1145
1894
  };
1895
+ this.confirmDialogOpen = true;
1146
1896
  return this.dialog
1147
1897
  .open(ConfirmDialogComponent, { data: dialogData, autoFocus: false })
1148
- .afterClosed();
1898
+ .afterClosed()
1899
+ .pipe(finalize(() => {
1900
+ this.confirmDialogOpen = false;
1901
+ }), map((confirmed) => Boolean(confirmed)), takeUntilDestroyed(this.destroyRef));
1149
1902
  }
1150
1903
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SettingsPanelComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.MatDialog }, { token: i0.ElementRef }, { token: i1$1.OverlayContainer }], target: i0.ɵɵFactoryTarget.Component });
1151
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: SettingsPanelComponent, isStandalone: true, selector: "praxis-settings-panel", host: { listeners: { "document:keydown": "handleKeydown($event)", "document:pointermove": "onDocumentPointerMove($event)", "document:pointerup": "onDocumentPointerEnd($event)", "document:pointercancel": "onDocumentPointerEnd($event)" } }, providers: [providePraxisSettingsPanelI18n()], viewQueries: [{ propertyName: "focusTrap", first: true, predicate: CdkTrapFocus, descendants: true }, { propertyName: "contentHost", first: true, predicate: ["contentHost"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<div\n class=\"settings-panel\"\n data-testid=\"settings-panel-root\"\n [class.expanded]=\"expanded\"\n [class.settings-panel--preview]=\"previewing\"\n [class.is-resizable]=\"showResizeHandle\"\n [ngStyle]=\"panelInlineStyles\"\n role=\"dialog\"\n [attr.aria-modal]=\"interactionActive ? 'true' : null\"\n [attr.aria-hidden]=\"interactionActive ? null : 'true'\"\n [attr.inert]=\"interactionActive ? null : ''\"\n [attr.aria-labelledby]=\"previewing ? titleId + '-preview' : titleId\"\n [cdkTrapFocus]=\"interactionActive\"\n [cdkTrapFocusAutoCapture]=\"true\"\n >\n @if (showResizeHandle && !previewing) {\n <div\n class=\"settings-panel__resize-handle\"\n role=\"separator\"\n tabindex=\"0\"\n aria-orientation=\"vertical\"\n [attr.aria-label]=\"resizeHandleLabel\"\n (pointerdown)=\"onResizeHandlePointerDown($event)\"\n (keydown)=\"onResizeHandleKeydown($event)\"\n ></div>\n }\n @if (previewing) {\n <section class=\"settings-panel-preview-bar\" data-testid=\"settings-panel-preview-bar\">\n <div><strong [id]=\"titleId + '-preview'\">{{ tx('Page preview') }}</strong><p>{{ tx('Inspect the result. Return to keep editing; nothing is saved here.') }}</p></div>\n <button mat-flat-button type=\"button\" data-testid=\"settings-panel-return\" (click)=\"returnFromPreview()\">{{ tx('Back to settings') }}</button>\n </section>\n }\n <header class=\"settings-panel-header\" [hidden]=\"previewing\">\n <h2 class=\"settings-panel-title\" [id]=\"titleId\">\n @if (titleIcon) {\n <mat-icon class=\"title-icon\" [praxisIcon]=\"titleIcon\"></mat-icon>\n }\n <span>{{ title }}</span>\n </h2>\n <span class=\"spacer\"></span>\n @if (previewTarget) {\n <button mat-stroked-button type=\"button\" data-testid=\"settings-panel-preview\" [disabled]=\"!canInspectPreview\" (click)=\"showPreview()\">\n <mat-icon aria-hidden=\"true\" [praxisIcon]=\"'visibility'\"></mat-icon>{{ tx('View result') }}\n </button>\n }\n <button\n [praxisIconButton]=\"expanded ? 'close_fullscreen' : 'open_in_full'\"\n size=\"compact\"\n type=\"button\"\n data-testid=\"settings-panel-toggle-expand\"\n [attr.aria-label]=\"expanded ? tx('Collapse panel') : tx('Expand panel')\"\n [attr.aria-expanded]=\"expanded\"\n [matTooltip]=\"expanded ? tx('Collapse panel') : tx('Expand panel')\"\n (click)=\"toggleExpand()\"\n ></button>\n <button\n praxisIconButton=\"close\"\n size=\"compact\"\n type=\"button\"\n data-testid=\"settings-panel-close-icon\"\n [attr.aria-label]=\"tx('Close')\"\n [matTooltip]=\"tx('Close')\"\n (click)=\"onCancel()\"\n ></button>\n </header>\n @if (showStatusMessage && !previewing) {\n <div\n class=\"settings-panel-status\"\n [attr.data-status]=\"statusTone\"\n role=\"status\"\n aria-live=\"polite\"\n >\n <mat-icon\n aria-hidden=\"true\"\n [praxisIcon]=\"\n statusTone === 'dirty' || statusTone === 'invalid'\n ? 'warning'\n : statusTone === 'saved'\n ? 'check_circle'\n : statusTone === 'busy'\n ? 'autorenew'\n : 'info'\n \"\n ></mat-icon>\n <span>{{ statusMessage }}</span>\n </div>\n }\n <div class=\"settings-panel-body\" [hidden]=\"previewing\">\n <ng-template #contentHost></ng-template>\n </div>\n <footer class=\"settings-panel-footer\" [hidden]=\"previewing\">\n <button\n mat-button\n type=\"button\"\n data-testid=\"settings-panel-reset\"\n (mousedown)=\"$event.stopPropagation()\"\n (click)=\"$event.stopPropagation(); onReset()\"\n [disabled]=\"isBusy\"\n >\n <mat-icon aria-hidden=\"true\" [praxisIcon]=\"'restart_alt'\"></mat-icon>\n <span>{{ tx('Reset') }}</span>\n </button>\n <span class=\"spacer\"></span>\n <button\n mat-button\n type=\"button\"\n data-testid=\"settings-panel-cancel\"\n (mousedown)=\"$event.stopPropagation()\"\n (click)=\"$event.stopPropagation(); onCancel()\"\n [disabled]=\"isBusy\"\n >\n <mat-icon aria-hidden=\"true\" [praxisIcon]=\"'close'\"></mat-icon>\n <span>{{ tx('Cancel') }}</span>\n </button>\n <button\n mat-stroked-button\n type=\"button\"\n data-testid=\"settings-panel-apply\"\n (mousedown)=\"$event.stopPropagation()\"\n (click)=\"$event.stopPropagation(); onApply()\"\n [disabled]=\"!canApply\"\n [matTooltip]=\"applySaveDisabledReason\"\n [matTooltipDisabled]=\"canApply || !diagnostics.showDisabledReason\"\n [attr.aria-busy]=\"isBusy\"\n [attr.aria-label]=\"applyActionLabel || 'Apply'\"\n >\n @if (showBusyIndicator) {\n <mat-progress-spinner\n mode=\"indeterminate\"\n diameter=\"20\"\n ></mat-progress-spinner>\n }\n @if (!showBusyIndicator) {\n <mat-icon aria-hidden=\"true\" [praxisIcon]=\"'done'\"></mat-icon>\n <span class=\"settings-panel-action-label settings-panel-action-label--apply\">{{ applyActionLabel }}</span>\n }\n </button>\n <button\n mat-flat-button\n color=\"primary\"\n type=\"button\"\n data-testid=\"settings-panel-save\"\n (mousedown)=\"$event.stopPropagation()\"\n (click)=\"$event.stopPropagation(); onSave()\"\n [disabled]=\"!canSave\"\n [matTooltip]=\"applySaveDisabledReason\"\n [matTooltipDisabled]=\"canSave || !diagnostics.showDisabledReason\"\n [attr.aria-busy]=\"isBusy\"\n [attr.aria-label]=\"saveActionLabel || 'Save & Close'\"\n >\n @if (showBusyIndicator) {\n <mat-progress-spinner\n mode=\"indeterminate\"\n diameter=\"20\"\n ></mat-progress-spinner>\n }\n @if (!showBusyIndicator) {\n <mat-icon aria-hidden=\"true\" [praxisIcon]=\"'save'\"></mat-icon>\n <span class=\"settings-panel-action-label settings-panel-action-label--save\">{{ saveActionLabel }}</span>\n }\n </button>\n </footer>\n</div>\n", styles: ["@charset \"UTF-8\";praxis-settings-panel{display:block;height:100%;width:100%;min-width:0;flex:1 1 auto;box-sizing:border-box}praxis-settings-panel .settings-panel{position:relative;container:settings-panel-shell/inline-size;--pfx-settings-panel-surface-container: var( --md-sys-color-surface-container, #ffffff );--pfx-settings-panel-surface-container-high: var( --md-sys-color-surface-container-high, #f7f7f7 );--pfx-settings-panel-surface-container-low: var( --md-sys-color-surface-container-low, #f2f4f7 );--pfx-settings-panel-surface: var(--md-sys-color-surface, #ffffff);--pfx-settings-panel-on-surface: var(--md-sys-color-on-surface, #111827);--pfx-settings-panel-on-surface-variant: var( --md-sys-color-on-surface-variant, rgba(17, 24, 39, .72) );--pfx-settings-panel-outline: var( --md-sys-color-outline, rgba(15, 23, 42, .24) );--pfx-settings-panel-outline-variant: var( --md-sys-color-outline-variant, rgba(15, 23, 42, .12) );--pfx-settings-panel-primary: var(--md-sys-color-primary, #2563eb);--pfx-settings-panel-primary-container: var( --md-sys-color-primary-container, rgba(37, 99, 235, .14) );--pfx-settings-panel-on-primary-container: var( --md-sys-color-on-primary-container, #0f172a );--pfx-settings-panel-secondary: var( --md-sys-color-secondary, var(--pfx-settings-panel-primary) );--pfx-settings-panel-error: var(--md-sys-color-error, #b3261e);--pfx-settings-panel-error-container: var( --md-sys-color-error-container, rgba(179, 38, 30, .14) );display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto 1fr auto;grid-template-areas:\"header\" \"status\" \"body\" \"footer\";height:100%;background:var(--pfx-settings-panel-surface-container);color:var(--pfx-settings-panel-on-surface);border-left:1px solid var(--pfx-settings-panel-outline-variant);width:100%;max-width:100%;min-width:0;box-sizing:border-box;box-shadow:var(--pfx-settings-panel-elevation, var(--md-sys-elevation-level2, 0 8px 24px rgba(0, 0, 0, .16)));overflow:hidden}praxis-settings-panel .settings-panel__resize-handle{position:absolute;inset:0 auto 0 0;width:12px;cursor:col-resize;touch-action:none;z-index:3;outline:none}praxis-settings-panel .settings-panel__resize-handle:before{content:\"\";position:absolute;inset:0 auto 0 4px;width:2px;background:transparent;transition:background-color var(--pfx-side-panel-motion-duration, .16s) ease,opacity var(--pfx-side-panel-motion-duration, .16s) ease;opacity:0}praxis-settings-panel .settings-panel.is-resizable:hover .settings-panel__resize-handle:before,praxis-settings-panel .settings-panel__resize-handle:focus-visible:before{opacity:1;background:var(--pfx-settings-panel-outline)}praxis-settings-panel .settings-panel-header{grid-area:header;display:flex;align-items:center;gap:var(--pfx-settings-panel-header-gap, 8px);padding:12px var(--pfx-settings-panel-header-padding-x, 20px);min-height:var(--pfx-settings-panel-header-height, 64px);border-bottom:1px solid var(--pfx-settings-panel-outline-variant);background:var(--pfx-settings-panel-surface-container-high);box-shadow:var(--pfx-settings-panel-header-shadow, var(--md-sys-elevation-level1, 0 2px 6px rgba(0, 0, 0, .08)));flex-shrink:0;min-width:0;max-width:100%}praxis-settings-panel .settings-panel-header .spacer{flex:1 1 auto;min-width:0}praxis-settings-panel .settings-panel-status{grid-area:status;display:flex;align-items:center;gap:8px;min-height:36px;padding:6px var(--pfx-settings-panel-status-padding-x, 20px);border-bottom:1px solid var(--pfx-settings-panel-outline-variant);background:var(--pfx-settings-panel-surface-container-high);color:var(--pfx-settings-panel-on-surface);font-size:.85rem;font-weight:500;min-width:0;max-width:100%}praxis-settings-panel .settings-panel-status mat-icon{width:18px;height:18px;font-size:18px}praxis-settings-panel .settings-panel-status[data-status=dirty],praxis-settings-panel .settings-panel-status[data-status=invalid]{color:var(--pfx-settings-panel-error);background:color-mix(in srgb,var(--pfx-settings-panel-error-container) 30%,var(--pfx-settings-panel-surface-container-high))}praxis-settings-panel .settings-panel-status[data-status=saved]{color:var(--pfx-settings-panel-primary);background:color-mix(in srgb,var(--pfx-settings-panel-primary-container) 28%,var(--pfx-settings-panel-surface-container-high))}praxis-settings-panel .settings-panel-body{grid-area:body;overflow-y:auto;overflow-x:hidden;scroll-padding-top:var(--pfx-settings-panel-scroll-padding-start, 16px);scroll-padding-bottom:var(--pfx-settings-panel-scroll-padding-end, 88px);min-height:0;padding:var(--pfx-settings-panel-body-padding, 8px 16px 24px);background:var(--pfx-settings-panel-surface);display:flex;flex-direction:column;min-width:0;max-width:100%}praxis-settings-panel .settings-panel-body>*{min-width:0;max-width:100%}praxis-settings-panel .settings-panel-content{display:block;min-width:0;max-width:100%}praxis-settings-panel .settings-panel-content>*{min-width:0;max-width:100%;box-sizing:border-box}praxis-settings-panel .settings-panel-footer{grid-area:footer;border-top:1px solid var(--pfx-settings-panel-outline-variant);background:var(--pfx-settings-panel-surface-container-high);box-shadow:var(--pfx-settings-panel-footer-shadow, var(--md-sys-elevation-level1, 0 -2px 6px rgba(0, 0, 0, .08)));display:flex;align-items:center;flex-wrap:wrap;padding:var(--pfx-settings-panel-footer-padding, 12px 20px);column-gap:var(--pfx-settings-panel-footer-gap, 12px);row-gap:8px;flex-shrink:0;min-width:0;max-width:100%}praxis-settings-panel .spacer{flex:1}praxis-settings-panel .settings-panel-title{display:inline-flex;align-items:center;flex:1 1 auto;gap:var(--pfx-settings-panel-title-gap, 8px);font-weight:700;line-height:1.2;letter-spacing:.2px;margin:0;min-width:0;overflow:visible;white-space:normal}praxis-settings-panel .settings-panel-title span{min-width:0;overflow:visible;white-space:normal}praxis-settings-panel .settings-panel-title mat-icon{color:var(--pfx-settings-panel-primary)}praxis-settings-panel .settings-panel-title .title-icon{width:20px;height:20px;font-size:20px}praxis-settings-panel .settings-panel-footer button{display:inline-flex;align-items:center}praxis-settings-panel .settings-panel-footer button .mat-icon{flex:0 0 20px;font-size:20px;width:20px;height:20px;line-height:1;display:inline-flex;align-items:center;justify-content:center;overflow:hidden}praxis-settings-panel .settings-panel-footer .mat-button-wrapper{display:inline-flex;align-items:center;gap:var(--pfx-settings-panel-button-gap, 8px)}praxis-settings-panel .settings-panel-footer .mat-progress-spinner{margin-right:8px}praxis-settings-panel .settings-panel-footer .mat-flat-button[color=primary]{font-weight:600}praxis-settings-panel .settings-panel-footer .mdc-button__label{display:inline-flex;align-items:center;gap:var(--pfx-settings-panel-button-gap, 8px);line-height:1}praxis-settings-panel .settings-panel-footer .mdc-button__label>span{display:inline-flex;align-items:center;line-height:1}praxis-settings-panel .settings-panel-footer .mdc-button__label .mat-icon{display:inline-flex;align-items:center;justify-content:center;line-height:1}@container settings-panel-shell (max-width: 520px){praxis-settings-panel .settings-panel-footer{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:stretch;padding:10px 12px;column-gap:8px}praxis-settings-panel .settings-panel-footer .spacer{display:none}praxis-settings-panel .settings-panel-footer button{justify-content:center;width:100%;min-width:0;min-height:44px;height:auto;padding:8px}praxis-settings-panel .settings-panel-action-label{white-space:normal;overflow-wrap:anywhere;text-align:center}praxis-settings-panel .settings-panel-footer .mdc-button__label{min-width:0;max-width:100%}praxis-settings-panel .settings-panel-footer .mdc-button__label>span{min-width:0;line-height:1.25}}@container settings-panel-shell (max-width: 280px){praxis-settings-panel .settings-panel-footer{grid-template-columns:minmax(0,1fr)}}praxis-settings-panel .settings-panel .mat-divider{background-color:var(--pfx-settings-panel-outline-variant)!important}praxis-settings-panel .settings-panel .mat-expansion-panel{background:var(--pfx-settings-panel-surface-container)!important;border:1px solid var(--pfx-settings-panel-outline-variant);border-radius:var(--md-sys-shape-corner-medium, 12px);box-shadow:var(--md-sys-elevation-level1, 0 2px 8px rgba(0, 0, 0, .08));color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel .mat-expansion-panel-header{background:var(--pfx-settings-panel-surface-container)!important;color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-content{color:var(--pfx-settings-panel-on-surface);flex-wrap:wrap;gap:4px 12px;min-width:0;overflow:visible}praxis-settings-panel .settings-panel .mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:hover{background:color-mix(in srgb,var(--pfx-settings-panel-surface-container-high) 84%,var(--pfx-settings-panel-primary) 16%)}praxis-settings-panel .settings-panel .mat-expansion-panel.mat-expanded>.mat-expansion-panel-header{background:var(--pfx-settings-panel-surface-container-high)!important}praxis-settings-panel .settings-panel .mat-expansion-panel-header mat-icon,praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-icon{color:var(--pfx-settings-panel-on-surface)!important}praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-expansion-panel-header-title,praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-expansion-panel-header-description{color:var(--pfx-settings-panel-on-surface);min-width:0;overflow:visible;white-space:normal}praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-expansion-panel-header-description{color:var(--pfx-settings-panel-on-surface-variant);flex-wrap:wrap;gap:8px}praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-expansion-panel-header-title>*,praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-expansion-panel-header-description>*{color:inherit}praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-expansion-panel-header-title small,praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-expansion-panel-header-description small{color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-expansion-indicator,praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-expansion-indicator:after{color:var(--pfx-settings-panel-on-surface-variant);border-color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel .mat-expansion-panel .mat-action-row{border-top-color:var(--pfx-settings-panel-outline-variant);background:var(--pfx-settings-panel-surface-container-low)}praxis-settings-panel .settings-panel .mat-accordion,praxis-settings-panel .settings-panel .mat-accordion .mat-expansion-panel-spacing{background:transparent!important}praxis-settings-panel .settings-panel .mat-expansion-panel-content,praxis-settings-panel .settings-panel .mat-expansion-panel-content-wrapper,praxis-settings-panel .settings-panel .mat-expansion-panel-body{background:var(--pfx-settings-panel-surface-container)!important;color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel .mat-expansion-panel .mat-expansion-panel-body{padding:8px}praxis-settings-panel .settings-panel .mat-expansion-panel .mat-expansion-panel-body>*{color:inherit}praxis-settings-panel .settings-panel .mat-mdc-tab-group .mat-mdc-tab-header{border-bottom:1px solid var(--pfx-settings-panel-outline-variant);background:var(--pfx-settings-panel-surface-container-low)}praxis-settings-panel .settings-panel .mat-mdc-tab-group .mdc-tab{min-width:0}praxis-settings-panel .settings-panel .mat-mdc-tab-group .mdc-tab .mdc-tab__text-label{color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel .mat-mdc-tab-group .mdc-tab:hover .mdc-tab__text-label,praxis-settings-panel .settings-panel .mat-mdc-tab-group .mdc-tab:focus .mdc-tab__text-label{color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel .mat-mdc-tab-group .mdc-tab.mdc-tab--active .mdc-tab__text-label{color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel .mat-mdc-tab-group .mat-mdc-tab-header-pagination{color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel .mat-mdc-tab-group .mat-mdc-tab-header-pagination-chevron{border-color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel .mat-mdc-tab-group .mat-mdc-tab-header-pagination:not(.mat-mdc-tab-header-pagination-disabled):hover{background:color-mix(in srgb,var(--pfx-settings-panel-surface-container-high) 84%,var(--pfx-settings-panel-primary) 16%)}praxis-settings-panel .settings-panel .mat-mdc-tab-group .mdc-tab-indicator__content--underline{border-color:var(--pfx-settings-panel-primary)}praxis-settings-panel .settings-panel .mat-mdc-card{background:var(--pfx-settings-panel-surface-container-low);border:1px solid var(--pfx-settings-panel-outline-variant);color:var(--pfx-settings-panel-on-surface);box-shadow:var(--md-sys-elevation-level1, 0 2px 8px rgba(0, 0, 0, .08))}praxis-settings-panel .settings-panel .mat-mdc-card-subtitle,praxis-settings-panel .settings-panel .mat-mdc-card-content{color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel .mat-mdc-card-title{color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel .mat-mdc-form-field{width:100%;--mdc-filled-text-field-container-color: var( --pfx-settings-panel-surface-container );--mdc-filled-text-field-hover-container-color: var( --pfx-settings-panel-surface-container-high );--mdc-filled-text-field-focus-container-color: var( --pfx-settings-panel-surface-container-high );--mdc-filled-text-field-active-indicator-color: var( --pfx-settings-panel-outline-variant );--mdc-filled-text-field-hover-active-indicator-color: var( --pfx-settings-panel-secondary );--mdc-filled-text-field-focus-active-indicator-color: var( --pfx-settings-panel-primary );--mdc-filled-text-field-label-text-color: var( --pfx-settings-panel-on-surface-variant );--mdc-filled-text-field-focus-label-text-color: var( --pfx-settings-panel-primary );--mdc-filled-text-field-input-text-color: var( --pfx-settings-panel-on-surface );--mdc-filled-text-field-caret-color: var(--pfx-settings-panel-primary);--mdc-outlined-text-field-outline-color: var( --pfx-settings-panel-outline-variant );--mdc-outlined-text-field-hover-outline-color: var( --pfx-settings-panel-secondary );--mdc-outlined-text-field-focus-outline-color: var( --pfx-settings-panel-primary );--mdc-outlined-text-field-label-text-color: var( --pfx-settings-panel-on-surface-variant );--mdc-outlined-text-field-focus-label-text-color: var( --pfx-settings-panel-primary );--mdc-outlined-text-field-input-text-color: var( --pfx-settings-panel-on-surface );--mdc-outlined-text-field-caret-color: var(--pfx-settings-panel-primary);--mat-form-field-focus-select-arrow-color: var( --pfx-settings-panel-primary );--mat-form-field-enabled-select-arrow-color: var( --pfx-settings-panel-on-surface-variant )}praxis-settings-panel .settings-panel .mdc-text-field--filled{background-color:var(--pfx-settings-panel-surface-container)!important;border-radius:var(--md-sys-shape-corner-small, 8px) var(--md-sys-shape-corner-small, 8px) 0 0}praxis-settings-panel .settings-panel .mat-mdc-text-field-wrapper,praxis-settings-panel .settings-panel .mat-mdc-form-field-flex,praxis-settings-panel .settings-panel .mat-mdc-form-field-infix,praxis-settings-panel .settings-panel .mat-mdc-form-field-focus-overlay{background:var(--pfx-settings-panel-surface-container)!important;color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel .mat-mdc-form-field-focus-overlay{opacity:0}praxis-settings-panel .settings-panel .mdc-text-field--filled .mdc-text-field__input,praxis-settings-panel .settings-panel .mdc-text-field--filled .mdc-floating-label,praxis-settings-panel .settings-panel .mat-mdc-select-value,praxis-settings-panel .settings-panel .mat-mdc-select-arrow,praxis-settings-panel .settings-panel .mat-mdc-form-field .mat-mdc-floating-label{color:var(--pfx-settings-panel-on-surface-variant)!important}praxis-settings-panel .settings-panel .mdc-text-field--filled.mdc-text-field--focused .mdc-floating-label,praxis-settings-panel .settings-panel .mdc-text-field--filled .mdc-text-field__input{color:var(--pfx-settings-panel-on-surface)!important}praxis-settings-panel .settings-panel .mat-mdc-form-field input,praxis-settings-panel .settings-panel .mat-mdc-form-field textarea,praxis-settings-panel .settings-panel .mat-mdc-form-field .mdc-text-field__input{color:var(--pfx-settings-panel-on-surface)!important}praxis-settings-panel .settings-panel .mat-mdc-form-field-subscript-wrapper,praxis-settings-panel .settings-panel .mat-mdc-form-field-hint-wrapper,praxis-settings-panel .settings-panel .mat-mdc-form-field-error-wrapper,praxis-settings-panel .settings-panel .mat-mdc-hint{color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel .mat-button-toggle-group{border-color:var(--pfx-settings-panel-outline-variant);background:var(--pfx-settings-panel-surface-container-low)}praxis-settings-panel .settings-panel .mat-button-toggle{background:var(--pfx-settings-panel-surface-container-low);color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel .mat-button-toggle+.mat-button-toggle{border-left-color:var(--pfx-settings-panel-outline-variant)}praxis-settings-panel .settings-panel .mat-button-toggle-checked{background:var(--pfx-settings-panel-primary-container)!important;color:var(--pfx-settings-panel-on-primary-container)!important}praxis-settings-panel .settings-panel .mat-button-toggle .mat-icon,praxis-settings-panel .settings-panel .mat-button-toggle-checked .mat-icon{color:inherit}praxis-settings-panel .settings-panel .mat-mdc-slide-toggle .mdc-label{color:var(--pfx-settings-panel-on-surface)}.settings-panel{grid-template-columns:minmax(0,1fr);min-width:0;max-width:100%}.settings-panel-body{overflow-x:hidden;min-width:0}.settings-panel-body>*{min-width:0;max-width:100%}.praxis-settings-panel-backdrop{background:var(--pfx-backdrop, rgba(8, 15, 26, .42));backdrop-filter:blur(var(--pfx-backdrop-blur, 6px)) saturate(110%);-webkit-backdrop-filter:blur(var(--pfx-backdrop-blur, 6px)) saturate(110%)}.praxis-settings-panel-pane{position:fixed!important;top:0!important;right:0!important;display:flex!important;align-items:stretch!important;height:100vh!important;max-width:100vw!important;max-height:100vh!important;z-index:var(--praxis-layer-settings-panel, 1220)!important;transition:width var(--pfx-side-panel-motion-duration-enter, .3s) var(--pfx-side-panel-motion-easing-enter, ease)}.praxis-settings-panel-pane .settings-panel{pointer-events:auto}@media(prefers-reduced-motion:reduce){.praxis-settings-panel-pane{transition:none}}.praxis-settings-panel-pane.praxis-settings-panel-pane--preview{top:auto!important;bottom:12px!important;right:12px!important;height:auto!important;width:min(560px,100vw - 24px)!important;min-width:0!important;transition:none}.praxis-settings-panel-backdrop.praxis-settings-panel-backdrop--preview{background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none}.praxis-settings-preview-target{outline:2px solid var(--md-sys-color-primary);outline-offset:3px}praxis-settings-panel .settings-panel [hidden]{display:none!important}praxis-settings-panel .settings-panel--preview{height:auto;min-height:0;grid-template-rows:auto;border-radius:16px}praxis-settings-panel .settings-panel-preview-bar{display:flex;align-items:center;gap:16px;padding:16px;color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel-preview-bar p{margin:4px 0 0;color:var(--pfx-settings-panel-on-surface-variant);font-size:.875rem}praxis-settings-panel .settings-panel-preview-bar button{flex-shrink:0}@container settings-panel-shell (max-width: 599px){praxis-settings-panel .settings-panel-header:not([hidden]){display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:start}praxis-settings-panel .settings-panel-header .spacer{display:none}praxis-settings-panel .settings-panel-header .settings-panel-title{grid-column:1;grid-row:1;overflow-wrap:anywhere}praxis-settings-panel .settings-panel-header [data-testid=settings-panel-toggle-expand]{grid-column:2;grid-row:1}praxis-settings-panel .settings-panel-header [data-testid=settings-panel-close-icon]{grid-column:3;grid-row:1}praxis-settings-panel .settings-panel-header [data-testid=settings-panel-preview]{grid-column:1/-1;grid-row:2;justify-self:start;max-width:100%}praxis-settings-panel .settings-panel-preview-bar{flex-direction:column;align-items:stretch;gap:8px}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: PraxisIconButtonComponent, selector: "button[praxisIconButton]", inputs: ["praxisIconButton", "size", "appearance", "presentation", "pressed", "busy"] }, { kind: "directive", type: PraxisIconDirective, selector: "mat-icon[praxisIcon]", inputs: ["praxisIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i7.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: MatDialogModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1904
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: SettingsPanelComponent, isStandalone: true, selector: "praxis-settings-panel", host: { listeners: { "document:keydown": "handleKeydown($event)", "document:pointermove": "onDocumentPointerMove($event)", "document:pointerup": "onDocumentPointerEnd($event)", "document:pointercancel": "onDocumentPointerEnd($event)" } }, providers: [providePraxisSettingsPanelI18n()], viewQueries: [{ propertyName: "focusTrap", first: true, predicate: CdkTrapFocus, descendants: true }, { propertyName: "contentHost", first: true, predicate: ["contentHost"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "saveErrorBanner", first: true, predicate: ["saveErrorBanner"], descendants: true }], ngImport: i0, template: "<div\n class=\"settings-panel\"\n data-testid=\"settings-panel-root\"\n [class.expanded]=\"expanded\"\n [class.settings-panel--preview]=\"previewing\"\n [class.is-resizable]=\"showResizeHandle\"\n [ngStyle]=\"panelInlineStyles\"\n role=\"dialog\"\n [attr.aria-modal]=\"interactionActive ? 'true' : null\"\n [attr.aria-hidden]=\"interactionActive ? null : 'true'\"\n [attr.inert]=\"interactionActive ? null : ''\"\n [attr.aria-labelledby]=\"previewing ? titleId + '-preview' : titleId\"\n [cdkTrapFocus]=\"interactionActive\"\n [cdkTrapFocusAutoCapture]=\"true\"\n >\n @if (showResizeHandle && !previewing) {\n <div\n class=\"settings-panel__resize-handle\"\n role=\"separator\"\n tabindex=\"0\"\n aria-orientation=\"vertical\"\n [attr.aria-label]=\"resizeHandleLabel\"\n (pointerdown)=\"onResizeHandlePointerDown($event)\"\n (keydown)=\"onResizeHandleKeydown($event)\"\n ></div>\n }\n @if (previewing) {\n <section class=\"settings-panel-preview-bar\" data-testid=\"settings-panel-preview-bar\">\n <div><strong [id]=\"titleId + '-preview'\">{{ tx('Page preview') }}</strong><p>{{ tx('Inspect the result. Return to keep editing; nothing is saved here.') }}</p></div>\n <button mat-flat-button type=\"button\" data-testid=\"settings-panel-return\" (click)=\"returnFromPreview()\">{{ tx('Back to settings') }}</button>\n </section>\n }\n <header class=\"settings-panel-header\" [hidden]=\"previewing\">\n <h2 class=\"settings-panel-title\" [id]=\"titleId\">\n @if (titleIcon) {\n <mat-icon class=\"title-icon\" [praxisIcon]=\"titleIcon\"></mat-icon>\n }\n <span>{{ title }}</span>\n </h2>\n <span class=\"spacer\"></span>\n @if (previewTarget) {\n <button mat-stroked-button type=\"button\" data-testid=\"settings-panel-preview\" [disabled]=\"!canInspectPreview\" (click)=\"showPreview()\">\n <mat-icon aria-hidden=\"true\" [praxisIcon]=\"'visibility'\"></mat-icon>{{ tx('View result') }}\n </button>\n }\n <button\n [praxisIconButton]=\"expanded ? 'close_fullscreen' : 'open_in_full'\"\n size=\"compact\"\n type=\"button\"\n data-testid=\"settings-panel-toggle-expand\"\n [attr.aria-label]=\"expanded ? tx('Collapse panel') : tx('Expand panel')\"\n [attr.aria-expanded]=\"expanded\"\n [matTooltip]=\"expanded ? tx('Collapse panel') : tx('Expand panel')\"\n (click)=\"toggleExpand()\"\n ></button>\n <button\n praxisIconButton=\"close\"\n size=\"compact\"\n type=\"button\"\n data-testid=\"settings-panel-close-icon\"\n [disabled]=\"isBusy\"\n [attr.aria-label]=\"tx('Close')\"\n [matTooltip]=\"tx('Close')\"\n (click)=\"onCancel()\"\n ></button>\n </header>\n @if (hasContextNavigation && !previewing) {\n <nav\n class=\"settings-panel-context-nav\"\n data-testid=\"settings-panel-context-nav\"\n [attr.aria-label]=\"tx('Context navigation')\"\n >\n @if (contextNavigation?.targets?.length) {\n <div class=\"settings-panel-context-nav__targets\">\n <button\n praxisIconButton=\"chevron_left\"\n size=\"compact\"\n type=\"button\"\n data-testid=\"settings-panel-prev-target\"\n [disabled]=\"!canSelectPreviousTarget\"\n [attr.aria-label]=\"tx('Previous item')\"\n [matTooltip]=\"tx('Previous item')\"\n (click)=\"selectPreviousTarget()\"\n ></button>\n <select\n #targetSelect\n class=\"settings-panel-context-nav__target-select\"\n data-testid=\"settings-panel-target-select\"\n [disabled]=\"isBusy || !interactionActive\"\n [attr.aria-label]=\"tx('Editing target')\"\n [value]=\"contextNavigation?.activeTargetId || ''\"\n (change)=\"selectContextTarget(targetSelect.value, targetSelect)\"\n >\n @for (target of contextNavigation?.targets || []; track target.id) {\n <option [value]=\"target.id\" [selected]=\"target.id === contextNavigation?.activeTargetId\">\n {{ target.label }}\n </option>\n }\n </select>\n <button\n praxisIconButton=\"chevron_right\"\n size=\"compact\"\n type=\"button\"\n data-testid=\"settings-panel-next-target\"\n [disabled]=\"!canSelectNextTarget\"\n [attr.aria-label]=\"tx('Next item')\"\n [matTooltip]=\"tx('Next item')\"\n (click)=\"selectNextTarget()\"\n ></button>\n </div>\n }\n @if (contextNavigation?.modes?.length) {\n <div\n class=\"settings-panel-context-nav__modes\"\n role=\"group\"\n [attr.aria-label]=\"tx('Editing modes')\"\n >\n @for (mode of contextNavigation?.modes || []; track mode.id) {\n <button\n type=\"button\"\n class=\"settings-panel-context-nav__mode-btn\"\n [class.is-active]=\"mode.id === contextNavigation?.activeModeId\"\n [disabled]=\"mode.disabled || isBusy || !interactionActive\"\n [attr.aria-pressed]=\"mode.id === contextNavigation?.activeModeId\"\n [attr.title]=\"mode.label\"\n [attr.data-testid]=\"'settings-panel-mode-' + mode.id\"\n (click)=\"selectContextMode(mode.id)\"\n >\n {{ mode.label }}\n </button>\n }\n </div>\n }\n </nav>\n }\n @if (showStatusMessage && !previewing) {\n <div\n class=\"settings-panel-status\"\n [attr.data-status]=\"statusTone\"\n role=\"status\"\n aria-live=\"polite\"\n >\n <mat-icon\n aria-hidden=\"true\"\n [praxisIcon]=\"\n statusTone === 'dirty' || statusTone === 'invalid'\n ? 'warning'\n : statusTone === 'saved'\n ? 'check_circle'\n : statusTone === 'busy'\n ? 'autorenew'\n : 'info'\n \"\n ></mat-icon>\n <span>{{ statusMessage }}</span>\n @if (showWriteScopeControls) {\n <span class=\"spacer\"></span>\n <span\n class=\"settings-panel-scope\"\n [attr.data-scope]=\"activeWriteScope\"\n data-testid=\"settings-panel-write-scope\"\n >\n <span class=\"settings-panel-scope__label\">{{ writeScopeLabel }}</span>\n @if (canToggleWriteScope) {\n <button\n mat-stroked-button\n type=\"button\"\n class=\"settings-panel-scope__toggle\"\n data-testid=\"settings-panel-scope-toggle\"\n [matTooltip]=\"writeScopeToggleLabel\"\n (click)=\"toggleWriteScope()\"\n >\n {{ writeScopeToggleLabel }}\n </button>\n }\n @if (canResetPersonalOverride) {\n <button\n mat-button\n type=\"button\"\n class=\"settings-panel-scope__reset\"\n data-testid=\"settings-panel-reset-personal-override\"\n [disabled]=\"isBusy || isConfirmDialogOpen\"\n (click)=\"resetPersonalOverrideToTenant()\"\n >\n {{ tx('Reset to tenant baseline') }}\n </button>\n }\n </span>\n }\n </div>\n }\n @if (!previewing && storageSaveError(); as saveErr) {\n <div\n #saveErrorBanner\n tabindex=\"-1\"\n class=\"settings-panel-save-error\"\n role=\"alert\"\n aria-live=\"assertive\"\n aria-atomic=\"true\"\n data-testid=\"settings-panel-save-error\"\n [attr.data-error-code]=\"saveErr.errorCode || saveErr.status || 'save-error'\"\n [attr.data-correlation-id]=\"saveErr.correlationId || null\"\n >\n <mat-icon aria-hidden=\"true\" [praxisIcon]=\"'error_outline'\"></mat-icon>\n <div class=\"settings-panel-save-error__content\">\n <p class=\"settings-panel-save-error__message\">{{ formattedSaveErrorMessage }}</p>\n @if (saveErr.detail && saveErr.detail !== formattedSaveErrorMessage && saveErr.detail !== saveErrorFieldMessages.join('; ')) {\n <p class=\"settings-panel-save-error__detail\">{{ saveErr.detail }}</p>\n } @else if (saveErr.title && saveErr.title !== formattedSaveErrorMessage) {\n <p class=\"settings-panel-save-error__detail\">{{ saveErr.title }}</p>\n }\n @if (saveErr.errorCode || saveErr.correlationId) {\n <p class=\"settings-panel-save-error__meta\" data-testid=\"settings-panel-save-error-meta\">\n @if (saveErr.errorCode) {\n <span>{{ tx('Code: {{code}}', { code: saveErr.errorCode }) }}</span>\n }\n @if (saveErr.correlationId) {\n <span>{{ tx('Correlation ID: {{id}}', { id: saveErr.correlationId }) }}</span>\n }\n </p>\n }\n @if (saveErrorFieldMessages.length > 0) {\n <ul class=\"settings-panel-save-error__fields\" data-testid=\"settings-panel-save-error-fields\">\n @for (fieldMsg of saveErrorFieldMessages; track $index) {\n <li>{{ fieldMsg }}</li>\n }\n </ul>\n }\n @if (canSwitchToPersonalScopeFromError) {\n <button\n mat-stroked-button\n type=\"button\"\n class=\"settings-panel-save-error__action\"\n data-testid=\"settings-panel-switch-personal\"\n (click)=\"switchToPersonalScopeFromError()\"\n >\n {{ tx('Switch to personal scope') }}\n </button>\n }\n </div>\n <button\n praxisIconButton=\"close\"\n size=\"compact\"\n type=\"button\"\n data-testid=\"settings-panel-save-error-dismiss\"\n [attr.aria-label]=\"tx('Dismiss error')\"\n (click)=\"dismissSaveError()\"\n ></button>\n </div>\n }\n <div class=\"settings-panel-body\" [hidden]=\"previewing\">\n <ng-template #contentHost></ng-template>\n </div>\n <footer class=\"settings-panel-footer\" [hidden]=\"previewing\">\n <button\n mat-button\n type=\"button\"\n data-testid=\"settings-panel-reset\"\n (mousedown)=\"$event.stopPropagation()\"\n (click)=\"$event.stopPropagation(); onReset()\"\n [disabled]=\"isBusy || isConfirmDialogOpen\"\n >\n <mat-icon aria-hidden=\"true\" [praxisIcon]=\"'restart_alt'\"></mat-icon>\n <span>{{ tx('Reset') }}</span>\n </button>\n <span class=\"spacer\"></span>\n <button\n mat-button\n type=\"button\"\n data-testid=\"settings-panel-cancel\"\n (mousedown)=\"$event.stopPropagation()\"\n (click)=\"$event.stopPropagation(); onCancel()\"\n [disabled]=\"isBusy || isConfirmDialogOpen\"\n >\n <mat-icon aria-hidden=\"true\" [praxisIcon]=\"'close'\"></mat-icon>\n <span>{{ tx('Cancel') }}</span>\n </button>\n <button\n mat-stroked-button\n type=\"button\"\n data-testid=\"settings-panel-apply\"\n (mousedown)=\"$event.stopPropagation()\"\n (click)=\"$event.stopPropagation(); onApply()\"\n [disabled]=\"!canApply\"\n [matTooltip]=\"applySaveDisabledReason\"\n [matTooltipDisabled]=\"canApply || !diagnostics.showDisabledReason\"\n [attr.aria-busy]=\"isBusy\"\n [attr.aria-label]=\"applyActionLabel || 'Apply'\"\n >\n @if (showBusyIndicator) {\n <mat-progress-spinner\n mode=\"indeterminate\"\n diameter=\"20\"\n ></mat-progress-spinner>\n }\n @if (!showBusyIndicator) {\n <mat-icon aria-hidden=\"true\" [praxisIcon]=\"'done'\"></mat-icon>\n <span class=\"settings-panel-action-label settings-panel-action-label--apply\">{{ applyActionLabel }}</span>\n }\n </button>\n <button\n mat-flat-button\n color=\"primary\"\n type=\"button\"\n data-testid=\"settings-panel-save\"\n (mousedown)=\"$event.stopPropagation()\"\n (click)=\"$event.stopPropagation(); onSave()\"\n [disabled]=\"!canSave\"\n [matTooltip]=\"applySaveDisabledReason\"\n [matTooltipDisabled]=\"canSave || !diagnostics.showDisabledReason\"\n [attr.aria-busy]=\"isBusy\"\n [attr.aria-label]=\"saveActionLabel || 'Save & Close'\"\n >\n @if (showBusyIndicator) {\n <mat-progress-spinner\n mode=\"indeterminate\"\n diameter=\"20\"\n ></mat-progress-spinner>\n }\n @if (!showBusyIndicator) {\n <mat-icon aria-hidden=\"true\" [praxisIcon]=\"'save'\"></mat-icon>\n <span class=\"settings-panel-action-label settings-panel-action-label--save\">{{ saveActionLabel }}</span>\n }\n </button>\n </footer>\n</div>\n", styles: ["@charset \"UTF-8\";praxis-settings-panel{display:block;height:100%;width:100%;min-width:0;flex:1 1 auto;box-sizing:border-box}praxis-settings-panel .settings-panel{position:relative;container:settings-panel-shell/inline-size;--pfx-settings-panel-surface-container: var( --md-sys-color-surface-container, #ffffff );--pfx-settings-panel-surface-container-high: var( --md-sys-color-surface-container-high, #f7f7f7 );--pfx-settings-panel-surface-container-low: var( --md-sys-color-surface-container-low, #f2f4f7 );--pfx-settings-panel-surface: var(--md-sys-color-surface, #ffffff);--pfx-settings-panel-on-surface: var(--md-sys-color-on-surface, #111827);--pfx-settings-panel-on-surface-variant: var( --md-sys-color-on-surface-variant, rgba(17, 24, 39, .72) );--pfx-settings-panel-outline: var( --md-sys-color-outline, rgba(15, 23, 42, .24) );--pfx-settings-panel-outline-variant: var( --md-sys-color-outline-variant, rgba(15, 23, 42, .12) );--pfx-settings-panel-primary: var(--md-sys-color-primary, #2563eb);--pfx-settings-panel-primary-container: var( --md-sys-color-primary-container, rgba(37, 99, 235, .14) );--pfx-settings-panel-on-primary-container: var( --md-sys-color-on-primary-container, #0f172a );--pfx-settings-panel-secondary: var( --md-sys-color-secondary, var(--pfx-settings-panel-primary) );--pfx-settings-panel-error: var(--md-sys-color-error, #b3261e);--pfx-settings-panel-error-container: var( --md-sys-color-error-container, rgba(179, 38, 30, .14) );--pfx-settings-panel-alert-bg: color-mix( in srgb, var(--pfx-settings-panel-error-container) 78%, var(--pfx-settings-panel-surface) );--pfx-settings-panel-alert-fg: var(--pfx-settings-panel-error);--pfx-settings-panel-scope-bg: var(--pfx-settings-panel-surface);--pfx-settings-panel-scope-fg: var(--pfx-settings-panel-on-surface-variant);--pfx-settings-panel-border-radius: 0px;--mat-divider-color: var(--pfx-settings-panel-outline-variant);--mat-expansion-container-background-color: var( --pfx-settings-panel-surface-container );--mat-expansion-container-text-color: var(--pfx-settings-panel-on-surface);--mat-expansion-header-text-color: var(--pfx-settings-panel-on-surface);--mat-expansion-header-description-color: var( --pfx-settings-panel-on-surface-variant );--mat-expansion-header-indicator-color: var( --pfx-settings-panel-on-surface-variant );--mat-button-toggle-selected-state-background-color: var( --pfx-settings-panel-primary-container );--mat-button-toggle-selected-state-text-color: var( --pfx-settings-panel-on-primary-container );display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto auto auto 1fr auto;grid-template-areas:\"header\" \"context-nav\" \"status\" \"alert\" \"body\" \"footer\";min-width:0;height:100%;max-width:var(--pfx-settings-panel-max-width, 100%);background:var(--pfx-settings-panel-surface-container);color:var(--pfx-settings-panel-on-surface);border-left:1px solid var(--pfx-settings-panel-outline-variant);border-radius:var(--pfx-settings-panel-border-radius, 0px);width:var(--pfx-settings-panel-width, 100%);box-sizing:border-box;box-shadow:var(--pfx-settings-panel-elevation, var(--md-sys-elevation-level2, 0 8px 24px rgba(0, 0, 0, .16)));overflow:hidden}praxis-settings-panel .settings-panel__resize-handle{position:absolute;inset:0 auto 0 0;width:12px;cursor:col-resize;touch-action:none;z-index:3;outline:none}praxis-settings-panel .settings-panel__resize-handle:before{content:\"\";position:absolute;inset:0 auto 0 4px;width:2px;background:transparent;transition:background-color var(--pfx-side-panel-motion-duration, .16s) ease,opacity var(--pfx-side-panel-motion-duration, .16s) ease;opacity:0}praxis-settings-panel .settings-panel.is-resizable:hover .settings-panel__resize-handle:before,praxis-settings-panel .settings-panel__resize-handle:focus-visible:before{opacity:1;background:var(--pfx-settings-panel-outline)}praxis-settings-panel .settings-panel-header{grid-area:header;display:flex;align-items:center;gap:var(--pfx-settings-panel-header-gap, 8px);padding:12px var(--pfx-settings-panel-header-padding-x, 20px);min-height:var(--pfx-settings-panel-header-height, 64px);border-bottom:1px solid var(--pfx-settings-panel-outline-variant);background:var(--pfx-settings-panel-surface-container-high);box-shadow:var(--pfx-settings-panel-header-shadow, var(--md-sys-elevation-level1, 0 2px 6px rgba(0, 0, 0, .08)));flex-shrink:0;min-width:0;max-width:100%}praxis-settings-panel .settings-panel-header .spacer{flex:1 1 auto;min-width:0}praxis-settings-panel .settings-panel-context-nav{grid-area:context-nav;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 12px;padding:8px var(--pfx-settings-panel-header-padding-x, 20px);border-bottom:1px solid var(--pfx-settings-panel-outline-variant);background:var(--pfx-settings-panel-surface-container-low);min-width:0;max-width:100%}praxis-settings-panel .settings-panel-context-nav__targets{display:flex;align-items:center;gap:4px;min-width:0;flex:1 1 200px}praxis-settings-panel .settings-panel-context-nav__target-select{flex:1 1 auto;min-width:0;min-height:34px;padding:4px 10px;border-radius:8px;border:1px solid var(--pfx-settings-panel-outline-variant);background:var(--pfx-settings-panel-surface);color:var(--pfx-settings-panel-on-surface);font:inherit;font-size:.84rem;font-weight:600}praxis-settings-panel .settings-panel-context-nav__modes{display:inline-flex;align-items:center;flex-wrap:wrap;gap:4px;padding:2px;max-width:100%;border-radius:999px;border:1px solid var(--pfx-settings-panel-outline-variant);background:var(--pfx-settings-panel-surface)}praxis-settings-panel .settings-panel-context-nav__mode-btn{appearance:none;border:none;background:transparent;color:var(--pfx-settings-panel-on-surface-variant);font:inherit;font-size:.78rem;font-weight:600;padding:5px 12px;border-radius:999px;white-space:nowrap;flex-shrink:0;cursor:pointer;transition:background-color .14s ease,color .14s ease}praxis-settings-panel .settings-panel-context-nav__mode-btn.is-active{background:var(--pfx-settings-panel-primary-container);color:var(--pfx-settings-panel-on-primary-container)}praxis-settings-panel .settings-panel-context-nav__mode-btn:disabled{opacity:.42;cursor:not-allowed}praxis-settings-panel .settings-panel-status{grid-area:status;display:flex;align-items:center;gap:8px;min-height:36px;padding:6px var(--pfx-settings-panel-status-padding-x, 20px);border-bottom:1px solid var(--pfx-settings-panel-outline-variant);background:var(--pfx-settings-panel-surface-container-high);color:var(--pfx-settings-panel-on-surface);font-size:.85rem;font-weight:500;min-width:0;max-width:100%}praxis-settings-panel .settings-panel-status mat-icon{width:18px;height:18px;font-size:18px}praxis-settings-panel .settings-panel-status[data-status=dirty],praxis-settings-panel .settings-panel-status[data-status=invalid]{color:var(--pfx-settings-panel-error);background:color-mix(in srgb,var(--pfx-settings-panel-error-container) 30%,var(--pfx-settings-panel-surface-container-high))}praxis-settings-panel .settings-panel-status[data-status=saved]{color:var(--pfx-settings-panel-primary);background:color-mix(in srgb,var(--pfx-settings-panel-primary-container) 28%,var(--pfx-settings-panel-surface-container-high))}praxis-settings-panel .settings-panel-scope{display:inline-flex;align-items:center;flex-wrap:wrap;gap:6px;padding:2px 8px;border-radius:999px;border:1px solid var(--pfx-settings-panel-outline-variant);background:var(--pfx-settings-panel-scope-bg);color:var(--pfx-settings-panel-scope-fg);font-size:.75rem;font-weight:600}praxis-settings-panel .settings-panel-scope[data-scope=tenant]{border-color:color-mix(in srgb,var(--pfx-settings-panel-primary) 42%,var(--pfx-settings-panel-outline-variant));background:var(--pfx-settings-panel-primary-container);color:var(--pfx-settings-panel-on-primary-container)}praxis-settings-panel .settings-panel-scope__toggle,praxis-settings-panel .settings-panel-scope__reset{height:24px;line-height:22px;font-size:.72rem;padding:0 8px}praxis-settings-panel .settings-panel-save-error{grid-area:alert;display:flex;align-items:flex-start;gap:10px;padding:10px var(--pfx-settings-panel-status-padding-x, 20px);background:var(--pfx-settings-panel-alert-bg);color:var(--pfx-settings-panel-alert-fg);border-bottom:1px solid color-mix(in srgb,var(--pfx-settings-panel-error) 32%,var(--pfx-settings-panel-outline-variant));font-size:.82rem}praxis-settings-panel .settings-panel-save-error__content{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:4px}praxis-settings-panel .settings-panel-save-error__message{margin:0;font-weight:600;line-height:1.35}praxis-settings-panel .settings-panel-save-error:focus-visible,praxis-settings-panel .settings-panel-save-error:focus{outline:2px solid var(--pfx-settings-panel-error);outline-offset:-2px}praxis-settings-panel .settings-panel-save-error__detail{margin:0;font-size:.78rem;color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel-save-error__meta{margin:2px 0 0;display:flex;flex-wrap:wrap;gap:6px 12px;font-size:.72rem;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel-save-error__fields{margin:2px 0 0;padding-inline-start:16px;font-size:.78rem;color:var(--pfx-settings-panel-on-surface-variant);display:flex;flex-direction:column;gap:2px}praxis-settings-panel .settings-panel-save-error__action{align-self:flex-start;margin-top:2px}praxis-settings-panel .settings-panel-body{grid-area:body;container-type:inline-size;overflow-y:auto;overflow-x:hidden;scroll-padding-top:var(--pfx-settings-panel-scroll-padding-start, 16px);scroll-padding-bottom:var(--pfx-settings-panel-scroll-padding-end, 88px);min-height:0;padding:var(--pfx-settings-panel-body-padding, 8px 16px 24px);background:var(--pfx-settings-panel-surface);display:flex;flex-direction:column;min-width:0;max-width:100%}praxis-settings-panel .settings-panel-body>*{min-width:0;max-width:100%}praxis-settings-panel .settings-panel-content{display:block;min-width:0;max-width:100%}praxis-settings-panel .settings-panel-content>*{min-width:0;max-width:100%;box-sizing:border-box}praxis-settings-panel .settings-panel-footer{grid-area:footer;border-top:1px solid var(--pfx-settings-panel-outline-variant);background:var(--pfx-settings-panel-surface-container-high);box-shadow:var(--pfx-settings-panel-footer-shadow, var(--md-sys-elevation-level1, 0 -2px 6px rgba(0, 0, 0, .08)));display:flex;align-items:center;flex-wrap:wrap;padding:var(--pfx-settings-panel-footer-padding, 12px 20px);column-gap:var(--pfx-settings-panel-footer-gap, 12px);row-gap:8px;flex-shrink:0;min-width:0;max-width:100%}praxis-settings-panel .spacer{flex:1}praxis-settings-panel .settings-panel-title{display:inline-flex;align-items:center;flex:1 1 auto;gap:var(--pfx-settings-panel-title-gap, 8px);font-weight:700;line-height:1.2;letter-spacing:.2px;margin:0;min-width:0;overflow:visible;white-space:normal}praxis-settings-panel .settings-panel-title span{min-width:0;overflow:visible;white-space:normal}praxis-settings-panel .settings-panel-title mat-icon{color:var(--pfx-settings-panel-primary)}praxis-settings-panel .settings-panel-title .title-icon{width:20px;height:20px;font-size:20px}praxis-settings-panel .settings-panel-footer button{display:inline-flex;align-items:center}praxis-settings-panel .settings-panel-footer button .mat-icon{flex:0 0 20px;font-size:20px;width:20px;height:20px;line-height:1;display:inline-flex;align-items:center;justify-content:center;overflow:hidden}praxis-settings-panel .settings-panel-footer .mat-button-wrapper{display:inline-flex;align-items:center;gap:var(--pfx-settings-panel-button-gap, 8px)}praxis-settings-panel .settings-panel-footer .mat-progress-spinner{margin-right:8px}praxis-settings-panel .settings-panel-footer .mat-flat-button[color=primary]{font-weight:600}praxis-settings-panel .settings-panel-footer .mdc-button__label{display:inline-flex;align-items:center;gap:var(--pfx-settings-panel-button-gap, 8px);line-height:1}praxis-settings-panel .settings-panel-footer .mdc-button__label>span{display:inline-flex;align-items:center;line-height:1}praxis-settings-panel .settings-panel-footer .mdc-button__label .mat-icon{display:inline-flex;align-items:center;justify-content:center;line-height:1}@container settings-panel-shell (max-width: 520px){praxis-settings-panel .settings-panel-footer{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:stretch;padding:10px 12px;column-gap:8px}praxis-settings-panel .settings-panel-footer .spacer{display:none}praxis-settings-panel .settings-panel-footer button{justify-content:center;width:100%;min-width:0;min-height:44px;height:auto;padding:8px}praxis-settings-panel .settings-panel-action-label{white-space:normal;overflow-wrap:anywhere;text-align:center}praxis-settings-panel .settings-panel-footer .mdc-button__label{min-width:0;max-width:100%}praxis-settings-panel .settings-panel-footer .mdc-button__label>span{min-width:0;line-height:1.25}}@container settings-panel-shell (max-width: 280px){praxis-settings-panel .settings-panel-footer{grid-template-columns:minmax(0,1fr)}}praxis-settings-panel .settings-panel .mat-divider{background-color:var(--pfx-settings-panel-outline-variant)}praxis-settings-panel .settings-panel .mat-expansion-panel{background:var(--pfx-settings-panel-surface-container);border:1px solid var(--pfx-settings-panel-outline-variant);border-radius:var(--md-sys-shape-corner-medium, 12px);box-shadow:var(--md-sys-elevation-level1, 0 2px 8px rgba(0, 0, 0, .08));color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel .mat-expansion-panel-header{background:var(--pfx-settings-panel-surface-container);color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-content{color:var(--pfx-settings-panel-on-surface);flex-wrap:wrap;gap:4px 12px;min-width:0;overflow:visible}praxis-settings-panel .settings-panel .mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:hover{background:color-mix(in srgb,var(--pfx-settings-panel-surface-container-high) 84%,var(--pfx-settings-panel-primary) 16%)}praxis-settings-panel .settings-panel .mat-expansion-panel.mat-expanded>.mat-expansion-panel-header{background:var(--pfx-settings-panel-surface-container-high)}praxis-settings-panel .settings-panel .mat-expansion-panel-header mat-icon,praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-icon{color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-expansion-panel-header-title,praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-expansion-panel-header-description{color:var(--pfx-settings-panel-on-surface);min-width:0;overflow:visible;white-space:normal}praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-expansion-panel-header-description{color:var(--pfx-settings-panel-on-surface-variant);flex-wrap:wrap;gap:8px}praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-expansion-panel-header-title>*,praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-expansion-panel-header-description>*{color:inherit}praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-expansion-panel-header-title small,praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-expansion-panel-header-description small{color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-expansion-indicator,praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-expansion-indicator:after{color:var(--pfx-settings-panel-on-surface-variant);border-color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel .mat-expansion-panel .mat-action-row{border-top-color:var(--pfx-settings-panel-outline-variant);background:var(--pfx-settings-panel-surface-container-low)}praxis-settings-panel .settings-panel .mat-accordion,praxis-settings-panel .settings-panel .mat-accordion .mat-expansion-panel-spacing{background:transparent}praxis-settings-panel .settings-panel .mat-expansion-panel-content,praxis-settings-panel .settings-panel .mat-expansion-panel-content-wrapper,praxis-settings-panel .settings-panel .mat-expansion-panel-body{background:var(--pfx-settings-panel-surface-container);color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel .mat-expansion-panel .mat-expansion-panel-body{padding:8px}praxis-settings-panel .settings-panel .mat-expansion-panel .mat-expansion-panel-body>*{color:inherit}praxis-settings-panel .settings-panel .mat-mdc-tab-group .mat-mdc-tab-header{border-bottom:1px solid var(--pfx-settings-panel-outline-variant);background:var(--pfx-settings-panel-surface-container-low)}praxis-settings-panel .settings-panel .mat-mdc-tab-group .mdc-tab{min-width:0}praxis-settings-panel .settings-panel .mat-mdc-tab-group .mdc-tab .mdc-tab__text-label{color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel .mat-mdc-tab-group .mdc-tab:hover .mdc-tab__text-label,praxis-settings-panel .settings-panel .mat-mdc-tab-group .mdc-tab:focus .mdc-tab__text-label{color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel .mat-mdc-tab-group .mdc-tab.mdc-tab--active .mdc-tab__text-label{color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel .mat-mdc-tab-group .mat-mdc-tab-header-pagination{color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel .mat-mdc-tab-group .mat-mdc-tab-header-pagination-chevron{border-color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel .mat-mdc-tab-group .mat-mdc-tab-header-pagination:not(.mat-mdc-tab-header-pagination-disabled):hover{background:color-mix(in srgb,var(--pfx-settings-panel-surface-container-high) 84%,var(--pfx-settings-panel-primary) 16%)}praxis-settings-panel .settings-panel .mat-mdc-tab-group .mdc-tab-indicator__content--underline{border-color:var(--pfx-settings-panel-primary)}praxis-settings-panel .settings-panel .mat-mdc-card{background:var(--pfx-settings-panel-surface-container-low);border:1px solid var(--pfx-settings-panel-outline-variant);color:var(--pfx-settings-panel-on-surface);box-shadow:var(--md-sys-elevation-level1, 0 2px 8px rgba(0, 0, 0, .08))}praxis-settings-panel .settings-panel .mat-mdc-card-subtitle{color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel .mat-mdc-card-title,praxis-settings-panel .settings-panel .mat-mdc-card-content{color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel .mat-mdc-form-field{width:100%;align-self:start;--mdc-filled-text-field-container-color: var( --pfx-settings-panel-surface-container );--mdc-filled-text-field-hover-container-color: var( --pfx-settings-panel-surface-container-high );--mdc-filled-text-field-focus-container-color: var( --pfx-settings-panel-surface-container-high );--mdc-filled-text-field-active-indicator-color: var( --pfx-settings-panel-outline-variant );--mdc-filled-text-field-hover-active-indicator-color: var( --pfx-settings-panel-secondary );--mdc-filled-text-field-focus-active-indicator-color: var( --pfx-settings-panel-primary );--mdc-filled-text-field-label-text-color: var( --pfx-settings-panel-on-surface-variant );--mdc-filled-text-field-focus-label-text-color: var( --pfx-settings-panel-primary );--mdc-filled-text-field-input-text-color: var( --pfx-settings-panel-on-surface );--mdc-filled-text-field-caret-color: var(--pfx-settings-panel-primary);--mdc-outlined-text-field-outline-color: var( --pfx-settings-panel-outline-variant );--mdc-outlined-text-field-hover-outline-color: var( --pfx-settings-panel-secondary );--mdc-outlined-text-field-focus-outline-color: var( --pfx-settings-panel-primary );--mdc-outlined-text-field-label-text-color: var( --pfx-settings-panel-on-surface-variant );--mdc-outlined-text-field-focus-label-text-color: var( --pfx-settings-panel-primary );--mdc-outlined-text-field-input-text-color: var( --pfx-settings-panel-on-surface );--mdc-outlined-text-field-caret-color: var(--pfx-settings-panel-primary);--mat-form-field-focus-select-arrow-color: var( --pfx-settings-panel-primary );--mat-form-field-enabled-select-arrow-color: var( --pfx-settings-panel-on-surface-variant )}praxis-settings-panel .settings-panel .mat-mdc-form-field .mat-mdc-text-field-wrapper.mdc-text-field--filled,praxis-settings-panel .settings-panel .mat-mdc-form-field .mdc-text-field--filled{background-color:var(--pfx-settings-panel-surface-container);border-radius:var(--md-sys-shape-corner-small, 8px) var(--md-sys-shape-corner-small, 8px) 0 0}praxis-settings-panel .settings-panel .mat-mdc-form-field .mdc-text-field--filled .mat-mdc-form-field-flex,praxis-settings-panel .settings-panel .mat-mdc-form-field .mdc-text-field--filled .mat-mdc-form-field-infix,praxis-settings-panel .settings-panel .mat-mdc-form-field .mdc-text-field--filled .mat-mdc-form-field-focus-overlay{background:var(--pfx-settings-panel-surface-container);color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel .mat-mdc-form-field .mat-mdc-text-field-wrapper.mdc-text-field--outlined,praxis-settings-panel .settings-panel .mat-mdc-form-field .mdc-text-field--outlined,praxis-settings-panel .settings-panel .mat-mdc-form-field .mdc-text-field--outlined .mat-mdc-form-field-flex,praxis-settings-panel .settings-panel .mat-mdc-form-field .mdc-text-field--outlined .mat-mdc-form-field-infix{background:transparent;background-color:transparent;color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel .mat-mdc-form-field-focus-overlay{opacity:0}praxis-settings-panel .settings-panel .mat-mdc-form-field .mdc-text-field--filled .mdc-floating-label,praxis-settings-panel .settings-panel .mat-mdc-form-field .mat-mdc-select-placeholder,praxis-settings-panel .settings-panel .mat-mdc-form-field .mat-mdc-select-arrow,praxis-settings-panel .settings-panel .mat-mdc-form-field .mat-mdc-floating-label{color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel .mat-mdc-form-field .mat-mdc-select-value,praxis-settings-panel .settings-panel .mat-mdc-form-field .mat-mdc-select-value-text,praxis-settings-panel .settings-panel .mat-mdc-form-field .mdc-text-field--filled .mdc-text-field__input,praxis-settings-panel .settings-panel .mat-mdc-form-field input,praxis-settings-panel .settings-panel .mat-mdc-form-field textarea,praxis-settings-panel .settings-panel .mat-mdc-form-field .mdc-text-field__input{color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel .mat-mdc-form-field .mdc-text-field--focused:not(.mdc-text-field--invalid) .mat-mdc-floating-label,praxis-settings-panel .settings-panel .mat-mdc-form-field .mdc-text-field--filled.mdc-text-field--focused .mdc-floating-label{color:var(--pfx-settings-panel-primary)}praxis-settings-panel .settings-panel .mat-mdc-form-field .mdc-text-field--invalid .mat-mdc-floating-label{color:var(--pfx-settings-panel-error)}praxis-settings-panel .settings-panel .mat-mdc-form-field-subscript-wrapper{position:relative;box-sizing:border-box}praxis-settings-panel .settings-panel .mat-mdc-form-field .mat-mdc-form-field-hint-wrapper,praxis-settings-panel .settings-panel .mat-mdc-form-field .mat-mdc-form-field-error-wrapper{position:relative;top:auto;left:auto;right:auto;padding-top:4px;line-height:1.35}praxis-settings-panel .settings-panel .mat-mdc-form-field-bottom-align:before{display:none}praxis-settings-panel .settings-panel .mat-mdc-form-field-subscript-wrapper,praxis-settings-panel .settings-panel .mat-mdc-form-field-hint-wrapper,praxis-settings-panel .settings-panel .mat-mdc-form-field-error-wrapper,praxis-settings-panel .settings-panel .mat-mdc-hint{color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel .mat-button-toggle-group{border-color:var(--pfx-settings-panel-outline-variant);background:var(--pfx-settings-panel-surface-container-low)}praxis-settings-panel .settings-panel .mat-button-toggle{background:var(--pfx-settings-panel-surface-container-low);color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel .mat-button-toggle+.mat-button-toggle{border-left-color:var(--pfx-settings-panel-outline-variant)}praxis-settings-panel .settings-panel .mat-button-toggle-group .mat-button-toggle-checked{background:var(--pfx-settings-panel-primary-container);color:var(--pfx-settings-panel-on-primary-container)}praxis-settings-panel .settings-panel .mat-button-toggle .mat-icon,praxis-settings-panel .settings-panel .mat-button-toggle-checked .mat-icon{color:inherit}praxis-settings-panel .settings-panel .mat-mdc-slide-toggle .mdc-label{color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel .pfx-editor-section{box-sizing:border-box;width:100%;min-width:0;padding:16px;border-radius:16px;border:1px solid var(--pfx-settings-panel-outline-variant);background:var(--pfx-settings-panel-surface-container-low)}praxis-settings-panel .settings-panel .pfx-editor-subgroup{display:grid;gap:12px;padding-top:14px;border-top:1px solid color-mix(in srgb,var(--pfx-settings-panel-outline-variant) 70%,transparent)}praxis-settings-panel .settings-panel .pfx-editor-subgroup:first-child{padding-top:0;border-top:0}praxis-settings-panel .settings-panel .pfx-editor-grid-12{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:12px;min-width:0}praxis-settings-panel .settings-panel .pfx-editor-toggle-cluster{display:flex;flex-wrap:wrap;align-items:center;gap:12px 20px}.settings-panel{grid-template-columns:minmax(0,1fr);min-width:0;max-width:100%}.settings-panel-body{overflow-x:hidden;min-width:0}.settings-panel-body>*{min-width:0;max-width:100%}.praxis-settings-panel-backdrop{background:var(--pfx-settings-panel-backdrop, var(--pfx-backdrop, rgba(8, 15, 26, .42)));backdrop-filter:blur(var(--pfx-settings-panel-backdrop-blur, var(--pfx-backdrop-blur, 6px))) saturate(110%);-webkit-backdrop-filter:blur(var(--pfx-settings-panel-backdrop-blur, var(--pfx-backdrop-blur, 6px))) saturate(110%)}:is(.cdk-overlay-pane.praxis-settings-panel-pane,.praxis-settings-panel-pane){position:fixed;top:0;right:0;display:flex;align-items:stretch;height:100vh;max-width:var(--pfx-settings-panel-pane-max-width, 100vw);max-height:100vh;z-index:var(--pfx-settings-panel-z-index, var(--praxis-z-settings-panel, var(--praxis-layer-settings-panel, 1220)));transition:width var(--pfx-side-panel-motion-duration-enter, .3s) var(--pfx-side-panel-motion-easing-enter, ease)}.praxis-settings-panel-pane .settings-panel{pointer-events:auto}@media(prefers-reduced-motion:reduce){.praxis-settings-panel-pane{transition:none}}:is(.cdk-overlay-pane.praxis-settings-panel-pane.praxis-settings-panel-pane--preview,.praxis-settings-panel-pane.praxis-settings-panel-pane--preview){top:auto;bottom:12px;right:12px;height:auto;width:min(560px,100vw - 24px);min-width:0;transition:none}.praxis-settings-panel-backdrop.praxis-settings-panel-backdrop--preview{background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none}.praxis-settings-preview-target{outline:2px solid var(--md-sys-color-primary);outline-offset:3px}praxis-settings-panel .settings-panel [hidden]{display:none}praxis-settings-panel .settings-panel .settings-panel-header[hidden],praxis-settings-panel .settings-panel .settings-panel-body[hidden],praxis-settings-panel .settings-panel .settings-panel-footer[hidden]{display:none}praxis-settings-panel .settings-panel--preview{height:auto;min-height:0;grid-template-rows:auto;border-radius:16px}praxis-settings-panel .settings-panel-preview-bar{display:flex;align-items:center;gap:16px;padding:16px;color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel-preview-bar p{margin:4px 0 0;color:var(--pfx-settings-panel-on-surface-variant);font-size:.875rem}praxis-settings-panel .settings-panel-preview-bar button{flex-shrink:0}@container settings-panel-shell (max-width: 599px){praxis-settings-panel .settings-panel-header:not([hidden]){display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:start}praxis-settings-panel .settings-panel-header .spacer{display:none}praxis-settings-panel .settings-panel-header .settings-panel-title{grid-column:1;grid-row:1;overflow-wrap:anywhere}praxis-settings-panel .settings-panel-header [data-testid=settings-panel-toggle-expand]{grid-column:2;grid-row:1}praxis-settings-panel .settings-panel-header [data-testid=settings-panel-close-icon]{grid-column:3;grid-row:1}praxis-settings-panel .settings-panel-header [data-testid=settings-panel-preview]{grid-column:1/-1;grid-row:2;justify-self:start;max-width:100%}praxis-settings-panel .settings-panel-preview-bar{flex-direction:column;align-items:stretch;gap:8px}}@media(prefers-reduced-transparency:reduce){.praxis-settings-panel-backdrop{backdrop-filter:none;-webkit-backdrop-filter:none;background:var(--pfx-backdrop-opaque, rgba(8, 15, 26, .72))}}@media(forced-colors:active){praxis-settings-panel .settings-panel{border:1px solid CanvasText;background:Canvas;color:CanvasText}praxis-settings-panel .settings-panel-save-error,praxis-settings-panel .settings-panel-scope{border:1px solid CanvasText;background:Canvas;color:CanvasText}.praxis-settings-panel-backdrop{backdrop-filter:none;-webkit-backdrop-filter:none;background:Canvas;opacity:.75}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: PraxisIconButtonComponent, selector: "button[praxisIconButton]", inputs: ["praxisIconButton", "size", "appearance", "presentation", "pressed", "busy"] }, { kind: "directive", type: PraxisIconDirective, selector: "mat-icon[praxisIcon]", inputs: ["praxisIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i7.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: MatDialogModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1152
1905
  }
1153
1906
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SettingsPanelComponent, decorators: [{
1154
1907
  type: Component,
@@ -1163,13 +1916,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
1163
1916
  CdkTrapFocus,
1164
1917
  MatProgressSpinnerModule,
1165
1918
  MatDialogModule,
1166
- ], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [providePraxisSettingsPanelI18n()], template: "<div\n class=\"settings-panel\"\n data-testid=\"settings-panel-root\"\n [class.expanded]=\"expanded\"\n [class.settings-panel--preview]=\"previewing\"\n [class.is-resizable]=\"showResizeHandle\"\n [ngStyle]=\"panelInlineStyles\"\n role=\"dialog\"\n [attr.aria-modal]=\"interactionActive ? 'true' : null\"\n [attr.aria-hidden]=\"interactionActive ? null : 'true'\"\n [attr.inert]=\"interactionActive ? null : ''\"\n [attr.aria-labelledby]=\"previewing ? titleId + '-preview' : titleId\"\n [cdkTrapFocus]=\"interactionActive\"\n [cdkTrapFocusAutoCapture]=\"true\"\n >\n @if (showResizeHandle && !previewing) {\n <div\n class=\"settings-panel__resize-handle\"\n role=\"separator\"\n tabindex=\"0\"\n aria-orientation=\"vertical\"\n [attr.aria-label]=\"resizeHandleLabel\"\n (pointerdown)=\"onResizeHandlePointerDown($event)\"\n (keydown)=\"onResizeHandleKeydown($event)\"\n ></div>\n }\n @if (previewing) {\n <section class=\"settings-panel-preview-bar\" data-testid=\"settings-panel-preview-bar\">\n <div><strong [id]=\"titleId + '-preview'\">{{ tx('Page preview') }}</strong><p>{{ tx('Inspect the result. Return to keep editing; nothing is saved here.') }}</p></div>\n <button mat-flat-button type=\"button\" data-testid=\"settings-panel-return\" (click)=\"returnFromPreview()\">{{ tx('Back to settings') }}</button>\n </section>\n }\n <header class=\"settings-panel-header\" [hidden]=\"previewing\">\n <h2 class=\"settings-panel-title\" [id]=\"titleId\">\n @if (titleIcon) {\n <mat-icon class=\"title-icon\" [praxisIcon]=\"titleIcon\"></mat-icon>\n }\n <span>{{ title }}</span>\n </h2>\n <span class=\"spacer\"></span>\n @if (previewTarget) {\n <button mat-stroked-button type=\"button\" data-testid=\"settings-panel-preview\" [disabled]=\"!canInspectPreview\" (click)=\"showPreview()\">\n <mat-icon aria-hidden=\"true\" [praxisIcon]=\"'visibility'\"></mat-icon>{{ tx('View result') }}\n </button>\n }\n <button\n [praxisIconButton]=\"expanded ? 'close_fullscreen' : 'open_in_full'\"\n size=\"compact\"\n type=\"button\"\n data-testid=\"settings-panel-toggle-expand\"\n [attr.aria-label]=\"expanded ? tx('Collapse panel') : tx('Expand panel')\"\n [attr.aria-expanded]=\"expanded\"\n [matTooltip]=\"expanded ? tx('Collapse panel') : tx('Expand panel')\"\n (click)=\"toggleExpand()\"\n ></button>\n <button\n praxisIconButton=\"close\"\n size=\"compact\"\n type=\"button\"\n data-testid=\"settings-panel-close-icon\"\n [attr.aria-label]=\"tx('Close')\"\n [matTooltip]=\"tx('Close')\"\n (click)=\"onCancel()\"\n ></button>\n </header>\n @if (showStatusMessage && !previewing) {\n <div\n class=\"settings-panel-status\"\n [attr.data-status]=\"statusTone\"\n role=\"status\"\n aria-live=\"polite\"\n >\n <mat-icon\n aria-hidden=\"true\"\n [praxisIcon]=\"\n statusTone === 'dirty' || statusTone === 'invalid'\n ? 'warning'\n : statusTone === 'saved'\n ? 'check_circle'\n : statusTone === 'busy'\n ? 'autorenew'\n : 'info'\n \"\n ></mat-icon>\n <span>{{ statusMessage }}</span>\n </div>\n }\n <div class=\"settings-panel-body\" [hidden]=\"previewing\">\n <ng-template #contentHost></ng-template>\n </div>\n <footer class=\"settings-panel-footer\" [hidden]=\"previewing\">\n <button\n mat-button\n type=\"button\"\n data-testid=\"settings-panel-reset\"\n (mousedown)=\"$event.stopPropagation()\"\n (click)=\"$event.stopPropagation(); onReset()\"\n [disabled]=\"isBusy\"\n >\n <mat-icon aria-hidden=\"true\" [praxisIcon]=\"'restart_alt'\"></mat-icon>\n <span>{{ tx('Reset') }}</span>\n </button>\n <span class=\"spacer\"></span>\n <button\n mat-button\n type=\"button\"\n data-testid=\"settings-panel-cancel\"\n (mousedown)=\"$event.stopPropagation()\"\n (click)=\"$event.stopPropagation(); onCancel()\"\n [disabled]=\"isBusy\"\n >\n <mat-icon aria-hidden=\"true\" [praxisIcon]=\"'close'\"></mat-icon>\n <span>{{ tx('Cancel') }}</span>\n </button>\n <button\n mat-stroked-button\n type=\"button\"\n data-testid=\"settings-panel-apply\"\n (mousedown)=\"$event.stopPropagation()\"\n (click)=\"$event.stopPropagation(); onApply()\"\n [disabled]=\"!canApply\"\n [matTooltip]=\"applySaveDisabledReason\"\n [matTooltipDisabled]=\"canApply || !diagnostics.showDisabledReason\"\n [attr.aria-busy]=\"isBusy\"\n [attr.aria-label]=\"applyActionLabel || 'Apply'\"\n >\n @if (showBusyIndicator) {\n <mat-progress-spinner\n mode=\"indeterminate\"\n diameter=\"20\"\n ></mat-progress-spinner>\n }\n @if (!showBusyIndicator) {\n <mat-icon aria-hidden=\"true\" [praxisIcon]=\"'done'\"></mat-icon>\n <span class=\"settings-panel-action-label settings-panel-action-label--apply\">{{ applyActionLabel }}</span>\n }\n </button>\n <button\n mat-flat-button\n color=\"primary\"\n type=\"button\"\n data-testid=\"settings-panel-save\"\n (mousedown)=\"$event.stopPropagation()\"\n (click)=\"$event.stopPropagation(); onSave()\"\n [disabled]=\"!canSave\"\n [matTooltip]=\"applySaveDisabledReason\"\n [matTooltipDisabled]=\"canSave || !diagnostics.showDisabledReason\"\n [attr.aria-busy]=\"isBusy\"\n [attr.aria-label]=\"saveActionLabel || 'Save & Close'\"\n >\n @if (showBusyIndicator) {\n <mat-progress-spinner\n mode=\"indeterminate\"\n diameter=\"20\"\n ></mat-progress-spinner>\n }\n @if (!showBusyIndicator) {\n <mat-icon aria-hidden=\"true\" [praxisIcon]=\"'save'\"></mat-icon>\n <span class=\"settings-panel-action-label settings-panel-action-label--save\">{{ saveActionLabel }}</span>\n }\n </button>\n </footer>\n</div>\n", styles: ["@charset \"UTF-8\";praxis-settings-panel{display:block;height:100%;width:100%;min-width:0;flex:1 1 auto;box-sizing:border-box}praxis-settings-panel .settings-panel{position:relative;container:settings-panel-shell/inline-size;--pfx-settings-panel-surface-container: var( --md-sys-color-surface-container, #ffffff );--pfx-settings-panel-surface-container-high: var( --md-sys-color-surface-container-high, #f7f7f7 );--pfx-settings-panel-surface-container-low: var( --md-sys-color-surface-container-low, #f2f4f7 );--pfx-settings-panel-surface: var(--md-sys-color-surface, #ffffff);--pfx-settings-panel-on-surface: var(--md-sys-color-on-surface, #111827);--pfx-settings-panel-on-surface-variant: var( --md-sys-color-on-surface-variant, rgba(17, 24, 39, .72) );--pfx-settings-panel-outline: var( --md-sys-color-outline, rgba(15, 23, 42, .24) );--pfx-settings-panel-outline-variant: var( --md-sys-color-outline-variant, rgba(15, 23, 42, .12) );--pfx-settings-panel-primary: var(--md-sys-color-primary, #2563eb);--pfx-settings-panel-primary-container: var( --md-sys-color-primary-container, rgba(37, 99, 235, .14) );--pfx-settings-panel-on-primary-container: var( --md-sys-color-on-primary-container, #0f172a );--pfx-settings-panel-secondary: var( --md-sys-color-secondary, var(--pfx-settings-panel-primary) );--pfx-settings-panel-error: var(--md-sys-color-error, #b3261e);--pfx-settings-panel-error-container: var( --md-sys-color-error-container, rgba(179, 38, 30, .14) );display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto 1fr auto;grid-template-areas:\"header\" \"status\" \"body\" \"footer\";height:100%;background:var(--pfx-settings-panel-surface-container);color:var(--pfx-settings-panel-on-surface);border-left:1px solid var(--pfx-settings-panel-outline-variant);width:100%;max-width:100%;min-width:0;box-sizing:border-box;box-shadow:var(--pfx-settings-panel-elevation, var(--md-sys-elevation-level2, 0 8px 24px rgba(0, 0, 0, .16)));overflow:hidden}praxis-settings-panel .settings-panel__resize-handle{position:absolute;inset:0 auto 0 0;width:12px;cursor:col-resize;touch-action:none;z-index:3;outline:none}praxis-settings-panel .settings-panel__resize-handle:before{content:\"\";position:absolute;inset:0 auto 0 4px;width:2px;background:transparent;transition:background-color var(--pfx-side-panel-motion-duration, .16s) ease,opacity var(--pfx-side-panel-motion-duration, .16s) ease;opacity:0}praxis-settings-panel .settings-panel.is-resizable:hover .settings-panel__resize-handle:before,praxis-settings-panel .settings-panel__resize-handle:focus-visible:before{opacity:1;background:var(--pfx-settings-panel-outline)}praxis-settings-panel .settings-panel-header{grid-area:header;display:flex;align-items:center;gap:var(--pfx-settings-panel-header-gap, 8px);padding:12px var(--pfx-settings-panel-header-padding-x, 20px);min-height:var(--pfx-settings-panel-header-height, 64px);border-bottom:1px solid var(--pfx-settings-panel-outline-variant);background:var(--pfx-settings-panel-surface-container-high);box-shadow:var(--pfx-settings-panel-header-shadow, var(--md-sys-elevation-level1, 0 2px 6px rgba(0, 0, 0, .08)));flex-shrink:0;min-width:0;max-width:100%}praxis-settings-panel .settings-panel-header .spacer{flex:1 1 auto;min-width:0}praxis-settings-panel .settings-panel-status{grid-area:status;display:flex;align-items:center;gap:8px;min-height:36px;padding:6px var(--pfx-settings-panel-status-padding-x, 20px);border-bottom:1px solid var(--pfx-settings-panel-outline-variant);background:var(--pfx-settings-panel-surface-container-high);color:var(--pfx-settings-panel-on-surface);font-size:.85rem;font-weight:500;min-width:0;max-width:100%}praxis-settings-panel .settings-panel-status mat-icon{width:18px;height:18px;font-size:18px}praxis-settings-panel .settings-panel-status[data-status=dirty],praxis-settings-panel .settings-panel-status[data-status=invalid]{color:var(--pfx-settings-panel-error);background:color-mix(in srgb,var(--pfx-settings-panel-error-container) 30%,var(--pfx-settings-panel-surface-container-high))}praxis-settings-panel .settings-panel-status[data-status=saved]{color:var(--pfx-settings-panel-primary);background:color-mix(in srgb,var(--pfx-settings-panel-primary-container) 28%,var(--pfx-settings-panel-surface-container-high))}praxis-settings-panel .settings-panel-body{grid-area:body;overflow-y:auto;overflow-x:hidden;scroll-padding-top:var(--pfx-settings-panel-scroll-padding-start, 16px);scroll-padding-bottom:var(--pfx-settings-panel-scroll-padding-end, 88px);min-height:0;padding:var(--pfx-settings-panel-body-padding, 8px 16px 24px);background:var(--pfx-settings-panel-surface);display:flex;flex-direction:column;min-width:0;max-width:100%}praxis-settings-panel .settings-panel-body>*{min-width:0;max-width:100%}praxis-settings-panel .settings-panel-content{display:block;min-width:0;max-width:100%}praxis-settings-panel .settings-panel-content>*{min-width:0;max-width:100%;box-sizing:border-box}praxis-settings-panel .settings-panel-footer{grid-area:footer;border-top:1px solid var(--pfx-settings-panel-outline-variant);background:var(--pfx-settings-panel-surface-container-high);box-shadow:var(--pfx-settings-panel-footer-shadow, var(--md-sys-elevation-level1, 0 -2px 6px rgba(0, 0, 0, .08)));display:flex;align-items:center;flex-wrap:wrap;padding:var(--pfx-settings-panel-footer-padding, 12px 20px);column-gap:var(--pfx-settings-panel-footer-gap, 12px);row-gap:8px;flex-shrink:0;min-width:0;max-width:100%}praxis-settings-panel .spacer{flex:1}praxis-settings-panel .settings-panel-title{display:inline-flex;align-items:center;flex:1 1 auto;gap:var(--pfx-settings-panel-title-gap, 8px);font-weight:700;line-height:1.2;letter-spacing:.2px;margin:0;min-width:0;overflow:visible;white-space:normal}praxis-settings-panel .settings-panel-title span{min-width:0;overflow:visible;white-space:normal}praxis-settings-panel .settings-panel-title mat-icon{color:var(--pfx-settings-panel-primary)}praxis-settings-panel .settings-panel-title .title-icon{width:20px;height:20px;font-size:20px}praxis-settings-panel .settings-panel-footer button{display:inline-flex;align-items:center}praxis-settings-panel .settings-panel-footer button .mat-icon{flex:0 0 20px;font-size:20px;width:20px;height:20px;line-height:1;display:inline-flex;align-items:center;justify-content:center;overflow:hidden}praxis-settings-panel .settings-panel-footer .mat-button-wrapper{display:inline-flex;align-items:center;gap:var(--pfx-settings-panel-button-gap, 8px)}praxis-settings-panel .settings-panel-footer .mat-progress-spinner{margin-right:8px}praxis-settings-panel .settings-panel-footer .mat-flat-button[color=primary]{font-weight:600}praxis-settings-panel .settings-panel-footer .mdc-button__label{display:inline-flex;align-items:center;gap:var(--pfx-settings-panel-button-gap, 8px);line-height:1}praxis-settings-panel .settings-panel-footer .mdc-button__label>span{display:inline-flex;align-items:center;line-height:1}praxis-settings-panel .settings-panel-footer .mdc-button__label .mat-icon{display:inline-flex;align-items:center;justify-content:center;line-height:1}@container settings-panel-shell (max-width: 520px){praxis-settings-panel .settings-panel-footer{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:stretch;padding:10px 12px;column-gap:8px}praxis-settings-panel .settings-panel-footer .spacer{display:none}praxis-settings-panel .settings-panel-footer button{justify-content:center;width:100%;min-width:0;min-height:44px;height:auto;padding:8px}praxis-settings-panel .settings-panel-action-label{white-space:normal;overflow-wrap:anywhere;text-align:center}praxis-settings-panel .settings-panel-footer .mdc-button__label{min-width:0;max-width:100%}praxis-settings-panel .settings-panel-footer .mdc-button__label>span{min-width:0;line-height:1.25}}@container settings-panel-shell (max-width: 280px){praxis-settings-panel .settings-panel-footer{grid-template-columns:minmax(0,1fr)}}praxis-settings-panel .settings-panel .mat-divider{background-color:var(--pfx-settings-panel-outline-variant)!important}praxis-settings-panel .settings-panel .mat-expansion-panel{background:var(--pfx-settings-panel-surface-container)!important;border:1px solid var(--pfx-settings-panel-outline-variant);border-radius:var(--md-sys-shape-corner-medium, 12px);box-shadow:var(--md-sys-elevation-level1, 0 2px 8px rgba(0, 0, 0, .08));color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel .mat-expansion-panel-header{background:var(--pfx-settings-panel-surface-container)!important;color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-content{color:var(--pfx-settings-panel-on-surface);flex-wrap:wrap;gap:4px 12px;min-width:0;overflow:visible}praxis-settings-panel .settings-panel .mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:hover{background:color-mix(in srgb,var(--pfx-settings-panel-surface-container-high) 84%,var(--pfx-settings-panel-primary) 16%)}praxis-settings-panel .settings-panel .mat-expansion-panel.mat-expanded>.mat-expansion-panel-header{background:var(--pfx-settings-panel-surface-container-high)!important}praxis-settings-panel .settings-panel .mat-expansion-panel-header mat-icon,praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-icon{color:var(--pfx-settings-panel-on-surface)!important}praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-expansion-panel-header-title,praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-expansion-panel-header-description{color:var(--pfx-settings-panel-on-surface);min-width:0;overflow:visible;white-space:normal}praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-expansion-panel-header-description{color:var(--pfx-settings-panel-on-surface-variant);flex-wrap:wrap;gap:8px}praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-expansion-panel-header-title>*,praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-expansion-panel-header-description>*{color:inherit}praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-expansion-panel-header-title small,praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-expansion-panel-header-description small{color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-expansion-indicator,praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-expansion-indicator:after{color:var(--pfx-settings-panel-on-surface-variant);border-color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel .mat-expansion-panel .mat-action-row{border-top-color:var(--pfx-settings-panel-outline-variant);background:var(--pfx-settings-panel-surface-container-low)}praxis-settings-panel .settings-panel .mat-accordion,praxis-settings-panel .settings-panel .mat-accordion .mat-expansion-panel-spacing{background:transparent!important}praxis-settings-panel .settings-panel .mat-expansion-panel-content,praxis-settings-panel .settings-panel .mat-expansion-panel-content-wrapper,praxis-settings-panel .settings-panel .mat-expansion-panel-body{background:var(--pfx-settings-panel-surface-container)!important;color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel .mat-expansion-panel .mat-expansion-panel-body{padding:8px}praxis-settings-panel .settings-panel .mat-expansion-panel .mat-expansion-panel-body>*{color:inherit}praxis-settings-panel .settings-panel .mat-mdc-tab-group .mat-mdc-tab-header{border-bottom:1px solid var(--pfx-settings-panel-outline-variant);background:var(--pfx-settings-panel-surface-container-low)}praxis-settings-panel .settings-panel .mat-mdc-tab-group .mdc-tab{min-width:0}praxis-settings-panel .settings-panel .mat-mdc-tab-group .mdc-tab .mdc-tab__text-label{color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel .mat-mdc-tab-group .mdc-tab:hover .mdc-tab__text-label,praxis-settings-panel .settings-panel .mat-mdc-tab-group .mdc-tab:focus .mdc-tab__text-label{color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel .mat-mdc-tab-group .mdc-tab.mdc-tab--active .mdc-tab__text-label{color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel .mat-mdc-tab-group .mat-mdc-tab-header-pagination{color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel .mat-mdc-tab-group .mat-mdc-tab-header-pagination-chevron{border-color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel .mat-mdc-tab-group .mat-mdc-tab-header-pagination:not(.mat-mdc-tab-header-pagination-disabled):hover{background:color-mix(in srgb,var(--pfx-settings-panel-surface-container-high) 84%,var(--pfx-settings-panel-primary) 16%)}praxis-settings-panel .settings-panel .mat-mdc-tab-group .mdc-tab-indicator__content--underline{border-color:var(--pfx-settings-panel-primary)}praxis-settings-panel .settings-panel .mat-mdc-card{background:var(--pfx-settings-panel-surface-container-low);border:1px solid var(--pfx-settings-panel-outline-variant);color:var(--pfx-settings-panel-on-surface);box-shadow:var(--md-sys-elevation-level1, 0 2px 8px rgba(0, 0, 0, .08))}praxis-settings-panel .settings-panel .mat-mdc-card-subtitle,praxis-settings-panel .settings-panel .mat-mdc-card-content{color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel .mat-mdc-card-title{color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel .mat-mdc-form-field{width:100%;--mdc-filled-text-field-container-color: var( --pfx-settings-panel-surface-container );--mdc-filled-text-field-hover-container-color: var( --pfx-settings-panel-surface-container-high );--mdc-filled-text-field-focus-container-color: var( --pfx-settings-panel-surface-container-high );--mdc-filled-text-field-active-indicator-color: var( --pfx-settings-panel-outline-variant );--mdc-filled-text-field-hover-active-indicator-color: var( --pfx-settings-panel-secondary );--mdc-filled-text-field-focus-active-indicator-color: var( --pfx-settings-panel-primary );--mdc-filled-text-field-label-text-color: var( --pfx-settings-panel-on-surface-variant );--mdc-filled-text-field-focus-label-text-color: var( --pfx-settings-panel-primary );--mdc-filled-text-field-input-text-color: var( --pfx-settings-panel-on-surface );--mdc-filled-text-field-caret-color: var(--pfx-settings-panel-primary);--mdc-outlined-text-field-outline-color: var( --pfx-settings-panel-outline-variant );--mdc-outlined-text-field-hover-outline-color: var( --pfx-settings-panel-secondary );--mdc-outlined-text-field-focus-outline-color: var( --pfx-settings-panel-primary );--mdc-outlined-text-field-label-text-color: var( --pfx-settings-panel-on-surface-variant );--mdc-outlined-text-field-focus-label-text-color: var( --pfx-settings-panel-primary );--mdc-outlined-text-field-input-text-color: var( --pfx-settings-panel-on-surface );--mdc-outlined-text-field-caret-color: var(--pfx-settings-panel-primary);--mat-form-field-focus-select-arrow-color: var( --pfx-settings-panel-primary );--mat-form-field-enabled-select-arrow-color: var( --pfx-settings-panel-on-surface-variant )}praxis-settings-panel .settings-panel .mdc-text-field--filled{background-color:var(--pfx-settings-panel-surface-container)!important;border-radius:var(--md-sys-shape-corner-small, 8px) var(--md-sys-shape-corner-small, 8px) 0 0}praxis-settings-panel .settings-panel .mat-mdc-text-field-wrapper,praxis-settings-panel .settings-panel .mat-mdc-form-field-flex,praxis-settings-panel .settings-panel .mat-mdc-form-field-infix,praxis-settings-panel .settings-panel .mat-mdc-form-field-focus-overlay{background:var(--pfx-settings-panel-surface-container)!important;color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel .mat-mdc-form-field-focus-overlay{opacity:0}praxis-settings-panel .settings-panel .mdc-text-field--filled .mdc-text-field__input,praxis-settings-panel .settings-panel .mdc-text-field--filled .mdc-floating-label,praxis-settings-panel .settings-panel .mat-mdc-select-value,praxis-settings-panel .settings-panel .mat-mdc-select-arrow,praxis-settings-panel .settings-panel .mat-mdc-form-field .mat-mdc-floating-label{color:var(--pfx-settings-panel-on-surface-variant)!important}praxis-settings-panel .settings-panel .mdc-text-field--filled.mdc-text-field--focused .mdc-floating-label,praxis-settings-panel .settings-panel .mdc-text-field--filled .mdc-text-field__input{color:var(--pfx-settings-panel-on-surface)!important}praxis-settings-panel .settings-panel .mat-mdc-form-field input,praxis-settings-panel .settings-panel .mat-mdc-form-field textarea,praxis-settings-panel .settings-panel .mat-mdc-form-field .mdc-text-field__input{color:var(--pfx-settings-panel-on-surface)!important}praxis-settings-panel .settings-panel .mat-mdc-form-field-subscript-wrapper,praxis-settings-panel .settings-panel .mat-mdc-form-field-hint-wrapper,praxis-settings-panel .settings-panel .mat-mdc-form-field-error-wrapper,praxis-settings-panel .settings-panel .mat-mdc-hint{color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel .mat-button-toggle-group{border-color:var(--pfx-settings-panel-outline-variant);background:var(--pfx-settings-panel-surface-container-low)}praxis-settings-panel .settings-panel .mat-button-toggle{background:var(--pfx-settings-panel-surface-container-low);color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel .mat-button-toggle+.mat-button-toggle{border-left-color:var(--pfx-settings-panel-outline-variant)}praxis-settings-panel .settings-panel .mat-button-toggle-checked{background:var(--pfx-settings-panel-primary-container)!important;color:var(--pfx-settings-panel-on-primary-container)!important}praxis-settings-panel .settings-panel .mat-button-toggle .mat-icon,praxis-settings-panel .settings-panel .mat-button-toggle-checked .mat-icon{color:inherit}praxis-settings-panel .settings-panel .mat-mdc-slide-toggle .mdc-label{color:var(--pfx-settings-panel-on-surface)}.settings-panel{grid-template-columns:minmax(0,1fr);min-width:0;max-width:100%}.settings-panel-body{overflow-x:hidden;min-width:0}.settings-panel-body>*{min-width:0;max-width:100%}.praxis-settings-panel-backdrop{background:var(--pfx-backdrop, rgba(8, 15, 26, .42));backdrop-filter:blur(var(--pfx-backdrop-blur, 6px)) saturate(110%);-webkit-backdrop-filter:blur(var(--pfx-backdrop-blur, 6px)) saturate(110%)}.praxis-settings-panel-pane{position:fixed!important;top:0!important;right:0!important;display:flex!important;align-items:stretch!important;height:100vh!important;max-width:100vw!important;max-height:100vh!important;z-index:var(--praxis-layer-settings-panel, 1220)!important;transition:width var(--pfx-side-panel-motion-duration-enter, .3s) var(--pfx-side-panel-motion-easing-enter, ease)}.praxis-settings-panel-pane .settings-panel{pointer-events:auto}@media(prefers-reduced-motion:reduce){.praxis-settings-panel-pane{transition:none}}.praxis-settings-panel-pane.praxis-settings-panel-pane--preview{top:auto!important;bottom:12px!important;right:12px!important;height:auto!important;width:min(560px,100vw - 24px)!important;min-width:0!important;transition:none}.praxis-settings-panel-backdrop.praxis-settings-panel-backdrop--preview{background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none}.praxis-settings-preview-target{outline:2px solid var(--md-sys-color-primary);outline-offset:3px}praxis-settings-panel .settings-panel [hidden]{display:none!important}praxis-settings-panel .settings-panel--preview{height:auto;min-height:0;grid-template-rows:auto;border-radius:16px}praxis-settings-panel .settings-panel-preview-bar{display:flex;align-items:center;gap:16px;padding:16px;color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel-preview-bar p{margin:4px 0 0;color:var(--pfx-settings-panel-on-surface-variant);font-size:.875rem}praxis-settings-panel .settings-panel-preview-bar button{flex-shrink:0}@container settings-panel-shell (max-width: 599px){praxis-settings-panel .settings-panel-header:not([hidden]){display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:start}praxis-settings-panel .settings-panel-header .spacer{display:none}praxis-settings-panel .settings-panel-header .settings-panel-title{grid-column:1;grid-row:1;overflow-wrap:anywhere}praxis-settings-panel .settings-panel-header [data-testid=settings-panel-toggle-expand]{grid-column:2;grid-row:1}praxis-settings-panel .settings-panel-header [data-testid=settings-panel-close-icon]{grid-column:3;grid-row:1}praxis-settings-panel .settings-panel-header [data-testid=settings-panel-preview]{grid-column:1/-1;grid-row:2;justify-self:start;max-width:100%}praxis-settings-panel .settings-panel-preview-bar{flex-direction:column;align-items:stretch;gap:8px}}\n"] }]
1919
+ ], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [providePraxisSettingsPanelI18n()], template: "<div\n class=\"settings-panel\"\n data-testid=\"settings-panel-root\"\n [class.expanded]=\"expanded\"\n [class.settings-panel--preview]=\"previewing\"\n [class.is-resizable]=\"showResizeHandle\"\n [ngStyle]=\"panelInlineStyles\"\n role=\"dialog\"\n [attr.aria-modal]=\"interactionActive ? 'true' : null\"\n [attr.aria-hidden]=\"interactionActive ? null : 'true'\"\n [attr.inert]=\"interactionActive ? null : ''\"\n [attr.aria-labelledby]=\"previewing ? titleId + '-preview' : titleId\"\n [cdkTrapFocus]=\"interactionActive\"\n [cdkTrapFocusAutoCapture]=\"true\"\n >\n @if (showResizeHandle && !previewing) {\n <div\n class=\"settings-panel__resize-handle\"\n role=\"separator\"\n tabindex=\"0\"\n aria-orientation=\"vertical\"\n [attr.aria-label]=\"resizeHandleLabel\"\n (pointerdown)=\"onResizeHandlePointerDown($event)\"\n (keydown)=\"onResizeHandleKeydown($event)\"\n ></div>\n }\n @if (previewing) {\n <section class=\"settings-panel-preview-bar\" data-testid=\"settings-panel-preview-bar\">\n <div><strong [id]=\"titleId + '-preview'\">{{ tx('Page preview') }}</strong><p>{{ tx('Inspect the result. Return to keep editing; nothing is saved here.') }}</p></div>\n <button mat-flat-button type=\"button\" data-testid=\"settings-panel-return\" (click)=\"returnFromPreview()\">{{ tx('Back to settings') }}</button>\n </section>\n }\n <header class=\"settings-panel-header\" [hidden]=\"previewing\">\n <h2 class=\"settings-panel-title\" [id]=\"titleId\">\n @if (titleIcon) {\n <mat-icon class=\"title-icon\" [praxisIcon]=\"titleIcon\"></mat-icon>\n }\n <span>{{ title }}</span>\n </h2>\n <span class=\"spacer\"></span>\n @if (previewTarget) {\n <button mat-stroked-button type=\"button\" data-testid=\"settings-panel-preview\" [disabled]=\"!canInspectPreview\" (click)=\"showPreview()\">\n <mat-icon aria-hidden=\"true\" [praxisIcon]=\"'visibility'\"></mat-icon>{{ tx('View result') }}\n </button>\n }\n <button\n [praxisIconButton]=\"expanded ? 'close_fullscreen' : 'open_in_full'\"\n size=\"compact\"\n type=\"button\"\n data-testid=\"settings-panel-toggle-expand\"\n [attr.aria-label]=\"expanded ? tx('Collapse panel') : tx('Expand panel')\"\n [attr.aria-expanded]=\"expanded\"\n [matTooltip]=\"expanded ? tx('Collapse panel') : tx('Expand panel')\"\n (click)=\"toggleExpand()\"\n ></button>\n <button\n praxisIconButton=\"close\"\n size=\"compact\"\n type=\"button\"\n data-testid=\"settings-panel-close-icon\"\n [disabled]=\"isBusy\"\n [attr.aria-label]=\"tx('Close')\"\n [matTooltip]=\"tx('Close')\"\n (click)=\"onCancel()\"\n ></button>\n </header>\n @if (hasContextNavigation && !previewing) {\n <nav\n class=\"settings-panel-context-nav\"\n data-testid=\"settings-panel-context-nav\"\n [attr.aria-label]=\"tx('Context navigation')\"\n >\n @if (contextNavigation?.targets?.length) {\n <div class=\"settings-panel-context-nav__targets\">\n <button\n praxisIconButton=\"chevron_left\"\n size=\"compact\"\n type=\"button\"\n data-testid=\"settings-panel-prev-target\"\n [disabled]=\"!canSelectPreviousTarget\"\n [attr.aria-label]=\"tx('Previous item')\"\n [matTooltip]=\"tx('Previous item')\"\n (click)=\"selectPreviousTarget()\"\n ></button>\n <select\n #targetSelect\n class=\"settings-panel-context-nav__target-select\"\n data-testid=\"settings-panel-target-select\"\n [disabled]=\"isBusy || !interactionActive\"\n [attr.aria-label]=\"tx('Editing target')\"\n [value]=\"contextNavigation?.activeTargetId || ''\"\n (change)=\"selectContextTarget(targetSelect.value, targetSelect)\"\n >\n @for (target of contextNavigation?.targets || []; track target.id) {\n <option [value]=\"target.id\" [selected]=\"target.id === contextNavigation?.activeTargetId\">\n {{ target.label }}\n </option>\n }\n </select>\n <button\n praxisIconButton=\"chevron_right\"\n size=\"compact\"\n type=\"button\"\n data-testid=\"settings-panel-next-target\"\n [disabled]=\"!canSelectNextTarget\"\n [attr.aria-label]=\"tx('Next item')\"\n [matTooltip]=\"tx('Next item')\"\n (click)=\"selectNextTarget()\"\n ></button>\n </div>\n }\n @if (contextNavigation?.modes?.length) {\n <div\n class=\"settings-panel-context-nav__modes\"\n role=\"group\"\n [attr.aria-label]=\"tx('Editing modes')\"\n >\n @for (mode of contextNavigation?.modes || []; track mode.id) {\n <button\n type=\"button\"\n class=\"settings-panel-context-nav__mode-btn\"\n [class.is-active]=\"mode.id === contextNavigation?.activeModeId\"\n [disabled]=\"mode.disabled || isBusy || !interactionActive\"\n [attr.aria-pressed]=\"mode.id === contextNavigation?.activeModeId\"\n [attr.title]=\"mode.label\"\n [attr.data-testid]=\"'settings-panel-mode-' + mode.id\"\n (click)=\"selectContextMode(mode.id)\"\n >\n {{ mode.label }}\n </button>\n }\n </div>\n }\n </nav>\n }\n @if (showStatusMessage && !previewing) {\n <div\n class=\"settings-panel-status\"\n [attr.data-status]=\"statusTone\"\n role=\"status\"\n aria-live=\"polite\"\n >\n <mat-icon\n aria-hidden=\"true\"\n [praxisIcon]=\"\n statusTone === 'dirty' || statusTone === 'invalid'\n ? 'warning'\n : statusTone === 'saved'\n ? 'check_circle'\n : statusTone === 'busy'\n ? 'autorenew'\n : 'info'\n \"\n ></mat-icon>\n <span>{{ statusMessage }}</span>\n @if (showWriteScopeControls) {\n <span class=\"spacer\"></span>\n <span\n class=\"settings-panel-scope\"\n [attr.data-scope]=\"activeWriteScope\"\n data-testid=\"settings-panel-write-scope\"\n >\n <span class=\"settings-panel-scope__label\">{{ writeScopeLabel }}</span>\n @if (canToggleWriteScope) {\n <button\n mat-stroked-button\n type=\"button\"\n class=\"settings-panel-scope__toggle\"\n data-testid=\"settings-panel-scope-toggle\"\n [matTooltip]=\"writeScopeToggleLabel\"\n (click)=\"toggleWriteScope()\"\n >\n {{ writeScopeToggleLabel }}\n </button>\n }\n @if (canResetPersonalOverride) {\n <button\n mat-button\n type=\"button\"\n class=\"settings-panel-scope__reset\"\n data-testid=\"settings-panel-reset-personal-override\"\n [disabled]=\"isBusy || isConfirmDialogOpen\"\n (click)=\"resetPersonalOverrideToTenant()\"\n >\n {{ tx('Reset to tenant baseline') }}\n </button>\n }\n </span>\n }\n </div>\n }\n @if (!previewing && storageSaveError(); as saveErr) {\n <div\n #saveErrorBanner\n tabindex=\"-1\"\n class=\"settings-panel-save-error\"\n role=\"alert\"\n aria-live=\"assertive\"\n aria-atomic=\"true\"\n data-testid=\"settings-panel-save-error\"\n [attr.data-error-code]=\"saveErr.errorCode || saveErr.status || 'save-error'\"\n [attr.data-correlation-id]=\"saveErr.correlationId || null\"\n >\n <mat-icon aria-hidden=\"true\" [praxisIcon]=\"'error_outline'\"></mat-icon>\n <div class=\"settings-panel-save-error__content\">\n <p class=\"settings-panel-save-error__message\">{{ formattedSaveErrorMessage }}</p>\n @if (saveErr.detail && saveErr.detail !== formattedSaveErrorMessage && saveErr.detail !== saveErrorFieldMessages.join('; ')) {\n <p class=\"settings-panel-save-error__detail\">{{ saveErr.detail }}</p>\n } @else if (saveErr.title && saveErr.title !== formattedSaveErrorMessage) {\n <p class=\"settings-panel-save-error__detail\">{{ saveErr.title }}</p>\n }\n @if (saveErr.errorCode || saveErr.correlationId) {\n <p class=\"settings-panel-save-error__meta\" data-testid=\"settings-panel-save-error-meta\">\n @if (saveErr.errorCode) {\n <span>{{ tx('Code: {{code}}', { code: saveErr.errorCode }) }}</span>\n }\n @if (saveErr.correlationId) {\n <span>{{ tx('Correlation ID: {{id}}', { id: saveErr.correlationId }) }}</span>\n }\n </p>\n }\n @if (saveErrorFieldMessages.length > 0) {\n <ul class=\"settings-panel-save-error__fields\" data-testid=\"settings-panel-save-error-fields\">\n @for (fieldMsg of saveErrorFieldMessages; track $index) {\n <li>{{ fieldMsg }}</li>\n }\n </ul>\n }\n @if (canSwitchToPersonalScopeFromError) {\n <button\n mat-stroked-button\n type=\"button\"\n class=\"settings-panel-save-error__action\"\n data-testid=\"settings-panel-switch-personal\"\n (click)=\"switchToPersonalScopeFromError()\"\n >\n {{ tx('Switch to personal scope') }}\n </button>\n }\n </div>\n <button\n praxisIconButton=\"close\"\n size=\"compact\"\n type=\"button\"\n data-testid=\"settings-panel-save-error-dismiss\"\n [attr.aria-label]=\"tx('Dismiss error')\"\n (click)=\"dismissSaveError()\"\n ></button>\n </div>\n }\n <div class=\"settings-panel-body\" [hidden]=\"previewing\">\n <ng-template #contentHost></ng-template>\n </div>\n <footer class=\"settings-panel-footer\" [hidden]=\"previewing\">\n <button\n mat-button\n type=\"button\"\n data-testid=\"settings-panel-reset\"\n (mousedown)=\"$event.stopPropagation()\"\n (click)=\"$event.stopPropagation(); onReset()\"\n [disabled]=\"isBusy || isConfirmDialogOpen\"\n >\n <mat-icon aria-hidden=\"true\" [praxisIcon]=\"'restart_alt'\"></mat-icon>\n <span>{{ tx('Reset') }}</span>\n </button>\n <span class=\"spacer\"></span>\n <button\n mat-button\n type=\"button\"\n data-testid=\"settings-panel-cancel\"\n (mousedown)=\"$event.stopPropagation()\"\n (click)=\"$event.stopPropagation(); onCancel()\"\n [disabled]=\"isBusy || isConfirmDialogOpen\"\n >\n <mat-icon aria-hidden=\"true\" [praxisIcon]=\"'close'\"></mat-icon>\n <span>{{ tx('Cancel') }}</span>\n </button>\n <button\n mat-stroked-button\n type=\"button\"\n data-testid=\"settings-panel-apply\"\n (mousedown)=\"$event.stopPropagation()\"\n (click)=\"$event.stopPropagation(); onApply()\"\n [disabled]=\"!canApply\"\n [matTooltip]=\"applySaveDisabledReason\"\n [matTooltipDisabled]=\"canApply || !diagnostics.showDisabledReason\"\n [attr.aria-busy]=\"isBusy\"\n [attr.aria-label]=\"applyActionLabel || 'Apply'\"\n >\n @if (showBusyIndicator) {\n <mat-progress-spinner\n mode=\"indeterminate\"\n diameter=\"20\"\n ></mat-progress-spinner>\n }\n @if (!showBusyIndicator) {\n <mat-icon aria-hidden=\"true\" [praxisIcon]=\"'done'\"></mat-icon>\n <span class=\"settings-panel-action-label settings-panel-action-label--apply\">{{ applyActionLabel }}</span>\n }\n </button>\n <button\n mat-flat-button\n color=\"primary\"\n type=\"button\"\n data-testid=\"settings-panel-save\"\n (mousedown)=\"$event.stopPropagation()\"\n (click)=\"$event.stopPropagation(); onSave()\"\n [disabled]=\"!canSave\"\n [matTooltip]=\"applySaveDisabledReason\"\n [matTooltipDisabled]=\"canSave || !diagnostics.showDisabledReason\"\n [attr.aria-busy]=\"isBusy\"\n [attr.aria-label]=\"saveActionLabel || 'Save & Close'\"\n >\n @if (showBusyIndicator) {\n <mat-progress-spinner\n mode=\"indeterminate\"\n diameter=\"20\"\n ></mat-progress-spinner>\n }\n @if (!showBusyIndicator) {\n <mat-icon aria-hidden=\"true\" [praxisIcon]=\"'save'\"></mat-icon>\n <span class=\"settings-panel-action-label settings-panel-action-label--save\">{{ saveActionLabel }}</span>\n }\n </button>\n </footer>\n</div>\n", styles: ["@charset \"UTF-8\";praxis-settings-panel{display:block;height:100%;width:100%;min-width:0;flex:1 1 auto;box-sizing:border-box}praxis-settings-panel .settings-panel{position:relative;container:settings-panel-shell/inline-size;--pfx-settings-panel-surface-container: var( --md-sys-color-surface-container, #ffffff );--pfx-settings-panel-surface-container-high: var( --md-sys-color-surface-container-high, #f7f7f7 );--pfx-settings-panel-surface-container-low: var( --md-sys-color-surface-container-low, #f2f4f7 );--pfx-settings-panel-surface: var(--md-sys-color-surface, #ffffff);--pfx-settings-panel-on-surface: var(--md-sys-color-on-surface, #111827);--pfx-settings-panel-on-surface-variant: var( --md-sys-color-on-surface-variant, rgba(17, 24, 39, .72) );--pfx-settings-panel-outline: var( --md-sys-color-outline, rgba(15, 23, 42, .24) );--pfx-settings-panel-outline-variant: var( --md-sys-color-outline-variant, rgba(15, 23, 42, .12) );--pfx-settings-panel-primary: var(--md-sys-color-primary, #2563eb);--pfx-settings-panel-primary-container: var( --md-sys-color-primary-container, rgba(37, 99, 235, .14) );--pfx-settings-panel-on-primary-container: var( --md-sys-color-on-primary-container, #0f172a );--pfx-settings-panel-secondary: var( --md-sys-color-secondary, var(--pfx-settings-panel-primary) );--pfx-settings-panel-error: var(--md-sys-color-error, #b3261e);--pfx-settings-panel-error-container: var( --md-sys-color-error-container, rgba(179, 38, 30, .14) );--pfx-settings-panel-alert-bg: color-mix( in srgb, var(--pfx-settings-panel-error-container) 78%, var(--pfx-settings-panel-surface) );--pfx-settings-panel-alert-fg: var(--pfx-settings-panel-error);--pfx-settings-panel-scope-bg: var(--pfx-settings-panel-surface);--pfx-settings-panel-scope-fg: var(--pfx-settings-panel-on-surface-variant);--pfx-settings-panel-border-radius: 0px;--mat-divider-color: var(--pfx-settings-panel-outline-variant);--mat-expansion-container-background-color: var( --pfx-settings-panel-surface-container );--mat-expansion-container-text-color: var(--pfx-settings-panel-on-surface);--mat-expansion-header-text-color: var(--pfx-settings-panel-on-surface);--mat-expansion-header-description-color: var( --pfx-settings-panel-on-surface-variant );--mat-expansion-header-indicator-color: var( --pfx-settings-panel-on-surface-variant );--mat-button-toggle-selected-state-background-color: var( --pfx-settings-panel-primary-container );--mat-button-toggle-selected-state-text-color: var( --pfx-settings-panel-on-primary-container );display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto auto auto 1fr auto;grid-template-areas:\"header\" \"context-nav\" \"status\" \"alert\" \"body\" \"footer\";min-width:0;height:100%;max-width:var(--pfx-settings-panel-max-width, 100%);background:var(--pfx-settings-panel-surface-container);color:var(--pfx-settings-panel-on-surface);border-left:1px solid var(--pfx-settings-panel-outline-variant);border-radius:var(--pfx-settings-panel-border-radius, 0px);width:var(--pfx-settings-panel-width, 100%);box-sizing:border-box;box-shadow:var(--pfx-settings-panel-elevation, var(--md-sys-elevation-level2, 0 8px 24px rgba(0, 0, 0, .16)));overflow:hidden}praxis-settings-panel .settings-panel__resize-handle{position:absolute;inset:0 auto 0 0;width:12px;cursor:col-resize;touch-action:none;z-index:3;outline:none}praxis-settings-panel .settings-panel__resize-handle:before{content:\"\";position:absolute;inset:0 auto 0 4px;width:2px;background:transparent;transition:background-color var(--pfx-side-panel-motion-duration, .16s) ease,opacity var(--pfx-side-panel-motion-duration, .16s) ease;opacity:0}praxis-settings-panel .settings-panel.is-resizable:hover .settings-panel__resize-handle:before,praxis-settings-panel .settings-panel__resize-handle:focus-visible:before{opacity:1;background:var(--pfx-settings-panel-outline)}praxis-settings-panel .settings-panel-header{grid-area:header;display:flex;align-items:center;gap:var(--pfx-settings-panel-header-gap, 8px);padding:12px var(--pfx-settings-panel-header-padding-x, 20px);min-height:var(--pfx-settings-panel-header-height, 64px);border-bottom:1px solid var(--pfx-settings-panel-outline-variant);background:var(--pfx-settings-panel-surface-container-high);box-shadow:var(--pfx-settings-panel-header-shadow, var(--md-sys-elevation-level1, 0 2px 6px rgba(0, 0, 0, .08)));flex-shrink:0;min-width:0;max-width:100%}praxis-settings-panel .settings-panel-header .spacer{flex:1 1 auto;min-width:0}praxis-settings-panel .settings-panel-context-nav{grid-area:context-nav;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 12px;padding:8px var(--pfx-settings-panel-header-padding-x, 20px);border-bottom:1px solid var(--pfx-settings-panel-outline-variant);background:var(--pfx-settings-panel-surface-container-low);min-width:0;max-width:100%}praxis-settings-panel .settings-panel-context-nav__targets{display:flex;align-items:center;gap:4px;min-width:0;flex:1 1 200px}praxis-settings-panel .settings-panel-context-nav__target-select{flex:1 1 auto;min-width:0;min-height:34px;padding:4px 10px;border-radius:8px;border:1px solid var(--pfx-settings-panel-outline-variant);background:var(--pfx-settings-panel-surface);color:var(--pfx-settings-panel-on-surface);font:inherit;font-size:.84rem;font-weight:600}praxis-settings-panel .settings-panel-context-nav__modes{display:inline-flex;align-items:center;flex-wrap:wrap;gap:4px;padding:2px;max-width:100%;border-radius:999px;border:1px solid var(--pfx-settings-panel-outline-variant);background:var(--pfx-settings-panel-surface)}praxis-settings-panel .settings-panel-context-nav__mode-btn{appearance:none;border:none;background:transparent;color:var(--pfx-settings-panel-on-surface-variant);font:inherit;font-size:.78rem;font-weight:600;padding:5px 12px;border-radius:999px;white-space:nowrap;flex-shrink:0;cursor:pointer;transition:background-color .14s ease,color .14s ease}praxis-settings-panel .settings-panel-context-nav__mode-btn.is-active{background:var(--pfx-settings-panel-primary-container);color:var(--pfx-settings-panel-on-primary-container)}praxis-settings-panel .settings-panel-context-nav__mode-btn:disabled{opacity:.42;cursor:not-allowed}praxis-settings-panel .settings-panel-status{grid-area:status;display:flex;align-items:center;gap:8px;min-height:36px;padding:6px var(--pfx-settings-panel-status-padding-x, 20px);border-bottom:1px solid var(--pfx-settings-panel-outline-variant);background:var(--pfx-settings-panel-surface-container-high);color:var(--pfx-settings-panel-on-surface);font-size:.85rem;font-weight:500;min-width:0;max-width:100%}praxis-settings-panel .settings-panel-status mat-icon{width:18px;height:18px;font-size:18px}praxis-settings-panel .settings-panel-status[data-status=dirty],praxis-settings-panel .settings-panel-status[data-status=invalid]{color:var(--pfx-settings-panel-error);background:color-mix(in srgb,var(--pfx-settings-panel-error-container) 30%,var(--pfx-settings-panel-surface-container-high))}praxis-settings-panel .settings-panel-status[data-status=saved]{color:var(--pfx-settings-panel-primary);background:color-mix(in srgb,var(--pfx-settings-panel-primary-container) 28%,var(--pfx-settings-panel-surface-container-high))}praxis-settings-panel .settings-panel-scope{display:inline-flex;align-items:center;flex-wrap:wrap;gap:6px;padding:2px 8px;border-radius:999px;border:1px solid var(--pfx-settings-panel-outline-variant);background:var(--pfx-settings-panel-scope-bg);color:var(--pfx-settings-panel-scope-fg);font-size:.75rem;font-weight:600}praxis-settings-panel .settings-panel-scope[data-scope=tenant]{border-color:color-mix(in srgb,var(--pfx-settings-panel-primary) 42%,var(--pfx-settings-panel-outline-variant));background:var(--pfx-settings-panel-primary-container);color:var(--pfx-settings-panel-on-primary-container)}praxis-settings-panel .settings-panel-scope__toggle,praxis-settings-panel .settings-panel-scope__reset{height:24px;line-height:22px;font-size:.72rem;padding:0 8px}praxis-settings-panel .settings-panel-save-error{grid-area:alert;display:flex;align-items:flex-start;gap:10px;padding:10px var(--pfx-settings-panel-status-padding-x, 20px);background:var(--pfx-settings-panel-alert-bg);color:var(--pfx-settings-panel-alert-fg);border-bottom:1px solid color-mix(in srgb,var(--pfx-settings-panel-error) 32%,var(--pfx-settings-panel-outline-variant));font-size:.82rem}praxis-settings-panel .settings-panel-save-error__content{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:4px}praxis-settings-panel .settings-panel-save-error__message{margin:0;font-weight:600;line-height:1.35}praxis-settings-panel .settings-panel-save-error:focus-visible,praxis-settings-panel .settings-panel-save-error:focus{outline:2px solid var(--pfx-settings-panel-error);outline-offset:-2px}praxis-settings-panel .settings-panel-save-error__detail{margin:0;font-size:.78rem;color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel-save-error__meta{margin:2px 0 0;display:flex;flex-wrap:wrap;gap:6px 12px;font-size:.72rem;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel-save-error__fields{margin:2px 0 0;padding-inline-start:16px;font-size:.78rem;color:var(--pfx-settings-panel-on-surface-variant);display:flex;flex-direction:column;gap:2px}praxis-settings-panel .settings-panel-save-error__action{align-self:flex-start;margin-top:2px}praxis-settings-panel .settings-panel-body{grid-area:body;container-type:inline-size;overflow-y:auto;overflow-x:hidden;scroll-padding-top:var(--pfx-settings-panel-scroll-padding-start, 16px);scroll-padding-bottom:var(--pfx-settings-panel-scroll-padding-end, 88px);min-height:0;padding:var(--pfx-settings-panel-body-padding, 8px 16px 24px);background:var(--pfx-settings-panel-surface);display:flex;flex-direction:column;min-width:0;max-width:100%}praxis-settings-panel .settings-panel-body>*{min-width:0;max-width:100%}praxis-settings-panel .settings-panel-content{display:block;min-width:0;max-width:100%}praxis-settings-panel .settings-panel-content>*{min-width:0;max-width:100%;box-sizing:border-box}praxis-settings-panel .settings-panel-footer{grid-area:footer;border-top:1px solid var(--pfx-settings-panel-outline-variant);background:var(--pfx-settings-panel-surface-container-high);box-shadow:var(--pfx-settings-panel-footer-shadow, var(--md-sys-elevation-level1, 0 -2px 6px rgba(0, 0, 0, .08)));display:flex;align-items:center;flex-wrap:wrap;padding:var(--pfx-settings-panel-footer-padding, 12px 20px);column-gap:var(--pfx-settings-panel-footer-gap, 12px);row-gap:8px;flex-shrink:0;min-width:0;max-width:100%}praxis-settings-panel .spacer{flex:1}praxis-settings-panel .settings-panel-title{display:inline-flex;align-items:center;flex:1 1 auto;gap:var(--pfx-settings-panel-title-gap, 8px);font-weight:700;line-height:1.2;letter-spacing:.2px;margin:0;min-width:0;overflow:visible;white-space:normal}praxis-settings-panel .settings-panel-title span{min-width:0;overflow:visible;white-space:normal}praxis-settings-panel .settings-panel-title mat-icon{color:var(--pfx-settings-panel-primary)}praxis-settings-panel .settings-panel-title .title-icon{width:20px;height:20px;font-size:20px}praxis-settings-panel .settings-panel-footer button{display:inline-flex;align-items:center}praxis-settings-panel .settings-panel-footer button .mat-icon{flex:0 0 20px;font-size:20px;width:20px;height:20px;line-height:1;display:inline-flex;align-items:center;justify-content:center;overflow:hidden}praxis-settings-panel .settings-panel-footer .mat-button-wrapper{display:inline-flex;align-items:center;gap:var(--pfx-settings-panel-button-gap, 8px)}praxis-settings-panel .settings-panel-footer .mat-progress-spinner{margin-right:8px}praxis-settings-panel .settings-panel-footer .mat-flat-button[color=primary]{font-weight:600}praxis-settings-panel .settings-panel-footer .mdc-button__label{display:inline-flex;align-items:center;gap:var(--pfx-settings-panel-button-gap, 8px);line-height:1}praxis-settings-panel .settings-panel-footer .mdc-button__label>span{display:inline-flex;align-items:center;line-height:1}praxis-settings-panel .settings-panel-footer .mdc-button__label .mat-icon{display:inline-flex;align-items:center;justify-content:center;line-height:1}@container settings-panel-shell (max-width: 520px){praxis-settings-panel .settings-panel-footer{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:stretch;padding:10px 12px;column-gap:8px}praxis-settings-panel .settings-panel-footer .spacer{display:none}praxis-settings-panel .settings-panel-footer button{justify-content:center;width:100%;min-width:0;min-height:44px;height:auto;padding:8px}praxis-settings-panel .settings-panel-action-label{white-space:normal;overflow-wrap:anywhere;text-align:center}praxis-settings-panel .settings-panel-footer .mdc-button__label{min-width:0;max-width:100%}praxis-settings-panel .settings-panel-footer .mdc-button__label>span{min-width:0;line-height:1.25}}@container settings-panel-shell (max-width: 280px){praxis-settings-panel .settings-panel-footer{grid-template-columns:minmax(0,1fr)}}praxis-settings-panel .settings-panel .mat-divider{background-color:var(--pfx-settings-panel-outline-variant)}praxis-settings-panel .settings-panel .mat-expansion-panel{background:var(--pfx-settings-panel-surface-container);border:1px solid var(--pfx-settings-panel-outline-variant);border-radius:var(--md-sys-shape-corner-medium, 12px);box-shadow:var(--md-sys-elevation-level1, 0 2px 8px rgba(0, 0, 0, .08));color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel .mat-expansion-panel-header{background:var(--pfx-settings-panel-surface-container);color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-content{color:var(--pfx-settings-panel-on-surface);flex-wrap:wrap;gap:4px 12px;min-width:0;overflow:visible}praxis-settings-panel .settings-panel .mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:hover{background:color-mix(in srgb,var(--pfx-settings-panel-surface-container-high) 84%,var(--pfx-settings-panel-primary) 16%)}praxis-settings-panel .settings-panel .mat-expansion-panel.mat-expanded>.mat-expansion-panel-header{background:var(--pfx-settings-panel-surface-container-high)}praxis-settings-panel .settings-panel .mat-expansion-panel-header mat-icon,praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-icon{color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-expansion-panel-header-title,praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-expansion-panel-header-description{color:var(--pfx-settings-panel-on-surface);min-width:0;overflow:visible;white-space:normal}praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-expansion-panel-header-description{color:var(--pfx-settings-panel-on-surface-variant);flex-wrap:wrap;gap:8px}praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-expansion-panel-header-title>*,praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-expansion-panel-header-description>*{color:inherit}praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-expansion-panel-header-title small,praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-expansion-panel-header-description small{color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-expansion-indicator,praxis-settings-panel .settings-panel .mat-expansion-panel-header .mat-expansion-indicator:after{color:var(--pfx-settings-panel-on-surface-variant);border-color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel .mat-expansion-panel .mat-action-row{border-top-color:var(--pfx-settings-panel-outline-variant);background:var(--pfx-settings-panel-surface-container-low)}praxis-settings-panel .settings-panel .mat-accordion,praxis-settings-panel .settings-panel .mat-accordion .mat-expansion-panel-spacing{background:transparent}praxis-settings-panel .settings-panel .mat-expansion-panel-content,praxis-settings-panel .settings-panel .mat-expansion-panel-content-wrapper,praxis-settings-panel .settings-panel .mat-expansion-panel-body{background:var(--pfx-settings-panel-surface-container);color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel .mat-expansion-panel .mat-expansion-panel-body{padding:8px}praxis-settings-panel .settings-panel .mat-expansion-panel .mat-expansion-panel-body>*{color:inherit}praxis-settings-panel .settings-panel .mat-mdc-tab-group .mat-mdc-tab-header{border-bottom:1px solid var(--pfx-settings-panel-outline-variant);background:var(--pfx-settings-panel-surface-container-low)}praxis-settings-panel .settings-panel .mat-mdc-tab-group .mdc-tab{min-width:0}praxis-settings-panel .settings-panel .mat-mdc-tab-group .mdc-tab .mdc-tab__text-label{color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel .mat-mdc-tab-group .mdc-tab:hover .mdc-tab__text-label,praxis-settings-panel .settings-panel .mat-mdc-tab-group .mdc-tab:focus .mdc-tab__text-label{color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel .mat-mdc-tab-group .mdc-tab.mdc-tab--active .mdc-tab__text-label{color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel .mat-mdc-tab-group .mat-mdc-tab-header-pagination{color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel .mat-mdc-tab-group .mat-mdc-tab-header-pagination-chevron{border-color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel .mat-mdc-tab-group .mat-mdc-tab-header-pagination:not(.mat-mdc-tab-header-pagination-disabled):hover{background:color-mix(in srgb,var(--pfx-settings-panel-surface-container-high) 84%,var(--pfx-settings-panel-primary) 16%)}praxis-settings-panel .settings-panel .mat-mdc-tab-group .mdc-tab-indicator__content--underline{border-color:var(--pfx-settings-panel-primary)}praxis-settings-panel .settings-panel .mat-mdc-card{background:var(--pfx-settings-panel-surface-container-low);border:1px solid var(--pfx-settings-panel-outline-variant);color:var(--pfx-settings-panel-on-surface);box-shadow:var(--md-sys-elevation-level1, 0 2px 8px rgba(0, 0, 0, .08))}praxis-settings-panel .settings-panel .mat-mdc-card-subtitle{color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel .mat-mdc-card-title,praxis-settings-panel .settings-panel .mat-mdc-card-content{color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel .mat-mdc-form-field{width:100%;align-self:start;--mdc-filled-text-field-container-color: var( --pfx-settings-panel-surface-container );--mdc-filled-text-field-hover-container-color: var( --pfx-settings-panel-surface-container-high );--mdc-filled-text-field-focus-container-color: var( --pfx-settings-panel-surface-container-high );--mdc-filled-text-field-active-indicator-color: var( --pfx-settings-panel-outline-variant );--mdc-filled-text-field-hover-active-indicator-color: var( --pfx-settings-panel-secondary );--mdc-filled-text-field-focus-active-indicator-color: var( --pfx-settings-panel-primary );--mdc-filled-text-field-label-text-color: var( --pfx-settings-panel-on-surface-variant );--mdc-filled-text-field-focus-label-text-color: var( --pfx-settings-panel-primary );--mdc-filled-text-field-input-text-color: var( --pfx-settings-panel-on-surface );--mdc-filled-text-field-caret-color: var(--pfx-settings-panel-primary);--mdc-outlined-text-field-outline-color: var( --pfx-settings-panel-outline-variant );--mdc-outlined-text-field-hover-outline-color: var( --pfx-settings-panel-secondary );--mdc-outlined-text-field-focus-outline-color: var( --pfx-settings-panel-primary );--mdc-outlined-text-field-label-text-color: var( --pfx-settings-panel-on-surface-variant );--mdc-outlined-text-field-focus-label-text-color: var( --pfx-settings-panel-primary );--mdc-outlined-text-field-input-text-color: var( --pfx-settings-panel-on-surface );--mdc-outlined-text-field-caret-color: var(--pfx-settings-panel-primary);--mat-form-field-focus-select-arrow-color: var( --pfx-settings-panel-primary );--mat-form-field-enabled-select-arrow-color: var( --pfx-settings-panel-on-surface-variant )}praxis-settings-panel .settings-panel .mat-mdc-form-field .mat-mdc-text-field-wrapper.mdc-text-field--filled,praxis-settings-panel .settings-panel .mat-mdc-form-field .mdc-text-field--filled{background-color:var(--pfx-settings-panel-surface-container);border-radius:var(--md-sys-shape-corner-small, 8px) var(--md-sys-shape-corner-small, 8px) 0 0}praxis-settings-panel .settings-panel .mat-mdc-form-field .mdc-text-field--filled .mat-mdc-form-field-flex,praxis-settings-panel .settings-panel .mat-mdc-form-field .mdc-text-field--filled .mat-mdc-form-field-infix,praxis-settings-panel .settings-panel .mat-mdc-form-field .mdc-text-field--filled .mat-mdc-form-field-focus-overlay{background:var(--pfx-settings-panel-surface-container);color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel .mat-mdc-form-field .mat-mdc-text-field-wrapper.mdc-text-field--outlined,praxis-settings-panel .settings-panel .mat-mdc-form-field .mdc-text-field--outlined,praxis-settings-panel .settings-panel .mat-mdc-form-field .mdc-text-field--outlined .mat-mdc-form-field-flex,praxis-settings-panel .settings-panel .mat-mdc-form-field .mdc-text-field--outlined .mat-mdc-form-field-infix{background:transparent;background-color:transparent;color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel .mat-mdc-form-field-focus-overlay{opacity:0}praxis-settings-panel .settings-panel .mat-mdc-form-field .mdc-text-field--filled .mdc-floating-label,praxis-settings-panel .settings-panel .mat-mdc-form-field .mat-mdc-select-placeholder,praxis-settings-panel .settings-panel .mat-mdc-form-field .mat-mdc-select-arrow,praxis-settings-panel .settings-panel .mat-mdc-form-field .mat-mdc-floating-label{color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel .mat-mdc-form-field .mat-mdc-select-value,praxis-settings-panel .settings-panel .mat-mdc-form-field .mat-mdc-select-value-text,praxis-settings-panel .settings-panel .mat-mdc-form-field .mdc-text-field--filled .mdc-text-field__input,praxis-settings-panel .settings-panel .mat-mdc-form-field input,praxis-settings-panel .settings-panel .mat-mdc-form-field textarea,praxis-settings-panel .settings-panel .mat-mdc-form-field .mdc-text-field__input{color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel .mat-mdc-form-field .mdc-text-field--focused:not(.mdc-text-field--invalid) .mat-mdc-floating-label,praxis-settings-panel .settings-panel .mat-mdc-form-field .mdc-text-field--filled.mdc-text-field--focused .mdc-floating-label{color:var(--pfx-settings-panel-primary)}praxis-settings-panel .settings-panel .mat-mdc-form-field .mdc-text-field--invalid .mat-mdc-floating-label{color:var(--pfx-settings-panel-error)}praxis-settings-panel .settings-panel .mat-mdc-form-field-subscript-wrapper{position:relative;box-sizing:border-box}praxis-settings-panel .settings-panel .mat-mdc-form-field .mat-mdc-form-field-hint-wrapper,praxis-settings-panel .settings-panel .mat-mdc-form-field .mat-mdc-form-field-error-wrapper{position:relative;top:auto;left:auto;right:auto;padding-top:4px;line-height:1.35}praxis-settings-panel .settings-panel .mat-mdc-form-field-bottom-align:before{display:none}praxis-settings-panel .settings-panel .mat-mdc-form-field-subscript-wrapper,praxis-settings-panel .settings-panel .mat-mdc-form-field-hint-wrapper,praxis-settings-panel .settings-panel .mat-mdc-form-field-error-wrapper,praxis-settings-panel .settings-panel .mat-mdc-hint{color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel .mat-button-toggle-group{border-color:var(--pfx-settings-panel-outline-variant);background:var(--pfx-settings-panel-surface-container-low)}praxis-settings-panel .settings-panel .mat-button-toggle{background:var(--pfx-settings-panel-surface-container-low);color:var(--pfx-settings-panel-on-surface-variant)}praxis-settings-panel .settings-panel .mat-button-toggle+.mat-button-toggle{border-left-color:var(--pfx-settings-panel-outline-variant)}praxis-settings-panel .settings-panel .mat-button-toggle-group .mat-button-toggle-checked{background:var(--pfx-settings-panel-primary-container);color:var(--pfx-settings-panel-on-primary-container)}praxis-settings-panel .settings-panel .mat-button-toggle .mat-icon,praxis-settings-panel .settings-panel .mat-button-toggle-checked .mat-icon{color:inherit}praxis-settings-panel .settings-panel .mat-mdc-slide-toggle .mdc-label{color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel .pfx-editor-section{box-sizing:border-box;width:100%;min-width:0;padding:16px;border-radius:16px;border:1px solid var(--pfx-settings-panel-outline-variant);background:var(--pfx-settings-panel-surface-container-low)}praxis-settings-panel .settings-panel .pfx-editor-subgroup{display:grid;gap:12px;padding-top:14px;border-top:1px solid color-mix(in srgb,var(--pfx-settings-panel-outline-variant) 70%,transparent)}praxis-settings-panel .settings-panel .pfx-editor-subgroup:first-child{padding-top:0;border-top:0}praxis-settings-panel .settings-panel .pfx-editor-grid-12{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:12px;min-width:0}praxis-settings-panel .settings-panel .pfx-editor-toggle-cluster{display:flex;flex-wrap:wrap;align-items:center;gap:12px 20px}.settings-panel{grid-template-columns:minmax(0,1fr);min-width:0;max-width:100%}.settings-panel-body{overflow-x:hidden;min-width:0}.settings-panel-body>*{min-width:0;max-width:100%}.praxis-settings-panel-backdrop{background:var(--pfx-settings-panel-backdrop, var(--pfx-backdrop, rgba(8, 15, 26, .42)));backdrop-filter:blur(var(--pfx-settings-panel-backdrop-blur, var(--pfx-backdrop-blur, 6px))) saturate(110%);-webkit-backdrop-filter:blur(var(--pfx-settings-panel-backdrop-blur, var(--pfx-backdrop-blur, 6px))) saturate(110%)}:is(.cdk-overlay-pane.praxis-settings-panel-pane,.praxis-settings-panel-pane){position:fixed;top:0;right:0;display:flex;align-items:stretch;height:100vh;max-width:var(--pfx-settings-panel-pane-max-width, 100vw);max-height:100vh;z-index:var(--pfx-settings-panel-z-index, var(--praxis-z-settings-panel, var(--praxis-layer-settings-panel, 1220)));transition:width var(--pfx-side-panel-motion-duration-enter, .3s) var(--pfx-side-panel-motion-easing-enter, ease)}.praxis-settings-panel-pane .settings-panel{pointer-events:auto}@media(prefers-reduced-motion:reduce){.praxis-settings-panel-pane{transition:none}}:is(.cdk-overlay-pane.praxis-settings-panel-pane.praxis-settings-panel-pane--preview,.praxis-settings-panel-pane.praxis-settings-panel-pane--preview){top:auto;bottom:12px;right:12px;height:auto;width:min(560px,100vw - 24px);min-width:0;transition:none}.praxis-settings-panel-backdrop.praxis-settings-panel-backdrop--preview{background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none}.praxis-settings-preview-target{outline:2px solid var(--md-sys-color-primary);outline-offset:3px}praxis-settings-panel .settings-panel [hidden]{display:none}praxis-settings-panel .settings-panel .settings-panel-header[hidden],praxis-settings-panel .settings-panel .settings-panel-body[hidden],praxis-settings-panel .settings-panel .settings-panel-footer[hidden]{display:none}praxis-settings-panel .settings-panel--preview{height:auto;min-height:0;grid-template-rows:auto;border-radius:16px}praxis-settings-panel .settings-panel-preview-bar{display:flex;align-items:center;gap:16px;padding:16px;color:var(--pfx-settings-panel-on-surface)}praxis-settings-panel .settings-panel-preview-bar p{margin:4px 0 0;color:var(--pfx-settings-panel-on-surface-variant);font-size:.875rem}praxis-settings-panel .settings-panel-preview-bar button{flex-shrink:0}@container settings-panel-shell (max-width: 599px){praxis-settings-panel .settings-panel-header:not([hidden]){display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:start}praxis-settings-panel .settings-panel-header .spacer{display:none}praxis-settings-panel .settings-panel-header .settings-panel-title{grid-column:1;grid-row:1;overflow-wrap:anywhere}praxis-settings-panel .settings-panel-header [data-testid=settings-panel-toggle-expand]{grid-column:2;grid-row:1}praxis-settings-panel .settings-panel-header [data-testid=settings-panel-close-icon]{grid-column:3;grid-row:1}praxis-settings-panel .settings-panel-header [data-testid=settings-panel-preview]{grid-column:1/-1;grid-row:2;justify-self:start;max-width:100%}praxis-settings-panel .settings-panel-preview-bar{flex-direction:column;align-items:stretch;gap:8px}}@media(prefers-reduced-transparency:reduce){.praxis-settings-panel-backdrop{backdrop-filter:none;-webkit-backdrop-filter:none;background:var(--pfx-backdrop-opaque, rgba(8, 15, 26, .72))}}@media(forced-colors:active){praxis-settings-panel .settings-panel{border:1px solid CanvasText;background:Canvas;color:CanvasText}praxis-settings-panel .settings-panel-save-error,praxis-settings-panel .settings-panel-scope{border:1px solid CanvasText;background:Canvas;color:CanvasText}.praxis-settings-panel-backdrop{backdrop-filter:none;-webkit-backdrop-filter:none;background:Canvas;opacity:.75}}\n"] }]
1167
1920
  }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1.MatDialog }, { type: i0.ElementRef }, { type: i1$1.OverlayContainer }], propDecorators: { focusTrap: [{
1168
1921
  type: ViewChild,
1169
1922
  args: [CdkTrapFocus]
1170
1923
  }], contentHost: [{
1171
1924
  type: ViewChild,
1172
1925
  args: ['contentHost', { read: ViewContainerRef, static: true }]
1926
+ }], saveErrorBanner: [{
1927
+ type: ViewChild,
1928
+ args: ['saveErrorBanner']
1173
1929
  }], handleKeydown: [{
1174
1930
  type: HostListener,
1175
1931
  args: ['document:keydown', ['$event']]
@@ -1189,14 +1945,18 @@ class SettingsPanelRef {
1189
1945
  appliedSubject = new Subject();
1190
1946
  savedSubject = new Subject();
1191
1947
  resetSubject = new Subject();
1948
+ tenantBaselineRestoredSubject = new Subject();
1192
1949
  closedSubject = new Subject();
1193
1950
  sizeChangedSubject = new Subject();
1951
+ persistenceErrorSubject = new Subject();
1194
1952
  sizePersistor;
1195
1953
  applied$ = this.appliedSubject.asObservable();
1196
1954
  saved$ = this.savedSubject.asObservable();
1197
1955
  reset$ = this.resetSubject.asObservable();
1956
+ tenantBaselineRestored$ = this.tenantBaselineRestoredSubject.asObservable();
1198
1957
  closed$ = this.closedSubject.asObservable();
1199
1958
  sizeChanged$ = this.sizeChangedSubject.asObservable();
1959
+ persistenceError$ = this.persistenceErrorSubject.asObservable();
1200
1960
  constructor(overlayRef) {
1201
1961
  this.overlayRef = overlayRef;
1202
1962
  }
@@ -1216,6 +1976,12 @@ class SettingsPanelRef {
1216
1976
  reset() {
1217
1977
  this.resetSubject.next();
1218
1978
  }
1979
+ notifyTenantBaselineRestored(baseline) {
1980
+ this.tenantBaselineRestoredSubject.next(baseline);
1981
+ }
1982
+ reportPersistenceError(error) {
1983
+ this.persistenceErrorSubject.next(error);
1984
+ }
1219
1985
  bindSizePersistor(fn) {
1220
1986
  this.sizePersistor = fn;
1221
1987
  }
@@ -1246,23 +2012,29 @@ class SettingsPanelRef {
1246
2012
  this.appliedSubject.complete();
1247
2013
  this.savedSubject.complete();
1248
2014
  this.resetSubject.complete();
2015
+ this.tenantBaselineRestoredSubject.complete();
1249
2016
  this.closedSubject.complete();
1250
2017
  this.sizeChangedSubject.complete();
2018
+ this.persistenceErrorSubject.complete();
1251
2019
  }
1252
2020
  }
1253
2021
  class DeferredSettingsPanelRef {
1254
2022
  appliedSubject = new Subject();
1255
2023
  savedSubject = new Subject();
1256
2024
  resetSubject = new Subject();
2025
+ tenantBaselineRestoredSubject = new Subject();
1257
2026
  closedSubject = new ReplaySubject(1);
1258
2027
  sizeChangedSubject = new Subject();
2028
+ persistenceErrorSubject = new Subject();
1259
2029
  target;
1260
2030
  completed = false;
1261
2031
  applied$ = this.appliedSubject.asObservable();
1262
2032
  saved$ = this.savedSubject.asObservable();
1263
2033
  reset$ = this.resetSubject.asObservable();
2034
+ tenantBaselineRestored$ = this.tenantBaselineRestoredSubject.asObservable();
1264
2035
  closed$ = this.closedSubject.asObservable();
1265
2036
  sizeChanged$ = this.sizeChangedSubject.asObservable();
2037
+ persistenceError$ = this.persistenceErrorSubject.asObservable();
1266
2038
  resolve(target) {
1267
2039
  if (this.completed) {
1268
2040
  return;
@@ -1271,7 +2043,9 @@ class DeferredSettingsPanelRef {
1271
2043
  target.applied$.subscribe((value) => this.appliedSubject.next(value));
1272
2044
  target.saved$.subscribe((value) => this.savedSubject.next(value));
1273
2045
  target.reset$.subscribe(() => this.resetSubject.next());
2046
+ target.tenantBaselineRestored$.subscribe((baseline) => this.tenantBaselineRestoredSubject.next(baseline));
1274
2047
  target.sizeChanged$.subscribe((value) => this.sizeChangedSubject.next(value));
2048
+ target.persistenceError$.subscribe((error) => this.persistenceErrorSubject.next(error));
1275
2049
  target.closed$.subscribe((reason) => {
1276
2050
  this.closedSubject.next(reason);
1277
2051
  this.complete();
@@ -1286,6 +2060,12 @@ class DeferredSettingsPanelRef {
1286
2060
  reset() {
1287
2061
  this.target?.reset();
1288
2062
  }
2063
+ notifyTenantBaselineRestored(baseline) {
2064
+ this.target?.notifyTenantBaselineRestored(baseline);
2065
+ }
2066
+ reportPersistenceError(error) {
2067
+ this.target?.reportPersistenceError(error);
2068
+ }
1289
2069
  bindSizePersistor(_fn) { }
1290
2070
  setPreviewing(previewing) {
1291
2071
  this.target?.setPreviewing(previewing);
@@ -1312,15 +2092,16 @@ class DeferredSettingsPanelRef {
1312
2092
  this.appliedSubject.complete();
1313
2093
  this.savedSubject.complete();
1314
2094
  this.resetSubject.complete();
2095
+ this.tenantBaselineRestoredSubject.complete();
1315
2096
  this.closedSubject.complete();
1316
2097
  this.sizeChangedSubject.complete();
2098
+ this.persistenceErrorSubject.complete();
1317
2099
  }
1318
2100
  }
1319
2101
 
1320
2102
  const SETTINGS_PANEL_DATA = SETTINGS_PANEL_DATA$1;
1321
2103
  const SETTINGS_PANEL_REF = new InjectionToken('SETTINGS_PANEL_REF');
1322
2104
 
1323
- const PRAXIS_BASE_SIDE_PANEL_I18N_NAMESPACE = 'praxis-side-panel';
1324
2105
  class BaseSidePanelComponent {
1325
2106
  cdr;
1326
2107
  i18n;
@@ -1332,9 +2113,12 @@ class BaseSidePanelComponent {
1332
2113
  minWidth;
1333
2114
  maxWidth;
1334
2115
  resizable = false;
2116
+ expandable = false;
1335
2117
  resizeAxis = 'x';
1336
2118
  persistSizeKey;
1337
2119
  useHostWidth = false;
2120
+ isExpanded = false;
2121
+ isResizing = false;
1338
2122
  theme = null;
1339
2123
  onClose;
1340
2124
  onResizeWidth;
@@ -1343,6 +2127,9 @@ class BaseSidePanelComponent {
1343
2127
  activePointerId = null;
1344
2128
  dragStartX = 0;
1345
2129
  dragStartWidth = 0;
2130
+ collapsedWidthBeforeExpand = null;
2131
+ suppressNextBackdropClick = false;
2132
+ backdropSuppressTimer = null;
1346
2133
  contentRef;
1347
2134
  footerRef;
1348
2135
  contentHost;
@@ -1352,7 +2139,11 @@ class BaseSidePanelComponent {
1352
2139
  this.i18n = i18n;
1353
2140
  }
1354
2141
  ngOnDestroy() {
1355
- this.stopResizeSession();
2142
+ if (this.backdropSuppressTimer !== null) {
2143
+ clearTimeout(this.backdropSuppressTimer);
2144
+ this.backdropSuppressTimer = null;
2145
+ }
2146
+ this.stopResizeSession(false);
1356
2147
  }
1357
2148
  get hostClasses() {
1358
2149
  return this.theme?.hostClasses ?? [];
@@ -1360,9 +2151,19 @@ class BaseSidePanelComponent {
1360
2151
  get hostCssVars() {
1361
2152
  return (this.theme?.cssVars ?? {});
1362
2153
  }
2154
+ get tracksHostWidth() {
2155
+ return (this.useHostWidth ||
2156
+ this.resizable ||
2157
+ this.expandable ||
2158
+ this.isExpanded ||
2159
+ Boolean(this.width));
2160
+ }
1363
2161
  get panelInlineStyles() {
2162
+ if (this.tracksHostWidth) {
2163
+ return {};
2164
+ }
1364
2165
  return {
1365
- width: this.useHostWidth ? null : this.width ?? null,
2166
+ width: this.width ?? null,
1366
2167
  minWidth: this.minWidth ?? null,
1367
2168
  maxWidth: this.maxWidth ?? null,
1368
2169
  };
@@ -1374,10 +2175,16 @@ class BaseSidePanelComponent {
1374
2175
  };
1375
2176
  }
1376
2177
  get closeLabel() {
1377
- return this.i18n.t('Close', undefined, 'Close', PRAXIS_BASE_SIDE_PANEL_I18N_NAMESPACE);
2178
+ const fallback = this.i18n.getLocale().toLowerCase().startsWith('en')
2179
+ ? 'Close'
2180
+ : 'Fechar';
2181
+ return this.i18n.t('Close', undefined, fallback, PRAXIS_SETTINGS_PANEL_I18N_NAMESPACE);
1378
2182
  }
1379
2183
  get resizeHandleLabel() {
1380
- return this.i18n.t('Resize panel', undefined, 'Resize panel', PRAXIS_BASE_SIDE_PANEL_I18N_NAMESPACE);
2184
+ const fallback = this.i18n.getLocale().toLowerCase().startsWith('en')
2185
+ ? 'Resize panel'
2186
+ : 'Redimensionar painel';
2187
+ return this.i18n.t('Resize panel', undefined, fallback, PRAXIS_SETTINGS_PANEL_I18N_NAMESPACE);
1381
2188
  }
1382
2189
  get hasHeader() {
1383
2190
  return !!(this.title || this.titleIcon || this.subtitle);
@@ -1386,26 +2193,144 @@ class BaseSidePanelComponent {
1386
2193
  return !!this.footerRef;
1387
2194
  }
1388
2195
  get widthClass() {
1389
- if (this.useHostWidth || this.width) {
2196
+ if (this.tracksHostWidth) {
1390
2197
  return null;
1391
2198
  }
1392
2199
  return `width-${this.widthPreset}`;
1393
2200
  }
1394
2201
  get showResizeHandle() {
1395
- return this.resizable && this.resizeAxis === 'x';
2202
+ return (this.resizable &&
2203
+ this.resizeAxis === 'x' &&
2204
+ resolveSidePanelViewportWidth() > 640);
2205
+ }
2206
+ get showExpandButton() {
2207
+ if (!this.expandable) {
2208
+ return false;
2209
+ }
2210
+ if (this.isExpanded) {
2211
+ return true;
2212
+ }
2213
+ const viewportWidth = resolveSidePanelViewportWidth();
2214
+ return canExpandSidePanel(this.getCurrentWidthPx(viewportWidth), viewportWidth, { maxWidth: this.maxWidth });
2215
+ }
2216
+ get expandLabel() {
2217
+ const isEn = this.i18n.getLocale().toLowerCase().startsWith('en');
2218
+ if (this.isExpanded) {
2219
+ return this.i18n.t('Collapse panel', undefined, isEn ? 'Collapse panel' : 'Reduzir painel', PRAXIS_SETTINGS_PANEL_I18N_NAMESPACE);
2220
+ }
2221
+ return this.i18n.t('Expand panel', undefined, isEn ? 'Expand panel' : 'Expandir painel', PRAXIS_SETTINGS_PANEL_I18N_NAMESPACE);
2222
+ }
2223
+ get resizeMinWidthPx() {
2224
+ const viewportWidth = resolveSidePanelViewportWidth();
2225
+ return clampSidePanelWidthPx(0, {
2226
+ minWidth: this.minWidth,
2227
+ maxWidth: this.maxWidth,
2228
+ defaultMinPx: 320,
2229
+ viewportWidth,
2230
+ });
2231
+ }
2232
+ get resizeMaxWidthPx() {
2233
+ const viewportWidth = resolveSidePanelViewportWidth();
2234
+ return clampSidePanelWidthPx(viewportWidth, {
2235
+ minWidth: this.minWidth,
2236
+ maxWidth: this.maxWidth,
2237
+ defaultMinPx: 320,
2238
+ viewportWidth,
2239
+ });
2240
+ }
2241
+ get resizeCurrentWidthPx() {
2242
+ return this.getCurrentWidthPx();
2243
+ }
2244
+ onWindowResize() {
2245
+ const viewportWidth = resolveSidePanelViewportWidth();
2246
+ if (this.isExpanded) {
2247
+ const expandedPx = resolveExpandedSidePanelWidthPx(viewportWidth, {
2248
+ maxWidth: this.maxWidth,
2249
+ });
2250
+ const nextWidth = `${expandedPx}px`;
2251
+ if (nextWidth !== this.width) {
2252
+ this.width = nextWidth;
2253
+ this.onResizeWidth?.(nextWidth, { persist: false });
2254
+ }
2255
+ this.cdr.markForCheck();
2256
+ return;
2257
+ }
2258
+ const parsedWidth = parseSidePanelWidthPx(this.width, viewportWidth);
2259
+ if (parsedWidth !== null) {
2260
+ const clamped = this.clampWidthPx(parsedWidth, viewportWidth);
2261
+ const nextWidth = `${clamped}px`;
2262
+ if (parsedWidth > clamped && nextWidth !== this.width) {
2263
+ this.width = nextWidth;
2264
+ this.onResizeWidth?.(nextWidth, { persist: false });
2265
+ }
2266
+ }
2267
+ this.cdr.markForCheck();
1396
2268
  }
1397
2269
  setTitle(title) {
1398
2270
  this.title = title;
1399
2271
  this.cdr.markForCheck();
1400
2272
  }
1401
- onResizeHandlePointerDown(event) {
1402
- if (!this.showResizeHandle || event.button !== 0) {
2273
+ setExpanded(expanded) {
2274
+ if (!this.expandable || expanded === this.isExpanded) {
1403
2275
  return;
1404
2276
  }
1405
- const currentWidth = this.parseWidthPx(this.width);
1406
- if (currentWidth === null) {
2277
+ const viewportWidth = resolveSidePanelViewportWidth();
2278
+ if (expanded) {
2279
+ const currentWidth = this.getCurrentWidthPx(viewportWidth);
2280
+ if (!canExpandSidePanel(currentWidth, viewportWidth, {
2281
+ maxWidth: this.maxWidth,
2282
+ })) {
2283
+ return;
2284
+ }
2285
+ this.collapsedWidthBeforeExpand =
2286
+ this.width ?? resolveSidePanelPresetWidth(this.widthPreset);
2287
+ const expandedPx = resolveExpandedSidePanelWidthPx(viewportWidth, {
2288
+ maxWidth: this.maxWidth,
2289
+ });
2290
+ const nextWidth = `${expandedPx}px`;
2291
+ this.isExpanded = true;
2292
+ this.width = nextWidth;
2293
+ this.onResizeWidth?.(nextWidth, { persist: false });
2294
+ this.cdr.markForCheck();
1407
2295
  return;
1408
2296
  }
2297
+ const rawRestoreWidth = this.collapsedWidthBeforeExpand ??
2298
+ resolveSidePanelPresetWidth(this.widthPreset);
2299
+ const parsedRestore = parseSidePanelWidthPx(rawRestoreWidth, viewportWidth);
2300
+ const clampedRestore = parsedRestore !== null
2301
+ ? this.clampWidthPx(parsedRestore, viewportWidth)
2302
+ : null;
2303
+ const restoreWidth = parsedRestore !== null &&
2304
+ clampedRestore !== null &&
2305
+ parsedRestore > clampedRestore
2306
+ ? `${clampedRestore}px`
2307
+ : rawRestoreWidth;
2308
+ this.collapsedWidthBeforeExpand = null;
2309
+ this.isExpanded = false;
2310
+ this.width = restoreWidth;
2311
+ this.onResizeWidth?.(restoreWidth, { persist: false });
2312
+ this.cdr.markForCheck();
2313
+ }
2314
+ shouldSuppressBackdropClose() {
2315
+ if (this.isResizing) {
2316
+ return true;
2317
+ }
2318
+ if (this.suppressNextBackdropClick) {
2319
+ this.suppressNextBackdropClick = false;
2320
+ return true;
2321
+ }
2322
+ return false;
2323
+ }
2324
+ toggleExpanded() {
2325
+ this.setExpanded(!this.isExpanded);
2326
+ }
2327
+ onResizeHandlePointerDown(event) {
2328
+ if (!this.showResizeHandle || event.button !== 0) {
2329
+ return;
2330
+ }
2331
+ const viewportWidth = resolveSidePanelViewportWidth();
2332
+ const currentWidth = this.promoteExpandedBeforeManualResize(viewportWidth);
2333
+ this.isResizing = true;
1409
2334
  this.activePointerId = event.pointerId;
1410
2335
  this.dragStartX = event.clientX;
1411
2336
  this.dragStartWidth = currentWidth;
@@ -1414,36 +2339,64 @@ class BaseSidePanelComponent {
1414
2339
  target?.setPointerCapture(event.pointerId);
1415
2340
  }
1416
2341
  catch { }
2342
+ this.cdr.markForCheck();
2343
+ event.preventDefault();
2344
+ }
2345
+ onResizeHandleDoubleClick(event) {
2346
+ if (!this.showResizeHandle) {
2347
+ return;
2348
+ }
1417
2349
  event.preventDefault();
2350
+ if (this.isExpanded) {
2351
+ this.setExpanded(false);
2352
+ return;
2353
+ }
2354
+ const viewportWidth = resolveSidePanelViewportWidth();
2355
+ const currentWidth = this.getCurrentWidthPx(viewportWidth);
2356
+ const targetWidth = currentWidth < 840 ? 960 : 720;
2357
+ this.applyWidthPx(targetWidth, viewportWidth);
1418
2358
  }
1419
2359
  onResizeHandleKeydown(event) {
1420
2360
  if (!this.showResizeHandle) {
1421
2361
  return;
1422
2362
  }
1423
- const step = event.shiftKey ? 48 : 24;
2363
+ const viewportWidth = resolveSidePanelViewportWidth();
2364
+ const step = event.shiftKey ? 80 : 40;
1424
2365
  switch (event.key) {
1425
- case 'ArrowLeft':
1426
- this.applyWidthPx(this.getCurrentWidthPx() + step);
2366
+ case 'ArrowLeft': {
2367
+ const currentWidth = this.promoteExpandedBeforeManualResize(viewportWidth);
2368
+ this.applyWidthPx(currentWidth + step, viewportWidth);
1427
2369
  event.preventDefault();
1428
2370
  return;
1429
- case 'ArrowRight':
1430
- this.applyWidthPx(this.getCurrentWidthPx() - step);
2371
+ }
2372
+ case 'ArrowRight': {
2373
+ const currentWidth = this.promoteExpandedBeforeManualResize(viewportWidth);
2374
+ this.applyWidthPx(currentWidth - step, viewportWidth);
1431
2375
  event.preventDefault();
1432
2376
  return;
2377
+ }
1433
2378
  case 'Home': {
1434
- const min = this.parseWidthPx(this.minWidth);
1435
- if (min !== null) {
1436
- this.applyWidthPx(min);
1437
- event.preventDefault();
1438
- }
2379
+ this.promoteExpandedBeforeManualResize(viewportWidth);
2380
+ const minPx = clampSidePanelWidthPx(0, {
2381
+ minWidth: this.minWidth,
2382
+ maxWidth: this.maxWidth,
2383
+ defaultMinPx: 320,
2384
+ viewportWidth,
2385
+ });
2386
+ this.applyWidthPx(minPx, viewportWidth);
2387
+ event.preventDefault();
1439
2388
  return;
1440
2389
  }
1441
2390
  case 'End': {
1442
- const max = this.parseWidthPx(this.maxWidth);
1443
- if (max !== null) {
1444
- this.applyWidthPx(max);
1445
- event.preventDefault();
1446
- }
2391
+ this.promoteExpandedBeforeManualResize(viewportWidth);
2392
+ const maxPx = clampSidePanelWidthPx(viewportWidth, {
2393
+ minWidth: this.minWidth,
2394
+ maxWidth: this.maxWidth,
2395
+ defaultMinPx: 320,
2396
+ viewportWidth,
2397
+ });
2398
+ this.applyWidthPx(maxPx, viewportWidth);
2399
+ event.preventDefault();
1447
2400
  return;
1448
2401
  }
1449
2402
  default:
@@ -1461,7 +2414,7 @@ class BaseSidePanelComponent {
1461
2414
  if (event.pointerId !== this.activePointerId) {
1462
2415
  return;
1463
2416
  }
1464
- this.stopResizeSession();
2417
+ this.stopResizeSession(true);
1465
2418
  }
1466
2419
  attachContent(component, injector, inputs) {
1467
2420
  this.contentRef = this.contentHost.createComponent(component, { injector });
@@ -1509,39 +2462,60 @@ class BaseSidePanelComponent {
1509
2462
  }
1510
2463
  return new Set(Object.keys(declaredInputs));
1511
2464
  }
1512
- stopResizeSession() {
1513
- this.activePointerId = null;
2465
+ stopResizeSession(suppressBackdropClick = false) {
2466
+ if (this.activePointerId !== null || this.isResizing) {
2467
+ this.activePointerId = null;
2468
+ this.isResizing = false;
2469
+ if (suppressBackdropClick) {
2470
+ this.suppressNextBackdropClick = true;
2471
+ if (this.backdropSuppressTimer !== null) {
2472
+ clearTimeout(this.backdropSuppressTimer);
2473
+ }
2474
+ this.backdropSuppressTimer = setTimeout(() => {
2475
+ this.backdropSuppressTimer = null;
2476
+ this.suppressNextBackdropClick = false;
2477
+ }, 0);
2478
+ }
2479
+ this.cdr.markForCheck();
2480
+ }
1514
2481
  }
1515
- getCurrentWidthPx() {
1516
- return this.parseWidthPx(this.width) ?? 720;
2482
+ promoteExpandedBeforeManualResize(viewportWidth = resolveSidePanelViewportWidth()) {
2483
+ const currentWidth = this.getCurrentWidthPx(viewportWidth);
2484
+ if (this.isExpanded) {
2485
+ this.isExpanded = false;
2486
+ this.collapsedWidthBeforeExpand = null;
2487
+ this.width = `${currentWidth}px`;
2488
+ this.cdr.markForCheck();
2489
+ }
2490
+ return currentWidth;
1517
2491
  }
1518
- applyWidthPx(value) {
1519
- const clampedWidth = this.clampWidthPx(value);
2492
+ getCurrentWidthPx(viewportWidth = resolveSidePanelViewportWidth()) {
2493
+ const parsed = this.parseWidthPx(this.width, viewportWidth);
2494
+ if (parsed !== null) {
2495
+ return Math.round(parsed);
2496
+ }
2497
+ return Math.round(resolveSidePanelPresetWidthPx(this.widthPreset, viewportWidth));
2498
+ }
2499
+ applyWidthPx(value, viewportWidth = resolveSidePanelViewportWidth()) {
2500
+ const clampedWidth = this.clampWidthPx(value, viewportWidth);
1520
2501
  const width = `${clampedWidth}px`;
1521
2502
  this.width = width;
1522
- this.onResizeWidth?.(width);
2503
+ this.onResizeWidth?.(width, { persist: true });
1523
2504
  this.cdr.markForCheck();
1524
2505
  }
1525
- clampWidthPx(value) {
1526
- const viewportMax = typeof window !== 'undefined' ? window.innerWidth : value;
1527
- const fallbackMin = 320;
1528
- const min = this.parseWidthPx(this.minWidth) ?? fallbackMin;
1529
- const max = Math.min(this.parseWidthPx(this.maxWidth) ?? viewportMax, viewportMax);
1530
- return Math.min(Math.max(Math.round(value), min), Math.max(min, max));
2506
+ clampWidthPx(value, viewportWidth = resolveSidePanelViewportWidth()) {
2507
+ return clampSidePanelWidthPx(value, {
2508
+ minWidth: this.minWidth,
2509
+ maxWidth: this.maxWidth,
2510
+ defaultMinPx: 320,
2511
+ viewportWidth,
2512
+ });
1531
2513
  }
1532
- parseWidthPx(value) {
1533
- if (!value) {
1534
- return null;
1535
- }
1536
- const normalized = value.trim().toLowerCase();
1537
- if (!normalized.endsWith('px')) {
1538
- return null;
1539
- }
1540
- const parsed = Number.parseFloat(normalized.slice(0, -2));
1541
- return Number.isFinite(parsed) ? parsed : null;
2514
+ parseWidthPx(value, viewportWidth = resolveSidePanelViewportWidth()) {
2515
+ return parseSidePanelWidthPx(value, viewportWidth);
1542
2516
  }
1543
2517
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: BaseSidePanelComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$2.PraxisI18nService }], target: i0.ɵɵFactoryTarget.Component });
1544
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: BaseSidePanelComponent, isStandalone: true, selector: "praxis-base-side-panel", host: { listeners: { "document:pointermove": "onDocumentPointerMove($event)", "document:pointerup": "onDocumentPointerEnd($event)", "document:pointercancel": "onDocumentPointerEnd($event)" } }, viewQueries: [{ propertyName: "contentHost", first: true, predicate: ["contentHost"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "footerHost", first: true, predicate: ["footerHost"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<div\n class=\"pfx-base-side-panel\"\n [class.has-header]=\"hasHeader\"\n [class.has-footer]=\"hasFooter\"\n [class.width-narrow]=\"widthClass === 'width-narrow'\"\n [class.width-default]=\"widthClass === 'width-default'\"\n [class.width-wide]=\"widthClass === 'width-wide'\"\n [class.width-full]=\"widthClass === 'width-full'\"\n [class.use-host-width]=\"useHostWidth\"\n [class.is-resizable]=\"showResizeHandle\"\n [ngClass]=\"hostClasses\"\n [ngStyle]=\"mergedHostStyles\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"hasHeader ? titleId : null\"\n cdkTrapFocus\n cdkTrapFocusAutoCapture\n>\n @if (showResizeHandle) {\n <div\n class=\"pfx-base-side-panel__resize-handle\"\n role=\"separator\"\n tabindex=\"0\"\n aria-orientation=\"vertical\"\n [attr.aria-label]=\"resizeHandleLabel\"\n (pointerdown)=\"onResizeHandlePointerDown($event)\"\n (keydown)=\"onResizeHandleKeydown($event)\"\n ></div>\n }\n @if (hasHeader) {\n <header class=\"pfx-base-side-panel__header\">\n <div class=\"pfx-base-side-panel__title-block\">\n @if (titleIcon) {\n <mat-icon class=\"pfx-base-side-panel__title-icon\" [praxisIcon]=\"titleIcon\"></mat-icon>\n }\n <div class=\"pfx-base-side-panel__copy\">\n @if (title) {\n <h2 class=\"pfx-base-side-panel__title\" [id]=\"titleId\">{{ title }}</h2>\n }\n @if (subtitle) {\n <p class=\"pfx-base-side-panel__subtitle\">{{ subtitle }}</p>\n }\n </div>\n </div>\n <button\n praxisIconButton=\"close\"\n size=\"compact\"\n type=\"button\"\n class=\"pfx-base-side-panel__close\"\n [attr.aria-label]=\"closeLabel\"\n [matTooltip]=\"closeLabel\"\n (click)=\"onClose?.()\"\n ></button>\n </header>\n }\n\n <section class=\"pfx-base-side-panel__body\">\n <ng-template #contentHost></ng-template>\n </section>\n\n <footer class=\"pfx-base-side-panel__footer\" [hidden]=\"!hasFooter\">\n <ng-template #footerHost></ng-template>\n </footer>\n</div>\n", styles: [":host{display:block;height:100%;width:100%;min-width:0;flex:1 1 auto}.pfx-base-side-panel{position:relative;display:grid;grid-template-rows:auto 1fr auto;height:100%;min-width:0;max-width:100%;overflow:hidden;background:var(--md-sys-color-surface-container, #fff);color:var(--md-sys-color-on-surface, #111);border-left:1px solid var(--md-sys-color-outline-variant, rgba(0, 0, 0, .12));border-radius:var(--pfx-side-panel-border-radius, 0);box-shadow:var(--pfx-side-panel-elevation, var(--md-sys-elevation-level2, 0 8px 24px rgba(0, 0, 0, .16)));width:min(var(--pfx-side-panel-width, 720px),100%)}.pfx-base-side-panel__resize-handle{position:absolute;inset:0 auto 0 0;width:12px;cursor:col-resize;touch-action:none;z-index:2;outline:none}.pfx-base-side-panel__resize-handle:before{content:\"\";position:absolute;inset:0 auto 0 4px;width:2px;background:transparent;transition:background-color var(--pfx-side-panel-motion-duration, .16s) ease,opacity var(--pfx-side-panel-motion-duration, .16s) ease;opacity:0}.pfx-base-side-panel.is-resizable:hover .pfx-base-side-panel__resize-handle:before,.pfx-base-side-panel__resize-handle:focus-visible:before{opacity:1;background:var(--md-sys-color-outline, rgba(0, 0, 0, .24))}.pfx-base-side-panel.use-host-width{width:100%;max-width:100%}.pfx-base-side-panel.width-narrow{width:min(var(--pfx-side-panel-width, 420px),100%)}.pfx-base-side-panel.width-default{width:min(var(--pfx-side-panel-width, 720px),100%)}.pfx-base-side-panel.width-wide{width:min(var(--pfx-side-panel-width, 960px),100%)}.pfx-base-side-panel.width-full{width:min(100vw,var(--pfx-side-panel-max-width, 100vw))}.pfx-base-side-panel__header{display:flex;align-items:center;gap:var(--pfx-side-panel-header-gap, 8px);min-height:var(--pfx-side-panel-header-height, 64px);padding:0 var(--pfx-side-panel-header-padding-x, 16px);border-bottom:1px solid var(--md-sys-color-outline-variant, rgba(0, 0, 0, .12));background:var(--md-sys-color-surface-container-high, #f7f7f7)}.pfx-base-side-panel__title-block{display:flex;align-items:flex-start;gap:10px;min-width:0;flex:1 1 auto}.pfx-base-side-panel__title-icon{color:var(--md-sys-color-primary, currentColor)}.pfx-base-side-panel__copy{min-width:0}.pfx-base-side-panel__title,.pfx-base-side-panel__subtitle{margin:0}.pfx-base-side-panel__title{font-size:1rem;font-weight:600}.pfx-base-side-panel__subtitle{margin-top:4px;color:var(--md-sys-color-on-surface-variant, rgba(0, 0, 0, .64));font-size:.875rem}.pfx-base-side-panel__body{min-height:0;overflow:auto;padding:var(--pfx-side-panel-body-padding, 16px);background:var(--md-sys-color-surface, #fff)}.pfx-base-side-panel__footer{border-top:1px solid var(--md-sys-color-outline-variant, rgba(0, 0, 0, .12));background:var(--md-sys-color-surface-container-high, #f7f7f7);padding:var(--pfx-side-panel-footer-padding, 12px 16px)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: PraxisIconButtonComponent, selector: "button[praxisIconButton]", inputs: ["praxisIconButton", "size", "appearance", "presentation", "pressed", "busy"] }, { kind: "directive", type: PraxisIconDirective, selector: "mat-icon[praxisIcon]", inputs: ["praxisIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2518
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: BaseSidePanelComponent, isStandalone: true, selector: "praxis-base-side-panel", host: { listeners: { "window:resize": "onWindowResize()", "document:pointermove": "onDocumentPointerMove($event)", "document:pointerup": "onDocumentPointerEnd($event)", "document:pointercancel": "onDocumentPointerEnd($event)" } }, viewQueries: [{ propertyName: "contentHost", first: true, predicate: ["contentHost"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "footerHost", first: true, predicate: ["footerHost"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<div\n class=\"pfx-base-side-panel\"\n [class.has-header]=\"hasHeader\"\n [class.has-footer]=\"hasFooter\"\n [class.width-narrow]=\"widthClass === 'width-narrow'\"\n [class.width-default]=\"widthClass === 'width-default'\"\n [class.width-wide]=\"widthClass === 'width-wide'\"\n [class.width-full]=\"widthClass === 'width-full'\"\n [class.use-host-width]=\"tracksHostWidth\"\n [class.is-resizable]=\"showResizeHandle\"\n [class.is-expandable]=\"expandable\"\n [class.is-expanded]=\"isExpanded\"\n [class.is-resizing]=\"isResizing\"\n [ngClass]=\"hostClasses\"\n [ngStyle]=\"mergedHostStyles\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"hasHeader ? titleId : null\"\n cdkTrapFocus\n cdkTrapFocusAutoCapture\n>\n @if (showResizeHandle) {\n <div\n class=\"pfx-base-side-panel__resize-handle\"\n role=\"separator\"\n tabindex=\"0\"\n aria-orientation=\"vertical\"\n [attr.aria-label]=\"resizeHandleLabel\"\n [attr.aria-valuemin]=\"resizeMinWidthPx\"\n [attr.aria-valuemax]=\"resizeMaxWidthPx\"\n [attr.aria-valuenow]=\"resizeCurrentWidthPx\"\n (pointerdown)=\"onResizeHandlePointerDown($event)\"\n (dblclick)=\"onResizeHandleDoubleClick($event)\"\n (keydown)=\"onResizeHandleKeydown($event)\"\n ></div>\n }\n @if (hasHeader) {\n <header class=\"pfx-base-side-panel__header\">\n <div class=\"pfx-base-side-panel__title-block\">\n @if (titleIcon) {\n <mat-icon class=\"pfx-base-side-panel__title-icon\" [praxisIcon]=\"titleIcon\"></mat-icon>\n }\n <div class=\"pfx-base-side-panel__copy\">\n @if (title) {\n <h2 class=\"pfx-base-side-panel__title\" [id]=\"titleId\">{{ title }}</h2>\n }\n @if (subtitle) {\n <p class=\"pfx-base-side-panel__subtitle\">{{ subtitle }}</p>\n }\n </div>\n </div>\n <div class=\"pfx-base-side-panel__actions\">\n @if (showExpandButton) {\n <button\n [praxisIconButton]=\"isExpanded ? 'close_fullscreen' : 'open_in_full'\"\n size=\"compact\"\n type=\"button\"\n class=\"pfx-base-side-panel__expand\"\n [attr.aria-label]=\"expandLabel\"\n [pressed]=\"isExpanded\"\n [matTooltip]=\"expandLabel\"\n (click)=\"toggleExpanded()\"\n ></button>\n }\n <button\n praxisIconButton=\"close\"\n size=\"compact\"\n type=\"button\"\n class=\"pfx-base-side-panel__close\"\n [attr.aria-label]=\"closeLabel\"\n [matTooltip]=\"closeLabel\"\n (click)=\"onClose?.()\"\n ></button>\n </div>\n </header>\n }\n\n <section class=\"pfx-base-side-panel__body\">\n <ng-template #contentHost></ng-template>\n </section>\n\n <footer class=\"pfx-base-side-panel__footer\" [hidden]=\"!hasFooter\">\n <ng-template #footerHost></ng-template>\n </footer>\n</div>\n", styles: [":host{display:block;height:100%;width:100%;min-width:0;flex:1 1 auto}.pfx-base-side-panel{position:relative;display:grid;grid-template-rows:auto 1fr auto;height:100%;min-width:0;max-width:100%;overflow:hidden;background:var(--md-sys-color-surface-container, #fff);color:var(--md-sys-color-on-surface, #111);border-left:1px solid var(--md-sys-color-outline-variant, rgba(0, 0, 0, .12));border-radius:var(--pfx-side-panel-border-radius, 0);box-shadow:var(--pfx-side-panel-elevation, var(--md-sys-elevation-level2, 0 8px 24px rgba(0, 0, 0, .16)));width:min(var(--pfx-side-panel-width, 720px),100%)}.pfx-base-side-panel__resize-handle{position:absolute;inset:0 auto 0 0;width:12px;cursor:col-resize;touch-action:none;z-index:2;outline:none}.pfx-base-side-panel__resize-handle:before{content:\"\";position:absolute;inset:0 auto 0 4px;width:2px;background:transparent;transition:background-color var(--pfx-side-panel-motion-duration, .16s) ease,opacity var(--pfx-side-panel-motion-duration, .16s) ease;opacity:0}.pfx-base-side-panel.is-resizable:hover .pfx-base-side-panel__resize-handle:before,.pfx-base-side-panel__resize-handle:focus-visible:before{opacity:1;background:var(--md-sys-color-outline, rgba(0, 0, 0, .24))}.pfx-base-side-panel.use-host-width,.pfx-base-side-panel.is-expanded{width:100%;max-width:100%}.pfx-base-side-panel.is-resizing{-webkit-user-select:none;user-select:none}.pfx-base-side-panel__actions{display:flex;align-items:center;gap:6px;flex:0 0 auto}.pfx-base-side-panel.width-narrow{width:min(var(--pfx-side-panel-width, 420px),100%)}.pfx-base-side-panel.width-default{width:min(var(--pfx-side-panel-width, 720px),100%)}.pfx-base-side-panel.width-wide{width:min(var(--pfx-side-panel-width, 960px),100%)}.pfx-base-side-panel.width-full{width:min(100vw,var(--pfx-side-panel-max-width, 100vw))}.pfx-base-side-panel__header{display:flex;align-items:center;gap:var(--pfx-side-panel-header-gap, 8px);min-height:var(--pfx-side-panel-header-height, 64px);padding:0 var(--pfx-side-panel-header-padding-x, 16px);border-bottom:1px solid var(--md-sys-color-outline-variant, rgba(0, 0, 0, .12));background:var(--md-sys-color-surface-container-high, #f7f7f7)}.pfx-base-side-panel__title-block{display:flex;align-items:flex-start;gap:10px;min-width:0;flex:1 1 auto}.pfx-base-side-panel__title-icon{color:var(--md-sys-color-primary, currentColor)}.pfx-base-side-panel__copy{min-width:0}.pfx-base-side-panel__title,.pfx-base-side-panel__subtitle{margin:0}.pfx-base-side-panel__title{font-size:1rem;font-weight:600}.pfx-base-side-panel__subtitle{margin-top:4px;color:var(--md-sys-color-on-surface-variant, rgba(0, 0, 0, .64));font-size:.875rem}.pfx-base-side-panel__body{min-height:0;overflow:auto;padding:var(--pfx-side-panel-body-padding, 16px);background:var(--md-sys-color-surface, #fff)}.pfx-base-side-panel__footer{border-top:1px solid var(--md-sys-color-outline-variant, rgba(0, 0, 0, .12));background:var(--md-sys-color-surface-container-high, #f7f7f7);padding:var(--pfx-side-panel-footer-padding, 12px 16px)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: PraxisIconButtonComponent, selector: "button[praxisIconButton]", inputs: ["praxisIconButton", "size", "appearance", "presentation", "pressed", "busy"] }, { kind: "directive", type: PraxisIconDirective, selector: "mat-icon[praxisIcon]", inputs: ["praxisIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1545
2519
  }
1546
2520
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: BaseSidePanelComponent, decorators: [{
1547
2521
  type: Component,
@@ -1554,13 +2528,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
1554
2528
  CdkTrapFocus,
1555
2529
  PraxisIconButtonComponent,
1556
2530
  PraxisIconDirective,
1557
- ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"pfx-base-side-panel\"\n [class.has-header]=\"hasHeader\"\n [class.has-footer]=\"hasFooter\"\n [class.width-narrow]=\"widthClass === 'width-narrow'\"\n [class.width-default]=\"widthClass === 'width-default'\"\n [class.width-wide]=\"widthClass === 'width-wide'\"\n [class.width-full]=\"widthClass === 'width-full'\"\n [class.use-host-width]=\"useHostWidth\"\n [class.is-resizable]=\"showResizeHandle\"\n [ngClass]=\"hostClasses\"\n [ngStyle]=\"mergedHostStyles\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"hasHeader ? titleId : null\"\n cdkTrapFocus\n cdkTrapFocusAutoCapture\n>\n @if (showResizeHandle) {\n <div\n class=\"pfx-base-side-panel__resize-handle\"\n role=\"separator\"\n tabindex=\"0\"\n aria-orientation=\"vertical\"\n [attr.aria-label]=\"resizeHandleLabel\"\n (pointerdown)=\"onResizeHandlePointerDown($event)\"\n (keydown)=\"onResizeHandleKeydown($event)\"\n ></div>\n }\n @if (hasHeader) {\n <header class=\"pfx-base-side-panel__header\">\n <div class=\"pfx-base-side-panel__title-block\">\n @if (titleIcon) {\n <mat-icon class=\"pfx-base-side-panel__title-icon\" [praxisIcon]=\"titleIcon\"></mat-icon>\n }\n <div class=\"pfx-base-side-panel__copy\">\n @if (title) {\n <h2 class=\"pfx-base-side-panel__title\" [id]=\"titleId\">{{ title }}</h2>\n }\n @if (subtitle) {\n <p class=\"pfx-base-side-panel__subtitle\">{{ subtitle }}</p>\n }\n </div>\n </div>\n <button\n praxisIconButton=\"close\"\n size=\"compact\"\n type=\"button\"\n class=\"pfx-base-side-panel__close\"\n [attr.aria-label]=\"closeLabel\"\n [matTooltip]=\"closeLabel\"\n (click)=\"onClose?.()\"\n ></button>\n </header>\n }\n\n <section class=\"pfx-base-side-panel__body\">\n <ng-template #contentHost></ng-template>\n </section>\n\n <footer class=\"pfx-base-side-panel__footer\" [hidden]=\"!hasFooter\">\n <ng-template #footerHost></ng-template>\n </footer>\n</div>\n", styles: [":host{display:block;height:100%;width:100%;min-width:0;flex:1 1 auto}.pfx-base-side-panel{position:relative;display:grid;grid-template-rows:auto 1fr auto;height:100%;min-width:0;max-width:100%;overflow:hidden;background:var(--md-sys-color-surface-container, #fff);color:var(--md-sys-color-on-surface, #111);border-left:1px solid var(--md-sys-color-outline-variant, rgba(0, 0, 0, .12));border-radius:var(--pfx-side-panel-border-radius, 0);box-shadow:var(--pfx-side-panel-elevation, var(--md-sys-elevation-level2, 0 8px 24px rgba(0, 0, 0, .16)));width:min(var(--pfx-side-panel-width, 720px),100%)}.pfx-base-side-panel__resize-handle{position:absolute;inset:0 auto 0 0;width:12px;cursor:col-resize;touch-action:none;z-index:2;outline:none}.pfx-base-side-panel__resize-handle:before{content:\"\";position:absolute;inset:0 auto 0 4px;width:2px;background:transparent;transition:background-color var(--pfx-side-panel-motion-duration, .16s) ease,opacity var(--pfx-side-panel-motion-duration, .16s) ease;opacity:0}.pfx-base-side-panel.is-resizable:hover .pfx-base-side-panel__resize-handle:before,.pfx-base-side-panel__resize-handle:focus-visible:before{opacity:1;background:var(--md-sys-color-outline, rgba(0, 0, 0, .24))}.pfx-base-side-panel.use-host-width{width:100%;max-width:100%}.pfx-base-side-panel.width-narrow{width:min(var(--pfx-side-panel-width, 420px),100%)}.pfx-base-side-panel.width-default{width:min(var(--pfx-side-panel-width, 720px),100%)}.pfx-base-side-panel.width-wide{width:min(var(--pfx-side-panel-width, 960px),100%)}.pfx-base-side-panel.width-full{width:min(100vw,var(--pfx-side-panel-max-width, 100vw))}.pfx-base-side-panel__header{display:flex;align-items:center;gap:var(--pfx-side-panel-header-gap, 8px);min-height:var(--pfx-side-panel-header-height, 64px);padding:0 var(--pfx-side-panel-header-padding-x, 16px);border-bottom:1px solid var(--md-sys-color-outline-variant, rgba(0, 0, 0, .12));background:var(--md-sys-color-surface-container-high, #f7f7f7)}.pfx-base-side-panel__title-block{display:flex;align-items:flex-start;gap:10px;min-width:0;flex:1 1 auto}.pfx-base-side-panel__title-icon{color:var(--md-sys-color-primary, currentColor)}.pfx-base-side-panel__copy{min-width:0}.pfx-base-side-panel__title,.pfx-base-side-panel__subtitle{margin:0}.pfx-base-side-panel__title{font-size:1rem;font-weight:600}.pfx-base-side-panel__subtitle{margin-top:4px;color:var(--md-sys-color-on-surface-variant, rgba(0, 0, 0, .64));font-size:.875rem}.pfx-base-side-panel__body{min-height:0;overflow:auto;padding:var(--pfx-side-panel-body-padding, 16px);background:var(--md-sys-color-surface, #fff)}.pfx-base-side-panel__footer{border-top:1px solid var(--md-sys-color-outline-variant, rgba(0, 0, 0, .12));background:var(--md-sys-color-surface-container-high, #f7f7f7);padding:var(--pfx-side-panel-footer-padding, 12px 16px)}\n"] }]
2531
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"pfx-base-side-panel\"\n [class.has-header]=\"hasHeader\"\n [class.has-footer]=\"hasFooter\"\n [class.width-narrow]=\"widthClass === 'width-narrow'\"\n [class.width-default]=\"widthClass === 'width-default'\"\n [class.width-wide]=\"widthClass === 'width-wide'\"\n [class.width-full]=\"widthClass === 'width-full'\"\n [class.use-host-width]=\"tracksHostWidth\"\n [class.is-resizable]=\"showResizeHandle\"\n [class.is-expandable]=\"expandable\"\n [class.is-expanded]=\"isExpanded\"\n [class.is-resizing]=\"isResizing\"\n [ngClass]=\"hostClasses\"\n [ngStyle]=\"mergedHostStyles\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"hasHeader ? titleId : null\"\n cdkTrapFocus\n cdkTrapFocusAutoCapture\n>\n @if (showResizeHandle) {\n <div\n class=\"pfx-base-side-panel__resize-handle\"\n role=\"separator\"\n tabindex=\"0\"\n aria-orientation=\"vertical\"\n [attr.aria-label]=\"resizeHandleLabel\"\n [attr.aria-valuemin]=\"resizeMinWidthPx\"\n [attr.aria-valuemax]=\"resizeMaxWidthPx\"\n [attr.aria-valuenow]=\"resizeCurrentWidthPx\"\n (pointerdown)=\"onResizeHandlePointerDown($event)\"\n (dblclick)=\"onResizeHandleDoubleClick($event)\"\n (keydown)=\"onResizeHandleKeydown($event)\"\n ></div>\n }\n @if (hasHeader) {\n <header class=\"pfx-base-side-panel__header\">\n <div class=\"pfx-base-side-panel__title-block\">\n @if (titleIcon) {\n <mat-icon class=\"pfx-base-side-panel__title-icon\" [praxisIcon]=\"titleIcon\"></mat-icon>\n }\n <div class=\"pfx-base-side-panel__copy\">\n @if (title) {\n <h2 class=\"pfx-base-side-panel__title\" [id]=\"titleId\">{{ title }}</h2>\n }\n @if (subtitle) {\n <p class=\"pfx-base-side-panel__subtitle\">{{ subtitle }}</p>\n }\n </div>\n </div>\n <div class=\"pfx-base-side-panel__actions\">\n @if (showExpandButton) {\n <button\n [praxisIconButton]=\"isExpanded ? 'close_fullscreen' : 'open_in_full'\"\n size=\"compact\"\n type=\"button\"\n class=\"pfx-base-side-panel__expand\"\n [attr.aria-label]=\"expandLabel\"\n [pressed]=\"isExpanded\"\n [matTooltip]=\"expandLabel\"\n (click)=\"toggleExpanded()\"\n ></button>\n }\n <button\n praxisIconButton=\"close\"\n size=\"compact\"\n type=\"button\"\n class=\"pfx-base-side-panel__close\"\n [attr.aria-label]=\"closeLabel\"\n [matTooltip]=\"closeLabel\"\n (click)=\"onClose?.()\"\n ></button>\n </div>\n </header>\n }\n\n <section class=\"pfx-base-side-panel__body\">\n <ng-template #contentHost></ng-template>\n </section>\n\n <footer class=\"pfx-base-side-panel__footer\" [hidden]=\"!hasFooter\">\n <ng-template #footerHost></ng-template>\n </footer>\n</div>\n", styles: [":host{display:block;height:100%;width:100%;min-width:0;flex:1 1 auto}.pfx-base-side-panel{position:relative;display:grid;grid-template-rows:auto 1fr auto;height:100%;min-width:0;max-width:100%;overflow:hidden;background:var(--md-sys-color-surface-container, #fff);color:var(--md-sys-color-on-surface, #111);border-left:1px solid var(--md-sys-color-outline-variant, rgba(0, 0, 0, .12));border-radius:var(--pfx-side-panel-border-radius, 0);box-shadow:var(--pfx-side-panel-elevation, var(--md-sys-elevation-level2, 0 8px 24px rgba(0, 0, 0, .16)));width:min(var(--pfx-side-panel-width, 720px),100%)}.pfx-base-side-panel__resize-handle{position:absolute;inset:0 auto 0 0;width:12px;cursor:col-resize;touch-action:none;z-index:2;outline:none}.pfx-base-side-panel__resize-handle:before{content:\"\";position:absolute;inset:0 auto 0 4px;width:2px;background:transparent;transition:background-color var(--pfx-side-panel-motion-duration, .16s) ease,opacity var(--pfx-side-panel-motion-duration, .16s) ease;opacity:0}.pfx-base-side-panel.is-resizable:hover .pfx-base-side-panel__resize-handle:before,.pfx-base-side-panel__resize-handle:focus-visible:before{opacity:1;background:var(--md-sys-color-outline, rgba(0, 0, 0, .24))}.pfx-base-side-panel.use-host-width,.pfx-base-side-panel.is-expanded{width:100%;max-width:100%}.pfx-base-side-panel.is-resizing{-webkit-user-select:none;user-select:none}.pfx-base-side-panel__actions{display:flex;align-items:center;gap:6px;flex:0 0 auto}.pfx-base-side-panel.width-narrow{width:min(var(--pfx-side-panel-width, 420px),100%)}.pfx-base-side-panel.width-default{width:min(var(--pfx-side-panel-width, 720px),100%)}.pfx-base-side-panel.width-wide{width:min(var(--pfx-side-panel-width, 960px),100%)}.pfx-base-side-panel.width-full{width:min(100vw,var(--pfx-side-panel-max-width, 100vw))}.pfx-base-side-panel__header{display:flex;align-items:center;gap:var(--pfx-side-panel-header-gap, 8px);min-height:var(--pfx-side-panel-header-height, 64px);padding:0 var(--pfx-side-panel-header-padding-x, 16px);border-bottom:1px solid var(--md-sys-color-outline-variant, rgba(0, 0, 0, .12));background:var(--md-sys-color-surface-container-high, #f7f7f7)}.pfx-base-side-panel__title-block{display:flex;align-items:flex-start;gap:10px;min-width:0;flex:1 1 auto}.pfx-base-side-panel__title-icon{color:var(--md-sys-color-primary, currentColor)}.pfx-base-side-panel__copy{min-width:0}.pfx-base-side-panel__title,.pfx-base-side-panel__subtitle{margin:0}.pfx-base-side-panel__title{font-size:1rem;font-weight:600}.pfx-base-side-panel__subtitle{margin-top:4px;color:var(--md-sys-color-on-surface-variant, rgba(0, 0, 0, .64));font-size:.875rem}.pfx-base-side-panel__body{min-height:0;overflow:auto;padding:var(--pfx-side-panel-body-padding, 16px);background:var(--md-sys-color-surface, #fff)}.pfx-base-side-panel__footer{border-top:1px solid var(--md-sys-color-outline-variant, rgba(0, 0, 0, .12));background:var(--md-sys-color-surface-container-high, #f7f7f7);padding:var(--pfx-side-panel-footer-padding, 12px 16px)}\n"] }]
1558
2532
  }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1$2.PraxisI18nService }], propDecorators: { contentHost: [{
1559
2533
  type: ViewChild,
1560
2534
  args: ['contentHost', { read: ViewContainerRef, static: true }]
1561
2535
  }], footerHost: [{
1562
2536
  type: ViewChild,
1563
2537
  args: ['footerHost', { read: ViewContainerRef, static: true }]
2538
+ }], onWindowResize: [{
2539
+ type: HostListener,
2540
+ args: ['window:resize']
1564
2541
  }], onDocumentPointerMove: [{
1565
2542
  type: HostListener,
1566
2543
  args: ['document:pointermove', ['$event']]
@@ -1579,6 +2556,7 @@ class BaseSidePanelOverlayRef {
1579
2556
  overlayRef;
1580
2557
  titleUpdater;
1581
2558
  sizePersistor;
2559
+ expandController;
1582
2560
  terminalOutcomeEmitted = false;
1583
2561
  closed$ = this.closedSubject.asObservable();
1584
2562
  result$ = this.resultSubject.asObservable();
@@ -1592,6 +2570,15 @@ class BaseSidePanelOverlayRef {
1592
2570
  bindSizePersistor(fn) {
1593
2571
  this.sizePersistor = fn;
1594
2572
  }
2573
+ bindExpandController(controller) {
2574
+ this.expandController = controller;
2575
+ }
2576
+ setExpanded(expanded) {
2577
+ this.expandController?.setExpanded(expanded);
2578
+ }
2579
+ toggleExpanded() {
2580
+ this.expandController?.toggleExpanded();
2581
+ }
1595
2582
  emitResult(result) {
1596
2583
  this.resultSubject.next(result);
1597
2584
  }
@@ -1606,7 +2593,7 @@ class BaseSidePanelOverlayRef {
1606
2593
  updateTitle(title) {
1607
2594
  this.titleUpdater?.(title);
1608
2595
  }
1609
- updateSize(size) {
2596
+ updateSize(size, options) {
1610
2597
  if (!this.overlayRef) {
1611
2598
  return;
1612
2599
  }
@@ -1617,7 +2604,9 @@ class BaseSidePanelOverlayRef {
1617
2604
  return;
1618
2605
  }
1619
2606
  this.overlayRef.updateSize({ width });
1620
- this.sizePersistor?.(width);
2607
+ if (options?.persist !== false) {
2608
+ this.sizePersistor?.(width);
2609
+ }
1621
2610
  this.sizeChangedSubject.next({ width });
1622
2611
  }
1623
2612
  close(result) {
@@ -1632,18 +2621,14 @@ class BaseSidePanelOverlayRef {
1632
2621
  this.sizeChangedSubject.complete();
1633
2622
  }
1634
2623
  resolveWidth(preset) {
1635
- switch (preset) {
1636
- case 'narrow':
1637
- return '420px';
1638
- case 'wide':
1639
- return '960px';
1640
- case 'full':
1641
- return '100vw';
1642
- case 'default':
1643
- return '720px';
1644
- default:
1645
- return preset;
2624
+ const trimmed = preset.trim();
2625
+ if (trimmed === 'narrow' ||
2626
+ trimmed === 'default' ||
2627
+ trimmed === 'wide' ||
2628
+ trimmed === 'full') {
2629
+ return resolveSidePanelPresetWidth(trimmed);
1646
2630
  }
2631
+ return trimmed;
1647
2632
  }
1648
2633
  }
1649
2634
 
@@ -1676,13 +2661,22 @@ class BaseSidePanelService {
1676
2661
  panelRef.instance.minWidth = resolvedConfig.minWidth;
1677
2662
  panelRef.instance.maxWidth = resolvedConfig.maxWidth;
1678
2663
  panelRef.instance.resizable = resolvedConfig.resizable ?? false;
2664
+ panelRef.instance.expandable = resolvedConfig.expandable ?? false;
1679
2665
  panelRef.instance.resizeAxis = resolvedConfig.resizeAxis ?? 'x';
1680
2666
  panelRef.instance.persistSizeKey = resolvedConfig.persistSizeKey;
1681
- panelRef.instance.useHostWidth = false;
2667
+ panelRef.instance.useHostWidth = !!(resolvedConfig.width ||
2668
+ resolvedConfig.minWidth ||
2669
+ resolvedConfig.maxWidth ||
2670
+ resolvedConfig.resizable ||
2671
+ resolvedConfig.expandable);
1682
2672
  panelRef.instance.theme = resolvedConfig.theme ?? null;
1683
2673
  panelRef.instance.onClose = () => ref.close(this.closeResult('close'));
1684
- panelRef.instance.onResizeWidth = (width) => ref.updateSize?.({ width });
2674
+ panelRef.instance.onResizeWidth = (width, resizeOptions) => ref.updateSize?.({ width }, resizeOptions);
1685
2675
  ref.bindTitleUpdater((title) => panelRef.instance.setTitle(title));
2676
+ ref.bindExpandController({
2677
+ setExpanded: (expanded) => panelRef.instance.setExpanded(expanded),
2678
+ toggleExpanded: () => panelRef.instance.toggleExpanded(),
2679
+ });
1686
2680
  const contentInjector = Injector.create({
1687
2681
  providers: [
1688
2682
  { provide: BASE_SIDE_PANEL_DATA, useValue: resolvedConfig.content.inputs },
@@ -1716,7 +2710,12 @@ class BaseSidePanelService {
1716
2710
  const panelRef = overlayRef.attach(new ComponentPortal(options.component));
1717
2711
  options.attach(panelRef, ref, resolvedConfig);
1718
2712
  if (options.config.closeOnBackdrop !== false) {
1719
- overlayRef.backdropClick().subscribe(() => options.onBackdrop(ref));
2713
+ overlayRef.backdropClick().subscribe(() => {
2714
+ if (panelRef.instance?.shouldSuppressBackdropClose?.()) {
2715
+ return;
2716
+ }
2717
+ options.onBackdrop(ref);
2718
+ });
1720
2719
  }
1721
2720
  // Keep this pane in CDK keyboard arbitration even when its content mediates
1722
2721
  // Escape. Otherwise CDK dispatches to an older menu during its exit animation.
@@ -1766,54 +2765,32 @@ class BaseSidePanelService {
1766
2765
  return `min(${normalized}, 100vw)`;
1767
2766
  }
1768
2767
  resolveWidth(preset) {
1769
- switch (preset) {
1770
- case 'narrow':
1771
- return '420px';
1772
- case 'wide':
1773
- return '960px';
1774
- case 'full':
1775
- return '100vw';
1776
- case 'default':
1777
- default:
1778
- return '720px';
1779
- }
2768
+ return resolveSidePanelPresetWidth(preset);
1780
2769
  }
1781
2770
  resolveOpenConfig(config) {
1782
2771
  const persistedWidth = this.resolvePersistedWidth(config.persistSizeKey);
1783
2772
  if (!persistedWidth) {
1784
2773
  return config;
1785
2774
  }
2775
+ const viewportWidth = resolveSidePanelViewportWidth();
2776
+ const parsedWidth = parseSidePanelWidthPx(persistedWidth, viewportWidth);
2777
+ const effectiveWidth = parsedWidth !== null
2778
+ ? `${clampSidePanelWidthPx(parsedWidth, {
2779
+ minWidth: config.minWidth,
2780
+ maxWidth: config.maxWidth,
2781
+ viewportWidth,
2782
+ })}px`
2783
+ : persistedWidth;
1786
2784
  return {
1787
2785
  ...config,
1788
- width: persistedWidth,
2786
+ width: effectiveWidth,
1789
2787
  };
1790
2788
  }
1791
2789
  resolvePersistedWidth(persistSizeKey) {
1792
- if (!persistSizeKey || typeof localStorage === 'undefined') {
1793
- return undefined;
1794
- }
1795
- try {
1796
- const value = localStorage.getItem(this.storageKey(persistSizeKey));
1797
- return this.isPixelWidth(value) ? value ?? undefined : undefined;
1798
- }
1799
- catch {
1800
- return undefined;
1801
- }
2790
+ return readPersistedSidePanelWidth(persistSizeKey);
1802
2791
  }
1803
2792
  persistWidth(persistSizeKey, width) {
1804
- if (!persistSizeKey || typeof localStorage === 'undefined' || !this.isPixelWidth(width)) {
1805
- return;
1806
- }
1807
- try {
1808
- localStorage.setItem(this.storageKey(persistSizeKey), width);
1809
- }
1810
- catch { }
1811
- }
1812
- storageKey(persistSizeKey) {
1813
- return `praxis.side-panel.width:${persistSizeKey}`;
1814
- }
1815
- isPixelWidth(value) {
1816
- return !!value && /^\d+(\.\d+)?px$/i.test(value.trim());
2793
+ writePersistedSidePanelWidth(persistSizeKey, width);
1817
2794
  }
1818
2795
  shouldDeferEscape(event, overlayRef) {
1819
2796
  if (event.defaultPrevented) {
@@ -2002,7 +2979,17 @@ class SettingsPanelService {
2002
2979
  expanded: config.expanded || false,
2003
2980
  });
2004
2981
  panelRef.instance.configureDiagnostics(config.diagnostics);
2982
+ panelRef.instance.configStorageKey = config.configStorageKey;
2983
+ if (config.showWriteScope !== undefined) {
2984
+ panelRef.instance.showWriteScope = config.showWriteScope;
2985
+ }
2986
+ if (config.canSwitchWriteScope !== undefined) {
2987
+ panelRef.instance.canSwitchWriteScope = config.canSwitchWriteScope;
2988
+ }
2989
+ panelRef.instance.persistSaveHandler = config.onSave;
2990
+ panelRef.instance.persistResetHandler = config.onReset;
2005
2991
  panelRef.instance.previewTarget = config.previewTarget;
2992
+ panelRef.instance.contextNavigation = config.contextNavigation;
2006
2993
  this.currentPanelInstance = panelRef.instance;
2007
2994
  this.currentScope = scope;
2008
2995
  this.currentContentParentInjector = contentParentInjector;
@@ -2086,6 +3073,12 @@ function providePraxisSettingsPanelBridge() {
2086
3073
  title: opts.title,
2087
3074
  titleIcon: opts.titleIcon,
2088
3075
  previewTarget: opts.previewTarget,
3076
+ contextNavigation: opts.contextNavigation,
3077
+ configStorageKey: opts.configStorageKey,
3078
+ showWriteScope: opts.showWriteScope,
3079
+ canSwitchWriteScope: opts.canSwitchWriteScope,
3080
+ onSave: opts.onSave,
3081
+ onReset: opts.onReset,
2089
3082
  content: {
2090
3083
  component: opts.content.component,
2091
3084
  inputs: (opts.content.inputs || undefined),
@@ -2104,10 +3097,20 @@ class SurfaceDrawerComponent {
2104
3097
  titleIcon;
2105
3098
  subtitle;
2106
3099
  widthPreset = 'default';
3100
+ width;
3101
+ minWidth;
3102
+ maxWidth;
3103
+ resizable = false;
3104
+ expandable = false;
3105
+ resizeAxis = 'x';
3106
+ persistSizeKey;
2107
3107
  useHostWidth = false;
3108
+ isExpanded = false;
3109
+ isResizing = false;
2108
3110
  theme = null;
2109
3111
  onClose;
2110
3112
  onBack;
3113
+ onResizeWidth;
2111
3114
  static nextId = 0;
2112
3115
  titleId = `praxis-surface-drawer-title-${SurfaceDrawerComponent.nextId++}`;
2113
3116
  subtitleId = `${this.titleId}-description`;
@@ -2116,6 +3119,12 @@ class SurfaceDrawerComponent {
2116
3119
  body;
2117
3120
  backButton;
2118
3121
  frames = [];
3122
+ activePointerId = null;
3123
+ dragStartX = 0;
3124
+ dragStartWidth = 0;
3125
+ collapsedWidthBeforeExpand = null;
3126
+ suppressNextBackdropClick = false;
3127
+ backdropSuppressTimer = null;
2119
3128
  constructor(cdr, i18n) {
2120
3129
  this.cdr = cdr;
2121
3130
  this.i18n = i18n;
@@ -2138,29 +3147,276 @@ class SurfaceDrawerComponent {
2138
3147
  : 'Voltar';
2139
3148
  return this.i18n.t('Back', undefined, fallback, PRAXIS_SETTINGS_PANEL_I18N_NAMESPACE);
2140
3149
  }
2141
- get canGoBack() {
2142
- return this.frames.length > 1;
3150
+ get canGoBack() {
3151
+ return this.frames.length > 1;
3152
+ }
3153
+ get navigationDepth() {
3154
+ return this.frames.length;
3155
+ }
3156
+ get activeFrameId() {
3157
+ return this.frames[this.frames.length - 1]?.definition.id ?? '';
3158
+ }
3159
+ get hasHeader() {
3160
+ return !!(this.title || this.titleIcon || this.subtitle);
3161
+ }
3162
+ get tracksHostWidth() {
3163
+ return (this.useHostWidth ||
3164
+ this.resizable ||
3165
+ this.expandable ||
3166
+ this.isExpanded ||
3167
+ Boolean(this.width));
3168
+ }
3169
+ get showResizeHandle() {
3170
+ return (this.resizable &&
3171
+ this.resizeAxis === 'x' &&
3172
+ resolveSidePanelViewportWidth() > 640);
3173
+ }
3174
+ get showExpandButton() {
3175
+ if (!this.expandable) {
3176
+ return false;
3177
+ }
3178
+ if (this.isExpanded) {
3179
+ return true;
3180
+ }
3181
+ const viewportWidth = resolveSidePanelViewportWidth();
3182
+ return canExpandSidePanel(this.getCurrentWidthPx(viewportWidth), viewportWidth, { maxWidth: this.maxWidth });
3183
+ }
3184
+ get expandLabel() {
3185
+ const isEn = this.i18n.getLocale().toLowerCase().startsWith('en');
3186
+ if (this.isExpanded) {
3187
+ return this.i18n.t('Collapse panel', undefined, isEn ? 'Collapse panel' : 'Reduzir painel', PRAXIS_SETTINGS_PANEL_I18N_NAMESPACE);
3188
+ }
3189
+ return this.i18n.t('Expand panel', undefined, isEn ? 'Expand panel' : 'Expandir painel', PRAXIS_SETTINGS_PANEL_I18N_NAMESPACE);
3190
+ }
3191
+ get resizeHandleLabel() {
3192
+ const fallback = this.i18n.getLocale().toLowerCase().startsWith('en')
3193
+ ? 'Resize panel'
3194
+ : 'Redimensionar painel';
3195
+ return this.i18n.t('Resize panel', undefined, fallback, PRAXIS_SETTINGS_PANEL_I18N_NAMESPACE);
3196
+ }
3197
+ get resizeMinWidthPx() {
3198
+ const viewportWidth = resolveSidePanelViewportWidth();
3199
+ return clampSidePanelWidthPx(0, {
3200
+ minWidth: this.minWidth,
3201
+ maxWidth: this.maxWidth,
3202
+ viewportWidth,
3203
+ });
3204
+ }
3205
+ get resizeMaxWidthPx() {
3206
+ const viewportWidth = resolveSidePanelViewportWidth();
3207
+ return clampSidePanelWidthPx(viewportWidth, {
3208
+ minWidth: this.minWidth,
3209
+ maxWidth: this.maxWidth,
3210
+ viewportWidth,
3211
+ });
3212
+ }
3213
+ get resizeCurrentWidthPx() {
3214
+ return this.getCurrentWidthPx();
3215
+ }
3216
+ get widthClass() {
3217
+ if (this.tracksHostWidth) {
3218
+ return null;
3219
+ }
3220
+ return `width-${this.widthPreset}`;
3221
+ }
3222
+ syncHostWidth(width) {
3223
+ this.width = width;
3224
+ this.cdr.markForCheck();
3225
+ }
3226
+ syncCollapsedWidth(width) {
3227
+ this.collapsedWidthBeforeExpand = width;
3228
+ }
3229
+ onWindowResize() {
3230
+ const viewportWidth = resolveSidePanelViewportWidth();
3231
+ if (this.isExpanded) {
3232
+ const expandedPx = resolveExpandedSidePanelWidthPx(viewportWidth, {
3233
+ maxWidth: this.maxWidth,
3234
+ });
3235
+ const nextWidth = `${expandedPx}px`;
3236
+ if (nextWidth !== this.width) {
3237
+ this.width = nextWidth;
3238
+ this.onResizeWidth?.(nextWidth, { persist: false });
3239
+ }
3240
+ this.cdr.markForCheck();
3241
+ return;
3242
+ }
3243
+ const parsedWidth = parseSidePanelWidthPx(this.width, viewportWidth);
3244
+ if (parsedWidth !== null) {
3245
+ const clamped = clampSidePanelWidthPx(parsedWidth, {
3246
+ minWidth: this.minWidth,
3247
+ maxWidth: this.maxWidth,
3248
+ viewportWidth,
3249
+ });
3250
+ const nextWidth = `${clamped}px`;
3251
+ if (parsedWidth > clamped && nextWidth !== this.width) {
3252
+ this.width = nextWidth;
3253
+ this.onResizeWidth?.(nextWidth, { persist: false });
3254
+ }
3255
+ }
3256
+ this.cdr.markForCheck();
3257
+ }
3258
+ setExpanded(expanded) {
3259
+ if (!this.expandable || expanded === this.isExpanded) {
3260
+ return;
3261
+ }
3262
+ const viewportWidth = resolveSidePanelViewportWidth();
3263
+ if (expanded) {
3264
+ const currentPx = this.getCurrentWidthPx(viewportWidth);
3265
+ if (!canExpandSidePanel(currentPx, viewportWidth, {
3266
+ maxWidth: this.maxWidth,
3267
+ })) {
3268
+ return;
3269
+ }
3270
+ this.collapsedWidthBeforeExpand =
3271
+ this.width ?? resolveSidePanelPresetWidth(this.widthPreset);
3272
+ const expandedPx = resolveExpandedSidePanelWidthPx(viewportWidth, {
3273
+ maxWidth: this.maxWidth,
3274
+ });
3275
+ const nextWidth = `${expandedPx}px`;
3276
+ this.isExpanded = true;
3277
+ this.width = nextWidth;
3278
+ this.onResizeWidth?.(nextWidth, { persist: false });
3279
+ this.cdr.markForCheck();
3280
+ return;
3281
+ }
3282
+ const rawRestoreWidth = this.collapsedWidthBeforeExpand ??
3283
+ resolveSidePanelPresetWidth(this.widthPreset);
3284
+ const parsedRestore = parseSidePanelWidthPx(rawRestoreWidth, viewportWidth);
3285
+ const clampedRestore = parsedRestore !== null
3286
+ ? clampSidePanelWidthPx(parsedRestore, {
3287
+ minWidth: this.minWidth,
3288
+ maxWidth: this.maxWidth,
3289
+ viewportWidth,
3290
+ })
3291
+ : null;
3292
+ const restoreWidth = parsedRestore !== null &&
3293
+ clampedRestore !== null &&
3294
+ parsedRestore > clampedRestore
3295
+ ? `${clampedRestore}px`
3296
+ : rawRestoreWidth;
3297
+ this.collapsedWidthBeforeExpand = null;
3298
+ this.isExpanded = false;
3299
+ this.width = restoreWidth;
3300
+ this.onResizeWidth?.(restoreWidth, { persist: false });
3301
+ this.cdr.markForCheck();
3302
+ }
3303
+ shouldSuppressBackdropClose() {
3304
+ if (this.isResizing) {
3305
+ return true;
3306
+ }
3307
+ if (this.suppressNextBackdropClick) {
3308
+ this.suppressNextBackdropClick = false;
3309
+ return true;
3310
+ }
3311
+ return false;
3312
+ }
3313
+ toggleExpanded() {
3314
+ this.setExpanded(!this.isExpanded);
2143
3315
  }
2144
- get navigationDepth() {
2145
- return this.frames.length;
3316
+ onResizeHandlePointerDown(event) {
3317
+ if (!this.showResizeHandle || event.button !== 0) {
3318
+ return;
3319
+ }
3320
+ const viewportWidth = resolveSidePanelViewportWidth();
3321
+ const currentWidth = this.promoteExpandedWidthBeforeManualResize(viewportWidth);
3322
+ this.activePointerId = event.pointerId;
3323
+ this.isResizing = true;
3324
+ this.dragStartX = event.clientX;
3325
+ this.dragStartWidth = currentWidth;
3326
+ const target = event.currentTarget;
3327
+ try {
3328
+ target?.setPointerCapture(event.pointerId);
3329
+ }
3330
+ catch { }
3331
+ this.cdr.markForCheck();
3332
+ event.preventDefault();
2146
3333
  }
2147
- get activeFrameId() {
2148
- return this.frames[this.frames.length - 1]?.definition.id ?? '';
3334
+ onResizeHandleDoubleClick(event) {
3335
+ if (!this.showResizeHandle) {
3336
+ return;
3337
+ }
3338
+ event.preventDefault();
3339
+ if (this.isExpanded) {
3340
+ this.setExpanded(false);
3341
+ return;
3342
+ }
3343
+ const viewportWidth = resolveSidePanelViewportWidth();
3344
+ const currentWidth = this.getCurrentWidthPx(viewportWidth);
3345
+ const targetWidth = currentWidth < 840 ? 960 : 720;
3346
+ this.applyWidthPx(targetWidth, viewportWidth);
2149
3347
  }
2150
- get hasHeader() {
2151
- return !!(this.title || this.titleIcon || this.subtitle);
3348
+ onResizeHandleKeydown(event) {
3349
+ if (!this.showResizeHandle) {
3350
+ return;
3351
+ }
3352
+ const viewportWidth = resolveSidePanelViewportWidth();
3353
+ const step = event.shiftKey ? 80 : 40;
3354
+ switch (event.key) {
3355
+ case 'ArrowLeft': {
3356
+ const currentWidth = this.promoteExpandedWidthBeforeManualResize(viewportWidth);
3357
+ this.applyWidthPx(currentWidth + step, viewportWidth);
3358
+ event.preventDefault();
3359
+ return;
3360
+ }
3361
+ case 'ArrowRight': {
3362
+ const currentWidth = this.promoteExpandedWidthBeforeManualResize(viewportWidth);
3363
+ this.applyWidthPx(currentWidth - step, viewportWidth);
3364
+ event.preventDefault();
3365
+ return;
3366
+ }
3367
+ case 'Home': {
3368
+ this.promoteExpandedWidthBeforeManualResize(viewportWidth);
3369
+ const minPx = clampSidePanelWidthPx(0, {
3370
+ minWidth: this.minWidth,
3371
+ maxWidth: this.maxWidth,
3372
+ viewportWidth,
3373
+ });
3374
+ this.applyWidthPx(minPx, viewportWidth);
3375
+ event.preventDefault();
3376
+ return;
3377
+ }
3378
+ case 'End': {
3379
+ this.promoteExpandedWidthBeforeManualResize(viewportWidth);
3380
+ const maxPx = clampSidePanelWidthPx(viewportWidth, {
3381
+ minWidth: this.minWidth,
3382
+ maxWidth: this.maxWidth,
3383
+ viewportWidth,
3384
+ });
3385
+ this.applyWidthPx(maxPx, viewportWidth);
3386
+ event.preventDefault();
3387
+ return;
3388
+ }
3389
+ default:
3390
+ return;
3391
+ }
2152
3392
  }
2153
- get widthClass() {
2154
- if (this.useHostWidth) {
2155
- return null;
3393
+ onDocumentPointerMove(event) {
3394
+ if (event.pointerId !== this.activePointerId) {
3395
+ return;
2156
3396
  }
2157
- return `width-${this.widthPreset}`;
3397
+ const deltaX = this.dragStartX - event.clientX;
3398
+ this.applyWidthPx(this.dragStartWidth + deltaX);
3399
+ }
3400
+ onDocumentPointerEnd(event) {
3401
+ if (event.pointerId !== this.activePointerId) {
3402
+ return;
3403
+ }
3404
+ this.stopResizeSession(true);
2158
3405
  }
2159
3406
  setTitle(title) {
2160
3407
  this.title = title;
3408
+ const active = this.frames[this.frames.length - 1];
3409
+ if (active) {
3410
+ active.definition = { ...active.definition, title };
3411
+ }
2161
3412
  this.cdr.markForCheck();
2162
3413
  }
2163
3414
  ngOnDestroy() {
3415
+ if (this.backdropSuppressTimer !== null) {
3416
+ clearTimeout(this.backdropSuppressTimer);
3417
+ this.backdropSuppressTimer = null;
3418
+ }
3419
+ this.stopResizeSession(false);
2164
3420
  for (const frame of this.frames) {
2165
3421
  if (!frame.componentRef.hostView.destroyed) {
2166
3422
  frame.componentRef.destroy();
@@ -2180,16 +3436,12 @@ class SurfaceDrawerComponent {
2180
3436
  initializeFrame(definition, injector, inputs) {
2181
3437
  this.destroyAllFrames();
2182
3438
  const frame = this.createFrame(definition, injector, inputs);
2183
- this.frames = [frame];
2184
- this.applyFrameHeader(frame);
2185
3439
  return frame.componentRef;
2186
3440
  }
2187
3441
  pushFrame(definition, injector, inputs) {
2188
3442
  this.captureActiveFrameState(definition.returnFocusTo);
2189
3443
  this.detachActiveView();
2190
3444
  const frame = this.createFrame(definition, injector, inputs);
2191
- this.frames.push(frame);
2192
- this.applyFrameHeader(frame);
2193
3445
  this.focusNavigationControl();
2194
3446
  return frame.componentRef;
2195
3447
  }
@@ -2199,8 +3451,6 @@ class SurfaceDrawerComponent {
2199
3451
  }
2200
3452
  this.removeActiveFrame();
2201
3453
  const frame = this.createFrame(definition, injector, inputs);
2202
- this.frames.push(frame);
2203
- this.applyFrameHeader(frame);
2204
3454
  this.focusNavigationControl();
2205
3455
  return frame.componentRef;
2206
3456
  }
@@ -2247,16 +3497,21 @@ class SurfaceDrawerComponent {
2247
3497
  }
2248
3498
  createFrame(definition, injector, inputs) {
2249
3499
  const componentRef = this.contentHost.createComponent(definition.content.component, { injector });
2250
- this.applyInputs(componentRef, inputs);
2251
- this.contentRef = componentRef;
2252
- this.cdr.markForCheck();
2253
- return {
3500
+ const frame = {
2254
3501
  definition,
2255
3502
  componentRef,
2256
3503
  scrollTop: 0,
2257
3504
  restoreFocusTo: null,
2258
3505
  canLeave: definition.canLeave ?? null,
2259
3506
  };
3507
+ // Hosted lifecycle hooks register their guard and header overrides through the active frame ref.
3508
+ // Make that frame current and apply its default header before the first detectChanges runs those hooks.
3509
+ this.frames.push(frame);
3510
+ this.contentRef = componentRef;
3511
+ this.applyFrameHeader(frame);
3512
+ this.applyInputs(componentRef, inputs);
3513
+ this.cdr.markForCheck();
3514
+ return frame;
2260
3515
  }
2261
3516
  captureActiveFrameState(returnFocusTo) {
2262
3517
  const active = this.frames[this.frames.length - 1];
@@ -2322,7 +3577,7 @@ class SurfaceDrawerComponent {
2322
3577
  const supportedInputs = this.resolveSupportedInputs(componentRef);
2323
3578
  const canUseSetInput = typeof componentRef.setInput === 'function';
2324
3579
  for (const [key, value] of Object.entries(inputs)) {
2325
- if (!canUseSetInput && supportedInputs && !supportedInputs.has(key)) {
3580
+ if (supportedInputs && !supportedInputs.has(key)) {
2326
3581
  continue;
2327
3582
  }
2328
3583
  try {
@@ -2345,8 +3600,53 @@ class SurfaceDrawerComponent {
2345
3600
  }
2346
3601
  return new Set(Object.keys(declaredInputs));
2347
3602
  }
3603
+ promoteExpandedWidthBeforeManualResize(viewportWidth) {
3604
+ const currentWidth = this.getCurrentWidthPx(viewportWidth);
3605
+ if (this.isExpanded) {
3606
+ this.isExpanded = false;
3607
+ this.collapsedWidthBeforeExpand = null;
3608
+ this.width = `${currentWidth}px`;
3609
+ this.cdr.markForCheck();
3610
+ }
3611
+ return currentWidth;
3612
+ }
3613
+ getCurrentWidthPx(viewportWidth = resolveSidePanelViewportWidth()) {
3614
+ const parsed = parseSidePanelWidthPx(this.width, viewportWidth);
3615
+ if (parsed !== null) {
3616
+ return Math.round(parsed);
3617
+ }
3618
+ return Math.round(resolveSidePanelPresetWidthPx(this.widthPreset, viewportWidth));
3619
+ }
3620
+ applyWidthPx(value, viewportWidth = resolveSidePanelViewportWidth()) {
3621
+ const clampedWidth = clampSidePanelWidthPx(value, {
3622
+ minWidth: this.minWidth,
3623
+ maxWidth: this.maxWidth,
3624
+ viewportWidth,
3625
+ });
3626
+ const nextWidth = `${clampedWidth}px`;
3627
+ this.width = nextWidth;
3628
+ this.onResizeWidth?.(nextWidth, { persist: true });
3629
+ this.cdr.markForCheck();
3630
+ }
3631
+ stopResizeSession(suppressBackdropClick = false) {
3632
+ if (this.activePointerId !== null || this.isResizing) {
3633
+ this.activePointerId = null;
3634
+ this.isResizing = false;
3635
+ if (suppressBackdropClick) {
3636
+ this.suppressNextBackdropClick = true;
3637
+ if (this.backdropSuppressTimer !== null) {
3638
+ clearTimeout(this.backdropSuppressTimer);
3639
+ }
3640
+ this.backdropSuppressTimer = setTimeout(() => {
3641
+ this.backdropSuppressTimer = null;
3642
+ this.suppressNextBackdropClick = false;
3643
+ }, 0);
3644
+ }
3645
+ this.cdr.markForCheck();
3646
+ }
3647
+ }
2348
3648
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SurfaceDrawerComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$2.PraxisI18nService }], target: i0.ɵɵFactoryTarget.Component });
2349
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: SurfaceDrawerComponent, isStandalone: true, selector: "praxis-surface-drawer", viewQueries: [{ propertyName: "contentHost", first: true, predicate: ["contentHost"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "body", first: true, predicate: ["body"], descendants: true, read: ElementRef }, { propertyName: "backButton", first: true, predicate: ["backButton"], descendants: true, read: ElementRef }], ngImport: i0, template: "<div\n class=\"pfx-surface-drawer\"\n [class.has-header]=\"hasHeader\"\n [class.width-narrow]=\"widthClass === 'width-narrow'\"\n [class.width-default]=\"widthClass === 'width-default'\"\n [class.width-wide]=\"widthClass === 'width-wide'\"\n [class.width-full]=\"widthClass === 'width-full'\"\n [class.use-host-width]=\"useHostWidth\"\n [ngClass]=\"hostClasses\"\n [ngStyle]=\"hostCssVars\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"hasHeader ? titleId : null\"\n [attr.aria-describedby]=\"subtitle ? subtitleId : null\"\n cdkTrapFocus\n cdkTrapFocusAutoCapture\n>\n @if (hasHeader) {\n <header class=\"pfx-surface-drawer__header\">\n @if (canGoBack) {\n <button\n #backButton\n praxisIconButton=\"arrow_back\"\n size=\"compact\"\n type=\"button\"\n class=\"pfx-surface-drawer__back\"\n [attr.aria-label]=\"backLabel\"\n [matTooltip]=\"backLabel\"\n (click)=\"onBack?.()\"\n ></button>\n }\n <div class=\"pfx-surface-drawer__title-block\">\n @if (titleIcon) {\n <mat-icon class=\"pfx-surface-drawer__title-icon\" [praxisIcon]=\"titleIcon\"></mat-icon>\n }\n <div class=\"pfx-surface-drawer__copy\">\n @if (title) {\n <h2 class=\"pfx-surface-drawer__title\" [id]=\"titleId\">{{ title }}</h2>\n }\n @if (subtitle) {\n <p class=\"pfx-surface-drawer__subtitle\" [id]=\"subtitleId\">{{ subtitle }}</p>\n }\n </div>\n </div>\n <button\n praxisIconButton=\"close\"\n size=\"compact\"\n type=\"button\"\n class=\"pfx-surface-drawer__close\"\n [attr.aria-label]=\"closeLabel\"\n [matTooltip]=\"closeLabel\"\n (click)=\"onClose?.()\"\n ></button>\n </header>\n }\n\n <section #body class=\"pfx-surface-drawer__body\">\n <ng-template #contentHost></ng-template>\n </section>\n</div>\n", styles: [":host{display:block;height:100%;width:100%;min-width:0;flex:1 1 auto}.pfx-surface-drawer{display:grid;grid-template-rows:auto 1fr;height:100%;min-width:0;max-width:100%;overflow:hidden;background:var(--md-sys-color-surface-container, #fff);color:var(--md-sys-color-on-surface, #111);border-left:1px solid var(--md-sys-color-outline-variant, rgba(0, 0, 0, .12));border-radius:var(--pfx-side-panel-border-radius, 0);box-shadow:var(--pfx-side-panel-elevation, var(--md-sys-elevation-level2, 0 8px 24px rgba(0, 0, 0, .16)));width:var(--pfx-side-panel-width, 720px);transition:width var(--pfx-side-panel-motion-duration-enter, .22s) var(--pfx-side-panel-motion-easing-enter, cubic-bezier(.2, 0, 0, 1)),box-shadow var(--pfx-side-panel-motion-duration-enter, .22s) var(--pfx-side-panel-motion-easing-enter, cubic-bezier(.2, 0, 0, 1))}.pfx-surface-drawer.use-host-width{width:100%;max-width:100%}.pfx-surface-drawer.width-narrow{width:var(--pfx-side-panel-width, 420px)}.pfx-surface-drawer.width-default{width:var(--pfx-side-panel-width, 720px)}.pfx-surface-drawer.width-wide{width:var(--pfx-side-panel-width, 960px)}.pfx-surface-drawer.width-full{width:min(100vw,var(--pfx-side-panel-max-width, 100vw))}.pfx-surface-drawer__header{display:flex;align-items:flex-start;gap:var(--pfx-side-panel-header-gap, 12px);min-height:var(--pfx-side-panel-header-height, 64px);padding:var(--pfx-side-panel-header-padding-y, 16px) var(--pfx-side-panel-header-padding-x, 20px);box-sizing:border-box;border-bottom:1px solid var(--md-sys-color-outline-variant, rgba(0, 0, 0, .12));background:var(--md-sys-color-surface-container-high, #f7f7f7)}.pfx-surface-drawer__title-block{display:flex;align-items:flex-start;gap:12px;min-width:0;flex:1 1 auto}.pfx-surface-drawer__title-icon{flex:0 0 auto;display:grid;place-items:center;width:36px;height:36px;margin-top:1px;border-radius:10px;background:var(--md-sys-color-primary-container, rgba(47, 78, 178, .12));color:var(--md-sys-color-primary, currentColor)}.pfx-surface-drawer__copy{min-width:0}.pfx-surface-drawer__title,.pfx-surface-drawer__subtitle{margin:0}.pfx-surface-drawer__title{font-size:1.125rem;font-weight:650;line-height:1.35}.pfx-surface-drawer__subtitle{margin-top:6px;color:var(--md-sys-color-on-surface-variant, rgba(0, 0, 0, .64));font-size:.875rem;line-height:1.45;text-wrap:pretty}.pfx-surface-drawer__close{flex:0 0 auto}.pfx-surface-drawer__back{flex:0 0 auto;margin-top:1px}.pfx-surface-drawer__body{min-height:0;overflow:auto;padding:var(--pfx-side-panel-body-padding, 16px);background:var(--md-sys-color-surface, #fff)}@media(prefers-reduced-motion:reduce){.pfx-surface-drawer{transition:none}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: PraxisIconButtonComponent, selector: "button[praxisIconButton]", inputs: ["praxisIconButton", "size", "appearance", "presentation", "pressed", "busy"] }, { kind: "directive", type: PraxisIconDirective, selector: "mat-icon[praxisIcon]", inputs: ["praxisIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3649
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: SurfaceDrawerComponent, isStandalone: true, selector: "praxis-surface-drawer", host: { listeners: { "window:resize": "onWindowResize()", "document:pointermove": "onDocumentPointerMove($event)", "document:pointerup": "onDocumentPointerEnd($event)", "document:pointercancel": "onDocumentPointerEnd($event)" } }, viewQueries: [{ propertyName: "contentHost", first: true, predicate: ["contentHost"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "body", first: true, predicate: ["body"], descendants: true, read: ElementRef }, { propertyName: "backButton", first: true, predicate: ["backButton"], descendants: true, read: ElementRef }], ngImport: i0, template: "<div\n class=\"pfx-surface-drawer\"\n [class.has-header]=\"hasHeader\"\n [class.width-narrow]=\"widthClass === 'width-narrow'\"\n [class.width-default]=\"widthClass === 'width-default'\"\n [class.width-wide]=\"widthClass === 'width-wide'\"\n [class.width-full]=\"widthClass === 'width-full'\"\n [class.use-host-width]=\"tracksHostWidth\"\n [class.is-resizable]=\"showResizeHandle\"\n [class.is-expandable]=\"expandable\"\n [class.is-expanded]=\"isExpanded\"\n [class.is-resizing]=\"isResizing\"\n [ngClass]=\"hostClasses\"\n [ngStyle]=\"hostCssVars\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"hasHeader ? titleId : null\"\n [attr.aria-describedby]=\"subtitle ? subtitleId : null\"\n cdkTrapFocus\n cdkTrapFocusAutoCapture\n>\n @if (showResizeHandle) {\n <div\n class=\"pfx-surface-drawer__resize-handle\"\n role=\"separator\"\n tabindex=\"0\"\n aria-orientation=\"vertical\"\n [attr.aria-label]=\"resizeHandleLabel\"\n [attr.aria-valuemin]=\"resizeMinWidthPx\"\n [attr.aria-valuemax]=\"resizeMaxWidthPx\"\n [attr.aria-valuenow]=\"resizeCurrentWidthPx\"\n (pointerdown)=\"onResizeHandlePointerDown($event)\"\n (dblclick)=\"onResizeHandleDoubleClick($event)\"\n (keydown)=\"onResizeHandleKeydown($event)\"\n ></div>\n }\n @if (hasHeader) {\n <header class=\"pfx-surface-drawer__header\">\n @if (canGoBack) {\n <button\n #backButton\n praxisIconButton=\"arrow_back\"\n size=\"compact\"\n type=\"button\"\n class=\"pfx-surface-drawer__back\"\n [attr.aria-label]=\"backLabel\"\n [matTooltip]=\"backLabel\"\n (click)=\"onBack?.()\"\n ></button>\n }\n <div class=\"pfx-surface-drawer__title-block\">\n @if (titleIcon) {\n <mat-icon class=\"pfx-surface-drawer__title-icon\" [praxisIcon]=\"titleIcon\"></mat-icon>\n }\n <div class=\"pfx-surface-drawer__copy\">\n @if (title) {\n <h2 class=\"pfx-surface-drawer__title\" [id]=\"titleId\" tabindex=\"-1\" cdkFocusInitial>{{ title }}</h2>\n }\n @if (subtitle) {\n <p class=\"pfx-surface-drawer__subtitle\" [id]=\"subtitleId\">{{ subtitle }}</p>\n }\n </div>\n </div>\n <div class=\"pfx-surface-drawer__actions\">\n @if (showExpandButton) {\n <button\n [praxisIconButton]=\"isExpanded ? 'close_fullscreen' : 'open_in_full'\"\n size=\"compact\"\n type=\"button\"\n class=\"pfx-surface-drawer__expand\"\n [attr.aria-label]=\"expandLabel\"\n [pressed]=\"isExpanded\"\n [matTooltip]=\"expandLabel\"\n (click)=\"toggleExpanded()\"\n ></button>\n }\n <button\n praxisIconButton=\"close\"\n size=\"compact\"\n type=\"button\"\n class=\"pfx-surface-drawer__close\"\n [attr.aria-label]=\"closeLabel\"\n [matTooltip]=\"closeLabel\"\n (click)=\"onClose?.()\"\n ></button>\n </div>\n </header>\n }\n\n <section #body class=\"pfx-surface-drawer__body\">\n <ng-template #contentHost></ng-template>\n </section>\n</div>\n", styles: [":host{display:block;height:100%;width:100%;min-width:0;flex:1 1 auto}.pfx-surface-drawer{position:relative;display:grid;grid-template-rows:auto 1fr;height:100%;min-width:0;max-width:100%;overflow:hidden;background:var(--md-sys-color-surface-container, var(--mat-sys-surface-container));color:var(--md-sys-color-on-surface, var(--mat-sys-on-surface));border-left:1px solid var(--md-sys-color-outline-variant, var(--mat-sys-outline-variant));border-radius:var(--pfx-side-panel-border-radius, 0);box-shadow:var(--pfx-side-panel-elevation, var(--md-sys-elevation-level2, 0 8px 24px rgba(0, 0, 0, .16)));width:var(--pfx-side-panel-width, 720px);transition:width var(--pfx-side-panel-motion-duration-enter, .22s) var(--pfx-side-panel-motion-easing-enter, cubic-bezier(.2, 0, 0, 1)),box-shadow var(--pfx-side-panel-motion-duration-enter, .22s) var(--pfx-side-panel-motion-easing-enter, cubic-bezier(.2, 0, 0, 1))}.pfx-surface-drawer.is-resizing{transition:none;-webkit-user-select:none;user-select:none}.pfx-surface-drawer__resize-handle{position:absolute;inset:0 auto 0 0;width:12px;cursor:col-resize;touch-action:none;z-index:3;outline:none}.pfx-surface-drawer__resize-handle:before{content:\"\";position:absolute;inset:0 auto 0 3px;width:2px;background:transparent;border-radius:2px;opacity:0;transition:background-color var(--pfx-side-panel-motion-duration, .16s) ease,opacity var(--pfx-side-panel-motion-duration, .16s) ease}.pfx-surface-drawer.is-resizable:hover .pfx-surface-drawer__resize-handle:before,.pfx-surface-drawer__resize-handle:hover:before,.pfx-surface-drawer__resize-handle:focus-visible:before,.pfx-surface-drawer.is-resizing .pfx-surface-drawer__resize-handle:before{opacity:1;background:var(--md-sys-color-primary, var(--mat-sys-primary, rgba(0, 0, 0, .32)))}.pfx-surface-drawer.use-host-width,.pfx-surface-drawer.is-resizable,.pfx-surface-drawer.is-expandable,.pfx-surface-drawer.is-expanded{width:100%;max-width:100%}.pfx-surface-drawer.width-narrow{width:var(--pfx-side-panel-width, 420px)}.pfx-surface-drawer.width-default{width:var(--pfx-side-panel-width, 720px)}.pfx-surface-drawer.width-wide{width:var(--pfx-side-panel-width, 960px)}.pfx-surface-drawer.width-full{width:min(100vw,var(--pfx-side-panel-max-width, 100vw))}.pfx-surface-drawer__header{display:flex;align-items:flex-start;gap:var(--pfx-side-panel-header-gap, 12px);min-height:var(--pfx-side-panel-header-height, 64px);padding:var(--pfx-side-panel-header-padding-y, 16px) var(--pfx-side-panel-header-padding-x, 20px);box-sizing:border-box;border-bottom:1px solid var(--md-sys-color-outline-variant, var(--mat-sys-outline-variant));background:var(--md-sys-color-surface-container-high, var(--mat-sys-surface-container-high))}.pfx-surface-drawer__title-block{display:flex;align-items:flex-start;gap:12px;min-width:0;flex:1 1 auto}.pfx-surface-drawer__title-icon{flex:0 0 auto;display:grid;place-items:center;width:36px;height:36px;margin-top:1px;border-radius:10px;background:var(--md-sys-color-primary-container, var(--mat-sys-primary-container, rgba(47, 78, 178, .12)));color:var(--md-sys-color-primary, var(--mat-sys-primary, currentColor))}.pfx-surface-drawer__copy{min-width:0}.pfx-surface-drawer__title,.pfx-surface-drawer__subtitle{margin:0}.pfx-surface-drawer__title{font-size:1.125rem;font-weight:var(--mat-sys-title-medium-weight, 500);line-height:1.35}.pfx-surface-drawer__title:focus{outline:none}.pfx-surface-drawer__subtitle{margin-top:6px;color:var(--md-sys-color-on-surface-variant, var(--mat-sys-on-surface-variant));font-size:.875rem;line-height:1.45;text-wrap:pretty}.pfx-surface-drawer__actions{display:flex;align-items:center;gap:8px;flex:0 0 auto;margin-inline-end:-4px}.pfx-surface-drawer__expand,.pfx-surface-drawer__close,.pfx-surface-drawer__back{flex:0 0 auto;--praxis-icon-button-surface-size: 36px;--praxis-icon-button-icon-size: 18px;--praxis-icon-button-radius: 10px;--praxis-icon-button-focus-radius: 10px;color:var(--md-sys-color-on-surface-variant, var(--mat-sys-on-surface-variant))}.pfx-surface-drawer__expand,.pfx-surface-drawer__close{--praxis-icon-button-bg: color-mix( in srgb, var(--md-sys-color-on-surface, var(--mat-sys-on-surface)) 4.5%, transparent );--praxis-icon-button-border: 1px solid color-mix( in srgb, var(--md-sys-color-outline-variant, var(--mat-sys-outline-variant)) 48%, transparent )}.pfx-surface-drawer__expand:hover:not(:disabled),.pfx-surface-drawer__close:hover:not(:disabled){color:var(--md-sys-color-on-surface, var(--mat-sys-on-surface));--praxis-icon-button-hover-bg: color-mix( in srgb, var(--md-sys-color-on-surface, var(--mat-sys-on-surface)) 11%, transparent );--praxis-icon-button-hover-border-color: color-mix( in srgb, var(--md-sys-color-outline, var(--mat-sys-outline)) 48%, transparent )}.pfx-surface-drawer__expand:active:not(:disabled),.pfx-surface-drawer__close:active:not(:disabled){--praxis-icon-button-active-bg: color-mix( in srgb, var(--md-sys-color-on-surface, var(--mat-sys-on-surface)) 16%, transparent )}.pfx-surface-drawer__back{margin-top:1px;--praxis-icon-button-bg: transparent;--praxis-icon-button-border: 1px solid transparent}.pfx-surface-drawer__back:hover:not(:disabled){color:var(--md-sys-color-primary, var(--mat-sys-primary));--praxis-icon-button-hover-bg: color-mix( in srgb, var(--md-sys-color-primary, var(--mat-sys-primary)) 12%, transparent );--praxis-icon-button-hover-border-color: color-mix( in srgb, var(--md-sys-color-primary, var(--mat-sys-primary)) 30%, transparent )}.pfx-surface-drawer__body{min-height:0;overflow:auto;overscroll-behavior:contain;padding:var(--pfx-side-panel-body-padding, 16px);background:var(--md-sys-color-surface, var(--mat-sys-surface))}@media(min-width:640px){.pfx-surface-drawer:not(.width-full){border-radius:var(--pfx-side-panel-border-radius, 16px 0 0 16px)}}@media(prefers-reduced-motion:reduce){.pfx-surface-drawer{transition:none}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: PraxisIconButtonComponent, selector: "button[praxisIconButton]", inputs: ["praxisIconButton", "size", "appearance", "presentation", "pressed", "busy"] }, { kind: "directive", type: PraxisIconDirective, selector: "mat-icon[praxisIcon]", inputs: ["praxisIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2350
3650
  }
2351
3651
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: SurfaceDrawerComponent, decorators: [{
2352
3652
  type: Component,
@@ -2359,7 +3659,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
2359
3659
  CdkTrapFocus,
2360
3660
  PraxisIconButtonComponent,
2361
3661
  PraxisIconDirective,
2362
- ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"pfx-surface-drawer\"\n [class.has-header]=\"hasHeader\"\n [class.width-narrow]=\"widthClass === 'width-narrow'\"\n [class.width-default]=\"widthClass === 'width-default'\"\n [class.width-wide]=\"widthClass === 'width-wide'\"\n [class.width-full]=\"widthClass === 'width-full'\"\n [class.use-host-width]=\"useHostWidth\"\n [ngClass]=\"hostClasses\"\n [ngStyle]=\"hostCssVars\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"hasHeader ? titleId : null\"\n [attr.aria-describedby]=\"subtitle ? subtitleId : null\"\n cdkTrapFocus\n cdkTrapFocusAutoCapture\n>\n @if (hasHeader) {\n <header class=\"pfx-surface-drawer__header\">\n @if (canGoBack) {\n <button\n #backButton\n praxisIconButton=\"arrow_back\"\n size=\"compact\"\n type=\"button\"\n class=\"pfx-surface-drawer__back\"\n [attr.aria-label]=\"backLabel\"\n [matTooltip]=\"backLabel\"\n (click)=\"onBack?.()\"\n ></button>\n }\n <div class=\"pfx-surface-drawer__title-block\">\n @if (titleIcon) {\n <mat-icon class=\"pfx-surface-drawer__title-icon\" [praxisIcon]=\"titleIcon\"></mat-icon>\n }\n <div class=\"pfx-surface-drawer__copy\">\n @if (title) {\n <h2 class=\"pfx-surface-drawer__title\" [id]=\"titleId\">{{ title }}</h2>\n }\n @if (subtitle) {\n <p class=\"pfx-surface-drawer__subtitle\" [id]=\"subtitleId\">{{ subtitle }}</p>\n }\n </div>\n </div>\n <button\n praxisIconButton=\"close\"\n size=\"compact\"\n type=\"button\"\n class=\"pfx-surface-drawer__close\"\n [attr.aria-label]=\"closeLabel\"\n [matTooltip]=\"closeLabel\"\n (click)=\"onClose?.()\"\n ></button>\n </header>\n }\n\n <section #body class=\"pfx-surface-drawer__body\">\n <ng-template #contentHost></ng-template>\n </section>\n</div>\n", styles: [":host{display:block;height:100%;width:100%;min-width:0;flex:1 1 auto}.pfx-surface-drawer{display:grid;grid-template-rows:auto 1fr;height:100%;min-width:0;max-width:100%;overflow:hidden;background:var(--md-sys-color-surface-container, #fff);color:var(--md-sys-color-on-surface, #111);border-left:1px solid var(--md-sys-color-outline-variant, rgba(0, 0, 0, .12));border-radius:var(--pfx-side-panel-border-radius, 0);box-shadow:var(--pfx-side-panel-elevation, var(--md-sys-elevation-level2, 0 8px 24px rgba(0, 0, 0, .16)));width:var(--pfx-side-panel-width, 720px);transition:width var(--pfx-side-panel-motion-duration-enter, .22s) var(--pfx-side-panel-motion-easing-enter, cubic-bezier(.2, 0, 0, 1)),box-shadow var(--pfx-side-panel-motion-duration-enter, .22s) var(--pfx-side-panel-motion-easing-enter, cubic-bezier(.2, 0, 0, 1))}.pfx-surface-drawer.use-host-width{width:100%;max-width:100%}.pfx-surface-drawer.width-narrow{width:var(--pfx-side-panel-width, 420px)}.pfx-surface-drawer.width-default{width:var(--pfx-side-panel-width, 720px)}.pfx-surface-drawer.width-wide{width:var(--pfx-side-panel-width, 960px)}.pfx-surface-drawer.width-full{width:min(100vw,var(--pfx-side-panel-max-width, 100vw))}.pfx-surface-drawer__header{display:flex;align-items:flex-start;gap:var(--pfx-side-panel-header-gap, 12px);min-height:var(--pfx-side-panel-header-height, 64px);padding:var(--pfx-side-panel-header-padding-y, 16px) var(--pfx-side-panel-header-padding-x, 20px);box-sizing:border-box;border-bottom:1px solid var(--md-sys-color-outline-variant, rgba(0, 0, 0, .12));background:var(--md-sys-color-surface-container-high, #f7f7f7)}.pfx-surface-drawer__title-block{display:flex;align-items:flex-start;gap:12px;min-width:0;flex:1 1 auto}.pfx-surface-drawer__title-icon{flex:0 0 auto;display:grid;place-items:center;width:36px;height:36px;margin-top:1px;border-radius:10px;background:var(--md-sys-color-primary-container, rgba(47, 78, 178, .12));color:var(--md-sys-color-primary, currentColor)}.pfx-surface-drawer__copy{min-width:0}.pfx-surface-drawer__title,.pfx-surface-drawer__subtitle{margin:0}.pfx-surface-drawer__title{font-size:1.125rem;font-weight:650;line-height:1.35}.pfx-surface-drawer__subtitle{margin-top:6px;color:var(--md-sys-color-on-surface-variant, rgba(0, 0, 0, .64));font-size:.875rem;line-height:1.45;text-wrap:pretty}.pfx-surface-drawer__close{flex:0 0 auto}.pfx-surface-drawer__back{flex:0 0 auto;margin-top:1px}.pfx-surface-drawer__body{min-height:0;overflow:auto;padding:var(--pfx-side-panel-body-padding, 16px);background:var(--md-sys-color-surface, #fff)}@media(prefers-reduced-motion:reduce){.pfx-surface-drawer{transition:none}}\n"] }]
3662
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"pfx-surface-drawer\"\n [class.has-header]=\"hasHeader\"\n [class.width-narrow]=\"widthClass === 'width-narrow'\"\n [class.width-default]=\"widthClass === 'width-default'\"\n [class.width-wide]=\"widthClass === 'width-wide'\"\n [class.width-full]=\"widthClass === 'width-full'\"\n [class.use-host-width]=\"tracksHostWidth\"\n [class.is-resizable]=\"showResizeHandle\"\n [class.is-expandable]=\"expandable\"\n [class.is-expanded]=\"isExpanded\"\n [class.is-resizing]=\"isResizing\"\n [ngClass]=\"hostClasses\"\n [ngStyle]=\"hostCssVars\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"hasHeader ? titleId : null\"\n [attr.aria-describedby]=\"subtitle ? subtitleId : null\"\n cdkTrapFocus\n cdkTrapFocusAutoCapture\n>\n @if (showResizeHandle) {\n <div\n class=\"pfx-surface-drawer__resize-handle\"\n role=\"separator\"\n tabindex=\"0\"\n aria-orientation=\"vertical\"\n [attr.aria-label]=\"resizeHandleLabel\"\n [attr.aria-valuemin]=\"resizeMinWidthPx\"\n [attr.aria-valuemax]=\"resizeMaxWidthPx\"\n [attr.aria-valuenow]=\"resizeCurrentWidthPx\"\n (pointerdown)=\"onResizeHandlePointerDown($event)\"\n (dblclick)=\"onResizeHandleDoubleClick($event)\"\n (keydown)=\"onResizeHandleKeydown($event)\"\n ></div>\n }\n @if (hasHeader) {\n <header class=\"pfx-surface-drawer__header\">\n @if (canGoBack) {\n <button\n #backButton\n praxisIconButton=\"arrow_back\"\n size=\"compact\"\n type=\"button\"\n class=\"pfx-surface-drawer__back\"\n [attr.aria-label]=\"backLabel\"\n [matTooltip]=\"backLabel\"\n (click)=\"onBack?.()\"\n ></button>\n }\n <div class=\"pfx-surface-drawer__title-block\">\n @if (titleIcon) {\n <mat-icon class=\"pfx-surface-drawer__title-icon\" [praxisIcon]=\"titleIcon\"></mat-icon>\n }\n <div class=\"pfx-surface-drawer__copy\">\n @if (title) {\n <h2 class=\"pfx-surface-drawer__title\" [id]=\"titleId\" tabindex=\"-1\" cdkFocusInitial>{{ title }}</h2>\n }\n @if (subtitle) {\n <p class=\"pfx-surface-drawer__subtitle\" [id]=\"subtitleId\">{{ subtitle }}</p>\n }\n </div>\n </div>\n <div class=\"pfx-surface-drawer__actions\">\n @if (showExpandButton) {\n <button\n [praxisIconButton]=\"isExpanded ? 'close_fullscreen' : 'open_in_full'\"\n size=\"compact\"\n type=\"button\"\n class=\"pfx-surface-drawer__expand\"\n [attr.aria-label]=\"expandLabel\"\n [pressed]=\"isExpanded\"\n [matTooltip]=\"expandLabel\"\n (click)=\"toggleExpanded()\"\n ></button>\n }\n <button\n praxisIconButton=\"close\"\n size=\"compact\"\n type=\"button\"\n class=\"pfx-surface-drawer__close\"\n [attr.aria-label]=\"closeLabel\"\n [matTooltip]=\"closeLabel\"\n (click)=\"onClose?.()\"\n ></button>\n </div>\n </header>\n }\n\n <section #body class=\"pfx-surface-drawer__body\">\n <ng-template #contentHost></ng-template>\n </section>\n</div>\n", styles: [":host{display:block;height:100%;width:100%;min-width:0;flex:1 1 auto}.pfx-surface-drawer{position:relative;display:grid;grid-template-rows:auto 1fr;height:100%;min-width:0;max-width:100%;overflow:hidden;background:var(--md-sys-color-surface-container, var(--mat-sys-surface-container));color:var(--md-sys-color-on-surface, var(--mat-sys-on-surface));border-left:1px solid var(--md-sys-color-outline-variant, var(--mat-sys-outline-variant));border-radius:var(--pfx-side-panel-border-radius, 0);box-shadow:var(--pfx-side-panel-elevation, var(--md-sys-elevation-level2, 0 8px 24px rgba(0, 0, 0, .16)));width:var(--pfx-side-panel-width, 720px);transition:width var(--pfx-side-panel-motion-duration-enter, .22s) var(--pfx-side-panel-motion-easing-enter, cubic-bezier(.2, 0, 0, 1)),box-shadow var(--pfx-side-panel-motion-duration-enter, .22s) var(--pfx-side-panel-motion-easing-enter, cubic-bezier(.2, 0, 0, 1))}.pfx-surface-drawer.is-resizing{transition:none;-webkit-user-select:none;user-select:none}.pfx-surface-drawer__resize-handle{position:absolute;inset:0 auto 0 0;width:12px;cursor:col-resize;touch-action:none;z-index:3;outline:none}.pfx-surface-drawer__resize-handle:before{content:\"\";position:absolute;inset:0 auto 0 3px;width:2px;background:transparent;border-radius:2px;opacity:0;transition:background-color var(--pfx-side-panel-motion-duration, .16s) ease,opacity var(--pfx-side-panel-motion-duration, .16s) ease}.pfx-surface-drawer.is-resizable:hover .pfx-surface-drawer__resize-handle:before,.pfx-surface-drawer__resize-handle:hover:before,.pfx-surface-drawer__resize-handle:focus-visible:before,.pfx-surface-drawer.is-resizing .pfx-surface-drawer__resize-handle:before{opacity:1;background:var(--md-sys-color-primary, var(--mat-sys-primary, rgba(0, 0, 0, .32)))}.pfx-surface-drawer.use-host-width,.pfx-surface-drawer.is-resizable,.pfx-surface-drawer.is-expandable,.pfx-surface-drawer.is-expanded{width:100%;max-width:100%}.pfx-surface-drawer.width-narrow{width:var(--pfx-side-panel-width, 420px)}.pfx-surface-drawer.width-default{width:var(--pfx-side-panel-width, 720px)}.pfx-surface-drawer.width-wide{width:var(--pfx-side-panel-width, 960px)}.pfx-surface-drawer.width-full{width:min(100vw,var(--pfx-side-panel-max-width, 100vw))}.pfx-surface-drawer__header{display:flex;align-items:flex-start;gap:var(--pfx-side-panel-header-gap, 12px);min-height:var(--pfx-side-panel-header-height, 64px);padding:var(--pfx-side-panel-header-padding-y, 16px) var(--pfx-side-panel-header-padding-x, 20px);box-sizing:border-box;border-bottom:1px solid var(--md-sys-color-outline-variant, var(--mat-sys-outline-variant));background:var(--md-sys-color-surface-container-high, var(--mat-sys-surface-container-high))}.pfx-surface-drawer__title-block{display:flex;align-items:flex-start;gap:12px;min-width:0;flex:1 1 auto}.pfx-surface-drawer__title-icon{flex:0 0 auto;display:grid;place-items:center;width:36px;height:36px;margin-top:1px;border-radius:10px;background:var(--md-sys-color-primary-container, var(--mat-sys-primary-container, rgba(47, 78, 178, .12)));color:var(--md-sys-color-primary, var(--mat-sys-primary, currentColor))}.pfx-surface-drawer__copy{min-width:0}.pfx-surface-drawer__title,.pfx-surface-drawer__subtitle{margin:0}.pfx-surface-drawer__title{font-size:1.125rem;font-weight:var(--mat-sys-title-medium-weight, 500);line-height:1.35}.pfx-surface-drawer__title:focus{outline:none}.pfx-surface-drawer__subtitle{margin-top:6px;color:var(--md-sys-color-on-surface-variant, var(--mat-sys-on-surface-variant));font-size:.875rem;line-height:1.45;text-wrap:pretty}.pfx-surface-drawer__actions{display:flex;align-items:center;gap:8px;flex:0 0 auto;margin-inline-end:-4px}.pfx-surface-drawer__expand,.pfx-surface-drawer__close,.pfx-surface-drawer__back{flex:0 0 auto;--praxis-icon-button-surface-size: 36px;--praxis-icon-button-icon-size: 18px;--praxis-icon-button-radius: 10px;--praxis-icon-button-focus-radius: 10px;color:var(--md-sys-color-on-surface-variant, var(--mat-sys-on-surface-variant))}.pfx-surface-drawer__expand,.pfx-surface-drawer__close{--praxis-icon-button-bg: color-mix( in srgb, var(--md-sys-color-on-surface, var(--mat-sys-on-surface)) 4.5%, transparent );--praxis-icon-button-border: 1px solid color-mix( in srgb, var(--md-sys-color-outline-variant, var(--mat-sys-outline-variant)) 48%, transparent )}.pfx-surface-drawer__expand:hover:not(:disabled),.pfx-surface-drawer__close:hover:not(:disabled){color:var(--md-sys-color-on-surface, var(--mat-sys-on-surface));--praxis-icon-button-hover-bg: color-mix( in srgb, var(--md-sys-color-on-surface, var(--mat-sys-on-surface)) 11%, transparent );--praxis-icon-button-hover-border-color: color-mix( in srgb, var(--md-sys-color-outline, var(--mat-sys-outline)) 48%, transparent )}.pfx-surface-drawer__expand:active:not(:disabled),.pfx-surface-drawer__close:active:not(:disabled){--praxis-icon-button-active-bg: color-mix( in srgb, var(--md-sys-color-on-surface, var(--mat-sys-on-surface)) 16%, transparent )}.pfx-surface-drawer__back{margin-top:1px;--praxis-icon-button-bg: transparent;--praxis-icon-button-border: 1px solid transparent}.pfx-surface-drawer__back:hover:not(:disabled){color:var(--md-sys-color-primary, var(--mat-sys-primary));--praxis-icon-button-hover-bg: color-mix( in srgb, var(--md-sys-color-primary, var(--mat-sys-primary)) 12%, transparent );--praxis-icon-button-hover-border-color: color-mix( in srgb, var(--md-sys-color-primary, var(--mat-sys-primary)) 30%, transparent )}.pfx-surface-drawer__body{min-height:0;overflow:auto;overscroll-behavior:contain;padding:var(--pfx-side-panel-body-padding, 16px);background:var(--md-sys-color-surface, var(--mat-sys-surface))}@media(min-width:640px){.pfx-surface-drawer:not(.width-full){border-radius:var(--pfx-side-panel-border-radius, 16px 0 0 16px)}}@media(prefers-reduced-motion:reduce){.pfx-surface-drawer{transition:none}}\n"] }]
2363
3663
  }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1$2.PraxisI18nService }], propDecorators: { contentHost: [{
2364
3664
  type: ViewChild,
2365
3665
  args: ['contentHost', { read: ViewContainerRef, static: true }]
@@ -2369,6 +3669,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
2369
3669
  }], backButton: [{
2370
3670
  type: ViewChild,
2371
3671
  args: ['backButton', { read: ElementRef }]
3672
+ }], onWindowResize: [{
3673
+ type: HostListener,
3674
+ args: ['window:resize']
3675
+ }], onDocumentPointerMove: [{
3676
+ type: HostListener,
3677
+ args: ['document:pointermove', ['$event']]
3678
+ }], onDocumentPointerEnd: [{
3679
+ type: HostListener,
3680
+ args: ['document:pointerup', ['$event']]
3681
+ }, {
3682
+ type: HostListener,
3683
+ args: ['document:pointercancel', ['$event']]
2372
3684
  }] } });
2373
3685
 
2374
3686
  function buildSurfaceRuntime(ref) {
@@ -2379,7 +3691,11 @@ function buildSurfaceRuntime(ref) {
2379
3691
  emitResult: (result) => ref.emitResult?.(result),
2380
3692
  complete: (outcome) => ref.complete?.(outcome),
2381
3693
  updateTitle: (title) => ref.updateTitle?.(title),
2382
- updateSize: (preset) => ref.updateSize?.(preset),
3694
+ updateSize: (preset, options) => options === undefined
3695
+ ? ref.updateSize?.(preset)
3696
+ : ref.updateSize?.(preset, options),
3697
+ setExpanded: (expanded) => ref.setExpanded?.(expanded),
3698
+ toggleExpanded: () => ref.toggleExpanded?.(),
2383
3699
  navigation$: ref.navigation$,
2384
3700
  push: (frame) => ref.push?.(frame),
2385
3701
  replace: (frame) => ref.replace?.(frame),
@@ -2441,6 +3757,29 @@ function providePraxisSurfaceDrawerBridge() {
2441
3757
  let panel = null;
2442
3758
  let activeRef = null;
2443
3759
  const frameRefs = [];
3760
+ const viewportWidth = resolveSidePanelViewportWidth();
3761
+ const persistedWidth = opts.persistSizeKey
3762
+ ? readPersistedSidePanelWidth(opts.persistSizeKey)
3763
+ : undefined;
3764
+ const clampedPersistedWidth = (() => {
3765
+ if (!persistedWidth)
3766
+ return undefined;
3767
+ const parsed = parseSidePanelWidthPx(persistedWidth, viewportWidth);
3768
+ if (parsed === null)
3769
+ return persistedWidth;
3770
+ return `${clampSidePanelWidthPx(parsed, {
3771
+ minWidth: opts.minWidth,
3772
+ maxWidth: opts.maxWidth,
3773
+ viewportWidth,
3774
+ })}px`;
3775
+ })();
3776
+ const initialWidth = clampedPersistedWidth ??
3777
+ opts.width ??
3778
+ resolveSidePanelPresetWidth(opts.widthPreset ?? 'default');
3779
+ const frameWidthStack = [initialWidth];
3780
+ let userResized = false;
3781
+ let navigatingBack = false;
3782
+ let closingSession = false;
2444
3783
  const createContent = (frame, mode, runtimeRef) => {
2445
3784
  if (!panel)
2446
3785
  return null;
@@ -2477,16 +3816,57 @@ function providePraxisSurfaceDrawerBridge() {
2477
3816
  runtime.__closeFrame?.(result);
2478
3817
  };
2479
3818
  const navigateBack = async (result) => {
2480
- const leaving = frameRefs[frameRefs.length - 1];
2481
- const moved = await panel?.backFrame() ?? false;
2482
- if (!moved)
3819
+ if (navigatingBack || closingSession)
2483
3820
  return false;
2484
- if (leaving) {
2485
- frameRefs.pop();
2486
- closeFrameRef(leaving, result ?? { type: 'back' });
3821
+ navigatingBack = true;
3822
+ try {
3823
+ const leaving = frameRefs[frameRefs.length - 1];
3824
+ const moved = await panel?.backFrame() ?? false;
3825
+ if (!moved)
3826
+ return false;
3827
+ if (leaving) {
3828
+ frameRefs.pop();
3829
+ closeFrameRef(leaving, result ?? { type: 'back' });
3830
+ }
3831
+ const leavingWidth = frameWidthStack.length > 1 ? frameWidthStack.pop() : undefined;
3832
+ const restoredWidth = frameWidthStack[frameWidthStack.length - 1];
3833
+ if (restoredWidth && panel?.isExpanded) {
3834
+ panel.syncCollapsedWidth?.(restoredWidth);
3835
+ }
3836
+ else if (!userResized &&
3837
+ !panel?.isExpanded &&
3838
+ leavingWidth &&
3839
+ restoredWidth &&
3840
+ restoredWidth !== leavingWidth) {
3841
+ activeRef?.updateSize?.(restoredWidth, { persist: false });
3842
+ panel?.syncHostWidth?.(restoredWidth);
3843
+ }
3844
+ publishNavigationState();
3845
+ return true;
3846
+ }
3847
+ finally {
3848
+ navigatingBack = false;
3849
+ }
3850
+ };
3851
+ const requestSessionClose = async (reason, ref) => {
3852
+ if (closingSession || navigatingBack)
3853
+ return;
3854
+ closingSession = true;
3855
+ try {
3856
+ if (await panel?.canCloseSession())
3857
+ ref.close({ type: reason });
3858
+ }
3859
+ finally {
3860
+ closingSession = false;
3861
+ }
3862
+ };
3863
+ const requestDismiss = async (reason, ref) => {
3864
+ // Dismiss the current step, preserving the live parent collection.
3865
+ if (panel?.canGoBack) {
3866
+ await navigateBack({ type: reason });
3867
+ return;
2487
3868
  }
2488
- publishNavigationState();
2489
- return true;
3869
+ await requestSessionClose(reason, ref);
2490
3870
  };
2491
3871
  const createFrameRef = (frameId) => {
2492
3872
  const closedSubject = new Subject();
@@ -2502,10 +3882,28 @@ function providePraxisSurfaceDrawerBridge() {
2502
3882
  emitResult: (result) => resultSubject.next(result),
2503
3883
  complete: (outcome) => {
2504
3884
  resultSubject.next(outcome);
3885
+ const outcomeRecord = outcome && typeof outcome === 'object'
3886
+ ? outcome
3887
+ : null;
3888
+ const outcomeKind = typeof outcomeRecord?.kind === 'string'
3889
+ ? outcomeRecord.kind.toLowerCase()
3890
+ : '';
3891
+ const outcomeType = typeof outcomeRecord?.type === 'string'
3892
+ ? outcomeRecord.type.toLowerCase()
3893
+ : '';
3894
+ if (outcomeKind === 'completed' ||
3895
+ outcomeType === 'save' ||
3896
+ outcomeType === 'delete') {
3897
+ activeRef?.emitResult?.(outcome);
3898
+ }
2505
3899
  void navigateBack(outcome);
2506
3900
  },
2507
3901
  updateTitle: (title) => activeRef?.updateTitle?.(title),
2508
- updateSize: (preset) => activeRef?.updateSize?.(preset),
3902
+ updateSize: (preset, options) => options === undefined
3903
+ ? activeRef?.updateSize?.(preset)
3904
+ : activeRef?.updateSize?.(preset, options),
3905
+ setExpanded: (expanded) => activeRef?.setExpanded?.(expanded),
3906
+ toggleExpanded: () => activeRef?.toggleExpanded?.(),
2509
3907
  push: (frame) => activeRef?.push?.(frame) ?? Promise.resolve(null),
2510
3908
  replace: (frame) => activeRef?.replace?.(frame) ?? Promise.resolve(null),
2511
3909
  back: () => activeRef?.back?.() ?? Promise.resolve(false),
@@ -2536,6 +3934,40 @@ function providePraxisSurfaceDrawerBridge() {
2536
3934
  ref.navigation$ = navigationState.asObservable();
2537
3935
  ref.canGoBack = () => panel?.canGoBack ?? false;
2538
3936
  ref.setCanLeave = (guard) => panel?.setActiveCanLeave(guard);
3937
+ if (typeof ref.bindExpandController === 'function') {
3938
+ ref.bindExpandController({
3939
+ setExpanded: (expanded) => panel?.setExpanded?.(expanded),
3940
+ toggleExpanded: () => panel?.toggleExpanded?.(),
3941
+ });
3942
+ }
3943
+ else {
3944
+ ref.setExpanded = (expanded) => panel?.setExpanded?.(expanded);
3945
+ ref.toggleExpanded = () => panel?.toggleExpanded?.();
3946
+ }
3947
+ const applyFrameWidthTransition = (frame, mode) => {
3948
+ const currentTopWidth = frameWidthStack[frameWidthStack.length - 1] ?? initialWidth;
3949
+ const targetWidth = frame.width ??
3950
+ (frame.widthPreset
3951
+ ? resolveSidePanelPresetWidth(frame.widthPreset)
3952
+ : currentTopWidth);
3953
+ if (mode === 'push') {
3954
+ frameWidthStack.push(targetWidth);
3955
+ }
3956
+ else if (frameWidthStack.length > 0) {
3957
+ frameWidthStack[frameWidthStack.length - 1] = targetWidth;
3958
+ }
3959
+ else {
3960
+ frameWidthStack.push(targetWidth);
3961
+ }
3962
+ if (panel?.isExpanded) {
3963
+ panel.syncCollapsedWidth?.(targetWidth);
3964
+ }
3965
+ else if (!userResized &&
3966
+ targetWidth !== currentTopWidth) {
3967
+ ref.updateSize?.(targetWidth, { persist: false });
3968
+ panel?.syncHostWidth?.(targetWidth);
3969
+ }
3970
+ };
2539
3971
  ref.push = async (frame) => {
2540
3972
  const frameRef = createFrameRef(frame.id);
2541
3973
  const contentRef = await createContent(frame, 'push', frameRef);
@@ -2543,6 +3975,7 @@ function providePraxisSurfaceDrawerBridge() {
2543
3975
  return null;
2544
3976
  frameRefs.push(frameRef);
2545
3977
  frameRef.__setCleanup?.(bindSurfaceContentSelectionResults(contentRef.instance, frameRef));
3978
+ applyFrameWidthTransition(frame, 'push');
2546
3979
  publishNavigationState();
2547
3980
  return frameRef;
2548
3981
  };
@@ -2558,6 +3991,7 @@ function providePraxisSurfaceDrawerBridge() {
2558
3991
  value: frame.id,
2559
3992
  });
2560
3993
  bindSurfaceContentSelectionResults(contentRef.instance, rootRef);
3994
+ applyFrameWidthTransition(frame, 'replace');
2561
3995
  publishNavigationState();
2562
3996
  return rootRef;
2563
3997
  }
@@ -2570,6 +4004,7 @@ function providePraxisSurfaceDrawerBridge() {
2570
4004
  closeFrameRef(replaced, { type: 'replace' });
2571
4005
  frameRefs.push(frameRef);
2572
4006
  frameRef.__setCleanup?.(bindSurfaceContentSelectionResults(contentRef.instance, frameRef));
4007
+ applyFrameWidthTransition(frame, 'replace');
2573
4008
  publishNavigationState();
2574
4009
  return frameRef;
2575
4010
  };
@@ -2596,6 +4031,7 @@ function providePraxisSurfaceDrawerBridge() {
2596
4031
  minWidth: opts.minWidth,
2597
4032
  maxWidth: opts.maxWidth,
2598
4033
  resizable: opts.resizable,
4034
+ expandable: opts.expandable,
2599
4035
  resizeAxis: opts.resizeAxis,
2600
4036
  persistSizeKey: opts.persistSizeKey,
2601
4037
  content: {
@@ -2615,18 +4051,46 @@ function providePraxisSurfaceDrawerBridge() {
2615
4051
  const ref = new BaseSidePanelOverlayRef(overlayRef);
2616
4052
  return configureRef(ref);
2617
4053
  },
2618
- attach: (panelRef, ref) => {
4054
+ attach: (panelRef, ref, resolvedConfig) => {
2619
4055
  panel = panelRef.instance;
2620
4056
  configureRef(ref);
2621
- panelRef.instance.widthPreset = opts.widthPreset ?? 'default';
2622
- panelRef.instance.useHostWidth = !!(opts.width ||
4057
+ const resolvedPanelWidth = resolvedConfig?.width ??
4058
+ clampedPersistedWidth ??
4059
+ opts.width ??
4060
+ resolveSidePanelPresetWidth(resolvedConfig?.widthPreset ?? opts.widthPreset ?? 'default');
4061
+ frameWidthStack[0] = resolvedPanelWidth;
4062
+ panelRef.instance.widthPreset =
4063
+ resolvedConfig?.widthPreset ?? opts.widthPreset ?? 'default';
4064
+ panelRef.instance.width = resolvedPanelWidth;
4065
+ panelRef.instance.minWidth = resolvedConfig?.minWidth ?? opts.minWidth;
4066
+ panelRef.instance.maxWidth = resolvedConfig?.maxWidth ?? opts.maxWidth;
4067
+ panelRef.instance.resizable =
4068
+ resolvedConfig?.resizable ?? opts.resizable ?? false;
4069
+ panelRef.instance.expandable =
4070
+ resolvedConfig?.expandable ?? opts.expandable ?? false;
4071
+ panelRef.instance.resizeAxis =
4072
+ resolvedConfig?.resizeAxis ?? opts.resizeAxis ?? 'x';
4073
+ panelRef.instance.persistSizeKey =
4074
+ resolvedConfig?.persistSizeKey ?? opts.persistSizeKey;
4075
+ panelRef.instance.useHostWidth = !!(resolvedConfig?.width ||
4076
+ clampedPersistedWidth ||
4077
+ opts.width ||
4078
+ resolvedConfig?.minWidth ||
2623
4079
  opts.minWidth ||
2624
- opts.maxWidth);
4080
+ resolvedConfig?.maxWidth ||
4081
+ opts.maxWidth ||
4082
+ resolvedConfig?.resizable ||
4083
+ opts.resizable ||
4084
+ resolvedConfig?.expandable ||
4085
+ opts.expandable);
4086
+ panelRef.instance.onResizeWidth = (width, resizeOptions) => {
4087
+ if (resizeOptions?.persist !== false) {
4088
+ userResized = true;
4089
+ }
4090
+ ref.updateSize?.({ width }, resizeOptions);
4091
+ };
2625
4092
  panelRef.instance.onClose = () => {
2626
- void panelRef.instance.canCloseSession().then((allowed) => {
2627
- if (allowed)
2628
- ref.close({ type: 'close' });
2629
- });
4093
+ void requestDismiss('close', ref);
2630
4094
  };
2631
4095
  panelRef.instance.onBack = () => { void activeRef?.back?.(); };
2632
4096
  ref.bindTitleUpdater((title) => panelRef.instance.setTitle(title));
@@ -2646,22 +4110,14 @@ function providePraxisSurfaceDrawerBridge() {
2646
4110
  panelRef.changeDetectorRef.detectChanges();
2647
4111
  },
2648
4112
  createCloser: (ref) => (reason = 'close') => {
2649
- void panel?.canCloseSession().then((allowed) => {
2650
- if (allowed)
2651
- ref.close({ type: reason });
2652
- });
4113
+ // Scope replacement closes the session, not just its current step.
4114
+ void requestSessionClose(reason, ref);
2653
4115
  },
2654
4116
  onBackdrop: (ref) => {
2655
- void panel?.canCloseSession().then((allowed) => {
2656
- if (allowed)
2657
- ref.close({ type: 'backdrop' });
2658
- });
4117
+ void requestDismiss('backdrop', ref);
2659
4118
  },
2660
4119
  onEsc: (ref) => {
2661
- void panel?.canCloseSession().then((allowed) => {
2662
- if (allowed)
2663
- ref.close({ type: 'esc' });
2664
- });
4120
+ void requestDismiss('esc', ref);
2665
4121
  },
2666
4122
  });
2667
4123
  result.closed$.subscribe(() => {
@@ -2721,6 +4177,7 @@ class GlobalConfigAdminService {
2721
4177
  dynamicFields: this.global.getDynamicFields(),
2722
4178
  table: this.global.getTable(),
2723
4179
  dialog: this.global.getDialog(),
4180
+ pages: this.global.getPages(),
2724
4181
  ai: this.global.get('ai'),
2725
4182
  cache: this.global.get('cache'),
2726
4183
  };
@@ -3305,6 +4762,96 @@ function buildGlobalConfigFormConfig(translate = (text) => text) {
3305
4762
  { name: safeName('dialog.variants.error.actions'), label: tx('Variant error - actions (JSON array)'), controlType: FieldControlType.TEXTAREA, dataAttributes: { globalPath: 'dialog.variants.error.actions', monospace: true } },
3306
4763
  { name: safeName('dialog.variants.error.styles'), label: tx('Variant error - styles (JSON)'), controlType: FieldControlType.TEXTAREA, dataAttributes: { globalPath: 'dialog.variants.error.styles', monospace: true }, hint: tx('Example JSON: {"containerColor":"var(--md-sys-color-surface)","containerBorderColor":"var(--md-sys-color-outline-variant)","backdropColor":"var(--md-sys-color-scrim)","actionButtonRadius":"8px"}') },
3307
4764
  { name: safeName('dialog.variants.error.animation'), label: tx('Variant error - animation (JSON/boolean)'), controlType: FieldControlType.TEXTAREA, dataAttributes: { globalPath: 'dialog.variants.error.animation', monospace: true } },
4765
+ // Dynamic Pages - Defaults
4766
+ {
4767
+ name: safeName('pages.defaults.layoutPreset'),
4768
+ label: tx('Preset de layout padrão'),
4769
+ controlType: FieldControlType.SELECT,
4770
+ selectOptions: [
4771
+ { text: tx('Definido pela página (sem preset forçado)'), value: '' },
4772
+ { text: tx('KPI + Tabela Operacional (kpi-plus-table)'), value: 'kpi-plus-table' },
4773
+ { text: tx('Visão Analítica (analytics-overview)'), value: 'analytics-overview' },
4774
+ { text: tx('Master-Detail Dashboard (master-detail-dashboard)'), value: 'master-detail-dashboard' },
4775
+ { text: tx('Monitoramento Operacional (ops-monitoring)'), value: 'ops-monitoring' },
4776
+ ],
4777
+ hint: tx('Preset estrutural aplicado quando a página não define layoutPreset próprio.'),
4778
+ dataAttributes: { globalPath: 'pages.defaults.layoutPreset' },
4779
+ },
4780
+ {
4781
+ name: safeName('pages.defaults.themePreset'),
4782
+ label: tx('Preset de tema padrão da página'),
4783
+ controlType: FieldControlType.SELECT,
4784
+ selectOptions: [
4785
+ { text: tx('Workspace Equilibrado (workspace-balanced)'), value: 'workspace-balanced' },
4786
+ { text: tx('Analítico Calmo (analytics-calm)'), value: 'analytics-calm' },
4787
+ { text: tx('Monitoramento Operacional (ops-monitoring)'), value: 'ops-monitoring' },
4788
+ { text: tx('Centro de Comando Executivo (executive-command-center)'), value: 'executive-command-center' },
4789
+ ],
4790
+ hint: tx('Define densidade, superfície e atmosfera padrão das páginas dinâmicas.'),
4791
+ dataAttributes: { globalPath: 'pages.defaults.themePreset' },
4792
+ },
4793
+ {
4794
+ name: safeName('pages.defaults.shellPreset'),
4795
+ label: tx('Preset padrão de moldura (Widget Shell)'),
4796
+ controlType: FieldControlType.SELECT,
4797
+ selectOptions: [
4798
+ { text: tx('Card Integrado (integrated-card)'), value: 'integrated-card' },
4799
+ { text: tx('Card com Contorno (outlined-card)'), value: 'outlined-card' },
4800
+ { text: tx('Card Elevado (elevated-card)'), value: 'elevated-card' },
4801
+ { text: tx('Card Tonal (tonal-card)'), value: 'tonal-card' },
4802
+ { text: tx('Card Seccionado (sectioned-card)'), value: 'sectioned-card' },
4803
+ { text: tx('Sem Moldura (frameless)'), value: 'frameless' },
4804
+ { text: tx('Painel de Dados (data-panel)'), value: 'data-panel' },
4805
+ { text: tx('Painel de Gráfico (chart-panel)'), value: 'chart-panel' },
4806
+ { text: tx('Painel de Métrica (metric-panel)'), value: 'metric-panel' },
4807
+ { text: tx('Card Executivo (executive-card)'), value: 'executive-card' },
4808
+ { text: tx('Barra de Filtro (filter-bar)'), value: 'filter-bar' },
4809
+ { text: tx('Vidro Escuro (dark-glass)'), value: 'dark-glass' },
4810
+ { text: tx('Vidro Claro (glass-light)'), value: 'glass-light' },
4811
+ { text: tx('Neutro Claro (light-neutral)'), value: 'light-neutral' },
4812
+ { text: tx('Grafite (graphite)'), value: 'graphite' },
4813
+ ],
4814
+ hint: tx('Usado quando nem o widget nem o tema da página definem um preset de shell.'),
4815
+ dataAttributes: { globalPath: 'pages.defaults.shellPreset' },
4816
+ },
4817
+ {
4818
+ name: safeName('pages.defaults.columns'),
4819
+ label: tx('Colunas padrão da grade'),
4820
+ controlType: FieldControlType.INPUT,
4821
+ numericFormat: 'integer',
4822
+ min: 1,
4823
+ max: 12,
4824
+ numericStep: 1,
4825
+ hint: tx('Quantidade padrão de colunas em layouts colunares ou canvas (1 a 12).'),
4826
+ dataAttributes: { globalPath: 'pages.defaults.columns' },
4827
+ },
4828
+ {
4829
+ name: safeName('pages.defaults.gap'),
4830
+ label: tx('Espaçamento padrão entre widgets (gap)'),
4831
+ controlType: FieldControlType.INPUT,
4832
+ placeholder: '16px',
4833
+ hint: tx('Ex.: 12px, 16px, 20px, 1.25rem.'),
4834
+ dataAttributes: { globalPath: 'pages.defaults.gap' },
4835
+ },
4836
+ {
4837
+ name: safeName('pages.defaults.paddingInline'),
4838
+ label: tx('Recuo horizontal padrão (paddingInline)'),
4839
+ controlType: FieldControlType.INPUT,
4840
+ placeholder: '0px',
4841
+ hint: tx('Ex.: 0px, 16px, 24px.'),
4842
+ dataAttributes: { globalPath: 'pages.defaults.paddingInline' },
4843
+ },
4844
+ {
4845
+ name: safeName('pages.defaults.autoRows'),
4846
+ label: tx('Modo padrão de altura de linhas no Canvas'),
4847
+ controlType: FieldControlType.SELECT,
4848
+ selectOptions: [
4849
+ { text: tx('Adaptado ao conteúdo (content)'), value: 'content' },
4850
+ { text: tx('Altura de linha fixa (fixed)'), value: 'fixed' },
4851
+ ],
4852
+ hint: tx('Controla se os blocos no canvas crescem conforme o conteúdo ou seguem rowUnit fixo.'),
4853
+ dataAttributes: { globalPath: 'pages.defaults.autoRows' },
4854
+ },
3308
4855
  ];
3309
4856
  const cfg = {
3310
4857
  sections: [
@@ -3592,6 +5139,34 @@ function buildGlobalConfigFormConfig(translate = (text) => text) {
3592
5139
  },
3593
5140
  ],
3594
5141
  },
5142
+ {
5143
+ id: 'dynamic-pages',
5144
+ title: tx('Dynamic Pages'),
5145
+ rows: [
5146
+ {
5147
+ id: 'pages-row-presets',
5148
+ columns: [
5149
+ {
5150
+ id: 'pages-col-presets-1',
5151
+ fields: [
5152
+ safeName('pages.defaults.layoutPreset'),
5153
+ safeName('pages.defaults.themePreset'),
5154
+ safeName('pages.defaults.shellPreset'),
5155
+ ],
5156
+ },
5157
+ {
5158
+ id: 'pages-col-presets-2',
5159
+ fields: [
5160
+ safeName('pages.defaults.columns'),
5161
+ safeName('pages.defaults.gap'),
5162
+ safeName('pages.defaults.paddingInline'),
5163
+ safeName('pages.defaults.autoRows'),
5164
+ ],
5165
+ },
5166
+ ],
5167
+ },
5168
+ ],
5169
+ },
3595
5170
  ],
3596
5171
  actions: {
3597
5172
  placement: 'afterSections',
@@ -3640,7 +5215,7 @@ class GlobalConfigEditorComponent {
3640
5215
  currentValues = {};
3641
5216
  pathMap = {};
3642
5217
  bootstrappedSections = new Set();
3643
- allSections = ['crud', 'dynamic-fields', 'cache', 'table', 'dialog', 'ai-credentials', 'ai-model', 'ai-embedding'];
5218
+ allSections = ['crud', 'dynamic-fields', 'cache', 'table', 'dialog', 'dynamic-pages', 'ai-credentials', 'ai-model', 'ai-embedding'];
3644
5219
  // SettingsPanel integration signals
3645
5220
  isDirty$ = new BehaviorSubject(false);
3646
5221
  isValid$ = new BehaviorSubject(true);
@@ -3650,6 +5225,7 @@ class GlobalConfigEditorComponent {
3650
5225
  hostCache;
3651
5226
  hostTable;
3652
5227
  hostDialog;
5228
+ hostPages;
3653
5229
  hostAiCredentials;
3654
5230
  hostAiModel;
3655
5231
  hostAiEmbedding;
@@ -3664,7 +5240,10 @@ class GlobalConfigEditorComponent {
3664
5240
  component: 'GlobalConfigEditorComponent',
3665
5241
  };
3666
5242
  providedDynamicFormCtor = inject(GLOBAL_CONFIG_DYNAMIC_FORM_COMPONENT, { optional: true });
3667
- dynamicFormCtor = this.providedDynamicFormCtor ?? null;
5243
+ componentMetadata = inject(ComponentMetadataRegistry, { optional: true });
5244
+ dynamicFormCtor = this.providedDynamicFormCtor ??
5245
+ this.componentMetadata?.get('praxis-dynamic-form')?.component ??
5246
+ null;
3668
5247
  loggedMissingDynamicForm = false;
3669
5248
  // Guardar instância do form da seção 'dialog' para atualizar controles diretamente
3670
5249
  dialogFormInst = null;
@@ -3712,11 +5291,16 @@ class GlobalConfigEditorComponent {
3712
5291
  this.snack = snack;
3713
5292
  }
3714
5293
  async ngOnInit() {
5294
+ await this.refreshStoredConfigState();
5295
+ if (this.destroyRef.destroyed)
5296
+ return;
3715
5297
  const cfg = this.admin.getEffectiveConfig();
3716
5298
  const flat = this.flatten(cfg);
3717
5299
  this.formConfig = buildGlobalConfigFormConfig(this.tx.bind(this));
3718
5300
  this.applyConfigSnapshot(flat, { resetForms: false });
3719
5301
  await this.loadProviderCatalog();
5302
+ if (this.destroyRef.destroyed)
5303
+ return;
3720
5304
  this.applyProviderOptions();
3721
5305
  this.applyEmbeddingProviderOptions();
3722
5306
  const providerSafe = this.safeName('ai.provider');
@@ -3734,10 +5318,9 @@ class GlobalConfigEditorComponent {
3734
5318
  this.syncEmbeddingDefaults(false);
3735
5319
  this.ensureEmbeddingModelDefaults(false);
3736
5320
  this.ensureEmbeddingDimensionsDefaults(false);
3737
- await this.refreshStoredConfigState();
3738
5321
  // Monitor API Key changes to auto-fetch
3739
5322
  this.apiKeyChanged$.pipe(debounceTime(1500), // Wait for typing to stop
3740
- distinctUntilChanged((prev, curr) => prev.apiKey === curr.apiKey && prev.provider === curr.provider), filter(({ apiKey, provider }) => this.canAutoRefreshModels(provider, apiKey))).subscribe(() => {
5323
+ distinctUntilChanged((prev, curr) => prev.apiKey === curr.apiKey && prev.provider === curr.provider), filter(({ apiKey, provider }) => this.canAutoRefreshModels(provider, apiKey)), takeUntilDestroyed(this.destroyRef)).subscribe(() => {
3741
5324
  this.refreshModels();
3742
5325
  });
3743
5326
  if (this.hasApiKey && this.selectedProvider?.supportsModels !== false) {
@@ -3780,7 +5363,11 @@ class GlobalConfigEditorComponent {
3780
5363
  }
3781
5364
  }
3782
5365
  if (this.hasApiKey) {
3783
- setTimeout(() => this.ensureAiModelForm(), 0);
5366
+ setTimeout(() => {
5367
+ if (!this.destroyRef.destroyed) {
5368
+ this.ensureAiModelForm();
5369
+ }
5370
+ }, 0);
3784
5371
  }
3785
5372
  else {
3786
5373
  if (this.aiModelFormRef) {
@@ -3824,9 +5411,17 @@ class GlobalConfigEditorComponent {
3824
5411
  }
3825
5412
  }
3826
5413
  const fms = (this.formConfig.fieldMetadata || []).filter((f) => names.has(f.name));
3827
- return { sections: [sec], fieldMetadata: fms };
5414
+ const framelessSection = { ...sec, title: '' };
5415
+ return {
5416
+ sections: [framelessSection],
5417
+ fieldMetadata: fms,
5418
+ actions: this.formConfig.actions,
5419
+ };
3828
5420
  }
3829
5421
  bootstrapDynamicForms() {
5422
+ if (this.destroyRef.destroyed) {
5423
+ return;
5424
+ }
3830
5425
  if (!this.dynamicFormCtor) {
3831
5426
  if (!this.loggedMissingDynamicForm) {
3832
5427
  this.logger.warnOnce('[GlobalConfigEditor] Dynamic form component was not provided. Set GLOBAL_CONFIG_DYNAMIC_FORM_COMPONENT to enable form rendering.', this.buildLogOptions({ token: 'GLOBAL_CONFIG_DYNAMIC_FORM_COMPONENT' }, { dedupeKey: 'global-config-editor:missing-dynamic-form' }));
@@ -3840,10 +5435,15 @@ class GlobalConfigEditorComponent {
3840
5435
  { id: 'cache', host: this.hostCache, cfg: this.buildSectionConfig('cache') },
3841
5436
  { id: 'table', host: this.hostTable, cfg: this.buildSectionConfig('table') },
3842
5437
  { id: 'dialog', host: this.hostDialog, cfg: this.buildSectionConfig('dialog') },
5438
+ { id: 'dynamic-pages', host: this.hostPages, cfg: this.buildSectionConfig('dynamic-pages') },
3843
5439
  { id: 'ai-credentials', host: this.hostAiCredentials, cfg: this.buildSectionConfig('ai-credentials') },
3844
5440
  { id: 'ai-embedding', host: this.hostAiEmbedding, cfg: this.buildSectionConfig('ai-embedding') },
3845
5441
  ];
3846
5442
  for (const g of groups) {
5443
+ if (this.destroyRef.destroyed) {
5444
+ return;
5445
+ }
5446
+ let ref = null;
3847
5447
  try {
3848
5448
  if (!g.host) {
3849
5449
  this.logger.warnOnce('[GlobalConfigEditor] Missing host for section', this.buildLogOptions({ sectionId: g.id }, {
@@ -3856,7 +5456,7 @@ class GlobalConfigEditorComponent {
3856
5456
  context: { actionId: `section.${g.id}` },
3857
5457
  throttleKey: 'global-config-editor:create-form-section',
3858
5458
  }));
3859
- const ref = g.host.createComponent(this.dynamicFormCtor);
5459
+ ref = g.host.createComponent(this.dynamicFormCtor);
3860
5460
  ref.setInput('config', g.cfg);
3861
5461
  ref.setInput('mode', 'edit');
3862
5462
  // Não habilitar o modo de edição de layout (canvas) - queremos apenas edição de valores
@@ -3884,7 +5484,10 @@ class GlobalConfigEditorComponent {
3884
5484
  }
3885
5485
  catch { }
3886
5486
  if (inst?.valueChange?.subscribe) {
3887
- inst.valueChange.subscribe((ev) => this.onValueChange(g.id, ev));
5487
+ const stream = typeof inst.valueChange.pipe === 'function'
5488
+ ? inst.valueChange.pipe(takeUntilDestroyed(this.destroyRef))
5489
+ : inst.valueChange;
5490
+ stream.subscribe((ev) => this.onValueChange(g.id, ev));
3888
5491
  }
3889
5492
  this.componentRefs.set(g.id, ref);
3890
5493
  if (g.id === 'dialog') {
@@ -3894,12 +5497,27 @@ class GlobalConfigEditorComponent {
3894
5497
  if (g.id === 'ai-embedding') {
3895
5498
  this.aiEmbeddingFormRef = ref;
3896
5499
  }
5500
+ if (this.destroyRef.destroyed) {
5501
+ try {
5502
+ ref.destroy();
5503
+ }
5504
+ catch { }
5505
+ this.componentRefs.delete(g.id);
5506
+ return;
5507
+ }
5508
+ const createdRef = ref;
3897
5509
  this.destroyRef.onDestroy(() => { try {
3898
- ref.destroy();
5510
+ createdRef.destroy();
3899
5511
  }
3900
5512
  catch { } });
3901
5513
  }
3902
5514
  catch (err) {
5515
+ if (ref) {
5516
+ try {
5517
+ ref.destroy();
5518
+ }
5519
+ catch { }
5520
+ }
3903
5521
  this.logger.error('[GlobalConfigEditor] Failed to create form section', this.buildLogOptions({ sectionId: g.id, error: err }, { context: { actionId: `section.${g.id}.create` } }));
3904
5522
  }
3905
5523
  }
@@ -4224,17 +5842,18 @@ class GlobalConfigEditorComponent {
4224
5842
  this.syncEmbeddingDefaults();
4225
5843
  }
4226
5844
  createAiModelForm() {
4227
- if (!this.dynamicFormCtor || !this.hostAiModel)
5845
+ if (this.destroyRef.destroyed || !this.dynamicFormCtor || !this.hostAiModel)
4228
5846
  return;
4229
5847
  const cfg = this.buildSectionConfig('ai-model');
4230
5848
  if (!cfg.sections?.length)
4231
5849
  return;
5850
+ let ref = null;
4232
5851
  try {
4233
5852
  // Apply pending options to metadata before creating
4234
5853
  if (this.pendingModelOptions.length) {
4235
5854
  this.setModelFieldOptions(this.pendingModelOptions);
4236
5855
  }
4237
- const ref = this.hostAiModel.createComponent(this.dynamicFormCtor);
5856
+ ref = this.hostAiModel.createComponent(this.dynamicFormCtor);
4238
5857
  ref.setInput('config', cfg);
4239
5858
  ref.setInput('mode', 'edit');
4240
5859
  ref.setInput('enableCustomization', false);
@@ -4260,17 +5879,34 @@ class GlobalConfigEditorComponent {
4260
5879
  }
4261
5880
  catch { }
4262
5881
  if (inst?.valueChange?.subscribe) {
4263
- inst.valueChange.subscribe((ev) => this.onValueChange('ai-model', ev));
5882
+ const stream = typeof inst.valueChange.pipe === 'function'
5883
+ ? inst.valueChange.pipe(takeUntilDestroyed(this.destroyRef))
5884
+ : inst.valueChange;
5885
+ stream.subscribe((ev) => this.onValueChange('ai-model', ev));
5886
+ }
5887
+ if (this.destroyRef.destroyed) {
5888
+ try {
5889
+ ref.destroy();
5890
+ }
5891
+ catch { }
5892
+ return;
4264
5893
  }
4265
5894
  this.componentRefs.set('ai-model', ref);
4266
5895
  this.aiModelFormRef = ref;
4267
5896
  this.updateModelDetails(this.currentValues[this.safeName('ai.model')] || '');
5897
+ const createdRef = ref;
4268
5898
  this.destroyRef.onDestroy(() => { try {
4269
- ref.destroy();
5899
+ createdRef.destroy();
4270
5900
  }
4271
5901
  catch { } });
4272
5902
  }
4273
5903
  catch (err) {
5904
+ if (ref) {
5905
+ try {
5906
+ ref.destroy();
5907
+ }
5908
+ catch { }
5909
+ }
4274
5910
  this.logger.error('[GlobalConfigEditor] Failed to create AI model form', this.buildLogOptions({ error: err }, { context: { actionId: 'section.ai-model.create' } }));
4275
5911
  }
4276
5912
  }
@@ -4308,15 +5944,23 @@ class GlobalConfigEditorComponent {
4308
5944
  }
4309
5945
  // SettingsPanel expects these methods
4310
5946
  reset() {
4311
- const flat = {};
4312
- for (const safe of Object.keys(this.initialValues))
4313
- flat[safe] = this.initialValues[safe];
4314
- for (const fm of this.formConfig.fieldMetadata || []) {
4315
- const v = flat[fm.name];
5947
+ const resetValues = {};
5948
+ for (const safe of Object.keys(this.pathMap)) {
5949
+ if (safe in this.initialValues) {
5950
+ resetValues[safe] = this.initialValues[safe];
5951
+ }
5952
+ else {
5953
+ resetValues[safe] = null;
5954
+ }
5955
+ }
5956
+ for (const fm of this.formConfig?.fieldMetadata || []) {
5957
+ const v = this.initialValues[fm.name];
4316
5958
  fm.defaultValue = v;
4317
5959
  }
4318
5960
  this.currentValues = { ...this.initialValues };
5961
+ this.patchFormsWithValues(resetValues);
4319
5962
  this.isDirty$.next(false);
5963
+ this.cdr.detectChanges();
4320
5964
  }
4321
5965
  getSettingsValue() {
4322
5966
  const flat = this.buildChangedValues();
@@ -4324,7 +5968,8 @@ class GlobalConfigEditorComponent {
4324
5968
  }
4325
5969
  async onSave() {
4326
5970
  const partial = this.getSettingsValue();
4327
- const validationMessage = this.validateCompactTableAppearancePayload(partial);
5971
+ const validationMessage = this.validateCompactTableAppearancePayload(partial) ||
5972
+ this.validatePagesDefaultsPayload(partial);
4328
5973
  if (validationMessage) {
4329
5974
  try {
4330
5975
  this.snack.open(validationMessage, undefined, { duration: 5000 });
@@ -4338,6 +5983,8 @@ class GlobalConfigEditorComponent {
4338
5983
  // Update baseline after save
4339
5984
  this.initialValues = { ...this.currentValues };
4340
5985
  this.isDirty$.next(false);
5986
+ await this.refreshStoredConfigState();
5987
+ this.cdr.detectChanges();
4341
5988
  try {
4342
5989
  this.snack.open(this.tx('Settings saved'), undefined, { duration: 2000 });
4343
5990
  }
@@ -4528,8 +6175,26 @@ class GlobalConfigEditorComponent {
4528
6175
  return this.tx('Save failed.');
4529
6176
  }
4530
6177
  normalizeFieldValue(path, value) {
6178
+ if (path === 'pages.defaults.columns') {
6179
+ if (typeof value === 'number' && Number.isFinite(value)) {
6180
+ return Math.max(1, Math.min(12, Math.round(value)));
6181
+ }
6182
+ if (typeof value === 'string') {
6183
+ const trimmed = value.trim();
6184
+ if (!trimmed)
6185
+ return null;
6186
+ const parsed = Number(trimmed);
6187
+ return Number.isFinite(parsed)
6188
+ ? Math.max(1, Math.min(12, Math.round(parsed)))
6189
+ : value;
6190
+ }
6191
+ return value;
6192
+ }
4531
6193
  if (typeof value !== 'string')
4532
6194
  return value;
6195
+ if (path === 'pages.defaults.gap' || path === 'pages.defaults.paddingInline') {
6196
+ return value.trim();
6197
+ }
4533
6198
  if (!TABLE_COMPACT_SPACING_PATHS.has(path) && !TABLE_COMPACT_FONT_SIZE_PATHS.has(path)) {
4534
6199
  return value;
4535
6200
  }
@@ -4577,6 +6242,36 @@ class GlobalConfigEditorComponent {
4577
6242
  }
4578
6243
  return null;
4579
6244
  }
6245
+ validatePagesDefaultsPayload(partial) {
6246
+ const defaults = partial?.pages?.defaults;
6247
+ if (!defaults || typeof defaults !== 'object')
6248
+ return null;
6249
+ const checks = [
6250
+ {
6251
+ path: 'pages.defaults.gap',
6252
+ label: 'pages.defaults.gap',
6253
+ value: defaults.gap,
6254
+ example: '16px',
6255
+ },
6256
+ {
6257
+ path: 'pages.defaults.paddingInline',
6258
+ label: 'pages.defaults.paddingInline',
6259
+ value: defaults.paddingInline,
6260
+ example: '0px',
6261
+ },
6262
+ ];
6263
+ for (const check of checks) {
6264
+ if (typeof check.value !== 'string')
6265
+ continue;
6266
+ const normalized = this.normalizeFieldValue(check.path, check.value);
6267
+ if (!normalized)
6268
+ continue;
6269
+ if (!TABLE_COMPACT_SPACING_REGEX.test(normalized)) {
6270
+ return `Invalid value in ${check.label}. Use a valid CSS measure, such as ${check.example}.`;
6271
+ }
6272
+ }
6273
+ return null;
6274
+ }
4580
6275
  getVariantIcon(key) {
4581
6276
  const safe = this.safeName(`dialog.variants.${key}.icon`);
4582
6277
  return this.currentValues[safe];
@@ -4676,7 +6371,7 @@ class GlobalConfigEditorComponent {
4676
6371
  return true;
4677
6372
  }
4678
6373
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: GlobalConfigEditorComponent, deps: [{ token: GlobalConfigAdminService }, { token: i2$1.MatSnackBar }], target: i0.ɵɵFactoryTarget.Component });
4679
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: GlobalConfigEditorComponent, isStandalone: true, selector: "praxis-global-config-editor", viewQueries: [{ propertyName: "hostCrud", first: true, predicate: ["hostCrud"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "hostFields", first: true, predicate: ["hostFields"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "hostCache", first: true, predicate: ["hostCache"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "hostTable", first: true, predicate: ["hostTable"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "hostDialog", first: true, predicate: ["hostDialog"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "hostAiCredentials", first: true, predicate: ["hostAiCredentials"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "hostAiModel", first: true, predicate: ["hostAiModel"], descendants: true, read: ViewContainerRef }, { propertyName: "hostAiEmbedding", first: true, predicate: ["hostAiEmbedding"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: `
6374
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: GlobalConfigEditorComponent, isStandalone: true, selector: "praxis-global-config-editor", viewQueries: [{ propertyName: "hostCrud", first: true, predicate: ["hostCrud"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "hostFields", first: true, predicate: ["hostFields"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "hostCache", first: true, predicate: ["hostCache"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "hostTable", first: true, predicate: ["hostTable"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "hostDialog", first: true, predicate: ["hostDialog"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "hostPages", first: true, predicate: ["hostPages"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "hostAiCredentials", first: true, predicate: ["hostAiCredentials"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "hostAiModel", first: true, predicate: ["hostAiModel"], descendants: true, read: ViewContainerRef }, { propertyName: "hostAiEmbedding", first: true, predicate: ["hostAiEmbedding"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: `
4680
6375
  <mat-accordion multi>
4681
6376
  <mat-expansion-panel>
4682
6377
  <mat-expansion-panel-header>
@@ -4974,8 +6669,18 @@ class GlobalConfigEditorComponent {
4974
6669
  <div class="dlg-icon-helpers__hint">{{ tx('The text field above remains editable. These buttons only help with selection/clear preview.') }}</div>
4975
6670
  </div>
4976
6671
  </mat-expansion-panel>
6672
+ <mat-expansion-panel>
6673
+ <mat-expansion-panel-header>
6674
+ <mat-panel-title>
6675
+ <mat-icon class="panel-icon">dashboard_customize</mat-icon>
6676
+ {{ tx('Dynamic Pages') }}
6677
+ </mat-panel-title>
6678
+ <mat-panel-description>{{ tx('Global presets for layout, theme, widget shell and canvas grid') }}</mat-panel-description>
6679
+ </mat-expansion-panel-header>
6680
+ <ng-template #hostPages></ng-template>
6681
+ </mat-expansion-panel>
4977
6682
  </mat-accordion>
4978
- `, isInline: true, styles: [".dlg-icon-helpers{margin:12px 16px 4px;padding:12px;border:1px dashed var(--md-sys-color-outline-variant);border-radius:var(--md-sys-shape-corner-small, 8px)}.dlg-icon-helpers__head{font-weight:600;margin-bottom:8px;opacity:.8}.dlg-icon-helpers__row{display:flex;align-items:center;gap:12px;padding:6px 0}.dlg-icon-helpers__label{text-transform:capitalize;width:96px;opacity:.8}.dlg-icon-helpers__preview{width:24px;height:24px}.dlg-icon-helpers__value{font-family:monospace;font-size:12px;opacity:.8}.dlg-icon-helpers__hint{margin-top:8px;font-size:12px;opacity:.7}.panel-icon{margin-right:12px;color:var(--md-sys-color-primary)}.ai-config-container{padding:16px;display:flex;flex-direction:column;gap:24px}.ai-config-source{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border-radius:var(--md-sys-shape-corner-medium, 10px);border:1px dashed var(--md-sys-color-outline-variant);background:var(--md-sys-color-surface-container-low);font-size:12px;color:var(--md-sys-color-on-surface-variant);flex-wrap:wrap}.ai-config-source__meta{display:inline-flex;align-items:center;gap:8px}.ai-action-btn--clear{background:var(--md-sys-color-error-container);color:var(--md-sys-color-on-error-container);--mdc-outlined-button-container-color: var(--md-sys-color-error-container);--mdc-outlined-button-label-text-color: var(--md-sys-color-on-error-container);--mdc-outlined-button-outline-color: var(--md-sys-color-error);--mat-mdc-button-persistent-ripple-color: var(--md-sys-color-on-error-container);--mat-mdc-button-ripple-color: var(--md-sys-color-on-error-container)}.ai-action-btn--clear:hover{background:var(--md-sys-color-error-container)}.ai-group-title{display:flex;align-items:center;gap:8px;font-weight:500;font-size:14px;color:var(--md-sys-color-primary);margin-bottom:12px;border-bottom:1px solid var(--md-sys-color-outline-variant);padding-bottom:4px}.ai-group-title mat-icon{font-size:20px;width:20px;height:20px}.ai-group ::ng-deep .form-actions,.ai-group ::ng-deep button[type=submit]{display:none!important}.ai-credentials-row{display:flex;align-items:flex-start;gap:16px;flex-wrap:wrap}.ai-group-header{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.ai-provider-summary{display:flex;align-items:center;gap:12px;padding:8px 12px;border-radius:var(--md-sys-shape-corner-medium, 10px);background:var(--md-sys-color-surface-variant);border:1px solid var(--md-sys-color-outline-variant);margin:8px 0 4px;flex-wrap:wrap}.ai-provider-icon{width:32px;height:32px;border-radius:var(--md-sys-shape-corner-small, 8px);border:1px solid var(--md-sys-color-outline-variant);display:flex;align-items:center;justify-content:center;background:var(--md-sys-color-surface);color:var(--md-sys-color-primary);flex:0 0 auto}.provider-svg{width:18px;height:18px}.ai-provider-meta{display:flex;flex-direction:column;gap:2px;min-width:200px;flex:1 1 auto}.ai-provider-name{font-weight:600;font-size:13px}.ai-provider-desc{font-size:12px;opacity:.75}.ai-provider-key{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;border:1px solid var(--md-sys-color-outline-variant);background:var(--md-sys-color-surface-container-lowest);color:var(--md-sys-color-on-surface-variant);font-size:11px;font-weight:600;letter-spacing:.2px;box-shadow:var(--md-sys-elevation-level1, 0 1px 2px rgba(0,0,0,.2))}.ai-provider-key mat-icon{width:16px;height:16px;font-size:16px}.ai-provider-key.is-present{background:var(--md-sys-color-primary-container);color:var(--md-sys-color-on-primary-container);border-color:var(--md-sys-color-primary)}.ai-provider-key.is-saved{background:var(--md-sys-color-secondary-container);color:var(--md-sys-color-on-secondary-container);border-color:var(--md-sys-color-secondary)}.ai-provider-key.is-missing{background:var(--md-sys-color-surface-container-low);color:var(--md-sys-color-on-surface-variant);border-style:dashed;opacity:.9}.ai-provider-key.is-unlocked{background:var(--md-sys-color-tertiary-container);color:var(--md-sys-color-on-tertiary-container);border-color:var(--md-sys-color-tertiary)}.ai-action-btn{display:inline-flex;align-items:center;gap:8px;height:40px;padding:0 14px;min-width:168px;border-radius:var(--md-sys-shape-corner-medium, 12px);white-space:nowrap;background:var(--md-sys-color-secondary-container);color:var(--md-sys-color-on-secondary-container);border-color:var(--md-sys-color-outline-variant);box-shadow:var(--md-sys-elevation-level1, 0 1px 2px rgba(0,0,0,.2));transition:background-color .15s ease,box-shadow .15s ease,transform .06s ease;--mdc-outlined-button-container-color: var(--md-sys-color-secondary-container);--mdc-outlined-button-label-text-color: var(--md-sys-color-on-secondary-container);--mdc-outlined-button-outline-color: var(--md-sys-color-outline-variant);--mat-mdc-button-persistent-ripple-color: var(--md-sys-color-on-secondary-container);--mat-mdc-button-ripple-color: var(--md-sys-color-on-secondary-container)}.ai-action-btn .mat-button-wrapper,.ai-action-btn .mdc-button__label{display:inline-flex;align-items:center;gap:8px;line-height:1;height:100%}.ai-action-btn .mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.ai-action-btn .ai-action-label{display:inline-flex;align-items:center;line-height:1}.ai-action-btn .mat-progress-spinner,.ai-action-btn .btn-spinner{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle}.ai-action-btn:hover{background:var(--md-sys-color-secondary-container);box-shadow:var(--md-sys-elevation-level2, 0 2px 6px rgba(0,0,0,.25))}.ai-action-btn:active{transform:translateY(1px)}.ai-action-btn:focus-visible{outline:2px solid var(--md-sys-color-primary);outline-offset:2px}.ai-action-btn.is-success{background:var(--md-sys-color-tertiary-container);color:var(--md-sys-color-on-tertiary-container);border-color:var(--md-sys-color-tertiary);--mdc-outlined-button-container-color: var(--md-sys-color-tertiary-container);--mdc-outlined-button-label-text-color: var(--md-sys-color-on-tertiary-container);--mdc-outlined-button-outline-color: var(--md-sys-color-tertiary);--mat-mdc-button-persistent-ripple-color: var(--md-sys-color-on-tertiary-container);--mat-mdc-button-ripple-color: var(--md-sys-color-on-tertiary-container)}.ai-action-btn.is-success:hover{background:var(--md-sys-color-tertiary-container)}.ai-action-btn:disabled{background:var(--md-sys-color-surface-container-low);color:var(--md-sys-color-on-surface-variant);border-color:var(--md-sys-color-outline-variant);box-shadow:none;opacity:.7}.ai-form-inline{flex:1;min-width:300px}.ai-credentials-row button{margin-top:4px;height:40px}.btn-spinner{margin-right:8px}.ai-feedback{margin-top:8px;display:flex;align-items:center;gap:8px;padding:8px 12px;background:var(--md-sys-color-error-container);color:var(--md-sys-color-on-error-container);border-radius:var(--md-sys-shape-corner-extra-small, 4px);font-size:13px}.ai-feedback--warn{background:var(--md-sys-color-tertiary-container);color:var(--md-sys-color-on-tertiary-container)}.disabled-group{opacity:.6;pointer-events:none}.ai-model-content{display:flex;flex-direction:column;gap:8px}.ai-model-controls{display:flex;align-items:flex-start;gap:8px}.ai-model-controls ::ng-deep praxis-dynamic-form{flex:1}.ai-model-details{font-size:12px;color:var(--md-sys-color-on-surface-variant);margin-left:4px}.ai-subtext{font-size:12px;color:var(--md-sys-color-on-surface-variant)}.ai-header-actions{display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap}.ai-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px;background:var(--md-sys-color-surface-container-low);border-radius:var(--md-sys-shape-corner-small, 8px);color:var(--md-sys-color-outline);gap:8px;text-align:center;font-size:13px}.spin{animation:spin 1s linear infinite}@keyframes spin{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}\n"], dependencies: [{ kind: "ngmodule", type: MatSnackBarModule }, { kind: "ngmodule", type: MatExpansionModule }, { kind: "directive", type: i3$1.MatAccordion, selector: "mat-accordion", inputs: ["hideToggle", "displayMode", "togglePosition"], exportAs: ["matAccordion"] }, { kind: "component", type: i3$1.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i3$1.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "directive", type: i3$1.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "directive", type: i3$1.MatExpansionPanelDescription, selector: "mat-panel-description" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i7.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i8.MatChipOption, selector: "mat-basic-chip-option, [mat-basic-chip-option], mat-chip-option, [mat-chip-option]", inputs: ["selectable", "selected"], outputs: ["selectionChange"] }, { kind: "component", type: PraxisIconButtonComponent, selector: "button[praxisIconButton]", inputs: ["praxisIconButton", "size", "appearance", "presentation", "pressed", "busy"] }, { kind: "directive", type: PraxisIconDirective, selector: "mat-icon[praxisIcon]", inputs: ["praxisIcon"] }] });
6683
+ `, isInline: true, styles: [".dlg-icon-helpers{margin:12px 16px 4px;padding:12px;border:1px dashed var(--md-sys-color-outline-variant);border-radius:var(--md-sys-shape-corner-small, 8px)}.dlg-icon-helpers__head{font-weight:600;margin-bottom:8px;opacity:.8}.dlg-icon-helpers__row{display:flex;align-items:center;gap:12px;padding:6px 0}.dlg-icon-helpers__label{text-transform:capitalize;width:96px;opacity:.8}.dlg-icon-helpers__preview{width:24px;height:24px}.dlg-icon-helpers__value{font-family:monospace;font-size:12px;opacity:.8}.dlg-icon-helpers__hint{margin-top:8px;font-size:12px;opacity:.7}.panel-icon{margin-right:12px;color:var(--md-sys-color-primary);flex-shrink:0}:host ::ng-deep .mat-expansion-panel-header{height:auto!important;min-height:54px;padding-block:10px}:host ::ng-deep .mat-expansion-panel-header-title,:host ::ng-deep .mat-expansion-panel-header-description{line-height:1.35}:host ::ng-deep .mat-expansion-panel-body .form-section{border:none;background:transparent;box-shadow:none;padding:4px 0 0}@media(max-width:560px){:host ::ng-deep .mat-expansion-panel-header .mat-content{flex-direction:column;align-items:flex-start;gap:4px}:host ::ng-deep .mat-expansion-panel-header-title,:host ::ng-deep .mat-expansion-panel-header-description{margin-right:0}}.ai-config-container{padding:16px;display:flex;flex-direction:column;gap:24px}.ai-config-source{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border-radius:var(--md-sys-shape-corner-medium, 10px);border:1px dashed var(--md-sys-color-outline-variant);background:var(--md-sys-color-surface-container-low);font-size:12px;color:var(--md-sys-color-on-surface-variant);flex-wrap:wrap}.ai-config-source__meta{display:inline-flex;align-items:center;gap:8px}.ai-action-btn--clear{background:var(--md-sys-color-error-container);color:var(--md-sys-color-on-error-container);--mdc-outlined-button-container-color: var(--md-sys-color-error-container);--mdc-outlined-button-label-text-color: var(--md-sys-color-on-error-container);--mdc-outlined-button-outline-color: var(--md-sys-color-error);--mat-mdc-button-persistent-ripple-color: var(--md-sys-color-on-error-container);--mat-mdc-button-ripple-color: var(--md-sys-color-on-error-container)}.ai-action-btn--clear:hover{background:var(--md-sys-color-error-container)}.ai-group-title{display:flex;align-items:center;gap:8px;font-weight:500;font-size:14px;color:var(--md-sys-color-primary);margin-bottom:12px;border-bottom:1px solid var(--md-sys-color-outline-variant);padding-bottom:4px}.ai-group-title mat-icon{font-size:20px;width:20px;height:20px}.ai-group ::ng-deep .form-actions,.ai-group ::ng-deep button[type=submit]{display:none!important}.ai-credentials-row{display:flex;align-items:flex-start;gap:16px;flex-wrap:wrap}.ai-group-header{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.ai-provider-summary{display:flex;align-items:center;gap:12px;padding:8px 12px;border-radius:var(--md-sys-shape-corner-medium, 10px);background:var(--md-sys-color-surface-variant);border:1px solid var(--md-sys-color-outline-variant);margin:8px 0 4px;flex-wrap:wrap}.ai-provider-icon{width:32px;height:32px;border-radius:var(--md-sys-shape-corner-small, 8px);border:1px solid var(--md-sys-color-outline-variant);display:flex;align-items:center;justify-content:center;background:var(--md-sys-color-surface);color:var(--md-sys-color-primary);flex:0 0 auto}.provider-svg{width:18px;height:18px}.ai-provider-meta{display:flex;flex-direction:column;gap:2px;min-width:200px;flex:1 1 auto}.ai-provider-name{font-weight:600;font-size:13px}.ai-provider-desc{font-size:12px;opacity:.75}.ai-provider-key{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;border:1px solid var(--md-sys-color-outline-variant);background:var(--md-sys-color-surface-container-lowest);color:var(--md-sys-color-on-surface-variant);font-size:11px;font-weight:600;letter-spacing:.2px;box-shadow:var(--md-sys-elevation-level1, 0 1px 2px rgba(0,0,0,.2))}.ai-provider-key mat-icon{width:16px;height:16px;font-size:16px}.ai-provider-key.is-present{background:var(--md-sys-color-primary-container);color:var(--md-sys-color-on-primary-container);border-color:var(--md-sys-color-primary)}.ai-provider-key.is-saved{background:var(--md-sys-color-secondary-container);color:var(--md-sys-color-on-secondary-container);border-color:var(--md-sys-color-secondary)}.ai-provider-key.is-missing{background:var(--md-sys-color-surface-container-low);color:var(--md-sys-color-on-surface-variant);border-style:dashed;opacity:.9}.ai-provider-key.is-unlocked{background:var(--md-sys-color-tertiary-container);color:var(--md-sys-color-on-tertiary-container);border-color:var(--md-sys-color-tertiary)}.ai-action-btn{display:inline-flex;align-items:center;gap:8px;height:40px;padding:0 14px;min-width:168px;border-radius:var(--md-sys-shape-corner-medium, 12px);white-space:nowrap;background:var(--md-sys-color-secondary-container);color:var(--md-sys-color-on-secondary-container);border-color:var(--md-sys-color-outline-variant);box-shadow:var(--md-sys-elevation-level1, 0 1px 2px rgba(0,0,0,.2));transition:background-color .15s ease,box-shadow .15s ease,transform .06s ease;--mdc-outlined-button-container-color: var(--md-sys-color-secondary-container);--mdc-outlined-button-label-text-color: var(--md-sys-color-on-secondary-container);--mdc-outlined-button-outline-color: var(--md-sys-color-outline-variant);--mat-mdc-button-persistent-ripple-color: var(--md-sys-color-on-secondary-container);--mat-mdc-button-ripple-color: var(--md-sys-color-on-secondary-container)}.ai-action-btn .mat-button-wrapper,.ai-action-btn .mdc-button__label{display:inline-flex;align-items:center;gap:8px;line-height:1;height:100%}.ai-action-btn .mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.ai-action-btn .ai-action-label{display:inline-flex;align-items:center;line-height:1}.ai-action-btn .mat-progress-spinner,.ai-action-btn .btn-spinner{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle}.ai-action-btn:hover{background:var(--md-sys-color-secondary-container);box-shadow:var(--md-sys-elevation-level2, 0 2px 6px rgba(0,0,0,.25))}.ai-action-btn:active{transform:translateY(1px)}.ai-action-btn:focus-visible{outline:2px solid var(--md-sys-color-primary);outline-offset:2px}.ai-action-btn.is-success{background:var(--md-sys-color-tertiary-container);color:var(--md-sys-color-on-tertiary-container);border-color:var(--md-sys-color-tertiary);--mdc-outlined-button-container-color: var(--md-sys-color-tertiary-container);--mdc-outlined-button-label-text-color: var(--md-sys-color-on-tertiary-container);--mdc-outlined-button-outline-color: var(--md-sys-color-tertiary);--mat-mdc-button-persistent-ripple-color: var(--md-sys-color-on-tertiary-container);--mat-mdc-button-ripple-color: var(--md-sys-color-on-tertiary-container)}.ai-action-btn.is-success:hover{background:var(--md-sys-color-tertiary-container)}.ai-action-btn:disabled{background:var(--md-sys-color-surface-container-low);color:var(--md-sys-color-on-surface-variant);border-color:var(--md-sys-color-outline-variant);box-shadow:none;opacity:.7}.ai-form-inline{flex:1;min-width:300px}.ai-credentials-row button{margin-top:4px;height:40px}.btn-spinner{margin-right:8px}.ai-feedback{margin-top:8px;display:flex;align-items:center;gap:8px;padding:8px 12px;background:var(--md-sys-color-error-container);color:var(--md-sys-color-on-error-container);border-radius:var(--md-sys-shape-corner-extra-small, 4px);font-size:13px}.ai-feedback--warn{background:var(--md-sys-color-tertiary-container);color:var(--md-sys-color-on-tertiary-container)}.disabled-group{opacity:.6;pointer-events:none}.ai-model-content{display:flex;flex-direction:column;gap:8px}.ai-model-controls{display:flex;align-items:flex-start;gap:8px}.ai-model-controls ::ng-deep praxis-dynamic-form{flex:1}.ai-model-details{font-size:12px;color:var(--md-sys-color-on-surface-variant);margin-left:4px}.ai-subtext{font-size:12px;color:var(--md-sys-color-on-surface-variant)}.ai-header-actions{display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap}.ai-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px;background:var(--md-sys-color-surface-container-low);border-radius:var(--md-sys-shape-corner-small, 8px);color:var(--md-sys-color-outline);gap:8px;text-align:center;font-size:13px}.spin{animation:spin 1s linear infinite}@keyframes spin{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}\n"], dependencies: [{ kind: "ngmodule", type: MatSnackBarModule }, { kind: "ngmodule", type: MatExpansionModule }, { kind: "directive", type: i3$1.MatAccordion, selector: "mat-accordion", inputs: ["hideToggle", "displayMode", "togglePosition"], exportAs: ["matAccordion"] }, { kind: "component", type: i3$1.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i3$1.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "directive", type: i3$1.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "directive", type: i3$1.MatExpansionPanelDescription, selector: "mat-panel-description" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i7.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i8.MatChipOption, selector: "mat-basic-chip-option, [mat-basic-chip-option], mat-chip-option, [mat-chip-option]", inputs: ["selectable", "selected"], outputs: ["selectionChange"] }, { kind: "component", type: PraxisIconButtonComponent, selector: "button[praxisIconButton]", inputs: ["praxisIconButton", "size", "appearance", "presentation", "pressed", "busy"] }, { kind: "directive", type: PraxisIconDirective, selector: "mat-icon[praxisIcon]", inputs: ["praxisIcon"] }] });
4979
6684
  }
4980
6685
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: GlobalConfigEditorComponent, decorators: [{
4981
6686
  type: Component,
@@ -5277,8 +6982,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
5277
6982
  <div class="dlg-icon-helpers__hint">{{ tx('The text field above remains editable. These buttons only help with selection/clear preview.') }}</div>
5278
6983
  </div>
5279
6984
  </mat-expansion-panel>
6985
+ <mat-expansion-panel>
6986
+ <mat-expansion-panel-header>
6987
+ <mat-panel-title>
6988
+ <mat-icon class="panel-icon">dashboard_customize</mat-icon>
6989
+ {{ tx('Dynamic Pages') }}
6990
+ </mat-panel-title>
6991
+ <mat-panel-description>{{ tx('Global presets for layout, theme, widget shell and canvas grid') }}</mat-panel-description>
6992
+ </mat-expansion-panel-header>
6993
+ <ng-template #hostPages></ng-template>
6994
+ </mat-expansion-panel>
5280
6995
  </mat-accordion>
5281
- `, styles: [".dlg-icon-helpers{margin:12px 16px 4px;padding:12px;border:1px dashed var(--md-sys-color-outline-variant);border-radius:var(--md-sys-shape-corner-small, 8px)}.dlg-icon-helpers__head{font-weight:600;margin-bottom:8px;opacity:.8}.dlg-icon-helpers__row{display:flex;align-items:center;gap:12px;padding:6px 0}.dlg-icon-helpers__label{text-transform:capitalize;width:96px;opacity:.8}.dlg-icon-helpers__preview{width:24px;height:24px}.dlg-icon-helpers__value{font-family:monospace;font-size:12px;opacity:.8}.dlg-icon-helpers__hint{margin-top:8px;font-size:12px;opacity:.7}.panel-icon{margin-right:12px;color:var(--md-sys-color-primary)}.ai-config-container{padding:16px;display:flex;flex-direction:column;gap:24px}.ai-config-source{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border-radius:var(--md-sys-shape-corner-medium, 10px);border:1px dashed var(--md-sys-color-outline-variant);background:var(--md-sys-color-surface-container-low);font-size:12px;color:var(--md-sys-color-on-surface-variant);flex-wrap:wrap}.ai-config-source__meta{display:inline-flex;align-items:center;gap:8px}.ai-action-btn--clear{background:var(--md-sys-color-error-container);color:var(--md-sys-color-on-error-container);--mdc-outlined-button-container-color: var(--md-sys-color-error-container);--mdc-outlined-button-label-text-color: var(--md-sys-color-on-error-container);--mdc-outlined-button-outline-color: var(--md-sys-color-error);--mat-mdc-button-persistent-ripple-color: var(--md-sys-color-on-error-container);--mat-mdc-button-ripple-color: var(--md-sys-color-on-error-container)}.ai-action-btn--clear:hover{background:var(--md-sys-color-error-container)}.ai-group-title{display:flex;align-items:center;gap:8px;font-weight:500;font-size:14px;color:var(--md-sys-color-primary);margin-bottom:12px;border-bottom:1px solid var(--md-sys-color-outline-variant);padding-bottom:4px}.ai-group-title mat-icon{font-size:20px;width:20px;height:20px}.ai-group ::ng-deep .form-actions,.ai-group ::ng-deep button[type=submit]{display:none!important}.ai-credentials-row{display:flex;align-items:flex-start;gap:16px;flex-wrap:wrap}.ai-group-header{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.ai-provider-summary{display:flex;align-items:center;gap:12px;padding:8px 12px;border-radius:var(--md-sys-shape-corner-medium, 10px);background:var(--md-sys-color-surface-variant);border:1px solid var(--md-sys-color-outline-variant);margin:8px 0 4px;flex-wrap:wrap}.ai-provider-icon{width:32px;height:32px;border-radius:var(--md-sys-shape-corner-small, 8px);border:1px solid var(--md-sys-color-outline-variant);display:flex;align-items:center;justify-content:center;background:var(--md-sys-color-surface);color:var(--md-sys-color-primary);flex:0 0 auto}.provider-svg{width:18px;height:18px}.ai-provider-meta{display:flex;flex-direction:column;gap:2px;min-width:200px;flex:1 1 auto}.ai-provider-name{font-weight:600;font-size:13px}.ai-provider-desc{font-size:12px;opacity:.75}.ai-provider-key{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;border:1px solid var(--md-sys-color-outline-variant);background:var(--md-sys-color-surface-container-lowest);color:var(--md-sys-color-on-surface-variant);font-size:11px;font-weight:600;letter-spacing:.2px;box-shadow:var(--md-sys-elevation-level1, 0 1px 2px rgba(0,0,0,.2))}.ai-provider-key mat-icon{width:16px;height:16px;font-size:16px}.ai-provider-key.is-present{background:var(--md-sys-color-primary-container);color:var(--md-sys-color-on-primary-container);border-color:var(--md-sys-color-primary)}.ai-provider-key.is-saved{background:var(--md-sys-color-secondary-container);color:var(--md-sys-color-on-secondary-container);border-color:var(--md-sys-color-secondary)}.ai-provider-key.is-missing{background:var(--md-sys-color-surface-container-low);color:var(--md-sys-color-on-surface-variant);border-style:dashed;opacity:.9}.ai-provider-key.is-unlocked{background:var(--md-sys-color-tertiary-container);color:var(--md-sys-color-on-tertiary-container);border-color:var(--md-sys-color-tertiary)}.ai-action-btn{display:inline-flex;align-items:center;gap:8px;height:40px;padding:0 14px;min-width:168px;border-radius:var(--md-sys-shape-corner-medium, 12px);white-space:nowrap;background:var(--md-sys-color-secondary-container);color:var(--md-sys-color-on-secondary-container);border-color:var(--md-sys-color-outline-variant);box-shadow:var(--md-sys-elevation-level1, 0 1px 2px rgba(0,0,0,.2));transition:background-color .15s ease,box-shadow .15s ease,transform .06s ease;--mdc-outlined-button-container-color: var(--md-sys-color-secondary-container);--mdc-outlined-button-label-text-color: var(--md-sys-color-on-secondary-container);--mdc-outlined-button-outline-color: var(--md-sys-color-outline-variant);--mat-mdc-button-persistent-ripple-color: var(--md-sys-color-on-secondary-container);--mat-mdc-button-ripple-color: var(--md-sys-color-on-secondary-container)}.ai-action-btn .mat-button-wrapper,.ai-action-btn .mdc-button__label{display:inline-flex;align-items:center;gap:8px;line-height:1;height:100%}.ai-action-btn .mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.ai-action-btn .ai-action-label{display:inline-flex;align-items:center;line-height:1}.ai-action-btn .mat-progress-spinner,.ai-action-btn .btn-spinner{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle}.ai-action-btn:hover{background:var(--md-sys-color-secondary-container);box-shadow:var(--md-sys-elevation-level2, 0 2px 6px rgba(0,0,0,.25))}.ai-action-btn:active{transform:translateY(1px)}.ai-action-btn:focus-visible{outline:2px solid var(--md-sys-color-primary);outline-offset:2px}.ai-action-btn.is-success{background:var(--md-sys-color-tertiary-container);color:var(--md-sys-color-on-tertiary-container);border-color:var(--md-sys-color-tertiary);--mdc-outlined-button-container-color: var(--md-sys-color-tertiary-container);--mdc-outlined-button-label-text-color: var(--md-sys-color-on-tertiary-container);--mdc-outlined-button-outline-color: var(--md-sys-color-tertiary);--mat-mdc-button-persistent-ripple-color: var(--md-sys-color-on-tertiary-container);--mat-mdc-button-ripple-color: var(--md-sys-color-on-tertiary-container)}.ai-action-btn.is-success:hover{background:var(--md-sys-color-tertiary-container)}.ai-action-btn:disabled{background:var(--md-sys-color-surface-container-low);color:var(--md-sys-color-on-surface-variant);border-color:var(--md-sys-color-outline-variant);box-shadow:none;opacity:.7}.ai-form-inline{flex:1;min-width:300px}.ai-credentials-row button{margin-top:4px;height:40px}.btn-spinner{margin-right:8px}.ai-feedback{margin-top:8px;display:flex;align-items:center;gap:8px;padding:8px 12px;background:var(--md-sys-color-error-container);color:var(--md-sys-color-on-error-container);border-radius:var(--md-sys-shape-corner-extra-small, 4px);font-size:13px}.ai-feedback--warn{background:var(--md-sys-color-tertiary-container);color:var(--md-sys-color-on-tertiary-container)}.disabled-group{opacity:.6;pointer-events:none}.ai-model-content{display:flex;flex-direction:column;gap:8px}.ai-model-controls{display:flex;align-items:flex-start;gap:8px}.ai-model-controls ::ng-deep praxis-dynamic-form{flex:1}.ai-model-details{font-size:12px;color:var(--md-sys-color-on-surface-variant);margin-left:4px}.ai-subtext{font-size:12px;color:var(--md-sys-color-on-surface-variant)}.ai-header-actions{display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap}.ai-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px;background:var(--md-sys-color-surface-container-low);border-radius:var(--md-sys-shape-corner-small, 8px);color:var(--md-sys-color-outline);gap:8px;text-align:center;font-size:13px}.spin{animation:spin 1s linear infinite}@keyframes spin{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}\n"] }]
6996
+ `, styles: [".dlg-icon-helpers{margin:12px 16px 4px;padding:12px;border:1px dashed var(--md-sys-color-outline-variant);border-radius:var(--md-sys-shape-corner-small, 8px)}.dlg-icon-helpers__head{font-weight:600;margin-bottom:8px;opacity:.8}.dlg-icon-helpers__row{display:flex;align-items:center;gap:12px;padding:6px 0}.dlg-icon-helpers__label{text-transform:capitalize;width:96px;opacity:.8}.dlg-icon-helpers__preview{width:24px;height:24px}.dlg-icon-helpers__value{font-family:monospace;font-size:12px;opacity:.8}.dlg-icon-helpers__hint{margin-top:8px;font-size:12px;opacity:.7}.panel-icon{margin-right:12px;color:var(--md-sys-color-primary);flex-shrink:0}:host ::ng-deep .mat-expansion-panel-header{height:auto!important;min-height:54px;padding-block:10px}:host ::ng-deep .mat-expansion-panel-header-title,:host ::ng-deep .mat-expansion-panel-header-description{line-height:1.35}:host ::ng-deep .mat-expansion-panel-body .form-section{border:none;background:transparent;box-shadow:none;padding:4px 0 0}@media(max-width:560px){:host ::ng-deep .mat-expansion-panel-header .mat-content{flex-direction:column;align-items:flex-start;gap:4px}:host ::ng-deep .mat-expansion-panel-header-title,:host ::ng-deep .mat-expansion-panel-header-description{margin-right:0}}.ai-config-container{padding:16px;display:flex;flex-direction:column;gap:24px}.ai-config-source{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border-radius:var(--md-sys-shape-corner-medium, 10px);border:1px dashed var(--md-sys-color-outline-variant);background:var(--md-sys-color-surface-container-low);font-size:12px;color:var(--md-sys-color-on-surface-variant);flex-wrap:wrap}.ai-config-source__meta{display:inline-flex;align-items:center;gap:8px}.ai-action-btn--clear{background:var(--md-sys-color-error-container);color:var(--md-sys-color-on-error-container);--mdc-outlined-button-container-color: var(--md-sys-color-error-container);--mdc-outlined-button-label-text-color: var(--md-sys-color-on-error-container);--mdc-outlined-button-outline-color: var(--md-sys-color-error);--mat-mdc-button-persistent-ripple-color: var(--md-sys-color-on-error-container);--mat-mdc-button-ripple-color: var(--md-sys-color-on-error-container)}.ai-action-btn--clear:hover{background:var(--md-sys-color-error-container)}.ai-group-title{display:flex;align-items:center;gap:8px;font-weight:500;font-size:14px;color:var(--md-sys-color-primary);margin-bottom:12px;border-bottom:1px solid var(--md-sys-color-outline-variant);padding-bottom:4px}.ai-group-title mat-icon{font-size:20px;width:20px;height:20px}.ai-group ::ng-deep .form-actions,.ai-group ::ng-deep button[type=submit]{display:none!important}.ai-credentials-row{display:flex;align-items:flex-start;gap:16px;flex-wrap:wrap}.ai-group-header{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.ai-provider-summary{display:flex;align-items:center;gap:12px;padding:8px 12px;border-radius:var(--md-sys-shape-corner-medium, 10px);background:var(--md-sys-color-surface-variant);border:1px solid var(--md-sys-color-outline-variant);margin:8px 0 4px;flex-wrap:wrap}.ai-provider-icon{width:32px;height:32px;border-radius:var(--md-sys-shape-corner-small, 8px);border:1px solid var(--md-sys-color-outline-variant);display:flex;align-items:center;justify-content:center;background:var(--md-sys-color-surface);color:var(--md-sys-color-primary);flex:0 0 auto}.provider-svg{width:18px;height:18px}.ai-provider-meta{display:flex;flex-direction:column;gap:2px;min-width:200px;flex:1 1 auto}.ai-provider-name{font-weight:600;font-size:13px}.ai-provider-desc{font-size:12px;opacity:.75}.ai-provider-key{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;border:1px solid var(--md-sys-color-outline-variant);background:var(--md-sys-color-surface-container-lowest);color:var(--md-sys-color-on-surface-variant);font-size:11px;font-weight:600;letter-spacing:.2px;box-shadow:var(--md-sys-elevation-level1, 0 1px 2px rgba(0,0,0,.2))}.ai-provider-key mat-icon{width:16px;height:16px;font-size:16px}.ai-provider-key.is-present{background:var(--md-sys-color-primary-container);color:var(--md-sys-color-on-primary-container);border-color:var(--md-sys-color-primary)}.ai-provider-key.is-saved{background:var(--md-sys-color-secondary-container);color:var(--md-sys-color-on-secondary-container);border-color:var(--md-sys-color-secondary)}.ai-provider-key.is-missing{background:var(--md-sys-color-surface-container-low);color:var(--md-sys-color-on-surface-variant);border-style:dashed;opacity:.9}.ai-provider-key.is-unlocked{background:var(--md-sys-color-tertiary-container);color:var(--md-sys-color-on-tertiary-container);border-color:var(--md-sys-color-tertiary)}.ai-action-btn{display:inline-flex;align-items:center;gap:8px;height:40px;padding:0 14px;min-width:168px;border-radius:var(--md-sys-shape-corner-medium, 12px);white-space:nowrap;background:var(--md-sys-color-secondary-container);color:var(--md-sys-color-on-secondary-container);border-color:var(--md-sys-color-outline-variant);box-shadow:var(--md-sys-elevation-level1, 0 1px 2px rgba(0,0,0,.2));transition:background-color .15s ease,box-shadow .15s ease,transform .06s ease;--mdc-outlined-button-container-color: var(--md-sys-color-secondary-container);--mdc-outlined-button-label-text-color: var(--md-sys-color-on-secondary-container);--mdc-outlined-button-outline-color: var(--md-sys-color-outline-variant);--mat-mdc-button-persistent-ripple-color: var(--md-sys-color-on-secondary-container);--mat-mdc-button-ripple-color: var(--md-sys-color-on-secondary-container)}.ai-action-btn .mat-button-wrapper,.ai-action-btn .mdc-button__label{display:inline-flex;align-items:center;gap:8px;line-height:1;height:100%}.ai-action-btn .mat-icon{width:18px;height:18px;font-size:18px;line-height:18px}.ai-action-btn .ai-action-label{display:inline-flex;align-items:center;line-height:1}.ai-action-btn .mat-progress-spinner,.ai-action-btn .btn-spinner{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle}.ai-action-btn:hover{background:var(--md-sys-color-secondary-container);box-shadow:var(--md-sys-elevation-level2, 0 2px 6px rgba(0,0,0,.25))}.ai-action-btn:active{transform:translateY(1px)}.ai-action-btn:focus-visible{outline:2px solid var(--md-sys-color-primary);outline-offset:2px}.ai-action-btn.is-success{background:var(--md-sys-color-tertiary-container);color:var(--md-sys-color-on-tertiary-container);border-color:var(--md-sys-color-tertiary);--mdc-outlined-button-container-color: var(--md-sys-color-tertiary-container);--mdc-outlined-button-label-text-color: var(--md-sys-color-on-tertiary-container);--mdc-outlined-button-outline-color: var(--md-sys-color-tertiary);--mat-mdc-button-persistent-ripple-color: var(--md-sys-color-on-tertiary-container);--mat-mdc-button-ripple-color: var(--md-sys-color-on-tertiary-container)}.ai-action-btn.is-success:hover{background:var(--md-sys-color-tertiary-container)}.ai-action-btn:disabled{background:var(--md-sys-color-surface-container-low);color:var(--md-sys-color-on-surface-variant);border-color:var(--md-sys-color-outline-variant);box-shadow:none;opacity:.7}.ai-form-inline{flex:1;min-width:300px}.ai-credentials-row button{margin-top:4px;height:40px}.btn-spinner{margin-right:8px}.ai-feedback{margin-top:8px;display:flex;align-items:center;gap:8px;padding:8px 12px;background:var(--md-sys-color-error-container);color:var(--md-sys-color-on-error-container);border-radius:var(--md-sys-shape-corner-extra-small, 4px);font-size:13px}.ai-feedback--warn{background:var(--md-sys-color-tertiary-container);color:var(--md-sys-color-on-tertiary-container)}.disabled-group{opacity:.6;pointer-events:none}.ai-model-content{display:flex;flex-direction:column;gap:8px}.ai-model-controls{display:flex;align-items:flex-start;gap:8px}.ai-model-controls ::ng-deep praxis-dynamic-form{flex:1}.ai-model-details{font-size:12px;color:var(--md-sys-color-on-surface-variant);margin-left:4px}.ai-subtext{font-size:12px;color:var(--md-sys-color-on-surface-variant)}.ai-header-actions{display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap}.ai-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px;background:var(--md-sys-color-surface-container-low);border-radius:var(--md-sys-shape-corner-small, 8px);color:var(--md-sys-color-outline);gap:8px;text-align:center;font-size:13px}.spin{animation:spin 1s linear infinite}@keyframes spin{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}\n"] }]
5282
6997
  }], ctorParameters: () => [{ type: GlobalConfigAdminService }, { type: i2$1.MatSnackBar }], propDecorators: { hostCrud: [{
5283
6998
  type: ViewChild,
5284
6999
  args: ['hostCrud', { read: ViewContainerRef, static: true }]
@@ -5294,6 +7009,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
5294
7009
  }], hostDialog: [{
5295
7010
  type: ViewChild,
5296
7011
  args: ['hostDialog', { read: ViewContainerRef, static: true }]
7012
+ }], hostPages: [{
7013
+ type: ViewChild,
7014
+ args: ['hostPages', { read: ViewContainerRef, static: true }]
5297
7015
  }], hostAiCredentials: [{
5298
7016
  type: ViewChild,
5299
7017
  args: ['hostAiCredentials', { read: ViewContainerRef, static: true }]
@@ -5311,10 +7029,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
5311
7029
  * openGlobalConfigEditor(settings);
5312
7030
  */
5313
7031
  function openGlobalConfigEditor(settings, opts) {
5314
- settings.open({
7032
+ return settings.open({
5315
7033
  id: opts?.id ?? 'global-config',
5316
7034
  title: opts?.title,
5317
7035
  titleIcon: opts?.titleIcon ?? 'tune',
7036
+ owner: opts?.owner,
5318
7037
  content: { component: GlobalConfigEditorComponent, inputs: {} },
5319
7038
  });
5320
7039
  }
@@ -5362,6 +7081,31 @@ const SETTINGS_PANEL_AI_CAPABILITIES = {
5362
7081
  ],
5363
7082
  };
5364
7083
 
7084
+ const settingsPanelConfigRootResolutionSpec = {
7085
+ strategy: 'root-path',
7086
+ paths: ['config', ''],
7087
+ allowIndex: false,
7088
+ };
7089
+ const settingsPanelSizeResolutionSpec = {
7090
+ strategy: 'root-path',
7091
+ paths: ['config', 'runtime.size'],
7092
+ allowIndex: false,
7093
+ };
7094
+ const settingsPanelProviderBehaviorResolutionSpec = {
7095
+ strategy: 'root-path',
7096
+ paths: ['provider', 'ref'],
7097
+ allowIndex: false,
7098
+ };
7099
+ const settingsPanelEditorHostResolutionSpec = {
7100
+ strategy: 'root-path',
7101
+ paths: ['config.content', 'content'],
7102
+ allowIndex: false,
7103
+ };
7104
+ const settingsPanelDiagnosticsResolutionSpec = {
7105
+ strategy: 'root-path',
7106
+ paths: ['config.diagnostics', 'panel'],
7107
+ allowIndex: false,
7108
+ };
5365
7109
  const panelSizeSchema = {
5366
7110
  type: 'object',
5367
7111
  minProperties: 1,
@@ -5421,14 +7165,14 @@ const PRAXIS_SETTINGS_PANEL_AUTHORING_MANIFEST = {
5421
7165
  { name: 'provider', type: 'SettingsValueProvider', description: 'Editor protocol for dirty, valid, busy, getSettingsValue, onSave, reset and close hooks.' },
5422
7166
  ],
5423
7167
  editableTargets: [
5424
- { kind: 'panelShell', resolver: 'settings-panel-config-root', description: 'Top-level shell identity and title fields owned by SettingsPanelConfig.' },
5425
- { kind: 'openMode', resolver: 'settings-panel-open-mode', description: 'Initial expanded state, replacement mediation and close behavior for an authoring panel.' },
5426
- { kind: 'panelSize', resolver: 'settings-panel-size-and-resize', description: 'Width, min/max width, resize enablement and persisted size key.' },
5427
- { kind: 'applyBehavior', resolver: 'settings-value-provider-apply-contract', description: 'Apply availability and payload emission through getSettingsValue().' },
5428
- { kind: 'saveBehavior', resolver: 'settings-value-provider-save-contract', description: 'Save availability, onSave fallback and close-after-save behavior.' },
5429
- { kind: 'resetBehavior', resolver: 'settings-value-provider-reset-contract', description: 'Reset confirmation, provider reset hook and reset event emission.' },
5430
- { kind: 'editorHost', resolver: 'settings-panel-editor-host', description: 'Hosted editor component and serializable input envelope.' },
5431
- { kind: 'diagnostics', resolver: 'settings-panel-state-diagnostics', description: 'Dirty, valid, busy, disabled reason and status message visibility.' },
7168
+ { kind: 'panelShell', resolver: 'settings-panel-config-root', resolutionSpec: settingsPanelConfigRootResolutionSpec, description: 'Top-level shell identity and title fields owned by SettingsPanelConfig.' },
7169
+ { kind: 'openMode', resolver: 'settings-panel-open-mode', resolutionSpec: settingsPanelConfigRootResolutionSpec, description: 'Initial expanded state, replacement mediation and close behavior for an authoring panel.' },
7170
+ { kind: 'panelSize', resolver: 'settings-panel-size-and-resize', resolutionSpec: settingsPanelSizeResolutionSpec, description: 'Width, min/max width, resize enablement and persisted size key.' },
7171
+ { kind: 'applyBehavior', resolver: 'settings-value-provider-apply-contract', resolutionSpec: settingsPanelProviderBehaviorResolutionSpec, description: 'Apply availability and payload emission through getSettingsValue().' },
7172
+ { kind: 'saveBehavior', resolver: 'settings-value-provider-save-contract', resolutionSpec: settingsPanelProviderBehaviorResolutionSpec, description: 'Save availability, onSave fallback and close-after-save behavior.' },
7173
+ { kind: 'resetBehavior', resolver: 'settings-value-provider-reset-contract', resolutionSpec: settingsPanelProviderBehaviorResolutionSpec, description: 'Reset confirmation, provider reset hook and reset event emission.' },
7174
+ { kind: 'editorHost', resolver: 'settings-panel-editor-host', resolutionSpec: settingsPanelEditorHostResolutionSpec, description: 'Hosted editor component and serializable input envelope.' },
7175
+ { kind: 'diagnostics', resolver: 'settings-panel-state-diagnostics', resolutionSpec: settingsPanelDiagnosticsResolutionSpec, description: 'Dirty, valid, busy, disabled reason and status message visibility.' },
5432
7176
  ],
5433
7177
  operations: [
5434
7178
  {
@@ -5436,7 +7180,7 @@ const PRAXIS_SETTINGS_PANEL_AUTHORING_MANIFEST = {
5436
7180
  title: 'Configure panel shell identity',
5437
7181
  scope: 'global',
5438
7182
  targetKind: 'panelShell',
5439
- target: { kind: 'panelShell', resolver: 'settings-panel-config-root', ambiguityPolicy: 'fail', required: true },
7183
+ target: { kind: 'panelShell', resolver: 'settings-panel-config-root', resolutionSpec: settingsPanelConfigRootResolutionSpec, ambiguityPolicy: 'fail', required: true },
5440
7184
  inputSchema: panelShellSchema,
5441
7185
  effects: [{ kind: 'merge-object', path: 'config' }],
5442
7186
  validators: ['panel-id-stable', 'title-i18n-compatible', 'settings-panel-round-trip'],
@@ -5451,7 +7195,7 @@ const PRAXIS_SETTINGS_PANEL_AUTHORING_MANIFEST = {
5451
7195
  title: 'Set panel open mode',
5452
7196
  scope: 'global',
5453
7197
  targetKind: 'openMode',
5454
- target: { kind: 'openMode', resolver: 'settings-panel-open-mode', ambiguityPolicy: 'fail', required: false },
7198
+ target: { kind: 'openMode', resolver: 'settings-panel-open-mode', resolutionSpec: settingsPanelConfigRootResolutionSpec, ambiguityPolicy: 'fail', required: false },
5455
7199
  inputSchema: {
5456
7200
  type: 'object',
5457
7201
  minProperties: 1,
@@ -5473,7 +7217,7 @@ const PRAXIS_SETTINGS_PANEL_AUTHORING_MANIFEST = {
5473
7217
  title: 'Set panel size and resize policy',
5474
7218
  scope: 'layout',
5475
7219
  targetKind: 'panelSize',
5476
- target: { kind: 'panelSize', resolver: 'settings-panel-size-and-resize', ambiguityPolicy: 'fail', required: false },
7220
+ target: { kind: 'panelSize', resolver: 'settings-panel-size-and-resize', resolutionSpec: settingsPanelSizeResolutionSpec, ambiguityPolicy: 'fail', required: false },
5477
7221
  inputSchema: panelSizeSchema,
5478
7222
  effects: [{ kind: 'compile-domain-patch', handler: 'settings-panel-size-set', handlerContract: {
5479
7223
  reads: ['SettingsPanelConfig', 'SettingsPanelRef.sizeChanged$', 'persistSizeKey'],
@@ -5495,7 +7239,7 @@ const PRAXIS_SETTINGS_PANEL_AUTHORING_MANIFEST = {
5495
7239
  title: 'Set apply behavior',
5496
7240
  scope: 'interaction',
5497
7241
  targetKind: 'applyBehavior',
5498
- target: { kind: 'applyBehavior', resolver: 'settings-value-provider-apply-contract', ambiguityPolicy: 'fail', required: false },
7242
+ target: { kind: 'applyBehavior', resolver: 'settings-value-provider-apply-contract', resolutionSpec: settingsPanelProviderBehaviorResolutionSpec, ambiguityPolicy: 'fail', required: false },
5499
7243
  inputSchema: behaviorSchema,
5500
7244
  effects: [{ kind: 'compile-domain-patch', handler: 'settings-panel-apply-behavior-set', handlerContract: {
5501
7245
  reads: ['SettingsValueProvider.isDirty$', 'SettingsValueProvider.isValid$', 'SettingsValueProvider.isBusy$', 'SettingsValueProvider.getSettingsValue'],
@@ -5517,7 +7261,7 @@ const PRAXIS_SETTINGS_PANEL_AUTHORING_MANIFEST = {
5517
7261
  title: 'Set save behavior',
5518
7262
  scope: 'interaction',
5519
7263
  targetKind: 'saveBehavior',
5520
- target: { kind: 'saveBehavior', resolver: 'settings-value-provider-save-contract', ambiguityPolicy: 'fail', required: false },
7264
+ target: { kind: 'saveBehavior', resolver: 'settings-value-provider-save-contract', resolutionSpec: settingsPanelProviderBehaviorResolutionSpec, ambiguityPolicy: 'fail', required: false },
5521
7265
  inputSchema: behaviorSchema,
5522
7266
  effects: [{ kind: 'compile-domain-patch', handler: 'settings-panel-save-behavior-set', handlerContract: {
5523
7267
  reads: ['SettingsValueProvider.onSave', 'SettingsValueProvider.getSettingsValue', 'SettingsValueProvider.isDirty$', 'SettingsValueProvider.isValid$', 'SettingsValueProvider.isBusy$'],
@@ -5539,7 +7283,7 @@ const PRAXIS_SETTINGS_PANEL_AUTHORING_MANIFEST = {
5539
7283
  title: 'Set reset behavior',
5540
7284
  scope: 'interaction',
5541
7285
  targetKind: 'resetBehavior',
5542
- target: { kind: 'resetBehavior', resolver: 'settings-value-provider-reset-contract', ambiguityPolicy: 'fail', required: false },
7286
+ target: { kind: 'resetBehavior', resolver: 'settings-value-provider-reset-contract', resolutionSpec: settingsPanelProviderBehaviorResolutionSpec, ambiguityPolicy: 'fail', required: false },
5543
7287
  inputSchema: {
5544
7288
  type: 'object',
5545
7289
  minProperties: 1,
@@ -5570,7 +7314,7 @@ const PRAXIS_SETTINGS_PANEL_AUTHORING_MANIFEST = {
5570
7314
  title: 'Configure hosted editor',
5571
7315
  scope: 'templating',
5572
7316
  targetKind: 'editorHost',
5573
- target: { kind: 'editorHost', resolver: 'settings-panel-editor-host', ambiguityPolicy: 'fail', required: true },
7317
+ target: { kind: 'editorHost', resolver: 'settings-panel-editor-host', resolutionSpec: settingsPanelEditorHostResolutionSpec, ambiguityPolicy: 'fail', required: true },
5574
7318
  inputSchema: editorHostSchema,
5575
7319
  effects: [{ kind: 'compile-domain-patch', handler: 'settings-panel-editor-host-configure', handlerContract: {
5576
7320
  reads: ['ComponentMetadataRegistry', 'SettingsPanelConfig.content', 'SettingsValueProvider', 'component.authoringManifest'],
@@ -5592,7 +7336,7 @@ const PRAXIS_SETTINGS_PANEL_AUTHORING_MANIFEST = {
5592
7336
  title: 'Set panel diagnostics visibility',
5593
7337
  scope: 'interaction',
5594
7338
  targetKind: 'diagnostics',
5595
- target: { kind: 'diagnostics', resolver: 'settings-panel-state-diagnostics', ambiguityPolicy: 'fail', required: false },
7339
+ target: { kind: 'diagnostics', resolver: 'settings-panel-state-diagnostics', resolutionSpec: settingsPanelDiagnosticsResolutionSpec, ambiguityPolicy: 'fail', required: false },
5596
7340
  inputSchema: {
5597
7341
  type: 'object',
5598
7342
  minProperties: 1,