@arcgis/core 4.31.0-next.20240712 → 4.31.0-next.20240713

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 (52) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/192f64e12728626372ab.js +1 -0
  3. package/assets/esri/core/workers/chunks/1dc7a3a7fc39fd3060f4.js +1 -0
  4. package/assets/esri/core/workers/chunks/{0928dfb82b92a7b4c377.js → 2d92a9db4a300cdbc7fd.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{53a07f99b34a4fce6175.js → 69e432e24f581aa08ce3.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{e487369636b6cb21528d.js → 89b9332f052d11df6a71.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{f4d63feb971fe1fdc4be.js → 8d9bc39077d8261df151.js} +1 -1
  8. package/assets/esri/core/workers/chunks/a30f52f903d5e87f5401.js +1 -0
  9. package/assets/esri/core/workers/chunks/{56ff916e894207779993.js → b6be871be5ac97d13288.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{a4da52df90974695d9a2.js → bff4b67cbb1a9eaf1f0b.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{9b3b0c00cc6a4408fc49.js → cdbb209cf240e8bc29f0.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{15574dbf40b7b93d47ef.js → e070bcd8e69ce3efb8fd.js} +1 -1
  13. package/assets/esri/libs/linkchartlayout/lclayout.wasm +0 -0
  14. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core-simd.wasm +0 -0
  15. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core.wasm +0 -0
  16. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations.json +1 -1
  17. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_en.json +1 -1
  18. package/chunks/arcgis-knowledge-client-core-simd.js +1 -1
  19. package/chunks/arcgis-knowledge-client-core.js +1 -1
  20. package/interfaces.d.ts +0 -7
  21. package/layers/KnowledgeGraphLayer.js +1 -1
  22. package/layers/LinkChartLayer.js +1 -1
  23. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  24. package/layers/knowledgeGraph/layerUtils.js +5 -0
  25. package/package.json +1 -1
  26. package/rest/knowledgeGraph/wasmInterface/WasmClientDataInterfaces.js +5 -0
  27. package/rest/knowledgeGraph/wasmInterface/clientDataToWasmEncodedFactories.js +5 -0
  28. package/rest/knowledgeGraph/wasmInterface/wasmToClientDataFactories.js +5 -0
  29. package/rest/knowledgeGraph/wasmInterface/wasmUtils.js +5 -0
  30. package/rest/knowledgeGraphService.js +1 -1
  31. package/support/revision.js +1 -1
  32. package/views/2d/viewpointUtils.js +1 -1
  33. package/views/3d/layers/I3SMeshView3D.js +1 -1
  34. package/views/3d/layers/SceneLayerView3D.js +1 -1
  35. package/views/3d/support/HighlightDefault.js +5 -0
  36. package/views/3d/support/HighlightOptions.js +1 -1
  37. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  38. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  39. package/views/SceneView.js +1 -1
  40. package/views/support/HighlightDefaults.js +1 -1
  41. package/widgets/BasemapLayerList.js +1 -1
  42. package/widgets/Bookmarks.js +1 -1
  43. package/widgets/CatalogLayerList.js +1 -1
  44. package/widgets/Editor/UpdateWorkflow.js +1 -1
  45. package/widgets/LayerList.js +1 -1
  46. package/widgets/TableList.js +1 -1
  47. package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +1 -1
  48. package/widgets/support/listUtils.js +5 -0
  49. package/assets/esri/core/workers/chunks/17c37078ab65f8d4046b.js +0 -1
  50. package/assets/esri/core/workers/chunks/3de4fe7458b7844e2aae.js +0 -1
  51. package/assets/esri/core/workers/chunks/482f7dfc9486a283a529.js +0 -1
  52. package/views/3d/support/HighlightOptionsBase.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{g as n,c as t}from"./_commonjsHelpers.js";var e,r,a,i={exports:{}};e=i,r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,a=function(n){var e,a,i;n=n||{},e||(e=void 0!==n?n:{}),e.ready=new Promise((function(n,t){a=n,i=t}));var o=Object.assign({},e),u="./this.program",c="";"undefined"!=typeof document&&document.currentScript&&(c=document.currentScript.src),r&&(c=r),c=0!==c.indexOf("blob:")?c.substr(0,c.replace(/[?#].*/,"").lastIndexOf("/")+1):"";var f,s=e.print||console.log.bind(console),l=e.printErr||console.warn.bind(console);Object.assign(e,o),o=null,e.thisProgram&&(u=e.thisProgram),e.wasmBinary&&(f=e.wasmBinary),e.noExitRuntime,"object"!=typeof WebAssembly&&R("no native wasm support detected");var h,p,v,d,g,m,y,b,w,A,T,_,C=!1,P="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function $(n,t,e){var r=t+e;for(e=t;n[e]&&!(e>=r);)++e;if(16<e-t&&n.buffer&&P)return P.decode(n.subarray(t,e));for(r="";t<e;){var a=n[t++];if(128&a){var i=63&n[t++];if(192==(224&a))r+=String.fromCharCode((31&a)<<6|i);else{var o=63&n[t++];65536>(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&n[t++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function k(n,t,e,r){if(0<r){r=e+r-1;for(var a=0;a<n.length;++a){var i=n.charCodeAt(a);if(55296<=i&&57343>=i&&(i=65536+((1023&i)<<10)|1023&n.charCodeAt(++a)),127>=i){if(e>=r)break;t[e++]=i}else{if(2047>=i){if(e+1>=r)break;t[e++]=192|i>>6}else{if(65535>=i){if(e+2>=r)break;t[e++]=224|i>>12}else{if(e+3>=r)break;t[e++]=240|i>>18,t[e++]=128|i>>12&63}t[e++]=128|i>>6&63}t[e++]=128|63&i}}t[e]=0}}function W(n){for(var t=0,e=0;e<n.length;++e){var r=n.charCodeAt(e);127>=r?t++:2047>=r?t+=2:55296<=r&&57343>=r?(t+=4,++e):t+=3}return t}function E(){var n=h.buffer;p=n,e.HEAP8=v=new Int8Array(n),e.HEAP16=g=new Int16Array(n),e.HEAP32=y=new Int32Array(n),e.HEAPU8=d=new Uint8Array(n),e.HEAPU16=m=new Uint16Array(n),e.HEAPU32=b=new Uint32Array(n),e.HEAPF32=w=new Float32Array(n),e.HEAPF64=_=new Float64Array(n),e.HEAP64=A=new BigInt64Array(n),e.HEAPU64=T=new BigUint64Array(n)}var j,O=[],S=[],F=[];function D(){var n=e.preRun.shift();O.unshift(n)}var M,U=0,I=null;function R(n){throw e.onAbort&&e.onAbort(n),l(n="Aborted("+n+")"),C=!0,n=new WebAssembly.RuntimeError(n+". Build with -sASSERTIONS for more info."),i(n),n}function x(){return M.startsWith("data:application/octet-stream;base64,")}if(M="arcgis-knowledge-client-core.wasm",!x()){var H=M;M=e.locateFile?e.locateFile(H,c):c+H}function Y(){var n=M;try{if(n==M&&f)return new Uint8Array(f);throw"both async and sync fetching of the wasm failed"}catch(t){R(t)}}function V(){return f||"function"!=typeof fetch?Promise.resolve().then((function(){return Y()})):fetch(M,{credentials:"same-origin"}).then((function(n){if(!n.ok)throw"failed to load wasm binary file at '"+M+"'";return n.arrayBuffer()})).catch((function(){return Y()}))}function B(n){for(;0<n.length;)n.shift()(e)}function z(n){this.ga=n-24,this.Za=function(n){b[this.ga+4>>2]=n},this.Ua=function(n){b[this.ga+8>>2]=n},this.Va=function(){y[this.ga>>2]=0},this.Oa=function(){v[this.ga+12|0]=0},this.Ya=function(){v[this.ga+13|0]=0},this.La=function(n,t){this.Ma(),this.Za(n),this.Ua(t),this.Va(),this.Oa(),this.Ya()},this.Ma=function(){b[this.ga+16>>2]=0}}var q={};function N(n){for(;n.length;){var t=n.pop();n.pop()(t)}}function L(n){return this.fromWireType(y[n>>2])}var G={},J={},Z={};function X(n){if(void 0===n)return"_unknown";var t=(n=n.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=t&&57>=t?"_"+n:n}function K(n,t){return n=X(n),function(){return t.apply(this,arguments)}}function Q(n){var t=Error,e=K(n,(function(t){this.name=n,this.message=t,void 0!==(t=Error(t).stack)&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))}));return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},e}var nn=void 0;function tn(n){throw new nn(n)}function en(n,t,e){function r(t){(t=e(t)).length!==n.length&&tn("Mismatched type converter count");for(var r=0;r<n.length;++r)fn(n[r],t[r])}n.forEach((function(n){Z[n]=t}));var a=Array(t.length),i=[],o=0;t.forEach(((n,t)=>{J.hasOwnProperty(n)?a[t]=J[n]:(i.push(n),G.hasOwnProperty(n)||(G[n]=[]),G[n].push((()=>{a[t]=J[n],++o===i.length&&r(a)})))})),0===i.length&&r(a)}function rn(n){if(null===n)return"null";var t=typeof n;return"object"===t||"array"===t||"function"===t?n.toString():""+n}var an=void 0;function on(n){for(var t="";d[n];)t+=an[d[n++]];return t}var un=void 0;function cn(n){throw new un(n)}function fn(n,t,e={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");var r=t.name;if(n||cn('type "'+r+'" must have a positive integer typeid pointer'),J.hasOwnProperty(n)){if(e.Wa)return;cn("Cannot register type '"+r+"' twice")}J[n]=t,delete Z[n],G.hasOwnProperty(n)&&(t=G[n],delete G[n],t.forEach((n=>n())))}function sn(n,t,e){switch(t){case 0:return e?function(n){return v[n]}:function(n){return d[n]};case 1:return e?function(n){return g[n>>1]}:function(n){return m[n>>1]};case 2:return e?function(n){return y[n>>2]}:function(n){return b[n>>2]};case 3:return e?function(n){return A[n>>3]}:function(n){return T[n>>3]};default:throw new TypeError("Unknown integer type: "+n)}}function ln(n){switch(n){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+n)}}function hn(n){cn(n.ea.ha.fa.name+" instance already deleted")}var pn=!1;function vn(){}function dn(n){--n.count.value,0===n.count.value&&(n.ja?n.la.oa(n.ja):n.ha.fa.oa(n.ga))}function gn(n,t,e){return t===e?n:void 0===e.ma||null===(n=gn(n,t,e.ma))?null:e.Ka(n)}var mn={},yn=[];function bn(){for(;yn.length;){var n=yn.pop();n.ea.ua=!1,n.delete()}}var wn=void 0,An={};function Tn(n,t){for(void 0===t&&cn("ptr should not be undefined");n.ma;)t=n.wa(t),n=n.ma;return An[t]}function _n(n,t){return t.ha&&t.ga||tn("makeClassHandle requires ptr and ptrType"),!!t.la!=!!t.ja&&tn("Both smartPtrType and smartPtr must be specified"),t.count={value:1},Cn(Object.create(n,{ea:{value:t}}))}function Cn(n){return"undefined"==typeof FinalizationRegistry?(Cn=n=>n,n):(pn=new FinalizationRegistry((n=>{dn(n.ea)})),vn=n=>{pn.unregister(n)},(Cn=n=>{var t=n.ea;return t.ja&&pn.register(n,{ea:t},n),n})(n))}function Pn(){}function $n(n,t,e){if(void 0===n[t].ia){var r=n[t];n[t]=function(){return n[t].ia.hasOwnProperty(arguments.length)||cn("Function '"+e+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+n[t].ia+")!"),n[t].ia[arguments.length].apply(this,arguments)},n[t].ia=[],n[t].ia[r.ta]=r}}function kn(n,t,r){e.hasOwnProperty(n)?((void 0===r||void 0!==e[n].ia&&void 0!==e[n].ia[r])&&cn("Cannot register public name '"+n+"' twice"),$n(e,n,n),e.hasOwnProperty(r)&&cn("Cannot register multiple overloads of a function with the same number of arguments ("+r+")!"),e[n].ia[r]=t):(e[n]=t,void 0!==r&&(e[n].lb=r))}function Wn(n,t,e,r,a,i,o,u){this.name=n,this.constructor=t,this.pa=e,this.oa=r,this.ma=a,this.Pa=i,this.wa=o,this.Ka=u,this.ab=[]}function En(n,t,e){for(;t!==e;)t.wa||cn("Expected null or instance of "+e.name+", got an instance of "+t.name),n=t.wa(n),t=t.ma;return n}function jn(n,t){return null===t?(this.Ba&&cn("null is not a valid "+this.name),0):(t.ea||cn('Cannot pass "'+rn(t)+'" as a '+this.name),t.ea.ga||cn("Cannot pass deleted object as a pointer of type "+this.name),En(t.ea.ga,t.ea.ha.fa,this.fa))}function On(n,t){if(null===t){if(this.Ba&&cn("null is not a valid "+this.name),this.ya){var e=this.Ca();return null!==n&&n.push(this.oa,e),e}return 0}if(t.ea||cn('Cannot pass "'+rn(t)+'" as a '+this.name),t.ea.ga||cn("Cannot pass deleted object as a pointer of type "+this.name),!this.xa&&t.ea.ha.xa&&cn("Cannot convert argument of type "+(t.ea.la?t.ea.la.name:t.ea.ha.name)+" to parameter type "+this.name),e=En(t.ea.ga,t.ea.ha.fa,this.fa),this.ya)switch(void 0===t.ea.ja&&cn("Passing raw pointer to smart pointer is illegal"),this.gb){case 0:t.ea.la===this?e=t.ea.ja:cn("Cannot convert argument of type "+(t.ea.la?t.ea.la.name:t.ea.ha.name)+" to parameter type "+this.name);break;case 1:e=t.ea.ja;break;case 2:if(t.ea.la===this)e=t.ea.ja;else{var r=t.clone();e=this.bb(e,Ln((function(){r.delete()}))),null!==n&&n.push(this.oa,e)}break;default:cn("Unsupporting sharing policy")}return e}function Sn(n,t){return null===t?(this.Ba&&cn("null is not a valid "+this.name),0):(t.ea||cn('Cannot pass "'+rn(t)+'" as a '+this.name),t.ea.ga||cn("Cannot pass deleted object as a pointer of type "+this.name),t.ea.ha.xa&&cn("Cannot convert argument of type "+t.ea.ha.name+" to parameter type "+this.name),En(t.ea.ga,t.ea.ha.fa,this.fa))}function Fn(n,t,e,r,a,i,o,u,c,f,s){this.name=n,this.fa=t,this.Ba=e,this.xa=r,this.ya=a,this.$a=i,this.gb=o,this.Ha=u,this.Ca=c,this.bb=f,this.oa=s,a||void 0!==t.ma?this.toWireType=On:(this.toWireType=r?jn:Sn,this.ka=null)}function Dn(n,t,r){e.hasOwnProperty(n)||tn("Replacing nonexistant public symbol"),void 0!==e[n].ia&&void 0!==r?e[n].ia[r]=t:(e[n]=t,e[n].ta=r)}var Mn=[];function Un(n,t){n=on(n);var e=Mn[t];return e||(t>=Mn.length&&(Mn.length=t+1),Mn[t]=e=j.get(t)),"function"!=typeof e&&cn("unknown function pointer with signature "+n+": "+t),e}var In=void 0;function Rn(n){var t=on(n=$t(n));return Pt(n),t}function xn(n,t){function e(n){a[n]||J[n]||(Z[n]?Z[n].forEach(e):(r.push(n),a[n]=!0))}var r=[],a={};throw t.forEach(e),new In(n+": "+r.map(Rn).join([", "]))}function Hn(n,t,e,r,a){var i=t.length;2>i&&cn("argTypes array size mismatch! Must at least get return value and 'this' types!");var o=null!==t[1]&&null!==e,u=!1;for(e=1;e<t.length;++e)if(null!==t[e]&&void 0===t[e].ka){u=!0;break}var c="void"!==t[0].name,f=i-2,s=Array(f),l=[],h=[];return function(){if(arguments.length!==f&&cn("function "+n+" called with "+arguments.length+" arguments, expected "+f+" args!"),h.length=0,l.length=o?2:1,l[0]=a,o){var e=t[1].toWireType(h,this);l[1]=e}for(var i=0;i<f;++i)s[i]=t[i+2].toWireType(h,arguments[i]),l.push(s[i]);if(i=r.apply(null,l),u)N(h);else for(var p=o?1:2;p<t.length;p++){var v=1===p?e:s[p-2];null!==t[p].ka&&t[p].ka(v)}return e=c?t[0].fromWireType(i):void 0}}function Yn(n,t){for(var e=[],r=0;r<n;r++)e.push(b[t+4*r>>2]);return e}function Vn(n,t,e){return n instanceof Object||cn(e+' with invalid "this": '+n),n instanceof t.fa.constructor||cn(e+' incompatible with "this" of type '+n.constructor.name),n.ea.ga||cn("cannot call emscripten binding method "+e+" on deleted object"),En(n.ea.ga,n.ea.ha.fa,t.fa)}var Bn=[],zn=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function qn(n){4<n&&0==--zn[n].Da&&(zn[n]=void 0,Bn.push(n))}var Nn=n=>(n||cn("Cannot use deleted val. handle = "+n),zn[n].value),Ln=n=>{switch(n){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var t=Bn.length?Bn.pop():zn.length;return zn[t]={Da:1,value:n},t}};function Gn(n,t,e){switch(t){case 0:return function(n){return this.fromWireType((e?v:d)[n])};case 1:return function(n){return this.fromWireType((e?g:m)[n>>1])};case 2:return function(n){return this.fromWireType((e?y:b)[n>>2])};default:throw new TypeError("Unknown integer type: "+n)}}function Jn(n,t){var e=J[n];return void 0===e&&cn(t+" has unknown type "+Rn(n)),e}function Zn(n,t){switch(t){case 2:return function(n){return this.fromWireType(w[n>>2])};case 3:return function(n){return this.fromWireType(_[n>>3])};default:throw new TypeError("Unknown float type: "+n)}}var Xn="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function Kn(n,t){for(var e=n>>1,r=e+t/2;!(e>=r)&&m[e];)++e;if(32<(e<<=1)-n&&Xn)return Xn.decode(d.subarray(n,e));for(e="",r=0;!(r>=t/2);++r){var a=g[n+2*r>>1];if(0==a)break;e+=String.fromCharCode(a)}return e}function Qn(n,t,e){if(void 0===e&&(e=2147483647),2>e)return 0;var r=t;e=(e-=2)<2*n.length?e/2:n.length;for(var a=0;a<e;++a)g[t>>1]=n.charCodeAt(a),t+=2;return g[t>>1]=0,t-r}function nt(n){return 2*n.length}function tt(n,t){for(var e=0,r="";!(e>=t/4);){var a=y[n+4*e>>2];if(0==a)break;++e,65536<=a?(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a)):r+=String.fromCharCode(a)}return r}function et(n,t,e){if(void 0===e&&(e=2147483647),4>e)return 0;var r=t;e=r+e-4;for(var a=0;a<n.length;++a){var i=n.charCodeAt(a);if(55296<=i&&57343>=i&&(i=65536+((1023&i)<<10)|1023&n.charCodeAt(++a)),y[t>>2]=i,(t+=4)+4>e)break}return y[t>>2]=0,t-r}function rt(n){for(var t=0,e=0;e<n.length;++e){var r=n.charCodeAt(e);55296<=r&&57343>=r&&++e,t+=4}return t}function at(n,t){for(var e=Array(n),r=0;r<n;++r)e[r]=Jn(b[t+4*r>>2],"parameter "+r);return e}var it={};function ot(n){var t=it[n];return void 0===t?on(n):t}var ut=[];function ct(){function n(n){n.$$$embind_global$$$=n;var t="object"==typeof $$$embind_global$$$&&n.$$$embind_global$$$==n;return t||delete n.$$$embind_global$$$,t}if("object"==typeof globalThis)return globalThis;if("object"==typeof $$$embind_global$$$)return $$$embind_global$$$;if("object"==typeof t&&n(t)?$$$embind_global$$$=t:"object"==typeof self&&n(self)&&($$$embind_global$$$=self),"object"==typeof $$$embind_global$$$)return $$$embind_global$$$;throw Error("unable to get global object.")}function ft(n){var t=ut.length;return ut.push(n),t}var st=[],lt={};function ht(){if(!pt){var n,t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:u||"./this.program"};for(n in lt)void 0===lt[n]?delete t[n]:t[n]=lt[n];var e=[];for(n in t)e.push(n+"="+t[n]);pt=e}return pt}var pt,vt=[null,[],[]];function dt(n){return 0==n%4&&(0!=n%100||0==n%400)}var gt=[31,29,31,30,31,30,31,31,30,31,30,31],mt=[31,28,31,30,31,30,31,31,30,31,30,31];function yt(n){var t=Array(W(n)+1);return k(n,t,0,t.length),t}function bt(n,t,e,r){function a(n,t,e){for(n="number"==typeof n?n.toString():n||"";n.length<t;)n=e[0]+n;return n}function i(n,t){return a(n,t,"0")}function o(n,t){function e(n){return 0>n?-1:0<n?1:0}var r;return 0===(r=e(n.getFullYear()-t.getFullYear()))&&0===(r=e(n.getMonth()-t.getMonth()))&&(r=e(n.getDate()-t.getDate())),r}function u(n){switch(n.getDay()){case 0:return new Date(n.getFullYear()-1,11,29);case 1:return n;case 2:return new Date(n.getFullYear(),0,3);case 3:return new Date(n.getFullYear(),0,2);case 4:return new Date(n.getFullYear(),0,1);case 5:return new Date(n.getFullYear()-1,11,31);case 6:return new Date(n.getFullYear()-1,11,30)}}function c(n){var t=n.ra;for(n=new Date(new Date(n.sa+1900,0,1).getTime());0<t;){var e=n.getMonth(),r=(dt(n.getFullYear())?gt:mt)[e];if(!(t>r-n.getDate())){n.setDate(n.getDate()+t);break}t-=r-n.getDate()+1,n.setDate(1),11>e?n.setMonth(e+1):(n.setMonth(0),n.setFullYear(n.getFullYear()+1))}return e=new Date(n.getFullYear()+1,0,4),t=u(new Date(n.getFullYear(),0,4)),e=u(e),0>=o(t,n)?0>=o(e,n)?n.getFullYear()+1:n.getFullYear():n.getFullYear()-1}var f=y[r+40>>2];for(var s in r={jb:y[r>>2],ib:y[r+4>>2],za:y[r+8>>2],Ea:y[r+12>>2],Aa:y[r+16>>2],sa:y[r+20>>2],na:y[r+24>>2],ra:y[r+28>>2],mb:y[r+32>>2],hb:y[r+36>>2],kb:f&&f?$(d,f):""},e=e?$(d,e):"",f={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})e=e.replace(new RegExp(s,"g"),f[s]);var l="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),h="January February March April May June July August September October November December".split(" ");for(s in f={"%a":function(n){return l[n.na].substring(0,3)},"%A":function(n){return l[n.na]},"%b":function(n){return h[n.Aa].substring(0,3)},"%B":function(n){return h[n.Aa]},"%C":function(n){return i((n.sa+1900)/100|0,2)},"%d":function(n){return i(n.Ea,2)},"%e":function(n){return a(n.Ea,2," ")},"%g":function(n){return c(n).toString().substring(2)},"%G":function(n){return c(n)},"%H":function(n){return i(n.za,2)},"%I":function(n){return 0==(n=n.za)?n=12:12<n&&(n-=12),i(n,2)},"%j":function(n){for(var t=0,e=0;e<=n.Aa-1;t+=(dt(n.sa+1900)?gt:mt)[e++]);return i(n.Ea+t,3)},"%m":function(n){return i(n.Aa+1,2)},"%M":function(n){return i(n.ib,2)},"%n":function(){return"\n"},"%p":function(n){return 0<=n.za&&12>n.za?"AM":"PM"},"%S":function(n){return i(n.jb,2)},"%t":function(){return"\t"},"%u":function(n){return n.na||7},"%U":function(n){return i(Math.floor((n.ra+7-n.na)/7),2)},"%V":function(n){var t=Math.floor((n.ra+7-(n.na+6)%7)/7);if(2>=(n.na+371-n.ra-2)%7&&t++,t)53==t&&(4==(e=(n.na+371-n.ra)%7)||3==e&&dt(n.sa)||(t=1));else{t=52;var e=(n.na+7-n.ra-1)%7;(4==e||5==e&&dt(n.sa%400-1))&&t++}return i(t,2)},"%w":function(n){return n.na},"%W":function(n){return i(Math.floor((n.ra+7-(n.na+6)%7)/7),2)},"%y":function(n){return(n.sa+1900).toString().substring(2)},"%Y":function(n){return n.sa+1900},"%z":function(n){var t=0<=(n=n.hb);return n=Math.abs(n)/60,(t?"+":"-")+String("0000"+(n/60*100+n%60)).slice(-4)},"%Z":function(n){return n.kb},"%%":function(){return"%"}},e=e.replace(/%%/g,"\0\0"),f)e.includes(s)&&(e=e.replace(new RegExp(s,"g"),f[s](r)));return(s=yt(e=e.replace(/\0\0/g,"%"))).length>t?0:(v.set(s,n),s.length-1)}nn=e.InternalError=Q("InternalError");for(var wt=Array(256),At=0;256>At;++At)wt[At]=String.fromCharCode(At);an=wt,un=e.BindingError=Q("BindingError"),Pn.prototype.isAliasOf=function(n){if(!(this instanceof Pn&&n instanceof Pn))return!1;var t=this.ea.ha.fa,e=this.ea.ga,r=n.ea.ha.fa;for(n=n.ea.ga;t.ma;)e=t.wa(e),t=t.ma;for(;r.ma;)n=r.wa(n),r=r.ma;return t===r&&e===n},Pn.prototype.clone=function(){if(this.ea.ga||hn(this),this.ea.va)return this.ea.count.value+=1,this;var n=Cn,t=Object,e=t.create,r=Object.getPrototypeOf(this),a=this.ea;return(n=n(e.call(t,r,{ea:{value:{count:a.count,ua:a.ua,va:a.va,ga:a.ga,ha:a.ha,ja:a.ja,la:a.la}}}))).ea.count.value+=1,n.ea.ua=!1,n},Pn.prototype.delete=function(){this.ea.ga||hn(this),this.ea.ua&&!this.ea.va&&cn("Object already scheduled for deletion"),vn(this),dn(this.ea),this.ea.va||(this.ea.ja=void 0,this.ea.ga=void 0)},Pn.prototype.isDeleted=function(){return!this.ea.ga},Pn.prototype.deleteLater=function(){return this.ea.ga||hn(this),this.ea.ua&&!this.ea.va&&cn("Object already scheduled for deletion"),yn.push(this),1===yn.length&&wn&&wn(bn),this.ea.ua=!0,this},e.getInheritedInstanceCount=function(){return Object.keys(An).length},e.getLiveInheritedInstances=function(){var n,t=[];for(n in An)An.hasOwnProperty(n)&&t.push(An[n]);return t},e.flushPendingDeletes=bn,e.setDelayFunction=function(n){wn=n,yn.length&&wn&&wn(bn)},Fn.prototype.Qa=function(n){return this.Ha&&(n=this.Ha(n)),n},Fn.prototype.Fa=function(n){this.oa&&this.oa(n)},Fn.prototype.argPackAdvance=8,Fn.prototype.readValueFromPointer=L,Fn.prototype.deleteObject=function(n){null!==n&&n.delete()},Fn.prototype.fromWireType=function(n){function t(){return this.ya?_n(this.fa.pa,{ha:this.$a,ga:e,la:this,ja:n}):_n(this.fa.pa,{ha:this,ga:n})}var e=this.Qa(n);if(!e)return this.Fa(n),null;var r=Tn(this.fa,e);if(void 0!==r)return 0===r.ea.count.value?(r.ea.ga=e,r.ea.ja=n,r.clone()):(r=r.clone(),this.Fa(n),r);if(r=this.fa.Pa(e),!(r=mn[r]))return t.call(this);r=this.xa?r.Ia:r.pointerType;var a=gn(e,this.fa,r.fa);return null===a?t.call(this):this.ya?_n(r.fa.pa,{ha:r,ga:a,la:this,ja:n}):_n(r.fa.pa,{ha:r,ga:a})},In=e.UnboundTypeError=Q("UnboundTypeError"),e.count_emval_handles=function(){for(var n=0,t=5;t<zn.length;++t)void 0!==zn[t]&&++n;return n},e.get_first_emval=function(){for(var n=5;n<zn.length;++n)if(void 0!==zn[n])return zn[n];return null};var Tt={n:function(n){return Ct(n+24)+24},m:function(n,t,e){throw new z(n).La(t,e),n},s:function(n){var t=q[n];delete q[n];var e=t.Ca,r=t.oa,a=t.Ga;en([n],a.map((n=>n.Ta)).concat(a.map((n=>n.eb))),(n=>{var i={};return a.forEach(((t,e)=>{var r=n[e],o=t.Ra,u=t.Sa,c=n[e+a.length],f=t.cb,s=t.fb;i[t.Na]={read:n=>r.fromWireType(o(u,n)),write:(n,t)=>{var e=[];f(s,n,c.toWireType(e,t)),N(e)}}})),[{name:t.name,fromWireType:function(n){var t,e={};for(t in i)e[t]=i[t].read(n);return r(n),e},toWireType:function(n,t){for(var a in i)if(!(a in t))throw new TypeError('Missing field: "'+a+'"');var o=e();for(a in i)i[a].write(o,t[a]);return null!==n&&n.push(r,o),o},argPackAdvance:8,readValueFromPointer:L,ka:r}]}))},F:function(n,t,e,r,a){t=on(t),e=ln(e);var i=-1!=t.indexOf("u");i&&(a=(1n<<64n)-1n),fn(n,{name:t,fromWireType:function(n){return n},toWireType:function(n,e){if("bigint"!=typeof e&&"number"!=typeof e)throw new TypeError('Cannot convert "'+rn(e)+'" to '+this.name);if(e<r||e>a)throw new TypeError('Passing a number "'+rn(e)+'" from JS side to C/C++ side to an argument of type "'+t+'", which is outside the valid range ['+r+", "+a+"]!");return e},argPackAdvance:8,readValueFromPointer:sn(t,e,!i),ka:null})},S:function(n,t,e,r,a){var i=ln(e);fn(n,{name:t=on(t),fromWireType:function(n){return!!n},toWireType:function(n,t){return t?r:a},argPackAdvance:8,readValueFromPointer:function(n){if(1===e)var r=v;else if(2===e)r=g;else{if(4!==e)throw new TypeError("Unknown boolean type size: "+t);r=y}return this.fromWireType(r[n>>i])},ka:null})},f:function(n,t,e,r,a,i,o,u,c,f,s,l,h){s=on(s),i=Un(a,i),u&&(u=Un(o,u)),f&&(f=Un(c,f)),h=Un(l,h);var p=X(s);kn(p,(function(){xn("Cannot construct "+s+" due to unbound types",[r])})),en([n,t,e],r?[r]:[],(function(t){if(t=t[0],r)var e=t.fa,a=e.pa;else a=Pn.prototype;t=K(p,(function(){if(Object.getPrototypeOf(this)!==o)throw new un("Use 'new' to construct "+s);if(void 0===c.qa)throw new un(s+" has no accessible constructor");var n=c.qa[arguments.length];if(void 0===n)throw new un("Tried to invoke ctor of "+s+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(c.qa).toString()+") parameters instead!");return n.apply(this,arguments)}));var o=Object.create(a,{constructor:{value:t}});t.prototype=o;var c=new Wn(s,t,o,h,e,i,u,f);e=new Fn(s,c,!0,!1,!1),a=new Fn(s+"*",c,!1,!1,!1);var l=new Fn(s+" const*",c,!1,!0,!1);return mn[n]={pointerType:a,Ia:l},Dn(p,t),[e,a,l]}))},v:function(n,t,e,r,a,i,o){var u=Yn(e,r);t=on(t),i=Un(a,i),en([],[n],(function(n){function r(){xn("Cannot call "+a+" due to unbound types",u)}var a=(n=n[0]).name+"."+t;t.startsWith("@@")&&(t=Symbol[t.substring(2)]);var c=n.fa.constructor;return void 0===c[t]?(r.ta=e-1,c[t]=r):($n(c,t,a),c[t].ia[e-1]=r),en([],u,(function(n){return n=Hn(a,[n[0],null].concat(n.slice(1)),null,i,o),void 0===c[t].ia?(n.ta=e-1,c[t]=n):c[t].ia[e-1]=n,[]})),[]}))},i:function(n,t,e,r,a,i){0<t||R();var o=Yn(t,e);a=Un(r,a),en([],[n],(function(n){var e="constructor "+(n=n[0]).name;if(void 0===n.fa.qa&&(n.fa.qa=[]),void 0!==n.fa.qa[t-1])throw new un("Cannot register multiple constructors with identical number of parameters ("+(t-1)+") for class '"+n.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return n.fa.qa[t-1]=()=>{xn("Cannot construct "+n.name+" due to unbound types",o)},en([],o,(function(r){return r.splice(1,0,null),n.fa.qa[t-1]=Hn(e,r,null,a,i),[]})),[]}))},b:function(n,t,e,r,a,i,o,u){var c=Yn(e,r);t=on(t),i=Un(a,i),en([],[n],(function(n){function r(){xn("Cannot call "+a+" due to unbound types",c)}var a=(n=n[0]).name+"."+t;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),u&&n.fa.ab.push(t);var f=n.fa.pa,s=f[t];return void 0===s||void 0===s.ia&&s.className!==n.name&&s.ta===e-2?(r.ta=e-2,r.className=n.name,f[t]=r):($n(f,t,a),f[t].ia[e-2]=r),en([],c,(function(r){return r=Hn(a,r,n,i,o),void 0===f[t].ia?(r.ta=e-2,f[t]=r):f[t].ia[e-2]=r,[]})),[]}))},c:function(n,t,e,r,a,i,o,u,c,f){t=on(t),a=Un(r,a),en([],[n],(function(n){var r=(n=n[0]).name+"."+t,s={get:function(){xn("Cannot access "+r+" due to unbound types",[e,o])},enumerable:!0,configurable:!0};return s.set=c?()=>{xn("Cannot access "+r+" due to unbound types",[e,o])}:()=>{cn(r+" is a read-only property")},Object.defineProperty(n.fa.pa,t,s),en([],c?[e,o]:[e],(function(e){var o=e[0],s={get:function(){var t=Vn(this,n,r+" getter");return o.fromWireType(a(i,t))},enumerable:!0};if(c){c=Un(u,c);var l=e[1];s.set=function(t){var e=Vn(this,n,r+" setter"),a=[];c(f,e,l.toWireType(a,t)),N(a)}}return Object.defineProperty(n.fa.pa,t,s),[]})),[]}))},R:function(n,t){fn(n,{name:t=on(t),fromWireType:function(n){var t=Nn(n);return qn(n),t},toWireType:function(n,t){return Ln(t)},argPackAdvance:8,readValueFromPointer:L,ka:null})},o:function(n,t,e,r){function a(){}e=ln(e),t=on(t),a.values={},fn(n,{name:t,constructor:a,fromWireType:function(n){return this.constructor.values[n]},toWireType:function(n,t){return t.value},argPackAdvance:8,readValueFromPointer:Gn(t,e,r),ka:null}),kn(t,a)},e:function(n,t,e){var r=Jn(n,"enum");t=on(t),n=r.constructor,r=Object.create(r.constructor.prototype,{value:{value:e},constructor:{value:K(r.name+"_"+t,(function(){}))}}),n.values[e]=r,n[t]=r},E:function(n,t,e){e=ln(e),fn(n,{name:t=on(t),fromWireType:function(n){return n},toWireType:function(n,t){return t},argPackAdvance:8,readValueFromPointer:Zn(t,e),ka:null})},W:function(n,t,e,r,a,i){var o=Yn(t,e);n=on(n),a=Un(r,a),kn(n,(function(){xn("Cannot call "+n+" due to unbound types",o)}),t-1),en([],o,(function(e){return Dn(n,Hn(n,[e[0],null].concat(e.slice(1)),null,a,i),t-1),[]}))},w:function(n,t,e,r,a){t=on(t),-1===a&&(a=4294967295),a=ln(e);var i=n=>n;if(0===r){var o=32-8*e;i=n=>n<<o>>>o}e=t.includes("unsigned")?function(n,t){return t>>>0}:function(n,t){return t},fn(n,{name:t,fromWireType:i,toWireType:e,argPackAdvance:8,readValueFromPointer:sn(t,a,0!==r),ka:null})},r:function(n,t,e){function r(n){var t=b;return new a(p,t[1+(n>>=2)],t[n])}var a=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];fn(n,{name:e=on(e),fromWireType:r,argPackAdvance:8,readValueFromPointer:r},{Wa:!0})},h:function(n,t,e,r,a,i,o,u,c,f,s,l){e=on(e),i=Un(a,i),u=Un(o,u),f=Un(c,f),l=Un(s,l),en([n],[t],(function(n){return n=n[0],[new Fn(e,n.fa,!1,!1,!0,n,r,i,u,f,l)]}))},G:function(n,t){var e="std::string"===(t=on(t));fn(n,{name:t,fromWireType:function(n){var t=b[n>>2],r=n+4;if(e)for(var a=r,i=0;i<=t;++i){var o=r+i;if(i==t||0==d[o]){if(a=a?$(d,a,o-a):"",void 0===u)var u=a;else u+=String.fromCharCode(0),u+=a;a=o+1}}else{for(u=Array(t),i=0;i<t;++i)u[i]=String.fromCharCode(d[r+i]);u=u.join("")}return Pt(n),u},toWireType:function(n,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var r="string"==typeof t;r||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||cn("Cannot pass non-string to std::string");var a=e&&r?W(t):t.length,i=Ct(4+a+1),o=i+4;if(b[i>>2]=a,e&&r)k(t,d,o,a+1);else if(r)for(r=0;r<a;++r){var u=t.charCodeAt(r);255<u&&(Pt(o),cn("String has UTF-16 code units that do not fit in 8 bits")),d[o+r]=u}else for(r=0;r<a;++r)d[o+r]=t[r];return null!==n&&n.push(Pt,i),i},argPackAdvance:8,readValueFromPointer:L,ka:function(n){Pt(n)}})},B:function(n,t,e){if(e=on(e),2===t)var r=Kn,a=Qn,i=nt,o=()=>m,u=1;else 4===t&&(r=tt,a=et,i=rt,o=()=>b,u=2);fn(n,{name:e,fromWireType:function(n){for(var e,a=b[n>>2],i=o(),c=n+4,f=0;f<=a;++f){var s=n+4+f*t;f!=a&&0!=i[s>>u]||(c=r(c,s-c),void 0===e?e=c:(e+=String.fromCharCode(0),e+=c),c=s+t)}return Pt(n),e},toWireType:function(n,r){"string"!=typeof r&&cn("Cannot pass non-string to C++ string type "+e);var o=i(r),c=Ct(4+o+t);return b[c>>2]=o>>u,a(r,c+4,o+t),null!==n&&n.push(Pt,c),c},argPackAdvance:8,readValueFromPointer:L,ka:function(n){Pt(n)}})},t:function(n,t,e,r,a,i){q[n]={name:on(t),Ca:Un(e,r),oa:Un(a,i),Ga:[]}},j:function(n,t,e,r,a,i,o,u,c,f){q[n].Ga.push({Na:on(t),Ta:e,Ra:Un(r,a),Sa:i,eb:o,cb:Un(u,c),fb:f})},T:function(n,t){fn(n,{Xa:!0,name:t=on(t),argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},l:function(n,t,e){n=Nn(n),t=Jn(t,"emval::as");var r=[],a=Ln(r);return b[e>>2]=a,t.toWireType(r,n)},z:function(n,t){return n=Nn(n),(t=Jn(t,"emval::as")).toWireType(null,n)},X:function(n,t,e,r){n=Nn(n),e=at(t,e);for(var a=Array(t),i=0;i<t;++i){var o=e[i];a[i]=o.readValueFromPointer(r),r+=o.argPackAdvance}return n=n.apply(void 0,a),Ln(n)},U:function(n,t,e,r,a){n=ut[n],t=Nn(t),e=ot(e);var i=[];return b[r>>2]=Ln(i),n(t,e,i,a)},C:function(n,t,e,r){(n=ut[n])(t=Nn(t),e=ot(e),null,r)},a:qn,H:function(n){return 0===n?Ln(ct()):(n=ot(n),Ln(ct()[n]))},A:function(n,t){var e=at(n,t),r=e[0];t=r.name+"_$"+e.slice(1).map((function(n){return n.name})).join("_")+"$";var a=st[t];if(void 0!==a)return a;var i=Array(n-1);return a=ft(((t,a,o,u)=>{for(var c=0,f=0;f<n-1;++f)i[f]=e[f+1].readValueFromPointer(u+c),c+=e[f+1].argPackAdvance;for(t=t[a].apply(t,i),f=0;f<n-1;++f)e[f+1].Ja&&e[f+1].Ja(i[f]);if(!r.Xa)return r.toWireType(o,t)})),st[t]=a},q:function(n,t){return n=Nn(n),t=Nn(t),Ln(n[t])},g:function(n){4<n&&(zn[n].Da+=1)},I:function(n,t){return(n=Nn(n))instanceof(t=Nn(t))},u:function(n){return"number"==typeof(n=Nn(n))},x:function(n){return"string"==typeof(n=Nn(n))},V:function(){return Ln([])},p:function(n){return Ln(ot(n))},k:function(n){N(Nn(n)),qn(n)},d:function(n,t){return n=(n=Jn(n,"_emval_take_value")).readValueFromPointer(t),Ln(n)},y:function(n){return n=Nn(n),Ln(typeof n)},D:function(){R("")},N:function(n,t,e){d.copyWithin(n,t,t+e)},M:function(n){var t=d.length;if(2147483648<(n>>>=0))return!1;for(var e=1;4>=e;e*=2){var r=t*(1+.2/e);r=Math.min(r,n+100663296);var a=Math;r=Math.max(n,r),a=a.min.call(a,2147483648,r+(65536-r%65536)%65536);n:{try{h.grow(a-p.byteLength+65535>>>16),E();var i=1;break n}catch(o){}i=void 0}if(i)return!0}return!1},K:function(n,t){var e=0;return ht().forEach((function(r,a){var i=t+e;for(a=b[n+4*a>>2]=i,i=0;i<r.length;++i)v[0|a++]=r.charCodeAt(i);v[0|a]=0,e+=r.length+1})),0},L:function(n,t){var e=ht();b[n>>2]=e.length;var r=0;return e.forEach((function(n){r+=n.length+1})),b[t>>2]=r,0},Q:function(){return 52},P:function(){return 70},O:function(n,t,e,r){for(var a=0,i=0;i<e;i++){var o=b[t>>2],u=b[t+4>>2];t+=8;for(var c=0;c<u;c++){var f=d[o+c],h=vt[n];0===f||10===f?((1===n?s:l)($(h,0)),h.length=0):h.push(f)}a+=u}return b[r>>2]=a,0},J:function(n,t,e,r){return bt(n,t,e,r)}};!function(){function n(n){e.asm=n.exports,h=e.asm.Y,E(),j=e.asm.ca,S.unshift(e.asm.Z),U--,e.monitorRunDependencies&&e.monitorRunDependencies(U),0==U&&I&&(n=I,I=null,n())}function t(t){n(t.instance)}function r(n){return V().then((function(n){return WebAssembly.instantiate(n,a)})).then((function(n){return n})).then(n,(function(n){l("failed to asynchronously prepare wasm: "+n),R(n)}))}var a={a:Tt};if(U++,e.monitorRunDependencies&&e.monitorRunDependencies(U),e.instantiateWasm)try{return e.instantiateWasm(a,n)}catch(o){l("Module.instantiateWasm callback failed with error: "+o),i(o)}(f||"function"!=typeof WebAssembly.instantiateStreaming||x()||"function"!=typeof fetch?r(t):fetch(M,{credentials:"same-origin"}).then((function(n){return WebAssembly.instantiateStreaming(n,a).then(t,(function(n){return l("wasm streaming compile failed: "+n),l("falling back to ArrayBuffer instantiation"),r(t)}))}))).catch(i)}(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.Z).apply(null,arguments)};var _t,Ct=e._malloc=function(){return(Ct=e._malloc=e.asm._).apply(null,arguments)},Pt=e._free=function(){return(Pt=e._free=e.asm.$).apply(null,arguments)},$t=e.___getTypeName=function(){return($t=e.___getTypeName=e.asm.aa).apply(null,arguments)};function kt(){function n(){if(!_t&&(_t=!0,e.calledRun=!0,!C)){if(B(S),a(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var n=e.postRun.shift();F.unshift(n)}B(F)}}if(!(0<U)){if(e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)D();B(O),0<U||(e.setStatus?(e.setStatus("Running..."),setTimeout((function(){setTimeout((function(){e.setStatus("")}),1),n()}),1)):n())}}if(e.__embind_initialize_bindings=function(){return(e.__embind_initialize_bindings=e.asm.ba).apply(null,arguments)},e.___cxa_is_pointer_type=function(){return(e.___cxa_is_pointer_type=e.asm.da).apply(null,arguments)},I=function n(){_t||kt(),_t||(I=n)},e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);0<e.preInit.length;)e.preInit.pop()();return kt(),n.ready},e.exports=a;const o=n(i.exports),u=Object.freeze(Object.defineProperty({__proto__:null,default:o},Symbol.toStringTag,{value:"Module"}));export{u as a};
5
+ import{g as n,c as t}from"./_commonjsHelpers.js";var e,r,a,i={exports:{}};e=i,r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,a=function(n){var e,a,i;n=n||{},e||(e=void 0!==n?n:{}),e.ready=new Promise((function(n,t){a=n,i=t}));var o=Object.assign({},e),u="./this.program",c="";"undefined"!=typeof document&&document.currentScript&&(c=document.currentScript.src),r&&(c=r),c=0!==c.indexOf("blob:")?c.substr(0,c.replace(/[?#].*/,"").lastIndexOf("/")+1):"";var f,s=e.print||console.log.bind(console),l=e.printErr||console.warn.bind(console);Object.assign(e,o),o=null,e.thisProgram&&(u=e.thisProgram),e.wasmBinary&&(f=e.wasmBinary),e.noExitRuntime,"object"!=typeof WebAssembly&&R("no native wasm support detected");var h,p,v,d,g,m,y,b,w,A,T,_,C=!1,P="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function $(n,t,e){var r=t+e;for(e=t;n[e]&&!(e>=r);)++e;if(16<e-t&&n.buffer&&P)return P.decode(n.subarray(t,e));for(r="";t<e;){var a=n[t++];if(128&a){var i=63&n[t++];if(192==(224&a))r+=String.fromCharCode((31&a)<<6|i);else{var o=63&n[t++];65536>(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&n[t++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function k(n,t,e,r){if(0<r){r=e+r-1;for(var a=0;a<n.length;++a){var i=n.charCodeAt(a);if(55296<=i&&57343>=i&&(i=65536+((1023&i)<<10)|1023&n.charCodeAt(++a)),127>=i){if(e>=r)break;t[e++]=i}else{if(2047>=i){if(e+1>=r)break;t[e++]=192|i>>6}else{if(65535>=i){if(e+2>=r)break;t[e++]=224|i>>12}else{if(e+3>=r)break;t[e++]=240|i>>18,t[e++]=128|i>>12&63}t[e++]=128|i>>6&63}t[e++]=128|63&i}}t[e]=0}}function W(n){for(var t=0,e=0;e<n.length;++e){var r=n.charCodeAt(e);127>=r?t++:2047>=r?t+=2:55296<=r&&57343>=r?(t+=4,++e):t+=3}return t}function E(){var n=h.buffer;p=n,e.HEAP8=v=new Int8Array(n),e.HEAP16=g=new Int16Array(n),e.HEAP32=y=new Int32Array(n),e.HEAPU8=d=new Uint8Array(n),e.HEAPU16=m=new Uint16Array(n),e.HEAPU32=b=new Uint32Array(n),e.HEAPF32=w=new Float32Array(n),e.HEAPF64=_=new Float64Array(n),e.HEAP64=A=new BigInt64Array(n),e.HEAPU64=T=new BigUint64Array(n)}var j,O=[],S=[],F=[];function D(){var n=e.preRun.shift();O.unshift(n)}var M,U=0,I=null;function R(n){throw e.onAbort&&e.onAbort(n),l(n="Aborted("+n+")"),C=!0,n=new WebAssembly.RuntimeError(n+". Build with -sASSERTIONS for more info."),i(n),n}function x(){return M.startsWith("data:application/octet-stream;base64,")}if(M="arcgis-knowledge-client-core.wasm",!x()){var H=M;M=e.locateFile?e.locateFile(H,c):c+H}function Y(){var n=M;try{if(n==M&&f)return new Uint8Array(f);throw"both async and sync fetching of the wasm failed"}catch(t){R(t)}}function V(){return f||"function"!=typeof fetch?Promise.resolve().then((function(){return Y()})):fetch(M,{credentials:"same-origin"}).then((function(n){if(!n.ok)throw"failed to load wasm binary file at '"+M+"'";return n.arrayBuffer()})).catch((function(){return Y()}))}function B(n){for(;0<n.length;)n.shift()(e)}function z(n){this.ga=n-24,this.Za=function(n){b[this.ga+4>>2]=n},this.Ua=function(n){b[this.ga+8>>2]=n},this.Va=function(){y[this.ga>>2]=0},this.Oa=function(){v[this.ga+12|0]=0},this.Ya=function(){v[this.ga+13|0]=0},this.La=function(n,t){this.Ma(),this.Za(n),this.Ua(t),this.Va(),this.Oa(),this.Ya()},this.Ma=function(){b[this.ga+16>>2]=0}}var q={};function N(n){for(;n.length;){var t=n.pop();n.pop()(t)}}function L(n){return this.fromWireType(y[n>>2])}var G={},J={},Z={};function X(n){if(void 0===n)return"_unknown";var t=(n=n.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=t&&57>=t?"_"+n:n}function K(n,t){return n=X(n),function(){return t.apply(this,arguments)}}function Q(n){var t=Error,e=K(n,(function(t){this.name=n,this.message=t,void 0!==(t=Error(t).stack)&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))}));return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},e}var nn=void 0;function tn(n){throw new nn(n)}function en(n,t,e){function r(t){(t=e(t)).length!==n.length&&tn("Mismatched type converter count");for(var r=0;r<n.length;++r)fn(n[r],t[r])}n.forEach((function(n){Z[n]=t}));var a=Array(t.length),i=[],o=0;t.forEach(((n,t)=>{J.hasOwnProperty(n)?a[t]=J[n]:(i.push(n),G.hasOwnProperty(n)||(G[n]=[]),G[n].push((()=>{a[t]=J[n],++o===i.length&&r(a)})))})),0===i.length&&r(a)}function rn(n){if(null===n)return"null";var t=typeof n;return"object"===t||"array"===t||"function"===t?n.toString():""+n}var an=void 0;function on(n){for(var t="";d[n];)t+=an[d[n++]];return t}var un=void 0;function cn(n){throw new un(n)}function fn(n,t,e={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");var r=t.name;if(n||cn('type "'+r+'" must have a positive integer typeid pointer'),J.hasOwnProperty(n)){if(e.Wa)return;cn("Cannot register type '"+r+"' twice")}J[n]=t,delete Z[n],G.hasOwnProperty(n)&&(t=G[n],delete G[n],t.forEach((n=>n())))}function sn(n,t,e){switch(t){case 0:return e?function(n){return v[n]}:function(n){return d[n]};case 1:return e?function(n){return g[n>>1]}:function(n){return m[n>>1]};case 2:return e?function(n){return y[n>>2]}:function(n){return b[n>>2]};case 3:return e?function(n){return A[n>>3]}:function(n){return T[n>>3]};default:throw new TypeError("Unknown integer type: "+n)}}function ln(n){switch(n){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+n)}}function hn(n){cn(n.ea.ha.fa.name+" instance already deleted")}var pn=!1;function vn(){}function dn(n){--n.count.value,0===n.count.value&&(n.ja?n.la.oa(n.ja):n.ha.fa.oa(n.ga))}function gn(n,t,e){return t===e?n:void 0===e.ma||null===(n=gn(n,t,e.ma))?null:e.Ka(n)}var mn={},yn=[];function bn(){for(;yn.length;){var n=yn.pop();n.ea.ua=!1,n.delete()}}var wn=void 0,An={};function Tn(n,t){for(void 0===t&&cn("ptr should not be undefined");n.ma;)t=n.wa(t),n=n.ma;return An[t]}function _n(n,t){return t.ha&&t.ga||tn("makeClassHandle requires ptr and ptrType"),!!t.la!=!!t.ja&&tn("Both smartPtrType and smartPtr must be specified"),t.count={value:1},Cn(Object.create(n,{ea:{value:t}}))}function Cn(n){return"undefined"==typeof FinalizationRegistry?(Cn=n=>n,n):(pn=new FinalizationRegistry((n=>{dn(n.ea)})),vn=n=>{pn.unregister(n)},(Cn=n=>{var t=n.ea;return t.ja&&pn.register(n,{ea:t},n),n})(n))}function Pn(){}function $n(n,t,e){if(void 0===n[t].ia){var r=n[t];n[t]=function(){return n[t].ia.hasOwnProperty(arguments.length)||cn("Function '"+e+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+n[t].ia+")!"),n[t].ia[arguments.length].apply(this,arguments)},n[t].ia=[],n[t].ia[r.ta]=r}}function kn(n,t,r){e.hasOwnProperty(n)?((void 0===r||void 0!==e[n].ia&&void 0!==e[n].ia[r])&&cn("Cannot register public name '"+n+"' twice"),$n(e,n,n),e.hasOwnProperty(r)&&cn("Cannot register multiple overloads of a function with the same number of arguments ("+r+")!"),e[n].ia[r]=t):(e[n]=t,void 0!==r&&(e[n].lb=r))}function Wn(n,t,e,r,a,i,o,u){this.name=n,this.constructor=t,this.pa=e,this.oa=r,this.ma=a,this.Pa=i,this.wa=o,this.Ka=u,this.ab=[]}function En(n,t,e){for(;t!==e;)t.wa||cn("Expected null or instance of "+e.name+", got an instance of "+t.name),n=t.wa(n),t=t.ma;return n}function jn(n,t){return null===t?(this.Ba&&cn("null is not a valid "+this.name),0):(t.ea||cn('Cannot pass "'+rn(t)+'" as a '+this.name),t.ea.ga||cn("Cannot pass deleted object as a pointer of type "+this.name),En(t.ea.ga,t.ea.ha.fa,this.fa))}function On(n,t){if(null===t){if(this.Ba&&cn("null is not a valid "+this.name),this.ya){var e=this.Ca();return null!==n&&n.push(this.oa,e),e}return 0}if(t.ea||cn('Cannot pass "'+rn(t)+'" as a '+this.name),t.ea.ga||cn("Cannot pass deleted object as a pointer of type "+this.name),!this.xa&&t.ea.ha.xa&&cn("Cannot convert argument of type "+(t.ea.la?t.ea.la.name:t.ea.ha.name)+" to parameter type "+this.name),e=En(t.ea.ga,t.ea.ha.fa,this.fa),this.ya)switch(void 0===t.ea.ja&&cn("Passing raw pointer to smart pointer is illegal"),this.gb){case 0:t.ea.la===this?e=t.ea.ja:cn("Cannot convert argument of type "+(t.ea.la?t.ea.la.name:t.ea.ha.name)+" to parameter type "+this.name);break;case 1:e=t.ea.ja;break;case 2:if(t.ea.la===this)e=t.ea.ja;else{var r=t.clone();e=this.bb(e,Ln((function(){r.delete()}))),null!==n&&n.push(this.oa,e)}break;default:cn("Unsupporting sharing policy")}return e}function Sn(n,t){return null===t?(this.Ba&&cn("null is not a valid "+this.name),0):(t.ea||cn('Cannot pass "'+rn(t)+'" as a '+this.name),t.ea.ga||cn("Cannot pass deleted object as a pointer of type "+this.name),t.ea.ha.xa&&cn("Cannot convert argument of type "+t.ea.ha.name+" to parameter type "+this.name),En(t.ea.ga,t.ea.ha.fa,this.fa))}function Fn(n,t,e,r,a,i,o,u,c,f,s){this.name=n,this.fa=t,this.Ba=e,this.xa=r,this.ya=a,this.$a=i,this.gb=o,this.Ha=u,this.Ca=c,this.bb=f,this.oa=s,a||void 0!==t.ma?this.toWireType=On:(this.toWireType=r?jn:Sn,this.ka=null)}function Dn(n,t,r){e.hasOwnProperty(n)||tn("Replacing nonexistant public symbol"),void 0!==e[n].ia&&void 0!==r?e[n].ia[r]=t:(e[n]=t,e[n].ta=r)}var Mn=[];function Un(n,t){n=on(n);var e=Mn[t];return e||(t>=Mn.length&&(Mn.length=t+1),Mn[t]=e=j.get(t)),"function"!=typeof e&&cn("unknown function pointer with signature "+n+": "+t),e}var In=void 0;function Rn(n){var t=on(n=$t(n));return Pt(n),t}function xn(n,t){function e(n){a[n]||J[n]||(Z[n]?Z[n].forEach(e):(r.push(n),a[n]=!0))}var r=[],a={};throw t.forEach(e),new In(n+": "+r.map(Rn).join([", "]))}function Hn(n,t,e,r,a){var i=t.length;2>i&&cn("argTypes array size mismatch! Must at least get return value and 'this' types!");var o=null!==t[1]&&null!==e,u=!1;for(e=1;e<t.length;++e)if(null!==t[e]&&void 0===t[e].ka){u=!0;break}var c="void"!==t[0].name,f=i-2,s=Array(f),l=[],h=[];return function(){if(arguments.length!==f&&cn("function "+n+" called with "+arguments.length+" arguments, expected "+f+" args!"),h.length=0,l.length=o?2:1,l[0]=a,o){var e=t[1].toWireType(h,this);l[1]=e}for(var i=0;i<f;++i)s[i]=t[i+2].toWireType(h,arguments[i]),l.push(s[i]);if(i=r.apply(null,l),u)N(h);else for(var p=o?1:2;p<t.length;p++){var v=1===p?e:s[p-2];null!==t[p].ka&&t[p].ka(v)}return e=c?t[0].fromWireType(i):void 0}}function Yn(n,t){for(var e=[],r=0;r<n;r++)e.push(b[t+4*r>>2]);return e}function Vn(n,t,e){return n instanceof Object||cn(e+' with invalid "this": '+n),n instanceof t.fa.constructor||cn(e+' incompatible with "this" of type '+n.constructor.name),n.ea.ga||cn("cannot call emscripten binding method "+e+" on deleted object"),En(n.ea.ga,n.ea.ha.fa,t.fa)}var Bn=[],zn=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function qn(n){4<n&&0==--zn[n].Da&&(zn[n]=void 0,Bn.push(n))}var Nn=n=>(n||cn("Cannot use deleted val. handle = "+n),zn[n].value),Ln=n=>{switch(n){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var t=Bn.length?Bn.pop():zn.length;return zn[t]={Da:1,value:n},t}};function Gn(n,t,e){switch(t){case 0:return function(n){return this.fromWireType((e?v:d)[n])};case 1:return function(n){return this.fromWireType((e?g:m)[n>>1])};case 2:return function(n){return this.fromWireType((e?y:b)[n>>2])};default:throw new TypeError("Unknown integer type: "+n)}}function Jn(n,t){var e=J[n];return void 0===e&&cn(t+" has unknown type "+Rn(n)),e}function Zn(n,t){switch(t){case 2:return function(n){return this.fromWireType(w[n>>2])};case 3:return function(n){return this.fromWireType(_[n>>3])};default:throw new TypeError("Unknown float type: "+n)}}var Xn="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function Kn(n,t){for(var e=n>>1,r=e+t/2;!(e>=r)&&m[e];)++e;if(32<(e<<=1)-n&&Xn)return Xn.decode(d.subarray(n,e));for(e="",r=0;!(r>=t/2);++r){var a=g[n+2*r>>1];if(0==a)break;e+=String.fromCharCode(a)}return e}function Qn(n,t,e){if(void 0===e&&(e=2147483647),2>e)return 0;var r=t;e=(e-=2)<2*n.length?e/2:n.length;for(var a=0;a<e;++a)g[t>>1]=n.charCodeAt(a),t+=2;return g[t>>1]=0,t-r}function nt(n){return 2*n.length}function tt(n,t){for(var e=0,r="";!(e>=t/4);){var a=y[n+4*e>>2];if(0==a)break;++e,65536<=a?(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a)):r+=String.fromCharCode(a)}return r}function et(n,t,e){if(void 0===e&&(e=2147483647),4>e)return 0;var r=t;e=r+e-4;for(var a=0;a<n.length;++a){var i=n.charCodeAt(a);if(55296<=i&&57343>=i&&(i=65536+((1023&i)<<10)|1023&n.charCodeAt(++a)),y[t>>2]=i,(t+=4)+4>e)break}return y[t>>2]=0,t-r}function rt(n){for(var t=0,e=0;e<n.length;++e){var r=n.charCodeAt(e);55296<=r&&57343>=r&&++e,t+=4}return t}function at(n,t){for(var e=Array(n),r=0;r<n;++r)e[r]=Jn(b[t+4*r>>2],"parameter "+r);return e}var it={};function ot(n){var t=it[n];return void 0===t?on(n):t}var ut=[];function ct(){function n(n){n.$$$embind_global$$$=n;var t="object"==typeof $$$embind_global$$$&&n.$$$embind_global$$$==n;return t||delete n.$$$embind_global$$$,t}if("object"==typeof globalThis)return globalThis;if("object"==typeof $$$embind_global$$$)return $$$embind_global$$$;if("object"==typeof t&&n(t)?$$$embind_global$$$=t:"object"==typeof self&&n(self)&&($$$embind_global$$$=self),"object"==typeof $$$embind_global$$$)return $$$embind_global$$$;throw Error("unable to get global object.")}function ft(n){var t=ut.length;return ut.push(n),t}var st=[],lt={};function ht(){if(!pt){var n,t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:u||"./this.program"};for(n in lt)void 0===lt[n]?delete t[n]:t[n]=lt[n];var e=[];for(n in t)e.push(n+"="+t[n]);pt=e}return pt}var pt,vt=[null,[],[]];function dt(n){return 0==n%4&&(0!=n%100||0==n%400)}var gt=[31,29,31,30,31,30,31,31,30,31,30,31],mt=[31,28,31,30,31,30,31,31,30,31,30,31];function yt(n){var t=Array(W(n)+1);return k(n,t,0,t.length),t}function bt(n,t,e,r){function a(n,t,e){for(n="number"==typeof n?n.toString():n||"";n.length<t;)n=e[0]+n;return n}function i(n,t){return a(n,t,"0")}function o(n,t){function e(n){return 0>n?-1:0<n?1:0}var r;return 0===(r=e(n.getFullYear()-t.getFullYear()))&&0===(r=e(n.getMonth()-t.getMonth()))&&(r=e(n.getDate()-t.getDate())),r}function u(n){switch(n.getDay()){case 0:return new Date(n.getFullYear()-1,11,29);case 1:return n;case 2:return new Date(n.getFullYear(),0,3);case 3:return new Date(n.getFullYear(),0,2);case 4:return new Date(n.getFullYear(),0,1);case 5:return new Date(n.getFullYear()-1,11,31);case 6:return new Date(n.getFullYear()-1,11,30)}}function c(n){var t=n.ra;for(n=new Date(new Date(n.sa+1900,0,1).getTime());0<t;){var e=n.getMonth(),r=(dt(n.getFullYear())?gt:mt)[e];if(!(t>r-n.getDate())){n.setDate(n.getDate()+t);break}t-=r-n.getDate()+1,n.setDate(1),11>e?n.setMonth(e+1):(n.setMonth(0),n.setFullYear(n.getFullYear()+1))}return e=new Date(n.getFullYear()+1,0,4),t=u(new Date(n.getFullYear(),0,4)),e=u(e),0>=o(t,n)?0>=o(e,n)?n.getFullYear()+1:n.getFullYear():n.getFullYear()-1}var f=y[r+40>>2];for(var s in r={jb:y[r>>2],ib:y[r+4>>2],za:y[r+8>>2],Ea:y[r+12>>2],Aa:y[r+16>>2],sa:y[r+20>>2],na:y[r+24>>2],ra:y[r+28>>2],mb:y[r+32>>2],hb:y[r+36>>2],kb:f&&f?$(d,f):""},e=e?$(d,e):"",f={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})e=e.replace(new RegExp(s,"g"),f[s]);var l="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),h="January February March April May June July August September October November December".split(" ");for(s in f={"%a":function(n){return l[n.na].substring(0,3)},"%A":function(n){return l[n.na]},"%b":function(n){return h[n.Aa].substring(0,3)},"%B":function(n){return h[n.Aa]},"%C":function(n){return i((n.sa+1900)/100|0,2)},"%d":function(n){return i(n.Ea,2)},"%e":function(n){return a(n.Ea,2," ")},"%g":function(n){return c(n).toString().substring(2)},"%G":function(n){return c(n)},"%H":function(n){return i(n.za,2)},"%I":function(n){return 0==(n=n.za)?n=12:12<n&&(n-=12),i(n,2)},"%j":function(n){for(var t=0,e=0;e<=n.Aa-1;t+=(dt(n.sa+1900)?gt:mt)[e++]);return i(n.Ea+t,3)},"%m":function(n){return i(n.Aa+1,2)},"%M":function(n){return i(n.ib,2)},"%n":function(){return"\n"},"%p":function(n){return 0<=n.za&&12>n.za?"AM":"PM"},"%S":function(n){return i(n.jb,2)},"%t":function(){return"\t"},"%u":function(n){return n.na||7},"%U":function(n){return i(Math.floor((n.ra+7-n.na)/7),2)},"%V":function(n){var t=Math.floor((n.ra+7-(n.na+6)%7)/7);if(2>=(n.na+371-n.ra-2)%7&&t++,t)53==t&&(4==(e=(n.na+371-n.ra)%7)||3==e&&dt(n.sa)||(t=1));else{t=52;var e=(n.na+7-n.ra-1)%7;(4==e||5==e&&dt(n.sa%400-1))&&t++}return i(t,2)},"%w":function(n){return n.na},"%W":function(n){return i(Math.floor((n.ra+7-(n.na+6)%7)/7),2)},"%y":function(n){return(n.sa+1900).toString().substring(2)},"%Y":function(n){return n.sa+1900},"%z":function(n){var t=0<=(n=n.hb);return n=Math.abs(n)/60,(t?"+":"-")+String("0000"+(n/60*100+n%60)).slice(-4)},"%Z":function(n){return n.kb},"%%":function(){return"%"}},e=e.replace(/%%/g,"\0\0"),f)e.includes(s)&&(e=e.replace(new RegExp(s,"g"),f[s](r)));return(s=yt(e=e.replace(/\0\0/g,"%"))).length>t?0:(v.set(s,n),s.length-1)}nn=e.InternalError=Q("InternalError");for(var wt=Array(256),At=0;256>At;++At)wt[At]=String.fromCharCode(At);an=wt,un=e.BindingError=Q("BindingError"),Pn.prototype.isAliasOf=function(n){if(!(this instanceof Pn&&n instanceof Pn))return!1;var t=this.ea.ha.fa,e=this.ea.ga,r=n.ea.ha.fa;for(n=n.ea.ga;t.ma;)e=t.wa(e),t=t.ma;for(;r.ma;)n=r.wa(n),r=r.ma;return t===r&&e===n},Pn.prototype.clone=function(){if(this.ea.ga||hn(this),this.ea.va)return this.ea.count.value+=1,this;var n=Cn,t=Object,e=t.create,r=Object.getPrototypeOf(this),a=this.ea;return(n=n(e.call(t,r,{ea:{value:{count:a.count,ua:a.ua,va:a.va,ga:a.ga,ha:a.ha,ja:a.ja,la:a.la}}}))).ea.count.value+=1,n.ea.ua=!1,n},Pn.prototype.delete=function(){this.ea.ga||hn(this),this.ea.ua&&!this.ea.va&&cn("Object already scheduled for deletion"),vn(this),dn(this.ea),this.ea.va||(this.ea.ja=void 0,this.ea.ga=void 0)},Pn.prototype.isDeleted=function(){return!this.ea.ga},Pn.prototype.deleteLater=function(){return this.ea.ga||hn(this),this.ea.ua&&!this.ea.va&&cn("Object already scheduled for deletion"),yn.push(this),1===yn.length&&wn&&wn(bn),this.ea.ua=!0,this},e.getInheritedInstanceCount=function(){return Object.keys(An).length},e.getLiveInheritedInstances=function(){var n,t=[];for(n in An)An.hasOwnProperty(n)&&t.push(An[n]);return t},e.flushPendingDeletes=bn,e.setDelayFunction=function(n){wn=n,yn.length&&wn&&wn(bn)},Fn.prototype.Qa=function(n){return this.Ha&&(n=this.Ha(n)),n},Fn.prototype.Fa=function(n){this.oa&&this.oa(n)},Fn.prototype.argPackAdvance=8,Fn.prototype.readValueFromPointer=L,Fn.prototype.deleteObject=function(n){null!==n&&n.delete()},Fn.prototype.fromWireType=function(n){function t(){return this.ya?_n(this.fa.pa,{ha:this.$a,ga:e,la:this,ja:n}):_n(this.fa.pa,{ha:this,ga:n})}var e=this.Qa(n);if(!e)return this.Fa(n),null;var r=Tn(this.fa,e);if(void 0!==r)return 0===r.ea.count.value?(r.ea.ga=e,r.ea.ja=n,r.clone()):(r=r.clone(),this.Fa(n),r);if(r=this.fa.Pa(e),!(r=mn[r]))return t.call(this);r=this.xa?r.Ia:r.pointerType;var a=gn(e,this.fa,r.fa);return null===a?t.call(this):this.ya?_n(r.fa.pa,{ha:r,ga:a,la:this,ja:n}):_n(r.fa.pa,{ha:r,ga:a})},In=e.UnboundTypeError=Q("UnboundTypeError"),e.count_emval_handles=function(){for(var n=0,t=5;t<zn.length;++t)void 0!==zn[t]&&++n;return n},e.get_first_emval=function(){for(var n=5;n<zn.length;++n)if(void 0!==zn[n])return zn[n];return null};var Tt={n:function(n){return Ct(n+24)+24},m:function(n,t,e){throw new z(n).La(t,e),n},r:function(n){var t=q[n];delete q[n];var e=t.Ca,r=t.oa,a=t.Ga;en([n],a.map((n=>n.Ta)).concat(a.map((n=>n.eb))),(n=>{var i={};return a.forEach(((t,e)=>{var r=n[e],o=t.Ra,u=t.Sa,c=n[e+a.length],f=t.cb,s=t.fb;i[t.Na]={read:n=>r.fromWireType(o(u,n)),write:(n,t)=>{var e=[];f(s,n,c.toWireType(e,t)),N(e)}}})),[{name:t.name,fromWireType:function(n){var t,e={};for(t in i)e[t]=i[t].read(n);return r(n),e},toWireType:function(n,t){for(var a in i)if(!(a in t))throw new TypeError('Missing field: "'+a+'"');var o=e();for(a in i)i[a].write(o,t[a]);return null!==n&&n.push(r,o),o},argPackAdvance:8,readValueFromPointer:L,ka:r}]}))},F:function(n,t,e,r,a){t=on(t),e=ln(e);var i=-1!=t.indexOf("u");i&&(a=(1n<<64n)-1n),fn(n,{name:t,fromWireType:function(n){return n},toWireType:function(n,e){if("bigint"!=typeof e&&"number"!=typeof e)throw new TypeError('Cannot convert "'+rn(e)+'" to '+this.name);if(e<r||e>a)throw new TypeError('Passing a number "'+rn(e)+'" from JS side to C/C++ side to an argument of type "'+t+'", which is outside the valid range ['+r+", "+a+"]!");return e},argPackAdvance:8,readValueFromPointer:sn(t,e,!i),ka:null})},S:function(n,t,e,r,a){var i=ln(e);fn(n,{name:t=on(t),fromWireType:function(n){return!!n},toWireType:function(n,t){return t?r:a},argPackAdvance:8,readValueFromPointer:function(n){if(1===e)var r=v;else if(2===e)r=g;else{if(4!==e)throw new TypeError("Unknown boolean type size: "+t);r=y}return this.fromWireType(r[n>>i])},ka:null})},f:function(n,t,e,r,a,i,o,u,c,f,s,l,h){s=on(s),i=Un(a,i),u&&(u=Un(o,u)),f&&(f=Un(c,f)),h=Un(l,h);var p=X(s);kn(p,(function(){xn("Cannot construct "+s+" due to unbound types",[r])})),en([n,t,e],r?[r]:[],(function(t){if(t=t[0],r)var e=t.fa,a=e.pa;else a=Pn.prototype;t=K(p,(function(){if(Object.getPrototypeOf(this)!==o)throw new un("Use 'new' to construct "+s);if(void 0===c.qa)throw new un(s+" has no accessible constructor");var n=c.qa[arguments.length];if(void 0===n)throw new un("Tried to invoke ctor of "+s+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(c.qa).toString()+") parameters instead!");return n.apply(this,arguments)}));var o=Object.create(a,{constructor:{value:t}});t.prototype=o;var c=new Wn(s,t,o,h,e,i,u,f);e=new Fn(s,c,!0,!1,!1),a=new Fn(s+"*",c,!1,!1,!1);var l=new Fn(s+" const*",c,!1,!0,!1);return mn[n]={pointerType:a,Ia:l},Dn(p,t),[e,a,l]}))},v:function(n,t,e,r,a,i,o){var u=Yn(e,r);t=on(t),i=Un(a,i),en([],[n],(function(n){function r(){xn("Cannot call "+a+" due to unbound types",u)}var a=(n=n[0]).name+"."+t;t.startsWith("@@")&&(t=Symbol[t.substring(2)]);var c=n.fa.constructor;return void 0===c[t]?(r.ta=e-1,c[t]=r):($n(c,t,a),c[t].ia[e-1]=r),en([],u,(function(n){return n=Hn(a,[n[0],null].concat(n.slice(1)),null,i,o),void 0===c[t].ia?(n.ta=e-1,c[t]=n):c[t].ia[e-1]=n,[]})),[]}))},i:function(n,t,e,r,a,i){0<t||R();var o=Yn(t,e);a=Un(r,a),en([],[n],(function(n){var e="constructor "+(n=n[0]).name;if(void 0===n.fa.qa&&(n.fa.qa=[]),void 0!==n.fa.qa[t-1])throw new un("Cannot register multiple constructors with identical number of parameters ("+(t-1)+") for class '"+n.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return n.fa.qa[t-1]=()=>{xn("Cannot construct "+n.name+" due to unbound types",o)},en([],o,(function(r){return r.splice(1,0,null),n.fa.qa[t-1]=Hn(e,r,null,a,i),[]})),[]}))},b:function(n,t,e,r,a,i,o,u){var c=Yn(e,r);t=on(t),i=Un(a,i),en([],[n],(function(n){function r(){xn("Cannot call "+a+" due to unbound types",c)}var a=(n=n[0]).name+"."+t;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),u&&n.fa.ab.push(t);var f=n.fa.pa,s=f[t];return void 0===s||void 0===s.ia&&s.className!==n.name&&s.ta===e-2?(r.ta=e-2,r.className=n.name,f[t]=r):($n(f,t,a),f[t].ia[e-2]=r),en([],c,(function(r){return r=Hn(a,r,n,i,o),void 0===f[t].ia?(r.ta=e-2,f[t]=r):f[t].ia[e-2]=r,[]})),[]}))},c:function(n,t,e,r,a,i,o,u,c,f){t=on(t),a=Un(r,a),en([],[n],(function(n){var r=(n=n[0]).name+"."+t,s={get:function(){xn("Cannot access "+r+" due to unbound types",[e,o])},enumerable:!0,configurable:!0};return s.set=c?()=>{xn("Cannot access "+r+" due to unbound types",[e,o])}:()=>{cn(r+" is a read-only property")},Object.defineProperty(n.fa.pa,t,s),en([],c?[e,o]:[e],(function(e){var o=e[0],s={get:function(){var t=Vn(this,n,r+" getter");return o.fromWireType(a(i,t))},enumerable:!0};if(c){c=Un(u,c);var l=e[1];s.set=function(t){var e=Vn(this,n,r+" setter"),a=[];c(f,e,l.toWireType(a,t)),N(a)}}return Object.defineProperty(n.fa.pa,t,s),[]})),[]}))},R:function(n,t){fn(n,{name:t=on(t),fromWireType:function(n){var t=Nn(n);return qn(n),t},toWireType:function(n,t){return Ln(t)},argPackAdvance:8,readValueFromPointer:L,ka:null})},o:function(n,t,e,r){function a(){}e=ln(e),t=on(t),a.values={},fn(n,{name:t,constructor:a,fromWireType:function(n){return this.constructor.values[n]},toWireType:function(n,t){return t.value},argPackAdvance:8,readValueFromPointer:Gn(t,e,r),ka:null}),kn(t,a)},e:function(n,t,e){var r=Jn(n,"enum");t=on(t),n=r.constructor,r=Object.create(r.constructor.prototype,{value:{value:e},constructor:{value:K(r.name+"_"+t,(function(){}))}}),n.values[e]=r,n[t]=r},E:function(n,t,e){e=ln(e),fn(n,{name:t=on(t),fromWireType:function(n){return n},toWireType:function(n,t){return t},argPackAdvance:8,readValueFromPointer:Zn(t,e),ka:null})},W:function(n,t,e,r,a,i){var o=Yn(t,e);n=on(n),a=Un(r,a),kn(n,(function(){xn("Cannot call "+n+" due to unbound types",o)}),t-1),en([],o,(function(e){return Dn(n,Hn(n,[e[0],null].concat(e.slice(1)),null,a,i),t-1),[]}))},w:function(n,t,e,r,a){t=on(t),-1===a&&(a=4294967295),a=ln(e);var i=n=>n;if(0===r){var o=32-8*e;i=n=>n<<o>>>o}e=t.includes("unsigned")?function(n,t){return t>>>0}:function(n,t){return t},fn(n,{name:t,fromWireType:i,toWireType:e,argPackAdvance:8,readValueFromPointer:sn(t,a,0!==r),ka:null})},t:function(n,t,e){function r(n){var t=b;return new a(p,t[1+(n>>=2)],t[n])}var a=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];fn(n,{name:e=on(e),fromWireType:r,argPackAdvance:8,readValueFromPointer:r},{Wa:!0})},h:function(n,t,e,r,a,i,o,u,c,f,s,l){e=on(e),i=Un(a,i),u=Un(o,u),f=Un(c,f),l=Un(s,l),en([n],[t],(function(n){return n=n[0],[new Fn(e,n.fa,!1,!1,!0,n,r,i,u,f,l)]}))},G:function(n,t){var e="std::string"===(t=on(t));fn(n,{name:t,fromWireType:function(n){var t=b[n>>2],r=n+4;if(e)for(var a=r,i=0;i<=t;++i){var o=r+i;if(i==t||0==d[o]){if(a=a?$(d,a,o-a):"",void 0===u)var u=a;else u+=String.fromCharCode(0),u+=a;a=o+1}}else{for(u=Array(t),i=0;i<t;++i)u[i]=String.fromCharCode(d[r+i]);u=u.join("")}return Pt(n),u},toWireType:function(n,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var r="string"==typeof t;r||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||cn("Cannot pass non-string to std::string");var a=e&&r?W(t):t.length,i=Ct(4+a+1),o=i+4;if(b[i>>2]=a,e&&r)k(t,d,o,a+1);else if(r)for(r=0;r<a;++r){var u=t.charCodeAt(r);255<u&&(Pt(o),cn("String has UTF-16 code units that do not fit in 8 bits")),d[o+r]=u}else for(r=0;r<a;++r)d[o+r]=t[r];return null!==n&&n.push(Pt,i),i},argPackAdvance:8,readValueFromPointer:L,ka:function(n){Pt(n)}})},B:function(n,t,e){if(e=on(e),2===t)var r=Kn,a=Qn,i=nt,o=()=>m,u=1;else 4===t&&(r=tt,a=et,i=rt,o=()=>b,u=2);fn(n,{name:e,fromWireType:function(n){for(var e,a=b[n>>2],i=o(),c=n+4,f=0;f<=a;++f){var s=n+4+f*t;f!=a&&0!=i[s>>u]||(c=r(c,s-c),void 0===e?e=c:(e+=String.fromCharCode(0),e+=c),c=s+t)}return Pt(n),e},toWireType:function(n,r){"string"!=typeof r&&cn("Cannot pass non-string to C++ string type "+e);var o=i(r),c=Ct(4+o+t);return b[c>>2]=o>>u,a(r,c+4,o+t),null!==n&&n.push(Pt,c),c},argPackAdvance:8,readValueFromPointer:L,ka:function(n){Pt(n)}})},s:function(n,t,e,r,a,i){q[n]={name:on(t),Ca:Un(e,r),oa:Un(a,i),Ga:[]}},j:function(n,t,e,r,a,i,o,u,c,f){q[n].Ga.push({Na:on(t),Ta:e,Ra:Un(r,a),Sa:i,eb:o,cb:Un(u,c),fb:f})},T:function(n,t){fn(n,{Xa:!0,name:t=on(t),argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},l:function(n,t,e){n=Nn(n),t=Jn(t,"emval::as");var r=[],a=Ln(r);return b[e>>2]=a,t.toWireType(r,n)},z:function(n,t){return n=Nn(n),(t=Jn(t,"emval::as")).toWireType(null,n)},X:function(n,t,e,r){n=Nn(n),e=at(t,e);for(var a=Array(t),i=0;i<t;++i){var o=e[i];a[i]=o.readValueFromPointer(r),r+=o.argPackAdvance}return n=n.apply(void 0,a),Ln(n)},U:function(n,t,e,r,a){n=ut[n],t=Nn(t),e=ot(e);var i=[];return b[r>>2]=Ln(i),n(t,e,i,a)},C:function(n,t,e,r){(n=ut[n])(t=Nn(t),e=ot(e),null,r)},a:qn,H:function(n){return 0===n?Ln(ct()):(n=ot(n),Ln(ct()[n]))},A:function(n,t){var e=at(n,t),r=e[0];t=r.name+"_$"+e.slice(1).map((function(n){return n.name})).join("_")+"$";var a=st[t];if(void 0!==a)return a;var i=Array(n-1);return a=ft(((t,a,o,u)=>{for(var c=0,f=0;f<n-1;++f)i[f]=e[f+1].readValueFromPointer(u+c),c+=e[f+1].argPackAdvance;for(t=t[a].apply(t,i),f=0;f<n-1;++f)e[f+1].Ja&&e[f+1].Ja(i[f]);if(!r.Xa)return r.toWireType(o,t)})),st[t]=a},q:function(n,t){return n=Nn(n),t=Nn(t),Ln(n[t])},g:function(n){4<n&&(zn[n].Da+=1)},I:function(n,t){return(n=Nn(n))instanceof(t=Nn(t))},u:function(n){return"number"==typeof(n=Nn(n))},x:function(n){return"string"==typeof(n=Nn(n))},V:function(){return Ln([])},p:function(n){return Ln(ot(n))},k:function(n){N(Nn(n)),qn(n)},d:function(n,t){return n=(n=Jn(n,"_emval_take_value")).readValueFromPointer(t),Ln(n)},y:function(n){return n=Nn(n),Ln(typeof n)},D:function(){R("")},N:function(n,t,e){d.copyWithin(n,t,t+e)},M:function(n){var t=d.length;if(2147483648<(n>>>=0))return!1;for(var e=1;4>=e;e*=2){var r=t*(1+.2/e);r=Math.min(r,n+100663296);var a=Math;r=Math.max(n,r),a=a.min.call(a,2147483648,r+(65536-r%65536)%65536);n:{try{h.grow(a-p.byteLength+65535>>>16),E();var i=1;break n}catch(o){}i=void 0}if(i)return!0}return!1},K:function(n,t){var e=0;return ht().forEach((function(r,a){var i=t+e;for(a=b[n+4*a>>2]=i,i=0;i<r.length;++i)v[0|a++]=r.charCodeAt(i);v[0|a]=0,e+=r.length+1})),0},L:function(n,t){var e=ht();b[n>>2]=e.length;var r=0;return e.forEach((function(n){r+=n.length+1})),b[t>>2]=r,0},Q:function(){return 52},P:function(){return 70},O:function(n,t,e,r){for(var a=0,i=0;i<e;i++){var o=b[t>>2],u=b[t+4>>2];t+=8;for(var c=0;c<u;c++){var f=d[o+c],h=vt[n];0===f||10===f?((1===n?s:l)($(h,0)),h.length=0):h.push(f)}a+=u}return b[r>>2]=a,0},J:function(n,t,e,r){return bt(n,t,e,r)}};!function(){function n(n){e.asm=n.exports,h=e.asm.Y,E(),j=e.asm.ca,S.unshift(e.asm.Z),U--,e.monitorRunDependencies&&e.monitorRunDependencies(U),0==U&&I&&(n=I,I=null,n())}function t(t){n(t.instance)}function r(n){return V().then((function(n){return WebAssembly.instantiate(n,a)})).then((function(n){return n})).then(n,(function(n){l("failed to asynchronously prepare wasm: "+n),R(n)}))}var a={a:Tt};if(U++,e.monitorRunDependencies&&e.monitorRunDependencies(U),e.instantiateWasm)try{return e.instantiateWasm(a,n)}catch(o){l("Module.instantiateWasm callback failed with error: "+o),i(o)}(f||"function"!=typeof WebAssembly.instantiateStreaming||x()||"function"!=typeof fetch?r(t):fetch(M,{credentials:"same-origin"}).then((function(n){return WebAssembly.instantiateStreaming(n,a).then(t,(function(n){return l("wasm streaming compile failed: "+n),l("falling back to ArrayBuffer instantiation"),r(t)}))}))).catch(i)}(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.Z).apply(null,arguments)};var _t,Ct=e._malloc=function(){return(Ct=e._malloc=e.asm._).apply(null,arguments)},Pt=e._free=function(){return(Pt=e._free=e.asm.$).apply(null,arguments)},$t=e.___getTypeName=function(){return($t=e.___getTypeName=e.asm.aa).apply(null,arguments)};function kt(){function n(){if(!_t&&(_t=!0,e.calledRun=!0,!C)){if(B(S),a(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var n=e.postRun.shift();F.unshift(n)}B(F)}}if(!(0<U)){if(e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)D();B(O),0<U||(e.setStatus?(e.setStatus("Running..."),setTimeout((function(){setTimeout((function(){e.setStatus("")}),1),n()}),1)):n())}}if(e.__embind_initialize_bindings=function(){return(e.__embind_initialize_bindings=e.asm.ba).apply(null,arguments)},e.___cxa_is_pointer_type=function(){return(e.___cxa_is_pointer_type=e.asm.da).apply(null,arguments)},I=function n(){_t||kt(),_t||(I=n)},e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);0<e.preInit.length;)e.preInit.pop()();return kt(),n.ready},e.exports=a;const o=n(i.exports),u=Object.freeze(Object.defineProperty({__proto__:null,default:o},Symbol.toStringTag,{value:"Module"}));export{u as a};
package/interfaces.d.ts CHANGED
@@ -122208,7 +122208,6 @@ declare namespace __esri {
122208
122208
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-TableList.html#triggerAction)
122209
122209
  */
122210
122210
  triggerAction(action: ActionButton | ActionToggle, item: TableListListItem): void;
122211
- on(name: "trigger-action", eventHandler: TableListTriggerActionEventHandler): IHandle;
122212
122211
  }
122213
122212
 
122214
122213
  interface TableListProperties extends WidgetProperties {
@@ -122622,11 +122621,6 @@ declare namespace __esri {
122622
122621
 
122623
122622
  export type TableListListItemCreatedHandler = (event: any) => void;
122624
122623
 
122625
- export interface TableListTriggerActionEvent {
122626
- action: ActionButton | ActionToggle;
122627
- item: TableListListItem;
122628
- }
122629
-
122630
122624
  /**
122631
122625
  * The visible elements that are displayed within the widget.
122632
122626
  *
@@ -126872,7 +126866,6 @@ declare namespace __esri {
126872
126866
  export type SubtypeGroupLayerLayerviewCreateEventHandler = (event: SubtypeGroupLayerLayerviewCreateEvent) => void;
126873
126867
  export type SubtypeGroupLayerLayerviewDestroyEventHandler = (event: SubtypeGroupLayerLayerviewDestroyEvent) => void;
126874
126868
  export type SubtypeGroupLayerRefreshEventHandler = (event: SubtypeGroupLayerRefreshEvent) => void;
126875
- export type TableListTriggerActionEventHandler = (event: TableListTriggerActionEvent) => void;
126876
126869
  export type TableListViewModelTriggerActionEventHandler = (event: TableListViewModelTriggerActionEvent) => void;
126877
126870
  export type TileLayerLayerviewCreateErrorEventHandler = (event: TileLayerLayerviewCreateErrorEvent) => void;
126878
126871
  export type TileLayerLayerviewCreateEventHandler = (event: TileLayerLayerviewCreateEvent) => void;
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Collection.js";import i from"../core/Error.js";import o from"../core/Logger.js";import{getOrCreateMapValue as s}from"../core/MapUtils.js";import{MultiOriginJSONMixin as r}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as a}from"../core/promiseUtils.js";import{isAbsolute as n,join as p}from"../core/urlUtils.js";import{generateUUID as l}from"../core/uuid.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as h}from"../core/accessorSupport/decorators/reader.js";import{subclass as y}from"../core/accessorSupport/decorators/subclass.js";import{writer as c}from"../core/accessorSupport/decorators/writer.js";import{OriginId as m,idToName as u,nameToId as f}from"../core/accessorSupport/PropertyOrigin.js";import g from"./Layer.js";import{KnowledgeGraphLayerDataManager as w}from"./knowledgeGraph/KnowledgeGraphLayerDataManager.js";import M from"./knowledgeGraph/KnowledgeGraphSublayer.js";import{fetchAndConvertSerializedKgIdMap as b,serializeInclusionDefinitionToIdCollectionsMapPbf as T}from"./knowledgeGraph/supportUtils.js";import{ArcGISService as S}from"./mixins/ArcGISService.js";import{BlendLayer as _}from"./mixins/BlendLayer.js";import{CustomParametersMixin as D}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as L}from"./mixins/OperationalLayer.js";import{PortalLayer as j}from"./mixins/PortalLayer.js";import{RefreshableLayer as v}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as k}from"./mixins/ScaleRangeLayer.js";import{url as G}from"./support/commonProperties.js";import{fetchKnowledgeGraph as A}from"../rest/knowledgeGraphService.js";import{f as N,t as C}from"../chunks/persistableUrlUtils.js";let E=class extends(_(k(v(S(L(j(r(D(g))))))))){constructor(e){super(e),this._graphTypeLookup=new Map,this._namedTypesModified=!1,this.dataManager=null,this.definitionSetMap=null,this.knowledgeGraph=null,this.layers=new(t.ofType(M)),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="KnowledgeGraphLayer",this.sublayerIdsCache=new Map,this.tables=new(t.ofType(M)),this.type="knowledge-graph",this.url=null}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){try{await this.loadFromPortal({supportedTypes:["Knowledge Graph Layer"]},e)}catch(t){a(t)}await this._fetchMetadata(),await this._initializeLayerProperties(),this.loadLayerAssumingLocalCache()}async _fetchMetadata(){if(!this.url)throw new i("knowledge-graph:missing-url","KnowledgeGraphLayer must be created with a url");const e=await A(this.url);this.knowledgeGraph=e,this._forEachGraphType((e=>{e.name&&this._graphTypeLookup.set(e.name,e)}))}async _initializeLayerProperties(){this.originIdOf("inclusionModeDefinition")===m.USER?this._validateInclusionModeDefinition():await this._initializeInclusionModeDefinition(),this._setMemberTypes(),this.dataManager=new w({knowledgeGraph:this.knowledgeGraph,inclusionModeDefinition:this.inclusionModeDefinition})}async _initializeInclusionModeDefinition(){const e=this.definitionSetMap?await b(this.definitionSetMap,!0):{generateAllSublayers:!0,namedTypeDefinitions:new Map};[...this.layers.toArray(),...this.tables.toArray()].forEach((t=>{const i=this._graphTypeLookup.get(t.graphTypeName);i&&!e.namedTypeDefinitions.has(i.name)&&e.namedTypeDefinitions.set(i.name,{useAllData:!0})})),this.setAtOrigin("inclusionModeDefinition",e,u(this.originIdOf("definitionSetMap")))}_validateInclusionModeDefinition(){const{inclusionModeDefinition:e}=this;if(!e)return;const{namedTypeDefinitions:t}=e;if(t?.size>0)t.forEach(((e,i)=>{const s=this._graphTypeLookup.get(i);if(!s)return o.getLogger(this).warn(`A named type, ${i}, was in the inclusion list that wasn't in the data model and will be removed`),void t.delete(i);"relationship"!==s.type&&"entity"!==s.type&&(o.getLogger(this).warn(`A named type, ${i}, was in the inclusion list that wasn't properly modeled and will be removed`),t.delete(i))}));else if(!e.generateAllSublayers)throw new i("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined")}_setMemberTypes(){let e=[],t=[];const{inclusionModeDefinition:i}=this,o=i?.namedTypeDefinitions;!i||i.generateAllSublayers?(e=this.knowledgeGraph.dataModel?.entityTypes??[],t=this.knowledgeGraph.dataModel?.relationshipTypes??[]):o&&o.size>0&&o.forEach(((i,o)=>{const s=this._graphTypeLookup.get(o);switch(s?.type){case"relationship":t.push(s);break;case"entity":e.push(s)}})),this.memberEntityTypes=e,this.memberRelationshipTypes=t}_forEachGraphType(e){[...this.knowledgeGraph.dataModel?.entityTypes??[],...this.knowledgeGraph.dataModel?.relationshipTypes??[]].forEach((t=>{e(t)}))}_refreshNamedTypes(){this._namedTypesModified=!0;for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}async _handleNewRecords(e){const t=[];this.dataManager.addToLayer(e);for(const i of e)this.sublayerIdsCache.has(i.typeName)||(this.sublayerIdsCache.set(i.typeName,new Set),t.push(i.typeName)),this.sublayerIdsCache.get(i.typeName).add(i.id);for(const i of t){const e=this._graphTypeLookup.get(i);if(!e)continue;this._addSublayer(e).title=i,"entity"===e.type?this.dataManager.entityTypeNames.add(i):this.dataManager.relationshipTypeNames.add(i),this.dataManager.sublayerCaches.set(i,new Map)}this._refreshNamedTypes()}_createSublayers(e,t,i){e.forEach((e=>{const o=this._createSublayer(e);i(o)&&t.push(o),this._updateSublayerCaches(e)}))}_addSublayer(e){const t=this._createSublayer(e);return t.geometryType?this.layers.push(t):this.tables.push(t),t}_createSublayer(e){return new M({objectType:e,parentCompositeLayer:this,graphType:e.type,title:e.name})}_updateSublayers(e,t){t.forEach((t=>{t.parentCompositeLayer=this;const i=e.find((e=>e.type===t.graphType&&e.name===t.graphTypeName));i&&(t.objectType=i,t.read({title:i.name},{origin:"service"}),this._updateSublayerCaches(i))}))}_updateSublayerCaches(e){const t=this.dataManager.sublayerCaches;t.has(e.name)||t.set(e.name,new Map)}_saveUrlAsNewResource(e,t,i,o){e[t]="<pending>",i.pendingOperations.push(I(this.inclusionModeDefinition).then((s=>{const r=O(o);e[t]=r.itemRelativeUrl,i.toAdd.push({resource:r,content:{type:"blob",blob:s},compress:!1,finish:e=>{this.definitionSetMap=e.url}})})))}_displaysAllRecords(e){for(const[,{useAllData:t}]of e.namedTypeDefinitions)if(!t)return!1;return!0}readDefinitionSetMap(e,t,i){return N(e,i)}writeDefinitionSetMap(e,t,i,o){const s=o?.portalItem,r=o?.resources,a=f(o?.origin);if(!s||!r||null==a)return void(e&&(t[i]=C(e,o)));const{inclusionModeDefinition:p}=this;if(!p||this._displaysAllRecords(p))return void(this.definitionSetMap=null);const l=this.originIdOf("inclusionModeDefinition");if(l===m.USER||this._namedTypesModified||a<l)this._saveUrlAsNewResource(t,i,r,s);else if(a===l&&e){const a=C(e,o);n(a)?this._saveUrlAsNewResource(t,i,r,s):t[i]=a}}set inclusionModeDefinition(e){"loaded"!==this.loadStatus&&"failed"!==this.loadStatus?this._set("inclusionModeDefinition",e):o.getLogger(this).error("#inclusionModeDefinition","inclusionModeDefinition cannot be changed after the layer is loaded.")}loadLayerAssumingLocalCache(){const e=[...this.memberEntityTypes,...this.memberRelationshipTypes];this.originIdOf("layers")===m.DEFAULTS?this._createSublayers(e,this.layers,(e=>!!e.geometryType)):this._updateSublayers(e,this.layers),this.originIdOf("tables")===m.DEFAULTS?this._createSublayers(e,this.tables,(e=>!e.geometryType)):this._updateSublayers(e,this.tables),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach(((e,t)=>{const i=s(this.sublayerIdsCache,t,(()=>new Set));e.members?.forEach((e=>{i.add(e.id)}))}))}async addRecords(e){await this._handleNewRecords(e)}async removeRecords(e){const t=[];for(const i of e)!1===this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(i.typeName)?.useAllData&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(i.typeName)?.members?.has(i.id)&&t.push(i);this.dataManager.removeFromLayer(t);for(const i of t)this.sublayerIdsCache.get(i.typeName)?.delete(i.id);return this._refreshNamedTypes(),t}};e([d()],E.prototype,"dataManager",void 0),e([d({json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],E.prototype,"definitionSetMap",void 0),e([h("definitionSetMap")],E.prototype,"readDefinitionSetMap",null),e([c("definitionSetMap")],E.prototype,"writeDefinitionSetMap",null),e([d()],E.prototype,"inclusionModeDefinition",null),e([d()],E.prototype,"knowledgeGraph",void 0),e([d({type:t.ofType(M),json:{write:{ignoreOrigin:!0}}})],E.prototype,"layers",void 0),e([d()],E.prototype,"memberEntityTypes",void 0),e([d()],E.prototype,"memberRelationshipTypes",void 0),e([d({type:["KnowledgeGraphLayer"]})],E.prototype,"operationalLayerType",void 0),e([d()],E.prototype,"sublayerIdsCache",void 0),e([d({type:t.ofType(M),json:{write:{ignoreOrigin:!0}}})],E.prototype,"tables",void 0),e([d({json:{read:!1}})],E.prototype,"type",void 0),e([d(G)],E.prototype,"url",void 0),E=e([y("esri.layers.KnowledgeGraphLayer")],E);const R=E;async function I(e){const t=await T(e);return new Blob([t],{type:"application/x-protobuf"})}function O(e){const t=`definitionSetMap-${l()}.dat`,i=p("knowledgeGraphLayer",t);return e.resourceFromPath(i)}export{R as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Collection.js";import i from"../core/Error.js";import o from"../core/Logger.js";import{getOrCreateMapValue as s}from"../core/MapUtils.js";import{MultiOriginJSONMixin as r}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as a}from"../core/promiseUtils.js";import{isAbsolute as n,join as p}from"../core/urlUtils.js";import{generateUUID as l}from"../core/uuid.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as h}from"../core/accessorSupport/decorators/reader.js";import{subclass as y}from"../core/accessorSupport/decorators/subclass.js";import{writer as c}from"../core/accessorSupport/decorators/writer.js";import{OriginId as m,idToName as u,nameToId as f}from"../core/accessorSupport/PropertyOrigin.js";import g from"./Layer.js";import{KnowledgeGraphLayerDataManager as w}from"./knowledgeGraph/KnowledgeGraphLayerDataManager.js";import M from"./knowledgeGraph/KnowledgeGraphSublayer.js";import{initializeLayersFromClientData as b}from"./knowledgeGraph/layerUtils.js";import{fetchAndConvertSerializedKgIdMap as T,serializeInclusionDefinitionToIdCollectionsMapPbf as S}from"./knowledgeGraph/supportUtils.js";import{ArcGISService as _}from"./mixins/ArcGISService.js";import{BlendLayer as D}from"./mixins/BlendLayer.js";import{CustomParametersMixin as L}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as j}from"./mixins/OperationalLayer.js";import{PortalLayer as v}from"./mixins/PortalLayer.js";import{RefreshableLayer as k}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as G}from"./mixins/ScaleRangeLayer.js";import{url as A}from"./support/commonProperties.js";import{fetchKnowledgeGraph as N}from"../rest/knowledgeGraphService.js";import{f as C,t as E}from"../chunks/persistableUrlUtils.js";let R=class extends(D(G(k(_(j(v(r(L(g))))))))){constructor(e){super(e),this._graphTypeLookup=new Map,this._namedTypesModified=!1,this.dataManager=null,this.definitionSetMap=null,this.knowledgeGraph=null,this.layers=new(t.ofType(M)),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="KnowledgeGraphLayer",this.sublayerIdsCache=new Map,this.tables=new(t.ofType(M)),this.type="knowledge-graph",this.url=null}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){try{await this.loadFromPortal({supportedTypes:["Knowledge Graph Layer"]},e)}catch(t){a(t)}await this._fetchMetadata(),await this._initializeLayerProperties(),this.loadLayerAssumingLocalCache(),await b(this)}async _fetchMetadata(){if(!this.url)throw new i("knowledge-graph:missing-url","KnowledgeGraphLayer must be created with a url");const e=await N(this.url);this.knowledgeGraph=e,this._forEachGraphType((e=>{e.name&&this._graphTypeLookup.set(e.name,e)}))}async _initializeLayerProperties(){this.originIdOf("inclusionModeDefinition")===m.USER?this._validateInclusionModeDefinition():await this._initializeInclusionModeDefinition(),this._setMemberTypes(),this.dataManager=new w({knowledgeGraph:this.knowledgeGraph,inclusionModeDefinition:this.inclusionModeDefinition})}async _initializeInclusionModeDefinition(){const e=this.definitionSetMap?await T(this.definitionSetMap,!0):{generateAllSublayers:!0,namedTypeDefinitions:new Map};[...this.layers.toArray(),...this.tables.toArray()].forEach((t=>{const i=this._graphTypeLookup.get(t.graphTypeName);i&&!e.namedTypeDefinitions.has(i.name)&&e.namedTypeDefinitions.set(i.name,{useAllData:!0})})),this.setAtOrigin("inclusionModeDefinition",e,u(this.originIdOf("definitionSetMap")))}_validateInclusionModeDefinition(){const{inclusionModeDefinition:e}=this;if(!e)return;const{namedTypeDefinitions:t}=e;if(t?.size>0)t.forEach(((e,i)=>{const s=this._graphTypeLookup.get(i);if(!s)return o.getLogger(this).warn(`A named type, ${i}, was in the inclusion list that wasn't in the data model and will be removed`),void t.delete(i);"relationship"!==s.type&&"entity"!==s.type&&(o.getLogger(this).warn(`A named type, ${i}, was in the inclusion list that wasn't properly modeled and will be removed`),t.delete(i))}));else if(!e.generateAllSublayers)throw new i("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined")}_setMemberTypes(){let e=[],t=[];const{inclusionModeDefinition:i}=this,o=i?.namedTypeDefinitions;!i||i.generateAllSublayers?(e=this.knowledgeGraph.dataModel?.entityTypes??[],t=this.knowledgeGraph.dataModel?.relationshipTypes??[]):o&&o.size>0&&o.forEach(((i,o)=>{const s=this._graphTypeLookup.get(o);switch(s?.type){case"relationship":t.push(s);break;case"entity":e.push(s)}})),this.memberEntityTypes=e,this.memberRelationshipTypes=t}_forEachGraphType(e){[...this.knowledgeGraph.dataModel?.entityTypes??[],...this.knowledgeGraph.dataModel?.relationshipTypes??[]].forEach((t=>{e(t)}))}_refreshNamedTypes(){this._namedTypesModified=!0;for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}async _handleNewRecords(e){const t=[];this.dataManager.addToLayer(e);for(const i of e)this.sublayerIdsCache.has(i.typeName)||(this.sublayerIdsCache.set(i.typeName,new Set),t.push(i.typeName)),this.sublayerIdsCache.get(i.typeName).add(i.id);for(const i of t){const e=this._graphTypeLookup.get(i);e&&(this._addSublayer(e),"entity"===e.type?this.dataManager.entityTypeNames.add(i):this.dataManager.relationshipTypeNames.add(i),this.dataManager.sublayerCaches.set(i,new Map))}await b(this,t),this._refreshNamedTypes()}_createSublayers(e,t,i){e.forEach((e=>{const o=this._createSublayer(e);i(o)&&t.push(o),this._updateSublayerCaches(e)}))}_addSublayer(e){const t=this._createSublayer(e);return t.geometryType?this.layers.push(t):this.tables.push(t),t}_createSublayer(e){return new M({objectType:e,parentCompositeLayer:this,graphType:e.type})}_updateSublayers(e,t){t.forEach((t=>{t.parentCompositeLayer=this;const i=e.find((e=>e.type===t.graphType&&e.name===t.graphTypeName));i&&(t.objectType=i,this._updateSublayerCaches(i))}))}_updateSublayerCaches(e){const t=this.dataManager.sublayerCaches;t.has(e.name)||t.set(e.name,new Map)}_saveUrlAsNewResource(e,t,i,o){e[t]="<pending>",i.pendingOperations.push(U(this.inclusionModeDefinition).then((s=>{const r=O(o);e[t]=r.itemRelativeUrl,i.toAdd.push({resource:r,content:{type:"blob",blob:s},compress:!1,finish:e=>{this.definitionSetMap=e.url}})})))}_displaysAllRecords(e){for(const[,{useAllData:t}]of e.namedTypeDefinitions)if(!t)return!1;return!0}readDefinitionSetMap(e,t,i){return C(e,i)}writeDefinitionSetMap(e,t,i,o){const s=o?.portalItem,r=o?.resources,a=f(o?.origin);if(!s||!r||null==a)return void(e&&(t[i]=E(e,o)));const{inclusionModeDefinition:p}=this;if(!p||this._displaysAllRecords(p))return void(this.definitionSetMap=null);const l=this.originIdOf("inclusionModeDefinition");if(l===m.USER||this._namedTypesModified||a<l)this._saveUrlAsNewResource(t,i,r,s);else if(a===l&&e){const a=E(e,o);n(a)?this._saveUrlAsNewResource(t,i,r,s):t[i]=a}}set inclusionModeDefinition(e){"loaded"!==this.loadStatus&&"failed"!==this.loadStatus?this._set("inclusionModeDefinition",e):o.getLogger(this).error("#inclusionModeDefinition","inclusionModeDefinition cannot be changed after the layer is loaded.")}loadLayerAssumingLocalCache(){const e=[...this.memberEntityTypes,...this.memberRelationshipTypes];this.originIdOf("layers")===m.DEFAULTS?this._createSublayers(e,this.layers,(e=>!!e.geometryType)):this._updateSublayers(e,this.layers),this.originIdOf("tables")===m.DEFAULTS?this._createSublayers(e,this.tables,(e=>!e.geometryType)):this._updateSublayers(e,this.tables),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach(((e,t)=>{const i=s(this.sublayerIdsCache,t,(()=>new Set));e.members?.forEach((e=>{i.add(e.id)}))}))}async addRecords(e){await this._handleNewRecords(e)}async removeRecords(e){const t=[];for(const i of e)!1===this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(i.typeName)?.useAllData&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(i.typeName)?.members?.has(i.id)&&t.push(i);this.dataManager.removeFromLayer(t);for(const i of t)this.sublayerIdsCache.get(i.typeName)?.delete(i.id);return this._refreshNamedTypes(),t}};e([d()],R.prototype,"dataManager",void 0),e([d({json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],R.prototype,"definitionSetMap",void 0),e([h("definitionSetMap")],R.prototype,"readDefinitionSetMap",null),e([c("definitionSetMap")],R.prototype,"writeDefinitionSetMap",null),e([d()],R.prototype,"inclusionModeDefinition",null),e([d()],R.prototype,"knowledgeGraph",void 0),e([d({type:t.ofType(M),json:{write:{ignoreOrigin:!0}}})],R.prototype,"layers",void 0),e([d()],R.prototype,"memberEntityTypes",void 0),e([d()],R.prototype,"memberRelationshipTypes",void 0),e([d({type:["KnowledgeGraphLayer"]})],R.prototype,"operationalLayerType",void 0),e([d()],R.prototype,"sublayerIdsCache",void 0),e([d({type:t.ofType(M),json:{write:{ignoreOrigin:!0}}})],R.prototype,"tables",void 0),e([d({json:{read:!1}})],R.prototype,"type",void 0),e([d(A)],R.prototype,"url",void 0),R=e([y("esri.layers.KnowledgeGraphLayer")],R);const I=R;async function U(e){const t=await S(e);return new Blob([t],{type:"application/x-protobuf"})}function O(e){const t=`definitionSetMap-${l()}.dat`,i=p("knowledgeGraphLayer",t);return e.resourceFromPath(i)}export{I as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import"../geometry.js";import t from"../core/Collection.js";import a from"../core/Error.js";import i from"../core/Logger.js";import{getOrCreateMapValue as n}from"../core/MapUtils.js";import{throwIfAborted as o}from"../core/promiseUtils.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";import l from"./Layer.js";import{convertFromGeometry as h}from"./graphics/featureConversionUtils.js";import d from"./graphics/OptimizedGeometry.js";import{IdealEdgeLengthTypeOptions as p}from"./knowledgeGraph/IdealEdgeLengthTypeOptions.js";import{KnowledgeGraphLayerDataManager as u,mockOidFieldName as c,mockOriginIdFieldName as y,mockDestinationIdFieldName as g,mockLayoutGeometryFieldName as m,mockAggregationCountFieldName as f}from"./knowledgeGraph/KnowledgeGraphLayerDataManager.js";import L from"./knowledgeGraph/KnowledgeGraphSublayer.js";import{getRelationshipEndNodeIds as C}from"./knowledgeGraph/supportUtils.js";import{BlendLayer as k}from"./mixins/BlendLayer.js";import{ScaleRangeLayer as w}from"./mixins/ScaleRangeLayer.js";import{LCChronologicalLayout as M,LCSimpleLayout as b,LCSmartTreeLayout as T,LCRadialTreeLayout as E,LCHierarchicalLayout as D,LCCommunityLayout as N,LCForceDirectedLayout as x,NodeFlag as I,load as R,LinkType as v}from"../libs/linkchartlayout/LinkChartLayout.js";import{fetchKnowledgeGraph as A}from"../rest/knowledgeGraphService.js";import G from"../geometry/Extent.js";import _ from"../geometry/Point.js";import O from"../geometry/Polyline.js";let j=class extends(k(w(l))){constructor(e){if(super(e),this.dataPreloadedInLocalCache=!1,this.defaultLinkChartConfig=null,this._currentLinkChartConfig={layoutMode:"RADIAL_TREE"},this._graphTypeLookup=new Map,this.dataManager=null,this.knowledgeGraph=null,this.layers=new t,this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map,this.linkChartExtent=new G({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7}),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.sublayerIdsCache=new Map,this.tables=new t,this.type="link-chart",this.chronologicalAuxiliaryGraphics=null,this._originalInclusionList=e.inclusionModeDefinition,e.dataPreloadedInLocalCache&&!e.inclusionModeDefinition)throw new a("knowledge-graph:linkchart-layer-constructor","If creating a link chart composite layer and configured that data is already loaded in the cache, you must specify an inclusion list so the Composite Layer knows what records belong to it")}normalizeCtorArgs(e){return{url:e.url,title:e.title,dataPreloadedInLocalCache:e.dataPreloadedInLocalCache,defaultLinkChartConfig:e.defaultLinkChartConfig}}_initializeLayerProperties(e){if(!this.title&&this.url){const e=this.url.split("/");this.title=e[e.length-2]}const t=new Set;let n=[],o=[];if(e.inclusionModeDefinition&&(!e.inclusionModeDefinition.namedTypeDefinitions||e.inclusionModeDefinition.namedTypeDefinitions.size<1))throw new a("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined");e.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&this._graphTypeLookup.set(e.name,e)})),e.knowledgeGraph.dataModel.relationshipTypes?.forEach((e=>{e.name&&this._graphTypeLookup.set(e.name,e)})),e.inclusionModeDefinition?.generateAllSublayers?(n=e.knowledgeGraph.dataModel.entityTypes??[],o=e.knowledgeGraph.dataModel.relationshipTypes??[]):e.inclusionModeDefinition?.namedTypeDefinitions&&e.inclusionModeDefinition?.namedTypeDefinitions.size>0?e.inclusionModeDefinition?.namedTypeDefinitions.forEach(((a,s)=>{const r=this._graphTypeLookup.get(s);if(!r)return i.getLogger(this).warn(`A named type, ${s}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(s);"relationship"===r.type?t.has(s)||(t.add(s),o.push(r)):"entity"===r.type?t.has(s)||(t.add(s),n.push(r)):(i.getLogger(this).warn(`A named type, ${s}, was in the inclusion list that wasn't properly modeled and will be removed`),e.inclusionModeDefinition?.namedTypeDefinitions.delete(s))})):(n=e.knowledgeGraph.dataModel.entityTypes??[],o=e.knowledgeGraph.dataModel.relationshipTypes??[]);const s=new u({knowledgeGraph:e.knowledgeGraph,inclusionModeDefinition:e.inclusionModeDefinition});this.knowledgeGraph=e.knowledgeGraph,this.memberEntityTypes=n,this.memberRelationshipTypes=o,this.dataManager=s}load(e){return this.addResolvingPromise(new Promise((t=>{A(this.url).then((a=>{if(this._initializeLayerProperties({knowledgeGraph:a,inclusionModeDefinition:this._originalInclusionList}),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.size||(this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map},this.dataManager.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})})),this.dataManager.knowledgeGraph.dataModel.relationshipTypes?.forEach((e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})}))),this.dataPreloadedInLocalCache)this.loadLayerAssumingLocalCache(),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach((e=>{e.useAllData=!1,e.members?.forEach((e=>{let t;t=e.linkChartLocation instanceof d?e.linkChartLocation:e.linkChartLocation?h(e.linkChartLocation):null,t&&2===t.coords.length&&0===t.lengths.length?this.entityLinkChartDiagramLookup.set(e.id,t):this.relationshipLinkChartDiagramLookup.set(e.id,t)})),this.addResolvingPromise(this._initializeDiagram().then((async()=>{this.layers.forEach((async e=>{await e.refreshCachedQueryEngine()})),this.tables.forEach((async e=>{await e.refreshCachedQueryEngine()}))})))}));else{const t="GEOGRAPHIC"===this.defaultLinkChartConfig?.layoutMode;this.addResolvingPromise(this.dataManager.refreshCacheContent(void 0,!1,t,!0).then((async()=>{o(e);const t=[],a=[];this.loadLayerAssumingLocalCache(),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1,this.dataManager.inclusionModeDefinition.namedTypeDefinitions.forEach((e=>{e.useAllData=!1}))),await this._initializeDiagram(),this.layers.forEach((e=>{a.push(e.refreshCachedQueryEngine()),t.push(new Promise((t=>{e.on("layerview-create",(()=>{t(null)}))})))})),this.tables.forEach((e=>{a.push(e.refreshCachedQueryEngine())})),await Promise.all(a)})))}t(null)}))}))),Promise.resolve(this)}async addRecords(e,t){let a=[];t?.cascadeAddRelationshipEndNodes&&this.dataManager.knowledgeGraph.dataModel&&(a=await C(e,this.dataManager.knowledgeGraph));const i=e.concat(a).filter((e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id)));await this._handleNewRecords(i)}async removeRecords(e,{cascadeRemoveRelationships:t=!0,recalculateLayout:a=!1}={cascadeRemoveRelationships:!0,recalculateLayout:!1}){let i=[];for(const o of e)!1===this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(o.typeName)?.useAllData&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(o.typeName)?.members?.has(o.id)&&i.push(o);if(t){const e=new Set,t=[];for(const a of i)if(this.dataManager.nodeConnectionsLookup.has(a.id))for(const t of this.dataManager.nodeConnectionsLookup.get(a.id))e.add(t);for(const a of e)if(this.dataManager.memberIdTypeLookup.has(a))for(const e of this.dataManager.memberIdTypeLookup.get(a))this.dataManager.relationshipTypeNames.has(e)&&t.push({id:a,typeName:e});i=i.concat(t)}this.dataManager.removeFromLayer(i);for(const o of i)this.sublayerIdsCache.get(o.typeName)?.delete(o.id),this.dataManager.relationshipTypeNames.has(o.typeName)?this.relationshipLinkChartDiagramLookup.delete(o.id):this.entityLinkChartDiagramLookup.delete(o.id);a&&await this._calculateLayoutWithSublayerTimeInfo(this._currentLinkChartConfig.layoutMode,this._currentLinkChartConfig.layoutOptions);const n=[];return this.layers.forEach((e=>{n.push(e.refreshCachedQueryEngine())})),await Promise.all(n),this._refreshNamedTypes(),i}async expand(e,t){const a=await this.dataManager.getConnectedRecordIds(e,t),i=a.filter((e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id)));return await this._handleNewRecords(a),{records:i}}loadLayerAssumingLocalCache(){this.memberRelationshipTypes.forEach((e=>{const t=new L({objectType:e,parentCompositeLayer:this,graphType:"relationship",title:e.name});t.geometryType?this.layers.push(t):this.tables.push(t),this.dataManager.sublayerCaches.has(e.name)||this.dataManager.sublayerCaches.set(e.name,new Map)})),this.memberEntityTypes.forEach((e=>{const t=new L({objectType:e,parentCompositeLayer:this,graphType:"entity",title:e.name});t.geometryType?this.layers.push(t):this.tables.push(t),this.dataManager.sublayerCaches.has(e.name)||this.dataManager.sublayerCaches.set(e.name,new Map)})),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach(((e,t)=>{const a=n(this.sublayerIdsCache,t,(()=>new Set));e.members?.forEach((e=>{if(a.add(e.id),e.linkChartLocation)if(e.linkChartLocation instanceof d)this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(e.id,e.linkChartLocation):this.entityLinkChartDiagramLookup.set(e.id,e.linkChartLocation);else{const a=h(e.linkChartLocation);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(e.id,e.linkChartLocation?a:null):this.entityLinkChartDiagramLookup.set(e.id,e.linkChartLocation?a:null)}}))}))}async calculateLinkChartLayout(e="RADIAL_TREE",t){const n=[],o=[],s=[];this.dataManager.sublayerCaches.forEach(((e,t)=>{this.dataManager.entityTypeNames.has(t)?e.forEach((e=>{n.push({typeName:t,feature:e})})):this.dataManager.relationshipTypeNames.has(t)&&e.forEach((e=>{o.push({typeName:t,feature:e})}))})),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map;const r=new Map,l=new Map,d=new Map,p=new Map,u=new Uint8Array(n.length),L=new Float64Array(n.length),C=new Float64Array(n.length),k=new Float64Array(n.length),w=new Float64Array(n.length),A=new Uint32Array(o.length),j=new Uint32Array(o.length),P=new Float64Array(o.length),S=new Float64Array(o.length),F=[],B="FORCE_DIRECTED",H=new G({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7});let z,U="FORCE_DIRECTED",Q=0,W=0;const K=M.apply;switch(U="GEOGRAPHIC"===e?B:e,U){case"FORCE_DIRECTED":z=x.apply;break;case"COMMUNITY":z=N.apply;break;case"HIERARCHICAL":z=D.apply;break;case"RADIAL_TREE":z=E.apply;break;case"SMART_TREE":z=T.apply;break;default:z=b.apply}let Y=!1;n.forEach((({typeName:a,feature:i})=>{if("CHRONOLOGICAL"!==e&&t?.lockedNodeLocations?.has(i.attributes[c])){"GEOGRAPHIC"===e&&this.dataManager.geographicLookup.has(a)?u[Q]=I.IsGeographic:u[Q]=I.None;const n=t.lockedNodeLocations.get(i.attributes[c]);L[Q]=n.x,C[Q]=n.y}else if("GEOGRAPHIC"===e&&this.dataManager.geographicLookup.has(a)){u[Q]=I.IsGeographic;let e=null;const t=i.attributes[this.dataManager.geographicLookup.get(a).name],n=this.dataManager.geographicLookup.get(a)?.geometryType;switch(n){case"esriGeometryPoint":L[Q]=t?.x,C[Q]=t?.y;break;case"esriGeometryPolygon":e=t?.centroid,null!=e?.x&&null!=e?.y?(L[Q]=e.x,C[Q]=e.y):u[Q]=I.IsMovable;break;case"esriGeometryPolyline":case"esriGeometryMultipoint":e=t?.extent?.center,null!=e?.x&&null!=e?.y?(L[Q]=e.x,C[Q]=e.y):u[Q]=I.IsMovable;break;default:u[Q]=I.IsMovable}(null==L[Q]||null==C[Q]||Number.isNaN(L[Q])||Number.isNaN(C[Q]))&&(u[Q]=I.IsMovable,L[Q]=0,C[Q]=0)}else if("CHRONOLOGICAL"===e){!Y&&t?.lockedNodeLocations?.has(i.attributes[c])&&(Y=!0);const e=t?.timeInfoByTypeName?.get(a),n=e?.startField,o=n&&e?.startField?i.attributes[n]:null;k[Q]=o?new Date(o).getTime():NaN;const s=e?.endField,r=s&&e?.endField?i.attributes[s]:null;w[Q]=r?new Date(r).getTime():NaN,L[Q]=0,C[Q]=0,u[Q]=I.IsMovable}else u[Q]=I.IsMovable,L[Q]=0,C[Q]=0;p.set(i.attributes[c],Q),F[Q]={feature:i,typeName:a},Q++})),Y&&i.getLogger(this).warn("Locked node locations are not supported for chronological layout at this time. Requested node locations were ignored");let $=!1;const q=new Map;o.forEach((a=>{const i=a.feature.attributes[y],n=a.feature.attributes[g],o=p.get(i),r=p.get(n),l=t?.timeInfoByTypeName?.get(a.typeName),h=t?.timeInfoByTypeName?l?.startField:null,d=h?a.feature.attributes[h]:null,u=l?.endField,c=u?a.feature.attributes[u]:null;if(void 0!==o&&void 0!==r){let t=i+"-"+n;"CHRONOLOGICAL"===e&&(t=t+"-"+d+"-"+c);const l=q.get(t),h=l?.has(a.typeName);h||(A[W]=o,j[W]=r,"CHRONOLOGICAL"===e&&(P[W]=d?new Date(d).getTime():NaN,S[W]=c?new Date(c).getTime():NaN),void 0===l?q.set(t,new Map([[a.typeName,W]])):l.set(a.typeName,W),W++),s.push(a)}else $=!0,this.relationshipLinkChartDiagramLookup.set(i,null)})),$&&i.getLogger(this).warn("A relationship is a member of this layer that has either origin or destination entity nodes that are not members. The diagram geometry will be set to null");const J=this._validateLayoutSettings(e,t),V=this._convertLayoutSettingsToCalculationSettings(J);await R();let X=!1,Z=null;if("CHRONOLOGICAL"===e){const e=!0;let t;({success:X,links:Z,graphics:t}=K(u,L,C,k,w,A.subarray(0,W),j.subarray(0,W),P.subarray(0,W),S.subarray(0,W),e,{})),X&&(this.chronologicalAuxiliaryGraphics=t)}else({success:X,links:Z}=z(u,L,C,A.subarray(0,W),j.subarray(0,W),V.computationBudgetTime,V.idealEdgeLengthMultiplier,V.repulsionRadiusMultiplier));if(!X)throw new a("knowledge-graph:layout-failed","Attempting to arrange the records in the specified layout failed");for(let a=0;a<F.length;a++){if(C[a]>84.9999?C[a]=84.9999:C[a]<-84.9999&&(C[a]=-84.9999),L[a]>179.9999?L[a]=179.9999:L[a]<-179.9999&&(L[a]=-179.9999),F[a].feature.attributes[m]=new _(L[a],C[a]),r.has(F[a].typeName)){const e=r.get(F[a].typeName);e?.set(F[a].feature.attributes[c],F[a].feature)}else{const e=new Map;e.set(F[a].feature.attributes[c],F[a].feature),r.set(F[a].typeName,e)}d.set(F[a].feature.attributes[c],F[a].feature);const e=h(F[a].feature.attributes[m]);this.entityLinkChartDiagramLookup.set(F[a].feature.attributes[c],F[a].feature.attributes[m]?e:null),F[a].feature.attributes[m].x<H.xmin&&(H.xmin=F[a].feature.attributes[m].x),F[a].feature.attributes[m].x>H.xmax&&(H.xmax=F[a].feature.attributes[m].x),F[a].feature.attributes[m].y<H.ymin&&(H.ymin=F[a].feature.attributes[m].y),F[a].feature.attributes[m].y>H.ymax&&(H.ymax=F[a].feature.attributes[m].y)}if(this.linkChartExtent.xmin=H.xmin,this.linkChartExtent.xmax=H.xmax,this.linkChartExtent.ymin=H.ymin,this.linkChartExtent.ymax=H.ymax,!Z)throw new a("knowledge-graph:layout-failed","Attempting to retrieve link geometry from diagram engine failed");const ee=new Map,te=new Map,ae=new Map,ie=new Set;for(let a=0;a<s.length;a++){const n=[],o=s[a],r=o.feature.attributes[y],u=o.feature.attributes[g];let f=r+"-"+u;if("CHRONOLOGICAL"===e){const e=t?.timeInfoByTypeName?.get(o.typeName),a=t?.timeInfoByTypeName?e?.startField:null,i=a?o.feature.attributes[a]:null,n=e?.endField;f+="-"+i+"-"+(n?o.feature.attributes[n]:null)}const L=q.get(f).get(o.typeName),C=0===L?0:Z?.vertexEndIndex[L-1];if(!ie.has(L)){if(ie.add(L),Z.types[L]===v.Recursive){const e=[Z.vertices[2*C],Z.vertices[2*C+1]],t=[Z.vertices[2*(C+1)],Z.vertices[2*(C+1)+1]],a=[.5*(e[0]+t[0]),.5*(e[1]+t[1])],i=[a[0]-e[0],a[1]-e[1]],o=[a[0]+i[1],a[1]-i[0]],s=[a[0]-i[1],a[1]+i[0]];n.push(e),n.push(o),n.push(t),n.push(s),n.push(e)}else{if(Z.types[L]!==v.Regular){i.getLogger(this).warn("A relationship generated an unsupported link geometry type. It will not be rendered");continue}for(let e=C;e<Z.vertexEndIndex[L];e++)n.push([Z.vertices[2*e],Z.vertices[2*e+1]])}if("CHRONOLOGICAL"!==e){const e=F[p.get(r)]?.feature.attributes[m],t=F[p.get(u)]?.feature.attributes[m];n[0][0]===e.x&&n[0][1]===e.y||(n[0]=[e.x,e.y]),n[n.length-1][0]===t.x&&n[n.length-1][1]===t.y||(n[n.length-1]=[t.x,t.y])}for(let e=1;e<n.length-1;e++)n[e][1]>85.5?n[e][1]=85.5:n[e][1]<-85.5&&(n[e][1]=-85.5),n[e][0]>179.9999?n[e][0]=179.9999:n[e][0]<-179.9999&&(n[e][0]=-179.9999);ee.has(f)?ee.get(f).push(n):ee.set(f,[n])}const k=ee.get(f);te.has(f)||(te.set(f,new Map),ae.set(f,new Map));const w=te.get(f),M=ae.get(f);w.has(o.typeName)||(w.set(o.typeName,k.shift()),M.set(o.typeName,0));const b=w.get(o.typeName);M.set(o.typeName,M.get(o.typeName)+1);const T=new O({paths:[b]});if(o.feature.attributes[m]=T,l.has(o.typeName)){const e=l.get(o.typeName);e?.set(o.feature.attributes[c],o.feature)}else{const e=new Map;e.set(o.feature.attributes[c],o.feature),l.set(o.typeName,e)}d.set(o.feature.attributes[c],o.feature);const E=h(o.feature.attributes[m]);this.relationshipLinkChartDiagramLookup.set(o.feature.attributes[c],o.feature.attributes[m]?E:null)}for(const a of s)a.feature.attributes[f]=ae.get(a.feature.attributes[y]+"-"+a.feature.attributes[g])?.get(a.typeName)??null;return this._currentLinkChartConfig={layoutMode:e,layoutOptions:J},{nodes:r,links:l,idMap:d}}async applyNewLinkChartLayout(e="RADIAL_TREE",t){const a=[];await this._calculateLayoutWithSublayerTimeInfo(e,t),this.layers.forEach((e=>{a.push(e.refreshCachedQueryEngine())})),await Promise.all(a),this._refreshNamedTypes()}getCurrentNodeLocations(){const e=new Map;return this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((t=>{t?.members?.forEach((t=>{const a=t.linkChartLocation;let i;const n=t.id;a&&(i="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]},e.set(n,new _({x:i.x,y:i.y})))}))})),e}async synchronizeInclusionListWithCache(){return new Promise((e=>{this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach(((e,t)=>{if(e.useAllData=!1,e.members&&e.members.size>0){if(!this.dataManager.sublayerCaches.get(t))return;const a=new Set(Array.from(this.dataManager.sublayerCaches.get(t).keys()));Array.from(e.members.keys()).filter((e=>!a.has(e))).forEach((t=>{e.members?.delete(t)}))}})),e()}))}async refreshLinkChartCache(e){await this.dataManager.refreshCacheContent(e);const t=[];this.layers.forEach((e=>{t.push(e.refreshCachedQueryEngine())})),await Promise.all(t),this._refreshNamedTypes()}async connectBetweenEntities(e){let t=[];for(const i of this.dataManager.relationshipTypeNames){const e=this.sublayerIdsCache.get(i);e&&(t=t.concat(Array.from(e.keys())))}const a=await this.dataManager.getRelationshipsBetweenNodes(e,t);return await this._handleNewRecords(a),{records:a}}async connectFromEntities(e){let t=[];for(const n of this.dataManager.relationshipTypeNames){const e=this.sublayerIdsCache.get(n);e&&(t=t.concat(Array.from(e.keys())))}let a=[];for(const n of this.dataManager.entityTypeNames){const e=this.sublayerIdsCache.get(n);e&&(a=a.concat(Array.from(e)))}const i=await this.dataManager.getRelationshipsFromNodes(e,a,t);return await this._handleNewRecords(i),{records:i}}getCurrentLayout(){return this._currentLinkChartConfig.layoutMode}async _calculateLayoutWithSublayerTimeInfo(e="RADIAL_TREE",t){const a=new Map;this.layers.forEach((e=>{a.set(e.objectType.name,e.timeInfo)})),await this.calculateLinkChartLayout(e,{timeInfoByTypeName:a,...t})}async _handleNewRecords(e){const t=[];this.dataManager.addToLayer(e);for(const i of e)this.sublayerIdsCache.has(i.typeName)||(this.sublayerIdsCache.set(i.typeName,new Set),t.push(i.typeName)),this.sublayerIdsCache.get(i.typeName).add(i.id);for(const i of t){const e=this._graphTypeLookup.get(i);if(e){const t=new L({objectType:e,parentCompositeLayer:this,graphType:e.type,title:i});"entity"===e.type?this.dataManager.entityTypeNames.add(i):this.dataManager.relationshipTypeNames.add(i),t.geometryType?this.layers.push(t):this.tables.push(t),this.dataManager.sublayerCaches.set(i,new Map)}}await this.dataManager.refreshCacheContent(e.map((e=>e.id)));const a=Object.assign({},this._currentLinkChartConfig.layoutOptions);a.lockedNodeLocations=new Map;for(const[i,n]of this.entityLinkChartDiagramLookup.entries())n&&a.lockedNodeLocations.set(i,new _(n.coords[0],n.coords[1]));await this.applyNewLinkChartLayout(this._currentLinkChartConfig.layoutMode,a)}async _initializeDiagram(){this.defaultLinkChartConfig?this.defaultLinkChartConfig.doNotRecalculateLayout?(this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach(((e,t)=>{e?.members?.forEach((e=>{const a=e.linkChartLocation;let i;const n=e.id;if(!a)return;i="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]};const o=h(i);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(n,o):this.entityLinkChartDiagramLookup.set(n,o),this.linkChartExtent.xmin>i.x&&(this.linkChartExtent.xmin=i.x),this.linkChartExtent.xmax<i.x&&(this.linkChartExtent.xmax=i.x),this.linkChartExtent.ymin>i.y&&(this.linkChartExtent.ymin=i.y),this.linkChartExtent.ymax<i.y&&(this.linkChartExtent.ymax=i.y)}))})),this.memberRelationshipTypes.forEach((e=>{e.name&&this.dataManager.sublayerCaches.get(e.name)?.forEach((e=>{const t=this.relationshipLinkChartDiagramLookup.get(e.attributes[y]),a=this.relationshipLinkChartDiagramLookup.get(e.attributes[g]);if(t&&a){const i=h(new O({paths:[[[t.coords[0],t.coords[1]],[a.coords[0],a.coords[1]]]]}));this.relationshipLinkChartDiagramLookup.set(e.attributes[c],i)}else this.relationshipLinkChartDiagramLookup.set(e.attributes[c],null)}))}))):await this._calculateLayoutWithSublayerTimeInfo(this.defaultLinkChartConfig.layoutMode,{lockedNodeLocations:this.getCurrentNodeLocations(),...this.defaultLinkChartConfig.layoutOptions||{}}):await this._calculateLayoutWithSublayerTimeInfo("RADIAL_TREE",{lockedNodeLocations:this.getCurrentNodeLocations()})}_refreshNamedTypes(){for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}_validateLayoutSettings(e,t){const a=e=>"number"==typeof e&&!isNaN(e),n=e=>a(e)&&e>=1,o=e=>a(e)&&e>=1,s=e=>Object.values(p).includes(e),r=e=>a(e)&&e>=0,l=new Set(["FORCE_DIRECTED","COMMUNITY","GEOGRAPHIC"]),h={};if(!l.has(e)||!t)return!l.has(e)&&t&&i.getLogger(this).warn("Layout mode options were given for a layout mode that does not utilize them, settings will be ignored"),h;const{computationBudgetTime:d,repulsionRadiusMultiplier:u,idealEdgeLength:c,idealEdgeLengthType:y}=t;o(d)?h.computationBudgetTime=d:void 0!==d&&i.getLogger(this).warn("Invalid layout computationBudgetTime setting, will revert to default setting"),n(u)?h.repulsionRadiusMultiplier=u:void 0!==u&&i.getLogger(this).warn("Invalid layout repulsionRadiusMultiplier setting, will revert to default setting");const g=void 0!==c||void 0!==y;return"GEOGRAPHIC"!==e&&g?i.getLogger(this).warn("Ideal edge length settings were specified for an incompatible layout mode, and will be ignored"):"GEOGRAPHIC"===e&&g&&(s(y)?h.idealEdgeLengthType=y:void 0!==y&&i.getLogger(this).warn('Invalid layout idealEdgeLengthType setting, will revert to "multiplier" setting'),r(c)?h.idealEdgeLength=c:void 0!==c&&i.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting")),h}_convertLayoutSettingsToCalculationSettings(e){let t=e.idealEdgeLength;return e.idealEdgeLengthType===p.ABSOLUTE&&(void 0===t?t=-1:t*=-1),{computationBudgetTime:e.computationBudgetTime,repulsionRadiusMultiplier:e.repulsionRadiusMultiplier,idealEdgeLengthMultiplier:t}}};e([s()],j.prototype,"dataPreloadedInLocalCache",void 0),e([s()],j.prototype,"defaultLinkChartConfig",void 0),e([s()],j.prototype,"dataManager",void 0),e([s()],j.prototype,"knowledgeGraph",void 0),e([s()],j.prototype,"layers",void 0),e([s()],j.prototype,"entityLinkChartDiagramLookup",void 0),e([s()],j.prototype,"relationshipLinkChartDiagramLookup",void 0),e([s()],j.prototype,"linkChartExtent",void 0),e([s()],j.prototype,"memberEntityTypes",void 0),e([s()],j.prototype,"memberRelationshipTypes",void 0),e([s()],j.prototype,"sublayerIdsCache",void 0),e([s()],j.prototype,"tables",void 0),e([s({json:{read:!1}})],j.prototype,"type",void 0),e([s({json:{read:!1}})],j.prototype,"chronologicalAuxiliaryGraphics",void 0),j=e([r("esri.layers.LinkChartLayer")],j);const P=j;export{P as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import"../geometry.js";import t from"../core/Collection.js";import a from"../core/Error.js";import i from"../core/Logger.js";import{getOrCreateMapValue as n}from"../core/MapUtils.js";import{throwIfAborted as s}from"../core/promiseUtils.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";import l from"./Layer.js";import{convertFromGeometry as h}from"./graphics/featureConversionUtils.js";import d from"./graphics/OptimizedGeometry.js";import{IdealEdgeLengthTypeOptions as u}from"./knowledgeGraph/IdealEdgeLengthTypeOptions.js";import{KnowledgeGraphLayerDataManager as p,mockOidFieldName as c,mockOriginIdFieldName as y,mockDestinationIdFieldName as g,mockLayoutGeometryFieldName as m,mockAggregationCountFieldName as f}from"./knowledgeGraph/KnowledgeGraphLayerDataManager.js";import L from"./knowledgeGraph/KnowledgeGraphSublayer.js";import{initializeLayersFromClientData as C}from"./knowledgeGraph/layerUtils.js";import{getRelationshipEndNodeIds as k}from"./knowledgeGraph/supportUtils.js";import{BlendLayer as w}from"./mixins/BlendLayer.js";import{ScaleRangeLayer as M}from"./mixins/ScaleRangeLayer.js";import{LCChronologicalLayout as b,LCSimpleLayout as T,LCSmartTreeLayout as E,LCRadialTreeLayout as D,LCHierarchicalLayout as N,LCCommunityLayout as x,LCForceDirectedLayout as I,NodeFlag as R,load as v,LinkType as A}from"../libs/linkchartlayout/LinkChartLayout.js";import{fetchKnowledgeGraph as G}from"../rest/knowledgeGraphService.js";import _ from"../geometry/Extent.js";import O from"../geometry/Point.js";import S from"../geometry/Polyline.js";let j=class extends(w(M(l))){constructor(e){if(super(e),this.dataPreloadedInLocalCache=!1,this.defaultLinkChartConfig=null,this._currentLinkChartConfig={layoutMode:"RADIAL_TREE"},this._graphTypeLookup=new Map,this.dataManager=null,this.knowledgeGraph=null,this.layers=new t,this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map,this.linkChartExtent=new _({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7}),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.sublayerIdsCache=new Map,this.tables=new t,this.type="link-chart",this.chronologicalAuxiliaryGraphics=null,this._originalInclusionList=e.inclusionModeDefinition,e.dataPreloadedInLocalCache&&!e.inclusionModeDefinition)throw new a("knowledge-graph:linkchart-layer-constructor","If creating a link chart composite layer and configured that data is already loaded in the cache, you must specify an inclusion list so the Composite Layer knows what records belong to it")}normalizeCtorArgs(e){return{url:e.url,title:e.title,dataPreloadedInLocalCache:e.dataPreloadedInLocalCache,defaultLinkChartConfig:e.defaultLinkChartConfig}}_initializeLayerProperties(e){if(!this.title&&this.url){const e=this.url.split("/");this.title=e[e.length-2]}const t=new Set;let n=[],s=[];if(e.inclusionModeDefinition&&(!e.inclusionModeDefinition.namedTypeDefinitions||e.inclusionModeDefinition.namedTypeDefinitions.size<1))throw new a("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined");e.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&this._graphTypeLookup.set(e.name,e)})),e.knowledgeGraph.dataModel.relationshipTypes?.forEach((e=>{e.name&&this._graphTypeLookup.set(e.name,e)})),e.inclusionModeDefinition?.generateAllSublayers?(n=e.knowledgeGraph.dataModel.entityTypes??[],s=e.knowledgeGraph.dataModel.relationshipTypes??[]):e.inclusionModeDefinition?.namedTypeDefinitions&&e.inclusionModeDefinition?.namedTypeDefinitions.size>0?e.inclusionModeDefinition?.namedTypeDefinitions.forEach(((a,o)=>{const r=this._graphTypeLookup.get(o);if(!r)return i.getLogger(this).warn(`A named type, ${o}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(o);"relationship"===r.type?t.has(o)||(t.add(o),s.push(r)):"entity"===r.type?t.has(o)||(t.add(o),n.push(r)):(i.getLogger(this).warn(`A named type, ${o}, was in the inclusion list that wasn't properly modeled and will be removed`),e.inclusionModeDefinition?.namedTypeDefinitions.delete(o))})):(n=e.knowledgeGraph.dataModel.entityTypes??[],s=e.knowledgeGraph.dataModel.relationshipTypes??[]);const o=new p({knowledgeGraph:e.knowledgeGraph,inclusionModeDefinition:e.inclusionModeDefinition});this.knowledgeGraph=e.knowledgeGraph,this.memberEntityTypes=n,this.memberRelationshipTypes=s,this.dataManager=o}load(e){return this.addResolvingPromise(new Promise((t=>{G(this.url).then((async a=>{if(this._initializeLayerProperties({knowledgeGraph:a,inclusionModeDefinition:this._originalInclusionList}),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.size||(this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map},this.dataManager.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})})),this.dataManager.knowledgeGraph.dataModel.relationshipTypes?.forEach((e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})}))),this.dataPreloadedInLocalCache)this.loadLayerAssumingLocalCache(),await C(this),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach((e=>{e.useAllData=!1,e.members?.forEach((e=>{let t;t=e.linkChartLocation instanceof d?e.linkChartLocation:e.linkChartLocation?h(e.linkChartLocation):null,t&&2===t.coords.length&&0===t.lengths.length?this.entityLinkChartDiagramLookup.set(e.id,t):this.relationshipLinkChartDiagramLookup.set(e.id,t)})),this.addResolvingPromise(this._initializeDiagram().then((async()=>{this.layers.forEach((async e=>{await e.refreshCachedQueryEngine()})),this.tables.forEach((async e=>{await e.refreshCachedQueryEngine()}))})))}));else{const t="GEOGRAPHIC"===this.defaultLinkChartConfig?.layoutMode;this.addResolvingPromise(this.dataManager.refreshCacheContent(void 0,!1,t,!0).then((async()=>{s(e);const t=[],a=[];this.loadLayerAssumingLocalCache(),await C(this),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1,this.dataManager.inclusionModeDefinition.namedTypeDefinitions.forEach((e=>{e.useAllData=!1}))),await this._initializeDiagram(),this.layers.forEach((e=>{a.push(e.refreshCachedQueryEngine()),t.push(new Promise((t=>{e.on("layerview-create",(()=>{t(null)}))})))})),this.tables.forEach((e=>{a.push(e.refreshCachedQueryEngine())})),await Promise.all(a)})))}t(null)}))}))),Promise.resolve(this)}async addRecords(e,t){let a=[];t?.cascadeAddRelationshipEndNodes&&this.dataManager.knowledgeGraph.dataModel&&(a=await k(e,this.dataManager.knowledgeGraph));const i=e.concat(a).filter((e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id)));await this._handleNewRecords(i)}async removeRecords(e,{cascadeRemoveRelationships:t=!0,recalculateLayout:a=!1}={cascadeRemoveRelationships:!0,recalculateLayout:!1}){let i=[];for(const s of e)!1===this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(s.typeName)?.useAllData&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(s.typeName)?.members?.has(s.id)&&i.push(s);if(t){const e=new Set,t=[];for(const a of i)if(this.dataManager.nodeConnectionsLookup.has(a.id))for(const t of this.dataManager.nodeConnectionsLookup.get(a.id))e.add(t);for(const a of e)if(this.dataManager.memberIdTypeLookup.has(a))for(const e of this.dataManager.memberIdTypeLookup.get(a))this.dataManager.relationshipTypeNames.has(e)&&t.push({id:a,typeName:e});i=i.concat(t)}this.dataManager.removeFromLayer(i);for(const s of i)this.sublayerIdsCache.get(s.typeName)?.delete(s.id),this.dataManager.relationshipTypeNames.has(s.typeName)?this.relationshipLinkChartDiagramLookup.delete(s.id):this.entityLinkChartDiagramLookup.delete(s.id);a&&await this._calculateLayoutWithSublayerTimeInfo(this._currentLinkChartConfig.layoutMode,this._currentLinkChartConfig.layoutOptions);const n=[];return this.layers.forEach((e=>{n.push(e.refreshCachedQueryEngine())})),await Promise.all(n),this._refreshNamedTypes(),i}async expand(e,t){const a=await this.dataManager.getConnectedRecordIds(e,t),i=a.filter((e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id)));return await this._handleNewRecords(a),{records:i}}loadLayerAssumingLocalCache(){this.memberRelationshipTypes.forEach((e=>{const t=this._createSublayer(e);t.geometryType?this.layers.push(t):this.tables.push(t),this.dataManager.sublayerCaches.has(e.name)||this.dataManager.sublayerCaches.set(e.name,new Map)})),this.memberEntityTypes.forEach((e=>{const t=this._createSublayer(e);t.geometryType?this.layers.push(t):this.tables.push(t),this.dataManager.sublayerCaches.has(e.name)||this.dataManager.sublayerCaches.set(e.name,new Map)})),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach(((e,t)=>{const a=n(this.sublayerIdsCache,t,(()=>new Set));e.members?.forEach((e=>{if(a.add(e.id),e.linkChartLocation)if(e.linkChartLocation instanceof d)this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(e.id,e.linkChartLocation):this.entityLinkChartDiagramLookup.set(e.id,e.linkChartLocation);else{const a=h(e.linkChartLocation);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(e.id,e.linkChartLocation?a:null):this.entityLinkChartDiagramLookup.set(e.id,e.linkChartLocation?a:null)}}))}))}async calculateLinkChartLayout(e="RADIAL_TREE",t){const n=[],s=[],o=[];this.dataManager.sublayerCaches.forEach(((e,t)=>{this.dataManager.entityTypeNames.has(t)?e.forEach((e=>{n.push({typeName:t,feature:e})})):this.dataManager.relationshipTypeNames.has(t)&&e.forEach((e=>{s.push({typeName:t,feature:e})}))})),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map;const r=new Map,l=new Map,d=new Map,u=new Map,p=new Uint8Array(n.length),L=new Float64Array(n.length),C=new Float64Array(n.length),k=new Float64Array(n.length),w=new Float64Array(n.length),M=new Uint32Array(s.length),G=new Uint32Array(s.length),j=new Float64Array(s.length),P=new Float64Array(s.length),F=[],B="FORCE_DIRECTED",H=new _({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7});let z,U="FORCE_DIRECTED",Q=0,W=0;const K=b.apply;switch(U="GEOGRAPHIC"===e?B:e,U){case"FORCE_DIRECTED":z=I.apply;break;case"COMMUNITY":z=x.apply;break;case"HIERARCHICAL":z=N.apply;break;case"RADIAL_TREE":z=D.apply;break;case"SMART_TREE":z=E.apply;break;default:z=T.apply}let Y=!1;n.forEach((({typeName:a,feature:i})=>{if("CHRONOLOGICAL"!==e&&t?.lockedNodeLocations?.has(i.attributes[c])){"GEOGRAPHIC"===e&&this.dataManager.geographicLookup.has(a)?p[Q]=R.IsGeographic:p[Q]=R.None;const n=t.lockedNodeLocations.get(i.attributes[c]);L[Q]=n.x,C[Q]=n.y}else if("GEOGRAPHIC"===e&&this.dataManager.geographicLookup.has(a)){p[Q]=R.IsGeographic;let e=null;const t=i.attributes[this.dataManager.geographicLookup.get(a).name],n=this.dataManager.geographicLookup.get(a)?.geometryType;switch(n){case"esriGeometryPoint":L[Q]=t?.x,C[Q]=t?.y;break;case"esriGeometryPolygon":e=t?.centroid,null!=e?.x&&null!=e?.y?(L[Q]=e.x,C[Q]=e.y):p[Q]=R.IsMovable;break;case"esriGeometryPolyline":case"esriGeometryMultipoint":e=t?.extent?.center,null!=e?.x&&null!=e?.y?(L[Q]=e.x,C[Q]=e.y):p[Q]=R.IsMovable;break;default:p[Q]=R.IsMovable}(null==L[Q]||null==C[Q]||Number.isNaN(L[Q])||Number.isNaN(C[Q]))&&(p[Q]=R.IsMovable,L[Q]=0,C[Q]=0)}else if("CHRONOLOGICAL"===e){!Y&&t?.lockedNodeLocations?.has(i.attributes[c])&&(Y=!0);const e=t?.timeInfoByTypeName?.get(a),n=e?.startField,s=n&&e?.startField?i.attributes[n]:null;k[Q]=s?new Date(s).getTime():NaN;const o=e?.endField,r=o&&e?.endField?i.attributes[o]:null;w[Q]=r?new Date(r).getTime():NaN,L[Q]=0,C[Q]=0,p[Q]=R.IsMovable}else p[Q]=R.IsMovable,L[Q]=0,C[Q]=0;u.set(i.attributes[c],Q),F[Q]={feature:i,typeName:a},Q++})),Y&&i.getLogger(this).warn("Locked node locations are not supported for chronological layout at this time. Requested node locations were ignored");let $=!1;const q=new Map;s.forEach((a=>{const i=a.feature.attributes[y],n=a.feature.attributes[g],s=u.get(i),r=u.get(n),l=t?.timeInfoByTypeName?.get(a.typeName),h=t?.timeInfoByTypeName?l?.startField:null,d=h?a.feature.attributes[h]:null,p=l?.endField,c=p?a.feature.attributes[p]:null;if(void 0!==s&&void 0!==r){let t=i+"-"+n;"CHRONOLOGICAL"===e&&(t=t+"-"+d+"-"+c);const l=q.get(t),h=l?.has(a.typeName);h||(M[W]=s,G[W]=r,"CHRONOLOGICAL"===e&&(j[W]=d?new Date(d).getTime():NaN,P[W]=c?new Date(c).getTime():NaN),void 0===l?q.set(t,new Map([[a.typeName,W]])):l.set(a.typeName,W),W++),o.push(a)}else $=!0,this.relationshipLinkChartDiagramLookup.set(i,null)})),$&&i.getLogger(this).warn("A relationship is a member of this layer that has either origin or destination entity nodes that are not members. The diagram geometry will be set to null");const J=this._validateLayoutSettings(e,t),V=this._convertLayoutSettingsToCalculationSettings(J);await v();let X=!1,Z=null;if("CHRONOLOGICAL"===e){const e=!0;let t;({success:X,links:Z,graphics:t}=K(p,L,C,k,w,M.subarray(0,W),G.subarray(0,W),j.subarray(0,W),P.subarray(0,W),e,{})),X&&(this.chronologicalAuxiliaryGraphics=t)}else({success:X,links:Z}=z(p,L,C,M.subarray(0,W),G.subarray(0,W),V.computationBudgetTime,V.idealEdgeLengthMultiplier,V.repulsionRadiusMultiplier));if(!X)throw new a("knowledge-graph:layout-failed","Attempting to arrange the records in the specified layout failed");for(let a=0;a<F.length;a++){if(C[a]>84.9999?C[a]=84.9999:C[a]<-84.9999&&(C[a]=-84.9999),L[a]>179.9999?L[a]=179.9999:L[a]<-179.9999&&(L[a]=-179.9999),F[a].feature.attributes[m]=new O(L[a],C[a]),r.has(F[a].typeName)){const e=r.get(F[a].typeName);e?.set(F[a].feature.attributes[c],F[a].feature)}else{const e=new Map;e.set(F[a].feature.attributes[c],F[a].feature),r.set(F[a].typeName,e)}d.set(F[a].feature.attributes[c],F[a].feature);const e=h(F[a].feature.attributes[m]);this.entityLinkChartDiagramLookup.set(F[a].feature.attributes[c],F[a].feature.attributes[m]?e:null),F[a].feature.attributes[m].x<H.xmin&&(H.xmin=F[a].feature.attributes[m].x),F[a].feature.attributes[m].x>H.xmax&&(H.xmax=F[a].feature.attributes[m].x),F[a].feature.attributes[m].y<H.ymin&&(H.ymin=F[a].feature.attributes[m].y),F[a].feature.attributes[m].y>H.ymax&&(H.ymax=F[a].feature.attributes[m].y)}if(this.linkChartExtent.xmin=H.xmin,this.linkChartExtent.xmax=H.xmax,this.linkChartExtent.ymin=H.ymin,this.linkChartExtent.ymax=H.ymax,!Z)throw new a("knowledge-graph:layout-failed","Attempting to retrieve link geometry from diagram engine failed");const ee=new Map,te=new Map,ae=new Map,ie=new Set;for(let a=0;a<o.length;a++){const n=[],s=o[a],r=s.feature.attributes[y],p=s.feature.attributes[g];let f=r+"-"+p;if("CHRONOLOGICAL"===e){const e=t?.timeInfoByTypeName?.get(s.typeName),a=t?.timeInfoByTypeName?e?.startField:null,i=a?s.feature.attributes[a]:null,n=e?.endField;f+="-"+i+"-"+(n?s.feature.attributes[n]:null)}const L=q.get(f).get(s.typeName),C=0===L?0:Z?.vertexEndIndex[L-1];if(!ie.has(L)){if(ie.add(L),Z.types[L]===A.Recursive){const e=[Z.vertices[2*C],Z.vertices[2*C+1]],t=[Z.vertices[2*(C+1)],Z.vertices[2*(C+1)+1]],a=[.5*(e[0]+t[0]),.5*(e[1]+t[1])],i=[a[0]-e[0],a[1]-e[1]],s=[a[0]+i[1],a[1]-i[0]],o=[a[0]-i[1],a[1]+i[0]];n.push(e),n.push(s),n.push(t),n.push(o),n.push(e)}else{if(Z.types[L]!==A.Regular){i.getLogger(this).warn("A relationship generated an unsupported link geometry type. It will not be rendered");continue}for(let e=C;e<Z.vertexEndIndex[L];e++)n.push([Z.vertices[2*e],Z.vertices[2*e+1]])}if("CHRONOLOGICAL"!==e){const e=F[u.get(r)]?.feature.attributes[m],t=F[u.get(p)]?.feature.attributes[m];n[0][0]===e.x&&n[0][1]===e.y||(n[0]=[e.x,e.y]),n[n.length-1][0]===t.x&&n[n.length-1][1]===t.y||(n[n.length-1]=[t.x,t.y])}for(let e=1;e<n.length-1;e++)n[e][1]>85.5?n[e][1]=85.5:n[e][1]<-85.5&&(n[e][1]=-85.5),n[e][0]>179.9999?n[e][0]=179.9999:n[e][0]<-179.9999&&(n[e][0]=-179.9999);ee.has(f)?ee.get(f).push(n):ee.set(f,[n])}const k=ee.get(f);te.has(f)||(te.set(f,new Map),ae.set(f,new Map));const w=te.get(f),M=ae.get(f);w.has(s.typeName)||(w.set(s.typeName,k.shift()),M.set(s.typeName,0));const b=w.get(s.typeName);M.set(s.typeName,M.get(s.typeName)+1);const T=new S({paths:[b]});if(s.feature.attributes[m]=T,l.has(s.typeName)){const e=l.get(s.typeName);e?.set(s.feature.attributes[c],s.feature)}else{const e=new Map;e.set(s.feature.attributes[c],s.feature),l.set(s.typeName,e)}d.set(s.feature.attributes[c],s.feature);const E=h(s.feature.attributes[m]);this.relationshipLinkChartDiagramLookup.set(s.feature.attributes[c],s.feature.attributes[m]?E:null)}for(const a of o)a.feature.attributes[f]=ae.get(a.feature.attributes[y]+"-"+a.feature.attributes[g])?.get(a.typeName)??null;return this._currentLinkChartConfig={layoutMode:e,layoutOptions:J},{nodes:r,links:l,idMap:d}}async applyNewLinkChartLayout(e="RADIAL_TREE",t){const a=[];await this._calculateLayoutWithSublayerTimeInfo(e,t),this.layers.forEach((e=>{a.push(e.refreshCachedQueryEngine())})),await Promise.all(a),this._refreshNamedTypes()}getCurrentNodeLocations(){const e=new Map;return this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((t=>{t?.members?.forEach((t=>{const a=t.linkChartLocation;let i;const n=t.id;a&&(i="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]},e.set(n,new O({x:i.x,y:i.y})))}))})),e}async synchronizeInclusionListWithCache(){return new Promise((e=>{this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach(((e,t)=>{if(e.useAllData=!1,e.members&&e.members.size>0){if(!this.dataManager.sublayerCaches.get(t))return;const a=new Set(Array.from(this.dataManager.sublayerCaches.get(t).keys()));Array.from(e.members.keys()).filter((e=>!a.has(e))).forEach((t=>{e.members?.delete(t)}))}})),e()}))}async refreshLinkChartCache(e){await this.dataManager.refreshCacheContent(e);const t=[];this.layers.forEach((e=>{t.push(e.refreshCachedQueryEngine())})),await Promise.all(t),this._refreshNamedTypes()}async connectBetweenEntities(e){let t=[];for(const i of this.dataManager.relationshipTypeNames){const e=this.sublayerIdsCache.get(i);e&&(t=t.concat(Array.from(e.keys())))}const a=await this.dataManager.getRelationshipsBetweenNodes(e,t);return await this._handleNewRecords(a),{records:a}}async connectFromEntities(e){let t=[];for(const n of this.dataManager.relationshipTypeNames){const e=this.sublayerIdsCache.get(n);e&&(t=t.concat(Array.from(e.keys())))}let a=[];for(const n of this.dataManager.entityTypeNames){const e=this.sublayerIdsCache.get(n);e&&(a=a.concat(Array.from(e)))}const i=await this.dataManager.getRelationshipsFromNodes(e,a,t);return await this._handleNewRecords(i),{records:i}}getCurrentLayout(){return this._currentLinkChartConfig.layoutMode}async _calculateLayoutWithSublayerTimeInfo(e="RADIAL_TREE",t){const a=new Map;this.layers.forEach((e=>{a.set(e.objectType.name,e.timeInfo)})),await this.calculateLinkChartLayout(e,{timeInfoByTypeName:a,...t})}async _handleNewRecords(e){const t=[];this.dataManager.addToLayer(e);for(const i of e)this.sublayerIdsCache.has(i.typeName)||(this.sublayerIdsCache.set(i.typeName,new Set),t.push(i.typeName)),this.sublayerIdsCache.get(i.typeName).add(i.id);for(const i of t){const e=this._graphTypeLookup.get(i);if(e){const t=this._createSublayer(e);"entity"===e.type?this.dataManager.entityTypeNames.add(i):this.dataManager.relationshipTypeNames.add(i),t.geometryType?this.layers.push(t):this.tables.push(t),this.dataManager.sublayerCaches.set(i,new Map)}}await C(this,t),await this.dataManager.refreshCacheContent(e.map((e=>e.id)));const a=Object.assign({},this._currentLinkChartConfig.layoutOptions);a.lockedNodeLocations=new Map;for(const[i,n]of this.entityLinkChartDiagramLookup.entries())n&&a.lockedNodeLocations.set(i,new O(n.coords[0],n.coords[1]));await this.applyNewLinkChartLayout(this._currentLinkChartConfig.layoutMode,a)}async _initializeDiagram(){this.defaultLinkChartConfig?this.defaultLinkChartConfig.doNotRecalculateLayout?(this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach(((e,t)=>{e?.members?.forEach((e=>{const a=e.linkChartLocation;let i;const n=e.id;if(!a)return;i="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]};const s=h(i);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(n,s):this.entityLinkChartDiagramLookup.set(n,s),this.linkChartExtent.xmin>i.x&&(this.linkChartExtent.xmin=i.x),this.linkChartExtent.xmax<i.x&&(this.linkChartExtent.xmax=i.x),this.linkChartExtent.ymin>i.y&&(this.linkChartExtent.ymin=i.y),this.linkChartExtent.ymax<i.y&&(this.linkChartExtent.ymax=i.y)}))})),this.memberRelationshipTypes.forEach((e=>{e.name&&this.dataManager.sublayerCaches.get(e.name)?.forEach((e=>{const t=this.relationshipLinkChartDiagramLookup.get(e.attributes[y]),a=this.relationshipLinkChartDiagramLookup.get(e.attributes[g]);if(t&&a){const i=h(new S({paths:[[[t.coords[0],t.coords[1]],[a.coords[0],a.coords[1]]]]}));this.relationshipLinkChartDiagramLookup.set(e.attributes[c],i)}else this.relationshipLinkChartDiagramLookup.set(e.attributes[c],null)}))}))):await this._calculateLayoutWithSublayerTimeInfo(this.defaultLinkChartConfig.layoutMode,{lockedNodeLocations:this.getCurrentNodeLocations(),...this.defaultLinkChartConfig.layoutOptions||{}}):await this._calculateLayoutWithSublayerTimeInfo("RADIAL_TREE",{lockedNodeLocations:this.getCurrentNodeLocations()})}_refreshNamedTypes(){for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}_validateLayoutSettings(e,t){const a=e=>"number"==typeof e&&!isNaN(e),n=e=>a(e)&&e>=1,s=e=>a(e)&&e>=1,o=e=>Object.values(u).includes(e),r=e=>a(e)&&e>=0,l=new Set(["FORCE_DIRECTED","COMMUNITY","GEOGRAPHIC"]),h={};if(!l.has(e)||!t)return!l.has(e)&&t&&i.getLogger(this).warn("Layout mode options were given for a layout mode that does not utilize them, settings will be ignored"),h;const{computationBudgetTime:d,repulsionRadiusMultiplier:p,idealEdgeLength:c,idealEdgeLengthType:y}=t;s(d)?h.computationBudgetTime=d:void 0!==d&&i.getLogger(this).warn("Invalid layout computationBudgetTime setting, will revert to default setting"),n(p)?h.repulsionRadiusMultiplier=p:void 0!==p&&i.getLogger(this).warn("Invalid layout repulsionRadiusMultiplier setting, will revert to default setting");const g=void 0!==c||void 0!==y;return"GEOGRAPHIC"!==e&&g?i.getLogger(this).warn("Ideal edge length settings were specified for an incompatible layout mode, and will be ignored"):"GEOGRAPHIC"===e&&g&&(o(y)?h.idealEdgeLengthType=y:void 0!==y&&i.getLogger(this).warn('Invalid layout idealEdgeLengthType setting, will revert to "multiplier" setting'),r(c)?h.idealEdgeLength=c:void 0!==c&&i.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting")),h}_convertLayoutSettingsToCalculationSettings(e){let t=e.idealEdgeLength;return e.idealEdgeLengthType===u.ABSOLUTE&&(void 0===t?t=-1:t*=-1),{computationBudgetTime:e.computationBudgetTime,repulsionRadiusMultiplier:e.repulsionRadiusMultiplier,idealEdgeLengthMultiplier:t}}_createSublayer(e){return new L({objectType:e,parentCompositeLayer:this,graphType:e.type})}};e([o()],j.prototype,"dataPreloadedInLocalCache",void 0),e([o()],j.prototype,"defaultLinkChartConfig",void 0),e([o()],j.prototype,"dataManager",void 0),e([o()],j.prototype,"knowledgeGraph",void 0),e([o()],j.prototype,"layers",void 0),e([o()],j.prototype,"entityLinkChartDiagramLookup",void 0),e([o()],j.prototype,"relationshipLinkChartDiagramLookup",void 0),e([o()],j.prototype,"linkChartExtent",void 0),e([o()],j.prototype,"memberEntityTypes",void 0),e([o()],j.prototype,"memberRelationshipTypes",void 0),e([o()],j.prototype,"sublayerIdsCache",void 0),e([o()],j.prototype,"tables",void 0),e([o({json:{read:!1}})],j.prototype,"type",void 0),e([o({json:{read:!1}})],j.prototype,"chronologicalAuxiliaryGraphics",void 0),j=e([r("esri.layers.LinkChartLayer")],j);const P=j;export{P as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import"../../geometry.js";import t from"../../PopupTemplate.js";import"../../renderers/ClassBreaksRenderer.js";import"../../renderers/DictionaryRenderer.js";import"../../renderers/DotDensityRenderer.js";import"../../renderers/HeatmapRenderer.js";import"../../renderers/PieChartRenderer.js";import"../../renderers/Renderer.js";import"../../renderers/SimpleRenderer.js";import"../../renderers/UniqueValueRenderer.js";import{fromJSON as r}from"../../renderers/support/jsonUtils.js";import{rendererTypes as o}from"../../renderers/support/types.js";import{clone as i}from"../../core/lang.js";import{MultiOriginJSONMixin as n}from"../../core/MultiOriginJSONSupport.js";import"../../core/workers/workers.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../../core/accessorSupport/decorators/writer.js";import{OriginId as l}from"../../core/accessorSupport/PropertyOrigin.js";import{initializeProjection as u,project as y}from"../../geometry/projection.js";import d from"../../geometry/SpatialReference.js";import{wgs84 as m}from"../../geometry/support/spatialReferenceUtils.js";import c from"../Layer.js";import h from"../graphics/data/FeatureStore.js";import{QueryEngine as g}from"../graphics/data/QueryEngine.js";import{createCapabilities as f,createDrawingInfo as j}from"../graphics/sources/support/clientSideDefaults.js";import{mockOidFieldName as b,mockAggregationCountFieldName as w,systemIsSpatialFieldName as S,mockLayoutGeometryFieldName as T}from"./KnowledgeGraphLayerDataManager.js";import{KnowledgeGraphSublayerBase as v}from"./KnowledgeGraphSublayerBase.js";import{BlendLayer as O,blendModeProperty as x,effectProperty as E}from"../mixins/BlendLayer.js";import{FeatureEffectLayer as F,featureEffectProperty as L}from"../mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as N}from"../mixins/FeatureReductionLayer.js";import{OrderedLayer as R,orderByProperty as I}from"../mixins/OrderedLayer.js";import{RefreshableLayer as Q}from"../mixins/RefreshableLayer.js";import{ScaleRangeLayer as C}from"../mixins/ScaleRangeLayer.js";import{TemporalLayer as J,useViewTimeProperty as M}from"../mixins/TemporalLayer.js";import{labelsVisible as k,legendEnabled as q,maxScale as P,minScale as _,opacity as D,popupEnabled as G}from"../support/commonProperties.js";import{featureReductionProperty as U}from"../support/featureReductionUtils.js";import V from"../support/Field.js";import{fixRendererFields as Z}from"../support/fieldUtils.js";import B from"../support/LabelClass.js";import{reader as K}from"../support/labelingInfo.js";import W from"../../rest/support/FeatureSet.js";import z from"../../rest/support/Query.js";import{createPopupTemplate as A}from"../../support/popupUtils.js";import H from"../../core/workers/RemoteClient.js";import X from"../../geometry/Extent.js";import Y from"../../geometry/Polygon.js";import $ from"../../geometry/Polyline.js";import ee from"../../geometry/Point.js";import{featureGeometryTypeKebabDictionary as te}from"../../geometry/support/typeUtils.js";function re(e){if(!e.json)return e;e.json.write=oe(e.json.write);const t=e.json.origins;if(!t)return e;let r;for(r in t){const e=t[r];e&&(e.write=oe(e.write))}return e}function oe(e){return"object"==typeof e&&e?(!1!==e.enabled&&(e.overridePolicy=ie(e)),e):!0===e?ne():e}function ie(e){const{target:t,writer:r,overridePolicy:o,...i}=e;return function(e,t){const r=se.call(this,e,t);return r.enabled?{...i,...r}:r}}function ne(){return{overridePolicy:se}}function se(e,t){const r=!!this.geometryType;let o={enabled:r};return r&&(o={...o,...ae.call(this,e,t)}),o}function ae(e,t){return{ignoreOrigin:this.originIdOf(t)>l.DEFAULTS}}let pe=class extends(v(N(F(O(R(J(C(Q(n(c)))))))))){constructor(e){super(e),this.blendMode="normal",this.capabilities=f(!1,!1),this.charts=null,this.definitionExpression=null,this.displayField="",this.effect=null,this.elevationInfo=null,this.featureEffect=null,this.graphType=null,this.labelsVisible=!0,this.labelingInfo=null,this.layerType=null,this.legendEnabled=!0,this.maxScale=0,this.minScale=0,this.objectIdField=b,this.objectType=null,this.opacity=1,this.orderBy=null,this.parentCompositeLayer=null,this.persistenceEnabled=!0,this.popupEnabled=!0,this.popupTemplate=null,this.refreshInterval=0,this.source={openPorts:()=>this.load().then((()=>{const e=new MessageChannel;return new H(e.port1,{channel:e,client:{queryFeatures:(e,t={})=>{const r=z.fromJSON(e);return this.queryFeaturesJSON(r,t)}}}),[e.port2]}))},this.title=null,this.type="knowledge-graph-sublayer",this.useViewTime=!0,this.visible=!0}get defaultPopupTemplate(){return this.createPopupTemplate()}set featureReduction(e){const t=this._normalizeFeatureReduction(e);this._set("featureReduction",t)}get fields(){const e=[];return this.objectType?.properties?.forEach((t=>{const r="esriFieldTypeOID"===t.fieldType?"esriFieldTypeInteger":t.fieldType;e.push(V.fromJSON({name:t.name,type:r,alias:t.alias,defaultValue:t.defaultValue,editable:t.editable,nullable:t.nullable}))})),e.push(V.fromJSON({name:this.objectIdField,type:"esriFieldTypeString",alias:this.objectIdField,editable:!1}),V.fromJSON({name:w,type:"esriFieldTypeInteger",alias:w,editable:!1}),V.fromJSON({name:S,type:"esriFieldTypeInteger",alias:S,editable:!1})),e}get geometryType(){if("link-chart"===this.parentCompositeLayer?.type)return"relationship"===this.graphType?"polyline":"point";const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.geometryType;return t&&"esriGeometryNull"!==t?te.fromJSON(t):null}get geometryFieldName(){if("link-chart"===this.parentCompositeLayer?.type)return T;const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name);return e?.name??null}get graphTypeName(){return this.objectType?.name}get hasM(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name,r=t?this.objectType?.properties?.[t]:null;return r?.hasM??!1}get hasZ(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name,r=t?this.objectType?.properties?.[t]:null;return r?.hasZ??!1}set renderer(e){Z(e,this.fieldsIndex),this._set("renderer",e)}get renderer(){return this._isOverridden("renderer")?this._get("renderer"):"link-chart"===this.parentCompositeLayer?.type?"relationship"===this.graphType?r(j(te.toJSON("polyline")).renderer):r(j(te.toJSON("point")).renderer):r(j(te.toJSON(this.geometryType)).renderer)}get spatialReference(){return this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel?.spatialReference??d.WGS84}writeTitle(e,t){t.title=e??"Layer"}createPopupTemplate(e){return A(this,e)}createQuery(){return new z({where:"1=1",outFields:["*"]})}getField(e){for(let t=0;t<this.fields.length;t++)if(this.fields[t].name===e)return this.fields[t];return null}getFieldDomain(e,t){return null}async queryFeatures(e,t){const{resolvedQuery:r,queryEngine:o}=await this._setupQueryObjects(e),i=W.fromJSON(await o.executeQuery(r.toJSON(),t?.signal));return i.features.forEach((e=>{e.sourceLayer=this})),i}async queryFeaturesJSON(e,t){const{resolvedQuery:r,queryEngine:o}=await this._setupQueryObjects(e);return await o.executeQuery(r.toJSON(),t?.signal)}async queryFeatureCount(e,t){const{resolvedQuery:r,queryEngine:o}=await this._setupQueryObjects(e);return o.executeQueryForCount(r.toJSON(),t?.signal)}async queryExtent(e={},t){const r={...e,returnGeometry:!0},{resolvedQuery:o,queryEngine:i}=await this._setupQueryObjects(r),n=await i.executeQueryForExtent(o.toJSON(),t?.signal);let s;return s=null!=n.extent?.xmin&&null!=n.extent?.xmax&&null!=n.extent?.ymin&&null!=n.extent?.ymax?new X(n.extent):new X,{count:n.count,extent:s}}async queryObjectIds(e,t){const r=z.from(e);let o;if("link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)o=this._cachedQueryEngine;else{const e=await this.parentCompositeLayer.dataManager.getData(r,this,t);o=this.loadQueryEngine(e)}return o.executeQueryForIds(r.toJSON(),t?.signal)}loadQueryEngine(e){const t=new h({geometryType:te.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ}),r=new g({fieldsIndex:this.fieldsIndex.toJSON(),geometryType:te.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ,objectIdField:this.objectIdField,spatialReference:this.spatialReference.toJSON(),timeInfo:null,featureStore:t});return r.featureStore.addMany(e),r}async refreshCachedQueryEngine(){const e=await this.parentCompositeLayer.dataManager.getData(new z({where:"1=1",outFields:[b]}),this);this._cachedQueryEngine=this.loadQueryEngine(e)}async _setupQueryObjects(e,t){const r=z.from(e),o=r.geometry;let i;if(o&&!o.spatialReference?.isWGS84&&(await u(o.spatialReference,m),r.geometry=y(o instanceof Y||o instanceof $||o instanceof ee?o:o.extent,m)),"link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)i=this._cachedQueryEngine;else{const e=await this.parentCompositeLayer.dataManager.getData(r,this,t);i=this.loadQueryEngine(e)}return{resolvedQuery:r,queryEngine:i}}};e([s(re(i(x)))],pe.prototype,"blendMode",void 0),e([s()],pe.prototype,"capabilities",void 0),e([s({json:{origins:{"web-scene":{write:!1}},write:ne()}})],pe.prototype,"charts",void 0),e([s({readOnly:!0})],pe.prototype,"defaultPopupTemplate",null),e([s({type:String,json:{origins:{service:{read:!1}},name:"layerDefinition.definitionExpression",write:{ignoreOrigin:!0}}})],pe.prototype,"definitionExpression",void 0),e([s()],pe.prototype,"displayField",void 0),e([s(re(i(E)))],pe.prototype,"effect",void 0),e([s()],pe.prototype,"elevationInfo",void 0),e([s(re(i(L)))],pe.prototype,"featureEffect",void 0),e([s(re(i(U)))],pe.prototype,"featureReduction",null),e([s()],pe.prototype,"fields",null),e([s()],pe.prototype,"geometryType",null),e([s()],pe.prototype,"geometryFieldName",null),e([s({type:["entity","relationship"],nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],pe.prototype,"graphType",void 0),e([s({type:String,nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],pe.prototype,"graphTypeName",null),e([s()],pe.prototype,"hasM",null),e([s()],pe.prototype,"hasZ",null),e([s({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],pe.prototype,"id",void 0),e([s(re(i(k)))],pe.prototype,"labelsVisible",void 0),e([s({type:[B],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:K,write:ne()}})],pe.prototype,"labelingInfo",void 0),e([s({readOnly:!0,json:{read:!1,write:{writer(e,t){t.layerType=this.geometryType?"KnowledgeGraphSubLayer":"KnowledgeGraphSubTable"},isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],pe.prototype,"layerType",void 0),e([s(re(i(q)))],pe.prototype,"legendEnabled",void 0),e([s(re(i(P)))],pe.prototype,"maxScale",void 0),e([s(re(i(_)))],pe.prototype,"minScale",void 0),e([s()],pe.prototype,"objectIdField",void 0),e([s()],pe.prototype,"objectType",void 0),e([s(re(i(D)))],pe.prototype,"opacity",void 0),e([s(re(i(I)))],pe.prototype,"orderBy",void 0),e([s()],pe.prototype,"parentCompositeLayer",void 0),e([s(re(i(G)))],pe.prototype,"popupEnabled",void 0),e([s({type:t,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],pe.prototype,"popupTemplate",void 0),e([s({type:Number,json:{write:{overridePolicy:ae}}})],pe.prototype,"refreshInterval",void 0),e([s({types:o,json:{name:"layerDefinition.drawingInfo.renderer",write:ne()}})],pe.prototype,"renderer",null),e([s()],pe.prototype,"source",void 0),e([s()],pe.prototype,"spatialReference",null),e([s({type:String,json:{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],pe.prototype,"title",void 0),e([p("title")],pe.prototype,"writeTitle",null),e([s({json:{read:!1}})],pe.prototype,"type",void 0),e([s(re(i(M)))],pe.prototype,"useViewTime",void 0),e([s({type:Boolean,json:{name:"visibility",write:ne()}})],pe.prototype,"visible",void 0),pe=e([a("esri.layers.knowledgeGraph.KnowledgeGraphSublayer")],pe);const le=pe;export{le as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import"../../geometry.js";import t from"../../PopupTemplate.js";import"../../renderers/ClassBreaksRenderer.js";import"../../renderers/DictionaryRenderer.js";import"../../renderers/DotDensityRenderer.js";import"../../renderers/HeatmapRenderer.js";import"../../renderers/PieChartRenderer.js";import"../../renderers/Renderer.js";import"../../renderers/SimpleRenderer.js";import"../../renderers/UniqueValueRenderer.js";import{fromJSON as r}from"../../renderers/support/jsonUtils.js";import{rendererTypes as o}from"../../renderers/support/types.js";import{clone as i}from"../../core/lang.js";import{MultiOriginJSONMixin as n}from"../../core/MultiOriginJSONSupport.js";import"../../core/workers/workers.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../../core/accessorSupport/decorators/writer.js";import{OriginId as l}from"../../core/accessorSupport/PropertyOrigin.js";import{initializeProjection as u,project as y}from"../../geometry/projection.js";import d from"../../geometry/SpatialReference.js";import{wgs84 as m}from"../../geometry/support/spatialReferenceUtils.js";import c from"../Layer.js";import h from"../graphics/data/FeatureStore.js";import{QueryEngine as g}from"../graphics/data/QueryEngine.js";import{createCapabilities as f,createDrawingInfo as j}from"../graphics/sources/support/clientSideDefaults.js";import{mockOidFieldName as b,mockAggregationCountFieldName as w,systemIsSpatialFieldName as S,mockLayoutGeometryFieldName as T}from"./KnowledgeGraphLayerDataManager.js";import{KnowledgeGraphSublayerBase as v}from"./KnowledgeGraphSublayerBase.js";import{BlendLayer as O,blendModeProperty as x,effectProperty as E}from"../mixins/BlendLayer.js";import{FeatureEffectLayer as N,featureEffectProperty as F}from"../mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as L}from"../mixins/FeatureReductionLayer.js";import{OrderedLayer as R,orderByProperty as I}from"../mixins/OrderedLayer.js";import{RefreshableLayer as Q}from"../mixins/RefreshableLayer.js";import{ScaleRangeLayer as C}from"../mixins/ScaleRangeLayer.js";import{TemporalLayer as J,useViewTimeProperty as M}from"../mixins/TemporalLayer.js";import{labelsVisible as _,legendEnabled as k,maxScale as q,minScale as P,opacity as D,popupEnabled as G}from"../support/commonProperties.js";import{featureReductionProperty as U}from"../support/featureReductionUtils.js";import V from"../support/Field.js";import{fixRendererFields as Z}from"../support/fieldUtils.js";import B from"../support/LabelClass.js";import{reader as K}from"../support/labelingInfo.js";import W from"../../rest/support/FeatureSet.js";import z from"../../rest/support/Query.js";import{createPopupTemplate as A}from"../../support/popupUtils.js";import H from"../../core/workers/RemoteClient.js";import X from"../../geometry/Extent.js";import Y from"../../geometry/Polygon.js";import $ from"../../geometry/Polyline.js";import ee from"../../geometry/Point.js";import{featureGeometryTypeKebabDictionary as te}from"../../geometry/support/typeUtils.js";function re(e){if(!e.json)return e;e.json.write=oe(e.json.write);const t=e.json.origins;if(!t)return e;let r;for(r in t){const e=t[r];e&&(e.write=oe(e.write))}return e}function oe(e){return"object"==typeof e&&e?(!1!==e.enabled&&(e.overridePolicy=ie(e)),e):!0===e?ne():e}function ie(e){const{target:t,writer:r,overridePolicy:o,...i}=e;return function(e,t){const r=se.call(this,e,t);return r.enabled?{...i,...r}:r}}function ne(){return{overridePolicy:se}}function se(e,t){const r=!!this.geometryType;let o={enabled:r};return r&&(o={...o,...ae.call(this,e,t)}),o}function ae(e,t){return{ignoreOrigin:this.originIdOf(t)>l.DEFAULTS}}let pe=class extends(v(L(N(O(R(J(C(Q(n(c)))))))))){constructor(e){super(e),this.blendMode="normal",this.capabilities=f(!1,!1),this.charts=null,this.definitionExpression=null,this.displayField="",this.effect=null,this.elevationInfo=null,this.featureEffect=null,this.graphType=null,this.labelsVisible=!0,this.labelingInfo=null,this.layerType=null,this.legendEnabled=!0,this.maxScale=0,this.minScale=0,this.objectIdField=b,this.objectType=null,this.opacity=1,this.orderBy=null,this.parentCompositeLayer=null,this.persistenceEnabled=!0,this.popupEnabled=!0,this.popupTemplate=null,this.refreshInterval=0,this.source={openPorts:()=>this.load().then((()=>{const e=new MessageChannel;return new H(e.port1,{channel:e,client:{queryFeatures:(e,t={})=>{const r=z.fromJSON(e);return this.queryFeaturesJSON(r,t)}}}),[e.port2]}))},this.type="knowledge-graph-sublayer",this.useViewTime=!0,this.visible=!0}get defaultPopupTemplate(){return this.createPopupTemplate()}set featureReduction(e){const t=this._normalizeFeatureReduction(e);this._set("featureReduction",t)}get fields(){const e=[];return this.objectType?.properties?.forEach((t=>{const r="esriFieldTypeOID"===t.fieldType?"esriFieldTypeInteger":t.fieldType;e.push(V.fromJSON({name:t.name,type:r,alias:t.alias,defaultValue:t.defaultValue,editable:t.editable,nullable:t.nullable}))})),e.push(V.fromJSON({name:this.objectIdField,type:"esriFieldTypeString",alias:this.objectIdField,editable:!1}),V.fromJSON({name:w,type:"esriFieldTypeInteger",alias:w,editable:!1}),V.fromJSON({name:S,type:"esriFieldTypeInteger",alias:S,editable:!1})),e}get geometryType(){if("link-chart"===this.parentCompositeLayer?.type)return"relationship"===this.graphType?"polyline":"point";const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.geometryType;return t&&"esriGeometryNull"!==t?te.fromJSON(t):null}get geometryFieldName(){if("link-chart"===this.parentCompositeLayer?.type)return T;const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name);return e?.name??null}get graphTypeName(){return this.objectType?.name}get hasM(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name,r=t?this.objectType?.properties?.[t]:null;return r?.hasM??!1}get hasZ(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name,r=t?this.objectType?.properties?.[t]:null;return r?.hasZ??!1}set renderer(e){Z(e,this.fieldsIndex),this._set("renderer",e)}get renderer(){return this._isOverridden("renderer")?this._get("renderer"):"link-chart"===this.parentCompositeLayer?.type?"relationship"===this.graphType?r(j(te.toJSON("polyline")).renderer):r(j(te.toJSON("point")).renderer):r(j(te.toJSON(this.geometryType)).renderer)}get spatialReference(){return this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel?.spatialReference??d.WGS84}get title(){return this._isOverridden("title")?this._get("title"):this.graphTypeName}set title(e){this._set("title",e)}writeTitle(e,t){t.title=e??"Layer"}createPopupTemplate(e){return A(this,e)}createQuery(){return new z({where:"1=1",outFields:["*"]})}getField(e){for(let t=0;t<this.fields.length;t++)if(this.fields[t].name===e)return this.fields[t];return null}getFieldDomain(e,t){return null}async queryFeatures(e,t){const{resolvedQuery:r,queryEngine:o}=await this._setupQueryObjects(e),i=W.fromJSON(await o.executeQuery(r.toJSON(),t?.signal));return i.features.forEach((e=>{e.sourceLayer=this})),i}async queryFeaturesJSON(e,t){const{resolvedQuery:r,queryEngine:o}=await this._setupQueryObjects(e);return await o.executeQuery(r.toJSON(),t?.signal)}async queryFeatureCount(e,t){const{resolvedQuery:r,queryEngine:o}=await this._setupQueryObjects(e);return o.executeQueryForCount(r.toJSON(),t?.signal)}async queryExtent(e={},t){const r={...e,returnGeometry:!0},{resolvedQuery:o,queryEngine:i}=await this._setupQueryObjects(r),n=await i.executeQueryForExtent(o.toJSON(),t?.signal);let s;return s=null!=n.extent?.xmin&&null!=n.extent?.xmax&&null!=n.extent?.ymin&&null!=n.extent?.ymax?new X(n.extent):new X,{count:n.count,extent:s}}async queryObjectIds(e,t){const r=z.from(e);let o;if("link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)o=this._cachedQueryEngine;else{const e=await this.parentCompositeLayer.dataManager.getData(r,this,t);o=this.loadQueryEngine(e)}return o.executeQueryForIds(r.toJSON(),t?.signal)}loadQueryEngine(e){const t=new h({geometryType:te.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ}),r=new g({fieldsIndex:this.fieldsIndex.toJSON(),geometryType:te.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ,objectIdField:this.objectIdField,spatialReference:this.spatialReference.toJSON(),timeInfo:null,featureStore:t});return r.featureStore.addMany(e),r}async refreshCachedQueryEngine(){const e=await this.parentCompositeLayer.dataManager.getData(new z({where:"1=1",outFields:[b]}),this);this._cachedQueryEngine=this.loadQueryEngine(e)}async _setupQueryObjects(e,t){const r=z.from(e),o=r.geometry;let i;if(o&&!o.spatialReference?.isWGS84&&(await u(o.spatialReference,m),r.geometry=y(o instanceof Y||o instanceof $||o instanceof ee?o:o.extent,m)),"link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)i=this._cachedQueryEngine;else{const e=await this.parentCompositeLayer.dataManager.getData(r,this,t);i=this.loadQueryEngine(e)}return{resolvedQuery:r,queryEngine:i}}};e([s(re(i(x)))],pe.prototype,"blendMode",void 0),e([s()],pe.prototype,"capabilities",void 0),e([s({json:{origins:{"web-scene":{write:!1}},write:ne()}})],pe.prototype,"charts",void 0),e([s({readOnly:!0})],pe.prototype,"defaultPopupTemplate",null),e([s({type:String,json:{origins:{service:{read:!1}},name:"layerDefinition.definitionExpression",write:{ignoreOrigin:!0}}})],pe.prototype,"definitionExpression",void 0),e([s()],pe.prototype,"displayField",void 0),e([s(re(i(E)))],pe.prototype,"effect",void 0),e([s()],pe.prototype,"elevationInfo",void 0),e([s(re(i(F)))],pe.prototype,"featureEffect",void 0),e([s(re(i(U)))],pe.prototype,"featureReduction",null),e([s()],pe.prototype,"fields",null),e([s()],pe.prototype,"geometryType",null),e([s()],pe.prototype,"geometryFieldName",null),e([s({type:["entity","relationship"],nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],pe.prototype,"graphType",void 0),e([s({type:String,nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],pe.prototype,"graphTypeName",null),e([s()],pe.prototype,"hasM",null),e([s()],pe.prototype,"hasZ",null),e([s({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],pe.prototype,"id",void 0),e([s(re(i(_)))],pe.prototype,"labelsVisible",void 0),e([s({type:[B],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:K,write:ne()}})],pe.prototype,"labelingInfo",void 0),e([s({readOnly:!0,json:{read:!1,write:{writer(e,t){t.layerType=this.geometryType?"KnowledgeGraphSubLayer":"KnowledgeGraphSubTable"},isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],pe.prototype,"layerType",void 0),e([s(re(i(k)))],pe.prototype,"legendEnabled",void 0),e([s(re(i(q)))],pe.prototype,"maxScale",void 0),e([s(re(i(P)))],pe.prototype,"minScale",void 0),e([s()],pe.prototype,"objectIdField",void 0),e([s()],pe.prototype,"objectType",void 0),e([s(re(i(D)))],pe.prototype,"opacity",void 0),e([s(re(i(I)))],pe.prototype,"orderBy",void 0),e([s()],pe.prototype,"parentCompositeLayer",void 0),e([s(re(i(G)))],pe.prototype,"popupEnabled",void 0),e([s({type:t,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],pe.prototype,"popupTemplate",void 0),e([s({type:Number,json:{write:{overridePolicy:ae}}})],pe.prototype,"refreshInterval",void 0),e([s({types:o,json:{name:"layerDefinition.drawingInfo.renderer",write:ne()}})],pe.prototype,"renderer",null),e([s()],pe.prototype,"source",void 0),e([s()],pe.prototype,"spatialReference",null),e([s({type:String,json:{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],pe.prototype,"title",null),e([p("title")],pe.prototype,"writeTitle",null),e([s({json:{read:!1}})],pe.prototype,"type",void 0),e([s(re(i(M)))],pe.prototype,"useViewTime",void 0),e([s({type:Boolean,json:{name:"visibility",write:ne()}})],pe.prototype,"visible",void 0),pe=e([a("esri.layers.knowledgeGraph.KnowledgeGraphSublayer")],pe);const le=pe;export{le as default};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
+ */
5
+ import{fetchClientDataAtKeys as e}from"../../rest/knowledgeGraphService.js";const a={initializeLayersFromClientData:async(a,t)=>{if(t||(t=[...a.layers,...a.tables].map((e=>e.graphTypeName))),0===t?.length)return;const n=new Map;for(const e of t)n.set(e,r(a,e));const o=await e(a.dataManager.knowledgeGraph,Array.from(n.values()));for(const e of[...a.layers,...a.tables]){const t=e.objectType.name;if(null===t)continue;const n=o.get(r(a,t));if(n){const a=JSON.parse(n);e.read(a,{origin:"service"})}}}},r=(e,a)=>"knowledge-graph"===e.type?`${a}/Map`:`${a}/LinkChart/LinkChartSubLayer`;async function t(e,r){return a.initializeLayersFromClientData(e,r)}export{t as initializeLayersFromClientData,a as layerUtils};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.31.0-next.20240712",
3
+ "version": "4.31.0-next.20240713",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
+ */
5
+ var e,t,i,n;!function(e){e[e.ClientDataKeyTypeUNSPECIFIED=0]="ClientDataKeyTypeUNSPECIFIED",e[e.ClientDataKeyTypeString=1]="ClientDataKeyTypeString"}(e||(e={})),function(e){e[e.ClientDataTypeUNSPECIFIED=0]="ClientDataTypeUNSPECIFIED",e[e.ClientDataTypeString=1]="ClientDataTypeString"}(t||(t={})),function(e){e[e.Unspecified=0]="Unspecified",e[e.ClientData=1]="ClientData",e[e.NotModified=2]="NotModified"}(i||(i={})),function(e){e[e.Unspecified=0]="Unspecified",e[e.Error=1]="Error",e[e.ClientDataValue=2]="ClientDataValue"}(n||(n={}));export{e as ClientDataKeyType,t as ClientDataType,i as DataValueCase,n as FetchResultCase};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
+ */
5
+ import{checkWasmError as e}from"./wasmUtils.js";function t(t,r,a,o=!1){const c=new a.ClientDataFetchRequestEncoder;c.deleteLater();for(const e of t){const t=n(e,r,a,o);c.add_client_data_fetch_request_parameter(t)}c.encode();const s=c.get_encoding_result();return e(s.error,"knowledge-graph:fetchClientDataAtKeys-encoding-failed","Attempting to encode the fetchClientDataAtKeys failed"),structuredClone(s.get_byte_buffer())}function n(e,t,n,r){const a=new n.ClientDataKey;a.deleteLater(),a.key_string=e;const o=new n.ClientDataFetchRequestParameter;o.deleteLater(),o.set_key(a);const c=t.get(e);return c&&!r&&(o.v_tag={v_tag:c.version}),o}export{n as clientDataKeyToWasmFetchRequestParam,t as encodeClientDataAtKeysRequest};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
+ */
5
+ import{FetchResultCase as e,DataValueCase as t,ClientDataKeyType as a}from"./WasmClientDataInterfaces.js";function n(a,n,_,s=!1){const r=new Map;for(let o=0;o<a.get_results_count();o++){const g=a.get_result_at(o);if(g.get_fetch_result_case().value!==e.ClientDataValue||0!==g.error().error_code){const e=g.get_key().key_string;_.has(e)&&n.delete(e);continue}const l=g.get_value(),i=g.get_key().key_string,c=_.get(i);let u;if(l.get_data_case().value===t.NotModified&&c)u=c.value;else{if(l.get_data_case().value!==t.ClientData)continue;{u=l.get_data().client_data_string;const e=g.get_value().get_v_tag().v_tag;s||n.set(i,{key:i,version:e,value:u})}}r.set(i,u)}return r}function _(e){const t=e.get_keys(),n=new Array;for(let _=0;_<t.get_keys_count();_++){const e=t.get_key_at(_);e.get_client_data_key_type().value===a.ClientDataKeyTypeString&&n.push(e.key_string)}return n}export{_ as wasmClientDataAllKeysResponseToClientDataKeys,n as wasmClientDataFetchResponseToClientData};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
+ */
5
+ import r from"../../../core/Error.js";function e(e,o,s){if(0!==e.error_code)throw new r(o,s,{errorCode:e.error_code,errorMessage:e.error_message})}export{e as checkWasmError};