@esri/solutions-components 0.6.10 → 0.6.11
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/buffer-tools_4.cjs.entry.js +4 -2
- package/dist/collection/components/buffer-tools/buffer-tools.js +4 -2
- package/dist/collection/components/map-picker/map-picker.css +64 -64
- package/dist/collection/components/map-tools/map-tools.css +45 -45
- package/dist/components/buffer-tools2.js +4 -2
- package/dist/esm/buffer-tools_4.entry.js +4 -2
- package/dist/solutions-components/{p-35cb6eca.entry.js → p-7a8d99fe.entry.js} +2 -2
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
@@ -165,9 +165,11 @@ const BufferTools = class {
|
|
165
165
|
}
|
166
166
|
this._bufferTimeout = setTimeout(() => {
|
167
167
|
var _a;
|
168
|
-
// needs to be wgs 84 or Web Mercator
|
169
168
|
if (((_a = this.geometries) === null || _a === void 0 ? void 0 : _a.length) > 0 && this.unit && this.distance > 0) {
|
170
|
-
const
|
169
|
+
const geom = this.geometries[0];
|
170
|
+
const sr = geom.spatialReference;
|
171
|
+
const buffer = (sr.isWGS84 || sr.isWebMercator) ?
|
172
|
+
this._geometryEngine.geodesicBuffer(this.geometries, this.distance, this.unit, this.unionResults) : this._geometryEngine.buffer(this.geometries, this.distance, this.unit, this.unionResults);
|
171
173
|
this.bufferComplete.emit(buffer);
|
172
174
|
}
|
173
175
|
}, 400);
|
@@ -154,9 +154,11 @@ export class BufferTools {
|
|
154
154
|
}
|
155
155
|
this._bufferTimeout = setTimeout(() => {
|
156
156
|
var _a;
|
157
|
-
// needs to be wgs 84 or Web Mercator
|
158
157
|
if (((_a = this.geometries) === null || _a === void 0 ? void 0 : _a.length) > 0 && this.unit && this.distance > 0) {
|
159
|
-
const
|
158
|
+
const geom = this.geometries[0];
|
159
|
+
const sr = geom.spatialReference;
|
160
|
+
const buffer = (sr.isWGS84 || sr.isWebMercator) ?
|
161
|
+
this._geometryEngine.geodesicBuffer(this.geometries, this.distance, this.unit, this.unionResults) : this._geometryEngine.buffer(this.geometries, this.distance, this.unit, this.unionResults);
|
160
162
|
this.bufferComplete.emit(buffer);
|
161
163
|
}
|
162
164
|
}, 400);
|
@@ -1,64 +1,64 @@
|
|
1
|
-
/** @license
|
2
|
-
* Copyright 2023 Esri
|
3
|
-
*
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
* you may not use this file except in compliance with the License.
|
6
|
-
* You may obtain a copy of the License at
|
7
|
-
*
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
*
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
* See the License for the specific language governing permissions and
|
14
|
-
* limitations under the License.
|
15
|
-
*/
|
16
|
-
|
17
|
-
:host {
|
18
|
-
display: block;
|
19
|
-
}
|
20
|
-
|
21
|
-
.width-full {
|
22
|
-
width: 100%;
|
23
|
-
}
|
24
|
-
|
25
|
-
.height-full {
|
26
|
-
height: 100%;
|
27
|
-
}
|
28
|
-
|
29
|
-
.display-flex {
|
30
|
-
display: flex;
|
31
|
-
}
|
32
|
-
|
33
|
-
.border-bottom-1 {
|
34
|
-
border-width: 0px;
|
35
|
-
border-bottom-width: 1px;
|
36
|
-
border-style: solid;
|
37
|
-
border-color: var(--calcite-ui-border-3);
|
38
|
-
}
|
39
|
-
|
40
|
-
.action-bar-size {
|
41
|
-
height: 51px;
|
42
|
-
width: 100%;
|
43
|
-
}
|
44
|
-
|
45
|
-
.map-list {
|
46
|
-
position: absolute;
|
47
|
-
display: flex;
|
48
|
-
flex-direction: column;
|
49
|
-
overflow: hidden;
|
50
|
-
animation: calcite-scrim-fade-in var(--calcite-internal-animation-timing-medium) ease-in-out;
|
51
|
-
background-color: var(--calcite-scrim-background);
|
52
|
-
z-index: 1000;
|
53
|
-
width: 100%;
|
54
|
-
height: -moz-fit-content;
|
55
|
-
height: fit-content;
|
56
|
-
}
|
57
|
-
|
58
|
-
.display-none {
|
59
|
-
display: none;
|
60
|
-
}
|
61
|
-
|
62
|
-
.action-bar-color {
|
63
|
-
background-color: var(--calcite-ui-border-3) !important;
|
64
|
-
}
|
1
|
+
/** @license
|
2
|
+
* Copyright 2023 Esri
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
|
17
|
+
:host {
|
18
|
+
display: block;
|
19
|
+
}
|
20
|
+
|
21
|
+
.width-full {
|
22
|
+
width: 100%;
|
23
|
+
}
|
24
|
+
|
25
|
+
.height-full {
|
26
|
+
height: 100%;
|
27
|
+
}
|
28
|
+
|
29
|
+
.display-flex {
|
30
|
+
display: flex;
|
31
|
+
}
|
32
|
+
|
33
|
+
.border-bottom-1 {
|
34
|
+
border-width: 0px;
|
35
|
+
border-bottom-width: 1px;
|
36
|
+
border-style: solid;
|
37
|
+
border-color: var(--calcite-ui-border-3);
|
38
|
+
}
|
39
|
+
|
40
|
+
.action-bar-size {
|
41
|
+
height: 51px;
|
42
|
+
width: 100%;
|
43
|
+
}
|
44
|
+
|
45
|
+
.map-list {
|
46
|
+
position: absolute;
|
47
|
+
display: flex;
|
48
|
+
flex-direction: column;
|
49
|
+
overflow: hidden;
|
50
|
+
animation: calcite-scrim-fade-in var(--calcite-internal-animation-timing-medium) ease-in-out;
|
51
|
+
background-color: var(--calcite-scrim-background);
|
52
|
+
z-index: 1000;
|
53
|
+
width: 100%;
|
54
|
+
height: -moz-fit-content;
|
55
|
+
height: fit-content;
|
56
|
+
}
|
57
|
+
|
58
|
+
.display-none {
|
59
|
+
display: none;
|
60
|
+
}
|
61
|
+
|
62
|
+
.action-bar-color {
|
63
|
+
background-color: var(--calcite-ui-border-3) !important;
|
64
|
+
}
|
@@ -1,45 +1,45 @@
|
|
1
|
-
/** @license
|
2
|
-
* Copyright 2022 Esri
|
3
|
-
*
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
* you may not use this file except in compliance with the License.
|
6
|
-
* You may obtain a copy of the License at
|
7
|
-
*
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
*
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
* See the License for the specific language governing permissions and
|
14
|
-
* limitations under the License.
|
15
|
-
*/
|
16
|
-
|
17
|
-
:host {
|
18
|
-
display: block;
|
19
|
-
}
|
20
|
-
|
21
|
-
.display-none {
|
22
|
-
display: none;
|
23
|
-
}
|
24
|
-
|
25
|
-
.border {
|
26
|
-
border: 1px solid var(--calcite-ui-border-3);
|
27
|
-
}
|
28
|
-
|
29
|
-
.margin-top-1-2 {
|
30
|
-
margin-top: 0.5rem;
|
31
|
-
}
|
32
|
-
|
33
|
-
.square-40 {
|
34
|
-
width: 40px;
|
35
|
-
height: 40px;
|
36
|
-
}
|
37
|
-
|
38
|
-
.width-40 {
|
39
|
-
width: 40px;
|
40
|
-
}
|
41
|
-
|
42
|
-
.square-40-41 {
|
43
|
-
width: 40px;
|
44
|
-
height: 41px;
|
45
|
-
}
|
1
|
+
/** @license
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
|
17
|
+
:host {
|
18
|
+
display: block;
|
19
|
+
}
|
20
|
+
|
21
|
+
.display-none {
|
22
|
+
display: none;
|
23
|
+
}
|
24
|
+
|
25
|
+
.border {
|
26
|
+
border: 1px solid var(--calcite-ui-border-3);
|
27
|
+
}
|
28
|
+
|
29
|
+
.margin-top-1-2 {
|
30
|
+
margin-top: 0.5rem;
|
31
|
+
}
|
32
|
+
|
33
|
+
.square-40 {
|
34
|
+
width: 40px;
|
35
|
+
height: 40px;
|
36
|
+
}
|
37
|
+
|
38
|
+
.width-40 {
|
39
|
+
width: 40px;
|
40
|
+
}
|
41
|
+
|
42
|
+
.square-40-41 {
|
43
|
+
width: 40px;
|
44
|
+
height: 41px;
|
45
|
+
}
|
@@ -155,9 +155,11 @@ const BufferTools = /*@__PURE__*/ proxyCustomElement(class BufferTools extends H
|
|
155
155
|
}
|
156
156
|
this._bufferTimeout = setTimeout(() => {
|
157
157
|
var _a;
|
158
|
-
// needs to be wgs 84 or Web Mercator
|
159
158
|
if (((_a = this.geometries) === null || _a === void 0 ? void 0 : _a.length) > 0 && this.unit && this.distance > 0) {
|
160
|
-
const
|
159
|
+
const geom = this.geometries[0];
|
160
|
+
const sr = geom.spatialReference;
|
161
|
+
const buffer = (sr.isWGS84 || sr.isWebMercator) ?
|
162
|
+
this._geometryEngine.geodesicBuffer(this.geometries, this.distance, this.unit, this.unionResults) : this._geometryEngine.buffer(this.geometries, this.distance, this.unit, this.unionResults);
|
161
163
|
this.bufferComplete.emit(buffer);
|
162
164
|
}
|
163
165
|
}, 400);
|
@@ -161,9 +161,11 @@ const BufferTools = class {
|
|
161
161
|
}
|
162
162
|
this._bufferTimeout = setTimeout(() => {
|
163
163
|
var _a;
|
164
|
-
// needs to be wgs 84 or Web Mercator
|
165
164
|
if (((_a = this.geometries) === null || _a === void 0 ? void 0 : _a.length) > 0 && this.unit && this.distance > 0) {
|
166
|
-
const
|
165
|
+
const geom = this.geometries[0];
|
166
|
+
const sr = geom.spatialReference;
|
167
|
+
const buffer = (sr.isWGS84 || sr.isWebMercator) ?
|
168
|
+
this._geometryEngine.geodesicBuffer(this.geometries, this.distance, this.unit, this.unionResults) : this._geometryEngine.buffer(this.geometries, this.distance, this.unit, this.unionResults);
|
167
169
|
this.bufferComplete.emit(buffer);
|
168
170
|
}
|
169
171
|
}, 400);
|
@@ -3,7 +3,7 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import{r as t,c as i,h as s,H as e,g as a}from"./p-9310b882.js";import{l}from"./p-0266ca81.js";import{g as
|
6
|
+
import{r as t,c as i,h as s,H as e,g as a}from"./p-9310b882.js";import{l as h}from"./p-0266ca81.js";import{g as l}from"./p-7f9642d5.js";import{w as n,i as r,x as o}from"./p-a16feeec.js";import{g as c}from"./p-8b448a5b.js";import{c as d,d as u,a as m,H as b}from"./p-072155f9.js";import{c as p,d as v,u as g}from"./p-ad75b9bb.js";import{i as f}from"./p-43ba7a04.js";import{c as x,d as _,g as k}from"./p-d2d3e4b5.js";import{s as w,a as y,c as V}from"./p-476e5302.js";import{n as z,c as $,d as M}from"./p-7f271c31.js";import{d as D,c as H}from"./p-3d3e6e20.js";import{f as I}from"./p-868df4a0.js";import{s as j}from"./p-3445a8c6.js";import"./p-e1a4994d.js";import"./p-e3525c00.js";import"./p-588bc0c0.js";import"./p-2c0dc7b1.js";const C=class{constructor(s){t(this,s),this.bufferComplete=i(this,"bufferComplete",7),this.distanceChanged=i(this,"distanceChanged",7),this.unitChanged=i(this,"unitChanged",7),this.appearance="text",this.distance=0,this.geometries=[],this.max=void 0,this.min=0,this.sliderTicks=10,this.unionResults=!0,this.unit="meters",this.disabled=!1,this._translations=void 0}geometriesWatchHandler(){this._buffer()}disabledWatchHandler(){this._buffer()}async componentWillLoad(){await this._getTranslations(),await this._initModules()}render(){return s(e,null,"text"===this.appearance?this._getTextBoxDisplay():this._getSliderDisplay())}async _initModules(){const[t]=await h(["esri/geometry/geometryEngine"]);this._geometryEngine=t}_getUnits(){const t={feet:this._translations.feet,meters:this._translations.meters,miles:this._translations.miles,kilometers:this._translations.kilometers};return Object.keys(t).map((i=>s("calcite-option",{label:t[i],selected:this.unit===i,value:i})))}_setDistance(t){const i=parseInt(t.target.value,10);this.distance!==i&&i>=this.min&&(this.distanceChanged.emit({oldValue:this.distance,newValue:i}),this.distance=i,this.distance>0?this._buffer():this.bufferComplete.emit(void 0))}_setUnit(t){this.unitChanged.emit({oldValue:this.unit,newValue:t}),this.unit=t,this._buffer()}_buffer(){this.disabled?this.bufferComplete.emit(void 0):(this._bufferTimeout&&clearTimeout(this._bufferTimeout),this._bufferTimeout=setTimeout((()=>{var t;if((null===(t=this.geometries)||void 0===t?void 0:t.length)>0&&this.unit&&this.distance>0){const t=this.geometries[0].spatialReference,i=t.isWGS84||t.isWebMercator?this._geometryEngine.geodesicBuffer(this.geometries,this.distance,this.unit,this.unionResults):this._geometryEngine.buffer(this.geometries,this.distance,this.unit,this.unionResults);this.bufferComplete.emit(i)}}),400))}_getTextBoxDisplay(){return s("div",{class:"c-container"},s("calcite-input",{class:"padding-end-1 w-50",max:this.max&&this.max>0?this.max:void 0,min:this.min,"number-button-type":"vertical",onCalciteInputInput:t=>this._setDistance(t),placeholder:"0",type:"number",value:this.distance?this.distance.toString():void 0}),s("calcite-select",{class:"flex-1 w-50",label:"label",onCalciteSelectChange:()=>this._setUnit(this._unitElement.value),ref:t=>{this._unitElement=t}},this._getUnits()))}_getSliderDisplay(){return s("div",null,s("calcite-slider",{labelHandles:!0,max:this.max&&this.max>0?this.max:void 0,min:this.min,ticks:this.sliderTicks}))}async _getTranslations(){const t=await l(this.el);this._translations=t[0]}_testAccess(t,i){switch(t){case"_setUnit":return this._setUnit(i);case"_setDistance":return this._setDistance(i)}return null}get el(){return a(this)}static get watchers(){return{geometries:["geometriesWatchHandler"],disabled:["disabledWatchHandler"]}}};
|
7
7
|
/*!
|
8
8
|
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
9
9
|
* See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
|
@@ -15,4 +15,4 @@ var S;C.style=':host{display:block}.c-container{display:inline-flex}.flex-1{flex
|
|
15
15
|
* See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
|
16
16
|
* v1.6.1
|
17
17
|
*/
|
18
|
-
const T="handle__label";function F(t){return Array.isArray(t)}const L=class{constructor(s){t(this,s),this.calciteSliderInput=i(this,"calciteSliderInput",6),this.calciteSliderChange=i(this,"calciteSliderChange",6),this.activeProp="value",this.guid=`calcite-slider-${c()}`,this.dragUpdate=t=>{if(!this.disabled&&(t.preventDefault(),this.dragProp)){const i=this.translate(t.clientX||t.pageX);if(F(this.value)&&"minMaxValue"===this.dragProp)if(this.minValueDragRange&&this.maxValueDragRange&&this.minMaxValueRange){const t=i-this.minValueDragRange,s=i+this.maxValueDragRange;s<=this.max&&t>=this.min&&s-t===this.minMaxValueRange&&this.setValue({minValue:this.clamp(t,"minValue"),maxValue:this.clamp(s,"maxValue")})}else this.minValueDragRange=i-this.minValue,this.maxValueDragRange=this.maxValue-i,this.minMaxValueRange=this.maxValue-this.minValue;else this.setValue({[this.dragProp]:this.clamp(i,this.dragProp)})}},this.pointerUpDragEnd=t=>{!this.disabled&&r(t)&&this.dragEnd(t)},this.dragEnd=t=>{this.disabled||(this.removeDragListeners(),this.focusActiveHandle(t.clientX),this.lastDragPropValue!=this[this.dragProp]&&this.emitChange(),this.dragProp=null,this.lastDragPropValue=null,this.minValueDragRange=null,this.maxValueDragRange=null,this.minMaxValueRange=null)},this.storeTrackRef=t=>{this.trackEl=t},this.determineGroupSeparator=t=>{if("number"==typeof t)return z.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator},z.localize(t.toString())},this.disabled=!1,this.form=void 0,this.groupSeparator=!1,this.hasHistogram=!1,this.histogram=void 0,this.histogramStops=void 0,this.labelHandles=!1,this.labelTicks=!1,this.max=100,this.maxLabel=void 0,this.maxValue=void 0,this.min=0,this.minLabel=void 0,this.minValue=void 0,this.mirrored=!1,this.name=void 0,this.numberingSystem=void 0,this.pageStep=void 0,this.precise=!1,this.required=!1,this.snap=!1,this.step=1,this.ticks=void 0,this.value=0,this.scale="m",this.effectiveLocale="",this.minMaxValueRange=null,this.minValueDragRange=null,this.maxValueDragRange=null,this.tickValues=[]}histogramWatcher(t){this.hasHistogram=!!t}ticksWatcher(){this.tickValues=this.generateTickValues()}valueHandler(){this.setMinMaxFromValue()}minMaxValueHandler(){this.setValueFromMinMax()}connectedCallback(){p(this),$(this),this.setMinMaxFromValue(),this.setValueFromMinMax(),x(this),d(this)}disconnectedCallback(){v(this),_(this),u(this),M(this),this.removeDragListeners()}componentWillLoad(){w(this),F(this.value)||(this.value=this.snap?this.getClosestStep(this.value):this.clamp(this.value)),this.ticksWatcher(),this.histogramWatcher(this.histogram),m(this,this.value)}componentDidLoad(){y(this)}componentDidRender(){this.labelHandles&&(this.adjustHostObscuredHandleLabel("value"),F(this.value)&&(this.adjustHostObscuredHandleLabel("minValue"),this.precise&&!this.hasHistogram||this.hyphenateCollidingRangeHandleLabels())),this.hideObscuredBoundingTickLabels(),g(this)}render(){const t=this.el.id||this.guid,i=F(this.value)?"maxValue":"value",a=F(this.value)?this.maxValue:this.value,l=this.determineGroupSeparator(a),h=this.determineGroupSeparator(this.minValue),n=this.minValue||this.min,r=this.shouldUseMinValue(),o=100*this.getUnitInterval(r?this.minValue:n),c=100*this.getUnitInterval(a),d=this.shouldMirror(),u=`${d?100-o:o}%`,m=`${d?c:100-c}%`,p=F(this.value),v=`${T} handle__label--minValue`,g=`${T} handle__label--value`,f=s("div",{"aria-disabled":this.disabled,"aria-label":p?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":a,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===i},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=i,onPointerDown:t=>this.pointerDownDragStart(t,i),role:"slider",style:{right:m},tabIndex:0,ref:t=>this.maxHandle=t},s("div",{class:"handle"})),x=s("div",{"aria-disabled":this.disabled,"aria-label":p?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":a,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===i},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=i,onPointerDown:t=>this.pointerDownDragStart(t,i),role:"slider",style:{right:m},tabIndex:0,ref:t=>this.maxHandle=t},s("span",{"aria-hidden":"true",class:g},l),s("span",{"aria-hidden":"true",class:`${g} static`},l),s("span",{"aria-hidden":"true",class:`${g} transformed`},l),s("div",{class:"handle"})),_=s("div",{"aria-disabled":this.disabled,"aria-label":p?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":a,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===i},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=i,onPointerDown:t=>this.pointerDownDragStart(t,i),role:"slider",style:{right:m},tabIndex:0,ref:t=>this.maxHandle=t},s("div",{class:"handle"}),s("span",{"aria-hidden":"true",class:g},l),s("span",{"aria-hidden":"true",class:`${g} static`},l),s("span",{"aria-hidden":"true",class:`${g} transformed`},l)),w=s("div",{"aria-disabled":this.disabled,"aria-label":p?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":a,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===i,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=i,onPointerDown:t=>this.pointerDownDragStart(t,i),role:"slider",style:{right:m},tabIndex:0,ref:t=>this.maxHandle=t},s("div",{class:"handle"}),s("div",{class:"handle-extension"})),y=s("div",{"aria-disabled":this.disabled,"aria-label":p?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":a,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===i,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=i,onPointerDown:t=>this.pointerDownDragStart(t,i),role:"slider",style:{right:m},tabIndex:0,ref:t=>this.maxHandle=t},s("div",{class:"handle-extension"}),s("div",{class:"handle"})),V=s("div",{"aria-disabled":this.disabled,"aria-label":p?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":a,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===i,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=i,onPointerDown:t=>this.pointerDownDragStart(t,i),role:"slider",style:{right:m},tabIndex:0,ref:t=>this.maxHandle=t},s("span",{"aria-hidden":"true",class:g},l),s("span",{"aria-hidden":"true",class:`${g} static`},l),s("span",{"aria-hidden":"true",class:`${g} transformed`},l),s("div",{class:"handle"}),s("div",{class:"handle-extension"})),z=s("div",{"aria-disabled":this.disabled,"aria-label":p?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":a,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===i,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=i,onPointerDown:t=>this.pointerDownDragStart(t,i),role:"slider",style:{right:m},tabIndex:0,ref:t=>this.maxHandle=t},s("div",{class:"handle-extension"}),s("div",{class:"handle"}),s("span",{"aria-hidden":"true",class:g},l),s("span",{"aria-hidden":"true",class:`${g} static`},l),s("span",{"aria-hidden":"true",class:`${g} transformed`},l)),$=s("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:t=>this.pointerDownDragStart(t,"minValue"),role:"slider",style:{left:u},tabIndex:0,ref:t=>this.minHandle=t},s("div",{class:"handle"})),M=s("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:t=>this.pointerDownDragStart(t,"minValue"),role:"slider",style:{left:u},tabIndex:0,ref:t=>this.minHandle=t},s("span",{"aria-hidden":"true",class:v},h),s("span",{"aria-hidden":"true",class:`${v} static`},h),s("span",{"aria-hidden":"true",class:`${v} transformed`},h),s("div",{class:"handle"})),D=s("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:t=>this.pointerDownDragStart(t,"minValue"),role:"slider",style:{left:u},tabIndex:0,ref:t=>this.minHandle=t},s("div",{class:"handle"}),s("span",{"aria-hidden":"true",class:v},h),s("span",{"aria-hidden":"true",class:`${v} static`},h),s("span",{"aria-hidden":"true",class:`${v} transformed`},h)),H=s("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:t=>this.pointerDownDragStart(t,"minValue"),role:"slider",style:{left:u},tabIndex:0,ref:t=>this.minHandle=t},s("div",{class:"handle-extension"}),s("div",{class:"handle"})),I=s("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:t=>this.pointerDownDragStart(t,"minValue"),role:"slider",style:{left:u},tabIndex:0,ref:t=>this.minHandle=t},s("div",{class:"handle-extension"}),s("div",{class:"handle"}),s("span",{"aria-hidden":"true",class:v},h),s("span",{"aria-hidden":"true",class:`${v} static`},h),s("span",{"aria-hidden":"true",class:`${v} transformed`},h));return s(e,{id:t,onTouchStart:this.handleTouchStart},s("div",{"aria-label":k(this),class:{container:!0,"container--range":p,[`scale--${this.scale}`]:!0}},this.renderGraph(),s("div",{class:"track",ref:this.storeTrackRef},s("div",{class:"track__range",onPointerDown:t=>this.pointerDownDragStart(t,"minMaxValue"),style:{left:`${d?100-c:o}%`,right:`${d?o:100-c}%`}}),s("div",{class:"ticks"},this.tickValues.map((t=>{const i=100*this.getUnitInterval(t)+"%";let e=t>=n&&t<=a;return r&&(e=t>=this.minValue&&t<=this.maxValue),s("span",{class:{tick:!0,"tick--active":e},style:{left:d?"":i,right:d?i:""}},this.renderTickLabel(t))})))),s("div",{class:"thumb-container"},!this.precise&&!this.labelHandles&&p&&$,!this.hasHistogram&&!this.precise&&this.labelHandles&&p&&M,this.precise&&!this.labelHandles&&p&&H,this.precise&&this.labelHandles&&p&&I,this.hasHistogram&&!this.precise&&this.labelHandles&&p&&D,!this.precise&&!this.labelHandles&&f,!this.hasHistogram&&!this.precise&&this.labelHandles&&x,!this.hasHistogram&&this.precise&&!this.labelHandles&&w,this.hasHistogram&&this.precise&&!this.labelHandles&&y,!this.hasHistogram&&this.precise&&this.labelHandles&&V,this.hasHistogram&&!this.precise&&this.labelHandles&&_,this.hasHistogram&&this.precise&&this.labelHandles&&z,s(b,{component:this}))))}renderGraph(){return this.histogram?s("calcite-graph",{class:"graph",colorStops:this.histogramStops,data:this.histogram,highlightMax:F(this.value)?this.maxValue:this.value,highlightMin:F(this.value)?this.minValue:this.min,max:this.max,min:this.min}):null}renderTickLabel(t){const i=F(this.value),e=t===this.min,a=t===this.max,l=this.determineGroupSeparator(t),h=s("span",{class:{tick__label:!0,"tick__label--min":e,"tick__label--max":a}},l);return this.labelTicks&&!this.hasHistogram&&!i||this.labelTicks&&!this.hasHistogram&&i&&!this.precise&&!this.labelHandles||this.labelTicks&&!this.hasHistogram&&i&&!this.precise&&this.labelHandles||this.labelTicks&&!this.hasHistogram&&i&&this.precise&&(e||a)||this.labelTicks&&this.hasHistogram&&!this.precise&&!this.labelHandles||this.labelTicks&&this.hasHistogram&&this.precise&&!this.labelHandles&&(e||a)||this.labelTicks&&this.hasHistogram&&!this.precise&&this.labelHandles&&(e||a)||this.labelTicks&&this.hasHistogram&&this.precise&&this.labelHandles&&(e||a)?h:null}keyDownHandler(t){const i=this.shouldMirror(),{activeProp:s,max:e,min:a,pageStep:l,step:h}=this,n=this[s],{key:r}=t;if(f(r))return void t.preventDefault();let o;if("ArrowUp"===r||"ArrowRight"===r?o=n+h*(i&&"ArrowRight"===r?-1:1):"ArrowDown"===r||"ArrowLeft"===r?o=n-h*(i&&"ArrowLeft"===r?-1:1):"PageUp"===r?l&&(o=n+l):"PageDown"===r?l&&(o=n-l):"Home"===r?o=a:"End"===r&&(o=e),isNaN(o))return;t.preventDefault();const c=Number(o.toFixed(D(h)));this.setValue({[s]:this.clamp(c,s)})}pointerDownHandler(t){if(this.disabled||!r(t))return;const i=t.clientX||t.pageX,s=this.translate(i);let e="value";F(this.value)&&(e=s>=this.minValue&&s<=this.maxValue&&"minMaxValue"===this.lastDragProp?"minMaxValue":Math.abs(this.maxValue-s)<Math.abs(this.minValue-s)||s>this.maxValue?"maxValue":"minValue"),this.lastDragPropValue=this[e],this.dragStart(e),this.el.shadowRoot.querySelector(".thumb:active")||this.setValue({[e]:this.clamp(s,e)}),this.focusActiveHandle(i)}handleTouchStart(t){t.preventDefault()}async setFocus(){await V(this);const t=this.minHandle?this.minHandle:this.maxHandle;null==t||t.focus()}setValueFromMinMax(){const{minValue:t,maxValue:i}=this;"number"==typeof t&&"number"==typeof i&&(this.value=[t,i])}setMinMaxFromValue(){const{value:t}=this;F(t)&&(this.minValue=t[0],this.maxValue=t[1])}onLabelClick(){this.setFocus()}shouldMirror(){return this.mirrored&&!this.hasHistogram}shouldUseMinValue(){return!!F(this.value)&&(this.hasHistogram&&0===this.maxValue||!this.hasHistogram&&0===this.minValue)}getTickDensity(){const t=(this.max-this.min)/this.ticks/250;return t<1?1:t}generateTickValues(){var t;const i=null!==(t=this.ticks)&&void 0!==t?t:0;if(i<=0)return[];const s=[this.min],e=i*this.getTickDensity();let a=this.min;for(;a<this.max;)a+=e,s.push(Math.min(a,this.max));return s.includes(this.max)||s.push(this.max),s}pointerDownDragStart(t,i){r(t)&&this.dragStart(i)}dragStart(t){this.dragProp=t,this.lastDragProp=this.dragProp,this.activeProp=t,document.addEventListener("pointermove",this.dragUpdate),document.addEventListener("pointerup",this.pointerUpDragEnd),document.addEventListener("pointercancel",this.dragEnd)}focusActiveHandle(t){switch(this.dragProp){case"minValue":this.minHandle.focus();break;case"maxValue":case"value":this.maxHandle.focus();break;case"minMaxValue":this.getClosestHandle(t).focus()}}emitInput(){this.calciteSliderInput.emit()}emitChange(){this.calciteSliderChange.emit()}removeDragListeners(){document.removeEventListener("pointermove",this.dragUpdate),document.removeEventListener("pointerup",this.pointerUpDragEnd),document.removeEventListener("pointercancel",this.dragEnd)}setValue(t){let i;Object.keys(t).forEach((s=>{const e=t[s];i||(i=this[s]!==e),this[s]=e})),i&&(this.dragProp||this.emitChange(),this.emitInput())}clamp(t,i){return t=H(t,this.min,this.max),"maxValue"===i&&(t=Math.max(t,this.minValue)),"minValue"===i&&(t=Math.min(t,this.maxValue)),t}translate(t){const i=this.max-this.min,{left:s,width:e}=this.trackEl.getBoundingClientRect(),a=(t-s)/e,l=this.shouldMirror(),h=this.clamp(this.min+i*(l?1-a:a));let n=Number(h.toFixed(D(this.step)));return this.snap&&this.step&&(n=this.getClosestStep(n)),n}getClosestStep(t){if(t=Number(this.clamp(t).toFixed(D(this.step))),this.step){const i=Math.round(t/this.step)*this.step;t=Number(this.clamp(i).toFixed(D(this.step)))}return t}getClosestHandle(t){return this.getDistanceX(this.maxHandle,t)>this.getDistanceX(this.minHandle,t)?this.minHandle:this.maxHandle}getDistanceX(t,i){return Math.abs(t.getBoundingClientRect().left-i)}getFontSizeForElement(t){return Number(window.getComputedStyle(t).getPropertyValue("font-size").match(/\d+/)[0])}getUnitInterval(t){return((t=this.clamp(t))-this.min)/(this.max-this.min)}adjustHostObscuredHandleLabel(t){const i=this.el.shadowRoot.querySelector(`.handle__label--${t}`),s=this.el.shadowRoot.querySelector(`.handle__label--${t}.static`),e=this.el.shadowRoot.querySelector(`.handle__label--${t}.transformed`),a=s.getBoundingClientRect(),l=this.getHostOffset(a.left,a.right);i.style.transform=`translateX(${l}px)`,e.style.transform=`translateX(${l}px)`}hyphenateCollidingRangeHandleLabels(){const{shadowRoot:t}=this.el,i=this.shouldMirror(),s=i?"value":"minValue",e=i?"minValue":"value",a=t.querySelector(`.handle__label--${s}`),l=t.querySelector(`.handle__label--${s}.static`),h=t.querySelector(`.handle__label--${s}.transformed`),n=this.getHostOffset(l.getBoundingClientRect().left,l.getBoundingClientRect().right),r=t.querySelector(`.handle__label--${e}`),o=t.querySelector(`.handle__label--${e}.static`),c=t.querySelector(`.handle__label--${e}.transformed`),d=this.getHostOffset(o.getBoundingClientRect().left,o.getBoundingClientRect().right),u=this.getFontSizeForElement(a),m=this.getRangeLabelOverlap(h,c),b=a,p=u/2;if(m>0){if(b.classList.add("hyphen","hyphen--wrap"),0===d&&0===n){let t=m/2-p;t=-1===Math.sign(t)?Math.abs(t):-t;const i=this.getHostOffset(h.getBoundingClientRect().left+t-p,h.getBoundingClientRect().right+t-p);let s=m/2;const e=this.getHostOffset(c.getBoundingClientRect().left+s,c.getBoundingClientRect().right+s);0!==i&&(t+=i,s+=i),0!==e&&(t+=e,s+=e),a.style.transform=`translateX(${t}px)`,h.style.transform=`translateX(${t-p}px)`,r.style.transform=`translateX(${s}px)`,c.style.transform=`translateX(${s}px)`}else if(n>0||d>0)a.style.transform=`translateX(${n+p}px)`,r.style.transform=`translateX(${m+d}px)`,c.style.transform=`translateX(${m+d}px)`;else if(n<0||d<0){let t=Math.abs(n)+m-p;t=-1===Math.sign(t)?Math.abs(t):-t,a.style.transform=`translateX(${t}px)`,h.style.transform=`translateX(${t-p}px)`}}else b.classList.remove("hyphen","hyphen--wrap"),a.style.transform=`translateX(${n}px)`,h.style.transform=`translateX(${n}px)`,r.style.transform=`translateX(${d}px)`,c.style.transform=`translateX(${d}px)`}hideObscuredBoundingTickLabels(){const t=F(this.value);if(!(this.hasHistogram||t||this.labelHandles||this.precise))return;if(!this.hasHistogram&&!t&&this.labelHandles&&!this.precise)return;if(!this.hasHistogram&&!t&&!this.labelHandles&&this.precise)return;if(!this.hasHistogram&&!t&&this.labelHandles&&this.precise)return;if(!this.hasHistogram&&t&&!this.precise)return;if(this.hasHistogram&&!this.precise&&!this.labelHandles)return;const i=this.el.shadowRoot.querySelector(".thumb--minValue"),s=this.el.shadowRoot.querySelector(".thumb--value"),e=this.el.shadowRoot.querySelector(".tick__label--min"),a=this.el.shadowRoot.querySelector(".tick__label--max");!i&&s&&e&&a&&(e.style.opacity=this.isMinTickLabelObscured(e,s)?"0":"1",a.style.opacity=this.isMaxTickLabelObscured(a,s)?"0":"1"),i&&s&&e&&a&&(e.style.opacity=this.isMinTickLabelObscured(e,i)||this.isMinTickLabelObscured(e,s)?"0":"1",a.style.opacity=this.isMaxTickLabelObscured(a,i)||this.isMaxTickLabelObscured(a,s)&&this.hasHistogram?"0":"1")}getHostOffset(t,i){const s=this.el.getBoundingClientRect();return t+7<s.left?s.left-t-7:i-7>s.right?7-(i-s.right):0}getRangeLabelOverlap(t,i){const s=t.getBoundingClientRect(),e=i.getBoundingClientRect(),a=this.getFontSizeForElement(t);return Math.max(s.right+a-e.left,0)}isMinTickLabelObscured(t,i){const s=t.getBoundingClientRect(),e=i.getBoundingClientRect();return o(s,e)}isMaxTickLabelObscured(t,i){const s=t.getBoundingClientRect(),e=i.getBoundingClientRect();return o(s,e)}static get delegatesFocus(){return!0}get el(){return a(this)}static get watchers(){return{histogram:["histogramWatcher"],ticks:["ticksWatcher"],value:["valueHandler"],minValue:["minMaxValueHandler"],maxValue:["minMaxValueHandler"]}}};L.style='@charset "UTF-8";:host([disabled]){cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}.scale--s{--calcite-slider-handle-size:0.625rem;--calcite-slider-handle-extension-height:0.4rem;--calcite-slider-container-font-size:var(--calcite-font-size--3)}.scale--s .handle__label,.scale--s .tick__label{line-height:.75rem}.scale--m{--calcite-slider-handle-size:0.875rem;--calcite-slider-handle-extension-height:0.5rem;--calcite-slider-container-font-size:var(--calcite-font-size--2)}.scale--m .handle__label,.scale--m .tick__label{line-height:1rem}.scale--l{--calcite-slider-handle-size:1rem;--calcite-slider-handle-extension-height:0.65rem;--calcite-slider-container-font-size:var(--calcite-font-size--1)}.scale--l .handle__label,.scale--l .tick__label{line-height:1rem}.handle__label,.tick__label{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-2);font-size:var(--calcite-slider-container-font-size)}:host{display:block}.container{position:relative;display:block;overflow-wrap:normal;word-break:normal;padding-inline:calc(var(--calcite-slider-handle-size) * 0.5);padding-block:calc(var(--calcite-slider-handle-size) * 0.5);margin-block:calc(var(--calcite-slider-handle-size) * 0.5);margin-inline:0;--calcite-slider-full-handle-height:calc(\n var(--calcite-slider-handle-size) + var(--calcite-slider-handle-extension-height)\n );touch-action:none}:host([disabled]) .track__range,:host([disabled]) .tick--active{background-color:var(--calcite-ui-text-3)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.scale--s .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-0.375rem}.scale--m .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-0.5rem}.scale--l .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-0.55rem}:host([precise]:not([has-histogram])) .container .thumb--value{--calcite-slider-thumb-y-offset:calc(var(--calcite-slider-full-handle-height) * -1)}.thumb-container{position:relative;max-inline-size:100%}.thumb{--calcite-slider-thumb-x-offset:calc(var(--calcite-slider-handle-size) * 0.5);position:absolute;margin:0px;display:flex;cursor:pointer;flex-direction:column;align-items:center;border-style:none;background-color:transparent;padding:0px;font-family:inherit;outline:2px solid transparent;outline-offset:2px;transform:translate(var(--calcite-slider-thumb-x-offset), var(--calcite-slider-thumb-y-offset))}.thumb .handle__label.static,.thumb .handle__label.transformed{position:absolute;inset-block:0px;opacity:0}.thumb .handle__label.hyphen::after{content:"—";display:inline-block;inline-size:1em}.thumb .handle__label.hyphen--wrap{display:flex}.thumb .handle{box-sizing:border-box;border-radius:9999px;background-color:var(--calcite-ui-foreground-1);outline-color:transparent;block-size:var(--calcite-slider-handle-size);inline-size:var(--calcite-slider-handle-size);box-shadow:0 0 0 2px var(--calcite-ui-text-3) inset;transition:border var(--calcite-internal-animation-timing-medium) ease, background-color var(--calcite-internal-animation-timing-medium) ease, box-shadow var(--calcite-animation-timing) ease}.thumb .handle-extension{inline-size:0.125rem;block-size:var(--calcite-slider-handle-extension-height);background-color:var(--calcite-ui-text-3)}.thumb:hover .handle{box-shadow:0 0 0 3px var(--calcite-ui-brand) inset}.thumb:hover .handle-extension{background-color:var(--calcite-ui-brand)}.thumb:focus .handle{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc(\n 2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-ui-focus-offset-invert),\n 1\n )\n )\n )}.thumb:focus .handle-extension{background-color:var(--calcite-ui-brand)}.thumb.thumb--minValue{transform:translate(calc(var(--calcite-slider-thumb-x-offset) * -1), var(--calcite-slider-thumb-y-offset))}.thumb.thumb--precise{--calcite-slider-thumb-y-offset:-0.125rem}:host([label-handles]) .thumb{--calcite-slider-thumb-x-offset:50%}:host([label-handles]):host(:not([has-histogram])) .scale--s .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-1.4375rem}:host([label-handles]):host(:not([has-histogram])) .scale--m .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-1.875rem}:host([label-handles]):host(:not([has-histogram])) .scale--l .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-2rem}:host([has-histogram][label-handles]) .handle__label,:host([label-handles]:not([has-histogram])) .thumb--minValue.thumb--precise .handle__label{margin-block-start:0.5em}:host(:not([has-histogram]):not([precise])) .handle__label,:host([label-handles]:not([has-histogram])) .thumb--value .handle__label{margin-block-end:0.5em}:host([label-handles][precise]):host(:not([has-histogram])) .scale--s .thumb--value{--calcite-slider-thumb-y-offset:-2.075rem}:host([label-handles][precise]):host(:not([has-histogram])) .scale--m .thumb--value{--calcite-slider-thumb-y-offset:-2.75rem}:host([label-handles][precise]):host(:not([has-histogram])) .scale--l .thumb--value{--calcite-slider-thumb-y-offset:-3.0625rem}.thumb:focus .handle,.thumb--active .handle{background-color:var(--calcite-ui-brand);box-shadow:0 0 8px 0 rgba(0, 0, 0, 0.16)}.thumb:hover.thumb--precise:after,.thumb:focus.thumb--precise:after,.thumb--active.thumb--precise:after{background-color:var(--calcite-ui-brand)}.track{position:relative;block-size:0.125rem;border-radius:0px;background-color:var(--calcite-ui-border-2);transition:all var(--calcite-internal-animation-timing-medium) ease-in}.track__range{position:absolute;inset-block-start:0px;block-size:0.125rem;background-color:var(--calcite-ui-brand)}.container--range .track__range:hover{cursor:ew-resize}.container--range .track__range:after{position:absolute;inline-size:100%;content:"";inset-block-start:calc(var(--calcite-slider-full-handle-height) * 0.5 * -1);block-size:calc(var(--calcite-slider-handle-size) + var(--calcite-slider-handle-extension-height))}@media (forced-colors: active){.thumb{outline-width:0;outline-offset:0}.handle{outline:2px solid transparent;outline-offset:2px}.thumb:focus .handle,.thumb .handle-extension,.thumb:hover .handle-extension,.thumb:focus .handle-extension,.thumb:active .handle-extension{background-color:canvasText}.track{background-color:canvasText}.track__range{background-color:highlight}}.tick{position:absolute;block-size:0.25rem;inline-size:0.125rem;border-width:1px;border-style:solid;background-color:var(--calcite-ui-border-input);border-color:var(--calcite-ui-foreground-1);inset-block-start:-2px;pointer-events:none;margin-inline-start:calc(-1 * 0.125rem)}.tick--active{background-color:var(--calcite-ui-brand)}.tick__label{pointer-events:none;margin-block-start:0.875rem;display:flex;justify-content:center}.tick__label--min{transition:opacity var(--calcite-animation-timing)}.tick__label--max{transition:opacity var(--calcite-internal-animation-timing-fast)}:host([has-histogram][label-handles]) .tick__label--min,:host([has-histogram][label-handles]) .tick__label--max,:host([has-histogram][precise]) .tick__label--min,:host([has-histogram][precise]) .tick__label--max{font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-3)}.graph{color:var(--calcite-ui-foreground-3);block-size:48px}:host([label-ticks][ticks]) .container{padding-block-end:calc(0.875rem + var(--calcite-slider-container-font-size))}:host([has-histogram]):host([precise][label-handles]) .container{padding-block-end:calc(var(--calcite-slider-full-handle-height) + 1em)}:host([has-histogram]):host([label-handles]:not([precise])) .container{padding-block-end:calc(var(--calcite-slider-handle-size) * 0.5 + 1em)}:host([has-histogram]):host([precise]:not([label-handles])) .container{padding-block-end:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([precise]:not([label-handles])) .container{padding-block-start:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([precise]:not([label-handles])) .container--range{padding-block-end:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([label-handles]:not([precise])) .container{padding-block-start:calc(var(--calcite-slider-full-handle-height) + 4px)}:host(:not([has-histogram])):host([label-handles][precise]) .container{padding-block-start:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px)}:host(:not([has-histogram])):host([label-handles][precise]) .container--range{padding-block-end:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px)}::slotted(input[slot=hidden-form-input]){margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;inset:0 !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}:host([hidden]){display:none}[hidden]{display:none}';const P=class{constructor(s){t(this,s),this.selectionLoadingChange=i(this,"selectionLoadingChange",7),this.sketchGraphicsChange=i(this,"sketchGraphicsChange",7),this.drawUndo=i(this,"drawUndo",7),this.drawRedo=i(this,"drawRedo",7),this.active=!1,this.drawMode=I.SKETCH,this.editGraphicsEnabled=!0,this.graphics=void 0,this.mapView=void 0,this.pointSymbol=void 0,this.polylineSymbol=void 0,this.polygonSymbol=void 0,this.redoEnabled=!1,this.undoEnabled=!1,this._translations=void 0,this._selectionMode=void 0}graphicsWatchHandler(t,i){t&&t.length>0&&JSON.stringify(t)!==JSON.stringify(i)&&this._sketchGraphicsLayer&&(this._updateGraphicsSymbols(t),this._sketchGraphicsLayer.removeAll(),this._sketchGraphicsLayer.addMany(t))}mapViewWatchHandler(t,i){t&&t!==i&&this._init()}async clear(){this._clearSketch()}async updateGraphics(){this._updateGraphics()}async componentWillLoad(){await this._getTranslations(),await this._initModules()}componentDidLoad(){this._init()}disconnectedCallback(){this._sketchWidget.cancel(),this._clearSketch()}render(){const t=this.drawMode===I.SKETCH?"display-none":"esri-widget esri-sketch__panel border-left esri-sketch__section";return s(e,null,s("div",{class:this.drawMode===I.SKETCH?"border":"border esri-widget esri-sketch__panel"},s("div",{ref:t=>{this._sketchElement=t}}),s("div",{class:t},s("calcite-action",{disabled:!this.undoEnabled,icon:"undo",onClick:()=>this._undo(),scale:"s",text:this._translations.undo}),s("calcite-action",{disabled:!this.redoEnabled,icon:"redo",onClick:()=>this._redo(),scale:"s",text:this._translations.redo}))))}async _initModules(){const[t,i,s]=await l(["esri/layers/GraphicsLayer","esri/widgets/Sketch","esri/widgets/Sketch/SketchViewModel"]);this.GraphicsLayer=t,this.Sketch=i,this.SketchViewModel=s}_init(){this.mapView&&this._sketchElement&&(this._initGraphicsLayer(),this._initSketch())}_initGraphicsLayer(){const t=this._translations.sketchLayer,i=this.mapView.map.layers.findIndex((i=>i.title===t));i>-1?this._sketchGraphicsLayer=this.mapView.map.layers.getItemAt(i):(this._sketchGraphicsLayer=new this.GraphicsLayer({title:t,listMode:"hide"}),j.managedLayers.push(t),this.mapView.map.layers.add(this._sketchGraphicsLayer)),this.graphics&&this.graphics.length>0&&this._sketchGraphicsLayer.addMany(this.graphics)}_initSketch(){const t={layer:this._sketchGraphicsLayer,view:this.mapView,defaultCreateOptions:{mode:"hybrid"},defaultUpdateOptions:{preserveAspectRatio:!1,enableScaling:!1,enableRotation:!1,tool:"reshape",toggleToolOnClick:!1}};this._sketchWidget=new this.Sketch(Object.assign(Object.assign({},t),{container:this._sketchElement,creationMode:"single",visibleElements:{duplicateButton:!1,selectionTools:{"lasso-selection":!1,"rectangle-selection":!1},createTools:{circle:!1},undoRedoMenu:!1,settingsMenu:this.drawMode===I.SKETCH}})),this._sketchViewModel=new this.SketchViewModel(Object.assign({},t)),this._sketchWidget.viewModel.polylineSymbol=this.polylineSymbol,this._sketchWidget.viewModel.pointSymbol=this.pointSymbol,this._sketchWidget.viewModel.polygonSymbol=this.polygonSymbol;let i=!1;this._sketchWidget.on("create",(t=>{"complete"===t.state&&(this.graphics=[t.graphic],this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1}),this.drawMode===I.REFINE&&(i=!0,this._sketchWidget.viewModel.create(t.tool))),"cancel"===t.state&&this.drawMode===I.REFINE&&i&&(i=!i,this._sketchWidget.viewModel.create(t.tool))})),this._sketchWidget.on("update",(t=>{var i;if(this.editGraphicsEnabled){const s=null===(i=null==t?void 0:t.toolEventInfo)||void 0===i?void 0:i.type;"reshape-stop"!==s&&"move-stop"!==s||(this.graphics=t.graphics,this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1}))}else this._sketchWidget.viewModel.cancel(),this._sketchViewModel.cancel()})),this._sketchWidget.on("delete",(()=>{this.graphics=[],this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1})})),this._sketchWidget.on("undo",(t=>{this.graphics=t.graphics,this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1})})),this._sketchWidget.on("redo",(t=>{this.graphics=t.graphics,this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1})}))}_clearSketch(){var t;this._sketchWidget.viewModel.cancel(),this.graphics=[],null===(t=this._sketchGraphicsLayer)||void 0===t||t.removeAll()}_undo(){this.drawUndo.emit()}_redo(){this.drawRedo.emit()}_updateGraphics(){setTimeout((()=>{1===this.graphics.length&&this._sketchWidget.update(this.graphics,{tool:"reshape",enableRotation:!1,enableScaling:!1,preserveAspectRatio:!1,toggleToolOnClick:!1})}),100)}_updateGraphicsSymbols(t){const i=t[0].geometry.type,s="point"===i?this.pointSymbol:"polyline"===i?this.polylineSymbol:"polygon"===i?this.polygonSymbol:void 0;s&&t.forEach((t=>t.symbol=s))}async _getTranslations(){const t=await h(this.el);this._translations=t[0]}get el(){return a(this)}static get watchers(){return{graphics:["graphicsWatchHandler"],mapView:["mapViewWatchHandler"]}}};P.style=':host{display:block}.border{outline:1px solid var(--calcite-ui-border-input)}.div-visible{display:inherit}.div-not-visible{display:none !important}.padding-top-1-2{padding-top:.5rem}.main-label{display:flex;float:left}html[dir="rtl"] .main-label{display:flex;float:right}.margin-top-1{margin-top:1rem}.border-left{border-left:1px solid rgba(110,110,110,.3)}.border-left[dir="rtl"]{border-right:1px solid rgba(110,110,110,.3)}.esri-widget{box-sizing:border-box;color:#323232;font-size:14px;font-family:"Avenir Next","Helvetica Neue",Helvetica,Arial,sans-serif;line-height:1.3em;background-color:#fff;--esri-widget-padding-v:12px;--esri-widget-padding-h:15px;--esri-widget-padding:var(--esri-widget-padding-v) var(--esri-widget-padding-h)}.esri-sketch__panel{align-items:center;display:flex;flex-flow:row wrap;padding:0;justify-content:flex-start !important}.esri-sketch__section{align-items:center;display:flex;flex-flow:row wrap;padding:0 7px;margin:6px 0}';export{C as buffer_tools,O as calcite_input_message,L as calcite_slider,P as map_draw_tools}
|
18
|
+
const T="handle__label";function F(t){return Array.isArray(t)}const L=class{constructor(s){t(this,s),this.calciteSliderInput=i(this,"calciteSliderInput",6),this.calciteSliderChange=i(this,"calciteSliderChange",6),this.activeProp="value",this.guid=`calcite-slider-${c()}`,this.dragUpdate=t=>{if(!this.disabled&&(t.preventDefault(),this.dragProp)){const i=this.translate(t.clientX||t.pageX);if(F(this.value)&&"minMaxValue"===this.dragProp)if(this.minValueDragRange&&this.maxValueDragRange&&this.minMaxValueRange){const t=i-this.minValueDragRange,s=i+this.maxValueDragRange;s<=this.max&&t>=this.min&&s-t===this.minMaxValueRange&&this.setValue({minValue:this.clamp(t,"minValue"),maxValue:this.clamp(s,"maxValue")})}else this.minValueDragRange=i-this.minValue,this.maxValueDragRange=this.maxValue-i,this.minMaxValueRange=this.maxValue-this.minValue;else this.setValue({[this.dragProp]:this.clamp(i,this.dragProp)})}},this.pointerUpDragEnd=t=>{!this.disabled&&r(t)&&this.dragEnd(t)},this.dragEnd=t=>{this.disabled||(this.removeDragListeners(),this.focusActiveHandle(t.clientX),this.lastDragPropValue!=this[this.dragProp]&&this.emitChange(),this.dragProp=null,this.lastDragPropValue=null,this.minValueDragRange=null,this.maxValueDragRange=null,this.minMaxValueRange=null)},this.storeTrackRef=t=>{this.trackEl=t},this.determineGroupSeparator=t=>{if("number"==typeof t)return z.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator},z.localize(t.toString())},this.disabled=!1,this.form=void 0,this.groupSeparator=!1,this.hasHistogram=!1,this.histogram=void 0,this.histogramStops=void 0,this.labelHandles=!1,this.labelTicks=!1,this.max=100,this.maxLabel=void 0,this.maxValue=void 0,this.min=0,this.minLabel=void 0,this.minValue=void 0,this.mirrored=!1,this.name=void 0,this.numberingSystem=void 0,this.pageStep=void 0,this.precise=!1,this.required=!1,this.snap=!1,this.step=1,this.ticks=void 0,this.value=0,this.scale="m",this.effectiveLocale="",this.minMaxValueRange=null,this.minValueDragRange=null,this.maxValueDragRange=null,this.tickValues=[]}histogramWatcher(t){this.hasHistogram=!!t}ticksWatcher(){this.tickValues=this.generateTickValues()}valueHandler(){this.setMinMaxFromValue()}minMaxValueHandler(){this.setValueFromMinMax()}connectedCallback(){p(this),$(this),this.setMinMaxFromValue(),this.setValueFromMinMax(),x(this),d(this)}disconnectedCallback(){v(this),_(this),u(this),M(this),this.removeDragListeners()}componentWillLoad(){w(this),F(this.value)||(this.value=this.snap?this.getClosestStep(this.value):this.clamp(this.value)),this.ticksWatcher(),this.histogramWatcher(this.histogram),m(this,this.value)}componentDidLoad(){y(this)}componentDidRender(){this.labelHandles&&(this.adjustHostObscuredHandleLabel("value"),F(this.value)&&(this.adjustHostObscuredHandleLabel("minValue"),this.precise&&!this.hasHistogram||this.hyphenateCollidingRangeHandleLabels())),this.hideObscuredBoundingTickLabels(),g(this)}render(){const t=this.el.id||this.guid,i=F(this.value)?"maxValue":"value",a=F(this.value)?this.maxValue:this.value,h=this.determineGroupSeparator(a),l=this.determineGroupSeparator(this.minValue),n=this.minValue||this.min,r=this.shouldUseMinValue(),o=100*this.getUnitInterval(r?this.minValue:n),c=100*this.getUnitInterval(a),d=this.shouldMirror(),u=`${d?100-o:o}%`,m=`${d?c:100-c}%`,p=F(this.value),v=`${T} handle__label--minValue`,g=`${T} handle__label--value`,f=s("div",{"aria-disabled":this.disabled,"aria-label":p?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":a,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===i},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=i,onPointerDown:t=>this.pointerDownDragStart(t,i),role:"slider",style:{right:m},tabIndex:0,ref:t=>this.maxHandle=t},s("div",{class:"handle"})),x=s("div",{"aria-disabled":this.disabled,"aria-label":p?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":a,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===i},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=i,onPointerDown:t=>this.pointerDownDragStart(t,i),role:"slider",style:{right:m},tabIndex:0,ref:t=>this.maxHandle=t},s("span",{"aria-hidden":"true",class:g},h),s("span",{"aria-hidden":"true",class:`${g} static`},h),s("span",{"aria-hidden":"true",class:`${g} transformed`},h),s("div",{class:"handle"})),_=s("div",{"aria-disabled":this.disabled,"aria-label":p?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":a,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===i},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=i,onPointerDown:t=>this.pointerDownDragStart(t,i),role:"slider",style:{right:m},tabIndex:0,ref:t=>this.maxHandle=t},s("div",{class:"handle"}),s("span",{"aria-hidden":"true",class:g},h),s("span",{"aria-hidden":"true",class:`${g} static`},h),s("span",{"aria-hidden":"true",class:`${g} transformed`},h)),w=s("div",{"aria-disabled":this.disabled,"aria-label":p?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":a,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===i,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=i,onPointerDown:t=>this.pointerDownDragStart(t,i),role:"slider",style:{right:m},tabIndex:0,ref:t=>this.maxHandle=t},s("div",{class:"handle"}),s("div",{class:"handle-extension"})),y=s("div",{"aria-disabled":this.disabled,"aria-label":p?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":a,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===i,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=i,onPointerDown:t=>this.pointerDownDragStart(t,i),role:"slider",style:{right:m},tabIndex:0,ref:t=>this.maxHandle=t},s("div",{class:"handle-extension"}),s("div",{class:"handle"})),V=s("div",{"aria-disabled":this.disabled,"aria-label":p?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":a,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===i,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=i,onPointerDown:t=>this.pointerDownDragStart(t,i),role:"slider",style:{right:m},tabIndex:0,ref:t=>this.maxHandle=t},s("span",{"aria-hidden":"true",class:g},h),s("span",{"aria-hidden":"true",class:`${g} static`},h),s("span",{"aria-hidden":"true",class:`${g} transformed`},h),s("div",{class:"handle"}),s("div",{class:"handle-extension"})),z=s("div",{"aria-disabled":this.disabled,"aria-label":p?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":a,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===i,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=i,onPointerDown:t=>this.pointerDownDragStart(t,i),role:"slider",style:{right:m},tabIndex:0,ref:t=>this.maxHandle=t},s("div",{class:"handle-extension"}),s("div",{class:"handle"}),s("span",{"aria-hidden":"true",class:g},h),s("span",{"aria-hidden":"true",class:`${g} static`},h),s("span",{"aria-hidden":"true",class:`${g} transformed`},h)),$=s("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:t=>this.pointerDownDragStart(t,"minValue"),role:"slider",style:{left:u},tabIndex:0,ref:t=>this.minHandle=t},s("div",{class:"handle"})),M=s("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:t=>this.pointerDownDragStart(t,"minValue"),role:"slider",style:{left:u},tabIndex:0,ref:t=>this.minHandle=t},s("span",{"aria-hidden":"true",class:v},l),s("span",{"aria-hidden":"true",class:`${v} static`},l),s("span",{"aria-hidden":"true",class:`${v} transformed`},l),s("div",{class:"handle"})),D=s("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:t=>this.pointerDownDragStart(t,"minValue"),role:"slider",style:{left:u},tabIndex:0,ref:t=>this.minHandle=t},s("div",{class:"handle"}),s("span",{"aria-hidden":"true",class:v},l),s("span",{"aria-hidden":"true",class:`${v} static`},l),s("span",{"aria-hidden":"true",class:`${v} transformed`},l)),H=s("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:t=>this.pointerDownDragStart(t,"minValue"),role:"slider",style:{left:u},tabIndex:0,ref:t=>this.minHandle=t},s("div",{class:"handle-extension"}),s("div",{class:"handle"})),I=s("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:t=>this.pointerDownDragStart(t,"minValue"),role:"slider",style:{left:u},tabIndex:0,ref:t=>this.minHandle=t},s("div",{class:"handle-extension"}),s("div",{class:"handle"}),s("span",{"aria-hidden":"true",class:v},l),s("span",{"aria-hidden":"true",class:`${v} static`},l),s("span",{"aria-hidden":"true",class:`${v} transformed`},l));return s(e,{id:t,onTouchStart:this.handleTouchStart},s("div",{"aria-label":k(this),class:{container:!0,"container--range":p,[`scale--${this.scale}`]:!0}},this.renderGraph(),s("div",{class:"track",ref:this.storeTrackRef},s("div",{class:"track__range",onPointerDown:t=>this.pointerDownDragStart(t,"minMaxValue"),style:{left:`${d?100-c:o}%`,right:`${d?o:100-c}%`}}),s("div",{class:"ticks"},this.tickValues.map((t=>{const i=100*this.getUnitInterval(t)+"%";let e=t>=n&&t<=a;return r&&(e=t>=this.minValue&&t<=this.maxValue),s("span",{class:{tick:!0,"tick--active":e},style:{left:d?"":i,right:d?i:""}},this.renderTickLabel(t))})))),s("div",{class:"thumb-container"},!this.precise&&!this.labelHandles&&p&&$,!this.hasHistogram&&!this.precise&&this.labelHandles&&p&&M,this.precise&&!this.labelHandles&&p&&H,this.precise&&this.labelHandles&&p&&I,this.hasHistogram&&!this.precise&&this.labelHandles&&p&&D,!this.precise&&!this.labelHandles&&f,!this.hasHistogram&&!this.precise&&this.labelHandles&&x,!this.hasHistogram&&this.precise&&!this.labelHandles&&w,this.hasHistogram&&this.precise&&!this.labelHandles&&y,!this.hasHistogram&&this.precise&&this.labelHandles&&V,this.hasHistogram&&!this.precise&&this.labelHandles&&_,this.hasHistogram&&this.precise&&this.labelHandles&&z,s(b,{component:this}))))}renderGraph(){return this.histogram?s("calcite-graph",{class:"graph",colorStops:this.histogramStops,data:this.histogram,highlightMax:F(this.value)?this.maxValue:this.value,highlightMin:F(this.value)?this.minValue:this.min,max:this.max,min:this.min}):null}renderTickLabel(t){const i=F(this.value),e=t===this.min,a=t===this.max,h=this.determineGroupSeparator(t),l=s("span",{class:{tick__label:!0,"tick__label--min":e,"tick__label--max":a}},h);return this.labelTicks&&!this.hasHistogram&&!i||this.labelTicks&&!this.hasHistogram&&i&&!this.precise&&!this.labelHandles||this.labelTicks&&!this.hasHistogram&&i&&!this.precise&&this.labelHandles||this.labelTicks&&!this.hasHistogram&&i&&this.precise&&(e||a)||this.labelTicks&&this.hasHistogram&&!this.precise&&!this.labelHandles||this.labelTicks&&this.hasHistogram&&this.precise&&!this.labelHandles&&(e||a)||this.labelTicks&&this.hasHistogram&&!this.precise&&this.labelHandles&&(e||a)||this.labelTicks&&this.hasHistogram&&this.precise&&this.labelHandles&&(e||a)?l:null}keyDownHandler(t){const i=this.shouldMirror(),{activeProp:s,max:e,min:a,pageStep:h,step:l}=this,n=this[s],{key:r}=t;if(f(r))return void t.preventDefault();let o;if("ArrowUp"===r||"ArrowRight"===r?o=n+l*(i&&"ArrowRight"===r?-1:1):"ArrowDown"===r||"ArrowLeft"===r?o=n-l*(i&&"ArrowLeft"===r?-1:1):"PageUp"===r?h&&(o=n+h):"PageDown"===r?h&&(o=n-h):"Home"===r?o=a:"End"===r&&(o=e),isNaN(o))return;t.preventDefault();const c=Number(o.toFixed(D(l)));this.setValue({[s]:this.clamp(c,s)})}pointerDownHandler(t){if(this.disabled||!r(t))return;const i=t.clientX||t.pageX,s=this.translate(i);let e="value";F(this.value)&&(e=s>=this.minValue&&s<=this.maxValue&&"minMaxValue"===this.lastDragProp?"minMaxValue":Math.abs(this.maxValue-s)<Math.abs(this.minValue-s)||s>this.maxValue?"maxValue":"minValue"),this.lastDragPropValue=this[e],this.dragStart(e),this.el.shadowRoot.querySelector(".thumb:active")||this.setValue({[e]:this.clamp(s,e)}),this.focusActiveHandle(i)}handleTouchStart(t){t.preventDefault()}async setFocus(){await V(this);const t=this.minHandle?this.minHandle:this.maxHandle;null==t||t.focus()}setValueFromMinMax(){const{minValue:t,maxValue:i}=this;"number"==typeof t&&"number"==typeof i&&(this.value=[t,i])}setMinMaxFromValue(){const{value:t}=this;F(t)&&(this.minValue=t[0],this.maxValue=t[1])}onLabelClick(){this.setFocus()}shouldMirror(){return this.mirrored&&!this.hasHistogram}shouldUseMinValue(){return!!F(this.value)&&(this.hasHistogram&&0===this.maxValue||!this.hasHistogram&&0===this.minValue)}getTickDensity(){const t=(this.max-this.min)/this.ticks/250;return t<1?1:t}generateTickValues(){var t;const i=null!==(t=this.ticks)&&void 0!==t?t:0;if(i<=0)return[];const s=[this.min],e=i*this.getTickDensity();let a=this.min;for(;a<this.max;)a+=e,s.push(Math.min(a,this.max));return s.includes(this.max)||s.push(this.max),s}pointerDownDragStart(t,i){r(t)&&this.dragStart(i)}dragStart(t){this.dragProp=t,this.lastDragProp=this.dragProp,this.activeProp=t,document.addEventListener("pointermove",this.dragUpdate),document.addEventListener("pointerup",this.pointerUpDragEnd),document.addEventListener("pointercancel",this.dragEnd)}focusActiveHandle(t){switch(this.dragProp){case"minValue":this.minHandle.focus();break;case"maxValue":case"value":this.maxHandle.focus();break;case"minMaxValue":this.getClosestHandle(t).focus()}}emitInput(){this.calciteSliderInput.emit()}emitChange(){this.calciteSliderChange.emit()}removeDragListeners(){document.removeEventListener("pointermove",this.dragUpdate),document.removeEventListener("pointerup",this.pointerUpDragEnd),document.removeEventListener("pointercancel",this.dragEnd)}setValue(t){let i;Object.keys(t).forEach((s=>{const e=t[s];i||(i=this[s]!==e),this[s]=e})),i&&(this.dragProp||this.emitChange(),this.emitInput())}clamp(t,i){return t=H(t,this.min,this.max),"maxValue"===i&&(t=Math.max(t,this.minValue)),"minValue"===i&&(t=Math.min(t,this.maxValue)),t}translate(t){const i=this.max-this.min,{left:s,width:e}=this.trackEl.getBoundingClientRect(),a=(t-s)/e,h=this.shouldMirror(),l=this.clamp(this.min+i*(h?1-a:a));let n=Number(l.toFixed(D(this.step)));return this.snap&&this.step&&(n=this.getClosestStep(n)),n}getClosestStep(t){if(t=Number(this.clamp(t).toFixed(D(this.step))),this.step){const i=Math.round(t/this.step)*this.step;t=Number(this.clamp(i).toFixed(D(this.step)))}return t}getClosestHandle(t){return this.getDistanceX(this.maxHandle,t)>this.getDistanceX(this.minHandle,t)?this.minHandle:this.maxHandle}getDistanceX(t,i){return Math.abs(t.getBoundingClientRect().left-i)}getFontSizeForElement(t){return Number(window.getComputedStyle(t).getPropertyValue("font-size").match(/\d+/)[0])}getUnitInterval(t){return((t=this.clamp(t))-this.min)/(this.max-this.min)}adjustHostObscuredHandleLabel(t){const i=this.el.shadowRoot.querySelector(`.handle__label--${t}`),s=this.el.shadowRoot.querySelector(`.handle__label--${t}.static`),e=this.el.shadowRoot.querySelector(`.handle__label--${t}.transformed`),a=s.getBoundingClientRect(),h=this.getHostOffset(a.left,a.right);i.style.transform=`translateX(${h}px)`,e.style.transform=`translateX(${h}px)`}hyphenateCollidingRangeHandleLabels(){const{shadowRoot:t}=this.el,i=this.shouldMirror(),s=i?"value":"minValue",e=i?"minValue":"value",a=t.querySelector(`.handle__label--${s}`),h=t.querySelector(`.handle__label--${s}.static`),l=t.querySelector(`.handle__label--${s}.transformed`),n=this.getHostOffset(h.getBoundingClientRect().left,h.getBoundingClientRect().right),r=t.querySelector(`.handle__label--${e}`),o=t.querySelector(`.handle__label--${e}.static`),c=t.querySelector(`.handle__label--${e}.transformed`),d=this.getHostOffset(o.getBoundingClientRect().left,o.getBoundingClientRect().right),u=this.getFontSizeForElement(a),m=this.getRangeLabelOverlap(l,c),b=a,p=u/2;if(m>0){if(b.classList.add("hyphen","hyphen--wrap"),0===d&&0===n){let t=m/2-p;t=-1===Math.sign(t)?Math.abs(t):-t;const i=this.getHostOffset(l.getBoundingClientRect().left+t-p,l.getBoundingClientRect().right+t-p);let s=m/2;const e=this.getHostOffset(c.getBoundingClientRect().left+s,c.getBoundingClientRect().right+s);0!==i&&(t+=i,s+=i),0!==e&&(t+=e,s+=e),a.style.transform=`translateX(${t}px)`,l.style.transform=`translateX(${t-p}px)`,r.style.transform=`translateX(${s}px)`,c.style.transform=`translateX(${s}px)`}else if(n>0||d>0)a.style.transform=`translateX(${n+p}px)`,r.style.transform=`translateX(${m+d}px)`,c.style.transform=`translateX(${m+d}px)`;else if(n<0||d<0){let t=Math.abs(n)+m-p;t=-1===Math.sign(t)?Math.abs(t):-t,a.style.transform=`translateX(${t}px)`,l.style.transform=`translateX(${t-p}px)`}}else b.classList.remove("hyphen","hyphen--wrap"),a.style.transform=`translateX(${n}px)`,l.style.transform=`translateX(${n}px)`,r.style.transform=`translateX(${d}px)`,c.style.transform=`translateX(${d}px)`}hideObscuredBoundingTickLabels(){const t=F(this.value);if(!(this.hasHistogram||t||this.labelHandles||this.precise))return;if(!this.hasHistogram&&!t&&this.labelHandles&&!this.precise)return;if(!this.hasHistogram&&!t&&!this.labelHandles&&this.precise)return;if(!this.hasHistogram&&!t&&this.labelHandles&&this.precise)return;if(!this.hasHistogram&&t&&!this.precise)return;if(this.hasHistogram&&!this.precise&&!this.labelHandles)return;const i=this.el.shadowRoot.querySelector(".thumb--minValue"),s=this.el.shadowRoot.querySelector(".thumb--value"),e=this.el.shadowRoot.querySelector(".tick__label--min"),a=this.el.shadowRoot.querySelector(".tick__label--max");!i&&s&&e&&a&&(e.style.opacity=this.isMinTickLabelObscured(e,s)?"0":"1",a.style.opacity=this.isMaxTickLabelObscured(a,s)?"0":"1"),i&&s&&e&&a&&(e.style.opacity=this.isMinTickLabelObscured(e,i)||this.isMinTickLabelObscured(e,s)?"0":"1",a.style.opacity=this.isMaxTickLabelObscured(a,i)||this.isMaxTickLabelObscured(a,s)&&this.hasHistogram?"0":"1")}getHostOffset(t,i){const s=this.el.getBoundingClientRect();return t+7<s.left?s.left-t-7:i-7>s.right?7-(i-s.right):0}getRangeLabelOverlap(t,i){const s=t.getBoundingClientRect(),e=i.getBoundingClientRect(),a=this.getFontSizeForElement(t);return Math.max(s.right+a-e.left,0)}isMinTickLabelObscured(t,i){const s=t.getBoundingClientRect(),e=i.getBoundingClientRect();return o(s,e)}isMaxTickLabelObscured(t,i){const s=t.getBoundingClientRect(),e=i.getBoundingClientRect();return o(s,e)}static get delegatesFocus(){return!0}get el(){return a(this)}static get watchers(){return{histogram:["histogramWatcher"],ticks:["ticksWatcher"],value:["valueHandler"],minValue:["minMaxValueHandler"],maxValue:["minMaxValueHandler"]}}};L.style='@charset "UTF-8";:host([disabled]){cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}.scale--s{--calcite-slider-handle-size:0.625rem;--calcite-slider-handle-extension-height:0.4rem;--calcite-slider-container-font-size:var(--calcite-font-size--3)}.scale--s .handle__label,.scale--s .tick__label{line-height:.75rem}.scale--m{--calcite-slider-handle-size:0.875rem;--calcite-slider-handle-extension-height:0.5rem;--calcite-slider-container-font-size:var(--calcite-font-size--2)}.scale--m .handle__label,.scale--m .tick__label{line-height:1rem}.scale--l{--calcite-slider-handle-size:1rem;--calcite-slider-handle-extension-height:0.65rem;--calcite-slider-container-font-size:var(--calcite-font-size--1)}.scale--l .handle__label,.scale--l .tick__label{line-height:1rem}.handle__label,.tick__label{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-2);font-size:var(--calcite-slider-container-font-size)}:host{display:block}.container{position:relative;display:block;overflow-wrap:normal;word-break:normal;padding-inline:calc(var(--calcite-slider-handle-size) * 0.5);padding-block:calc(var(--calcite-slider-handle-size) * 0.5);margin-block:calc(var(--calcite-slider-handle-size) * 0.5);margin-inline:0;--calcite-slider-full-handle-height:calc(\n var(--calcite-slider-handle-size) + var(--calcite-slider-handle-extension-height)\n );touch-action:none}:host([disabled]) .track__range,:host([disabled]) .tick--active{background-color:var(--calcite-ui-text-3)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.scale--s .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-0.375rem}.scale--m .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-0.5rem}.scale--l .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-0.55rem}:host([precise]:not([has-histogram])) .container .thumb--value{--calcite-slider-thumb-y-offset:calc(var(--calcite-slider-full-handle-height) * -1)}.thumb-container{position:relative;max-inline-size:100%}.thumb{--calcite-slider-thumb-x-offset:calc(var(--calcite-slider-handle-size) * 0.5);position:absolute;margin:0px;display:flex;cursor:pointer;flex-direction:column;align-items:center;border-style:none;background-color:transparent;padding:0px;font-family:inherit;outline:2px solid transparent;outline-offset:2px;transform:translate(var(--calcite-slider-thumb-x-offset), var(--calcite-slider-thumb-y-offset))}.thumb .handle__label.static,.thumb .handle__label.transformed{position:absolute;inset-block:0px;opacity:0}.thumb .handle__label.hyphen::after{content:"—";display:inline-block;inline-size:1em}.thumb .handle__label.hyphen--wrap{display:flex}.thumb .handle{box-sizing:border-box;border-radius:9999px;background-color:var(--calcite-ui-foreground-1);outline-color:transparent;block-size:var(--calcite-slider-handle-size);inline-size:var(--calcite-slider-handle-size);box-shadow:0 0 0 2px var(--calcite-ui-text-3) inset;transition:border var(--calcite-internal-animation-timing-medium) ease, background-color var(--calcite-internal-animation-timing-medium) ease, box-shadow var(--calcite-animation-timing) ease}.thumb .handle-extension{inline-size:0.125rem;block-size:var(--calcite-slider-handle-extension-height);background-color:var(--calcite-ui-text-3)}.thumb:hover .handle{box-shadow:0 0 0 3px var(--calcite-ui-brand) inset}.thumb:hover .handle-extension{background-color:var(--calcite-ui-brand)}.thumb:focus .handle{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc(\n 2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-ui-focus-offset-invert),\n 1\n )\n )\n )}.thumb:focus .handle-extension{background-color:var(--calcite-ui-brand)}.thumb.thumb--minValue{transform:translate(calc(var(--calcite-slider-thumb-x-offset) * -1), var(--calcite-slider-thumb-y-offset))}.thumb.thumb--precise{--calcite-slider-thumb-y-offset:-0.125rem}:host([label-handles]) .thumb{--calcite-slider-thumb-x-offset:50%}:host([label-handles]):host(:not([has-histogram])) .scale--s .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-1.4375rem}:host([label-handles]):host(:not([has-histogram])) .scale--m .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-1.875rem}:host([label-handles]):host(:not([has-histogram])) .scale--l .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-2rem}:host([has-histogram][label-handles]) .handle__label,:host([label-handles]:not([has-histogram])) .thumb--minValue.thumb--precise .handle__label{margin-block-start:0.5em}:host(:not([has-histogram]):not([precise])) .handle__label,:host([label-handles]:not([has-histogram])) .thumb--value .handle__label{margin-block-end:0.5em}:host([label-handles][precise]):host(:not([has-histogram])) .scale--s .thumb--value{--calcite-slider-thumb-y-offset:-2.075rem}:host([label-handles][precise]):host(:not([has-histogram])) .scale--m .thumb--value{--calcite-slider-thumb-y-offset:-2.75rem}:host([label-handles][precise]):host(:not([has-histogram])) .scale--l .thumb--value{--calcite-slider-thumb-y-offset:-3.0625rem}.thumb:focus .handle,.thumb--active .handle{background-color:var(--calcite-ui-brand);box-shadow:0 0 8px 0 rgba(0, 0, 0, 0.16)}.thumb:hover.thumb--precise:after,.thumb:focus.thumb--precise:after,.thumb--active.thumb--precise:after{background-color:var(--calcite-ui-brand)}.track{position:relative;block-size:0.125rem;border-radius:0px;background-color:var(--calcite-ui-border-2);transition:all var(--calcite-internal-animation-timing-medium) ease-in}.track__range{position:absolute;inset-block-start:0px;block-size:0.125rem;background-color:var(--calcite-ui-brand)}.container--range .track__range:hover{cursor:ew-resize}.container--range .track__range:after{position:absolute;inline-size:100%;content:"";inset-block-start:calc(var(--calcite-slider-full-handle-height) * 0.5 * -1);block-size:calc(var(--calcite-slider-handle-size) + var(--calcite-slider-handle-extension-height))}@media (forced-colors: active){.thumb{outline-width:0;outline-offset:0}.handle{outline:2px solid transparent;outline-offset:2px}.thumb:focus .handle,.thumb .handle-extension,.thumb:hover .handle-extension,.thumb:focus .handle-extension,.thumb:active .handle-extension{background-color:canvasText}.track{background-color:canvasText}.track__range{background-color:highlight}}.tick{position:absolute;block-size:0.25rem;inline-size:0.125rem;border-width:1px;border-style:solid;background-color:var(--calcite-ui-border-input);border-color:var(--calcite-ui-foreground-1);inset-block-start:-2px;pointer-events:none;margin-inline-start:calc(-1 * 0.125rem)}.tick--active{background-color:var(--calcite-ui-brand)}.tick__label{pointer-events:none;margin-block-start:0.875rem;display:flex;justify-content:center}.tick__label--min{transition:opacity var(--calcite-animation-timing)}.tick__label--max{transition:opacity var(--calcite-internal-animation-timing-fast)}:host([has-histogram][label-handles]) .tick__label--min,:host([has-histogram][label-handles]) .tick__label--max,:host([has-histogram][precise]) .tick__label--min,:host([has-histogram][precise]) .tick__label--max{font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-3)}.graph{color:var(--calcite-ui-foreground-3);block-size:48px}:host([label-ticks][ticks]) .container{padding-block-end:calc(0.875rem + var(--calcite-slider-container-font-size))}:host([has-histogram]):host([precise][label-handles]) .container{padding-block-end:calc(var(--calcite-slider-full-handle-height) + 1em)}:host([has-histogram]):host([label-handles]:not([precise])) .container{padding-block-end:calc(var(--calcite-slider-handle-size) * 0.5 + 1em)}:host([has-histogram]):host([precise]:not([label-handles])) .container{padding-block-end:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([precise]:not([label-handles])) .container{padding-block-start:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([precise]:not([label-handles])) .container--range{padding-block-end:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([label-handles]:not([precise])) .container{padding-block-start:calc(var(--calcite-slider-full-handle-height) + 4px)}:host(:not([has-histogram])):host([label-handles][precise]) .container{padding-block-start:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px)}:host(:not([has-histogram])):host([label-handles][precise]) .container--range{padding-block-end:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px)}::slotted(input[slot=hidden-form-input]){margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;inset:0 !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}:host([hidden]){display:none}[hidden]{display:none}';const P=class{constructor(s){t(this,s),this.selectionLoadingChange=i(this,"selectionLoadingChange",7),this.sketchGraphicsChange=i(this,"sketchGraphicsChange",7),this.drawUndo=i(this,"drawUndo",7),this.drawRedo=i(this,"drawRedo",7),this.active=!1,this.drawMode=I.SKETCH,this.editGraphicsEnabled=!0,this.graphics=void 0,this.mapView=void 0,this.pointSymbol=void 0,this.polylineSymbol=void 0,this.polygonSymbol=void 0,this.redoEnabled=!1,this.undoEnabled=!1,this._translations=void 0,this._selectionMode=void 0}graphicsWatchHandler(t,i){t&&t.length>0&&JSON.stringify(t)!==JSON.stringify(i)&&this._sketchGraphicsLayer&&(this._updateGraphicsSymbols(t),this._sketchGraphicsLayer.removeAll(),this._sketchGraphicsLayer.addMany(t))}mapViewWatchHandler(t,i){t&&t!==i&&this._init()}async clear(){this._clearSketch()}async updateGraphics(){this._updateGraphics()}async componentWillLoad(){await this._getTranslations(),await this._initModules()}componentDidLoad(){this._init()}disconnectedCallback(){this._sketchWidget.cancel(),this._clearSketch()}render(){const t=this.drawMode===I.SKETCH?"display-none":"esri-widget esri-sketch__panel border-left esri-sketch__section";return s(e,null,s("div",{class:this.drawMode===I.SKETCH?"border":"border esri-widget esri-sketch__panel"},s("div",{ref:t=>{this._sketchElement=t}}),s("div",{class:t},s("calcite-action",{disabled:!this.undoEnabled,icon:"undo",onClick:()=>this._undo(),scale:"s",text:this._translations.undo}),s("calcite-action",{disabled:!this.redoEnabled,icon:"redo",onClick:()=>this._redo(),scale:"s",text:this._translations.redo}))))}async _initModules(){const[t,i,s]=await h(["esri/layers/GraphicsLayer","esri/widgets/Sketch","esri/widgets/Sketch/SketchViewModel"]);this.GraphicsLayer=t,this.Sketch=i,this.SketchViewModel=s}_init(){this.mapView&&this._sketchElement&&(this._initGraphicsLayer(),this._initSketch())}_initGraphicsLayer(){const t=this._translations.sketchLayer,i=this.mapView.map.layers.findIndex((i=>i.title===t));i>-1?this._sketchGraphicsLayer=this.mapView.map.layers.getItemAt(i):(this._sketchGraphicsLayer=new this.GraphicsLayer({title:t,listMode:"hide"}),j.managedLayers.push(t),this.mapView.map.layers.add(this._sketchGraphicsLayer)),this.graphics&&this.graphics.length>0&&this._sketchGraphicsLayer.addMany(this.graphics)}_initSketch(){const t={layer:this._sketchGraphicsLayer,view:this.mapView,defaultCreateOptions:{mode:"hybrid"},defaultUpdateOptions:{preserveAspectRatio:!1,enableScaling:!1,enableRotation:!1,tool:"reshape",toggleToolOnClick:!1}};this._sketchWidget=new this.Sketch(Object.assign(Object.assign({},t),{container:this._sketchElement,creationMode:"single",visibleElements:{duplicateButton:!1,selectionTools:{"lasso-selection":!1,"rectangle-selection":!1},createTools:{circle:!1},undoRedoMenu:!1,settingsMenu:this.drawMode===I.SKETCH}})),this._sketchViewModel=new this.SketchViewModel(Object.assign({},t)),this._sketchWidget.viewModel.polylineSymbol=this.polylineSymbol,this._sketchWidget.viewModel.pointSymbol=this.pointSymbol,this._sketchWidget.viewModel.polygonSymbol=this.polygonSymbol;let i=!1;this._sketchWidget.on("create",(t=>{"complete"===t.state&&(this.graphics=[t.graphic],this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1}),this.drawMode===I.REFINE&&(i=!0,this._sketchWidget.viewModel.create(t.tool))),"cancel"===t.state&&this.drawMode===I.REFINE&&i&&(i=!i,this._sketchWidget.viewModel.create(t.tool))})),this._sketchWidget.on("update",(t=>{var i;if(this.editGraphicsEnabled){const s=null===(i=null==t?void 0:t.toolEventInfo)||void 0===i?void 0:i.type;"reshape-stop"!==s&&"move-stop"!==s||(this.graphics=t.graphics,this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1}))}else this._sketchWidget.viewModel.cancel(),this._sketchViewModel.cancel()})),this._sketchWidget.on("delete",(()=>{this.graphics=[],this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1})})),this._sketchWidget.on("undo",(t=>{this.graphics=t.graphics,this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1})})),this._sketchWidget.on("redo",(t=>{this.graphics=t.graphics,this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1})}))}_clearSketch(){var t;this._sketchWidget.viewModel.cancel(),this.graphics=[],null===(t=this._sketchGraphicsLayer)||void 0===t||t.removeAll()}_undo(){this.drawUndo.emit()}_redo(){this.drawRedo.emit()}_updateGraphics(){setTimeout((()=>{1===this.graphics.length&&this._sketchWidget.update(this.graphics,{tool:"reshape",enableRotation:!1,enableScaling:!1,preserveAspectRatio:!1,toggleToolOnClick:!1})}),100)}_updateGraphicsSymbols(t){const i=t[0].geometry.type,s="point"===i?this.pointSymbol:"polyline"===i?this.polylineSymbol:"polygon"===i?this.polygonSymbol:void 0;s&&t.forEach((t=>t.symbol=s))}async _getTranslations(){const t=await l(this.el);this._translations=t[0]}get el(){return a(this)}static get watchers(){return{graphics:["graphicsWatchHandler"],mapView:["mapViewWatchHandler"]}}};P.style=':host{display:block}.border{outline:1px solid var(--calcite-ui-border-input)}.div-visible{display:inherit}.div-not-visible{display:none !important}.padding-top-1-2{padding-top:.5rem}.main-label{display:flex;float:left}html[dir="rtl"] .main-label{display:flex;float:right}.margin-top-1{margin-top:1rem}.border-left{border-left:1px solid rgba(110,110,110,.3)}.border-left[dir="rtl"]{border-right:1px solid rgba(110,110,110,.3)}.esri-widget{box-sizing:border-box;color:#323232;font-size:14px;font-family:"Avenir Next","Helvetica Neue",Helvetica,Arial,sans-serif;line-height:1.3em;background-color:#fff;--esri-widget-padding-v:12px;--esri-widget-padding-h:15px;--esri-widget-padding:var(--esri-widget-padding-v) var(--esri-widget-padding-h)}.esri-sketch__panel{align-items:center;display:flex;flex-flow:row wrap;padding:0;justify-content:flex-start !important}.esri-sketch__section{align-items:center;display:flex;flex-flow:row wrap;padding:0 7px;margin:6px 0}';export{C as buffer_tools,O as calcite_input_message,L as calcite_slider,P as map_draw_tools}
|