previewWebStyleSymbol-G67MG6BX.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import {
  2. t
  3. } from "./chunk-Z6GWVH7Z.js";
  4. import "./chunk-7XXXCK2A.js";
  5. import {
  6. u
  7. } from "./chunk-WEMIK25H.js";
  8. import "./chunk-JXW4QTJA.js";
  9. import "./chunk-XNLG7T2T.js";
  10. import "./chunk-IR4PV7VK.js";
  11. import {
  12. U
  13. } from "./chunk-VNFRAYHO.js";
  14. import "./chunk-R5IG2D6H.js";
  15. import "./chunk-VBRY5KJM.js";
  16. import "./chunk-IHXECKQQ.js";
  17. import "./chunk-ULGDPLM2.js";
  18. import "./chunk-EMJ4ZSM2.js";
  19. import "./chunk-IKP3YN53.js";
  20. import "./chunk-GZT4BVFP.js";
  21. import "./chunk-A5ICIBVI.js";
  22. // node_modules/@arcgis/core/symbols/support/previewWebStyleSymbol.js
  23. function n(e, i, n2) {
  24. const o = e.thumbnail && e.thumbnail.url;
  25. return o ? U(o, { responseType: "image" }).then((t2) => {
  26. const e2 = h(t2.data, n2);
  27. return n2 && n2.node ? (n2.node.appendChild(e2), n2.node) : e2;
  28. }) : e.fetchSymbol().then((t2) => i(t2, n2));
  29. }
  30. function h(t2, n2) {
  31. const h2 = !/\\.svg$/i.test(t2.src) && n2 && n2.disableUpsampling, o = Math.max(t2.width, t2.height);
  32. let r = n2 && n2.maxSize != null ? u(n2.maxSize) : t.maxSize;
  33. h2 && (r = Math.min(o, r));
  34. const s = typeof n2?.size == "number" ? n2?.size : null, m = Math.min(r, s != null ? u(s) : o);
  35. if (m !== o) {
  36. const e = t2.width !== 0 && t2.height !== 0 ? t2.width / t2.height : 1;
  37. e >= 1 ? (t2.width = m, t2.height = m / e) : (t2.width = m * e, t2.height = m);
  38. }
  39. return t2;
  40. }
  41. export {
  42. n as previewWebStyleSymbol
  43. };
  44. //# sourceMappingURL=previewWebStyleSymbol-G67MG6BX.js.map