/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","./guid"],(function(t,e){"use strict";
/*!
   * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
   * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
   * v1.0.0-beta.82
   */const n={autoTheme:"calcite-theme-auto",darkTheme:"calcite-theme-dark",lightTheme:"calcite-theme-light",rtl:"calcite--rtl"},r={loading:"Loading"};function o(t){return t?t.id=t.id||`${t.tagName.toLowerCase()}-${e.guid()}`:""}function l(t){return Array.isArray(t)?t:Array.from(t)}function i(t){const e=m(t,`.${n.darkTheme}, .${n.lightTheme}`);return(null==e?void 0:e.classList.contains("calcite-theme-dark"))?"dark":"light"}function u(t){const e="dir",n=m(t,`[${e}]`);return n?n.getAttribute(e):"ltr"}function c(t,e,n){const r=`[${e}]`,o=t.closest(r);return o?o.getAttribute(e):n}function s(t){return t.getRootNode()}function a(t){return t.host||null}function f(t,e){function n(t,r){if(!t)return r;t.assignedSlot&&(t=t.assignedSlot);const o=s(t),l=Array.from(o.querySelectorAll(e)).filter((t=>!r.includes(t)));r=[...r,...l];const i=a(o);return i?n(i,r):r}return n(t,[])}function d(t,{selector:e,id:n}){function r(t){if(!t)return null;t.assignedSlot&&(t=t.assignedSlot);const o=s(t),l=n?"getElementById"in o?o.getElementById(n):null:e?o.querySelector(e):null,i=a(o);return l||(i?r(i):null)}return r(t)}function m(t,e){function n(t){return t?t.closest(e)||n(a(s(t))):null}return n(t)}function h(t){return"function"==typeof(null==t?void 0:t.setFocus)}async function y(t){if(t)return h(t)?t.setFocus():t.focus()}const g=":not([slot])";function A(t,e,n){e&&!Array.isArray(e)&&"string"!=typeof e&&(n=e,e=null);const r=e?Array.isArray(e)?e.map((t=>`[slot="${t}"]`)).join(","):`[slot="${e}"]`:g;return(null==n?void 0:n.all)?v(t,r,n):p(t,r,n)}function S(t,e){return t?Array.from(t.children||[]).filter((t=>null==t?void 0:t.matches(e))):[]}function v(t,e,n){let r=e===g?S(t,g):Array.from(t.querySelectorAll(e));r=n&&!1===n.direct?r:r.filter((e=>e.parentElement===t)),r=(null==n?void 0:n.matches)?r.filter((t=>null==t?void 0:t.matches(n.matches))):r;const o=null==n?void 0:n.selector;return o?r.map((t=>Array.from(t.querySelectorAll(o)))).reduce(((t,e)=>[...t,...e]),[]).filter((t=>!!t)):r}function p(t,e,n){let r=e===g?S(t,g)[0]||null:t.querySelector(e);r=n&&!1===n.direct||(null==r?void 0:r.parentElement)===t?r:null,r=(null==n?void 0:n.matches)?(null==r?void 0:r.matches(n.matches))?r:null:r;const o=null==n?void 0:n.selector;return o?null==r?void 0:r.querySelector(o):r}function E(t,e){return Array.from(t.children).filter((t=>t.matches(e)))}function T(t,e,n){return"string"==typeof e&&""!==e?e:""===e?t[n]:void 0}function q(t,e){return!(e.left>t.right||e.right<t.left||e.top>t.bottom||e.bottom<t.top)}function $(t){return(!!t).toString()}t.CSS_UTILITY=n,t.TEXT=r,t.closestElementCrossShadowBoundary=m,t.ensureId=o,t.filterDirectChildren=E,t.focusElement=y,t.getElementDir=u,t.getElementProp=c,t.getSlotted=A,t.getThemeName=i,t.intersects=q,t.isCalciteFocusable=h,t.nodeListToArray=l,t.queryElementRoots=d,t.queryElementsRoots=f,t.setRequestedIcon=T,t.toAriaBoolean=$}));
