/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import l from"../../../../core/Error.js";import{fetchStyle as t,symbolUrlFromStyleItem as e}from"../../../../symbols/support/styleUtils.js";import{getStyleItemFromStyle as s,fetchSymbolFromStyle as n}from"../../../../symbols/support/webStyleSymbolUtils.js";async function r(r){if(null==r||null==r.styleName&&null==r.styleUrl)return null;const o=r.name;if(null==o)throw new l("symbolstyleutils:style-symbol-reference-name-missing","Missing name in style symbol reference");const u={portal:r.portal},i=await t(r,u).catch(()=>null);if(null===i)return null;const m=s(o,i.data);if(m&&!m.formatInfos?.some(l=>"gltf_basisu"===l.type))return null;const a=await n(i,o,u,e,{acceptedFormats:["web-gltf-basisu","web-gltf","web"]}).catch(()=>null);if(null===a||"point-3d"!==a.type)return null;const y=a.symbolLayers.items[0];return"object"===y.type?y.resource:null}export{r as getResourceUrlFromSymbolStyle};
