import { c as r } from "../../chunks/runtime.js";
import { usePropertyChange as s } from "@arcgis/lumina/controllers";
import { reEmitEvent as o } from "@arcgis/lumina/controllers/accessor";
import a from "@arcgis/core/layers/GraphicsLayer.js";
import l from "@arcgis/core/widgets/Sketch.js";
import { LitElement as n, createEvent as c } from "@arcgis/lumina";
import { m as d } from "../../chunks/useWidget.js";
import { css as p } from "lit";
import { watch as g } from "@arcgis/core/core/reactiveUtils.js";
/*! 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 */
const h = p`.esri-widget__heading{color:var(--calcite-color-text-2);margin:0 0 .5rem;font-weight:var(--calcite-font-weight-semibold)}h1.esri-widget__heading{font-size:var(--calcite-font-size-xl)}h2.esri-widget__heading{font-size:var(--calcite-font-size-md)}h3.esri-widget__heading,h4.esri-widget__heading,h5.esri-widget__heading,h6.esri-widget__heading{font-size:var(--calcite-font-size)}.esri-widget{--esri-widget-padding-x: 15px;--esri-widget-padding-y: var(--calcite-spacing-md);--esri-widget-padding: var(--esri-widget-padding-y) var(--esri-widget-padding-x);box-sizing:border-box;color:var(--calcite-color-text-2);background-color:var(--calcite-color-foreground-1);font-size:var(--calcite-font-size);line-height:var(--calcite-font-line-height-relative-tight)}.esri-widget *,.esri-widget :before,.esri-widget :after{box-sizing:inherit}.esri-widget.esri-widget--disabled>*{opacity:.4;pointer-events:none}.esri-widget.esri-widget--compact{--esri-widget-padding-y: 0;--esri-widget-padding-x: 0}.esri-widget__anchor{color:var(--calcite-color-text-2)}.esri-widget__anchor:hover{color:var(--calcite-color-text-3)}.esri-widget__anchor:hover,.esri-widget__anchor:focus{text-decoration:underline}.esri-widget__anchor--disabled{opacity:.4;pointer-events:none}.esri-widget__header{background-color:var(--calcite-color-foreground-1);flex:1 0 100%;justify-content:space-between;align-items:center;width:100%;min-height:48px;padding:12px 0 12px 15px;display:flex}.esri-widget__header .esri-widget__heading{width:calc(100% - 48px);text-align:initial;color:var(--calcite-color-text-1);align-items:center;margin:0;padding:0;display:flex}.esri-widget__header-button{appearance:none;cursor:pointer;color:var(--calcite-color-text-2);background-color:var(--calcite-color-foreground-1);border:none;flex:0 0 48px;justify-content:center;align-self:stretch;align-items:center;width:48px;padding:0;display:flex}.esri-widget__footer{background-color:var(--calcite-color-foreground-1);justify-content:center;align-items:center;width:100%;min-height:48px;display:flex}.esri-widget__footer-pagination{color:var(--calcite-color-text-2);justify-content:space-between;align-items:center;display:flex}.esri-widget__footer-pagination-previous-button,.esri-widget__footer-pagination-next-button{cursor:pointer;background-color:var(--calcite-color-foreground-1);border:0;margin:0 7px;padding:12px 15px;transition:background-color .125s ease-in-out}.esri-widget__footer-pagination-previous-button:hover,.esri-widget__footer-pagination-previous-button:focus,.esri-widget__footer-pagination-next-button:hover,.esri-widget__footer-pagination-next-button:focus{color:var(--calcite-color-text-1);background-color:var(--calcite-color-foreground-1)}.esri-menu{visibility:hidden;z-index:1;background-clip:padding;background-color:var(--calcite-color-foreground-1);background-clip:padding-box;width:100%;max-height:0;margin:2px 0 0;padding:0;font-size:var(--calcite-font-size);line-height:var(--calcite-spacing-xl);position:absolute;top:100%;left:0;overflow:hidden;box-shadow:0 1px 2px #0000004d}.esri-menu .esri-menu__header{color:var(--calcite-color-text-inverse);background-color:var(--calcite-color-inverse);padding:6px 12px}.esri-menu__list{margin:0;padding:0;list-style:none}.esri-menu__list-item{cursor:pointer;border-top:1px solid #adadad4d;border-left:3px solid #0000;padding:.8em 1em}.esri-menu__list-item [class^=esri-icon-],.esri-menu__list-item [class*=" esri-icon-"]{padding-right:2.8px}.esri-menu__list-item:first-child{border-top:none}.esri-menu__list-item--focus,.esri-menu__list-item:hover,.esri-menu__list-item:focus{background-color:var(--calcite-color-foreground-1)}.esri-menu__list-item:active{background-color:var(--calcite-color-foreground-current)}.esri-menu__list-item--active,.esri-menu__list-item--active:hover,.esri-menu__list-item--active:focus{background-color:var(--calcite-color-foreground-1);border-left-color:var(--calcite-color-brand)}.esri-widget__table{border-collapse:collapse;color:var(--calcite-color-text-1);border:none;width:100%;line-height:var(--calcite-font-line-height-relative-tight)}.esri-widget__table tr:nth-child(odd){background-color:var(--calcite-color-transparent)}.esri-widget__table tr:nth-child(2n){background-color:var(--calcite-color-transparent-press)}.esri-widget__table tr a{color:var(--calcite-color-text-2)}.esri-widget__table tr a:hover,.esri-widget__table tr a:focus{color:var(--calcite-color-text-1)}.esri-widget__table tr td,.esri-widget__table tr th{vertical-align:top;word-break:break-word;padding:.5em .7em;font-size:var(--calcite-font-size-sm);font-weight:var(--calcite-font-weight-regular)}.esri-widget__table tr th{text-align:left;border-right:3px solid #0000000d;width:50%}.esri-widget__table tr td{width:50%}.esri-input{color:var(--calcite-color-text-1);background-color:var(--calcite-color-foreground-1);border:1px solid #959595;font-size:var(--calcite-font-size)}.esri-input::-ms-clear{display:none}.esri-input::placeholder{opacity:1;color:var(--calcite-color-text-2)}.esri-input:placeholder-shown{text-overflow:ellipsis}.esri-input[type=text],.esri-input[type=password],.esri-input[type=number]{height:32px;padding:0 .5em}calcite-combobox.esri-input{border:none}.esri-widget__content--empty{text-align:center;color:var(--calcite-color-border-input);flex-flow:column wrap;align-items:center;padding:18px 22px;display:flex}.esri-widget__content--empty h1.esri-widget__heading,.esri-widget__content--empty h2.esri-widget__heading,.esri-widget__content--empty h3.esri-widget__heading,.esri-widget__content--empty h4.esri-widget__heading,.esri-widget__content--empty h5.esri-widget__heading{font-weight:var(--calcite-font-weight-regular)}.esri-widget__content-illustration--empty{width:128px;padding:1rem 0}.esri-widget__content-icon--empty{width:32px;padding:.5rem 0}.esri-select{appearance:none;cursor:pointer;color:var(--calcite-color-text-2);background:var(--calcite-color-foreground-1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-8 -8 32 32' width='32' height='32'%3E%3Cpath d='M8 11.207l-4-4V5.793l4 4 4-4v1.414z' fill='%23adadad' fillrule='nonzero'/%3E%3C/svg%3E") 100% no-repeat;border:1px solid #959595;border-radius:0;width:100%;height:32px;margin:0;padding:0 .5em;font-family:inherit;font-size:.85em;display:block}.esri-select[disabled]{cursor:auto}.esri-select::-ms-expand{display:none}.esri-disabled a,.esri-disabled [role=menu],.esri-disabled [role=checkbox],.esri-disabled [class^=esri-icon-],.esri-disabled [class*=" esri-icon-"]{color:var(--calcite-color-text-3)}.keynav-mode .esri-widget:focus,.keynav-mode .esri-widget :focus{z-index:1;outline-offset:2px;outline:2px solid #adadad}.esri-widget__loader-animation{border:.15em solid #adadad4d;border-top-color:var(--calcite-color-border-input);border-radius:100%;width:1em;height:1em;font-size:var(--calcite-font-size-md);animation:1.25s linear infinite esri-rotate;display:block;transform:translateZ(0)}:dir(rtl) .esri-widget__table th{text-align:right;border-left:3px solid #0000000d;border-right:none}:dir(rtl) .esri-select{background-position:0}:dir(rtl) .esri-menu__list-item{border-left:none;border-right:3px solid #0000}:dir(rtl) .esri-menu__list-item [class^=esri-icon-],:dir(rtl) .esri-menu__list-item [class*=" esri-icon-"]{padding-left:2px;padding-right:0}:dir(rtl) .esri-menu__list-item--active{border-right-color:var(--calcite-color-brand)}.esri-icon-font-fallback-text{clip:rect(0 0 0 0);width:1px;height:1px;position:absolute;overflow:hidden}.esri-rotating{animation:1.25s linear infinite esri-rotate;transform:translateZ(0)}.esri-clearfix:before,.esri-clearfix:after{content:" ";display:table}.esri-clearfix:after{clear:both}.esri-interactive{cursor:pointer}.esri-hidden{display:none!important}.esri-invisible{visibility:hidden!important}.esri-offscreen{position:absolute;top:-999em;left:-999em}.esri-match-height{flex-direction:column;flex:auto;display:flex;overflow:hidden}:host{display:flex}.arcgis-grid-controls{user-select:none;display:flex;flex-flow:column wrap;padding:var(--calcite-spacing-sm);overflow-y:auto;width:100%;.container{display:flex;flex:1 1 auto;flex-direction:column;gap:var(--calcite-spacing-sm)}.numeric-inputs-container{display:grid;grid-auto-columns:1fr;grid-auto-flow:column;gap:var(--calcite-spacing-sm)}arcgis-labeled-switch{margin-block-end:var(--calcite-spacing-sm)}.switch--bordered{border-width:0 0 var(--calcite-spacing-px) 0;border-style:solid;border-color:var(--calcite-color-border-1);padding-block-end:var(--calcite-spacing-sm)}.tile-group{display:flex;column-gap:var(--calcite-spacing-md);align-items:start;margin-bottom:calc(0px - var(--calcite-spacing-sm))}.tile{position:relative;.content{display:flex;flex-direction:column;row-gap:var(--calcite-spacing-md);align-items:center;padding:var(--calcite-spacing-md);color:var(--calcite-color-text-2)}&.disabled{opacity:var(--calcite-opacity-disabled)}&:focus-within{outline:var(--calcite-spacing-base) solid var(--calcite-color-brand);outline-offset:var(--calcite-spacing-base)}input[type=radio]{appearance:none;position:absolute;inset:0;opacity:.001;border:var(--calcite-spacing-px) solid transparent;cursor:pointer;&:checked+.content{border:var(--calcite-spacing-px) solid var(--calcite-color-brand)}+.content{border:var(--calcite-spacing-px) solid transparent;calcite-label{margin-bottom:calc(0px - var(--calcite-label-margin-bottom, .75rem));font-weight:var(--calcite-font-weight-medium)}}}}.inline-icon{margin-left:var(--calcite-spacing-xs);vertical-align:top;color:var(--calcite-color-status-warning)}}calcite-block>.esri-grid-controls{background:0 0;padding:0}.esri-grid-controls{-webkit-user-select:none;user-select:none;padding:var(--esri-widget-padding);flex-flow:column wrap;display:flex;calcite-label.esri-labeled-switch__label{margin-block-end:var(--calcite-spacing-sm, .5rem)}}.esri-grid-controls__switch--bordered{border-width:0 0 var(--calcite-spacing-px) 0;border-style:solid;border-color:var(--calcite-color-border-1)}.esri-grid-controls__container{gap:var(--calcite-spacing-sm);flex-direction:column;flex:auto;display:flex}.esri-grid-controls__tilegroup{column-gap:var(--calcite-spacing-md);align-items:start;display:flex}.esri-grid-controls__tile__content{row-gap:var(--calcite-spacing-md);padding:var(--calcite-spacing-md);color:var(--calcite-color-text-2);flex-direction:column;align-items:center;display:flex}.esri-grid-controls__tile__content calcite-label{margin-bottom:calc(0px - var(--calcite-label-margin-bottom, .75rem));font-weight:var(--calcite-font-weight-medium)}.esri-grid-controls__tile{position:relative}.esri-grid-controls__tile:focus-within{outline:2px solid var(--calcite-color-brand);outline-offset:2px}.esri-grid-controls__tile--disabled{opacity:var(--calcite-opacity-disabled)}.esri-grid-controls__tile input[type=radio]{appearance:none;opacity:.001;border:var(--calcite-spacing-px) solid transparent;cursor:pointer;position:absolute;inset:0}.esri-grid-controls__tile input[type=radio]:checked+.esri-grid-controls__tile__content{border:var(--calcite-spacing-px) solid var(--calcite-color-brand)}.esri-grid-controls__tile input[type=radio]+.esri-grid-controls__tile__content{border:var(--calcite-spacing-px) solid transparent}.esri-grid-controls__numeric-inputs__container{gap:var(--calcite-spacing-sm);grid-auto-columns:1fr;grid-auto-flow:column;display:grid}.esri-grid-controls__inline-icon{margin-left:var(--calcite-spacing-xs);vertical-align:top;color:var(--calcite-color-status-warning)}:host{--response-toolbar-vert-width: 0;--response-toolbar-vert-height: 100%;--response-toolbar-horiz-width: 100%;--response-toolbar-horiz-height: 0}.esri-responsive-toolbar__ruler{opacity:0;pointer-events:none;position:absolute}.esri-responsive-toolbar__ruler--bar{visibility:hidden;height:0;display:block;position:absolute;top:0;left:0;right:0}.esri-responsive-toolbar__ruler--bar--vertical,.esri-responsive-toolbar__ruler--pad--vertical{width:var(--response-toolbar-vert-width);height:var(--response-toolbar-vert-height)}.esri-responsive-toolbar__ruler--pad--horizontal{width:var(--response-toolbar-horiz-width);height:var(--response-toolbar-horiz-height)}.esri-responsive-toolbar__bar>div{display:contents}.esri-responsive-toolbar__bar--horizontal{min-width:100%}.esri-responsive-toolbar__bar--vertical{min-height:100%}.esri-responsive-toolbar__pad{width:min-content;display:contents}.esri-responsive-toolbar__pad>div{display:contents}.esri-responsive-toolbar__ruler--pad--vertical{width:0;height:min(100vh - 120px,100cqh - 120px)}.esri-responsive-toolbar__ruler--pad--horizontal{width:min(100vw - 60px,100cqw - 60px);height:0}.esri-split-button--split-part--vertical--s{max-height:16px}.esri-split-button--split-part--vertical--m{max-height:24px}.esri-split-button--split-part--vertical--l{max-height:40px}.esri-split-button--split-part--horizontal--s,.esri-split-button--split-part--horizontal--m{max-width:16px}.esri-split-button--split-part--horizontal--l{max-width:24px}.esri-snapping-controls__toggle-block{min-width:100%;margin:0}.esri-snapping-controls__layer-list-block{border-bottom:none;min-width:225px}.esri-snapping-controls__layer-list-block[open]{margin-block:0}.esri-snapping-controls__layer-list{overflow:auto}.esri-snapping-controls__layer-list__filter{margin-bottom:10px}.esri-snapping-controls__layer-list__button{margin-bottom:6px}.esri-snapping-controls__layer-list__item calcite-accordion-item calcite-icon,.esri-snapping-controls__layer-list__item calcite-action calcite-icon{margin-inline-start:0}.esri-snapping-controls__layer-list__item calcite-icon{color:var(--calcite-color-brand);margin-inline-start:var(--calcite-list-item-spacing-indent)}.esri-snapping-controls{flex-flow:column wrap;display:flex}.esri-snapping-controls__container{flex-direction:column;flex:auto;display:flex}.esri-snapping-controls__container :only-child{border-block-end:none}.esri-snapping-controls__panel{width:320px}.esri-snapping-controls__item{border:1px solid #adadad4d;cursor:pointer;background-color:var(--calcite-color-foreground-2);border-color:var(--calcite-color-border-1);border-radius:2px;justify-content:space-between;margin:3px 0;padding:3px;transition:border-color .125s ease-in-out;display:flex;box-shadow:0 1px #adadad4d}.esri-snapping-controls__item-action-icon{flex:0 0 16px;width:16px;height:16px;margin-top:.1em;font-size:var(--calcite-font-size-md);display:inline-block}.esri-snapping-controls__action-toggle{opacity:1;cursor:pointer;border:1px solid var(--calcite-color-border-1);flex-flow:row-reverse;justify-content:space-between;align-items:flex-start;width:100%;margin:0;padding:6px 15px;font-size:var(--calcite-font-size-sm);transition:opacity .25s ease-in-out .25s,background-color .25s ease-in-out;display:flex}.esri-snapping-controls__action-toggle .esri-snapping-controls__item-action-title{margin-left:0}.esri-snapping-controls__action-toggle .esri-snapping-controls__item-action-icon{background-color:var(--calcite-color-foreground-1);border-radius:16px;flex:0 0 28px;width:16px;height:16px;padding:0;transition:background-color .125s ease-in-out;position:relative;overflow:hidden;box-shadow:0 0 0 1px #adadad}.esri-snapping-controls__action-toggle .esri-snapping-controls__item-action-icon:before{content:"";background-color:var(--calcite-color-foreground-2);border-radius:100%;width:12px;height:12px;margin:2px;transition:background-color .125s ease-in-out,left .125s ease-in-out;display:block;position:absolute;top:0;left:0;box-shadow:0 0 0 1px #242424}.esri-snapping-controls__action-toggle--on .esri-snapping-controls__item-action-icon{background-color:var(--calcite-color-foreground-1);box-shadow:0 0 0 1px #adadad}.esri-snapping-controls__action-toggle--on .esri-snapping-controls__item-action-icon:before{background-color:var(--calcite-color-foreground-3);left:12px}.esri-snapping-controls__nested-container{flex-direction:column;gap:6px;display:flex}.esri-snapping-controls__nested-container:not(:empty){padding-top:6px;padding-inline-start:1em}.esri-labeled-switch__label{--calcite-label-margin-bottom: 0}.esri-labeled-switch__label-content{text-wrap:balance;flex:1;align-items:center;gap:7px;display:flex}.esri-labeled-switch__label-content>div{flex-grow:1}.esri-labeled-switch__icon{margin-top:-1px}.esri-labeled-switch__icon_info{color:var(--calcite-color-status-info)}.esri-labeled-switch__icon_warning{color:var(--calcite-color-status-warning)}.esri-labeled-switch__tooltip{text-wrap:wrap}:host{display:flex;max-width:100%;justify-content:flex-end;pointer-events:none;--sketch-pad-flex-flow: wrap;--sketch-view-height-offset: 63px ;--sketch-view-margin-offset: 30px;--sketch-popover-header-offset: 49px}:host([scale="s"]){--sketch-view-height-offset: 47px ;--sketch-view-margin-offset: 30px;--sketch-popover-header-offset: 33px}:host([scale="l"]){--sketch-view-height-offset: 79px ;--sketch-view-margin-offset: 30px;--sketch-popover-header-offset: 65px}div:has(>.esri-sketch){display:contents}.esri-sketch{-webkit-user-select:none;user-select:none;pointer-events:none;display:flex}.esri-sketch-pad{gap:var(--arcgis-internal-sketch-gap, var(--calcite-spacing-sm));flex-flow:var(--sketch-pad-flex-flow);justify-content:var(--arcgis-internal-sketch-justify-content, flex-start)}.esri-sketch-pad:dir(rtl){flex-flow:row-reverse wrap}.esri-sketch-pad.esri-sketch--vertical{flex-flow:var(--sketch-pad-flex-flow, column wrap);justify-content:flex-start;--sketch-view-height-offset: 30px;--sketch-view-margin-offset: 15px}.esri-sketch-pad.esri-sketch--vertical:dir(rtl){flex-flow:var(--sketch-pad-flex-flow, column wrap-reverse)}.esri-sketch-pad.esri-sketch--vertical .esri-selection-toolbar__container{flex-direction:column}.esri-sketch>*{pointer-events:initial;display:flex}.esri-sketch-bar{flex-direction:column;gap:0;margin:0;flex-basis:100%}.esri-sketch-bar.esri-sketch--vertical{flex-flow:row}.esri-sketch__popover-wrapper{inline-size:max-content;min-inline-size:300px;max-height:calc(100cqh - (var(--sketch-view-height-offset, 90px)) - var(--sketch-view-margin-offset, 15px) - var(--sketch-popover-header-offset, 1000px));-webkit-user-select:none;user-select:none;max-inline-size:400px;overflow-y:auto}.esri-sketch__popover-wrapper .esri-sketch-tooltip-controls:not(:only-child) calcite-block{border-block-end-width:1px;border-style:solid;border-color:var(--calcite-color-border-3)}.esri-sketch__selection-count-chip--horizontal{margin-block:var(--calcite-spacing-xxs);margin-inline:var(--calcite-spacing-xs);align-self:center}.esri-sketch__selection-count-chip--vertical{margin-block:calc(var(--calcite-spacing-md) * var(--sketch-chip-margin-scale-factor, 1));scale:var(--sketch-chip-rescale, 1);align-self:center;margin-inline:0}.esri-sketch__selection-count-chip--vertical--s{--sketch-chip-rescale: .8;--sketch-chip-margin-scale-factor: .5}.esri-sketch--vertical{max-height:min(100vh - 120px,100cqh - 120px)}.esri-expand__popover-content .esri-sketch{gap:0}.esri-sketch-tooltip-controls{flex-flow:column wrap;min-width:100%;display:flex}.esri-sketch-tooltip-controls__block{border-block-end:none;margin:0}.esri-sketch-tooltip-controls__block-content{flex-direction:column;gap:6px;display:flex}.esri-sketch-tooltip-controls__radio-button-label-wrapper{align-items:center;gap:2px;display:flex}.esri-sketch-tooltip-controls calcite-label:last-child{--calcite-label-margin-bottom: 0}`, m = d(l);
class b extends n {
  constructor() {
    super(), this.widget = m(this), this.viewModel = this.widget.viewModel, this._defaultGraphicsLayer = null, this.view = this.widget.view, this.activeTool = this.widget.activeTool, this.autoDestroyDisabled = !1, this.availableCreateTools = this.widget.availableCreateTools, this.createGraphic = this.widget.createGraphic, this.creationMode = this.widget.creationMode, this.defaultCreateOptions = this.widget.defaultCreateOptions, this.defaultGraphicsLayerDisabled = !1, this.defaultUpdateOptions = this.widget.defaultUpdateOptions, this.hideCreateToolsCircle = this.widget.visibleElements.createTools.circle, this.hideCreateToolsMultipoint = this.widget.visibleElements.createTools.multipoint, this.hideCreateToolsPoint = this.widget.visibleElements.createTools.point, this.hideCreateToolsPolygon = this.widget.visibleElements.createTools.polygon, this.hideCreateToolsPolyline = this.widget.visibleElements.createTools.polyline, this.hideCreateToolsRectangle = this.widget.visibleElements.createTools.rectangle, this.hideDuplicateButton = this.widget.visibleElements.duplicateButton, this.hideDeleteButton = this.widget.visibleElements.deleteButton, this.hideSelectionCountLabel = this.widget.visibleElements.selectionCountLabel, this.hideLabelsToggle = this.widget.visibleElements.labelsToggle, this.hideSelectionToolsLassoSelection = this.widget.visibleElements.selectionTools["lasso-selection"], this.hideSelectionToolsRectangleSelection = this.widget.visibleElements.selectionTools["rectangle-selection"], this.hideSettingsMenu = this.widget.visibleElements.settingsMenu, this.hideSnappingControls = this.widget.visibleElements.snappingControls, this.hideSnappingControlsElementsEnabledToggle = this.widget.visibleElements.snappingControlsElements.enabledToggle, this.hideSnappingControlsElementsFeatureEnabledToggle = this.widget.visibleElements.snappingControlsElements.featureEnabledToggle, this.hideSnappingControlsElementsLayerList = this.widget.visibleElements.snappingControlsElements.layerList, this.hideSnappingControlsElementsSelfEnabledToggle = this.widget.visibleElements.snappingControlsElements.selfEnabledToggle, this.hideTooltipsToggle = this.widget.visibleElements.tooltipsToggle, this.hideUndoRedoMenu = this.widget.visibleElements.undoRedoMenu, this.icon = this.widget.icon, this.label = this.widget.label, this.labelOptions = this.widget.labelOptions, this.layer = this.widget.layer, this.layout = this.widget.layout, this.pointSymbol = this.viewModel.pointSymbol, this.polygonSymbol = this.viewModel.polygonSymbol, this.polylineSymbol = this.viewModel.polylineSymbol, this.scale = this.widget.scale, this.toolbarKind = this.widget.toolbarKind, this.showSnappingControlsElementsHeader = this.widget.visibleElements.snappingControlsElements.header, this.showCreateToolsFreehandPolygon = this.widget.visibleElements.createTools.freehandPolygon, this.showCreateToolsFreehandPolyline = this.widget.visibleElements.createTools.freehandPolyline, this.snappingOptions = this.widget.snappingOptions, this.state = this.widget.state, this.tooltipOptions = this.widget.tooltipOptions, this.updateGraphics = this.widget.updateGraphics, this.arcgisCreate = o(() => this.widget, "create"), this.arcgisDelete = o(() => this.widget, "delete"), this.arcgisPropertyChange = s()("state"), this.arcgisReady = c(), this.arcgisRedo = o(() => this.widget, "redo"), this.arcgisUndo = o(() => this.widget, "undo"), this.arcgisUpdate = o(() => this.widget, "update"), this.listen("arcgisReady", this._arcgisReadyHandler);
  }
  static {
    this.properties = { view: 0, activeTool: 3, autoDestroyDisabled: 5, availableCreateTools: 0, createGraphic: 0, creationMode: 1, defaultCreateOptions: 0, defaultGraphicsLayerDisabled: 5, defaultUpdateOptions: 0, hideCreateToolsCircle: 5, hideCreateToolsMultipoint: 5, hideCreateToolsPoint: 5, hideCreateToolsPolygon: 5, hideCreateToolsPolyline: 5, hideCreateToolsRectangle: 5, hideDuplicateButton: 5, hideDeleteButton: 5, hideSelectionCountLabel: 5, hideLabelsToggle: 5, hideSelectionToolsLassoSelection: 5, hideSelectionToolsRectangleSelection: 5, hideSettingsMenu: 5, hideSnappingControls: 5, hideSnappingControlsElementsEnabledToggle: 5, hideSnappingControlsElementsFeatureEnabledToggle: 5, hideSnappingControlsElementsLayerList: 5, hideSnappingControlsElementsSelfEnabledToggle: 5, hideTooltipsToggle: 5, hideUndoRedoMenu: 5, icon: 1, label: 1, labelOptions: 0, layer: 0, layout: 1, pointSymbol: 0, polygonSymbol: 0, polylineSymbol: 0, position: 1, referenceElement: 1, scale: 1, toolbarKind: 1, showSnappingControlsElementsHeader: 5, showCreateToolsFreehandPolygon: 5, showCreateToolsFreehandPolyline: 5, snappingOptions: 0, state: 3, tooltipOptions: 0, updateGraphics: 0 };
  }
  static {
    this.styles = h;
  }
  async cancel() {
    this.widget?.cancel();
  }
  async complete() {
    this.widget?.complete();
  }
  async create(i, e) {
    await this.widget?.create(i, e);
  }
  async delete() {
    this.widget?.delete();
  }
  async destroy() {
    await this.manager.destroy();
  }
  async duplicate() {
    this.widget?.duplicate();
  }
  async redo() {
    this.widget?.redo();
  }
  async triggerUpdate(i, e) {
    this.widget?.update(i, e);
  }
  async undo() {
    this.widget?.undo();
  }
  _arcgisReadyHandler() {
    this.defaultGraphicsLayerDisabled || (this._defaultGraphicsLayer = new a({ title: "Sketch Layer" }), this.widget.availableCreateTools = [
      "point",
      "polyline",
      "freehandPolyline",
      "polygon",
      "freehandPolygon",
      "rectangle",
      "circle"
    ], this.widget.layer = this._defaultGraphicsLayer, this.el.view?.map?.add(this.widget.layer), this.manager.onLifecycle(() => g(() => this.el.view?.map, (i, e) => {
      const t = this._defaultGraphicsLayer;
      !t || this.widget.layer !== t || (e?.allLayers.includes(t) && e.remove(t), i?.add(t));
    })), this.manager.onDestroy(() => {
      this._defaultGraphicsLayer && this.el.view?.map?.allLayers.includes(this._defaultGraphicsLayer) && this.el.view?.map?.remove(this._defaultGraphicsLayer), this._defaultGraphicsLayer?.destroy(), this._defaultGraphicsLayer = null;
    }));
  }
}
r("arcgis-sketch", b);
export {
  b as ArcgisSketch
};
