/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
import{c as t}from"./IJQZON2Z.js";export default $arcgis.t(([{watch:d}])=>{function w(n){n.el.childElem&&(n.el.childElem.ownedBy=n.el);let e=p(n);if(!e){let r=t(n);if(!r){f(n);return}return a(r,n,!0),r}return E(e,n.el.parent)||(n.el.parent=e,e.localName==="arcgis-expand"?g(e,n):a(e,n,!1)),e}function p({el:n}){for(let e=n.parentElement;e;e=e?.parentElement??null){if(c.has(e.localName))return e;if("ownedBy"in e&&e.ownedBy instanceof HTMLElement&&c.has(e.ownedBy.localName))return e.ownedBy}}var c=new Set(["arcgis-map","arcgis-scene","arcgis-link-chart","arcgis-expand"]);function E(n,e){return n!==e?!1:n.localName==="arcgis-expand"}function l(n,e,r="arcgisReady"){let o=n;if(o.view)e(o.view);else{let i=function(m){m.target===n&&(l(n,e,r),n.removeEventListener(r,i))};n.addEventListener(r,i)}}var g=(n,e)=>l(n,r=>{let o=u(e);if(e.el.shadowRoot?n.content=e.el:e.el.childElem&&n.content!=null&&o.append(e.el.childElem),e.el.view=r,n.referenceElement){e.referenceElement=n.referenceElement;return}d(()=>n.referenceElement,i=>{e.referenceElement=i},{once:!0})}),a=(n,e,r)=>l(n,o=>{r&&f(e),e.el.view=o,e.referenceElement=n},"arcgisViewReadyChange");function v(n){return n==null||n===""}function B(n,e){return n?.position===e?.position&&n?.heading===e.heading&&n?.tilt===e.tilt&&n?.fov===e.fov}function N(n,e){return e===void 0||n?.targetGeometry!==e?.targetGeometry||n?.rotation!==e?.rotation||n?.scale!==e?.scale}function L(n,e){return s(e?.center,n)}function s(n,e){if(typeof e=="string")return s(n,e.split(",").map(Number));if(!n)return e;if(Array.isArray(e)){let r=e[0],o=e[1],i=e.length>2?e[2]:void 0;if(r!==n.longitude||o!==n.latitude||i!==n.z)return e}else if(e&&!n?.equals(e))return e}function f(n){n.el.childElem&&u(n).append(n.el.childElem)}function u(n){return n.el.shadowRoot??n.el}var R=n=>n.el.childElem;async function x(n){let e=typeof n=="function"?n():n;e&&("setFocus"in e&&typeof e.setFocus=="function"?await e.setFocus():e instanceof HTMLElement&&e.focus())}return{a:w,b:v,c:B,d:N,e:L,f:s,g:R,h:x}},"core/reactiveUtils")