/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
import a from"./MOJH7XEP.js";import{O as r,U as c,a as o,b as i}from"./IXZEUVT2.js";import"./H6RQVSYM.js";export default $arcgis.t(([{a:n}])=>{var u=o`.export-button-container{display:flex;flex-direction:column;align-items:center;gap:.5rem}`,s=class extends r{static{this.properties={viewModel:0,messages:0,fileName:1,selectExportsTab:0}}static{this.styles=u}loaded(){this.manager.onLifecycle(()=>[])}async _handlePrintMap(){this.viewModel.export(this.fileName||this.messages.untitled),this.selectExportsTab()}render(){let{messages:t}=this,{layout:a,layoutItem:e,format:p}=this.viewModel.templateOptions,d=this.viewModel.state!=="ready"||!(a||e),m=n.test(this.viewModel.portal?.url),l=`5 ${t.credits}`,h=!!e?.id;return i`<div class="export-button-container">${m&&h?i`<calcite-chip icon=credits kind=neutral .label=${l} scale=s>${l}</calcite-chip>`:null}<calcite-button .ariaLabel=${t.exportDescription} .disabled=${d||!(a||e?.id)&&!p} @click=${this._handlePrintMap} scale=l width=full>${t.export}</calcite-button></div>`}};c("arcgis-print-export-button",s);return s},a)