{"version":3,"file":"BFormValidFeedback-CBYxQLDz.mjs","names":[],"sources":["../src/composables/useProvideFormGroupData.ts","../src/components/BForm/BFormInvalidFeedback.vue","../src/components/BForm/BFormInvalidFeedback.vue","../src/components/BForm/BFormRow.vue","../src/components/BForm/BFormRow.vue","../src/components/BForm/BFormText.vue","../src/components/BForm/BFormText.vue","../src/components/BForm/BFormValidFeedback.vue","../src/components/BForm/BFormValidFeedback.vue"],"sourcesContent":["import {computed, onUnmounted, provide, type Ref, shallowRef} from 'vue'\nimport type {ValidationState} from '../types/CommonTypes'\nimport {formGroupKey} from '../utils/keys'\n\nconst useLabelTargetRegistry = () => {\n  const labelTargetIds = shallowRef<Readonly<Ref<string | null>>[]>([])\n\n  // Track runs in the descendant's setup, so onUnmounted binds to the descendant.\n  const track = (idRef: Readonly<Ref<string | null>>) => {\n    labelTargetIds.value = [...labelTargetIds.value, idRef]\n    onUnmounted(() => {\n      labelTargetIds.value = labelTargetIds.value.filter((r: Readonly<Ref<string | null>>) => r !== idRef)\n    })\n  }\n\n  return {labelTargetIds, track}\n}\n\n/**\n * Provides formGroupKey for descendant form controls. Each provider has its own isolated\n * label-target registry: BFormGroup uses the resulting `singleLabelTargetId` to drive its\n * label/legend rendering. Intermediate components (e.g. BFormFloatingLabel) call this with\n * passed-through state/disabled, acting as a boundary — their registry exists but is unused,\n * so descendant claims never reach an outer BFormGroup.\n */\nexport const useProvideFormGroupData = ({\n  state,\n  disabled,\n}: {\n  state: Readonly<Ref<ValidationState | undefined>>\n  disabled: Readonly<Ref<boolean>>\n}) => {\n  const {labelTargetIds, track} = useLabelTargetRegistry()\n\n  provide(formGroupKey, () => ({state, disabled, track}))\n\n  // null unless exactly one distinct non-empty id is currently registered.\n  const singleLabelTargetId = computed<string | null>(() => {\n    let single: string | null = null\n    for (const r of labelTargetIds.value) {\n      const v = r.value\n      if (!v) continue\n      if (single !== null && single !== v) return null\n      single = v\n    }\n    return single\n  })\n\n  return {singleLabelTargetId}\n}\n","<template>\n  <component\n    :is=\"props.tag\"\n    :id=\"props.id\"\n    :role=\"props.role\"\n    :aria-live=\"props.ariaLive\"\n    :aria-atomic=\"props.ariaLive ? true : undefined\"\n    :class=\"computedClasses\"\n  >\n    <slot>\n      {{ props.text }}\n    </slot>\n  </component>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed} from 'vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {BFormInvalidFeedbackProps, BFormInvalidFeedbackSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<BFormInvalidFeedbackProps>(), {\n  ariaLive: undefined,\n  forceShow: false,\n  id: undefined,\n  role: undefined,\n  state: null,\n  tag: 'div',\n  text: undefined,\n  tooltip: false,\n})\nconst props = useDefaults(_props, 'BFormInvalidFeedback')\ndefineSlots<BFormInvalidFeedbackSlots>()\n\nconst computedShow = computed(() => props.forceShow || props.state === false)\n\nconst computedClasses = computed(() => ({\n  'd-block': computedShow.value,\n  'invalid-feedback': !props.tooltip,\n  'invalid-tooltip': props.tooltip,\n}))\n</script>\n","<template>\n  <component\n    :is=\"props.tag\"\n    :id=\"props.id\"\n    :role=\"props.role\"\n    :aria-live=\"props.ariaLive\"\n    :aria-atomic=\"props.ariaLive ? true : undefined\"\n    :class=\"computedClasses\"\n  >\n    <slot>\n      {{ props.text }}\n    </slot>\n  </component>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed} from 'vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {BFormInvalidFeedbackProps, BFormInvalidFeedbackSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<BFormInvalidFeedbackProps>(), {\n  ariaLive: undefined,\n  forceShow: false,\n  id: undefined,\n  role: undefined,\n  state: null,\n  tag: 'div',\n  text: undefined,\n  tooltip: false,\n})\nconst props = useDefaults(_props, 'BFormInvalidFeedback')\ndefineSlots<BFormInvalidFeedbackSlots>()\n\nconst computedShow = computed(() => props.forceShow || props.state === false)\n\nconst computedClasses = computed(() => ({\n  'd-block': computedShow.value,\n  'invalid-feedback': !props.tooltip,\n  'invalid-tooltip': props.tooltip,\n}))\n</script>\n","<template>\n  <component :is=\"props.tag\" class=\"row d-flex flex-wrap\">\n    <slot />\n  </component>\n</template>\n\n<script setup lang=\"ts\">\nimport type {BFormRowProps, BFormRowSlots} from '../../types'\nimport {useDefaults} from '../../composables/useDefaults'\n\nconst _props = withDefaults(defineProps<BFormRowProps>(), {\n  tag: 'div',\n})\nconst props = useDefaults(_props, 'BFormRow')\ndefineSlots<BFormRowSlots>()\n</script>\n","<template>\n  <component :is=\"props.tag\" class=\"row d-flex flex-wrap\">\n    <slot />\n  </component>\n</template>\n\n<script setup lang=\"ts\">\nimport type {BFormRowProps, BFormRowSlots} from '../../types'\nimport {useDefaults} from '../../composables/useDefaults'\n\nconst _props = withDefaults(defineProps<BFormRowProps>(), {\n  tag: 'div',\n})\nconst props = useDefaults(_props, 'BFormRow')\ndefineSlots<BFormRowSlots>()\n</script>\n","<template>\n  <component :is=\"props.tag\" :id=\"props.id\" :class=\"computedClasses\">\n    <slot>\n      {{ props.text }}\n    </slot>\n  </component>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed} from 'vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {useColorVariantClasses} from '../../composables/useColorVariantClasses'\nimport type {BFormTextProps, BFormTextSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<BFormTextProps>(), {\n  id: undefined,\n  inline: false,\n  tag: 'small',\n  text: undefined,\n  textVariant: 'body-secondary',\n})\nconst props = useDefaults(_props, 'BFormText')\ndefineSlots<BFormTextSlots>()\n\nconst colorClasses = useColorVariantClasses(props)\nconst computedClasses = computed(() => [\n  colorClasses.value,\n  {\n    'form-text': !props.inline,\n  },\n])\n</script>\n","<template>\n  <component :is=\"props.tag\" :id=\"props.id\" :class=\"computedClasses\">\n    <slot>\n      {{ props.text }}\n    </slot>\n  </component>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed} from 'vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {useColorVariantClasses} from '../../composables/useColorVariantClasses'\nimport type {BFormTextProps, BFormTextSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<BFormTextProps>(), {\n  id: undefined,\n  inline: false,\n  tag: 'small',\n  text: undefined,\n  textVariant: 'body-secondary',\n})\nconst props = useDefaults(_props, 'BFormText')\ndefineSlots<BFormTextSlots>()\n\nconst colorClasses = useColorVariantClasses(props)\nconst computedClasses = computed(() => [\n  colorClasses.value,\n  {\n    'form-text': !props.inline,\n  },\n])\n</script>\n","<template>\n  <component\n    :is=\"props.tag\"\n    :id=\"props.id\"\n    :role=\"props.role\"\n    :aria-live=\"props.ariaLive\"\n    :aria-atomic=\"props.ariaLive ? true : undefined\"\n    :class=\"computedClasses\"\n  >\n    <slot>\n      {{ props.text }}\n    </slot>\n  </component>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed} from 'vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {BFormValidFeedbackProps, BFormValidFeedbackSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<BFormValidFeedbackProps>(), {\n  ariaLive: undefined,\n  forceShow: false,\n  id: undefined,\n  role: undefined,\n  state: null,\n  tag: 'div',\n  text: undefined,\n  tooltip: false,\n})\nconst props = useDefaults(_props, 'BFormInvalidFeedback')\ndefineSlots<BFormValidFeedbackSlots>()\n\nconst computedShow = computed(() => props.forceShow === true || props.state === true)\n\nconst computedClasses = computed(() => ({\n  'd-block': computedShow.value,\n  'valid-feedback': !props.tooltip,\n  'valid-tooltip': props.tooltip,\n}))\n</script>\n","<template>\n  <component\n    :is=\"props.tag\"\n    :id=\"props.id\"\n    :role=\"props.role\"\n    :aria-live=\"props.ariaLive\"\n    :aria-atomic=\"props.ariaLive ? true : undefined\"\n    :class=\"computedClasses\"\n  >\n    <slot>\n      {{ props.text }}\n    </slot>\n  </component>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed} from 'vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {BFormValidFeedbackProps, BFormValidFeedbackSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<BFormValidFeedbackProps>(), {\n  ariaLive: undefined,\n  forceShow: false,\n  id: undefined,\n  role: undefined,\n  state: null,\n  tag: 'div',\n  text: undefined,\n  tooltip: false,\n})\nconst props = useDefaults(_props, 'BFormInvalidFeedback')\ndefineSlots<BFormValidFeedbackSlots>()\n\nconst computedShow = computed(() => props.forceShow === true || props.state === true)\n\nconst computedClasses = computed(() => ({\n  'd-block': computedShow.value,\n  'valid-feedback': !props.tooltip,\n  'valid-tooltip': props.tooltip,\n}))\n</script>\n"],"mappings":";;;;;AAIA,IAAM,+BAA+B;CACnC,MAAM,iBAAiB,WAA2C,EAAE,CAAC;CAGrE,MAAM,SAAS,UAAwC;AACrD,iBAAe,QAAQ,CAAC,GAAG,eAAe,OAAO,MAAM;AACvD,oBAAkB;AAChB,kBAAe,QAAQ,eAAe,MAAM,QAAQ,MAAoC,MAAM,MAAM;IACpG;;AAGJ,QAAO;EAAC;EAAgB;EAAM;;;;;;;;;AAUhC,IAAa,2BAA2B,EACtC,OACA,eAII;CACJ,MAAM,EAAC,gBAAgB,UAAS,wBAAwB;AAExD,SAAQ,qBAAqB;EAAC;EAAO;EAAU;EAAM,EAAE;AAcvD,QAAO,EAAC,qBAXoB,eAA8B;EACxD,IAAI,SAAwB;AAC5B,OAAK,MAAM,KAAK,eAAe,OAAO;GACpC,MAAM,IAAI,EAAE;AACZ,OAAI,CAAC,EAAG;AACR,OAAI,WAAW,QAAQ,WAAW,EAAG,QAAO;AAC5C,YAAS;;AAEX,SAAO;GACP,EAE0B;;;;;;;;;;;;;;;;;;;;;;;;;;EClB9B,MAAM,QAAQ,YAVC,SAUmB,uBAAsB;EAGxD,MAAM,eAAe,eAAe,MAAM,aAAa,MAAM,UAAU,MAAK;EAE5E,MAAM,kBAAkB,gBAAgB;GACtC,WAAW,aAAa;GACxB,oBAAoB,CAAC,MAAM;GAC3B,mBAAmB,MAAM;GAC1B,EAAC;;uBAtC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