{"version":3,"file":"LuvQdn21.js","sources":["../../../../../../bootstrap-vue-next/dist/useNumberishToStyle-BWrWARZP.mjs","../../../../../../bootstrap-vue-next/dist/BTableSimple.vue_vue_type_script_setup_true_lang-Be44iN5l.mjs","../../../../../../bootstrap-vue-next/dist/BTable.vue_vue_type_script_setup_true_lang-DSox5TGm.mjs"],"sourcesContent":["import { computed, toValue } from \"vue\";\nimport { R as RX_NUMBER } from \"./constants-BdrZaBP8.mjs\";\nconst useNumberishToStyle = (el, unit = \"px\") => computed(() => {\n const value = toValue(el);\n const resolvedUnit = toValue(unit);\n return RX_NUMBER.test(String(value)) ? `${Number(value)}${resolvedUnit}` : value;\n});\nexport {\n useNumberishToStyle as u\n};\n//# sourceMappingURL=useNumberishToStyle-BWrWARZP.mjs.map\n","import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, normalizeProps, guardReactiveProps, renderSlot, mergeProps } from \"vue\";\nimport { u as useDefaults } from \"./useDefaults-BuoSLvNO.mjs\";\nimport { u as useNumberishToStyle } from \"./useNumberishToStyle-BWrWARZP.mjs\";\nimport { u as useColorVariantClasses } from \"./useColorVariantClasses-ZDE19TZw.mjs\";\nconst defaultStickyHeaderHeight = \"300px\";\nconst _sfc_main = /* @__PURE__ */ defineComponent({\n __name: \"BTableSimple\",\n props: {\n bordered: { type: Boolean, default: false },\n borderless: { type: Boolean, default: false },\n borderVariant: { default: null },\n captionTop: { type: Boolean, default: false },\n dark: { type: Boolean, default: false },\n fixed: { type: Boolean, default: false },\n hover: { type: Boolean, default: false },\n id: { default: void 0 },\n noBorderCollapse: { type: Boolean, default: false },\n outlined: { type: Boolean, default: false },\n responsive: { type: [Boolean, String], default: false },\n small: { type: Boolean, default: false },\n stacked: { type: [Boolean, String], default: false },\n stickyHeader: { type: [Boolean, String, Number], default: false },\n striped: { type: Boolean, default: false },\n stripedColumns: { type: Boolean, default: false },\n variant: { default: null },\n tableAttrs: { default: void 0 },\n tableClass: { default: void 0 }\n },\n setup(__props) {\n const _props = __props;\n const props = useDefaults(_props, \"BTableSimple\");\n const colorClasses = useColorVariantClasses(\n computed(() => ({\n borderVariant: props.borderVariant\n }))\n );\n const computedClasses = computed(() => [\n props.tableClass,\n \"table\",\n \"b-table\",\n colorClasses.value,\n {\n \"table-bordered\": props.bordered,\n \"table-borderless\": props.borderless,\n \"caption-top\": props.captionTop,\n \"table-dark\": props.dark,\n \"table-hover\": props.hover,\n \"b-table-stacked\": props.stacked === true,\n [`b-table-stacked-${props.stacked}`]: typeof props.stacked === \"string\",\n \"table-striped\": props.striped,\n \"table-sm\": props.small,\n [`table-${props.variant}`]: props.variant !== null,\n \"table-striped-columns\": props.stripedColumns\n }\n ]);\n const computedTableAttrs = computed(() => ({\n id: props.id,\n class: computedClasses.value,\n ...props.tableAttrs\n }));\n const computedSticky = useNumberishToStyle(\n computed(\n () => (props.stickyHeader === true ? defaultStickyHeaderHeight : props.stickyHeader) || NaN\n )\n );\n const stickyIsValid = computed(() => props.stickyHeader !== false);\n const isResponsive = computed(() => props.responsive !== false || stickyIsValid.value);\n const responsiveStyles = computed(\n () => stickyIsValid.value ? { maxHeight: computedSticky.value } : void 0\n );\n const responsiveClasses = computed(() => ({\n \"table-responsive\": props.responsive === true,\n [`table-responsive-${props.responsive}`]: typeof props.responsive === \"string\",\n \"b-table-sticky-header\": stickyIsValid.value\n }));\n return (_ctx, _cache) => {\n return isResponsive.value ? (openBlock(), createElementBlock(\"div\", {\n key: 0,\n class: normalizeClass(responsiveClasses.value),\n style: normalizeStyle(responsiveStyles.value)\n }, [\n createElementVNode(\"table\", normalizeProps(guardReactiveProps(computedTableAttrs.value)), [\n renderSlot(_ctx.$slots, \"default\")\n ], 16)\n ], 6)) : (openBlock(), createElementBlock(\"table\", normalizeProps(mergeProps({ key: 1 }, computedTableAttrs.value)), [\n renderSlot(_ctx.$slots, \"default\")\n ], 16));\n };\n }\n});\nexport {\n _sfc_main as _\n};\n//# sourceMappingURL=BTableSimple.vue_vue_type_script_setup_true_lang-Be44iN5l.mjs.map\n","import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, renderSlot, unref, ref, watch, createBlock, withCtx, withDirectives, createVNode, createCommentVNode, Fragment, renderList, mergeProps, createTextVNode, toDisplayString, vShow, createElementVNode, mergeModels, useModel, onMounted, createSlots, normalizeProps, guardReactiveProps } from \"vue\";\nimport { g as get, s as set } from \"./object-DIbMZaP9.mjs\";\nimport { _ as _sfc_main$9 } from \"./BOverlay.vue_vue_type_script_setup_true_lang-lCwuaPXO.mjs\";\nimport { _ as _sfc_main$a } from \"./BSpinner.vue_vue_type_script_setup_true_lang-CXYbvCe5.mjs\";\nimport { _ as _sfc_main$8 } from \"./BTableSimple.vue_vue_type_script_setup_true_lang-Be44iN5l.mjs\";\nimport { u as useDefaults } from \"./useDefaults-BuoSLvNO.mjs\";\nimport { t as titleCase, s as startCase } from \"./stringUtils-i6NkPGA1.mjs\";\nimport { u as useToNumber } from \"./index-DlGgXMQF.mjs\";\nconst formatItem = (item, fieldKey, formatter) => {\n const val = get(item, fieldKey);\n return formatter && typeof formatter === \"function\" ? formatter(val, fieldKey, item) : val;\n};\nconst isTableItem = (value) => typeof value === \"object\" && value !== null;\nconst isTableField = (value) => typeof value === \"object\" && value !== null && \"key\" in value;\nconst _sfc_main$7 = /* @__PURE__ */ defineComponent({\n __name: \"BTbody\",\n props: {\n variant: { default: null }\n },\n setup(__props) {\n const _props = __props;\n const props = useDefaults(_props, \"BTbody\");\n const computedClasses = computed(() => ({\n [`thead-${props.variant}`]: props.variant !== null\n }));\n return (_ctx, _cache) => {\n return openBlock(), createElementBlock(\"tbody\", {\n class: normalizeClass(computedClasses.value)\n }, [\n renderSlot(_ctx.$slots, \"default\")\n ], 2);\n };\n }\n});\nconst _hoisted_1$3 = [\"scope\", \"colspan\", \"rowspan\", \"data-label\"];\nconst _hoisted_2$3 = { key: 0 };\nconst _sfc_main$6 = /* @__PURE__ */ defineComponent({\n __name: \"BTd\",\n props: {\n colspan: { default: void 0 },\n rowspan: { default: void 0 },\n stackedHeading: { default: void 0 },\n stickyColumn: { type: Boolean, default: false },\n variant: { default: null }\n },\n setup(__props) {\n const _props = __props;\n const props = useDefaults(_props, \"BTd\");\n const computedClasses = computed(() => ({\n [`table-${props.variant}`]: props.variant !== null,\n \"b-table-sticky-column\": props.stickyColumn,\n \"table-b-table-default\": props.stickyColumn && props.variant === null\n }));\n const scope = computed(() => props.colspan ? \"colspan\" : props.rowspan ? \"rowspan\" : \"col\");\n return (_ctx, _cache) => {\n return openBlock(), createElementBlock(\"td\", {\n scope: scope.value,\n class: normalizeClass(computedClasses.value),\n colspan: unref(props).colspan,\n rowspan: unref(props).rowspan,\n \"data-label\": unref(props).stackedHeading\n }, [\n unref(props).stackedHeading ? (openBlock(), createElementBlock(\"div\", _hoisted_2$3, [\n renderSlot(_ctx.$slots, \"default\")\n ])) : renderSlot(_ctx.$slots, \"default\", { key: 1 })\n ], 10, _hoisted_1$3);\n };\n }\n});\nconst _sfc_main$5 = /* @__PURE__ */ defineComponent({\n __name: \"BTfoot\",\n props: {\n variant: { default: null }\n },\n setup(__props) {\n const _props = __props;\n const props = useDefaults(_props, \"BTfoot\");\n const computedClasses = computed(() => ({\n [`table-${props.variant}`]: props.variant !== null\n }));\n return (_ctx, _cache) => {\n return openBlock(), createElementBlock(\"tfoot\", {\n class: normalizeClass(computedClasses.value)\n }, [\n renderSlot(_ctx.$slots, \"default\")\n ], 2);\n };\n }\n});\nconst _hoisted_1$2 = [\"scope\", \"colspan\", \"rowspan\", \"data-label\"];\nconst _hoisted_2$2 = { key: 0 };\nconst _sfc_main$4 = /* @__PURE__ */ defineComponent({\n __name: \"BTh\",\n props: {\n colspan: { default: void 0 },\n rowspan: { default: void 0 },\n stackedHeading: { default: void 0 },\n stickyColumn: { type: Boolean, default: false },\n variant: { default: null }\n },\n setup(__props) {\n const _props = __props;\n const props = useDefaults(_props, \"BTh\");\n const computedClasses = computed(() => ({\n [`table-${props.variant}`]: props.variant !== null,\n \"b-table-sticky-column\": props.stickyColumn,\n \"table-b-table-default\": props.stickyColumn && props.variant === null\n }));\n const scope = computed(() => props.colspan ? \"colspan\" : props.rowspan ? \"rowspan\" : \"col\");\n return (_ctx, _cache) => {\n return openBlock(), createElementBlock(\"th\", {\n scope: scope.value,\n class: normalizeClass(computedClasses.value),\n colspan: unref(props).colspan,\n rowspan: unref(props).rowspan,\n \"data-label\": unref(props).stackedHeading\n }, [\n unref(props).stackedHeading !== void 0 ? (openBlock(), createElementBlock(\"div\", _hoisted_2$2, [\n renderSlot(_ctx.$slots, \"default\")\n ])) : renderSlot(_ctx.$slots, \"default\", { key: 1 })\n ], 10, _hoisted_1$2);\n };\n }\n});\nconst _sfc_main$3 = /* @__PURE__ */ defineComponent({\n __name: \"BThead\",\n props: {\n variant: { default: null }\n },\n setup(__props) {\n const _props = __props;\n const props = useDefaults(_props, \"BThead\");\n const computedClasses = computed(() => ({\n [`table-${props.variant}`]: props.variant !== null\n }));\n return (_ctx, _cache) => {\n return openBlock(), createElementBlock(\"thead\", {\n class: normalizeClass(computedClasses.value)\n }, [\n renderSlot(_ctx.$slots, \"default\")\n ], 2);\n };\n }\n});\nconst _sfc_main$2 = /* @__PURE__ */ defineComponent({\n __name: \"BTr\",\n props: {\n variant: { default: null }\n },\n setup(__props) {\n const _props = __props;\n const props = useDefaults(_props, \"BTr\");\n const computedClasses = computed(() => ({\n [`table-${props.variant}`]: props.variant !== null\n }));\n return (_ctx, _cache) => {\n return openBlock(), createElementBlock(\"tr\", {\n class: normalizeClass(computedClasses.value)\n }, [\n renderSlot(_ctx.$slots, \"default\")\n ], 2);\n };\n }\n});\nconst getTableFieldHeadLabel = (field) => typeof field === \"string\" ? titleCase(field) : field.label !== void 0 ? field.label : typeof field.key === \"string\" ? titleCase(field.key) : field.key;\nconst TABLE_TAG_NAMES = [\"TD\", \"TH\", \"TR\"];\nconst eventFilter = [\n \"a\",\n \"a *\",\n // Include content inside links\n \"button\",\n \"button *\",\n // Include content inside buttons\n \"input:not(.disabled):not([disabled])\",\n \"select:not(.disabled):not([disabled])\",\n \"textarea:not(.disabled):not([disabled])\",\n '[role=\"link\"]',\n '[role=\"link\"] *',\n '[role=\"button\"]',\n '[role=\"button\"] *',\n \"[tabindex]:not(.disabled):not([disabled])\"\n].join(\",\");\nconst filterEvent = (event) => {\n if (!event || !event.target) {\n return false;\n }\n const el = event.target;\n if (\"disabled\" in el && el.disabled || TABLE_TAG_NAMES.indexOf(el.tagName) !== -1) {\n return false;\n }\n if (el.closest(\".dropdown-menu\")) return true;\n const label = el.tagName === \"LABEL\" ? el : el.closest(\"label\");\n if (label) {\n const labelFor = label.getAttribute(\"for\");\n const input = labelFor ? document.getElementById(labelFor) : label.querySelector(\"input, select, textarea\");\n if (input && !input.disabled) {\n return true;\n }\n }\n return el.matches(eventFilter);\n};\nconst _hoisted_1$1 = {\n key: 0,\n class: \"b-table-stacked-label\"\n};\nconst _hoisted_2$1 = { class: \"d-inline-flex flex-nowrap align-items-center gap-1\" };\nconst _hoisted_3 = { key: 2 };\nconst _sfc_main$1 = /* @__PURE__ */ defineComponent({\n __name: \"BTableLite\",\n props: {\n align: { default: void 0 },\n caption: { default: void 0 },\n captionHtml: { default: void 0 },\n detailsTdClass: { default: void 0 },\n emptyFilteredText: { default: \"There are no records matching your request\" },\n emptyText: { default: \"There are no records to show\" },\n fieldColumnClass: { type: [Function, String, Object, Array], default: void 0 },\n fields: { default: () => [] },\n footClone: { type: Boolean, default: false },\n footRowVariant: { default: void 0 },\n footVariant: { default: void 0 },\n headRowVariant: { default: void 0 },\n headVariant: { default: void 0 },\n items: { default: () => [] },\n labelStacked: { type: Boolean, default: false },\n modelValue: { default: void 0 },\n primaryKey: { default: void 0 },\n showEmpty: { type: Boolean, default: false },\n tbodyClass: { default: void 0 },\n tbodyTrAttrs: { type: [Function, Object], default: void 0 },\n tbodyTrClass: { type: [Function, String, Array, Object], default: void 0 },\n tfootClass: { default: void 0 },\n tfootTrClass: { default: void 0 },\n theadClass: { default: void 0 },\n theadTrClass: { default: void 0 },\n bordered: { type: Boolean, default: void 0 },\n borderless: { type: Boolean, default: void 0 },\n borderVariant: { default: void 0 },\n captionTop: { type: Boolean, default: void 0 },\n dark: { type: Boolean, default: void 0 },\n fixed: { type: Boolean, default: void 0 },\n hover: { type: Boolean, default: void 0 },\n id: { default: void 0 },\n noBorderCollapse: { type: Boolean, default: void 0 },\n outlined: { type: Boolean, default: void 0 },\n responsive: { type: [Boolean, String], default: void 0 },\n small: { type: Boolean, default: void 0 },\n stacked: { type: [Boolean, String], default: void 0 },\n stickyHeader: { type: [Boolean, String, Number], default: void 0 },\n striped: { type: Boolean, default: void 0 },\n stripedColumns: { type: Boolean, default: void 0 },\n variant: { default: void 0 },\n tableAttrs: {},\n tableClass: { default: void 0 }\n },\n emits: [\"head-clicked\", \"row-clicked\", \"row-dbl-clicked\", \"row-hovered\", \"row-unhovered\"],\n setup(__props, { emit: __emit }) {\n const _props = __props;\n const props = useDefaults(_props, \"BTableLite\");\n const emit = __emit;\n const generateDetailsItem = (item) => [\n item,\n item._showDetails\n ];\n const detailsMap = ref(/* @__PURE__ */ new WeakMap());\n watch(\n () => props.items,\n (items) => {\n items.forEach((item) => {\n if (!isTableItem(item)) return;\n detailsMap.value.set(...generateDetailsItem(item));\n });\n },\n { deep: true, immediate: true }\n );\n const computedTableClasses = computed(() => [\n props.tableClass,\n {\n [`align-${props.align}`]: props.align !== void 0\n }\n ]);\n const computedFields = computed(() => {\n if (!props.fields.length && props.items.length) {\n const [firstItem] = props.items;\n if (isTableItem(firstItem) || Array.isArray(firstItem)) {\n return Object.keys(firstItem).map((k) => {\n const label = startCase(k);\n return {\n key: k,\n label,\n tdAttr: props.stacked === true ? { \"data-label\": label } : void 0\n };\n });\n }\n return [{ key: \"\", _noHeader: true }];\n }\n return props.fields.map((f) => {\n if (isTableField(f)) {\n return {\n ...f,\n tdAttr: props.stacked === true ? { \"data-label\": startCase(f.key), ...f.tdAttr } : f.tdAttr\n };\n }\n const label = startCase(f);\n return {\n key: f,\n label,\n tdAttr: props.stacked === true ? { \"data-label\": label } : void 0\n };\n });\n });\n const computedFieldsTotal = computed(() => computedFields.value.length);\n const showComputedHeaders = computed(() => {\n if (computedFields.value.length > 0 && computedFields.value.every((el) => el._noHeader === true))\n return false;\n return true;\n });\n const itemAttributes = (item, fieldKey, attr) => {\n const val = get(item, fieldKey);\n return attr && typeof attr === \"function\" ? attr(val, fieldKey, item) : attr;\n };\n const callThAttr = (item, field, type) => {\n const fieldKey = String(field.key);\n const val = get(item, fieldKey);\n return field.thAttr && typeof field.thAttr === \"function\" ? field.thAttr(val, fieldKey, item, type) : field.thAttr;\n };\n const headerClicked = (field, event, isFooter = false) => {\n emit(\"head-clicked\", field.key, field, event, isFooter);\n };\n const toggleRowDetails = (tr) => {\n if (isTableItem(tr)) {\n const prevValue = detailsMap.value.get(tr);\n detailsMap.value.set(tr, !prevValue);\n tr._showDetails = !prevValue;\n }\n };\n const getFieldColumnClasses = (field) => [\n field.class,\n field.thClass,\n {\n \"b-table-sticky-column\": field.stickyColumn\n },\n props.fieldColumnClass ? typeof props.fieldColumnClass === \"function\" ? props.fieldColumnClass(field) : props.fieldColumnClass : null\n ];\n const getFieldRowClasses = (field, tr) => {\n var _a, _b;\n const val = get(tr, String(field.key));\n return [\n field.class,\n typeof field.tdClass === \"function\" ? field.tdClass(val, String(field.key), tr) : field.tdClass,\n (isTableItem(tr) ? (_a = tr._cellVariants) == null ? void 0 : _a[field.key] : false) ? `table-${(_b = tr._cellVariants) == null ? void 0 : _b[field.key]}` : null,\n {\n \"b-table-sticky-column\": field.stickyColumn\n }\n ];\n };\n const callTbodyTrAttrs = (item, type) => props.tbodyTrAttrs ? typeof props.tbodyTrAttrs === \"function\" ? props.tbodyTrAttrs(item, type) : props.tbodyTrAttrs : null;\n const getRowClasses = (item, type) => props.tbodyTrClass ? typeof props.tbodyTrClass === \"function\" ? props.tbodyTrClass(item, type) : props.tbodyTrClass : null;\n return (_ctx, _cache) => {\n return openBlock(), createBlock(_sfc_main$8, {\n id: unref(props).id,\n bordered: unref(props).bordered,\n borderless: unref(props).borderless,\n \"border-variant\": unref(props).borderVariant,\n \"caption-top\": unref(props).captionTop,\n dark: unref(props).dark,\n fixed: unref(props).fixed,\n hover: unref(props).hover,\n \"no-border-collapse\": unref(props).noBorderCollapse,\n outlined: unref(props).outlined,\n responsive: unref(props).responsive,\n small: unref(props).small,\n stacked: unref(props).stacked,\n \"sticky-header\": unref(props).stickyHeader,\n striped: unref(props).striped,\n \"table-class\": computedTableClasses.value,\n variant: unref(props).variant,\n \"striped-columns\": unref(props).stripedColumns\n }, {\n default: withCtx(() => [\n withDirectives(createVNode(_sfc_main$3, {\n variant: unref(props).headVariant,\n class: normalizeClass(unref(props).theadClass)\n }, {\n default: withCtx(() => [\n _ctx.$slots[\"thead-top\"] ? renderSlot(_ctx.$slots, \"thead-top\", { key: 0 }) : createCommentVNode(\"\", true),\n createVNode(_sfc_main$2, {\n variant: unref(props).headRowVariant,\n class: normalizeClass(unref(props).theadTrClass)\n }, {\n default: withCtx(() => [\n (openBlock(true), createElementBlock(Fragment, null, renderList(computedFields.value, (field) => {\n return openBlock(), createBlock(_sfc_main$4, mergeProps({\n key: field.key,\n scope: \"col\",\n class: getFieldColumnClasses(field),\n title: field.headerTitle,\n variant: field.variant,\n abbr: field.headerAbbr,\n style: field.thStyle,\n ref_for: true\n }, callThAttr(null, field, \"top\"), {\n onClick: ($event) => headerClicked(field, $event)\n }), {\n default: withCtx(() => [\n renderSlot(_ctx.$slots, _ctx.$slots[`head(${String(field.key)})`] ? `head(${String(field.key)})` : \"head()\", {\n label: field.label,\n column: field.key,\n field,\n isFoot: false\n }, () => [\n createTextVNode(toDisplayString(unref(getTableFieldHeadLabel)(field)), 1)\n ])\n ]),\n _: 2\n }, 1040, [\"class\", \"title\", \"variant\", \"abbr\", \"style\", \"onClick\"]);\n }), 128))\n ]),\n _: 3\n }, 8, [\"variant\", \"class\"]),\n _ctx.$slots[\"thead-sub\"] ? (openBlock(), createBlock(_sfc_main$2, { key: 1 }, {\n default: withCtx(() => [\n (openBlock(true), createElementBlock(Fragment, null, renderList(computedFields.value, (field) => {\n return openBlock(), createBlock(_sfc_main$6, {\n key: field.key,\n scope: \"col\",\n variant: field.variant,\n class: normalizeClass([field.class, field.thClass])\n }, {\n default: withCtx(() => [\n renderSlot(_ctx.$slots, \"thead-sub\", mergeProps({\n items: computedFields.value,\n ref_for: true\n }, field), () => [\n createTextVNode(toDisplayString(field.label), 1)\n ])\n ]),\n _: 2\n }, 1032, [\"variant\", \"class\"]);\n }), 128))\n ]),\n _: 3\n })) : createCommentVNode(\"\", true)\n ]),\n _: 3\n }, 8, [\"variant\", \"class\"]), [\n [vShow, showComputedHeaders.value]\n ]),\n createVNode(_sfc_main$7, {\n class: normalizeClass(unref(props).tbodyClass)\n }, {\n default: withCtx(() => [\n renderSlot(_ctx.$slots, \"custom-body\", {\n fields: computedFields.value,\n items: unref(props).items,\n columns: computedFields.value.length\n }, () => [\n !unref(props).stacked && _ctx.$slots[\"top-row\"] ? (openBlock(), createBlock(_sfc_main$2, mergeProps({\n key: 0,\n class: getRowClasses(null, \"row-top\")\n }, callTbodyTrAttrs(null, \"row-top\")), {\n default: withCtx(() => [\n renderSlot(_ctx.$slots, \"top-row\")\n ]),\n _: 3\n }, 16, [\"class\"])) : createCommentVNode(\"\", true),\n (openBlock(true), createElementBlock(Fragment, null, renderList(unref(props).items, (item, itemIndex) => {\n return openBlock(), createElementBlock(Fragment, {\n key: unref(props).primaryKey ? unref(get)(item, unref(props).primaryKey) : itemIndex\n }, [\n createVNode(_sfc_main$2, mergeProps({\n class: getRowClasses(item, \"row\"),\n variant: unref(isTableItem)(item) ? item._rowVariant : void 0,\n ref_for: true\n }, callTbodyTrAttrs(item, \"row\"), {\n onClick: ($event) => !unref(filterEvent)($event) && emit(\"row-clicked\", item, itemIndex, $event),\n onDblclick: ($event) => !unref(filterEvent)($event) && emit(\"row-dbl-clicked\", item, itemIndex, $event),\n onMouseenter: ($event) => !unref(filterEvent)($event) && emit(\"row-hovered\", item, itemIndex, $event),\n onMouseleave: ($event) => !unref(filterEvent)($event) && emit(\"row-unhovered\", item, itemIndex, $event)\n }), {\n default: withCtx(() => [\n (openBlock(true), createElementBlock(Fragment, null, renderList(computedFields.value, (field) => {\n var _a;\n return openBlock(), createBlock(_sfc_main$6, mergeProps({\n key: field.key,\n variant: (unref(isTableItem)(item) ? (_a = item._cellVariants) == null ? void 0 : _a[field.key] : false) ? null : field.variant,\n class: getFieldRowClasses(field, item),\n ref_for: true\n }, itemAttributes(item, String(field.key), field.tdAttr)), {\n default: withCtx(() => [\n unref(props).stacked && unref(props).labelStacked ? (openBlock(), createElementBlock(\"label\", _hoisted_1$1, toDisplayString(unref(getTableFieldHeadLabel)(field)), 1)) : createCommentVNode(\"\", true),\n renderSlot(\n _ctx.$slots,\n _ctx.$slots[`cell(${String(field.key)})`] ? `cell(${String(field.key)})` : \"cell()\",\n {\n value: unref(formatItem)(item, String(field.key), field.formatter),\n unformatted: unref(get)(item, String(field.key)),\n index: itemIndex,\n item,\n field,\n items: _ctx.items,\n toggleDetails: () => {\n toggleRowDetails(item);\n },\n detailsShowing: unref(isTableItem)(item) ? detailsMap.value.get(item) ?? false : false\n },\n () => [\n !_ctx.$slots[`cell(${String(field.key)})`] && !_ctx.$slots[\"cell()\"] ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [\n createTextVNode(toDisplayString(unref(formatItem)(item, String(field.key), field.formatter)), 1)\n ], 64)) : createCommentVNode(\"\", true)\n ]\n )\n ]),\n _: 2\n }, 1040, [\"variant\", \"class\"]);\n }), 128))\n ]),\n _: 2\n }, 1040, [\"class\", \"variant\", \"onClick\", \"onDblclick\", \"onMouseenter\", \"onMouseleave\"]),\n unref(isTableItem)(item) && detailsMap.value.get(item) === true && _ctx.$slots[\"row-details\"] ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [\n createVNode(_sfc_main$2, {\n \"aria-hidden\": \"true\",\n role: \"presentation\",\n class: \"d-none\"\n }),\n createVNode(_sfc_main$2, mergeProps({\n class: getRowClasses(item, \"row-details\"),\n variant: item._rowVariant,\n ref_for: true\n }, callTbodyTrAttrs(item, \"row-details\")), {\n default: withCtx(() => [\n createVNode(_sfc_main$6, {\n colspan: computedFieldsTotal.value,\n class: normalizeClass(_ctx.detailsTdClass)\n }, {\n default: withCtx(() => [\n renderSlot(_ctx.$slots, \"row-details\", {\n item,\n toggleDetails: () => {\n toggleRowDetails(item);\n },\n fields: unref(props).fields,\n index: itemIndex\n })\n ]),\n _: 2\n }, 1032, [\"colspan\", \"class\"])\n ]),\n _: 2\n }, 1040, [\"class\", \"variant\"])\n ], 64)) : createCommentVNode(\"\", true)\n ], 64);\n }), 128)),\n unref(props).showEmpty && unref(props).items.length === 0 ? (openBlock(), createBlock(_sfc_main$2, {\n key: 1,\n class: \"b-table-empty-slot\"\n }, {\n default: withCtx(() => [\n createVNode(_sfc_main$6, { colspan: computedFieldsTotal.value }, {\n default: withCtx(() => [\n renderSlot(_ctx.$slots, \"empty\", {\n items: unref(props).items\n }, () => [\n createTextVNode(toDisplayString(unref(props).emptyText), 1)\n ])\n ]),\n _: 3\n }, 8, [\"colspan\"])\n ]),\n _: 3\n })) : createCommentVNode(\"\", true),\n !unref(props).stacked && _ctx.$slots[\"bottom-row\"] ? (openBlock(), createBlock(_sfc_main$2, mergeProps({\n key: 2,\n class: [\"bottom-row\", getRowClasses(null, \"row-bottom\")]\n }, callTbodyTrAttrs(null, \"row-bottom\")), {\n default: withCtx(() => [\n renderSlot(_ctx.$slots, \"bottom-row\")\n ]),\n _: 3\n }, 16, [\"class\"])) : createCommentVNode(\"\", true)\n ])\n ]),\n _: 3\n }, 8, [\"class\"]),\n unref(props).footClone ? (openBlock(), createBlock(_sfc_main$5, {\n key: 0,\n variant: unref(props).footVariant,\n class: normalizeClass(unref(props).tfootClass)\n }, {\n default: withCtx(() => [\n createVNode(_sfc_main$2, {\n variant: unref(props).footRowVariant,\n class: normalizeClass(unref(props).tfootTrClass)\n }, {\n default: withCtx(() => [\n (openBlock(true), createElementBlock(Fragment, null, renderList(computedFields.value, (field) => {\n return openBlock(), createBlock(_sfc_main$4, mergeProps({\n key: field.key,\n scope: \"col\",\n class: getFieldColumnClasses(field),\n title: field.headerTitle,\n abbr: field.headerAbbr,\n style: field.thStyle,\n variant: field.variant,\n ref_for: true\n }, callThAttr(null, field, \"bottom\"), {\n onClick: ($event) => headerClicked(field, $event, true)\n }), {\n default: withCtx(() => [\n createElementVNode(\"div\", _hoisted_2$1, [\n createElementVNode(\"div\", null, [\n renderSlot(\n _ctx.$slots,\n _ctx.$slots[`foot(${String(field.key)})`] ? `foot(${String(field.key)})` : \"foot()\",\n {\n label: field.label,\n column: field.key,\n field,\n isFoot: true\n },\n () => [\n createTextVNode(toDisplayString(unref(getTableFieldHeadLabel)(field)), 1)\n ]\n )\n ])\n ])\n ]),\n _: 2\n }, 1040, [\"class\", \"title\", \"abbr\", \"style\", \"variant\", \"onClick\"]);\n }), 128))\n ]),\n _: 3\n }, 8, [\"variant\", \"class\"])\n ]),\n _: 3\n }, 8, [\"variant\", \"class\"])) : _ctx.$slots[\"custom-foot\"] ? (openBlock(), createBlock(_sfc_main$5, { key: 1 }, {\n default: withCtx(() => [\n renderSlot(_ctx.$slots, \"custom-foot\", {\n fields: computedFields.value,\n items: unref(props).items,\n columns: computedFields.value.length\n })\n ]),\n _: 3\n })) : createCommentVNode(\"\", true),\n _ctx.$slots[\"table-caption\"] || unref(props).caption ? (openBlock(), createElementBlock(\"caption\", _hoisted_3, [\n renderSlot(_ctx.$slots, \"table-caption\", {}, () => [\n createTextVNode(toDisplayString(unref(props).caption), 1)\n ])\n ])) : createCommentVNode(\"\", true)\n ]),\n _: 3\n }, 8, [\"id\", \"bordered\", \"borderless\", \"border-variant\", \"caption-top\", \"dark\", \"fixed\", \"hover\", \"no-border-collapse\", \"outlined\", \"responsive\", \"small\", \"stacked\", \"sticky-header\", \"striped\", \"table-class\", \"variant\", \"striped-columns\"]);\n };\n }\n});\nconst _hoisted_1 = {\n style: { opacity: 0.4 },\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"24\",\n height: \"24\",\n fill: \"currentColor\",\n class: \"bi bi-arrow-up-short\",\n viewBox: \"0 0 16 16\",\n \"aria-hidden\": \"\"\n};\nconst _hoisted_2 = { class: \"d-flex align-items-center gap-2 mt-5\" };\nconst _sfc_main = /* @__PURE__ */ defineComponent({\n __name: \"BTable\",\n props: /* @__PURE__ */ mergeModels({\n provider: { default: void 0 },\n noProvider: { default: void 0 },\n noProviderPaging: { type: Boolean, default: false },\n noProviderSorting: { type: Boolean, default: false },\n noProviderFiltering: { type: Boolean, default: false },\n mustSort: { type: [Boolean, Array], default: false },\n selectable: { type: Boolean, default: false },\n multisort: { type: Boolean, default: false },\n stickySelect: { type: Boolean, default: false },\n selectHead: { type: [Boolean, String], default: true },\n selectMode: { default: \"multi\" },\n selectionVariant: { default: \"primary\" },\n busyLoadingText: { default: \"Loading...\" },\n perPage: { default: Number.POSITIVE_INFINITY },\n currentPage: { default: 1 },\n filter: { default: void 0 },\n filterable: { default: void 0 },\n noLocalSorting: { type: Boolean, default: false },\n noSelectOnClick: { type: Boolean, default: false },\n noSortableIcon: { type: Boolean, default: false },\n align: { default: void 0 },\n caption: { default: void 0 },\n captionHtml: { default: void 0 },\n detailsTdClass: { default: void 0 },\n emptyFilteredText: { default: void 0 },\n emptyText: { default: void 0 },\n fieldColumnClass: { type: [Function, String, Object, Array], default: void 0 },\n fields: { default: () => [] },\n footClone: { type: Boolean, default: void 0 },\n footRowVariant: { default: void 0 },\n footVariant: { default: void 0 },\n headRowVariant: { default: void 0 },\n headVariant: { default: void 0 },\n items: { default: () => [] },\n labelStacked: { type: Boolean, default: void 0 },\n modelValue: { default: void 0 },\n primaryKey: { default: void 0 },\n showEmpty: { type: Boolean, default: void 0 },\n tbodyClass: { default: void 0 },\n tbodyTrAttrs: {},\n tbodyTrClass: { type: [Function, String, Array, Object], default: void 0 },\n tfootClass: { default: void 0 },\n tfootTrClass: { default: void 0 },\n theadClass: { default: void 0 },\n theadTrClass: { default: void 0 },\n bordered: { type: Boolean, default: void 0 },\n borderless: { type: Boolean, default: void 0 },\n borderVariant: { default: void 0 },\n captionTop: { type: Boolean, default: void 0 },\n dark: { type: Boolean, default: void 0 },\n fixed: { type: Boolean, default: void 0 },\n hover: { type: Boolean, default: void 0 },\n id: { default: void 0 },\n noBorderCollapse: { type: Boolean, default: void 0 },\n outlined: { type: Boolean, default: void 0 },\n responsive: { type: [Boolean, String], default: void 0 },\n small: { type: Boolean, default: void 0 },\n stacked: { type: [Boolean, String], default: void 0 },\n stickyHeader: { type: [Boolean, String, Number], default: void 0 },\n striped: { type: Boolean, default: void 0 },\n stripedColumns: { type: Boolean, default: void 0 },\n variant: { default: void 0 },\n tableAttrs: {}\n }, {\n \"sortBy\": {\n default: void 0\n },\n \"sortByModifiers\": {},\n \"busy\": { type: Boolean, ...{\n default: false\n } },\n \"busyModifiers\": {},\n \"selectedItems\": {\n default: () => []\n },\n \"selectedItemsModifiers\": {}\n }),\n emits: /* @__PURE__ */ mergeModels([\"filtered\", \"head-clicked\", \"row-clicked\", \"row-dbl-clicked\", \"row-hovered\", \"row-unhovered\", \"row-selected\", \"row-unselected\", \"sorted\", \"change\"], [\"update:sortBy\", \"update:busy\", \"update:selectedItems\"]),\n setup(__props, { expose: __expose, emit: __emit }) {\n const _props = __props;\n const props = useDefaults(_props, \"BTable\");\n const emit = __emit;\n const sortByModel = useModel(__props, \"sortBy\");\n const busyModel = useModel(__props, \"busy\");\n const selectedItemsModel = useModel(\n __props,\n \"selectedItems\"\n );\n const selectedItemsToSet = computed({\n get: () => /* @__PURE__ */ new Set([...selectedItemsModel.value]),\n set: (val) => {\n selectedItemsModel.value = [...val];\n }\n });\n const selectedItemsSetUtilities = {\n add: (item) => {\n const value = new Set(selectedItemsToSet.value);\n value.add(item);\n selectedItemsToSet.value = value;\n emit(\"row-selected\", item);\n },\n clear: () => {\n selectedItemsToSet.value.forEach((item) => {\n selectedItemsSetUtilities.delete(item);\n });\n },\n delete: (item) => {\n const value = new Set(selectedItemsToSet.value);\n if (props.primaryKey) {\n const pkey = props.primaryKey;\n selectedItemsModel.value.forEach((v, i) => {\n const selectedKey = get(v, pkey);\n const itemKey = get(item, pkey);\n if (!!selectedKey && !!itemKey && selectedKey === itemKey) {\n value.delete(selectedItemsModel.value[i]);\n }\n });\n } else {\n value.delete(item);\n }\n selectedItemsToSet.value = value;\n emit(\"row-unselected\", item);\n },\n set: (items) => {\n selectedItemsToSet.value = new Set(items);\n selectedItemsToSet.value.forEach((item) => {\n emit(\"row-unselected\", item);\n });\n },\n has: (item) => {\n if (!props.primaryKey) return selectedItemsToSet.value.has(item);\n const pkey = props.primaryKey;\n for (const selected of selectedItemsToSet.value) {\n const selectedKey = get(selected, pkey);\n const itemKey = get(item, pkey);\n if (!!selectedKey && !!itemKey && selectedKey === itemKey) return true;\n }\n return false;\n }\n };\n const internalItems = ref([]);\n const perPageNumber = useToNumber(() => props.perPage, { method: \"parseInt\" });\n const currentPageNumber = useToNumber(() => props.currentPage, { method: \"parseInt\" });\n const isFilterableTable = computed(() => !!props.filter);\n const usesProvider = computed(() => props.provider !== void 0);\n const isSelecting = computed(() => selectedItemsToSet.value.size > 0);\n const isSortable = computed(\n () => sortByModel.value !== void 0 || props.fields.some(\n (field) => typeof field === \"object\" && field !== null && field.sortable === true\n )\n );\n const computedFields = computed(\n () => props.fields.map((el) => {\n var _a;\n if (!isTableField(el)) {\n const label = startCase(el);\n return {\n key: el,\n label,\n tdAttr: props.stacked === true ? { \"data-label\": label } : void 0\n };\n }\n const value = (_a = sortByModel.value) == null ? void 0 : _a.find((sb) => el.key === sb.key);\n const sortValue = isSortable.value === false ? void 0 : value === void 0 ? \"none\" : value.order === \"desc\" ? \"descending\" : value.order === \"asc\" ? \"ascending\" : \"none\";\n return {\n ...el,\n thAttr: {\n \"aria-sort\": sortValue,\n ...el.thAttr\n }\n };\n })\n );\n const tableClasses = computed(() => ({\n \"b-table-busy\": busyModel.value,\n \"b-table-selectable\": props.selectable,\n \"user-select-none\": props.selectable && isSelecting.value\n }));\n const getBusyRowClasses = computed(() => [\n props.tbodyTrClass ? typeof props.tbodyTrClass === \"function\" ? props.tbodyTrClass(null, \"table-busy\") : props.tbodyTrClass : null\n ]);\n const getFieldColumnClasses = (field) => [\n {\n \"b-table-sortable-column\": isSortable.value && field.sortable\n }\n ];\n const getRowClasses = (item, type) => [\n {\n [`selected table-${props.selectionVariant}`]: props.selectable && !!item && selectedItemsSetUtilities.has(item)\n },\n props.tbodyTrClass ? typeof props.tbodyTrClass === \"function\" ? props.tbodyTrClass(item, type) : props.tbodyTrClass : null\n ];\n const computedItems = computed(() => {\n const sortItems = (items) => {\n var _a;\n const sortByItems = (_a = sortByModel.value) == null ? void 0 : _a.filter((el) => !!el.order);\n if (!sortByItems || sortByItems.length === 0) return items;\n return [...items].sort((a, b) => {\n for (let i = 0; i < (sortByItems.length ?? 0); i++) {\n const sortOption = sortByItems[i];\n const realVal = (ob) => {\n if (!isTableItem(ob)) return String(ob);\n const sortField = computedFields.value.find((el) => {\n if (isTableField(el)) return el.key === sortOption.key;\n return false;\n });\n const val = get(ob, sortOption.key);\n if (isTableField(sortField) && !!sortField.sortByFormatted) {\n const formatter = typeof sortField.sortByFormatted === \"function\" ? sortField.sortByFormatted : sortField.formatter;\n if (formatter) {\n return formatItem(ob, String(sortField.key), formatter);\n }\n }\n return typeof val === \"object\" && val !== null ? JSON.stringify(val) : (val == null ? void 0 : val.toString()) ?? \"\";\n };\n const aValue = realVal(a);\n const bValue = realVal(b);\n const comparison = sortOption.comparer ? sortOption.comparer(aValue, bValue) : aValue.localeCompare(bValue, void 0, { numeric: true });\n if (comparison !== 0) {\n return sortOption.order === \"asc\" ? comparison : -comparison;\n }\n }\n return 0;\n });\n };\n const filterItems = (items) => items.filter(\n (item) => isTableItem(item) ? Object.entries(item).some(([key, val]) => {\n var _a, _b, _c;\n if (val === null || val === void 0 || key[0] === \"_\" || !((_a = props.filterable) == null ? void 0 : _a.includes(key)) && !!((_b = props.filterable) == null ? void 0 : _b.length))\n return false;\n const realVal = () => {\n const filterField = computedFields.value.find((el) => {\n if (isTableField(el)) return el.key === key;\n return false;\n });\n if (isTableField(filterField) && !!filterField.filterByFormatted) {\n const formatter = typeof filterField.filterByFormatted === \"function\" ? filterField.filterByFormatted : filterField.formatter;\n if (formatter) {\n return formatter(val, String(filterField.key), item);\n }\n }\n return typeof val === \"object\" ? JSON.stringify(Object.values(val)) : val.toString();\n };\n const itemValue = realVal();\n return itemValue.toLowerCase().includes(((_c = props.filter) == null ? void 0 : _c.toLowerCase()) ?? \"\");\n }) : true\n );\n let mappedItems = usesProvider.value ? internalItems.value : props.items;\n mappedItems = mappedItems.map((item) => {\n if (typeof item === \"object\" && item !== null && Object.keys(item).some((key) => key.includes(\".\"))) {\n let newItem = {};\n for (const key in item) {\n if (key.includes(\".\")) {\n newItem = set(newItem, key, item[key]);\n } else {\n newItem[key] = item[key];\n }\n }\n return newItem;\n }\n return item;\n });\n if (isFilterableTable.value === true && !usesProvider.value || isFilterableTable.value === true && usesProvider.value && props.noProviderFiltering) {\n mappedItems = filterItems(mappedItems);\n }\n if (isSortable.value === true && !usesProvider.value && !props.noLocalSorting || isSortable.value === true && usesProvider.value && props.noProviderSorting) {\n mappedItems = sortItems(mappedItems);\n }\n return mappedItems;\n });\n const computedDisplayItems = computed(() => {\n if (Number.isNaN(perPageNumber.value) || usesProvider.value && !props.noProviderPaging) {\n return computedItems.value;\n }\n return computedItems.value.slice(\n (currentPageNumber.value - 1) * (perPageNumber.value || Number.POSITIVE_INFINITY),\n currentPageNumber.value * (perPageNumber.value || Number.POSITIVE_INFINITY)\n );\n });\n watch(computedDisplayItems, (v) => {\n emit(\"change\", v);\n });\n const handleRowSelection = (row, index, shiftClicked = false, ctrlClicked = false, metaClicked = false) => {\n if (!props.selectable) return;\n if (props.selectMode === \"single\" || props.selectMode === \"multi\") {\n if (shiftClicked || ctrlClicked) return;\n if (selectedItemsSetUtilities.has(row)) {\n selectedItemsSetUtilities.delete(row);\n } else {\n if (props.selectMode === \"single\") {\n selectedItemsSetUtilities.set([row]);\n } else {\n selectedItemsSetUtilities.add(row);\n }\n }\n } else {\n if (ctrlClicked || metaClicked) {\n if (selectedItemsSetUtilities.has(row)) {\n selectedItemsSetUtilities.delete(row);\n } else {\n selectedItemsSetUtilities.add(row);\n }\n } else if (shiftClicked) {\n const lastSelectedItem = [...selectedItemsToSet.value].pop();\n const lastSelectedIndex = computedItems.value.findIndex((i) => i === lastSelectedItem);\n const selectStartIndex = Math.min(lastSelectedIndex, index);\n const selectEndIndex = Math.max(lastSelectedIndex, index);\n const items = computedItems.value.slice(selectStartIndex, selectEndIndex + 1);\n selectedItemsSetUtilities.set(items);\n } else {\n selectedItemsSetUtilities.set([row]);\n }\n }\n };\n const onRowClick = (row, index, e) => {\n if (props.noSelectOnClick === false) {\n handleRowSelection(row, index, e.shiftKey, e.ctrlKey, e.metaKey);\n }\n emit(\"row-clicked\", row, index, e);\n };\n const handleFieldSorting = (field) => {\n var _a, _b;\n if (!isSortable.value) return;\n const fieldKey = typeof field === \"object\" && field !== null ? field.key : field;\n const fieldSortable = typeof field === \"object\" && field !== null ? field.sortable : false;\n if (!(isSortable.value === true && fieldSortable === true)) return;\n const resolveOrder = (val) => {\n if (val === \"asc\") return \"desc\";\n if (val === void 0) return \"asc\";\n if (props.mustSort === true || Array.isArray(props.mustSort) && props.mustSort.includes(fieldKey))\n return \"asc\";\n return void 0;\n };\n const index = ((_a = sortByModel.value) == null ? void 0 : _a.findIndex((el) => el.key === fieldKey)) ?? -1;\n const originalValue = (_b = sortByModel.value) == null ? void 0 : _b[index];\n const updatedValue = (\n // If value is new, we default to ascending\n // Otherwise we make a temp copy of the value\n index === -1 || !originalValue ? { key: fieldKey, order: \"asc\" } : { ...originalValue }\n );\n const handleMultiSort = () => {\n var _a2, _b2;\n let val = updatedValue;\n if (index === -1) {\n sortByModel.value = [...sortByModel.value ?? [], updatedValue];\n } else {\n const order = resolveOrder(updatedValue.order);\n val = { ...updatedValue, order };\n sortByModel.value = order ? (_a2 = sortByModel.value) == null ? void 0 : _a2.map((el) => el.key === val.key ? val : el) : (_b2 = sortByModel.value) == null ? void 0 : _b2.filter((el) => el.key !== val.key);\n }\n return val;\n };\n const handleSingleSort = () => {\n const val = {\n ...updatedValue,\n order: index === -1 ? updatedValue.order : resolveOrder(updatedValue.order)\n };\n sortByModel.value = [val];\n return val;\n };\n emit(\"sorted\", props.multisort === true ? handleMultiSort() : handleSingleSort());\n };\n const onFieldHeadClick = (fieldKey, field, event, isFooter = false) => {\n emit(\"head-clicked\", fieldKey, field, event, isFooter);\n handleFieldSorting(field);\n };\n const callItemsProvider = async () => {\n if (!usesProvider.value || props.provider === void 0 || busyModel.value) return;\n busyModel.value = true;\n const response = props.provider({\n currentPage: currentPageNumber.value,\n filter: props.filter,\n sortBy: sortByModel.value,\n perPage: perPageNumber.value\n });\n try {\n const items = response instanceof Promise ? await response : response;\n if (items === void 0) return;\n internalItems.value = items;\n } finally {\n busyModel.value = false;\n }\n };\n const providerPropsWatch = async (prop, val, oldVal) => {\n if (val === oldVal) return;\n const inNoProvider = (key) => {\n var _a;\n return ((_a = props.noProvider) == null ? void 0 : _a.includes(key)) === true;\n };\n const noProvideWhenPaging = (prop === \"currentPage\" || prop === \"perPage\") && (inNoProvider(\"paging\") || props.noProviderPaging === true);\n const noProvideWhenFiltering = prop === \"filter\" && (inNoProvider(\"filtering\") || props.noProviderFiltering === true);\n const noProvideWhenSorting = (prop === \"sortBy\" || prop === \"sortDesc\") && (inNoProvider(\"sorting\") || props.noProviderSorting === true);\n if (noProvideWhenPaging || noProvideWhenFiltering || noProvideWhenSorting) return;\n if (usesProvider.value === true) {\n await callItemsProvider();\n }\n if (!(prop === \"currentPage\" || prop === \"perPage\")) {\n emit(\"filtered\", [...computedItems.value]);\n }\n };\n watch(\n () => props.filter,\n (filter, oldFilter) => {\n providerPropsWatch(\"filter\", filter, oldFilter);\n if (filter === oldFilter || usesProvider.value) return;\n if (!filter) {\n emit(\"filtered\", [...computedItems.value]);\n }\n }\n );\n watch(currentPageNumber, (val, oldVal) => {\n providerPropsWatch(\"currentPage\", val, oldVal);\n });\n watch(perPageNumber, (val, oldVal) => {\n providerPropsWatch(\"perPage\", val, oldVal);\n });\n watch(\n sortByModel,\n (val, oldVal) => {\n providerPropsWatch(\"sortBy\", val, oldVal);\n },\n { deep: true }\n );\n watch(\n () => props.provider,\n (newValue) => {\n if (newValue === void 0) {\n internalItems.value = [];\n return;\n }\n callItemsProvider();\n }\n );\n onMounted(callItemsProvider);\n __expose({\n // The row selection methods are really for compat. Users should probably use the v-model though\n clearSelected: () => {\n if (!props.selectable) return;\n selectedItemsSetUtilities.clear();\n },\n refresh: callItemsProvider,\n selectAllRows: () => {\n if (!props.selectable) return;\n const unselectableItems = selectedItemsToSet.value.size > 0 ? [...selectedItemsToSet.value] : [];\n selectedItemsToSet.value = /* @__PURE__ */ new Set([...computedItems.value]);\n selectedItemsToSet.value.forEach((item) => {\n if (unselectableItems.includes(item)) return;\n emit(\"row-selected\", item);\n });\n },\n selectRow: (index) => {\n if (!props.selectable) return;\n const item = computedItems.value[index];\n if (!item || selectedItemsSetUtilities.has(item)) return;\n selectedItemsSetUtilities.add(item);\n },\n unselectRow: (index) => {\n if (!props.selectable) return;\n const item = computedItems.value[index];\n if (!item || !selectedItemsSetUtilities.has(item)) return;\n selectedItemsSetUtilities.delete(item);\n },\n isRowSelected: (index) => {\n if (!props.selectable) return false;\n const item = computedItems.value[index];\n return selectedItemsSetUtilities.has(item);\n }\n });\n return (_ctx, _cache) => {\n return openBlock(), createBlock(_sfc_main$1, mergeProps(unref(props), {\n \"aria-busy\": busyModel.value,\n items: computedDisplayItems.value,\n fields: computedFields.value,\n \"table-class\": tableClasses.value,\n \"tbody-tr-class\": getRowClasses,\n \"field-column-class\": getFieldColumnClasses,\n onHeadClicked: onFieldHeadClick,\n onRowDblClicked: _cache[0] || (_cache[0] = (row, index, e) => {\n emit(\"row-dbl-clicked\", row, index, e);\n }),\n onRowClicked: onRowClick,\n onRowHovered: _cache[1] || (_cache[1] = (row, index, e) => {\n emit(\"row-hovered\", row, index, e);\n }),\n onRowUnhovered: _cache[2] || (_cache[2] = (row, index, e) => {\n emit(\"row-unhovered\", row, index, e);\n })\n }), createSlots({\n \"custom-body\": withCtx((scope) => [\n busyModel.value ? (openBlock(), createBlock(_sfc_main$2, {\n key: 0,\n class: normalizeClass([\"b-table-busy-slot\", getBusyRowClasses.value])\n }, {\n default: withCtx(() => [\n createVNode(_sfc_main$6, {\n colspan: scope.fields.length\n }, {\n default: withCtx(() => [\n renderSlot(_ctx.$slots, \"table-busy\", {}, () => [\n createVNode(_sfc_main$9, { show: \"\" }, {\n overlay: withCtx(() => [\n createElementVNode(\"div\", _hoisted_2, [\n createVNode(_sfc_main$a),\n createElementVNode(\"strong\", null, toDisplayString(unref(props).busyLoadingText), 1)\n ])\n ]),\n _: 1\n })\n ])\n ]),\n _: 2\n }, 1032, [\"colspan\"])\n ]),\n _: 2\n }, 1032, [\"class\"])) : createCommentVNode(\"\", true)\n ]),\n _: 2\n }, [\n renderList(_ctx.$slots, (_, name) => {\n return {\n name,\n fn: withCtx((slotData) => [\n renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(slotData)))\n ])\n };\n }),\n renderList(computedFields.value, (field) => {\n return {\n name: `head(${String(field.key)})`,\n fn: withCtx((scope) => {\n var _a, _b, _c, _d;\n return [\n renderSlot(_ctx.$slots, _ctx.$slots[`head(${String(field.key)})`] ? `head(${String(field.key)})` : \"head()\", normalizeProps(guardReactiveProps(scope)), () => [\n createTextVNode(toDisplayString(unref(getTableFieldHeadLabel)(field)), 1)\n ]),\n isSortable.value && !!scope.field.sortable && unref(props).noSortableIcon === false ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [\n ((_b = (_a = sortByModel.value) == null ? void 0 : _a.find((el) => el.key === scope.field.key)) == null ? void 0 : _b.order) === \"asc\" ? renderSlot(\n _ctx.$slots,\n _ctx.$slots[`sortAsc(${String(scope.field.key)})`] ? `sortAsc(${String(scope.field.key)})` : \"sortAsc()\",\n normalizeProps(mergeProps({ key: 0 }, { ...scope })),\n () => [\n _cache[3] || (_cache[3] = createElementVNode(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"24\",\n height: \"24\",\n fill: \"currentColor\",\n class: \"bi bi-arrow-up-short\",\n viewBox: \"0 0 16 16\",\n \"aria-hidden\": \"\"\n }, [\n createElementVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n d: \"M8 12a.5.5 0 0 0 .5-.5V5.707l2.146 2.147a.5.5 0 0 0 .708-.708l-3-3a.5.5 0 0 0-.708 0l-3 3a.5.5 0 1 0 .708.708L7.5 5.707V11.5a.5.5 0 0 0 .5.5z\"\n })\n ], -1))\n ]\n ) : ((_d = (_c = sortByModel.value) == null ? void 0 : _c.find((el) => el.key === scope.field.key)) == null ? void 0 : _d.order) === \"desc\" ? renderSlot(\n _ctx.$slots,\n _ctx.$slots[`sortDesc(${String(scope.field.key)})`] ? `sortDesc(${String(scope.field.key)})` : \"sortDesc()\",\n normalizeProps(mergeProps({ key: 1 }, { ...scope })),\n () => [\n _cache[4] || (_cache[4] = createElementVNode(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"24\",\n height: \"24\",\n fill: \"currentColor\",\n class: \"bi bi-arrow-down-short\",\n viewBox: \"0 0 16 16\",\n \"aria-hidden\": \"\"\n }, [\n createElementVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n d: \"M8 4a.5.5 0 0 1 .5.5v5.793l2.146-2.147a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 1 1 .708-.708L7.5 10.293V4.5A.5.5 0 0 1 8 4z\"\n })\n ], -1))\n ]\n ) : renderSlot(\n _ctx.$slots,\n _ctx.$slots[`sortDefault(${String(scope.field.key)})`] ? `sortDefault(${String(scope.field.key)})` : \"sortDefault()\",\n normalizeProps(mergeProps({ key: 2 }, { ...scope })),\n () => [\n (openBlock(), createElementBlock(\"svg\", _hoisted_1, _cache[5] || (_cache[5] = [\n createElementVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n d: \"M8 12a.5.5 0 0 0 .5-.5V5.707l2.146 2.147a.5.5 0 0 0 .708-.708l-3-3a.5.5 0 0 0-.708 0l-3 3a.5.5 0 1 0 .708.708L7.5 5.707V11.5a.5.5 0 0 0 .5.5z\"\n }, null, -1)\n ])))\n ]\n )\n ], 64)) : createCommentVNode(\"\", true)\n ];\n })\n };\n })\n ]), 1040, [\"aria-busy\", \"items\", \"fields\", \"table-class\"]);\n };\n }\n});\nexport {\n _sfc_main as _,\n _sfc_main$1 as a,\n _sfc_main$7 as b,\n _sfc_main$6 as c,\n _sfc_main$5 as d,\n _sfc_main$4 as e,\n _sfc_main$3 as f,\n _sfc_main$2 as g\n};\n//# sourceMappingURL=BTable.vue_vue_type_script_setup_true_lang-DSox5TGm.mjs.map\n"],"names":["useNumberishToStyle","el","unit","computed","value","toValue","resolvedUnit","RX_NUMBER","defaultStickyHeaderHeight","_sfc_main","defineComponent","__props","props","useDefaults","colorClasses","useColorVariantClasses","computedClasses","computedTableAttrs","computedSticky","stickyIsValid","isResponsive","responsiveStyles","responsiveClasses","_ctx","_cache","openBlock","createElementBlock","normalizeClass","normalizeStyle","createElementVNode","normalizeProps","guardReactiveProps","renderSlot","mergeProps","_sfc_main$7","_hoisted_1$3","_hoisted_2$3","_sfc_main$6","scope","unref","_hoisted_1$2","_hoisted_2$2","_sfc_main$4","_sfc_main$3","_sfc_main$2"],"mappings":"iJAEA,MAAMA,EAAsB,CAACC,EAAIC,EAAO,OAASC,EAAS,IAAM,CAC9D,MAAMC,EAAQC,EAAQJ,CAAE,EAClBK,EAAeD,EAAQH,CAAI,EACjC,OAAOK,EAAU,KAAK,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