import { h } from './index-6e901f57.js';
import { a as applyProps } from './Button-4b5dc519.js';
var Blockquote = function (props, children) { return (h("blockquote", Object.assign({}, applyProps(props, { class: 'ui-blockquote' })), children)); };
var Breadcrumbs = function (props, children) { return (h("ul", Object.assign({}, applyProps(props, { class: 'ui-breadcrumbs' })), children)); };
var __rest = (undefined && undefined.__rest) || function (s, e) {
    var t = {};
    for (var p in s)
        if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
            t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
var applyClasses = function (mobile, tablet, desktop, inlineBlock) {
    var classes = [];
    classes.push('ui-breakpoint');
    if (inlineBlock) {
        classes.push('ui-breakpoint-inline-block');
    }
    if (mobile) {
        classes.push('ui-breakpoint-mobile');
    }
    if (tablet) {
        classes.push('ui-breakpoint-tablet');
    }
    if (desktop) {
        classes.push('ui-breakpoint-desktop');
    }
    return classes.join(' ');
};
var Breakpoint = function (_a, children) {
    var _b = _a.mobile, mobile = _b === void 0 ? true : _b, _c = _a.tablet, tablet = _c === void 0 ? true : _c, _d = _a.desktop, desktop = _d === void 0 ? true : _d, _e = _a.inlineBlock, inlineBlock = _e === void 0 ? false : _e, props = __rest(_a, ["mobile", "tablet", "desktop", "inlineBlock"]);
    return h("div", Object.assign({}, applyProps(props, { class: applyClasses(mobile, tablet, desktop, inlineBlock) })), children);
};
var AnchorButton = function (props, children) { return h("a", Object.assign({}, applyProps(props, { class: 'ui-button' })), children); };
var Card = function (props, children) { return (h("div", Object.assign({}, applyProps(props, {
    class: "ui-card" + (props.embelish !== false ? ' ui-card--embelish' : ''),
})), children)); };
var CardContent = function (props, children) { return (h("div", Object.assign({}, applyProps(props, { class: 'ui-card-content' })), children)); };
var __rest$1 = (undefined && undefined.__rest) || function (s, e) {
    var t = {};
    for (var p in s)
        if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
            t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
var DateTime = function (_a) {
    var date = _a.date, _b = _a.format, format = _b === void 0 ? {
        weekday: 'short',
        year: 'numeric',
        month: 'long',
        day: 'numeric',
    } : _b, props = __rest$1(_a, ["date", "format"]);
    var formatter = new Intl.DateTimeFormat('en-US', Object.assign({}, format));
    return h("time", Object.assign({}, applyProps(props, { class: 'ui-date' })), formatter.format(date));
};
var __rest$2 = (undefined && undefined.__rest) || function (s, e) {
    var t = {};
    for (var p in s)
        if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
            t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
var applyClasses$1 = function (cols, xs, sm, md, lg) {
    var classes = [];
    // General class, doesn't apply column behavior but
    // can be useful for selectors
    classes.push('ui-col');
    if (cols) {
        classes.push("ui-col-" + cols);
    }
    else {
        // If no "cols" is specified, add a default 12 to make content go full width
        // in the smallest viewport sizes
        classes.push("ui-col-12");
    }
    if (xs) {
        classes.push("ui-col-xs-" + xs);
    }
    if (sm) {
        classes.push("ui-col-sm-" + sm);
    }
    if (md) {
        classes.push("ui-col-md-" + md);
    }
    if (lg) {
        classes.push("ui-col-lg-" + lg);
    }
    return classes.join(' ');
};
var Col = function (_a, children) {
    var cols = _a.cols, xs = _a.xs, sm = _a.sm, md = _a.md, lg = _a.lg, props = __rest$2(_a, ["cols", "xs", "sm", "md", "lg"]);
    return (h("div", Object.assign({}, applyProps(props, { class: applyClasses$1(cols, xs, sm, md, lg) })), children));
};
var __rest$3 = (undefined && undefined.__rest) || function (s, e) {
    var t = {};
    for (var p in s)
        if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
            t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
/*
interface GridProps {
  bordered?: boolean;

  xsCols?: number | null;
  smCols?: number | null;
  mdCols?: number | null;
  lgCols?: number | null;

  cols?: number;
  [key: string]: any;
}

const getColClasses = (
  xsCols: number | null,
  smCols: number | null,
  mdCols: number | null,
  lgCols: number | null) => (
    [ ['xs', xsCols], ['sm', smCols], ['md', mdCols], ['lg', lgCols] ].reduce((str, c) => {
      const ct = c[0];
      const cn = c[1];
      if (cn) {
        return `${str} ui-grid-cols-${ct}-${cn}`;
      }
      return str;
    }, '')
  );
*/
var Grid = function (_a, children) {
    var props = __rest$3(_a, []);
    return h("div", Object.assign({}, applyProps(props, { class: "ui-grid" })), children);
};
// import { h } from '@stencil/core';
var listeners = [];
var visible = [];
var observer = new IntersectionObserver(function (entries, observer) {
    entries.forEach(function (e) {
        if (e.intersectionRatio > 0) {
            if (visible.indexOf(e.target) < 0) {
                visible.push(e.target);
            }
        }
        else {
            visible.splice(visible.indexOf(e.target), 1);
        }
    });
    listeners.forEach(function (l) { return l({ entries: entries, observer: observer, visible: visible }); });
}, { threshold: [0, 1] });
var addListener = function (listener) { return listeners.push(listener); };
var removeListener = function (listener) { return listeners.splice(listeners.indexOf(listener), 1); };
var observe = function (el) { return el && observer.observe(el); };
var IntersectionHelper = /*#__PURE__*/ Object.freeze({
    __proto__: null,
    observer: observer,
    addListener: addListener,
    removeListener: removeListener,
    observe: observe
});
var __rest$4 = (undefined && undefined.__rest) || function (s, e) {
    var t = {};
    for (var p in s)
        if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
            t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
var Heading = function (_a, children) {
    var _b = _a.level, level = _b === void 0 ? 3 : _b, _c = _a.bordered, bordered = _c === void 0 ? false : _c, _d = _a.leading, leading = _d === void 0 ? false : _d, _e = _a.strong, strong = _e === void 0 ? false : _e, props = __rest$4(_a, ["level", "bordered", "leading", "strong"]);
    var Tag = "h" + level;
    var classes = [
        "ui-heading",
        " ui-heading-" + level,
        "" + (bordered ? " ui-heading--bordered" : ""),
        "" + (leading ? " ui-heading--leading" : ""),
        "" + (strong ? " ui-heading--strong" : "")
    ];
    return (h(Tag, Object.assign({}, applyProps(props, { class: classes.join('') }), { ref: function (e) { return observe(e); } }), children));
};
var Paragraph = function (props, children) { return h("p", Object.assign({}, applyProps(props, { class: 'ui-paragraph' })), children); };
var ResponsiveContainer = function (props, children) { return (h("div", Object.assign({}, applyProps(props, { class: 'ui-container' })), children)); };
var __rest$5 = (undefined && undefined.__rest) || function (s, e) {
    var t = {};
    for (var p in s)
        if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
            t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
var Skeleton = function (_a, children) {
    var _b = _a.animated, animated = _b === void 0 ? true : _b, props = __rest$5(_a, ["animated"]);
    return (h("div", Object.assign({}, applyProps(props, { class: "ui-skeleton" + (animated ? " ui-skeleton--animated" : "") })), children));
};
var Text = function (props, children) { return h("p", Object.assign({}, applyProps(props, { class: 'ui-text' })), children); };
var __rest$6 = (undefined && undefined.__rest) || function (s, e) {
    var t = {};
    for (var p in s)
        if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
            t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
var ThemeProvider = function (_a, children) {
    var _b = _a.type, type = _b === void 0 ? 'base' : _b, props = __rest$6(_a, ["type"]);
    return (h("div", Object.assign({}, applyProps(props, { class: "ui-theme--" + type })), children));
};
export { AnchorButton as A, Blockquote as B, Card as C, DateTime as D, Grid as G, Heading as H, IntersectionHelper as I, Paragraph as P, ResponsiveContainer as R, Skeleton as S, Text as T, Breadcrumbs as a, Breakpoint as b, CardContent as c, Col as d, ThemeProvider as e };
