{"size": 30667, "ext": "js", "max_stars_repo_path": "assets/assets/esri/core/workers/chunks/640eee272c7c8e9aefd4.js", "max_stars_repo_name": "Dphalos/cim-symbol-builder-js", "max_stars_repo_stars_event_min_datetime": "2022-03-28T07:38:44.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-28T07:38:44.000Z", "max_issues_repo_path": "assets/assets/esri/core/workers/chunks/640eee272c7c8e9aefd4.js", "max_issues_repo_name": "Dphalos/cim-symbol-builder-js", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "assets/assets/esri/core/workers/chunks/640eee272c7c8e9aefd4.js", "max_forks_repo_name": "Dphalos/cim-symbol-builder-js", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 30667.0, "max_line_length": 30667, "alphanum_fraction": 0.6551994}
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7779],{91460:(e,t,r)=>{function n(e){return e&&("function"==typeof e.on||"function"==typeof e.addEventListener)}function i(e,t,r){if(!n(e))throw new TypeError("target is not a Evented or EventTarget object");if("on"in e)return e.on(t,r);if(Array.isArray(t)){const n=t.slice();for(const t of n)e.addEventListener(t,r);return{remove(){for(const t of n)e.removeEventListener(t,r)}}}return e.addEventListener(t,r),{remove(){e.removeEventListener(t,r)}}}function o(e,t,r){if(!n(e))throw new TypeError("target is not a Evented or EventTarget object");if("once"in e)return e.once(t,r);const o=i(e,t,(t=>{o.remove(),r.call(e,t)}));return{remove(){o.remove()}}}r.d(t,{vT:()=>n,on:()=>i,IH:()=>o})},95330:(e,t,r)=>{r.d(t,{e4:()=>S,$6:()=>l,Ue:()=>c,zE:()=>u,dD:()=>x,hh:()=>j,vr:()=>q,Ds:()=>U,as:()=>C,WW:()=>O,R8:()=>w,D_:()=>v,Hc:()=>d,tI:()=>$,y8:()=>I,fu:()=>y,$F:()=>g,d1:()=>k,DB:()=>_,r9:()=>m,k_:()=>p,H9:()=>f,Yn:()=>R,gx:()=>P,Hl:()=>b});const n=(i=globalThis,{setTimeout:(e,t)=>{const r=i.setTimeout(e,t);return{remove:()=>i.clearTimeout(r)}}});var i,o=r(20102),s=r(91460),a=(r(92604),r(70586));function l(e){return Promise.all(e)}function c(e){return new Promise(((t,r)=>{try{e(t,r)}catch(e){Promise.resolve().then((()=>r(e)))}}))}function u(e="Aborted"){return new o.Z("AbortError",e)}function p(e,t="Aborted"){if(d(e))throw u(t)}function h(e){return(0,a.pC)(e)?"aborted"in e?e:e.signal:e}function d(e){const t=h(e);return(0,a.pC)(t)&&t.aborted}function m(e){if(v(e))throw e}function f(e){if(!v(e))throw e}function y(e,t){const r=h(e);if(!(0,a.Wi)(r)){if(!r.aborted)return(0,s.IH)(r,"abort",(()=>t()));t()}}function g(e,t){const r=h(e);if(!(0,a.Wi)(r))return p(r),(0,s.IH)(r,"abort",(()=>t(u())))}function b(e,t){const r=h(t);return(0,a.Wi)(r)?e:new Promise(((r,n)=>{let i=y(t,(()=>n(u())));const o=()=>i=(0,a.hw)(i);e.then(o,o),e.then(r,n)}))}function v(e){return e&&"AbortError"===e.name}function w(e){return e.catch((e=>{if(!v(e))throw e}))}function x(){let e=null;const t=new Promise(((t,r)=>{e={promise:void 0,resolve:t,reject:r}}));return e.promise=t,e}function C(e){if(!e)return;if("function"!=typeof e.forEach){const t=Object.keys(e);return C(t.map((t=>e[t]))).then((e=>{const r={};return t.forEach(((t,n)=>r[t]=e[n])),r}))}const t=e;return c((e=>{const r=[];let n=t.length;0===n&&e(r),t.forEach((t=>{const i={promise:t||Promise.resolve(t)};r.push(i),i.promise.then((e=>{i.value=e})).catch((e=>{i.error=e})).then((()=>{--n,0===n&&e(r)}))}))}))}function O(e){return C(e).then((e=>e.filter((e=>!!e.value)).map((e=>e.value))))}function k(e){return Promise.reject(e)}function _(e){return Promise.resolve(e)}function S(e,t,r){const n=new AbortController;return y(r,(()=>n.abort())),new Promise(((r,i)=>{let o=setTimeout((()=>{o=0,r(t)}),e);y(n,(()=>{o&&(clearTimeout(o),i(u()))}))}))}function I(e){return e&&"function"==typeof e.then}function P(e){return $(e)?e:Promise.resolve(e)}function $(e){return e&&"object"==typeof e&&"then"in e&&"function"==typeof e.then}function U(e,t=-1){let r,n,i,o,s=null;const l=(...c)=>{if(r){n=c,o&&o.reject(u()),o=x();const e=(0,a.j0)(o.promise);if(s){const e=s;s=null,e.abort()}return e}if(i=o||x(),o=null,t>0){const n=new AbortController;r=P(e(...c,n.signal));const i=r;S(t).then((()=>{r===i&&(o?n.abort():s=n)}))}else r=1,r=P(e(...c));const p=()=>{const e=n;n=i=r=s=null,null!=e&&l(...e)},h=r,d=i;return h.then(p,p),h.then(d.resolve,d.reject),(0,a.j0)(d.promise)};return l}function j(){let e,t;const r=new Promise(((r,n)=>{e=r,t=n})),i=t=>{e(t)};return i.resolve=t=>e(t),i.reject=e=>t(e),i.timeout=(e,t)=>n.setTimeout((()=>i.reject(t)),e),i.promise=r,i}function q(e,t){let r,n=new AbortController;const i=e(n.signal);let o={promise:i,finished:!1,abort:()=>{n&&(n.abort(),n=null)}};const s=()=>{o&&(o.finished=!0,o=null),(0,a.pC)(r)&&(r.remove(),r=null),n=null};return i.then(s,s),r=y(t,(()=>{(0,a.pC)(o)&&o.abort()})),o}function R(e){return Promise.resolve().then((()=>{p(e)}))}},17452:(e,t,r)=>{r.d(t,{R9:()=>b,qg:()=>I,tD:()=>j,ZN:()=>ce,fl:()=>ue,AX:()=>x,Gd:()=>v,Ie:()=>se,sJ:()=>V,AH:()=>z,vt:()=>ie,oh:()=>L,P$:()=>Z,Ml:()=>pe,ed:()=>q,b7:()=>S,D6:()=>E,tm:()=>R,YP:()=>M,jc:()=>W,HK:()=>G,$U:()=>X,oC:()=>Q,kl:()=>N,v_:()=>K,hF:()=>A,_l:()=>B,PF:()=>J,Fv:()=>D,B7:()=>_,u0:()=>O,Yd:()=>ne,Hu:()=>le,Qj:()=>oe,hO:()=>ee,mN:()=>C});var n=r(68773),i=r(20102),o=r(92604),s=r(70586);const a=o.Z.getLogger("esri.core.urlUtils"),l=n.Z.request,c="esri/config: esriConfig.request.proxyUrl is not set.",u=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,p=/^\s*http:/i,h=/^\s*https:/i,d=/^\s*file:/i,m=/:\d+$/,f=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,y=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),g=new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");class b{constructor(e=""){this.uri=e,this.scheme=null,this.authority=null,this.path=null,this.query=null,this.fragment=null,this.user=null,this.password=null,this.host=null,this.port=null;let t=(0,s.j0)(this.uri.match(y));this.scheme=t[2]||(t[1]?"":null),this.authority=t[4]||(t[3]?"":null),this.path=t[5],this.query=t[7]||(t[6]?"":null),this.fragment=t[9]||(t[8]?"":null),null!=this.authority&&(t=(0,s.j0)(this.authority.match(g)),this.user=t[3]||null,this.password=t[4]||null,this.host=t[6]||t[7],this.port=t[9]||null)}toString(){return this.uri}}const v=new b(n.Z.applicationUrl),w={},x=(()=>{const e=(0,s.j0)(v.path),t=e.substring(0,e.lastIndexOf(e.split("/")[e.split("/").length-1]));return`${v.scheme}://${v.host}${null!=v.port?`:${v.port}`:""}${t}`})();function C(e){const t={path:null,query:null},r=new b(e),n=e.indexOf("?");return null===r.query?t.path=e:(t.path=e.substring(0,n),t.query=O(r.query)),r.fragment&&(t.hash=r.fragment,null===r.query&&(t.path=t.path.substring(0,t.path.length-(r.fragment.length+1)))),t}function O(e){const t=e.split("&"),r={};for(const e of t){if(!e)continue;const t=e.indexOf("=");let n,i;t<0?(n=decodeURIComponent(e),i=""):(n=decodeURIComponent(e.slice(0,t)),i=decodeURIComponent(e.slice(t+1)));let o=r[n];"string"==typeof o&&(o=r[n]=[o]),Array.isArray(o)?o.push(i):r[n]=i}return r}function k(e){return e&&"object"==typeof e&&"toJSON"in e&&"function"==typeof e.toJSON}function _(e,t){return e?t&&"function"==typeof t?Object.keys(e).map((r=>encodeURIComponent(r)+"="+encodeURIComponent(t(r,e[r])))).join("&"):Object.keys(e).map((r=>{const n=e[r];if(null==n)return"";const i=encodeURIComponent(r)+"=",o=t&&t[r];return o?i+encodeURIComponent(o(n)):Array.isArray(n)?n.map((e=>k(e)?i+encodeURIComponent(JSON.stringify(e)):i+encodeURIComponent(e))).join("&"):k(n)?i+encodeURIComponent(JSON.stringify(n)):i+encodeURIComponent(n)})).filter((e=>e)).join("&"):""}function S(e=!1){let t,r=l.proxyUrl;if("string"==typeof e){t=X(e);const n=q(e);n&&(r=n.proxyUrl)}else t=!!e;if(!r)throw a.warn(c),new i.Z("urlutils:proxy-not-set",c);return t&&te()&&(r=ee(r)),C(r)}function I(e){const t=q(e);let r,n;if(t){const e=$(t.proxyUrl);r=e.path,n=e.query?O(e.query):null}if(r){const t=C(e);e=r+"?"+t.path;const i=_({...n,...t.query});i&&(e=`${e}?${i}`)}return e}const P={path:"",query:""};function $(e){const t=e.indexOf("?");return-1!==t?(P.path=e.slice(0,t),P.query=e.slice(t+1)):(P.path=e,P.query=null),P}function U(e){return(e=re(e=function(e){return e&&"/"===e[e.length-1]?e:`${e}/`}(e=$(e).path),!0)).toLowerCase()}function j(e){const t={proxyUrl:e.proxyUrl,urlPrefix:U(e.urlPrefix)},r=l.proxyRules,n=t.urlPrefix;let i=r.length;for(let e=0;e<r.length;e++){const t=r[e].urlPrefix;if(0===n.indexOf(t)){if(n.length===t.length)return-1;i=e;break}0===t.indexOf(n)&&(i=e+1)}return r.splice(i,0,t),i}function q(e){const t=l.proxyRules,r=U(e);for(let e=0;e<t.length;e++)if(0===r.indexOf(t[e].urlPrefix))return t[e]}function R(e,t){return e=T(e),t=T(t),re(e)===re(t)}function T(e){const t=(e=D(e)).indexOf("/sharing");return t>0?e.substring(0,t):e.replace(/\/+$/,"")}function L(e){const t=t=>null==t||t instanceof RegExp&&t.test(e)||"string"==typeof t&&e.startsWith(t),r=l.interceptors;if(r)for(const e of r)if(Array.isArray(e.urls)){if(e.urls.some(t))return e}else if(t(e.urls))return e;return null}function E(e,t,r=!1){const n=ae(e),i=ae(t);return!(!r&&n.scheme!==i.scheme)&&null!=n.host&&null!=i.host&&n.host.toLowerCase()===i.host.toLowerCase()&&n.port===i.port}function N(e){if("string"==typeof e){if(!M(e))return!0;e=ae(e)}if(E(e,v))return!0;const t=l.trustedServers||[];for(let r=0;r<t.length;r++){const n=F(t[r]);for(let t=0;t<n.length;t++)if(E(e,n[t]))return!0}return!1}function F(e){return w[e]||(Y(e)||Q(e)?w[e]=[new b(A(e))]:w[e]=[new b(`http://${e}`),new b(`https://${e}`)]),w[e]}function A(e,t=x,r){return Q(e)?r&&r.preserveProtocolRelative?e:"http"===v.scheme&&v.authority===Z(e).slice(2)?`http:${e}`:`https:${e}`:Y(e)?e:(0,s.j0)(K("/"===e[0]?function(e){const t=e.indexOf("//"),r=e.indexOf("/",t+2);return-1===r?e:e.slice(0,r)}(t):t,e))}function J(e,t=x,r){if(!M(e))return e;const n=D(e),i=n.toLowerCase(),o=D(t).toLowerCase().replace(/\/+$/,""),s=r?D(r).toLowerCase().replace(/\/+$/,""):null;if(s&&0!==o.indexOf(s))return e;const a=(e,t,r)=>-1===(r=e.indexOf(t,r))?e.length:r;let l=a(i,"/",i.indexOf("//")+2),c=-1;for(;i.slice(0,l+1)===o.slice(0,l)+"/"&&(c=l+1,l!==i.length);)l=a(i,"/",l+1);if(-1===c)return e;if(s&&c<s.length)return e;e=n.slice(c);const u=o.slice(c-1).replace(/[^/]+/g,"").length;if(u>0)for(let t=0;t<u;t++)e=`../${e}`;else e=`./${e}`;return e}function D(e){return function(e){const t=l.httpsDomains;if(!function(e){return p.test(e)||"http"===v.scheme&&Q(e)}(e))return e;const r=e.indexOf("/",7);let n;if(n=-1===r?e:e.slice(0,r),n=n.toLowerCase().slice(7),m.test(n)){if(!n.endsWith(":80"))return e;n=n.slice(0,-3),e=e.replace(":80","")}return"http"===v.scheme&&n===v.authority&&!f.test(e)||(te()&&n===v.authority||t&&t.some((e=>n===e||n.endsWith(`.${e}`)))||te()&&!q(e))&&(e=ee(e)),e}(e=function(e){return e.replace(/^(https?:\/\/)(arcgis\.com)/i,"$1www.$2")}(e=function(e){if(/^https?:\/\//i.test(e)){const t=$(e);e=(e=t.path.replace(/\/{2,}/g,"/")).replace("/","//"),t.query&&(e+=`?${t.query}`)}return e}(e=A(e=e.trim()))))}function K(...e){const t=e.filter(s.pC);if(!t||!t.length)return;const r=[];if(M(t[0])){const e=t[0],n=e.indexOf("//");-1!==n&&(r.push(e.slice(0,n+1)),function(e){return d.test(e)}(t[0])&&(r[0]+="/"),t[0]=e.slice(n+2))}else"/"===t[0][0]&&r.push("");const n=t.reduce(((e,t)=>t?e.concat(t.split("/")):e),[]);for(let e=0;e<n.length;e++){const t=n[e];".."===t&&r.length>0&&".."!==r[r.length-1]?r.pop():(!t&&e===n.length-1||t&&("."!==t||0===r.length))&&r.push(t)}return r.join("/")}function Z(e,t=!1){if(W(e)||G(e))return null;let r=e.indexOf("://");if(-1===r&&Q(e))r=2;else{if(-1===r)return null;r+=3}const n=e.indexOf("/",r);return-1!==n&&(e=e.slice(0,n)),t&&(e=re(e,!0)),e}function M(e){return Q(e)||Y(e)}function W(e){return null!=e&&"blob:"===e.slice(0,5)}function G(e){return"data:"===e.slice(0,5)}function z(e){const t=V(e);if(!t||!t.isBase64)return null;const r=atob(t.data),n=new Uint8Array(r.length);for(let e=0;e<r.length;e++)n[e]=r.charCodeAt(e);return n.buffer}const H=/^data:(.*?)(;base64)?,(.*)$/;function V(e){const t=e.match(H);if(!t)return null;const[,r,n,i]=t;return{mediaType:r,isBase64:!!n,data:i}}function B(e){return e.isBase64?`data:${e.mediaType};base64,${e.data}`:`data:${e.mediaType},${e.data}`}function Q(e){return null!=e&&void 0!==e&&"/"===e[0]&&"/"===e[1]}function Y(e){return u.test(e)}function X(e){return h.test(e)||"https"===v.scheme&&Q(e)}function ee(e){return Q(e)?`https:${e}`:e.replace(p,"https:")}function te(){return"https"===v.scheme}function re(e,t=!1){return Q(e)?e.slice(2):(e=e.replace(u,""),t&&e.length>1&&"/"===e[0]&&"/"===e[1]&&(e=e.slice(2)),e)}function ne(e){let t=0;if(M(e)){const r=e.indexOf("//");-1!==r&&(t=r+2)}const r=e.lastIndexOf("/");return r<t?e:e.slice(0,r+1)}function ie(e,t){if(!e)return"";const r=C(e).path.replace(/\/+$/,""),n=r.substring(r.lastIndexOf("/")+1);if(null==t||!t.length)return n;const i=new RegExp(`.(${t.join("|")})$`,"ig");return n.replace(i,"")}function oe(e){return e.replace(/\/+$/,"")}function se(e,t,r){if(!(t&&r&&e&&M(e)))return e;const n=e.indexOf("//"),i=e.indexOf("/",n+2),o=e.indexOf(":",n+2),s=Math.min(i<0?e.length:i,o<0?e.length:o);return e.slice(n+2,s).toLowerCase()!==t.toLowerCase()?e:`${e.slice(0,n+2)}${r}${e.slice(s)}`}function ae(e){return"string"==typeof e?new b(A(e)):(e.scheme||(e.scheme=v.scheme),e)}function le(e,t){const r=C(e),n=Object.keys(r.query||{});return n.length>0&&t&&t.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${n.join(", ")}.`),r.path}function ce(e,t,r){const n=C(e),i=n.query||{};return i[t]=String(r),`${n.path}?${_(i)}`}function ue(e,t){const r=C(e),n=r.query||{};for(const e in t)n[e]=t[e];const i=_(n);return i?`${r.path}?${i}`:r.path}function pe(e){if((0,s.Wi)(e))return null;const t=e.match(he);return t?t[1]:null}const he=/.*?\.([^\/]*)$/},15235:(e,t,r)=>{r.r(t),r.d(t,{default:()=>I});var n=r(43697),i=r(99880),o=r(20102),s=r(10736),a=r(22974),l=r(83379),c=r(70586),u=r(17452),p=r(5600),h=r(75215),d=r(71715),m=r(52011),f=r(6570),y=r(65587),g=r(15923),b=r(92604),v=(r(67676),r(80442),r(90578));const w=b.Z.getLogger("esri.portal.PortalItemResource");let x=class extends g.Z{constructor(e){super(e),this.portalItem=null}normalizeCtorArgs(e){return e&&e.portalItem&&e.path?{...e,path:this.normalizePath(e.path,e.portalItem)}:e}set path(e){(0,c.pC)(e)&&(0,u.YP)(e)?w.error("portalitemresource:invalid-path","A portal item resource path must be relative"):this._set("path",e)}_castPath(e){return this.normalizePath(e,this.portalItem)}get url(){return this.portalItem&&this.path?`${this.portalItem.itemUrl}/resources/${this.path}`:null}get itemRelativeUrl(){return this.portalItem&&this.path?`./resources/${this.path}`:null}fetch(e="json",t){const r=this.url;if((0,c.Wi)(r))throw new o.Z("portal-item-resource:fetch","Portal item resource does not refer to a valid item or path");return this.portalItem.portal._request(r,{responseType:e,query:{token:this.portalItem.apiKey},signal:(0,c.U2)(t,"signal")})}async update(e,t){return(await r.e(7873).then(r.bind(r,97873))).addOrUpdateResource(this,"update",e,t)}hasPath(){return(0,c.pC)(this.path)}normalizePath(e,t){return(0,c.Wi)(e)?e:(e=e.replace(/^\/+/,""),(0,c.pC)(t)&&(0,u.YP)(e)&&(e=(0,u.PF)(e,t.itemUrl)),e.replace(/^\/+/,"").replace(/^(\.\/)?resources\//,""))}};(0,n._)([(0,p.Cb)()],x.prototype,"portalItem",void 0),(0,n._)([(0,p.Cb)({type:String,value:null})],x.prototype,"path",null),(0,n._)([(0,v.p)("path")],x.prototype,"_castPath",null),(0,n._)([(0,p.Cb)({type:String,readOnly:!0})],x.prototype,"url",null),(0,n._)([(0,p.Cb)({type:String,readOnly:!0})],x.prototype,"itemRelativeUrl",null),x=(0,n._)([(0,m.j)("esri.portal.PortalItemResource")],x);const C=x;let O=class extends g.Z{constructor(e){super(e),this.created=null,this.rating=null}};(0,n._)([(0,p.Cb)()],O.prototype,"created",void 0),(0,n._)([(0,p.Cb)()],O.prototype,"rating",void 0),O=(0,n._)([(0,m.j)("esri.portal.PortalRating")],O);const k=O;var _;let S=_=class extends((0,s.eC)(l.Z)){constructor(e){super(e),this.access=null,this.accessInformation=null,this.apiKey=null,this.applicationProxies=null,this.avgRating=null,this.categories=null,this.created=null,this.culture=null,this.description=null,this.extent=null,this.groupCategories=null,this.id=null,this.itemControl=null,this.licenseInfo=null,this.modified=null,this.name=null,this.numComments=null,this.numRatings=null,this.numViews=null,this.owner=null,this.ownerFolder=null,this.portal=null,this.screenshots=null,this.size=null,this.snippet=null,this.sourceJSON=null,this.tags=null,this.title=null,this.type=null,this.typeKeywords=null,this.url=null}static from(e){return(0,h.TJ)(_,e)}destroy(){this.portal=null}get displayName(){const e=this.type,t=this.typeKeywords||[];let r=e;return"Feature Service"===e||"Feature Collection"===e?r=t.indexOf("Table")>-1?"Table":t.indexOf("Route Layer")>-1?"Route Layer":t.indexOf("Markup")>-1?"Markup":"Feature Layer":"Image Service"===e?r=t.indexOf("Elevation 3D Layer")>-1?"Elevation Layer":t.indexOf("Tiled Imagery")>-1?"Tiled Imagery Layer":"Imagery Layer":"Scene Service"===e?r="Scene Layer":"Scene Package"===e?r="Scene Layer Package":"Stream Service"===e?r="Feature Layer":"Geoprocessing Service"===e&&this.portal&&this.portal.isPortal?r=t.indexOf("Web Tool")>-1?"Tool":"Geoprocessing Service":"Geocoding Service"===e?r="Locator":"Geoenrichment Service"===e?r="GeoEnrichment Service":"Microsoft Powerpoint"===e?r="Microsoft PowerPoint":"GeoJson"===e?r="GeoJSON":"Globe Service"===e?r="Globe Layer":"Vector Tile Service"===e?r="Tile Layer":"netCDF"===e?r="NetCDF":"Map Service"===e?r=-1===t.indexOf("Spatiotemporal")&&(t.indexOf("Hosted Service")>-1||t.indexOf("Tiled")>-1)&&-1===t.indexOf("Relational")?"Tile Layer":"Map Image Layer":e&&e.toLowerCase().indexOf("add in")>-1?r=e.replace(/(add in)/gi,"Add-In"):"datastore catalog service"===e?r="Big Data File Share":"Compact Tile Package"===e?r="Tile Package (tpkx)":"OGCFeatureServer"===e&&(r="OGC Feature Layer"),r}readExtent(e){return e&&e.length?new f.Z(e[0][0],e[0][1],e[1][0],e[1][1]):null}get iconUrl(){const e=this.type&&this.type.toLowerCase()||"",t=this.typeKeywords||[];let r,n=!1,o=!1,s=!1,a=!1,l=!1,c=!1;return e.indexOf("service")>0||"feature collection"===e||"kml"===e||"wms"===e||"wmts"===e||"wfs"===e?(n=t.indexOf("Hosted Service")>-1,"feature service"===e||"feature collection"===e||"kml"===e||"wfs"===e?(o=t.indexOf("Table")>-1,s=t.indexOf("Route Layer")>-1,a=t.indexOf("Markup")>-1,l=-1!==t.indexOf("Spatiotemporal"),c=-1!==t.indexOf("UtilityNetwork"),r=l&&o?"spatiotemporaltable":o?"table":s?"routelayer":a?"markup":l?"spatiotemporal":n?"featureshosted":c?"utilitynetwork":"features"):r="map service"===e||"wms"===e||"wmts"===e?n||t.indexOf("Tiled")>-1||"wmts"===e?"maptiles":"mapimages":"scene service"===e?t.indexOf("Line")>-1?"sceneweblayerline":t.indexOf("3DObject")>-1?"sceneweblayermultipatch":t.indexOf("Point")>-1?"sceneweblayerpoint":t.indexOf("IntegratedMesh")>-1?"sceneweblayermesh":t.indexOf("PointCloud")>-1?"sceneweblayerpointcloud":t.indexOf("Polygon")>-1?"sceneweblayerpolygon":t.indexOf("Building")>-1?"sceneweblayerbuilding":t.indexOf("Voxel")>-1?"sceneweblayervoxel":"sceneweblayer":"image service"===e?t.indexOf("Elevation 3D Layer")>-1?"elevationlayer":t.indexOf("Tiled Imagery")>-1?"tiledimagerylayer":"imagery":"stream service"===e?"streamlayer":"vector tile service"===e?"vectortile":"datastore catalog service"===e?"datastorecollection":"geocoding service"===e?"geocodeservice":"geoprocessing service"===e&&t.indexOf("Web Tool")>-1&&this.portal&&this.portal.isPortal?"tool":"layers"):r="web map"===e||"cityengine web scene"===e?"maps":"web scene"===e?t.indexOf("ViewingMode-Local")>-1?"webscenelocal":"websceneglobal":"web mapping application"===e||"mobile application"===e||"application"===e||"operation view"===e||"desktop application"===e?"apps":"map document"===e||"map package"===e||"published map"===e||"scene document"===e||"globe document"===e||"basemap package"===e||"mobile basemap package"===e||"mobile map package"===e||"project package"===e||"project template"===e||"pro map"===e||"layout"===e||"layer"===e&&t.indexOf("ArcGIS Pro")>-1||"explorer map"===e&&t.indexOf("Explorer Document")?"mapsgray":"service definition"===e||"csv"===e||"shapefile"===e||"cad drawing"===e||"geojson"===e||"360 vr experience"===e||"netcdf"===e||"administrative report"===e?"datafiles":"explorer add in"===e||"desktop add in"===e||"windows viewer add in"===e||"windows viewer configuration"===e?"appsgray":"arcgis pro add in"===e||"arcgis pro configuration"===e?"addindesktop":"rule package"===e||"file geodatabase"===e||"sqlite geodatabase"===e||"csv collection"===e||"kml collection"===e||"windows mobile package"===e||"map template"===e||"desktop application template"===e||"gml"===e||"arcpad package"===e||"code sample"===e||"form"===e||"document link"===e||"earth configuration"===e||"operations dashboard add in"===e||"rules package"===e||"image"===e||"workflow manager package"===e||"explorer map"===e&&t.indexOf("Explorer Mapping Application")>-1||t.indexOf("Document")>-1?"datafilesgray":"network analysis service"===e||"geoprocessing service"===e||"geodata service"===e||"geometry service"===e||"geoprocessing package"===e||"locator package"===e||"geoprocessing sample"===e||"workflow manager service"===e?"toolsgray":"layer"===e||"layer package"===e||"explorer layer"===e?"layersgray":"scene package"===e?"scenepackage":"mobile scene package"===e?"mobilescenepackage":"tile package"===e||"compact tile package"===e?"tilepackage":"task file"===e?"taskfile":"report template"===e?"report-template":"statistical data collection"===e?"statisticaldatacollection":"insights workbook"===e?"workbook":"insights model"===e?"insightsmodel":"insights page"===e?"insightspage":"insights theme"===e?"insightstheme":"hub initiative"===e?"hubinitiative":"hubpage"===e?"hubpage":"hub event"===e?"hubevent":"hub site application"===e?"hubsite":"relational database connection"===e?"relationaldatabaseconnection":"big data file share"===e?"datastorecollection":"image collection"===e?"imagecollection":"style"===e?"style":"desktop style"===e?"desktopstyle":"dashboard"===e?"dashboard":"raster function template"===e?"rasterprocessingtemplate":"vector tile package"===e?"vectortilepackage":"ortho mapping project"===e?"orthomappingproject":"ortho mapping template"===e?"orthomappingtemplate":"solution"===e?"solutions":"geopackage"===e?"geopackage":"deep learning package"===e?"deeplearningpackage":"real time analytic"===e?"realtimeanalytics":"big data analytic"===e?"bigdataanalytics":"feed"===e?"feed":"excalibur imagery project"===e?"excaliburimageryproject":"notebook"===e?"notebook":"storymap"===e?"storymap":"survey123 add in"===e?"survey123addin":"mission"===e?"mission":"mission report"===e?"missionreport":"quickcapture project"===e?"quickcaptureproject":"pro report"===e?"proreport":"urban model"===e?"urbanmodel":"web experience"===e?"experiencebuilder":"web experience template"===e?"webexperiencetemplate":"workflow"===e?"workflow":"insights script"===e?"insightsscript":"kernel gateway connection"===e?"kernelgatewayconnection":"hub initiative template"===e?"hubinitiativetemplate":"storymap theme"===e?"storymaptheme":"knowledge graph"===e?"knowledgegraph":"native application"===e?"nativeapp":"native application installer"===e?"nativeappinstaller":"link chart"===e?"linkchart":"investigation"===e?"investigation":"ogcfeatureserver"===e?"features":"pro project"===e?"proproject":"insights workbook package"===e?"insightsworkbookpackage":"apache parquet"===e?"apacheparquet":"maps",r?(0,i.V)("esri/images/portal/"+r+"16.png"):null}get isLayer(){return["Map Service","Feature Service","Feature Collection","Scene Service","Image Service","Stream Service","Vector Tile Service","WMTS","WMS"].indexOf(this.type)>-1}get itemUrl(){const e=this.get("portal.restUrl");return e?e+"/content/items/"+this.id:null}get thumbnailUrl(){const e=this.itemUrl,t=this.thumbnail;return e&&t?this.portal._normalizeUrl(`${e}/info/${t}?f=json`):null}get userItemUrl(){const e=this.get("portal.restUrl");if(!e)return null;const t=this.owner||this.get("portal.user.username");return t?`${e}/content/users/${this.ownerFolder?`${t}/${this.ownerFolder}`:t}/items/${this.id}`:null}load(e){this.portal||(this.portal=y.Z.getDefault());const t=this.portal.load(e).then((()=>this.sourceJSON?this.sourceJSON:this.id&&this.itemUrl?this.portal._request(this.itemUrl,{signal:(0,c.pC)(e)?e.signal:null,query:{token:this.apiKey}}):{})).then((e=>{this.sourceJSON=e,this.read(e)}));return this.addResolvingPromise(t),Promise.resolve(this)}addRating(e){const t={method:"post",query:{}};return e instanceof k&&(e=e.rating),isNaN(e)||"number"!=typeof e||(t.query.rating=e),this.portal._request(this.itemUrl+"/addRating",t).then((()=>new k({rating:e,created:new Date})))}clone(){const e={access:this.access,accessInformation:this.accessInformation,applicationProxies:(0,a.d9)(this.applicationProxies),avgRating:this.avgRating,categories:(0,a.d9)(this.categories),created:(0,a.d9)(this.created),culture:this.culture,description:this.description,extent:(0,a.d9)(this.extent),groupCategories:(0,a.d9)(this.groupCategories),id:this.id,itemControl:this.itemControl,licenseInfo:this.licenseInfo,modified:(0,a.d9)(this.modified),name:this.name,numComments:this.numComments,numRatings:this.numRatings,numViews:this.numViews,owner:this.owner,ownerFolder:this.ownerFolder,portal:this.portal,screenshots:(0,a.d9)(this.screenshots),size:this.size,snippet:this.snippet,tags:(0,a.d9)(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:(0,a.d9)(this.typeKeywords),url:this.url};return this.loaded&&(e.loadStatus="loaded"),new _({sourceJSON:this.sourceJSON}).set(e)}createPostQuery(){const e=this.toJSON();for(const t in e)"tags"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"typeKeywords"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"extent"===t&&e[t]&&(e[t]=JSON.stringify(e[t]));return e}deleteRating(){return this.portal._request(this.itemUrl+"/deleteRating",{method:"post"}).then((()=>{}))}fetchData(e="json",t){return this.portal._request(this.itemUrl+"/data",{responseType:e,...t,query:{token:this.apiKey}})}fetchRating(e){return this.portal._request(this.itemUrl+"/rating",{query:{token:this.apiKey},...e}).then((e=>null!=e.rating?(e.created=new Date(e.created),new k(e)):null))}fetchRelatedItems(e,t){return this.portal._requestToTypedArray(this.itemUrl+"/relatedItems",{query:{...e,token:this.apiKey},...t},_)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}reload(){return this.portal._request(this.itemUrl,{cacheBust:!0,query:{token:this.apiKey}}).then((e=>(this.sourceJSON=e,this.read(e),this)))}update(e){return this.id?this.load().then((()=>this.portal._signIn())).then((()=>{const t=e&&e.data,r={method:"post"};r.query=this.createPostQuery();for(const e in r.query)null===r.query[e]&&(r.query[e]="");return r.query.clearEmptyFields=!0,null!=t&&("string"==typeof t?r.query.text=t:"object"==typeof t&&(r.query.text=JSON.stringify(t))),this.portal._request(`${this.userItemUrl}/update`,r).then((()=>this.reload()))})):Promise.reject(new o.Z("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}updateThumbnail(e){return this.id?this.load().then((()=>this.portal._signIn())).then((()=>{const t=e.thumbnail,r=e.filename,n={method:"post"};if("string"==typeof t)(0,u.HK)(t)?n.query={data:t}:n.query={url:(0,u.hF)(t)},(0,c.pC)(r)&&(n.query.filename=r);else{const e=new FormData;(0,c.pC)(r)?e.append("file",t,r):e.append("file",t),n.body=e}return this.portal._request(`${this.userItemUrl}/updateThumbnail`,n).then((()=>this.reload()))})):Promise.reject(new o.Z("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async fetchResources(e={},t){return(await r.e(7873).then(r.bind(r,97873))).fetchResources(this,e,t)}async addResource(e,t,n){const i=await r.e(7873).then(r.bind(r,97873));return e.portalItem=this,i.addOrUpdateResource(e,"add",t,n)}async removeResource(e,t){const n=await r.e(7873).then(r.bind(r,97873));if(e.portalItem&&e.portalItem.itemUrl!==this.itemUrl)throw new o.Z("removeresource:portal-item-mismatch","The portal item associated with the provided resource does not match the item");return n.removeResource(this,e,t)}async removeAllResources(e){return(await r.e(7873).then(r.bind(r,97873))).removeAllResources(this,e)}resourceFromPath(e){return new C({portalItem:this,path:e})}toJSON(){const e=this.extent,t={created:this.created&&this.created.getTime(),description:this.description,extent:e&&[[e.xmin,e.ymin],[e.xmax,e.ymax]],id:this.id,modified:this.modified&&this.modified.getTime(),name:this.name,owner:this.owner,ownerFolder:this.ownerFolder,snippet:this.snippet,tags:this.tags,thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:this.typeKeywords,url:this.url};return(0,a.yd)(t)}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");return new _({sourceJSON:e})}_getPostQuery(){const e=this.toJSON();for(const t in e)"tags"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"typeKeywords"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"extent"===t&&e[t]&&(e[t]=JSON.stringify(e[t]));return e}};(0,n._)([(0,p.Cb)({type:["private","shared","org","public"]})],S.prototype,"access",void 0),(0,n._)([(0,p.Cb)()],S.prototype,"accessInformation",void 0),(0,n._)([(0,p.Cb)({type:String})],S.prototype,"apiKey",void 0),(0,n._)([(0,p.Cb)({json:{read:{source:"appProxies"}}})],S.prototype,"applicationProxies",void 0),(0,n._)([(0,p.Cb)()],S.prototype,"avgRating",void 0),(0,n._)([(0,p.Cb)()],S.prototype,"categories",void 0),(0,n._)([(0,p.Cb)({type:Date})],S.prototype,"created",void 0),(0,n._)([(0,p.Cb)()],S.prototype,"culture",void 0),(0,n._)([(0,p.Cb)()],S.prototype,"description",void 0),(0,n._)([(0,p.Cb)({readOnly:!0})],S.prototype,"displayName",null),(0,n._)([(0,p.Cb)({type:f.Z})],S.prototype,"extent",void 0),(0,n._)([(0,d.r)("extent")],S.prototype,"readExtent",null),(0,n._)([(0,p.Cb)()],S.prototype,"groupCategories",void 0),(0,n._)([(0,p.Cb)({readOnly:!0})],S.prototype,"iconUrl",null),(0,n._)([(0,p.Cb)()],S.prototype,"id",void 0),(0,n._)([(0,p.Cb)({readOnly:!0})],S.prototype,"isLayer",null),(0,n._)([(0,p.Cb)()],S.prototype,"itemControl",void 0),(0,n._)([(0,p.Cb)({readOnly:!0})],S.prototype,"itemUrl",null),(0,n._)([(0,p.Cb)()],S.prototype,"licenseInfo",void 0),(0,n._)([(0,p.Cb)({type:Date})],S.prototype,"modified",void 0),(0,n._)([(0,p.Cb)()],S.prototype,"name",void 0),(0,n._)([(0,p.Cb)()],S.prototype,"numComments",void 0),(0,n._)([(0,p.Cb)()],S.prototype,"numRatings",void 0),(0,n._)([(0,p.Cb)()],S.prototype,"numViews",void 0),(0,n._)([(0,p.Cb)()],S.prototype,"owner",void 0),(0,n._)([(0,p.Cb)()],S.prototype,"ownerFolder",void 0),(0,n._)([(0,p.Cb)({type:y.Z})],S.prototype,"portal",void 0),(0,n._)([(0,p.Cb)()],S.prototype,"screenshots",void 0),(0,n._)([(0,p.Cb)()],S.prototype,"size",void 0),(0,n._)([(0,p.Cb)()],S.prototype,"snippet",void 0),(0,n._)([(0,p.Cb)()],S.prototype,"sourceJSON",void 0),(0,n._)([(0,p.Cb)()],S.prototype,"tags",void 0),(0,n._)([(0,p.Cb)()],S.prototype,"thumbnail",void 0),(0,n._)([(0,p.Cb)({readOnly:!0})],S.prototype,"thumbnailUrl",null),(0,n._)([(0,p.Cb)()],S.prototype,"title",void 0),(0,n._)([(0,p.Cb)()],S.prototype,"type",void 0),(0,n._)([(0,p.Cb)()],S.prototype,"typeKeywords",void 0),(0,n._)([(0,p.Cb)()],S.prototype,"url",void 0),(0,n._)([(0,p.Cb)({readOnly:!0})],S.prototype,"userItemUrl",null),S=_=(0,n._)([(0,m.j)("esri.portal.PortalItem")],S);const I=S}}]);