@arcgis/map-components 5.1.0-next.30 → 5.1.0-next.31

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.
Files changed (34) hide show
  1. package/dist/cdn/{4WKSSPS5.js → 4IFAJH4D.js} +1 -1
  2. package/dist/cdn/{KUYMBEIV.js → 6I4ST6BV.js} +1 -1
  3. package/dist/cdn/{BTIV4UDX.js → 6OMMETC4.js} +1 -1
  4. package/dist/cdn/{EAQLT2UN.js → A6SBSKY7.js} +1 -1
  5. package/dist/cdn/CAXI6CJY.js +2 -0
  6. package/dist/cdn/{227WPY6O.js → DQUREUJ4.js} +1 -1
  7. package/dist/cdn/HIASLYKF.js +2 -0
  8. package/dist/cdn/{VGP43HGK.js → HSXR7HAG.js} +1 -1
  9. package/dist/cdn/{SUZEU5HH.js → LONLK6RH.js} +1 -1
  10. package/dist/cdn/{SY5BLQ77.js → P4RZQHRD.js} +1 -1
  11. package/dist/cdn/{YOOYHZ7L.js → Q3NBRWIQ.js} +1 -1
  12. package/dist/cdn/{F42JMDII.js → SUAJ2D6L.js} +1 -1
  13. package/dist/cdn/{MBIE3GJO.js → T36AHJZT.js} +1 -1
  14. package/dist/cdn/{YTOLDZ6E.js → V5FNVAX5.js} +1 -1
  15. package/dist/cdn/{2AHOSQID.js → WO76BRRK.js} +1 -1
  16. package/dist/cdn/{ED2GZNOR.js → Y2HW37MS.js} +1 -1
  17. package/dist/cdn/{2D47DQA5.js → YBL2FOGP.js} +1 -1
  18. package/dist/cdn/assets/fonts/CalciteWebCoreIcons.woff2 +0 -0
  19. package/dist/cdn/index.js +1 -1
  20. package/dist/cdn/main.css +1 -1
  21. package/dist/chunks/layer-utils.js +23 -19
  22. package/dist/components/arcgis-link-chart/customElement.d.ts +14 -14
  23. package/dist/components/arcgis-map/customElement.d.ts +14 -14
  24. package/dist/components/arcgis-slider-opacity-legacy/customElement.d.ts +1 -1
  25. package/dist/components/arcgis-utility-network-trace-location/customElement.js +57 -51
  26. package/dist/docs/api.json +1 -1
  27. package/dist/docs/docs.json +1 -1
  28. package/dist/docs/web-types.json +1 -1
  29. package/package.json +4 -4
  30. package/dist/cdn/7WLTT4K3.js +0 -2
  31. package/dist/cdn/TLUXYPPY.js +0 -2
  32. package/dist/cdn/assets/fonts/CalciteWebCoreIcons.svg +0 -197
  33. package/dist/cdn/assets/fonts/CalciteWebCoreIcons.ttf +0 -0
  34. package/dist/cdn/assets/fonts/CalciteWebCoreIcons.woff +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import b from"./BTIV4UDX.js";import"./7WLTT4K3.js";import a from"./5MHPKAFK.js";import{a as I}from"./PC4PAQXQ.js";import{O as $,U as N,a as B,b as h}from"./R5KGKAEB.js";import"./3TTFCHAA.js";export default $arcgis.t(([{watch:Be,when:$e},Ne,Ce,Me,{compileExpression:Pe},{a:k,d:_},{p:C}])=>{var te=typeof global=="object"&&global&&global.Object===Object&&global,M=te;var re=typeof self=="object"&&self&&self.Object===Object&&self,ae=M||re||Function("return this")(),O=ae;var oe=O.Symbol,g=oe;var P=Object.prototype,fe=P.hasOwnProperty,se=P.toString,b=g?g.toStringTag:void 0;function le(e){var t=fe.call(e,b),a=e[b];try{e[b]=void 0;var r=!0}catch{}var o=se.call(e);return r&&(t?e[b]=a:delete e[b]),o}var F=le;var ie=Object.prototype,pe=ie.toString;function ue(e){return pe.call(e)}var z=ue;var de="[object Null]",me="[object Undefined]",D=g?g.toStringTag:void 0;function ne(e){return e==null?e===void 0?me:de:D&&D in Object(e)?F(e):z(e)}var q=ne;function xe(e){return e!=null&&typeof e=="object"}var J=xe;var ce="[object Symbol]";function he(e){return typeof e=="symbol"||J(e)&&q(e)==ce}var U=he;var ge=/\s/;function ye(e){for(var t=e.length;t--&&ge.test(e.charAt(t)););return t}var G=ye;var ve=/^\s+/;function be(e){return e&&e.slice(0,G(e)+1).replace(ve,"")}var K=be;function Te(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var c=Te;var V=NaN,Ie=/^[-+]0x[0-9a-f]+$/i,ke=/^0b[01]+$/i,Oe=/^0o[0-7]+$/i,we=parseInt;function Se(e){if(typeof e=="number")return e;if(U(e))return V;if(c(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=c(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=K(e);var a=ke.test(e);return a||Oe.test(e)?we(e.slice(2),a?2:8):Ie.test(e)?V:+e}var E=Se;var je=function(){return O.Date.now()},w=je;var _e="Expected a function",Ee=Math.max,We=Math.min;function Le(e,t,a){var r,o,l,p,s,i,d=0,y=!1,m=!1,x=!0;if(typeof e!="function")throw new TypeError(_e);t=E(t)||0,c(a)&&(y=!!a.leading,m="maxWait"in a,l=m?Ee(E(a.maxWait)||0,t):l,x="trailing"in a?!!a.trailing:x);function u(f){var n=r,v=o;return r=o=void 0,d=f,p=e.apply(v,n),p}function Q(f){return d=f,s=setTimeout(T,t),y?u(f):p}function Y(f){var n=f-i,v=f-d,R=t-n;return m?We(R,l-v):R}function L(f){var n=f-i,v=f-d;return i===void 0||n>=t||n<0||m&&v>=l}function T(){var f=w();if(L(f))return A(f);s=setTimeout(T,Y(f))}function A(f){return s=void 0,x&&r?u(f):(r=o=void 0,p)}function Z(){s!==void 0&&clearTimeout(s),d=0,r=i=o=s=void 0}function ee(){return s===void 0?p:A(w())}function j(){var f=w(),n=L(f);if(r=arguments,o=this,i=f,n){if(s===void 0)return Q(i);if(m)return clearTimeout(s),s=setTimeout(T,t),u(i)}return s===void 0&&(s=setTimeout(T,t)),p}return j.cancel=Z,j.flush=ee,j}var X=Le;var Ae="Expected a function";function Re(e,t,a){var r=!0,o=!0;if(typeof e!="function")throw new TypeError(Ae);return c(a)&&(r="leading"in a?!!a.leading:r,o="trailing"in a?!!a.trailing:o),X(e,t,{leading:r,maxWait:t,trailing:o})}var S=Re;var Fe=B`.loading-container{display:flex;justify-content:center;padding:var(--calcite-spacing-md) 0;width:100%}`,H=1,W=class extends ${constructor(){super(...arguments),this._compileThrottled=S(this._startCompile,H),this._evaluateThrottled=S(this._startEvaluate,H),this.headingLevel=2}static{this.properties={_compileTask:16,_evaluateTask:16,values:0,fieldInfoMap:0,expressionInfo:0,graphic:0,headingLevel:9,interceptor:0,location:0,messages:0,spatialReference:0,map:0,view:0}}static{this.styles=Fe}loaded(){this.manager.onLifecycle(()=>[Be(()=>[this.expressionInfo,this.graphic],()=>this._compileThrottled(),{initial:!0}),$e(()=>{if(!this._compileTask?.finished)return null;let t=this._compileTask.value,a=t?.dependencies,{view:r}=this;return[t,this.spatialReference,this.map,r,a?.has("view-scale")&&r&&"scale"in r?r.scale:null,a?.has("view-time-extent")?r?.timeExtent?.start:null,a?.has("view-time-extent")?r?.timeExtent?.end:null]},([t])=>this._evaluateThrottled(t)),{remove:()=>this._cancelThrottles()}])}_cancelThrottles(){this._compileThrottled.cancel(),this._evaluateThrottled.cancel()}_startCompile(){this._evaluateTask=I(this._evaluateTask),this._compileTask=I(this._compileTask),this._compileTask=_(async t=>{let{expressionInfo:a,graphic:r}=this,o=a?.expression;if(!o||!r)return null;let l=await Pe({expression:o,graphic:r});return k(t),l})}_startEvaluate(t){this._evaluateTask=I(this._evaluateTask),this._evaluateTask=_(async a=>{let{graphic:r}=this;if(!t||!r)return null;let{interceptor:o,spatialReference:l,map:p,location:s,view:i}=this,d=await t.evaluate({graphic:r,interceptor:o,location:s,map:p,options:{signal:a},spatialReference:l,view:i});k(a);let y=d&&"castAsJsonAsync"in d&&typeof d.castAsJsonAsync=="function"?d:null;if(!y)return null;let m=await y.castAsJsonAsync(a);k(a);let x=m?.type,u=x==="media"?Ne.fromJSON(m):x==="text"?Me.fromJSON(m):x==="fields"?Ce.fromJSON(m):null;return!u||u.type==="media"&&!u.mediaInfos||u.type==="fields"&&!u.fieldInfos||u.type==="text"&&!u.text?null:u})}render(){let t=!this._compileTask?.finished||!this._evaluateTask?.finished;return h`<div class="root">${t?this._renderLoading():this._evaluateTask?.value?this._renderContent():null}</div>`}_renderContent(){let{values:t,fieldInfoMap:a}=this,r=this._evaluateTask?.value,o=r?.type,l={...t,...r?.attributes};if(!o)return null;if(o==="text"){let p=C({values:l,fieldInfoMap:a??new Map,globalValues:l,layer:void 0,text:r.text});return h`<arcgis-feature-content .creator=${p} .graphic=${this.graphic}></arcgis-feature-content>`}else if(o==="media"){let{title:p,description:s,mediaInfos:i}=r;return i?.length?h`<arcgis-feature-media .heading=${p??""} .values=${l} .formattedValues=${l} .description=${s??""} .mediaInfos=${i} .messages=${this.messages} .headingLevel=${this.headingLevel}></arcgis-feature-media>`:null}else if(o==="fields"){let{title:p,description:s,fieldInfos:i}=r;return i?.length?h`<arcgis-feature-fields .fieldInfos=${i} .heading=${p??""} .values=${l} .description=${s??""} .headingLevel=${this.headingLevel} .messages=${this.messages}></arcgis-feature-fields>`:null}return null}_renderLoading(){return h`<div class="loading-container"><calcite-loader inline label></calcite-loader></div>`}};N("arcgis-feature-expression",W);return W},"core/reactiveUtils","popup/content/MediaContent","popup/content/FieldsContent","popup/content/TextContent","applications/Components/arcadeFeatureUtils",a,b)
2
+ import b from"./6OMMETC4.js";import"./CAXI6CJY.js";import a from"./5MHPKAFK.js";import{a as I}from"./PC4PAQXQ.js";import{O as $,U as N,a as B,b as h}from"./R5KGKAEB.js";import"./3TTFCHAA.js";export default $arcgis.t(([{watch:Be,when:$e},Ne,Ce,Me,{compileExpression:Pe},{a:k,d:_},{p:C}])=>{var te=typeof global=="object"&&global&&global.Object===Object&&global,M=te;var re=typeof self=="object"&&self&&self.Object===Object&&self,ae=M||re||Function("return this")(),O=ae;var oe=O.Symbol,g=oe;var P=Object.prototype,fe=P.hasOwnProperty,se=P.toString,b=g?g.toStringTag:void 0;function le(e){var t=fe.call(e,b),a=e[b];try{e[b]=void 0;var r=!0}catch{}var o=se.call(e);return r&&(t?e[b]=a:delete e[b]),o}var F=le;var ie=Object.prototype,pe=ie.toString;function ue(e){return pe.call(e)}var z=ue;var de="[object Null]",me="[object Undefined]",D=g?g.toStringTag:void 0;function ne(e){return e==null?e===void 0?me:de:D&&D in Object(e)?F(e):z(e)}var q=ne;function xe(e){return e!=null&&typeof e=="object"}var J=xe;var ce="[object Symbol]";function he(e){return typeof e=="symbol"||J(e)&&q(e)==ce}var U=he;var ge=/\s/;function ye(e){for(var t=e.length;t--&&ge.test(e.charAt(t)););return t}var G=ye;var ve=/^\s+/;function be(e){return e&&e.slice(0,G(e)+1).replace(ve,"")}var K=be;function Te(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var c=Te;var V=NaN,Ie=/^[-+]0x[0-9a-f]+$/i,ke=/^0b[01]+$/i,Oe=/^0o[0-7]+$/i,we=parseInt;function Se(e){if(typeof e=="number")return e;if(U(e))return V;if(c(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=c(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=K(e);var a=ke.test(e);return a||Oe.test(e)?we(e.slice(2),a?2:8):Ie.test(e)?V:+e}var E=Se;var je=function(){return O.Date.now()},w=je;var _e="Expected a function",Ee=Math.max,We=Math.min;function Le(e,t,a){var r,o,l,p,s,i,d=0,y=!1,m=!1,x=!0;if(typeof e!="function")throw new TypeError(_e);t=E(t)||0,c(a)&&(y=!!a.leading,m="maxWait"in a,l=m?Ee(E(a.maxWait)||0,t):l,x="trailing"in a?!!a.trailing:x);function u(f){var n=r,v=o;return r=o=void 0,d=f,p=e.apply(v,n),p}function Q(f){return d=f,s=setTimeout(T,t),y?u(f):p}function Y(f){var n=f-i,v=f-d,R=t-n;return m?We(R,l-v):R}function L(f){var n=f-i,v=f-d;return i===void 0||n>=t||n<0||m&&v>=l}function T(){var f=w();if(L(f))return A(f);s=setTimeout(T,Y(f))}function A(f){return s=void 0,x&&r?u(f):(r=o=void 0,p)}function Z(){s!==void 0&&clearTimeout(s),d=0,r=i=o=s=void 0}function ee(){return s===void 0?p:A(w())}function j(){var f=w(),n=L(f);if(r=arguments,o=this,i=f,n){if(s===void 0)return Q(i);if(m)return clearTimeout(s),s=setTimeout(T,t),u(i)}return s===void 0&&(s=setTimeout(T,t)),p}return j.cancel=Z,j.flush=ee,j}var X=Le;var Ae="Expected a function";function Re(e,t,a){var r=!0,o=!0;if(typeof e!="function")throw new TypeError(Ae);return c(a)&&(r="leading"in a?!!a.leading:r,o="trailing"in a?!!a.trailing:o),X(e,t,{leading:r,maxWait:t,trailing:o})}var S=Re;var Fe=B`.loading-container{display:flex;justify-content:center;padding:var(--calcite-spacing-md) 0;width:100%}`,H=1,W=class extends ${constructor(){super(...arguments),this._compileThrottled=S(this._startCompile,H),this._evaluateThrottled=S(this._startEvaluate,H),this.headingLevel=2}static{this.properties={_compileTask:16,_evaluateTask:16,values:0,fieldInfoMap:0,expressionInfo:0,graphic:0,headingLevel:9,interceptor:0,location:0,messages:0,spatialReference:0,map:0,view:0}}static{this.styles=Fe}loaded(){this.manager.onLifecycle(()=>[Be(()=>[this.expressionInfo,this.graphic],()=>this._compileThrottled(),{initial:!0}),$e(()=>{if(!this._compileTask?.finished)return null;let t=this._compileTask.value,a=t?.dependencies,{view:r}=this;return[t,this.spatialReference,this.map,r,a?.has("view-scale")&&r&&"scale"in r?r.scale:null,a?.has("view-time-extent")?r?.timeExtent?.start:null,a?.has("view-time-extent")?r?.timeExtent?.end:null]},([t])=>this._evaluateThrottled(t)),{remove:()=>this._cancelThrottles()}])}_cancelThrottles(){this._compileThrottled.cancel(),this._evaluateThrottled.cancel()}_startCompile(){this._evaluateTask=I(this._evaluateTask),this._compileTask=I(this._compileTask),this._compileTask=_(async t=>{let{expressionInfo:a,graphic:r}=this,o=a?.expression;if(!o||!r)return null;let l=await Pe({expression:o,graphic:r});return k(t),l})}_startEvaluate(t){this._evaluateTask=I(this._evaluateTask),this._evaluateTask=_(async a=>{let{graphic:r}=this;if(!t||!r)return null;let{interceptor:o,spatialReference:l,map:p,location:s,view:i}=this,d=await t.evaluate({graphic:r,interceptor:o,location:s,map:p,options:{signal:a},spatialReference:l,view:i});k(a);let y=d&&"castAsJsonAsync"in d&&typeof d.castAsJsonAsync=="function"?d:null;if(!y)return null;let m=await y.castAsJsonAsync(a);k(a);let x=m?.type,u=x==="media"?Ne.fromJSON(m):x==="text"?Me.fromJSON(m):x==="fields"?Ce.fromJSON(m):null;return!u||u.type==="media"&&!u.mediaInfos||u.type==="fields"&&!u.fieldInfos||u.type==="text"&&!u.text?null:u})}render(){let t=!this._compileTask?.finished||!this._evaluateTask?.finished;return h`<div class="root">${t?this._renderLoading():this._evaluateTask?.value?this._renderContent():null}</div>`}_renderContent(){let{values:t,fieldInfoMap:a}=this,r=this._evaluateTask?.value,o=r?.type,l={...t,...r?.attributes};if(!o)return null;if(o==="text"){let p=C({values:l,fieldInfoMap:a??new Map,globalValues:l,layer:void 0,text:r.text});return h`<arcgis-feature-content .creator=${p} .graphic=${this.graphic}></arcgis-feature-content>`}else if(o==="media"){let{title:p,description:s,mediaInfos:i}=r;return i?.length?h`<arcgis-feature-media .heading=${p??""} .values=${l} .formattedValues=${l} .description=${s??""} .mediaInfos=${i} .messages=${this.messages} .headingLevel=${this.headingLevel}></arcgis-feature-media>`:null}else if(o==="fields"){let{title:p,description:s,fieldInfos:i}=r;return i?.length?h`<arcgis-feature-fields .fieldInfos=${i} .heading=${p??""} .values=${l} .description=${s??""} .headingLevel=${this.headingLevel} .messages=${this.messages}></arcgis-feature-fields>`:null}return null}_renderLoading(){return h`<div class="loading-container"><calcite-loader inline label></calcite-loader></div>`}};N("arcgis-feature-expression",W);return W},"core/reactiveUtils","popup/content/MediaContent","popup/content/FieldsContent","popup/content/TextContent","applications/Components/arcadeFeatureUtils",a,b)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import a from"./BTIV4UDX.js";import{a as $,b as p}from"./7WLTT4K3.js";import{a as L}from"./QCCYKLEL.js";import{a as C}from"./PUJPVTUS.js";import{g as T}from"./2E5U7E4Y.js";import"./W5TN3LOU.js";import"./LB32PLWG.js";import{N as h,O as k,U as S,a as y,b as s,p as d,r as b,s as _,x as n}from"./R5KGKAEB.js";import"./3TTFCHAA.js";export default $arcgis.t(([{queryAllJSON:N},u,{watch:P},{substitute:I},F,U,A,v,E,D,{r:g}])=>{var M=y`:host{height:100%;flex-grow:1}calcite-flow{min-height:var(--arcgis-internal-panel-height-sm, 240px)}calcite-block-group{flex-grow:1;padding-bottom:var(--calcite-spacing-md);background-color:var(--calcite-color-foreground-1)}calcite-block{--calcite-block-content-space: 0;--calcite-block-border-color: transparent;margin:0}calcite-block calcite-select,calcite-block calcite-input{margin:0 var(--calcite-spacing-md)}calcite-block calcite-input-message{padding:var(--calcite-spacing-sm) var(--calcite-spacing-md) 0 var(--calcite-spacing-md)}calcite-block calcite-label:last-child{--calcite-label-margin-bottom: 0}calcite-notice{margin:var(--calcite-spacing-md)}#subnetwork-info-block{margin:var(--calcite-spacing-md) var(--calcite-spacing-md) 0 var(--calcite-spacing-md)}#results-limited-message{padding:var(--calcite-spacing-sm)}.inline-loader{--calcite-loader-spacing: var(--calcite-spacing-md)}.add-spatial-mode{display:flex;flex-direction:column;gap:var(--calcite-spacing-md);margin:var(--calcite-spacing-md)}.heading{color:var(--calcite-color-text-1);margin:0 0 var(--calcite-spacing-md) 0;font-size:var(--calcite-font-size);font-style:normal;font-weight:var(--calcite-font-weight-medium)}`,m=`utility-network-trace-inputs-sketch-${Date.now()}`,c=`utility-network-trace-inputs-flags-${Date.now()}`,x=20,f=class extends k{constructor(){super(...arguments),this._defaultPopupTemplateEnabled=!0,this._messages=C({blocking:!0}),this._layerIdToLayer=new Map,this._startingPoints=new u,this._barriers=new u,this._stoppingPoints=new u,this._subnetworkTraceTypes=new Set(["subnetwork","subnetwork-controller","upstream","downstream","isolation"]),this._removeDuplicateSubnetworkNames=(e,t,i)=>t===0||e.getAttribute("SUBNETWORKNAME")!==i[t-1].getAttribute("SUBNETWORKNAME"),this._hitTestPromise=null,this._featuresFromHitTest=[],this._displayLimit=20,this._traceLocationStartingRefChange=e=>{e&&(this._traceLocationStartingElement=e)},this._traceLocationBarrierRefChange=e=>{e&&(this._traceLocationBarrierElement=e)},this._traceLocationStoppingRefChange=e=>{e&&(this._traceLocationStoppingElement=e)},this._featuresComponentRefChange=e=>{e&&(this._featuresComponentElement=e)},this.compatibleSubnetworkNames=[],this.traceConfigurations=[],this._state="ready",this._exceedDisplayLimit=!1,this.autoDestroyDisabled=!1,this.mode="default",this.arcgisPropertyChange=T()("mode"),this.arcgisSelectedNamedTraceConfigurationChange=n(),this.arcgisTraceInputsChange=n(),this.arcgisTraceLocationSelectEnd=n(),this.arcgisTraceLocationSelectStart=n(),this.arcgisUtilityNetworkChange=n(),this.renderFeatureListItem=e=>{let{feature:t,label:i}=e;return s`<calcite-list-item .label=${i} @calciteListItemSelect=${()=>this._handleFeatureSelectChange(t)}><calcite-icon icon=chevron-right slot=content-end></calcite-icon></calcite-list-item>`}}static{this.properties={compatibleSubnetworkNames:16,subnetworksTable:16,traceConfigurations:16,utilityNetworks:16,_unTraceConfiguration:16,_state:16,_activeTraceLocationType:16,_selectedFeature:16,_exceedDisplayLimit:16,beforeTraceLocationSelectStart:0,view:0,selectedUtilityNetwork:0,selectedNamedTraceConfiguration:0,autoDestroyDisabled:5,unTraceConfiguration:32,referenceElement:1,mode:3,traceLocations:32}}static{this.styles=M}get isSubnetworkNameTraceSelected(){let e=this.selectedNamedTraceConfiguration?.traceType;return!!this.selectedNamedTraceConfiguration?.traceConfiguration?.subnetworkName&&e==="subnetwork"}get selectedSubnetworkName(){return this._unTraceConfiguration?.subnetworkName??void 0}set selectedSubnetworkName(e){this._unTraceConfiguration&&(this._unTraceConfiguration.subnetworkName=e)}get _allLayers(){let{view:e}=this;return e?.map?e.map.allLayers.toArray().concat(e.map.allTables.toArray()):[]}get showStartingPoints(){return!this.isSubnetworkNameTraceSelected}get showStoppingPoints(){let e=this.selectedNamedTraceConfiguration?.traceType;return e==="path"||e==="circuit"}get _subnetworkLayerIds(){let e=this.selectedUtilityNetwork?.dataElement?.domainNetworks;return e?e.map(t=>t.subnetworkLayerId).filter(t=>t!=null&&t>-1):[]}get unTraceConfiguration(){return this._unTraceConfiguration}get traceLocations(){let e=[],t=i=>{i.flagProperties.terminalConfiguration&&i.flagProperties.selectedTerminals?i.flagProperties.selectedTerminals.forEach(a=>{e.push(new A({type:i.traceLocation.type,isFilterBarrier:i.traceLocation.isFilterBarrier,globalId:i.traceLocation.globalId,percentAlong:i.traceLocation.percentAlong,terminalId:a}))}):e.push(i.traceLocation)};return this.showStartingPoints&&this._startingPoints.forEach(i=>t(i)),this._barriers.forEach(i=>t(i)),this.showStoppingPoints&&this._stoppingPoints.forEach(i=>t(i)),e}async destroy(){this._removeGraphicLayer(m),this._removeGraphicLayer(c),this._sketchViewModel?.cancel(),this._featuresComponentElement?.destroy(),this._traceLocationStartingElement?.destroy(),this._traceLocationBarrierElement?.destroy(),this._traceLocationStoppingElement?.destroy(),await this.manager.destroy()}load(){this.manager.onLifecycle(()=>[P(()=>this.view?.map,()=>{this._setupUtilityNetwork(),this._setupSketchViewModel()},{initial:!0})])}willUpdate(e){let{utilityNetworks:t,selectedUtilityNetwork:i}=this;(e.has("utilityNetworks")||!t||t.length===0||!i||!t?.includes(i))&&this._handleUtilityNetworksChange(),e.has("selectedUtilityNetwork")&&(this.arcgisUtilityNetworkChange.emit(),this._handleSelectedUtilityNetworkChange()),e.has("selectedNamedTraceConfiguration")&&(this.arcgisTraceInputsChange.emit(),this.arcgisSelectedNamedTraceConfigurationChange.emit(),this._handleTraceConfigChange()),e.has("selectedSubnetworkName")&&this.arcgisTraceInputsChange.emit()}disconnectedCallback(){super.disconnectedCallback(),this._layerIdToLayer.clear()}_clearTraceLocations(){this._getGraphicLayer(c)?.removeAll(),this._startingPoints.removeAll(),this._barriers.removeAll(),this._stoppingPoints.removeAll()}_createGraphicLayer(e){let{map:t}=this.view;if(!t?.findLayerById(e)){let i=new F({id:e,listMode:"hide",title:e});$(this.view,i)}}_getGraphicLayer(e){let{map:t}=this.view;if(t){let i=t.findLayerById(e);if(p(i))return t.reorder(i,t.layers.length-1),i}return null}_removeGraphicLayer(e){let{map:t}=this.view,i=t?.findLayerById(e);i&&p(i)&&t?.remove(i)}_setSnappingOption(){let{_sketchViewModel:e,_unLayers:t}=this;if(e&&t&&t.length>0){let i=new u;t.forEach(a=>{a.type==="subtype-group"?a.sublayers.forEach(r=>{i.add(new E({layer:r,enabled:!0}))}):i.add(new E({layer:a,enabled:!0}))}),e.snappingOptions={enabled:!0,featureEnabled:!0,featureSources:i}}}_initializeSketchViewModel(){let{view:e}=this,t=this._getGraphicLayer(m);return new D({layer:t,view:e})}_setupSketchViewModel(){this._createGraphicLayer(m),this._createGraphicLayer(c),this._sketchViewModel=this._initializeSketchViewModel(),this._setSnappingOption()}_clearSubnetworks(){this.selectedSubnetworkName=void 0,this.subnetworksTable=void 0,this.compatibleSubnetworkNames=[]}async _loadSubnetworksTable(){this.subnetworksTable||(this.subnetworksTable=await this.selectedUtilityNetwork?.loadSubnetworksTable())}async _querySubnetworks(){let{subnetworksTable:e}=this;if(!e)return;let t=e.createQuery();t.gdbVersion=this.selectedUtilityNetwork?.gdbVersion,t.where=this._getSubnetworkQueryWhereClause(),t.outFields=["SUBNETWORKNAME"],t.orderByFields=["SUBNETWORKNAME"];let i=v.fromJSON(await N(e,t));this.compatibleSubnetworkNames=i.features.filter(this._removeDuplicateSubnetworkNames).map(a=>a.getAttribute("SUBNETWORKNAME"))}_getSubnetworkQueryWhereClause(){let e=this._unTraceConfiguration,t=`DOMAINNETWORKNAME = '${e.domainNetworkName}'`,i=`TIERNAME = '${e.tierName}'`;return[t,i].join(" AND ")}async _handleSubnetworkTraceConfigChange(e){await this._loadSubnetworksTable(),await this._querySubnetworks();let{compatibleSubnetworkNames:t}=this;e.subnetworkName&&!t.some(i=>i===e.subnetworkName)&&(this.selectedSubnetworkName=t.at(0))}_selectTraceConfigurationByGuid(e){let t=this.selectedUtilityNetwork?.sharedNamedTraceConfigurations.find(i=>i.globalId===e);if(!t){d("error",this,"`traceConfig` not found in `selectedUtilityNetwork.sharedNamedTraceConfigurations`");return}this.selectedNamedTraceConfiguration=t}_handleTraceConfigChange(){let{selectedNamedTraceConfiguration:e}=this;if(!(e?.traceConfiguration instanceof U)){d("error",this,b("selectedNamedTraceConfiguration.traceConfiguration")),this._unTraceConfiguration=void 0;return}switch(this._unTraceConfiguration=e.traceConfiguration.clone(),e.traceType){case"subnetwork":this._state="loading",this._handleSubnetworkTraceConfigChange(this._unTraceConfiguration).finally(()=>this._state="ready");break}}async _handleSelectedUtilityNetworkChange(){await this.selectedUtilityNetwork?.load(),this._clearSubnetworks(),this._setupTraceConfigurations(),this._filterUnLayers(),this._clearTraceLocations()}_setupTraceConfigurations(){this._unTraceConfiguration=void 0,this.selectedNamedTraceConfiguration=void 0,this.traceConfigurations=this.selectedUtilityNetwork?.sharedNamedTraceConfigurations.filter(e=>e.traceType!=="path"&&e.traceType!=="circuit").sort((e,t)=>e.title.localeCompare(t.title))||[],this.selectedNamedTraceConfiguration=this.traceConfigurations.at(0)}_filterUnLayers(){let{selectedUtilityNetwork:e}=this;this._unLayers=new u(this._allLayers.filter(t=>e?.isUtilityLayer(t)&&!this._subnetworkLayerIds.includes(t.layerId))),this._setSnappingOption()}_handleUtilityNetworksChange(){let{utilityNetworks:e}=this;if(!e||e.length===0){this._state="error",d("error",this,_("utilityNetworks"));return}(!this.selectedUtilityNetwork||!e.includes(this.selectedUtilityNetwork))&&(this.selectedUtilityNetwork=e.at(0))}async _setupUtilityNetwork(){if(this.view?.map){let e=this.view.map;await e.load(),this.utilityNetworks=e.utilityNetworks||void 0}else this._state="disabled",d("error",this,"The property `view.map` is required to load utility networks but is missing.")}_handleTraceLocationSelectStart(e){if(e.stopPropagation(),this.arcgisTraceLocationSelectStart.emit(e.detail).defaultPrevented){e.preventDefault();return}this._activeTraceLocationType=e?.target?.traceLocationType,this.mode="add-spatial-instructions"}_getLayerByLayerId(e){if(e==null)return;let{_layerIdToLayer:t,_unLayers:i}=this;if(t.get(e))return t.get(e);if(!i)return;let a=i.find(r=>"layerId"in r&&r.layerId===e);return a&&t.set(e,a),a}async _queryFeatures(e,t){let i=e.createQuery();i.gdbVersion=this.selectedUtilityNetwork?.gdbVersion,i.objectIds=t.map(r=>r.getObjectId()),i.outFields=["*"];let{features:a}=v.fromJSON(await N(e,i));return a.forEach(r=>{r.layer=e.type==="subtype-group"?e.findSublayerForFeature(r):e,r.origin=r.layer;let o=r.layer;r.getEffectivePopupTemplate(this._defaultPopupTemplateEnabled)||(r.popupTemplate=o.createPopupTemplate())}),a}async _populateFeaturesWithLabel(e){let t=new Map;e.forEach(a=>{let r=a.layer?.type==="subtype-sublayer"?a.layer.parent:a.layer;if(r){let o=r.layerId,l=this._getLayerByLayerId(o);if(l){let w=t.get(l)||[];w.push(a),t.set(l,w)}}});let i=[];return await Promise.all(Array.from(t.keys()).map(async a=>{let r=t.get(a)??[],o=await this._queryFeatures(a,r);i.push(...o)})),await Promise.all(i.map(async a=>{let r=a.layer;if(r&&"getFeatureTitle"in r){let o=await r.getFeatureTitle(a)||g(a);return{feature:a,label:o}}return{feature:a,label:g(a)}}))}async _handleHitTestComplete(e){if(this._exceedDisplayLimit=e.length>this._displayLimit,this._featuresFromHitTest=await this._populateFeaturesWithLabel(e.slice(0,this._displayLimit)),this._featuresFromHitTest.length===0)return this._handleAddSpatialCancelClick(),await Promise.reject(Error("No features found"));if(this._featuresFromHitTest.length===1){let[{feature:t}]=this._featuresFromHitTest;this._selectedFeature=t,this.mode="add-spatial-feature"}else this.mode="add-spatial-feature-list";return this._hitTestPromise?.reject(),this._hitTestPromise=Promise.withResolvers(),await this._hitTestPromise.promise}_handleTraceLocationSelectEnd(e){e.stopPropagation(),this.arcgisTraceLocationSelectEnd.emit(),this._activeTraceLocationType=void 0,this.mode="default",this._handleAddSpatialCancelClick()}_handleAddSpatialCancelClick(e){e?.stopPropagation();let t=this._featuresComponentElement;t&&t.clear(),this._selectedFeature=void 0,this.mode="default",this._sketchViewModel?.cancel(),this._hitTestPromise?.reject(),this._hitTestPromise=null}_handleFeaturesClose(){this.mode="add-spatial-feature-list",this._selectedFeature=void 0}_handleAddSpatialAddClick(){let{_hitTestPromise:e,_featuresComponentElement:t}=this;if(e&&t){let i=t,a=i.selectedDrillInFeature??i.selectedFeature;if(!a)return;e.resolve(a),this._hitTestPromise=null}}_handleFeatureSelectChange(e){this._selectedFeature=e,this.mode="add-spatial-feature"}renderError(e,t=!1,i){return s`<calcite-notice .closable=${t} kind=danger open scale=s width=auto .icon=${i}><div slot=message>${e}</div></calcite-notice>`}renderLoader(){return s`<calcite-loader label=loading></calcite-loader>`}renderTraceSelection(){let{_messages:e,traceConfigurations:t}=this,i=e.labels.traceConfiguration;if(t.length===0)return this.renderError(e.errors.noTraceConfigurationError,!0);let a=L(t,r=>r.globalId,r=>s`<calcite-option .value=${r.globalId}>${r.title}</calcite-option>`);return s`<calcite-block .heading=${i} .label=${i} expanded><calcite-select .label=${i} .value=${this.selectedNamedTraceConfiguration?.globalId||void 0} @calciteSelectChange=${r=>{this._selectTraceConfigurationByGuid(r.target.value)}}>${a}</calcite-select></calcite-block>`}renderUtilityNetworkSelection(){let{_messages:e}=this,t=e.labels.utilityNetwork,i=this.utilityNetworks?.map(a=>s`<calcite-option .value=${a.id}>${a.title}</calcite-option>`);return s`<calcite-block .heading=${t} .label=${t} expanded><calcite-select .label=${t} .value=${this.selectedUtilityNetwork?.id} @calciteSelectChange=${a=>{this.selectedUtilityNetwork?.id!==a.target.value&&(this.selectedUtilityNetwork=this.utilityNetworks?.find(r=>r.id===a.target.value))}}>${i}</calcite-select></calcite-block>`}renderDefaultMode(){let{_messages:e,_state:t,mode:i}=this;return s`<calcite-flow-item .selected=${i==="default"}>${t==="disabled"?this.renderError(e.errors.noMapError):this.renderContent()}</calcite-flow-item>`}renderSpatialSelectInstructions(){let{_messages:e,_activeTraceLocationType:t,mode:i}=this,a=t==="starting-point"?e.labels.addSpatial.startingPoint:t==="barrier"?e.labels.addSpatial.barrier:e.labels.addSpatial.stoppingPoint;return s`<calcite-flow-item .selected=${i==="add-spatial-instructions"} .heading=${a} @calciteFlowItemBack=${r=>this._handleAddSpatialCancelClick(r)}><div class="add-spatial-mode"><div><h5 class="heading">${e.instructions.addSpatial.selectFeature.heading}</h5>${e.instructions.addSpatial.selectFeature.subheading}</div><div><h5 class="heading">${e.instructions.addSpatial.selectAssociatedFeature.heading}</h5>${e.instructions.addSpatial.selectAssociatedFeature.subheading}</div></div></calcite-flow-item>`}renderFeaturesList(e){return s`<calcite-list label="Feature list">${e.map(this.renderFeatureListItem)}</calcite-list>`}renderHitTestResults(){let{_messages:e,_activeTraceLocationType:t,_featuresFromHitTest:i,mode:a}=this,r=t==="starting-point"?e.labels.addSpatial.startingPoint:t==="barrier"?e.labels.addSpatial.barrier:e.labels.addSpatial.stoppingPoint;return s`<calcite-flow-item .selected=${a==="add-spatial-feature-list"} .heading=${r} @calciteFlowItemBack=${o=>this._handleAddSpatialCancelClick(o)}>${this.renderFeaturesList(i)}</calcite-flow-item>`}renderSelectedFeature(){let{_selectedFeature:e}=this;return e?s`<arcgis-features .referenceElement=${this.referenceElement} .features=${[e]} .view=${this.view} .defaultPopupTemplateEnabled=${this._defaultPopupTemplateEnabled} open @arcgisClose=${()=>this._handleFeaturesClose()} .autoDestroyDisabled=${this.autoDestroyDisabled} ${h(this._featuresComponentRefChange)}></arcgis-features>`:(this.mode="default",null)}renderAddSpatialFooter(){let{mode:e,_messages:t,selectedUtilityNetwork:i,_selectedFeature:a}=this,r=I(t.warnings.exceededDisplayLimit,{limit:this._displayLimit.toString()}),o=e==="add-spatial-feature-list"&&this._exceedDisplayLimit,l=a?!(i?.isUtilityLayer(a.layer)??!0):!0;return s`${o&&s`<calcite-input-message id=results-limited-message icon=exclamation-mark-circle status=idle>${r}</calcite-input-message>`||""}<calcite-button appearance=outline width=full @click=${()=>{this._handleAddSpatialCancelClick()}} slot=footer>${t.buttons.cancel}</calcite-button>${e==="add-spatial-feature"&&s`<calcite-button width=full slot=footer appearance=solid @click=${()=>{this._handleAddSpatialAddClick()}} .disabled=${l}>${t.buttons.add}</calcite-button>`||""}`}renderStartingPointSelection(){return s`<arcgis-utility-network-trace-location .view=${this.view} trace-location-type=starting-point .beforeTraceLocationSelectStart=${this.beforeTraceLocationSelectStart} @arcgisTraceLocationSelectStart=${this._handleTraceLocationSelectStart} @arcgisTraceLocationSelectEnd=${this._handleTraceLocationSelectEnd} @arcgisTraceLocationChange=${()=>this.arcgisTraceInputsChange.emit()} .sketchViewModel=${this._sketchViewModel} .utilityNetwork=${this.selectedUtilityNetwork} .filterLayers=${this._unLayers} .flagLayer=${this._getGraphicLayer(c)} .traceLocations=${this._startingPoints} .afterHitTest=${this._handleHitTestComplete.bind(this)} .autoDestroyDisabled=${this.autoDestroyDisabled} ${h(this._traceLocationStartingRefChange)}></arcgis-utility-network-trace-location>`}renderStoppingPointSelection(){return s`<arcgis-utility-network-trace-location .view=${this.view} trace-location-type=stopping-point .beforeTraceLocationSelectStart=${this.beforeTraceLocationSelectStart} @arcgisTraceLocationSelectStart=${this._handleTraceLocationSelectStart} @arcgisTraceLocationSelectEnd=${this._handleTraceLocationSelectEnd} @arcgisTraceLocationChange=${()=>this.arcgisTraceInputsChange.emit()} .sketchViewModel=${this._sketchViewModel} .utilityNetwork=${this.selectedUtilityNetwork} .filterLayers=${this._unLayers} .flagLayer=${this._getGraphicLayer(c)} .traceLocations=${this._stoppingPoints} .afterHitTest=${this._handleHitTestComplete.bind(this)} .autoDestroyDisabled=${this.autoDestroyDisabled} ${h(this._traceLocationStoppingRefChange)}></arcgis-utility-network-trace-location>`}renderBarrierSelection(){return s`<arcgis-utility-network-trace-location .view=${this.view} trace-location-type=barrier .beforeTraceLocationSelectStart=${this.beforeTraceLocationSelectStart} @arcgisTraceLocationSelectStart=${this._handleTraceLocationSelectStart} @arcgisTraceLocationSelectEnd=${this._handleTraceLocationSelectEnd} @arcgisTraceLocationChange=${()=>this.arcgisTraceInputsChange.emit()} .sketchViewModel=${this._sketchViewModel} .utilityNetwork=${this.selectedUtilityNetwork} .filterLayers=${this._unLayers} .flagLayer=${this._getGraphicLayer(c)} .traceLocations=${this._barriers} .afterHitTest=${this._handleHitTestComplete.bind(this)} .autoDestroyDisabled=${this.autoDestroyDisabled} ${h(this._traceLocationBarrierRefChange)}></arcgis-utility-network-trace-location>`}renderSubnetworkNameInput(){return s`<calcite-input clearable type=text .placeholder=${this._messages.instructions.enterSubnetworkName} max-length=64 .value=${this.selectedSubnetworkName} @calciteInputInput=${e=>this.selectedSubnetworkName=e.target.value}></calcite-input><calcite-input-message icon=exclamation-mark-triangle status=idle>${this._messages.labels.tooManySubnetworks}</calcite-input-message>`}renderSubnetworkSelectList(){return s`<calcite-select .label=${this._messages.labels.subnetworkName} .value=${this.selectedSubnetworkName} @calciteSelectChange=${e=>this.selectedSubnetworkName=e.target.value}>${this.compatibleSubnetworkNames.map(e=>s`<calcite-option .value=${e}>${e}</calcite-option>`)}</calcite-select>`}renderSubnetworkSelection(){let{compatibleSubnetworkNames:e}=this,t=this._messages.labels.subnetworkName;return this.isSubnetworkNameTraceSelected?this._state==="loading"?s`<calcite-loader class="inline-loader" label=loading scale=s></calcite-loader>`:e.length?s`<calcite-block .heading=${t} .label=${t} expanded>${e.length>x?this.renderSubnetworkNameInput():this.renderSubnetworkSelectList()}</calcite-block>`:this.renderError(this._messages.errors.noCompatibleSubnetworks,!1,"exclamation-mark-triangle"):null}renderSubnetworkInfo(){let{_messages:e,selectedNamedTraceConfiguration:t,_unTraceConfiguration:i}=this;return i&&t?.traceType&&this._subnetworkTraceTypes.has(t.traceType)?s`<calcite-block id=subnetwork-info-block expanded .label=${e.labels.subnetworkInfo}><arcgis-utility-network-subnetwork-info .namedTraceConfig=${t}></arcgis-utility-network-subnetwork-info></calcite-block>`:null}renderContent(){let{utilityNetworks:e}=this,t=this.selectedNamedTraceConfiguration?.traceConfiguration;if(!e||e.length===0)return this.renderError(this._messages.errors.noUtilityNetworkError);let i=s`${this.renderTraceSelection()}${this.renderSubnetworkInfo()}${this.renderSubnetworkSelection()}`,a=s`${this.showStartingPoints?this.renderStartingPointSelection():null}${this.showStoppingPoints?this.renderStoppingPointSelection():null}${this.renderBarrierSelection()}`;return s`<calcite-block-group .label=${this._messages.labels.traceInputs}>${e.length>1?this.renderUtilityNetworkSelection():null}${this.selectedUtilityNetwork?.loaded?i:this.renderLoader()}${t?a:null}</calcite-block-group>`}render(){let{mode:e}=this;return s`<calcite-panel>${e==="add-spatial-feature"?this.renderSelectedFeature():s`<calcite-flow>${this.renderDefaultMode()}${this.renderSpatialSelectInstructions()}${this.renderHitTestResults()}</calcite-flow>`}${e!=="default"?this.renderAddSpatialFooter():null}</calcite-panel>`}};S("arcgis-utility-network-trace-inputs",f);return f},"applications/Components/featureUtils","core/Collection","core/reactiveUtils","intl","layers/GraphicsLayer","networks/support/UNTraceConfiguration","rest/networks/support/TraceLocation","rest/support/FeatureSet","views/interactive/snapping/FeatureSnappingLayerSource","widgets/Sketch/SketchViewModel",a)
2
+ import a from"./6OMMETC4.js";import{a as $,b as p}from"./CAXI6CJY.js";import{a as L}from"./QCCYKLEL.js";import{a as C}from"./PUJPVTUS.js";import{g as T}from"./2E5U7E4Y.js";import"./W5TN3LOU.js";import"./LB32PLWG.js";import{N as h,O as k,U as S,a as y,b as s,p as d,r as b,s as _,x as n}from"./R5KGKAEB.js";import"./3TTFCHAA.js";export default $arcgis.t(([{queryAllJSON:N},u,{watch:P},{substitute:I},F,U,A,v,E,D,{r:g}])=>{var M=y`:host{height:100%;flex-grow:1}calcite-flow{min-height:var(--arcgis-internal-panel-height-sm, 240px)}calcite-block-group{flex-grow:1;padding-bottom:var(--calcite-spacing-md);background-color:var(--calcite-color-foreground-1)}calcite-block{--calcite-block-content-space: 0;--calcite-block-border-color: transparent;margin:0}calcite-block calcite-select,calcite-block calcite-input{margin:0 var(--calcite-spacing-md)}calcite-block calcite-input-message{padding:var(--calcite-spacing-sm) var(--calcite-spacing-md) 0 var(--calcite-spacing-md)}calcite-block calcite-label:last-child{--calcite-label-margin-bottom: 0}calcite-notice{margin:var(--calcite-spacing-md)}#subnetwork-info-block{margin:var(--calcite-spacing-md) var(--calcite-spacing-md) 0 var(--calcite-spacing-md)}#results-limited-message{padding:var(--calcite-spacing-sm)}.inline-loader{--calcite-loader-spacing: var(--calcite-spacing-md)}.add-spatial-mode{display:flex;flex-direction:column;gap:var(--calcite-spacing-md);margin:var(--calcite-spacing-md)}.heading{color:var(--calcite-color-text-1);margin:0 0 var(--calcite-spacing-md) 0;font-size:var(--calcite-font-size);font-style:normal;font-weight:var(--calcite-font-weight-medium)}`,m=`utility-network-trace-inputs-sketch-${Date.now()}`,c=`utility-network-trace-inputs-flags-${Date.now()}`,x=20,f=class extends k{constructor(){super(...arguments),this._defaultPopupTemplateEnabled=!0,this._messages=C({blocking:!0}),this._layerIdToLayer=new Map,this._startingPoints=new u,this._barriers=new u,this._stoppingPoints=new u,this._subnetworkTraceTypes=new Set(["subnetwork","subnetwork-controller","upstream","downstream","isolation"]),this._removeDuplicateSubnetworkNames=(e,t,i)=>t===0||e.getAttribute("SUBNETWORKNAME")!==i[t-1].getAttribute("SUBNETWORKNAME"),this._hitTestPromise=null,this._featuresFromHitTest=[],this._displayLimit=20,this._traceLocationStartingRefChange=e=>{e&&(this._traceLocationStartingElement=e)},this._traceLocationBarrierRefChange=e=>{e&&(this._traceLocationBarrierElement=e)},this._traceLocationStoppingRefChange=e=>{e&&(this._traceLocationStoppingElement=e)},this._featuresComponentRefChange=e=>{e&&(this._featuresComponentElement=e)},this.compatibleSubnetworkNames=[],this.traceConfigurations=[],this._state="ready",this._exceedDisplayLimit=!1,this.autoDestroyDisabled=!1,this.mode="default",this.arcgisPropertyChange=T()("mode"),this.arcgisSelectedNamedTraceConfigurationChange=n(),this.arcgisTraceInputsChange=n(),this.arcgisTraceLocationSelectEnd=n(),this.arcgisTraceLocationSelectStart=n(),this.arcgisUtilityNetworkChange=n(),this.renderFeatureListItem=e=>{let{feature:t,label:i}=e;return s`<calcite-list-item .label=${i} @calciteListItemSelect=${()=>this._handleFeatureSelectChange(t)}><calcite-icon icon=chevron-right slot=content-end></calcite-icon></calcite-list-item>`}}static{this.properties={compatibleSubnetworkNames:16,subnetworksTable:16,traceConfigurations:16,utilityNetworks:16,_unTraceConfiguration:16,_state:16,_activeTraceLocationType:16,_selectedFeature:16,_exceedDisplayLimit:16,beforeTraceLocationSelectStart:0,view:0,selectedUtilityNetwork:0,selectedNamedTraceConfiguration:0,autoDestroyDisabled:5,unTraceConfiguration:32,referenceElement:1,mode:3,traceLocations:32}}static{this.styles=M}get isSubnetworkNameTraceSelected(){let e=this.selectedNamedTraceConfiguration?.traceType;return!!this.selectedNamedTraceConfiguration?.traceConfiguration?.subnetworkName&&e==="subnetwork"}get selectedSubnetworkName(){return this._unTraceConfiguration?.subnetworkName??void 0}set selectedSubnetworkName(e){this._unTraceConfiguration&&(this._unTraceConfiguration.subnetworkName=e)}get _allLayers(){let{view:e}=this;return e?.map?e.map.allLayers.toArray().concat(e.map.allTables.toArray()):[]}get showStartingPoints(){return!this.isSubnetworkNameTraceSelected}get showStoppingPoints(){let e=this.selectedNamedTraceConfiguration?.traceType;return e==="path"||e==="circuit"}get _subnetworkLayerIds(){let e=this.selectedUtilityNetwork?.dataElement?.domainNetworks;return e?e.map(t=>t.subnetworkLayerId).filter(t=>t!=null&&t>-1):[]}get unTraceConfiguration(){return this._unTraceConfiguration}get traceLocations(){let e=[],t=i=>{i.flagProperties.terminalConfiguration&&i.flagProperties.selectedTerminals?i.flagProperties.selectedTerminals.forEach(a=>{e.push(new A({type:i.traceLocation.type,isFilterBarrier:i.traceLocation.isFilterBarrier,globalId:i.traceLocation.globalId,percentAlong:i.traceLocation.percentAlong,terminalId:a}))}):e.push(i.traceLocation)};return this.showStartingPoints&&this._startingPoints.forEach(i=>t(i)),this._barriers.forEach(i=>t(i)),this.showStoppingPoints&&this._stoppingPoints.forEach(i=>t(i)),e}async destroy(){this._removeGraphicLayer(m),this._removeGraphicLayer(c),this._sketchViewModel?.cancel(),this._featuresComponentElement?.destroy(),this._traceLocationStartingElement?.destroy(),this._traceLocationBarrierElement?.destroy(),this._traceLocationStoppingElement?.destroy(),await this.manager.destroy()}load(){this.manager.onLifecycle(()=>[P(()=>this.view?.map,()=>{this._setupUtilityNetwork(),this._setupSketchViewModel()},{initial:!0})])}willUpdate(e){let{utilityNetworks:t,selectedUtilityNetwork:i}=this;(e.has("utilityNetworks")||!t||t.length===0||!i||!t?.includes(i))&&this._handleUtilityNetworksChange(),e.has("selectedUtilityNetwork")&&(this.arcgisUtilityNetworkChange.emit(),this._handleSelectedUtilityNetworkChange()),e.has("selectedNamedTraceConfiguration")&&(this.arcgisTraceInputsChange.emit(),this.arcgisSelectedNamedTraceConfigurationChange.emit(),this._handleTraceConfigChange()),e.has("selectedSubnetworkName")&&this.arcgisTraceInputsChange.emit()}disconnectedCallback(){super.disconnectedCallback(),this._layerIdToLayer.clear()}_clearTraceLocations(){this._getGraphicLayer(c)?.removeAll(),this._startingPoints.removeAll(),this._barriers.removeAll(),this._stoppingPoints.removeAll()}_createGraphicLayer(e){let{map:t}=this.view;if(!t?.findLayerById(e)){let i=new F({id:e,listMode:"hide",title:e});$(this.view,i)}}_getGraphicLayer(e){let{map:t}=this.view;if(t){let i=t.findLayerById(e);if(p(i))return t.reorder(i,t.layers.length-1),i}return null}_removeGraphicLayer(e){let{map:t}=this.view,i=t?.findLayerById(e);i&&p(i)&&t?.remove(i)}_setSnappingOption(){let{_sketchViewModel:e,_unLayers:t}=this;if(e&&t&&t.length>0){let i=new u;t.forEach(a=>{a.type==="subtype-group"?a.sublayers.forEach(r=>{i.add(new E({layer:r,enabled:!0}))}):i.add(new E({layer:a,enabled:!0}))}),e.snappingOptions={enabled:!0,featureEnabled:!0,featureSources:i}}}_initializeSketchViewModel(){let{view:e}=this,t=this._getGraphicLayer(m);return new D({layer:t,view:e})}_setupSketchViewModel(){this._createGraphicLayer(m),this._createGraphicLayer(c),this._sketchViewModel=this._initializeSketchViewModel(),this._setSnappingOption()}_clearSubnetworks(){this.selectedSubnetworkName=void 0,this.subnetworksTable=void 0,this.compatibleSubnetworkNames=[]}async _loadSubnetworksTable(){this.subnetworksTable||(this.subnetworksTable=await this.selectedUtilityNetwork?.loadSubnetworksTable())}async _querySubnetworks(){let{subnetworksTable:e}=this;if(!e)return;let t=e.createQuery();t.gdbVersion=this.selectedUtilityNetwork?.gdbVersion,t.where=this._getSubnetworkQueryWhereClause(),t.outFields=["SUBNETWORKNAME"],t.orderByFields=["SUBNETWORKNAME"];let i=v.fromJSON(await N(e,t));this.compatibleSubnetworkNames=i.features.filter(this._removeDuplicateSubnetworkNames).map(a=>a.getAttribute("SUBNETWORKNAME"))}_getSubnetworkQueryWhereClause(){let e=this._unTraceConfiguration,t=`DOMAINNETWORKNAME = '${e.domainNetworkName}'`,i=`TIERNAME = '${e.tierName}'`;return[t,i].join(" AND ")}async _handleSubnetworkTraceConfigChange(e){await this._loadSubnetworksTable(),await this._querySubnetworks();let{compatibleSubnetworkNames:t}=this;e.subnetworkName&&!t.some(i=>i===e.subnetworkName)&&(this.selectedSubnetworkName=t.at(0))}_selectTraceConfigurationByGuid(e){let t=this.selectedUtilityNetwork?.sharedNamedTraceConfigurations.find(i=>i.globalId===e);if(!t){d("error",this,"`traceConfig` not found in `selectedUtilityNetwork.sharedNamedTraceConfigurations`");return}this.selectedNamedTraceConfiguration=t}_handleTraceConfigChange(){let{selectedNamedTraceConfiguration:e}=this;if(!(e?.traceConfiguration instanceof U)){d("error",this,b("selectedNamedTraceConfiguration.traceConfiguration")),this._unTraceConfiguration=void 0;return}switch(this._unTraceConfiguration=e.traceConfiguration.clone(),e.traceType){case"subnetwork":this._state="loading",this._handleSubnetworkTraceConfigChange(this._unTraceConfiguration).finally(()=>this._state="ready");break}}async _handleSelectedUtilityNetworkChange(){await this.selectedUtilityNetwork?.load(),this._clearSubnetworks(),this._setupTraceConfigurations(),this._filterUnLayers(),this._clearTraceLocations()}_setupTraceConfigurations(){this._unTraceConfiguration=void 0,this.selectedNamedTraceConfiguration=void 0,this.traceConfigurations=this.selectedUtilityNetwork?.sharedNamedTraceConfigurations.filter(e=>e.traceType!=="path"&&e.traceType!=="circuit").sort((e,t)=>e.title.localeCompare(t.title))||[],this.selectedNamedTraceConfiguration=this.traceConfigurations.at(0)}_filterUnLayers(){let{selectedUtilityNetwork:e}=this;this._unLayers=new u(this._allLayers.filter(t=>e?.isUtilityLayer(t)&&!this._subnetworkLayerIds.includes(t.layerId))),this._setSnappingOption()}_handleUtilityNetworksChange(){let{utilityNetworks:e}=this;if(!e||e.length===0){this._state="error",d("error",this,_("utilityNetworks"));return}(!this.selectedUtilityNetwork||!e.includes(this.selectedUtilityNetwork))&&(this.selectedUtilityNetwork=e.at(0))}async _setupUtilityNetwork(){if(this.view?.map){let e=this.view.map;await e.load(),this.utilityNetworks=e.utilityNetworks||void 0}else this._state="disabled",d("error",this,"The property `view.map` is required to load utility networks but is missing.")}_handleTraceLocationSelectStart(e){if(e.stopPropagation(),this.arcgisTraceLocationSelectStart.emit(e.detail).defaultPrevented){e.preventDefault();return}this._activeTraceLocationType=e?.target?.traceLocationType,this.mode="add-spatial-instructions"}_getLayerByLayerId(e){if(e==null)return;let{_layerIdToLayer:t,_unLayers:i}=this;if(t.get(e))return t.get(e);if(!i)return;let a=i.find(r=>"layerId"in r&&r.layerId===e);return a&&t.set(e,a),a}async _queryFeatures(e,t){let i=e.createQuery();i.gdbVersion=this.selectedUtilityNetwork?.gdbVersion,i.objectIds=t.map(r=>r.getObjectId()),i.outFields=["*"];let{features:a}=v.fromJSON(await N(e,i));return a.forEach(r=>{r.layer=e.type==="subtype-group"?e.findSublayerForFeature(r):e,r.origin=r.layer;let o=r.layer;r.getEffectivePopupTemplate(this._defaultPopupTemplateEnabled)||(r.popupTemplate=o.createPopupTemplate())}),a}async _populateFeaturesWithLabel(e){let t=new Map;e.forEach(a=>{let r=a.layer?.type==="subtype-sublayer"?a.layer.parent:a.layer;if(r){let o=r.layerId,l=this._getLayerByLayerId(o);if(l){let w=t.get(l)||[];w.push(a),t.set(l,w)}}});let i=[];return await Promise.all(Array.from(t.keys()).map(async a=>{let r=t.get(a)??[],o=await this._queryFeatures(a,r);i.push(...o)})),await Promise.all(i.map(async a=>{let r=a.layer;if(r&&"getFeatureTitle"in r){let o=await r.getFeatureTitle(a)||g(a);return{feature:a,label:o}}return{feature:a,label:g(a)}}))}async _handleHitTestComplete(e){if(this._exceedDisplayLimit=e.length>this._displayLimit,this._featuresFromHitTest=await this._populateFeaturesWithLabel(e.slice(0,this._displayLimit)),this._featuresFromHitTest.length===0)return this._handleAddSpatialCancelClick(),await Promise.reject(Error("No features found"));if(this._featuresFromHitTest.length===1){let[{feature:t}]=this._featuresFromHitTest;this._selectedFeature=t,this.mode="add-spatial-feature"}else this.mode="add-spatial-feature-list";return this._hitTestPromise?.reject(),this._hitTestPromise=Promise.withResolvers(),await this._hitTestPromise.promise}_handleTraceLocationSelectEnd(e){e.stopPropagation(),this.arcgisTraceLocationSelectEnd.emit(),this._activeTraceLocationType=void 0,this.mode="default",this._handleAddSpatialCancelClick()}_handleAddSpatialCancelClick(e){e?.stopPropagation();let t=this._featuresComponentElement;t&&t.clear(),this._selectedFeature=void 0,this.mode="default",this._sketchViewModel?.cancel(),this._hitTestPromise?.reject(),this._hitTestPromise=null}_handleFeaturesClose(){this.mode="add-spatial-feature-list",this._selectedFeature=void 0}_handleAddSpatialAddClick(){let{_hitTestPromise:e,_featuresComponentElement:t}=this;if(e&&t){let i=t,a=i.selectedDrillInFeature??i.selectedFeature;if(!a)return;e.resolve(a),this._hitTestPromise=null}}_handleFeatureSelectChange(e){this._selectedFeature=e,this.mode="add-spatial-feature"}renderError(e,t=!1,i){return s`<calcite-notice .closable=${t} kind=danger open scale=s width=auto .icon=${i}><div slot=message>${e}</div></calcite-notice>`}renderLoader(){return s`<calcite-loader label=loading></calcite-loader>`}renderTraceSelection(){let{_messages:e,traceConfigurations:t}=this,i=e.labels.traceConfiguration;if(t.length===0)return this.renderError(e.errors.noTraceConfigurationError,!0);let a=L(t,r=>r.globalId,r=>s`<calcite-option .value=${r.globalId}>${r.title}</calcite-option>`);return s`<calcite-block .heading=${i} .label=${i} expanded><calcite-select .label=${i} .value=${this.selectedNamedTraceConfiguration?.globalId||void 0} @calciteSelectChange=${r=>{this._selectTraceConfigurationByGuid(r.target.value)}}>${a}</calcite-select></calcite-block>`}renderUtilityNetworkSelection(){let{_messages:e}=this,t=e.labels.utilityNetwork,i=this.utilityNetworks?.map(a=>s`<calcite-option .value=${a.id}>${a.title}</calcite-option>`);return s`<calcite-block .heading=${t} .label=${t} expanded><calcite-select .label=${t} .value=${this.selectedUtilityNetwork?.id} @calciteSelectChange=${a=>{this.selectedUtilityNetwork?.id!==a.target.value&&(this.selectedUtilityNetwork=this.utilityNetworks?.find(r=>r.id===a.target.value))}}>${i}</calcite-select></calcite-block>`}renderDefaultMode(){let{_messages:e,_state:t,mode:i}=this;return s`<calcite-flow-item .selected=${i==="default"}>${t==="disabled"?this.renderError(e.errors.noMapError):this.renderContent()}</calcite-flow-item>`}renderSpatialSelectInstructions(){let{_messages:e,_activeTraceLocationType:t,mode:i}=this,a=t==="starting-point"?e.labels.addSpatial.startingPoint:t==="barrier"?e.labels.addSpatial.barrier:e.labels.addSpatial.stoppingPoint;return s`<calcite-flow-item .selected=${i==="add-spatial-instructions"} .heading=${a} @calciteFlowItemBack=${r=>this._handleAddSpatialCancelClick(r)}><div class="add-spatial-mode"><div><h5 class="heading">${e.instructions.addSpatial.selectFeature.heading}</h5>${e.instructions.addSpatial.selectFeature.subheading}</div><div><h5 class="heading">${e.instructions.addSpatial.selectAssociatedFeature.heading}</h5>${e.instructions.addSpatial.selectAssociatedFeature.subheading}</div></div></calcite-flow-item>`}renderFeaturesList(e){return s`<calcite-list label="Feature list">${e.map(this.renderFeatureListItem)}</calcite-list>`}renderHitTestResults(){let{_messages:e,_activeTraceLocationType:t,_featuresFromHitTest:i,mode:a}=this,r=t==="starting-point"?e.labels.addSpatial.startingPoint:t==="barrier"?e.labels.addSpatial.barrier:e.labels.addSpatial.stoppingPoint;return s`<calcite-flow-item .selected=${a==="add-spatial-feature-list"} .heading=${r} @calciteFlowItemBack=${o=>this._handleAddSpatialCancelClick(o)}>${this.renderFeaturesList(i)}</calcite-flow-item>`}renderSelectedFeature(){let{_selectedFeature:e}=this;return e?s`<arcgis-features .referenceElement=${this.referenceElement} .features=${[e]} .view=${this.view} .defaultPopupTemplateEnabled=${this._defaultPopupTemplateEnabled} open @arcgisClose=${()=>this._handleFeaturesClose()} .autoDestroyDisabled=${this.autoDestroyDisabled} ${h(this._featuresComponentRefChange)}></arcgis-features>`:(this.mode="default",null)}renderAddSpatialFooter(){let{mode:e,_messages:t,selectedUtilityNetwork:i,_selectedFeature:a}=this,r=I(t.warnings.exceededDisplayLimit,{limit:this._displayLimit.toString()}),o=e==="add-spatial-feature-list"&&this._exceedDisplayLimit,l=a?!(i?.isUtilityLayer(a.layer)??!0):!0;return s`${o&&s`<calcite-input-message id=results-limited-message icon=exclamation-mark-circle status=idle>${r}</calcite-input-message>`||""}<calcite-button appearance=outline width=full @click=${()=>{this._handleAddSpatialCancelClick()}} slot=footer>${t.buttons.cancel}</calcite-button>${e==="add-spatial-feature"&&s`<calcite-button width=full slot=footer appearance=solid @click=${()=>{this._handleAddSpatialAddClick()}} .disabled=${l}>${t.buttons.add}</calcite-button>`||""}`}renderStartingPointSelection(){return s`<arcgis-utility-network-trace-location .view=${this.view} trace-location-type=starting-point .beforeTraceLocationSelectStart=${this.beforeTraceLocationSelectStart} @arcgisTraceLocationSelectStart=${this._handleTraceLocationSelectStart} @arcgisTraceLocationSelectEnd=${this._handleTraceLocationSelectEnd} @arcgisTraceLocationChange=${()=>this.arcgisTraceInputsChange.emit()} .sketchViewModel=${this._sketchViewModel} .utilityNetwork=${this.selectedUtilityNetwork} .filterLayers=${this._unLayers} .flagLayer=${this._getGraphicLayer(c)} .traceLocations=${this._startingPoints} .afterHitTest=${this._handleHitTestComplete.bind(this)} .autoDestroyDisabled=${this.autoDestroyDisabled} ${h(this._traceLocationStartingRefChange)}></arcgis-utility-network-trace-location>`}renderStoppingPointSelection(){return s`<arcgis-utility-network-trace-location .view=${this.view} trace-location-type=stopping-point .beforeTraceLocationSelectStart=${this.beforeTraceLocationSelectStart} @arcgisTraceLocationSelectStart=${this._handleTraceLocationSelectStart} @arcgisTraceLocationSelectEnd=${this._handleTraceLocationSelectEnd} @arcgisTraceLocationChange=${()=>this.arcgisTraceInputsChange.emit()} .sketchViewModel=${this._sketchViewModel} .utilityNetwork=${this.selectedUtilityNetwork} .filterLayers=${this._unLayers} .flagLayer=${this._getGraphicLayer(c)} .traceLocations=${this._stoppingPoints} .afterHitTest=${this._handleHitTestComplete.bind(this)} .autoDestroyDisabled=${this.autoDestroyDisabled} ${h(this._traceLocationStoppingRefChange)}></arcgis-utility-network-trace-location>`}renderBarrierSelection(){return s`<arcgis-utility-network-trace-location .view=${this.view} trace-location-type=barrier .beforeTraceLocationSelectStart=${this.beforeTraceLocationSelectStart} @arcgisTraceLocationSelectStart=${this._handleTraceLocationSelectStart} @arcgisTraceLocationSelectEnd=${this._handleTraceLocationSelectEnd} @arcgisTraceLocationChange=${()=>this.arcgisTraceInputsChange.emit()} .sketchViewModel=${this._sketchViewModel} .utilityNetwork=${this.selectedUtilityNetwork} .filterLayers=${this._unLayers} .flagLayer=${this._getGraphicLayer(c)} .traceLocations=${this._barriers} .afterHitTest=${this._handleHitTestComplete.bind(this)} .autoDestroyDisabled=${this.autoDestroyDisabled} ${h(this._traceLocationBarrierRefChange)}></arcgis-utility-network-trace-location>`}renderSubnetworkNameInput(){return s`<calcite-input clearable type=text .placeholder=${this._messages.instructions.enterSubnetworkName} max-length=64 .value=${this.selectedSubnetworkName} @calciteInputInput=${e=>this.selectedSubnetworkName=e.target.value}></calcite-input><calcite-input-message icon=exclamation-mark-triangle status=idle>${this._messages.labels.tooManySubnetworks}</calcite-input-message>`}renderSubnetworkSelectList(){return s`<calcite-select .label=${this._messages.labels.subnetworkName} .value=${this.selectedSubnetworkName} @calciteSelectChange=${e=>this.selectedSubnetworkName=e.target.value}>${this.compatibleSubnetworkNames.map(e=>s`<calcite-option .value=${e}>${e}</calcite-option>`)}</calcite-select>`}renderSubnetworkSelection(){let{compatibleSubnetworkNames:e}=this,t=this._messages.labels.subnetworkName;return this.isSubnetworkNameTraceSelected?this._state==="loading"?s`<calcite-loader class="inline-loader" label=loading scale=s></calcite-loader>`:e.length?s`<calcite-block .heading=${t} .label=${t} expanded>${e.length>x?this.renderSubnetworkNameInput():this.renderSubnetworkSelectList()}</calcite-block>`:this.renderError(this._messages.errors.noCompatibleSubnetworks,!1,"exclamation-mark-triangle"):null}renderSubnetworkInfo(){let{_messages:e,selectedNamedTraceConfiguration:t,_unTraceConfiguration:i}=this;return i&&t?.traceType&&this._subnetworkTraceTypes.has(t.traceType)?s`<calcite-block id=subnetwork-info-block expanded .label=${e.labels.subnetworkInfo}><arcgis-utility-network-subnetwork-info .namedTraceConfig=${t}></arcgis-utility-network-subnetwork-info></calcite-block>`:null}renderContent(){let{utilityNetworks:e}=this,t=this.selectedNamedTraceConfiguration?.traceConfiguration;if(!e||e.length===0)return this.renderError(this._messages.errors.noUtilityNetworkError);let i=s`${this.renderTraceSelection()}${this.renderSubnetworkInfo()}${this.renderSubnetworkSelection()}`,a=s`${this.showStartingPoints?this.renderStartingPointSelection():null}${this.showStoppingPoints?this.renderStoppingPointSelection():null}${this.renderBarrierSelection()}`;return s`<calcite-block-group .label=${this._messages.labels.traceInputs}>${e.length>1?this.renderUtilityNetworkSelection():null}${this.selectedUtilityNetwork?.loaded?i:this.renderLoader()}${t?a:null}</calcite-block-group>`}render(){let{mode:e}=this;return s`<calcite-panel>${e==="add-spatial-feature"?this.renderSelectedFeature():s`<calcite-flow>${this.renderDefaultMode()}${this.renderSpatialSelectInstructions()}${this.renderHitTestResults()}</calcite-flow>`}${e!=="default"?this.renderAddSpatialFooter():null}</calcite-panel>`}};S("arcgis-utility-network-trace-inputs",f);return f},"applications/Components/featureUtils","core/Collection","core/reactiveUtils","intl","layers/GraphicsLayer","networks/support/UNTraceConfiguration","rest/networks/support/TraceLocation","rest/support/FeatureSet","views/interactive/snapping/FeatureSnappingLayerSource","widgets/Sketch/SketchViewModel",a)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{d as s}from"./7WLTT4K3.js";import{p as u}from"./R5KGKAEB.js";export default $arcgis.t(([{replace:f},{fieldFormatFromFieldInfo:h}])=>{var c=/^\s*expression\//iu,y=/href=(""|'')/giu,I=/(\{([^{\r\n]+)\})/gu,N=/href\s*=\s*(?:"([^"]+)"|'([^']+)')/giu,F=/'/gu,C="relationships/",w=/^(?:mailto:|tel:)/u;function P(n,e){let r=new Map;if(!n)return r;for(let t of n){if(!t.fieldName)continue;let i=d(t.fieldName,e);t.fieldName=i,r.set(i.toLowerCase(),t)}return r}function R(n){let e=[];if(!n)return e;let{fieldInfos:r,content:t}=n;return r&&e.push(...r),!t||!Array.isArray(t)||t.forEach(i=>{if(i.type==="fields"){let o=i?.fieldInfos;o&&e.push(...o)}}),e}function W(n,e){return n?.getEffectivePopupTemplate(e)??void 0}function B(n){if(n!=null)return"sourceLayer"in n&&n.sourceLayer?n.sourceLayer:n.layer??void 0}function L(n=""){return n?n.includes(C):!1}function D(n=""){if(n)return!w.test(n.trim().toLowerCase())}function d(n,e){let r=g(e,n);return r?r.name:n}function G(n,e){return n?.map(r=>d(r,e))}function p(n){return n?c.test(n):!1}function b(n,e){if(!e||!p(e)||!n)return;let r=e.replace(c,"").toLowerCase();return n.find(({name:t})=>t.toLowerCase()===r)}function J(n,e){if(!(!n?.length||!e))return n.find(r=>r.fieldName?.toLowerCase()===e.toLowerCase())}function A(n){let{fieldInfo:e,graphic:r,layer:t}=n;return v({fieldInfo:e,graphic:r})?s(t,{graphic:r}):null}function v({fieldInfo:n,graphic:e}){return!!n?.fieldName&&!p(n.fieldName)&&!L(n.fieldName)&&!e?.popupTemplate}function K({expressionInfos:n,fieldInfo:e,graphic:r,isContentFieldInfos:t,layer:i}){if(!e?.fieldName)return null;let o=b(n,e?.fieldName);if(o)return o.title||null;let a=A({fieldInfo:e,graphic:r,layer:i});if(a){let l=a.getFieldAlias(e.fieldName);return t?e.label||l||e.fieldName:l||e.fieldName}return e.label||e.fieldName}function Q(n){let{configurableFieldsContainer:e,fieldInfo:r,isContentFieldInfos:t}=n;if(!r?.fieldName)return null;let i=!e.popupTemplate&&!e.fieldConfigurations?h(r,e.getField(r.fieldName)):e.getFieldConfiguration(r.fieldName)?.fieldFormat;return t&&r.fieldFormat||i}function m(n){return n.trim()}function x(n){return n.replaceAll(y,"")}function j(n,e){return`{${e.get(n.toLowerCase())?.fieldName||n}}`}function k({formattedValues:n,template:e,fieldInfoMap:r}){return m(x(f(f(e,t=>j(t,r)),n)))}function g(n,e){return!(n&&"getField"in n&&typeof n.getField=="function")||!e?null:n.getField(e)??null}function E(n,e){return n.replaceAll(I,(r,t,i)=>{let o=g(e,i);return o?`{${o.name}}`:t})}function M(n,e,r=!1){let t=e[n];if(typeof t=="string"){let i=(r?encodeURIComponent(t):t).replaceAll(F,"%27");e[n]=i}}function T(n,e=!1){let r={...n};return Object.keys(r).forEach(t=>M(t,r,e)),r}function V(n,e,r){e=m(e);let t=e&&!e.startsWith("{");return f(n,T(r,t||!1))}function $(n,e,r){let t=E(n,r);return t&&t.replaceAll(N,(i,o,a)=>V(i,o||a,e))}function _({values:n,globalValues:e,layer:r,text:t,fieldInfoMap:i}){return t?k({formattedValues:e,template:$(t,{...e,...n},r),fieldInfoMap:i}):""}async function z({type:n,value:e,event:r}){try{return typeof e=="function"?e(r):await e}catch(t){u("error","arcgis-feature",`An error occurred when calling the "${n}" function`,{detail:{error:t,graphic:r.graphic,value:e}});return}}function H(n){let e=n.attributes,r=n.layer;if(!e||!r)return"";let t="displayField"in r?r.displayField:null,i=t!=null?e[t]:null,o=n.getObjectId()?.toString();return i?.toString()||o||"Unknown"}return{a:P,b:R,c:W,d:B,e:L,f:D,g:d,h:G,i:p,j:J,k:A,l:K,m:Q,n:k,o:E,p:_,q:z,r:H}},"applications/Components/stringUtils","applications/Components/fieldFormatUtils")
2
+ import{e as s}from"./CAXI6CJY.js";import{p as u}from"./R5KGKAEB.js";export default $arcgis.t(([{replace:f},{fieldFormatFromFieldInfo:h}])=>{var c=/^\s*expression\//iu,y=/href=(""|'')/giu,I=/(\{([^{\r\n]+)\})/gu,N=/href\s*=\s*(?:"([^"]+)"|'([^']+)')/giu,F=/'/gu,C="relationships/",w=/^(?:mailto:|tel:)/u;function P(n,e){let r=new Map;if(!n)return r;for(let t of n){if(!t.fieldName)continue;let i=d(t.fieldName,e);t.fieldName=i,r.set(i.toLowerCase(),t)}return r}function R(n){let e=[];if(!n)return e;let{fieldInfos:r,content:t}=n;return r&&e.push(...r),!t||!Array.isArray(t)||t.forEach(i=>{if(i.type==="fields"){let o=i?.fieldInfos;o&&e.push(...o)}}),e}function W(n,e){return n?.getEffectivePopupTemplate(e)??void 0}function B(n){if(n!=null)return"sourceLayer"in n&&n.sourceLayer?n.sourceLayer:n.layer??void 0}function L(n=""){return n?n.includes(C):!1}function D(n=""){if(n)return!w.test(n.trim().toLowerCase())}function d(n,e){let r=g(e,n);return r?r.name:n}function G(n,e){return n?.map(r=>d(r,e))}function p(n){return n?c.test(n):!1}function b(n,e){if(!e||!p(e)||!n)return;let r=e.replace(c,"").toLowerCase();return n.find(({name:t})=>t.toLowerCase()===r)}function J(n,e){if(!(!n?.length||!e))return n.find(r=>r.fieldName?.toLowerCase()===e.toLowerCase())}function A(n){let{fieldInfo:e,graphic:r,layer:t}=n;return v({fieldInfo:e,graphic:r})?s(t,{graphic:r}):null}function v({fieldInfo:n,graphic:e}){return!!n?.fieldName&&!p(n.fieldName)&&!L(n.fieldName)&&!e?.popupTemplate}function K({expressionInfos:n,fieldInfo:e,graphic:r,isContentFieldInfos:t,layer:i}){if(!e?.fieldName)return null;let o=b(n,e?.fieldName);if(o)return o.title||null;let a=A({fieldInfo:e,graphic:r,layer:i});if(a){let l=a.getFieldAlias(e.fieldName);return t?e.label||l||e.fieldName:l||e.fieldName}return e.label||e.fieldName}function Q(n){let{configurableFieldsContainer:e,fieldInfo:r,isContentFieldInfos:t}=n;if(!r?.fieldName)return null;let i=!e.popupTemplate&&!e.fieldConfigurations?h(r,e.getField(r.fieldName)):e.getFieldConfiguration(r.fieldName)?.fieldFormat;return t&&r.fieldFormat||i}function m(n){return n.trim()}function x(n){return n.replaceAll(y,"")}function j(n,e){return`{${e.get(n.toLowerCase())?.fieldName||n}}`}function k({formattedValues:n,template:e,fieldInfoMap:r}){return m(x(f(f(e,t=>j(t,r)),n)))}function g(n,e){return!(n&&"getField"in n&&typeof n.getField=="function")||!e?null:n.getField(e)??null}function E(n,e){return n.replaceAll(I,(r,t,i)=>{let o=g(e,i);return o?`{${o.name}}`:t})}function M(n,e,r=!1){let t=e[n];if(typeof t=="string"){let i=(r?encodeURIComponent(t):t).replaceAll(F,"%27");e[n]=i}}function T(n,e=!1){let r={...n};return Object.keys(r).forEach(t=>M(t,r,e)),r}function V(n,e,r){e=m(e);let t=e&&!e.startsWith("{");return f(n,T(r,t||!1))}function $(n,e,r){let t=E(n,r);return t&&t.replaceAll(N,(i,o,a)=>V(i,o||a,e))}function _({values:n,globalValues:e,layer:r,text:t,fieldInfoMap:i}){return t?k({formattedValues:e,template:$(t,{...e,...n},r),fieldInfoMap:i}):""}async function z({type:n,value:e,event:r}){try{return typeof e=="function"?e(r):await e}catch(t){u("error","arcgis-feature",`An error occurred when calling the "${n}" function`,{detail:{error:t,graphic:r.graphic,value:e}});return}}function H(n){let e=n.attributes,r=n.layer;if(!e||!r)return"";let t="displayField"in r?r.displayField:null,i=t!=null?e[t]:null,o=n.getObjectId()?.toString();return i?.toString()||o||"Unknown"}return{a:P,b:R,c:W,d:B,e:L,f:D,g:d,h:G,i:p,j:J,k:A,l:K,m:Q,n:k,o:E,p:_,q:z,r:H}},"applications/Components/stringUtils","applications/Components/fieldFormatUtils")
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{a as b}from"./MP6Z45SA.js";import a from"./BTIV4UDX.js";import"./7WLTT4K3.js";import{a as R}from"./B2G5OTNZ.js";import{b as P}from"./LB32PLWG.js";import{M as O,N as S,O as j,P as q,S as L,U as Q,a as x,b as o}from"./R5KGKAEB.js";import"./3TTFCHAA.js";export default $arcgis.t(([{templateHasKey:V,stripHTML:k},{isRelatableFeatureSupportedLayer:G,findRelatedLayer:J},{substitute:U,formatNumber:H},{watch:_,on:X},K,T,{ignoreAbortErrors:D},Y,{g:B}])=>{var ee=x`:host{position:relative;flex:1 1 auto}.list{min-height:var(--calcite-spacing-xxxl)}.list-item-hidden{display:none}.feature-observer{position:relative;bottom:var(--calcite-spacing-xxl);z-index:2;text-align:center}.sticky-loading-container{display:flex;position:sticky;bottom:var(--calcite-spacing-sm);align-items:center;justify-content:center;z-index:2;margin:0;padding:0;height:var(--calcite-spacing-xxxl);pointer-events:none}`,te=y=>{let e=[];if(y.formTemplate){let{description:t,title:r}=y.formTemplate;y.fields?.forEach(i=>{let s=r&&V(r,i.name),a=t&&V(t,i.name);(s||a)&&e.push(i.name)})}return e},E=100,M=class extends j{constructor(){super(...arguments),this._increaseFeaturePage=()=>{let{state:e,showAllEnabled:t,relatedFeatures:r,featuresPerPage:i,featurePage:s}=this;e==="ready"&&t&&r.length>=i*s&&this.featurePage++},this._relatedFeatureIntersectionObserver=new IntersectionObserver(([e])=>{e?.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this._featurePage=1,this._cancelQuery=()=>{let{_queryAbortController:e}=this;e&&e.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{let{_queryFeatureCountAbortController:e}=this;e&&e.abort(),this._queryFeatureCountAbortController=null},this._cancelQueryPage=()=>{let{_queryPageAbortController:e}=this;e&&e.abort(),this._queryPageAbortController=null},this._queryController=async()=>{this._cancelQuery();let e=new AbortController;this._queryAbortController=e,await D(this._query()),this._queryAbortController===e&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();let e=new AbortController;this._queryFeatureCountAbortController=e,await D(this._queryFeatureCount()),this._queryFeatureCountAbortController===e&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryPageController=async()=>{let e=new AbortController;this._queryPageAbortController=e,await D(this._queryPage()),this._queryPageAbortController===e&&(this._queryPageAbortController=null)},this._queryDebounced=b(this._queryController,E),this._queryFeatureCountDebounced=b(this._queryFeatureCountController,E),this._queryPageDebounced=b(this._queryPageController,E),this._query=async()=>{let{_queryAbortController:e,relatedFeatures:t}=this;!this.featureCount||this.relatedLayer?.type==="subtype-group"&&!this.activeCategory||(this.relatedFeatureViewModels.destroyAll(),this.featurePage=1,t.destroyAll(),t.addMany(this._sliceFeatures(await this._queryRelatedFeatures({signal:e?.signal}))))},this._addFlowItem=e=>{e&&this.flowItems?.push(e)},this._relatedFeatureIntersectionObserverNode=O(),this.relatedFeatures=new K,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.featureCount=0,this._loaded=!1,this.relatedFeatureViewModels=new K,this.autoDestroyDisabled=!1,this.featuresPerPage=10,this.flowType="feature-relationship",this.headingLevel=2,this.hideHeading=!1,this.hideDescription=!1,this.showAllEnabled=!1}static{this.properties={allCategories:16,_queryAbortController:16,_queryPageAbortController:16,_queryFeatureCountAbortController:16,featureCount:16,_loaded:16,canLoad:16,canQuery:16,displayShowAllButton:16,displayListItems:16,categories:16,itemDescriptionFieldName:16,relatedFeatureViewModels:16,state:16,autoDestroyDisabled:5,allItemsDescription:32,featurePage:9,featuresPerPage:9,flowItems:0,flowType:1,headingLevel:9,messages:0,heading:1,description:1,values:0,activeCategory:0,hideHeading:5,hideDescription:5,displayCount:9,graphic:0,layer:0,map:0,view:0,spatialReference:0,timeZone:1,orderByFields:0,relationshipId:9,showAllEnabled:5,label:3}}static{this.styles=ee}get orderByFieldsFixedCasing(){let{orderByFields:e,relatedLayer:t}=this;return e&&t?.loaded?e.map(r=>{let i=r.clone();return i.field=B(r.field,t),i}):e??[]}get supportsCacheHint(){return!!this.layer?.capabilities?.queryRelated?.supportsCacheHint}get allCategoriesCount(){return this.allCategories?.length??0}get objectId(){return(this.objectIdField&&this.graphic?.attributes?.[this.objectIdField])??null}get objectIdField(){return this.layer?.objectIdField||null}get relatedLayer(){let{layer:e,map:t,relationship:r}=this;if(!e?.loaded||!t||!r)return null;let i=e.type==="subtype-sublayer"&&e.parent&&G(e.parent)?e.parent:e;return J(t,i,r)??null}get relatedLayerKeyField(){let{relatedLayer:e,relationshipId:t}=this;return e?.loaded&&t!=null?e.relationships?.find(r=>r.id===t)?.keyField:null}get relatedLayerKeyFields(){let{relatedLayer:e}=this;return e?.loaded?e.relationships?.map(t=>t.keyField).filter(t=>t!=null)??[]:[]}get relationship(){let{relationshipId:e,layer:t}=this;return e!=null&&t?.loaded?t.relationships?.find(({id:r})=>r===e)??null:null}get relationshipKey(){let{relationshipKeyField:e}=this;return(e&&this.graphic?.attributes?.[e])??null}get relationshipKeyField(){return this.relationship?.keyField||null}get canLoad(){return!!this.map&&this.relationshipId!=null&&typeof this.objectId=="number"}get canQuery(){let e=this.layer?.capabilities?.queryRelated;return!!this.relatedLayer&&!!this.relationship&&this.relationshipId!=null&&this.objectId!=null&&!!e?.supportsCount&&e?.supportsPagination}get displayShowAllButton(){let{showAllEnabled:e,featureCount:t,displayCount:r,state:i,allCategoriesCount:s}=this,a=!!s&&(s>r||r===0),n=!!t&&(t>r||r===0);return!e&&i==="ready"&&(a||n)}get displayListItems(){let{relatedFeatures:e,allCategoriesCount:t}=this;return this.displayShowAllButton||!!e.length||!!t}get categories(){let{allCategories:e}=this;return this.showAllEnabled?e:e?.slice(0,this.displayCount)??null}get itemDescriptionFieldName(){return this.orderByFieldsFixedCasing[0]?.field||null}get state(){let{_queryAbortController:e,_queryFeatureCountAbortController:t,_queryPageAbortController:r,canQuery:i,_loaded:s,canLoad:a}=this;return t||a&&!s?"loading":e||r?"querying":i?"ready":"disabled"}get allItemsDescription(){let{messages:e,featureCount:t,allCategories:r,allCategoriesCount:i}=this;return U(e?.numberRecords??"",{number:H(r?i:t)})}get featurePage(){return this._featurePage}set featurePage(e){let{featuresPerPage:t,featureCount:r}=this,i=1,s=Math.ceil(r/t)||1;this._featurePage=Math.min(Math.max(e,i),s)}get heading(){let{activeCategory:e}=this;return this._heading??e?.name}set heading(e){this._heading=e}get displayCount(){return this._displayCount??3}set displayCount(e){this._displayCount=Math.min(Math.max(e??3,0),10)}async destroy(){await this.manager.destroy()}loaded(){this.manager.onLifecycle(()=>[_(()=>[this.displayCount,this.graphic,this.layer,this.layer?.loaded,this.map,this.orderByFields,this.relationshipId,this.featuresPerPage,this.showAllEnabled,this.canQuery,this.featureCount,this.activeCategory],()=>this._queryDebounced(),{initial:!0}),_(()=>[this.featurePage,this.showAllEnabled],()=>this._queryPageDebounced()),_(()=>[this.layer,this.relationshipId,this.objectId,this.canQuery,this.activeCategory],()=>this._queryFeatureCountDebounced(),{initial:!0}),_(()=>[this.state,this.showAllEnabled,this._relatedFeatureIntersectionObserverNode],()=>this._handleRelatedFeatureObserverChange()),X(()=>this.relatedFeatures,"change",()=>this._setRelatedFeaturesViewModels())]),this.manager.onDestroy(()=>{this.relatedFeatureViewModels.destroyAll(),this.relatedFeatures.destroyAll(),this._cancelQuery(),this._cancelQueryFeatureCount(),this._cancelQueryPage(),this._unobserveRelatedFeatureObserver()})}async _queryFeatureCount(){let{layer:e,relatedLayer:t}=this;await e?.load(),await t?.load();let{_queryFeatureCountAbortController:r,activeCategory:i,canQuery:s,objectId:a,relatedLayerKeyField:n,relationshipId:l,relationshipKey:g,supportsCacheHint:C}=this;if(!s||!e||!t||a==null){this.featureCount=0,this.allCategories=void 0;return}if(t?.type==="subtype-group"&&!i){if(this.featureCount=0,this.relatedFeatureViewModels.destroyAll(),this.featurePage=1,this.relatedFeatures.destroyAll(),n&&g!=null){let{default:w}=await $arcgis.t(m=>m[0],"smartMapping/statistics/uniqueValues"),{uniqueValueInfos:v}=await w({layer:t,sqlWhere:`${n} = '${g}'`,field:t.subtypeField??void 0,signal:r?.signal}),I=v.map(({count:u,value:c})=>{let m=t.subtypes?.find(A=>A.code===c)?.name;return c!=null&&m?{count:u,value:c,name:m}:void 0}).filter(u=>u!=null);this.allCategories=I}return}let{historicMoment:p,gdbVersion:f}=e,F=new T({cacheHint:C,gdbVersion:f,historicMoment:p,relationshipId:l,returnGeometry:!1,objectIds:[a],where:this._getRelationshipWhereClause(t)}),h=await e.queryRelatedFeaturesCount(F,{signal:r?.signal});this.allCategories=void 0,this.featureCount=h[a]||0}_getRelationshipWhereClause(e){let{activeCategory:t}=this,r=e.createQuery(),i="subtypeField"in e?e.subtypeField:void 0,s=t&&i?`${i} = ${t.value}`:void 0,a=r.where;return a&&s?`(${a}) AND (${s})`:a??s}_sliceFeatures(e){let{showAllEnabled:t,displayCount:r}=this;return t?e:r?e.slice(0,r):[]}async _queryPage(){let{relatedFeatures:e,featurePage:t,showAllEnabled:r,_queryPageAbortController:i,featureCount:s}=this;!r||t<2||!s||this.relatedLayer?.type==="subtype-group"&&!this.activeCategory||e.addMany(await this._queryRelatedFeatures({signal:i?.signal}))}async _queryRelatedFeatures(e){let{displayCount:t,featureCount:r,featurePage:i,featuresPerPage:s,layer:a,orderByFieldsFixedCasing:n,relatedLayer:l,relatedLayerKeyFields:g,relationshipId:C,showAllEnabled:p,supportsCacheHint:f}=this,{canQuery:F,objectId:h}=this;if(!F||!a||!l||h==null)return[];let w=p?((i-1)*s+r)%r:0,v=p?s:t,I=l.objectIdField,u="subtypeField"in l?l.subtypeField:void 0,c=[...n.map(d=>d.field),...te(l),...g,I,u].filter(d=>d!=null),m=n.map(d=>`${d.field} ${d.order}`),{historicMoment:A,gdbVersion:Z}=a,W=new T({orderByFields:m,start:w,num:v,outFields:c,cacheHint:f,historicMoment:A,gdbVersion:Z,relationshipId:C,returnGeometry:!1,objectIds:[h],where:this._getRelationshipWhereClause(l)}),$=(await a.queryRelatedFeatures(W,{signal:e?.signal}))[h]?.features||[];return l.type==="subtype-group"&&u?$.forEach(d=>{let z=d.attributes[u],N=l.findSublayerForSubtypeCode?.(z);d.sourceLayer=N,d.layer=N}):$.forEach(d=>{d.sourceLayer=l,d.layer=l}),$}_selectCategory(e){let{flowItems:t}=this;t&&this._addRelationshipFlowItem({showAllEnabled:!0,activeCategory:e})}_selectRecord(e){let{flowItems:t}=this;t&&this._addFlowItem(L(R(e,o`<arcgis-feature .autoDestroyDisabled=${this.autoDestroyDisabled} .flowItems=${t} .flowType=${this.flowType} .graphic=${e.graphic} .map=${this.map} show-relationship-content .spatialReference=${this.spatialReference} .timeZone=${this.timeZone} .view=${this.view}></arcgis-feature>`)))}_addRelationshipFlowItem({showAllEnabled:e=!1,activeCategory:t}){this._addFlowItem(L(R(t,o`<arcgis-feature-relationship .autoDestroyDisabled=${this.autoDestroyDisabled} .messages=${this.messages} .activeCategory=${t} .displayCount=${this.displayCount} .flowItems=${this.flowItems} .flowType=${this.flowType} .graphic=${this.graphic} .heading=${this.heading} hide-description .showAllEnabled=${e} hide-heading .layer=${this.layer} .map=${this.map} .orderByFields=${this.orderByFields} .relationshipId=${this.relationshipId} .spatialReference=${this.spatialReference} .values=${this.values} .view=${this.view}></arcgis-feature-relationship>`)))}_showAllRecords(){let{flowItems:e}=this;e&&this._addRelationshipFlowItem({showAllEnabled:!0})}_handleRelatedFeatureObserverChange(){this._unobserveRelatedFeatureObserver();let{state:e,showAllEnabled:t}=this;this._relatedFeatureIntersectionObserverNode.value&&e==="ready"&&t&&this._relatedFeatureIntersectionObserver.observe(this._relatedFeatureIntersectionObserverNode.value)}_unobserveRelatedFeatureObserver(){this._relatedFeatureIntersectionObserverNode.value&&this._relatedFeatureIntersectionObserver.unobserve(this._relatedFeatureIntersectionObserverNode.value)}_matchesFeature(e,t){let r=e?.graphic?.getObjectId(),i=t?.getObjectId();return r!=null&&i!=null&&r===i}_setRelatedFeaturesViewModels(){let{relatedFeatures:e,relatedFeatureViewModels:t,map:r,view:i,spatialReference:s,timeZone:a}=this;e?.filter(Boolean).forEach(n=>{t.some(l=>this._matchesFeature(l,n))||t.add(new Y({abilities:{relationshipContent:!1},map:r,view:i,spatialReference:s,timeZone:a,graphic:n}))}),t.forEach(n=>{e?.find(l=>this._matchesFeature(n,l))||t.remove(n)})}render(){let{state:e}=this;return o`<div class="root"><arcgis-feature-element-info .heading=${this.heading} .headingLevel=${this.headingLevel} .description=${this.description}></arcgis-feature-element-info>${e==="loading"?this._renderLoading():e==="disabled"?this._renderRelationshipNotFound():this._renderRelatedFeatures()}</div>`}_renderStickyLoading(){return this.state==="querying"?o`<div class="sticky-loading-container">${this._renderLoadingIcon()}</div>`:null}_renderLoadingIcon(){return o`<calcite-loader inline label></calcite-loader>`}_renderLoading(){return o`<div class="loading-container">${this._renderLoadingIcon()}</div>`}_renderShowAllIconNode(){return o`<calcite-icon icon=list scale=s slot=content-end></calcite-icon>`}_renderChevronIconNode(){return o`<calcite-icon flip-rtl icon=chevron-right scale=s slot=content-end></calcite-icon>`}_renderCategory(e){let{count:t,name:r}=e,i=H(t);return o`<calcite-list-item class="list-item" .disabled=${!t} .label=${r} @calciteListItemSelect=${()=>this._selectCategory(e)}><calcite-chip .label=${i} scale=s slot=content-end>${i}</calcite-chip>${this._renderChevronIconNode()}</calcite-list-item>`}_renderRelatedFeature(e){let{itemDescriptionFieldName:t,values:r}=this,{formattedAttributes:i,state:s,title:a}=e,n={...r,...i?.global},l=(t&&n?.[t])??"";return o`<calcite-list-item class=${q(P("list-item",{"list-item-hidden":s==="loading"}))} .description=${k(l.toString())} .label=${k(a)} @calciteListItemSelect=${()=>this._selectRecord(e)}>${this._renderChevronIconNode()}</calcite-list-item>`}_renderShowAllListItem(){return this.displayShowAllButton?o`<calcite-list-item .description=${this.allItemsDescription} .label=${this.messages?.showAll} @calciteListItemSelect=${()=>this._showAllRecords()}>${this._renderShowAllIconNode()}</calcite-list-item>`:null}_renderNoRelatedFeaturesMessage(){return o`<calcite-notice icon=information kind=brand open scale=s width=full><div slot=message>${this.messages?.noRelatedFeatures}</div></calcite-notice>`}_renderFeatureObserver(){return o`<div class="feature-observer" ${S(this._relatedFeatureIntersectionObserverNode)}></div>`}_renderList(){let{relatedFeatureViewModels:e,categories:t}=this;return o`<calcite-list display-mode=flat .label=${this.messages?.relatedFeaturesList??""}>${t?.map(r=>this._renderCategory(r))??e.toArray().map(r=>this._renderRelatedFeature(r))}${this._renderShowAllListItem()}</calcite-list>`}_renderRelatedFeatures(){let{displayListItems:e}=this,{state:t}=this;return o`<div class=${q(P("list",{"list-querying":t==="querying"}))}>${e?this._renderList():t==="ready"?this._renderNoRelatedFeaturesMessage():null}${this._renderStickyLoading()}${this._renderFeatureObserver()}</div>`}_renderRelationshipNotFound(){return o`<calcite-notice icon=exclamation-mark-triangle kind=danger open scale=s width=full><div slot=message>${this.messages?.relationshipNotFound}</div></calcite-notice>`}};Q("arcgis-feature-relationship",M);return M},"applications/Components/stringUtils","applications/Components/featureUtils","intl","core/reactiveUtils","core/Collection","rest/support/RelationshipQuery","core/promiseUtils","widgets/Feature/FeatureViewModel",a)
2
+ import{a as b}from"./MP6Z45SA.js";import a from"./6OMMETC4.js";import"./CAXI6CJY.js";import{a as R}from"./B2G5OTNZ.js";import{b as P}from"./LB32PLWG.js";import{M as O,N as S,O as j,P as q,S as L,U as Q,a as x,b as o}from"./R5KGKAEB.js";import"./3TTFCHAA.js";export default $arcgis.t(([{templateHasKey:V,stripHTML:k},{isRelatableFeatureSupportedLayer:G,findRelatedLayer:J},{substitute:U,formatNumber:H},{watch:_,on:X},K,T,{ignoreAbortErrors:D},Y,{g:B}])=>{var ee=x`:host{position:relative;flex:1 1 auto}.list{min-height:var(--calcite-spacing-xxxl)}.list-item-hidden{display:none}.feature-observer{position:relative;bottom:var(--calcite-spacing-xxl);z-index:2;text-align:center}.sticky-loading-container{display:flex;position:sticky;bottom:var(--calcite-spacing-sm);align-items:center;justify-content:center;z-index:2;margin:0;padding:0;height:var(--calcite-spacing-xxxl);pointer-events:none}`,te=y=>{let e=[];if(y.formTemplate){let{description:t,title:r}=y.formTemplate;y.fields?.forEach(i=>{let s=r&&V(r,i.name),a=t&&V(t,i.name);(s||a)&&e.push(i.name)})}return e},E=100,M=class extends j{constructor(){super(...arguments),this._increaseFeaturePage=()=>{let{state:e,showAllEnabled:t,relatedFeatures:r,featuresPerPage:i,featurePage:s}=this;e==="ready"&&t&&r.length>=i*s&&this.featurePage++},this._relatedFeatureIntersectionObserver=new IntersectionObserver(([e])=>{e?.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this._featurePage=1,this._cancelQuery=()=>{let{_queryAbortController:e}=this;e&&e.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{let{_queryFeatureCountAbortController:e}=this;e&&e.abort(),this._queryFeatureCountAbortController=null},this._cancelQueryPage=()=>{let{_queryPageAbortController:e}=this;e&&e.abort(),this._queryPageAbortController=null},this._queryController=async()=>{this._cancelQuery();let e=new AbortController;this._queryAbortController=e,await D(this._query()),this._queryAbortController===e&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();let e=new AbortController;this._queryFeatureCountAbortController=e,await D(this._queryFeatureCount()),this._queryFeatureCountAbortController===e&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryPageController=async()=>{let e=new AbortController;this._queryPageAbortController=e,await D(this._queryPage()),this._queryPageAbortController===e&&(this._queryPageAbortController=null)},this._queryDebounced=b(this._queryController,E),this._queryFeatureCountDebounced=b(this._queryFeatureCountController,E),this._queryPageDebounced=b(this._queryPageController,E),this._query=async()=>{let{_queryAbortController:e,relatedFeatures:t}=this;!this.featureCount||this.relatedLayer?.type==="subtype-group"&&!this.activeCategory||(this.relatedFeatureViewModels.destroyAll(),this.featurePage=1,t.destroyAll(),t.addMany(this._sliceFeatures(await this._queryRelatedFeatures({signal:e?.signal}))))},this._addFlowItem=e=>{e&&this.flowItems?.push(e)},this._relatedFeatureIntersectionObserverNode=O(),this.relatedFeatures=new K,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.featureCount=0,this._loaded=!1,this.relatedFeatureViewModels=new K,this.autoDestroyDisabled=!1,this.featuresPerPage=10,this.flowType="feature-relationship",this.headingLevel=2,this.hideHeading=!1,this.hideDescription=!1,this.showAllEnabled=!1}static{this.properties={allCategories:16,_queryAbortController:16,_queryPageAbortController:16,_queryFeatureCountAbortController:16,featureCount:16,_loaded:16,canLoad:16,canQuery:16,displayShowAllButton:16,displayListItems:16,categories:16,itemDescriptionFieldName:16,relatedFeatureViewModels:16,state:16,autoDestroyDisabled:5,allItemsDescription:32,featurePage:9,featuresPerPage:9,flowItems:0,flowType:1,headingLevel:9,messages:0,heading:1,description:1,values:0,activeCategory:0,hideHeading:5,hideDescription:5,displayCount:9,graphic:0,layer:0,map:0,view:0,spatialReference:0,timeZone:1,orderByFields:0,relationshipId:9,showAllEnabled:5,label:3}}static{this.styles=ee}get orderByFieldsFixedCasing(){let{orderByFields:e,relatedLayer:t}=this;return e&&t?.loaded?e.map(r=>{let i=r.clone();return i.field=B(r.field,t),i}):e??[]}get supportsCacheHint(){return!!this.layer?.capabilities?.queryRelated?.supportsCacheHint}get allCategoriesCount(){return this.allCategories?.length??0}get objectId(){return(this.objectIdField&&this.graphic?.attributes?.[this.objectIdField])??null}get objectIdField(){return this.layer?.objectIdField||null}get relatedLayer(){let{layer:e,map:t,relationship:r}=this;if(!e?.loaded||!t||!r)return null;let i=e.type==="subtype-sublayer"&&e.parent&&G(e.parent)?e.parent:e;return J(t,i,r)??null}get relatedLayerKeyField(){let{relatedLayer:e,relationshipId:t}=this;return e?.loaded&&t!=null?e.relationships?.find(r=>r.id===t)?.keyField:null}get relatedLayerKeyFields(){let{relatedLayer:e}=this;return e?.loaded?e.relationships?.map(t=>t.keyField).filter(t=>t!=null)??[]:[]}get relationship(){let{relationshipId:e,layer:t}=this;return e!=null&&t?.loaded?t.relationships?.find(({id:r})=>r===e)??null:null}get relationshipKey(){let{relationshipKeyField:e}=this;return(e&&this.graphic?.attributes?.[e])??null}get relationshipKeyField(){return this.relationship?.keyField||null}get canLoad(){return!!this.map&&this.relationshipId!=null&&typeof this.objectId=="number"}get canQuery(){let e=this.layer?.capabilities?.queryRelated;return!!this.relatedLayer&&!!this.relationship&&this.relationshipId!=null&&this.objectId!=null&&!!e?.supportsCount&&e?.supportsPagination}get displayShowAllButton(){let{showAllEnabled:e,featureCount:t,displayCount:r,state:i,allCategoriesCount:s}=this,a=!!s&&(s>r||r===0),n=!!t&&(t>r||r===0);return!e&&i==="ready"&&(a||n)}get displayListItems(){let{relatedFeatures:e,allCategoriesCount:t}=this;return this.displayShowAllButton||!!e.length||!!t}get categories(){let{allCategories:e}=this;return this.showAllEnabled?e:e?.slice(0,this.displayCount)??null}get itemDescriptionFieldName(){return this.orderByFieldsFixedCasing[0]?.field||null}get state(){let{_queryAbortController:e,_queryFeatureCountAbortController:t,_queryPageAbortController:r,canQuery:i,_loaded:s,canLoad:a}=this;return t||a&&!s?"loading":e||r?"querying":i?"ready":"disabled"}get allItemsDescription(){let{messages:e,featureCount:t,allCategories:r,allCategoriesCount:i}=this;return U(e?.numberRecords??"",{number:H(r?i:t)})}get featurePage(){return this._featurePage}set featurePage(e){let{featuresPerPage:t,featureCount:r}=this,i=1,s=Math.ceil(r/t)||1;this._featurePage=Math.min(Math.max(e,i),s)}get heading(){let{activeCategory:e}=this;return this._heading??e?.name}set heading(e){this._heading=e}get displayCount(){return this._displayCount??3}set displayCount(e){this._displayCount=Math.min(Math.max(e??3,0),10)}async destroy(){await this.manager.destroy()}loaded(){this.manager.onLifecycle(()=>[_(()=>[this.displayCount,this.graphic,this.layer,this.layer?.loaded,this.map,this.orderByFields,this.relationshipId,this.featuresPerPage,this.showAllEnabled,this.canQuery,this.featureCount,this.activeCategory],()=>this._queryDebounced(),{initial:!0}),_(()=>[this.featurePage,this.showAllEnabled],()=>this._queryPageDebounced()),_(()=>[this.layer,this.relationshipId,this.objectId,this.canQuery,this.activeCategory],()=>this._queryFeatureCountDebounced(),{initial:!0}),_(()=>[this.state,this.showAllEnabled,this._relatedFeatureIntersectionObserverNode],()=>this._handleRelatedFeatureObserverChange()),X(()=>this.relatedFeatures,"change",()=>this._setRelatedFeaturesViewModels())]),this.manager.onDestroy(()=>{this.relatedFeatureViewModels.destroyAll(),this.relatedFeatures.destroyAll(),this._cancelQuery(),this._cancelQueryFeatureCount(),this._cancelQueryPage(),this._unobserveRelatedFeatureObserver()})}async _queryFeatureCount(){let{layer:e,relatedLayer:t}=this;await e?.load(),await t?.load();let{_queryFeatureCountAbortController:r,activeCategory:i,canQuery:s,objectId:a,relatedLayerKeyField:n,relationshipId:l,relationshipKey:g,supportsCacheHint:C}=this;if(!s||!e||!t||a==null){this.featureCount=0,this.allCategories=void 0;return}if(t?.type==="subtype-group"&&!i){if(this.featureCount=0,this.relatedFeatureViewModels.destroyAll(),this.featurePage=1,this.relatedFeatures.destroyAll(),n&&g!=null){let{default:w}=await $arcgis.t(m=>m[0],"smartMapping/statistics/uniqueValues"),{uniqueValueInfos:v}=await w({layer:t,sqlWhere:`${n} = '${g}'`,field:t.subtypeField??void 0,signal:r?.signal}),I=v.map(({count:u,value:c})=>{let m=t.subtypes?.find(A=>A.code===c)?.name;return c!=null&&m?{count:u,value:c,name:m}:void 0}).filter(u=>u!=null);this.allCategories=I}return}let{historicMoment:p,gdbVersion:f}=e,F=new T({cacheHint:C,gdbVersion:f,historicMoment:p,relationshipId:l,returnGeometry:!1,objectIds:[a],where:this._getRelationshipWhereClause(t)}),h=await e.queryRelatedFeaturesCount(F,{signal:r?.signal});this.allCategories=void 0,this.featureCount=h[a]||0}_getRelationshipWhereClause(e){let{activeCategory:t}=this,r=e.createQuery(),i="subtypeField"in e?e.subtypeField:void 0,s=t&&i?`${i} = ${t.value}`:void 0,a=r.where;return a&&s?`(${a}) AND (${s})`:a??s}_sliceFeatures(e){let{showAllEnabled:t,displayCount:r}=this;return t?e:r?e.slice(0,r):[]}async _queryPage(){let{relatedFeatures:e,featurePage:t,showAllEnabled:r,_queryPageAbortController:i,featureCount:s}=this;!r||t<2||!s||this.relatedLayer?.type==="subtype-group"&&!this.activeCategory||e.addMany(await this._queryRelatedFeatures({signal:i?.signal}))}async _queryRelatedFeatures(e){let{displayCount:t,featureCount:r,featurePage:i,featuresPerPage:s,layer:a,orderByFieldsFixedCasing:n,relatedLayer:l,relatedLayerKeyFields:g,relationshipId:C,showAllEnabled:p,supportsCacheHint:f}=this,{canQuery:F,objectId:h}=this;if(!F||!a||!l||h==null)return[];let w=p?((i-1)*s+r)%r:0,v=p?s:t,I=l.objectIdField,u="subtypeField"in l?l.subtypeField:void 0,c=[...n.map(d=>d.field),...te(l),...g,I,u].filter(d=>d!=null),m=n.map(d=>`${d.field} ${d.order}`),{historicMoment:A,gdbVersion:Z}=a,W=new T({orderByFields:m,start:w,num:v,outFields:c,cacheHint:f,historicMoment:A,gdbVersion:Z,relationshipId:C,returnGeometry:!1,objectIds:[h],where:this._getRelationshipWhereClause(l)}),$=(await a.queryRelatedFeatures(W,{signal:e?.signal}))[h]?.features||[];return l.type==="subtype-group"&&u?$.forEach(d=>{let z=d.attributes[u],N=l.findSublayerForSubtypeCode?.(z);d.sourceLayer=N,d.layer=N}):$.forEach(d=>{d.sourceLayer=l,d.layer=l}),$}_selectCategory(e){let{flowItems:t}=this;t&&this._addRelationshipFlowItem({showAllEnabled:!0,activeCategory:e})}_selectRecord(e){let{flowItems:t}=this;t&&this._addFlowItem(L(R(e,o`<arcgis-feature .autoDestroyDisabled=${this.autoDestroyDisabled} .flowItems=${t} .flowType=${this.flowType} .graphic=${e.graphic} .map=${this.map} show-relationship-content .spatialReference=${this.spatialReference} .timeZone=${this.timeZone} .view=${this.view}></arcgis-feature>`)))}_addRelationshipFlowItem({showAllEnabled:e=!1,activeCategory:t}){this._addFlowItem(L(R(t,o`<arcgis-feature-relationship .autoDestroyDisabled=${this.autoDestroyDisabled} .messages=${this.messages} .activeCategory=${t} .displayCount=${this.displayCount} .flowItems=${this.flowItems} .flowType=${this.flowType} .graphic=${this.graphic} .heading=${this.heading} hide-description .showAllEnabled=${e} hide-heading .layer=${this.layer} .map=${this.map} .orderByFields=${this.orderByFields} .relationshipId=${this.relationshipId} .spatialReference=${this.spatialReference} .values=${this.values} .view=${this.view}></arcgis-feature-relationship>`)))}_showAllRecords(){let{flowItems:e}=this;e&&this._addRelationshipFlowItem({showAllEnabled:!0})}_handleRelatedFeatureObserverChange(){this._unobserveRelatedFeatureObserver();let{state:e,showAllEnabled:t}=this;this._relatedFeatureIntersectionObserverNode.value&&e==="ready"&&t&&this._relatedFeatureIntersectionObserver.observe(this._relatedFeatureIntersectionObserverNode.value)}_unobserveRelatedFeatureObserver(){this._relatedFeatureIntersectionObserverNode.value&&this._relatedFeatureIntersectionObserver.unobserve(this._relatedFeatureIntersectionObserverNode.value)}_matchesFeature(e,t){let r=e?.graphic?.getObjectId(),i=t?.getObjectId();return r!=null&&i!=null&&r===i}_setRelatedFeaturesViewModels(){let{relatedFeatures:e,relatedFeatureViewModels:t,map:r,view:i,spatialReference:s,timeZone:a}=this;e?.filter(Boolean).forEach(n=>{t.some(l=>this._matchesFeature(l,n))||t.add(new Y({abilities:{relationshipContent:!1},map:r,view:i,spatialReference:s,timeZone:a,graphic:n}))}),t.forEach(n=>{e?.find(l=>this._matchesFeature(n,l))||t.remove(n)})}render(){let{state:e}=this;return o`<div class="root"><arcgis-feature-element-info .heading=${this.heading} .headingLevel=${this.headingLevel} .description=${this.description}></arcgis-feature-element-info>${e==="loading"?this._renderLoading():e==="disabled"?this._renderRelationshipNotFound():this._renderRelatedFeatures()}</div>`}_renderStickyLoading(){return this.state==="querying"?o`<div class="sticky-loading-container">${this._renderLoadingIcon()}</div>`:null}_renderLoadingIcon(){return o`<calcite-loader inline label></calcite-loader>`}_renderLoading(){return o`<div class="loading-container">${this._renderLoadingIcon()}</div>`}_renderShowAllIconNode(){return o`<calcite-icon icon=list scale=s slot=content-end></calcite-icon>`}_renderChevronIconNode(){return o`<calcite-icon flip-rtl icon=chevron-right scale=s slot=content-end></calcite-icon>`}_renderCategory(e){let{count:t,name:r}=e,i=H(t);return o`<calcite-list-item class="list-item" .disabled=${!t} .label=${r} @calciteListItemSelect=${()=>this._selectCategory(e)}><calcite-chip .label=${i} scale=s slot=content-end>${i}</calcite-chip>${this._renderChevronIconNode()}</calcite-list-item>`}_renderRelatedFeature(e){let{itemDescriptionFieldName:t,values:r}=this,{formattedAttributes:i,state:s,title:a}=e,n={...r,...i?.global},l=(t&&n?.[t])??"";return o`<calcite-list-item class=${q(P("list-item",{"list-item-hidden":s==="loading"}))} .description=${k(l.toString())} .label=${k(a)} @calciteListItemSelect=${()=>this._selectRecord(e)}>${this._renderChevronIconNode()}</calcite-list-item>`}_renderShowAllListItem(){return this.displayShowAllButton?o`<calcite-list-item .description=${this.allItemsDescription} .label=${this.messages?.showAll} @calciteListItemSelect=${()=>this._showAllRecords()}>${this._renderShowAllIconNode()}</calcite-list-item>`:null}_renderNoRelatedFeaturesMessage(){return o`<calcite-notice icon=information kind=brand open scale=s width=full><div slot=message>${this.messages?.noRelatedFeatures}</div></calcite-notice>`}_renderFeatureObserver(){return o`<div class="feature-observer" ${S(this._relatedFeatureIntersectionObserverNode)}></div>`}_renderList(){let{relatedFeatureViewModels:e,categories:t}=this;return o`<calcite-list display-mode=flat .label=${this.messages?.relatedFeaturesList??""}>${t?.map(r=>this._renderCategory(r))??e.toArray().map(r=>this._renderRelatedFeature(r))}${this._renderShowAllListItem()}</calcite-list>`}_renderRelatedFeatures(){let{displayListItems:e}=this,{state:t}=this;return o`<div class=${q(P("list",{"list-querying":t==="querying"}))}>${e?this._renderList():t==="ready"?this._renderNoRelatedFeaturesMessage():null}${this._renderStickyLoading()}${this._renderFeatureObserver()}</div>`}_renderRelationshipNotFound(){return o`<calcite-notice icon=exclamation-mark-triangle kind=danger open scale=s width=full><div slot=message>${this.messages?.relationshipNotFound}</div></calcite-notice>`}};Q("arcgis-feature-relationship",M);return M},"applications/Components/stringUtils","applications/Components/featureUtils","intl","core/reactiveUtils","core/Collection","rest/support/RelationshipQuery","core/promiseUtils","widgets/Feature/FeatureViewModel",a)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ function o(n,r){if(!n.map)return;let{map:e}=n;e.layers.includes(r)||(e.add(r),e.reorder(r,e.layers.length-1))}function s(n){return n!=null&&typeof n=="object"&&"type"in n&&n.type==="feature"}function a(n){return s(n)&&n?.type==="feature"&&n.source?.type==="feature-layer"}function l(n){return n!=null&&typeof n=="object"&&"type"in n&&n.type==="graphics"}function y(n){return n?.type==="subtype-sublayer"}function c(n){return s(n)&&a(n)}function f(n,r){let e=r?.type==="subtype-sublayer"?r.parent:r;return n.allLayerViews.find(t=>{let u=t.layer;return u===e||"sublayers"in u&&u.sublayers!=null&&u.sublayers.includes(e)})}function i(n){let r=n?.type;return r==="binning"||r==="cluster"}function p(n,r){if(!c(n))return;let e=r?.graphic,t=n.featureReduction;if(e){if(e.isAggregate){let u=e.origin;return u&&"featureReductionProvider"in u&&t?i(t)?t:null:void 0}return n}return r?.checkFeatureReduction&&t?i(t)?t:null:n}export{o as a,l as b,y as c,f as d,p as e};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import f from"./BTIV4UDX.js";import"./7WLTT4K3.js";import e from"./P5MTPM2I.js";import{a as F}from"./PUJPVTUS.js";import d from"./6M6VT4H6.js";import c from"./G44JDQZ4.js";import{g as _}from"./2E5U7E4Y.js";import"./W5TN3LOU.js";import a from"./O5TDDX7K.js";import{b as x}from"./LB32PLWG.js";import{N as y,O as I,P as M,R as b,U as C,a as $,b as n,x as w}from"./R5KGKAEB.js";import"./3TTFCHAA.js";export default $arcgis.t(([k,{substitute:B},N,{watch:Z},{stripHTML:H},,,,L,{a:T,b:E,c:A,d:D,e:V,i:R,p:d}])=>{var P=$`:host{display:flex;flex:1 1 auto;background-color:var(--calcite-color-foreground-1);--calcite-color-background: var(--calcite-color-foreground-1)}.root{flex:1 1 auto}.root calcite-icon{box-sizing:content-box}.loading-container{display:flex;justify-content:center;padding:var(--calcite-spacing-md) 0;width:100%}.content-element{margin-bottom:var(--calcite-spacing-lg);padding:0 var(--calcite-spacing-sm);display:flex;flex-direction:column}.content-element:only-child,.content-element:last-child{margin-bottom:var(--calcite-spacing-xxs)}.last-edited-info{padding-top:var(--calcite-spacing-xs);font-size:var(--calcite-font-size-sm)}`,U=L(k),v=class extends I{constructor(){super(...arguments),this.messages=F(),this._rootFlowNode=null,this.flowType="feature",this.internalFlowItems=new N,this.viewModel=U(this),this.view=this.viewModel.view,this.icon="icon",this.isFeatureFromTable=this.viewModel.isFeatureFromTable,this.graphic=this.viewModel.graphic,this.defaultPopupTemplateEnabled=this.viewModel.defaultPopupTemplateEnabled,this.headingLevel=2,this.spatialReference=this.viewModel.spatialReference,this.timeZone=this.viewModel.timeZone,this.heading=this.viewModel.title,this.map=this.viewModel.map,this.chartAnimationDisabled=this.viewModel.abilities.chartAnimation,this.hideHeading=!1,this.hideContent=!1,this.hideAttachmentsContent=!1,this.hideCustomContent=!1,this.hideExpressionContent=!1,this.hideFieldsContent=!1,this.hideMediaContent=!1,this.showRelationshipContent=!1,this.hideTextContent=!1,this.showUtilityNetworkContent=!1,this.hideLastEditedInfo=!1,this.autoDestroyDisabled=!1,this.location=this.viewModel.location,this.state=this.viewModel.state,this.arcgisPropertyChange=_()("flowItems","state"),this.arcgisReady=w()}static{this.properties={flowType:16,popupTemplate:16,sourceLayer:16,fieldInfoMap:16,values:16,globalValues:16,internalFlowItems:16,viewModel:0,view:0,flowItems:0,referenceElement:1,icon:1,isFeatureFromTable:36,graphic:0,defaultPopupTemplateEnabled:5,headingLevel:9,spatialReference:0,timeZone:1,heading:0,map:0,chartAnimationDisabled:5,hideHeading:5,hideContent:5,hideAttachmentsContent:5,hideCustomContent:5,hideExpressionContent:5,hideFieldsContent:5,hideMediaContent:5,showRelationshipContent:5,hideTextContent:5,showUtilityNetworkContent:5,hideLastEditedInfo:5,autoDestroyDisabled:5,messageOverrides:0,label:1,location:0,state:32}}static{this.styles=P}get popupTemplate(){return A(this.graphic,this.defaultPopupTemplateEnabled)??void 0}get sourceLayer(){return D(this.graphic)}get fieldInfoMap(){return T(E(this.popupTemplate),this.sourceLayer)}get values(){return this.graphic?.attributes??{}}get globalValues(){return this.viewModel.formattedAttributes?.global??{}}async destroy(){this._removeFlowItems(),await this.manager.destroy()}async nextMedia(e){return this.viewModel.nextMedia(e)}async previousMedia(e){return this.viewModel.previousMedia(e)}async setActiveMedia(e,t){return this.viewModel.setActiveMedia(e,t)}async updateGeometry(){return await this.viewModel.updateGeometry()}loaded(){this.manager.onLifecycle(()=>[Z(()=>[this.internalFlowItems?.length],()=>this._setFocus())])}_removeFlowItems(){this.internalFlowItems?.destroyAll()}_storeRootFlowNode(e){this._rootFlowNode=e}_setFocus(){this._rootFlowNode?.setFocus()}_handleDrillInBackClick(){this.internalFlowItems?.pop()?.destroy()}render(){let{state:e}=this.viewModel,t=n`<div class="container">${e==="error"?this._renderError():e==="loading"?this._renderLoading():this._renderContentContainer()}</div>`;return n`<div class="root">${t}</div>`}_renderError(){let{messages:e,hideHeading:t}=this;return n`<calcite-notice icon=exclamation-mark-circle kind=danger open scale=s>${t?null:n`<div slot=title>${e.error}</div>`}<div slot=message>${e.loadingError}</div></calcite-notice>`}_renderLoading(){return n`<div class="loading-container"><calcite-loader inline label></calcite-loader></div>`}_renderAttachments(e){let{values:t,fieldInfoMap:i,sourceLayer:o,globalValues:a}=this,s=d({values:t,fieldInfoMap:i,globalValues:a,layer:o,text:e.title}),r=d({values:t,fieldInfoMap:i,globalValues:a,layer:o,text:e.description});return n`<arcgis-feature-attachments .headingLevel=${this.headingLevel} .heading=${s} class="content-element" .displayType=${e.displayType} .attachmentKeywords=${e.attachmentKeywords??void 0} .attachmentTypes=${e.attachmentTypes??void 0} .orderByFields=${e.orderByFields??void 0} .graphic=${this.graphic??void 0} .description=${r} .messages=${this.messages}></arcgis-feature-attachments>`}_renderCustom(e){return n`<arcgis-feature-content .creator=${e.creator} .destroyer=${e.destroyer??void 0} .graphic=${this.graphic??void 0} class="content-element"></arcgis-feature-content>`}_renderFields(e,t){let i=this.viewModel.formattedAttributes,{values:o,fieldInfoMap:a,sourceLayer:s,popupTemplate:r,globalValues:l,graphic:c}=this,h=!!e?.fieldInfos,p=(e.fieldInfos??r?.fieldInfos??[])?.filter(({fieldName:u})=>!!u&&(R(u)||V(u)||u in o)),m=r?.expressionInfos,f=d({values:o,fieldInfoMap:a,globalValues:l,layer:s,text:e.title}),g=d({values:o,fieldInfoMap:a,globalValues:l,layer:s,text:e.description});return n`<arcgis-feature-fields .headingLevel=${this.headingLevel} .heading=${f} class="content-element" .messages=${this.messages} .graphic=${c??void 0} .isContentFieldInfos=${h} .layer=${s} .description=${g} .values=${{...i?.global,...i?.content?.[t]}} .fieldInfos=${p} .expressionInfos=${m??void 0}></arcgis-feature-fields>`}_renderMedia(e,t){let{values:i,graphic:o,fieldInfoMap:a,sourceLayer:s,popupTemplate:r,globalValues:l}=this,{formattedAttributes:c,relatedInfos:h}=this.viewModel,p={...c?.global,...c?.content?.[t]},m=d({values:i,fieldInfoMap:a,globalValues:l,layer:s,text:e.title}),f=d({values:i,fieldInfoMap:a,globalValues:l,layer:s,text:e.description});return n`<arcgis-feature-media .activeMediaInfoIndex=${e.activeMediaInfoIndex??0} .chartAnimationDisabled=${this.chartAnimationDisabled} .headingLevel=${this.headingLevel} .heading=${m} class="content-element" .description=${f} .values=${i} .layer=${s} .graphic=${o??void 0} .messages=${this.messages} .fieldInfoMap=${a} .mediaInfos=${e.mediaInfos??[]} .popupTemplate=${r??void 0} .relatedInfos=${h} .formattedValues=${p}></arcgis-feature-media>`}_renderText(e){return n`<arcgis-feature-content .creator=${e.text} .graphic=${this.graphic??void 0} class="content-element"></arcgis-feature-content>`}_renderExpression(e,t){let i=this.viewModel.formattedAttributes,{fieldInfoMap:o}=this;return n`<arcgis-feature-expression .expressionInfo=${e.expressionInfo} .map=${this.map??void 0} .spatialReference=${this.spatialReference??void 0} .view=${this.viewModel.view??void 0} .graphic=${this.graphic??void 0} .location=${this.location??void 0} .headingLevel=${this.headingLevel} class="content-element" .interceptor=${this.viewModel.interceptor} .messages=${this.messages} .fieldInfoMap=${o} .values=${{...i?.global,...i?.content?.[t]}}></arcgis-feature-expression>`}_renderRelationship(e,t){let{values:i,graphic:o,fieldInfoMap:a,sourceLayer:s,globalValues:r}=this,{displayCount:l,orderByFields:c,relationshipId:h}=e,{formattedAttributes:p,view:m}=this.viewModel,f={...p?.global,...p?.content?.[t]},g=d({values:i,fieldInfoMap:a,globalValues:r,layer:s,text:e.title}),u=d({values:i,fieldInfoMap:a,globalValues:r,layer:s,text:e.description});return n`<arcgis-feature-relationship .autoDestroyDisabled=${this.autoDestroyDisabled} class="content-element" .flowItems=${this.flowItems??this.internalFlowItems} .description=${u} .layer=${s} .map=${this.map??void 0} .displayCount=${l} .graphic=${o??void 0} .heading=${g} .headingLevel=${this.headingLevel} .messages=${this.messages} .orderByFields=${c??void 0} .relationshipId=${h??void 0} .spatialReference=${this.spatialReference??void 0} .timeZone=${this.timeZone??void 0} .values=${f} .view=${m??void 0}></arcgis-feature-relationship>`}_renderAssociation(e){let{fieldInfoMap:t,globalValues:i,graphic:o,messages:a,sourceLayer:s,values:r}=this,l=d({values:r,fieldInfoMap:t,globalValues:i,layer:s,text:e.title}),c=d({values:r,fieldInfoMap:t,globalValues:i,layer:s,text:e.description});return n`<arcgis-feature-utility-network-associations .autoDestroyDisabled=${this.autoDestroyDisabled} .associationTypes=${e.associationTypes} class="content-element" .description=${c} .flowItems=${this.flowItems??this.internalFlowItems} .graphic=${o??void 0} .heading=${l} .headingLevel=${this.headingLevel} .layer=${s} .map=${this.map??void 0} .messages=${a} .parentFeatureViewModel=${this.viewModel} .referenceElement=${this.referenceElement} .spatialReference=${this.spatialReference??void 0} .timeZone=${this.timeZone??void 0} .view=${this.viewModel.view??void 0}></arcgis-feature-utility-network-associations>`}_renderContentElement(e,t){switch(e.type){case"attachments":return this.hideAttachmentsContent?null:this._renderAttachments(e);case"custom":return this.hideCustomContent?null:this._renderCustom(e);case"fields":return this.hideFieldsContent?null:this._renderFields(e,t);case"media":return this.hideMediaContent?null:this._renderMedia(e,t);case"text":return this.hideTextContent?null:this._renderText(e);case"expression":return this.hideExpressionContent?null:this._renderExpression(e,t);case"relationship":return this.showRelationshipContent?this._renderRelationship(e,t):null;case"utility-network-associations":return this.showUtilityNetworkContent?this._renderAssociation(e):null;default:return null}}_renderContent(){let{content:e,graphic:t}=this.viewModel;return e?Array.isArray(e)&&e.length?e.length?e.map(this._renderContentElement,this):null:typeof e=="string"?n`<arcgis-feature-content .creator=${e} .graphic=${t??void 0} class="content-element"></arcgis-feature-content>`:e instanceof HTMLElement?e:null:null}_renderContentContainer(){let{hideContent:e,internalFlowItems:t,headingLevel:i,state:o,messages:a}=this;if(e)return null;let s=n`<div class="main">${[this._renderContent(),this._renderLastEditInfo()]}</div>`,r=a.returnToInitialFeature??"";return this.flowItems?s:n`<calcite-flow ${y(this._storeRootFlowNode)}><calcite-flow-item .loading=${o==="loading"} .headingLevel=${i} .heading=${this.hideHeading?void 0:H(this.heading)} .selected=${!t.length}>${s}</calcite-flow-item>${t.toArray().map((l,c)=>n`<calcite-flow-item @calciteFlowItemBack=${h=>{h.preventDefault(),this._handleDrillInBackClick()}} .loading=${o==="loading"} .headingLevel=${i} .selected=${c===t.length-1}><calcite-action icon=move-up @click=${this._removeFlowItems} slot=header-actions-start .text=${r} title=${r??b}></calcite-action>${l}</calcite-flow-item>`)}</calcite-flow>`}_renderLastEditInfo(){let{hideLastEditedInfo:e,messages:t}=this,{lastEditInfo:i}=this.viewModel;if(!i||e)return null;let{date:o,user:a}=i,s=i.type==="edit"?a?t.lastEditedByUser:t.lastEdited:a?t.lastCreatedByUser:t.lastCreated,r=B(s??"",{date:o,user:a});return n`<div class=${M(x("last-edited-info","content-element"))}>${r}</div>`}};C("arcgis-feature",v);return v},"widgets/Feature/FeatureViewModel","intl","core/Collection","core/reactiveUtils","applications/Components/stringUtils",a,c,d,e,f)
2
+ import f from"./6OMMETC4.js";import"./CAXI6CJY.js";import e from"./P5MTPM2I.js";import{a as F}from"./PUJPVTUS.js";import d from"./6M6VT4H6.js";import c from"./G44JDQZ4.js";import{g as _}from"./2E5U7E4Y.js";import"./W5TN3LOU.js";import a from"./O5TDDX7K.js";import{b as x}from"./LB32PLWG.js";import{N as y,O as I,P as M,R as b,U as C,a as $,b as n,x as w}from"./R5KGKAEB.js";import"./3TTFCHAA.js";export default $arcgis.t(([k,{substitute:B},N,{watch:Z},{stripHTML:H},,,,L,{a:T,b:E,c:A,d:D,e:V,i:R,p:d}])=>{var P=$`:host{display:flex;flex:1 1 auto;background-color:var(--calcite-color-foreground-1);--calcite-color-background: var(--calcite-color-foreground-1)}.root{flex:1 1 auto}.root calcite-icon{box-sizing:content-box}.loading-container{display:flex;justify-content:center;padding:var(--calcite-spacing-md) 0;width:100%}.content-element{margin-bottom:var(--calcite-spacing-lg);padding:0 var(--calcite-spacing-sm);display:flex;flex-direction:column}.content-element:only-child,.content-element:last-child{margin-bottom:var(--calcite-spacing-xxs)}.last-edited-info{padding-top:var(--calcite-spacing-xs);font-size:var(--calcite-font-size-sm)}`,U=L(k),v=class extends I{constructor(){super(...arguments),this.messages=F(),this._rootFlowNode=null,this.flowType="feature",this.internalFlowItems=new N,this.viewModel=U(this),this.view=this.viewModel.view,this.icon="icon",this.isFeatureFromTable=this.viewModel.isFeatureFromTable,this.graphic=this.viewModel.graphic,this.defaultPopupTemplateEnabled=this.viewModel.defaultPopupTemplateEnabled,this.headingLevel=2,this.spatialReference=this.viewModel.spatialReference,this.timeZone=this.viewModel.timeZone,this.heading=this.viewModel.title,this.map=this.viewModel.map,this.chartAnimationDisabled=this.viewModel.abilities.chartAnimation,this.hideHeading=!1,this.hideContent=!1,this.hideAttachmentsContent=!1,this.hideCustomContent=!1,this.hideExpressionContent=!1,this.hideFieldsContent=!1,this.hideMediaContent=!1,this.showRelationshipContent=!1,this.hideTextContent=!1,this.showUtilityNetworkContent=!1,this.hideLastEditedInfo=!1,this.autoDestroyDisabled=!1,this.location=this.viewModel.location,this.state=this.viewModel.state,this.arcgisPropertyChange=_()("flowItems","state"),this.arcgisReady=w()}static{this.properties={flowType:16,popupTemplate:16,sourceLayer:16,fieldInfoMap:16,values:16,globalValues:16,internalFlowItems:16,viewModel:0,view:0,flowItems:0,referenceElement:1,icon:1,isFeatureFromTable:36,graphic:0,defaultPopupTemplateEnabled:5,headingLevel:9,spatialReference:0,timeZone:1,heading:0,map:0,chartAnimationDisabled:5,hideHeading:5,hideContent:5,hideAttachmentsContent:5,hideCustomContent:5,hideExpressionContent:5,hideFieldsContent:5,hideMediaContent:5,showRelationshipContent:5,hideTextContent:5,showUtilityNetworkContent:5,hideLastEditedInfo:5,autoDestroyDisabled:5,messageOverrides:0,label:1,location:0,state:32}}static{this.styles=P}get popupTemplate(){return A(this.graphic,this.defaultPopupTemplateEnabled)??void 0}get sourceLayer(){return D(this.graphic)}get fieldInfoMap(){return T(E(this.popupTemplate),this.sourceLayer)}get values(){return this.graphic?.attributes??{}}get globalValues(){return this.viewModel.formattedAttributes?.global??{}}async destroy(){this._removeFlowItems(),await this.manager.destroy()}async nextMedia(e){return this.viewModel.nextMedia(e)}async previousMedia(e){return this.viewModel.previousMedia(e)}async setActiveMedia(e,t){return this.viewModel.setActiveMedia(e,t)}async updateGeometry(){return await this.viewModel.updateGeometry()}loaded(){this.manager.onLifecycle(()=>[Z(()=>[this.internalFlowItems?.length],()=>this._setFocus())])}_removeFlowItems(){this.internalFlowItems?.destroyAll()}_storeRootFlowNode(e){this._rootFlowNode=e}_setFocus(){this._rootFlowNode?.setFocus()}_handleDrillInBackClick(){this.internalFlowItems?.pop()?.destroy()}render(){let{state:e}=this.viewModel,t=n`<div class="container">${e==="error"?this._renderError():e==="loading"?this._renderLoading():this._renderContentContainer()}</div>`;return n`<div class="root">${t}</div>`}_renderError(){let{messages:e,hideHeading:t}=this;return n`<calcite-notice icon=exclamation-mark-circle kind=danger open scale=s>${t?null:n`<div slot=title>${e.error}</div>`}<div slot=message>${e.loadingError}</div></calcite-notice>`}_renderLoading(){return n`<div class="loading-container"><calcite-loader inline label></calcite-loader></div>`}_renderAttachments(e){let{values:t,fieldInfoMap:i,sourceLayer:o,globalValues:a}=this,s=d({values:t,fieldInfoMap:i,globalValues:a,layer:o,text:e.title}),r=d({values:t,fieldInfoMap:i,globalValues:a,layer:o,text:e.description});return n`<arcgis-feature-attachments .headingLevel=${this.headingLevel} .heading=${s} class="content-element" .displayType=${e.displayType} .attachmentKeywords=${e.attachmentKeywords??void 0} .attachmentTypes=${e.attachmentTypes??void 0} .orderByFields=${e.orderByFields??void 0} .graphic=${this.graphic??void 0} .description=${r} .messages=${this.messages}></arcgis-feature-attachments>`}_renderCustom(e){return n`<arcgis-feature-content .creator=${e.creator} .destroyer=${e.destroyer??void 0} .graphic=${this.graphic??void 0} class="content-element"></arcgis-feature-content>`}_renderFields(e,t){let i=this.viewModel.formattedAttributes,{values:o,fieldInfoMap:a,sourceLayer:s,popupTemplate:r,globalValues:l,graphic:c}=this,h=!!e?.fieldInfos,p=(e.fieldInfos??r?.fieldInfos??[])?.filter(({fieldName:u})=>!!u&&(R(u)||V(u)||u in o)),m=r?.expressionInfos,f=d({values:o,fieldInfoMap:a,globalValues:l,layer:s,text:e.title}),g=d({values:o,fieldInfoMap:a,globalValues:l,layer:s,text:e.description});return n`<arcgis-feature-fields .headingLevel=${this.headingLevel} .heading=${f} class="content-element" .messages=${this.messages} .graphic=${c??void 0} .isContentFieldInfos=${h} .layer=${s} .description=${g} .values=${{...i?.global,...i?.content?.[t]}} .fieldInfos=${p} .expressionInfos=${m??void 0}></arcgis-feature-fields>`}_renderMedia(e,t){let{values:i,graphic:o,fieldInfoMap:a,sourceLayer:s,popupTemplate:r,globalValues:l}=this,{formattedAttributes:c,relatedInfos:h}=this.viewModel,p={...c?.global,...c?.content?.[t]},m=d({values:i,fieldInfoMap:a,globalValues:l,layer:s,text:e.title}),f=d({values:i,fieldInfoMap:a,globalValues:l,layer:s,text:e.description});return n`<arcgis-feature-media .activeMediaInfoIndex=${e.activeMediaInfoIndex??0} .chartAnimationDisabled=${this.chartAnimationDisabled} .headingLevel=${this.headingLevel} .heading=${m} class="content-element" .description=${f} .values=${i} .layer=${s} .graphic=${o??void 0} .messages=${this.messages} .fieldInfoMap=${a} .mediaInfos=${e.mediaInfos??[]} .popupTemplate=${r??void 0} .relatedInfos=${h} .formattedValues=${p}></arcgis-feature-media>`}_renderText(e){return n`<arcgis-feature-content .creator=${e.text} .graphic=${this.graphic??void 0} class="content-element"></arcgis-feature-content>`}_renderExpression(e,t){let i=this.viewModel.formattedAttributes,{fieldInfoMap:o}=this;return n`<arcgis-feature-expression .expressionInfo=${e.expressionInfo} .map=${this.map??void 0} .spatialReference=${this.spatialReference??void 0} .view=${this.viewModel.view??void 0} .graphic=${this.graphic??void 0} .location=${this.location??void 0} .headingLevel=${this.headingLevel} class="content-element" .interceptor=${this.viewModel.interceptor} .messages=${this.messages} .fieldInfoMap=${o} .values=${{...i?.global,...i?.content?.[t]}}></arcgis-feature-expression>`}_renderRelationship(e,t){let{values:i,graphic:o,fieldInfoMap:a,sourceLayer:s,globalValues:r}=this,{displayCount:l,orderByFields:c,relationshipId:h}=e,{formattedAttributes:p,view:m}=this.viewModel,f={...p?.global,...p?.content?.[t]},g=d({values:i,fieldInfoMap:a,globalValues:r,layer:s,text:e.title}),u=d({values:i,fieldInfoMap:a,globalValues:r,layer:s,text:e.description});return n`<arcgis-feature-relationship .autoDestroyDisabled=${this.autoDestroyDisabled} class="content-element" .flowItems=${this.flowItems??this.internalFlowItems} .description=${u} .layer=${s} .map=${this.map??void 0} .displayCount=${l} .graphic=${o??void 0} .heading=${g} .headingLevel=${this.headingLevel} .messages=${this.messages} .orderByFields=${c??void 0} .relationshipId=${h??void 0} .spatialReference=${this.spatialReference??void 0} .timeZone=${this.timeZone??void 0} .values=${f} .view=${m??void 0}></arcgis-feature-relationship>`}_renderAssociation(e){let{fieldInfoMap:t,globalValues:i,graphic:o,messages:a,sourceLayer:s,values:r}=this,l=d({values:r,fieldInfoMap:t,globalValues:i,layer:s,text:e.title}),c=d({values:r,fieldInfoMap:t,globalValues:i,layer:s,text:e.description});return n`<arcgis-feature-utility-network-associations .autoDestroyDisabled=${this.autoDestroyDisabled} .associationTypes=${e.associationTypes} class="content-element" .description=${c} .flowItems=${this.flowItems??this.internalFlowItems} .graphic=${o??void 0} .heading=${l} .headingLevel=${this.headingLevel} .layer=${s} .map=${this.map??void 0} .messages=${a} .parentFeatureViewModel=${this.viewModel} .referenceElement=${this.referenceElement} .spatialReference=${this.spatialReference??void 0} .timeZone=${this.timeZone??void 0} .view=${this.viewModel.view??void 0}></arcgis-feature-utility-network-associations>`}_renderContentElement(e,t){switch(e.type){case"attachments":return this.hideAttachmentsContent?null:this._renderAttachments(e);case"custom":return this.hideCustomContent?null:this._renderCustom(e);case"fields":return this.hideFieldsContent?null:this._renderFields(e,t);case"media":return this.hideMediaContent?null:this._renderMedia(e,t);case"text":return this.hideTextContent?null:this._renderText(e);case"expression":return this.hideExpressionContent?null:this._renderExpression(e,t);case"relationship":return this.showRelationshipContent?this._renderRelationship(e,t):null;case"utility-network-associations":return this.showUtilityNetworkContent?this._renderAssociation(e):null;default:return null}}_renderContent(){let{content:e,graphic:t}=this.viewModel;return e?Array.isArray(e)&&e.length?e.length?e.map(this._renderContentElement,this):null:typeof e=="string"?n`<arcgis-feature-content .creator=${e} .graphic=${t??void 0} class="content-element"></arcgis-feature-content>`:e instanceof HTMLElement?e:null:null}_renderContentContainer(){let{hideContent:e,internalFlowItems:t,headingLevel:i,state:o,messages:a}=this;if(e)return null;let s=n`<div class="main">${[this._renderContent(),this._renderLastEditInfo()]}</div>`,r=a.returnToInitialFeature??"";return this.flowItems?s:n`<calcite-flow ${y(this._storeRootFlowNode)}><calcite-flow-item .loading=${o==="loading"} .headingLevel=${i} .heading=${this.hideHeading?void 0:H(this.heading)} .selected=${!t.length}>${s}</calcite-flow-item>${t.toArray().map((l,c)=>n`<calcite-flow-item @calciteFlowItemBack=${h=>{h.preventDefault(),this._handleDrillInBackClick()}} .loading=${o==="loading"} .headingLevel=${i} .selected=${c===t.length-1}><calcite-action icon=move-up @click=${this._removeFlowItems} slot=header-actions-start .text=${r} title=${r??b}></calcite-action>${l}</calcite-flow-item>`)}</calcite-flow>`}_renderLastEditInfo(){let{hideLastEditedInfo:e,messages:t}=this,{lastEditInfo:i}=this.viewModel;if(!i||e)return null;let{date:o,user:a}=i,s=i.type==="edit"?a?t.lastEditedByUser:t.lastEdited:a?t.lastCreatedByUser:t.lastCreated,r=B(s??"",{date:o,user:a});return n`<div class=${M(x("last-edited-info","content-element"))}>${r}</div>`}};C("arcgis-feature",v);return v},"widgets/Feature/FeatureViewModel","intl","core/Collection","core/reactiveUtils","applications/Components/stringUtils",a,c,d,e,f)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{c as S}from"./CAXI6CJY.js";import{a as v}from"./PUJPVTUS.js";import"./2E5U7E4Y.js";import"./W5TN3LOU.js";import"./LB32PLWG.js";import{O as L,U as T,a as _,b as f,p as c,x as y}from"./R5KGKAEB.js";import"./3TTFCHAA.js";export default $arcgis.t(([A,m,p,x,P,C,b,w])=>{var N=_`calcite-block{--calcite-block-content-space: 0;--calcite-block-border-color: transparent;margin:0}.add-location-button{--calcite-button-border-color: var(--calcite-color-border-1);--calcite-button-icon-color: var(--calcite-color-text-1);--calcite-button-text-color: var(--calcite-color-text-1)}.button-container{justify-content:center;display:grid}.clear-button{--calcite-button-border-color: transparent}`,k=class extends L{constructor(){super(...arguments),this.messages=v({blocking:!0}),this.isSelectWaiting=!1,this.traceLocationType="starting-point",this.spatialTolerance=.05,this.autoDestroyDisabled=!1,this.arcgisTraceLocationChange=y(),this.arcgisTraceLocationSelectEnd=y(),this.arcgisTraceLocationSelectStart=y()}static{this.properties={isSelectWaiting:16,beforeTraceLocationSelectStart:0,afterHitTest:0,view:0,traceLocationType:1,traceLocations:0,filterLayers:0,sketchViewModel:0,flagLayer:0,spatialTolerance:9,autoDestroyDisabled:5,utilityNetwork:0}}static{this.styles=N}async destroy(){this._resetAfterSketch(!1),await this.manager.destroy()}async load(){p.isLoaded()||await p.load()}_createPolyline(t,e){return new x({hasZ:!1,hasM:!0,paths:t,spatialReference:new P({wkid:e})})}_calculatePercentAlong(t,e){let r=t.spatialReference,i=this._createPolyline(t.paths,r.wkid),n=e.x-.5,o=e.x+.5,s=e.y-.5,a=e.y+.5,l=[[[n,s],[o,a]]],h=this._createPolyline(l,e.spatialReference.wkid),u=p.execute(h,r);if(!u)return c("error",this,"Unable to project flag geometry to source geometry spatial reference."),.5;let d=A.execute(i,u);if(d.length>0){let I=m.execute(i,{unit:"feet"}),g;return d[0].paths[0][0][0]===i.paths[0][0][0]?g=m.execute(d[0],{unit:"feet"}):d.length>1?g=m.execute(d[1],{unit:"feet"}):g=0,g/I}return c("warn",this,"Unable to cut the source geometry with the flag geometry."),.5}get _edgeSourceLayerIds(){let t=this.utilityNetwork?.dataElement?.domainNetworks;return t?t.flatMap(e=>e.edgeSources).map(e=>e.layerId).filter(Boolean):[]}async _ensureNecessaryAttributes(t){let e=(t.layer?.type,t.layer),r=e.fieldsIndex?.get("assetgroup")??!1,i=e.fieldsIndex?.get("assetgroup")?.name??"assetgroup",n=e.fieldsIndex?.get("assettype")??!1,o=e.fieldsIndex?.get("assettype")?.name??"assettype",s=t.getGlobalId(),a=t.getObjectId(),l=r?!!t.getAttribute(i):!0,h=n?!!t.getAttribute(o):!0;if(s&&a&&l&&h)return t;let u=e.createQuery();return u.objectIds=[a],(await e.queryFeatures(u))?.features[0]||null}async _ensureNecessaryAttributesAndGenerateTraceLocation(t,e){let{view:r}=this;if(!r||t.length===0){c("error",this,"`view` is unavailable or there are no results to process.");return}let i=t[0],n=t.map(a=>{let l=a,h=l.graphic;return h.origin=l.layer,h}),o=this.afterHitTest?await this.afterHitTest(n).catch(()=>(this._resetAfterSketch(!0),null)):i.graphic;if(!o){c("error",this,"No graphic available from hit test results.");return}let s=await this._ensureNecessaryAttributes(o);if(!s){c("error",this,"Unable to ensure necessary attributes on the selected graphic.");return}await this._generateTraceLocation(s,e)}_createFlagSymbol(){let{traceLocationType:t}=this,e=[244,21,21,.6],r=[21,244,21,.6];return t==="stopping-point"?new w({color:e,style:"x",size:12,outline:{color:e,width:2}}):t==="barrier"?new w({color:e,style:"square",size:12,outline:{color:e,width:0}}):new w({color:r,style:"circle",size:12,outline:{color:r,width:0}})}_addFlagGraphic(t,e,r){let{flagLayer:i,view:n}=this;if(!i||!n)return c("error",this,"The properties `flagLayer` and `view` are required but either one or both are missing."),null;let o=e.geometry?.type;if(this.traceLocations?.some(l=>l.traceLocation.globalId===t)&&o!=="polyline")return c("warn",this,"A flag with the same globalId already exists."),null;let s=this._createFlagSymbol(),a=new C({geometry:r,symbol:s,attributes:e.attributes});return i.add(a),a}async _generateItemTitle(t){let{messages:e}=this,r=(t.layer?.type,t.layer);return("getFeatureTitle"in r?await r.getFeatureTitle(t):null)||t?.getObjectId()?.toString()||e.labels.unknown}async _generateFlagInfo(t,e){let{traceLocationType:r,utilityNetwork:i}=this,n=t.getGlobalId()??"",o=t.geometry?.type,s=await this._generateItemTitle(t);if(o==="point"||o==="polygon"){let a=i?.getTerminalConfiguration(t),l=a?a.terminals[0].id:1;return{traceLocation:new b({type:r,isFilterBarrier:!1,globalId:n,terminalId:l}),flagProperties:{title:s,expanded:!1,terminalConfiguration:a??void 0,selectedTerminals:a?new Set([l]):void 0},spatialProperties:{mapPoint:e,mapGraphic:t}}}else if(o==="polyline"){let a=this._calculatePercentAlong(t.geometry,e);return{traceLocation:new b({type:r,isFilterBarrier:!1,globalId:n,percentAlong:a}),flagProperties:{title:s,expanded:!1},spatialProperties:{mapPoint:e,mapGraphic:t}}}else if(!o){let a=S(t.layer)?t.layer.parent:t.layer,l=a&&this._edgeSourceLayerIds.includes(a.layerId),h=i?.getTerminalConfiguration(t),u=h?h.terminals[0].id:l?-1:1,d=l?.5:-1;return{traceLocation:new b({type:r,isFilterBarrier:!1,globalId:n,terminalId:u,percentAlong:d}),flagProperties:{title:s,expanded:!1,terminalConfiguration:h??void 0,selectedTerminals:h?new Set([u]):void 0},spatialProperties:{mapPoint:e}}}return null}async _generateTraceLocation(t,e){let{traceLocations:r}=this,i=t.getGlobalId()??"",n=t.geometry?.type,o=await this._generateFlagInfo(t,e);if(!o){c("error",this,"Unable to generate flag info for trace location.");return}let s=r?.filter(a=>a.spatialProperties.mapGraphic?.getGlobalId()===i)??[];if(s.length===0||n==="polyline"){if(n==="polyline"&&s.length>0&&s.some(l=>Math.abs(l.traceLocation.percentAlong-o.traceLocation.percentAlong)<=this.spatialTolerance)){c("warn",this,"A flag with the same globalId already exists within tolerance.");return}let a=this._addFlagGraphic(i,t,e);if(!a){c("warn",this,"Unable to add flag graphic.");return}o.spatialProperties.flagGraphic=a,r?.add(o);return}c("warn",this,"A flag with the same globalId already exists.")}async _hitTest(t){let{view:e,utilityNetwork:r}=this;if(!e||!r)return c("error",this,"Either `utilityNetwork` or `view` is unavailable for hit test."),!0;let i=t.graphic?.geometry,n=this.view?.toScreen(i);if(!n)return c("warn",this,"No screen point available for hit test."),!1;let o=(await e.hitTest(n,{include:this.filterLayers})).results.filter(s=>s.type==="graphic"&&s?.layer&&s.graphic);return o.length===0?(c("info",this,"No usable hit test results found."),!1):(this._resetAfterSketch(!1),await this._ensureNecessaryAttributesAndGenerateTraceLocation(o,i),this._resetAfterSketch(!0),!0)}_resetAfterSketch(t=!1){let{view:e}=this;if(!e){c("error",this,"View is not available to reset after sketch.");return}this._clickHandler?.remove(),this._clickHandler=void 0,"acquireCursor"in e&&e.acquireCursor("default"),t&&this.arcgisTraceLocationSelectEnd.emit()}_handleSketchComplete(t){let{sketchViewModel:e,view:r}=this;if(!e||!r){c("error",this,"Either `sketchViewModel` or `view` is not available in sketch complete handler.");return}if(t.state==="complete"&&t.graphic){e.layer.remove(t.graphic),this._hitTest(t).then(i=>{i?this._resetAfterSketch():this._initiateHitTest()});return}t.state==="cancel"&&this._resetAfterSketch(!0)}async _initiateHitTest(){let{view:t,sketchViewModel:e}=this;if(!t||!e){c("error",this,"Cannot initiate hit test; either `view` or `sketchViewModel` not found.");return}this._clickHandler?.remove(),this._clickHandler=e.on("create",this._handleSketchComplete.bind(this)),"acquireCursor"in t&&t.acquireCursor("crosshair"),this.sketchViewModel?.create("point")}async _handleAddButtonClick(){let{view:t,sketchViewModel:e}=this;if(!(t&&e)){c("error",this,"Cannot add trace location; `view` not found.");return}if(this.beforeTraceLocationSelectStart){this.isSelectWaiting=!0;try{await this.beforeTraceLocationSelectStart()}finally{this.isSelectWaiting=!1}}this.arcgisTraceLocationSelectStart.emit({cancelSelect:()=>e.cancel()}).defaultPrevented||await this._initiateHitTest()}_handleClearButtonClick(){let{flagLayer:t,traceLocations:e}=this;e?.forEach(r=>{r.spatialProperties.flagGraphic&&t&&t.remove(r.spatialProperties.flagGraphic)}),e?.removeAll()}renderAddLocationBlock(){let{traceLocationType:t,messages:e,traceLocations:r}=this,i=t==="starting-point"?e.types.startingPoint:t==="barrier"?e.types.barrier:e.types.stoppingPoint,n=i.heading,o=i.description,s=i.buttonText;return f`<calcite-block .heading=${n} .label=${n} expanded .description=${o}>${r?.length?f`<calcite-button class="clear-button" slot=actions-end appearance=transparent .label=${e.buttons.clear} @click=${()=>this._handleClearButtonClick()}>${e.buttons.clear}</calcite-button>`:null}<arcgis-utility-network-trace-location-list .traceLocations=${r} .traceLocationType=${t}></arcgis-utility-network-trace-location-list><div class="button-container"><calcite-button .loading=${this.isSelectWaiting} class="add-location-button" icon-start=select appearance=outline .label=${s} @click=${()=>this._handleAddButtonClick()}>${s}</calcite-button></div></calcite-block>`}render(){return f`<div class="root">${this.renderAddLocationBlock()}</div>`}};T("arcgis-utility-network-trace-location",k);return k},"geometry/operators/cutOperator","geometry/operators/lengthOperator","geometry/operators/projectOperator","geometry/Polyline","geometry/SpatialReference","Graphic","rest/networks/support/TraceLocation","symbols/SimpleMarkerSymbol")
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{a as E}from"./MR5JAWKH.js";import d from"./YTOLDZ6E.js";import c from"./BTIV4UDX.js";import"./7WLTT4K3.js";import b from"./5MHPKAFK.js";import"./PC4PAQXQ.js";import"./7SZFENQP.js";import{a as S}from"./PUJPVTUS.js";import"./2E5U7E4Y.js";import"./W5TN3LOU.js";import a from"./O5TDDX7K.js";import{b as y}from"./LB32PLWG.js";import{M as v,N as f,O as T,P as h,Q as A,R as o,U as M,b as r}from"./R5KGKAEB.js";import"./3TTFCHAA.js";export default $arcgis.t(([{isLayerFromCatalog:O},{h:w},,,{b:I,c:L}])=>{var D={hideChildren:"hide-children"};function R({exclusive:a,visible:e,visibilityAppearance:t}){let i=t==="checkbox";return e?a?"circle-f":i?"check-square-f":"view-visible":a?"circle":i?"square":"view-hide"}function P({connectionStatus:a,publishing:e}){return a?a==="connected"?"beacon":"offline":e?"square":"bullet-point"}function k(a){return a?.listMode===D.hideChildren}function U(a){let e=(a?.layer&&F(a.layer)?a.layer.layer:void 0)??a?.layer;return e?e.type==="catalog"?!1:B(e)??!0:!1}function F(a){return a!=null&&"layer"in a&&a.layer!=null}function B(a){let e=V(a);return e!=null&&"supportsDynamicLayers"in e?e.supportsDynamicLayers:void 0}function V(a){return a&&"capabilities"in a&&a.capabilities!=null&&"exportMap"in a.capabilities?a.capabilities.exportMap:void 0}function G(a){return a?.getAttribute("data-item")}function N(a){let{children:e,error:t}=a,i="incompatible"in a?a.incompatible:!1;return!!e?.filter(n=>!n.hidden).length&&!t&&!i}function q(a){for(let e of a)for(let t of e)if(t.type==="button"||t.type==="toggle")return t}function x(a,e){let t=a.parent,i=a.layer;if(i?.type!=="map-image"||!i.sourceJSON||!t)return!1;let n=i.sourceJSON.layers;if(!n)return!1;let s=n.find(l=>a.id===l.id),c=e==="footprints"?"Feature Layer":"Catalog Dynamic Group Layer";return s?.type!==c?!1:n.find(l=>l.id===t.id)?.type==="Catalog Layer"}var C=class extends T{constructor(){super(...arguments),this._itemRef=v(),this._noticeRef=v(),this.messages=S(),this.hideCatalogLayerList=!1,this.showCloseButton=!1,this.showCollapseButton=!1,this.showErrors=!1,this.showFilter=!1,this.showHeading=!1,this.hideStatusIndicators=!1,this.showTemporaryLayerIndicators=!1,this.showTemporaryTableIndicators=!1,this.dragEnabled=!1,this.listModeDisabled=!1,this.autoDestroyDisabled=!1}static{this.properties={_title:16,_renderedItemStatus:16,_renderedItemTemporaryIcon:16,_renderedItemToggle:16,_renderedPanel:16,_renderedPanelAction:16,_renderedActions:16,_renderedActionMenu:16,_renderedActionMenuContent:16,_renderedCatalogFootprintIcon:16,_renderedCatalogDynamicIcon:16,_renderedCatalogSelectNode:16,_renderedChildList:16,_hasTables:16,_renderedTablesItem:16,_renderedItemMessage:16,_singleAction:16,_filteredSections:16,_actionsCount:16,activeItem:0,canMove:0,css:0,displayMode:1,hideCatalogLayerList:5,showCloseButton:5,showCollapseButton:5,showErrors:5,showFilter:5,showHeading:5,hideStatusIndicators:5,showTemporaryLayerIndicators:5,showTemporaryTableIndicators:5,dragEnabled:5,item:0,layerTablesEnabled:0,listModeDisabled:5,handleAction:0,handlePanelOpen:0,handleCatalogOpen:0,handleTablesOpen:0,handleSelectedDragItemLayerUidChange:0,handleTooltipReferenceChange:0,parent:0,parentTitles:0,rootGroupUid:1,selectionMode:1,selectedItems:0,selectedDragItemLayerUid:1,visibilityAppearance:1,autoDestroyDisabled:5}}static{this.styles=E}get _title(){let{messages:e}=this;return this.item.title||("untitledTable"in e?e.untitledTable:e.untitledLayer)}get _renderedItemStatus(){let{item:e,parent:t,hideStatusIndicators:i,css:n}=this;if(!i)return null;let{publishing:s}=e,c="updating"in e&&e.updating&&!t,l="connectionStatus"in e?e.connectionStatus:void 0,u=!!l;return r`<calcite-icon class=${h(y(n.statusIndicator,{[n.publishing]:s},"updating"in n&&{[n.updating]:c},"connectionStatus"in n&&{[n.connectionStatus]:u},"connectionStatusConnected"in n&&{[n.connectionStatusConnected]:u&&l==="connected"}))} .icon=${P({connectionStatus:l,publishing:s})} scale=s slot=content-end></calcite-icon>`}get _renderedItemTemporaryIcon(){let{item:e,showTemporaryLayerIndicators:t,showTemporaryTableIndicators:i,css:n}=this,{layer:s}=e,c=s&&"persistenceEnabled"in s&&(O(s)||!s.persistenceEnabled);return(t||i)&&c?r`<calcite-icon class=${h(n.itemTemporaryIcon)} icon=temporary scale=s slot=content-start title=${this.messages.temporary??o}></calcite-icon>`:null}get _renderedItemToggle(){let{item:e,parent:t,messages:i,visibilityAppearance:n,css:s}=this;if(!("visible"in e)||!("layerVisibility"in i)||!("visibleToggle"in s)||!n)return null;let{visible:c}=e,l=this._getParentVisibilityMode(t);if(l==="inherited")return null;let u=R({visible:c,exclusive:l==="exclusive",visibilityAppearance:n}),d=n==="checkbox",g=i.layerVisibility;return r`<calcite-action class=${h(s.visibleToggle)} .icon=${d?u:void 0} @click=${()=>this._toggleVisibility(e,t)} scale=s .slot=${d?"actions-start":"actions-end"} .text=${g??""} title=${g??o}>${d?null:r`<calcite-icon class=${h(y({[s.visibleIcon]:l!=="exclusive"&&c}))} .icon=${u} scale=s></calcite-icon>`}</calcite-action>`}get _renderedPanel(){let{panel:e}=this.item;return e?.open&&!e.disabled&&!e.flowEnabled?r`<div class=${h(this.css.itemContentBottom)} slot=content-bottom>${e.render()}</div>`:null}get _renderedPanelAction(){let{panel:e}=this.item;if(!e?.visible)return null;let{open:t,title:i,disabled:n}=e,s={icon:e.icon,image:e.image,indicator:!1};return r`<calcite-action .active=${t} .disabled=${n} .icon=${I(s)} @click=${()=>this._togglePanel(e)} scale=s slot=actions-end .text=${i??""} title=${i??void 0??o}>${this._renderFallbackIcon(e)}</calcite-action>`}get _renderedActions(){switch(this._actionsCount){case 0:return null;case 1:return this._singleAction;default:return this._renderedActionMenu}}get _renderedActionMenu(){let{item:e,messages:t}=this,i=t.options;return r`<calcite-action-menu appearance=transparent .label=${t.menu??""} .open=${e.actionsOpen} overlay-positioning=fixed placement=bottom-end scale=s slot=actions-end @calciteActionMenuOpen=${this._onActionMenuOpen}><calcite-action icon=ellipsis scale=s slot=trigger .text=${i??""} title=${i??o}></calcite-action>${this._renderedActionMenuContent}</calcite-action-menu>`}get _renderedActionMenuContent(){return this._filteredSections.toArray().map(e=>r`<calcite-action-group>${e.toArray().map(t=>this._renderAction({action:t,textEnabled:!0}))}</calcite-action-group>`)}get _renderedCatalogFootprintIcon(){let{css:e}=this,t=this.item.layer,i=t?.type==="catalog-footprint",n=t?.type==="sublayer"&&x(t,"footprints");return"itemCatalogIcon"in e&&(i||n)?r`<calcite-icon class=${h(e.itemCatalogIcon)} icon=footprint scale=s slot=content-start></calcite-icon>`:null}get _renderedCatalogDynamicIcon(){let{css:e}=this,t=this.item.layer,i=t?.type==="catalog-dynamic-group",n=t?.type==="sublayer"&&x(t,"layers-in-view");return"itemCatalogIcon"in e&&(i||n)?r`<calcite-icon class=${h(e.itemCatalogIcon)} icon=catalog-dataset scale=s slot=content-start></calcite-icon>`:null}get _renderedCatalogSelectNode(){let{_title:e,item:t,hideCatalogLayerList:i}=this;if(!("visible"in t))return;let{layer:n}=t,s=n?.type==="catalog-dynamic-group";return i&&s?r`<calcite-action .disabled=${!n.visible} icon=chevron-right icon-flip-rtl @click=${()=>this._triggerOnCatalogOpen(t)} scale=s slot=actions-end .text=${e}></calcite-action>`:null}get _renderedChildList(){let{dragEnabled:e,item:t,rootGroupUid:i,listModeDisabled:n,selectionMode:s,displayMode:c}=this;if(!("children"in t))return;let l=[...this.parentTitles??[],t.title],{children:u,layer:d}=t,g=d?.type!=="catalog-dynamic-group"&&N(t),$=n?!1:k(d),m=d?.type==="group",_=!$&&!g&&e&&m,b=e?"childrenSortable"in t&&t.childrenSortable&&U(t):!1;return g||_?r`<calcite-list .canPull=${p=>this.canMove?this.canMove(p,"pull"):!1} .canPut=${p=>this.canMove?this.canMove(p,"put"):!1} data-item=${t??o} data-layer-type=${i??o} .displayMode=${c} .dragEnabled=${b} .group=${m?i:`${i}-${d?.uid}`} .label=${t.title} selection-appearance=border .selectionMode=${s}>${u?.filter(p=>!p.hidden&&(this.showErrors||!p.error)).toArray().map(p=>this._renderItem(p,t,l))}${this._renderedTablesItem}</calcite-list>`:null}get _hasTables(){let{layerTablesEnabled:e}=this,t=this.item.layer;if(!e||!t)return!1;switch(t.type){case"knowledge-graph":return e.includes(t.type)&&"tables"in t&&!!t.tables?.length;case"map-image":case"tile":return e.includes(t.type)&&"subtables"in t&&!!t.subtables?.length;default:return!1}}get _renderedTablesItem(){let{item:e,messages:t,css:i}=this,{layer:n}=e;return"itemTableIcon"in i&&"visible"in e&&"tables"in t&&this._hasTables?r`<calcite-list-item class=${h(i.item)} data-layer-id=${n?.id??o} drag-disabled .label=${t.tables} title=${t.tables??o} @calciteListItemSelect=${()=>this._triggerOnTablesOpen(e)}><calcite-icon class=${h(i.itemTableIcon)} icon=table scale=s slot=content-start></calcite-icon><calcite-icon flip-rtl icon=chevron-right scale=s slot=content-end></calcite-icon></calcite-list-item>`:null}get _renderedItemMessage(){let{item:e,messages:t,css:i}=this;return e.error?r`<div class=${h(i.itemMessage)} slot=content-bottom><calcite-notice icon=exclamation-mark-triangle kind=warning open scale=s width=full><div slot=message>${"tableError"in t?t.tableError:t.layerError}</div></calcite-notice></div>`:"incompatible"in e&&e.incompatible&&"layerIncompatible"in t?r`<div class=${h(i.itemMessage)} slot=content-bottom><calcite-notice icon=exclamation-mark-triangle kind=warning open scale=s tabindex=0 width=full ${f(this._noticeRef)}><div slot=message>${t.layerIncompatible}</div></calcite-notice></div>`:null}get _singleAction(){return this._renderAction({action:q(this._filteredSections),textEnabled:!1})}get _filteredSections(){return this.item.actionsSections.map(e=>e.filter(t=>t.visible))}get _actionsCount(){return this.item.actionsSections.reduce((e,t)=>e+t.length,0)}async destroy(){await this.manager.destroy()}willUpdate(){this._itemRef.value&&this._focusSelectedDragEl(this._itemRef.value,this.item),this._noticeRef.value&&this._setTooltipReference(this._noticeRef.value)}updated(){this._itemRef.value&&this._focusSelectedDragEl(this._itemRef.value,this.item),this._noticeRef.value&&this._removeTooltipReference()}_onActionMenuOpen(e){this.item.actionsOpen=e.currentTarget.open}_setTooltipReference(e){this.handleTooltipReferenceChange?.(this.item.layer?.uid,e)}_removeTooltipReference(){this.handleTooltipReferenceChange?.(this.item.layer?.uid,null)}_triggerAction(e,t){!t||!e||(t.type==="toggle"&&(t.value=!t.value),this.handleAction(t,e))}_triggerOnTablesOpen(e){!e||!this.handleTablesOpen||this.handleTablesOpen(e)}_triggerOnCatalogOpen(e){e&&this.handleCatalogOpen?.(e)}_focusSelectedDragEl(e,t){this.selectedDragItemLayerUid===t.layer?.uid&&(w(e),this.handleSelectedDragItemLayerUidChange?.(null))}_handleCalciteListItemToggle(e,t){e.stopPropagation(),t.open=e.target.expanded}_getParentVisibilityMode(e){return e&&"visibilityMode"in e?e.visibilityMode:null}_handleCalciteListItemSelect(e,t,i){if(G(e.target)!==t)return;let n=this._getParentVisibilityMode(i);this.selectionMode!=="none"||n==="inherited"||this._toggleVisibility(t,i)}_togglePanel(e){e.open=!e.open,e.open&&this.handlePanelOpen()}_toggleVisibility(e,t){!e||!("visible"in e)||this._getParentVisibilityMode(t)==="exclusive"&&e.visible||(e.visible=!e.visible)}render(){let e=this.parentTitles??[],{_title:t,item:i,activeItem:n,selectionMode:s,selectedItems:c,messages:l,parent:u,css:d}=this,g="visibleAtCurrentTimeExtent"in i&&"layerInvisibleAtTime"in l&&!i.visibleAtCurrentTimeExtent?`${t} (${l.layerInvisibleAtTime})`:"visibleAtCurrentScale"in i&&"layerInvisibleAtScale"in l&&!i.visibleAtCurrentScale?`${t} (${l.layerInvisibleAtScale})`:t,$="parent"in i&&i.parent?.layer?.type==="catalog",{layer:m}=i,_="visibleAtCurrentScale"in i&&!i.visibleAtCurrentScale||"visibleAtCurrentTimeExtent"in i&&!i.visibleAtCurrentTimeExtent;return r`<calcite-list-item class=${h(y(d.item,"itemActive"in d&&{[d.itemActive]:n===i}))} data-item=${i??o} data-layer-id=${m?.id??o} .dragDisabled=${!("sortable"in i&&i.sortable)||$} id=${m?.uid??o} .label=${t} .metadata=${{parentTitles:e,_title:t}} .expanded=${"open"in i&&i.open} .selected=${s!=="none"?c.includes(i):!1} title=${g??o} .unavailable=${_} .value=${m?.uid} @calciteListItemSelect=${b=>"visible"in i&&this._handleCalciteListItemSelect(b,i,u)} @calciteListItemToggle=${b=>"open"in i&&this._handleCalciteListItemToggle(b,i)} ${f(this._itemRef)}>${this._renderedCatalogFootprintIcon}${this._renderedCatalogDynamicIcon}${this._renderedItemStatus}${this._renderedItemToggle}${this._renderedCatalogSelectNode}${this._renderedItemTemporaryIcon}${this._renderedChildList}${this._renderedItemMessage}${this._renderedPanel}${this._renderedPanelAction}${this._renderedActions}</calcite-list-item>`}_renderAction(e){let{item:t}=this,{action:i,textEnabled:n}=e;if(!i)return null;let{active:s,disabled:c,title:l,type:u,indicator:d}=i;return r`<calcite-action .active=${u==="toggle"?i.value:!1} data-action-id=${i.id??o} .disabled=${c} .icon=${I(i)} .indicator=${d} .loading=${s} @click=${()=>this._triggerAction(t,i)} scale=s slot=${(n?void 0:"actions-end")??o} .text=${l??""} .textEnabled=${n} title=${l??void 0??o}>${this._renderFallbackIcon(i)}</calcite-action>`}_renderFallbackIcon(e){let{css:t}=this,{icon:i}=e;if(i)return null;let n="image"in e?e.image:void 0,s={[t.itemActionImage]:!!n};return n?r`<span aria-hidden=true class=${h(y(t.itemActionIcon,s))} style=${A(L(n))}></span>`:null}_renderItem(e,t,i=[]){return r`<arcgis-layer-list-item .activeItem=${this.activeItem} .canMove=${this.canMove} .css=${this.css} .displayMode=${this.displayMode} .dragEnabled=${this.dragEnabled} .item=${e} .layerTablesEnabled=${this.layerTablesEnabled} .listModeDisabled=${this.listModeDisabled} .parent=${t} .parentTitles=${i} .rootGroupUid=${this.rootGroupUid} .selectedDragItemLayerUid=${this.selectedDragItemLayerUid} .selectedItems=${this.selectedItems} .selectionMode=${this.selectionMode} .visibilityAppearance=${this.visibilityAppearance} .handleAction=${this.handleAction} .handleCatalogOpen=${this.handleCatalogOpen} .handlePanelOpen=${this.handlePanelOpen} .handleSelectedDragItemLayerUidChange=${this.handleSelectedDragItemLayerUidChange} .handleTablesOpen=${this.handleTablesOpen} .handleTooltipReferenceChange=${this.handleTooltipReferenceChange} .hideCatalogLayerList=${this.hideCatalogLayerList} .showCloseButton=${this.showCloseButton} .showCollapseButton=${this.showCollapseButton} .showErrors=${this.showErrors} .showFilter=${this.showFilter} .showHeading=${this.showHeading} .hideStatusIndicators=${this.hideStatusIndicators} .showTemporaryLayerIndicators=${this.showTemporaryLayerIndicators} .showTemporaryTableIndicators=${this.showTemporaryTableIndicators}></arcgis-layer-list-item>`}};M("arcgis-layer-list-item",C);return C},"layers/catalog/catalogUtils",a,b,c,d)
2
+ import{a as E}from"./MR5JAWKH.js";import d from"./V5FNVAX5.js";import c from"./6OMMETC4.js";import"./CAXI6CJY.js";import b from"./5MHPKAFK.js";import"./PC4PAQXQ.js";import"./7SZFENQP.js";import{a as S}from"./PUJPVTUS.js";import"./2E5U7E4Y.js";import"./W5TN3LOU.js";import a from"./O5TDDX7K.js";import{b as y}from"./LB32PLWG.js";import{M as v,N as f,O as T,P as h,Q as A,R as o,U as M,b as r}from"./R5KGKAEB.js";import"./3TTFCHAA.js";export default $arcgis.t(([{isLayerFromCatalog:O},{h:w},,,{b:I,c:L}])=>{var D={hideChildren:"hide-children"};function R({exclusive:a,visible:e,visibilityAppearance:t}){let i=t==="checkbox";return e?a?"circle-f":i?"check-square-f":"view-visible":a?"circle":i?"square":"view-hide"}function P({connectionStatus:a,publishing:e}){return a?a==="connected"?"beacon":"offline":e?"square":"bullet-point"}function k(a){return a?.listMode===D.hideChildren}function U(a){let e=(a?.layer&&F(a.layer)?a.layer.layer:void 0)??a?.layer;return e?e.type==="catalog"?!1:B(e)??!0:!1}function F(a){return a!=null&&"layer"in a&&a.layer!=null}function B(a){let e=V(a);return e!=null&&"supportsDynamicLayers"in e?e.supportsDynamicLayers:void 0}function V(a){return a&&"capabilities"in a&&a.capabilities!=null&&"exportMap"in a.capabilities?a.capabilities.exportMap:void 0}function G(a){return a?.getAttribute("data-item")}function N(a){let{children:e,error:t}=a,i="incompatible"in a?a.incompatible:!1;return!!e?.filter(n=>!n.hidden).length&&!t&&!i}function q(a){for(let e of a)for(let t of e)if(t.type==="button"||t.type==="toggle")return t}function x(a,e){let t=a.parent,i=a.layer;if(i?.type!=="map-image"||!i.sourceJSON||!t)return!1;let n=i.sourceJSON.layers;if(!n)return!1;let s=n.find(l=>a.id===l.id),c=e==="footprints"?"Feature Layer":"Catalog Dynamic Group Layer";return s?.type!==c?!1:n.find(l=>l.id===t.id)?.type==="Catalog Layer"}var C=class extends T{constructor(){super(...arguments),this._itemRef=v(),this._noticeRef=v(),this.messages=S(),this.hideCatalogLayerList=!1,this.showCloseButton=!1,this.showCollapseButton=!1,this.showErrors=!1,this.showFilter=!1,this.showHeading=!1,this.hideStatusIndicators=!1,this.showTemporaryLayerIndicators=!1,this.showTemporaryTableIndicators=!1,this.dragEnabled=!1,this.listModeDisabled=!1,this.autoDestroyDisabled=!1}static{this.properties={_title:16,_renderedItemStatus:16,_renderedItemTemporaryIcon:16,_renderedItemToggle:16,_renderedPanel:16,_renderedPanelAction:16,_renderedActions:16,_renderedActionMenu:16,_renderedActionMenuContent:16,_renderedCatalogFootprintIcon:16,_renderedCatalogDynamicIcon:16,_renderedCatalogSelectNode:16,_renderedChildList:16,_hasTables:16,_renderedTablesItem:16,_renderedItemMessage:16,_singleAction:16,_filteredSections:16,_actionsCount:16,activeItem:0,canMove:0,css:0,displayMode:1,hideCatalogLayerList:5,showCloseButton:5,showCollapseButton:5,showErrors:5,showFilter:5,showHeading:5,hideStatusIndicators:5,showTemporaryLayerIndicators:5,showTemporaryTableIndicators:5,dragEnabled:5,item:0,layerTablesEnabled:0,listModeDisabled:5,handleAction:0,handlePanelOpen:0,handleCatalogOpen:0,handleTablesOpen:0,handleSelectedDragItemLayerUidChange:0,handleTooltipReferenceChange:0,parent:0,parentTitles:0,rootGroupUid:1,selectionMode:1,selectedItems:0,selectedDragItemLayerUid:1,visibilityAppearance:1,autoDestroyDisabled:5}}static{this.styles=E}get _title(){let{messages:e}=this;return this.item.title||("untitledTable"in e?e.untitledTable:e.untitledLayer)}get _renderedItemStatus(){let{item:e,parent:t,hideStatusIndicators:i,css:n}=this;if(!i)return null;let{publishing:s}=e,c="updating"in e&&e.updating&&!t,l="connectionStatus"in e?e.connectionStatus:void 0,u=!!l;return r`<calcite-icon class=${h(y(n.statusIndicator,{[n.publishing]:s},"updating"in n&&{[n.updating]:c},"connectionStatus"in n&&{[n.connectionStatus]:u},"connectionStatusConnected"in n&&{[n.connectionStatusConnected]:u&&l==="connected"}))} .icon=${P({connectionStatus:l,publishing:s})} scale=s slot=content-end></calcite-icon>`}get _renderedItemTemporaryIcon(){let{item:e,showTemporaryLayerIndicators:t,showTemporaryTableIndicators:i,css:n}=this,{layer:s}=e,c=s&&"persistenceEnabled"in s&&(O(s)||!s.persistenceEnabled);return(t||i)&&c?r`<calcite-icon class=${h(n.itemTemporaryIcon)} icon=temporary scale=s slot=content-start title=${this.messages.temporary??o}></calcite-icon>`:null}get _renderedItemToggle(){let{item:e,parent:t,messages:i,visibilityAppearance:n,css:s}=this;if(!("visible"in e)||!("layerVisibility"in i)||!("visibleToggle"in s)||!n)return null;let{visible:c}=e,l=this._getParentVisibilityMode(t);if(l==="inherited")return null;let u=R({visible:c,exclusive:l==="exclusive",visibilityAppearance:n}),d=n==="checkbox",g=i.layerVisibility;return r`<calcite-action class=${h(s.visibleToggle)} .icon=${d?u:void 0} @click=${()=>this._toggleVisibility(e,t)} scale=s .slot=${d?"actions-start":"actions-end"} .text=${g??""} title=${g??o}>${d?null:r`<calcite-icon class=${h(y({[s.visibleIcon]:l!=="exclusive"&&c}))} .icon=${u} scale=s></calcite-icon>`}</calcite-action>`}get _renderedPanel(){let{panel:e}=this.item;return e?.open&&!e.disabled&&!e.flowEnabled?r`<div class=${h(this.css.itemContentBottom)} slot=content-bottom>${e.render()}</div>`:null}get _renderedPanelAction(){let{panel:e}=this.item;if(!e?.visible)return null;let{open:t,title:i,disabled:n}=e,s={icon:e.icon,image:e.image,indicator:!1};return r`<calcite-action .active=${t} .disabled=${n} .icon=${I(s)} @click=${()=>this._togglePanel(e)} scale=s slot=actions-end .text=${i??""} title=${i??void 0??o}>${this._renderFallbackIcon(e)}</calcite-action>`}get _renderedActions(){switch(this._actionsCount){case 0:return null;case 1:return this._singleAction;default:return this._renderedActionMenu}}get _renderedActionMenu(){let{item:e,messages:t}=this,i=t.options;return r`<calcite-action-menu appearance=transparent .label=${t.menu??""} .open=${e.actionsOpen} overlay-positioning=fixed placement=bottom-end scale=s slot=actions-end @calciteActionMenuOpen=${this._onActionMenuOpen}><calcite-action icon=ellipsis scale=s slot=trigger .text=${i??""} title=${i??o}></calcite-action>${this._renderedActionMenuContent}</calcite-action-menu>`}get _renderedActionMenuContent(){return this._filteredSections.toArray().map(e=>r`<calcite-action-group>${e.toArray().map(t=>this._renderAction({action:t,textEnabled:!0}))}</calcite-action-group>`)}get _renderedCatalogFootprintIcon(){let{css:e}=this,t=this.item.layer,i=t?.type==="catalog-footprint",n=t?.type==="sublayer"&&x(t,"footprints");return"itemCatalogIcon"in e&&(i||n)?r`<calcite-icon class=${h(e.itemCatalogIcon)} icon=footprint scale=s slot=content-start></calcite-icon>`:null}get _renderedCatalogDynamicIcon(){let{css:e}=this,t=this.item.layer,i=t?.type==="catalog-dynamic-group",n=t?.type==="sublayer"&&x(t,"layers-in-view");return"itemCatalogIcon"in e&&(i||n)?r`<calcite-icon class=${h(e.itemCatalogIcon)} icon=catalog-dataset scale=s slot=content-start></calcite-icon>`:null}get _renderedCatalogSelectNode(){let{_title:e,item:t,hideCatalogLayerList:i}=this;if(!("visible"in t))return;let{layer:n}=t,s=n?.type==="catalog-dynamic-group";return i&&s?r`<calcite-action .disabled=${!n.visible} icon=chevron-right icon-flip-rtl @click=${()=>this._triggerOnCatalogOpen(t)} scale=s slot=actions-end .text=${e}></calcite-action>`:null}get _renderedChildList(){let{dragEnabled:e,item:t,rootGroupUid:i,listModeDisabled:n,selectionMode:s,displayMode:c}=this;if(!("children"in t))return;let l=[...this.parentTitles??[],t.title],{children:u,layer:d}=t,g=d?.type!=="catalog-dynamic-group"&&N(t),$=n?!1:k(d),m=d?.type==="group",_=!$&&!g&&e&&m,b=e?"childrenSortable"in t&&t.childrenSortable&&U(t):!1;return g||_?r`<calcite-list .canPull=${p=>this.canMove?this.canMove(p,"pull"):!1} .canPut=${p=>this.canMove?this.canMove(p,"put"):!1} data-item=${t??o} data-layer-type=${i??o} .displayMode=${c} .dragEnabled=${b} .group=${m?i:`${i}-${d?.uid}`} .label=${t.title} selection-appearance=border .selectionMode=${s}>${u?.filter(p=>!p.hidden&&(this.showErrors||!p.error)).toArray().map(p=>this._renderItem(p,t,l))}${this._renderedTablesItem}</calcite-list>`:null}get _hasTables(){let{layerTablesEnabled:e}=this,t=this.item.layer;if(!e||!t)return!1;switch(t.type){case"knowledge-graph":return e.includes(t.type)&&"tables"in t&&!!t.tables?.length;case"map-image":case"tile":return e.includes(t.type)&&"subtables"in t&&!!t.subtables?.length;default:return!1}}get _renderedTablesItem(){let{item:e,messages:t,css:i}=this,{layer:n}=e;return"itemTableIcon"in i&&"visible"in e&&"tables"in t&&this._hasTables?r`<calcite-list-item class=${h(i.item)} data-layer-id=${n?.id??o} drag-disabled .label=${t.tables} title=${t.tables??o} @calciteListItemSelect=${()=>this._triggerOnTablesOpen(e)}><calcite-icon class=${h(i.itemTableIcon)} icon=table scale=s slot=content-start></calcite-icon><calcite-icon flip-rtl icon=chevron-right scale=s slot=content-end></calcite-icon></calcite-list-item>`:null}get _renderedItemMessage(){let{item:e,messages:t,css:i}=this;return e.error?r`<div class=${h(i.itemMessage)} slot=content-bottom><calcite-notice icon=exclamation-mark-triangle kind=warning open scale=s width=full><div slot=message>${"tableError"in t?t.tableError:t.layerError}</div></calcite-notice></div>`:"incompatible"in e&&e.incompatible&&"layerIncompatible"in t?r`<div class=${h(i.itemMessage)} slot=content-bottom><calcite-notice icon=exclamation-mark-triangle kind=warning open scale=s tabindex=0 width=full ${f(this._noticeRef)}><div slot=message>${t.layerIncompatible}</div></calcite-notice></div>`:null}get _singleAction(){return this._renderAction({action:q(this._filteredSections),textEnabled:!1})}get _filteredSections(){return this.item.actionsSections.map(e=>e.filter(t=>t.visible))}get _actionsCount(){return this.item.actionsSections.reduce((e,t)=>e+t.length,0)}async destroy(){await this.manager.destroy()}willUpdate(){this._itemRef.value&&this._focusSelectedDragEl(this._itemRef.value,this.item),this._noticeRef.value&&this._setTooltipReference(this._noticeRef.value)}updated(){this._itemRef.value&&this._focusSelectedDragEl(this._itemRef.value,this.item),this._noticeRef.value&&this._removeTooltipReference()}_onActionMenuOpen(e){this.item.actionsOpen=e.currentTarget.open}_setTooltipReference(e){this.handleTooltipReferenceChange?.(this.item.layer?.uid,e)}_removeTooltipReference(){this.handleTooltipReferenceChange?.(this.item.layer?.uid,null)}_triggerAction(e,t){!t||!e||(t.type==="toggle"&&(t.value=!t.value),this.handleAction(t,e))}_triggerOnTablesOpen(e){!e||!this.handleTablesOpen||this.handleTablesOpen(e)}_triggerOnCatalogOpen(e){e&&this.handleCatalogOpen?.(e)}_focusSelectedDragEl(e,t){this.selectedDragItemLayerUid===t.layer?.uid&&(w(e),this.handleSelectedDragItemLayerUidChange?.(null))}_handleCalciteListItemToggle(e,t){e.stopPropagation(),t.open=e.target.expanded}_getParentVisibilityMode(e){return e&&"visibilityMode"in e?e.visibilityMode:null}_handleCalciteListItemSelect(e,t,i){if(G(e.target)!==t)return;let n=this._getParentVisibilityMode(i);this.selectionMode!=="none"||n==="inherited"||this._toggleVisibility(t,i)}_togglePanel(e){e.open=!e.open,e.open&&this.handlePanelOpen()}_toggleVisibility(e,t){!e||!("visible"in e)||this._getParentVisibilityMode(t)==="exclusive"&&e.visible||(e.visible=!e.visible)}render(){let e=this.parentTitles??[],{_title:t,item:i,activeItem:n,selectionMode:s,selectedItems:c,messages:l,parent:u,css:d}=this,g="visibleAtCurrentTimeExtent"in i&&"layerInvisibleAtTime"in l&&!i.visibleAtCurrentTimeExtent?`${t} (${l.layerInvisibleAtTime})`:"visibleAtCurrentScale"in i&&"layerInvisibleAtScale"in l&&!i.visibleAtCurrentScale?`${t} (${l.layerInvisibleAtScale})`:t,$="parent"in i&&i.parent?.layer?.type==="catalog",{layer:m}=i,_="visibleAtCurrentScale"in i&&!i.visibleAtCurrentScale||"visibleAtCurrentTimeExtent"in i&&!i.visibleAtCurrentTimeExtent;return r`<calcite-list-item class=${h(y(d.item,"itemActive"in d&&{[d.itemActive]:n===i}))} data-item=${i??o} data-layer-id=${m?.id??o} .dragDisabled=${!("sortable"in i&&i.sortable)||$} id=${m?.uid??o} .label=${t} .metadata=${{parentTitles:e,_title:t}} .expanded=${"open"in i&&i.open} .selected=${s!=="none"?c.includes(i):!1} title=${g??o} .unavailable=${_} .value=${m?.uid} @calciteListItemSelect=${b=>"visible"in i&&this._handleCalciteListItemSelect(b,i,u)} @calciteListItemToggle=${b=>"open"in i&&this._handleCalciteListItemToggle(b,i)} ${f(this._itemRef)}>${this._renderedCatalogFootprintIcon}${this._renderedCatalogDynamicIcon}${this._renderedItemStatus}${this._renderedItemToggle}${this._renderedCatalogSelectNode}${this._renderedItemTemporaryIcon}${this._renderedChildList}${this._renderedItemMessage}${this._renderedPanel}${this._renderedPanelAction}${this._renderedActions}</calcite-list-item>`}_renderAction(e){let{item:t}=this,{action:i,textEnabled:n}=e;if(!i)return null;let{active:s,disabled:c,title:l,type:u,indicator:d}=i;return r`<calcite-action .active=${u==="toggle"?i.value:!1} data-action-id=${i.id??o} .disabled=${c} .icon=${I(i)} .indicator=${d} .loading=${s} @click=${()=>this._triggerAction(t,i)} scale=s slot=${(n?void 0:"actions-end")??o} .text=${l??""} .textEnabled=${n} title=${l??void 0??o}>${this._renderFallbackIcon(i)}</calcite-action>`}_renderFallbackIcon(e){let{css:t}=this,{icon:i}=e;if(i)return null;let n="image"in e?e.image:void 0,s={[t.itemActionImage]:!!n};return n?r`<span aria-hidden=true class=${h(y(t.itemActionIcon,s))} style=${A(L(n))}></span>`:null}_renderItem(e,t,i=[]){return r`<arcgis-layer-list-item .activeItem=${this.activeItem} .canMove=${this.canMove} .css=${this.css} .displayMode=${this.displayMode} .dragEnabled=${this.dragEnabled} .item=${e} .layerTablesEnabled=${this.layerTablesEnabled} .listModeDisabled=${this.listModeDisabled} .parent=${t} .parentTitles=${i} .rootGroupUid=${this.rootGroupUid} .selectedDragItemLayerUid=${this.selectedDragItemLayerUid} .selectedItems=${this.selectedItems} .selectionMode=${this.selectionMode} .visibilityAppearance=${this.visibilityAppearance} .handleAction=${this.handleAction} .handleCatalogOpen=${this.handleCatalogOpen} .handlePanelOpen=${this.handlePanelOpen} .handleSelectedDragItemLayerUidChange=${this.handleSelectedDragItemLayerUidChange} .handleTablesOpen=${this.handleTablesOpen} .handleTooltipReferenceChange=${this.handleTooltipReferenceChange} .hideCatalogLayerList=${this.hideCatalogLayerList} .showCloseButton=${this.showCloseButton} .showCollapseButton=${this.showCollapseButton} .showErrors=${this.showErrors} .showFilter=${this.showFilter} .showHeading=${this.showHeading} .hideStatusIndicators=${this.hideStatusIndicators} .showTemporaryLayerIndicators=${this.showTemporaryLayerIndicators} .showTemporaryTableIndicators=${this.showTemporaryTableIndicators}></arcgis-layer-list-item>`}};M("arcgis-layer-list-item",C);return C},"layers/catalog/catalogUtils",a,b,c,d)
@@ -1,3 +1,3 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import a from"./BTIV4UDX.js";import"./7WLTT4K3.js";import{a as O}from"./B2G5OTNZ.js";import{d as j,e as D}from"./2E5U7E4Y.js";import"./W5TN3LOU.js";import{e as H}from"./LB32PLWG.js";import{N as P,O as U,R as x,U as B,a as E,b as y}from"./R5KGKAEB.js";import"./3TTFCHAA.js";export default $arcgis.t(([{getColorsFromRenderer:ae},{substitute:re},{watch:ne},se,J,{renderingSanitizer:Q},{e:C,f:G,g:L,h:K,i:q,j:W,l:F,n:V,o:k,p:R}])=>{var oe=E`.container{display:flex;flex-flow:row wrap;align-items:center;margin-top:var(--calcite-spacing-xs);width:100%;min-height:150px}.container .pagination-button{display:flex;align-items:center;justify-content:center;border:none;background:transparent;cursor:pointer;padding-block:var(--calcite-spacing-xs);padding-inline:var(--calcite-spacing-xs);color:var(--calcite-color-text-3)}.container .pagination-button:hover,.container .pagination-button:focus{background-color:var(--calcite-color-foreground-3);color:var(--calcite-color-text-1);fill:var(--calcite-color-text-1)}.item-title{margin:0;font-size:var(--calcite-font-size-md);line-height:var(--calcite-font-line-height-relative-snug)}.item-caption{padding-block-start:var(--calcite-spacing-xxs);font-size:var(--calcite-font-size-sm);line-height:var(--calcite-font-line-height-relative-snug)}.item{display:flex;align-items:flex-start;justify-content:center;margin-block:var(--calcite-spacing-xs);width:100%;height:auto}.item-navigation{display:flex;flex:0 1 100%;align-items:flex-start;justify-content:space-between;margin-block-end:var(--calcite-spacing-xs)}.item-text{margin-inline-end:var(--calcite-spacing-xs)}.pagination{display:flex;flex:0 0 auto;align-items:center;overflow:hidden}.pagination:only-child{margin-inline-start:auto}.pagination-text{padding-inline:var(--calcite-spacing-xxs);color:var(--calcite-color-text-3);font-size:var(--calcite-font-size-sm);line-height:var(--calcite-font-line-height-relative-normal)}.item-container{flex:0 1 auto;width:100%}.item-container img{max-width:100%}.item-container img[src$=".SVG"],.item-container img[src$=".svg"]{width:100%}.chart{width:100%;height:155px}`;function z(S){if(!C(S))return null;let[e,t]=S.split("/").slice(1);return{layerId:e,fieldName:t}}var X=15,M="category",A="value",le="rgba(50, 50, 50, 1)",ce=250,de=500,he=200,N=class extends U{constructor(){super(...arguments),this._direction=D(),this._prefersReducedMotion=j("(prefers-reduced-motion)"),this.activeMediaInfoIndex=0,this.chartAnimationDisabled=!1,this.headingLevel=2}static{this.properties={_refreshIntervalInfo:16,messages:0,values:0,activeMediaInfoIndex:9,chartAnimationDisabled:5,activeMediaInfo:32,formattedMediaInfos:32,description:1,fieldInfoMap:0,layer:0,mediaInfos:0,popupTemplate:0,relatedInfos:0,formattedValues:0,heading:1,graphic:0,formattedMediaInfoCount:32,headingLevel:9}}static{this.styles=oe}get activeMediaInfo(){return this.formattedMediaInfos[this.activeMediaInfoIndex]||null}get formattedMediaInfos(){return this._formatMediaInfos()||[]}get formattedMediaInfoCount(){return this.formattedMediaInfos.length}next(){this._pageContentElementMedia(1)}previous(){this._pageContentElementMedia(-1)}setActiveMedia(e){this._setContentElementMedia(e)}loaded(){this.manager.onLifecycle(()=>[ne(()=>[this.activeMediaInfo,this.activeMediaInfoIndex],()=>this._setupMediaRefreshTimer(),{initial:!0}),{remove:()=>this._clearMediaRefreshTimer()}])}_setContentElementMedia(e){let{formattedMediaInfoCount:t}=this,i=(e+t)%t;this.activeMediaInfoIndex=i}_pageContentElementMedia(e){let{activeMediaInfoIndex:t}=this,i=t+e;this._setContentElementMedia(i)}_formatMediaInfos(){let{mediaInfos:e,layer:t}=this,i=this.values??{},a=this.formattedValues??{},r=this.fieldInfoMap??new Map;return e?.map(s=>{let n=s?.clone();if(!n)return null;if(n.title=R({values:i,fieldInfoMap:r,globalValues:a,layer:t,text:n.title}),n.caption=R({values:i,fieldInfoMap:r,globalValues:a,layer:t,text:n.caption}),n.altText=R({values:i,fieldInfoMap:r,globalValues:a,layer:t,text:n.altText}),n.type==="image"){if(!n.value)return null;let o=n.value;return this._setImageValue({value:o,formattedValues:a,layer:t}),o.sourceURL?n:void 0}if(n.type==="pie-chart"||n.type==="line-chart"||n.type==="column-chart"||n.type==="bar-chart"){if(!n.value)return null;let o=n.value;return this._setChartValue({value:o,chartType:n.type,values:i,formattedValues:a,layer:t}),n}return null}).filter(s=>s!=null)??[]}_setImageValue(e){let t=this.fieldInfoMap??new Map,{value:i,formattedValues:a,layer:r}=e,{linkURL:s,sourceURL:n}=i;if(n){let o=k(n,r);i.sourceURL=V({formattedValues:a,template:o,fieldInfoMap:t})}if(s){let o=k(s,r);i.linkURL=V({formattedValues:a,template:o,fieldInfoMap:t})}}_setChartValue(e){let{value:t,values:i,formattedValues:a,chartType:r,layer:s}=e,{popupTemplate:n,relatedInfos:o}=this,{fields:c,normalizeField:g}=t,h=s;if(t.fields=K(c,h),g&&(t.normalizeField=L(g,h)),!c.some(d=>!!(a[d]!=null||C(d)&&o?.size)))return;let l=n?.fieldInfos??[];t.series=[],c.forEach((d,m)=>{let u=t.colors?.[m];if(C(d)){t.series=[...t.series,...this._getRelatedChartInfos({fieldInfos:l,fieldName:d,formattedValues:a,chartType:r,value:t,color:u})];return}let p=this._getChartOption({value:t,values:i,chartType:r,formattedValues:a,fieldName:d,fieldInfos:l,color:u});t.series.push(p)})}_getRelatedChartInfos(e){let{fieldInfos:t,fieldName:i,formattedValues:a,chartType:r,value:s,color:n}=e,o=[],c=z(i),g=c&&this.relatedInfos?.get(c.layerId);if(!g)return o;let{relatedFeatures:h,relation:l}=g;if(!l||!h)return o;let{cardinality:d}=l;return h.forEach(m=>{let u=m.attributes;u&&Object.keys(u).forEach(p=>{p===c.fieldName&&o.push(this._getChartOption({value:s,values:u,formattedValues:a,fieldName:i,chartType:r,relatedFieldName:p,hasMultipleRelatedFeatures:h?.length>1,fieldInfos:t,color:n}))})}),d&&(d==="one-to-many"||d==="many-to-many")?o:[o[0]]}_getTooltip({label:e,value:t,chartType:i}){return i==="pie-chart"?`${e}`:`${e}: ${t}`}_getChartOption(e){let{value:t,values:i,formattedValues:a,fieldName:r,relatedFieldName:s,fieldInfos:n,chartType:o,hasMultipleRelatedFeatures:c,color:g}=e,{layer:h,graphic:l}=this,d=this.fieldInfoMap??new Map,{normalizeField:m,tooltipField:u}=t,p=m?C(m)?i[z(m).fieldName]:i[m]:null,v=q(r)&&a?.[r]!==void 0?a[r]:s&&i[s]!==void 0?i[s]:i[r]!==void 0?i[r]:a[r],_=v===void 0?null:v&&p&&typeof v=="number"&&typeof p=="number"?v/p:v,I=W(n,r),f=L(r,h),w=(u&&a[u]!==void 0?a[u]:F({fieldInfo:I||new se({fieldName:f}),expressionInfos:this.popupTemplate?.expressionInfos,graphic:l,layer:h}))??"",b=a[f]??"",Y=_!=null?typeof _=="number"?_:Number(_):null;if(C(r)){let T=d.get(r.toLowerCase()),Z=u?d.get(u.toLowerCase()):null,ee=T?.fieldName??r,$=c&&u?z(u).fieldName:Z?.fieldName??u,te=(c&&$?i[$]:a[$]??(T&&F({fieldInfo:T,layer:h,graphic:l}))??T?.fieldName??s)??"",ie=(c&&s?i[s]:a[ee])??"";return new J({fieldName:r,tooltip:this._getTooltip({label:te,value:ie,chartType:o}),color:g,value:Y})}return new J({fieldName:r,tooltip:this._getTooltip({label:w,value:b,chartType:o}),color:g,value:Y})}_getRenderer(){let e=this.layer;return this.graphic?.isAggregate&&e?.featureReduction&&"renderer"in e.featureReduction?e.featureReduction.renderer:e?.renderer}async _getSeriesColors(e){let{color:t}=await import("./D27YXH3W.js"),i=new Map;return e.forEach(a=>{a.color&&i.set(a,t(a.color.toCss(!0)))}),i}async _getRendererColors(){let{color:e}=await import("./D27YXH3W.js"),t=new Map,i=this._getRenderer(),a="default";if(!i)return t;let r=await ae(i);return r.delete(a),Array.from(r.values()).every(s=>s?.length===1)&&Array.from(r.keys()).forEach(s=>{let n=r.get(s)?.[0]?.toCss(!0);n&&t.set(s,e(n))}),t}async _createChart(e){let{activeMediaInfo:t}=this;if(!e||!t)return;let{createRoot:i}=await import("./PZC5TBXA.js").then(m=>m.default.then(e=>({createRoot:e}))),a=await i(e);this._chartRoot=a,this._renderChart({mediaInfo:t,root:a})}_handleMediaKeyup(e){let{key:t}=e;t==="ArrowLeft"&&(e.stopPropagation(),this.previous()),t==="ArrowRight"&&(e.stopPropagation(),this.next())}_canAnimateChart(){return!this.chartAnimationDisabled&&!this._prefersReducedMotion}_getChartAnimationMS(){return this._canAnimateChart()?ce:0}_getChartSeriesAnimationMS(){return this._canAnimateChart()?de:0}async _customizeChartTooltip(e,t="horizontal"){let{color:i}=await import("./D27YXH3W.js");e.setAll({pointerOrientation:t}),e.get("background")?.setAll({stroke:i(le)}),e.label.setAll({direction:this._direction,oversizedBehavior:"wrap",maxWidth:he})}async _createPieChart(e,t){let[{Tooltip:i},{PieChart:a,PieSeries:r}]=await Promise.all([import("./D27YXH3W.js"),import("./Y6IN6NEC.js")]),{mediaInfo:s,root:n}=e,{title:o}=s,c=5,g=s?.altText||s?.title||"",h=n.container.children.push(a.new(n,{role:"figure",ariaLabel:g,focusable:!0,paddingBottom:c,paddingTop:c,paddingLeft:c,paddingRight:c})),l=`{category}: {valuePercentTotal.formatNumber('0.00')}%
2
+ import a from"./6OMMETC4.js";import"./CAXI6CJY.js";import{a as O}from"./B2G5OTNZ.js";import{d as j,e as D}from"./2E5U7E4Y.js";import"./W5TN3LOU.js";import{e as H}from"./LB32PLWG.js";import{N as P,O as U,R as x,U as B,a as E,b as y}from"./R5KGKAEB.js";import"./3TTFCHAA.js";export default $arcgis.t(([{getColorsFromRenderer:ae},{substitute:re},{watch:ne},se,J,{renderingSanitizer:Q},{e:C,f:G,g:L,h:K,i:q,j:W,l:F,n:V,o:k,p:R}])=>{var oe=E`.container{display:flex;flex-flow:row wrap;align-items:center;margin-top:var(--calcite-spacing-xs);width:100%;min-height:150px}.container .pagination-button{display:flex;align-items:center;justify-content:center;border:none;background:transparent;cursor:pointer;padding-block:var(--calcite-spacing-xs);padding-inline:var(--calcite-spacing-xs);color:var(--calcite-color-text-3)}.container .pagination-button:hover,.container .pagination-button:focus{background-color:var(--calcite-color-foreground-3);color:var(--calcite-color-text-1);fill:var(--calcite-color-text-1)}.item-title{margin:0;font-size:var(--calcite-font-size-md);line-height:var(--calcite-font-line-height-relative-snug)}.item-caption{padding-block-start:var(--calcite-spacing-xxs);font-size:var(--calcite-font-size-sm);line-height:var(--calcite-font-line-height-relative-snug)}.item{display:flex;align-items:flex-start;justify-content:center;margin-block:var(--calcite-spacing-xs);width:100%;height:auto}.item-navigation{display:flex;flex:0 1 100%;align-items:flex-start;justify-content:space-between;margin-block-end:var(--calcite-spacing-xs)}.item-text{margin-inline-end:var(--calcite-spacing-xs)}.pagination{display:flex;flex:0 0 auto;align-items:center;overflow:hidden}.pagination:only-child{margin-inline-start:auto}.pagination-text{padding-inline:var(--calcite-spacing-xxs);color:var(--calcite-color-text-3);font-size:var(--calcite-font-size-sm);line-height:var(--calcite-font-line-height-relative-normal)}.item-container{flex:0 1 auto;width:100%}.item-container img{max-width:100%}.item-container img[src$=".SVG"],.item-container img[src$=".svg"]{width:100%}.chart{width:100%;height:155px}`;function z(S){if(!C(S))return null;let[e,t]=S.split("/").slice(1);return{layerId:e,fieldName:t}}var X=15,M="category",A="value",le="rgba(50, 50, 50, 1)",ce=250,de=500,he=200,N=class extends U{constructor(){super(...arguments),this._direction=D(),this._prefersReducedMotion=j("(prefers-reduced-motion)"),this.activeMediaInfoIndex=0,this.chartAnimationDisabled=!1,this.headingLevel=2}static{this.properties={_refreshIntervalInfo:16,messages:0,values:0,activeMediaInfoIndex:9,chartAnimationDisabled:5,activeMediaInfo:32,formattedMediaInfos:32,description:1,fieldInfoMap:0,layer:0,mediaInfos:0,popupTemplate:0,relatedInfos:0,formattedValues:0,heading:1,graphic:0,formattedMediaInfoCount:32,headingLevel:9}}static{this.styles=oe}get activeMediaInfo(){return this.formattedMediaInfos[this.activeMediaInfoIndex]||null}get formattedMediaInfos(){return this._formatMediaInfos()||[]}get formattedMediaInfoCount(){return this.formattedMediaInfos.length}next(){this._pageContentElementMedia(1)}previous(){this._pageContentElementMedia(-1)}setActiveMedia(e){this._setContentElementMedia(e)}loaded(){this.manager.onLifecycle(()=>[ne(()=>[this.activeMediaInfo,this.activeMediaInfoIndex],()=>this._setupMediaRefreshTimer(),{initial:!0}),{remove:()=>this._clearMediaRefreshTimer()}])}_setContentElementMedia(e){let{formattedMediaInfoCount:t}=this,i=(e+t)%t;this.activeMediaInfoIndex=i}_pageContentElementMedia(e){let{activeMediaInfoIndex:t}=this,i=t+e;this._setContentElementMedia(i)}_formatMediaInfos(){let{mediaInfos:e,layer:t}=this,i=this.values??{},a=this.formattedValues??{},r=this.fieldInfoMap??new Map;return e?.map(s=>{let n=s?.clone();if(!n)return null;if(n.title=R({values:i,fieldInfoMap:r,globalValues:a,layer:t,text:n.title}),n.caption=R({values:i,fieldInfoMap:r,globalValues:a,layer:t,text:n.caption}),n.altText=R({values:i,fieldInfoMap:r,globalValues:a,layer:t,text:n.altText}),n.type==="image"){if(!n.value)return null;let o=n.value;return this._setImageValue({value:o,formattedValues:a,layer:t}),o.sourceURL?n:void 0}if(n.type==="pie-chart"||n.type==="line-chart"||n.type==="column-chart"||n.type==="bar-chart"){if(!n.value)return null;let o=n.value;return this._setChartValue({value:o,chartType:n.type,values:i,formattedValues:a,layer:t}),n}return null}).filter(s=>s!=null)??[]}_setImageValue(e){let t=this.fieldInfoMap??new Map,{value:i,formattedValues:a,layer:r}=e,{linkURL:s,sourceURL:n}=i;if(n){let o=k(n,r);i.sourceURL=V({formattedValues:a,template:o,fieldInfoMap:t})}if(s){let o=k(s,r);i.linkURL=V({formattedValues:a,template:o,fieldInfoMap:t})}}_setChartValue(e){let{value:t,values:i,formattedValues:a,chartType:r,layer:s}=e,{popupTemplate:n,relatedInfos:o}=this,{fields:c,normalizeField:g}=t,h=s;if(t.fields=K(c,h),g&&(t.normalizeField=L(g,h)),!c.some(d=>!!(a[d]!=null||C(d)&&o?.size)))return;let l=n?.fieldInfos??[];t.series=[],c.forEach((d,m)=>{let u=t.colors?.[m];if(C(d)){t.series=[...t.series,...this._getRelatedChartInfos({fieldInfos:l,fieldName:d,formattedValues:a,chartType:r,value:t,color:u})];return}let p=this._getChartOption({value:t,values:i,chartType:r,formattedValues:a,fieldName:d,fieldInfos:l,color:u});t.series.push(p)})}_getRelatedChartInfos(e){let{fieldInfos:t,fieldName:i,formattedValues:a,chartType:r,value:s,color:n}=e,o=[],c=z(i),g=c&&this.relatedInfos?.get(c.layerId);if(!g)return o;let{relatedFeatures:h,relation:l}=g;if(!l||!h)return o;let{cardinality:d}=l;return h.forEach(m=>{let u=m.attributes;u&&Object.keys(u).forEach(p=>{p===c.fieldName&&o.push(this._getChartOption({value:s,values:u,formattedValues:a,fieldName:i,chartType:r,relatedFieldName:p,hasMultipleRelatedFeatures:h?.length>1,fieldInfos:t,color:n}))})}),d&&(d==="one-to-many"||d==="many-to-many")?o:[o[0]]}_getTooltip({label:e,value:t,chartType:i}){return i==="pie-chart"?`${e}`:`${e}: ${t}`}_getChartOption(e){let{value:t,values:i,formattedValues:a,fieldName:r,relatedFieldName:s,fieldInfos:n,chartType:o,hasMultipleRelatedFeatures:c,color:g}=e,{layer:h,graphic:l}=this,d=this.fieldInfoMap??new Map,{normalizeField:m,tooltipField:u}=t,p=m?C(m)?i[z(m).fieldName]:i[m]:null,v=q(r)&&a?.[r]!==void 0?a[r]:s&&i[s]!==void 0?i[s]:i[r]!==void 0?i[r]:a[r],_=v===void 0?null:v&&p&&typeof v=="number"&&typeof p=="number"?v/p:v,I=W(n,r),f=L(r,h),w=(u&&a[u]!==void 0?a[u]:F({fieldInfo:I||new se({fieldName:f}),expressionInfos:this.popupTemplate?.expressionInfos,graphic:l,layer:h}))??"",b=a[f]??"",Y=_!=null?typeof _=="number"?_:Number(_):null;if(C(r)){let T=d.get(r.toLowerCase()),Z=u?d.get(u.toLowerCase()):null,ee=T?.fieldName??r,$=c&&u?z(u).fieldName:Z?.fieldName??u,te=(c&&$?i[$]:a[$]??(T&&F({fieldInfo:T,layer:h,graphic:l}))??T?.fieldName??s)??"",ie=(c&&s?i[s]:a[ee])??"";return new J({fieldName:r,tooltip:this._getTooltip({label:te,value:ie,chartType:o}),color:g,value:Y})}return new J({fieldName:r,tooltip:this._getTooltip({label:w,value:b,chartType:o}),color:g,value:Y})}_getRenderer(){let e=this.layer;return this.graphic?.isAggregate&&e?.featureReduction&&"renderer"in e.featureReduction?e.featureReduction.renderer:e?.renderer}async _getSeriesColors(e){let{color:t}=await import("./D27YXH3W.js"),i=new Map;return e.forEach(a=>{a.color&&i.set(a,t(a.color.toCss(!0)))}),i}async _getRendererColors(){let{color:e}=await import("./D27YXH3W.js"),t=new Map,i=this._getRenderer(),a="default";if(!i)return t;let r=await ae(i);return r.delete(a),Array.from(r.values()).every(s=>s?.length===1)&&Array.from(r.keys()).forEach(s=>{let n=r.get(s)?.[0]?.toCss(!0);n&&t.set(s,e(n))}),t}async _createChart(e){let{activeMediaInfo:t}=this;if(!e||!t)return;let{createRoot:i}=await import("./PZC5TBXA.js").then(m=>m.default.then(e=>({createRoot:e}))),a=await i(e);this._chartRoot=a,this._renderChart({mediaInfo:t,root:a})}_handleMediaKeyup(e){let{key:t}=e;t==="ArrowLeft"&&(e.stopPropagation(),this.previous()),t==="ArrowRight"&&(e.stopPropagation(),this.next())}_canAnimateChart(){return!this.chartAnimationDisabled&&!this._prefersReducedMotion}_getChartAnimationMS(){return this._canAnimateChart()?ce:0}_getChartSeriesAnimationMS(){return this._canAnimateChart()?de:0}async _customizeChartTooltip(e,t="horizontal"){let{color:i}=await import("./D27YXH3W.js");e.setAll({pointerOrientation:t}),e.get("background")?.setAll({stroke:i(le)}),e.label.setAll({direction:this._direction,oversizedBehavior:"wrap",maxWidth:he})}async _createPieChart(e,t){let[{Tooltip:i},{PieChart:a,PieSeries:r}]=await Promise.all([import("./D27YXH3W.js"),import("./Y6IN6NEC.js")]),{mediaInfo:s,root:n}=e,{title:o}=s,c=5,g=s?.altText||s?.title||"",h=n.container.children.push(a.new(n,{role:"figure",ariaLabel:g,focusable:!0,paddingBottom:c,paddingTop:c,paddingLeft:c,paddingRight:c})),l=`{category}: {valuePercentTotal.formatNumber('0.00')}%
3
3
  ({value})`,d=i.new(n,{labelText:l}),m=h.series.push(r.new(n,{name:o,valueField:A,categoryField:M,tooltip:d}));m.ticks.template.set("forceHidden",!0),m.labels.template.set("forceHidden",!0),m.slices.template.states.create("active",{shiftRadius:c}),this._customizeChartTooltip(d),m.slices.template.setAll({ariaLabel:l,focusable:!0,templateField:"columnSettings"}),m.data.setAll(t),m.appear(this._getChartSeriesAnimationMS()),h.appear(this._getChartAnimationMS()),h.root.dom.classList.toggle("chart-rendered",!0)}_getMinSeriesValue(e){let t=0;return e.forEach(i=>t=Math.min(i.value,t)),t}async _createColumnChart(e,t,i){let[{Tooltip:a,Scrollbar:r},{CategoryAxis:s,AxisRendererX:n,AxisRendererY:o,ValueAxis:c,ColumnSeries:g}]=await Promise.all([import("./D27YXH3W.js"),import("./XW72RT5D.js")]),{mediaInfo:h,root:l}=t,{value:d,title:m}=h,{_direction:u}=this;e.setAll({wheelX:"panX",wheelY:"zoomX"});let p=e.xAxes.push(s.new(l,{renderer:n.new(l,{inversed:u==="rtl"}),categoryField:M}));p.get("renderer").labels.template.setAll({forceHidden:!0});let v=e.yAxes.push(c.new(l,{renderer:o.new(l,{inside:!1}),min:this._getMinSeriesValue(d.series)}));v.get("renderer").labels.template.setAll({direction:u});let _="{categoryX}",I=a.new(l,{labelText:_}),f=e.series.push(g.new(l,{name:m,xAxis:p,yAxis:v,valueYField:A,categoryXField:M,tooltip:I}));this._customizeChartTooltip(I),f.columns.template.setAll({ariaLabel:_,focusable:!0,templateField:"columnSettings"}),d.series.length>X&&e.set("scrollbarX",r.new(l,{orientation:"horizontal"})),p.data.setAll(i),f.data.setAll(i),f.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createBarChart(e,t,i){let[{Tooltip:a,Scrollbar:r},{CategoryAxis:s,AxisRendererX:n,AxisRendererY:o,ValueAxis:c,ColumnSeries:g}]=await Promise.all([import("./D27YXH3W.js"),import("./XW72RT5D.js")]),{mediaInfo:h,root:l}=t,{value:d,title:m}=h,{_direction:u}=this;e.setAll({wheelX:"panY",wheelY:"zoomY"});let p=e.yAxes.push(s.new(l,{renderer:o.new(l,{inversed:!0}),categoryField:M}));p.get("renderer").labels.template.setAll({forceHidden:!0});let v=e.xAxes.push(c.new(l,{renderer:n.new(l,{inside:!1,inversed:u==="rtl"}),min:this._getMinSeriesValue(d.series)}));v.get("renderer").labels.template.setAll({direction:u});let _="{categoryY}",I=a.new(l,{labelText:_}),f=e.series.push(g.new(l,{name:m,xAxis:v,yAxis:p,valueXField:A,categoryYField:M,tooltip:I}));this._customizeChartTooltip(I,"vertical"),f.columns.template.setAll({ariaLabel:_,focusable:!0,templateField:"columnSettings"}),d.series.length>X&&e.set("scrollbarY",r.new(l,{orientation:"vertical"})),p.data.setAll(i),f.data.setAll(i),f.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createLineChart(e,t,i){let[{Tooltip:a,Scrollbar:r},{CategoryAxis:s,AxisRendererX:n,AxisRendererY:o,ValueAxis:c,LineSeries:g}]=await Promise.all([import("./D27YXH3W.js"),import("./XW72RT5D.js")]),{root:h,mediaInfo:l}=t,{value:d,title:m}=l,{_direction:u}=this;e.setAll({wheelX:"panX",wheelY:"zoomX"});let p=e.xAxes.push(s.new(h,{renderer:n.new(h,{inversed:u==="rtl"}),categoryField:M}));p.get("renderer").labels.template.setAll({forceHidden:!0});let v=e.yAxes.push(c.new(h,{renderer:o.new(h,{inside:!1}),min:this._getMinSeriesValue(d.series)}));v.get("renderer").labels.template.setAll({direction:u});let _="{categoryX}",I=i[0]?.lineSettings?.stroke,f=a.new(h,{getFillFromSprite:!I,labelText:_});I&&f.get("background")?.setAll({fill:I});let w=e.series.push(g.new(h,{name:m,xAxis:p,yAxis:v,valueYField:A,categoryXField:M,tooltip:f}));w.strokes.template.setAll({templateField:"lineSettings"}),this._customizeChartTooltip(f,"vertical"),d.series.length>X&&e.set("scrollbarX",r.new(h,{orientation:"horizontal"})),p.data.setAll(i),w.data.setAll(i),w.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createXYChart(e,t){let{XYChart:i,XYCursor:a}=await import("./XW72RT5D.js"),{root:r,mediaInfo:s}=e,{type:n}=s,o=s?.altText||s?.title||"",c=r.container.children.push(i.new(r,{role:"figure",ariaLabel:o,focusable:!0,panX:!0,panY:!0}));c.set("cursor",a.new(r,{})),n==="column-chart"&&await this._createColumnChart(c,e,t),n==="bar-chart"&&await this._createBarChart(c,e,t),n==="line-chart"&&await this._createLineChart(c,e,t),c.root.dom.classList.toggle("chart-rendered",!0)}_clearMediaRefreshTimer(){let{_refreshTimer:e}=this;e&&(clearTimeout(e),this._refreshTimer=void 0)}_updateMediaInfoTimestamp(e){let t=Date.now();this._refreshIntervalInfo={timestamp:t,sourceURL:e&&this._getImageSource(e,t)}}_setupMediaRefreshTimer(){this._clearMediaRefreshTimer();let{activeMediaInfo:e}=this;e?.type==="image"&&e.refreshInterval>0&&this._setRefreshTimeout(e)}_setRefreshTimeout(e){let{refreshInterval:t,value:i}=e,a=t*6e4;this._updateMediaInfoTimestamp(i.sourceURL);let r=window.setInterval(()=>{this._updateMediaInfoTimestamp(i.sourceURL)},a);this._refreshTimer=r}_getImageSource(e,t){let i=e.includes("?")?"&":"?",[a,r=""]=e.split("#");return`${a}${i}timestamp=${t}${r?"#":""}${r}`}_updateChartElement(e){this._chartRoot?.dispose(),this._chartRoot=void 0,e&&this._createChart(e)}render(){return y`<div class="root" @keyup=${this._handleMediaKeyup}><arcgis-feature-element-info .heading=${this.heading} .description=${this.description} .headingLevel=${this.headingLevel}></arcgis-feature-element-info>${this._renderMedia()}</div>`}_renderMedia(){let{formattedMediaInfoCount:e,activeMediaInfoIndex:t}=this,i=this._renderMediaText();return e?y`<div class="container">${this._renderMediaInfo()}<div class="item-navigation">${i}${e>1?y`<div class="pagination">${this._renderMediaPageButton("previous")}<span class="pagination-text">${re(this.messages?.pageText??"",{index:t+1,total:e})}</span>${this._renderMediaPageButton("next")}</div>`:null}</div></div>`:null}_renderMediaText(){let{activeMediaInfo:e}=this;if(!e)return null;let t=e?.title?y`<div class="item-title" .innerHTML=${Q.sanitize(e.title)??""}></div>`:null,i=e?.caption?y`<div class="item-caption" .innerHTML=${Q.sanitize(e.caption)??""}></div>`:null;return t||i?y`<div class="item-text">${t}${i}</div>`:null}_renderImageMediaInfo(e){if(!e.value)return null;let{_refreshIntervalInfo:t}=this,{value:i,refreshInterval:a,altText:r,title:s}=e,{sourceURL:n,linkURL:o}=i,c=G(o??void 0)?"_blank":"_self",g=c==="_blank"?"noreferrer":"",h=a?t:null,l=h?h.sourceURL:n,d=y`<img alt=${(r||s)??x} src=${l??void 0??x}>`;return(o?y`<a href=${o??x} rel=${g??x} target=${c??x} title=${s??x}>${d}</a>`:null)??d}_renderChartMediaInfo(e){let{activeMediaInfoIndex:t,formattedMediaInfoCount:i}=this;return O(`media-${e.type}-${t}-${i}`,y`<div class="chart" ${P(this._updateChartElement)}></div>`)}_renderMediaInfoType(){let{activeMediaInfo:e}=this;return e?e.type==="image"?this._renderImageMediaInfo(e):e.type.includes("chart")?this._renderChartMediaInfo(e):null:null}_renderMediaInfo(){let{activeMediaInfo:e}=this;return e?y`<div class="item-container"><div class="item">${this._renderMediaInfoType()}</div></div>`:null}_renderMediaPageButton(e){if(this.formattedMediaInfoCount<2)return null;let t=e==="previous",i=t?this.messages?.previous??"":this.messages?.next??"",a=t?"chevron-left":"chevron-right",r=t?this.previous:this.next;return y`<button .ariaLabel=${i} class="pagination-button" @click=${r} tabindex=0 title=${i??x} type=button><calcite-icon flip-rtl class="pagination-icon" .icon=${a} scale=s></calcite-icon></button>`}async _renderChart(e){let{root:t,mediaInfo:i}=e,{value:a,type:r}=i,[{default:s},{default:n},{default:o},{esriChartColorSet:c},{ColorSet:g,Theme:h}]=await Promise.all([import("./HHJN3Q6G.js"),import("./4JCY4NHX.js"),import("./CCKYOWZO.js"),import("./YC5JACID.js"),import("./D27YXH3W.js")]),l=h.new(t);l.rule("ColorSet").set("colors",c),l.rule("ColorSet").set("reuse",!0);let d=[o.new(t),l];H(this.el)==="dark"&&d.push(n.new(t)),this._canAnimateChart()&&d.push(s.new(t)),t.setThemes(d);let m=await this._getRendererColors(),u=await this._getSeriesColors(a.series),p=g.new(t,{}),v=u.get(a.series[0]),_=v?{lineSettings:{stroke:v}}:void 0,I=a.series.map((f,w)=>{let b=u.get(f)||m.get(f.fieldName)||p.getIndex(w);return{[M]:f.tooltip,[A]:f.value,columnSettings:{fill:b,stroke:b},..._}}).filter(f=>r==="pie-chart"?f.value!=null&&f.value>0:!0);r==="pie-chart"?this._createPieChart(e,I):this._createXYChart(e,I)}};B("arcgis-feature-media",N);return N},"renderers/support/utils","intl","core/reactiveUtils","popup/FieldInfo","popup/content/support/ChartMediaInfoValueSeries","applications/Components/sanitizerUtils",a)