Files
2026-01-30 23:31:00 -06:00

3 lines
10 KiB
JavaScript

/*! For license information please see 6898.c31d641e0f028511.js.LICENSE.txt */
"use strict";(self.webpackChunkhacs_frontend=self.webpackChunkhacs_frontend||[]).push([["6898"],{22997:function(e,t,n){var i,o,s=n("9065"),r=n("50778"),l=(n("71695"),n("40251"),n("22139"),n("47021"),n("2060"),n("81843"),{MENU_SELECTED_LIST_ITEM:"mdc-menu-item--selected",MENU_SELECTION_GROUP:"mdc-menu__selection-group",ROOT:"mdc-menu"}),d={ARIA_CHECKED_ATTR:"aria-checked",ARIA_DISABLED_ATTR:"aria-disabled",CHECKBOX_SELECTOR:'input[type="checkbox"]',LIST_SELECTOR:".mdc-list,.mdc-deprecated-list",SELECTED_EVENT:"MDCMenu:selected",SKIP_RESTORE_FOCUS:"data-menu-item-skip-restore-focus"},a={FOCUS_ROOT_INDEX:-1};(o=i||(i={}))[o.NONE=0]="NONE",o[o.LIST_ROOT=1]="LIST_ROOT",o[o.FIRST_ITEM=2]="FIRST_ITEM",o[o.LAST_ITEM=3]="LAST_ITEM";n("52247");var c=n("80573"),u=n("1328"),m=n("94280");const p=function(e){function t(n){var o=e.call(this,(0,s.pi)((0,s.pi)({},t.defaultAdapter),n))||this;return o.closeAnimationEndTimerId=0,o.defaultFocusState=i.LIST_ROOT,o.selectedIndex=-1,o}return(0,s.ZT)(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return l},enumerable:!1,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return d},enumerable:!1,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return a},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClassToElementAtIndex:function(){},removeClassFromElementAtIndex:function(){},addAttributeToElementAtIndex:function(){},removeAttributeFromElementAtIndex:function(){},getAttributeFromElementAtIndex:function(){return null},elementContainsClass:function(){return!1},closeSurface:function(){},getElementIndex:function(){return-1},notifySelected:function(){},getMenuItemCount:function(){return 0},focusItemAtIndex:function(){},focusListRoot:function(){},getSelectedSiblingOfItemAtIndex:function(){return-1},isSelectableItemAtIndex:function(){return!1}}},enumerable:!1,configurable:!0}),t.prototype.destroy=function(){this.closeAnimationEndTimerId&&clearTimeout(this.closeAnimationEndTimerId),this.adapter.closeSurface()},t.prototype.handleKeydown=function(e){var t=e.key,n=e.keyCode;("Tab"===t||9===n)&&this.adapter.closeSurface(!0)},t.prototype.handleItemAction=function(e){var t=this,n=this.adapter.getElementIndex(e);if(!(n<0)){this.adapter.notifySelected({index:n});var i="true"===this.adapter.getAttributeFromElementAtIndex(n,d.SKIP_RESTORE_FOCUS);this.adapter.closeSurface(i),this.closeAnimationEndTimerId=setTimeout((function(){var n=t.adapter.getElementIndex(e);n>=0&&t.adapter.isSelectableItemAtIndex(n)&&t.setSelectedIndex(n)}),m.k.numbers.TRANSITION_CLOSE_DURATION)}},t.prototype.handleMenuSurfaceOpened=function(){switch(this.defaultFocusState){case i.FIRST_ITEM:this.adapter.focusItemAtIndex(0);break;case i.LAST_ITEM:this.adapter.focusItemAtIndex(this.adapter.getMenuItemCount()-1);break;case i.NONE:break;default:this.adapter.focusListRoot()}},t.prototype.setDefaultFocusState=function(e){this.defaultFocusState=e},t.prototype.getSelectedIndex=function(){return this.selectedIndex},t.prototype.setSelectedIndex=function(e){if(this.validatedIndex(e),!this.adapter.isSelectableItemAtIndex(e))throw new Error("MDCMenuFoundation: No selection group at specified index.");var t=this.adapter.getSelectedSiblingOfItemAtIndex(e);t>=0&&(this.adapter.removeAttributeFromElementAtIndex(t,d.ARIA_CHECKED_ATTR),this.adapter.removeClassFromElementAtIndex(t,l.MENU_SELECTED_LIST_ITEM)),this.adapter.addClassToElementAtIndex(e,l.MENU_SELECTED_LIST_ITEM),this.adapter.addAttributeToElementAtIndex(e,d.ARIA_CHECKED_ATTR,"true"),this.selectedIndex=e},t.prototype.setEnabled=function(e,t){this.validatedIndex(e),t?(this.adapter.removeClassFromElementAtIndex(e,u.UX.LIST_ITEM_DISABLED_CLASS),this.adapter.addAttributeToElementAtIndex(e,d.ARIA_DISABLED_ATTR,"false")):(this.adapter.addClassToElementAtIndex(e,u.UX.LIST_ITEM_DISABLED_CLASS),this.adapter.addAttributeToElementAtIndex(e,d.ARIA_DISABLED_ATTR,"true"))},t.prototype.validatedIndex=function(e){var t=this.adapter.getMenuItemCount();if(!(e>=0&&e<t))throw new Error("MDCMenuFoundation: No list item at specified index.")},t}(c.K);var h=n("11911"),f=n("78611"),I=n("57243"),E=n("35359");n("26625");let A,C,S=e=>e;class y extends h.H{constructor(){super(...arguments),this.mdcFoundationClass=p,this.listElement_=null,this.anchor=null,this.open=!1,this.quick=!1,this.wrapFocus=!1,this.innerRole="menu",this.innerAriaLabel=null,this.corner="TOP_START",this.x=null,this.y=null,this.absolute=!1,this.multi=!1,this.activatable=!1,this.fixed=!1,this.forceGroupSelection=!1,this.fullwidth=!1,this.menuCorner="START",this.stayOpenOnBodyClick=!1,this.defaultFocus="LIST_ROOT",this._listUpdateComplete=null}get listElement(){return this.listElement_||(this.listElement_=this.renderRoot.querySelector("mwc-list")),this.listElement_}get items(){const e=this.listElement;return e?e.items:[]}get index(){const e=this.listElement;return e?e.index:-1}get selected(){const e=this.listElement;return e?e.selected:null}render(){return this.renderSurface()}renderSurface(){const e=this.getSurfaceClasses();return(0,I.dy)(A||(A=S` <mwc-menu-surface ?hidden="${0}" .anchor="${0}" .open="${0}" .quick="${0}" .corner="${0}" .x="${0}" .y="${0}" .absolute="${0}" .fixed="${0}" .fullwidth="${0}" .menuCorner="${0}" ?stayOpenOnBodyClick="${0}" class="${0}" @closed="${0}" @opened="${0}" @keydown="${0}"> ${0} </mwc-menu-surface>`),!this.open,this.anchor,this.open,this.quick,this.corner,this.x,this.y,this.absolute,this.fixed,this.fullwidth,this.menuCorner,this.stayOpenOnBodyClick,(0,E.$)(e),this.onClosed,this.onOpened,this.onKeydown,this.renderList())}getSurfaceClasses(){return{"mdc-menu":!0,"mdc-menu-surface":!0}}renderList(){const e="menu"===this.innerRole?"menuitem":"option",t=this.renderListClasses();return(0,I.dy)(C||(C=S` <mwc-list rootTabbable .innerAriaLabel="${0}" .innerRole="${0}" .multi="${0}" class="${0}" .itemRoles="${0}" .wrapFocus="${0}" .activatable="${0}" @action="${0}"> <slot></slot> </mwc-list>`),this.innerAriaLabel,this.innerRole,this.multi,(0,E.$)(t),e,this.wrapFocus,this.activatable,this.onAction)}renderListClasses(){return{"mdc-deprecated-list":!0}}createAdapter(){return{addClassToElementAtIndex:(e,t)=>{const n=this.listElement;if(!n)return;const i=n.items[e];i&&("mdc-menu-item--selected"===t?this.forceGroupSelection&&!i.selected&&n.toggle(e,!0):i.classList.add(t))},removeClassFromElementAtIndex:(e,t)=>{const n=this.listElement;if(!n)return;const i=n.items[e];i&&("mdc-menu-item--selected"===t?i.selected&&n.toggle(e,!1):i.classList.remove(t))},addAttributeToElementAtIndex:(e,t,n)=>{const i=this.listElement;if(!i)return;const o=i.items[e];o&&o.setAttribute(t,n)},removeAttributeFromElementAtIndex:(e,t)=>{const n=this.listElement;if(!n)return;const i=n.items[e];i&&i.removeAttribute(t)},getAttributeFromElementAtIndex:(e,t)=>{const n=this.listElement;if(!n)return null;const i=n.items[e];return i?i.getAttribute(t):null},elementContainsClass:(e,t)=>e.classList.contains(t),closeSurface:()=>{this.open=!1},getElementIndex:e=>{const t=this.listElement;return t?t.items.indexOf(e):-1},notifySelected:()=>{},getMenuItemCount:()=>{const e=this.listElement;return e?e.items.length:0},focusItemAtIndex:e=>{const t=this.listElement;if(!t)return;const n=t.items[e];n&&n.focus()},focusListRoot:()=>{this.listElement&&this.listElement.focus()},getSelectedSiblingOfItemAtIndex:e=>{const t=this.listElement;if(!t)return-1;const n=t.items[e];if(!n||!n.group)return-1;for(let i=0;i<t.items.length;i++){if(i===e)continue;const o=t.items[i];if(o.selected&&o.group===n.group)return i}return-1},isSelectableItemAtIndex:e=>{const t=this.listElement;if(!t)return!1;const n=t.items[e];return!!n&&n.hasAttribute("group")}}}onKeydown(e){this.mdcFoundation&&this.mdcFoundation.handleKeydown(e)}onAction(e){const t=this.listElement;if(this.mdcFoundation&&t){const n=e.detail.index,i=t.items[n];i&&this.mdcFoundation.handleItemAction(i)}}onOpened(){this.open=!0,this.mdcFoundation&&this.mdcFoundation.handleMenuSurfaceOpened()}onClosed(){this.open=!1}async getUpdateComplete(){await this._listUpdateComplete;return await super.getUpdateComplete()}async firstUpdated(){super.firstUpdated();const e=this.listElement;e&&(this._listUpdateComplete=e.updateComplete,await this._listUpdateComplete)}select(e){const t=this.listElement;t&&t.select(e)}close(){this.open=!1}show(){this.open=!0}getFocusedItemIndex(){const e=this.listElement;return e?e.getFocusedItemIndex():-1}focusItemAtIndex(e){const t=this.listElement;t&&t.focusItemAtIndex(e)}layout(e=!0){const t=this.listElement;t&&t.layout(e)}}(0,s.gn)([(0,r.IO)(".mdc-menu")],y.prototype,"mdcRoot",void 0),(0,s.gn)([(0,r.IO)("slot")],y.prototype,"slotElement",void 0),(0,s.gn)([(0,r.Cb)({type:Object})],y.prototype,"anchor",void 0),(0,s.gn)([(0,r.Cb)({type:Boolean,reflect:!0})],y.prototype,"open",void 0),(0,s.gn)([(0,r.Cb)({type:Boolean})],y.prototype,"quick",void 0),(0,s.gn)([(0,r.Cb)({type:Boolean})],y.prototype,"wrapFocus",void 0),(0,s.gn)([(0,r.Cb)({type:String})],y.prototype,"innerRole",void 0),(0,s.gn)([(0,r.Cb)({type:String})],y.prototype,"innerAriaLabel",void 0),(0,s.gn)([(0,r.Cb)({type:String})],y.prototype,"corner",void 0),(0,s.gn)([(0,r.Cb)({type:Number})],y.prototype,"x",void 0),(0,s.gn)([(0,r.Cb)({type:Number})],y.prototype,"y",void 0),(0,s.gn)([(0,r.Cb)({type:Boolean})],y.prototype,"absolute",void 0),(0,s.gn)([(0,r.Cb)({type:Boolean})],y.prototype,"multi",void 0),(0,s.gn)([(0,r.Cb)({type:Boolean})],y.prototype,"activatable",void 0),(0,s.gn)([(0,r.Cb)({type:Boolean})],y.prototype,"fixed",void 0),(0,s.gn)([(0,r.Cb)({type:Boolean})],y.prototype,"forceGroupSelection",void 0),(0,s.gn)([(0,r.Cb)({type:Boolean})],y.prototype,"fullwidth",void 0),(0,s.gn)([(0,r.Cb)({type:String})],y.prototype,"menuCorner",void 0),(0,s.gn)([(0,r.Cb)({type:Boolean})],y.prototype,"stayOpenOnBodyClick",void 0),(0,s.gn)([(0,r.Cb)({type:String}),(0,f.P)((function(e){this.mdcFoundation&&this.mdcFoundation.setDefaultFocusState(i[e])}))],y.prototype,"defaultFocus",void 0);let b;const T=(0,I.iv)(b||(b=(e=>e)`mwc-list ::slotted([mwc-list-item]:not([twoline])),mwc-list ::slotted([noninteractive]:not([twoline])){height:var(--mdc-menu-item-height,48px)}`));let g=class extends y{};g.styles=[T],g=(0,s.gn)([(0,r.Mo)("mwc-menu")],g)}}]);
//# sourceMappingURL=6898.c31d641e0f028511.js.map