import{i as p,a as h,R as l,u as o,b as e}from"./index-B6fu-u6K.js";import{r as u,c as d}from"./if-defined-D6swbWyQ.js";import{T as g}from"./index-BmxH4wsL.js";const f=p` :host { --prev-height: 0px; --new-height: 0px; display: block; } div.w3m-router-container { transform: translateY(0); opacity: 1; } div.w3m-router-container[view-direction='prev'] { animation: slide-left-out 150ms forwards ease, slide-left-in 150ms forwards ease; animation-delay: 0ms, 200ms; } div.w3m-router-container[view-direction='next'] { animation: slide-right-out 150ms forwards ease, slide-right-in 150ms forwards ease; animation-delay: 0ms, 200ms; } @keyframes slide-left-out { from { transform: translateX(0px); opacity: 1; } to { transform: translateX(10px); opacity: 0; } } @keyframes slide-left-in { from { transform: translateX(-10px); opacity: 0; } to { transform: translateX(0); opacity: 1; } } @keyframes slide-right-out { from { transform: translateX(0px); opacity: 1; } to { transform: translateX(-10px); opacity: 0; } } @keyframes slide-right-in { from { transform: translateX(10px); opacity: 0; } to { transform: translateX(0); opacity: 1; } } `;var v=function(s,t,i,a){var w=arguments.length,r=w<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,i):a,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,t,i,a);else for(var m=s.length-1;m>=0;m--)(c=s[m])&&(r=(w<3?c(r):w>3?c(t,i,r):c(t,i))||r);return w>3&&r&&Object.defineProperty(t,i,r),r};let n=class extends h{constructor(){super(),this.resizeObserver=void 0,this.prevHeight="0px",this.prevHistoryLength=1,this.unsubscribe=[],this.view=l.state.view,this.viewDirection="",this.unsubscribe.push(l.subscribeKey("view",t=>this.onViewChange(t)))}firstUpdated(){var t;this.resizeObserver=new ResizeObserver(([i])=>{const a=`${i==null?void 0:i.contentRect.height}px`;this.prevHeight!=="0px"&&(this.style.setProperty("--prev-height",this.prevHeight),this.style.setProperty("--new-height",a),this.style.animation="w3m-view-height 150ms forwards ease",this.style.height="auto"),setTimeout(()=>{this.prevHeight=a,this.style.animation="unset"},o.ANIMATION_DURATIONS.ModalHeight)}),(t=this.resizeObserver)==null||t.observe(this.getWrapper())}disconnectedCallback(){var t;(t=this.resizeObserver)==null||t.unobserve(this.getWrapper()),this.unsubscribe.forEach(i=>i())}render(){return e`