{"version":3,"file":"DYNJVsbk.js","sources":["../../../../node_modules/.pnpm/@nuxt+ui@2.20.0_axios@1.7.7_magicast@0.3.5_rollup@4.24.0_sortablejs@1.14.0_typescript@5.6.3_v_mfllii6etumfxz3e2rqnt3xxey/node_modules/@nuxt/ui/dist/runtime/composables/useFormGroup.js"],"sourcesContent":["import { inject, ref, computed } from \"vue\";\nimport { useDebounceFn } from \"@vueuse/core\";\nexport const useFormGroup = (inputProps, config, bind = true) => {\n const formBus = inject(\"form-events\", void 0);\n const formGroup = inject(\"form-group\", void 0);\n const formInputs = inject(\"form-inputs\", void 0);\n if (formGroup) {\n if (!bind || inputProps?.legend) {\n formGroup.inputId.value = void 0;\n } else if (inputProps?.id) {\n formGroup.inputId.value = inputProps?.id;\n }\n if (formInputs) {\n formInputs.value[formGroup.name.value] = formGroup.inputId.value;\n }\n }\n const blurred = ref(false);\n function emitFormEvent(type, path) {\n if (formBus) {\n formBus.emit({ type, path });\n }\n }\n function emitFormBlur() {\n emitFormEvent(\"blur\", formGroup?.name.value);\n blurred.value = true;\n }\n function emitFormChange() {\n emitFormEvent(\"change\", formGroup?.name.value);\n }\n const emitFormInput = useDebounceFn(() => {\n if (blurred.value || formGroup?.eagerValidation.value) {\n emitFormEvent(\"input\", formGroup?.name.value);\n }\n }, 300);\n return {\n inputId: computed(() => inputProps?.id ?? formGroup?.inputId.value),\n name: computed(() => inputProps?.name ?? formGroup?.name.value),\n size: computed(() => {\n const formGroupSize = config.size[formGroup?.size.value] ? formGroup?.size.value : null;\n return inputProps?.size ?? formGroupSize ?? config.default?.size;\n }),\n color: computed(() => formGroup?.error?.value ? \"red\" : inputProps?.color),\n emitFormBlur,\n emitFormInput,\n emitFormChange\n };\n};\n"],"names":["useFormGroup","inputProps","config","bind","formBus","inject","formGroup","formInputs","blurred","ref","emitFormEvent","type","path","emitFormBlur","emitFormChange","emitFormInput","useDebounceFn","computed","formGroupSize","_a"],"mappings":"yDAEY,MAACA,EAAe,CAACC,EAAYC,EA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