/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["require","exports","../../chunks/_rollupPluginBabelHelpers","../../config","../../core/Logger"],(function(r,t,e,o,l){"use strict";const a=l.getLogger("esri.layers.support.fromPortalItem");function n(r){return i.apply(this,arguments)}function i(){return(i=e._asyncToGenerator((function*(t){const e="portalItem"in t?t:{portalItem:t},l=yield new Promise(((t,e)=>r(["../../portal/support/portalLayers"],t,e)));try{return yield l.fromItem(e)}catch(n){const r=e&&e.portalItem,t=r&&r.id||"unset",l=r&&r.portal&&r.portal.url||o.portalUrl;throw a.error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+l+"', id: '"+t+"')",n),n}}))).apply(this,arguments)}t.fromPortalItem=n,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
