{"version":3,"file":"BAlert-0UDGGiWI-D7ZQbn7O.js","sources":["../../../node_modules/bootstrap-vue-next/dist/useTransitions-BJccF5e-.mjs","../../../node_modules/bootstrap-vue-next/dist/BAlert-0UDGGiWI.mjs"],"sourcesContent":["import { computed, toValue } from \"vue\";\nconst useFadeTransition = (fade) => computed(() => {\n const NO_FADE_PROPS = {\n name: \"\",\n enterActiveClass: \"\",\n enterToClass: \"\",\n leaveActiveClass: \"\",\n leaveToClass: \"showing\",\n enterFromClass: \"showing\",\n leaveFromClass: \"\"\n };\n const FADE_PROPS = {\n ...NO_FADE_PROPS,\n enterActiveClass: \"fade showing\",\n leaveActiveClass: \"fade showing\"\n };\n return toValue(fade) ? FADE_PROPS : NO_FADE_PROPS;\n});\nexport {\n useFadeTransition as u\n};\n//# sourceMappingURL=useTransitions-BJccF5e-.mjs.map\n","import { defineComponent, mergeModels, useSlots, useTemplateRef, useModel, computed, watchEffect, openBlock, createBlock, Transition, mergeProps, unref, withCtx, createElementBlock, normalizeClass, renderSlot, Fragment, createTextVNode, toDisplayString, createCommentVNode } from \"vue\";\nimport { _ as _sfc_main$2 } from \"./BCloseButton.vue_vue_type_script_setup_true_lang-B0EXlL9P.mjs\";\nimport { _ as _sfc_main$1 } from \"./BButton.vue_vue_type_script_setup_true_lang-BC0Lfmfc.mjs\";\nimport { u as useCountdown, a as useCountdownHover } from \"./useCountdownHover-CJ6C8i_a.mjs\";\nimport { u as useDefaults } from \"./useDefaults-BTLXvYhO.mjs\";\nimport { i as isEmptySlot } from \"./dom-BK2w00Ec.mjs\";\nimport { u as useFadeTransition } from \"./useTransitions-BJccF5e-.mjs\";\nimport { _ as _export_sfc } from \"./_plugin-vue_export-helper-1tPrXgE0.mjs\";\nconst _sfc_main = /* @__PURE__ */ defineComponent({\n __name: \"BAlert\",\n props: /* @__PURE__ */ mergeModels({\n closeClass: { default: void 0 },\n closeContent: { default: void 0 },\n closeLabel: { default: \"Close\" },\n closeVariant: { default: \"secondary\" },\n dismissible: { type: Boolean, default: false },\n fade: { type: Boolean, default: false },\n immediate: { type: Boolean, default: true },\n interval: { default: \"requestAnimationFrame\" },\n noHoverPause: { type: Boolean, default: false },\n noResumeOnHoverLeave: { type: Boolean, default: false },\n showOnPause: { type: Boolean, default: true },\n variant: { default: \"info\" }\n }, {\n \"modelValue\": { type: [Boolean, Number], ...{ default: false } },\n \"modelModifiers\": {}\n }),\n emits: /* @__PURE__ */ mergeModels([\"close\", \"close-countdown\", \"closed\"], [\"update:modelValue\"]),\n setup(__props, { expose: __expose, emit: __emit }) {\n const _props = __props;\n const props = useDefaults(_props, \"BAlert\");\n const emit = __emit;\n const slots = useSlots();\n const fadeTransitions = useFadeTransition(() => props.fade);\n const element = useTemplateRef(\"_element\");\n const modelValue = useModel(__props, \"modelValue\");\n const hasCloseSlot = computed(() => !isEmptySlot(slots.close));\n const countdownLength = computed(\n () => typeof modelValue.value === \"boolean\" ? 0 : modelValue.value\n );\n const computedClasses = computed(() => ({\n [`alert-${props.variant}`]: props.variant !== null,\n \"alert-dismissible\": props.dismissible\n }));\n const closeClasses = computed(() => [props.closeClass, { \"btn-close-custom\": hasCloseSlot.value }]);\n const {\n isActive,\n pause,\n resume,\n stop,\n isPaused,\n restart,\n value: remainingMs\n } = useCountdown(countdownLength, props.interval, {\n immediate: typeof modelValue.value === \"number\" && props.immediate\n });\n useCountdownHover(\n element,\n computed(() => ({\n noHoverPause: props.noHoverPause,\n noResumeOnHoverLeave: props.noResumeOnHoverLeave,\n modelValueIgnoresHover: typeof modelValue.value === \"boolean\"\n })),\n { pause, resume }\n );\n const isAlertVisible = computed(\n () => typeof modelValue.value === \"boolean\" ? modelValue.value : isActive.value || props.showOnPause && isPaused.value\n );\n const closeAttrs = computed(() => ({\n variant: hasCloseSlot.value ? props.closeVariant : void 0,\n class: closeClasses.value\n }));\n watchEffect(() => {\n emit(\"close-countdown\", remainingMs.value);\n });\n const hide = () => {\n emit(\"close\");\n if (typeof modelValue.value === \"boolean\") {\n modelValue.value = false;\n } else {\n modelValue.value = 0;\n stop();\n }\n emit(\"closed\");\n };\n __expose({\n pause,\n resume,\n stop,\n restart\n });\n return (_ctx, _cache) => {\n return openBlock(), createBlock(Transition, mergeProps(unref(fadeTransitions), { \"enter-to-class\": \"show\" }), {\n default: withCtx(() => [\n isAlertVisible.value ? (openBlock(), createElementBlock(\"div\", {\n key: 0,\n ref: \"_element\",\n class: normalizeClass([\"alert\", computedClasses.value]),\n role: \"alert\",\n \"aria-live\": \"polite\",\n \"aria-atomic\": \"true\"\n }, [\n renderSlot(_ctx.$slots, \"default\", {}, void 0, true),\n unref(props).dismissible ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [\n hasCloseSlot.value || unref(props).closeContent ? (openBlock(), createBlock(_sfc_main$1, mergeProps({ key: 0 }, closeAttrs.value, { onClick: hide }), {\n default: withCtx(() => [\n renderSlot(_ctx.$slots, \"close\", {}, () => [\n createTextVNode(toDisplayString(unref(props).closeContent), 1)\n ], true)\n ]),\n _: 3\n }, 16)) : (openBlock(), createBlock(_sfc_main$2, mergeProps({\n key: 1,\n \"aria-label\": unref(props).closeLabel\n }, closeAttrs.value, { onClick: hide }), null, 16, [\"aria-label\"]))\n ], 64)) : createCommentVNode(\"\", true)\n ], 2)) : createCommentVNode(\"\", true)\n ]),\n _: 3\n }, 16);\n };\n }\n});\nconst BAlert = /* @__PURE__ */ _export_sfc(_sfc_main, [[\"__scopeId\", \"data-v-141c4f93\"]]);\nexport {\n BAlert as B\n};\n//# sourceMappingURL=BAlert-0UDGGiWI.mjs.map\n"],"names":["useFadeTransition","fade","computed","NO_FADE_PROPS","FADE_PROPS","toValue","_sfc_main","defineComponent","mergeModels","__props","__expose","__emit","props","useDefaults","emit","slots","useSlots","fadeTransitions","element","useTemplateRef","modelValue","useModel","hasCloseSlot","isEmptySlot","countdownLength","computedClasses","closeClasses","isActive","pause","resume","stop","isPaused","restart","remainingMs","useCountdown","useCountdownHover","isAlertVisible","closeAttrs","watchEffect","hide","_ctx","_cache","openBlock","createBlock","Transition","mergeProps","unref","withCtx","createElementBlock","normalizeClass","renderSlot","Fragment","_sfc_main$1","createTextVNode","toDisplayString","_sfc_main$2","createCommentVNode","BAlert","_export_sfc"],"mappings":"omBACA,MAAMA,EAAqBC,GAASC,EAAS,IAAM,CACjD,MAAMC,EAAgB,CACpB,KAAM,GACN,iBAAkB,GAClB,aAAc,GACd,iBAAkB,GAClB,aAAc,UACd,eAAgB,UAChB,eAAgB,EACjB,EACKC,EAAa,CACjB,GAAGD,EACH,iBAAkB,eAClB,iBAAkB,cACnB,EACD,OAAOE,EAAQJ,CAAI,EAAIG,EAAaD,CACtC,CAAC,ECTKG,EAA4BC,EAAgB,CAChD,OAAQ,SACR,MAAuBC,EAAY,CACjC,WAAY,CAAE,QAAS,MAAQ,EAC/B,aAAc,CAAE,QAAS,MAAQ,EACjC,WAAY,CAAE,QAAS,OAAS,EAChC,aAAc,CAAE,QAAS,WAAa,EACtC,YAAa,CAAE,KAAM,QAAS,QAAS,EAAO,EAC9C,KAAM,CAAE,KAAM,QAAS,QAAS,EAAO,EACvC,UAAW,CAAE,KAAM,QAAS,QAAS,EAAM,EAC3C,SAAU,CAAE,QAAS,uBAAyB,EAC9C,aAAc,CAAE,KAAM,QAAS,QAAS,EAAO,EAC/C,qBAAsB,CAAE,KAAM,QAAS,QAAS,EAAO,EACvD,YAAa,CAAE,KAAM,QAAS,QAAS,EAAM,EAC7C,QAAS,CAAE,QAAS,MAAM,CAC9B,EAAK,CACD,WAAc,CAAE,KAAM,CAAC,QAAS,MAAM,EAAQ,QAAS,EAAS,EAChE,eAAkB,CAAA,CACtB,CAAG,EACD,MAAuBA,EAAY,CAAC,QAAS,kBAAmB,QAAQ,EAAG,CAAC,mBAAmB,CAAC,EAChG,MAAMC,EAAS,CAAE,OAAQC,EAAU,KAAMC,GAAU,CAEjD,MAAMC,EAAQC,EADCJ,EACmB,QAAQ,EACpCK,EAAOH,EACPI,EAAQC,EAAU,EAClBC,EAAkBjB,E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