@arcgis/core 5.1.0-next.87 → 5.1.0-next.88
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/Graphic.js +1 -1
- package/analysis/LineOfSightAnalysisObserver.d.ts +2 -2
- package/analysis/LineOfSightAnalysisTarget.d.ts +2 -2
- package/applications/Components/arcadeUtils.d.ts +23 -0
- package/applications/Components/arcadeUtils.js +2 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/00e9e25269d5776f8645.js +1 -0
- package/assets/esri/core/workers/chunks/015fc0a17b17d69cc3bb.js +1 -0
- package/assets/esri/core/workers/chunks/0a6df243b18acae471be.js +1 -0
- package/assets/esri/core/workers/chunks/0cc4b3100a7a453bd058.js +1 -0
- package/assets/esri/core/workers/chunks/10cf6a70bf79f04a7208.js +1 -0
- package/assets/esri/core/workers/chunks/169ca3724053fc046d1b.js +1 -0
- package/assets/esri/core/workers/chunks/206bdfd868a9ef88f3a8.js +1 -0
- package/assets/esri/core/workers/chunks/2343b1105bc4c1b4a086.js +1 -0
- package/assets/esri/core/workers/chunks/{f89b7b0ccfbd1e5f9a0f.js → 3092184350d66c79f610.js} +1 -1
- package/assets/esri/core/workers/chunks/3469df5c4846b0cee012.js +1 -0
- package/assets/esri/core/workers/chunks/{26f804c92077c11c626d.js → 394812e19b6915d560b0.js} +1 -1
- package/assets/esri/core/workers/chunks/3feec3d08424b94e1bcf.js +1 -0
- package/assets/esri/core/workers/chunks/{ce4dfc3a470230ddc9e4.js → 43f58604ba4a94a9167c.js} +1 -1
- package/assets/esri/core/workers/chunks/{ff57a071156d8a7e47be.js → 456d269e3982c437010a.js} +1 -1
- package/assets/esri/core/workers/chunks/46b16501db6681dc467b.js +1 -0
- package/assets/esri/core/workers/chunks/48549d3d7bf0154c0afa.js +1 -0
- package/assets/esri/core/workers/chunks/{713ab619060bd5087479.js → 4baf66314f82cfa76beb.js} +182 -157
- package/assets/esri/core/workers/chunks/{1ab66600579fa4232d7b.js → 4dc91c2208201ba34c90.js} +1 -1
- package/assets/esri/core/workers/chunks/{b14c4c3f295970f731ab.js → 500be1fb7cc9efec875c.js} +1 -1
- package/assets/esri/core/workers/chunks/{fc6ca7ffb9f1b875059c.js → 51716e411fad624ac21c.js} +1 -1
- package/assets/esri/core/workers/chunks/54c035cdc171998d0776.js +1 -0
- package/assets/esri/core/workers/chunks/{b23e677c33db6f9bac8a.js → 566f6319ded0634769e0.js} +1 -1
- package/assets/esri/core/workers/chunks/752f4e0e2961fc315dca.js +1 -0
- package/assets/esri/core/workers/chunks/7ba67f1d7831a5576a5a.js +1 -0
- package/assets/esri/core/workers/chunks/{186bfde8c552e3b42302.js → 7ef51b0ebd560113ae7e.js} +1 -1
- package/assets/esri/core/workers/chunks/7f0f10946f05a09b5654.js +1 -0
- package/assets/esri/core/workers/chunks/{fce2306a1b31c6680f90.js → 7f34fa9f154f5101cb13.js} +1 -1
- package/assets/esri/core/workers/chunks/8178e9ba3c568d406a87.js +1 -0
- package/assets/esri/core/workers/chunks/83f1871d04c979fa23b7.js +1 -0
- package/assets/esri/core/workers/chunks/85da2987e17b6755a94e.js +1 -0
- package/assets/esri/core/workers/chunks/8a5a827ee557d9f9a66e.js +1 -0
- package/assets/esri/core/workers/chunks/9c09097e390985bbac58.js +1 -0
- package/assets/esri/core/workers/chunks/a432219de6a873f88776.js +1 -0
- package/assets/esri/core/workers/chunks/{455d08294e0f5c5509ff.js → a6b75576d598ec161cc4.js} +1 -1
- package/assets/esri/core/workers/chunks/b2662bfdbd1e3623ceb9.js +1 -0
- package/assets/esri/core/workers/chunks/b4bac22467e96be7a974.js +1 -0
- package/assets/esri/core/workers/chunks/{5166f204fd078dced5db.js → baea6f86b2dbe067940e.js} +1 -1
- package/assets/esri/core/workers/chunks/c3e89c7c7b677bd18557.js +1 -0
- package/assets/esri/core/workers/chunks/cb81d524f12edcadb9bb.js +1 -0
- package/assets/esri/core/workers/chunks/cc0f3b9b153a0c232afe.js +1 -0
- package/assets/esri/core/workers/chunks/cd0c232f4e3868d91a05.js +1 -0
- package/assets/esri/core/workers/chunks/{9bd713d96502ddc2ce25.js → d8ccc713c5ad93e7a0c3.js} +1 -1
- package/assets/esri/core/workers/chunks/{e66b9d00d02fc08cbb2d.js → da008d6a3afb30d18392.js} +1 -1
- package/assets/esri/core/workers/chunks/dde94664110ff231a52d.js +1 -0
- package/assets/esri/core/workers/chunks/de3e5d82502ee15b7eae.js +1 -0
- package/assets/esri/core/workers/chunks/e6fe8b5fbe95de01453b.js +1 -0
- package/assets/esri/core/workers/chunks/ee7e9bca57160694b3c4.js +1 -0
- package/assets/esri/core/workers/chunks/f36345ebb9851ab92453.js +1 -0
- package/assets/esri/core/workers/chunks/{c503c79ba5761f7abbeb.js → fa869bfe4366f7f49cca.js} +1 -1
- package/assets/esri/core/workers/chunks/{d8de7fe49dba9ed589df.js → fade7b878a9498382bb2.js} +1 -1
- package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
- package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
- package/assets/esri/libs/text/pkg/bundle_bg.wasm +0 -0
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ar.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_bg.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_bs.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ca.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_cs.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_da.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_de.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_el.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_es.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_et.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_fi.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_fr.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_he.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_hr.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_hu.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_id.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_it.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ja.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ko.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_lt.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_lv.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_nl.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_no.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_pl.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_pt-BR.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_pt-PT.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ro.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ru.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_sk.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_sl.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_sr.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_sv.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_th.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_tr.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_uk.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_vi.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_zh-CN.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_zh-HK.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_zh-TW.json +1 -1
- package/chunks/GlobalIllumination.glsl.js +25 -17
- package/chunks/GlowBlur.glsl.js +11 -8
- package/chunks/OITBlend.glsl.js +1 -1
- package/chunks/bundle2.js +1 -1
- package/config.js +1 -1
- package/core/has.js +1 -1
- package/interfaces.d.ts +0 -3
- package/kernel.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/graphics/data/QueryEngineCapabilities.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/sources/OGCFeatureSource.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/support/SubtypeSublayer.js +1 -1
- package/layers/support/capabilities.js +1 -1
- package/layers/support/layerUtils.js +1 -1
- package/layers/support/serviceCapabilitiesUtils.js +1 -1
- package/networks/CircuitManager.d.ts +33 -25
- package/networks/CircuitManager.js +1 -1
- package/networks/support/typeUtils.d.ts +4 -1
- package/networks/support/typeUtils.js +1 -1
- package/package.json +1 -1
- package/renderers/ClassBreaksRenderer.js +1 -1
- package/renderers/UniqueValueRenderer.js +1 -1
- package/renderers/support/scaleDependentSymbolUtils.js +2 -0
- package/rest/networks/circuits/queryCircuits.js +1 -1
- package/rest/networks/circuits/support/QueryCircuitsParameters.d.ts +21 -15
- package/rest/networks/circuits/support/QueryCircuitsParameters.js +1 -1
- package/rest/query/operations/query.js +1 -1
- package/rest/support/Query.js +1 -1
- package/support/revision.js +1 -1
- package/third-party-notices.txt +19 -12
- package/views/2d/engine/webgl/GlyphSDFCreator.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightAuthoringStore.js +2 -0
- package/views/3d/analysis/LineOfSight/LineOfSightAuthoringUtils.js +2 -0
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightDrawToolRenderer.js +2 -0
- package/views/3d/analysis/LineOfSight/LineOfSightObserverPlugin.js +2 -0
- package/views/3d/analysis/LineOfSight/LineOfSightPlacementTool.js +2 -0
- package/views/3d/analysis/LineOfSight/LineOfSightRootPlugin.js +2 -0
- package/views/3d/analysis/LineOfSight/LineOfSightTargetPlugin.js +2 -0
- package/views/3d/analysis/LineOfSight/LineOfSightTool2.js +1 -1
- package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerViewBase3D.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js +149 -0
- package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterColor.glsl.js +2 -2
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
- package/views/3d/webgl-engine/materials/WaterTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
- package/webmap/utils.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/assets/esri/core/workers/chunks/0c074c46d106ca4d3bad.js +0 -1
- package/assets/esri/core/workers/chunks/1f16bc8c02d8c4b2f693.js +0 -1
- package/assets/esri/core/workers/chunks/29878b52aa12b3815230.js +0 -1
- package/assets/esri/core/workers/chunks/2c916b93d8a6e6b9c0d7.js +0 -1
- package/assets/esri/core/workers/chunks/3ea5a18b264628dc37f0.js +0 -1
- package/assets/esri/core/workers/chunks/41913575dd45c65d645e.js +0 -1
- package/assets/esri/core/workers/chunks/46e622857ba92a72a317.js +0 -1
- package/assets/esri/core/workers/chunks/49e8144effc299dfcd66.js +0 -1
- package/assets/esri/core/workers/chunks/4d0f793dee4ad919221b.js +0 -1
- package/assets/esri/core/workers/chunks/65ac73de5bb133c6bf89.js +0 -1
- package/assets/esri/core/workers/chunks/67ec1694d6e18b7c234c.js +0 -1
- package/assets/esri/core/workers/chunks/6e526c06825ecc6c99c0.js +0 -1
- package/assets/esri/core/workers/chunks/6f7aaba26773fe416ac2.js +0 -1
- package/assets/esri/core/workers/chunks/7acf82763aeba44049d0.js +0 -1
- package/assets/esri/core/workers/chunks/88eb1e4320c4ada01711.js +0 -1
- package/assets/esri/core/workers/chunks/8af9a78cf316581ea482.js +0 -1
- package/assets/esri/core/workers/chunks/96bba4d93a32ad34a1c8.js +0 -1
- package/assets/esri/core/workers/chunks/97719271a3e4c9f2b2c9.js +0 -1
- package/assets/esri/core/workers/chunks/9ea23cd4b2664c08b670.js +0 -1
- package/assets/esri/core/workers/chunks/a1a12552d34ea9eea130.js +0 -1
- package/assets/esri/core/workers/chunks/ac5999c88c27b49cd760.js +0 -1
- package/assets/esri/core/workers/chunks/b575292013bceef9b015.js +0 -1
- package/assets/esri/core/workers/chunks/bbc27d9285162696d089.js +0 -1
- package/assets/esri/core/workers/chunks/bc8a74da48b08309875f.js +0 -1
- package/assets/esri/core/workers/chunks/cd7159600ce132e32d04.js +0 -1
- package/assets/esri/core/workers/chunks/ce66c551b7083913eee5.js +0 -1
- package/assets/esri/core/workers/chunks/cf7acf5acb6d322fd996.js +0 -1
- package/assets/esri/core/workers/chunks/d9c3f14eee4db7a7137b.js +0 -1
- package/assets/esri/core/workers/chunks/db3c484bfa607dec6050.js +0 -1
- package/assets/esri/core/workers/chunks/dcc719e15b2e0cce1f3b.js +0 -1
- package/assets/esri/core/workers/chunks/f43d628d47eec7d530c7.js +0 -1
- package/assets/esri/core/workers/chunks/fae147d03ed723ab234d.js +0 -1
- package/assets/esri/core/workers/chunks/fcf51697c361e0075cc2.js +0 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceReflections.glsl.js +0 -132
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../core/Error.js";import{JSONSupport as i}from"../core/JSONSupport.js";import{watch as r}from"../core/reactiveUtils.js";import{property as s,subclass as o}from"../core/accessorSupport/decorators.js";import c from"../layers/FeatureLayer.js";import{emitApplyEditsEvent as a}from"../layers/mixins/EditBusLayer.js";import n from"./UtilityNetwork.js";import l from"./support/Circuit.js";import u from"./support/CircuitExportJobInfo.js";import d from"./support/CircuitVerifyJobInfo.js";import{isVersionInEditSession as m,currentSessionId as h,isSafeToEditVersion as b}from"../versionManagement/support/versionManagementUtils.js";let w=class extends i{constructor(e){super(e),this._circuitTable=null,this._circuitSectionTable=null,this._subcircuitTable=null,this.telecomDomainNetwork=null,this.utilityNetwork=null}initialize(){this.addHandles([r(()=>[this.gdbVersion,this.historicMoment],()=>{this._setLayerVersionAndMoment(this._circuitTable),this._setLayerVersionAndMoment(this._circuitSectionTable),this._setLayerVersionAndMoment(this._subcircuitTable)})])}get _circuitTableUrl(){if(null==this.telecomDomainNetwork)return null;const e=this.telecomDomainNetwork.circuitSources?.find(e=>"esriUNFCUTCircuit"===e.utilityNetworkFeatureClassUsageType)?.layerId??null;return null==e?null:`${this.featureServiceUrl}/${e}`}get _circuitSectionTableUrl(){if(null==this.telecomDomainNetwork)return null;const e=this.telecomDomainNetwork.circuitSources?.find(e=>"esriUNFCUTCircuitSection"===e.utilityNetworkFeatureClassUsageType)?.layerId??null;return null==e?null:`${this.featureServiceUrl}/${e}`}get _subcircuitTableUrl(){if(null==this.telecomDomainNetwork)return null;const e=this.telecomDomainNetwork.circuitSources?.find(e=>"esriUNFCUTSubcircuit"===e.utilityNetworkFeatureClassUsageType)?.layerId??null;return null==e?null:`${this.featureServiceUrl}/${e}`}get networkServiceUrl(){return this.utilityNetwork?.networkServiceUrl??null}get featureServiceUrl(){return this.utilityNetwork?.featureServiceUrl??null}get gdbVersion(){return this.utilityNetwork?.gdbVersion??null}get historicMoment(){return this.utilityNetwork?.historicMoment??null}get telecomDomainNetworkName(){return this.telecomDomainNetwork?.domainNetworkName??null}get circuitTable(){if(null!=this._circuitTable)return this._circuitTable;if(null==this._circuitTableUrl)throw new t("circuit-manager:missing-circuit-table-url","Unable to load the circuit table; cannot get layer url from `telecomDomainNetwork.","Ensure `telecomDomainNetwork` was provided to the circuit manager.");return this._circuitTable=new c({url:this._circuitTableUrl,gdbVersion:this.gdbVersion,historicMoment:this.historicMoment}),this._circuitTable}get circuitSectionTable(){if(null!=this._circuitSectionTable)return this._circuitSectionTable;if(null==this._circuitSectionTableUrl)throw new t("circuit-manager:missing-circuit-section-table-url","Unable to load the circuit section table; cannot get layer url from `telecomDomainNetwork.","Ensure `telecomDomainNetwork` was provided to the circuit manager.");return this._circuitSectionTable=new c({url:this._circuitSectionTableUrl,gdbVersion:this.gdbVersion,historicMoment:this.historicMoment}),this._circuitSectionTable}get subcircuitTable(){if(null!=this._subcircuitTable)return this._subcircuitTable;if(null==this._subcircuitTableUrl)throw new t("circuit-manager:missing-subcircuit-table-url","Unable to load the subcircuit table; cannot get layer url from `telecomDomainNetwork.","Ensure `telecomDomainNetwork` was provided to the circuit manager.");return this._subcircuitTable=new c({url:this._subcircuitTableUrl,gdbVersion:this.gdbVersion,historicMoment:this.historicMoment}),this._subcircuitTable}async loadCircuitTable(){return this.circuitTable.load()}async loadCircuitSectionTable(){return this.circuitSectionTable.load()}async loadSubcircuitTable(){return this.subcircuitTable.load()}getCircuit(e,t=!1){return new l(t?{circuitManager:this,name:e,sections:new Map}:{circuitManager:this,name:e})}async create(e){const[{createCircuit:t},{default:i}]=await Promise.all([import("../rest/networks/circuits/createCircuit.js"),import("../rest/networks/circuits/support/CreateAlterCircuitParameters.js"),this.loadCircuitTable()]),r=i.from({circuit:e,domainNetworkName:this.telecomDomainNetworkName});m(this.featureServiceUrl,this.gdbVersion||null)?(r.sessionId=h,await b(this.featureServiceUrl,this.gdbVersion,!0)):r.sessionId=null,r.gdbVersion=this.gdbVersion;const s=a(this.featureServiceUrl,null,this.gdbVersion,!1),o=await t(this.networkServiceUrl,r);e.circuitManager=this,this._setCircuitGlobalIdFromEdits(e,o.serviceEdits||[]),s.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:o.exceededTransferLimit,historicMoment:o.moment,editedFeatures:o.serviceEdits||void 0})}async alter(e){if(null==e.globalId)throw new t("circuit-manager:alter-without-globalid","A circuit being altered must have a globalId","To ensure the circuit has a globalId, query the circuit first");const[{alterCircuit:i},{default:r}]=await Promise.all([import("../rest/networks/circuits/alterCircuit.js"),import("../rest/networks/circuits/support/CreateAlterCircuitParameters.js")]),s=r.from({circuit:e,domainNetworkName:this.telecomDomainNetworkName});m(this.featureServiceUrl,this.gdbVersion||null)?(s.sessionId=h,await b(this.featureServiceUrl,this.gdbVersion,!0)):s.sessionId=null,s.gdbVersion=this.gdbVersion;const o=a(this.featureServiceUrl,null,this.gdbVersion,!1),c=await i(this.networkServiceUrl,s);e.circuitManager=this,o.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:c.exceededTransferLimit,historicMoment:c.moment,editedFeatures:c.serviceEdits||void 0})}async delete(e){const[{deleteCircuits:t},{default:i}]=await Promise.all([import("../rest/networks/circuits/deleteCircuits.js"),import("../rest/networks/circuits/support/DeleteCircuitsParameters.js")]),r=i.from({circuits:e,domainNetworkName:this.telecomDomainNetworkName});m(this.featureServiceUrl,this.gdbVersion||null)?(r.sessionId=h,await b(this.featureServiceUrl,this.gdbVersion,!0)):r.sessionId=null,r.gdbVersion=this.gdbVersion;const s=a(this.featureServiceUrl,null,this.gdbVersion,!1),o=await t(this.networkServiceUrl,r);s.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:o.exceededTransferLimit,historicMoment:o.moment,editedFeatures:o.serviceEdits||void 0})}async export(e){const[{exportCircuits:t},{default:i}]=await Promise.all([import("../rest/networks/circuits/exportCircuits.js"),import("../rest/networks/circuits/support/ExportCircuitsParameters.js")]),r=i.from(e);m(this.featureServiceUrl,this.gdbVersion||null)?(r.sessionId=h,await b(this.featureServiceUrl,this.gdbVersion,!0)):r.sessionId=null,r.domainNetworkName=this.telecomDomainNetworkName,r.gdbVersion=this.gdbVersion,r.moment=this.historicMoment;const s=a(this.featureServiceUrl,null,this.gdbVersion,!1),o=await t(this.networkServiceUrl,r);return s.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:o.exceededTransferLimit,historicMoment:o.moment,editedFeatures:o.serviceEdits||void 0}),o.circuits}async submitExportJob(e,t){const[{submitExportCircuitsJob:i},{default:r}]=await Promise.all([import("../rest/networks/circuits/exportCircuits.js"),import("../rest/networks/circuits/support/ExportCircuitsParameters.js")]),s=r.from(e);m(this.featureServiceUrl,this.gdbVersion||null)?(s.sessionId=h,await b(this.featureServiceUrl,this.gdbVersion,!0)):s.sessionId=null,s.domainNetworkName=this.telecomDomainNetworkName,s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment;const o=this.featureServiceUrl?a(this.featureServiceUrl,null,this.gdbVersion,!0):void 0,c=await i(this.networkServiceUrl,s,{...t});return new u({statusUrl:c,editsResolver:o})}async verify(e){const[{verifyCircuits:t},{default:i}]=await Promise.all([import("../rest/networks/circuits/verifyCircuits.js"),import("../rest/networks/circuits/support/VerifyCircuitsParameters.js")]),r=i.from(e);m(this.featureServiceUrl,this.gdbVersion||null)?(r.sessionId=h,await b(this.featureServiceUrl,this.gdbVersion,!0)):r.sessionId=null,r.domainNetworkName=this.telecomDomainNetworkName,r.gdbVersion=this.gdbVersion;const s=a(this.featureServiceUrl,null,this.gdbVersion,!0),o=await t(this.networkServiceUrl,r);return s.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:o.exceededTransferLimit,historicMoment:o.moment,editedFeatures:o.serviceEdits||void 0}),o.circuits}async submitVerifyJob(e,t){const[{submitVerifyCircuitsJob:i},{default:r}]=await Promise.all([import("../rest/networks/circuits/verifyCircuits.js"),import("../rest/networks/circuits/support/VerifyCircuitsParameters.js")]),s=r.from(e);m(this.featureServiceUrl,this.gdbVersion||null)?(s.sessionId=h,await b(this.featureServiceUrl,this.gdbVersion,!0)):s.sessionId=null,s.domainNetworkName=this.telecomDomainNetworkName,s.gdbVersion=this.gdbVersion;const o=this.featureServiceUrl?a(this.featureServiceUrl,null,this.gdbVersion,!0):void 0,c=await i(this.networkServiceUrl,s,{...t});return new d({statusUrl:c,editsResolver:o})}async queryCircuits(e){const[{queryCircuits:t},{default:i}]=await Promise.all([import("../rest/networks/circuits/queryCircuits.js"),import("../rest/networks/circuits/support/QueryCircuitsParameters.js")]),r=Array.isArray(e)?{circuits:e}:e,s=i.from(r);m(this.featureServiceUrl,this.gdbVersion||null)?s.sessionId=h:s.sessionId=null,s.domainNetworkName=this.telecomDomainNetworkName,s.resultTypes=["circuit"],s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment;const o=await t(this.networkServiceUrl,s);return o.circuits?.forEach(e=>e.circuitManager=this),o.circuits||[]}async queryCircuitNames(e){const[{queryCircuits:t},{default:i}]=await Promise.all([import("../rest/networks/circuits/queryCircuits.js"),import("../rest/networks/circuits/support/QueryCircuitsParameters.js")]),r=i.from(e);m(this.featureServiceUrl,this.gdbVersion||null)?r.sessionId=h:r.sessionId=null,r.domainNetworkName=this.telecomDomainNetworkName,r.resultTypes=["name"],r.gdbVersion=this.gdbVersion,r.moment=this.historicMoment;return(await t(this.networkServiceUrl,r)).circuitNames||[]}_setLayerVersionAndMoment(e){null!=e&&(e.gdbVersion!==this.gdbVersion&&(e.gdbVersion=this.gdbVersion),e.historicMoment!==this.historicMoment&&(e.historicMoment=this.historicMoment))}_setCircuitGlobalIdFromEdits(e,t){const i=this.circuitTable.fieldsIndex.get("Name").name,r=this.circuitTable.globalIdField,s=t?.find(({layerId:e})=>e===this.circuitTable.layerId)?.editedFeatures.adds.find(({attributes:t})=>t[i].toLocaleLowerCase()===e.name.toLocaleLowerCase());e.globalId=s?.attributes[r]??null}};e([s()],w.prototype,"_circuitTable",void 0),e([s()],w.prototype,"_circuitSectionTable",void 0),e([s()],w.prototype,"_subcircuitTable",void 0),e([s({constructOnly:!0})],w.prototype,"telecomDomainNetwork",void 0),e([s({type:n,constructOnly:!0})],w.prototype,"utilityNetwork",void 0),e([s()],w.prototype,"networkServiceUrl",null),e([s()],w.prototype,"featureServiceUrl",null),e([s()],w.prototype,"gdbVersion",null),e([s()],w.prototype,"historicMoment",null),e([s()],w.prototype,"telecomDomainNetworkName",null),e([s()],w.prototype,"circuitTable",null),e([s()],w.prototype,"circuitSectionTable",null),e([s()],w.prototype,"subcircuitTable",null),w=e([o("esri.networks.CircuitManager")],w);const p=w;export{p as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../core/Error.js";import{JSONSupport as i}from"../core/JSONSupport.js";import{watch as r}from"../core/reactiveUtils.js";import{property as s,subclass as o}from"../core/accessorSupport/decorators.js";import c from"../layers/FeatureLayer.js";import{emitApplyEditsEvent as a}from"../layers/mixins/EditBusLayer.js";import n from"./UtilityNetwork.js";import l from"./support/Circuit.js";import u from"./support/CircuitExportJobInfo.js";import d from"./support/CircuitVerifyJobInfo.js";import{isVersionInEditSession as m,currentSessionId as h,isSafeToEditVersion as b}from"../versionManagement/support/versionManagementUtils.js";let w=class extends i{constructor(e){super(e),this._circuitTable=null,this._circuitSectionTable=null,this._subcircuitTable=null,this.telecomDomainNetwork=null,this.utilityNetwork=null}initialize(){this.addHandles([r(()=>[this.gdbVersion,this.historicMoment],()=>{this._setLayerVersionAndMoment(this._circuitTable),this._setLayerVersionAndMoment(this._circuitSectionTable),this._setLayerVersionAndMoment(this._subcircuitTable)})])}get _circuitTableUrl(){if(null==this.telecomDomainNetwork)return null;const e=this.telecomDomainNetwork.circuitSources?.find(e=>"esriUNFCUTCircuit"===e.utilityNetworkFeatureClassUsageType)?.layerId??null;return null==e?null:`${this.featureServiceUrl}/${e}`}get _circuitSectionTableUrl(){if(null==this.telecomDomainNetwork)return null;const e=this.telecomDomainNetwork.circuitSources?.find(e=>"esriUNFCUTCircuitSection"===e.utilityNetworkFeatureClassUsageType)?.layerId??null;return null==e?null:`${this.featureServiceUrl}/${e}`}get _subcircuitTableUrl(){if(null==this.telecomDomainNetwork)return null;const e=this.telecomDomainNetwork.circuitSources?.find(e=>"esriUNFCUTSubcircuit"===e.utilityNetworkFeatureClassUsageType)?.layerId??null;return null==e?null:`${this.featureServiceUrl}/${e}`}get networkServiceUrl(){return this.utilityNetwork?.networkServiceUrl??null}get featureServiceUrl(){return this.utilityNetwork?.featureServiceUrl??null}get gdbVersion(){return this.utilityNetwork?.gdbVersion??null}get historicMoment(){return this.utilityNetwork?.historicMoment??null}get telecomDomainNetworkName(){return this.telecomDomainNetwork?.domainNetworkName??null}get circuitTable(){if(null!=this._circuitTable)return this._circuitTable;if(null==this._circuitTableUrl)throw new t("circuit-manager:missing-circuit-table-url","Unable to load the circuit table; cannot get layer url from `telecomDomainNetwork.","Ensure `telecomDomainNetwork` was provided to the circuit manager.");return this._circuitTable=new c({url:this._circuitTableUrl,gdbVersion:this.gdbVersion,historicMoment:this.historicMoment}),this._circuitTable}get circuitSectionTable(){if(null!=this._circuitSectionTable)return this._circuitSectionTable;if(null==this._circuitSectionTableUrl)throw new t("circuit-manager:missing-circuit-section-table-url","Unable to load the circuit section table; cannot get layer url from `telecomDomainNetwork.","Ensure `telecomDomainNetwork` was provided to the circuit manager.");return this._circuitSectionTable=new c({url:this._circuitSectionTableUrl,gdbVersion:this.gdbVersion,historicMoment:this.historicMoment}),this._circuitSectionTable}get subcircuitTable(){if(null!=this._subcircuitTable)return this._subcircuitTable;if(null==this._subcircuitTableUrl)throw new t("circuit-manager:missing-subcircuit-table-url","Unable to load the subcircuit table; cannot get layer url from `telecomDomainNetwork.","Ensure `telecomDomainNetwork` was provided to the circuit manager.");return this._subcircuitTable=new c({url:this._subcircuitTableUrl,gdbVersion:this.gdbVersion,historicMoment:this.historicMoment}),this._subcircuitTable}async loadCircuitTable(){return this.circuitTable.load()}async loadCircuitSectionTable(){return this.circuitSectionTable.load()}async loadSubcircuitTable(){return this.subcircuitTable.load()}getCircuit(e,t=!1){return new l(t?{circuitManager:this,name:e,sections:new Map}:{circuitManager:this,name:e})}async create(e){const[{createCircuit:t},{default:i}]=await Promise.all([import("../rest/networks/circuits/createCircuit.js"),import("../rest/networks/circuits/support/CreateAlterCircuitParameters.js"),this.loadCircuitTable()]),r=i.from({circuit:e,domainNetworkName:this.telecomDomainNetworkName});m(this.featureServiceUrl,this.gdbVersion||null)?(r.sessionId=h,await b(this.featureServiceUrl,this.gdbVersion,!0)):r.sessionId=null,r.gdbVersion=this.gdbVersion;const s=a(this.featureServiceUrl,null,this.gdbVersion,!1),o=await t(this.networkServiceUrl,r);e.circuitManager=this,this._setCircuitGlobalIdFromEdits(e,o.serviceEdits||[]),s.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:o.exceededTransferLimit,historicMoment:o.moment,editedFeatures:o.serviceEdits||void 0})}async alter(e){if(null==e.globalId)throw new t("circuit-manager:alter-without-globalid","A circuit being altered must have a globalId","To ensure the circuit has a globalId, query the circuit first");const[{alterCircuit:i},{default:r}]=await Promise.all([import("../rest/networks/circuits/alterCircuit.js"),import("../rest/networks/circuits/support/CreateAlterCircuitParameters.js")]),s=r.from({circuit:e,domainNetworkName:this.telecomDomainNetworkName});m(this.featureServiceUrl,this.gdbVersion||null)?(s.sessionId=h,await b(this.featureServiceUrl,this.gdbVersion,!0)):s.sessionId=null,s.gdbVersion=this.gdbVersion;const o=a(this.featureServiceUrl,null,this.gdbVersion,!1),c=await i(this.networkServiceUrl,s);e.circuitManager=this,o.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:c.exceededTransferLimit,historicMoment:c.moment,editedFeatures:c.serviceEdits||void 0})}async delete(e){const[{deleteCircuits:t},{default:i}]=await Promise.all([import("../rest/networks/circuits/deleteCircuits.js"),import("../rest/networks/circuits/support/DeleteCircuitsParameters.js")]),r=i.from({circuits:e,domainNetworkName:this.telecomDomainNetworkName});m(this.featureServiceUrl,this.gdbVersion||null)?(r.sessionId=h,await b(this.featureServiceUrl,this.gdbVersion,!0)):r.sessionId=null,r.gdbVersion=this.gdbVersion;const s=a(this.featureServiceUrl,null,this.gdbVersion,!1),o=await t(this.networkServiceUrl,r);s.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:o.exceededTransferLimit,historicMoment:o.moment,editedFeatures:o.serviceEdits||void 0})}async export(e){const[{exportCircuits:t},{default:i}]=await Promise.all([import("../rest/networks/circuits/exportCircuits.js"),import("../rest/networks/circuits/support/ExportCircuitsParameters.js")]),r=i.from(e);m(this.featureServiceUrl,this.gdbVersion||null)?(r.sessionId=h,await b(this.featureServiceUrl,this.gdbVersion,!0)):r.sessionId=null,r.domainNetworkName=this.telecomDomainNetworkName,r.gdbVersion=this.gdbVersion,r.moment=this.historicMoment;const s=a(this.featureServiceUrl,null,this.gdbVersion,!1),o=await t(this.networkServiceUrl,r);return s.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:o.exceededTransferLimit,historicMoment:o.moment,editedFeatures:o.serviceEdits||void 0}),o.circuits}async submitExportJob(e,t){const[{submitExportCircuitsJob:i},{default:r}]=await Promise.all([import("../rest/networks/circuits/exportCircuits.js"),import("../rest/networks/circuits/support/ExportCircuitsParameters.js")]),s=r.from(e);m(this.featureServiceUrl,this.gdbVersion||null)?(s.sessionId=h,await b(this.featureServiceUrl,this.gdbVersion,!0)):s.sessionId=null,s.domainNetworkName=this.telecomDomainNetworkName,s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment;const o=this.featureServiceUrl?a(this.featureServiceUrl,null,this.gdbVersion,!0):void 0,c=await i(this.networkServiceUrl,s,{...t});return new u({statusUrl:c,editsResolver:o})}async verify(e){const[{verifyCircuits:t},{default:i}]=await Promise.all([import("../rest/networks/circuits/verifyCircuits.js"),import("../rest/networks/circuits/support/VerifyCircuitsParameters.js")]),r=i.from(e);m(this.featureServiceUrl,this.gdbVersion||null)?(r.sessionId=h,await b(this.featureServiceUrl,this.gdbVersion,!0)):r.sessionId=null,r.domainNetworkName=this.telecomDomainNetworkName,r.gdbVersion=this.gdbVersion;const s=a(this.featureServiceUrl,null,this.gdbVersion,!0),o=await t(this.networkServiceUrl,r);return s.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],exceededTransferLimit:o.exceededTransferLimit,historicMoment:o.moment,editedFeatures:o.serviceEdits||void 0}),o.circuits}async submitVerifyJob(e,t){const[{submitVerifyCircuitsJob:i},{default:r}]=await Promise.all([import("../rest/networks/circuits/verifyCircuits.js"),import("../rest/networks/circuits/support/VerifyCircuitsParameters.js")]),s=r.from(e);m(this.featureServiceUrl,this.gdbVersion||null)?(s.sessionId=h,await b(this.featureServiceUrl,this.gdbVersion,!0)):s.sessionId=null,s.domainNetworkName=this.telecomDomainNetworkName,s.gdbVersion=this.gdbVersion;const o=this.featureServiceUrl?a(this.featureServiceUrl,null,this.gdbVersion,!0):void 0,c=await i(this.networkServiceUrl,s,{...t});return new d({statusUrl:c,editsResolver:o})}async queryCircuits(e){const[{queryCircuits:t},{default:i}]=await Promise.all([import("../rest/networks/circuits/queryCircuits.js"),import("../rest/networks/circuits/support/QueryCircuitsParameters.js")]),r={circuitHierarchy:e.hierarchy,circuitStatus:e.status,..."names"in e?{circuits:e.names}:{},..."globalIds"in e?{circuitIds:e.globalIds}:{},..."locations"in e?{locations:e.locations,locationType:e.locationType}:{}},s=i.from(r);m(this.featureServiceUrl,this.gdbVersion||null)?s.sessionId=h:s.sessionId=null,s.domainNetworkName=this.telecomDomainNetworkName,s.resultTypes=["circuit"],s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment;const o=await t(this.networkServiceUrl,s);return o.circuits?.forEach(e=>e.circuitManager=this),o.circuits||[]}async queryCircuitNames(e){const[{queryCircuits:t},{default:i}]=await Promise.all([import("../rest/networks/circuits/queryCircuits.js"),import("../rest/networks/circuits/support/QueryCircuitsParameters.js")]),r={circuitHierarchy:e.hierarchy,circuitStatus:e.status,..."globalIds"in e?{circuitIds:e.globalIds}:{},..."locations"in e?{locations:e.locations,locationType:e.locationType}:{}},s=i.from(r);m(this.featureServiceUrl,this.gdbVersion||null)?s.sessionId=h:s.sessionId=null,s.domainNetworkName=this.telecomDomainNetworkName,s.resultTypes=["name"],s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment;return(await t(this.networkServiceUrl,s)).circuitNames||[]}_setLayerVersionAndMoment(e){null!=e&&(e.gdbVersion!==this.gdbVersion&&(e.gdbVersion=this.gdbVersion),e.historicMoment!==this.historicMoment&&(e.historicMoment=this.historicMoment))}_setCircuitGlobalIdFromEdits(e,t){const i=this.circuitTable.fieldsIndex.get("Name").name,r=this.circuitTable.globalIdField,s=t?.find(({layerId:e})=>e===this.circuitTable.layerId)?.editedFeatures.adds.find(({attributes:t})=>t[i].toLocaleLowerCase()===e.name.toLocaleLowerCase());e.globalId=s?.attributes[r]??null}};e([s()],w.prototype,"_circuitTable",void 0),e([s()],w.prototype,"_circuitSectionTable",void 0),e([s()],w.prototype,"_subcircuitTable",void 0),e([s({constructOnly:!0})],w.prototype,"telecomDomainNetwork",void 0),e([s({type:n,constructOnly:!0})],w.prototype,"utilityNetwork",void 0),e([s()],w.prototype,"networkServiceUrl",null),e([s()],w.prototype,"featureServiceUrl",null),e([s()],w.prototype,"gdbVersion",null),e([s()],w.prototype,"historicMoment",null),e([s()],w.prototype,"telecomDomainNetworkName",null),e([s()],w.prototype,"circuitTable",null),e([s()],w.prototype,"circuitSectionTable",null),e([s()],w.prototype,"subcircuitTable",null),w=e([o("esri.networks.CircuitManager")],w);const p=w;export{p as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @since 5.0 */
|
|
2
|
-
export type CircuitStatus = "clean" | "dirty" | "invalid";
|
|
2
|
+
export type CircuitStatus = "clean" | "dirty" | "invalid" | "deleted";
|
|
3
3
|
|
|
4
4
|
export interface WaitOptions<T> {
|
|
5
5
|
/**
|
|
@@ -18,6 +18,9 @@ export interface WaitOptions<T> {
|
|
|
18
18
|
/** @since 5.0 */
|
|
19
19
|
export type CircuitType = "physical" | "virtual";
|
|
20
20
|
|
|
21
|
+
/** @since 5.0 */
|
|
22
|
+
export type CircuitHierarchy = "consumers" | "providers" | "consumers-and-providers" | "none";
|
|
23
|
+
|
|
21
24
|
/** @since 5.0 */
|
|
22
25
|
export type CircuitSectionRoleType = "start-and-end" | "start" | "midspan" | "end";
|
|
23
26
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{JSONMap as n}from"../../core/jsonMap.js";const t=new n({Clean:"clean",Dirty:"dirty",Invalid:"invalid"}),
|
|
2
|
+
import{JSONMap as n}from"../../core/jsonMap.js";const t=new n({Clean:"clean",Dirty:"dirty",Invalid:"invalid",Deleted:"deleted"}),e=new n({Physical:"physical",Virtual:"virtual"}),i=new n({consumers:"consumers",providers:"providers","consumers and providers":"consumers-and-providers",none:"none"}),o=new n({"Start and End":"start-and-end",Start:"start",Midspan:"midspan",End:"end"}),c=new n({Available:"available",Consumed:"consumed",Reserved:"reserved"}),r=new n({startingPoint:"starting-point",barrier:"barrier",stoppingPoint:"stopping-point"}),a=new n({connected:"connected",upstream:"upstream",downstream:"downstream",shortestPath:"shortest-path",subnetwork:"subnetwork",subnetworkController:"subnetwork-controller",loops:"loops",isolation:"isolation",path:"path",circuit:"circuit"}),s="{00000000-0000-0000-0000-000000000000}",d=new n({junctionJunctionConnectivity:"junction-junction-connectivity",connectivity:"connectivity",attachment:"attachment",containment:"containment",junctionEdgeFromConnectivity:"junction-edge-from-connectivity",junctionEdgeMidspanConnectivity:"junction-edge-midspan-connectivity",junctionEdgeToConnectivity:"junction-edge-to-connectivity"}),u={connectivity:1,"junction-junction-connectivity":1,containment:2,attachment:3,"junction-edge-from-connectivity":4,"junction-edge-midspan-connectivity":5,"junction-edge-to-connectivity":6},l=new n({normal:"normal",rebuild:"rebuild",forceRebuild:"force-rebuild"});export{u as AssociationTypeEnum,i as CircuitHierarchyKebabDict,o as CircuitSectionRoleKebabDict,t as CircuitStatusKebabDict,e as CircuitTypeKebabDict,d as associationTypeKebabDict,s as nullGuid,c as subcircuitStateKebabDict,r as traceLocationTypeKebabDict,a as traceTypeKebabDict,l as validationTypeKebabDict};
|
package/package.json
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{JSONMap as s}from"../core/jsonMap.js";import{clone as t}from"../core/lang.js";import o from"../core/Logger.js";import{property as i,cast as
|
|
2
|
+
import{__decorate as e}from"tslib";import{JSONMap as s}from"../core/jsonMap.js";import{clone as t}from"../core/lang.js";import o from"../core/Logger.js";import{property as i,cast as l,subclass as r}from"../core/accessorSupport/decorators.js";import{ensureString as a,ensureType as n}from"../core/accessorSupport/ensureType.js";import{collectArcadeFieldNames as u,collectField as p}from"../layers/support/fieldUtils.js";import c from"./Renderer.js";import{VisualVariablesMixin as m}from"./mixins/VisualVariablesMixin.js";import d from"./support/ClassBreakInfo.js";import{rendererBackgroundFillSymbolProperty as f,rendererSymbolProperty as h}from"./support/commonProperties.js";import y from"./support/RendererLegendOptions.js";import{getScaleDependentSymbol as g}from"./support/scaleDependentSymbolUtils.js";import{loadArcade as x}from"../support/loadArcade.js";import{ensureType as k}from"../symbols/support/typeUtils.js";import{reader as I}from"../core/accessorSupport/decorators/reader.js";import{writer as b}from"../core/accessorSupport/decorators/writer.js";import{enumeration as v}from"../core/accessorSupport/decorators/enumeration.js";var B;const V="log",F="percent-of-total",S="field",E=new s({esriNormalizeByLog:V,esriNormalizeByPercentOfTotal:F,esriNormalizeByField:S}),w=n(d);let j=B=class extends(m(c)){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,s,t){if(!Array.isArray(e))return;let o=s.minValue;return e.map(e=>{const s=new d;return s.read(e,t),null==s.minValue&&(s.minValue=o),null==s.maxValue&&(s.maxValue=s.minValue),o=s.maxValue,s})}writeClassBreakInfos(e,s,t,o){const i=e.map(e=>e.write({},o));this._areClassBreaksConsecutive()&&i.forEach(e=>delete e.classMinValue),s[t]=i}castField(e){return null==e?e:"function"==typeof e?(o.getLogger(this).error(".field: field must be a string value"),null):a(e)}get minValue(){return this.classBreakInfos&&this.classBreakInfos[0]&&this.classBreakInfos[0].minValue||0}get normalizationType(){let e=this._get("normalizationType");const s=!!this.normalizationField,t=null!=this.normalizationTotal;return s||t?(e=s&&S||t&&F||null,s&&t&&o.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):e!==S&&e!==F||(e=null),e}set normalizationType(e){this._set("normalizationType",e)}addClassBreakInfo(e,s,o){let i=null;i="number"==typeof e?new d({minValue:e,maxValue:s,symbol:k(o)}):w(t(e)),this.classBreakInfos.push(i),1===this.classBreakInfos.length&&this.notifyChange("minValue")}removeClassBreakInfo(e,s){const t=this.classBreakInfos.length;for(let o=0;o<t;o++){const t=[this.classBreakInfos[o].minValue,this.classBreakInfos[o].maxValue];if(t[0]===e&&t[1]===s){this.classBreakInfos.splice(o,1);break}}}getBreakIndex(e,s){return this.valueExpression&&null==s?.arcade&&o.getLogger(this).warn(""),this.valueExpression?this._getBreakIndexForExpression(e,s):this._getBreakIndexForField(e)}async getClassBreakInfo(e,s){let t=s;this.valueExpression&&null==s?.arcade&&(t={...t,arcade:await x()});const o=this.getBreakIndex(e,t);return-1!==o?this.classBreakInfos[o]:null}getSymbol(e,s){if(this.valueExpression&&null==s?.arcade)return void o.getLogger(this).error("#getSymbol()","Please use getSymbolAsync if valueExpression is used");const t=this.getBreakIndex(e,s);return-1===t?this.defaultSymbol:g(this.classBreakInfos[t],s?.scale)??this.defaultSymbol}async getSymbolAsync(e,s){let t=s;if(this.valueExpression&&null==s?.arcade){const e=await x(),{arcadeUtils:s}=e;s.hasGeometryOperations(this.valueExpression)&&await s.enableGeometryOperations(),t={...t,arcade:e}}const o=this.getBreakIndex(e,t);return-1===o?this.defaultSymbol:g(this.classBreakInfos[o],s?.scale)??this.defaultSymbol}get symbols(){const e=[];return this.classBreakInfos.forEach(s=>{s.symbol&&e.push(s.symbol),e.push(...s.alternateSymbols??[])}),this.defaultSymbol&&e.push(this.defaultSymbol),e}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}clone(){return new B({field:this.field,backgroundFillSymbol:this.backgroundFillSymbol?.clone(),defaultLabel:this.defaultLabel,defaultSymbol:this.defaultSymbol?.clone(),valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,classBreakInfos:t(this.classBreakInfos),isMaxInclusive:this.isMaxInclusive,normalizationField:this.normalizationField,normalizationTotal:this.normalizationTotal,normalizationType:this.normalizationType,visualVariables:t(this.visualVariables),legendOptions:t(this.legendOptions),authoringInfo:t(this.authoringInfo)})}async collectRequiredFields(e,s){const t=[this.collectVVRequiredFields(e,s),this.collectSymbolFields(e,s)];await Promise.all(t)}async collectSymbolFields(e,s){const t=[...this.symbols.map(t=>t.collectRequiredFields(e,s)),u(e,s,null,this.valueExpression)];p(e,s,this.field),p(e,s,this.normalizationField),await Promise.all(t)}_getBreakIndexForExpression(e,s){const{viewingMode:t,scale:o,spatialReference:i,arcade:l,timeZone:r}=s??{},{valueExpression:a}=this;let n=this._compiledValueExpression.valueExpression===a?this._compiledValueExpression.compiledFunction:null;const u=l.arcadeUtils;if(!n){const e=u.createSyntaxTree(a);n=u.createFunction(e),this._compiledValueExpression.compiledFunction=n}this._compiledValueExpression.valueExpression=a;const p=u.executeFunction(n,u.createExecContext(e,u.getViewInfo({viewingMode:t,scale:o,spatialReference:i}),r));return this._getBreakIndexfromInfos(p)}_getBreakIndexForField(e){const s=this.field,t=e.attributes,o=this.normalizationType;let i=parseFloat(t[s]);if(o){const e=this.normalizationTotal,s=parseFloat(this.normalizationField?t[this.normalizationField]:void 0);if(o===V)i=Math.log(i)*Math.LOG10E;else if(o!==F||null==e||isNaN(e)){if(o===S&&!isNaN(s)){if(isNaN(i)||isNaN(s))return-1;i/=s}}else i=i/e*100}return this._getBreakIndexfromInfos(i)}_getBreakIndexfromInfos(e){const s=this.isMaxInclusive;if(null!=e&&"number"==typeof e&&!isNaN(e))for(let t=0;t<this.classBreakInfos.length;t++){const o=[this.classBreakInfos[t].minValue,this.classBreakInfos[t].maxValue];if(o[0]<=e&&(s?e<=o[1]:e<o[1]))return t}return-1}_areClassBreaksConsecutive(){const e=this.classBreakInfos,s=e.length;for(let t=1;t<s;t++)if(e[t-1].maxValue!==e[t].minValue)return!1;return!0}};e([i(f)],j.prototype,"backgroundFillSymbol",void 0),e([i({type:[d],json:{write:{isRequired:!0}}})],j.prototype,"classBreakInfos",void 0),e([I("classBreakInfos")],j.prototype,"readClassBreakInfos",null),e([b("classBreakInfos")],j.prototype,"writeClassBreakInfos",null),e([i({type:String,json:{write:!0}})],j.prototype,"defaultLabel",void 0),e([i(h)],j.prototype,"defaultSymbol",void 0),e([i({type:String,json:{write:!0}})],j.prototype,"field",void 0),e([l("field")],j.prototype,"castField",null),e([i({type:Boolean})],j.prototype,"isMaxInclusive",void 0),e([i({type:y,json:{write:!0}})],j.prototype,"legendOptions",void 0),e([i({type:Number,readOnly:!0,value:null,json:{read:!1,write:{overridePolicy(){return 0!==this.classBreakInfos.length&&this._areClassBreaksConsecutive()?{enabled:!0}:{enabled:!1}}}}})],j.prototype,"minValue",null),e([i({type:String,json:{write:!0}})],j.prototype,"normalizationField",void 0),e([i({type:Number,json:{write:!0}})],j.prototype,"normalizationTotal",void 0),e([i({type:E.apiValues,value:null,json:{type:E.jsonValues,read:E.read,write:E.write}})],j.prototype,"normalizationType",null),e([v({classBreaks:"class-breaks"})],j.prototype,"type",void 0),e([i({type:String,json:{write:!0}})],j.prototype,"valueExpression",void 0),e([i({type:String,json:{write:!0}})],j.prototype,"valueExpressionTitle",void 0),j=B=e([r("esri.renderers.ClassBreaksRenderer")],j);export{j as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{clone as t}from"../core/lang.js";import s from"../core/Logger.js";import{deepMerge as i}from"../core/object.js";import{watch as o}from"../core/reactiveUtils.js";import{property as l,cast as r,subclass as u}from"../core/accessorSupport/decorators.js";import{diff as n}from"../core/accessorSupport/diffUtils.js";import{ensureString as a,ensureType as p}from"../core/accessorSupport/ensureType.js";import{collectArcadeFieldNames as f,collectField as d}from"../layers/support/fieldUtils.js";import c from"../portal/Portal.js";import h from"./Renderer.js";import{VisualVariablesMixin as m}from"./mixins/VisualVariablesMixin.js";import{rendererBackgroundFillSymbolProperty as y,rendererSymbolProperty as b}from"./support/commonProperties.js";import v from"./support/RendererLegendOptions.js";import _ from"./support/UniqueValue.js";import g from"./support/UniqueValueClass.js";import V from"./support/UniqueValueGroup.js";import q from"./support/UniqueValueInfo.js";import{loadArcade as I}from"../support/loadArcade.js";import{f as S,t as w}from"../chunks/persistableUrlUtils.js";import U from"../symbols/WebStyleSymbol.js";import{fetchStyle as j}from"../symbols/support/styleUtils.js";import{ensureType as F}from"../symbols/support/typeUtils.js";import{addPropertyUnsupportedError as O}from"../webdoc/support/unsupportedErrors.js";import{enumeration as G}from"../core/accessorSupport/decorators/enumeration.js";import{writer as D}from"../core/accessorSupport/decorators/writer.js";import{reader as x}from"../core/accessorSupport/decorators/reader.js";var E;const M="uvInfos-watcher",R="uvGroups-watcher",L=",",N=p(q);function P(e){const{field1:t,field2:s,field3:i,fieldDelimiter:o,uniqueValueInfos:l,valueExpression:r}=e,u=!(!t||!s);return[{classes:(l??[]).map(e=>{const{alternateSymbols:l,symbol:n,label:a,value:p,description:f}=e,[d,c,h]=u?p?.toString()?.split(o||"")||[]:[p],m=[];return(t||r)&&m.push(d),s&&m.push(c),i&&m.push(h),{alternateSymbols:l,symbol:n,label:a,values:[m],description:f}})}]}function C(e){return null!=e&&""!==e&&("string"!=typeof e||""!==e.trim()&&"<null>"!==e.toLowerCase())||(e=null),e+""}let z=E=class extends(m(h)){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 s=!1;const i={type:"collection",added:[],removed:[],changed:[],unchanged:[]};for(let o=0;o<t.length;o++){const l=e.find(e=>e.value===t[o].value);l?n(l,t[o])?(i.changed.push({type:"complete",oldValue:l,newValue:t[o]}),s=!0):i.unchanged.push({oldValue:l,newValue:t[o]}):(i.added.push(t[o]),s=!0)}for(let o=0;o<e.length;o++){t.find(t=>t.value===e[o].value)||(i.removed.push(e[o]),s=!0)}return s?i: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:a(e)}writeField(e,t,i,o){"string"==typeof e?t[i]=e:o?.messages?O(o,"UniqueValueRenderer.field","set to a function cannot be written to JSON"):s.getLogger(this).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,s){return s.portal||c.getDefault()}readStyleOrigin(e,t,s){if(t.styleName)return Object.freeze({styleName:t.styleName});if(t.styleUrl){const e=S(t.styleUrl,s);return Object.freeze({styleUrl:e})}}writeStyleOrigin(e,t,s,i){e.styleName?t.styleName=e.styleName:e.styleUrl&&(t.styleUrl=w(e.styleUrl,i))}set uniqueValueGroups(e){this.styleOrigin?s.getLogger(this).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?s.getLogger(this).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 s.getLogger(this).error("#addUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");let i;i="object"==typeof e?N(e):new q({value:e,symbol:F(t)}),this.uniqueValueInfos?.push(i),this._valueInfoMap[C(i.value)]=i,this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos()}removeUniqueValueInfo(e){if(this.styleOrigin)return void s.getLogger(this).error("#removeUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");const t=this.uniqueValueInfos;if(t)for(let s=0;s<t.length;s++){const i=t[s];if(String(i.value)===String(e)){delete this._valueInfoMap[C(e)],t.splice(s,1);break}}this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos()}async getUniqueValueInfo(e,t){let s=t;return this.valueExpression&&null==t?.arcade&&(s={...s,arcade:await I()}),this._getUniqueValueInfo(e,s)}getSymbol(e,t){if(this.valueExpression&&null==t?.arcade)return void s.getLogger(this).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 s=t;if(this.valueExpression&&null==s?.arcade){const e=await I(),{arcadeUtils:t}=e;t.hasGeometryOperations(this.valueExpression)&&await t.enableGeometryOperations(),s={...s,arcade:e}}const i=this._getUniqueValueInfo(e,s);return i?.symbol||this.defaultSymbol}get symbols(){const e=[];if(this._isInfosSource)for(const t of this.uniqueValueInfos??[])t.symbol&&e.push(t.symbol),e.push(...t.alternateSymbols??[]);else for(const t of this.uniqueValueGroups??[])for(const s of t.classes??[])s.symbol&&e.push(s.symbol),e.push(...s.alternateSymbols??[]);return this.defaultSymbol&&e.push(this.defaultSymbol),e}clone(){const e=new E({field:this.field,field2:this.field2,field3:this.field3,defaultLabel:this.defaultLabel,defaultSymbol:t(this.defaultSymbol),orderByClassesEnabled:this.orderByClassesEnabled,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,fieldDelimiter:this.fieldDelimiter,visualVariables:t(this.visualVariables),legendOptions:t(this.legendOptions),authoringInfo:t(this.authoringInfo),backgroundFillSymbol:t(this.backgroundFillSymbol)});this._isDefaultSymbolDerived&&(e._isDefaultSymbolDerived=!0),e._set("portal",this.portal);const s=t(this.uniqueValueInfos),i=t(this.uniqueValueGroups);return this.styleOrigin&&(e._set("styleOrigin",Object.freeze(t(this.styleOrigin))),Object.freeze(s),Object.freeze(i)),e._set("uniqueValueInfos",s),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 s=[this.collectVVRequiredFields(e,t),this.collectSymbolFields(e,t)];await Promise.all(s)}async collectSymbolFields(e,t){const s=[...this.symbols.map(s=>s.collectRequiredFields(e,t)),f(e,t,null,this.valueExpression)];d(e,t,this.field),d(e,t,this.field2),d(e,t,this.field3),await Promise.all(s)}populateFromStyle(){return j(this.styleOrigin,{portal:this.portal}).then(e=>{const t=[];return this._valueInfoMap={},e?.data&&Array.isArray(e.data.items)&&e.data.items.forEach(s=>{const i=new U({styleUrl:e.styleUrl,styleName:e.styleName,portal:this.portal,name:s.name});this.defaultSymbol||s.name!==e.data.defaultItem||(this.defaultSymbol=i,this._isDefaultSymbolDerived=!0);const o=new q({value:s.name,symbol:i});t.push(o),this._valueInfoMap[C(s.name)]=o}),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",L)}_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[C(t.value)]=t}_watchUniqueValueInfosAndGroups(){this._watchUniqueValueInfos(),this._watchUniqueValueGroups()}_watchUniqueValueInfos(){this.removeHandles(M);const{uniqueValueInfos:e}=this;if(e){const t=[];for(const s of e)t.push(o(()=>({symbol:s.symbol,alternateSymbols:s.alternateSymbols,value:s.value,label:s.label,description:s.description}),(e,t)=>{e!==t&&(this._updateGroupsFromInfos(),this._isInfosSource=!0)},{sync:!0}));this.addHandles(t,M)}}_watchUniqueValueGroups(){this.removeHandles(R);const{uniqueValueGroups:e}=this;if(e){const t=[];for(const s of e){t.push(o(()=>({classes:s.classes}),(e,t)=>{e!==t&&(this._updateInfosFromGroups(),this._isInfosSource=!1)},{sync:!0}));for(const e of s.classes??[])t.push(o(()=>({symbol:e.symbol,alternateSymbols:e.alternateSymbols,values:e.values,label:e.label,description:e.description}),(e,t)=>{e!==t&&(this._updateInfosFromGroups(),this._isInfosSource=!1)},{sync:!0}))}this.addHandles(t,R)}}_updateInfosFromGroups(){if(!this.uniqueValueGroups)return this._set("uniqueValueInfos",null),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const e=[],{field:t,field2:s,field3:i,fieldDelimiter:o,uniqueValueGroups:l,valueExpression:r}=this;if(!t&&!r)return this._set("uniqueValueInfos",e),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const u=!(!t||!s);for(const n of l)for(const t of n.classes??[]){const{alternateSymbols:l,symbol:r,label:n,values:a,description:p}=t;for(const t of a??[]){const{value:a,value2:f,value3:d}=t,c=[a];s&&c.push(f),i&&c.push(d);const h=u?c.join(o||""):c[0]??void 0;e.push(new q({alternateSymbols:l,symbol:r,label:n,value:h,description:p}))}}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:s,valueExpression:i,fieldDelimiter:o,uniqueValueInfos:l}=this;if(!t&&!i||!l.length)return this._set("uniqueValueGroups",[]),void this._watchUniqueValueGroups();const r=!(!t||!s),u=l.map(e=>{const{alternateSymbols:t,symbol:s,label:i,value:l,description:u}=e,[n,a,p]=r?l?.toString()?.split(o||"")||[]:[l];return new g({alternateSymbols:t,symbol:s,label:i,description:u,values:[new _({value:n,value2:a,value3:p})]})}),n=[new V({classes:u})];e&&Object.freeze(n),this._set("uniqueValueGroups",n),this._watchUniqueValueGroups()}_getUniqueValueInfo(e,t){return this.valueExpression?this._getUnqiueValueInfoForExpression(e,t):this._getUnqiueValueInfoForFields(e)}_getUnqiueValueInfoForExpression(e,t){const{viewingMode:s,scale:i,spatialReference:o,arcade:l,timeZone:r}=t??{};let u=this._cache.compiledFunc;const n=l.arcadeUtils;if(!u){const e=n.createSyntaxTree(this.valueExpression);u=n.createFunction(e),this._cache.compiledFunc=u}const a=n.executeFunction(u,n.createExecContext(e,n.getViewInfo({viewingMode:s,scale:i,spatialReference:o}),r));return this._valueInfoMap[C(a)]}_getUnqiueValueInfoForFields(e){const t=this.field,s=e.attributes;let i;if(this.field2){const e=this.field2,o=this.field3,l=[];t&&l.push(s[t]),e&&l.push(s[e]),o&&l.push(s[o]),i=l.join(this.fieldDelimiter||"")}else t&&(i=s[t]);return this._valueInfoMap[C(i)]}static fromPortalStyle(e,t){const i=new E(t?.properties);i._set("styleOrigin",Object.freeze({styleName:e})),i._set("portal",t?.portal||c.getDefault());const o=i.populateFromStyle();return o.catch(t=>{s.getLogger(this.prototype).error(`#fromPortalStyle('${e}'[, ...])`,"Failed to create unique value renderer from style name",t)}),o}static fromStyleUrl(e,t){const i=new E(t?.properties);i._set("styleOrigin",Object.freeze({styleUrl:e}));const o=i.populateFromStyle();return o.catch(t=>{s.getLogger(this.prototype).error(`#fromStyleUrl('${e}'[, ...])`,"Failed to create unique value renderer from style URL",t)}),o}};e([l({readOnly:!0})],z.prototype,"_cache",null),e([G({uniqueValue:"unique-value"})],z.prototype,"type",void 0),e([l(y)],z.prototype,"backgroundFillSymbol",void 0),e([l({value:null,json:{type:String,read:{source:"field1"},write:{target:"field1"}}})],z.prototype,"field",null),e([r("field")],z.prototype,"castField",null),e([D("field")],z.prototype,"writeField",null),e([l({type:String,value:null,json:{write:!0}})],z.prototype,"field2",null),e([l({type:String,value:null,json:{write:!0}})],z.prototype,"field3",null),e([l({type:Boolean,json:{name:"drawInClassOrder",default:!1,write:!0,origins:{"web-scene":{write:!1}}}})],z.prototype,"orderByClassesEnabled",void 0),e([l({type:String,value:null,json:{write:!0}})],z.prototype,"valueExpression",null),e([l({type:String,json:{write:!0}})],z.prototype,"valueExpressionTitle",void 0),e([l({type:v,json:{write:!0}})],z.prototype,"legendOptions",void 0),e([l({type:String,json:{write:!0}})],z.prototype,"defaultLabel",void 0),e([l(i({...b},{json:{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}},origins:{"web-scene":{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}}}}}}))],z.prototype,"defaultSymbol",null),e([l({type:String,value:null,json:{write:!0}})],z.prototype,"fieldDelimiter",null),e([l({type:c,readOnly:!0})],z.prototype,"portal",void 0),e([x("portal",["styleName"])],z.prototype,"readPortal",null),e([l({readOnly:!0,json:{write:{enabled:!1,overridePolicy:()=>({enabled:!0})}}})],z.prototype,"styleOrigin",void 0),e([x("styleOrigin",["styleName","styleUrl"])],z.prototype,"readStyleOrigin",null),e([D("styleOrigin",{styleName:{type:String},styleUrl:{type:String}})],z.prototype,"writeStyleOrigin",null),e([l({type:[V],json:{read:{source:["uniqueValueGroups","uniqueValueInfos"],reader:(e,t,s)=>(t.uniqueValueGroups||P(t)).map(e=>V.fromJSON(e,s))},write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],z.prototype,"uniqueValueGroups",null),e([l({type:[q],json:{read:!1,write:{isRequired:!0,overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0,isRequired:!0}}}}})],z.prototype,"uniqueValueInfos",null),z=E=e([u("esri.renderers.UniqueValueRenderer")],z);export{z as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{clone as t}from"../core/lang.js";import s from"../core/Logger.js";import{deepMerge as i}from"../core/object.js";import{watch as l}from"../core/reactiveUtils.js";import{property as o,cast as r,subclass as u}from"../core/accessorSupport/decorators.js";import{diff as n}from"../core/accessorSupport/diffUtils.js";import{ensureString as a,ensureType as p}from"../core/accessorSupport/ensureType.js";import{collectArcadeFieldNames as f,collectField as d}from"../layers/support/fieldUtils.js";import c from"../portal/Portal.js";import h from"./Renderer.js";import{VisualVariablesMixin as m}from"./mixins/VisualVariablesMixin.js";import{rendererBackgroundFillSymbolProperty as y,rendererSymbolProperty as b}from"./support/commonProperties.js";import v from"./support/RendererLegendOptions.js";import{getScaleDependentSymbol as _}from"./support/scaleDependentSymbolUtils.js";import g from"./support/UniqueValue.js";import V from"./support/UniqueValueClass.js";import q from"./support/UniqueValueGroup.js";import I from"./support/UniqueValueInfo.js";import{loadArcade as S}from"../support/loadArcade.js";import{f as w,t as U}from"../chunks/persistableUrlUtils.js";import j from"../symbols/WebStyleSymbol.js";import{fetchStyle as F}from"../symbols/support/styleUtils.js";import{ensureType as O}from"../symbols/support/typeUtils.js";import{addPropertyUnsupportedError as G}from"../webdoc/support/unsupportedErrors.js";import{enumeration as D}from"../core/accessorSupport/decorators/enumeration.js";import{writer as x}from"../core/accessorSupport/decorators/writer.js";import{reader as E}from"../core/accessorSupport/decorators/reader.js";var M;const R="uvInfos-watcher",L="uvGroups-watcher",N=",",P=p(I);function C(e){const{field1:t,field2:s,field3:i,fieldDelimiter:l,uniqueValueInfos:o,valueExpression:r}=e,u=!(!t||!s);return[{classes:(o??[]).map(e=>{const{alternateSymbols:o,symbol:n,label:a,value:p,description:f}=e,[d,c,h]=u?p?.toString()?.split(l||"")||[]:[p],m=[];return(t||r)&&m.push(d),s&&m.push(c),i&&m.push(h),{alternateSymbols:o,symbol:n,label:a,values:[m],description:f}})}]}function z(e){return null!=e&&""!==e&&("string"!=typeof e||""!==e.trim()&&"<null>"!==e.toLowerCase())||(e=null),e+""}let A=M=class extends(m(h)){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 s=!1;const i={type:"collection",added:[],removed:[],changed:[],unchanged:[]};for(let l=0;l<t.length;l++){const o=e.find(e=>e.value===t[l].value);o?n(o,t[l])?(i.changed.push({type:"complete",oldValue:o,newValue:t[l]}),s=!0):i.unchanged.push({oldValue:o,newValue:t[l]}):(i.added.push(t[l]),s=!0)}for(let l=0;l<e.length;l++){t.find(t=>t.value===e[l].value)||(i.removed.push(e[l]),s=!0)}return s?i: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:a(e)}writeField(e,t,i,l){"string"==typeof e?t[i]=e:l?.messages?G(l,"UniqueValueRenderer.field","set to a function cannot be written to JSON"):s.getLogger(this).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,s){return s.portal||c.getDefault()}readStyleOrigin(e,t,s){if(t.styleName)return Object.freeze({styleName:t.styleName});if(t.styleUrl){const e=w(t.styleUrl,s);return Object.freeze({styleUrl:e})}}writeStyleOrigin(e,t,s,i){e.styleName?t.styleName=e.styleName:e.styleUrl&&(t.styleUrl=U(e.styleUrl,i))}set uniqueValueGroups(e){this.styleOrigin?s.getLogger(this).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?s.getLogger(this).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 s.getLogger(this).error("#addUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");let i;i="object"==typeof e?P(e):new I({value:e,symbol:O(t)}),this.uniqueValueInfos?.push(i),this._valueInfoMap[z(i.value)]=i,this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos()}removeUniqueValueInfo(e){if(this.styleOrigin)return void s.getLogger(this).error("#removeUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");const t=this.uniqueValueInfos;if(t)for(let s=0;s<t.length;s++){const i=t[s];if(String(i.value)===String(e)){delete this._valueInfoMap[z(e)],t.splice(s,1);break}}this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos()}async getUniqueValueInfo(e,t){let s=t;return this.valueExpression&&null==t?.arcade&&(s={...s,arcade:await S()}),this._getUniqueValueInfo(e,s)}getSymbol(e,t){if(this.valueExpression&&null==t?.arcade)return void s.getLogger(this).error("#getSymbol()","Please use getSymbolAsync if valueExpression is used");const i=this._getUniqueValueInfo(e,t);return _(i,t?.scale)??this.defaultSymbol}async getSymbolAsync(e,t){let s=t;if(this.valueExpression&&null==s?.arcade){const e=await S(),{arcadeUtils:t}=e;t.hasGeometryOperations(this.valueExpression)&&await t.enableGeometryOperations(),s={...s,arcade:e}}const i=this._getUniqueValueInfo(e,t);return _(i,t?.scale)??this.defaultSymbol}get symbols(){const e=[];if(this._isInfosSource)for(const t of this.uniqueValueInfos??[])t.symbol&&e.push(t.symbol),e.push(...t.alternateSymbols??[]);else for(const t of this.uniqueValueGroups??[])for(const s of t.classes??[])s.symbol&&e.push(s.symbol),e.push(...s.alternateSymbols??[]);return this.defaultSymbol&&e.push(this.defaultSymbol),e}clone(){const e=new M({field:this.field,field2:this.field2,field3:this.field3,defaultLabel:this.defaultLabel,defaultSymbol:t(this.defaultSymbol),orderByClassesEnabled:this.orderByClassesEnabled,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,fieldDelimiter:this.fieldDelimiter,visualVariables:t(this.visualVariables),legendOptions:t(this.legendOptions),authoringInfo:t(this.authoringInfo),backgroundFillSymbol:t(this.backgroundFillSymbol)});this._isDefaultSymbolDerived&&(e._isDefaultSymbolDerived=!0),e._set("portal",this.portal);const s=t(this.uniqueValueInfos),i=t(this.uniqueValueGroups);return this.styleOrigin&&(e._set("styleOrigin",Object.freeze(t(this.styleOrigin))),Object.freeze(s),Object.freeze(i)),e._set("uniqueValueInfos",s),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 s=[this.collectVVRequiredFields(e,t),this.collectSymbolFields(e,t)];await Promise.all(s)}async collectSymbolFields(e,t){const s=[...this.symbols.map(s=>s.collectRequiredFields(e,t)),f(e,t,null,this.valueExpression)];d(e,t,this.field),d(e,t,this.field2),d(e,t,this.field3),await Promise.all(s)}populateFromStyle(){return F(this.styleOrigin,{portal:this.portal}).then(e=>{const t=[];return this._valueInfoMap={},e?.data&&Array.isArray(e.data.items)&&e.data.items.forEach(s=>{const i=new j({styleUrl:e.styleUrl,styleName:e.styleName,portal:this.portal,name:s.name});this.defaultSymbol||s.name!==e.data.defaultItem||(this.defaultSymbol=i,this._isDefaultSymbolDerived=!0);const l=new I({value:s.name,symbol:i});t.push(l),this._valueInfoMap[z(s.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",N)}_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[z(t.value)]=t}_watchUniqueValueInfosAndGroups(){this._watchUniqueValueInfos(),this._watchUniqueValueGroups()}_watchUniqueValueInfos(){this.removeHandles(R);const{uniqueValueInfos:e}=this;if(e){const t=[];for(const s of e)t.push(l(()=>({symbol:s.symbol,alternateSymbols:s.alternateSymbols,value:s.value,label:s.label,description:s.description}),(e,t)=>{e!==t&&(this._updateGroupsFromInfos(),this._isInfosSource=!0)},{sync:!0}));this.addHandles(t,R)}}_watchUniqueValueGroups(){this.removeHandles(L);const{uniqueValueGroups:e}=this;if(e){const t=[];for(const s of e){t.push(l(()=>({classes:s.classes}),(e,t)=>{e!==t&&(this._updateInfosFromGroups(),this._isInfosSource=!1)},{sync:!0}));for(const e of s.classes??[])t.push(l(()=>({symbol:e.symbol,alternateSymbols:e.alternateSymbols,values:e.values,label:e.label,description:e.description}),(e,t)=>{e!==t&&(this._updateInfosFromGroups(),this._isInfosSource=!1)},{sync:!0}))}this.addHandles(t,L)}}_updateInfosFromGroups(){if(!this.uniqueValueGroups)return this._set("uniqueValueInfos",null),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const e=[],{field:t,field2:s,field3:i,fieldDelimiter:l,uniqueValueGroups:o,valueExpression:r}=this;if(!t&&!r)return this._set("uniqueValueInfos",e),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const u=!(!t||!s);for(const n of o)for(const t of n.classes??[]){const{alternateSymbols:o,symbol:r,label:n,values:a,description:p}=t;for(const t of a??[]){const{value:a,value2:f,value3:d}=t,c=[a];s&&c.push(f),i&&c.push(d);const h=u?c.join(l||""):c[0]??void 0;e.push(new I({alternateSymbols:o,symbol:r,label:n,value:h,description:p}))}}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:s,valueExpression:i,fieldDelimiter:l,uniqueValueInfos:o}=this;if(!t&&!i||!o.length)return this._set("uniqueValueGroups",[]),void this._watchUniqueValueGroups();const r=!(!t||!s),u=o.map(e=>{const{alternateSymbols:t,symbol:s,label:i,value:o,description:u}=e,[n,a,p]=r?o?.toString()?.split(l||"")||[]:[o];return new V({alternateSymbols:t,symbol:s,label:i,description:u,values:[new g({value:n,value2:a,value3:p})]})}),n=[new q({classes:u})];e&&Object.freeze(n),this._set("uniqueValueGroups",n),this._watchUniqueValueGroups()}_getUniqueValueInfo(e,t){return this.valueExpression?this._getUnqiueValueInfoForExpression(e,t):this._getUnqiueValueInfoForFields(e)}_getUnqiueValueInfoForExpression(e,t){const{viewingMode:s,scale:i,spatialReference:l,arcade:o,timeZone:r}=t??{};let u=this._cache.compiledFunc;const n=o.arcadeUtils;if(!u){const e=n.createSyntaxTree(this.valueExpression);u=n.createFunction(e),this._cache.compiledFunc=u}const a=n.executeFunction(u,n.createExecContext(e,n.getViewInfo({viewingMode:s,scale:i,spatialReference:l}),r));return this._valueInfoMap[z(a)]}_getUnqiueValueInfoForFields(e){const t=this.field,s=e.attributes;let i;if(this.field2){const e=this.field2,l=this.field3,o=[];t&&o.push(s[t]),e&&o.push(s[e]),l&&o.push(s[l]),i=o.join(this.fieldDelimiter||"")}else t&&(i=s[t]);return this._valueInfoMap[z(i)]}static fromPortalStyle(e,t){const i=new M(t?.properties);i._set("styleOrigin",Object.freeze({styleName:e})),i._set("portal",t?.portal||c.getDefault());const l=i.populateFromStyle();return l.catch(t=>{s.getLogger(this.prototype).error(`#fromPortalStyle('${e}'[, ...])`,"Failed to create unique value renderer from style name",t)}),l}static fromStyleUrl(e,t){const i=new M(t?.properties);i._set("styleOrigin",Object.freeze({styleUrl:e}));const l=i.populateFromStyle();return l.catch(t=>{s.getLogger(this.prototype).error(`#fromStyleUrl('${e}'[, ...])`,"Failed to create unique value renderer from style URL",t)}),l}};e([o({readOnly:!0})],A.prototype,"_cache",null),e([D({uniqueValue:"unique-value"})],A.prototype,"type",void 0),e([o(y)],A.prototype,"backgroundFillSymbol",void 0),e([o({value:null,json:{type:String,read:{source:"field1"},write:{target:"field1"}}})],A.prototype,"field",null),e([r("field")],A.prototype,"castField",null),e([x("field")],A.prototype,"writeField",null),e([o({type:String,value:null,json:{write:!0}})],A.prototype,"field2",null),e([o({type:String,value:null,json:{write:!0}})],A.prototype,"field3",null),e([o({type:Boolean,json:{name:"drawInClassOrder",default:!1,write:!0,origins:{"web-scene":{write:!1}}}})],A.prototype,"orderByClassesEnabled",void 0),e([o({type:String,value:null,json:{write:!0}})],A.prototype,"valueExpression",null),e([o({type:String,json:{write:!0}})],A.prototype,"valueExpressionTitle",void 0),e([o({type:v,json:{write:!0}})],A.prototype,"legendOptions",void 0),e([o({type:String,json:{write:!0}})],A.prototype,"defaultLabel",void 0),e([o(i({...b},{json:{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}},origins:{"web-scene":{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}}}}}}))],A.prototype,"defaultSymbol",null),e([o({type:String,value:null,json:{write:!0}})],A.prototype,"fieldDelimiter",null),e([o({type:c,readOnly:!0})],A.prototype,"portal",void 0),e([E("portal",["styleName"])],A.prototype,"readPortal",null),e([o({readOnly:!0,json:{write:{enabled:!1,overridePolicy:()=>({enabled:!0})}}})],A.prototype,"styleOrigin",void 0),e([E("styleOrigin",["styleName","styleUrl"])],A.prototype,"readStyleOrigin",null),e([x("styleOrigin",{styleName:{type:String},styleUrl:{type:String}})],A.prototype,"writeStyleOrigin",null),e([o({type:[q],json:{read:{source:["uniqueValueGroups","uniqueValueInfos"],reader:(e,t,s)=>(t.uniqueValueGroups||C(t)).map(e=>q.fromJSON(e,s))},write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],A.prototype,"uniqueValueGroups",null),e([o({type:[I],json:{read:!1,write:{isRequired:!0,overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0,isRequired:!0}}}}})],A.prototype,"uniqueValueInfos",null),A=M=e([u("esri.renderers.UniqueValueRenderer")],A);export{A as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
function n(n,r){if(null==n)return null;if(null==r)return n.symbol;if(null!=n.symbol&&l(n.symbol,r))return n.symbol;for(const t of n.alternateSymbols??[])if(l(t,r))return t;return null}function l(n,l){if("cim"!==n.type)return!0;const r=n.data?.minScale??0,t=n.data?.maxScale??0;return(!t||l>t)&&(!r||l<=r)}export{n as getScaleDependentSymbol};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import t from"../../../request.js";import{parseUrl as
|
|
2
|
+
import t from"../../../request.js";import{parseUrl as o,encode as r,asValidOptions as s}from"../../utils.js";import u from"./support/QueryCircuitsResult.js";async function e(e,i,p){const m=o(e),a={...i.toJSON(),f:"json"},n=r({...m.query,...a}),c=s(n,{...p,method:"post",authMode:"no-prompt"}),f=`${m.path}/circuits/query`,{data:j}=await t(f,c);return u.fromJSON(j)}export{e as queryCircuits};
|
|
@@ -1,39 +1,45 @@
|
|
|
1
1
|
import type CircuitLocation from "../../../../networks/support/CircuitLocation.js";
|
|
2
2
|
import type { JSONSupport } from "../../../../core/JSONSupport.js";
|
|
3
|
+
import type { CircuitHierarchy, CircuitStatus } from "../../../../networks/support/typeUtils.js";
|
|
3
4
|
import type { CircuitLocationProperties } from "../../../../networks/support/CircuitLocation.js";
|
|
4
5
|
|
|
5
6
|
/** @since 5.0 */
|
|
6
|
-
export interface QueryCircuitsParametersProperties extends Partial<Pick<QueryCircuitsParameters, "
|
|
7
|
+
export interface QueryCircuitsParametersProperties extends Partial<Pick<QueryCircuitsParameters, "circuitHierarchy" | "circuitStatus" | "locationType">> {
|
|
7
8
|
/**
|
|
8
|
-
* The
|
|
9
|
+
* The list of locations to query circuits by.
|
|
9
10
|
*
|
|
10
|
-
* @since 5.
|
|
11
|
+
* @since 5.1
|
|
11
12
|
*/
|
|
12
|
-
|
|
13
|
+
locations?: CircuitLocationProperties[] | null;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
/** @since 5.0 */
|
|
16
17
|
export default class QueryCircuitsParameters extends JSONSupport {
|
|
17
18
|
constructor(properties?: QueryCircuitsParametersProperties);
|
|
18
19
|
/**
|
|
19
|
-
*
|
|
20
|
+
* Specifies whether to return the associated consumer and provider circuits with the queried circuit.
|
|
20
21
|
*
|
|
21
|
-
* @
|
|
22
|
+
* @default "none"
|
|
23
|
+
* @since 5.1
|
|
22
24
|
*/
|
|
23
|
-
|
|
24
|
-
set location(value: CircuitLocationProperties | null | undefined);
|
|
25
|
+
accessor circuitHierarchy: CircuitHierarchy;
|
|
25
26
|
/**
|
|
26
|
-
*
|
|
27
|
+
* Specifies whether to filter the result of the query to return only circuits of a certain status.
|
|
27
28
|
*
|
|
28
|
-
* @since 5.
|
|
29
|
+
* @since 5.1
|
|
29
30
|
*/
|
|
30
|
-
accessor
|
|
31
|
+
accessor circuitStatus: CircuitStatus | null | undefined;
|
|
31
32
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
33
|
+
* The list of locations to query circuits by.
|
|
34
|
+
*
|
|
35
|
+
* @since 5.1
|
|
36
|
+
*/
|
|
37
|
+
get locations(): CircuitLocation[] | null | undefined;
|
|
38
|
+
set locations(value: CircuitLocationProperties[] | null | undefined);
|
|
39
|
+
/**
|
|
40
|
+
* The type of location to query circuits by.
|
|
34
41
|
*
|
|
35
|
-
* @default false
|
|
36
42
|
* @since 5.0
|
|
37
43
|
*/
|
|
38
|
-
accessor
|
|
44
|
+
accessor locationType: "start" | "stop" | "all" | null | undefined;
|
|
39
45
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{JSONSupport as
|
|
2
|
+
import{__decorate as t}from"tslib";import{JSONSupport as r}from"../../../../core/JSONSupport.js";import{property as i,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{ensureClass as e}from"../../../../core/accessorSupport/ensureType.js";import s from"../../../../networks/support/CircuitLocation.js";import{CircuitHierarchyKebabDict as p}from"../../../../networks/support/typeUtils.js";var n;let c=n=class extends r{static from(t){return e(n,t)}constructor(t){super(t),this.gdbVersion=null,this.sessionId=null,this.moment=null,this.domainNetworkName=null,this.circuits=null,this.circuitIds=null,this.locations=null,this.circuitHierarchy="none",this.circuitStatus=null,this.resultTypes=null}};t([i({type:String,json:{write:!0}})],c.prototype,"gdbVersion",void 0),t([i({type:String,json:{write:!0}})],c.prototype,"sessionId",void 0),t([i({type:Date,json:{type:Number,write:{writer:(t,r)=>{r.moment=t?t.getTime():null}}}})],c.prototype,"moment",void 0),t([i({type:String,json:{write:!0}})],c.prototype,"domainNetworkName",void 0),t([i({type:[String],json:{write:{writer:(t,r)=>r.circuits=JSON.stringify(t??[])}}})],c.prototype,"circuits",void 0),t([i({type:[String],json:{write:{writer:(t,r)=>r.circuitIds=JSON.stringify(t??[])}}})],c.prototype,"circuitIds",void 0),t([i({type:[s],json:{write:{writer:(t,r)=>r.locations=JSON.stringify(t??[])}}})],c.prototype,"locations",void 0),t([i({type:String,json:{write:!0}})],c.prototype,"locationType",void 0),t([i({type:p.apiValues,json:{type:p.jsonValues,read:p.read,write:p.write}})],c.prototype,"circuitHierarchy",void 0),t([i({type:String,json:{write:!0}})],c.prototype,"circuitStatus",void 0),t([i({type:[String],json:{write:{writer:(t,r)=>r.resultTypes=JSON.stringify(t??[])}}})],c.prototype,"resultTypes",void 0),c=n=t([o("esri.rest.networks.circuits.support.QueryCircuitsParameters")],c);const u=c;export{u as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import t from"../../../request.js";import{urlToObject as n,join as r}from"../../../core/urlUtils.js";import{normalizeCentralMeridian as e}from"../../../geometry/support/normalizeUtils.js";import{mapParameters as o}from"../../operations/urlUtils.js";import{parsePBFFeatureQuery as u}from"./pbfQueryUtils.js";import{safeExtentResultFormat as s,queryLikeToQueryStringParameters as i}from"./queryUtils.js";import{applyFeatureSetZUnitScaling as c}from"./queryZScale.js";const a="Layer does not support extent calculation.";function y(t,n,r){return i(t,n,r)}async function l(t,n,r,e,o){const u=n.timeExtent?.isEmpty?{features:[]}:await
|
|
2
|
+
import t from"../../../request.js";import{urlToObject as n,join as r}from"../../../core/urlUtils.js";import{normalizeCentralMeridian as e}from"../../../geometry/support/normalizeUtils.js";import{mapParameters as o}from"../../operations/urlUtils.js";import{parsePBFFeatureQuery as u}from"./pbfQueryUtils.js";import{safeExtentResultFormat as s,queryLikeToQueryStringParameters as i}from"./queryUtils.js";import{applyFeatureSetZUnitScaling as c}from"./queryZScale.js";const a="Layer does not support extent calculation.";function y(t,n,r){return i(t,n,r)}async function l(t,n,r,e,o){const u=n.timeExtent?.isEmpty?{features:[]}:await d(t,n,"json",e,void 0,o);return c(n,r,u),u}async function f(t,n,r,e,o){if(n.timeExtent?.isEmpty)return r.featureSet;const s=await m(t,n,e,o);return u(s,r)}function m(t,n,r,e){return d(t,n,"pbf",r,void 0,e)}function p(t,n,r,e){return n.timeExtent?.isEmpty?Promise.resolve({objectIds:[]}):d(t,n,"json",r,{returnIdsOnly:!0},e)}async function O(t,n,r,e){return n.timeExtent?.isEmpty?0:(await d(t,n,"json",r,{returnCountOnly:!0},e)).count}async function w(t,n,r){if(n.timeExtent?.isEmpty)return{count:0,extent:null};const e=await d(t,n,s,r,{returnExtentOnly:!0,returnCountOnly:!0});if(e.hasOwnProperty("extent"))return e;const o="string"==typeof t?t:t.path;if(/\/imageserver\/?$/i.test(o)&&e.hasOwnProperty("count")){const o=await d(t,n,s,r,{returnExtentOnly:!0});return{count:e.count,extent:o.extent}}if(e.features)throw new Error(a);if(e.hasOwnProperty("count"))throw new Error(a);return e}function E(t,n){if(!t.returnIdsOnly||!n.uniqueIdFields)return t;const r={...t,returnUniqueIdsOnly:!0};return delete r.returnIdsOnly,r}async function d(n,r,e,o={},u={},s={}){const i=await j(n,r,e,o,u,s),c="json"===e?"json":"array-buffer";return t(i.url,{responseType:c,...i.options}).then(({data:t})=>t)}async function j(t,u,s,i,c={},a={}){const l="string"==typeof t?n(t):t,f=u.geometry?[u.geometry]:[],m=await e(f,null,{signal:i.signal}),p=m?.[0];if(null!=p){const t=u.clone();t.geometry=p.clone(),u=t}const O=o({...l.query,f:s,...E(c,a),...y(u,c,a)});return i={...i,query:{...O,...i.query}},new x(r(l.path,h(u,c)?"query3d":"query"),i)}class x{constructor(t,n){this.url=t,this.options=n}}function h(t,n){return null!=t.formatOf3DObjects&&!(n.returnCountOnly||n.returnExtentOnly||n.returnIdsOnly)}export{x as RunQueryParameters,l as executeQuery,O as executeQueryForCount,w as executeQueryForExtent,p as executeQueryForIds,f as executeQueryPBF,m as executeQueryPBFBuffer,j as getQueryParameters,y as queryToQueryStringParameters,d as runQuery};
|
package/rest/support/Query.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{JSONMap as e}from"../../core/jsonMap.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import{clone as o}from"../../core/lang.js";import{property as i,cast as s,subclass as n}from"../../core/accessorSupport/decorators.js";import{ensureClass as a}from"../../core/accessorSupport/ensureType.js";import l from"../../geometry/Point.js";import p from"../../geometry/SpatialReference.js";import{fromJSON as u}from"../../geometry/support/jsonUtils.js";import{geometryTypes as m}from"../../geometry/support/typeUtils.js";import d from"../layerSources/DynamicDataLayer.js";import c from"./FullTextSearch.js";import y from"./QuantizationParameters.js";import{spatialRelKebabDict as h}from"./spatialRelationships.js";import f from"./StatisticDefinition.js";import
|
|
2
|
+
import{__decorate as t}from"tslib";import{JSONMap as e}from"../../core/jsonMap.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import{clone as o}from"../../core/lang.js";import{property as i,cast as s,subclass as n}from"../../core/accessorSupport/decorators.js";import{ensureClass as a}from"../../core/accessorSupport/ensureType.js";import l from"../../geometry/Point.js";import p from"../../geometry/SpatialReference.js";import{fromJSON as u}from"../../geometry/support/jsonUtils.js";import{geometryTypes as m}from"../../geometry/support/typeUtils.js";import d from"../layerSources/DynamicDataLayer.js";import c from"./FullTextSearch.js";import y from"./QuantizationParameters.js";import{spatialRelKebabDict as h}from"./spatialRelationships.js";import f from"./StatisticDefinition.js";import g from"../../time/TimeExtent.js";import{writer as v}from"../../core/accessorSupport/decorators/writer.js";import{enumeration as j}from"../../core/accessorSupport/decorators/enumeration.js";var w;const S=new e({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let R=class extends r{static{w=this}static from(t){return a(w,t)}constructor(t){super(t),this.aggregateIds=null,this.cacheHint=void 0,this.compactGeometryEnabled=!1,this.datumTransformation=null,this.defaultSpatialReferenceEnabled=!1,this.distance=void 0,this.dynamicDataSource=void 0,this.formatOf3DObjects=null,this.fullText=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=void 0,this.groupByFieldsForStatistics=null,this.having=null,this.historicMoment=null,this.maxAllowableOffset=void 0,this.maxRecordCountFactor=1,this.multipatchOption=null,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.outStatistics=null,this.parameterValues=null,this.pixelSize=null,this.quantizationParameters=null,this.rangeValues=null,this.relationParameter=null,this.resultType=null,this.returnAggregateIds=!1,this.returnCentroid=!1,this.returnDistinctValues=!1,this.returnExceededLimitFeatures=!0,this.returnGeometry=!1,this.returnQueryGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.returnTrueCurves=void 0,this.sourceSpatialReference=null,this.spatialRelationship="intersects",this.start=void 0,this.sqlFormat=null,this.text=null,this.timeExtent=null,this.timeReferenceUnknownClient=!1,this.units=null,this.outDistance=null,this.where=null}castDatumTransformation(t){return"number"==typeof t||"object"==typeof t?t:null}writeHistoricMoment(t,e){e.historicMoment=t&&t.getTime()}writeParameterValues(t,e){if(t){const r={};for(const e in t){const o=t[e];Array.isArray(o)?r[e]=o.map(t=>t instanceof Date?t.getTime():t):o instanceof Date?r[e]=o.getTime():r[e]=o}e.parameterValues=r}}writeStart(t,e){e.resultOffset=this.start,e.resultRecordCount=this.num||10,e.where="1=1"}writeWhere(t,e){e.where=t||"1=1"}clone(){return new w(o({aggregateIds:this.aggregateIds,cacheHint:this.cacheHint,compactGeometryEnabled:this.compactGeometryEnabled,datumTransformation:this.datumTransformation,defaultSpatialReferenceEnabled:this.defaultSpatialReferenceEnabled,distance:this.distance,fullText:this.fullText,formatOf3DObjects:this.formatOf3DObjects,gdbVersion:this.gdbVersion,geometry:this.geometry,geometryPrecision:this.geometryPrecision,groupByFieldsForStatistics:this.groupByFieldsForStatistics,having:this.having,historicMoment:null!=this.historicMoment?new Date(this.historicMoment):null,maxAllowableOffset:this.maxAllowableOffset,maxRecordCountFactor:this.maxRecordCountFactor,multipatchOption:this.multipatchOption,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,outStatistics:this.outStatistics,parameterValues:this.parameterValues,pixelSize:this.pixelSize,quantizationParameters:this.quantizationParameters,rangeValues:this.rangeValues,relationParameter:this.relationParameter,resultType:this.resultType,returnAggregateIds:this.returnAggregateIds,returnDistinctValues:this.returnDistinctValues,returnGeometry:this.returnGeometry,returnCentroid:this.returnCentroid,returnExceededLimitFeatures:this.returnExceededLimitFeatures,returnQueryGeometry:this.returnQueryGeometry,returnM:this.returnM,returnZ:this.returnZ,returnTrueCurves:this.returnTrueCurves,dynamicDataSource:this.dynamicDataSource,sourceSpatialReference:this.sourceSpatialReference,spatialRelationship:this.spatialRelationship,start:this.start,sqlFormat:this.sqlFormat,text:this.text,timeExtent:this.timeExtent,timeReferenceUnknownClient:this.timeReferenceUnknownClient,units:this.units,outDistance:this.outDistance,where:this.where}))}static{this.MAX_MAX_RECORD_COUNT_FACTOR=5}};t([i({json:{write:!0}})],R.prototype,"aggregateIds",void 0),t([i({type:Boolean,json:{write:!0}})],R.prototype,"cacheHint",void 0),t([i({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"compactGeometryEnabled",void 0),t([i({json:{write:!0}})],R.prototype,"datumTransformation",void 0),t([s("datumTransformation")],R.prototype,"castDatumTransformation",null),t([i({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"defaultSpatialReferenceEnabled",void 0),t([i({type:Number,json:{write:!0}})],R.prototype,"distance",void 0),t([i({type:d,json:{write:!0}})],R.prototype,"dynamicDataSource",void 0),t([i({type:String,json:{write:!0}})],R.prototype,"formatOf3DObjects",void 0),t([i({type:[c],json:{write:{enabled:!0,overridePolicy(){return{enabled:null!=this.fullText&&this.fullText.length>0}}}}})],R.prototype,"fullText",void 0),t([i({type:String,json:{write:!0}})],R.prototype,"gdbVersion",void 0),t([i({types:m,json:{read:u,write:!0}})],R.prototype,"geometry",void 0),t([i({type:Number,json:{write:!0}})],R.prototype,"geometryPrecision",void 0),t([i({type:[String],json:{write:!0}})],R.prototype,"groupByFieldsForStatistics",void 0),t([i({type:String,json:{write:!0}})],R.prototype,"having",void 0),t([i({type:Date})],R.prototype,"historicMoment",void 0),t([v("historicMoment")],R.prototype,"writeHistoricMoment",null),t([i({type:Number,json:{write:!0}})],R.prototype,"maxAllowableOffset",void 0),t([i({type:Number,cast:t=>t<1?1:t>R.MAX_MAX_RECORD_COUNT_FACTOR?R.MAX_MAX_RECORD_COUNT_FACTOR:t,json:{write:{overridePolicy:t=>({enabled:t>1})}}})],R.prototype,"maxRecordCountFactor",void 0),t([i({type:["xyFootprint"],json:{write:!0}})],R.prototype,"multipatchOption",void 0),t([i({type:Number,json:{read:{source:"resultRecordCount"}}})],R.prototype,"num",void 0),t([i({json:{write:!0}})],R.prototype,"objectIds",void 0),t([i({type:[String],json:{write:!0}})],R.prototype,"orderByFields",void 0),t([i({type:[String],json:{write:!0}})],R.prototype,"outFields",void 0),t([i({type:p,json:{name:"outSR",write:!0}})],R.prototype,"outSpatialReference",void 0),t([i({type:[f],json:{write:{enabled:!0,overridePolicy(){return{enabled:null!=this.outStatistics&&this.outStatistics.length>0}}}}})],R.prototype,"outStatistics",void 0),t([i({json:{write:!0}})],R.prototype,"parameterValues",void 0),t([v("parameterValues")],R.prototype,"writeParameterValues",null),t([i({type:l,json:{write:!0}})],R.prototype,"pixelSize",void 0),t([i({type:y,json:{write:!0}})],R.prototype,"quantizationParameters",void 0),t([i({type:[Object],json:{write:!0}})],R.prototype,"rangeValues",void 0),t([i({type:String,json:{read:{source:"relationParam"},write:{target:"relationParam",overridePolicy(){return{enabled:"relation"===this.spatialRelationship}}}}})],R.prototype,"relationParameter",void 0),t([i({type:String,json:{write:!0}})],R.prototype,"resultType",void 0),t([i({type:Boolean,json:{name:"returnAggIds",write:{overridePolicy(t){return{enabled:t&&!!this.groupByFieldsForStatistics?.length&&!!this.outStatistics?.length}}}}})],R.prototype,"returnAggregateIds",void 0),t([i({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"returnCentroid",void 0),t([i({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"returnDistinctValues",void 0),t([i({type:Boolean,json:{default:!0,write:!0}})],R.prototype,"returnExceededLimitFeatures",void 0),t([i({type:Boolean,json:{write:!0}})],R.prototype,"returnGeometry",void 0),t([i({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"returnQueryGeometry",void 0),t([i({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"returnM",void 0),t([i({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],R.prototype,"returnZ",void 0),t([i({type:Boolean,json:{write:!0}})],R.prototype,"returnTrueCurves",void 0),t([i({type:p,json:{write:!0}})],R.prototype,"sourceSpatialReference",void 0),t([j(h,{ignoreUnknown:!1,name:"spatialRel"})],R.prototype,"spatialRelationship",void 0),t([i({type:Number,json:{read:{source:"resultOffset"}}})],R.prototype,"start",void 0),t([v("start"),v("num")],R.prototype,"writeStart",null),t([i({type:String,json:{write:!0}})],R.prototype,"sqlFormat",void 0),t([i({type:String,json:{write:!0}})],R.prototype,"text",void 0),t([i({type:g,json:{write:!0}})],R.prototype,"timeExtent",void 0),t([i({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"timeReferenceUnknownClient",void 0),t([j(S,{ignoreUnknown:!1}),i({json:{write:{overridePolicy(t){return{enabled:!!t&&null!=this.distance}}}}})],R.prototype,"units",void 0),t([i()],R.prototype,"outDistance",void 0),t([i({type:String,json:{write:{overridePolicy(t){return{enabled:null!=t||null!=this.start&&this.start>0}}}}})],R.prototype,"where",void 0),t([v("where")],R.prototype,"writeWhere",null),R=w=t([n("esri.rest.support.Query")],R);export{R as default};
|
package/support/revision.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
const
|
|
2
|
+
const c="20260430",a="25a21c0430b606c2f0d6d5af52467c615ac694da";export{c as buildDate,a as commitHash};
|
package/third-party-notices.txt
CHANGED
|
@@ -772,23 +772,30 @@ DEALINGS IN THE SOFTWARE.
|
|
|
772
772
|
|
|
773
773
|
-------------------------------------------------------------------------------
|
|
774
774
|
|
|
775
|
-
|
|
775
|
+
wuff/
|
|
776
776
|
|
|
777
|
-
https://github.com/
|
|
777
|
+
https://github.com/nicoburns/wuff
|
|
778
778
|
|
|
779
|
-
Copyright
|
|
779
|
+
Copyright (c) 2013-2017 by the WOFF2 Authors.
|
|
780
|
+
Copyright (c) 2025 by Nico Burns.
|
|
780
781
|
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
782
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
783
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
784
|
+
in the Software without restriction, including without limitation the rights
|
|
785
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
786
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
787
|
+
furnished to do so, subject to the following conditions:
|
|
784
788
|
|
|
785
|
-
|
|
789
|
+
The above copyright notice and this permission notice shall be included in
|
|
790
|
+
all copies or substantial portions of the Software.
|
|
786
791
|
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
793
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
794
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
795
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
796
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
797
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
798
|
+
THE SOFTWARE.
|
|
792
799
|
|
|
793
800
|
-------------------------------------------------------------------------------
|
|
794
801
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
const t=1e20;class e{constructor(t){this.sdfSizePx=t.sdfSizePx,this.sdfBufferPx=t.sdfBufferPx,this.radius=t.radius,this.cutoff=t.cutoff;const e=t.sdfSizePx
|
|
2
|
+
const t=1e20;class e{constructor(t){this.sdfSizePx=t.sdfSizePx,this.sdfBufferPx=t.sdfBufferPx,this.radius=t.radius,this.cutoff=t.cutoff;const e=3*t.sdfSizePx;this.canvasSize=e;const s=this._createCanvas(e);this.context=s.getContext("2d",{willReadFrequently:!0}),this.context.imageSmoothingEnabled=!1,this.gridOuter=new Float64Array(e*e),this.gridInner=new Float64Array(e*e),this.gridValues=new Float64Array(e),this.parabolaBoundaries=new Float64Array(e+1),this.parabolaIndices=new Uint16Array(e)}draw(e,s){const{context:a,gridInner:i,gridOuter:r,sdfSizePx:n,sdfBufferPx:o,canvasSize:h,cutoff:l,radius:c}=this,d=n/e.units_per_em();this.context.fillStyle="black",this.context.strokeStyle="black",this.context.resetTransform(),this.context.clearRect(0,0,h,h),this.context.translate(this.sdfSizePx,this.sdfSizePx),this.context.scale(d,d);const f=e.paintCurves(s,a);if(!f)return null;const u=f.xMin*d,x=f.xMax*d,g=f.yMin*d,M=f.yMax*d;f.free();const w=Math.ceil(x-u),y=Math.ceil(M-g),S=Math.floor(n+u-o),_=Math.floor(n+g-o),m=w+2*o,p=y+2*o,P=new Uint8ClampedArray(Math.max(m*p,0)),b=a.getImageData(S,_,m,p);r.fill(t,0,P.length),i.fill(0,0,P.length);for(let v=0;v<p;v++)for(let e=0;e<m;e++){const s=p-1-v,a=b.data[4*(s*m+e)+3]/255;if(0===a)continue;const n=v*m+e;if(1===a)r[n]=0,i[n]=t;else{const t=.5-a;r[n]=t>0?t*t:0,i[n]=t<0?t*t:0}}this._edt(r,0,0,m,p,m),this._edt(i,0,0,m,p,m);for(let t=0;t<P.length;t++){const e=Math.sqrt(r[t])-Math.sqrt(i[t]);P[t]=Math.round(255-255*(e/c+l))}const z=d*e.face_height();return{buffer:P,width:w,height:y,top:Math.round(M-z+2*o),left:Math.round(u-o)}}_createCanvas(t){const e=document.createElement("canvas");return e.width=e.height=t,e}_edt(t,e,s,a,i,r){for(let n=e;n<e+a;n++)this._edt1d(t,s*r+n,r,i);for(let n=s;n<s+i;n++)this._edt1d(t,n*r+e,1,a)}_edt1d(e,s,a,i){const r=this.parabolaIndices,n=this.parabolaBoundaries,o=this.gridValues;r[0]=0,n[0]=-t,n[1]=t,o[0]=e[s];let h=0;for(let l=1;l<i;l++){o[l]=e[s+l*a];const i=l*l;let c;do{const t=r[h];c=(o[l]-o[t]+i-t*t)/(l-t)/2}while(c<=n[h]&&--h>-1);h++,r[h]=l,n[h]=c,n[h+1]=t}for(let t=0,l=0;t<i;t++){for(;n[l+1]<t;)l++;const i=r[l],h=t-i;e[s+t*a]=o[i]+h*h}}}export{e as GlyphSDFCreator};
|