export const __webpack_esm_id__=5958;export const __webpack_esm_ids__=[5958];export const __webpack_esm_modules__={5958(t,i,e){e.d(i,{g:()=>n}),e(5983),e(1821);var n,o=e(2900),a=e(7704),s=e(9609),r=e(2050),l=e(4084),d=(e(4358),e(1660),e(4886),e(5109)),c=(e(6014),e(2927)),h=e(8899),m=e(3517),p=e(7262),u=function(t,i,e,n){var o,a=arguments.length,s=a<3?i:null===n?n=Object.getOwnPropertyDescriptor(i,e):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,e,n);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(s=(a<3?o(s):a>3?o(i,e,s):o(i,e))||s);return a>3&&s&&Object.defineProperty(i,e,s),s};!function(t){let i=class extends((0,a.yC)(c.LitElement)){constructor(){super(...arguments),this.heading="",this.label="",this.show=!1,this.closeAriaLabel="Close Modal",this.minimize=!1,this.maximizeIconAriaLabel="Maximize Modal",this.dragOccured=!1,this.containerTransform="",this.applyInitialPosition=!0,this.getInitialPosition=()=>{var t,i;return this.applyInitialPosition&&this.minPosition?{initialX:Number(null===(t=this.minPosition)||void 0===t?void 0:t.x),initialY:Number(null===(i=this.minPosition)||void 0===i?void 0:i.y)}:{initialX:0,initialY:0}},this.dragMoveListener=t=>{const{target:i}=t,{x:e,y:n}=this.getTransformValues(t);this.setTargetPosition(i,e,n),this.applyInitialPosition=!1},this.dragEndListener=()=>{this.dragOccured=!0,this.setContainerRect()}}static get styles(){return[l.A,p.A]}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",(0,r.sg)(()=>this.setInteractInstance(),250))}updated(t){super.updated(t),t.has("show")&&(this.container&&this.show?(this.applyInitialPosition=!0,this.setContainerRect(),this.setInteractInstance(),this.setFocusOnContainer()):(this.cleanContainerStyles(),this.destroyInteractInstance())),this.container&&t.has("minPosition")&&!t.has("show")&&this.setInitialTargetPosition(),t.has("minimize")&&void 0!==t.get("minimize")&&this.setFocusOnContainer()}isNewPositionNotSame(){var t,i,e,n;if(this.container)return Number(null===(t=this.container)||void 0===t?void 0:t.getAttribute("data-x"))!==(null===(i=this.minPosition)||void 0===i?void 0:i.x)||Number(null===(e=this.container)||void 0===e?void 0:e.getAttribute("data-y"))!==(null===(n=this.minPosition)||void 0===n?void 0:n.y)}setInitialTargetPosition(){var t,i;this.container&&this.isNewPositionNotSame()&&this.setTargetPosition(this.container,Number(null===(t=this.minPosition)||void 0===t?void 0:t.x),Number(null===(i=this.minPosition)||void 0===i?void 0:i.y))}setFocusOnContainer(){this.container&&(this.container.setAttribute("tabindex","0"),this.container.focus())}cleanContainerStyles(){this.containerTransform=""}getContainerTransform(){const t=this.container.getAttribute("data-x"),i=this.container.getAttribute("data-y");return t&&i?(this.dispatchEvent(new CustomEvent("floating-modal-minimize-location",{composed:!0,bubbles:!0,detail:{transform:{x:t,y:i}}})),`translate(${t}px, ${i}px)`):this.container.style.transform}setContainerRect(){requestAnimationFrame(()=>{return t=this,i=void 0,n=function*(){yield this.updateComplete,this.containerTransform=this.getContainerTransform()},new((e=void 0)||(e=Promise))(function(o,a){function s(t){try{l(n.next(t))}catch(t){a(t)}}function r(t){try{l(n.throw(t))}catch(t){a(t)}}function l(t){var i;t.done?o(t.value):(i=t.value,i instanceof e?i:new e(function(t){t(i)})).then(s,r)}l((n=n.apply(t,i||[])).next())});var t,i,e,n})}setInteractInstance(){requestAnimationFrame(()=>{this.container&&(0,d.default)(this.container).draggable({autoScroll:!0,allowFrom:this.header,listeners:{move:this.dragMoveListener,end:this.dragEndListener},modifiers:[d.default.modifiers.restrictRect({restriction:document.body.getBoundingClientRect(),endOnly:!0})]})})}handleKeyDown(t){t.code!==o.Uz.Enter&&t.code!==o.Uz.Space||this.handleMinimize(t)}handleKeyDownClose(t){t.code!==o.Uz.Enter&&t.code!==o.Uz.Space||this.handleClose(t)}handleClose(t){this.show=!1,this.dispatchEvent(new CustomEvent("floating-modal-close",{composed:!0,bubbles:!0,detail:{srcEvent:t}})),t.stopPropagation()}handleMinimize(t){t.preventDefault(),t.stopPropagation(),this.dragOccured||this.dispatchEvent(new CustomEvent("floating-min-modal-minimize",{composed:!0,bubbles:!0,detail:{srcEvent:t}})),this.dragOccured=!1}getTransformValues(t){const{target:i,dx:e,dy:n}=t,{initialX:o,initialY:a}=this.getInitialPosition();return{x:(parseFloat(i.getAttribute("data-x"))||0)+e+o,y:(parseFloat(i.getAttribute("data-y"))||0)+n+a}}setTargetPosition(t,i,e){t.style.transform=`translate(${i}px, ${e}px)`,t.setAttribute("data-x",`${i}`),t.setAttribute("data-y",`${e}`)}destroyInteractInstance(){this.container&&d.default.isSet(this.container)&&(0,d.default)(this.container).unset()}disconnectedCallback(){super.disconnectedCallback(),this.destroyInteractInstance(),window.removeEventListener("resize",(0,r.sg)(()=>this.setInteractInstance(),250))}render(){return c.html`
        ${this.show?c.html`
              <div
                class="md-floating ${this.minimize?"":"hide"} md-floating-minimize"
                @click=${this.handleMinimize}
                @keydown=${this.handleKeyDown}
                role="dialog"
                tabindex="-1"
                part="floating-minimized"
                aria-label=${(0,m.ifDefined)(this.heading||this.label||void 0)}
                aria-modal="true"
                style=${(0,m.ifDefined)(this.minPosition?`transform: translate(${this.minPosition.x}px, ${this.minPosition.y}px) !important`:`transform: ${this.containerTransform} !important`)}
              >
                <div class="md-floating__header ${this.minimize?"md-floating__header-minimize":""}">
                  <div class="md-floating__header-text" aria-hidden="true">
                    ${this.heading?c.html` ${this.heading} `:c.html` <slot></slot> `}
                  </div>
                  <md-button
                    color="color-none"
                    size="20"
                    class="md-floating__resize md-floating__header-button"
                    ariaLabel="${this.maximizeIconAriaLabel}"
                    circle
                    @click=${this.handleMinimize}
                  >
                    <md-icon name="maximize-bold" size="16" iconSet="momentumDesign"></md-icon>
                  </md-button>

                  <md-button
                    color="color-none"
                    size="20"
                    class="md-floating__close md-floating__header-button"
                    aria-label="${this.closeAriaLabel}"
                    circle
                    @click=${this.handleClose}
                    @keydown=${this.handleKeyDownClose}
                  >
                    <md-icon name="cancel-bold" size="16" iconSet="momentumDesign"></md-icon>
                  </md-button>
                </div>
              </div>
            `:c.nothing}
      `}};u([(0,h.property)({type:String})],i.prototype,"heading",void 0),u([(0,h.property)({type:String})],i.prototype,"label",void 0),u([(0,h.property)({type:Boolean,reflect:!0})],i.prototype,"show",void 0),u([(0,h.property)({type:String,attribute:"close-aria-label"})],i.prototype,"closeAriaLabel",void 0),u([(0,h.property)({type:Boolean,reflect:!0})],i.prototype,"minimize",void 0),u([(0,h.property)({type:String,attribute:"maximize-icon-aria-label"})],i.prototype,"maximizeIconAriaLabel",void 0),u([(0,h.property)({type:Object})],i.prototype,"minPosition",void 0),u([(0,h.query)(".md-floating")],i.prototype,"container",void 0),u([(0,h.query)(".md-floating__header")],i.prototype,"header",void 0),u([(0,h.state)()],i.prototype,"dragOccured",void 0),u([(0,h.state)()],i.prototype,"containerTransform",void 0),i=u([(0,s.w)("md-floating-modal-minimized")],i),t.ELEMENT=i}(n||(n={}))}};