@formatica/vue 0.1.2 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/BaseField.d.ts +28 -0
- package/dist/components/BaseField.d.ts.map +1 -0
- package/dist/components/FormBuilder.d.ts +25 -0
- package/dist/components/FormBuilder.d.ts.map +1 -0
- package/dist/components/FormField.d.ts +6 -0
- package/dist/components/FormField.d.ts.map +1 -0
- package/dist/components/inputs/CheckboxGroupInput.d.ts +21 -0
- package/dist/components/inputs/CheckboxGroupInput.d.ts.map +1 -0
- package/dist/components/inputs/CheckboxInput.d.ts +16 -0
- package/dist/components/inputs/CheckboxInput.d.ts.map +1 -0
- package/dist/components/inputs/DateInput.d.ts +22 -0
- package/dist/components/inputs/DateInput.d.ts.map +1 -0
- package/dist/components/inputs/FileInput.d.ts +22 -0
- package/dist/components/inputs/FileInput.d.ts.map +1 -0
- package/dist/components/inputs/NumberInput.d.ts +26 -0
- package/dist/components/inputs/NumberInput.d.ts.map +1 -0
- package/dist/components/inputs/PhoneInput.d.ts +23 -0
- package/dist/components/inputs/PhoneInput.d.ts.map +1 -0
- package/dist/components/inputs/RadioInput.d.ts +19 -0
- package/dist/components/inputs/RadioInput.d.ts.map +1 -0
- package/dist/components/inputs/SelectInput.d.ts +29 -0
- package/dist/components/inputs/SelectInput.d.ts.map +1 -0
- package/dist/components/inputs/SliderInput.d.ts +23 -0
- package/dist/components/inputs/SliderInput.d.ts.map +1 -0
- package/dist/components/inputs/SwitchInput.d.ts +17 -0
- package/dist/components/inputs/SwitchInput.d.ts.map +1 -0
- package/dist/components/inputs/TagsInput.d.ts +24 -0
- package/dist/components/inputs/TagsInput.d.ts.map +1 -0
- package/dist/components/inputs/TextInput.d.ts +27 -0
- package/dist/components/inputs/TextInput.d.ts.map +1 -0
- package/dist/components/inputs/TextareaInput.d.ts +28 -0
- package/dist/components/inputs/TextareaInput.d.ts.map +1 -0
- package/dist/components/layout/FormDivider.d.ts +7 -0
- package/dist/components/layout/FormDivider.d.ts.map +1 -0
- package/dist/components/layout/FormGroup.d.ts +15 -0
- package/dist/components/layout/FormGroup.d.ts.map +1 -0
- package/dist/components/layout/FormHtml.d.ts +7 -0
- package/dist/components/layout/FormHtml.d.ts.map +1 -0
- package/dist/components/layout/FormRow.d.ts +12 -0
- package/dist/components/layout/FormRow.d.ts.map +1 -0
- package/dist/components/layout/FormSteps.d.ts +11 -0
- package/dist/components/layout/FormSteps.d.ts.map +1 -0
- package/dist/components/layout/FormTabs.d.ts +8 -0
- package/dist/components/layout/FormTabs.d.ts.map +1 -0
- package/dist/components/layout/LayoutRenderer.d.ts +8 -0
- package/dist/components/layout/LayoutRenderer.d.ts.map +1 -0
- package/dist/core/eventBus.d.ts +9 -0
- package/dist/core/eventBus.d.ts.map +1 -0
- package/dist/core/fieldRegistry.d.ts +24 -0
- package/dist/core/fieldRegistry.d.ts.map +1 -0
- package/dist/core/ruleRegistry.d.ts +2 -0
- package/dist/core/ruleRegistry.d.ts.map +1 -0
- package/dist/core/schemaParser.d.ts +4 -0
- package/dist/core/schemaParser.d.ts.map +1 -0
- package/dist/core/useConditions.d.ts +2 -0
- package/dist/core/useConditions.d.ts.map +1 -0
- package/dist/core/useForm.d.ts +10 -0
- package/dist/core/useForm.d.ts.map +1 -0
- package/dist/core/useFormI18n.d.ts +22 -0
- package/dist/core/useFormI18n.d.ts.map +1 -0
- package/dist/core/useTheme.d.ts +28 -0
- package/dist/core/useTheme.d.ts.map +1 -0
- package/dist/core/useValidation.d.ts +17 -0
- package/dist/core/useValidation.d.ts.map +1 -0
- package/dist/formatica.es.js +974 -966
- package/dist/formatica.es.js.map +1 -1
- package/dist/formatica.umd.cjs +1 -1
- package/dist/formatica.umd.cjs.map +1 -1
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/plugin.d.ts +11 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/types/form.d.ts +92 -0
- package/dist/types/form.d.ts.map +1 -0
- package/dist/types/i18n.d.ts +18 -0
- package/dist/types/i18n.d.ts.map +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/layout.d.ts +76 -0
- package/dist/types/layout.d.ts.map +1 -0
- package/dist/types/schema.d.ts +251 -0
- package/dist/types/schema.d.ts.map +1 -0
- package/dist/types/theme.d.ts +69 -0
- package/dist/types/theme.d.ts.map +1 -0
- package/dist/types/validation.d.ts +26 -0
- package/dist/types/validation.d.ts.map +1 -0
- package/dist/utils/deepMerge.d.ts +2 -0
- package/dist/utils/deepMerge.d.ts.map +1 -0
- package/dist/utils/extractFields.d.ts +2 -0
- package/dist/utils/extractFields.d.ts.map +1 -0
- package/dist/utils/sanitize.d.ts +2 -0
- package/dist/utils/sanitize.d.ts.map +1 -0
- package/dist/utils/titleCase.d.ts +2 -0
- package/dist/utils/titleCase.d.ts.map +1 -0
- package/package.json +4 -2
package/dist/formatica.umd.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(T,S){typeof exports=="object"&&typeof module<"u"?S(exports,require("@formatica/core"),require("vue"),require("libphonenumber-js")):typeof define=="function"&&define.amd?define(["exports","@formatica/core","vue","libphonenumber-js"],S):(T=typeof globalThis<"u"?globalThis:T||self,S(T.Formatica={},T.FormaticaCore,T.Vue,T.libphonenumber))})(this,function(T,S,e,M){"use strict";const U=Symbol("FormaticaComponents"),j=new Map;function _(t,c){j.set(t,c)}function le(t){j.delete(t)}function Y(t){return j.get(t)}function W(t){return j.has(t)}function oe(){return Array.from(j.keys())}function ne(){const t=new Map;function c(l,s){t.has(l)||t.set(l,new Set);const d=t.get(l);return d?(d.add(s),()=>{d.delete(s)}):()=>{}}function a(l,s){const d=t.get(l);if(d)for(const m of d)m(s)}return{on:c,emit:a}}const P=Symbol("FormaticaI18n"),re={required:"This field is required",email:"Please enter a valid email address",url:"Please enter a valid URL",min:"Must be at least {min}",max:"Must be at most {max}",minLength:"Must be at least {min} characters",maxLength:"Must be at most {max} characters",between:"Must be between {min} and {max}",pattern:"Invalid format",numeric:"Must be a number",integer:"Must be an integer",alpha:"Must contain only letters",alphaNumeric:"Must contain only letters and numbers",confirmed:"Confirmation does not match",date:"Please enter a valid date"};function Q(t){const{locale:c,fallbackLocale:a="en",fieldTranslations:l={},formTranslations:s={}}=t;function d(r,i){const y=l[r];if(y){const x=y[c.value];if(x){const f=x[i];if(typeof f=="string")return f}const w=y[a];if(w){const f=w[i];if(typeof f=="string")return f}}return i==="label"?S.titleCase(r):""}function m(r,i){var x,w;const y=l[r];if(y){const f=y[c.value];if((x=f==null?void 0:f.options)!=null&&x[i])return f.options[i];const p=y[a];if((w=p==null?void 0:p.options)!=null&&w[i])return p.options[i]}return i}function o(r,i){var f,p;const y=(f=s[c.value])==null?void 0:f.messages;if(y!=null&&y[r])return H(y[r],i??{});const x=(p=s[a])==null?void 0:p.messages;if(x!=null&&x[r])return H(x[r],i??{});const w=re[r];return w?H(w,i??{}):`Validation failed: ${r}`}const n={locale:c,fallbackLocale:a,t:d,tOption:m,tValidation:o};return e.provide(P,n),n}function J(){return e.inject(P)}function H(t,c){return t.replace(/\{(\w+)\}/g,(a,l)=>c[l]!==void 0?String(c[l]):`{${l}}`)}function X(t){return t.split("|").map(c=>{const[a,...l]=c.split(":"),s={};if(l.length>0){const m=l.join(":").split(",");a==="between"&&m.length===2?(s.min=m[0],s.max=m[1]):m.length===1?s[a]=m[0]:s.values=m}return{name:a,params:s}})}function se(t){const c=t.rules;if(!c){const l=[];return t.required&&l.push({name:"required"}),l}if(typeof c=="string")return X(c);if(Array.isArray(c))return c.flatMap(l=>typeof l=="string"?X(l):[]);const a=[];for(const[l,s]of Object.entries(c)){if(s===!1)continue;const d={};typeof s=="object"&&s!==null&&!Array.isArray(s)?Object.assign(d,s):s!==!0&&(d[l]=s),a.push({name:l,params:d})}return a}function ie(t,c){let a=null,l=null;return(...s)=>new Promise(d=>{a!==null&&(clearTimeout(a),l&&l([])),l=d,a=setTimeout(async()=>{a=null;const m=await t(...s);d(m),l=null},c)})}function ce(t){const{fields:c,values:a,settings:l}=t,s=e.ref({}),d=new Map;function m(x,w){const f=`${x}:${w}`;d.has(f)||d.set(f,ie(async(...u)=>o(u[0],u[1]),w));const p=d.get(f);if(!p)throw new Error(`Debounced validator not found for ${f}`);return p}async function o(x,w){var V;const f=c.value.find(h=>h.name===x);if(!f)return[];const p=se(f),u=a.value[x],b=[];for(const h of p){if((V=h.params)!=null&&V.when){const k=h.params.when;if(("field"in k||"and"in k||"or"in k)&&!S.evaluateCondition(k,a.value))continue}if(h.optional&&de(u))continue;let B;if(h.validator)B=await h.validator(u,h.params??{},w);else{const k=S.getRule(h.name);if(!k)continue;B=await k(u,h.params??{},w)}if(B!==!0){const k=h.message?me(h.message,h.params??{}):typeof B=="string"?B:`Validation failed for rule: ${h.name}`;if(b.push(k),h.bail)break}}return s.value[x]=b,b}async function n(x,w){const f=l==null?void 0:l.debounce;return f&&f>0?m(x,f)(x,w):o(x,w)}async function r(x){const w={},f=c.value.map(async p=>{const u=await o(p.name,x);u.length>0&&(w[p.name]=u)});return await Promise.all(f),s.value={...w},w}function i(x){delete s.value[x]}function y(){s.value={}}return{errors:s,validateField:n,validateAll:r,clearFieldErrors:i,clearAllErrors:y}}function de(t){return!!(t==null||t===""||Array.isArray(t)&&t.length===0)}function me(t,c){return t.replace(/\{(\w+)\}/g,(a,l)=>c[l]!==void 0?String(c[l]):`{${l}}`)}const R=Symbol("FormaticaContext");function ue(t){switch(t.type){case"tags":return[];case"checkbox-group":return[];case"checkbox":return!1;case"switch":return!1;case"number":case"slider":return null;case"file":return null;default:return""}}function G(t){const c={};for(const a of t)c[a.name]=a.defaultValue??ue(a);return c}function fe(t){const c={};for(const a of t)a.translations&&(c[a.name]=a.translations);return c}function ee(t,c){const a=e.ref((c==null?void 0:c.locale)??"en"),l=(c==null?void 0:c.fallbackLocale)??"en";let s=t;const d=e.ref(S.extractFields(t.fields)),m=e.reactive(G(S.extractFields(t.fields))),o=e.reactive({}),n=e.reactive({}),r=e.reactive({}),i=e.ref(!1),y=e.ref(0),x=e.computed(()=>Object.values(o).every(g=>g.length===0)),w=e.computed(()=>Object.values(r).some(Boolean)),f=ne();function p(){return{values:{...m},getFieldValue:g=>m[g]}}const u=e.computed(()=>({...m})),b=ce({fields:d,values:u,settings:t.settings});Q({locale:a,fallbackLocale:l,fieldTranslations:fe(S.extractFields(t.fields)),formTranslations:t.translations});let V=G(S.extractFields(t.fields));e.watch(()=>({...m}),(g,E)=>{var F;if(E){for(const D of Object.keys(g))g[D]!==E[D]&&(r[D]=!0,f.emit("field:change",{field:D,value:g[D],previousValue:E[D]}),(F=t.settings)!=null&&F.validateOnChange&&$(D));f.emit("change",{values:g})}},{deep:!0});const h=new Map;function B(g){const E=g.name;return{name:E,value:e.computed({get:()=>m[E],set:F=>{m[E]=F}}),errors:e.computed(()=>o[E]??[]),touched:e.computed({get:()=>n[E]??!1,set:F=>{n[E]=F}}),dirty:e.computed({get:()=>r[E]??!1,set:F=>{r[E]=F}}),disabled:e.computed(()=>typeof g.disabled=="function"?g.disabled(p()):g.disabled??!1),visible:e.computed(()=>g.condition?S.evaluateCondition(g.condition,m):typeof g.visible=="function"?g.visible(p()):g.visible??!0),schema:g,validate:()=>$(E),reset:()=>{m[E]=V[E]??null,delete o[E],n[E]=!1,r[E]=!1},clear:()=>{m[E]=null,delete o[E]}}}function k(){h.clear();for(const g of S.extractFields(s.fields))h.set(g.name,B(g))}k();async function $(g){const E=await b.validateField(g,p());return o[g]=E,f.emit("validate:field",{field:g,valid:E.length===0,errors:E}),E}async function C(){const g=await b.validateAll(p());for(const F of Object.keys(o))F in g||delete o[F];for(const[F,D]of Object.entries(g))o[F]=D;const E=Object.values(g).every(F=>F.length===0);return f.emit("validate",{valid:E,errors:{...g}}),E}async function N(g){i.value=!0,y.value+=1;try{for(const F of S.extractFields(s.fields))n[F.name]=!0;if(!await C()){f.emit("submit:error",{values:{...m},error:new Error("Validation failed")});return}f.emit("submit",{values:{...m}}),g&&await g({...m},p()),f.emit("submit:success",{values:{...m},result:void 0})}catch(E){throw f.emit("submit:error",{values:{...m},error:E}),E}finally{i.value=!1}}function z(){for(const g of S.extractFields(s.fields))m[g.name]=V[g.name]??null,delete o[g.name],n[g.name]=!1,r[g.name]=!1;b.clearAllErrors(),f.emit("reset",void 0)}function A(){for(const g of S.extractFields(s.fields))m[g.name]=null,delete o[g.name];b.clearAllErrors()}function K(g){s=g;const E=S.extractFields(g.fields);d.value=E,V=G(E);for(const D of E)D.name in m||(m[D.name]=D.defaultValue??null);const F=new Set(E.map(D=>D.name));for(const D of Object.keys(m))F.has(D)||(delete m[D],delete o[D],delete n[D],delete r[D]);k()}const ae={values:m,errors:o,touched:n,dirty:r,isValid:x,isDirty:w,isSubmitting:i,submitCount:y,validate:C,validateField:$,submit:N,reset:z,clear:A,setError:(g,E)=>{o[g]=E},clearError:g=>{delete o[g],b.clearFieldErrors(g)},clearErrors:()=>{for(const g of Object.keys(o))delete o[g];b.clearAllErrors()},getField:g=>h.get(g),setFieldValue:(g,E)=>{m[g]=E},setFieldDisabled:(g,E)=>{const F=S.extractFields(s.fields).find(D=>D.name===g);F&&(F.disabled=E)},setFieldVisible:(g,E)=>{const F=S.extractFields(s.fields).find(D=>D.name===g);F&&(F.visible=E)},on:f.on,locale:a,setLocale:g=>{a.value=g},schema:s,updateSchema:K};return e.provide(R,ae),ae}const q=Symbol("FormaticaTheme"),Z={name:"default",colors:{primary:"#3b82f6",primaryHover:"#2563eb",error:"#ef4444",errorHover:"#dc2626",success:"#22c55e",warning:"#f59e0b",info:"#3b82f6",text:"#1f2937",textSecondary:"#6b7280",textDisabled:"#9ca3af",background:"#ffffff",backgroundDisabled:"#f3f4f6",border:"#d1d5db",borderFocus:"#3b82f6",borderError:"#ef4444",placeholder:"#9ca3af"},typography:{fontFamily:"inherit",fontSize:"0.875rem",fontSizeSmall:"0.75rem",fontSizeLarge:"1rem",lineHeight:"1.5",labelFontWeight:"500"},spacing:{fieldGap:"1rem",rowGap:"1rem",inputPaddingX:"0.75rem",inputPaddingY:"0.5rem",labelMarginBottom:"0.375rem"},borders:{radius:"0.375rem",radiusSmall:"0.25rem",radiusLarge:"0.5rem",width:"1px",style:"solid"},shadows:{focus:"0 0 0 3px rgba(59, 130, 246, 0.1)",error:"0 0 0 3px rgba(239, 68, 68, 0.1)",dropdown:"0 4px 6px -1px rgba(0, 0, 0, 0.1)"},transitions:{duration:"150ms",timingFunction:"ease-in-out"}};function pe(t){const c=e.isRef(t)?e.computed(()=>t.value??Z):e.ref(t??Z),a=e.computed(()=>{const d=c.value.components??{};return{form:d.form??"fc-form",field:d.field??"fc-field",label:d.label??"fc-label",input:d.input??"fc-input",error:d.error??"fc-error",helpText:d.helpText??"fc-help-text",group:d.group??"fc-group",row:d.row??"fc-row",steps:d.steps??"fc-steps",tabs:d.tabs??"fc-tabs",button:d.button??"fc-button"}}),l=e.computed(()=>{const d=c.value,m={};if(d.colors)for(const[o,n]of Object.entries(d.colors))n&&(m[`--fc-color-${I(o)}`]=n);if(d.typography)for(const[o,n]of Object.entries(d.typography))n&&(m[`--fc-${I(o)}`]=n);if(d.spacing)for(const[o,n]of Object.entries(d.spacing))n&&(m[`--fc-${I(o)}`]=n);if(d.borders)for(const[o,n]of Object.entries(d.borders))n&&(m[`--fc-border-${I(o)}`]=n);if(d.shadows)for(const[o,n]of Object.entries(d.shadows))n&&(m[`--fc-shadow-${I(o)}`]=n);if(d.transitions)for(const[o,n]of Object.entries(d.transitions))n&&(m[`--fc-transition-${I(o)}`]=n);return d.cssVars&&Object.assign(m,d.cssVars),m}),s={config:c.value,classes:a,cssVars:l};return e.provide(q,s),s}function L(){const t=e.inject(q);return t||be()}function be(){const t=e.computed(()=>({form:"fc-form",field:"fc-field",label:"fc-label",input:"fc-input",error:"fc-error",helpText:"fc-help-text",group:"fc-group",row:"fc-row",steps:"fc-steps",tabs:"fc-tabs",button:"fc-button"})),c=e.computed(()=>({}));return{config:Z,classes:t,cssVars:c}}function I(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}const ye=["checked","disabled","onChange"],ge=["aria-checked","aria-disabled","onClick","onKeydown"],he={key:0,class:"h-3 w-3",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},ke={class:"text-sm text-gray-700"},xe=e.defineComponent({__name:"CheckboxGroupInput",props:{modelValue:{},options:{},inline:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minSelect:{},maxSelect:{}},emits:["update:modelValue","blur"],setup(t,{emit:c}){const a=t,l=c;L();function s(n){return a.modelValue.includes(n)}function d(n){return!!(a.disabled||n.disabled||a.maxSelect&&!s(n.value)&&a.modelValue.length>=a.maxSelect)}function m(n){if(d(n))return;const r=[...a.modelValue],i=r.indexOf(n.value);if(i>=0){if(a.minSelect&&r.length<=a.minSelect)return;r.splice(i,1)}else r.push(n.value);l("update:modelValue",r)}function o(n,r){(n.key===" "||n.key==="Enter")&&(n.preventDefault(),m(r))}return(n,r)=>(e.openBlock(),e.createElementBlock("div",{role:"group",class:e.normalizeClass(t.inline?"flex flex-wrap gap-4":"flex flex-col gap-2")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,i=>(e.openBlock(),e.createElementBlock("label",{key:String(i.value),class:e.normalizeClass(["inline-flex items-center gap-2 select-none",d(i)?"opacity-50 cursor-not-allowed":"cursor-pointer"])},[e.createElementVNode("input",{type:"checkbox",checked:s(i.value),disabled:d(i),class:"sr-only",onChange:y=>m(i),onBlur:r[0]||(r[0]=y=>l("blur",y))},null,40,ye),e.createElementVNode("div",{role:"checkbox","aria-checked":s(i.value),"aria-disabled":d(i)||void 0,tabindex:"0",class:e.normalizeClass(["flex h-5 w-5 shrink-0 items-center justify-center rounded border-2 transition-colors duration-200",s(i.value)?"text-white":"border-gray-300 bg-white"]),style:e.normalizeStyle(s(i.value)?{borderColor:"var(--fc-color-primary, #3b82f6)",backgroundColor:"var(--fc-color-primary, #3b82f6)"}:{}),onClick:y=>m(i),onKeydown:y=>o(y,i)},[s(i.value)?(e.openBlock(),e.createElementBlock("svg",he,[...r[1]||(r[1]=[e.createElementVNode("path",{d:"M2 6l3 3 5-5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):e.createCommentVNode("",!0)],46,ge),e.createElementVNode("span",ke,e.toDisplayString(i.label),1)],2))),128))],2))}}),Be=["checked","disabled"],we=["aria-checked","aria-disabled"],Ce={key:0,class:"h-3 w-3",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},Ve={key:0,class:"text-sm text-gray-700"},Ee=e.defineComponent({__name:"CheckboxInput",props:{modelValue:{type:Boolean},checkboxLabel:{},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","blur"],setup(t,{emit:c}){const a=t,l=c;L();const s=e.computed(()=>["inline-flex items-center gap-2 select-none",a.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"]);function d(){a.disabled||l("update:modelValue",!a.modelValue)}function m(o){(o.key===" "||o.key==="Enter")&&(o.preventDefault(),d())}return(o,n)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(s.value)},[e.createElementVNode("input",{type:"checkbox",checked:t.modelValue,disabled:t.disabled,class:"sr-only",onChange:d,onBlur:n[0]||(n[0]=r=>l("blur",r))},null,40,Be),e.createElementVNode("div",{role:"checkbox","aria-checked":t.modelValue,"aria-disabled":t.disabled||void 0,tabindex:"0",class:e.normalizeClass(["flex h-5 w-5 shrink-0 items-center justify-center rounded border-2 transition-colors duration-200",t.modelValue?"text-white":"border-gray-300 bg-white"]),style:e.normalizeStyle(t.modelValue?{borderColor:"var(--fc-color-primary, #3b82f6)",backgroundColor:"var(--fc-color-primary, #3b82f6)"}:{}),onClick:d,onKeydown:m},[t.modelValue?(e.openBlock(),e.createElementBlock("svg",Ce,[...n[1]||(n[1]=[e.createElementVNode("path",{d:"M2 6l3 3 5-5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):e.createCommentVNode("",!0)],46,we),t.checkboxLabel?(e.openBlock(),e.createElementBlock("span",Ve,e.toDisplayString(t.checkboxLabel),1)):e.createCommentVNode("",!0)],2))}}),Ne=["value","min","max","placeholder","disabled","aria-disabled"],$e=e.defineComponent({__name:"DateInput",props:{modelValue:{},format:{},minDate:{},maxDate:{},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","blur","focus"],setup(t,{emit:c}){const a=t,l=c,s=L(),d=e.computed(()=>["w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm","focus:outline-none focus:ring-2 focus:ring-blue-500/20 fc-date-input","transition-colors duration-200",a.disabled?"opacity-50 cursor-not-allowed bg-gray-100":"",s.classes.value.input].filter(Boolean).join(" "));function m(o){const n=o.target;l("update:modelValue",n.value)}return(o,n)=>(e.openBlock(),e.createElementBlock("input",{type:"date",value:t.modelValue,min:t.minDate,max:t.maxDate,placeholder:t.placeholder,disabled:t.disabled,class:e.normalizeClass(d.value),"aria-disabled":t.disabled||void 0,onInput:m,onBlur:n[0]||(n[0]=r=>l("blur",r)),onFocus:n[1]||(n[1]=r=>l("focus",r))},null,42,Ne))}}),O=(t,c)=>{const a=t.__vccOpts||t;for(const[l,s]of c)a[l]=s;return a},Se=O($e,[["__scopeId","data-v-7d4bc9b7"]]),Fe=["aria-disabled","onKeydown"],De={key:0,class:"mt-1 text-xs text-gray-400"},ze=["accept","multiple"],Te={key:0,class:"mt-3 space-y-2"},Le={class:"flex items-center gap-2 truncate"},Me={class:"truncate"},Ie={class:"shrink-0 text-xs text-gray-400"},Ae=["onClick"],je=e.defineComponent({__name:"FileInput",props:{modelValue:{},accept:{},maxSize:{},multiple:{type:Boolean,default:!1},maxFiles:{},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","blur"],setup(t,{emit:c}){const a=t,l=c;L();const s=e.ref(null),d=e.ref(!1),m=e.computed(()=>a.modelValue?Array.isArray(a.modelValue)?a.modelValue:[a.modelValue]:[]);function o(u){return u<1024?`${u} B`:u<1024*1024?`${(u/1024).toFixed(1)} KB`:`${(u/(1024*1024)).toFixed(1)} MB`}function n(u){let b=u;if(a.maxSize){const V=a.maxSize;b=b.filter(h=>h.size<=V)}if(a.multiple&&a.maxFiles){const V=a.maxFiles-m.value.length;b=b.slice(0,Math.max(0,V))}return b}function r(u){const b=n(u);b.length!==0&&(a.multiple?l("update:modelValue",[...m.value,...b]):l("update:modelValue",b[0]))}function i(u){const b=u.target;b.files&&(r(Array.from(b.files)),b.value="")}function y(u){if(a.disabled)return;const b=m.value.filter((V,h)=>h!==u);a.multiple?l("update:modelValue",b.length?b:[]):l("update:modelValue",null)}function x(u){u.preventDefault(),a.disabled||(d.value=!0)}function w(){d.value=!1}function f(u){var b;u.preventDefault(),d.value=!1,!(a.disabled||!((b=u.dataTransfer)!=null&&b.files))&&r(Array.from(u.dataTransfer.files))}function p(){var u;a.disabled||(u=s.value)==null||u.click()}return(u,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(t.disabled?"opacity-50 cursor-not-allowed":"")},[e.createElementVNode("div",{role:"button",tabindex:"0","aria-disabled":t.disabled||void 0,class:e.normalizeClass(["flex flex-col items-center justify-center rounded-lg border-2 border-dashed p-6 text-center transition-colors duration-200",d.value?"":"border-gray-300 bg-gray-50",t.disabled?"pointer-events-none":"cursor-pointer hover:border-gray-400"]),style:e.normalizeStyle(d.value?{borderColor:"var(--fc-color-primary, #3b82f6)",backgroundColor:"color-mix(in srgb, var(--fc-color-primary, #3b82f6) 8%, white)"}:{}),onClick:p,onKeydown:[e.withKeys(p,["enter"]),e.withKeys(e.withModifiers(p,["prevent"]),["space"])],onDragover:x,onDragleave:w,onDrop:f,onBlur:b[0]||(b[0]=V=>l("blur",V))},[b[1]||(b[1]=e.createElementVNode("svg",{class:"mb-2 h-8 w-8 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 16v-8m0 0l-3 3m3-3l3 3M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1"})],-1)),b[2]||(b[2]=e.createElementVNode("p",{class:"text-sm text-gray-600"},[e.createTextVNode(" Drop files here or "),e.createElementVNode("span",{class:"font-medium",style:{color:"var(--fc-color-primary, #3b82f6)"}},"browse")],-1)),t.accept?(e.openBlock(),e.createElementBlock("p",De,"Accepted: "+e.toDisplayString(t.accept),1)):e.createCommentVNode("",!0)],46,Fe),e.createElementVNode("input",{ref_key:"fileInputRef",ref:s,type:"file",accept:t.accept,multiple:t.multiple,class:"hidden",onChange:i},null,40,ze),m.value.length>0?(e.openBlock(),e.createElementBlock("ul",Te,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(V,h)=>(e.openBlock(),e.createElementBlock("li",{key:`${V.name}-${h}`,class:"flex items-center justify-between rounded-md border border-gray-200 bg-white px-3 py-2 text-sm"},[e.createElementVNode("div",Le,[b[3]||(b[3]=e.createElementVNode("svg",{class:"h-4 w-4 shrink-0 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})],-1)),e.createElementVNode("span",Me,e.toDisplayString(V.name),1),e.createElementVNode("span",Ie,"("+e.toDisplayString(o(V.size))+")",1)]),t.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"ml-2 shrink-0 text-gray-400 hover:text-red-500 transition-colors duration-200","aria-label":"Remove file",onClick:e.withModifiers(B=>y(h),["stop"])}," × ",8,Ae))]))),128))])):e.createCommentVNode("",!0)],2))}}),Re={key:0,class:"flex items-stretch"},Oe={key:0,class:"inline-flex items-center rounded-l-md border border-r-0 border-gray-300 bg-gray-50 px-3 text-sm text-gray-500"},ve=["value","min","max","step","disabled","readonly","aria-disabled","aria-readonly"],Ke={key:1,class:"inline-flex items-center rounded-r-md border border-l-0 border-gray-300 bg-gray-50 px-3 text-sm text-gray-500"},Pe=["value","min","max","step","disabled","readonly","aria-disabled","aria-readonly"],Ue=O(e.defineComponent({__name:"NumberInput",props:{modelValue:{},min:{},max:{},step:{default:1},precision:{},prefix:{},suffix:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1}},emits:["update:modelValue","blur","focus"],setup(t,{emit:c}){const a=t,l=c,s=L(),d=e.computed(()=>!!a.prefix||!!a.suffix),m=e.computed(()=>["w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm","placeholder:text-gray-400","focus:outline-none focus:ring-2 focus:ring-blue-500/20 fc-number-input","transition-colors duration-200",a.disabled?"opacity-50 cursor-not-allowed bg-gray-100":"",a.prefix?"rounded-l-none":"",a.suffix?"rounded-r-none":"",s.classes.value.input].filter(Boolean).join(" "));function o(n){const i=n.target.value;if(i===""){l("update:modelValue",null);return}let y=parseFloat(i);Number.isNaN(y)||(a.precision!==void 0&&(y=parseFloat(y.toFixed(a.precision))),l("update:modelValue",y))}return(n,r)=>d.value?(e.openBlock(),e.createElementBlock("div",Re,[t.prefix?(e.openBlock(),e.createElementBlock("span",Oe,e.toDisplayString(t.prefix),1)):e.createCommentVNode("",!0),e.createElementVNode("input",{type:"number",value:t.modelValue??"",min:t.min,max:t.max,step:t.step,disabled:t.disabled,readonly:t.readonly,class:e.normalizeClass(m.value),"aria-disabled":t.disabled||void 0,"aria-readonly":t.readonly||void 0,onInput:o,onBlur:r[0]||(r[0]=i=>l("blur",i)),onFocus:r[1]||(r[1]=i=>l("focus",i))},null,42,ve),t.suffix?(e.openBlock(),e.createElementBlock("span",Ke,e.toDisplayString(t.suffix),1)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("input",{key:1,type:"number",value:t.modelValue??"",min:t.min,max:t.max,step:t.step,disabled:t.disabled,readonly:t.readonly,class:e.normalizeClass(m.value),"aria-disabled":t.disabled||void 0,"aria-readonly":t.readonly||void 0,onInput:o,onBlur:r[2]||(r[2]=i=>l("blur",i)),onFocus:r[3]||(r[3]=i=>l("focus",i))},null,42,Pe))}}),[["__scopeId","data-v-4e51299b"]]),He={class:"relative"},Ge=["disabled"],qe={class:"text-lg leading-none"},Ze={class:"text-xs text-gray-500 dark:text-gray-400 font-medium"},_e=["value","placeholder","disabled"],Ye={key:1,class:"absolute left-0 top-full z-50 mt-1 w-72 rounded-lg border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-900 shadow-xl overflow-hidden"},We={class:"border-b border-gray-200 dark:border-gray-700 p-2"},Qe={class:"max-h-48 overflow-y-auto"},Je=["onMousedown"],Xe={class:"text-lg leading-none"},et={class:"flex-1 truncate text-xs"},tt={class:"text-[11px] text-gray-400 dark:text-gray-500 font-mono"},at={key:0,class:"px-3 py-4 text-center text-xs text-gray-400 dark:text-gray-500"},lt=e.defineComponent({__name:"PhoneInput",props:{modelValue:{},defaultCountry:{default:"US"},countries:{},showDialCode:{type:Boolean,default:!0},placeholder:{},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","blur"],setup(t,{emit:c}){const a=t,l=c,s={AF:"Afghanistan",AL:"Albania",DZ:"Algeria",AD:"Andorra",AO:"Angola",AR:"Argentina",AM:"Armenia",AU:"Australia",AT:"Austria",AZ:"Azerbaijan",BH:"Bahrain",BD:"Bangladesh",BY:"Belarus",BE:"Belgium",BZ:"Belize",BJ:"Benin",BT:"Bhutan",BO:"Bolivia",BA:"Bosnia",BW:"Botswana",BR:"Brazil",BN:"Brunei",BG:"Bulgaria",BF:"Burkina Faso",BI:"Burundi",KH:"Cambodia",CM:"Cameroon",CA:"Canada",CL:"Chile",CN:"China",CO:"Colombia",CR:"Costa Rica",HR:"Croatia",CU:"Cuba",CY:"Cyprus",CZ:"Czechia",DK:"Denmark",DO:"Dominican Rep.",EC:"Ecuador",EG:"Egypt",SV:"El Salvador",EE:"Estonia",ET:"Ethiopia",FI:"Finland",FR:"France",GE:"Georgia",DE:"Germany",GH:"Ghana",GR:"Greece",GT:"Guatemala",HN:"Honduras",HK:"Hong Kong",HU:"Hungary",IS:"Iceland",IN:"India",ID:"Indonesia",IR:"Iran",IQ:"Iraq",IE:"Ireland",IL:"Israel",IT:"Italy",JM:"Jamaica",JP:"Japan",JO:"Jordan",KZ:"Kazakhstan",KE:"Kenya",KR:"South Korea",KW:"Kuwait",LV:"Latvia",LB:"Lebanon",LY:"Libya",LT:"Lithuania",LU:"Luxembourg",MO:"Macau",MY:"Malaysia",MX:"Mexico",MA:"Morocco",MZ:"Mozambique",MM:"Myanmar",NP:"Nepal",NL:"Netherlands",NZ:"New Zealand",NI:"Nicaragua",NG:"Nigeria",NO:"Norway",OM:"Oman",PK:"Pakistan",PA:"Panama",PY:"Paraguay",PE:"Peru",PH:"Philippines",PL:"Poland",PT:"Portugal",QA:"Qatar",RO:"Romania",RU:"Russia",SA:"Saudi Arabia",RS:"Serbia",SG:"Singapore",SK:"Slovakia",SI:"Slovenia",ZA:"South Africa",ES:"Spain",LK:"Sri Lanka",SE:"Sweden",CH:"Switzerland",TW:"Taiwan",TZ:"Tanzania",TH:"Thailand",TR:"Turkey",UA:"Ukraine",AE:"UAE",GB:"United Kingdom",US:"United States",UY:"Uruguay",VE:"Venezuela",VN:"Vietnam",ZW:"Zimbabwe"};function d(B){return B.toUpperCase().split("").map(k=>String.fromCodePoint(127462+k.charCodeAt(0)-65)).join("")}const m=e.computed(()=>{var k;return((k=a.countries)!=null&&k.length?a.countries.filter($=>M.getCountries().includes($)):M.getCountries()).map($=>({code:$,name:s[$]??$,dialCode:`+${M.getCountryCallingCode($)}`,flag:d($)})).sort(($,C)=>$.name.localeCompare(C.name))}),o=e.ref(a.defaultCountry),n=e.ref(""),r=e.ref(!1),i=e.ref(""),y=e.ref(null),x=e.computed(()=>{const B=i.value.toLowerCase();return B?m.value.filter(k=>k.name.toLowerCase().includes(B)||k.code.toLowerCase().includes(B)||k.dialCode.includes(B)):m.value}),w=e.computed(()=>m.value.find(B=>B.code===o.value)??m.value[0]);e.onMounted(()=>{a.modelValue&&f(a.modelValue)}),e.watch(()=>a.modelValue,B=>{B&&f(B)});function f(B){try{const k=M.parsePhoneNumber(B);if(k!=null&&k.country){o.value=k.country,n.value=k.nationalNumber;return}}catch{}n.value=B.replace(/^\+\d+\s*/,"")}function p(){if(!n.value.trim()){l("update:modelValue","");return}const B=new M.AsYouType(o.value);B.input(`+${M.getCountryCallingCode(o.value)}${n.value}`);const k=B.getNumber();l("update:modelValue",(k==null?void 0:k.format("E.164"))??n.value)}function u(B){const k=B.target;n.value=k.value,p()}function b(B){o.value=B,r.value=!1,i.value="",p()}function V(){a.disabled||(r.value=!0,i.value="",e.nextTick(()=>{var B;return(B=y.value)==null?void 0:B.focus()}))}function h(){r.value=!1,i.value=""}return(B,k)=>{var $,C;return e.openBlock(),e.createElementBlock("div",He,[e.createElementVNode("div",{class:e.normalizeClass(["flex items-stretch rounded-lg border transition-colors",t.disabled?"opacity-50 cursor-not-allowed bg-gray-50 dark:bg-gray-800 border-gray-200 dark:border-gray-700":"border-gray-300 dark:border-gray-600 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20"])},[t.showDialCode?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",disabled:t.disabled,class:"flex items-center gap-1.5 px-3 border-r border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-800 rounded-l-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors shrink-0",onMousedown:k[0]||(k[0]=e.withModifiers(N=>r.value?h():V(),["prevent"]))},[e.createElementVNode("span",qe,e.toDisplayString(($=w.value)==null?void 0:$.flag),1),e.createElementVNode("span",Ze,e.toDisplayString((C=w.value)==null?void 0:C.dialCode),1),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["h-3 w-3 text-gray-400 transition-transform",r.value?"rotate-180":""]),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...k[3]||(k[3]=[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"},null,-1)])],2))],40,Ge)):e.createCommentVNode("",!0),e.createElementVNode("input",{type:"tel",value:n.value,placeholder:t.placeholder||"Phone number",disabled:t.disabled,autocomplete:"tel-national",class:e.normalizeClass(["flex-1 bg-transparent px-3 py-2 text-sm text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500 outline-none min-w-0",t.showDialCode?"rounded-r-lg":"rounded-lg"]),onInput:u,onBlur:k[1]||(k[1]=N=>l("blur",N))},null,42,_e)],2),r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 z-40",onMousedown:h},null,32)):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("div",Ye,[e.createElementVNode("div",We,[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:y,"onUpdate:modelValue":k[2]||(k[2]=N=>i.value=N),type:"text",placeholder:"Search country...",class:"w-full rounded-md border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-800 px-3 py-1.5 text-xs text-gray-900 dark:text-white placeholder-gray-400 outline-none focus:border-primary-500"},null,512),[[e.vModelText,i.value]])]),e.createElementVNode("div",Qe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,N=>(e.openBlock(),e.createElementBlock("button",{key:N.code,type:"button",class:e.normalizeClass(["flex w-full items-center gap-3 px-3 py-2 text-left text-sm transition-colors hover:bg-gray-50 dark:hover:bg-gray-800",N.code===o.value?"bg-primary-50 dark:bg-primary-950/30 text-primary-700 dark:text-primary-300":"text-gray-700 dark:text-gray-300"]),onMousedown:e.withModifiers(z=>b(N.code),["prevent"])},[e.createElementVNode("span",Xe,e.toDisplayString(N.flag),1),e.createElementVNode("span",et,e.toDisplayString(N.name),1),e.createElementVNode("span",tt,e.toDisplayString(N.dialCode),1)],42,Je))),128)),x.value.length===0?(e.openBlock(),e.createElementBlock("p",at," No countries found ")):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])}}}),ot=["checked","disabled","onChange"],nt=["aria-checked","aria-disabled","onClick","onKeydown"],rt={key:0,class:"h-2.5 w-2.5 rounded-full",style:{backgroundColor:"var(--fc-color-primary, #3b82f6)"}},st={class:"text-sm text-gray-700"},it=e.defineComponent({__name:"RadioInput",props:{modelValue:{type:[String,Number,Boolean,null]},options:{},inline:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","blur"],setup(t,{emit:c}){const a=t,l=c;L();function s(n){return a.modelValue===n}function d(n){return a.disabled||!!n.disabled}function m(n){d(n)||l("update:modelValue",n.value)}function o(n,r){(n.key===" "||n.key==="Enter")&&(n.preventDefault(),m(r))}return(n,r)=>(e.openBlock(),e.createElementBlock("div",{role:"radiogroup",class:e.normalizeClass(t.inline?"flex flex-wrap gap-4":"flex flex-col gap-2")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,i=>(e.openBlock(),e.createElementBlock("label",{key:String(i.value),class:e.normalizeClass(["inline-flex items-center gap-2 select-none",d(i)?"opacity-50 cursor-not-allowed":"cursor-pointer"])},[e.createElementVNode("input",{type:"radio",checked:s(i.value),disabled:d(i),class:"sr-only",onChange:y=>m(i),onBlur:r[0]||(r[0]=y=>l("blur",y))},null,40,ot),e.createElementVNode("div",{role:"radio","aria-checked":s(i.value),"aria-disabled":d(i)||void 0,tabindex:"0",class:e.normalizeClass(["flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 transition-colors duration-200",s(i.value)?"":"border-gray-300"]),style:e.normalizeStyle(s(i.value)?{borderColor:"var(--fc-color-primary, #3b82f6)"}:{}),onClick:y=>m(i),onKeydown:y=>o(y,i)},[s(i.value)?(e.openBlock(),e.createElementBlock("div",rt)):e.createCommentVNode("",!0)],46,nt),e.createElementVNode("span",st,e.toDisplayString(i.label),1)],2))),128))],2))}}),ct=["aria-expanded"],dt={class:"flex flex-1 flex-wrap items-center gap-1"},mt=["onClick"],ut={key:1,class:"truncate"},ft={key:2,class:"text-gray-400"},pt={key:0,class:"absolute z-50 mt-1 w-full rounded-md border border-gray-200 bg-white shadow-lg"},bt={key:0,class:"border-b border-gray-200 p-2"},yt={role:"listbox",class:"max-h-60 overflow-auto py-1"},gt=["aria-selected","onClick","onMouseenter"],ht={key:0,class:"px-3 py-2 text-sm text-gray-400"},kt=O(e.defineComponent({__name:"SelectInput",props:{modelValue:{type:[String,Number,Boolean,Array,null]},options:{},multiple:{type:Boolean,default:!1},searchable:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},placeholder:{default:"Select..."},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","blur"],setup(t,{emit:c}){const a=t,l=c,s=L(),d=e.ref(!1),m=e.ref(""),o=e.ref(-1),n=e.ref(null),r=e.ref(null),i=e.computed(()=>a.modelValue===null||a.modelValue===void 0?[]:Array.isArray(a.modelValue)?a.modelValue:[a.modelValue]),y=e.computed(()=>{if(i.value.length===0||a.multiple)return"";const C=a.options.find(N=>N.value===i.value[0]);return(C==null?void 0:C.label)??String(i.value[0])}),x=e.computed(()=>{if(!m.value)return a.options;const C=m.value.toLowerCase();return a.options.filter(N=>N.label.toLowerCase().includes(C))});function w(C){return i.value.includes(C)}function f(){a.disabled||(d.value?u():p())}function p(){d.value=!0,o.value=-1,m.value="",e.nextTick(()=>{var C;return(C=r.value)==null?void 0:C.focus()})}function u(){d.value=!1,m.value=""}function b(C){if(!C.disabled)if(a.multiple){const N=[...i.value],z=N.indexOf(C.value);z>=0?N.splice(z,1):N.push(C.value),l("update:modelValue",N)}else l("update:modelValue",C.value),u()}function V(C){if(a.disabled)return;const N=i.value.filter(z=>z!==C);l("update:modelValue",N.length?N:a.multiple?[]:null)}function h(C){C.stopPropagation(),l("update:modelValue",a.multiple?[]:null)}function B(C){if(!d.value){(C.key==="Enter"||C.key===" "||C.key==="ArrowDown")&&(C.preventDefault(),p());return}switch(C.key){case"ArrowDown":C.preventDefault(),o.value=Math.min(o.value+1,x.value.length-1);break;case"ArrowUp":C.preventDefault(),o.value=Math.max(o.value-1,0);break;case"Enter":C.preventDefault(),o.value>=0&&x.value[o.value]&&b(x.value[o.value]);break;case"Escape":C.preventDefault(),u();break}}function k(C){n.value&&!n.value.contains(C.target)&&u()}function $(C){const N=a.options.find(z=>z.value===C);return(N==null?void 0:N.label)??String(C)}return e.onMounted(()=>document.addEventListener("mousedown",k)),e.onBeforeUnmount(()=>document.removeEventListener("mousedown",k)),e.watch(d,C=>{C||l("blur",new FocusEvent("blur"))}),(C,N)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:n,class:e.normalizeClass(["relative w-full",e.unref(s).classes.value.input,t.disabled?"opacity-50 cursor-not-allowed":""])},[e.createElementVNode("div",{role:"combobox","aria-expanded":d.value,"aria-haspopup":"listbox",tabindex:"0",class:e.normalizeClass(["flex min-h-[38px] w-full cursor-pointer items-center rounded-md border border-gray-300 bg-white px-3 py-1.5 text-sm","transition-colors duration-200",d.value?"ring-2 ring-blue-500/20":"",t.disabled?"pointer-events-none bg-gray-100":""]),style:e.normalizeStyle(d.value?{borderColor:"var(--fc-color-primary, #3b82f6)"}:{}),onClick:f,onKeydown:B},[e.createElementVNode("div",dt,[t.multiple?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(i.value,z=>(e.openBlock(),e.createElementBlock("span",{key:String(z),class:"inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs",style:{backgroundColor:"color-mix(in srgb, var(--fc-color-primary, #3b82f6) 15%, white)",color:"var(--fc-color-primary, #3b82f6)"}},[e.createTextVNode(e.toDisplayString($(z))+" ",1),e.createElementVNode("button",{type:"button",class:"ml-0.5",style:{color:"var(--fc-color-primary, #3b82f6)"},"aria-label":"Remove",onClick:e.withModifiers(A=>V(z),["stop"])}," × ",8,mt)]))),128)):y.value?(e.openBlock(),e.createElementBlock("span",ut,e.toDisplayString(y.value),1)):(e.openBlock(),e.createElementBlock("span",ft,e.toDisplayString(t.placeholder),1))]),t.clearable&&i.value.length>0&&!t.disabled?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"ml-1 shrink-0 text-gray-400 hover:text-gray-600 transition-colors duration-200","aria-label":"Clear selection",onClick:h}," × ")):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["ml-1 h-4 w-4 shrink-0 text-gray-400 transition-transform duration-200",d.value?"rotate-180":""]),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[...N[1]||(N[1]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z","clip-rule":"evenodd"},null,-1)])],2))],46,ct),d.value?(e.openBlock(),e.createElementBlock("div",pt,[t.searchable?(e.openBlock(),e.createElementBlock("div",bt,[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:r,"onUpdate:modelValue":N[0]||(N[0]=z=>m.value=z),type:"text",class:"w-full rounded border border-gray-300 px-2 py-1 text-sm focus:outline-none fc-select-search",placeholder:"Search...",onKeydown:B},null,544),[[e.vModelText,m.value]])])):e.createCommentVNode("",!0),e.createElementVNode("ul",yt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(z,A)=>(e.openBlock(),e.createElementBlock("li",{key:String(z.value),role:"option","aria-selected":w(z.value),class:e.normalizeClass(["cursor-pointer px-3 py-2 text-sm transition-colors duration-200",w(z.value)?"":"text-gray-900",o.value===A?"bg-gray-100":"",z.disabled?"opacity-50 cursor-not-allowed":"hover:bg-gray-50"]),style:e.normalizeStyle(w(z.value)?{backgroundColor:"color-mix(in srgb, var(--fc-color-primary, #3b82f6) 8%, white)",color:"var(--fc-color-primary, #3b82f6)"}:{}),onClick:K=>b(z),onMouseenter:K=>o.value=A},e.toDisplayString(z.label),47,gt))),128)),x.value.length===0?(e.openBlock(),e.createElementBlock("li",ht," No options found ")):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-b34f2a7d"]]),xt=["value","min","max","step","disabled","aria-valuenow","aria-valuemin","aria-valuemax","aria-disabled"],Bt={class:"mt-1 flex justify-between text-xs text-gray-400"},wt=e.defineComponent({__name:"SliderInput",props:{modelValue:{},min:{default:0},max:{default:100},step:{default:1},showTooltip:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","blur"],setup(t,{emit:c}){const a=t,l=c;L();const s=e.ref(!1),d=e.computed(()=>{const o=a.max-a.min;return o===0?0:(a.modelValue-a.min)/o*100});function m(o){const n=o.target;l("update:modelValue",parseFloat(n.value))}return(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative w-full py-2",t.disabled?"opacity-50 cursor-not-allowed":""])},[t.showTooltip&&s.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"absolute -top-8 rounded bg-gray-800 px-2 py-1 text-xs text-white shadow-sm transition-opacity duration-200",style:e.normalizeStyle({left:`calc(${d.value}% - 16px)`})},e.toDisplayString(t.modelValue),5)):e.createCommentVNode("",!0),e.createElementVNode("input",{type:"range",value:t.modelValue,min:t.min,max:t.max,step:t.step,disabled:t.disabled,"aria-valuenow":t.modelValue,"aria-valuemin":t.min,"aria-valuemax":t.max,"aria-disabled":t.disabled||void 0,class:"h-2 w-full cursor-pointer appearance-none rounded-full bg-gray-200 focus:outline-none focus:ring-2 focus:ring-blue-500/20 disabled:pointer-events-none",style:{accentColor:"var(--fc-color-primary, #3b82f6)"},onInput:m,onMousedown:n[0]||(n[0]=r=>s.value=!0),onMouseup:n[1]||(n[1]=r=>s.value=!1),onTouchstart:n[2]||(n[2]=r=>s.value=!0),onTouchend:n[3]||(n[3]=r=>s.value=!1),onFocus:n[4]||(n[4]=r=>s.value=!0),onBlur:n[5]||(n[5]=r=>{s.value=!1,l("blur",r)})},null,40,xt),e.createElementVNode("div",Bt,[e.createElementVNode("span",null,e.toDisplayString(t.min),1),e.createElementVNode("span",null,e.toDisplayString(t.max),1)])],2))}}),Ct={key:0,class:"text-sm text-gray-600"},Vt=["checked","disabled"],Et=["aria-checked","aria-disabled"],Nt={key:1,class:"text-sm text-gray-600"},$t=e.defineComponent({__name:"SwitchInput",props:{modelValue:{type:Boolean},activeLabel:{},inactiveLabel:{},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","blur"],setup(t,{emit:c}){const a=t,l=c;L();const s=e.computed(()=>["inline-flex items-center gap-2 select-none",a.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"]);function d(){a.disabled||l("update:modelValue",!a.modelValue)}function m(o){(o.key===" "||o.key==="Enter")&&(o.preventDefault(),d())}return(o,n)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(s.value)},[t.inactiveLabel?(e.openBlock(),e.createElementBlock("span",Ct,e.toDisplayString(t.inactiveLabel),1)):e.createCommentVNode("",!0),e.createElementVNode("input",{type:"checkbox",checked:t.modelValue,disabled:t.disabled,class:"sr-only",onChange:d,onBlur:n[0]||(n[0]=r=>l("blur",r))},null,40,Vt),e.createElementVNode("button",{type:"button",role:"switch","aria-checked":t.modelValue,"aria-disabled":t.disabled||void 0,tabindex:"0",class:e.normalizeClass(["relative inline-flex h-6 w-11 shrink-0 rounded-full border-2 border-transparent transition-colors duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)]",t.modelValue?"":"bg-gray-300",t.disabled?"pointer-events-none":"focus:outline-none focus:ring-2 focus:ring-blue-500/20"]),style:e.normalizeStyle(t.modelValue?{backgroundColor:"var(--fc-color-primary, #3b82f6)"}:{}),onClick:d,onKeydown:m},[e.createElementVNode("span",{class:e.normalizeClass(["pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow-sm transition-transform duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)]",t.modelValue?"translate-x-5":"translate-x-0"]),"aria-hidden":"true"},null,2)],46,Et),t.activeLabel?(e.openBlock(),e.createElementBlock("span",Nt,e.toDisplayString(t.activeLabel),1)):e.createCommentVNode("",!0)],2))}}),St=["onClick"],Ft=["placeholder","disabled"],Dt={key:0,class:"absolute z-50 mt-1 w-full rounded-md border border-gray-200 bg-white py-1 shadow-lg",role:"listbox"},zt=["aria-selected","onMousedown","onMouseenter"],Tt=e.defineComponent({__name:"TagsInput",props:{modelValue:{default:()=>[]},maxTags:{},suggestions:{default:()=>[]},placeholder:{default:"Add a tag..."},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","blur"],setup(t,{emit:c}){const a=t,l=e.computed(()=>Array.isArray(a.modelValue)?a.modelValue:[]),s=c,d=L(),m=e.ref(""),o=e.ref(!1),n=e.ref(!1),r=e.ref(-1),i=e.ref(null),y=e.ref(null),x=e.computed(()=>!a.maxTags||l.value.length<a.maxTags),w=e.computed(()=>{if(!m.value||a.suggestions.length===0)return[];const h=m.value.toLowerCase();return a.suggestions.filter(B=>B.toLowerCase().includes(h)&&!l.value.includes(B))});function f(h){const B=h.trim();!B||!x.value||l.value.includes(B)||(s("update:modelValue",[...l.value,B]),m.value="",n.value=!1,r.value=-1)}function p(h){if(a.disabled)return;const B=l.value.filter((k,$)=>$!==h);s("update:modelValue",B)}function u(h){if(h.key==="Enter"||h.key===","){h.preventDefault(),r.value>=0&&w.value[r.value]?f(w.value[r.value]):f(m.value);return}if(h.key==="Backspace"&&m.value===""&&l.value.length>0){p(l.value.length-1);return}if(h.key==="ArrowDown"&&n.value){h.preventDefault(),r.value=Math.min(r.value+1,w.value.length-1);return}if(h.key==="ArrowUp"&&n.value){h.preventDefault(),r.value=Math.max(r.value-1,0);return}h.key==="Escape"&&(n.value=!1,r.value=-1)}function b(){n.value=m.value.length>0&&w.value.length>0,r.value=-1}function V(h){i.value&&!i.value.contains(h.target)&&(n.value=!1)}return e.onMounted(()=>document.addEventListener("mousedown",V)),e.onBeforeUnmount(()=>document.removeEventListener("mousedown",V)),e.watch(m,()=>{e.nextTick(b)}),(h,B)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:i,class:e.normalizeClass(["relative w-full",t.disabled?"opacity-50 cursor-not-allowed":""])},[e.createElementVNode("div",{class:e.normalizeClass(["flex flex-wrap items-center gap-1.5 rounded-md border bg-white px-2 py-1.5 text-sm transition-colors duration-200",o.value?"ring-2 ring-blue-500/20":"border-gray-300",e.unref(d).classes.value.input]),style:e.normalizeStyle(o.value?{borderColor:"var(--fc-color-primary, #3b82f6)"}:{}),onClick:B[3]||(B[3]=k=>{var $;return($=y.value)==null?void 0:$.focus()})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(k,$)=>(e.openBlock(),e.createElementBlock("span",{key:k,class:"inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs",style:{backgroundColor:"color-mix(in srgb, var(--fc-color-primary, #3b82f6) 15%, white)",color:"var(--fc-color-primary, #3b82f6)"}},[e.createTextVNode(e.toDisplayString(k)+" ",1),t.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"ml-0.5 transition-colors duration-200",style:{color:"var(--fc-color-primary, #3b82f6)"},"aria-label":"Remove tag",onClick:e.withModifiers(C=>p($),["stop"])}," × ",8,St))]))),128)),e.withDirectives(e.createElementVNode("input",{ref_key:"inputRef",ref:y,"onUpdate:modelValue":B[0]||(B[0]=k=>m.value=k),type:"text",placeholder:l.value.length===0?t.placeholder:"",disabled:t.disabled,class:"min-w-[80px] flex-1 border-0 bg-transparent p-0 text-sm outline-none placeholder:text-gray-400",onKeydown:u,onFocus:B[1]||(B[1]=k=>o.value=!0),onBlur:B[2]||(B[2]=k=>{o.value=!1,s("blur",k)})},null,40,Ft),[[e.vModelText,m.value]])],6),n.value&&w.value.length>0?(e.openBlock(),e.createElementBlock("ul",Dt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(k,$)=>(e.openBlock(),e.createElementBlock("li",{key:k,role:"option","aria-selected":r.value===$,class:e.normalizeClass(["cursor-pointer px-3 py-2 text-sm transition-colors duration-200",r.value!==$?"text-gray-900 hover:bg-gray-50":""]),style:e.normalizeStyle(r.value===$?{backgroundColor:"color-mix(in srgb, var(--fc-color-primary, #3b82f6) 8%, white)",color:"var(--fc-color-primary, #3b82f6)"}:{}),onMousedown:e.withModifiers(C=>f(k),["prevent"]),onMouseenter:C=>r.value=$},e.toDisplayString(k),47,zt))),128))])):e.createCommentVNode("",!0)],2))}}),Lt=["value","rows","maxlength","placeholder","disabled","readonly","aria-disabled","aria-readonly"],Mt=O(e.defineComponent({__name:"TextareaInput",props:{modelValue:{},rows:{default:3},autoResize:{type:Boolean,default:!1},maxLength:{},placeholder:{default:""},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1}},emits:["update:modelValue","blur","focus"],setup(t,{emit:c}){const a=t,l=c,s=L(),d=e.ref(null),m=e.computed(()=>["w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm","placeholder:text-gray-400 resize-y","focus:outline-none focus:ring-2 focus:ring-blue-500/20 fc-textarea-input","transition-colors duration-200",a.disabled?"opacity-50 cursor-not-allowed bg-gray-100":"",a.autoResize?"resize-none overflow-hidden":"",s.classes.value.input].filter(Boolean).join(" "));function o(){if(!a.autoResize||!d.value)return;const r=d.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`}function n(r){const i=r.target;l("update:modelValue",i.value),a.autoResize&&e.nextTick(o)}return e.watch(()=>a.modelValue,()=>{a.autoResize&&e.nextTick(o)}),e.onMounted(()=>{a.autoResize&&o()}),(r,i)=>(e.openBlock(),e.createElementBlock("textarea",{ref_key:"textareaRef",ref:d,value:t.modelValue,rows:t.rows,maxlength:t.maxLength,placeholder:t.placeholder,disabled:t.disabled,readonly:t.readonly,class:e.normalizeClass(m.value),"aria-disabled":t.disabled||void 0,"aria-readonly":t.readonly||void 0,onInput:n,onBlur:i[0]||(i[0]=y=>l("blur",y)),onFocus:i[1]||(i[1]=y=>l("focus",y))},null,42,Lt))}}),[["__scopeId","data-v-67f80d90"]]),It={key:0,class:"flex items-stretch"},At={key:0,class:"inline-flex items-center rounded-l-md border border-r-0 border-gray-300 bg-gray-50 px-3 text-sm text-gray-500"},jt=["type","value","placeholder","maxlength","disabled","readonly","aria-disabled","aria-readonly"],Rt={key:1,class:"inline-flex items-center rounded-r-md border border-l-0 border-gray-300 bg-gray-50 px-3 text-sm text-gray-500"},Ot=["type","value","placeholder","maxlength","disabled","readonly","aria-disabled","aria-readonly"],vt=O(e.defineComponent({__name:"TextInput",props:{modelValue:{},inputType:{default:"text"},placeholder:{default:""},maxLength:{},prefix:{},suffix:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},mask:{}},emits:["update:modelValue","blur","focus"],setup(t,{emit:c}){const a=t,l=c,s=L(),d=e.computed(()=>!!a.prefix||!!a.suffix),m=e.computed(()=>["w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm","placeholder:text-gray-400","focus:outline-none focus:ring-2 focus:ring-blue-500/20 fc-text-input","transition-colors duration-200",a.disabled?"opacity-50 cursor-not-allowed bg-gray-100":"",a.prefix?"rounded-l-none":"",a.suffix?"rounded-r-none":"",s.classes.value.input].filter(Boolean).join(" "));function o(n){const r=n.target;l("update:modelValue",r.value)}return(n,r)=>d.value?(e.openBlock(),e.createElementBlock("div",It,[t.prefix?(e.openBlock(),e.createElementBlock("span",At,e.toDisplayString(t.prefix),1)):e.createCommentVNode("",!0),e.createElementVNode("input",{type:t.inputType,value:t.modelValue,placeholder:t.placeholder,maxlength:t.maxLength,disabled:t.disabled,readonly:t.readonly,class:e.normalizeClass(m.value),"aria-disabled":t.disabled||void 0,"aria-readonly":t.readonly||void 0,onInput:o,onBlur:r[0]||(r[0]=i=>l("blur",i)),onFocus:r[1]||(r[1]=i=>l("focus",i))},null,42,jt),t.suffix?(e.openBlock(),e.createElementBlock("span",Rt,e.toDisplayString(t.suffix),1)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("input",{key:1,type:t.inputType,value:t.modelValue,placeholder:t.placeholder,maxlength:t.maxLength,disabled:t.disabled,readonly:t.readonly,class:e.normalizeClass(m.value),"aria-disabled":t.disabled||void 0,"aria-readonly":t.readonly||void 0,onInput:o,onBlur:r[2]||(r[2]=i=>l("blur",i)),onFocus:r[3]||(r[3]=i=>l("focus",i))},null,42,Ot))}}),[["__scopeId","data-v-a42b4343"]]),Kt={key:0,class:"mb-1.5 flex items-center gap-1"},Pt=["for"],Ut={key:0,class:"text-red-500 ml-0.5","aria-hidden":"true"},Ht=["aria-label"],Gt={key:0,role:"tooltip",class:"absolute bottom-full left-1/2 z-10 mb-2 -translate-x-1/2 rounded-md bg-gray-900 px-3 py-1.5 text-xs text-white shadow-lg whitespace-nowrap"},qt=["id"],Zt=["id"],_t=e.defineComponent({__name:"BaseField",props:{fieldSchema:{},fieldName:{},errors:{default:()=>[]},touched:{type:Boolean,default:!1}},setup(t){const c=t,a=e.inject(P),l=e.inject(q),s=e.ref(!1),d=e.computed(()=>{if(a){const x=a.t(c.fieldName,"label");if(x)return x}return c.fieldSchema.label??c.fieldName}),m=e.computed(()=>{if(a){const x=a.t(c.fieldName,"helpText");if(x)return x}return c.fieldSchema.helpText??""}),o=e.computed(()=>{if(a){const x=a.t(c.fieldName,"tooltip");if(x)return x}return c.fieldSchema.tooltip??""}),n=e.computed(()=>c.touched&&c.errors.length>0),r=e.computed(()=>[(l==null?void 0:l.classes.value.field)??"fc-field",c.fieldSchema.className??"",c.fieldSchema.disabled?"opacity-50 cursor-not-allowed":"",c.fieldSchema.readOnly?"fc-readonly":""]),i=e.computed(()=>`fc-field-${c.fieldName}`),y=e.computed(()=>`fc-error-${c.fieldName}`);return(x,w)=>{var f,p;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([r.value,"relative mb-4"]),style:e.normalizeStyle(t.fieldSchema.style)},[t.fieldSchema.type!=="hidden"?(e.openBlock(),e.createElementBlock("div",Kt,[e.createElementVNode("label",{for:i.value,class:e.normalizeClass([((f=e.unref(l))==null?void 0:f.classes.value.label)??"fc-label","block text-sm font-medium text-gray-700"])},[e.createTextVNode(e.toDisplayString(d.value)+" ",1),t.fieldSchema.required?(e.openBlock(),e.createElementBlock("span",Ut,"*")):e.createCommentVNode("",!0)],10,Pt),o.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:"relative inline-flex",onMouseenter:w[0]||(w[0]=u=>s.value=!0),onMouseleave:w[1]||(w[1]=u=>s.value=!1),onFocusin:w[2]||(w[2]=u=>s.value=!0),onFocusout:w[3]||(w[3]=u=>s.value=!1)},[e.createElementVNode("button",{type:"button",class:"inline-flex h-4 w-4 items-center justify-center rounded-full bg-gray-200 text-gray-500 text-xs hover:bg-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500/40","aria-label":`Info: ${o.value}`,tabindex:"0"}," i ",8,Ht),e.createVNode(e.Transition,{"enter-active-class":"motion-safe:transition motion-safe:duration-200 motion-safe:ease-out","enter-from-class":"opacity-0 scale-95","enter-to-class":"opacity-100 scale-100","leave-active-class":"motion-safe:transition motion-safe:duration-150 motion-safe:ease-in","leave-from-class":"opacity-100 scale-100","leave-to-class":"opacity-0 scale-95"},{default:e.withCtx(()=>[s.value?(e.openBlock(),e.createElementBlock("div",Gt,[e.createTextVNode(e.toDisplayString(o.value)+" ",1),w[4]||(w[4]=e.createElementVNode("div",{class:"absolute left-1/2 top-full -translate-x-1/2 border-4 border-transparent border-t-gray-900"},null,-1))])):e.createCommentVNode("",!0)]),_:1})],32)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{id:i.value},[e.renderSlot(x.$slots,"default")],8,qt),e.createVNode(e.TransitionGroup,{tag:"div","enter-active-class":"motion-safe:transition-all motion-safe:duration-200 motion-safe:ease-out","enter-from-class":"opacity-0 -translate-y-1 max-h-0","enter-to-class":"opacity-100 translate-y-0 max-h-8","leave-active-class":"motion-safe:transition-all motion-safe:duration-150 motion-safe:ease-in","leave-from-class":"opacity-100 translate-y-0 max-h-8","leave-to-class":"opacity-0 -translate-y-1 max-h-0",class:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value?t.errors:[],(u,b)=>{var V;return e.openBlock(),e.createElementBlock("p",{key:u+b,id:b===0?y.value:void 0,class:e.normalizeClass([((V=e.unref(l))==null?void 0:V.classes.value.error)??"fc-error","mt-1 text-xs text-red-500"]),role:"alert"},e.toDisplayString(u),11,Zt)}),128))]),_:1}),m.value&&!n.value?(e.openBlock(),e.createElementBlock("p",{key:1,class:e.normalizeClass([((p=e.unref(l))==null?void 0:p.classes.value.helpText)??"fc-help-text","mt-1 text-xs text-gray-400"])},e.toDisplayString(m.value),3)):e.createCommentVNode("",!0)],6)}}}),Yt={key:1,class:"rounded-md border border-dashed border-amber-400 bg-amber-50 px-3 py-2 text-xs text-amber-700"},te=e.defineComponent({__name:"FormField",props:{name:{}},setup(t){const c=t,a=e.inject(R);if(!a)throw new Error("FormField must be used inside a FormBuilder (FormContextKey not provided)");const l=e.inject(U,null),s=e.computed(()=>S.extractFields(a.schema.fields).find(f=>f.name===c.name)),d=e.computed(()=>{var u;const f=s.value;if(!f)return;const p=(u=l==null?void 0:l.value)==null?void 0:u[f.type];return p||Y(f.type)}),m=e.computed(()=>a.values[c.name]),o=e.computed(()=>a.errors[c.name]??[]),n=e.computed(()=>a.touched[c.name]??!1),r=e.computed(()=>{const f=s.value;return f?f.condition?S.evaluateCondition(f.condition,a.values):typeof f.visible=="function"?f.visible({values:{...a.values},getFieldValue:p=>a.values[p]}):f.visible??!0:!1}),i=e.computed(()=>{const f=s.value;return f?typeof f.disabled=="function"?f.disabled({values:{...a.values},getFieldValue:p=>a.values[p]}):f.disabled??!1:!1}),y=e.computed(()=>{const f=s.value;if(!f)return{};const{name:p,label:u,helpText:b,tooltip:V,condition:h,translations:B,meta:k,rules:$,visible:C,className:N,style:z,defaultValue:A,...K}=f;return{...K,modelValue:m.value,disabled:i.value,readonly:f.readOnly??!1,placeholder:f.placeholder??""}});function x(f){a.setFieldValue(c.name,f)}function w(){var f;a.touched[c.name]=!0,((f=a.schema.settings)==null?void 0:f.validateOnBlur)!==!1&&a.validateField(c.name)}return(f,p)=>(e.openBlock(),e.createBlock(e.Transition,{"enter-active-class":"motion-safe:transition-all motion-safe:duration-300 motion-safe:ease-out","enter-from-class":"opacity-0 max-h-0","enter-to-class":"opacity-100 max-h-96","leave-active-class":"motion-safe:transition-all motion-safe:duration-200 motion-safe:ease-in","leave-from-class":"opacity-100 max-h-96","leave-to-class":"opacity-0 max-h-0"},{default:e.withCtx(()=>[r.value&&s.value?(e.openBlock(),e.createBlock(_t,{key:0,"field-schema":s.value,"field-name":t.name,errors:o.value,touched:n.value},{default:e.withCtx(()=>[d.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d.value),e.mergeProps({key:0},y.value,{"aria-invalid":n.value&&o.value.length>0?!0:void 0,"aria-describedby":n.value&&o.value.length>0?`fc-error-${t.name}`:void 0,"onUpdate:modelValue":x,onBlur:w}),null,16,["aria-invalid","aria-describedby"])):(e.openBlock(),e.createElementBlock("div",Yt,' No component registered for field type "'+e.toDisplayString(s.value.type)+'" ',1))]),_:1},8,["field-schema","field-name","errors","touched"])):e.createCommentVNode("",!0)]),_:1}))}}),Wt={key:0,class:"relative flex justify-center"},Qt={class:"bg-white px-3 text-xs text-gray-500"},Jt=e.defineComponent({__name:"FormDivider",props:{label:{},className:{}},setup(t){return(c,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([t.className??"","relative my-4"]),role:"separator"},[a[0]||(a[0]=e.createElementVNode("div",{class:"absolute inset-0 flex items-center","aria-hidden":"true"},[e.createElementVNode("div",{class:"w-full border-t border-gray-200"})],-1)),t.label?(e.openBlock(),e.createElementBlock("div",Wt,[e.createElementVNode("span",Qt,e.toDisplayString(t.label),1)])):e.createCommentVNode("",!0)],2))}}),Xt=["aria-labelledby"],ea={key:0,class:"border-b border-gray-100 px-4 py-3"},ta=["id"],aa={key:1,class:"mt-0.5 text-xs text-gray-500"},la=["id"],oa=e.defineComponent({__name:"FormGroup",props:{title:{},description:{},collapsible:{type:Boolean,default:!1},collapsed:{type:Boolean,default:!1},children:{},className:{}},setup(t){const c=t,a=e.ref(c.collapsed);function l(){c.collapsible&&(a.value=!a.value)}const s=e.computed(()=>c.title?`fc-group-${c.title.toLowerCase().replace(/\s+/g,"-")}`:void 0);return(d,m)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass([[t.className??""],"rounded-lg border border-gray-200 bg-white"]),"aria-labelledby":s.value},[t.title||t.description?(e.openBlock(),e.createElementBlock("div",ea,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.collapsible?"button":"div"),{type:t.collapsible?"button":void 0,class:e.normalizeClass(["flex w-full items-center justify-between text-left",t.collapsible?"cursor-pointer focus:outline-none focus:ring-2 focus:ring-blue-500/40 rounded":""]),"aria-expanded":t.collapsible?!a.value:void 0,"aria-controls":t.collapsible?`fc-group-body-${s.value}`:void 0,onClick:l},{default:e.withCtx(()=>[e.createElementVNode("div",null,[t.title?(e.openBlock(),e.createElementBlock("legend",{key:0,id:s.value,class:"text-sm font-semibold text-gray-800"},e.toDisplayString(t.title),9,ta)):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createElementBlock("p",aa,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),t.collapsible?(e.openBlock(),e.createElementBlock("svg",{key:0,class:e.normalizeClass(["h-4 w-4 shrink-0 text-gray-400 motion-safe:transition-transform motion-safe:duration-200",a.value?"":"rotate-180"]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[...m[0]||(m[0]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z","clip-rule":"evenodd"},null,-1)])],2)):e.createCommentVNode("",!0)]),_:1},8,["type","class","aria-expanded","aria-controls"]))])):e.createCommentVNode("",!0),e.createVNode(e.Transition,{"enter-active-class":"motion-safe:transition-all motion-safe:duration-300 motion-safe:ease-out","enter-from-class":"max-h-0 opacity-0 overflow-hidden","enter-to-class":"max-h-[2000px] opacity-100 overflow-hidden","leave-active-class":"motion-safe:transition-all motion-safe:duration-200 motion-safe:ease-in","leave-from-class":"max-h-[2000px] opacity-100 overflow-hidden","leave-to-class":"max-h-0 opacity-0 overflow-hidden"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{id:t.collapsible?`fc-group-body-${s.value}`:void 0,class:"p-4"},[e.createVNode(v,{nodes:t.children},null,8,["nodes"])],8,la),[[e.vShow,!a.value]])]),_:1})],10,Xt))}}),na=["innerHTML"],ra=e.defineComponent({__name:"FormHtml",props:{content:{},className:{}},setup(t){const c=t,a=e.computed(()=>S.sanitizeHtml(c.content));return(l,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([t.className??"","fc-html prose prose-sm max-w-none text-gray-700"]),innerHTML:a.value},null,10,na))}}),sa=e.defineComponent({__name:"FormRow",props:{children:{},gap:{},align:{default:"stretch"},className:{}},setup(t){const c=t,a=e.computed(()=>({start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"})[c.align]??"items-stretch"),l=e.computed(()=>c.gap?typeof c.gap=="number"?`${c.gap}px`:c.gap:"");return(s,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["grid grid-cols-12",[a.value,t.className??""]]),style:e.normalizeStyle(l.value?{gap:l.value}:{gap:"1rem"}),role:"group"},[e.createVNode(v,{nodes:t.children},null,8,["nodes"])],6))}}),ia={"aria-label":"Form steps",class:"flex items-center justify-center"},ca={class:"flex items-center gap-0"},da=["disabled","aria-current","aria-label","onClick"],ma={key:0,class:"h-4 w-4 motion-safe:transition-transform motion-safe:duration-200",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},ua={key:1},fa={key:0,class:"text-center"},pa={class:"text-base font-semibold text-gray-800"},ba={key:0,class:"mt-1 text-sm text-gray-500"},ya={class:"flex items-center justify-between border-t border-gray-100 pt-4"},ga=["disabled"],ha={class:"text-xs text-gray-400"},ka={key:1,class:"w-[72px]"},xa=e.defineComponent({__name:"FormSteps",props:{steps:{},linear:{type:Boolean,default:!1},className:{}},setup(t){const c=t,a=e.inject(R),l=e.ref(0),s=e.ref(new Set),d=e.computed(()=>c.steps),m=e.computed(()=>d.value.length),o=e.computed(()=>l.value===0),n=e.computed(()=>l.value===m.value-1);function r(f){const p=[];function u(b){for(const V of b)if(S.isFieldNode(V))p.push(V.name);else if(V.type==="row"||V.type==="group")u(V.children);else if(V.type==="steps")for(const h of V.steps)u(h.children);else if(V.type==="tabs")for(const h of V.tabs)u(h.children)}return u(f.children),p}async function i(){if(!a||!c.linear)return!0;const f=d.value[l.value];if(!f)return!0;const p=r(f);let u=!0;for(const b of p){const V=await a.validateField(b);a.touched[b]=!0,V.length>0&&(u=!1)}return u}async function y(){n.value||c.linear&&!await i()||(s.value.add(l.value),l.value++)}function x(){o.value||l.value--}function w(f){c.linear&&f>l.value||(l.value=f)}return(f,p)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([t.className??"","space-y-6"])},[e.createElementVNode("nav",ia,[e.createElementVNode("ol",ca,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(u,b)=>(e.openBlock(),e.createElementBlock("li",{key:b,class:"flex items-center"},[e.createElementVNode("button",{type:"button",disabled:t.linear&&b>l.value,"aria-current":b===l.value?"step":void 0,"aria-label":`Step ${b+1}: ${u.title}`,class:e.normalizeClass(["relative flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 text-xs font-semibold motion-safe:transition-all motion-safe:duration-300 focus:outline-none focus:ring-2 focus:ring-blue-500/40",[s.value.has(b)&&b!==l.value?"border-green-500 bg-green-500 text-white":b!==l.value?"border-gray-300 bg-white text-gray-500":"text-white",t.linear&&b>l.value?"cursor-not-allowed":"cursor-pointer hover:shadow-md"]]),style:e.normalizeStyle(b===l.value?{borderColor:"var(--fc-color-primary, #3b82f6)",backgroundColor:"var(--fc-color-primary, #3b82f6)"}:{}),onClick:V=>w(b)},[s.value.has(b)&&b!==l.value?(e.openBlock(),e.createElementBlock("svg",ma,[...p[0]||(p[0]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z","clip-rule":"evenodd"},null,-1)])])):(e.openBlock(),e.createElementBlock("span",ua,e.toDisplayString(b+1),1))],14,da),b<d.value.length-1?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["mx-1 h-0.5 w-8 motion-safe:transition-colors motion-safe:duration-300 sm:w-12",s.value.has(b)?"bg-green-500":"bg-gray-200"])},null,2)):e.createCommentVNode("",!0)]))),128))])]),d.value[l.value]?(e.openBlock(),e.createElementBlock("div",fa,[e.createElementVNode("h3",pa,e.toDisplayString(d.value[l.value].title),1),d.value[l.value].description?(e.openBlock(),e.createElementBlock("p",ba,e.toDisplayString(d.value[l.value].description),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createVNode(e.Transition,{mode:"out-in","enter-active-class":"motion-safe:transition-all motion-safe:duration-200 motion-safe:ease-out","enter-from-class":"opacity-0 translate-x-2","enter-to-class":"opacity-100 translate-x-0","leave-active-class":"motion-safe:transition-all motion-safe:duration-150 motion-safe:ease-in","leave-from-class":"opacity-100 translate-x-0","leave-to-class":"opacity-0 -translate-x-2"},{default:e.withCtx(()=>[d.value[l.value]?(e.openBlock(),e.createElementBlock("div",{key:l.value},[e.createVNode(v,{nodes:d.value[l.value].children},null,8,["nodes"])])):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",ya,[e.createElementVNode("button",{type:"button",disabled:o.value,class:"rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 motion-safe:transition-colors motion-safe:duration-150 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500/40 disabled:cursor-not-allowed disabled:opacity-50 fc-steps-prev-btn",onClick:x}," Previous ",8,ga),e.createElementVNode("span",ha,e.toDisplayString(l.value+1)+" / "+e.toDisplayString(m.value),1),n.value?(e.openBlock(),e.createElementBlock("div",ka)):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"rounded-md px-4 py-2 text-sm font-medium text-white motion-safe:transition-colors motion-safe:duration-150 focus:outline-none focus:ring-2 focus:ring-blue-500/40 fc-steps-next-btn",style:{backgroundColor:"var(--fc-color-primary, #3b82f6)"},onClick:y}," Next "))])],2))}}),Ba={class:"relative flex border-b border-gray-200",role:"tablist","aria-orientation":"horizontal"},wa=["id","aria-selected","aria-controls","aria-disabled","tabindex","onClick","onKeydown"],Ca={key:0,class:"absolute inset-x-0 -bottom-px h-0.5 motion-safe:transition-all motion-safe:duration-200",style:{backgroundColor:"var(--fc-color-primary, #3b82f6)"}},Va=["id","aria-labelledby"],Ea=e.defineComponent({__name:"FormTabs",props:{tabs:{},className:{}},setup(t){const c=t,a=e.ref(0),l=e.computed(()=>c.tabs);function s(o){const n=l.value[o];n!=null&&n.disabled||(a.value=o)}function d(o,n){var x;const r=l.value.length;let i=n;if(o.key==="ArrowRight"||o.key==="ArrowDown")o.preventDefault(),i=(n+1)%r;else if(o.key==="ArrowLeft"||o.key==="ArrowUp")o.preventDefault(),i=(n-1+r)%r;else if(o.key==="Home")o.preventDefault(),i=0;else if(o.key==="End")o.preventDefault(),i=r-1;else return;for(;(x=l.value[i])!=null&&x.disabled&&i!==n;)o.key==="ArrowLeft"||o.key==="ArrowUp"?i=(i-1+r)%r:i=(i+1)%r;s(i);const y=document.getElementById(`fc-tab-${i}`);y==null||y.focus()}const m=e.computed(()=>`fc-tabpanel-${a.value}`);return(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(t.className??"")},[e.createElementVNode("div",Ba,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(r,i)=>(e.openBlock(),e.createElementBlock("button",{key:i,id:`fc-tab-${i}`,type:"button",role:"tab","aria-selected":i===a.value,"aria-controls":m.value,"aria-disabled":r.disabled||void 0,tabindex:i===a.value?0:-1,class:e.normalizeClass(["relative px-4 py-2.5 text-sm font-medium motion-safe:transition-colors motion-safe:duration-150 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue-500/40",[i!==a.value?r.disabled?"cursor-not-allowed text-gray-300":"text-gray-500 hover:text-gray-700":""]]),style:e.normalizeStyle(i===a.value?{color:"var(--fc-color-primary, #3b82f6)"}:{}),onClick:y=>s(i),onKeydown:y=>d(y,i)},[e.createTextVNode(e.toDisplayString(r.title)+" ",1),i===a.value?(e.openBlock(),e.createElementBlock("span",Ca)):e.createCommentVNode("",!0)],46,wa))),128))]),e.createVNode(e.Transition,{mode:"out-in","enter-active-class":"motion-safe:transition-all motion-safe:duration-200 motion-safe:ease-out","enter-from-class":"opacity-0 translate-y-1","enter-to-class":"opacity-100 translate-y-0","leave-active-class":"motion-safe:transition-all motion-safe:duration-150 motion-safe:ease-in","leave-from-class":"opacity-100 translate-y-0","leave-to-class":"opacity-0 -translate-y-1"},{default:e.withCtx(()=>[l.value[a.value]?(e.openBlock(),e.createElementBlock("div",{key:a.value,id:m.value,role:"tabpanel","aria-labelledby":`fc-tab-${a.value}`,tabindex:"0",class:"pt-4"},[e.createVNode(v,{nodes:l.value[a.value].children},null,8,["nodes"])],8,Va)):e.createCommentVNode("",!0)]),_:1})],2))}}),v=e.defineComponent({__name:"LayoutRenderer",props:{nodes:{}},setup(t){const c=e.inject(R);function a(s){return c?S.evaluateCondition(s.condition,c.values):!0}function l(s){return s==="full"?{gridColumn:"1 / -1"}:s==="auto"?{gridColumn:"auto"}:typeof s=="number"?{gridColumn:`span ${s} / span ${s}`}:{gridColumn:"span 12 / span 12"}}return(s,d)=>{const m=e.resolveComponent("LayoutRenderer",!0);return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.nodes,(o,n)=>{var r;return e.openBlock(),e.createElementBlock(e.Fragment,{key:n},[e.unref(S.isFieldNode)(o)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(o.className??""),style:e.normalizeStyle(l(o.span))},[e.createVNode(te,{name:o.name},null,8,["name"])],6)):o.type==="field"?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(o.className??""),style:e.normalizeStyle(l(o.span))},[e.createVNode(te,{name:o.name},null,8,["name"])],6)):o.type==="row"?(e.openBlock(),e.createBlock(sa,{key:2,children:o.children,gap:o.gap,align:o.align,"class-name":o.className},null,8,["children","gap","align","class-name"])):o.type==="group"?(e.openBlock(),e.createBlock(oa,{key:3,title:o.title,description:o.description,collapsible:o.collapsible,collapsed:o.collapsed,children:o.children,"class-name":o.className},null,8,["title","description","collapsible","collapsed","children","class-name"])):o.type==="steps"?(e.openBlock(),e.createBlock(xa,{key:4,steps:o.steps,linear:o.linear,"class-name":o.className},null,8,["steps","linear","class-name"])):o.type==="tabs"?(e.openBlock(),e.createBlock(Ea,{key:5,tabs:o.tabs,"class-name":o.className},null,8,["tabs","class-name"])):o.type==="divider"?(e.openBlock(),e.createBlock(Jt,{key:6,label:o.label,"class-name":o.className},null,8,["label","class-name"])):o.type==="html"?(e.openBlock(),e.createBlock(ra,{key:7,content:o.content,"class-name":o.className},null,8,["content","class-name"])):o.type==="conditional"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:8},[a(o)?(e.openBlock(),e.createBlock(m,{key:0,nodes:o.children},null,8,["nodes"])):(r=o.elseChildren)!=null&&r.length?(e.openBlock(),e.createBlock(m,{key:1,nodes:o.elseChildren},null,8,["nodes"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64)}),128)}}}),Na={key:0,class:"mb-6"},$a={key:0,class:"text-lg font-semibold text-gray-900"},Sa={key:1,class:"mt-1 text-sm text-gray-500"},Fa={class:"mt-6 flex items-center gap-3"},Da=["disabled"],za={key:0,class:"mr-2 inline-block h-3.5 w-3.5 animate-spin rounded-full border-2 border-white border-t-transparent","aria-hidden":"true"},Ta=["disabled"],La=e.defineComponent({__name:"FormBuilder",props:{schema:{},layout:{},locale:{default:"en"},fallbackLocale:{default:"en"},modelValue:{},theme:{},components:{}},emits:["submit","error","update:modelValue"],setup(t,{expose:c,emit:a}){const l=t,s=a,d=[["text",vt],["number",Ue],["textarea",Mt],["select",kt],["checkbox",Ee],["checkbox-group",xe],["radio",it],["switch",$t],["date",Se],["file",je],["slider",wt],["tags",Tt],["phone",lt]];for(const[p,u]of d)W(p)||_(p,u);e.provide(U,e.computed(()=>l.components??{})),pe(e.toRef(l,"theme"));const m=L(),o=ee(l.schema,{locale:l.locale,fallbackLocale:l.fallbackLocale});if(l.modelValue)for(const[p,u]of Object.entries(l.modelValue))o.setFieldValue(p,u);e.watch(()=>l.modelValue,p=>{if(p)for(const[u,b]of Object.entries(p))o.values[u]!==b&&o.setFieldValue(u,b)},{deep:!0}),e.watch(()=>({...o.values}),p=>{s("update:modelValue",p)},{deep:!0}),e.watch(()=>l.locale,p=>{p&&o.setLocale(p)}),J();const n=e.computed(()=>{var V,h;const p=l.schema.translations;if(!p)return"";const u=p[l.locale];if((V=u==null?void 0:u.messages)!=null&&V.title)return u.messages.title;const b=p[l.fallbackLocale];return((h=b==null?void 0:b.messages)==null?void 0:h.title)??""}),r=e.computed(()=>{var V,h;const p=l.schema.translations;if(!p)return"";const u=p[l.locale];if((V=u==null?void 0:u.messages)!=null&&V.description)return u.messages.description;const b=p[l.fallbackLocale];return((h=b==null?void 0:b.messages)==null?void 0:h.description)??""}),i=e.computed(()=>{const p=l.schema.translations;if(!p)return"Submit";const u=p[l.locale];if(u!=null&&u.submit)return u.submit;const b=p[l.fallbackLocale];return(b==null?void 0:b.submit)??"Submit"}),y=e.computed(()=>{const p=l.schema.translations;if(!p)return"Reset";const u=p[l.locale];if(u!=null&&u.reset)return u.reset;const b=p[l.fallbackLocale];return(b==null?void 0:b.reset)??"Reset"}),x=e.computed(()=>{var p,u;return(u=(p=l.layout)==null?void 0:p.nodes)!=null&&u.length?l.layout.nodes:l.schema.fields});async function w(){try{await o.submit(async p=>{s("submit",p)})}catch(p){s("error",p)}}function f(){o.reset()}return c({form:o}),(p,u)=>(e.openBlock(),e.createElementBlock("form",{class:e.normalizeClass([e.unref(m).classes.value.form,"fc-form-builder"]),style:e.normalizeStyle(e.unref(m).cssVars.value),novalidate:"",onSubmit:e.withModifiers(w,["prevent"]),onReset:e.withModifiers(f,["prevent"])},[n.value||r.value?(e.openBlock(),e.createElementBlock("div",Na,[n.value?(e.openBlock(),e.createElementBlock("h2",$a,e.toDisplayString(n.value),1)):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("p",Sa,e.toDisplayString(r.value),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createVNode(v,{nodes:x.value},null,8,["nodes"]),e.createElementVNode("div",Fa,[e.createElementVNode("button",{type:"submit",disabled:e.unref(o).isSubmitting.value,class:e.normalizeClass([e.unref(m).classes.value.button,"fc-submit-btn rounded-md px-4 py-2 text-sm font-medium text-white motion-safe:transition-colors motion-safe:duration-150 focus:outline-none focus:ring-2 focus:ring-blue-500/40 disabled:cursor-not-allowed disabled:opacity-50"]),style:{"background-color":"var(--fc-color-primary, #3b82f6)"}},[e.unref(o).isSubmitting.value?(e.openBlock(),e.createElementBlock("span",za)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(i.value),1)],10,Da),e.createElementVNode("button",{type:"reset",disabled:e.unref(o).isSubmitting.value,class:"rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 motion-safe:transition-colors motion-safe:duration-150 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500/40 disabled:cursor-not-allowed disabled:opacity-50"},e.toDisplayString(y.value),9,Ta)])],38))}});T.FormBuilder=La,T.FormComponentsKey=U,T.FormContextKey=R,T.FormI18nKey=P,T.getFieldComponent=Y,T.getRegisteredFieldTypes=oe,T.hasFieldType=W,T.registerFieldType=_,T.unregisterFieldType=le,T.useForm=ee,T.useFormI18n=Q,T.useFormI18nContext=J,Object.keys(S).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(T,t)&&Object.defineProperty(T,t,{enumerable:!0,get:()=>S[t]})}),Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(z,S){typeof exports=="object"&&typeof module<"u"?S(exports,require("@formatica/core"),require("vue"),require("libphonenumber-js")):typeof define=="function"&&define.amd?define(["exports","@formatica/core","vue","libphonenumber-js"],S):(z=typeof globalThis<"u"?globalThis:z||self,S(z.Formatica={},z.FormaticaCore,z.Vue,z.libphonenumber))})(this,function(z,S,e,M){"use strict";const U=Symbol("FormaticaComponents"),j=new Map;function H(t,d){j.set(t,d)}function oe(t){j.delete(t)}function W(t){return j.get(t)}function Q(t){return j.has(t)}function ne(){return Array.from(j.keys())}const G=Symbol("Formatica");function re(t={}){return{install(d){if(d.provide(G,e.reactive(t)),t.components)for(const[a,l]of Object.entries(t.components))H(a,l)}}}function se(){const t=new Map;function d(l,i){t.has(l)||t.set(l,new Set);const r=t.get(l);return r?(r.add(i),()=>{r.delete(i)}):()=>{}}function a(l,i){const r=t.get(l);if(r)for(const m of r)m(i)}return{on:d,emit:a}}const P=Symbol("FormaticaI18n"),ie={required:"This field is required",email:"Please enter a valid email address",url:"Please enter a valid URL",min:"Must be at least {min}",max:"Must be at most {max}",minLength:"Must be at least {min} characters",maxLength:"Must be at most {max} characters",between:"Must be between {min} and {max}",pattern:"Invalid format",numeric:"Must be a number",integer:"Must be an integer",alpha:"Must contain only letters",alphaNumeric:"Must contain only letters and numbers",confirmed:"Confirmation does not match",date:"Please enter a valid date"};function J(t){const{locale:d,fallbackLocale:a="en",fieldTranslations:l={},formTranslations:i={}}=t;function r(s,c){const h=l[s];if(h){const b=h[d.value];if(b){const u=b[c];if(typeof u=="string")return u}const x=h[a];if(x){const u=x[c];if(typeof u=="string")return u}}return c==="label"?S.titleCase(s):""}function m(s,c){var b,x;const h=l[s];if(h){const u=h[d.value];if((b=u==null?void 0:u.options)!=null&&b[c])return u.options[c];const B=h[a];if((x=B==null?void 0:B.options)!=null&&x[c])return B.options[c]}return c}function o(s,c){var u,B;const h=(u=i[d.value])==null?void 0:u.messages;if(h!=null&&h[s])return q(h[s],c??{});const b=(B=i[a])==null?void 0:B.messages;if(b!=null&&b[s])return q(b[s],c??{});const x=ie[s];return x?q(x,c??{}):`Validation failed: ${s}`}const n={locale:d,fallbackLocale:a,t:r,tOption:m,tValidation:o};return e.provide(P,n),n}function X(){return e.inject(P)}function q(t,d){return t.replace(/\{(\w+)\}/g,(a,l)=>d[l]!==void 0?String(d[l]):`{${l}}`)}function ee(t){return t.split("|").map(d=>{const[a,...l]=d.split(":"),i={};if(l.length>0){const m=l.join(":").split(",");a==="between"&&m.length===2?(i.min=m[0],i.max=m[1]):m.length===1?i[a]=m[0]:i.values=m}return{name:a,params:i}})}function ce(t){const d=t.rules;if(!d){const l=[];return t.required&&l.push({name:"required"}),l}if(typeof d=="string")return ee(d);if(Array.isArray(d))return d.flatMap(l=>typeof l=="string"?ee(l):[]);const a=[];for(const[l,i]of Object.entries(d)){if(i===!1)continue;const r={};typeof i=="object"&&i!==null&&!Array.isArray(i)?Object.assign(r,i):i!==!0&&(r[l]=i),a.push({name:l,params:r})}return a}function de(t,d){let a=null,l=null;return(...i)=>new Promise(r=>{a!==null&&(clearTimeout(a),l&&l([])),l=r,a=setTimeout(async()=>{a=null;const m=await t(...i);r(m),l=null},d)})}function me(t){const{fields:d,values:a,settings:l}=t,i=e.ref({}),r=new Map;function m(b,x){const u=`${b}:${x}`;r.has(u)||r.set(u,de(async(...g)=>o(g[0],g[1]),x));const B=r.get(u);if(!B)throw new Error(`Debounced validator not found for ${u}`);return B}async function o(b,x){var N;const u=d.value.find(w=>w.name===b);if(!u)return[];const B=ce(u),g=a.value[b],y=[];for(const w of B){if((N=w.params)!=null&&N.when){const p=w.params.when;if(("field"in p||"and"in p||"or"in p)&&!S.evaluateCondition(p,a.value))continue}if(w.optional&&ue(g))continue;let f;if(w.validator)f=await w.validator(g,w.params??{},x);else{const p=S.getRule(w.name);if(!p)continue;f=await p(g,w.params??{},x)}if(f!==!0){const p=w.message?fe(w.message,w.params??{}):typeof f=="string"?f:`Validation failed for rule: ${w.name}`;if(y.push(p),w.bail)break}}return i.value[b]=y,y}async function n(b,x){const u=l==null?void 0:l.debounce;return u&&u>0?m(b,u)(b,x):o(b,x)}async function s(b){const x={},u=d.value.map(async B=>{const g=await o(B.name,b);g.length>0&&(x[B.name]=g)});return await Promise.all(u),i.value={...x},x}function c(b){delete i.value[b]}function h(){i.value={}}return{errors:i,validateField:n,validateAll:s,clearFieldErrors:c,clearAllErrors:h}}function ue(t){return!!(t==null||t===""||Array.isArray(t)&&t.length===0)}function fe(t,d){return t.replace(/\{(\w+)\}/g,(a,l)=>d[l]!==void 0?String(d[l]):`{${l}}`)}const v=Symbol("FormaticaContext");function pe(t){switch(t.type){case"tags":return[];case"checkbox-group":return[];case"checkbox":return!1;case"switch":return!1;case"number":case"slider":return null;case"file":return null;default:return""}}function Z(t){const d={};for(const a of t)d[a.name]=a.defaultValue??pe(a);return d}function ye(t){const d={};for(const a of t)a.translations&&(d[a.name]=a.translations);return d}function te(t,d){const a=e.ref((d==null?void 0:d.locale)??"en"),l=(d==null?void 0:d.fallbackLocale)??"en";let i=t;const r=e.ref(S.extractFields(t.fields)),m=e.reactive(Z(S.extractFields(t.fields))),o=e.reactive({}),n=e.reactive({}),s=e.reactive({}),c=e.ref(!1),h=e.ref(0),b=e.computed(()=>Object.values(o).every(k=>k.length===0)),x=e.computed(()=>Object.values(s).some(Boolean)),u=se();function B(){return{values:{...m},getFieldValue:k=>m[k]}}const g=e.computed(()=>({...m})),y=me({fields:r,values:g,settings:t.settings});J({locale:a,fallbackLocale:l,fieldTranslations:ye(S.extractFields(t.fields)),formTranslations:t.translations});let N=Z(S.extractFields(t.fields));e.watch(()=>({...m}),(k,E)=>{var F;if(E){for(const D of Object.keys(k))k[D]!==E[D]&&(s[D]=!0,u.emit("field:change",{field:D,value:k[D],previousValue:E[D]}),(F=t.settings)!=null&&F.validateOnChange&&V(D));u.emit("change",{values:k})}},{deep:!0});const w=new Map;function f(k){const E=k.name;return{name:E,value:e.computed({get:()=>m[E],set:F=>{m[E]=F}}),errors:e.computed(()=>o[E]??[]),touched:e.computed({get:()=>n[E]??!1,set:F=>{n[E]=F}}),dirty:e.computed({get:()=>s[E]??!1,set:F=>{s[E]=F}}),disabled:e.computed(()=>typeof k.disabled=="function"?k.disabled(B()):k.disabled??!1),visible:e.computed(()=>k.condition?S.evaluateCondition(k.condition,m):typeof k.visible=="function"?k.visible(B()):k.visible??!0),schema:k,validate:()=>V(E),reset:()=>{m[E]=N[E]??null,delete o[E],n[E]=!1,s[E]=!1},clear:()=>{m[E]=null,delete o[E]}}}function p(){w.clear();for(const k of S.extractFields(i.fields))w.set(k.name,f(k))}p();async function V(k){const E=await y.validateField(k,B());return o[k]=E,u.emit("validate:field",{field:k,valid:E.length===0,errors:E}),E}async function C(){const k=await y.validateAll(B());for(const F of Object.keys(o))F in k||delete o[F];for(const[F,D]of Object.entries(k))o[F]=D;const E=Object.values(k).every(F=>F.length===0);return u.emit("validate",{valid:E,errors:{...k}}),E}async function $(k){c.value=!0,h.value+=1;try{for(const F of S.extractFields(i.fields))n[F.name]=!0;if(!await C()){u.emit("submit:error",{values:{...m},error:new Error("Validation failed")});return}u.emit("submit",{values:{...m}}),k&&await k({...m},B()),u.emit("submit:success",{values:{...m},result:void 0})}catch(E){throw u.emit("submit:error",{values:{...m},error:E}),E}finally{c.value=!1}}function T(){for(const k of S.extractFields(i.fields))m[k.name]=N[k.name]??null,delete o[k.name],n[k.name]=!1,s[k.name]=!1;y.clearAllErrors(),u.emit("reset",void 0)}function A(){for(const k of S.extractFields(i.fields))m[k.name]=null,delete o[k.name];y.clearAllErrors()}function K(k){i=k;const E=S.extractFields(k.fields);r.value=E,N=Z(E);for(const D of E)D.name in m||(m[D.name]=D.defaultValue??null);const F=new Set(E.map(D=>D.name));for(const D of Object.keys(m))F.has(D)||(delete m[D],delete o[D],delete n[D],delete s[D]);p()}const le={values:m,errors:o,touched:n,dirty:s,isValid:b,isDirty:x,isSubmitting:c,submitCount:h,validate:C,validateField:V,submit:$,reset:T,clear:A,setError:(k,E)=>{o[k]=E},clearError:k=>{delete o[k],y.clearFieldErrors(k)},clearErrors:()=>{for(const k of Object.keys(o))delete o[k];y.clearAllErrors()},getField:k=>w.get(k),setFieldValue:(k,E)=>{m[k]=E},setFieldDisabled:(k,E)=>{const F=S.extractFields(i.fields).find(D=>D.name===k);F&&(F.disabled=E)},setFieldVisible:(k,E)=>{const F=S.extractFields(i.fields).find(D=>D.name===k);F&&(F.visible=E)},on:u.on,locale:a,setLocale:k=>{a.value=k},schema:i,updateSchema:K};return e.provide(v,le),le}const _=Symbol("FormaticaTheme"),Y={name:"default",colors:{primary:"#3b82f6",primaryHover:"#2563eb",error:"#ef4444",errorHover:"#dc2626",success:"#22c55e",warning:"#f59e0b",info:"#3b82f6",text:"#1f2937",textSecondary:"#6b7280",textDisabled:"#9ca3af",background:"#ffffff",backgroundDisabled:"#f3f4f6",border:"#d1d5db",borderFocus:"#3b82f6",borderError:"#ef4444",placeholder:"#9ca3af"},typography:{fontFamily:"inherit",fontSize:"0.875rem",fontSizeSmall:"0.75rem",fontSizeLarge:"1rem",lineHeight:"1.5",labelFontWeight:"500"},spacing:{fieldGap:"1rem",rowGap:"1rem",inputPaddingX:"0.75rem",inputPaddingY:"0.5rem",labelMarginBottom:"0.375rem"},borders:{radius:"0.375rem",radiusSmall:"0.25rem",radiusLarge:"0.5rem",width:"1px",style:"solid"},shadows:{focus:"0 0 0 3px rgba(59, 130, 246, 0.1)",error:"0 0 0 3px rgba(239, 68, 68, 0.1)",dropdown:"0 4px 6px -1px rgba(0, 0, 0, 0.1)"},transitions:{duration:"150ms",timingFunction:"ease-in-out"}};function be(t){const d=e.isRef(t)?e.computed(()=>t.value??Y):e.ref(t??Y),a=e.computed(()=>{const r=d.value.components??{};return{form:r.form??"fc-form",field:r.field??"fc-field",label:r.label??"fc-label",input:r.input??"fc-input",error:r.error??"fc-error",helpText:r.helpText??"fc-help-text",group:r.group??"fc-group",row:r.row??"fc-row",steps:r.steps??"fc-steps",tabs:r.tabs??"fc-tabs",button:r.button??"fc-button"}}),l=e.computed(()=>{const r=d.value,m={};if(r.colors)for(const[o,n]of Object.entries(r.colors))n&&(m[`--fc-color-${I(o)}`]=n);if(r.typography)for(const[o,n]of Object.entries(r.typography))n&&(m[`--fc-${I(o)}`]=n);if(r.spacing)for(const[o,n]of Object.entries(r.spacing))n&&(m[`--fc-${I(o)}`]=n);if(r.borders)for(const[o,n]of Object.entries(r.borders))n&&(m[`--fc-border-${I(o)}`]=n);if(r.shadows)for(const[o,n]of Object.entries(r.shadows))n&&(m[`--fc-shadow-${I(o)}`]=n);if(r.transitions)for(const[o,n]of Object.entries(r.transitions))n&&(m[`--fc-transition-${I(o)}`]=n);return r.cssVars&&Object.assign(m,r.cssVars),m}),i={config:d.value,classes:a,cssVars:l};return e.provide(_,i),i}function L(){const t=e.inject(_);return t||ge()}function ge(){const t=e.computed(()=>({form:"fc-form",field:"fc-field",label:"fc-label",input:"fc-input",error:"fc-error",helpText:"fc-help-text",group:"fc-group",row:"fc-row",steps:"fc-steps",tabs:"fc-tabs",button:"fc-button"})),d=e.computed(()=>({}));return{config:Y,classes:t,cssVars:d}}function I(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}const he=["checked","disabled","onChange"],ke=["aria-checked","aria-disabled","onClick","onKeydown"],xe={key:0,class:"h-3 w-3",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},Be={class:"text-sm text-gray-700"},we=e.defineComponent({__name:"CheckboxGroupInput",props:{modelValue:{},options:{},inline:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minSelect:{},maxSelect:{}},emits:["update:modelValue","blur"],setup(t,{emit:d}){const a=t,l=d;L();function i(n){return a.modelValue.includes(n)}function r(n){return!!(a.disabled||n.disabled||a.maxSelect&&!i(n.value)&&a.modelValue.length>=a.maxSelect)}function m(n){if(r(n))return;const s=[...a.modelValue],c=s.indexOf(n.value);if(c>=0){if(a.minSelect&&s.length<=a.minSelect)return;s.splice(c,1)}else s.push(n.value);l("update:modelValue",s)}function o(n,s){(n.key===" "||n.key==="Enter")&&(n.preventDefault(),m(s))}return(n,s)=>(e.openBlock(),e.createElementBlock("div",{role:"group",class:e.normalizeClass(t.inline?"flex flex-wrap gap-4":"flex flex-col gap-2")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,c=>(e.openBlock(),e.createElementBlock("label",{key:String(c.value),class:e.normalizeClass(["inline-flex items-center gap-2 select-none",r(c)?"opacity-50 cursor-not-allowed":"cursor-pointer"])},[e.createElementVNode("input",{type:"checkbox",checked:i(c.value),disabled:r(c),class:"sr-only",onChange:h=>m(c),onBlur:s[0]||(s[0]=h=>l("blur",h))},null,40,he),e.createElementVNode("div",{role:"checkbox","aria-checked":i(c.value),"aria-disabled":r(c)||void 0,tabindex:"0",class:e.normalizeClass(["flex h-5 w-5 shrink-0 items-center justify-center rounded border-2 transition-colors duration-200",i(c.value)?"text-white":"border-gray-300 bg-white"]),style:e.normalizeStyle(i(c.value)?{borderColor:"var(--fc-color-primary, #3b82f6)",backgroundColor:"var(--fc-color-primary, #3b82f6)"}:{}),onClick:h=>m(c),onKeydown:h=>o(h,c)},[i(c.value)?(e.openBlock(),e.createElementBlock("svg",xe,[...s[1]||(s[1]=[e.createElementVNode("path",{d:"M2 6l3 3 5-5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):e.createCommentVNode("",!0)],46,ke),e.createElementVNode("span",Be,e.toDisplayString(c.label),1)],2))),128))],2))}}),Ce=["checked","disabled"],Ve=["aria-checked","aria-disabled"],Ee={key:0,class:"h-3 w-3",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},Ne={key:0,class:"text-sm text-gray-700"},$e=e.defineComponent({__name:"CheckboxInput",props:{modelValue:{type:Boolean},checkboxLabel:{},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","blur"],setup(t,{emit:d}){const a=t,l=d;L();const i=e.computed(()=>["inline-flex items-center gap-2 select-none",a.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"]);function r(){a.disabled||l("update:modelValue",!a.modelValue)}function m(o){(o.key===" "||o.key==="Enter")&&(o.preventDefault(),r())}return(o,n)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(i.value)},[e.createElementVNode("input",{type:"checkbox",checked:t.modelValue,disabled:t.disabled,class:"sr-only",onChange:r,onBlur:n[0]||(n[0]=s=>l("blur",s))},null,40,Ce),e.createElementVNode("div",{role:"checkbox","aria-checked":t.modelValue,"aria-disabled":t.disabled||void 0,tabindex:"0",class:e.normalizeClass(["flex h-5 w-5 shrink-0 items-center justify-center rounded border-2 transition-colors duration-200",t.modelValue?"text-white":"border-gray-300 bg-white"]),style:e.normalizeStyle(t.modelValue?{borderColor:"var(--fc-color-primary, #3b82f6)",backgroundColor:"var(--fc-color-primary, #3b82f6)"}:{}),onClick:r,onKeydown:m},[t.modelValue?(e.openBlock(),e.createElementBlock("svg",Ee,[...n[1]||(n[1]=[e.createElementVNode("path",{d:"M2 6l3 3 5-5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):e.createCommentVNode("",!0)],46,Ve),t.checkboxLabel?(e.openBlock(),e.createElementBlock("span",Ne,e.toDisplayString(t.checkboxLabel),1)):e.createCommentVNode("",!0)],2))}}),Se=["value","min","max","placeholder","disabled","aria-disabled"],Fe=e.defineComponent({__name:"DateInput",props:{modelValue:{},format:{},minDate:{},maxDate:{},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","blur","focus"],setup(t,{emit:d}){const a=t,l=d,i=L(),r=e.computed(()=>["w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm","focus:outline-none focus:ring-2 focus:ring-blue-500/20 fc-date-input","transition-colors duration-200",a.disabled?"opacity-50 cursor-not-allowed bg-gray-100":"",i.classes.value.input].filter(Boolean).join(" "));function m(o){const n=o.target;l("update:modelValue",n.value)}return(o,n)=>(e.openBlock(),e.createElementBlock("input",{type:"date",value:t.modelValue,min:t.minDate,max:t.maxDate,placeholder:t.placeholder,disabled:t.disabled,class:e.normalizeClass(r.value),"aria-disabled":t.disabled||void 0,onInput:m,onBlur:n[0]||(n[0]=s=>l("blur",s)),onFocus:n[1]||(n[1]=s=>l("focus",s))},null,42,Se))}}),R=(t,d)=>{const a=t.__vccOpts||t;for(const[l,i]of d)a[l]=i;return a},De=R(Fe,[["__scopeId","data-v-7d4bc9b7"]]),ze=["aria-disabled","onKeydown"],Te={key:0,class:"mt-1 text-xs text-gray-400"},Le=["accept","multiple"],Me={key:0,class:"mt-3 space-y-2"},Ie={class:"flex items-center gap-2 truncate"},Ae={class:"truncate"},je={class:"shrink-0 text-xs text-gray-400"},ve=["onClick"],Re=e.defineComponent({__name:"FileInput",props:{modelValue:{},accept:{},maxSize:{},multiple:{type:Boolean,default:!1},maxFiles:{},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","blur"],setup(t,{emit:d}){const a=t,l=d;L();const i=e.ref(null),r=e.ref(!1),m=e.computed(()=>a.modelValue?Array.isArray(a.modelValue)?a.modelValue:[a.modelValue]:[]);function o(g){return g<1024?`${g} B`:g<1024*1024?`${(g/1024).toFixed(1)} KB`:`${(g/(1024*1024)).toFixed(1)} MB`}function n(g){let y=g;if(a.maxSize){const N=a.maxSize;y=y.filter(w=>w.size<=N)}if(a.multiple&&a.maxFiles){const N=a.maxFiles-m.value.length;y=y.slice(0,Math.max(0,N))}return y}function s(g){const y=n(g);y.length!==0&&(a.multiple?l("update:modelValue",[...m.value,...y]):l("update:modelValue",y[0]))}function c(g){const y=g.target;y.files&&(s(Array.from(y.files)),y.value="")}function h(g){if(a.disabled)return;const y=m.value.filter((N,w)=>w!==g);a.multiple?l("update:modelValue",y.length?y:[]):l("update:modelValue",null)}function b(g){g.preventDefault(),a.disabled||(r.value=!0)}function x(){r.value=!1}function u(g){var y;g.preventDefault(),r.value=!1,!(a.disabled||!((y=g.dataTransfer)!=null&&y.files))&&s(Array.from(g.dataTransfer.files))}function B(){var g;a.disabled||(g=i.value)==null||g.click()}return(g,y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(t.disabled?"opacity-50 cursor-not-allowed":"")},[e.createElementVNode("div",{role:"button",tabindex:"0","aria-disabled":t.disabled||void 0,class:e.normalizeClass(["flex flex-col items-center justify-center rounded-lg border-2 border-dashed p-6 text-center transition-colors duration-200",r.value?"":"border-gray-300 bg-gray-50",t.disabled?"pointer-events-none":"cursor-pointer hover:border-gray-400"]),style:e.normalizeStyle(r.value?{borderColor:"var(--fc-color-primary, #3b82f6)",backgroundColor:"color-mix(in srgb, var(--fc-color-primary, #3b82f6) 8%, white)"}:{}),onClick:B,onKeydown:[e.withKeys(B,["enter"]),e.withKeys(e.withModifiers(B,["prevent"]),["space"])],onDragover:b,onDragleave:x,onDrop:u,onBlur:y[0]||(y[0]=N=>l("blur",N))},[y[1]||(y[1]=e.createElementVNode("svg",{class:"mb-2 h-8 w-8 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 16v-8m0 0l-3 3m3-3l3 3M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1"})],-1)),y[2]||(y[2]=e.createElementVNode("p",{class:"text-sm text-gray-600"},[e.createTextVNode(" Drop files here or "),e.createElementVNode("span",{class:"font-medium",style:{color:"var(--fc-color-primary, #3b82f6)"}},"browse")],-1)),t.accept?(e.openBlock(),e.createElementBlock("p",Te,"Accepted: "+e.toDisplayString(t.accept),1)):e.createCommentVNode("",!0)],46,ze),e.createElementVNode("input",{ref_key:"fileInputRef",ref:i,type:"file",accept:t.accept,multiple:t.multiple,class:"hidden",onChange:c},null,40,Le),m.value.length>0?(e.openBlock(),e.createElementBlock("ul",Me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(N,w)=>(e.openBlock(),e.createElementBlock("li",{key:`${N.name}-${w}`,class:"flex items-center justify-between rounded-md border border-gray-200 bg-white px-3 py-2 text-sm"},[e.createElementVNode("div",Ie,[y[3]||(y[3]=e.createElementVNode("svg",{class:"h-4 w-4 shrink-0 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})],-1)),e.createElementVNode("span",Ae,e.toDisplayString(N.name),1),e.createElementVNode("span",je,"("+e.toDisplayString(o(N.size))+")",1)]),t.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"ml-2 shrink-0 text-gray-400 hover:text-red-500 transition-colors duration-200","aria-label":"Remove file",onClick:e.withModifiers(f=>h(w),["stop"])}," × ",8,ve))]))),128))])):e.createCommentVNode("",!0)],2))}}),Oe={key:0,class:"flex items-stretch"},Ke={key:0,class:"inline-flex items-center rounded-l-md border border-r-0 border-gray-300 bg-gray-50 px-3 text-sm text-gray-500"},Pe=["value","min","max","step","disabled","readonly","aria-disabled","aria-readonly"],Ue={key:1,class:"inline-flex items-center rounded-r-md border border-l-0 border-gray-300 bg-gray-50 px-3 text-sm text-gray-500"},He=["value","min","max","step","disabled","readonly","aria-disabled","aria-readonly"],Ge=R(e.defineComponent({__name:"NumberInput",props:{modelValue:{},min:{},max:{},step:{default:1},precision:{},prefix:{},suffix:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1}},emits:["update:modelValue","blur","focus"],setup(t,{emit:d}){const a=t,l=d,i=L(),r=e.computed(()=>!!a.prefix||!!a.suffix),m=e.computed(()=>["w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm","placeholder:text-gray-400","focus:outline-none focus:ring-2 focus:ring-blue-500/20 fc-number-input","transition-colors duration-200",a.disabled?"opacity-50 cursor-not-allowed bg-gray-100":"",a.prefix?"rounded-l-none":"",a.suffix?"rounded-r-none":"",i.classes.value.input].filter(Boolean).join(" "));function o(n){const c=n.target.value;if(c===""){l("update:modelValue",null);return}let h=parseFloat(c);Number.isNaN(h)||(a.precision!==void 0&&(h=parseFloat(h.toFixed(a.precision))),l("update:modelValue",h))}return(n,s)=>r.value?(e.openBlock(),e.createElementBlock("div",Oe,[t.prefix?(e.openBlock(),e.createElementBlock("span",Ke,e.toDisplayString(t.prefix),1)):e.createCommentVNode("",!0),e.createElementVNode("input",{type:"number",value:t.modelValue??"",min:t.min,max:t.max,step:t.step,disabled:t.disabled,readonly:t.readonly,class:e.normalizeClass(m.value),"aria-disabled":t.disabled||void 0,"aria-readonly":t.readonly||void 0,onInput:o,onBlur:s[0]||(s[0]=c=>l("blur",c)),onFocus:s[1]||(s[1]=c=>l("focus",c))},null,42,Pe),t.suffix?(e.openBlock(),e.createElementBlock("span",Ue,e.toDisplayString(t.suffix),1)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("input",{key:1,type:"number",value:t.modelValue??"",min:t.min,max:t.max,step:t.step,disabled:t.disabled,readonly:t.readonly,class:e.normalizeClass(m.value),"aria-disabled":t.disabled||void 0,"aria-readonly":t.readonly||void 0,onInput:o,onBlur:s[2]||(s[2]=c=>l("blur",c)),onFocus:s[3]||(s[3]=c=>l("focus",c))},null,42,He))}}),[["__scopeId","data-v-4e51299b"]]),qe={class:"relative"},Ze=["disabled"],_e={class:"text-lg leading-none"},Ye={class:"text-xs text-gray-500 dark:text-gray-400 font-medium"},We=["value","placeholder","disabled"],Qe={key:1,class:"absolute left-0 top-full z-50 mt-1 w-72 rounded-lg border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-900 shadow-xl overflow-hidden"},Je={class:"border-b border-gray-200 dark:border-gray-700 p-2"},Xe={class:"max-h-48 overflow-y-auto"},et=["onMousedown"],tt={class:"text-lg leading-none"},at={class:"flex-1 truncate text-xs"},lt={class:"text-[11px] text-gray-400 dark:text-gray-500 font-mono"},ot={key:0,class:"px-3 py-4 text-center text-xs text-gray-400 dark:text-gray-500"},nt=e.defineComponent({__name:"PhoneInput",props:{modelValue:{},defaultCountry:{default:"US"},countries:{},showDialCode:{type:Boolean,default:!0},placeholder:{},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","blur"],setup(t,{emit:d}){const a=t,l=d,i={AF:"Afghanistan",AL:"Albania",DZ:"Algeria",AD:"Andorra",AO:"Angola",AR:"Argentina",AM:"Armenia",AU:"Australia",AT:"Austria",AZ:"Azerbaijan",BH:"Bahrain",BD:"Bangladesh",BY:"Belarus",BE:"Belgium",BZ:"Belize",BJ:"Benin",BT:"Bhutan",BO:"Bolivia",BA:"Bosnia",BW:"Botswana",BR:"Brazil",BN:"Brunei",BG:"Bulgaria",BF:"Burkina Faso",BI:"Burundi",KH:"Cambodia",CM:"Cameroon",CA:"Canada",CL:"Chile",CN:"China",CO:"Colombia",CR:"Costa Rica",HR:"Croatia",CU:"Cuba",CY:"Cyprus",CZ:"Czechia",DK:"Denmark",DO:"Dominican Rep.",EC:"Ecuador",EG:"Egypt",SV:"El Salvador",EE:"Estonia",ET:"Ethiopia",FI:"Finland",FR:"France",GE:"Georgia",DE:"Germany",GH:"Ghana",GR:"Greece",GT:"Guatemala",HN:"Honduras",HK:"Hong Kong",HU:"Hungary",IS:"Iceland",IN:"India",ID:"Indonesia",IR:"Iran",IQ:"Iraq",IE:"Ireland",IL:"Israel",IT:"Italy",JM:"Jamaica",JP:"Japan",JO:"Jordan",KZ:"Kazakhstan",KE:"Kenya",KR:"South Korea",KW:"Kuwait",LV:"Latvia",LB:"Lebanon",LY:"Libya",LT:"Lithuania",LU:"Luxembourg",MO:"Macau",MY:"Malaysia",MX:"Mexico",MA:"Morocco",MZ:"Mozambique",MM:"Myanmar",NP:"Nepal",NL:"Netherlands",NZ:"New Zealand",NI:"Nicaragua",NG:"Nigeria",NO:"Norway",OM:"Oman",PK:"Pakistan",PA:"Panama",PY:"Paraguay",PE:"Peru",PH:"Philippines",PL:"Poland",PT:"Portugal",QA:"Qatar",RO:"Romania",RU:"Russia",SA:"Saudi Arabia",RS:"Serbia",SG:"Singapore",SK:"Slovakia",SI:"Slovenia",ZA:"South Africa",ES:"Spain",LK:"Sri Lanka",SE:"Sweden",CH:"Switzerland",TW:"Taiwan",TZ:"Tanzania",TH:"Thailand",TR:"Turkey",UA:"Ukraine",AE:"UAE",GB:"United Kingdom",US:"United States",UY:"Uruguay",VE:"Venezuela",VN:"Vietnam",ZW:"Zimbabwe"};function r(f){return f.toUpperCase().split("").map(p=>String.fromCodePoint(127462+p.charCodeAt(0)-65)).join("")}const m=e.computed(()=>{var p;return((p=a.countries)!=null&&p.length?a.countries.filter(V=>M.getCountries().includes(V)):M.getCountries()).map(V=>({code:V,name:i[V]??V,dialCode:`+${M.getCountryCallingCode(V)}`,flag:r(V)})).sort((V,C)=>V.name.localeCompare(C.name))}),o=e.ref(a.defaultCountry),n=e.ref(""),s=e.ref(!1),c=e.ref(""),h=e.ref(null),b=e.computed(()=>{const f=c.value.toLowerCase();return f?m.value.filter(p=>p.name.toLowerCase().includes(f)||p.code.toLowerCase().includes(f)||p.dialCode.includes(f)):m.value}),x=e.computed(()=>m.value.find(f=>f.code===o.value)??m.value[0]);e.onMounted(()=>{a.modelValue&&u(a.modelValue)}),e.watch(()=>a.modelValue,f=>{f&&u(f)});function u(f){try{const p=M.parsePhoneNumber(f);if(p!=null&&p.country){o.value=p.country,n.value=p.nationalNumber;return}}catch{}n.value=f.replace(/^\+\d+\s*/,"")}function B(){if(!n.value.trim()){l("update:modelValue","");return}const f=new M.AsYouType(o.value);f.input(`+${M.getCountryCallingCode(o.value)}${n.value}`);const p=f.getNumber();l("update:modelValue",(p==null?void 0:p.format("E.164"))??n.value)}function g(f){const p=f.target;n.value=p.value,B()}function y(f){o.value=f,s.value=!1,c.value="",B()}function N(){a.disabled||(s.value=!0,c.value="",e.nextTick(()=>{var f;return(f=h.value)==null?void 0:f.focus()}))}function w(){s.value=!1,c.value=""}return(f,p)=>{var V,C;return e.openBlock(),e.createElementBlock("div",qe,[e.createElementVNode("div",{class:e.normalizeClass(["flex items-stretch rounded-lg border transition-colors",t.disabled?"opacity-50 cursor-not-allowed bg-gray-50 dark:bg-gray-800 border-gray-200 dark:border-gray-700":"border-gray-300 dark:border-gray-600 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20"])},[t.showDialCode?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",disabled:t.disabled,class:"flex items-center gap-1.5 px-3 border-r border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-800 rounded-l-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors shrink-0",onMousedown:p[0]||(p[0]=e.withModifiers($=>s.value?w():N(),["prevent"]))},[e.createElementVNode("span",_e,e.toDisplayString((V=x.value)==null?void 0:V.flag),1),e.createElementVNode("span",Ye,e.toDisplayString((C=x.value)==null?void 0:C.dialCode),1),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["h-3 w-3 text-gray-400 transition-transform",s.value?"rotate-180":""]),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...p[3]||(p[3]=[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"},null,-1)])],2))],40,Ze)):e.createCommentVNode("",!0),e.createElementVNode("input",{type:"tel",value:n.value,placeholder:t.placeholder||"Phone number",disabled:t.disabled,autocomplete:"tel-national",class:e.normalizeClass(["flex-1 bg-transparent px-3 py-2 text-sm text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500 outline-none min-w-0",t.showDialCode?"rounded-r-lg":"rounded-lg"]),onInput:g,onBlur:p[1]||(p[1]=$=>l("blur",$))},null,42,We)],2),s.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 z-40",onMousedown:w},null,32)):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("div",Qe,[e.createElementVNode("div",Je,[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:h,"onUpdate:modelValue":p[2]||(p[2]=$=>c.value=$),type:"text",placeholder:"Search country...",class:"w-full rounded-md border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-800 px-3 py-1.5 text-xs text-gray-900 dark:text-white placeholder-gray-400 outline-none focus:border-primary-500"},null,512),[[e.vModelText,c.value]])]),e.createElementVNode("div",Xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,$=>(e.openBlock(),e.createElementBlock("button",{key:$.code,type:"button",class:e.normalizeClass(["flex w-full items-center gap-3 px-3 py-2 text-left text-sm transition-colors hover:bg-gray-50 dark:hover:bg-gray-800",$.code===o.value?"bg-primary-50 dark:bg-primary-950/30 text-primary-700 dark:text-primary-300":"text-gray-700 dark:text-gray-300"]),onMousedown:e.withModifiers(T=>y($.code),["prevent"])},[e.createElementVNode("span",tt,e.toDisplayString($.flag),1),e.createElementVNode("span",at,e.toDisplayString($.name),1),e.createElementVNode("span",lt,e.toDisplayString($.dialCode),1)],42,et))),128)),b.value.length===0?(e.openBlock(),e.createElementBlock("p",ot," No countries found ")):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])}}}),rt=["checked","disabled","onChange"],st=["aria-checked","aria-disabled","onClick","onKeydown"],it={key:0,class:"h-2.5 w-2.5 rounded-full",style:{backgroundColor:"var(--fc-color-primary, #3b82f6)"}},ct={class:"text-sm text-gray-700"},dt=e.defineComponent({__name:"RadioInput",props:{modelValue:{type:[String,Number,Boolean,null]},options:{},inline:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","blur"],setup(t,{emit:d}){const a=t,l=d;L();function i(n){return a.modelValue===n}function r(n){return a.disabled||!!n.disabled}function m(n){r(n)||l("update:modelValue",n.value)}function o(n,s){(n.key===" "||n.key==="Enter")&&(n.preventDefault(),m(s))}return(n,s)=>(e.openBlock(),e.createElementBlock("div",{role:"radiogroup",class:e.normalizeClass(t.inline?"flex flex-wrap gap-4":"flex flex-col gap-2")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,c=>(e.openBlock(),e.createElementBlock("label",{key:String(c.value),class:e.normalizeClass(["inline-flex items-center gap-2 select-none",r(c)?"opacity-50 cursor-not-allowed":"cursor-pointer"])},[e.createElementVNode("input",{type:"radio",checked:i(c.value),disabled:r(c),class:"sr-only",onChange:h=>m(c),onBlur:s[0]||(s[0]=h=>l("blur",h))},null,40,rt),e.createElementVNode("div",{role:"radio","aria-checked":i(c.value),"aria-disabled":r(c)||void 0,tabindex:"0",class:e.normalizeClass(["flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 transition-colors duration-200",i(c.value)?"":"border-gray-300"]),style:e.normalizeStyle(i(c.value)?{borderColor:"var(--fc-color-primary, #3b82f6)"}:{}),onClick:h=>m(c),onKeydown:h=>o(h,c)},[i(c.value)?(e.openBlock(),e.createElementBlock("div",it)):e.createCommentVNode("",!0)],46,st),e.createElementVNode("span",ct,e.toDisplayString(c.label),1)],2))),128))],2))}}),mt=["aria-expanded"],ut={class:"flex flex-1 flex-wrap items-center gap-1"},ft=["onClick"],pt={key:1,class:"truncate"},yt={key:2,class:"text-gray-400"},bt={key:0,class:"absolute z-50 mt-1 w-full rounded-md border border-gray-200 bg-white shadow-lg"},gt={key:0,class:"border-b border-gray-200 p-2"},ht={role:"listbox",class:"max-h-60 overflow-auto py-1"},kt=["aria-selected","onClick","onMouseenter"],xt={key:0,class:"px-3 py-2 text-sm text-gray-400"},Bt=R(e.defineComponent({__name:"SelectInput",props:{modelValue:{type:[String,Number,Boolean,Array,null]},options:{},multiple:{type:Boolean,default:!1},searchable:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},placeholder:{default:"Select..."},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","blur"],setup(t,{emit:d}){const a=t,l=d,i=L(),r=e.ref(!1),m=e.ref(""),o=e.ref(-1),n=e.ref(null),s=e.ref(null),c=e.computed(()=>a.modelValue===null||a.modelValue===void 0?[]:Array.isArray(a.modelValue)?a.modelValue:[a.modelValue]),h=e.computed(()=>{if(c.value.length===0||a.multiple)return"";const C=a.options.find($=>$.value===c.value[0]);return(C==null?void 0:C.label)??String(c.value[0])}),b=e.computed(()=>{if(!m.value)return a.options;const C=m.value.toLowerCase();return a.options.filter($=>$.label.toLowerCase().includes(C))});function x(C){return c.value.includes(C)}function u(){a.disabled||(r.value?g():B())}function B(){r.value=!0,o.value=-1,m.value="",e.nextTick(()=>{var C;return(C=s.value)==null?void 0:C.focus()})}function g(){r.value=!1,m.value=""}function y(C){if(!C.disabled)if(a.multiple){const $=[...c.value],T=$.indexOf(C.value);T>=0?$.splice(T,1):$.push(C.value),l("update:modelValue",$)}else l("update:modelValue",C.value),g()}function N(C){if(a.disabled)return;const $=c.value.filter(T=>T!==C);l("update:modelValue",$.length?$:a.multiple?[]:null)}function w(C){C.stopPropagation(),l("update:modelValue",a.multiple?[]:null)}function f(C){if(!r.value){(C.key==="Enter"||C.key===" "||C.key==="ArrowDown")&&(C.preventDefault(),B());return}switch(C.key){case"ArrowDown":C.preventDefault(),o.value=Math.min(o.value+1,b.value.length-1);break;case"ArrowUp":C.preventDefault(),o.value=Math.max(o.value-1,0);break;case"Enter":C.preventDefault(),o.value>=0&&b.value[o.value]&&y(b.value[o.value]);break;case"Escape":C.preventDefault(),g();break}}function p(C){n.value&&!n.value.contains(C.target)&&g()}function V(C){const $=a.options.find(T=>T.value===C);return($==null?void 0:$.label)??String(C)}return e.onMounted(()=>document.addEventListener("mousedown",p)),e.onBeforeUnmount(()=>document.removeEventListener("mousedown",p)),e.watch(r,C=>{C||l("blur",new FocusEvent("blur"))}),(C,$)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:n,class:e.normalizeClass(["relative w-full",e.unref(i).classes.value.input,t.disabled?"opacity-50 cursor-not-allowed":""])},[e.createElementVNode("div",{role:"combobox","aria-expanded":r.value,"aria-haspopup":"listbox",tabindex:"0",class:e.normalizeClass(["flex min-h-[38px] w-full cursor-pointer items-center rounded-md border border-gray-300 bg-white px-3 py-1.5 text-sm","transition-colors duration-200",r.value?"ring-2 ring-blue-500/20":"",t.disabled?"pointer-events-none bg-gray-100":""]),style:e.normalizeStyle(r.value?{borderColor:"var(--fc-color-primary, #3b82f6)"}:{}),onClick:u,onKeydown:f},[e.createElementVNode("div",ut,[t.multiple?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(c.value,T=>(e.openBlock(),e.createElementBlock("span",{key:String(T),class:"inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs",style:{backgroundColor:"color-mix(in srgb, var(--fc-color-primary, #3b82f6) 15%, white)",color:"var(--fc-color-primary, #3b82f6)"}},[e.createTextVNode(e.toDisplayString(V(T))+" ",1),e.createElementVNode("button",{type:"button",class:"ml-0.5",style:{color:"var(--fc-color-primary, #3b82f6)"},"aria-label":"Remove",onClick:e.withModifiers(A=>N(T),["stop"])}," × ",8,ft)]))),128)):h.value?(e.openBlock(),e.createElementBlock("span",pt,e.toDisplayString(h.value),1)):(e.openBlock(),e.createElementBlock("span",yt,e.toDisplayString(t.placeholder),1))]),t.clearable&&c.value.length>0&&!t.disabled?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"ml-1 shrink-0 text-gray-400 hover:text-gray-600 transition-colors duration-200","aria-label":"Clear selection",onClick:w}," × ")):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["ml-1 h-4 w-4 shrink-0 text-gray-400 transition-transform duration-200",r.value?"rotate-180":""]),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[...$[1]||($[1]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z","clip-rule":"evenodd"},null,-1)])],2))],46,mt),r.value?(e.openBlock(),e.createElementBlock("div",bt,[t.searchable?(e.openBlock(),e.createElementBlock("div",gt,[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:s,"onUpdate:modelValue":$[0]||($[0]=T=>m.value=T),type:"text",class:"w-full rounded border border-gray-300 px-2 py-1 text-sm focus:outline-none fc-select-search",placeholder:"Search...",onKeydown:f},null,544),[[e.vModelText,m.value]])])):e.createCommentVNode("",!0),e.createElementVNode("ul",ht,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(T,A)=>(e.openBlock(),e.createElementBlock("li",{key:String(T.value),role:"option","aria-selected":x(T.value),class:e.normalizeClass(["cursor-pointer px-3 py-2 text-sm transition-colors duration-200",x(T.value)?"":"text-gray-900",o.value===A?"bg-gray-100":"",T.disabled?"opacity-50 cursor-not-allowed":"hover:bg-gray-50"]),style:e.normalizeStyle(x(T.value)?{backgroundColor:"color-mix(in srgb, var(--fc-color-primary, #3b82f6) 8%, white)",color:"var(--fc-color-primary, #3b82f6)"}:{}),onClick:K=>y(T),onMouseenter:K=>o.value=A},e.toDisplayString(T.label),47,kt))),128)),b.value.length===0?(e.openBlock(),e.createElementBlock("li",xt," No options found ")):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-b34f2a7d"]]),wt=["value","min","max","step","disabled","aria-valuenow","aria-valuemin","aria-valuemax","aria-disabled"],Ct={class:"mt-1 flex justify-between text-xs text-gray-400"},Vt=e.defineComponent({__name:"SliderInput",props:{modelValue:{},min:{default:0},max:{default:100},step:{default:1},showTooltip:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","blur"],setup(t,{emit:d}){const a=t,l=d;L();const i=e.ref(!1),r=e.computed(()=>{const o=a.max-a.min;return o===0?0:(a.modelValue-a.min)/o*100});function m(o){const n=o.target;l("update:modelValue",parseFloat(n.value))}return(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative w-full py-2",t.disabled?"opacity-50 cursor-not-allowed":""])},[t.showTooltip&&i.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"absolute -top-8 rounded bg-gray-800 px-2 py-1 text-xs text-white shadow-sm transition-opacity duration-200",style:e.normalizeStyle({left:`calc(${r.value}% - 16px)`})},e.toDisplayString(t.modelValue),5)):e.createCommentVNode("",!0),e.createElementVNode("input",{type:"range",value:t.modelValue,min:t.min,max:t.max,step:t.step,disabled:t.disabled,"aria-valuenow":t.modelValue,"aria-valuemin":t.min,"aria-valuemax":t.max,"aria-disabled":t.disabled||void 0,class:"h-2 w-full cursor-pointer appearance-none rounded-full bg-gray-200 focus:outline-none focus:ring-2 focus:ring-blue-500/20 disabled:pointer-events-none",style:{accentColor:"var(--fc-color-primary, #3b82f6)"},onInput:m,onMousedown:n[0]||(n[0]=s=>i.value=!0),onMouseup:n[1]||(n[1]=s=>i.value=!1),onTouchstart:n[2]||(n[2]=s=>i.value=!0),onTouchend:n[3]||(n[3]=s=>i.value=!1),onFocus:n[4]||(n[4]=s=>i.value=!0),onBlur:n[5]||(n[5]=s=>{i.value=!1,l("blur",s)})},null,40,wt),e.createElementVNode("div",Ct,[e.createElementVNode("span",null,e.toDisplayString(t.min),1),e.createElementVNode("span",null,e.toDisplayString(t.max),1)])],2))}}),Et={key:0,class:"text-sm text-gray-600"},Nt=["checked","disabled"],$t=["aria-checked","aria-disabled"],St={key:1,class:"text-sm text-gray-600"},Ft=e.defineComponent({__name:"SwitchInput",props:{modelValue:{type:Boolean},activeLabel:{},inactiveLabel:{},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","blur"],setup(t,{emit:d}){const a=t,l=d;L();const i=e.computed(()=>["inline-flex items-center gap-2 select-none",a.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"]);function r(){a.disabled||l("update:modelValue",!a.modelValue)}function m(o){(o.key===" "||o.key==="Enter")&&(o.preventDefault(),r())}return(o,n)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(i.value)},[t.inactiveLabel?(e.openBlock(),e.createElementBlock("span",Et,e.toDisplayString(t.inactiveLabel),1)):e.createCommentVNode("",!0),e.createElementVNode("input",{type:"checkbox",checked:t.modelValue,disabled:t.disabled,class:"sr-only",onChange:r,onBlur:n[0]||(n[0]=s=>l("blur",s))},null,40,Nt),e.createElementVNode("button",{type:"button",role:"switch","aria-checked":t.modelValue,"aria-disabled":t.disabled||void 0,tabindex:"0",class:e.normalizeClass(["relative inline-flex h-6 w-11 shrink-0 rounded-full border-2 border-transparent transition-colors duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)]",t.modelValue?"":"bg-gray-300",t.disabled?"pointer-events-none":"focus:outline-none focus:ring-2 focus:ring-blue-500/20"]),style:e.normalizeStyle(t.modelValue?{backgroundColor:"var(--fc-color-primary, #3b82f6)"}:{}),onClick:r,onKeydown:m},[e.createElementVNode("span",{class:e.normalizeClass(["pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow-sm transition-transform duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)]",t.modelValue?"translate-x-5":"translate-x-0"]),"aria-hidden":"true"},null,2)],46,$t),t.activeLabel?(e.openBlock(),e.createElementBlock("span",St,e.toDisplayString(t.activeLabel),1)):e.createCommentVNode("",!0)],2))}}),Dt=["onClick"],zt=["placeholder","disabled"],Tt={key:0,class:"absolute z-50 mt-1 w-full rounded-md border border-gray-200 bg-white py-1 shadow-lg",role:"listbox"},Lt=["aria-selected","onMousedown","onMouseenter"],Mt=e.defineComponent({__name:"TagsInput",props:{modelValue:{default:()=>[]},maxTags:{},suggestions:{default:()=>[]},placeholder:{default:"Add a tag..."},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","blur"],setup(t,{emit:d}){const a=t,l=e.computed(()=>Array.isArray(a.modelValue)?a.modelValue:[]),i=d,r=L(),m=e.ref(""),o=e.ref(!1),n=e.ref(!1),s=e.ref(-1),c=e.ref(null),h=e.ref(null),b=e.computed(()=>!a.maxTags||l.value.length<a.maxTags),x=e.computed(()=>{if(!m.value||a.suggestions.length===0)return[];const w=m.value.toLowerCase();return a.suggestions.filter(f=>f.toLowerCase().includes(w)&&!l.value.includes(f))});function u(w){const f=w.trim();!f||!b.value||l.value.includes(f)||(i("update:modelValue",[...l.value,f]),m.value="",n.value=!1,s.value=-1)}function B(w){if(a.disabled)return;const f=l.value.filter((p,V)=>V!==w);i("update:modelValue",f)}function g(w){if(w.key==="Enter"||w.key===","){w.preventDefault(),s.value>=0&&x.value[s.value]?u(x.value[s.value]):u(m.value);return}if(w.key==="Backspace"&&m.value===""&&l.value.length>0){B(l.value.length-1);return}if(w.key==="ArrowDown"&&n.value){w.preventDefault(),s.value=Math.min(s.value+1,x.value.length-1);return}if(w.key==="ArrowUp"&&n.value){w.preventDefault(),s.value=Math.max(s.value-1,0);return}w.key==="Escape"&&(n.value=!1,s.value=-1)}function y(){n.value=m.value.length>0&&x.value.length>0,s.value=-1}function N(w){c.value&&!c.value.contains(w.target)&&(n.value=!1)}return e.onMounted(()=>document.addEventListener("mousedown",N)),e.onBeforeUnmount(()=>document.removeEventListener("mousedown",N)),e.watch(m,()=>{e.nextTick(y)}),(w,f)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:c,class:e.normalizeClass(["relative w-full",t.disabled?"opacity-50 cursor-not-allowed":""])},[e.createElementVNode("div",{class:e.normalizeClass(["flex flex-wrap items-center gap-1.5 rounded-md border bg-white px-2 py-1.5 text-sm transition-colors duration-200",o.value?"ring-2 ring-blue-500/20":"border-gray-300",e.unref(r).classes.value.input]),style:e.normalizeStyle(o.value?{borderColor:"var(--fc-color-primary, #3b82f6)"}:{}),onClick:f[3]||(f[3]=p=>{var V;return(V=h.value)==null?void 0:V.focus()})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(p,V)=>(e.openBlock(),e.createElementBlock("span",{key:p,class:"inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs",style:{backgroundColor:"color-mix(in srgb, var(--fc-color-primary, #3b82f6) 15%, white)",color:"var(--fc-color-primary, #3b82f6)"}},[e.createTextVNode(e.toDisplayString(p)+" ",1),t.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"ml-0.5 transition-colors duration-200",style:{color:"var(--fc-color-primary, #3b82f6)"},"aria-label":"Remove tag",onClick:e.withModifiers(C=>B(V),["stop"])}," × ",8,Dt))]))),128)),e.withDirectives(e.createElementVNode("input",{ref_key:"inputRef",ref:h,"onUpdate:modelValue":f[0]||(f[0]=p=>m.value=p),type:"text",placeholder:l.value.length===0?t.placeholder:"",disabled:t.disabled,class:"min-w-[80px] flex-1 border-0 bg-transparent p-0 text-sm outline-none placeholder:text-gray-400",onKeydown:g,onFocus:f[1]||(f[1]=p=>o.value=!0),onBlur:f[2]||(f[2]=p=>{o.value=!1,i("blur",p)})},null,40,zt),[[e.vModelText,m.value]])],6),n.value&&x.value.length>0?(e.openBlock(),e.createElementBlock("ul",Tt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(p,V)=>(e.openBlock(),e.createElementBlock("li",{key:p,role:"option","aria-selected":s.value===V,class:e.normalizeClass(["cursor-pointer px-3 py-2 text-sm transition-colors duration-200",s.value!==V?"text-gray-900 hover:bg-gray-50":""]),style:e.normalizeStyle(s.value===V?{backgroundColor:"color-mix(in srgb, var(--fc-color-primary, #3b82f6) 8%, white)",color:"var(--fc-color-primary, #3b82f6)"}:{}),onMousedown:e.withModifiers(C=>u(p),["prevent"]),onMouseenter:C=>s.value=V},e.toDisplayString(p),47,Lt))),128))])):e.createCommentVNode("",!0)],2))}}),It=["value","rows","maxlength","placeholder","disabled","readonly","aria-disabled","aria-readonly"],At=R(e.defineComponent({__name:"TextareaInput",props:{modelValue:{},rows:{default:3},autoResize:{type:Boolean,default:!1},maxLength:{},placeholder:{default:""},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1}},emits:["update:modelValue","blur","focus"],setup(t,{emit:d}){const a=t,l=d,i=L(),r=e.ref(null),m=e.computed(()=>["w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm","placeholder:text-gray-400 resize-y","focus:outline-none focus:ring-2 focus:ring-blue-500/20 fc-textarea-input","transition-colors duration-200",a.disabled?"opacity-50 cursor-not-allowed bg-gray-100":"",a.autoResize?"resize-none overflow-hidden":"",i.classes.value.input].filter(Boolean).join(" "));function o(){if(!a.autoResize||!r.value)return;const s=r.value;s.style.height="auto",s.style.height=`${s.scrollHeight}px`}function n(s){const c=s.target;l("update:modelValue",c.value),a.autoResize&&e.nextTick(o)}return e.watch(()=>a.modelValue,()=>{a.autoResize&&e.nextTick(o)}),e.onMounted(()=>{a.autoResize&&o()}),(s,c)=>(e.openBlock(),e.createElementBlock("textarea",{ref_key:"textareaRef",ref:r,value:t.modelValue,rows:t.rows,maxlength:t.maxLength,placeholder:t.placeholder,disabled:t.disabled,readonly:t.readonly,class:e.normalizeClass(m.value),"aria-disabled":t.disabled||void 0,"aria-readonly":t.readonly||void 0,onInput:n,onBlur:c[0]||(c[0]=h=>l("blur",h)),onFocus:c[1]||(c[1]=h=>l("focus",h))},null,42,It))}}),[["__scopeId","data-v-67f80d90"]]),jt={key:0,class:"flex items-stretch"},vt={key:0,class:"inline-flex items-center rounded-l-md border border-r-0 border-gray-300 bg-gray-50 px-3 text-sm text-gray-500"},Rt=["type","value","placeholder","maxlength","disabled","readonly","aria-disabled","aria-readonly"],Ot={key:1,class:"inline-flex items-center rounded-r-md border border-l-0 border-gray-300 bg-gray-50 px-3 text-sm text-gray-500"},Kt=["type","value","placeholder","maxlength","disabled","readonly","aria-disabled","aria-readonly"],Pt=R(e.defineComponent({__name:"TextInput",props:{modelValue:{},inputType:{default:"text"},placeholder:{default:""},maxLength:{},prefix:{},suffix:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},mask:{}},emits:["update:modelValue","blur","focus"],setup(t,{emit:d}){const a=t,l=d,i=L(),r=e.computed(()=>!!a.prefix||!!a.suffix),m=e.computed(()=>["w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm","placeholder:text-gray-400","focus:outline-none focus:ring-2 focus:ring-blue-500/20 fc-text-input","transition-colors duration-200",a.disabled?"opacity-50 cursor-not-allowed bg-gray-100":"",a.prefix?"rounded-l-none":"",a.suffix?"rounded-r-none":"",i.classes.value.input].filter(Boolean).join(" "));function o(n){const s=n.target;l("update:modelValue",s.value)}return(n,s)=>r.value?(e.openBlock(),e.createElementBlock("div",jt,[t.prefix?(e.openBlock(),e.createElementBlock("span",vt,e.toDisplayString(t.prefix),1)):e.createCommentVNode("",!0),e.createElementVNode("input",{type:t.inputType,value:t.modelValue,placeholder:t.placeholder,maxlength:t.maxLength,disabled:t.disabled,readonly:t.readonly,class:e.normalizeClass(m.value),"aria-disabled":t.disabled||void 0,"aria-readonly":t.readonly||void 0,onInput:o,onBlur:s[0]||(s[0]=c=>l("blur",c)),onFocus:s[1]||(s[1]=c=>l("focus",c))},null,42,Rt),t.suffix?(e.openBlock(),e.createElementBlock("span",Ot,e.toDisplayString(t.suffix),1)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("input",{key:1,type:t.inputType,value:t.modelValue,placeholder:t.placeholder,maxlength:t.maxLength,disabled:t.disabled,readonly:t.readonly,class:e.normalizeClass(m.value),"aria-disabled":t.disabled||void 0,"aria-readonly":t.readonly||void 0,onInput:o,onBlur:s[2]||(s[2]=c=>l("blur",c)),onFocus:s[3]||(s[3]=c=>l("focus",c))},null,42,Kt))}}),[["__scopeId","data-v-a42b4343"]]),Ut={key:0,class:"mb-1.5 flex items-center gap-1"},Ht=["for"],Gt={key:0,class:"text-red-500 ml-0.5","aria-hidden":"true"},qt=["aria-label"],Zt={key:0,role:"tooltip",class:"absolute bottom-full left-1/2 z-10 mb-2 -translate-x-1/2 rounded-md bg-gray-900 px-3 py-1.5 text-xs text-white shadow-lg whitespace-nowrap"},_t=["id"],Yt=["id"],Wt=e.defineComponent({__name:"BaseField",props:{fieldSchema:{},fieldName:{},errors:{default:()=>[]},touched:{type:Boolean,default:!1}},setup(t){const d=t,a=e.inject(P),l=e.inject(_),i=e.ref(!1),r=e.computed(()=>{if(a){const b=a.t(d.fieldName,"label");if(b)return b}return d.fieldSchema.label??d.fieldName}),m=e.computed(()=>{if(a){const b=a.t(d.fieldName,"helpText");if(b)return b}return d.fieldSchema.helpText??""}),o=e.computed(()=>{if(a){const b=a.t(d.fieldName,"tooltip");if(b)return b}return d.fieldSchema.tooltip??""}),n=e.computed(()=>d.touched&&d.errors.length>0),s=e.computed(()=>[(l==null?void 0:l.classes.value.field)??"fc-field",d.fieldSchema.className??"",d.fieldSchema.disabled?"opacity-50 cursor-not-allowed":"",d.fieldSchema.readOnly?"fc-readonly":""]),c=e.computed(()=>`fc-field-${d.fieldName}`),h=e.computed(()=>`fc-error-${d.fieldName}`);return(b,x)=>{var u,B;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([s.value,"relative mb-4"]),style:e.normalizeStyle(t.fieldSchema.style)},[t.fieldSchema.type!=="hidden"?(e.openBlock(),e.createElementBlock("div",Ut,[e.createElementVNode("label",{for:c.value,class:e.normalizeClass([((u=e.unref(l))==null?void 0:u.classes.value.label)??"fc-label","block text-sm font-medium text-gray-700"])},[e.createTextVNode(e.toDisplayString(r.value)+" ",1),t.fieldSchema.required?(e.openBlock(),e.createElementBlock("span",Gt,"*")):e.createCommentVNode("",!0)],10,Ht),o.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:"relative inline-flex",onMouseenter:x[0]||(x[0]=g=>i.value=!0),onMouseleave:x[1]||(x[1]=g=>i.value=!1),onFocusin:x[2]||(x[2]=g=>i.value=!0),onFocusout:x[3]||(x[3]=g=>i.value=!1)},[e.createElementVNode("button",{type:"button",class:"inline-flex h-4 w-4 items-center justify-center rounded-full bg-gray-200 text-gray-500 text-xs hover:bg-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500/40","aria-label":`Info: ${o.value}`,tabindex:"0"}," i ",8,qt),e.createVNode(e.Transition,{"enter-active-class":"motion-safe:transition motion-safe:duration-200 motion-safe:ease-out","enter-from-class":"opacity-0 scale-95","enter-to-class":"opacity-100 scale-100","leave-active-class":"motion-safe:transition motion-safe:duration-150 motion-safe:ease-in","leave-from-class":"opacity-100 scale-100","leave-to-class":"opacity-0 scale-95"},{default:e.withCtx(()=>[i.value?(e.openBlock(),e.createElementBlock("div",Zt,[e.createTextVNode(e.toDisplayString(o.value)+" ",1),x[4]||(x[4]=e.createElementVNode("div",{class:"absolute left-1/2 top-full -translate-x-1/2 border-4 border-transparent border-t-gray-900"},null,-1))])):e.createCommentVNode("",!0)]),_:1})],32)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{id:c.value},[e.renderSlot(b.$slots,"default")],8,_t),e.createVNode(e.TransitionGroup,{tag:"div","enter-active-class":"motion-safe:transition-all motion-safe:duration-200 motion-safe:ease-out","enter-from-class":"opacity-0 -translate-y-1 max-h-0","enter-to-class":"opacity-100 translate-y-0 max-h-8","leave-active-class":"motion-safe:transition-all motion-safe:duration-150 motion-safe:ease-in","leave-from-class":"opacity-100 translate-y-0 max-h-8","leave-to-class":"opacity-0 -translate-y-1 max-h-0",class:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value?t.errors:[],(g,y)=>{var N;return e.openBlock(),e.createElementBlock("p",{key:g+y,id:y===0?h.value:void 0,class:e.normalizeClass([((N=e.unref(l))==null?void 0:N.classes.value.error)??"fc-error","mt-1 text-xs text-red-500"]),role:"alert"},e.toDisplayString(g),11,Yt)}),128))]),_:1}),m.value&&!n.value?(e.openBlock(),e.createElementBlock("p",{key:1,class:e.normalizeClass([((B=e.unref(l))==null?void 0:B.classes.value.helpText)??"fc-help-text","mt-1 text-xs text-gray-400"])},e.toDisplayString(m.value),3)):e.createCommentVNode("",!0)],6)}}}),Qt={key:1,class:"rounded-md border border-dashed border-amber-400 bg-amber-50 px-3 py-2 text-xs text-amber-700"},ae=e.defineComponent({__name:"FormField",props:{name:{}},setup(t){const d=t,a=e.inject(v);if(!a)throw new Error("FormField must be used inside a FormBuilder (FormContextKey not provided)");const l=e.inject(U,null),i=e.computed(()=>S.extractFields(a.schema.fields).find(u=>u.name===d.name)),r=e.computed(()=>{var g;const u=i.value;if(!u)return;const B=(g=l==null?void 0:l.value)==null?void 0:g[u.type];return B||W(u.type)}),m=e.computed(()=>a.values[d.name]),o=e.computed(()=>a.errors[d.name]??[]),n=e.computed(()=>a.touched[d.name]??!1),s=e.computed(()=>{const u=i.value;return u?u.condition?S.evaluateCondition(u.condition,a.values):typeof u.visible=="function"?u.visible({values:{...a.values},getFieldValue:B=>a.values[B]}):u.visible??!0:!1}),c=e.computed(()=>{const u=i.value;return u?typeof u.disabled=="function"?u.disabled({values:{...a.values},getFieldValue:B=>a.values[B]}):u.disabled??!1:!1}),h=e.computed(()=>{const u=i.value;if(!u)return{};const{name:B,label:g,helpText:y,tooltip:N,condition:w,translations:f,meta:p,rules:V,visible:C,className:$,style:T,defaultValue:A,...K}=u;return{...K,modelValue:m.value,disabled:c.value,readonly:u.readOnly??!1,placeholder:u.placeholder??""}});function b(u){a.setFieldValue(d.name,u)}function x(){var u;a.touched[d.name]=!0,((u=a.schema.settings)==null?void 0:u.validateOnBlur)!==!1&&a.validateField(d.name)}return(u,B)=>(e.openBlock(),e.createBlock(e.Transition,{"enter-active-class":"motion-safe:transition-all motion-safe:duration-300 motion-safe:ease-out","enter-from-class":"opacity-0 max-h-0","enter-to-class":"opacity-100 max-h-96","leave-active-class":"motion-safe:transition-all motion-safe:duration-200 motion-safe:ease-in","leave-from-class":"opacity-100 max-h-96","leave-to-class":"opacity-0 max-h-0"},{default:e.withCtx(()=>[s.value&&i.value?(e.openBlock(),e.createBlock(Wt,{key:0,"field-schema":i.value,"field-name":t.name,errors:o.value,touched:n.value},{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),e.mergeProps({key:0},h.value,{"aria-invalid":n.value&&o.value.length>0?!0:void 0,"aria-describedby":n.value&&o.value.length>0?`fc-error-${t.name}`:void 0,"onUpdate:modelValue":b,onBlur:x}),null,16,["aria-invalid","aria-describedby"])):(e.openBlock(),e.createElementBlock("div",Qt,' No component registered for field type "'+e.toDisplayString(i.value.type)+'" ',1))]),_:1},8,["field-schema","field-name","errors","touched"])):e.createCommentVNode("",!0)]),_:1}))}}),Jt={key:0,class:"relative flex justify-center"},Xt={class:"bg-white px-3 text-xs text-gray-500"},ea=e.defineComponent({__name:"FormDivider",props:{label:{},className:{}},setup(t){return(d,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([t.className??"","relative my-4"]),role:"separator"},[a[0]||(a[0]=e.createElementVNode("div",{class:"absolute inset-0 flex items-center","aria-hidden":"true"},[e.createElementVNode("div",{class:"w-full border-t border-gray-200"})],-1)),t.label?(e.openBlock(),e.createElementBlock("div",Jt,[e.createElementVNode("span",Xt,e.toDisplayString(t.label),1)])):e.createCommentVNode("",!0)],2))}}),ta=["aria-labelledby"],aa={key:0,class:"border-b border-gray-100 px-4 py-3"},la=["id"],oa={key:1,class:"mt-0.5 text-xs text-gray-500"},na=["id"],ra=e.defineComponent({__name:"FormGroup",props:{title:{},description:{},collapsible:{type:Boolean,default:!1},collapsed:{type:Boolean,default:!1},children:{},className:{}},setup(t){const d=t,a=e.ref(d.collapsed);function l(){d.collapsible&&(a.value=!a.value)}const i=e.computed(()=>d.title?`fc-group-${d.title.toLowerCase().replace(/\s+/g,"-")}`:void 0);return(r,m)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass([[t.className??""],"rounded-lg border border-gray-200 bg-white"]),"aria-labelledby":i.value},[t.title||t.description?(e.openBlock(),e.createElementBlock("div",aa,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.collapsible?"button":"div"),{type:t.collapsible?"button":void 0,class:e.normalizeClass(["flex w-full items-center justify-between text-left",t.collapsible?"cursor-pointer focus:outline-none focus:ring-2 focus:ring-blue-500/40 rounded":""]),"aria-expanded":t.collapsible?!a.value:void 0,"aria-controls":t.collapsible?`fc-group-body-${i.value}`:void 0,onClick:l},{default:e.withCtx(()=>[e.createElementVNode("div",null,[t.title?(e.openBlock(),e.createElementBlock("legend",{key:0,id:i.value,class:"text-sm font-semibold text-gray-800"},e.toDisplayString(t.title),9,la)):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createElementBlock("p",oa,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),t.collapsible?(e.openBlock(),e.createElementBlock("svg",{key:0,class:e.normalizeClass(["h-4 w-4 shrink-0 text-gray-400 motion-safe:transition-transform motion-safe:duration-200",a.value?"":"rotate-180"]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[...m[0]||(m[0]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z","clip-rule":"evenodd"},null,-1)])],2)):e.createCommentVNode("",!0)]),_:1},8,["type","class","aria-expanded","aria-controls"]))])):e.createCommentVNode("",!0),e.createVNode(e.Transition,{"enter-active-class":"motion-safe:transition-all motion-safe:duration-300 motion-safe:ease-out","enter-from-class":"max-h-0 opacity-0 overflow-hidden","enter-to-class":"max-h-[2000px] opacity-100 overflow-hidden","leave-active-class":"motion-safe:transition-all motion-safe:duration-200 motion-safe:ease-in","leave-from-class":"max-h-[2000px] opacity-100 overflow-hidden","leave-to-class":"max-h-0 opacity-0 overflow-hidden"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{id:t.collapsible?`fc-group-body-${i.value}`:void 0,class:"p-4"},[e.createVNode(O,{nodes:t.children},null,8,["nodes"])],8,na),[[e.vShow,!a.value]])]),_:1})],10,ta))}}),sa=["innerHTML"],ia=e.defineComponent({__name:"FormHtml",props:{content:{},className:{}},setup(t){const d=t,a=e.computed(()=>S.sanitizeHtml(d.content));return(l,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([t.className??"","fc-html prose prose-sm max-w-none text-gray-700"]),innerHTML:a.value},null,10,sa))}}),ca=e.defineComponent({__name:"FormRow",props:{children:{},gap:{},align:{default:"stretch"},className:{}},setup(t){const d=t,a=e.computed(()=>({start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"})[d.align]??"items-stretch"),l=e.computed(()=>d.gap?typeof d.gap=="number"?`${d.gap}px`:d.gap:"");return(i,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["grid grid-cols-12",[a.value,t.className??""]]),style:e.normalizeStyle(l.value?{gap:l.value}:{gap:"1rem"}),role:"group"},[e.createVNode(O,{nodes:t.children},null,8,["nodes"])],6))}}),da={"aria-label":"Form steps",class:"flex items-center justify-center"},ma={class:"flex items-center gap-0"},ua=["disabled","aria-current","aria-label","onClick"],fa={key:0,class:"h-4 w-4 motion-safe:transition-transform motion-safe:duration-200",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},pa={key:1},ya={key:0,class:"text-center"},ba={class:"text-base font-semibold text-gray-800"},ga={key:0,class:"mt-1 text-sm text-gray-500"},ha={class:"flex items-center justify-between border-t border-gray-100 pt-4"},ka=["disabled"],xa={class:"text-xs text-gray-400"},Ba={key:1,class:"w-[72px]"},wa=e.defineComponent({__name:"FormSteps",props:{steps:{},linear:{type:Boolean,default:!1},className:{}},setup(t){const d=t,a=e.inject(v),l=e.ref(0),i=e.ref(new Set),r=e.computed(()=>d.steps),m=e.computed(()=>r.value.length),o=e.computed(()=>l.value===0),n=e.computed(()=>l.value===m.value-1);function s(u){const B=[];function g(y){for(const N of y)if(S.isFieldNode(N))B.push(N.name);else if(N.type==="row"||N.type==="group")g(N.children);else if(N.type==="steps")for(const w of N.steps)g(w.children);else if(N.type==="tabs")for(const w of N.tabs)g(w.children)}return g(u.children),B}async function c(){if(!a||!d.linear)return!0;const u=r.value[l.value];if(!u)return!0;const B=s(u);let g=!0;for(const y of B){const N=await a.validateField(y);a.touched[y]=!0,N.length>0&&(g=!1)}return g}async function h(){n.value||d.linear&&!await c()||(i.value.add(l.value),l.value++)}function b(){o.value||l.value--}function x(u){d.linear&&u>l.value||(l.value=u)}return(u,B)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([t.className??"","space-y-6"])},[e.createElementVNode("nav",da,[e.createElementVNode("ol",ma,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(g,y)=>(e.openBlock(),e.createElementBlock("li",{key:y,class:"flex items-center"},[e.createElementVNode("button",{type:"button",disabled:t.linear&&y>l.value,"aria-current":y===l.value?"step":void 0,"aria-label":`Step ${y+1}: ${g.title}`,class:e.normalizeClass(["relative flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 text-xs font-semibold motion-safe:transition-all motion-safe:duration-300 focus:outline-none focus:ring-2 focus:ring-blue-500/40",[i.value.has(y)&&y!==l.value?"border-green-500 bg-green-500 text-white":y!==l.value?"border-gray-300 bg-white text-gray-500":"text-white",t.linear&&y>l.value?"cursor-not-allowed":"cursor-pointer hover:shadow-md"]]),style:e.normalizeStyle(y===l.value?{borderColor:"var(--fc-color-primary, #3b82f6)",backgroundColor:"var(--fc-color-primary, #3b82f6)"}:{}),onClick:N=>x(y)},[i.value.has(y)&&y!==l.value?(e.openBlock(),e.createElementBlock("svg",fa,[...B[0]||(B[0]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z","clip-rule":"evenodd"},null,-1)])])):(e.openBlock(),e.createElementBlock("span",pa,e.toDisplayString(y+1),1))],14,ua),y<r.value.length-1?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["mx-1 h-0.5 w-8 motion-safe:transition-colors motion-safe:duration-300 sm:w-12",i.value.has(y)?"bg-green-500":"bg-gray-200"])},null,2)):e.createCommentVNode("",!0)]))),128))])]),r.value[l.value]?(e.openBlock(),e.createElementBlock("div",ya,[e.createElementVNode("h3",ba,e.toDisplayString(r.value[l.value].title),1),r.value[l.value].description?(e.openBlock(),e.createElementBlock("p",ga,e.toDisplayString(r.value[l.value].description),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createVNode(e.Transition,{mode:"out-in","enter-active-class":"motion-safe:transition-all motion-safe:duration-200 motion-safe:ease-out","enter-from-class":"opacity-0 translate-x-2","enter-to-class":"opacity-100 translate-x-0","leave-active-class":"motion-safe:transition-all motion-safe:duration-150 motion-safe:ease-in","leave-from-class":"opacity-100 translate-x-0","leave-to-class":"opacity-0 -translate-x-2"},{default:e.withCtx(()=>[r.value[l.value]?(e.openBlock(),e.createElementBlock("div",{key:l.value},[e.createVNode(O,{nodes:r.value[l.value].children},null,8,["nodes"])])):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",ha,[e.createElementVNode("button",{type:"button",disabled:o.value,class:"rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 motion-safe:transition-colors motion-safe:duration-150 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500/40 disabled:cursor-not-allowed disabled:opacity-50 fc-steps-prev-btn",onClick:b}," Previous ",8,ka),e.createElementVNode("span",xa,e.toDisplayString(l.value+1)+" / "+e.toDisplayString(m.value),1),n.value?(e.openBlock(),e.createElementBlock("div",Ba)):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"rounded-md px-4 py-2 text-sm font-medium text-white motion-safe:transition-colors motion-safe:duration-150 focus:outline-none focus:ring-2 focus:ring-blue-500/40 fc-steps-next-btn",style:{backgroundColor:"var(--fc-color-primary, #3b82f6)"},onClick:h}," Next "))])],2))}}),Ca={class:"relative flex border-b border-gray-200",role:"tablist","aria-orientation":"horizontal"},Va=["id","aria-selected","aria-controls","aria-disabled","tabindex","onClick","onKeydown"],Ea={key:0,class:"absolute inset-x-0 -bottom-px h-0.5 motion-safe:transition-all motion-safe:duration-200",style:{backgroundColor:"var(--fc-color-primary, #3b82f6)"}},Na=["id","aria-labelledby"],$a=e.defineComponent({__name:"FormTabs",props:{tabs:{},className:{}},setup(t){const d=t,a=e.ref(0),l=e.computed(()=>d.tabs);function i(o){const n=l.value[o];n!=null&&n.disabled||(a.value=o)}function r(o,n){var b;const s=l.value.length;let c=n;if(o.key==="ArrowRight"||o.key==="ArrowDown")o.preventDefault(),c=(n+1)%s;else if(o.key==="ArrowLeft"||o.key==="ArrowUp")o.preventDefault(),c=(n-1+s)%s;else if(o.key==="Home")o.preventDefault(),c=0;else if(o.key==="End")o.preventDefault(),c=s-1;else return;for(;(b=l.value[c])!=null&&b.disabled&&c!==n;)o.key==="ArrowLeft"||o.key==="ArrowUp"?c=(c-1+s)%s:c=(c+1)%s;i(c);const h=document.getElementById(`fc-tab-${c}`);h==null||h.focus()}const m=e.computed(()=>`fc-tabpanel-${a.value}`);return(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(t.className??"")},[e.createElementVNode("div",Ca,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(s,c)=>(e.openBlock(),e.createElementBlock("button",{key:c,id:`fc-tab-${c}`,type:"button",role:"tab","aria-selected":c===a.value,"aria-controls":m.value,"aria-disabled":s.disabled||void 0,tabindex:c===a.value?0:-1,class:e.normalizeClass(["relative px-4 py-2.5 text-sm font-medium motion-safe:transition-colors motion-safe:duration-150 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue-500/40",[c!==a.value?s.disabled?"cursor-not-allowed text-gray-300":"text-gray-500 hover:text-gray-700":""]]),style:e.normalizeStyle(c===a.value?{color:"var(--fc-color-primary, #3b82f6)"}:{}),onClick:h=>i(c),onKeydown:h=>r(h,c)},[e.createTextVNode(e.toDisplayString(s.title)+" ",1),c===a.value?(e.openBlock(),e.createElementBlock("span",Ea)):e.createCommentVNode("",!0)],46,Va))),128))]),e.createVNode(e.Transition,{mode:"out-in","enter-active-class":"motion-safe:transition-all motion-safe:duration-200 motion-safe:ease-out","enter-from-class":"opacity-0 translate-y-1","enter-to-class":"opacity-100 translate-y-0","leave-active-class":"motion-safe:transition-all motion-safe:duration-150 motion-safe:ease-in","leave-from-class":"opacity-100 translate-y-0","leave-to-class":"opacity-0 -translate-y-1"},{default:e.withCtx(()=>[l.value[a.value]?(e.openBlock(),e.createElementBlock("div",{key:a.value,id:m.value,role:"tabpanel","aria-labelledby":`fc-tab-${a.value}`,tabindex:"0",class:"pt-4"},[e.createVNode(O,{nodes:l.value[a.value].children},null,8,["nodes"])],8,Na)):e.createCommentVNode("",!0)]),_:1})],2))}}),O=e.defineComponent({__name:"LayoutRenderer",props:{nodes:{}},setup(t){const d=e.inject(v);function a(i){return d?S.evaluateCondition(i.condition,d.values):!0}function l(i){return i==="full"?{gridColumn:"1 / -1"}:i==="auto"?{gridColumn:"auto"}:typeof i=="number"?{gridColumn:`span ${i} / span ${i}`}:{gridColumn:"span 12 / span 12"}}return(i,r)=>{const m=e.resolveComponent("LayoutRenderer",!0);return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.nodes,(o,n)=>{var s;return e.openBlock(),e.createElementBlock(e.Fragment,{key:n},[e.unref(S.isFieldNode)(o)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(o.className??""),style:e.normalizeStyle(l(o.span))},[e.createVNode(ae,{name:o.name},null,8,["name"])],6)):o.type==="field"?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(o.className??""),style:e.normalizeStyle(l(o.span))},[e.createVNode(ae,{name:o.name},null,8,["name"])],6)):o.type==="row"?(e.openBlock(),e.createBlock(ca,{key:2,children:o.children,gap:o.gap,align:o.align,"class-name":o.className},null,8,["children","gap","align","class-name"])):o.type==="group"?(e.openBlock(),e.createBlock(ra,{key:3,title:o.title,description:o.description,collapsible:o.collapsible,collapsed:o.collapsed,children:o.children,"class-name":o.className},null,8,["title","description","collapsible","collapsed","children","class-name"])):o.type==="steps"?(e.openBlock(),e.createBlock(wa,{key:4,steps:o.steps,linear:o.linear,"class-name":o.className},null,8,["steps","linear","class-name"])):o.type==="tabs"?(e.openBlock(),e.createBlock($a,{key:5,tabs:o.tabs,"class-name":o.className},null,8,["tabs","class-name"])):o.type==="divider"?(e.openBlock(),e.createBlock(ea,{key:6,label:o.label,"class-name":o.className},null,8,["label","class-name"])):o.type==="html"?(e.openBlock(),e.createBlock(ia,{key:7,content:o.content,"class-name":o.className},null,8,["content","class-name"])):o.type==="conditional"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:8},[a(o)?(e.openBlock(),e.createBlock(m,{key:0,nodes:o.children},null,8,["nodes"])):(s=o.elseChildren)!=null&&s.length?(e.openBlock(),e.createBlock(m,{key:1,nodes:o.elseChildren},null,8,["nodes"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64)}),128)}}}),Sa={key:0,class:"mb-6"},Fa={key:0,class:"text-lg font-semibold text-gray-900"},Da={key:1,class:"mt-1 text-sm text-gray-500"},za={class:"mt-6 flex items-center gap-3"},Ta=["disabled"],La={key:0,class:"mr-2 inline-block h-3.5 w-3.5 animate-spin rounded-full border-2 border-white border-t-transparent","aria-hidden":"true"},Ma=["disabled"],Ia=e.defineComponent({__name:"FormBuilder",props:{schema:{},layout:{},locale:{},fallbackLocale:{},modelValue:{},theme:{},components:{}},emits:["submit","error","update:modelValue"],setup(t,{expose:d,emit:a}){const l=t,i=a,r=e.inject(G,void 0),m=e.computed(()=>l.theme??(r==null?void 0:r.theme)),o=e.computed(()=>l.locale??(r==null?void 0:r.locale)??"en"),n=e.computed(()=>l.fallbackLocale??(r==null?void 0:r.fallbackLocale)??"en"),s=e.computed(()=>l.components??(r==null?void 0:r.components)??{}),c=[["text",Pt],["number",Ge],["textarea",At],["select",Bt],["checkbox",$e],["checkbox-group",we],["radio",dt],["switch",Ft],["date",De],["file",Re],["slider",Vt],["tags",Mt],["phone",nt]];for(const[f,p]of c)Q(f)||H(f,p);e.provide(U,s),be(m);const h=L(),b=te(l.schema,{locale:o.value,fallbackLocale:n.value});if(l.modelValue)for(const[f,p]of Object.entries(l.modelValue))b.setFieldValue(f,p);e.watch(()=>l.modelValue,f=>{if(f)for(const[p,V]of Object.entries(f))b.values[p]!==V&&b.setFieldValue(p,V)},{deep:!0}),e.watch(()=>({...b.values}),f=>{i("update:modelValue",f)},{deep:!0}),e.watch(o,f=>{f&&b.setLocale(f)}),X();const x=e.computed(()=>{var C,$;const f=l.schema.translations;if(!f)return"";const p=f[o.value];if((C=p==null?void 0:p.messages)!=null&&C.title)return p.messages.title;const V=f[n.value];return(($=V==null?void 0:V.messages)==null?void 0:$.title)??""}),u=e.computed(()=>{var C,$;const f=l.schema.translations;if(!f)return"";const p=f[o.value];if((C=p==null?void 0:p.messages)!=null&&C.description)return p.messages.description;const V=f[n.value];return(($=V==null?void 0:V.messages)==null?void 0:$.description)??""}),B=e.computed(()=>{const f=l.schema.translations;if(!f)return"Submit";const p=f[o.value];if(p!=null&&p.submit)return p.submit;const V=f[n.value];return(V==null?void 0:V.submit)??"Submit"}),g=e.computed(()=>{const f=l.schema.translations;if(!f)return"Reset";const p=f[o.value];if(p!=null&&p.reset)return p.reset;const V=f[n.value];return(V==null?void 0:V.reset)??"Reset"}),y=e.computed(()=>{var f,p;return(p=(f=l.layout)==null?void 0:f.nodes)!=null&&p.length?l.layout.nodes:l.schema.fields});async function N(){try{await b.submit(async f=>{i("submit",f)})}catch(f){i("error",f)}}function w(){b.reset()}return d({form:b}),(f,p)=>(e.openBlock(),e.createElementBlock("form",{class:e.normalizeClass([e.unref(h).classes.value.form,"fc-form-builder"]),style:e.normalizeStyle(e.unref(h).cssVars.value),novalidate:"",onSubmit:e.withModifiers(N,["prevent"]),onReset:e.withModifiers(w,["prevent"])},[x.value||u.value?(e.openBlock(),e.createElementBlock("div",Sa,[x.value?(e.openBlock(),e.createElementBlock("h2",Fa,e.toDisplayString(x.value),1)):e.createCommentVNode("",!0),u.value?(e.openBlock(),e.createElementBlock("p",Da,e.toDisplayString(u.value),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createVNode(O,{nodes:y.value},null,8,["nodes"]),e.createElementVNode("div",za,[e.createElementVNode("button",{type:"submit",disabled:e.unref(b).isSubmitting.value,class:e.normalizeClass([e.unref(h).classes.value.button,"fc-submit-btn rounded-md px-4 py-2 text-sm font-medium text-white motion-safe:transition-colors motion-safe:duration-150 focus:outline-none focus:ring-2 focus:ring-blue-500/40 disabled:cursor-not-allowed disabled:opacity-50"]),style:{"background-color":"var(--fc-color-primary, #3b82f6)"}},[e.unref(b).isSubmitting.value?(e.openBlock(),e.createElementBlock("span",La)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(B.value),1)],10,Ta),e.createElementVNode("button",{type:"reset",disabled:e.unref(b).isSubmitting.value,class:"rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 motion-safe:transition-colors motion-safe:duration-150 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500/40 disabled:cursor-not-allowed disabled:opacity-50"},e.toDisplayString(g.value),9,Ma)])],38))}});z.FormBuilder=Ia,z.FormComponentsKey=U,z.FormContextKey=v,z.FormI18nKey=P,z.FormaticaKey=G,z.createFormatica=re,z.getFieldComponent=W,z.getRegisteredFieldTypes=ne,z.hasFieldType=Q,z.registerFieldType=H,z.unregisterFieldType=oe,z.useForm=te,z.useFormI18n=J,z.useFormI18nContext=X,Object.keys(S).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(z,t)&&Object.defineProperty(z,t,{enumerable:!0,get:()=>S[t]})}),Object.defineProperty(z,Symbol.toStringTag,{value:"Module"})});
|
|
2
2
|
//# sourceMappingURL=formatica.umd.cjs.map
|