@arcgis/core 4.33.0-next.20250418 → 4.33.0-next.20250419
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/48a1bb1e171dd06a7c6e.js +1 -0
- package/assets/esri/themes/base/widgets/_FeatureTable.scss +1 -1
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
- package/interfaces.d.ts +5 -2
- package/package.json +1 -1
- package/renderers/support/AuthoringInfoVisualVariable.js +1 -1
- package/rest/print.js +1 -1
- package/smartMapping/renderers/size.js +1 -1
- package/smartMapping/renderers/support/spikeUtils.js +5 -0
- package/support/revision.js +1 -1
- package/views/draw/DrawScreenTool.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/Legend/support/sizeRampUtils.js +1 -1
- package/widgets/Legend/support/utils.js +1 -1
- package/widgets/Print/PrintViewModel.js +1 -1
- package/widgets/Print/utils.js +1 -1
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
- package/widgets/support/Selector2D/SelectionOperation.js +1 -1
- package/widgets/support/Selector2D/selectorUtils.js +1 -1
- package/assets/esri/core/workers/chunks/f34ce3c37a385b341631.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{millisecondsPerTimeUnit as e}from"../../../core/timeUtils.js";import{isTimeOnlyField as A}from"../../../layers/support/fieldUtils.js";import{format as t}from"../../../renderers/support/numberUtils.js";import{formatAnyDate as n,isAnyDateField as i}from"../../../smartMapping/support/utils.js";import a from"../../../symbols/SimpleLineSymbol.js";const o="<",l=">";function r(e,A,i,a){let r="";0===A?r=`${o} `:A===i&&(r=`${l} `);return r+(a?n(e,a):t(e))}const s=["data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAAAAAAAAAHqZRakAAAANUlEQVQ4jWPMy8v7z0BFwMLAwMAwcdIkqhiWn5fHwEQVk5DAqIGjBo4aOGrgqIEQwEjtKgAATl0Hu6JrzFUAAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAAAAAAAAAHqZRakAAAANUlEQVQ4jWPMy8v7z0BFwMLAwMAwaeIkqhiWl5/HwEQVk5DAqIGjBo4aOGrgqIEQwEjtKgAATl0Hu6sKxboAAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAAAAAAAAAHqZRakAAAANUlEQVQ4jWPMy8v7z0BFwMLAwMAwadJEqhiWl5fPwEQVk5DAqIGjBo4aOGrgqIEQwEjtKgAATl0Hu75+IUcAAAAASUVORK5CYII="];async function u(e){if(!("visualVariables"in e)||!e.visualVariables)return null;const A=e.visualVariables.find((e=>"color"===e.type));if(!A)return null;let t=null,n=null;if(A.stops){if(1===A.stops.length)return A.stops[0].color;t=A.stops[0].value,n=A.stops[A.stops.length-1].value}const i=null!=t&&null!=n?t+(n-t)/2:0,{getColor:a}=await import("../../../renderers/visualVariables/support/visualVariableUtils.js");return a(A,i)??null}async function p(e,A){const t=e.trailCap,n=e.trailWidth||1,i=A||await u(e)||e.color;return new a({cap:t,color:i,width:n})}function f(e,A){if(!A.field)return null;if("featureReduction"in e)switch(e.featureReduction?.type){case"cluster":case"binning":{const t=e.featureReduction.fields.find((({name:e})=>e.toLowerCase()===A.field.toLowerCase()));return t&&"getField"in e?e.getField(t.onStatisticField):null}}return"getField"in e?e.getField?.(A.field):null}function m(e,A){const t="popupTemplate"in e?e.popupTemplate?.fieldInfos:null;if(t?.length&&A)return t.find((e=>e.fieldName?.toLowerCase()===A.toLowerCase()))?.format?.dateFormat}function d(t,n,a){const o=f(t,n);if(!o||!i(o)&&!A(o))return null;let l=m(t,o.name);if(!l&&"date"===o.type){let A=0,t=0;n.stops?(A=n.stops?.at(0)?.value??A,t=n.stops?.at(-1)?.value??t):"minDataValue"in n&&"maxDataValue"in n&&(A=n.minDataValue??A,t=n.maxDataValue??t),l=t-A>2*e.days?"short-date":"short-date-short-time"}return{fieldType:o.type,format:l,timeZoneOptions:{layerTimeZone:"preferredTimeZone"in t?t.preferredTimeZone:null,viewTimeZone:a,datesInUnknownTimezone:"datesInUnknownTimezone"in t&&t.datesInUnknownTimezone}}}function c(e){if("authoringInfo"in e)return e.authoringInfo?.visualVariables?.find((({theme:e})=>
|
|
5
|
+
import{millisecondsPerTimeUnit as e}from"../../../core/timeUtils.js";import{isTimeOnlyField as A}from"../../../layers/support/fieldUtils.js";import{format as t}from"../../../renderers/support/numberUtils.js";import{formatAnyDate as n,isAnyDateField as i}from"../../../smartMapping/support/utils.js";import a from"../../../symbols/SimpleLineSymbol.js";const o="<",l=">";function r(e,A,i,a){let r="";0===A?r=`${o} `:A===i&&(r=`${l} `);return r+(a?n(e,a):t(e))}const s=["data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAAAAAAAAAHqZRakAAAANUlEQVQ4jWPMy8v7z0BFwMLAwMAwcdIkqhiWn5fHwEQVk5DAqIGjBo4aOGrgqIEQwEjtKgAATl0Hu6JrzFUAAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAAAAAAAAAHqZRakAAAANUlEQVQ4jWPMy8v7z0BFwMLAwMAwaeIkqhiWl5/HwEQVk5DAqIGjBo4aOGrgqIEQwEjtKgAATl0Hu6sKxboAAAAASUVORK5CYII=","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAAAAAAAAAHqZRakAAAANUlEQVQ4jWPMy8v7z0BFwMLAwMAwadJEqhiWl5fPwEQVk5DAqIGjBo4aOGrgqIEQwEjtKgAATl0Hu75+IUcAAAAASUVORK5CYII="];async function u(e){if(!("visualVariables"in e)||!e.visualVariables)return null;const A=e.visualVariables.find((e=>"color"===e.type));if(!A)return null;let t=null,n=null;if(A.stops){if(1===A.stops.length)return A.stops[0].color;t=A.stops[0].value,n=A.stops[A.stops.length-1].value}const i=null!=t&&null!=n?t+(n-t)/2:0,{getColor:a}=await import("../../../renderers/visualVariables/support/visualVariableUtils.js");return a(A,i)??null}async function p(e,A){const t=e.trailCap,n=e.trailWidth||1,i=A||await u(e)||e.color;return new a({cap:t,color:i,width:n})}function f(e,A){if(!A.field)return null;if("featureReduction"in e)switch(e.featureReduction?.type){case"cluster":case"binning":{const t=e.featureReduction.fields.find((({name:e})=>e.toLowerCase()===A.field.toLowerCase()));return t&&"getField"in e?e.getField(t.onStatisticField):null}}return"getField"in e?e.getField?.(A.field):null}function m(e,A){const t="popupTemplate"in e?e.popupTemplate?.fieldInfos:null;if(t?.length&&A)return t.find((e=>e.fieldName?.toLowerCase()===A.toLowerCase()))?.format?.dateFormat}function d(t,n,a){const o=f(t,n);if(!o||!i(o)&&!A(o))return null;let l=m(t,o.name);if(!l&&"date"===o.type){let A=0,t=0;n.stops?(A=n.stops?.at(0)?.value??A,t=n.stops?.at(-1)?.value??t):"minDataValue"in n&&"maxDataValue"in n&&(A=n.minDataValue??A,t=n.maxDataValue??t),l=t-A>2*e.days?"short-date":"short-date-short-time"}return{fieldType:o.type,format:l,timeZoneOptions:{layerTimeZone:"preferredTimeZone"in t?t.preferredTimeZone:null,viewTimeZone:a,datesInUnknownTimezone:"datesInUnknownTimezone"in t&&t.datesInUnknownTimezone}}}function c(e,A){if("authoringInfo"in e)return e.authoringInfo?.visualVariables?.find((({theme:e})=>e===A))}export{r as createStopLabel,c as getAuthoringInfoVisualVariableByTheme,d as getDateFormatOptions,u as getMedianColor,p as getSymbolForFlowRenderer,s as rgbImgSource,l as specialCharsGreaterThan,o as specialCharsLessThan};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../request.js";import{isSome as s}from"../../core/arrayUtils.js";import i from"../../core/Collection.js";import o from"../../core/Error.js";import{JSONMap as a}from"../../core/jsonMap.js";import{clone as r}from"../../core/lang.js";import l from"../../core/Loadable.js";import{isAbortError as n}from"../../core/promiseUtils.js";import p from"../../core/ReactiveMap.js";import{watch as m,initial as u}from"../../core/reactiveUtils.js";import{createScreenPoint as h}from"../../core/screenUtils.js";import{unitType as d,convertUnit as c,getMetersPerUnitForSR as y,inchesPerMeter as f}from"../../core/unitUtils.js";import{property as T}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as v}from"../../core/accessorSupport/decorators/subclass.js";import w from"../../geometry/Extent.js";import _ from"../../geometry/SpatialReference.js";import{formatDate as I,convertDateFormatToIntlOptions as g}from"../../intl/date.js";import{getLocaleParts as O}from"../../intl/locale.js";import b from"../../portal/Portal.js";import x from"../../portal/PortalQueryParams.js";import{reArcGISOnlineDomain as P}from"../../portal/support/urlUtils.js";import{execute as S,getTasks as E}from"../../rest/print.js";import{formatJsonMap as U}from"../../rest/support/fileFormat.js";import{fromJSON as L}from"../../rest/support/layoutTemplate.js";import j from"../../rest/support/PrintParameters.js";import C from"../../rest/support/PrintTemplate.js";import{getExtent as k}from"../../views/2d/viewpointUtils.js";import{ViewEventPriorities as H}from"../../views/input/InputManager.js";import F from"../../views/overlay/BoxOverlayItem.js";import D from"./CustomTemplate.js";import A from"./TemplateOptions.js";import{fetchLayoutTemplateInfos as R}from"./utils.js";const W=[30,144,255,255],M=[237,211,23,255],z=[216,48,32,255],V=new Set(["GISProfessionalStdUT","GISProfessionalAdvUT"]),q=/(\/GPServer\/).+/i,G=new a({inch:"inches",foot:"feet",yard:"yards",mile:"miles","nautical-mile":"nautical-miles",millimeter:"millimeters",centimeter:"centimeters",decimeter:"decimeters",meter:"meters",kilometer:"kilometers"}),B=i.ofType(D);function J(t){t.layoutOptions??={},t.layoutOptions.customTextElements??=[];const e="date";if(!t.layoutOptions.customTextElements.find((t=>e in t))){const{customTextElements:e}=t.layoutOptions;let s=I(Date.now(),g("short-date"));"ar"===O()?.language&&(s=""+s),e.push({date:s})}}function N(t,e,s){if(!e)return;!(e.visible===s)&&t.layoutOptions&&(t.layoutOptions.elementOverrides?t.layoutOptions.elementOverrides[e.name]={visible:s}:t.layoutOptions.elementOverrides={[e.name]:{visible:s}})}let $=class extends l{constructor(t){super(t),this._serviceTemplateCustomTextElements=null,this._templateIdToCustomTemplate=new p,this._isFreeHand=!1,this._freeHandWidth=0,this._freehandHeight=0,this._asyncPrintTaskUrl=null,this._layoutInfoTaskUrl=null,this._customLayoutOptions=null,this.allowedFormats="all",this.allowedLayouts="all",this.browseTemplates=new B,this.defaultTemplates=new B,this.error=null,this.extraParameters=null,this.includeDefaultTemplates=!0,this.outSpatialReference=null,this.portal=b.getDefault(),this.portalTemplateIds=[],this.printServiceTemplates=new B,this.defaultTemplate=null,this.showPrintAreaEnabled=!1,this.printServiceUrl=null,this.printTimeout=12e4,this.templatesInfo=null,this.updateDelay=1e3,this.view=null,this.templateCustomTextElements=null,this.templateOptions=new A}initialize(){this.addHandles([m((()=>[this.showPrintAreaEnabled,this.view]),(()=>{this.showPrintAreaEnabled?this._enablePrintPreview():(this.removeHandles("overlay-handler"),this.view?.overlay?.removeItem(this._getOverlayItem()))})),m((()=>[this.templateOptions.layout,this.templateOptions.layoutItem]),(()=>{this.loaded&&this._processTemplateOptions()}))])}destroy(){this.removeHandles("overlay-handler"),this.view&&(this._overlayItem&&(this.view.overlay?.removeItem(this._overlayItem),this._overlayItem.destroy(),this._overlayItem=null),this.view=null)}get effectivePrintServiceUrl(){return this.printServiceUrl??null}get effectiveTemplateCustomTextElements(){if(!this._serviceTemplateCustomTextElements)return{};const t=r(this._serviceTemplateCustomTextElements);return this.templateCustomTextElements&&Object.keys(this.templateCustomTextElements).forEach((e=>{const s=t[e];if(s){const t=this.templateCustomTextElements?.[e];s.forEach((e=>{const[s]=Object.entries(e)[0];t?.forEach((t=>{const[i,o]=Object.entries(t)[0];s===i&&(e[s]=o)}))}))}})),Object.freeze(t)}get state(){return"loading"===this.loadStatus?"initializing":"failed"===this.loadStatus||this.error?"error":"loaded"===this.loadStatus&&this.view?.ready?"ready":"disabled"}async load(t){return this.addResolvingPromise(this._loadResources(t).catch((t=>this.error=t))),this}async print(t){const{view:e,extraParameters:s,updateDelay:i,outSpatialReference:a}=this;if(!e)throw new o("print:view-required","view is not set");J(t);const r=this._getOverlayItem(),l=t.scalePreserved||!this.showPrintAreaEnabled?void 0:k(new w,e.viewpoint,"map-only"===t.layout?[t.exportOptions.width,t.exportOptions.height]:[r.boxWidth,r.boxHeight]),n=new j({view:e,template:t,extent:l,extraParameters:s,updateDelay:i,outSpatialReference:a});try{const e=!!t.layoutItem?.id&&(this.portalTemplateIds.includes(t.layoutItem.id)||this.browseTemplates.some((e=>e.layoutItem?.id===t.layoutItem?.id)));return await S(e&&this._asyncPrintTaskUrl?this._asyncPrintTaskUrl:this.effectivePrintServiceUrl,n,{timeout:this.printTimeout})}catch(p){throw new o("print:export-error","An error occurred while exporting the web map.",{error:p})}}toPrintTemplate({attributionEnabled:t,author:e,copyright:s,customTextElements:i,dpi:a,forceFeatureAttributes:r,format:l,height:n,id:p,includeTables:m,layout:u,layoutItem:h,legendEnabled:d,northArrowEnabled:c,scale:y,scaleBarEnabled:f,scaleEnabled:T,title:v,width:w}){if(!u&&!h)throw new o("print:layout-required","layout is not set");const _=new C({attributionVisible:t,forceFeatureAttributes:r,format:l,includeTables:m,layout:u,layoutItem:h,layoutOptions:{authorText:e||"",copyrightText:s||"",customTextElements:i,titleText:v||""},outScale:y??0,scalePreserved:T});if(w&&(_.exportOptions.width=w),n&&(_.exportOptions.height=n),a&&(_.exportOptions.dpi=a),_.layoutOptions){d||(_.layoutOptions.legendLayers=[]);const t=this.getLayoutTemplateById(p)?.mapSurroundInfoOptions;if(t){const e=t.northArrow;for(const t of e)N(_,t,c);const s=t.scaleBar;for(const t of s)N(_,t,f);const i=t.legend;for(const t of i)N(_,t,d)}}return _}getLayoutTemplateById(t){return t?this._templateIdToCustomTemplate.get(t):null}async addPortalTemplate(t){if(!this.portal||!t?.id)return;try{t.loaded||await t.load()}catch{return void this.applyTemplate(this.defaultTemplate)}const e=new D({type:"browse-template",layoutInfoTaskUrl:this._layoutInfoTaskUrl,label:t.title,layoutItem:t});this._templateIdToCustomTemplate.set(e.id,e),this.browseTemplates.add(e)}removePortalTemplate(t){t.layoutItem&&this.templateOptions.id===t.layoutItem.id&&(this.defaultTemplate?this.applyTemplate(this.defaultTemplate):this.templateOptions.reset()),this.browseTemplates.remove(t),this._templateIdToCustomTemplate.delete(t.id)}async applyTemplate(t){if(!t)return void this.templateOptions.reset();!t.layout||!this.templatesInfo||this.templatesInfo.layout.choiceList.includes(t.layout)||(this.defaultTemplate?t=this.defaultTemplate:this.templateOptions.reset());const e=t.layout||t.layoutItem?.id,s=e?this.templateCustomTextElements?.[e]:void 0;if(await this.templateOptions.applyTemplate(t,{customTextElements:s,customLayoutOptions:this._customLayoutOptions}),e&&this._serviceTemplateCustomTextElements&&!this._serviceTemplateCustomTextElements[e]&&t.layoutTemplateInfo?.layoutOptions?.customTextElements){const s=r(this._serviceTemplateCustomTextElements);s[e]=t.layoutTemplateInfo.layoutOptions.customTextElements,this._serviceTemplateCustomTextElements=Object.freeze(s)}}async _loadResources(t){if(this.destroyed)return;await this._loadUrls(t);const[e,s]=await Promise.all([this._getLayoutToLayoutTemplateInfos(t),this._getPrintServiceTemplatesInfo(t)]);await this._loadAllTemplates(e,s,t),this._processPrintServiceTemplatesInfo(s),await this._processTemplateOptions(),this._updateOverLayItem()}async _processTemplateOptions(){const{layout:t,layoutItem:e}=this.templateOptions;if("map-only"!==t&&!this.templateOptions.id)if(this._customLayoutOptions={legend:this.templateOptions.legendEnabled,northArrow:this.templateOptions.northArrowEnabled,scaleBar:this.templateOptions.scaleBarEnabled},e?.id){try{e.loaded||await e.load()}catch{return void this.applyTemplate(this.defaultTemplate)}let t=this._templateIdToCustomTemplate.get(e.id);t||(t=new D({label:e.title,layoutItem:e,layoutInfoTaskUrl:this._layoutInfoTaskUrl}),this._templateIdToCustomTemplate.set(t.id,t)),await this.applyTemplate(t)}else if(t){const t=this.defaultTemplates.find((t=>t.layout===this.templateOptions.layout))??this.printServiceTemplates.find((t=>t.layout===this.templateOptions.layout));await this.applyTemplate(t??this.defaultTemplate)}}async _loadPortal(t){try{await this.portal.load(t)}catch(e){throw new o("print:could-not-load-portal","Cannot load print resource information from portal",{error:e,url:this.effectivePrintServiceUrl})}}async _loadUrls(t){if(this.printServiceUrl)this._set("effectivePrintServiceUrl",this.printServiceUrl),await this._updateLayoutInfoTaskUrl(this.effectivePrintServiceUrl);else{await this._loadPortal(t);const{printTask:e,asyncPrintTask:s,layoutInfoTask:i}=this.portal?.helperServices??{};this._set("effectivePrintServiceUrl",e?.url),this._asyncPrintTaskUrl=s?.url,await this._updateLayoutInfoTaskUrl(i?.url||this.effectivePrintServiceUrl)}const e=this.effectivePrintServiceUrl?.toLowerCase().split("/");if(!e?.includes("gpserver"))throw new o("print:invalid-print-service-url","Can't fetch print templates information from provided URL",{url:this.effectivePrintServiceUrl})}async _updateLayoutInfoTaskUrl(t,e){if(!t)return;const s=(await E(t,e)).find((t=>t.includes("Get Layout Templates Info")));s&&(this._layoutInfoTaskUrl=t.replace(q,`$1${encodeURI(s)}`))}_getPortalDefaultTemplates(t,e){return this.portal?.helperServices?.printTask?.templates?.filter((t=>"map_only"!==t.layout.toLowerCase()&&(!e||e.includes(L(t.layout)))))?.map((e=>{const s=D.fromJSON(e);if(s.type="default-template",s.layoutInfoTaskUrl=this._layoutInfoTaskUrl,s.layout){const e=t.get(s.layout);e&&s.setLayoutTemplateInfo(e)}return s}))??[]}async _getPortalCustomTemplates(t){if(this.printServiceUrl||!this.portal)return[];const{layoutGroupQuery:e,user:s}=this.portal,i=P.test(this.portal.url),o=s?.userLicenseTypeId,a=o&&V.has(o);if(!e||i&&!a)return[];const r=new x({query:e,disableExtraQuery:!0}),l=await this.portal.queryGroups(r,t);if(!l.total)return[];const n=l.results[0],p=new x({num:100,query:"type:Layout",sortField:n.sortField,sortOrder:n.sortOrder??void 0}),m=(await n.queryItems(p,t)).results;if(!m.length)return[];return m.map((t=>(this.portalTemplateIds.push(t.id),new D({type:"default-template",label:t.title,layoutItem:t,layoutInfoTaskUrl:this._layoutInfoTaskUrl}))))}async _loadAllTemplates(t,e,s){let i=!1;const o=e?.layout?.choiceList;if(this.includeDefaultTemplates&&this.portal&&!this.printServiceUrl){const e=this._getPortalDefaultTemplates(t,o);i=!!e.length,this.defaultTemplates.addMany(e);const a=await this._getPortalCustomTemplates(s);this.defaultTemplates.addMany(a);for(const t of this.defaultTemplates)this._templateIdToCustomTemplate.set(t.id,t)}i||t.forEach(((t,e)=>{if(!o||o.includes(e)){const s=new D({type:"print-service-template",layout:e,layoutInfoTaskUrl:this._layoutInfoTaskUrl});s.setLayoutTemplateInfo(t),this.printServiceTemplates.add(s),this._templateIdToCustomTemplate.set(s.id,s)}}))}_processPrintServiceTemplatesInfo(t){this._set("templatesInfo",t);const e=t?.layout?.defaultValue;if(e&&"map-only"!==e){const t=this.defaultTemplates.find((t=>t.layout===e))??this.printServiceTemplates.find((t=>t.layout===e))??this.defaultTemplates.at(0)??this.printServiceTemplates.at(0);this._set("defaultTemplate",t)}}async _getLayoutToLayoutTemplateInfos(t){const e=await R(this._layoutInfoTaskUrl,void 0,t),s=new Map,i={};for(const o of e){const t=L(o.layoutTemplate);s.set(t,o),i[t]=o.layoutOptions.customTextElements}return this._serviceTemplateCustomTextElements=Object.freeze(i),s}async _getPrintServiceTemplatesInfo(t){let s;try{({data:s}=await e(this.effectivePrintServiceUrl,{...t,query:{f:"json"},timeout:this.printTimeout}))}catch(l){throw n(l)?l:new o("print:unavailable-service-info","Can't fetch templates info from service",{error:l})}const{parameters:i}=s,a=i.find((({name:t})=>"Format"===t)),r=i.find((({name:t})=>"Layout_Template"===t));return{format:this._getFormat(a),layout:this._getLayout(r)}}_getFormat(t){const e="all"===this.allowedFormats?t.choiceList:t.choiceList.filter((t=>"string"!=typeof this.allowedFormats&&this.allowedFormats.some((e=>new RegExp(`\\b${e}\\b`,"i").test(t))))),i=(e.length?e:t.choiceList).map((t=>U.fromJSON(t))).filter(s),o=U.fromJSON(t.defaultValue),a=i.some((t=>new RegExp(`\\b${o}\\b`,"i").test(t)))?o:i[0];return{choiceList:i,defaultValue:a}}_getLayout(t){const e=t.choiceList.filter((t=>"map_only"!==t.toLowerCase())),i="all"===this.allowedLayouts?e:e.filter((t=>this.allowedLayouts.includes(L(t)))),o=(i.length?i:e).map(L).filter(s),a=L(t.defaultValue),r=o.includes(a)?a:o.find((t=>/(?=.*letter)(?=.*landscape)/i.test(t)))??o.find((t=>/(?=.*a4)(?=.*landscape)/i.test(t)))??o[0];return{choiceList:o,defaultValue:r}}_getOverlayItem(){return this._overlayItem||(this._overlayItem=new F({strokeDash:[5],strokeWidth:2,strokeColor:[30,144,255,255]})),this._overlayItem}_enablePrintPreview(){if(!this.view?.overlay)return;const t=this.templateOptions,e=this._getOverlayItem();this.addHandles([m((()=>[t.width,t.height,t.scaleEnabled,t.scale,t.layout,t.layoutItem,t.id,t.state,this.view?.scale,this.view?.size,this.view?.state.paddedViewState.size,this.view?.state.padding,this.loaded]),(()=>this._updateOverLayItem()),u),this.view?.on("drag",["Shift"],(t=>this._handleDrag(t)),H.WIDGET),this.view?.on("key-down",["Escape"],(()=>this._resetDrag()),H.WIDGET)],"overlay-handler"),this.view.overlay.addItem(e)}_updateOverLayItem(){if(!this.view)return;const t=this.templateOptions,e=this._getOverlayItem(),s=t.layoutItem?.id??t.layout,i=this.view,o=i.spatialReference,[a,r]=i.state.paddedViewState.size,l=i.state.padding;let n=0,p=0;if("map-only"===s)null!=t.width&&null!=t.height&&(n=t.width,p=t.height);else if(s){const e=t.id?this._templateIdToCustomTemplate.get(t.id):null,{webMapFrameSize:s,pageUnits:i}=e?.layoutTemplateInfo??{};let l=!1;if(s&&i)if(this._isFreeHand){const t=s[0]/s[1];n=this._freeHandWidth,p=this._freehandHeight,n>p?p=n/t:n=p*t}else{const t=G.fromJSON(i.toLowerCase()),e=o.unit;d(t)===d(e)?(n=c(s[0],t,e),p=c(s[1],t,e)):(l=!0,n=s[0],p=s[1])}if(!this._isFreeHand)if(t.scaleEnabled&&t.scale){const e=l?Math.min(a/n,r/p):y(o)*f*t.dpi;n*=e,p*=e}else if(0===n||0===p)n=a,p=r;else{const t=(a-.1*a)/n,e=(r-.1*r)/p,s=Math.min(t,e);n*=s,p*=s}}const{scaleEnabled:m,scale:u}=t,h=m&&u?u/this.view.scale:1;if(e.boxWidth=n*h||a,e.boxHeight=p*h||r,l&&(e.padding=l),e.backgroundWidth=a??0,e.backgroundHeight=r??0,"loading"===this.loadStatus)e.strokeColor=M;else if("loaded"===this.loadStatus)switch(this.templateOptions.state){case"pending":e.strokeColor=M;break;case"ready":e.strokeColor=W;break;case"error":e.strokeColor=z}}_resetDrag(){this._isFreeHand=!1,this._updateOverLayItem()}_handleDrag(t){switch(t.action){case"start":this._start();break;case"update":this._update(t);break;case"end":this._end()}t.stopPropagation()}_start(){this._isFreeHand=!0}_update(t){const e=this._getOverlayItem(),{x:s,y:i}=t,{x:o,y:a}=t.origin;s>o?(e.x=o,e.boxWidth=s-o):(e.x=s,e.boxWidth=o-s),i>a?(e.y=a,e.boxHeight=i-a):(e.y=i,e.boxHeight=a-i)}_end(){const t=this._getOverlayItem();if(!this.view||null==t.x||null==t.y)return;const e=this.view,s=e.toMap(h(t.x+.5*t.boxWidth,t.y+.5*t.boxHeight));t.x=null,t.y=null,e.goTo({center:s}),this._freeHandWidth=t.boxWidth,this._freehandHeight=t.boxHeight,"map-only"===this.templateOptions.layout&&(this.templateOptions.width=this._freeHandWidth,this.templateOptions.height=this._freehandHeight),this.templateOptions.scale=this.view.scale,this._updateOverLayItem()}};t([T()],$.prototype,"_serviceTemplateCustomTextElements",void 0),t([T()],$.prototype,"_templateIdToCustomTemplate",void 0),t([T()],$.prototype,"allowedFormats",void 0),t([T()],$.prototype,"allowedLayouts",void 0),t([T({type:B})],$.prototype,"browseTemplates",void 0),t([T({type:B})],$.prototype,"defaultTemplates",void 0),t([T()],$.prototype,"error",void 0),t([T()],$.prototype,"extraParameters",void 0),t([T()],$.prototype,"includeDefaultTemplates",void 0),t([T({readOnly:!0})],$.prototype,"effectivePrintServiceUrl",null),t([T()],$.prototype,"effectiveTemplateCustomTextElements",null),t([T({type:_})],$.prototype,"outSpatialReference",void 0),t([T({type:b})],$.prototype,"portal",void 0),t([T()],$.prototype,"portalTemplateIds",void 0),t([T({type:B})],$.prototype,"printServiceTemplates",void 0),t([T({readOnly:!0})],$.prototype,"defaultTemplate",void 0),t([T()],$.prototype,"showPrintAreaEnabled",void 0),t([T()],$.prototype,"printServiceUrl",void 0),t([T()],$.prototype,"printTimeout",void 0),t([T({readOnly:!0})],$.prototype,"state",null),t([T({readOnly:!0})],$.prototype,"templatesInfo",void 0),t([T()],$.prototype,"updateDelay",void 0),t([T()],$.prototype,"view",void 0),t([T()],$.prototype,"templateCustomTextElements",void 0),t([T({type:A})],$.prototype,"templateOptions",void 0),$=t([v("esri.widgets.Print.PrintViewModel")],$);const Q=$;export{Q as default};
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import{isSome as e}from"../../core/arrayUtils.js";import s from"../../core/Collection.js";import i from"../../core/Error.js";import{JSONMap as o}from"../../core/jsonMap.js";import{clone as a}from"../../core/lang.js";import r from"../../core/Loadable.js";import l from"../../core/ReactiveMap.js";import{watch as n,initial as p}from"../../core/reactiveUtils.js";import{createScreenPoint as m}from"../../core/screenUtils.js";import{unitType as u,convertUnit as h,getMetersPerUnitForSR as d,inchesPerMeter as c}from"../../core/unitUtils.js";import{property as y}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as f}from"../../core/accessorSupport/decorators/subclass.js";import T from"../../geometry/Extent.js";import v from"../../geometry/SpatialReference.js";import{formatDate as w,convertDateFormatToIntlOptions as _}from"../../intl/date.js";import{getLocaleParts as I}from"../../intl/locale.js";import g from"../../portal/Portal.js";import O from"../../portal/PortalQueryParams.js";import{reArcGISOnlineDomain as b}from"../../portal/support/urlUtils.js";import{execute as x,getTaskInfo as P,PrintServiceTask as S}from"../../rest/print.js";import{formatJsonMap as E}from"../../rest/support/fileFormat.js";import{fromJSON as U}from"../../rest/support/layoutTemplate.js";import L from"../../rest/support/PrintParameters.js";import C from"../../rest/support/PrintTemplate.js";import{getExtent as k}from"../../views/2d/viewpointUtils.js";import{ViewEventPriorities as j}from"../../views/input/InputManager.js";import H from"../../views/overlay/BoxOverlayItem.js";import F from"./CustomTemplate.js";import D from"./TemplateOptions.js";import{fetchLayoutTemplateInfos as A}from"./utils.js";const W=[30,144,255,255],R=[237,211,23,255],M=[216,48,32,255],z=new Set(["GISProfessionalStdUT","GISProfessionalAdvUT"]),V=/(\/GPServer\/).+/i,G=new o({inch:"inches",foot:"feet",yard:"yards",mile:"miles","nautical-mile":"nautical-miles",millimeter:"millimeters",centimeter:"centimeters",decimeter:"decimeters",meter:"meters",kilometer:"kilometers"}),B=s.ofType(F);function q(t){t.layoutOptions??={},t.layoutOptions.customTextElements??=[];const e="date";if(!t.layoutOptions.customTextElements.find((t=>e in t))){const{customTextElements:e}=t.layoutOptions;let s=w(Date.now(),_("short-date"));"ar"===I()?.language&&(s=""+s),e.push({date:s})}}function N(t,e,s){if(!e)return;!(e.visible===s)&&t.layoutOptions&&(t.layoutOptions.elementOverrides?t.layoutOptions.elementOverrides[e.name]={visible:s}:t.layoutOptions.elementOverrides={[e.name]:{visible:s}})}let J=class extends r{constructor(t){super(t),this._serviceTemplateCustomTextElements=null,this._templateIdToCustomTemplate=new l,this._isFreeHand=!1,this._freeHandWidth=0,this._freehandHeight=0,this._asyncPrintTaskUrl=null,this._layoutInfoTaskUrl=null,this._customLayoutOptions=null,this.allowedFormats="all",this.allowedLayouts="all",this.browseTemplates=new B,this.defaultTemplates=new B,this.error=null,this.extraParameters=null,this.includeDefaultTemplates=!0,this.outSpatialReference=null,this.portal=g.getDefault(),this.portalTemplateIds=[],this.printServiceTemplates=new B,this.defaultTemplate=null,this.showPrintAreaEnabled=!1,this.printServiceUrl=null,this.printTimeout=12e4,this.templatesInfo=null,this.updateDelay=1e3,this.view=null,this.templateCustomTextElements=null,this.templateOptions=new D}initialize(){this.addHandles([n((()=>[this.showPrintAreaEnabled,this.view]),(()=>{this.showPrintAreaEnabled?this._enablePrintPreview():(this.removeHandles("overlay-handler"),this.view?.overlay?.removeItem(this._getOverlayItem()))})),n((()=>[this.templateOptions.layout,this.templateOptions.layoutItem]),(()=>{this.loaded&&this._processTemplateOptions()}))])}destroy(){this.removeHandles("overlay-handler"),this.view&&(this._overlayItem&&(this.view.overlay?.removeItem(this._overlayItem),this._overlayItem.destroy(),this._overlayItem=null),this.view=null)}get effectivePrintServiceUrl(){return this.printServiceUrl??null}get effectiveTemplateCustomTextElements(){if(!this._serviceTemplateCustomTextElements)return{};const t=a(this._serviceTemplateCustomTextElements);return this.templateCustomTextElements&&Object.keys(this.templateCustomTextElements).forEach((e=>{const s=t[e];if(s){const t=this.templateCustomTextElements?.[e];s.forEach((e=>{const[s]=Object.entries(e)[0];t?.forEach((t=>{const[i,o]=Object.entries(t)[0];s===i&&(e[s]=o)}))}))}})),Object.freeze(t)}get state(){return"loading"===this.loadStatus?"initializing":"failed"===this.loadStatus||this.error?"error":"loaded"===this.loadStatus&&this.view?.ready?"ready":"disabled"}async load(t){return this.addResolvingPromise(this._loadResources(t).catch((t=>this.error=t))),this}async print(t){const{view:e,extraParameters:s,updateDelay:o,outSpatialReference:a}=this;if(!e)throw new i("print:view-required","view is not set");q(t);const r=this._getOverlayItem(),l=t.scalePreserved||!this.showPrintAreaEnabled?void 0:k(new T,e.viewpoint,"map-only"===t.layout?[t.exportOptions.width,t.exportOptions.height]:[r.boxWidth,r.boxHeight]),n=new L({view:e,template:t,extent:l,extraParameters:s,updateDelay:o,outSpatialReference:a});try{const e=!!t.layoutItem?.id&&(this.portalTemplateIds.includes(t.layoutItem.id)||this.browseTemplates.some((e=>e.layoutItem?.id===t.layoutItem?.id)));return await x(e&&this._asyncPrintTaskUrl?this._asyncPrintTaskUrl:this.effectivePrintServiceUrl,n,{timeout:this.printTimeout})}catch(p){throw new i("print:export-error","An error occurred while exporting the web map.",{error:p})}}toPrintTemplate({attributionEnabled:t,author:e,copyright:s,customTextElements:o,dpi:a,forceFeatureAttributes:r,format:l,height:n,id:p,includeTables:m,layout:u,layoutItem:h,legendEnabled:d,northArrowEnabled:c,scale:y,scaleBarEnabled:f,scaleEnabled:T,title:v,width:w}){if(!u&&!h)throw new i("print:layout-required","layout is not set");const _=new C({attributionVisible:t,forceFeatureAttributes:r,format:l,includeTables:m,layout:u,layoutItem:h,layoutOptions:{authorText:e||"",copyrightText:s||"",customTextElements:o,titleText:v||""},outScale:y??0,scalePreserved:T});if(w&&(_.exportOptions.width=w),n&&(_.exportOptions.height=n),a&&(_.exportOptions.dpi=a),_.layoutOptions){d||(_.layoutOptions.legendLayers=[]);const t=this.getLayoutTemplateById(p)?.mapSurroundInfoOptions;if(t){const e=t.northArrow;for(const t of e)N(_,t,c);const s=t.scaleBar;for(const t of s)N(_,t,f);const i=t.legend;for(const t of i)N(_,t,d)}}return _}getLayoutTemplateById(t){return t?this._templateIdToCustomTemplate.get(t):null}async addPortalTemplate(t){if(!this.portal||!t?.id)return;try{t.loaded||await t.load()}catch{return void this.applyTemplate(this.defaultTemplate)}const e=new F({type:"browse-template",layoutInfoTaskUrl:this._layoutInfoTaskUrl,label:t.title,layoutItem:t});this._templateIdToCustomTemplate.set(e.id,e),this.browseTemplates.add(e)}removePortalTemplate(t){t.layoutItem&&this.templateOptions.id===t.layoutItem.id&&(this.defaultTemplate?this.applyTemplate(this.defaultTemplate):this.templateOptions.reset()),this.browseTemplates.remove(t),this._templateIdToCustomTemplate.delete(t.id)}async applyTemplate(t){if(!t)return void this.templateOptions.reset();!t.layout||!this.templatesInfo||this.templatesInfo.layout.choiceList.includes(t.layout)||(this.defaultTemplate?t=this.defaultTemplate:this.templateOptions.reset());const e=t.layout||t.layoutItem?.id,s=e?this.templateCustomTextElements?.[e]:void 0;if(await this.templateOptions.applyTemplate(t,{customTextElements:s,customLayoutOptions:this._customLayoutOptions}),e&&this._serviceTemplateCustomTextElements&&!this._serviceTemplateCustomTextElements[e]&&t.layoutTemplateInfo?.layoutOptions?.customTextElements){const s=a(this._serviceTemplateCustomTextElements);s[e]=t.layoutTemplateInfo.layoutOptions.customTextElements,this._serviceTemplateCustomTextElements=Object.freeze(s)}}async _loadResources(t){if(this.destroyed)return;await this._loadUrls(t);const[e,s]=await Promise.all([this._getLayoutToLayoutTemplateInfos(t),this._getPrintServiceTemplatesInfo(t)]);await this._loadAllTemplates(e,s,t),this._processPrintServiceTemplatesInfo(s),await this._processTemplateOptions(),this._updateOverLayItem()}async _processTemplateOptions(){const{layout:t,layoutItem:e}=this.templateOptions;if("map-only"!==t&&!this.templateOptions.id)if(this._customLayoutOptions={legend:this.templateOptions.legendEnabled,northArrow:this.templateOptions.northArrowEnabled,scaleBar:this.templateOptions.scaleBarEnabled},e?.id){try{e.loaded||await e.load()}catch{return void this.applyTemplate(this.defaultTemplate)}let t=this._templateIdToCustomTemplate.get(e.id);t||(t=new F({label:e.title,layoutItem:e,layoutInfoTaskUrl:this._layoutInfoTaskUrl}),this._templateIdToCustomTemplate.set(t.id,t)),await this.applyTemplate(t)}else if(t){const t=this.defaultTemplates.find((t=>t.layout===this.templateOptions.layout))??this.printServiceTemplates.find((t=>t.layout===this.templateOptions.layout));await this.applyTemplate(t??this.defaultTemplate)}}async _loadPortal(t){try{await this.portal.load(t)}catch(e){throw new i("print:could-not-load-portal","Cannot load print resource information from portal",{error:e,url:this.effectivePrintServiceUrl})}}async _loadUrls(t){if(this.printServiceUrl)this._set("effectivePrintServiceUrl",this.printServiceUrl),await this._updateLayoutInfoTaskUrl(this.effectivePrintServiceUrl,t);else{await this._loadPortal(t);const{printTask:e,asyncPrintTask:s,layoutInfoTask:i}=this.portal?.helperServices??{};this._set("effectivePrintServiceUrl",e?.url),this._asyncPrintTaskUrl=s?.url,await this._updateLayoutInfoTaskUrl(i?.url||this.effectivePrintServiceUrl,t)}const e=this.effectivePrintServiceUrl?.toLowerCase().split("/");if(!e?.includes("gpserver"))throw new i("print:invalid-print-service-url","Can't fetch print templates information from provided URL",{url:this.effectivePrintServiceUrl})}async _updateLayoutInfoTaskUrl(t,e){if(!t)return;const s=await P(t,S.GetLayoutTemplatesInfo,e);s&&(this._layoutInfoTaskUrl=t.replace(V,`$1${encodeURI(s.displayName)}`))}_getPortalDefaultTemplates(t,e){return this.portal?.helperServices?.printTask?.templates?.filter((t=>"map_only"!==t.layout.toLowerCase()&&(!e||e.includes(U(t.layout)))))?.map((e=>{const s=F.fromJSON(e);if(s.type="default-template",s.layoutInfoTaskUrl=this._layoutInfoTaskUrl,s.layout){const e=t.get(s.layout);e&&s.setLayoutTemplateInfo(e)}return s}))??[]}async _getPortalCustomTemplates(t){if(this.printServiceUrl||!this.portal)return[];const{layoutGroupQuery:e,user:s}=this.portal,i=b.test(this.portal.url),o=s?.userLicenseTypeId,a=o&&z.has(o);if(!e||i&&!a)return[];const r=new O({query:e,disableExtraQuery:!0}),l=await this.portal.queryGroups(r,t);if(!l.total)return[];const n=l.results[0],p=new O({num:100,query:"type:Layout",sortField:n.sortField,sortOrder:n.sortOrder??void 0}),m=(await n.queryItems(p,t)).results;if(!m.length)return[];return m.map((t=>(this.portalTemplateIds.push(t.id),new F({type:"default-template",label:t.title,layoutItem:t,layoutInfoTaskUrl:this._layoutInfoTaskUrl}))))}async _loadAllTemplates(t,e,s){let i=!1;const o=e?.layout?.choiceList;if(this.includeDefaultTemplates&&this.portal&&!this.printServiceUrl){const e=this._getPortalDefaultTemplates(t,o);i=!!e.length,this.defaultTemplates.addMany(e);const a=await this._getPortalCustomTemplates(s);this.defaultTemplates.addMany(a);for(const t of this.defaultTemplates)this._templateIdToCustomTemplate.set(t.id,t)}i||t.forEach(((t,e)=>{if(!o||o.includes(e)){const s=new F({type:"print-service-template",layout:e,layoutInfoTaskUrl:this._layoutInfoTaskUrl});s.setLayoutTemplateInfo(t),this.printServiceTemplates.add(s),this._templateIdToCustomTemplate.set(s.id,s)}}))}_processPrintServiceTemplatesInfo(t){this._set("templatesInfo",t);const e=t?.layout?.defaultValue;if(e&&"map-only"!==e){const t=this.defaultTemplates.find((t=>t.layout===e))??this.printServiceTemplates.find((t=>t.layout===e))??this.defaultTemplates.at(0)??this.printServiceTemplates.at(0);this._set("defaultTemplate",t)}}async _getLayoutToLayoutTemplateInfos(t){const e=await A(this._layoutInfoTaskUrl,void 0,t),s=new Map,i={};for(const o of e){const t=U(o.layoutTemplate);s.set(t,o),i[t]=o.layoutOptions.customTextElements}return this._serviceTemplateCustomTextElements=Object.freeze(i),s}async _getPrintServiceTemplatesInfo(t){const e=await P(this.effectivePrintServiceUrl,S.ExportWebMap,t);if(!e)throw new i("print:unavailable-service-info","Can't fetch templates info from service");const{parameters:s}=e,o=s.find((({name:t})=>"Format"===t)),a=s.find((({name:t})=>"Layout_Template"===t));return{format:this._getFormat(o),layout:this._getLayout(a)}}_getFormat(t){const s="all"===this.allowedFormats?t.choiceList:t.choiceList.filter((t=>"string"!=typeof this.allowedFormats&&this.allowedFormats.some((e=>new RegExp(`\\b${e}\\b`,"i").test(t))))),i=(s.length?s:t.choiceList).map((t=>E.fromJSON(t))).filter(e),o=E.fromJSON(t.defaultValue),a=i.some((t=>new RegExp(`\\b${o}\\b`,"i").test(t)))?o:i[0];return{choiceList:i,defaultValue:a}}_getLayout(t){const s=t.choiceList.filter((t=>"map_only"!==t.toLowerCase())),i="all"===this.allowedLayouts?s:s.filter((t=>this.allowedLayouts.includes(U(t)))),o=(i.length?i:s).map(U).filter(e),a=U(t.defaultValue),r=o.includes(a)?a:o.find((t=>/(?=.*letter)(?=.*landscape)/i.test(t)))??o.find((t=>/(?=.*a4)(?=.*landscape)/i.test(t)))??o[0];return{choiceList:o,defaultValue:r}}_getOverlayItem(){return this._overlayItem||(this._overlayItem=new H({strokeDash:[5],strokeWidth:2,strokeColor:[30,144,255,255]})),this._overlayItem}_enablePrintPreview(){if(!this.view?.overlay)return;const t=this.templateOptions,e=this._getOverlayItem();this.addHandles([n((()=>[t.width,t.height,t.scaleEnabled,t.scale,t.layout,t.layoutItem,t.id,t.state,this.view?.scale,this.view?.size,this.view?.state.paddedViewState.size,this.view?.state.padding,this.loaded]),(()=>this._updateOverLayItem()),p),this.view?.on("drag",["Shift"],(t=>this._handleDrag(t)),j.WIDGET),this.view?.on("key-down",["Escape"],(()=>this._resetDrag()),j.WIDGET)],"overlay-handler"),this.view.overlay.addItem(e)}_updateOverLayItem(){if(!this.view)return;const t=this.templateOptions,e=this._getOverlayItem(),s=t.layoutItem?.id??t.layout,i=this.view,o=i.spatialReference,[a,r]=i.state.paddedViewState.size,l=i.state.padding;let n=0,p=0;if("map-only"===s)null!=t.width&&null!=t.height&&(n=t.width,p=t.height);else if(s){const e=t.id?this._templateIdToCustomTemplate.get(t.id):null,{webMapFrameSize:s,pageUnits:i}=e?.layoutTemplateInfo??{};let l=!1;if(s&&i)if(this._isFreeHand){const t=s[0]/s[1];n=this._freeHandWidth,p=this._freehandHeight,n>p?p=n/t:n=p*t}else{const t=G.fromJSON(i.toLowerCase()),e=o.unit;u(t)===u(e)?(n=h(s[0],t,e),p=h(s[1],t,e)):(l=!0,n=s[0],p=s[1])}if(!this._isFreeHand)if(t.scaleEnabled&&t.scale){const e=l?Math.min(a/n,r/p):d(o)*c*t.dpi;n*=e,p*=e}else if(0===n||0===p)n=a,p=r;else{const t=(a-.1*a)/n,e=(r-.1*r)/p,s=Math.min(t,e);n*=s,p*=s}}const{scaleEnabled:m,scale:y}=t,f=m&&y?y/this.view.scale:1;if(e.boxWidth=n*f||a,e.boxHeight=p*f||r,l&&(e.padding=l),e.backgroundWidth=a??0,e.backgroundHeight=r??0,"loading"===this.loadStatus)e.strokeColor=R;else if("loaded"===this.loadStatus)switch(this.templateOptions.state){case"pending":e.strokeColor=R;break;case"ready":e.strokeColor=W;break;case"error":e.strokeColor=M}}_resetDrag(){this._isFreeHand=!1,this._updateOverLayItem()}_handleDrag(t){switch(t.action){case"start":this._start();break;case"update":this._update(t);break;case"end":this._end()}t.stopPropagation()}_start(){this._isFreeHand=!0}_update(t){const e=this._getOverlayItem(),{x:s,y:i}=t,{x:o,y:a}=t.origin;s>o?(e.x=o,e.boxWidth=s-o):(e.x=s,e.boxWidth=o-s),i>a?(e.y=a,e.boxHeight=i-a):(e.y=i,e.boxHeight=a-i)}_end(){const t=this._getOverlayItem();if(!this.view||null==t.x||null==t.y)return;const e=this.view,s=e.toMap(m(t.x+.5*t.boxWidth,t.y+.5*t.boxHeight));t.x=null,t.y=null,e.goTo({center:s}),this._freeHandWidth=t.boxWidth,this._freehandHeight=t.boxHeight,"map-only"===this.templateOptions.layout&&(this.templateOptions.width=this._freeHandWidth,this.templateOptions.height=this._freehandHeight),this.templateOptions.scale=this.view.scale,this._updateOverLayItem()}};t([y()],J.prototype,"_serviceTemplateCustomTextElements",void 0),t([y()],J.prototype,"_templateIdToCustomTemplate",void 0),t([y()],J.prototype,"allowedFormats",void 0),t([y()],J.prototype,"allowedLayouts",void 0),t([y({type:B})],J.prototype,"browseTemplates",void 0),t([y({type:B})],J.prototype,"defaultTemplates",void 0),t([y()],J.prototype,"error",void 0),t([y()],J.prototype,"extraParameters",void 0),t([y()],J.prototype,"includeDefaultTemplates",void 0),t([y({readOnly:!0})],J.prototype,"effectivePrintServiceUrl",null),t([y()],J.prototype,"effectiveTemplateCustomTextElements",null),t([y({type:v})],J.prototype,"outSpatialReference",void 0),t([y({type:g})],J.prototype,"portal",void 0),t([y()],J.prototype,"portalTemplateIds",void 0),t([y({type:B})],J.prototype,"printServiceTemplates",void 0),t([y({readOnly:!0})],J.prototype,"defaultTemplate",void 0),t([y()],J.prototype,"showPrintAreaEnabled",void 0),t([y()],J.prototype,"printServiceUrl",void 0),t([y()],J.prototype,"printTimeout",void 0),t([y({readOnly:!0})],J.prototype,"state",null),t([y({readOnly:!0})],J.prototype,"templatesInfo",void 0),t([y()],J.prototype,"updateDelay",void 0),t([y()],J.prototype,"view",void 0),t([y()],J.prototype,"templateCustomTextElements",void 0),t([y({type:D})],J.prototype,"templateOptions",void 0),J=t([f("esri.widgets.Print.PrintViewModel")],J);const $=J;export{$ as default};
|
package/widgets/Print/utils.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../core/Error.js";import{
|
|
5
|
+
import t from"../../core/Error.js";import{getTaskExecutionMode as o,PrintServiceTask as r}from"../../rest/print.js";import{execute as e}from"../../rest/geoprocessor/execute.js";import{submitJob as a}from"../../rest/geoprocessor/submitJob.js";async function i(i,s,n){if(!i)throw new t("print:invalid-layout-info-task-url","Can't fetch layout template info",{url:i});if("async"===await o(i,r.GetLayoutTemplatesInfo,n)){const t=await a(i,s,void 0,n||void 0);await t.waitForJobCompletion();return(await t.fetchResultData("Output_JSON")).value}return(await e(i,s,null,n)).results[0].value}export{i as fetchLayoutTemplateInfos};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import{deprecatedProperty as t}from"../../../core/deprecate.js";import
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import{deprecatedProperty as t}from"../../../core/deprecate.js";import o from"../../../core/Evented.js";import{handlesGroup as s}from"../../../core/handleUtils.js";import r from"../../../core/Logger.js";import{removeMaybe as i}from"../../../core/maybe.js";import{watch as a}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{isKnowledgeGraphLayer as l,isLinkChartLayer as p}from"../../../layers/support/layerUtils.js";import{findLayerView as u}from"../../../views/draw/support/layerUtils.js";import{isSelectableLayerView2D as h}from"../../../views/support/layerViewUtils.js";import d from"../Selector2D/SelectionOperation.js";let m=class extends o.EventedAccessor{constructor(e){super(e),this._operationHandlesGroup=null,this.activeOperation=null,this.layerViewPreferenceEnabled=!0,this.sources=null}initialize(){this.addHandles([a((()=>this._sources),(e=>{this.activeOperation&&(this.activeOperation.sources=e)}))])}destroy(){this._operationHandlesGroup=i(this._operationHandlesGroup)}get _sources(){const{layerViewPreferenceEnabled:e,sources:t,view:o}=this;if(!o||!t?.length)return[];const s=[];return t.forEach((t=>{if(h(t))s.push(t);else if(l(t)||p(t)){(t.layers||[]).forEach((t=>{const r=u(o,t)||void 0,i=e&&h(r)?r:t;s.push(i)}))}else if(e){const e=u(o,t)||void 0,r=h(e)?e:t;s.push(r)}else s.push(t)})),s}get layers(){return t(r.getLogger(this),"layers",{replacement:"Use SelectionToolbar.sources instead."}),this.sources}set layers(e){t(r.getLogger(this),"layers",{replacement:"Use SelectionToolbar.sources instead."}),this.sources=e}get state(){const{_sources:e,view:t}=this,o=!e?.length&&!t?.selectionManager.sources.length;return this.activeOperation?"active":t?.ready&&!o?"ready":"disabled"}cancel(){"active"===this.state&&(this.activeOperation?.cancel(),this._set("activeOperation",null))}activate(e){const{_sources:t,state:o,view:r}=this,i=!t?.length&&!r?.selectionManager.sources.length;if("disabled"===o||i||!this.view)return;"active"===o&&this.cancel();const a=new d({view:this.view,sources:t,options:e});return this._operationHandlesGroup=s([a.selection.on("change",(e=>this.emit("selection-change",e))),a.once("complete",(e=>this._onOperationComplete(e)))]),this._set("activeOperation",a),a}_onOperationComplete(e){this._operationHandlesGroup=i(this._operationHandlesGroup),this._set("activeOperation",null),this.emit("complete",e)}};e([n()],m.prototype,"_sources",null),e([n({readOnly:!0})],m.prototype,"activeOperation",void 0),e([n()],m.prototype,"layers",null),e([n()],m.prototype,"layerViewPreferenceEnabled",void 0),e([n()],m.prototype,"sources",void 0),e([n({readOnly:!0})],m.prototype,"state",null),e([n()],m.prototype,"view",void 0),m=e([c("esri.widgets.support.SelectionToolbar.SelectionToolbarViewModel")],m);const v=m;export{v as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import{createTask as o}from"../../../core/asyncUtils.js";import t from"../../../core/Collection.js";import s from"../../../core/Evented.js";import{makeHandle as r}from"../../../core/handleUtils.js";import{debounce as i,ignoreAbortErrors as n,onAbort as c}from"../../../core/promiseUtils.js";import{createScreenPoint as l}from"../../../core/screenUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import{createTask as o}from"../../../core/asyncUtils.js";import t from"../../../core/Collection.js";import s from"../../../core/Evented.js";import{makeHandle as r}from"../../../core/handleUtils.js";import{debounce as i,ignoreAbortErrors as n,onAbort as c}from"../../../core/promiseUtils.js";import{createScreenPoint as l}from"../../../core/screenUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import d from"../../../geometry/Point.js";import m from"../../../geometry/Polygon.js";import{isClockwise as h}from"../../../geometry/support/coordsUtils.js";import{DrawScreenTool as u}from"../../../views/draw/DrawScreenTool.js";import{sketchKeys as y}from"../../../views/interactive/keybindings.js";import{getSelectionFromGeometry as g}from"./selectorUtils.js";const v=100;let f=class extends s.EventedAccessor{constructor(e){super(e),this._processTask=null,this.options=null,this.selection=new t,this.sources=null,this._process=i((async(e,t)=>{const{callback:s,selector:r,completed:i}=e,n=o((async e=>{const{options:o,selection:t,sources:n,view:c}=this,l=!n?.length&&!c?.selectionManager.sources.length;if(t.removeAll(),!l&&c){if(r&&null!=n){const s=await g({returnGeometry:o?.returnGeometry,selector:r,signal:e,sources:n,view:c});t.addMany(s),i&&!1!==o?.persistSelection&&c.selectionManager?.updateSelection({current:s,added:[],removed:[]})}s&&s()}}));return c(t,(()=>n.abort())),this._processTask=n,n.promise}),v)}initialize(){this._setup()}get processingFinalSelection(){return!(!this._processTask||!this._tool?.drawOperation.isCompleted)}cancel(){this.removeAllHandles(),this._processTask?.abort()}async _setup(){const{view:e}=this;if(await e.whenReady(),this.destroyed)return;const o=this.options,t=o?.createTool??"rectangle",s=o?.mode??("polygon"===t?"click":"hybrid"),i=Symbol();this._tool=new u({view:e,mode:s,geometryType:t}),o?.selectOnComplete||this.addHandles(this._tool.on(["cursor-update","vertex-add","vertex-remove"],(()=>n(this._process({selector:this._selectionArea})))),i),this.addHandles([e.on("key-down",(e=>{if(!e.repeat)switch(e.key){case y.constraint:this._tool.uniformSizeToggled=!0,e.stopPropagation();break;case y.center:this._tool.centeredToggled=!0,e.stopPropagation()}})),e.on("key-up",(e=>{switch(e.key){case y.constraint:this._tool.uniformSizeToggled=!1,e.stopPropagation();break;case y.center:this._tool.centeredToggled=!1,e.stopPropagation()}})),this._tool.on("complete",(async e=>{this.removeHandles(i);const o=()=>{this.removeAllHandles(),this.emit("complete",{aborted:e.aborted,selection:this.selection.toArray()})};e.aborted?(this.cancel(),this.selection.removeAll(),o()):(this._tool.cursor="progress",await this._process({selector:this._selectionArea,callback:o,completed:!0}))}))],i),this.addHandles(r((()=>e.tools.remove(this._tool)))),e.addAndActivateTool(this._tool)}get _selectionArea(){const e=l(),o=this._tool.coordinates,t=this.view.spatialReference,s=o=>{e.x=o[0],e.y=o[1];const t=this.view.toMap(e);return[t?.x??0,t?.y??0]};if(0===o.length)return;if(1===o.length||o.every((([e,t])=>e===o[0][0]&&t===o[0][1]))){const[e,r]=s(o[0]);return new d({x:e,y:r,spatialReference:t})}const r=o.map(s);if(0===r.length)return;h(r)||r.reverse();return new m({spatialReference:t,rings:[r]})}};e([a()],f.prototype,"_processTask",void 0),e([a()],f.prototype,"options",void 0),e([a()],f.prototype,"processingFinalSelection",null),e([a({readOnly:!0})],f.prototype,"selection",void 0),e([a()],f.prototype,"sources",void 0),e([a({constructOnly:!0})],f.prototype,"view",void 0),f=e([p("esri.widgets.support.Selector2D.SelectionOperation")],f);const _=f;export{_ as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{addMany as e}from"../../../core/arrayUtils.js";import{
|
|
5
|
+
import{addMany as e}from"../../../core/arrayUtils.js";import{ignoreAbortErrors as r,whenOrAbort as t}from"../../../core/promiseUtils.js";import{getDisplayFieldName as s}from"../../../layers/support/fieldUtils.js";import{isFeatureLayer as a,isSubtypeGroupLayer as i,isSubtypeSublayer as l,isKnowledgeGraphLayer as n,isLinkChartLayer as o,isMapNotesLayer as c,isGraphicsLayer as u}from"../../../layers/support/layerUtils.js";import{calculateTolerance as d}from"../../../renderers/support/clickToleranceUtils.js";import{createQueryGeometry as y}from"../../../views/support/drapedUtils.js";import{isSelectableLayerView2D as p}from"../../../views/support/layerViewUtils.js";async function m(e){const{returnGeometry:s,selector:a,signal:i,sources:l,view:n}=e;if(!l?.length)return[];const{layers:o,layerViews:c,graphicsLayers:u}=f(l),d=[];return await r(t(Promise.all([h({candidates:d,layers:o,returnGeometry:s,selector:a,signal:i,view:n}),g({candidates:d,layerViews:c,returnGeometry:s,selector:a,signal:i,view:n}),v({candidates:d,graphicsLayers:u,selector:a,view:n})]),i)),d}function f(e){const r=[],t=[],s=[];return e.forEach((e=>{a(e)||i(e)||l(e)?r.push(e):(n(e)||o(e))&&e.layers?.length?r.push(...e.layers.toArray()):c(e)&&e.sublayers?.length?s.push(...e.sublayers.toArray()):u(e)?s.push(e):p(e)&&t.push(e)})),{layers:r,layerViews:t,graphicsLayers:s}}async function g(r){const{candidates:s,layerViews:a,returnGeometry:i,selector:l,signal:n,view:o}=r;await t(Promise.allSettled(a.map((async r=>{const t=b(r,l,o,i),a=await r.queryFeatures(t,{signal:n});e(s,a.features)}))),n)}async function h(r){const{candidates:s,layers:a,returnGeometry:i,selector:l,signal:n,view:o}=r;await t(Promise.allSettled(a.map((async r=>{const t=j(r,l,o,i),a=await r.queryFeatures(t,{signal:n});e(s,a.features)}))),n)}function w(e,r,t){return"point"===e.type?y(e,"renderer"in r?d({renderer:r.renderer}):0,t):e}function F(e,r){const{fields:t,fieldsIndex:a}=e,i=new Set([e.objectIdField]);"globalIdField"in e&&null!=e.globalIdField&&a.has(e.globalIdField)&&i.add(a.get(e.globalIdField).name);const l="displayField"in e?e.displayField:null,n=s({displayField:l,fields:t});if(null!=n&&a.has(n)&&i.add(n),"subtypeField"in e&&null!=e.subtypeField){const t=a.get(e.subtypeField)?.name;if(null!=t&&i.add(t),"utilityNetworks"in r.map&&r.map.utilityNetworks?.length){const e=a.get("assetgroup");e?.name&&i.add(e.name);const r=a.get("assettype");r?.name&&i.add(r.name)}}return r.requiredFieldsOptions.featureTitleFields&&"featureTitleFields"in e&&e.featureTitleFields&&e.featureTitleFields.forEach((e=>i.add(e))),Array.from(i.values())}function b(e,r,t,s=!0){const a=e.createQuery();return a.outFields=["*"],a.geometry=w(r,e.layer,t),a.returnGeometry=s,a.outSpatialReference=t.spatialReference,a}function j(e,r,t,s=!0){const a=e.createQuery();return a.outFields=F(e,t),a.geometry=w(r,e,t),a.returnGeometry=s,a.outSpatialReference=t.spatialReference,a}async function v(e){const{candidates:r,graphicsLayers:t,selector:s}=e,a=t.flatMap((e=>e.graphics.toArray()))??[];if(!a?.length||!s)return;const i=await import("../../../geometry/operators/intersectsOperator.js");i.accelerateGeometry(s),a.forEach((e=>{e.geometry&&"mesh"!==e.geometry.type&&i.execute(s,e.geometry)&&r.push(e)}))}export{g as collectSelectionFromFeatureLayerViews,h as collectSelectionFromFeatureLayers,v as collectSelectionFromGraphicsLayers,m as getSelectionFromGeometry,w as getSuggestedQueryGeometry};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[13],{1626:(e,t,i)=>{i.d(t,{A:()=>c});var s,l=i(90237),r=i(4718),n=i(10107),o=(i(44208),i(53966),i(40608)),a=i(2485),u=i(72606);let p=s=class extends u.A{constructor(e){super(e),this.colorRamps=null,this.type="multipart"}clone(){return new s({colorRamps:(0,r.o8)(this.colorRamps)})}};(0,l._)([(0,n.MZ)({type:[a.A],json:{write:!0}})],p.prototype,"colorRamps",void 0),(0,l._)([(0,n.MZ)({type:["multipart"]})],p.prototype,"type",void 0),p=s=(0,l._)([(0,o.$)("esri.rest.support.MultipartColorRamp")],p);const c=p},2024:(e,t,i)=>{i.d(t,{A:()=>p});var s,l=i(90237),r=i(10107),n=(i(44208),i(53966),i(87811),i(40608)),o=i(2795),a=i(72500);let u=s=class extends o.A{constructor(e){super(e),this.type="color",this.normalizationField=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null}}set stops(e){e&&Array.isArray(e)&&(e=e.filter((e=>!!e))).sort(((e,t)=>e.value-t.value)),this._set("stops",e)}clone(){return new s({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map((e=>e.clone())),legendOptions:this.legendOptions?.clone()})}getAttributeHash(){return`${super.getAttributeHash()}-${this.normalizationField}`}_interpolateData(){return this.stops&&this.stops.map((e=>e.value||0))}};(0,l._)([(0,r.MZ)({readOnly:!0})],u.prototype,"cache",null),(0,l._)([(0,r.MZ)({type:["color"],json:{type:["colorInfo"]}})],u.prototype,"type",void 0),(0,l._)([(0,r.MZ)({type:String,json:{write:!0}})],u.prototype,"normalizationField",void 0),(0,l._)([(0,r.MZ)({type:[a.A],json:{write:!0}})],u.prototype,"stops",null),u=s=(0,l._)([(0,n.$)("esri.renderers.visualVariables.ColorVariable")],u);const p=u},2485:(e,t,i)=>{i.d(t,{A:()=>h});var s,l=i(90237),r=i(68197),n=i(4718),o=i(10107),a=i(56507),u=i(93223),p=i(40608),c=i(72606);let d=s=class extends c.A{constructor(e){super(e),this.algorithm=null,this.fromColor=null,this.toColor=null,this.type="algorithmic"}clone(){return new s({fromColor:(0,n.o8)(this.fromColor),toColor:(0,n.o8)(this.toColor),algorithm:this.algorithm})}};(0,l._)([(0,u.e)({esriCIELabAlgorithm:"cie-lab",esriHSVAlgorithm:"hsv",esriLabLChAlgorithm:"lab-lch"})],d.prototype,"algorithm",void 0),(0,l._)([(0,o.MZ)({type:r.A,json:{type:[a.jz],write:!0}})],d.prototype,"fromColor",void 0),(0,l._)([(0,o.MZ)({type:r.A,json:{type:[a.jz],write:!0}})],d.prototype,"toColor",void 0),(0,l._)([(0,o.MZ)({type:["algorithmic"]})],d.prototype,"type",void 0),d=s=(0,l._)([(0,p.$)("esri.rest.support.AlgorithmicColorRamp")],d);const h=d},2795:(e,t,i)=>{i.d(t,{A:()=>y});var s=i(90237),l=i(66552),r=i(25482),n=i(53966),o=i(10107),a=i(79901),u=i(40608),p=i(56507),c=i(41078);const d=new l.J({colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation",sizeInfo:"size"});let h=class extends r.A{constructor(e){super(e),this.index=null,this.type=null,this.field=null,this.valueExpression=null,this.valueExpressionTitle=null,this.legendOptions=null}castField(e){return null==e?e:"function"==typeof e?(n.A.getLogger(this).error(".field: field must be a string value"),null):(0,p.GX)(e)}get arcadeRequired(){return!!this.valueExpression}clone(){}getAttributeHash(){return`${this.type}-${this.field}-${this.valueExpression}`}};(0,s._)([(0,o.MZ)()],h.prototype,"index",void 0),(0,s._)([(0,o.MZ)({type:d.apiValues,readOnly:!0,json:{read:d.read,write:{writer:d.write,isRequired:!0}}})],h.prototype,"type",void 0),(0,s._)([(0,o.MZ)({type:String,json:{write:!0}})],h.prototype,"field",void 0),(0,s._)([(0,a.w)("field")],h.prototype,"castField",null),(0,s._)([(0,o.MZ)({type:String,json:{write:!0}})],h.prototype,"valueExpression",void 0),(0,s._)([(0,o.MZ)({type:String,json:{write:!0}})],h.prototype,"valueExpressionTitle",void 0),(0,s._)([(0,o.MZ)({readOnly:!0})],h.prototype,"arcadeRequired",null),(0,s._)([(0,o.MZ)({type:c.A,json:{write:!0}})],h.prototype,"legendOptions",void 0),h=(0,s._)([(0,u.$)("esri.renderers.visualVariables.VisualVariable")],h);const y=h},12330:(e,t,i)=>{i.d(t,{A:()=>p});var s,l=i(90237),r=i(25482),n=i(90629),o=i(10107),a=(i(44208),i(53966),i(87811),i(40608));let u=s=class extends r.A{constructor(e){super(e),this.label=null,this.size=null,this.value=null,this.useMinValue=null,this.useMaxValue=null}clone(){return new s({label:this.label,size:this.size,value:this.value,useMaxValue:this.useMaxValue,useMinValue:this.useMinValue})}};(0,l._)([(0,o.MZ)({type:String,json:{write:!0}})],u.prototype,"label",void 0),(0,l._)([(0,o.MZ)({type:Number,cast:n.cr,json:{write:{isRequired:!0}}})],u.prototype,"size",void 0),(0,l._)([(0,o.MZ)({type:Number,json:{write:{isRequired:!0}}})],u.prototype,"value",void 0),(0,l._)([(0,o.MZ)({type:Boolean,json:{write:!1}})],u.prototype,"useMinValue",void 0),(0,l._)([(0,o.MZ)({type:Boolean,json:{write:!1}})],u.prototype,"useMaxValue",void 0),u=s=(0,l._)([(0,a.$)("esri.renderers.visualVariables.support.SizeStop")],u);const p=u},20061:(e,t,i)=>{i.d(t,{A:()=>y});var s,l=i(90237),r=i(69540),n=i(66552),o=i(25482),a=i(10107),u=i(56507),p=(i(44208),i(87811),i(93223)),c=i(40608);const d=(0,n.O)()({ascendingValues:"ascending-values",descendingValues:"descending-values"});let h=s=class extends(r.A.ClonableMixin(o.A)){static from(e){return(0,u.PZ)(s,e)}constructor(e){super(e),this.title=null,this.order=null}};(0,l._)([(0,a.MZ)({type:String,json:{write:!0}})],h.prototype,"title",void 0),(0,l._)([(0,p.e)(d)],h.prototype,"order",void 0),h=s=(0,l._)([(0,c.$)("esri.renderers.support.RendererLegendOptions")],h);const y=h},23461:(e,t,i)=>{i.d(t,{A:()=>u});var s,l=i(90237),r=i(10107),n=(i(44208),i(53966),i(87811),i(40608)),o=i(2795);let a=s=class extends o.A{constructor(e){super(e),this.axis=null,this.type="rotation",this.rotationType="geographic"}get cache(){return{hasExpression:!!this.valueExpression,compiledFunc:null}}clone(){return new s({axis:this.axis,rotationType:this.rotationType,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,legendOptions:this.legendOptions?.clone()})}};(0,l._)([(0,r.MZ)({readOnly:!0})],a.prototype,"cache",null),(0,l._)([(0,r.MZ)({type:["heading","tilt","roll"],json:{origins:{"web-scene":{default:"heading",write:!0}}}})],a.prototype,"axis",void 0),(0,l._)([(0,r.MZ)({type:["rotation"],json:{type:["rotationInfo"]}})],a.prototype,"type",void 0),(0,l._)([(0,r.MZ)({type:["geographic","arithmetic"],json:{write:!0,origins:{"web-document":{write:!0,default:"geographic"}}}})],a.prototype,"rotationType",void 0),a=s=(0,l._)([(0,n.$)("esri.renderers.visualVariables.RotationVariable")],a);const u=a},29266:(e,t,i)=>{i.d(t,{RV:()=>d,UT:()=>h,Yz:()=>v}),i(68197);var s=i(52106),l=i(21818),r=i(53966),n=i(31756),o=i(98205);const a=()=>r.A.getLogger("esri.renderers.visualVariables.support.visualVariableUtils"),u=e=>a().warn(`The visualVariable should be an instance of esri.renderers.visualVariables.${e}`),p=()=>a().error("Use of arcade expressions requires an arcade context"),c=(new s.A,Math.PI),d=/^\s*(return\s+)?\$view\.scale\s*(;)?\s*$/i;function h(e,t,i){const s="visualVariables"in e&&e.visualVariables?e.visualVariables.find((e=>"rotation"===e.type)):e;if(!s)return;if("esri.renderers.visualVariables.RotationVariable"!==s.declaredClass)return void u("RotationVariable");const l=s.axis||"heading",r="heading"===l&&"arithmetic"===s.rotationType?90:0,n="heading"===l&&"arithmetic"===s.rotationType?-1:1,o="number"==typeof t?null:t,a=o?.attributes,c=s.field,{hasExpression:d}=s.cache;let h=s.cache.compiledFunc,y=null;if(!c&&!d)return y;if(d){if(null==i?.arcade)return void p();const e={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},t=i.arcade.arcadeUtils,l=t.getViewInfo(e),r=t.createExecContext(o,l,i.timeZone);if(!h){const e=t.createSyntaxTree(s.valueExpression);h=t.createFunction(e),s.cache.compiledFunc=h}y=t.executeFunction(h,r)}else a&&(y=a[c]);return y="number"!=typeof y||isNaN(y)?null:r+n*y,y}function y(e,t,i){const s="visualVariables"in e&&e.visualVariables?e.visualVariables.find((e=>"size"===e.type)):e;if(!s)return;if("esri.renderers.visualVariables.SizeVariable"!==s.declaredClass)return void u("SizeVariable");const l=function(e,t,i,s,l){switch(t.transformationType){case o._w.Additive:return function(e,t,i,s){const l=f(t.minSize,i,s)||t.minDataValue;return null==e&&null==l?null:(e??0)+(l??0)}(e,t,i,s);case o._w.Constant:return function(e,t,i){const s=e.stops;let l=s?.length&&s[0].size;return null==l&&(l=e.minSize),f(l,t,i)}(t,i,s);case o._w.ClampedLinear:return function(e,t,i,s){const l=f(t.minSize,i,s);if(null==e)return l;const{minDataValue:r,maxDataValue:n}=t;if(null==r||null==n)return null;const o=(e-r)/(n-r),a=f(t.maxSize,i,s),u=null!=s?s.shape:void 0;if(e<=r)return l;if(e>=n)return a;if(null==l||null==a)return null;if("area"===t.scaleBy&&u){const e="circle"===u,t=e?c*(l/2)**2:l*l,i=t+o*((e?c*(a/2)**2:a*a)-t);return e?2*Math.sqrt(i/c):Math.sqrt(i)}return l+o*(a-l)}(e,t,i,s);case o._w.Proportional:return function(e,t,i,s){const l=f(t.minSize,i,s);if(null==e||null==l)return l;const r=null!=s?s.shape:void 0,{minDataValue:n}=t;if(null==n)return null;const o=e/n,a=f(t.maxSize,i,s);let u=null;return u="circle"===r?2*Math.sqrt(o*(l/2)**2):"square"===r||"diamond"===r||"image"===r?Math.sqrt(o*l**2):o*l,m(u,l,a)}(e,t,i,s);case o._w.Stops:return function(e,t,i,s,l){if(null==e)return null;const[r,n,o]=function(e,t){if(!t)return;let i=0,s=t.length-1;return t.some(((t,l)=>e<t?(s=l,!0):(i=l,!1))),[i,s,(e-t[i])/(t[s]-t[i])]}(e,l);if(r===n)return f(t.stops?.[r].size,i,s);{const e=f(t.stops?.[r].size,i,s),l=f(t.stops?.[n].size,i,s);return null==e||null==l?null:e+(l-e)*o}}(e,t,i,s,l);case o._w.RealWorldSize:return function(e,t,i,s){const l=(s?.resolution??1)*n.j[t.valueUnit],r=f(t.minSize,i,s),o=f(t.maxSize,i,s),{valueRepresentation:a}=t;if(null==e)return r;let u=null;return u="area"===a?2*Math.sqrt(e/c)/l:"radius"===a||"distance"===a?2*e/l:e/l,m(u,r,o)}(e,t,i,s);case o._w.Identity:return e;case o._w.Unknown:return null}}(function(e,t,i){const s="number"==typeof t,l=s?null:t,r=l?.attributes;let n=s?t:null;const{isScaleDriven:a}=e.cache;let u=e.cache.compiledFunc;if(a){const t=null!=i?i.scale:void 0,s=null!=i?i.view:void 0;n=null==t||"3d"===s?function(e){let t=null,i=null;const s=e.stops;return s?(t=s[0].value,i=s[s.length-1].value):(t=e.minDataValue||0,i=e.maxDataValue||0),(t+i)/2}(e):t}else if(!s)switch(e.inputValueType){case o.Yf.Expression:{if(null==i?.arcade)return void p();const t={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},s=i.arcade.arcadeUtils,r=s.getViewInfo(t),o=s.createExecContext(l,r,i.timeZone);if(!u){const t=s.createSyntaxTree(e.valueExpression);u=s.createFunction(t),e.cache.compiledFunc=u}n=s.executeFunction(u,o);break}case o.Yf.Field:r&&(n=r[e.field]);break;case o.Yf.Unknown:n=null}if(!(0,o.gf)(n))return null;if(s||!e.normalizationField)return n;const c=r?parseFloat(r[e.normalizationField]):null;return(0,o.gf)(c)&&0!==c?n/c:null}(s,t,i),s,t,i,s.cache.ipData);return null==l||isNaN(l)?void 0:l}function f(e,t,i){return null==e?null:(0,o.of)(e)?y(e,t,i):(0,o.gf)(e)?e:null}function m(e,t,i){return(0,o.gf)(i)&&e>i?i:(0,o.gf)(t)&&e<t?t:e}function v(e,t,i){const s=["proportional","proportional","proportional"];for(const r of e){const e=r.useSymbolValue?"symbol-value":y(r,t,i)??"proportional";switch(r.axis){case"width":s[0]=e;break;case"depth":s[1]=e;break;case"height":s[2]=e;break;case"width-and-depth":s[0]=e,s[1]=e;break;case"all":case void 0:case null:s[0]=e,s[1]=e,s[2]=e;break;default:(0,l.Xb)(r.axis)}}return s}},30943:(e,t,i)=>{i.d(t,{A:()=>C});var s,l=i(90237),r=i(66552),n=i(25482),o=i(4718),a=i(10107),u=i(56507),p=i(36005),c=i(40608);i(44208),i(53966),i(87811);let d=s=class extends n.A{constructor(e){super(e),this.minValue=0,this.maxValue=0}clone(){return new s({minValue:this.minValue,maxValue:this.maxValue})}};var h;(0,l._)([(0,a.MZ)({type:Number,json:{write:!0}})],d.prototype,"minValue",void 0),(0,l._)([(0,a.MZ)({type:Number,json:{write:!0}})],d.prototype,"maxValue",void 0),d=s=(0,l._)([(0,c.$)("esri.renderers.support.AuthoringInfoClassBreakInfo")],d);let y=h=class extends n.A{constructor(e){super(e),this.field="",this.normalizationField="",this.label="",this.classBreakInfos=new Array}clone(){return new h({field:this.field,normalizationField:this.normalizationField,label:this.label,classBreakInfos:(0,o.o8)(this.classBreakInfos)})}};(0,l._)([(0,a.MZ)({type:String,json:{write:!0}})],y.prototype,"field",void 0),(0,l._)([(0,a.MZ)({type:String,json:{write:!0}})],y.prototype,"normalizationField",void 0),(0,l._)([(0,a.MZ)({type:String,json:{write:!0}})],y.prototype,"label",void 0),(0,l._)([(0,a.MZ)({type:[d],json:{write:!0}})],y.prototype,"classBreakInfos",void 0),y=h=(0,l._)([(0,c.$)("esri.renderers.support.AuthoringInfoFieldInfo")],y);var f,m=i(79901);let v=f=class extends n.A{constructor(e){super(e),this.label=null,this.size=null,this.value=null}clone(){return new f({label:this.label,value:this.value,size:this.size})}};(0,l._)([(0,a.MZ)({type:String,json:{write:!0}})],v.prototype,"label",void 0),(0,l._)([(0,a.MZ)({type:Number,json:{write:!0}})],v.prototype,"size",void 0),(0,l._)([(0,a.MZ)({type:Number,json:{write:!0}})],v.prototype,"value",void 0),v=f=(0,l._)([(0,c.$)("esri.renderers.support.AuthoringInfoSizeStop")],v);const b=v;var g;const w=new r.J({percentTotal:"percent-of-total",ratio:"ratio",percent:"percent"}),_=new r.J({sizeInfo:"size",colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation"}),V={key:e=>"number"==typeof e?"number":"string",typeMap:{number:Number,string:String},base:null},S=["high-to-low","above-and-below","centered-on","extremes"],x=[...new Set(["high-to-low","above-and-below","centered-on","extremes","above","below","high-to-low","above-and-below","above","below","reference-size"])],M=["seconds","minutes","hours","days","months","years"];let z=g=class extends n.A{constructor(e){super(e),this.endTime=null,this.field=null,this.maxSliderValue=null,this.minSliderValue=null,this.startTime=null,this.type=null,this.units=null}castEndTime(e){return"string"==typeof e||"number"==typeof e?e:null}get normalizationField(){return"reference-size"===this.theme?this._get("normalizationField"):null}set normalizationField(e){this._set("normalizationField",e)}get referenceSizeScale(){return"reference-size"===this.theme?this._get("referenceSizeScale"):null}set referenceSizeScale(e){this._set("referenceSizeScale",e)}get referenceSizeSymbolStyle(){return"reference-size"===this.theme?this._get("referenceSizeSymbolStyle"):null}set referenceSizeSymbolStyle(e){this._set("referenceSizeSymbolStyle",e)}castStartTime(e){return"string"==typeof e||"number"==typeof e?e:null}get sizeStops(){return"reference-size"===this.theme?this._get("sizeStops"):null}set sizeStops(e){this._set("sizeStops",e)}get style(){return"color"===this.type?this._get("style"):null}set style(e){this._set("style",e)}get theme(){return"color"===this.type||"size"===this.type?this._get("theme")||"high-to-low":null}set theme(e){this._set("theme",e)}clone(){return new g({endTime:this.endTime,field:this.field,maxSliderValue:this.maxSliderValue,minSliderValue:this.minSliderValue,normalizationField:this.normalizationField,referenceSizeScale:this.referenceSizeScale,referenceSizeSymbolStyle:this.referenceSizeSymbolStyle,sizeStops:(0,o.o8)(this.sizeStops),startTime:this.startTime,style:this.style,theme:this.theme,type:this.type,units:this.units})}};(0,l._)([(0,a.MZ)({types:V,json:{write:!0}})],z.prototype,"endTime",void 0),(0,l._)([(0,m.w)("endTime")],z.prototype,"castEndTime",null),(0,l._)([(0,a.MZ)({type:String,json:{write:!0}})],z.prototype,"field",void 0),(0,l._)([(0,a.MZ)({type:Number,json:{write:!0}})],z.prototype,"maxSliderValue",void 0),(0,l._)([(0,a.MZ)({type:Number,json:{write:!0}})],z.prototype,"minSliderValue",void 0),(0,l._)([(0,a.MZ)({type:String,json:{origins:{"web-scene":{write:!1}},write:!0}})],z.prototype,"normalizationField",null),(0,l._)([(0,a.MZ)({type:Number,value:null,json:{origins:{"web-scene":{write:!1}},write:!0}})],z.prototype,"referenceSizeScale",null),(0,l._)([(0,a.MZ)({type:["circle","diamond","hexagon-flat","hexagon-pointy","square"],value:null,json:{origins:{"web-scene":{write:!1}},write:!0}})],z.prototype,"referenceSizeSymbolStyle",null),(0,l._)([(0,a.MZ)({types:V,json:{write:!0}})],z.prototype,"startTime",void 0),(0,l._)([(0,m.w)("startTime")],z.prototype,"castStartTime",null),(0,l._)([(0,a.MZ)({type:[b],json:{origins:{"web-scene":{write:!1}},write:!0}})],z.prototype,"sizeStops",null),(0,l._)([(0,a.MZ)({type:w.apiValues,value:null,json:{type:w.jsonValues,read:w.read,write:w.write}})],z.prototype,"style",null),(0,l._)([(0,a.MZ)({type:x,value:null,json:{type:x,origins:{"web-scene":{type:S,write:{writer:(e,t)=>{S.includes(e)&&(t.theme=e)}}}},write:!0}})],z.prototype,"theme",null),(0,l._)([(0,a.MZ)({type:_.apiValues,json:{type:_.jsonValues,read:_.read,write:_.write}})],z.prototype,"type",void 0),(0,l._)([(0,a.MZ)({type:M,json:{type:M,write:!0}})],z.prototype,"units",void 0),z=g=(0,l._)([(0,c.$)("esri.renderers.support.AuthoringInfoVisualVariable")],z);const I=z;var A,j=i(95349);const Z=new r.J({esriClassifyDefinedInterval:"defined-interval",esriClassifyEqualInterval:"equal-interval",esriClassifyManual:"manual",esriClassifyNaturalBreaks:"natural-breaks",esriClassifyQuantile:"quantile",esriClassifyStandardDeviation:"standard-deviation"}),F=new r.J({classedSize:"class-breaks-size",classedColor:"class-breaks-color",univariateColorSize:"univariate-color-size",relationship:"relationship",predominance:"predominance",dotDensity:"dot-density",flow:"flow"}),q=new r.J({classedSize:"class-breaks-size",classedColor:"class-breaks-color",univariateColorSize:"univariate-color-size",relationship:"relationship",predominance:"predominance",dotDensity:"dot-density"}),k=["inches","feet","yards","miles","nautical-miles","millimeters","centimeters","decimeters","meters","kilometers"];let E=A=class extends n.A{constructor(e){super(e),this.colorRamp=null,this.fadeRatio=null,this.isAutoGenerated=!1,this.lengthUnit=null,this.maxSliderValue=null,this.minSliderValue=null,this.visualVariables=null}get classificationMethod(){const e=this._get("classificationMethod"),t=this.type;return t&&"relationship"!==t?"class-breaks-size"===t||"class-breaks-color"===t?e||"manual":null:e}set classificationMethod(e){this._set("classificationMethod",e)}readColorRamp(e){return e?(0,j.r)(e):void 0}get fields(){return this.type&&"predominance"!==this.type?null:this._get("fields")}set fields(e){this._set("fields",e)}get field1(){return this.type&&"relationship"!==this.type?null:this._get("field1")}set field1(e){this._set("field1",e)}get field2(){return this.type&&"relationship"!==this.type?null:this._get("field2")}set field2(e){this._set("field2",e)}get flowTheme(){return"flow"===this.type?this._get("flowTheme"):null}set flowTheme(e){this._set("flowTheme",e)}get focus(){return this.type&&"relationship"!==this.type?null:this._get("focus")}set focus(e){this._set("focus",e)}get numClasses(){return this.type&&"relationship"!==this.type?null:this._get("numClasses")}set numClasses(e){this._set("numClasses",e)}get statistics(){return"univariate-color-size"===this.type&&"above-and-below"===this.univariateTheme?this._get("statistics"):null}set statistics(e){this._set("statistics",e)}get standardDeviationInterval(){const e=this.type;return e&&"relationship"!==e&&"class-breaks-size"!==e&&"class-breaks-color"!==e||this.classificationMethod&&"standard-deviation"!==this.classificationMethod?null:this._get("standardDeviationInterval")}set standardDeviationInterval(e){this._set("standardDeviationInterval",e)}get type(){return this._get("type")}set type(e){let t=e;"classed-size"===e?t="class-breaks-size":"classed-color"===e&&(t="class-breaks-color"),this._set("type",t)}get univariateSymbolStyle(){return"univariate-color-size"===this.type&&"above-and-below"===this.univariateTheme?this._get("univariateSymbolStyle"):null}set univariateSymbolStyle(e){this._set("univariateSymbolStyle",e)}get univariateTheme(){return"univariate-color-size"===this.type?this._get("univariateTheme"):null}set univariateTheme(e){this._set("univariateTheme",e)}clone(){return new A({classificationMethod:this.classificationMethod,colorRamp:(0,o.o8)(this.colorRamp),fadeRatio:(0,o.o8)(this.fadeRatio),fields:this.fields?.slice(),field1:(0,o.o8)(this.field1),field2:(0,o.o8)(this.field2),isAutoGenerated:this.isAutoGenerated,focus:this.focus,numClasses:this.numClasses,maxSliderValue:this.maxSliderValue,minSliderValue:this.minSliderValue,lengthUnit:this.lengthUnit,statistics:this.statistics,standardDeviationInterval:this.standardDeviationInterval,type:this.type,visualVariables:this.visualVariables&&this.visualVariables.map((e=>e.clone())),univariateSymbolStyle:this.univariateSymbolStyle,univariateTheme:this.univariateTheme,flowTheme:this.flowTheme})}};(0,l._)([(0,a.MZ)({type:Z.apiValues,value:null,json:{type:Z.jsonValues,read:Z.read,write:Z.write,origins:{"web-document":{default:"manual",type:Z.jsonValues,read:Z.read,write:Z.write}}}})],E.prototype,"classificationMethod",null),(0,l._)([(0,a.MZ)({types:j.g,json:{write:!0}})],E.prototype,"colorRamp",void 0),(0,l._)([(0,p.w)("colorRamp")],E.prototype,"readColorRamp",null),(0,l._)([(0,a.MZ)({json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],E.prototype,"fadeRatio",void 0),(0,l._)([(0,a.MZ)({type:[String],value:null,json:{write:!0}})],E.prototype,"fields",null),(0,l._)([(0,a.MZ)({type:y,value:null,json:{write:!0}})],E.prototype,"field1",null),(0,l._)([(0,a.MZ)({type:y,value:null,json:{write:!0}})],E.prototype,"field2",null),(0,l._)([(0,a.MZ)({type:["flow-line","wave-front"],value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],E.prototype,"flowTheme",null),(0,l._)([(0,a.MZ)({type:["HH","HL","LH","LL"],value:null,json:{write:!0}})],E.prototype,"focus",null),(0,l._)([(0,a.MZ)({type:Boolean,json:{write:!0,default:!1,origins:{"web-scene":{write:!1}}}})],E.prototype,"isAutoGenerated",void 0),(0,l._)([(0,a.MZ)({type:Number,value:null,json:{type:u.jz,write:!0}})],E.prototype,"numClasses",null),(0,l._)([(0,a.MZ)({type:k,json:{type:k,read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],E.prototype,"lengthUnit",void 0),(0,l._)([(0,a.MZ)({type:Number,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],E.prototype,"maxSliderValue",void 0),(0,l._)([(0,a.MZ)({type:Number,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],E.prototype,"minSliderValue",void 0),(0,l._)([(0,a.MZ)({type:Object,value:null,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],E.prototype,"statistics",null),(0,l._)([(0,a.MZ)({type:[.25,.33,.5,1],value:null,json:{type:[.25,.33,.5,1],write:!0}})],E.prototype,"standardDeviationInterval",null),(0,l._)([(0,a.MZ)({type:F.apiValues,value:null,json:{type:F.jsonValues,read:F.read,write:F.write,origins:{"web-scene":{type:q.jsonValues,write:{writer:q.write,overridePolicy:e=>({enabled:"flow"!==e})}}}}})],E.prototype,"type",null),(0,l._)([(0,a.MZ)({type:[I],json:{write:!0}})],E.prototype,"visualVariables",void 0),(0,l._)([(0,a.MZ)({type:["caret","circle-caret","arrow","circle-arrow","plus-minus","circle-plus-minus","square","circle","triangle","happy-sad","thumb","custom"],value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],E.prototype,"univariateSymbolStyle",null),(0,l._)([(0,a.MZ)({type:["high-to-low","above-and-below","above","below"],value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],E.prototype,"univariateTheme",null),E=A=(0,l._)([(0,c.$)("esri.renderers.support.AuthoringInfo")],E);const C=E},41078:(e,t,i)=>{i.d(t,{A:()=>u});var s=i(90237),l=i(69540),r=i(25482),n=i(10107),o=(i(44208),i(53966),i(87811),i(40608));let a=class extends(l.A.ClonableMixin(r.A)){constructor(){super(...arguments),this.showLegend=null,this.title=null}};(0,s._)([(0,n.MZ)({type:Boolean,json:{write:!0}})],a.prototype,"showLegend",void 0),(0,s._)([(0,n.MZ)({type:String,json:{write:!0}})],a.prototype,"title",void 0),a=(0,s._)([(0,o.$)("esri.renderers.visualVariables.support.VisualVariableLegendOptions")],a);const u=a},48940:(e,t,i)=>{i.d(t,{A:()=>z});var s=i(90237),l=i(49186),r=i(66552),n=i(53966),o=i(10107),a=i(79901),u=i(36005),p=i(40608),c=i(43937),d=i(2795),h=i(90629),y=i(12330),f=(i(44208),i(87811),i(41078));let m=class extends f.A{constructor(){super(...arguments),this.customValues=null}};(0,s._)([(0,o.MZ)({type:[Number],json:{write:!0}})],m.prototype,"customValues",void 0),m=(0,s._)([(0,p.$)("esri.renderers.visualVariables.support.SizeVariableLegendOptions")],m);const v=m;var b,g=i(98205),w=i(29266);const _=new r.J({width:"width",depth:"depth",height:"height",widthAndDepth:"width-and-depth",all:"all"}),V=new r.J({unknown:"unknown",inch:"inches",foot:"feet",yard:"yards",mile:"miles","nautical-mile":"nautical-miles",millimeter:"millimeters",centimeter:"centimeters",decimeter:"decimeters",meter:"meters",kilometer:"kilometers"});function S(e){if(null!=e)return"string"==typeof e||"number"==typeof e?function(e){return(0,h.cr)(e)}(e):"size"===e.type?(0,g.of)(e)?e:(delete(e={...e}).type,new M(e)):void 0}function x(e,t,i){if("object"!=typeof e)return e;const s=new M;return s.read(e,i),s}let M=b=class extends d.A{constructor(e){super(e),this.axis=null,this.legendOptions=null,this.normalizationField=null,this.scaleBy=null,this.target=null,this.type="size",this.useSymbolValue=null,this.valueExpression=null,this.valueRepresentation=null,this.valueUnit=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null,isScaleDriven:null!=this.valueExpression&&w.RV.test(this.valueExpression)}}set index(e){(0,g.of)(this.maxSize)&&(this.maxSize.index=`visualVariables[${e}].maxSize`),(0,g.of)(this.minSize)&&(this.minSize.index=`visualVariables[${e}].minSize`),this._set("index",e)}get inputValueType(){return(0,g.eh)(this)}set maxDataValue(e){e&&this.stops&&(n.A.getLogger(this).warn("cannot set maxDataValue when stops is not null."),e=null),this._set("maxDataValue",e)}set maxSize(e){e&&this.stops&&(n.A.getLogger(this).warn("cannot set maxSize when stops is not null."),e=null),this._set("maxSize",e)}castMaxSize(e){return S(e)}readMaxSize(e,t,i){return x(e,0,i)}set minDataValue(e){e&&this.stops&&(n.A.getLogger(this).warn("cannot set minDataValue when stops is not null."),e=null),this._set("minDataValue",e)}set minSize(e){e&&this.stops&&(n.A.getLogger(this).warn("cannot set minSize when stops is not null."),e=null),this._set("minSize",e)}castMinSize(e){return S(e)}readMinSize(e,t,i){return x(e,0,i)}get arcadeRequired(){return!!this.valueExpression||null!=this.minSize&&"object"==typeof this.minSize&&this.minSize.arcadeRequired||null!=this.maxSize&&"object"==typeof this.maxSize&&this.maxSize.arcadeRequired}set stops(e){null==this.minDataValue&&null==this.maxDataValue&&null==this.minSize&&null==this.maxSize?e&&Array.isArray(e)&&(e=e.filter((e=>!!e))).sort(((e,t)=>e.value-t.value)):e&&(n.A.getLogger(this).warn("cannot set stops when one of minDataValue, maxDataValue, minSize or maxSize is not null."),e=null),this._set("stops",e)}get transformationType(){return(0,g.KZ)(this,this.inputValueType)}readValueExpression(e,t){return e||t.expression&&"$view.scale"}writeValueExpressionWebScene(e,t,i,s){if("$view.scale"===e){if(s?.messages){const e=this.index,t="string"==typeof e?e:`visualVariables[${e}]`;s.messages.push(new l.A("property:unsupported",this.type+"VisualVariable.valueExpression = '$view.scale' is not supported in Web Scene. Please remove this property to save the Web Scene.",{instance:this,propertyName:t+".valueExpression",context:s}))}}else t[i]=e}readValueUnit(e){return e?V.read(e):null}clone(){return new b({axis:this.axis,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,maxDataValue:this.maxDataValue,maxSize:(0,g.of)(this.maxSize)?this.maxSize.clone():this.maxSize,minDataValue:this.minDataValue,minSize:(0,g.of)(this.minSize)?this.minSize.clone():this.minSize,normalizationField:this.normalizationField,stops:this.stops?.map((e=>e.clone())),target:this.target,useSymbolValue:this.useSymbolValue,valueRepresentation:this.valueRepresentation,valueUnit:this.valueUnit,legendOptions:this.legendOptions?.clone()})}flipSizes(){if(this.transformationType===g._w.ClampedLinear){const{minSize:e,maxSize:t}=this;return this.minSize=t,this.maxSize=e,this}if(this.transformationType===g._w.Stops){const e=this.stops;if(!e)return this;const t=e.map((e=>e.size)).reverse(),i=e.length;for(let s=0;s<i;s++)e[s].size=t[s];return this}return this}getAttributeHash(){return`${super.getAttributeHash()}-${this.target}-${this.normalizationField}`}_interpolateData(){return this.stops?.map((e=>e.value||0))}};(0,s._)([(0,o.MZ)({readOnly:!0})],M.prototype,"cache",null),(0,s._)([(0,o.MZ)({type:_.apiValues,json:{type:_.jsonValues,origins:{"web-map":{read:!1}},read:_.read,write:_.write}})],M.prototype,"axis",void 0),(0,s._)([(0,o.MZ)()],M.prototype,"index",null),(0,s._)([(0,o.MZ)({type:String,readOnly:!0})],M.prototype,"inputValueType",null),(0,s._)([(0,o.MZ)({type:v,json:{write:!0}})],M.prototype,"legendOptions",void 0),(0,s._)([(0,o.MZ)({type:Number,value:null,json:{write:!0}})],M.prototype,"maxDataValue",null),(0,s._)([(0,o.MZ)({type:Number,value:null,json:{write:!0}})],M.prototype,"maxSize",null),(0,s._)([(0,a.w)("maxSize")],M.prototype,"castMaxSize",null),(0,s._)([(0,u.w)("maxSize")],M.prototype,"readMaxSize",null),(0,s._)([(0,o.MZ)({type:Number,value:null,json:{write:!0}})],M.prototype,"minDataValue",null),(0,s._)([(0,o.MZ)({type:Number,value:null,json:{write:!0}})],M.prototype,"minSize",null),(0,s._)([(0,a.w)("minSize")],M.prototype,"castMinSize",null),(0,s._)([(0,u.w)("minSize")],M.prototype,"readMinSize",null),(0,s._)([(0,o.MZ)({type:String,json:{write:!0}})],M.prototype,"normalizationField",void 0),(0,s._)([(0,o.MZ)({readOnly:!0})],M.prototype,"arcadeRequired",null),(0,s._)([(0,o.MZ)({type:String})],M.prototype,"scaleBy",void 0),(0,s._)([(0,o.MZ)({type:[y.A],value:null,json:{write:!0}})],M.prototype,"stops",null),(0,s._)([(0,o.MZ)({type:["outline"],json:{write:!0}})],M.prototype,"target",void 0),(0,s._)([(0,o.MZ)({type:String,readOnly:!0})],M.prototype,"transformationType",null),(0,s._)([(0,o.MZ)({type:["size"],json:{type:["sizeInfo"]}})],M.prototype,"type",void 0),(0,s._)([(0,o.MZ)({type:Boolean,json:{write:!0,origins:{"web-map":{read:!1}}}})],M.prototype,"useSymbolValue",void 0),(0,s._)([(0,o.MZ)({type:String,json:{write:!0}})],M.prototype,"valueExpression",void 0),(0,s._)([(0,u.w)("valueExpression",["valueExpression","expression"])],M.prototype,"readValueExpression",null),(0,s._)([(0,c.K)("web-scene","valueExpression")],M.prototype,"writeValueExpressionWebScene",null),(0,s._)([(0,o.MZ)({type:["radius","diameter","area","width","distance"],json:{write:!0}})],M.prototype,"valueRepresentation",void 0),(0,s._)([(0,o.MZ)({type:V.apiValues,json:{write:V.write,origins:{"web-map":{read:!1},"web-scene":{write:!0},"portal-item":{write:!0}}}})],M.prototype,"valueUnit",void 0),(0,s._)([(0,u.w)("valueUnit")],M.prototype,"readValueUnit",null),M=b=(0,s._)([(0,p.$)("esri.renderers.visualVariables.SizeVariable")],M);const z=M},49849:(e,t,i)=>{i.d(t,{As:()=>c,Ug:()=>d,Wp:()=>p,z4:()=>u});var s=i(93637),l=i(90360),r=i(65365),n=i(20378),o=i(73838),a=i(33910);const u={types:a.xK,json:{write:{writer:o.M9},origins:{"web-scene":{types:a.On,write:{writer:o.M9},read:{reader:(0,l.C)({types:a.On})}}}}},p=(0,s.$N)({json:{origins:{"web-scene":{write:{isRequired:!0}}}}},u),c={types:{base:n.A,key:"type",typeMap:{"simple-fill":a.Es.typeMap["simple-fill"],"picture-fill":a.Es.typeMap["picture-fill"],"polygon-3d":a.Es.typeMap["polygon-3d"],cim:a.Es.typeMap.cim}},json:{write:{writer:o.M9},origins:{"web-scene":{type:r.A,write:{writer:o.M9}}}}},d={cast:e=>null==e||"string"==typeof e||"number"==typeof e?e:`${e}`,json:{type:String,write:{writer:(e,t)=>{t.value=e?.toString()}}}}},62724:(e,t,i)=>{i.d(t,{A:()=>v});var s,l=i(90237),r=i(10107),n=(i(44208),i(53966),i(87811),i(40608)),o=i(2795),a=i(25482),u=i(56507),p=i(36005),c=i(43937),d=i(78553);let h=s=class extends a.A{constructor(e){super(e),this.label=null,this.opacity=null,this.value=null}readOpacity(e,t){return(0,d.D)(t.transparency)}writeOpacity(e,t,i){t[i]=(0,d.p)(e)}clone(){return new s({label:this.label,opacity:this.opacity,value:this.value})}};(0,l._)([(0,r.MZ)({type:String,json:{write:!0}})],h.prototype,"label",void 0),(0,l._)([(0,r.MZ)({type:Number,json:{type:u.jz,write:{target:"transparency",isRequired:!0}}})],h.prototype,"opacity",void 0),(0,l._)([(0,p.w)("opacity",["transparency"])],h.prototype,"readOpacity",null),(0,l._)([(0,c.K)("opacity")],h.prototype,"writeOpacity",null),(0,l._)([(0,r.MZ)({type:Number,json:{write:{isRequired:!0}}})],h.prototype,"value",void 0),h=s=(0,l._)([(0,n.$)("esri.renderers.visualVariables.support.OpacityStop")],h);const y=h;var f;let m=f=class extends o.A{constructor(e){super(e),this.type="opacity",this.normalizationField=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null}}set stops(e){e&&Array.isArray(e)&&(e=e.filter((e=>!!e))).sort(((e,t)=>e.value-t.value)),this._set("stops",e)}clone(){return new f({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map((e=>e.clone())),legendOptions:this.legendOptions?.clone()})}getAttributeHash(){return`${super.getAttributeHash()}-${this.normalizationField}`}_interpolateData(){return this.stops&&this.stops.map((e=>e.value||0))}};(0,l._)([(0,r.MZ)({readOnly:!0})],m.prototype,"cache",null),(0,l._)([(0,r.MZ)({type:["opacity"],json:{type:["transparencyInfo"]}})],m.prototype,"type",void 0),(0,l._)([(0,r.MZ)({type:String,json:{write:!0}})],m.prototype,"normalizationField",void 0),(0,l._)([(0,r.MZ)({type:[y],json:{write:!0}})],m.prototype,"stops",null),m=f=(0,l._)([(0,n.$)("esri.renderers.visualVariables.OpacityVariable")],m);const v=m},63988:(e,t,i)=>{i.d(t,{h:()=>M});var s=i(90237),l=i(10107),r=(i(44208),i(53966)),n=(i(87811),i(36005)),o=i(40608),a=i(43937),u=i(30524),p=i(2024),c=i(62724),d=i(23461),h=i(48940),y=i(2795),f=i(69622),m=i(66552),v=i(67076);const b={color:p.A,size:h.A,opacity:c.A,rotation:d.A},g=new m.J({colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation",sizeInfo:"size"}),w=/^\[([^\]]+)\]$/i;let _=class extends f.A{constructor(){super(...arguments),this.colorVariables=null,this.opacityVariables=null,this.rotationVariables=null,this.sizeVariables=null}set visualVariables(e){if(this._resetVariables(),e=e?.filter((e=>!!e)),e?.length){for(const t of e)switch(t.type){case"color":this.colorVariables.push(t);break;case"opacity":this.opacityVariables.push(t);break;case"rotation":this.rotationVariables.push(t);break;case"size":this.sizeVariables.push(t)}this.sizeVariables.length&&this.sizeVariables.some((e=>!!e.target))&&e.sort(((e,t)=>{let i=null;return i=e.target===t.target?0:e.target?1:-1,i}));for(let t=0;t<e.length;t++)e[t].index=t;this._set("visualVariables",e)}else this._set("visualVariables",e)}readVariables(e,t,i){const{rotationExpression:s,rotationType:l}=t,n=s?.match(w),o=n?.[1];if(o&&(e||(e=[]),e.push({type:"rotationInfo",rotationType:l,field:o})),e)return e.map((e=>{const t=g.read(e.type),s=b[t];s||(r.A.getLogger(this).warn(`Unknown variable type: ${t}`),i?.messages&&i.messages.push(new v.A("visual-variable:unsupported",`visualVariable of type '${t}' is not supported`,{definition:e,context:i})));const l=new s;return l.read(e,i),l}))}writeVariables(e,t){const i=[];for(const s of e){const e=s.toJSON(t);e&&i.push(e)}return i}_resetVariables(){this.colorVariables=[],this.opacityVariables=[],this.rotationVariables=[],this.sizeVariables=[]}};(0,s._)([(0,l.MZ)()],_.prototype,"visualVariables",null),_=(0,s._)([(0,o.$)("esri.renderers.visualVariables.VisualVariableFactory")],_);const V=_;var S=i(69309);const x={base:y.A,key:"type",typeMap:{opacity:c.A,color:p.A,rotation:d.A,size:h.A}},M=e=>{let t=class extends e{constructor(){super(...arguments),this._vvFactory=new V}set visualVariables(e){this._vvFactory.visualVariables=e,this._set("visualVariables",this._vvFactory.visualVariables)}readVisualVariables(e,t,i){return this._vvFactory.readVariables(e,t,i)}writeVisualVariables(e,t,i,s){t[i]=this._vvFactory.writeVariables(e,s)}get arcadeRequiredForVisualVariables(){return this.visualVariables?.some((({arcadeRequired:e})=>e))??!1}hasVisualVariables(e,t){return e?this.getVisualVariablesForType(e,t).length>0:this.getVisualVariablesForType("size",t).length>0||this.getVisualVariablesForType("color",t).length>0||this.getVisualVariablesForType("opacity",t).length>0||this.getVisualVariablesForType("rotation",t).length>0}getVisualVariablesForType(e,t){return this.visualVariables?.filter((i=>i.type===e&&("string"==typeof t?i.target===t:!1!==t||!i.target)))??[]}async collectVVRequiredFields(e,t){let i=[];this.visualVariables&&(i=i.concat(this.visualVariables));for(const s of i)s&&(s.field&&(0,u.rq)(e,t,s.field),s.normalizationField&&(0,u.rq)(e,t,s.normalizationField),s.valueExpression&&(z(s.valueExpression,e,t)||await(0,u.Dx)(e,t,s.valueExpression)))}};return(0,s._)([(0,l.MZ)({types:[x],value:null,json:{write:!0}})],t.prototype,"visualVariables",null),(0,s._)([(0,n.w)("visualVariables",["visualVariables","rotationType","rotationExpression"])],t.prototype,"readVisualVariables",null),(0,s._)([(0,a.K)("visualVariables")],t.prototype,"writeVisualVariables",null),t=(0,s._)([(0,o.$)("esri.renderers.mixins.VisualVariablesMixin")],t),t};function z(e,t,i){const s=(0,S.D)(e);return null!=s&&((0,u.rq)(t,i,s),!0)}},72500:(e,t,i)=>{i.d(t,{A:()=>d});var s,l=i(90237),r=i(68197),n=i(25482),o=i(10107),a=i(56507),u=(i(44208),i(87811),i(40608)),p=i(43937);let c=s=class extends n.A{constructor(e){super(e),this.color=null,this.label=null,this.value=null}writeValue(e,t,i){t[i]=e??0}clone(){return new s({color:this.color&&this.color.clone(),label:this.label,value:this.value})}};(0,l._)([(0,o.MZ)({type:r.A,json:{type:[a.jz],write:{isRequired:!0}}})],c.prototype,"color",void 0),(0,l._)([(0,o.MZ)({type:String,json:{write:!0}})],c.prototype,"label",void 0),(0,l._)([(0,o.MZ)({type:Number,json:{write:{writerEnsuresNonNull:!0}}})],c.prototype,"value",void 0),(0,l._)([(0,p.K)("value")],c.prototype,"writeValue",null),c=s=(0,l._)([(0,u.$)("esri.renderers.visualVariables.support.ColorStop")],c);const d=c},72606:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(90237),l=i(25482),r=i(10107),n=(i(44208),i(53966),i(87811),i(40608));let o=class extends l.A{constructor(e){super(e),this.type=null}};(0,s._)([(0,r.MZ)({readOnly:!0,json:{read:!1,write:!0}})],o.prototype,"type",void 0),o=(0,s._)([(0,n.$)("esri.rest.support.ColorRamp")],o);const a=o},73838:(e,t,i)=>{i.d(t,{rS:()=>k,M9:()=>j,oO:()=>Z});var s=i(49186),l=i(77548),r=i(37757),n=i(13313),o=i(97887),a=i(68548),u=i(58592),p=i(75981),c=i(65365),d=i(94985),h=i(31593),y=i(53930),f=i(68249),m=i(68197),v=i(5503),b=(i(44208),i(90629)),g=i(27845),w=i(11506),_=i(39065),V=i(59868),S=i(93470);p.A.fromSimpleMarkerSymbol(V.UK),o.A.fromSimpleLineSymbol(V.A7),c.A.fromSimpleFillSymbol(V.Cx),new a.A({symbolLayers:new v.A([new g.A({material:{color:S.fT},edges:new _.A({size:(0,b.PN)(1),color:new m.A(S.JR)})})])});const x=new o.A({symbolLayers:new v.A([new w.A({material:{color:new m.A([0,0,0])},size:(0,b.PN)(1)})])}),M=new c.A({symbolLayers:new v.A([new g.A({outline:{color:new m.A([0,0,0]),size:(0,b.PN)(1)}})])});var z=i(33910);const I="#useCIMFallbackSymbology()",A={retainId:!1,ignoreDrivers:!1,hasLabelingContext:!0};function j(e,t,i,s){const l=q(e,{},{context:s,isLabelSymbol:!1});null!=l&&(t[i]=l)}function Z(e,t,i,s){const l=q(e,{},{context:s,isLabelSymbol:!0});null!=l&&(t[i]=l)}function F(e){return(0,z.wk)(e)||e instanceof r.A}function q(e,t,i){if(null==e)return null;const{context:m,isLabelSymbol:v}=i,b=m?.origin,g=m?.messages;if("web-scene"===b&&!F(e)){const i=function(e,t=A){if(!e)return{symbol:null};const{retainId:i=A.retainId,ignoreDrivers:l=A.ignoreDrivers,hasLabelingContext:m=A.hasLabelingContext,retainCIM:v=A.retainCIM,cimFallbackEnabled:b=A.cimFallbackEnabled}=t;let g=null;if((0,z.wk)(e)||e instanceof r.A)g=e.clone();else if("cim"===e.type){const i=e.data?.symbol?.type;switch(i){case"CIMPointSymbol":g=v?e.clone():p.A.fromCIMSymbol(e);break;case"CIMLineSymbol":b&&(g=x.clone(),t?.logWarning?.(I,"Unsupported CIM line symbology converted to fallback 3D line symbology"));break;case"CIMPolygonSymbol":b&&(g=M.clone(),t?.logWarning?.(I,"Unsupported CIM polygon symbology converted to fallback 3D polygon symbology"))}if(!g)return{error:new s.A("symbol-conversion:unsupported-cim-symbol",`CIM symbol of type '${i||"unknown"}' is unsupported in 3D`,{symbol:e})}}else if(e instanceof h.A)g=o.A.fromSimpleLineSymbol(e);else if(e instanceof y.A)g=p.A.fromSimpleMarkerSymbol(e);else if(e instanceof u.A)g=p.A.fromPictureMarkerSymbol(e);else if(e instanceof d.A)g=t.geometryType&&"mesh"===t.geometryType?a.A.fromSimpleFillSymbol(e):c.A.fromSimpleFillSymbol(e);else{if(!(e instanceof f.A))return{error:new s.A("symbol-conversion:unsupported-2d-symbol",`2D symbol of type '${e.type||e.declaredClass}' is unsupported in 3D`,{symbol:e})};g=m?n.A.fromTextSymbol(e):p.A.fromTextSymbol(e)}return i&&g&&"cim"!==g.type&&(g.id=e.id),!l||"cim"===g.type||g instanceof r.A||g.symbolLayers.forEach((e=>e.ignoreDrivers=!0)),{symbol:g}}(e,{retainCIM:!0,hasLabelingContext:v});return null!=i.symbol?i.symbol.write(t,m):(g?.push(new s.A("symbol:unsupported",`Symbols of type '${e.declaredClass}' are not supported in scenes. Use 3D symbology instead when working with WebScene and SceneView`,{symbol:e,context:m,error:i.error})),null)}return(0,l.TU)(m?.layer)&&(w=e,"polygon-3d"===w?.type||"line-3d"===w?.type)?(g?.push(new s.A("symbol:unsupported",`Symbols of type '${e.declaredClass}' are not supported on layers of type '${m?.layer?.declaredClass}'.`,{symbol:e,context:m})),null):("web-map"===b||"portal-item"===b&&!(0,l.TU)(m?.layer))&&F(e)?(g?.push(new s.A("symbol:unsupported",`Symbols of type '${e.declaredClass}' are not supported in web maps and portal items. Use 2D symbology and CIMSymbol instead when working with MapView`,{symbol:e,context:m})),null):e.write(t,m);var w}function k(e,t){return(0,z.Bu)(e,null,t)}},85594:(e,t,i)=>{i.d(t,{jg:()=>b,cF:()=>c,bo:()=>d,yA:()=>f,o5:()=>h});var s=i(78888),l=i(49186),r=i(44208),n=i(74887),o=i(84952),a=i(20655),u=i(16405);const p=new Map;function c(e,t,i){return null!=e?.styleUrl?async function(e,t){try{return{data:(await f(e,t)).data,baseUrl:(0,o.nM)(e),styleUrl:e}}catch(e){return(0,n.QP)(e),null}}(e.styleUrl,i):null!=e?.styleName?function(e,t,i){const s=null!=t.portal?t.portal:a.A.getDefault();let r;const n=`${s.url} - ${s.user?.username} - ${e}`,o=p.get(n);if(o)return o;const c=function(e,t,i){return t.load(i).then((()=>{const s=new u.A({disableExtraQuery:!0,query:`owner:${m} AND type:${v} AND typekeywords:"${e}"`});return t.queryItems(s,i)})).then((({results:t})=>{let s=null;const r=e.toLowerCase();if(t&&Array.isArray(t))for(const e of t){const t=e.typeKeywords?.some((e=>e.toLowerCase()===r));if(t&&e.type===v&&e.owner===m){s=e;break}}if(!s)throw new l.A("symbolstyleutils:style-not-found",`The style '${e}' could not be found`,{styleName:e});return s.load(i)}))}(e,s,i).then((e=>(r=e,e.fetchData()))).then((t=>({data:t,baseUrl:r.itemUrl??"",styleName:e})));return p.set(n,c),c}(e.styleName,t,i):Promise.reject(new l.A("symbolstyleutils:style-url-and-name-missing","Either styleUrl or styleName is required to resolve a style"))}function d(e){return null===e||"CIMSymbolReference"===e.type?e:{type:"CIMSymbolReference",symbol:e}}function h(e,t){for(const i of t)switch(i){case"cim":if(e.cimRef)return{format:i,url:encodeURI(e.cimRef)};break;case"web-gltf-basisu":{const t=y(e,"gltf_basisu");if(t)return{format:i,url:t};break}case"web-gltf":{const t=y(e,"gltf");if(t)return{format:i,url:t};break}case"web":{const t=y(e,"gltf");if(t)return{format:"web-gltf",url:t};if(e.webRef)return{format:i,url:encodeURI(e.webRef)};break}}}function y(e,t){if(!(0,r.A)("enable-feature:force-wosr"))return e.formatInfos?.find((e=>e.type===t))?.href}function f(e,t){const i={responseType:"json",query:{f:"json"},...t};return(0,s.A)((0,o.S8)(e),i)}const m="esri_en",v="Style",b="https://cdn.arcgis.com/sharing/rest/content/items/220936cc6ed342c9937abd8f180e7d1e/resources/styles/cim/{SymbolName}.json?f=json"},86162:(e,t,i)=>{i.d(t,{A:()=>A});var s,l=i(90237),r=i(66552),n=i(4718),o=i(53966),a=i(10107),u=i(79901),p=i(93223),c=i(36005),d=i(40608),h=i(43937),y=i(56507),f=i(30524),m=i(92438),v=i(63988),b=i(88542),g=i(49849),w=i(20061),_=i(43668),V=i(33910);const S="percent-of-total",x="field",M=new r.J({esriNormalizeByLog:"log",esriNormalizeByPercentOfTotal:S,esriNormalizeByField:x}),z=(0,y.dp)(b.A);let I=s=class extends((0,v.h)(m.A)){constructor(e){super(e),this._compiledValueExpression={valueExpression:null,compiledFunction:null},this.backgroundFillSymbol=null,this.classBreakInfos=null,this.defaultLabel=null,this.defaultSymbol=null,this.field=null,this.isMaxInclusive=!0,this.legendOptions=null,this.normalizationField=null,this.normalizationTotal=null,this.type="class-breaks",this.valueExpression=null,this.valueExpressionTitle=null,this._set("classBreakInfos",[])}readClassBreakInfos(e,t,i){if(!Array.isArray(e))return;let s=t.minValue;return e.map((e=>{const t=new b.A;return t.read(e,i),null==t.minValue&&(t.minValue=s),null==t.maxValue&&(t.maxValue=t.minValue),s=t.maxValue,t}))}writeClassBreakInfos(e,t,i,s){const l=e.map((e=>e.write({},s)));this._areClassBreaksConsecutive()&&l.forEach((e=>delete e.classMinValue)),t[i]=l}castField(e){return null==e?e:"function"==typeof e?(o.A.getLogger(this).error(".field: field must be a string value"),null):(0,y.GX)(e)}get minValue(){return this.classBreakInfos&&this.classBreakInfos[0]&&this.classBreakInfos[0].minValue||0}get normalizationType(){let e=this._get("normalizationType");const t=!!this.normalizationField,i=null!=this.normalizationTotal;return t||i?(e=t&&x||i&&S||null,t&&i&&o.A.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):e!==x&&e!==S||(e=null),e}set normalizationType(e){this._set("normalizationType",e)}addClassBreakInfo(e,t,i){let s=null;s="number"==typeof e?new b.A({minValue:e,maxValue:t,symbol:(0,V.dp)(i)}):z((0,n.o8)(e)),this.classBreakInfos.push(s),1===this.classBreakInfos.length&&this.notifyChange("minValue")}removeClassBreakInfo(e,t){const i=this.classBreakInfos.length;for(let s=0;s<i;s++){const i=[this.classBreakInfos[s].minValue,this.classBreakInfos[s].maxValue];if(i[0]===e&&i[1]===t){this.classBreakInfos.splice(s,1);break}}}getBreakIndex(e,t){return this.valueExpression&&null==t?.arcade&&o.A.getLogger(this).warn(""),this.valueExpression?this._getBreakIndexForExpression(e,t):this._getBreakIndexForField(e)}async getClassBreakInfo(e,t){let i=t;this.valueExpression&&null==t?.arcade&&(i={...i,arcade:await(0,_.l)()});const s=this.getBreakIndex(e,i);return-1!==s?this.classBreakInfos[s]:null}getSymbol(e,t){if(this.valueExpression&&null==t?.arcade)return void o.A.getLogger(this).error("#getSymbol()","Please use getSymbolAsync if valueExpression is used");const i=this.getBreakIndex(e,t);return i>-1?this.classBreakInfos[i].symbol:this.defaultSymbol}async getSymbolAsync(e,t){let i=t;if(this.valueExpression&&null==t?.arcade){const e=await(0,_.l)(),{arcadeUtils:t}=e;t.hasGeometryOperations(this.valueExpression)&&await t.enableGeometryOperations(),i={...i,arcade:e}}const s=this.getBreakIndex(e,i);return s>-1?this.classBreakInfos[s].symbol:this.defaultSymbol}get symbols(){const e=[];return this.classBreakInfos.forEach((t=>{t.symbol&&e.push(t.symbol)})),this.defaultSymbol&&e.push(this.defaultSymbol),e}getAttributeHash(){return this.visualVariables?.reduce(((e,t)=>e+t.getAttributeHash()),"")??""}getMeshHash(){const e=JSON.stringify(this.backgroundFillSymbol),t=JSON.stringify(this.defaultSymbol),i=`${this.normalizationField}.${this.normalizationType}.${this.normalizationTotal}`;return`${e}.${t}.${this.classBreakInfos.reduce(((e,t)=>e+t.getMeshHash()),"")}.${i}.${this.field}.${this.valueExpression}`}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}clone(){return new s({field:this.field,backgroundFillSymbol:this.backgroundFillSymbol?.clone(),defaultLabel:this.defaultLabel,defaultSymbol:this.defaultSymbol?.clone(),valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,classBreakInfos:(0,n.o8)(this.classBreakInfos),isMaxInclusive:this.isMaxInclusive,normalizationField:this.normalizationField,normalizationTotal:this.normalizationTotal,normalizationType:this.normalizationType,visualVariables:(0,n.o8)(this.visualVariables),legendOptions:(0,n.o8)(this.legendOptions),authoringInfo:(0,n.o8)(this.authoringInfo)})}async collectRequiredFields(e,t){const i=[this.collectVVRequiredFields(e,t),this.collectSymbolFields(e,t)];await Promise.all(i)}async collectSymbolFields(e,t){const i=[...this.symbols.map((i=>i.collectRequiredFields(e,t))),(0,f.Dx)(e,t,this.valueExpression)];(0,f.rq)(e,t,this.field),(0,f.rq)(e,t,this.normalizationField),await Promise.all(i)}_getBreakIndexForExpression(e,t){const{viewingMode:i,scale:s,spatialReference:l,arcade:r,timeZone:n}=t??{},{valueExpression:o}=this;let a=this._compiledValueExpression.valueExpression===o?this._compiledValueExpression.compiledFunction:null;const u=r.arcadeUtils;if(!a){const e=u.createSyntaxTree(o);a=u.createFunction(e),this._compiledValueExpression.compiledFunction=a}this._compiledValueExpression.valueExpression=o;const p=u.executeFunction(a,u.createExecContext(e,u.getViewInfo({viewingMode:i,scale:s,spatialReference:l}),n));return this._getBreakIndexfromInfos(p)}_getBreakIndexForField(e){const t=this.field,i=e.attributes,s=this.normalizationType;let l=parseFloat(i[t]);if(s){const e=this.normalizationTotal,t=parseFloat(this.normalizationField?i[this.normalizationField]:void 0);if("log"===s)l=Math.log(l)*Math.LOG10E;else if(s!==S||null==e||isNaN(e)){if(s===x&&!isNaN(t)){if(isNaN(l)||isNaN(t))return-1;l/=t}}else l=l/e*100}return this._getBreakIndexfromInfos(l)}_getBreakIndexfromInfos(e){const t=this.isMaxInclusive;if(null!=e&&"number"==typeof e&&!isNaN(e))for(let i=0;i<this.classBreakInfos.length;i++){const s=[this.classBreakInfos[i].minValue,this.classBreakInfos[i].maxValue];if(s[0]<=e&&(t?e<=s[1]:e<s[1]))return i}return-1}_areClassBreaksConsecutive(){const e=this.classBreakInfos,t=e.length;for(let i=1;i<t;i++)if(e[i-1].maxValue!==e[i].minValue)return!1;return!0}};(0,l._)([(0,a.MZ)(g.As)],I.prototype,"backgroundFillSymbol",void 0),(0,l._)([(0,a.MZ)({type:[b.A],json:{write:{isRequired:!0}}})],I.prototype,"classBreakInfos",void 0),(0,l._)([(0,c.w)("classBreakInfos")],I.prototype,"readClassBreakInfos",null),(0,l._)([(0,h.K)("classBreakInfos")],I.prototype,"writeClassBreakInfos",null),(0,l._)([(0,a.MZ)({type:String,json:{write:!0}})],I.prototype,"defaultLabel",void 0),(0,l._)([(0,a.MZ)(g.z4)],I.prototype,"defaultSymbol",void 0),(0,l._)([(0,a.MZ)({type:String,json:{write:!0}})],I.prototype,"field",void 0),(0,l._)([(0,u.w)("field")],I.prototype,"castField",null),(0,l._)([(0,a.MZ)({type:Boolean})],I.prototype,"isMaxInclusive",void 0),(0,l._)([(0,a.MZ)({type:w.A,json:{write:!0}})],I.prototype,"legendOptions",void 0),(0,l._)([(0,a.MZ)({type:Number,readOnly:!0,value:null,json:{read:!1,write:{overridePolicy(){return 0!==this.classBreakInfos.length&&this._areClassBreaksConsecutive()?{enabled:!0}:{enabled:!1}}}}})],I.prototype,"minValue",null),(0,l._)([(0,a.MZ)({type:String,json:{write:!0}})],I.prototype,"normalizationField",void 0),(0,l._)([(0,a.MZ)({type:Number,json:{write:!0}})],I.prototype,"normalizationTotal",void 0),(0,l._)([(0,a.MZ)({type:M.apiValues,value:null,json:{type:M.jsonValues,read:M.read,write:M.write}})],I.prototype,"normalizationType",null),(0,l._)([(0,p.e)({classBreaks:"class-breaks"})],I.prototype,"type",void 0),(0,l._)([(0,a.MZ)({type:String,json:{write:!0}})],I.prototype,"valueExpression",void 0),(0,l._)([(0,a.MZ)({type:String,json:{write:!0}})],I.prototype,"valueExpressionTitle",void 0),I=s=(0,l._)([(0,d.$)("esri.renderers.ClassBreaksRenderer")],I);const A=I},88542:(e,t,i)=>{i.d(t,{A:()=>p});var s,l=i(90237),r=i(25482),n=i(10107),o=(i(44208),i(53966),i(87811),i(40608)),a=i(49849);let u=s=class extends r.A{constructor(e){super(e),this.description=null,this.label=null,this.minValue=null,this.maxValue=0,this.symbol=null}clone(){return new s({description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,symbol:this.symbol?.clone()??null})}getMeshHash(){const e=JSON.stringify(this.symbol);return`${this.minValue}.${this.maxValue}.${e}`}};(0,l._)([(0,n.MZ)({type:String,json:{write:!0}})],u.prototype,"description",void 0),(0,l._)([(0,n.MZ)({type:String,json:{write:!0}})],u.prototype,"label",void 0),(0,l._)([(0,n.MZ)({type:Number,json:{read:{source:"classMinValue"},write:{target:"classMinValue"}}})],u.prototype,"minValue",void 0),(0,l._)([(0,n.MZ)({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue"}}})],u.prototype,"maxValue",void 0),(0,l._)([(0,n.MZ)(a.Wp)],u.prototype,"symbol",void 0),u=s=(0,l._)([(0,o.$)("esri.renderers.support.ClassBreakInfo")],u);const p=u},92438:(e,t,i)=>{i.d(t,{A:()=>c});var s=i(90237),l=i(66552),r=i(25482),n=i(10107),o=(i(44208),i(53966),i(87811),i(40608)),a=i(30943);const u=new l.J({simple:"simple",uniqueValue:"unique-value",classBreaks:"class-breaks",heatmap:"heatmap",dotDensity:"dot-density",dictionary:"dictionary",pieChart:"pie-chart"},{ignoreUnknown:!0});let p=class extends r.A{constructor(e){super(e),this.authoringInfo=null,this.type=null}async getRequiredFields(e){if(!this.collectRequiredFields)return[];const t=new Set;return await this.collectRequiredFields(t,e),Array.from(t).sort()}getSymbol(e,t){}async getSymbolAsync(e,t){}get symbols(){return[]}get arcadeRequired(){return!1}getAttributeHash(){return JSON.stringify(this)}getMeshHash(){return JSON.stringify(this)}};(0,s._)([(0,n.MZ)({type:a.A,json:{write:!0}})],p.prototype,"authoringInfo",void 0),(0,s._)([(0,n.MZ)({type:u.apiValues,readOnly:!0,json:{type:u.jsonValues,read:!1,write:{writer:u.write,ignoreOrigin:!0,isRequired:!0}}})],p.prototype,"type",void 0),p=(0,s._)([(0,o.$)("esri.renderers.Renderer")],p);const c=p},93618:(e,t,i)=>{i.d(t,{A:()=>P});var s=i(90237),l=i(49186),r=i(4718),n=i(53966),o=i(93637),a=i(36708),u=i(10107),p=i(79901),c=i(93223),d=i(36005),h=i(40608),y=i(43937),f=i(6797),m=i(56507),v=i(30524),b=i(20655),g=i(92438),w=i(63988),_=i(49849),V=i(20061),S=i(69540),x=i(25482);i(44208),i(87811);let M=class extends(S.A.ClonableMixin(x.A)){constructor(e){super(e),this.value=null,this.value2=null,this.value3=null}};(0,s._)([(0,u.MZ)(_.Ug)],M.prototype,"value",void 0),(0,s._)([(0,u.MZ)(_.Ug)],M.prototype,"value2",void 0),(0,s._)([(0,u.MZ)(_.Ug)],M.prototype,"value3",void 0),M=(0,s._)([(0,h.$)("esri.renderers.support.UniqueValue")],M);const z=M;var I=i(4576);let A=class extends(S.A.ClonableMixin(x.A)){constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.values=null}castValues(e){if(null==e)return null;const t=typeof(e=Array.isArray(e)?e:[e])[0];return"string"===t||"number"===t?e.map((e=>new z({value:e}))):"object"===t?e[0]instanceof z?e:e.map((e=>new z(e))):null}};(0,s._)([(0,u.MZ)({type:String,json:{write:!0}})],A.prototype,"description",void 0),(0,s._)([(0,u.MZ)({type:String,json:{write:!0}})],A.prototype,"label",void 0),(0,s._)([(0,u.MZ)(_.z4)],A.prototype,"symbol",void 0),(0,s._)([(0,u.MZ)({type:[z],json:{type:[[String]],read:{reader:e=>e?e.map((e=>new z({value:e[0],value2:e[1],value3:e[2]}))):null},write:{writer:(e,t)=>{const i=[];for(const t of e){const e=[t.value,t.value2,t.value3].filter(I.Ru).map((e=>e.toString()));i.push(e)}t.values=i}}}})],A.prototype,"values",void 0),(0,s._)([(0,p.w)("values")],A.prototype,"castValues",null),A=(0,s._)([(0,h.$)("esri.renderers.support.UniqueValueClass")],A);const j=A;let Z=class extends(S.A.ClonableMixin(x.A)){constructor(e){super(e),this.heading=null,this.classes=null}};(0,s._)([(0,u.MZ)({type:String,json:{write:!0}})],Z.prototype,"heading",void 0),(0,s._)([(0,u.MZ)({type:[j],json:{write:{isRequired:!0}}})],Z.prototype,"classes",void 0),Z=(0,s._)([(0,h.$)("esri.renderers.support.UniqueValueGroup")],Z);const F=Z;var q,k=i(94833),E=i(43668),C=i(97159),U=i(37757),T=i(85594),D=i(33910);const O="esri.renderers.UniqueValueRenderer",R=()=>n.A.getLogger(O),$="uvInfos-watcher",N="uvGroups-watcher",B=(0,m.dp)(k.A);function L(e){return null!=e&&""!==e&&("string"!=typeof e||""!==e.trim()&&"<null>"!==e.toLowerCase())||(e=null),e+""}let G=q=class extends((0,w.h)(g.A)){constructor(e){super(e),this._valueInfoMap={},this._isDefaultSymbolDerived=!1,this._isInfosSource=null,this.type="unique-value",this.backgroundFillSymbol=null,this.orderByClassesEnabled=!1,this.valueExpressionTitle=null,this.legendOptions=null,this.defaultLabel=null,this.portal=null,this.styleOrigin=null,this.diff={uniqueValueInfos(e,t){if(!e&&!t)return;if(!e||!t)return{type:"complete",oldValue:e,newValue:t};let i=!1;const s={type:"collection",added:[],removed:[],changed:[],unchanged:[]};for(let l=0;l<t.length;l++){const r=e.find((e=>e.value===t[l].value));r?(0,f.Ui)(r,t[l])?(s.changed.push({type:"complete",oldValue:r,newValue:t[l]}),i=!0):s.unchanged.push({oldValue:r,newValue:t[l]}):(s.added.push(t[l]),i=!0)}for(let l=0;l<e.length;l++)t.find((t=>t.value===e[l].value))||(s.removed.push(e[l]),i=!0);return i?s:void 0}},this._set("uniqueValueInfos",[]),this._set("uniqueValueGroups",[])}get _cache(){return{compiledFunc:null}}set field(e){this._set("field",e),this._updateFieldDelimiter(),this._updateUniqueValues()}castField(e){return null==e||"function"==typeof e?e:(0,m.GX)(e)}writeField(e,t,i,s){"string"==typeof e?t[i]=e:s?.messages?s.messages.push(new l.A("property:unsupported","UniqueValueRenderer.field set to a function cannot be written to JSON")):R().error(".field: cannot write field to JSON since it's not a string value")}set field2(e){this._set("field2",e),this._updateFieldDelimiter(),this._updateUniqueValues()}set field3(e){this._set("field3",e),this._updateUniqueValues()}set valueExpression(e){this._set("valueExpression",e),this._updateUniqueValues()}set defaultSymbol(e){this._isDefaultSymbolDerived=!1,this._set("defaultSymbol",e)}set fieldDelimiter(e){this._set("fieldDelimiter",e),this._updateUniqueValues()}readPortal(e,t,i){return i.portal||b.A.getDefault()}readStyleOrigin(e,t,i){if(t.styleName)return Object.freeze({styleName:t.styleName});if(t.styleUrl){const e=(0,C.f)(t.styleUrl,i);return Object.freeze({styleUrl:e})}}writeStyleOrigin(e,t,i,s){e.styleName?t.styleName=e.styleName:e.styleUrl&&(t.styleUrl=(0,C.t)(e.styleUrl,s))}set uniqueValueGroups(e){this.styleOrigin?R().error("#uniqueValueGroups=","Cannot modify unique value groups of a UniqueValueRenderer created from a web style"):(this._set("uniqueValueGroups",e),this._updateInfosFromGroups(),this._isInfosSource=!1,this._watchUniqueValueGroups())}set uniqueValueInfos(e){this.styleOrigin?R().error("#uniqueValueInfos=","Cannot modify unique value infos of a UniqueValueRenderer created from a web style"):(this._set("uniqueValueInfos",e),this._updateValueInfoMap(),this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos())}addUniqueValueInfo(e,t){if(this.styleOrigin)return void R().error("#addUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");let i;i="object"==typeof e?B(e):new k.A({value:e,symbol:(0,D.dp)(t)}),this.uniqueValueInfos?.push(i),this._valueInfoMap[L(i.value)]=i,this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos()}removeUniqueValueInfo(e){if(this.styleOrigin)return void R().error("#removeUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");const t=this.uniqueValueInfos;if(t)for(let i=0;i<t.length;i++){const s=t[i];if(String(s.value)===String(e)){delete this._valueInfoMap[L(e)],t.splice(i,1);break}}this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos()}async getUniqueValueInfo(e,t){let i=t;return this.valueExpression&&null==t?.arcade&&(i={...i,arcade:await(0,E.l)()}),this._getUniqueValueInfo(e,i)}getSymbol(e,t){if(this.valueExpression&&null==t?.arcade)return void R().error("#getSymbol()","Please use getSymbolAsync if valueExpression is used");const i=this._getUniqueValueInfo(e,t);return i?.symbol||this.defaultSymbol}async getSymbolAsync(e,t){let i=t;if(this.valueExpression&&null==i?.arcade){const e=await(0,E.l)(),{arcadeUtils:t}=e;t.hasGeometryOperations(this.valueExpression)&&await t.enableGeometryOperations(),i={...i,arcade:e}}const s=this._getUniqueValueInfo(e,i);return s?.symbol||this.defaultSymbol}get symbols(){const e=[];for(const t of this.uniqueValueInfos??[])t.symbol&&e.push(t.symbol);return this.defaultSymbol&&e.push(this.defaultSymbol),e}getAttributeHash(){return this.visualVariables?.reduce(((e,t)=>e+t.getAttributeHash()),"")??""}getMeshHash(){const e=JSON.stringify(this.backgroundFillSymbol),t=JSON.stringify(this.defaultSymbol),i=this.uniqueValueInfos?.reduce(((e,t)=>e+t.getMeshHash()),"");return`${e}.${t}.${i}.${this.field}.${this.field2}.${this.field3}.${this.fieldDelimiter}.${this.valueExpression}`}clone(){const e=new q({field:this.field,field2:this.field2,field3:this.field3,defaultLabel:this.defaultLabel,defaultSymbol:(0,r.o8)(this.defaultSymbol),orderByClassesEnabled:this.orderByClassesEnabled,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,fieldDelimiter:this.fieldDelimiter,visualVariables:(0,r.o8)(this.visualVariables),legendOptions:(0,r.o8)(this.legendOptions),authoringInfo:(0,r.o8)(this.authoringInfo),backgroundFillSymbol:(0,r.o8)(this.backgroundFillSymbol)});this._isDefaultSymbolDerived&&(e._isDefaultSymbolDerived=!0),e._set("portal",this.portal);const t=(0,r.o8)(this.uniqueValueInfos),i=(0,r.o8)(this.uniqueValueGroups);return this.styleOrigin&&(e._set("styleOrigin",Object.freeze((0,r.o8)(this.styleOrigin))),Object.freeze(t),Object.freeze(i)),e._set("uniqueValueInfos",t),e._updateValueInfoMap(),e._set("uniqueValueGroups",i),e._isInfosSource=this._isInfosSource,e._watchUniqueValueInfosAndGroups(),e}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}async collectRequiredFields(e,t){const i=[this.collectVVRequiredFields(e,t),this.collectSymbolFields(e,t)];await Promise.all(i)}async collectSymbolFields(e,t){const i=[...this.symbols.map((i=>i.collectRequiredFields(e,t))),(0,v.Dx)(e,t,this.valueExpression)];(0,v.rq)(e,t,this.field),(0,v.rq)(e,t,this.field2),(0,v.rq)(e,t,this.field3),await Promise.all(i)}populateFromStyle(){return(0,T.cF)(this.styleOrigin,{portal:this.portal}).then((e=>{const t=[];return this._valueInfoMap={},e?.data&&Array.isArray(e.data.items)&&e.data.items.forEach((i=>{const s=new U.A({styleUrl:e.styleUrl,styleName:e.styleName,portal:this.portal,name:i.name});this.defaultSymbol||i.name!==e.data.defaultItem||(this.defaultSymbol=s,this._isDefaultSymbolDerived=!0);const l=new k.A({value:i.name,symbol:s});t.push(l),this._valueInfoMap[L(i.name)]=l})),this._set("uniqueValueInfos",Object.freeze(t)),this._updateGroupsFromInfos(!0),this._isInfosSource=null,this._watchUniqueValueInfos(),!this.defaultSymbol&&this.uniqueValueInfos?.length&&(this.defaultSymbol=this.uniqueValueInfos[0].symbol,this._isDefaultSymbolDerived=!0),this}))}_updateFieldDelimiter(){this.field&&this.field2&&!this.fieldDelimiter&&this._set("fieldDelimiter",",")}_updateUniqueValues(){null!=this._isInfosSource&&(this._isInfosSource?this._updateGroupsFromInfos():this._updateInfosFromGroups())}_updateValueInfoMap(){this._valueInfoMap={};const{uniqueValueInfos:e}=this;if(e)for(const t of e)this._valueInfoMap[L(t.value)]=t}_watchUniqueValueInfosAndGroups(){this._watchUniqueValueInfos(),this._watchUniqueValueGroups()}_watchUniqueValueInfos(){this.removeHandles($);const{uniqueValueInfos:e}=this;if(e){const t=[];for(const i of e)t.push((0,a.wB)((()=>({symbol:i.symbol,value:i.value,label:i.label,description:i.description})),((e,t)=>{e!==t&&(this._updateGroupsFromInfos(),this._isInfosSource=!0)}),{sync:!0}));this.addHandles(t,$)}}_watchUniqueValueGroups(){this.removeHandles(N);const{uniqueValueGroups:e}=this;if(e){const t=[];for(const i of e){t.push((0,a.wB)((()=>({classes:i.classes})),((e,t)=>{e!==t&&(this._updateInfosFromGroups(),this._isInfosSource=!1)}),{sync:!0}));for(const e of i.classes??[])t.push((0,a.wB)((()=>({symbol:e.symbol,values:e.values,label:e.label,description:e.description})),((e,t)=>{e!==t&&(this._updateInfosFromGroups(),this._isInfosSource=!1)}),{sync:!0}))}this.addHandles(t,N)}}_updateInfosFromGroups(){if(!this.uniqueValueGroups)return this._set("uniqueValueInfos",null),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const e=[],{field:t,field2:i,field3:s,fieldDelimiter:l,uniqueValueGroups:r,valueExpression:n}=this;if(!t&&!n)return this._set("uniqueValueInfos",e),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const o=!(!t||!i);for(const t of r)for(const r of t.classes??[]){const{symbol:t,label:n,values:a,description:u}=r;for(const r of a??[]){const{value:a,value2:p,value3:c}=r,d=[a];i&&d.push(p),s&&d.push(c);const h=o?d.join(l||""):d[0]??void 0;e.push(new k.A({symbol:t,label:n,value:h,description:u}))}}this._set("uniqueValueInfos",e),this._updateValueInfoMap(),this._watchUniqueValueInfos()}_updateGroupsFromInfos(e=!1){if(!this.uniqueValueInfos)return this._set("uniqueValueGroups",null),void this._watchUniqueValueGroups();const{field:t,field2:i,valueExpression:s,fieldDelimiter:l,uniqueValueInfos:r}=this;if(!t&&!s||!r.length)return this._set("uniqueValueGroups",[]),void this._watchUniqueValueGroups();const n=!(!t||!i),o=r.map((e=>{const{symbol:t,label:i,value:s,description:r}=e,[o,a,u]=n?s?.toString()?.split(l||"")||[]:[s];return new j({symbol:t,label:i,description:r,values:[new z({value:o,value2:a,value3:u})]})})),a=[new F({classes:o})];e&&Object.freeze(a),this._set("uniqueValueGroups",a),this._watchUniqueValueGroups()}_getUniqueValueInfo(e,t){return this.valueExpression?this._getUnqiueValueInfoForExpression(e,t):this._getUnqiueValueInfoForFields(e)}_getUnqiueValueInfoForExpression(e,t){const{viewingMode:i,scale:s,spatialReference:l,arcade:r,timeZone:n}=t??{};let o=this._cache.compiledFunc;const a=r.arcadeUtils;if(!o){const e=a.createSyntaxTree(this.valueExpression);o=a.createFunction(e),this._cache.compiledFunc=o}const u=a.executeFunction(o,a.createExecContext(e,a.getViewInfo({viewingMode:i,scale:s,spatialReference:l}),n));return this._valueInfoMap[L(u)]}_getUnqiueValueInfoForFields(e){const t=this.field,i=e.attributes;let s;if(this.field2){const e=this.field2,l=this.field3,r=[];t&&r.push(i[t]),e&&r.push(i[e]),l&&r.push(i[l]),s=r.join(this.fieldDelimiter||"")}else t&&(s=i[t]);return this._valueInfoMap[L(s)]}static fromPortalStyle(e,t){const i=new q(t?.properties);i._set("styleOrigin",Object.freeze({styleName:e})),i._set("portal",t?.portal||b.A.getDefault());const s=i.populateFromStyle();return s.catch((t=>{R().error(`#fromPortalStyle('${e}'[, ...])`,"Failed to create unique value renderer from style name",t)})),s}static fromStyleUrl(e,t){const i=new q(t?.properties);i._set("styleOrigin",Object.freeze({styleUrl:e}));const s=i.populateFromStyle();return s.catch((t=>{R().error(`#fromStyleUrl('${e}'[, ...])`,"Failed to create unique value renderer from style URL",t)})),s}};(0,s._)([(0,u.MZ)({readOnly:!0})],G.prototype,"_cache",null),(0,s._)([(0,c.e)({uniqueValue:"unique-value"})],G.prototype,"type",void 0),(0,s._)([(0,u.MZ)(_.As)],G.prototype,"backgroundFillSymbol",void 0),(0,s._)([(0,u.MZ)({value:null,json:{type:String,read:{source:"field1"},write:{target:"field1"}}})],G.prototype,"field",null),(0,s._)([(0,p.w)("field")],G.prototype,"castField",null),(0,s._)([(0,y.K)("field")],G.prototype,"writeField",null),(0,s._)([(0,u.MZ)({type:String,value:null,json:{write:!0}})],G.prototype,"field2",null),(0,s._)([(0,u.MZ)({type:String,value:null,json:{write:!0}})],G.prototype,"field3",null),(0,s._)([(0,u.MZ)({type:Boolean,json:{name:"drawInClassOrder",default:!1,write:!0,origins:{"web-scene":{write:!1}}}})],G.prototype,"orderByClassesEnabled",void 0),(0,s._)([(0,u.MZ)({type:String,value:null,json:{write:!0}})],G.prototype,"valueExpression",null),(0,s._)([(0,u.MZ)({type:String,json:{write:!0}})],G.prototype,"valueExpressionTitle",void 0),(0,s._)([(0,u.MZ)({type:V.A,json:{write:!0}})],G.prototype,"legendOptions",void 0),(0,s._)([(0,u.MZ)({type:String,json:{write:!0}})],G.prototype,"defaultLabel",void 0),(0,s._)([(0,u.MZ)((0,o.$N)({..._.z4},{json:{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}},origins:{"web-scene":{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}}}}}}))],G.prototype,"defaultSymbol",null),(0,s._)([(0,u.MZ)({type:String,value:null,json:{write:!0}})],G.prototype,"fieldDelimiter",null),(0,s._)([(0,u.MZ)({type:b.A,readOnly:!0})],G.prototype,"portal",void 0),(0,s._)([(0,d.w)("portal",["styleName"])],G.prototype,"readPortal",null),(0,s._)([(0,u.MZ)({readOnly:!0,json:{write:{enabled:!1,overridePolicy:()=>({enabled:!0})}}})],G.prototype,"styleOrigin",void 0),(0,s._)([(0,d.w)("styleOrigin",["styleName","styleUrl"])],G.prototype,"readStyleOrigin",null),(0,s._)([(0,y.K)("styleOrigin",{styleName:{type:String},styleUrl:{type:String}})],G.prototype,"writeStyleOrigin",null),(0,s._)([(0,u.MZ)({type:[F],json:{read:{source:["uniqueValueGroups","uniqueValueInfos"],reader:(e,t,i)=>(t.uniqueValueGroups||function(e){const{field1:t,field2:i,field3:s,fieldDelimiter:l,uniqueValueInfos:r,valueExpression:n}=e,o=!(!t||!i);return[{classes:(r??[]).map((e=>{const{symbol:r,label:a,value:u,description:p}=e,[c,d,h]=o?u?.toString()?.split(l||"")||[]:[u],y=[];return(t||n)&&y.push(c),i&&y.push(d),s&&y.push(h),{symbol:r,label:a,values:[y],description:p}}))}]}(t)).map((e=>F.fromJSON(e,i)))},write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],G.prototype,"uniqueValueGroups",null),(0,s._)([(0,u.MZ)({type:[k.A],json:{read:!1,write:{isRequired:!0,overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0,isRequired:!0}}}}})],G.prototype,"uniqueValueInfos",null),G=q=(0,s._)([(0,h.$)(O)],G);const P=G},94833:(e,t,i)=>{i.d(t,{A:()=>p});var s,l=i(90237),r=i(25482),n=i(10107),o=(i(44208),i(53966),i(87811),i(40608)),a=i(49849);let u=s=class extends r.A{constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.value=null}clone(){return new s({value:this.value,description:this.description,label:this.label,symbol:this.symbol?this.symbol.clone():null})}getMeshHash(){const e=JSON.stringify(this.symbol?.toJSON());return`${this.value}.${e}`}};(0,l._)([(0,n.MZ)({type:String,json:{write:!0}})],u.prototype,"description",void 0),(0,l._)([(0,n.MZ)({type:String,json:{write:!0}})],u.prototype,"label",void 0),(0,l._)([(0,n.MZ)(a.Wp)],u.prototype,"symbol",void 0),(0,l._)([(0,n.MZ)(a.Ug)],u.prototype,"value",void 0),u=s=(0,l._)([(0,o.$)("esri.renderers.support.UniqueValueInfo")],u);const p=u},95349:(e,t,i)=>{i.d(t,{g:()=>n,r:()=>o});var s=i(2485),l=i(72606),r=i(1626);const n={key:"type",base:l.A,typeMap:{algorithmic:s.A,multipart:r.A}};function o(e){return e?.type?"algorithmic"===e.type?s.A.fromJSON(e):"multipart"===e.type?r.A.fromJSON(e):null:null}},98205:(e,t,i)=>{var s,l;function r(e){return e&&"esri.renderers.visualVariables.SizeVariable"===e.declaredClass}function n(e){return null!=e&&!isNaN(e)&&isFinite(e)}function o(e){return e.valueExpression?s.Expression:e.field&&"string"==typeof e.field?s.Field:s.Unknown}function a(e,t){const i=t||o(e),r=e.valueUnit||"unknown";return i===s.Unknown?l.Constant:e.stops?l.Stops:null!=e.minSize&&null!=e.maxSize&&null!=e.minDataValue&&null!=e.maxDataValue?l.ClampedLinear:"unknown"===r?null!=e.minSize&&null!=e.minDataValue?e.minSize&&e.minDataValue?l.Proportional:l.Additive:l.Identity:l.RealWorldSize}i.d(t,{KZ:()=>a,Yf:()=>s,_w:()=>l,eh:()=>o,gf:()=>n,of:()=>r}),function(e){e.Unknown="unknown",e.Expression="expression",e.Field="field"}(s||(s={})),function(e){e.Unknown="unknown",e.Stops="stops",e.ClampedLinear="clamped-linear",e.Proportional="proportional",e.Additive="additive",e.Constant="constant",e.Identity="identity",e.RealWorldSize="real-world-size"}(l||(l={}))}}]);
|