/* COPYRIGHT Esri - https://js.arcgis.com/1.2/LICENSE.txt */
import{b as c}from"./ODCCVHGI.js";import{F as a,G as l,H as r,h as i,i as s,r as n}from"./42WFQ3AX.js";import"./3QPJ2JCA.js";export default $arcgis.t(([h,d])=>{var o=i`/** @license
 * Copyright 2025 Esri
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

:host {
  display: block;
}`,t=class extends r{constructor(){super(...arguments),this._fullscreenElement=a(),this.fullscreenStateChange=n()}static{this.properties={mapView:[0,{},{attribute:!1}],fullscreenWidget:[0,{},{attribute:!1}]}}static{this.styles=o}willUpdate(e){e.has("mapView")&&this.mapViewWatchHandler()}async mapViewWatchHandler(){await this.mapView?.when(async()=>{await this._initFullscreenWidget()})}render(){return s`<div class="fullscreen-widget" ${l(this._fullscreenElement)}></div>`}async updated(){this.hasUpdated||await this._initFullscreenWidget()}async loaded(){await this._initFullscreenWidget()}async _initFullscreenWidget(){this.mapView&&this._fullscreenElement.value&&!this.fullscreenWidget?(this.fullscreenWidget=new h({view:this.mapView}),await this.fullscreenWidget?.when(()=>{this._fullscreenStateChangeHandle&&this._fullscreenStateChangeHandle.remove(),this._fullscreenStateChangeHandle=d?.watch(()=>this.fullscreenWidget?.viewModel.state,e=>e&&this.fullscreenStateChange.emit(e))})):this.fullscreenWidget&&(this.fullscreenWidget.view=this.mapView)}};c("map-fullscreen",t);return t},"widgets/Fullscreen","core/reactiveUtils")