@arcgis/portal-components 6.0.0-next.21 → 6.0.0-next.23

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.
@@ -1,2 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import a from"./TJWJ3LTU.js";import{b as z}from"./3J3ISO3E.js";import{a as E}from"./4VLEUN7I.js";import"./KV4ZZSNW.js";import"./FN2QMDEW.js";import{a as B}from"./5R4JJWGB.js";import"./B3HV5JVN.js";import"./YK6FCXWU.js";import{I as S,J as C,K as j,O as D,Q as J,h as M,j as g,o as N,q as A,r as R,v as F}from"./HHGKNVCH.js";import"./KHKREBVZ.js";import"./5PV2GUZW.js";export default $arcgis.t(([le,be,we,Ie,$,de,b,pe,fe,P,X,T,ee,{i:W,k:q,l:G,m:U,n:V,o:H,p:Q,q:K,r:Y,s:Z}])=>{var L=(i=>(i.expression="expression/",i))(L||{});function I(i){return i!=null}function se(i,e,s){let t=e.fieldName;if(t.includes(L.expression)){let r=s.get(t);return r?.title?r.title:t}else return ee.supportsFieldConfiguration(i)&&i.getFieldConfiguration(t)?i.getFieldAlias(t)||t:e.label||t}function te(i,e,s){let t="";if(/^raster.(?:item|service)pixelvalue/iu.test(i))t="number";else if(e.has(i)){let r=e.get(i);t=r.type?r.type.toLowerCase():""}else if(s.has(i)){let r=s.get(i);t=r.returnType?r.returnType.toLowerCase():""}else t="number";return t}async function ie(i){return new Map((await me(i)).filter(e=>e.visible).map(e=>[e.name,e]))}function re(i){let e=new Map;return i?.expressionInfos&&i.expressionInfos.forEach(s=>{let t=`${L.expression}${s.name}`;e.set(t,s)}),e}async function me(i){return await new Promise((e,s)=>{switch(i.type){case"feature":case"ogc-feature":case"stream":e(i.fields);break;case"sublayer":{let t=i,r=t?.layer;r?.portalItem&&r.url.includes("https://demographics")&&r.url.includes(".arcgis.com")?r.portalItem?.fetchData().then(a=>{if(a?.thematicGroup){let n=new Map(t.fields.map(o=>[o.name,o])),c=a.thematicGroup.fieldNames,p=[];c.forEach(o=>{n.has(o)&&p.push(n.get(o))}),e(p)}else e(t.fields)}).catch(a=>{s(new Error(a))}):e(t.fields);break}case"imagery":case"imagery-tile":case"wcs":e(i.rasterFields);break;default:e("fields"in i?i.fields??[]:[])}})}function d(i,e){return!i||!e?!1:i.toLocaleLowerCase()===e.toLocaleLowerCase()}async function ae(i,e,s,t){if(!s)return!1;let r=["feature","oriented-imagery"].includes(e.type),a=t?.item??e.portalItem,n=e.sourceJSON;if(!r||!a||!a.portal.user||!U(a)||G(a)||V(a)||H(n)||a.portal.isPortal&&q(a)||["oid","global-id","geometry"].includes(s.type)||await ue(e,s.name,t))return!1;let c=e.sourceJSON.geometryProperties,p=c?.shapeLengthFieldName,o=c?.shapeAreaFieldName;if(d(p,s.name)||d(o,s.name))return!1;let l=e.editFieldsInfo;if(l&&(d(l.creationDateField,s.name)||d(l.creatorField,s.name)||d(l.editDateField,s.name)||d(l.editorField,s.name))||d(e.objectIdField,s.name)||d(e.displayField,s.name)||d(e.typeIdField,s.name)||d(e.subtypeField,s.name)||e.timeInfo&&(d(e.timeInfo.startField,s.name)||d(e.timeInfo.endField,s.name)||d(e.timeInfo.trackIdField,s.name)))return!1;if(!t?.ignoreLayerRenderer&&e.featureReduction){let f=new Set;if(await b.collectFeatureReductionFields(f,e,e.featureReduction),Array.from(f).some(y=>d(y,s.name)))return!1}if(!t?.ignoreLayerRenderer&&(await b.getRendererFields(e.renderer,e.fieldsIndex)).some(f=>d(f,s.name)))return!1;if(!t?.ignoreLayerLabelingInfo){let f=e.labelingInfo?.map(y=>y.labelExpressionInfo?.expression);if(f&&((await b.getExpressionFields(e,f)).some(y=>d(y,s.name))||await ne(e,s,"layer")))return!1}if(!t?.ignoreLayerDefinitionExpression&&e.definitionExpression&&(await T.parseWhereClause(e.definitionExpression,e.fieldsIndex)).fieldNames.some(f=>d(f,s.name))||await he(e,s,t)||await _e(e,s))return!1;if(await ye(e,s))return await Promise.resolve(!1);if(await ve(e,s))return await Promise.resolve(!1);if(ge(i,e,s)||e.relationships?.map(f=>f.keyField)?.some(f=>d(f,s.name)))return!1;let u=W(a,a.portal.user),w=t?.userItemInfo?.userGroups??await Q(e)??[],_=t?.userItemInfo?.itemGroups??await K(e)??[],v=Z(w,_);if(!u&&!v)return!1;let m=t?.userItemInfo?.relatedItems??await Y(a.id,a.portal,{relationshipType:"Service2Service"});return!(m?.data?.relatedItems&&m.data.relatedItems.some(f=>["WMTS","Map Service","Vector Tile Service"].includes(f.type)))}async function ue(i,e,s){let t=`${i.url}/${i.layerId}/fieldGroups`;try{let r=s?.userItemInfo&&"fieldGroups"in s.userItemInfo?s.userItemInfo.fieldGroups:(await X(t,{query:{f:"json"},responseType:"json"}))?.data?.fieldGroups;return r?r.some(a=>a.fields.some(n=>d(n,e))):!1}catch{return!1}}function ge(i,e,s){if(!i)return!1;let t=i.map?.applicationProperties?.viewing?.search;if(t){let r=t.layers?.find(a=>a.id===e.id);if(r){let a=r?.field?.name;if(a)return d(a,s.name)}}return!1}async function ne(i,e,s){let t=s==="layer"?i.labelingInfo?.filter(n=>I(n.where)):i.sourceJSON?.drawingInfo?.labelingInfo?.filter(n=>I(n.where));if(!t?.length)return!1;let r=[...await Promise.all(t.map(async n=>await T.parseWhereClause(n.where,i.fieldsIndex)))],a=!1;for(let n=0;n<r.length;n++){let c=r[n].fieldNames?.some(p=>d(p,e.name));if(!a&&c){a=!0;break}}return await Promise.resolve(a)}async function he(i,e,s){let t=i.portalItem;if(!t)return!1;let r=`${E(t.portal)}content/items/${t.id}/data`,a=(s?.userItemInfo?.itemData??await X(r,{query:{f:"json"},responseType:"json"}))?.data;if(!a)return!1;if(a?.layers){let n=a.layers.find(l=>l.id===i.layerId),c=n?.layerDefinition?.drawingInfo?.renderer,p=n?.layerDefinition?.featureReduction,o=n?.layerDefinition?.definitionExpression;if(!c&&!p&&!o)return!1;if(!s?.ignoreItemRenderer&&c){let l=P.fromJSON(c);if((await b.getRendererFields(l,i.fieldsIndex)).some(u=>d(u,e.name)))return!0}if(!s?.ignoreItemFeatureReduction&&p&&await oe(i,e,p)||o&&(await T.parseWhereClause(o,i.fieldsIndex)).fieldNames.some(l=>d(l,e.name)))return!0}return!1}async function _e(i,e){let s=i.sourceJSON,t=s?.drawingInfo?.renderer,r=s?.featureReduction;if(!t&&!r)return!1;if(t){let a=P.fromJSON(t);if((await b.getRendererFields(a,i.fieldsIndex)).some(n=>d(n,e.name)))return!0}return!!(r&&await oe(i,e,r))}async function ye(i,e){let s=i.sourceJSON?.drawingInfo?.labelingInfo;if(!s)return await Promise.resolve(!1);let t=s?.map(r=>r.labelExpressionInfo?.expression);if(t){if((await b.getExpressionFields(i,t)).some(r=>d(r,e.name)))return await Promise.resolve(!0);if(await ne(i,e,"service"))return await Promise.resolve(!0)}return await Promise.resolve(!1)}async function ve(i,e){let s=i.sourceJSON?.definitionQuery;return s?(await T.parseWhereClause(s,i.fieldsIndex)).fieldNames.some(t=>d(t,e.name))?await Promise.resolve(!0):await Promise.resolve(!1):await Promise.resolve(!1)}async function oe(i,e,s){let t=s.type==="binning"?pe.fromJSON(s):fe.fromJSON(s),r=new Set;return await b.collectFeatureReductionFields(r,i,t),!!Array.from(r).some(a=>d(a,e.name))}var h=new Map;h.set("oid","key");h.set("guid","key");h.set("global-id","key");h.set("blob","binary");h.set("integer","integer");h.set("small-integer","integer");h.set("big-integer","integer");h.set("single","number");h.set("double","number");h.set("long","number");h.set("number","number");h.set("date","date-time");h.set("date-only","calendar");h.set("time-only","clock");h.set("timestamp-offset","time-zone");h.set("string","string");var Ne=({fieldType:i})=>g`<calcite-icon scale=s .icon=${h.get(i)}></calcite-icon>`,Fe=["esrignss_speed","esrignss_direction","esrisnsr_azimuth","esrignss_positionsourcetype","esrignss_receiver","esrignss_h_rms","esrignss_v_rms","esrignss_latitude","esrignss_longitude","esrignss_altitude","esrignss_pdop","esrignss_hdop","esrignss_vdop","esrignss_fixtype","esrignss_correctionage","esrignss_stationid","esrignss_numsats","esrignss_fixdatetime","esrignss_avg_h_rms","esrignss_avg_v_rms","esrignss_avg_positions","esrignss_h_stddev","esrignss_correction_source_name","esrignss_correction_source_type","esrignss_custom_attributes","esrignss_h_95_status","esrignss_ntrip_mount_point","esrignss_antenna_height","esrignss_orthometric_height","esrignss_profile_has_hor_xform","esrignss_profile_hor_xform","esrignss_receiver_gcs","esrignss_receiver_gcs_wkid","esrignss_receiver_geoid","esrignss_receiver_ref_epoch","esrisnsr_tilt_azimuth_accuracy","esrisnsr_tilt_azimuth","esrisnsr_tilt_angle_accuracy","esrisnsr_tilt_angle","esrignss_tilt_compensated","esrignss_cp1_latitude","esrignss_cp1_longitude","esrignss_cp1_altitude","esrignss_cp1_h_rms","esrignss_cp1_v_rms","esrignss_cp1_fixdatetime","esrignss_cp1_fixtype","esrignss_cp1_corr_age","esrignss_cp1_stationid","esrignss_cp1_numsats","esrignss_cp1_pdop","esrignss_cp1_hdop","esrignss_cp1_vdop","esrignss_cp1_avg_h_rms","esrignss_cp1_avg_v_rms","esrignss_cp1_avg_positions","esrignss_cp1_h_stddev","esrisnsr_cp1_slope_dist","esrisnsr_cp1_inclination","esrisnsr_cp1_azimuth","esrignss_cp2_latitude","esrignss_cp2_longitude","esrignss_cp2_altitude","esrignss_cp2_h_rms","esrignss_cp2_v_rms","esrignss_cp2_fixdatetime","esrignss_cp2_fixtype","esrignss_cp2_corr_age","esrignss_cp2_stationid","esrignss_cp2_numsats","esrignss_cp2_pdop","esrignss_cp2_hdop","esrignss_cp2_vdop","esrignss_cp2_avg_h_rms","esrignss_cp2_avg_v_rms","esrignss_cp2_avg_positions","esrignss_cp2_h_stddev","esrisnsr_cp2_slope_dist","esrisnsr_cp2_inclination","esrisnsr_cp2_azimuth","esrisnsr_offset_method","esrisnsr_offset_device","esrisnsr_offset_laser_height","esrisnsr_offset_laser_target_ht","esrisnsr_offset_mag_var","esrignss_worst_h_rms","esrignss_worst_v_rms","esrignss_worst_fixtype","esrignss_manual_locations"],Ee=M`.dialog{--calcite-dialog-max-size-y: 60%}.dialog-content-wrapper{position:relative;min-height:100px}.hide-overflow{overflow:hidden}.field-icons{padding:0 var(--calcite-spacing-lg);display:flex;align-items:center}.warning{border-bottom:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);margin-bottom:var(--calcite-spacing-md)}.warning-message{font-size:var(--calcite-font-size--1);font-weight:var(--calcite-font-weight-bold)}.loader-container{position:absolute;height:100%;width:100%;top:0;right:0;display:none;z-index:40;overflow:hidden;background:#fffffff2;padding:0}.active{display:flex;flex-direction:column;align-items:center;justify-content:center}.loader{padding:0}.loader-text{font-weight:var(--calcite-font-weight-medium);text-align:center;margin-right:6.25rem;margin-left:6.25rem}`,k=class extends j{constructor(){super(...arguments),this.arcadeExpMap=new Map,this.cancelNode=S(),this.dialogNode=S(),this.layerFields=[],this.layerFieldsMap=new Map,this.messages=B({blocking:!0}),this.deleteInProgress=!1,this.fieldsAreDeletable=!1,this._propWatcherTask=new z(this,{task:async([e,s])=>{let t=I(e)&&I(s);if(I(e)||N("error",this,A("layer")),I(s)||N("error",this,A("fieldNames")),!t)throw new Error("Required properties are missing");this._propWatcherTask.autoRun=!1,await this.processProps()},args:()=>[this.layer,this.fieldNames]}),this.arcgisBeforeModalClose=F(),this.arcgisClose=F(),this.arcgisBeforeDelete=F(),this.arcgisFieldsDeleted=F()}static{this.properties={config:0,fieldNames:0,layer:0,mapView:0,options:0}}static{this.styles=Ee}async processProps(){let{layer:e,mapView:s,fieldNames:t}=this;if(!e||!t){this.fieldsAreDeletable=!1;return}e.loaded||await e.load(),this.layerFields=e.fields.filter(a=>t.includes(a.name));let r=t.some(a=>!e.fields.find(n=>n.name===a));if(!this.layerFields?.length||r)this.fieldsAreDeletable=!1;else{let a=await Promise.all(this.layerFields.map(async n=>await ae(s,e,n,this.options)));if(this.fieldsAreDeletable=a.every(n=>n),!this.fieldsAreDeletable)return}if(this.layerFieldsMap=await ie(e),this.options?.ignorePopupTemplate||(this.arcadeExpMap=re(e.popupTemplate)),this.portal=e.portalItem?.portal??this.options?.portal,this.item=e.portalItem??this.options?.item,!this.item){this.fieldsAreDeletable=!1;return}await Ie.getCredential(this.item.url.replace("rest/services","rest/admin/services"))}getFieldLabel(e){let{layer:s,arcadeExpMap:t}=this;if(this.options?.ignorePopupTemplate)return this.getFieldDisplayNameFromLayerFields(e);{let r=(s.popupTemplate??s.createPopupTemplate())?.fieldInfos?.find(a=>a.fieldName===e);return r?se(s,r,t):this.getFieldDisplayNameFromLayerFields(e)}}getFieldDisplayNameFromLayerFields(e){let{layer:s}=this,t=this.layerFieldsMap.get(e);return de.supportsFieldConfiguration(s)?s.getFieldAlias(e):t.alias??t.name}async deleteFields(){let{layer:e,fieldNames:s}=this,t=`${e.url.replace("/rest/services","/rest/admin/services")}/${e.layerId}/deleteFromDefinition`,r={fields:s.map(n=>({name:n}))},a={deleteFromDefinition:JSON.stringify(r)};await $(t,{query:{...a,f:"json",async:!1},method:"post",responseType:"json"}).then(async n=>{if(n.data?.success){let c=`${e.url}/${e.layerId}`;s.forEach(o=>{e.type==="feature"&&e.floorInfo?.floorField===o&&(e.floorInfo=null)});let p=await $(c,{query:{f:"json"},responseType:"json"});if(p){let o=p.data;this.currentLayerInfo=p.data,o&&(this.updateTypesAndTemplatesOnLayer(),s.forEach(l=>{o.templates?.length?o.templates.forEach(u=>delete u.prototype.attributes[l]):o.types?.forEach(u=>{u.templates.forEach(w=>delete w.prototype.attributes[l])})}),this.updateFeatureService(o))}else this.handleError()}else this.handleError()},()=>this.handleError())}updateTypesAndTemplatesOnLayer(){let{currentLayerInfo:e}=this,s=e;if(s.templates?.length){let t=this.updateTemplatesList(s.templates);s.templates=t}else if(s.types){let t=s.types;s.types=[],t.forEach(r=>{r.templates=this.updateTemplatesList(r.templates),this.addType(s,r)})}}updateTemplatesList(e){let{currentLayerInfo:s,messages:t}=this,r=[];return(e??[]).forEach(a=>{let n=new be;n.description=a.description??"",n.name=a.name||t.newFeature,n.drawingTool=a.drawingTool||"point";let c={};s.fields.forEach(o=>{let l=!1;for(let u=0;u<a.prototype.attributes.length;u++)if(a.prototype.attributes[u]===o.name){l=!0,c[o.name]=a.prototype.attributes[o.name];break}!l&&o.editable&&!Fe.includes(o.name)&&(c[o.name]=o.defaultValue||null)});let p=new we({attributes:c});n.prototype=p,r.push(n)}),r}addType(e,s){e.types?e.types.some(t=>t.id===s.id)||e.types.push(s):e.types=[s]}async updateFeatureService(e){let{layer:s,fieldNames:t}=this,r={templates:e.templates,types:e.types},a=`${s.url.replace("/rest/services","/rest/admin/services")}/${s.layerId}/updateDefinition`,n={f:"json",updateDefinition:JSON.stringify(r)};await $(a,{query:{...n,f:"json"},method:"post",responseType:"json"}).then(async c=>{if(c.data?.success){let p=`${E(this.portal)}content/items/${this.item.id}/data`;if(this.options?.ignorePopupTemplate||t.forEach(o=>{s.popupTemplate?.fieldInfos&&(s.popupTemplate.fieldInfos=s.popupTemplate.fieldInfos.filter(l=>l.fieldName!==o)),s.popupTemplate?.content?.forEach((l,u)=>{l.type==="fields"&&l.fieldInfos&&((s.popupTemplate?.content)[u].fieldInfos=(s.popupTemplate?.content)[u].fieldInfos?.filter(w=>w.fieldName!==o))})}),s.attributeTableTemplate){let o=s.attributeTableTemplate.clone();o.elements=o.elements.filter(l=>!(l.type==="field"&&t.includes(l.fieldName))),o.orderByFields=o.orderByFields.filter(l=>!t.includes(l.field)),s.attributeTableTemplate=o}if(s.fieldConfigurations?.length){let o=le.clone(s.fieldConfigurations).filter(l=>!t.includes(l.name));s.fieldConfigurations=o}await $(p,{query:{f:"json"},responseType:"json"}).then(async o=>{let l=o.data;if(l?.layers||l?.tables){let u=s.isTable,w=u?l.tables:l.layers,_=w?.find(v=>v.id===s.layerId);if(t.forEach(v=>{_?.attributeTableInfo?.attributeTableElements&&(_.attributeTableInfo.attributeTableElements=_.attributeTableInfo.attributeTableElements.map(m=>{if(m.type==="field")return m.fieldName===v?void 0:m;if(m.type==="group"&&Array.isArray(m.attributeTableElements)){let f=m.attributeTableElements.filter(y=>!(y.type==="field"&&y.fieldName===v));return f.length?{...m,attributeTableElements:f}:void 0}return m}).filter(Boolean),_.attributeTableInfo.orderByFields=_.attributeTableInfo.orderByFields.filter(m=>m.field!==v))}),_?.layerDefinition?.fieldConfigurations&&(_.layerDefinition.fieldConfigurations=_.layerDefinition.fieldConfigurations.filter(v=>!t.includes(v.name))),_?.popupInfo){t.forEach(y=>{_.popupInfo.fieldInfos=_.popupInfo.fieldInfos.filter(x=>x.fieldName!==y),_.popupInfo.popupElements?.forEach((x,O)=>{x.type==="fields"&&x.fieldInfos&&(_.popupInfo.popupElements[O].fieldInfos=_.popupInfo.popupElements[O].fieldInfos.filter(ce=>ce.fieldName!==y))})});let v=`${E(this.portal)}content/users/${this.item.owner}/items/${this.item.id}/update`,m={};u?(m.tables=w,l.layers&&(m.layers=l.layers)):(m.layers=w,l.tables&&(m.tables=l.tables));let f={f:"json",text:JSON.stringify(m)};await $(v,{query:{...f},method:"post",responseType:"json"}).then(y=>{y.data?.success?this.handleSuccess():this.handleError()},()=>this.handleError())}else this.handleSuccess()}else o.httpStatus===200&&(!o.data||JSON.stringify(o.data)==="{}")?this.handleSuccess():this.handleError()},()=>this.handleError())}},()=>this.handleError())}handleSuccess(){this.arcgisFieldsDeleted.emit(),this.dialogNode?.value&&(this.dialogNode.value.open=!1),this.options?.handleCloseOnConsumer?this.arcgisBeforeModalClose.emit("success"):this.displaySuccessAlert()}handleError(e){this.dialogNode?.value&&(this.dialogNode.value.open=!1),e?this.options?.handleCloseOnConsumer?this.arcgisBeforeModalClose.emit("read-only-error"):this.displayReadOnlyErrorAlert():this.options?.handleCloseOnConsumer?this.arcgisBeforeModalClose.emit("error"):this.displayErrorAlert()}displaySuccessAlert(){let{messages:e,fieldNames:s}=this;this.successAlertNode&&(this.successAlertNode.parentElement?.removeChild(this.successAlertNode),this.successAlertNode=void 0),this.successAlertNode=D(g`<calcite-alert .label=${s.length===1?e.fieldDeleted:e.fieldsDeleted} kind=success icon=check-circle auto-close open><div slot=message>${s.length===1?e.fieldDeleted:e.fieldsDeleted}</div></calcite-alert>`),document.body.append(this.successAlertNode)}displayErrorAlert(){let{messages:e}=this;this.errorAlertNode&&(this.errorAlertNode.parentElement?.removeChild(this.errorAlertNode),this.errorAlertNode=void 0),this.errorAlertNode=D(g`<calcite-alert .label=${e.fieldDeletionUnsuccessful} kind=danger icon=exclamation-mark-triangle auto-close open><div slot=message>${e.fieldDeletionUnsuccessful}</div></calcite-alert>`),document.body.append(this.errorAlertNode)}displayReadOnlyErrorAlert(){let{messages:e,portal:s}=this;this.errorAlertNode&&(this.errorAlertNode.parentElement?.removeChild(this.errorAlertNode),this.errorAlertNode=void 0),this.errorAlertNode=D(g`<calcite-alert .label=${e.fieldDeletionUnsuccessful} kind=danger icon=exclamation-mark-triangle auto-close auto-close-duration=slow open><div slot=title>${e.error}</div><div slot=message>${s.isPortal?e.readOnlyErrorMessageEnterprise:e.readOnlyErrorMessage}</div>${!s.isPortal&&g`<calcite-link slot=link target=_blank href=https://status.arcgis.com>${e.healthDashboard}</calcite-link>`||""}</calcite-alert>`),document.body.append(this.errorAlertNode)}render(){let{messages:e,fieldsAreDeletable:s,fieldNames:t,deleteInProgress:r}=this;return g`<calcite-dialog class="dialog" width=s open modal outside-close-disabled escape-disabled @calciteDialogClose=${()=>this.arcgisClose.emit()} .heading=${t?.length===1?e.deleteField:e.deleteFields} ${C(this.dialogNode)}>${this._propWatcherTask.render({pending:()=>g`<div class="dialog-content-wrapper hide-overflow"><div class="loader-container active"><calcite-loader class="loader" .label=${e.fields}></calcite-loader></div></div>`,error:()=>g`<div class="dialog-content-wrapper">${this.renderError()}</div>`,complete:()=>(s||(t?.length?t?.length===1?N("error",this,"Field cannot be deleted"):N("error",this,"One or more fields cannot be deleted"):N("error",this,R("fieldNames"))),s?g`<div class=${`dialog-content-wrapper ${r?"hide-overflow":""}`}>${this.renderDeleteLoader()}<calcite-label>${t.length===1?e.deletePrompt:e.deleteMultiplePrompt}</calcite-label>${this.renderFieldsPreview()}</div>${this.renderCancelButton()}${this.renderDeleteButton()}`:g`<div class="dialog-content-wrapper">${this.renderError()}</div>`)})}</calcite-dialog>`}renderError(){let{messages:e}=this;return g`<div class="loader-container active"><div class="loader-text">${e.errorOccurred}</div></div>`}renderDeleteLoader(){let{messages:e,fieldNames:s,deleteInProgress:t}=this;return g`<div class=${`loader-container ${t?"active":""}`}><calcite-loader class="loader" .label=${s.length===1?e.deletingField:e.deletingFields} .hidden=${!t}></calcite-loader><div class="loader-text">${s.length===1?e.deletingField:e.deletingFields}</div></div>`}renderFieldsPreview(){let{fieldNames:e,layerFields:s,layerFieldsMap:t,arcadeExpMap:r,messages:a}=this;return g`<calcite-list .label=${a.fields}>${e.map(n=>{let c=s.find(p=>p.name===n);return g`<calcite-list-item .label=${this.getFieldLabel(n)} .description=${`{${n}}`} .value=${n} .disabled=${!c.editable}><div slot=actions-end class="field-icons">${Ne({fieldType:te(n,t,r)})}</div></calcite-list-item>`})}</calcite-list>`}renderCancelButton(){let{messages:e}=this;return g`<calcite-button @click=${()=>this.dialogNode.value.open=!1} slot=footer-end appearance=outline ${C(this.cancelNode)}>${e.cancel}</calcite-button>`}renderDeleteButton(){let{messages:e,fieldNames:s}=this;return g`<calcite-button kind=danger slot=footer-end @click=${async t=>{let{portal:r}=this;t.currentTarget.disabled=!0,this.cancelNode.value.disabled=!0,this.dialogNode.value.closeDisabled=!0,r.sourceJSON?.isReadOnly?this.handleError(!0):(this.deleteInProgress=!0,this.requestUpdate(),this.arcgisBeforeDelete.emit(),await this.deleteFields())}}>${s.length===1?e.deleteField:e.deleteFieldsWithNumber.replace("${number}",`${s.length}`)}</calcite-button>`}};J("arcgis-portal-field-delete",k);return k},"core/lang","layers/support/FeatureTemplate","Graphic","identity/IdentityManager","request","applications/PortalApp/layerUtils","layers/support/fieldUtils","layers/support/FeatureReductionBinning","layers/support/FeatureReductionCluster","renderers/support/jsonUtils","request","core/sql","applications/PortalApp/layerUtils",a)