/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
v4.34.7 */
import{a as p}from"./B7UYEEQJ.js";import b from"./K2TY4WFO.js";import{g}from"./SRDD32D4.js";import"./EPSDPGVP.js";import{b as m,d as h}from"./IMJMO6DB.js";import{J as o,K as a,M as u,P as d,a as r,b as c,s as i}from"./RNRMSLW5.js";import"./G6QKOIC3.js";export default $arcgis.t(([{a:f}])=>{var x=r`.arcgis-button{--calcite-icon-color: var(--calcite-color-text-3);--calcite-button-background-color: var(--calcite-color-foreground-1);color:var(--calcite-color-text-3);line-height:var(--calcite-font-line-height-relative-tight);display:flex;flex-flow:column;cursor:pointer;background-color:var(--calcite-color-foreground-1);font-size:var(--calcite-font-size);:hover{--calcite-icon-color: var(--calcite-color-text-1);--calcite-button-background-color: var(--calcite-color-transparent-hover)}calcite-button{width:var(--calcite-spacing-xxxl);height:var(--calcite-spacing-xxxl)}}:host{width:var(--calcite-spacing-xxxl);height:var(--calcite-spacing-xxxl)}`,v={base:"fullscreen",button:"arcgis-button"};function E(s){return s.includes("#")||s.includes(".")||s.includes("[")?s:`#${s}`}var n=class extends o{constructor(){super(),this.messages=p(),this.view=f(this),this.arcgisPropertyChange=g()("state"),this.arcgisReady=i(),this.listenOn(document,"fullscreenchange",()=>this.fullscreenElement=document.fullscreenElement)}static{this.properties={fullscreenElement:16,view:0,element:1,label:1,messageOverrides:0,position:3,referenceElement:1,state:35}}static{this.styles=x}get fullscreenTitle(){let e=this.state;return e==="active"?this.messages.exit:e==="ready"?this.messages.enter:""}#e;get element(){return this.#e}set element(e){if(typeof e=="string"){let t=E(e),l=h(this.el,t);this.#e=l||void 0}else this.#e=e}get state(){if(!document.fullscreenEnabled)return"unsupported";let e=this._getElement();return e?this.fullscreenElement===e?"active":"ready":"disabled"}connectedCallback(){super.connectedCallback(),this.fullscreenElement=document.fullscreenElement}_getElement(){let e=this.view?.container,t=e?.getRootNode(),l=t instanceof ShadowRoot?t.host:null;return this.element??e?.parentElement??l??null}_toggle(){document.fullscreenElement?document.exitFullscreen():this._getElement()?.requestFullscreen()}render(){let{fullscreenTitle:e,state:t}=this,l=t==="unsupported",b=t==="ready"||t==="disabled"||t==="unsupported"?"zoom-out-fixed":"zoom-in-fixed";return c`<div class=${a(m(v.base,v.button))}>${!l&&c`<calcite-button .disabled=${t==="disabled"} .iconStart=${b} kind=neutral .label=${e} @click=${this._toggle} title=${e??u}></calcite-button>`||""}</div>`}};d("arcgis-fullscreen",n);return n},b)