@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
1 lines • 6 kB
JavaScript
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3513],{47685:(e,t,n)=>{n.d(t,{Mk:()=>m,Zk:()=>c,w6:()=>F});var i=n(90237),r=n(65529),s=n(4718),o=n(74887),d=n(10107),a=(n(44208),n(53966),n(40608)),u=n(20816);const l=new r.A.EventEmitter;function c(e,t,n=null,i=!1){const r=(0,o.Tw)();return i=null==t||i,l.emit("apply-edits",{serviceUrl:e,layerId:t,gdbVersion:n,mayReceiveServiceEdits:i,result:r.promise}),r}const h=Symbol();function m(e){return null!=e&&"object"==typeof e&&h in e}function f(e){return null!=e&&"object"==typeof e&&"gdbVersion"in e}function p(e,t,n){const i=new URL(e).host,r=u.Z3.get(i),s=e=>!e||e===r;return s(t)&&s(n)||t===n}const F=e=>{var t;let n=class extends e{constructor(...e){super(...e),this[t]=!0,this._applyEditsHandler=e=>{const{serviceUrl:t,layerId:n,gdbVersion:i,mayReceiveServiceEdits:r,result:o}=e,d=t===this.url,a=null!=n&&null!=this.layerId&&n===this.layerId,u=f(this),l=f(this)&&p(t,i,this.gdbVersion);if(!d||u&&!l||!a&&!r)return;const c=o.then((e=>{if(this.lastEditsEventDate=new Date,a&&(e.addedFeatures.length||e.updatedFeatures.length||e.deletedFeatures.length||e.addedAttachments.length||e.updatedAttachments.length||e.deletedAttachments.length))return this.emit("edits",(0,s.o8)(e)),e;const n=e.editedFeatures?.find((({layerId:e})=>e===this.layerId));if(n){const{adds:t,updates:i,deletes:r}=n.editedFeatures,o={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:t?t.map((({attributes:e})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]}))):[],deletedFeatures:r?r.map((({attributes:e})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]}))):[],updatedFeatures:i?i.map((({current:{attributes:e}})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]}))):[],editedFeatures:(0,s.o8)(e.editedFeatures),exceededTransferLimit:!1,historicMoment:(0,s.o8)(e.historicMoment)};return this.emit("edits",o),o}const r={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:[],deletedFeatures:[],updatedFeatures:[],editedFeatures:(0,s.o8)(e.editedFeatures),exceededTransferLimit:!1,historicMoment:(0,s.o8)(e.historicMoment)};return"historicMoment"in this&&this._shouldUpdateHistoricMoment(t,i,r.historicMoment)&&this.emit("edits",r),r})).then((e=>("historicMoment"in this&&this._shouldUpdateHistoricMoment(t,i,e.historicMoment)&&(this.historicMoment=e.historicMoment),e)));this.emit("apply-edits",{result:c})},this._updateMomentHandler=e=>{const{serviceUrl:t,gdbVersion:n,moment:i}=e,r=t===this.url,s=f(this),o=f(this)&&p(t,n,this.gdbVersion),d=f(this)&&!p(t,this.gdbVersion,null);r&&s&&o&&d&&"historicMoment"in this&&this.historicMoment!==i&&(this.historicMoment=i)},this.when().then((()=>{this.addHandles(function(e){return l.on("apply-edits",new WeakRef(e))}(this._applyEditsHandler)),"historicMoment"in this&&this.addHandles(function(e){return l.on("update-moment",new WeakRef(e))}(this._updateMomentHandler))}),(()=>{}))}_shouldUpdateHistoricMoment(e,t,n){return"historicMoment"in this&&this.historicMoment!==n&&(0,u.w5)(e,t)}};return t=h,(0,i._)([(0,d.MZ)()],n.prototype,"lastEditsEventDate",void 0),n=(0,i._)([(0,a.$)("esri.layers.mixins.EditBusLayer")],n),n}},20557:(e,t,n)=>{n.d(t,{Fm:()=>a,Hz:()=>m,JQ:()=>h,JZ:()=>w,ND:()=>p,R_:()=>o,U9:()=>c,fu:()=>r,nr:()=>f,oF:()=>s,rq:()=>u,z$:()=>l});const i=[["binary","application/octet-stream","bin",""]];function r(e,t){return null!=b(t.name,e?.supportedFormats??[])}function s(e,t){if(!e)return!1;const n=u(t,e.supportedFormats??[]);return null!=n&&e.editFormats.includes(n)}function o(e,t){return g(function(e,t){const n=e.toLowerCase();return F(t).find((e=>M(e)===n))}(e,t))}function d(e,t){return g(b(e,t))}function a(e,t){return M(function(e,t){return F(t).find((t=>g(t)===e))}(e,t))}function u(e,t){return d(e.name,t)??o(e.type,t)}function l(e,t,n){return o(e,n)??d(t,n)}function c({supportedFormats:e}){return l("model/gltf-binary","glb",e)}function h(e){const t=c(e);return null!=t&&e.editFormats.includes(t)}function m(e){if(!e)return null;const t=c(e),n=function({supportedFormats:e}){return l("model/gltf+json","gltf",e)}(e);let i=null;for(const r of e.queryFormats){if(r===t)return r;r===n&&(i=r)}return i}function f({supportedFormats:e}){return l("application/esri3do-SR_world","wld",e)}function p({supportedFormats:e}){return l("application/esri3do-SR_prj","prj",e)}function F(e){return[...i,...e]}function b(e,t){const n=e.toLowerCase();return F(t).find((e=>function(e){return e?.[2].split(",").map((e=>e.toLowerCase()))??[]}(e).some((e=>n.endsWith(e)))))}function g(e){return e?.[0]}function M(e){return e?.[1].toLowerCase()}function w(e){return e.tables?.find((e=>"assetMaps"===e.role))}},20816:(e,t,n)=>{n.d(t,{TA:()=>r,We:()=>d,Z3:()=>s,ZJ:()=>a,w5:()=>u});var i=n(78888);const r=(0,n(13069).vD)(),s=new Map,o=new Map;async function d(e,t,n){if(!e||!n)return!1;if(!t)return!0;const r=new URL(e).host;let o=s.get(r);if(!o){const t=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,"");o=(await(0,i.A)(t,{responseType:"json",query:{f:"json"}})).data.defaultVersionName}return o===t}async function a(e,t,i=!1){if(!e||!t)return!0;const s=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),d=o.get(s)?.entries();if(d)for(const[e,o]of d)if(o.name===t){const t=!o.stack?.hasForwardEdits();if(!t&&i){const[{deleteForwardEdits:t},{default:i}]=await Promise.all([n.e(2186).then(n.bind(n,32186)),n.e(2558).then(n.bind(n,32558))]),d=await t(s,e,new i({sessionId:r,moment:o.moment}));return d.success&&o.stack?.clearForwardEdits(),d.success}return t}return!0}function u(e,t){if(!e)return!1;const n=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),i=o.get(n)?.entries();if(i)for(const[e,n]of i)if(n.name===t)return"edit"===n.lockType;return!1}new Map}}]);