PageSourceSearch

https://inoutdecor.pl/application/assets/storefront/chunk-phoenix_components_modal.Dfrn71c.js

js inoutdecor.pl collected 2026-10-08 22:46:56 UTC 9,142 bytes, 11 lines download raw bytes

1import{H as L,a as A,b as T}from"./chunk-backdrop.BW8XJ0t.js";import{_ as s,a as i}from"./chunk-vendor-di.Bh23gdA.js";import{P as c,b as E,U as f,d as b,$ as k,e as h,t as O}from"./chunk-vendor-lit.NvY0u02.js";import{p as m}from"./chunk-phoenix_custom_element.-3oJuZO.js";import{a as S,P as w}from"./chunk-portal_constants.uZUnw1k.js";import{B as F}from"./chunk-backdrop_constants.5bk4eBT.js";import{B as $}from"./chunk-backdrop_controller.BQhgTTX.js";import{M as p,a as r,F as P,b as y}from"./chunk-modal_constants.RvL-5Lb.js";import"./chunk-v4.FWzwXvE.js";import"./chunk-transition_controller.B1AYL9W.js";import"./chunk-vendor-lodash.CWHFt7Z.js";let _=class extends c{constructor(){super(),this.tabIndex=0,this.setAttribute("role","button")}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this._dispatchModalCloseEvent),this.addEventListener("keydown",this._dispatchModalCloseOnEnterEvent)}disconnectedCallback(){this.removeEventListener("click",this._dispatchModalCloseEvent),this.removeEventListener("keydown",this._dispatchModalCloseOnEnterEvent)}_dispatchModalCloseEvent(){this.emitCustomEvent(p.close)}_dispatchModalCloseOnEnterEvent(e){(e.code==="Enter"||e.code==="Space")&&this._dispatchModalCloseEvent()}};_=s([m("h-modal-close"),i("design:paramtypes",[])],_);var d;let n=d=class extends c{constructor(){super(),this.opened=!1,this.class="",this.transition="scale",this.modalLabel="",this.noAutofocus=!1,this._firstFocusableElement=void 0,this._focusableElements=null,this._lastFocusableElement=void 0,this._focusedToggler=null,this._contentRef=E(),this._focusSentinelStart=E(),this._focusSentinelEnd=E(),this._propsChangeStrategies={[r]:{true:()=>{const e=window.scrollY;d.openModals=[...d.openModals,this],document.addEventListener("keydown",this._bindCloseOnEsc),document.addEventListener(F.clicked,this.close),this._dispatchModalOpenedEvent(),this.noAutofocus||setTimeout(()=>{var t;(t=this._firstFocusableElement)===null||t===void 0||t.focus(),window.scrollTo(0,e)},0)},false:()=>{d.openModals=d.openModals.filter(e=>e!==this),document.removeEventListener("keydown",this._bindCloseOnEsc),document.removeEventListener(F.clicked,this.close)}}},this._backdropController=new $,this._keepFocusWithinModal=e=>{var t;if(e.code==="Tab"&&this._contentRef.value)if(e.shiftKey){if(document.activeElement===this._firstFocusableElement){const o=f.getFocusableElements(this._contentRef.value);(t=o[o.length-1])===null||t===void 0||t.focus(),e.preventDefault()}}else document.activeElement===this._lastFocusableElement&&(f.setFocusToFirstFocusableElementInContainer(this._contentRef.value),e.preventDefault())},this._handleCloseFromCloseComponent=async e=>{var t;e.stopPropagation();const a=e.target instanceof _,o=(t=this._contentRef.value)===null||t===void 0?void 0:t.contains(e.target);a&&o&&await this.close()},this._bindCloseOnEsc=async e=>{e.stopImmediatePropagation();const t=e.target;if([e.key==="Escape",t.tagName!=="INPUT",e.ctrlKey===!1,e.shiftKey===!1,e.altKey===!1].every(l=>l)){const[l]=d.openModals.slice(-1);await l?.close()}},this.close=async()=>{if(this.opened)return new Promise(e=>{const t=parseFloat(getComputedStyle(this._contentRef.value||this).transitionDuration)*1e3;window.requestAnimationFrame(()=>{var a,o;(a=this._contentRef.value)===null||a===void 0||a.classList.remove(`modal_hide-${this.transition}-start`),(o=this._contentRef.value)===null||o===void 0||o.classList.add(`modal_hide-${this.transition}-end`),setTimeout(()=>{var l;(l=this._contentRef.value)===null||l===void 0||l.classList.remove(`modal_hide-${this.transition}-start`,`modal_hide-${this.transition}-end`),this[r]=!1,this._dispatchModalClosedEvent(),e()},t)})})},this._addInertToBodyChildrenElements=()=>{[...document.body.children].forEach(e=>{const t=e.tagName===w.toUpperCase(),a=e.hasAttribute("aria-live"),o=e.tagName==="H-BACKDROP";!t&&!a&&!o&&e.setAttribute("inert","")})},this._removeInertFromBodyChildrenElements=()=>{[...document.body.children].forEach(e=>{e.removeAttribute("inert")})},this.hidden=!0,this._focusableElements=[...this.querySelectorAll(P)]}static _appendModalsPortal(){if(!document.querySelector(`h-portal-target[name="${y}"]`)){const t=document.createElement("h-portal-target");t.setAttribute(S,y),document.body.appendChild(t)}}static isSomeModalOpen(){return d.openModals.some(e=>e.opened)}connectedCallback(){super.connectedCallback(),d._appendModalsPortal(),document.addEventListener("keyup",this._keepFocusWithinModal),document.addEventListener(p.close,this._handleCloseFromCloseComponent)}disconnectedCallback(){super.disconnectedCallback(),this[r]&&this.close(),document.removeEventListener(p.close,this._handleCloseFromCloseComponent),document.removeEventListener("keydown",this._bindCloseOnEsc),document.removeEventListener("keyup",this._keepFocusWithinModal)}firstUpdated(e){super.firstUpdated(e),this._firstFocusableElement=this._focusSentinelStart.value,this._lastFocusableElement=this._focusSentinelEnd.value}updated(e){e.has(r)&&this._propsChangeStrategies[r][String(this[r])]()}_setFocusToFirstFocusableElementInModalOrCloseBtn(){this.noAutofocus||requestAnimationFrame(()=>{if(this._contentRef.value){const e=f.getFocusableElements(this._contentRef.value);e.length>0&&(e.length>1?e[1].focus():e[0].focus())}})}async open(){return this._focusedToggler=document.activeElement,new Promise(e=>{var t;this[r]=!0,(t=this._contentRef.value)===null||t===void 0||t.classList.add("modal_visible",`modal_show-${this.transition}-start`),window.requestAnimationFrame(()=>{setTimeout(()=>{var o;(o=this._contentRef.value)===null||o===void 0||o.classList.add(`modal_show-${this.transition}-end`)},0);const a=parseFloat(getComputedStyle(this._contentRef.value||this).transitionDuration)*1e3;setTimeout(()=>{var o;(o=this._contentRef.value)===null||o===void 0||o.classList.remove(`modal_show-${this.transition}-start`,`modal_show-${this.transition}-end`),this._setFocusToFirstFocusableElementInModalOrCloseBtn(),e()},a)})})}_dispatchModalOpenedEvent(){this.emitCustomEvent(p.opened,{detail:this}),this._backdropController.show(),this._addInertToBodyChildrenElements()}_dispatchModalClosedEvent(){this.emitCustomEvent(p.closed,{detail:this}),requestAnimationFrame(()=>{var e;(e=this._focusedToggler)===null||e===void 0||e.focus()}),this._backdropController.hide(),this._removeInertFromBodyChildrenElements()}render(){return k`
2            <h-portal ?disabled="${!this.opened}" to="${y}" hidden>
3                <div class="modal-wrapper ${this.class}">
4                    <div tabindex="0" ${b(this._focusSentinelStart)}></div>
5                    <div ${b(this._contentRef)} class="modal" role="dialog" aria-label="${this.modalLabel}">
6                        <div class="modal__container">
6${this.getSlot("header")} ${this.getSlot("body")} ${this.getSlot("footer")}</div>
7                    </div>
8                    <div tabindex="0" ${b(this._focusSentinelEnd)}></div>
9                </div>
10            </h-portal>
11        `}};n.openModals=[];s([h({type:Boolean,reflect:!0}),i("design:type",Object)],n.prototype,"opened",void 0);s([h({type:String}),i("design:type",Object)],n.prototype,"class",void 0);s([h({type:String}),i("design:type",Object)],n.prototype,"transition",void 0);s([h({type:String,attribute:"modal-label"}),i("design:type",Object)],n.prototype,"modalLabel",void 0);s([h({type:Boolean,attribute:"no-autofocus"}),i("design:type",Object)],n.prototype,"noAutofocus",void 0);s([O(),i("design:type",Object)],n.prototype,"_firstFocusableElement",void 0);s([O(),i("design:type",Object)],n.prototype,"_focusableElements",void 0);s([O(),i("design:type",Object)],n.prototype,"_lastFocusableElement",void 0);n=d=s([m("h-modal"),i("design:paramtypes",[])],n);let v=class extends c{constructor(){super(),this.name="",this.tabIndex=0,this.setAttribute("role","button"),this.setAttribute("aria-haspopup","dialog")}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this._openModal),this.addEventListener("keydown",this._openModalOnKeydownEvent)}disconnectedCallback(){this.removeEventListener("click",this._openModal),this.removeEventListener("keydown",this._openModalOnKeydownEvent)}_openModal(){const e=document.querySelector(`h-modal#${this.name}`);e?.open()}_openModalOnKeydownEvent(e){(e.code==="Enter"||e.code==="Space")&&this._openModal()}};s([h({type:String}),i("design:type",Object)],v.prototype,"name",void 0);v=s([m("h-modal-opener"),i("design:paramtypes",[])],v);let C=class extends c{constructor(){super(),this.slot=this.hasAttribute("slot")?this.slot:"body",this.className=`modal__body ${this.className}`}};C=s([m("h-modal-body"),i("design:paramtypes",[])],C);let g=class extends c{constructor(){super(),this.slot=this.hasAttribute("slot")?this.slot:"footer",this.className=`modal__footer ${this.className}`}};g=s([m("h-modal-footer"),i("design:paramtypes",[])],g);let M=class extends c{constructor(){super(),this.slot=this.hasAttribute("slot")?this.slot:"header",this.className=`modal__header ${this.className}`}};M=s([m("h-modal-header"),i("design:paramtypes",[])],M);requestAnimationFrame(()=>{});globalThis.__phoenix_wc__=[L,n,C,_,g,M,v,A,T];

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.