react-luna-form 0.0.85 → 0.0.87
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/README.md +15 -10
- package/dist/client/cjs/index.js +2 -1
- package/dist/client/esm/index.js +2 -1
- package/dist/config/cjs/index.js +1 -1
- package/dist/config/esm/index.js +1 -1
- package/dist/schema/cjs/index.js +1 -1
- package/dist/schema/esm/index.js +1 -1
- package/dist/server/cjs/index.js +1 -1
- package/dist/server/esm/index.js +1 -1
- package/dist/types/luna-core/type.d.ts +30 -16
- package/dist/types/luna-core/util/build.d.ts +3 -1
- package/dist/types/luna-core/util/extract.d.ts +22 -0
- package/dist/types/luna-core/util/is-input.d.ts +13 -0
- package/dist/types/luna-core/util/prepare.d.ts +1 -1
- package/dist/types/luna-core/util/schema.d.ts +5 -5
- package/dist/types/luna-react/src/client/component/field/field-preview.d.ts +4 -2
- package/dist/types/luna-react/src/{component → client/component}/field/field-set-advanced.d.ts +1 -1
- package/dist/types/luna-react/src/client/component/field/field-set.d.ts +11 -0
- package/dist/types/luna-react/src/client/component/field/field.d.ts +37 -9
- package/dist/types/luna-react/src/client/component/field-description.d.ts +2 -0
- package/dist/types/luna-react/src/{component → client/component}/formatted-description.d.ts +2 -2
- package/dist/types/luna-react/src/client/component/input-strategies.d.ts +1 -1
- package/dist/types/luna-react/src/client/context/failed-submit-context.d.ts +3 -0
- package/dist/types/luna-react/src/client/context/reveal-context.d.ts +1 -0
- package/dist/types/luna-react/src/client/hook/use-disclosure.d.ts +1 -0
- package/dist/types/luna-react/src/client/hook/use-entry-atom.d.ts +18 -0
- package/dist/types/luna-react/src/client/hook/use-form-action.d.ts +2 -1
- package/dist/types/luna-react/src/client/hook/use-host-entry.d.ts +17 -0
- package/dist/types/luna-react/src/client/hook/use-input-core.d.ts +6 -8
- package/dist/types/luna-react/src/client/hook/use-input.d.ts +1 -1
- package/dist/types/luna-react/src/client/hook/use-latest.d.ts +22 -0
- package/dist/types/luna-react/src/client/hook/use-live-item-value.d.ts +17 -3
- package/dist/types/luna-react/src/client/hook/use-schema.d.ts +4 -2
- package/dist/types/luna-react/src/client/hook/use-value.d.ts +3 -3
- package/dist/types/luna-react/src/client/lib/compose-list-value.d.ts +29 -2
- package/dist/types/luna-react/src/client/lib/error-store.d.ts +3 -1
- package/dist/types/luna-react/src/client/lib/host-value-store.d.ts +28 -0
- package/dist/types/luna-react/src/client/lib/list-store.d.ts +6 -4
- package/dist/types/luna-react/src/client/lib/resolve-value.d.ts +0 -5
- package/dist/types/luna-react/src/client/lib/source-store.d.ts +7 -1
- package/dist/types/luna-react/src/client/lib/state-store.d.ts +0 -1
- package/dist/types/luna-react/src/client/lib/store-helper.d.ts +5 -7
- package/dist/types/luna-react/src/client/lib/value-store.d.ts +0 -1
- package/dist/types/luna-react/src/component/collapsible.d.ts +2 -1
- package/dist/types/luna-react/src/component/column.d.ts +2 -0
- package/dist/types/luna-react/src/component/description.d.ts +9 -0
- package/dist/types/luna-react/src/component/field/{field-set.d.ts → field-set-static.d.ts} +1 -1
- package/dist/types/luna-react/src/component/field/field.d.ts +1 -1
- package/dist/types/luna-react/src/component/field-description.d.ts +3 -2
- package/dist/types/luna-react/src/component/form.d.ts +11 -0
- package/dist/types/luna-react/src/component/input/input-base.d.ts +1 -0
- package/dist/types/luna-react/src/component/input-group.d.ts +2 -0
- package/dist/types/luna-react/src/component/input-label.d.ts +2 -0
- package/dist/types/luna-react/src/component/slot/slot-base.d.ts +2 -0
- package/dist/types/luna-react/src/lib/visibility.d.ts +3 -0
- package/dist/types/luna-react/src/server/component/field.d.ts +2 -0
- package/dist/types/luna-react/src/server/component/list-slot.d.ts +2 -0
- package/dist/types/luna-react/src/server/component/slot.d.ts +15 -0
- package/dist/types/luna-react/src/type.d.ts +1 -0
- package/docs/events/change.md +21 -7
- package/docs/fields/custom-inputs.md +4 -0
- package/docs/fields/input.md +9 -3
- package/docs/fields/list.md +2 -0
- package/docs/fields/specialized-selectors.md +4 -0
- package/docs/forms/submit.md +14 -8
- package/docs/setup.md +39 -19
- package/docs/structure/sections.md +3 -1
- package/docs/validation/overview.md +10 -1
- package/package.json +7 -7
- package/dist/types/luna-react/src/client/component/field/field-with-state.d.ts +0 -13
package/dist/server/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var he=Object.defineProperty;var Vr=Object.getOwnPropertyDescriptor;var Br=Object.getOwnPropertyNames;var Hr=Object.prototype.hasOwnProperty;var Gr=(e,t)=>{for(var n in t)he(e,n,{get:t[n],enumerable:!0})},Ur=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Br(t))!Hr.call(e,o)&&o!==n&&he(e,o,{get:()=>t[o],enumerable:!(r=Vr(t,o))||r.enumerable});return e};var $r=e=>Ur(he({},"__esModule",{value:!0}),e);var Go={};Gr(Go,{Fallback:()=>zr,Form:()=>be});module.exports=$r(Go);var Ze=require("react/jsx-runtime");function We(e){let t=typeof e.children=="function"?e.children({isPending:e.isPending}):e.children;return(0,Ze.jsx)("div",{"data-slot":"field-control",className:"w-full",children:t})}var Te=require("react/jsx-runtime");function L(e){return(0,Te.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:`size-4 transition-transform duration-200 ${e.expanded?"rotate-90":""}`,children:(0,Te.jsx)("path",{fillRule:"evenodd",d:"M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})})}var Qe=require("react");var qe=require("react"),Je=(0,qe.createContext)(!1);var Ae=require("react/jsx-runtime");function V({children:e,visible:t}){return(0,Ae.jsx)(Qe.Activity,{mode:t?"visible":"hidden",children:(0,Ae.jsx)(Je,{value:!0,children:e})})}var J="input",je="input/date",et="input/email",tt="input/number",nt="input/time";var rt="textarea",ot="radio",it="checkbox",Fe="list",lt="select",at="select/active",st="select/day",ct="select/month",dt="select/timezone",ut="select/year";var ft="chips",mt="chips/day",gt="chips/month",B="column",pt="description",Ce="fields",yt="label",Se="value",Q="options",Ne="email",xt="number",bt="password",Rt="tel",H="text",ht="aria-errormessage",Tt="aria-invalid",At="data-invalid",Ft="data-readonly",Ct="aria",St="data",Nt="max",vt="maxLength",wt="min",It="minLength",E="$ref";var kt="type",Lt={Africa:"Africa",America:"Americas",Asia:"Asia / Pacific",Atlantic:"Atlantic",Australia:"Asia / Pacific",Europe:"Europe",Indian:"Asia / Pacific",Pacific:"Asia / Pacific"};var g=require("date-fns"),w=require("date-fns/locale");function f(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function y(e){return d(e)||typeof e=="number"||Yr(e)}function Et(e){return Array.isArray(e)&&e.every(y)}function d(e){return typeof e=="string"}function Yr(e){return typeof e=="boolean"}var Ot={en:w.enUS,"en-US":w.enUS,es:w.es,"es-ES":w.es,"es-MX":w.es},Xr={short:"M/d/yy",medium:"MMM d, yyyy",long:"MMMM d, yyyy",full:"EEEE, MMMM d, yyyy"},Kr={ms:1,s:1e3,min:6e4,h:36e5,d:864e5};function Dt(e){if(e)return Ot[e]??Ot[e.split("-")[0]]}function j(e){if(typeof e=="number"&&!Number.isNaN(e))return e;if(d(e)&&e.trim()!==""){let t=Number(e);return Number.isNaN(t)?null:t}return null}function Pt(e,t,n){let r=Kr[t];if(r===void 0)return String(e);let o=e*r,i=(0,g.intervalToDuration)({start:0,end:o});return(0,g.formatDuration)(i,{locale:n})}function Mt(e){if(e instanceof Date)return(0,g.isValid)(e)?e:null;if(d(e)){let t=(0,g.parseISO)(e);if((0,g.isValid)(t))return t;let n=new Date(e);return(0,g.isValid)(n)?n:null}if(typeof e=="number"){let t=new Date(e);return(0,g.isValid)(t)?t:null}return null}var Wr={currency:(e,t,n)=>{let r=j(e);if(r===null)return String(e);let o=t[0]??"USD";return new Intl.NumberFormat(n.locale,{style:"currency",currency:o}).format(r)},percent:(e,t,n)=>{let r=j(e);return r===null?String(e):new Intl.NumberFormat(n.locale,{style:"percent"}).format(r)},number:(e,t,n)=>{let r=j(e);return r===null?String(e):new Intl.NumberFormat(n.locale).format(r)},date:(e,t,n)=>{let r=Mt(e);if(!r)return String(e);let o=t[0]??"short",i=Dt(n.locale);if(o==="relative")return(0,g.formatDistanceToNow)(r,{addSuffix:!0,locale:i});let l=Xr[o]??o;return(0,g.format)(r,l,{locale:i})},duration:(e,t,n)=>{let r=Dt(n.locale);if(typeof e=="number")return Pt(e,t[0]??"ms",r);if(d(e)){let i=j(e);if(i!==null)return Pt(i,t[0]??"ms",r)}let o=Mt(e);return o?(0,g.formatDistanceToNow)(o,{addSuffix:!0,locale:r}):String(e)}};function _t(e,t,n){let r=t.split(":").map(a=>a.trim()).filter(a=>a.length>0);if(r.length===0)return;let[o,...i]=r,l=Wr[o];if(l)return l(e,i,n)}function zt(e,t=Se){if(e!=null){if(Et(e)||y(e))return e;if(f(e)){let n=Zr(e,t);if(y(n))return n}}}function Zr(e,t){let n=x(e,t);if(y(n))return n}function x(e,t){if(!t||!f(e))return null;let n=t.split(".").filter(o=>o!=="");if(n.length===0)return null;let r=e;for(let o of n)if(f(r)&&o in r)r=r[o];else if(Array.isArray(r)){let i=Number(o);if(!Number.isInteger(i)||i<0||i>=r.length)return null;r=r[i]}else return null;return r}function Vt(e,t={description:pt,label:yt,value:Se}){return e.map(n=>{if(f(n)){let r=x(n,t.label),o=x(n,t.value);if(y(r)&&y(o)){let i=x(n,t.description);return{label:`${r}`,value:`${o}`,...y(i)&&{description:`${i}`}}}}return n})}function Bt(e=H){let t=e.lastIndexOf("/"),n=t===-1?e:e.slice(t+1);return n&&n!==J?n.trim().toLowerCase():H}var qr=/\[([^\]]{1,500})\]\(([^)]{1,2000})\)/g,Jr=/{([^}]{1,200})}/,Qr=/{([^}]{1,200})}/g;function G(e,t={},n={}){if(d(e))return eo(e,t,n);if(Array.isArray(e))return e.map(r=>G(r,t,n));if(f(e)){let r={};for(let o in e)r[o]=G(e[o],t,n);return r}return e}function U(e,t={},n={}){return ve(e)?G(e,t,n):e}function ve(e){return d(e)?Jr.test(e):Array.isArray(e)?e.some(t=>ve(t)):f(e)?Object.values(e).some(t=>ve(t)):!1}function jr(e,t){return t.includes(".")?x(e,t):e[t]}function eo(e,t={},n={}){return e.replace(Qr,(r,o)=>{let i=String(o).split("|").map(p=>p.trim()),[l,...a]=i;if(!l)return r;let s=jr(t,l);if(a.length===0)return y(s)?String(s):r;if(s==null)return r;let u=s;for(let p of a){let q=_t(u,p,{locale:n.locale});if(q===void 0)return r;u=q}return String(u)})}function Ht(e,t){if(!d(e)||!e||e.trim().length===0)return null;let n,r=0,o=!1,i=[];for(;(n=qr.exec(e))!==null;){let[l,a,s]=n,u=n.index;o=!0,u>r&&i.push(e.substring(r,u));let p=t?t(u,s,a):l;i.push(p),r=u+l.length}return o?(r<e.length&&i.push(e.substring(r)),i):e}var Gt=e=>m(at)(e),Ut=e=>m(st)(e),$t=e=>m(ct)(e),Yt=e=>m(ut)(e),Xt=e=>m(dt)(e),Kt=e=>m(mt)(e),Wt=e=>m(gt)(e),Zt=m(je),we=m(nt),b=m(it),O=m(ft),I=m(ot),qt=m(J),C=m(lt),Jt=m(rt),Qt=m(H,Ne,bt,Rt),si=m(et,Ne),jt=m(tt,xt);function en(e){return I(e)||b(e)}function ee(e){return e.type===Fe}function D(e){return e.type===B}function te(e){return e.type!==B&&e.type!==Fe}function Ie(e){return C(e)||I(e)||O(e)}function $(e){return e!=null&&e!==""}function m(...e){return t=>{let n=d(t.type)?t.type:void 0;return n?e.some(r=>n===r||n?.startsWith(`${r}/`)):!1}}function tn(e,t={}){if(C(e)&&e.disabled){let n=e.name?t?.[e.name]:void 0;if(n&&f(n))return[n]}}function nn(e){return I(e)||b(e)?!0:e.advanced?.horizontal}function rn(e){return b(e)?e.advanced?.reverse!==!1:!1}function on(e,t){let n=e.readonly??!1;return t||n}function ke(e){if(to(e)){let t=e.source;if(Array.isArray(t)||f(t)&&!(E in t))return t}}function ln(e){return Array.isArray(ke(e))}function to(e){return I(e)||O(e)||C(e)&&!e.disabled}var T=require("date-fns"),no=/^\d+$/,cn=new Date(2e3,0,1),ro=()=>"supportedValuesOf"in Intl?Intl.supportedValuesOf("timeZone"):[],Le="default";function dn(e){if(!e)return Le;try{return Intl.getCanonicalLocales(e)[0]??Le}catch{return Le}}function Ee(e){let t=dn(e);return Array.from({length:12},(n,r)=>({value:(r+1).toString(),label:new Date(0,r).toLocaleString(t,{month:"long"})}))}function Oe(e){let t=dn(e);return Array.from({length:7},(n,r)=>({value:r.toString(),label:new Date(2e3,0,2+r).toLocaleString(t,{weekday:"long"})}))}function un(e,t){return t>=e?Array.from({length:t-e+1},(n,r)=>{let o=e+r;return{value:o.toString(),label:o.toString()}}):[]}function De(){return new Date().getFullYear()}function oo(){return Intl.DateTimeFormat().resolvedOptions().timeZone}function io(e){let t=e.indexOf("/"),n=t===-1?e:e.slice(0,t);return Lt[n]??"Other"}function lo(e,t){return(e.find(r=>r.type==="timeZoneName")?.value??t).replace(/\s+(?:Standard|Daylight(?: Saving)?|Summer|Winter)\s+Time$/,"")}function an(e,t){let n=new Intl.DateTimeFormat("en",{timeZone:e,timeZoneName:"longOffset"}).formatToParts(t),r=new Intl.DateTimeFormat("en",{timeZone:e,timeZoneName:"long"}).formatToParts(t),i=(n.find(a=>a.type==="timeZoneName")?.value??"GMT+00:00").replace("GMT","UTC"),l=lo(r,e);return{offset:i,longName:l}}function sn(e){return e.slice(e.lastIndexOf("/")+1).replace(/_/g," ")}function fn(){let e=new Date,t=oo(),n=new Map,r=sn(t),{offset:o,longName:i}=an(t,e),l={value:t,label:`${r} - ${i} (${o})`};for(let s of ro()){if(s===t)continue;let u=sn(s),{offset:p,longName:q}=an(s,e),Xe={value:s,label:`${u} - ${q} (${p})`},Re=io(s);if(Re==="Other")continue;let Ke=n.get(Re);Ke?Ke.push(Xe):n.set(Re,[Xe])}for(let s of n.values())s.sort((u,p)=>u.label.localeCompare(p.label));let a=Array.from(n.entries()).sort(([s],[u])=>s.localeCompare(u)).map(([s,u])=>({label:s,items:u}));return[{label:"Suggested",items:[l]},...a]}function Pe(e,t){if(typeof e=="number")return e;let n=t??De(),r=e.trim().toLowerCase();if(r.startsWith("current")){let o=r.match(/^current([+-])(\d+)$/);if(o){let[,i,l]=o,a=parseInt(l,10);if(!isNaN(a))return i==="+"?n+a:n-a}return n}return no.test(r)?parseInt(r,10):n}function mn(e,t){if(!e)return"";try{let n=(0,T.parse)(e,t,cn);return(0,T.isValid)(n)?(0,T.format)(n,"yyyy-MM-dd"):""}catch{return""}}function gn(e,t){if(!e)return"";try{let n=(0,T.parse)(e,t,cn);return(0,T.isValid)(n)?(0,T.format)(n,"HH:mm:ss"):""}catch{return""}}function Me(e){return e.advanced?.format??"HH:mm"}function pn(e){return e.advanced?.format??"MMMM d, yyyy"}var ao={es:{"(Optional)":"(Opcional)","Add item":"A\xF1adir elemento","An unexpected error occurred submitting the form.":"Ocurri\xF3 un error inesperado al enviar el formulario.","Collapse {label} {index}":"Contraer {label} {index}","Expand {label} {index}":"Expandir {label} {index}","Please correct the errors and try again.":"Corrige los errores e int\xE9ntalo de nuevo.","Remove {label} item {index}":"Eliminar {label} {index}","There were validation errors submitting the form.":"Se encontraron errores de validaci\xF3n al enviar el formulario.","Unknown error":"Error desconocido",No:"No",Yes:"S\xED"}};function ne(e,t){return R(e,t)}function xn(e,t){let n=t?.[e??""],r=e?ao[so(e)]:void 0;return r?n?{...r,...n}:r:n}function so(e){return e.toLowerCase().split(/[-_]/)[0]}function R(e,t){return e?t?t[e]??e:e:""}function P(e,t){return e?R(e,t):void 0}function re(e,t){if(!t)return e;let n=!1,r=e.map(o=>{let i=co(o,t);return i!==o&&(n=!0),i});return n?r:e}function co(e,t){if(!f(e))return e;let n=yn(e.label,t),r=e.items;if(Array.isArray(r)){let i=re(r,t);return i===r&&n===e.label?e:{...e,...n!==void 0&&{label:n},items:i}}let o=yn(e.description,t);return n===e.label&&o===e.description?e:{...e,...n!==void 0&&{label:n},...o!==void 0&&{description:o}}}function yn(e,t){return d(e)?R(e,t):e}var oe=De();function uo(e,t){if(O(e))return fo(e,t?.lang)}function fo(e,t){if(Kt(e))return Oe(t);if(Wt(e))return Ee(t)}function mo(e,t){if(C(e))return go(e,t)}function go(e,t){let{lang:n,translations:r}=t??{};if(Ut(e))return Oe(n);if($t(e))return Ee(n);if(Yt(e)){let o=e.advanced?.length?.min??oe,i=e.advanced?.length?.max??oe+5;return un(Pe(o,oe),Pe(i,oe))}if(Xt(e))return fn();if(Gt(e))return re([{value:"true",label:"Yes"},{value:"false",label:"No"}],r)}function bn(e,t=!1,n){let r={disabled:t,id:e.name,name:e.name,placeholder:e.placeholder,required:e.required};return qt(e)?{...r,...po(e)}:C(e)?{...r,...Rn(mo(e,n))}:Jt(e)?{...r,...xo(e)}:O(e)?{...r,...yo(e,n)}:r}function po(e){let t=Bt(e.type),n={...e,type:t};return{...Ro(e),...hn(e),...bo(n),...Qt(n)?Tn(n):{},type:t}}function Rn(e){return e?{options:e}:{}}function yo(e,t){let n=Rn(uo(e,t)),r=e.advanced?.multiple??!0;return{...n,multiple:r}}function xo(e){return{...hn(e),...Tn(e)}}function hn(e){let t=e.advanced?.autocomplete;return t?{autoComplete:t}:{}}function bo(e){return jt(e)?ho(e):{}}function Ro(e){if(we(e)){let t=Me(e);return{step:t==="HH:mm:ss"||t==="hh:mm:ss a"?"1":"60"}}return{}}function Tn(e){return An(e,{min:It,max:vt})}function ho(e){return An(e,{min:wt,max:Nt})}function An(e,t){let n={},r=e.advanced?.length;return r&&(r.min!==void 0&&(n[t.min]=r.min),r.max!==void 0&&(n[t.max]=r.max)),n}function Fn(e,t){let n=ke(e);return n||tn(e,t)}function To(e,t){let n=f(t)&&e.name in t?t[e.name]:t,r=zt(n,e.advanced?.entity),o=$(r)?r:e.defaultValue;return we(e)&&$(o)?Ao(e,o):Zt(e)&&$(o)?No(e,o):o}function Ao(e,t){let n=Me(e);return d(t)?gn(t,n):t}function Fo(e,t,n){return Ie(e)&&Array.isArray(n)?{...t,[Q]:n}:t}function Co(e,t,n){if(e.required&&!$(n)&&C(e)&&e.advanced?.preselected!==!1&&Q in t){let r=t[Q];if(Array.isArray(r)&&r.length===1)return r[0]}return n}function So(e,t,n){if(Ie(e)&&Array.isArray(t)){let r=Vt(t,e.advanced?.options);return ln(e)?re(r,n):r}return t}function Cn(e,t,n,r,o){let i=To(e,r),l=Array.isArray(n)?So(e,n,o):n,a=Fo(e,t,l),s=Co(e,a,i);return{commonPropsWithOptions:a,defaultValue:s}}function Sn(e,t){return b(e)?{defaultChecked:!!t}:{defaultValue:t}}function No(e,t){let n=pn(e);return d(t)?mn(t,n):t}var vo=/^#\/definition\//;function le(e=[],t){let n=ie(e,t);return Array.isArray(n)?n.filter(Io).sort((r,o)=>Nn(r)-Nn(o)):[]}function ie(e,t,n=new Map,r=new WeakSet){if(!wo(t)||!e||typeof e!="object")return e;if(n.has(e))return n.get(e);if(r.has(e))return e;if(r.add(e),Array.isArray(e))return e.map(i=>ie(i,t,n,r));if(E in e&&d(e[E])){let i=e[E].replace(vo,""),l=x(t,i);return l!==null?ie(l,t,n,r):e}let o={};for(let[i,l]of Object.entries(e))o[i]=ie(l,t,n,r);return r.delete(e),n.set(e,o),o}function vn(e){return Object.entries(e??{})}function Nn(e){return e.order??Number.MAX_VALUE}function wo(e){return e!==void 0&&f(e)&&Object.keys(e).length>0}function Io(e){return kt in e?!0:Array.isArray(e[Ce])?e[Ce].length>0:!0}function wn(e,t){let n={};for(let[r,o]of vn(t))n[`${e}-${r}`]=o;return n}function ko(e){return wn(Ct,e)}function Lo(e){return wn(St,e)}function In(e,t){let n=ko(e.advanced?.aria);return t&&t.length>0&&(n[Tt]="true",n[ht]=`${e.name}-error`),n}function kn(e){return Lo(e.advanced?.data)}var Ln={1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3"},En={1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3"};function On(e,t=2){return Ln[e&&e in Ln?e:t]}function Dn(e){if(e&&e in En)return En[e]}function Eo(e){return{min:e.advanced?.length?.min??1,max:e.advanced?.length?.max??1/0}}function Oo(e,t){let n=t?x(t,e.name):null;return Do(e,Array.isArray(n)?n.length:0)}function Pn(e){return!Array.isArray(e.fields)||e.fields.length===0?!1:e.fields.length>1||e.fields[0].type===B}function Mn(e,t){let n=Oo(e,t);return Array.from({length:n},(r,o)=>o)}function _n(e){return e.advanced?.title??e.label??e.name}function Do(e,t){let{min:n,max:r}=Eo(e);return Math.min(Math.max(t,n),r)}function ae(e,t){let n={...e};for(let r of Object.keys(t??{})){let o=t?.[r];o!==void 0&&(n[r]=o)}return n}var zn=require("react/jsx-runtime");function A(e){return Ht(e,(t,n,r)=>(0,zn.jsx)("a",{className:"underline",href:n,rel:"noopener noreferrer",target:"_blank",children:r},`${n}-${t}`))}var se=require("react"),h=require("react/jsx-runtime");function Vn(e){let{fields:t=[]}=e.section,[n,r]=(0,se.useState)(!1),o=(0,se.useCallback)(()=>r(i=>!i),[]);return(0,h.jsxs)("fieldset",{"data-slot":"field-set","data-advanced":"true","data-expanded":n,"data-empty":t.length===0,className:"flex flex-col",id:e.section.id?.toString(),children:[(0,h.jsx)("legend",{children:(0,h.jsxs)("button",{className:"flex cursor-pointer items-center gap-2 text-base font-medium text-zinc-600 dark:text-zinc-400",onClick:o,type:"button",children:[(0,h.jsx)(L,{expanded:n}),(0,h.jsx)("span",{children:A(e.title)})]})}),(0,h.jsx)(V,{visible:n,children:(0,h.jsxs)("div",{className:"mt-3 ml-1.5 flex flex-col gap-4 border-l-2 border-zinc-300 pl-4 dark:border-zinc-600","data-slot":"field-set-content",children:[e.description&&(0,h.jsx)("p",{className:"text-sm leading-normal font-normal text-zinc-600 dark:text-zinc-400",children:A(e.description)}),e.group]})})]})}var S=require("react/jsx-runtime");function Bn(e){let t=(0,S.jsxs)("div",{className:"flex flex-col",children:[e.title&&(0,S.jsx)("legend",{className:"mb-3 font-medium text-zinc-800 dark:text-zinc-200",children:A(e.title)}),e.description&&(0,S.jsx)("p",{className:"-mt-2 text-sm leading-normal font-normal text-zinc-600 dark:text-zinc-400",children:A(e.description)})]});return e.step?(0,S.jsxs)("div",{className:"flex flex-row items-start gap-4",children:[(0,S.jsx)("div",{className:"bg-primary text-primary-foreground flex size-6 shrink-0 items-center justify-center rounded-full",children:(0,S.jsx)("span",{className:"text-sm font-bold",children:e.step})}),t]}):t}var Y=require("react/jsx-runtime");function ce(e){return(0,Y.jsxs)("fieldset",{className:"flex w-full min-w-0 flex-col data-[empty=false]:gap-6","data-empty":e.empty,"data-slot":"field-set",id:e.id,children:[(0,Y.jsx)(Bn,{description:e.description,step:e.step,title:e.title}),(0,Y.jsx)("div",{className:"w-full min-w-0",children:e.children})]})}var Hn=require("react/jsx-runtime");function N(e){return(0,Hn.jsx)("div",{"data-slot":"field-group","data-compact":e.compact,className:"flex w-full flex-col gap-8 data-[compact=true]:gap-3",children:e.children})}var de=require("react/jsx-runtime");function Gn(e){let{fields:t=[]}=e.section,n=e.advanced?.step?e.step:void 0,{compact:r}=ae(e.style,{compact:e.section.advanced?.compact}),o=(0,de.jsx)(N,{compact:r,children:e.children});if(!e.section.title&&!e.section.description)return o;let i=P(e.section.title,e.translations),l=P(e.section.description,e.translations);return e.section.advanced?.collapsible?(0,de.jsx)(Vn,{description:l,group:o,section:e.section,title:i}):(0,de.jsx)(ce,{description:l,empty:t.length===0,id:e.section.id?.toString(),step:n,title:i,children:o})}var _e=require("react/jsx-runtime");function Un(){return(0,_e.jsx)("div",{"data-slot":"field-separator",className:"relative -my-2 h-5 text-sm",children:(0,_e.jsx)("div",{className:"absolute inset-0 top-1/2 h-px w-full bg-zinc-200 dark:bg-zinc-800"})})}var Wn=require("jotai");var M=require("jotai"),$n=require("jotai-family"),ze=require("fast-equals");function Po(e,t){let{[t]:n,...r}=e;return r}function Mo(e){return(0,$n.atomFamily)(t=>(0,M.atom)(n=>n(e)[t]??void 0,(n,r,o)=>{let i=n(e);if(o!=null){let l=i[t];(0,ze.deepEqual)(l,o)||r(e,{...i,[t]:o})}else t in i&&r(e,Po(i,t))}))}function _o(e){return(0,M.atom)(null,(t,n)=>{let r=t(e);r&&Object.keys(r).length>0&&n(e,{})})}function zo(e){return(0,M.atom)(null,(t,n,r)=>{let i={...t(e)},l=!1;for(let a of r)a in i&&(delete i[a],l=!0);l&&n(e,i)})}function Vo(e){return(0,M.atom)(null,(t,n,r)=>{let o=t(e);(0,ze.deepEqual)(o,r)||n(e,r)})}function ue(e={}){let t=(0,M.atom)(e);return{atom:t,clearAll:_o(t),clear:zo(t),bulkReport:Vo(t),report:Mo(t)}}var Yn=ue(),Xn=Yn.atom,Kn=Yn.report;function Bo(e,t){return e.fields.every(n=>Zn(n,t))}function Zn(e,t){return t[e.name]?.hidden??e.hidden??!1}function Ho(e,t){return D(e)?Bo(e,t):Zn(e,t)}function qn(e){let t=(0,Wn.useAtomValue)(Xn);return e.container&&(t[e.container.name]?.hidden??e.container.hidden??!1)||e.fields.length===0||e.fields.every(r=>Ho(r,t))?null:e.children}var F=require("react/jsx-runtime");function Jn(e){let t=le(e.sections,e.definition);return(0,F.jsx)("div",{className:"h-full w-full",children:(0,F.jsx)("form",{noValidate:e.noValidate,action:e.action,children:(0,F.jsxs)(N,{children:[t.map((n,r)=>(0,F.jsxs)(qn,{fields:n.fields??[],children:[(0,F.jsx)(Gn,{advanced:e.advanced,section:n,step:r+1,style:e.config.style,translations:e.translations,children:e.children({disabled:e.readOnly,fields:n.fields})}),n.advanced?.separator&&(0,F.jsx)(Un,{})]},`key-${n.id}-${r}`)),e.control&&(0,F.jsx)(We,{isPending:e.isPending,children:e.control})]})})})}var jn=require("react/jsx-runtime");function Qn(e){return(0,jn.jsx)("p",{className:"-mt-2 text-xs leading-normal font-normal text-zinc-600 dark:text-zinc-400 [[data-slot=column]_&]:md:line-clamp-2",title:e.title,children:e.children})}var er=require("react"),_=require("react/jsx-runtime");function fe(e){let t={context:e.context,env:e.config?.env,value:e.value},r={locale:e.config?.env?.locale},[o,i]=(0,er.useState)(()=>f(e.text)&&"collapsed"in e.text?!e.text.collapsed:!0),l=()=>i(p=>!p),a=f(e.text)&&d(e.text.title)?A(R(U(e.text.title,t,r),e.translations)):void 0,s=R(U(d(e.text)?e.text:e.text?.message,t,r),e.translations),u=A(s);return u?(0,_.jsxs)("div",{className:"flex flex-col gap-2",children:[a&&(0,_.jsxs)("button",{className:"flex items-center gap-1 text-left text-xs font-medium text-zinc-700 hover:text-zinc-900 dark:text-zinc-300 dark:hover:text-zinc-100",onClick:l,type:"button",children:[a,(0,_.jsx)(L,{expanded:o})]}),o&&(0,_.jsx)(Qn,{title:s,children:u})]}):null}var Ve=require("jotai");var me=ue(),Al=me.atom,Fl=me.clearAll,Cl=me.clear,tr=me.report,Sl=(0,Ve.atom)({}),Nl=(0,Ve.atom)(null);var Be=require("jotai"),nr=require("react/jsx-runtime");function ge(e){let t=(0,Be.useAtomValue)(tr(e.field.name)),r=(0,Be.useAtomValue)(Kn(e.field.name))?.description??e.field.description;return(0,nr.jsx)(fe,{config:e.config,context:e.context,text:r,translations:e.translations,value:t})}var rr=require("tailwind-merge"),X=require("react/jsx-runtime");function or(e){let t=e.style?.showOptionalLabel??!0,n=I(e.field)||b(e.field);return(0,X.jsxs)("label",{"data-slot":"field-label","data-normal":n,className:(0,rr.twMerge)("flex w-fit items-center text-sm leading-snug font-medium select-none","data-[normal=true]:font-normal [[data-slot=column]_&]:md:w-full","group-data-[readonly=true]:cursor-not-allowed group-data-[readonly=true]:opacity-50"),htmlFor:e.field.name,title:d(e.children)?e.children:void 0,children:[(0,X.jsx)("span",{className:"[[data-slot=column]_&]:md:truncate",children:e.children}),t&&!e.field.required&&(0,X.jsx)("span",{className:"ml-2 flex-shrink-0 text-sm text-zinc-600 dark:text-zinc-400",children:ne("(Optional)",e.translations)})]})}var K=require("react/jsx-runtime");function ir(e){let t={context:e.context,env:e.config?.env},n=e.config?.env?.locale,r=U(e.field.label,t,{locale:n});return(0,K.jsxs)("div",{"data-slot":"field-content",className:"flex w-full flex-1 flex-col gap-1.5 leading-snug",children:[(0,K.jsx)(or,{field:e.field,style:e.config?.style,translations:e.translations,children:R(r,e.translations)}),e.horizontal===!0&&(0,K.jsx)(ge,{config:e.config,context:e.context,field:e.field,translations:e.translations})]})}var k=require("react/jsx-runtime");function lr(e){return(0,k.jsxs)(k.Fragment,{children:[e.field.name&&e.field.label&&(0,k.jsx)(ir,{config:e.config,context:e.context,field:e.field,horizontal:e.horizontal,translations:e.translations}),e.children,e.horizontal===!1&&(0,k.jsx)(ge,{config:e.config,context:e.context,field:e.field,translations:e.translations})]})}function ar(e,t){return e?t(e):null}var He=require("react/jsx-runtime");function sr(e){let t=Fn(e.field,e.value),{commonPropsWithOptions:n,defaultValue:r}=Cn(e.field,e.commonProps,t,e.value,e.translations),o=Sn(e.field,r);return ar(e.config.inputs[e.field.type],i=>(0,He.jsx)(lr,{config:e.config,context:e.context,field:e.field,horizontal:e.horizontal,translations:e.translations,children:(0,He.jsx)(i,{...e.ariaAttributes,...n,...e.dataAttributes,...o})}))}var Ge=require("react/jsx-runtime");function cr(e){return!e.errors||e.errors.length===0?null:(0,Ge.jsx)("ul",{className:"text-sm text-red-600 dark:text-red-500",id:e.name?`${e.name}-error`:void 0,children:e.errors?.map((t,n)=>(0,Ge.jsx)("li",{children:t},e.name?`${e.name}-error-${n}`:n))})}var dr=require("tailwind-merge"),ur=require("react/jsx-runtime");function pe(e){let t=e.errors&&e.errors.length>0;return(0,ur.jsx)("div",{"data-slot":"field","data-clickable":e.isClickable?"true":"false",...t&&{[At]:"true"},...e.disabled&&{[Ft]:"true"},"data-orientation":e.orientation,className:(0,dr.twMerge)("group flex w-full flex-col items-center data-[invalid=true]:text-red-600 data-[invalid=true]:dark:text-red-500","data-[clickable=true]:items-start",e.isCheckbox&&(e.isReversed?"flex-row-reverse!":"flex-row!"),"data-[clickable=true]:has-[>[data-slot=field-content]]:[&>:first-child]:mt-px",e.className),children:e.children})}var fr=require("tailwind-merge"),gr=require("react/jsx-runtime");function mr(e){return(0,gr.jsx)(pe,{...e,orientation:"vertical",className:(0,fr.twMerge)("gap-3 has-[>[data-slot=field-content]]:items-start",!e.isClickable&&"[&>*]:w-full"),children:e.children})}var pr=require("tailwind-merge"),xr=require("react/jsx-runtime");function yr(e){return(0,xr.jsx)(pe,{...e,orientation:"horizontal",className:(0,pr.twMerge)("gap-2 md:flex-row md:gap-4","[&>[data-slot=field-content]]:min-w-0 [&>[data-slot=field-content]]:flex-grow [&>[data-slot=field-content]]:self-start","[&_[role=checkbox]]:mt-[1.5px]",e.isClickable&&"md:flex-col",!e.isClickable&&["md:justify-between","[&>*:not([data-slot=field-content])]:w-full","[&>*:not([data-slot=field-content])]:md:w-1/2","[&>*:not([data-slot=field-content])]:xl:w-2/5"]),children:e.children})}var Ue=require("react/jsx-runtime");function br(e){let t=en(e.field),n=b(e.field),r=rn(e.field);return e.horizontal?(0,Ue.jsx)(yr,{disabled:e.disabled,errors:e.errors,isCheckbox:n,isReversed:r,isClickable:t,children:e.children}):(0,Ue.jsx)(mr,{disabled:e.disabled,errors:e.errors,isCheckbox:n,isReversed:r,isClickable:t,children:e.children})}function Rr(e){if(!e.field.type)return null;let t=bn(e.field,e.disabled,{lang:e.lang,translations:e.translations}),n=kn(e.field),r=In(e.field,e.errors),o={...e.field,disabled:t.disabled};return e.children({ariaAttributes:r,commonProps:t,dataAttributes:n,field:o,horizontal:e.horizontal})}var hr=require("tailwind-merge"),z=require("react/jsx-runtime");function Tr(e){let t=e.field.advanced?.cols,n=e.field.name?e.errors?.[e.field.name]:void 0,{horizontal:r=!1}=ae(e.style,{horizontal:nn(e.field)}),o=on(e.field,e.disabled);return(0,z.jsxs)("div",{className:(0,hr.twMerge)("flex flex-col gap-3",Dn(t)),children:[(0,z.jsx)(br,{disabled:o,errors:n,field:e.field,horizontal:r,children:(0,z.jsx)(Rr,{disabled:o,errors:n,field:e.field,horizontal:r,lang:e.lang,translations:e.translations,children:e.children})}),(0,z.jsx)(cr,{errors:n,name:e.field.name})]})}var ye=require("tailwind-merge"),Ar=require("react"),c=require("react/jsx-runtime");function Fr(e){let t=e.isMultiField||e.collapsed!=null,[n,r]=(0,Ar.useState)(t?!e.collapsed:!0);function o(){e.canRemove&&e.onRemove&&e.onRemove(e.index)}function i(){r(p=>!p)}let l=p=>G(ne(p,e.translations),{index:e.index+1,label:e.label}),a=e.canRemove&&e.onRemove!=null&&(0,c.jsx)("button",{"aria-label":l("Remove {label} item {index}"),className:(0,ye.twMerge)("flex size-6 items-center justify-center rounded text-xl leading-none text-zinc-400","transition-colors duration-150","hover:text-red-500","focus-visible:ring-2 focus-visible:ring-zinc-400 focus-visible:outline-none","dark:text-zinc-500 dark:hover:text-red-400"),onClick:o,type:"button",children:(0,c.jsx)("span",{"aria-hidden":"true",className:"leading-none",children:"\xD7"})}),s=(0,c.jsxs)("div",{className:"flex min-w-0 flex-col font-medium text-zinc-700 dark:text-zinc-400",children:[(0,c.jsx)("span",{className:"text-base",children:e.previewLabel??(0,c.jsxs)(c.Fragment,{children:[e.label," ",e.index+1]})}),!n&&e.previewTags&&(0,c.jsx)("div",{className:"flex items-center gap-2 overflow-hidden text-xs font-normal text-ellipsis whitespace-nowrap text-zinc-500 dark:text-zinc-500",children:e.previewTags})]}),u=(0,c.jsxs)("div",{className:(0,ye.twMerge)("flex items-center justify-between gap-2",e.isMultiField&&n&&"mb-3"),children:[t?(0,c.jsxs)("div",{className:"flex min-w-0 grow items-center gap-2",children:[(0,c.jsxs)("button",{"aria-expanded":n,"aria-label":l(n?"Collapse {label} {index}":"Expand {label} {index}"),className:(0,ye.twMerge)("group flex grow items-center gap-2 rounded p-1 text-left text-zinc-400","focus-visible:ring-2 focus-visible:ring-zinc-400 focus-visible:outline-none","dark:text-zinc-500"),onClick:i,type:"button",children:[(0,c.jsx)(L,{expanded:n}),s]}),!n&&e.previewBadge&&(0,c.jsx)("div",{className:"ml-auto shrink-0",children:e.previewBadge})]}):s,a]});return e.isMultiField?(0,c.jsxs)("div",{"data-slot":"list-item-card",className:"box-border w-full min-w-0 rounded-lg border border-zinc-100 p-4 dark:border-zinc-900",children:[u,(0,c.jsx)(V,{visible:n,children:(0,c.jsx)(N,{children:e.children})})]}):t?(0,c.jsxs)("div",{className:"box-border flex w-full min-w-0 flex-col gap-2",children:[u,(0,c.jsx)(V,{visible:n,children:(0,c.jsx)(N,{children:e.children})})]}):(0,c.jsxs)("div",{className:"box-border flex w-full min-w-0 items-start gap-2",children:[(0,c.jsx)("div",{className:"flex min-w-0 grow flex-col",children:(0,c.jsx)(N,{children:e.children})}),a&&(0,c.jsx)("div",{className:"shrink-0",children:a})]})}var Sr=require("react/jsx-runtime");function Cr(e){let t=R(_n(e.field),e.translations),n=Pn(e.field);return Mn(e.field,e.value).map(r=>(0,Sr.jsx)(Fr,{collapsed:e.field.advanced?.collapsed,index:r,isMultiField:n,label:t,translations:e.translations,children:e.children(r)},r))}var vr=require("react/jsx-runtime");function Nr(e){let t=Array.isArray(e.field.fields)&&e.field.fields.length===0,n=P(e.field.label,e.translations),r=P(e.field.description,e.translations);return(0,vr.jsx)(ce,{description:r,empty:t,id:e.field.name,title:n,children:e.children})}var $e=require("react/jsx-runtime");function wr({children:e,field:t,lang:n,translations:r,value:o}){return(0,$e.jsx)(Nr,{field:t,translations:r,children:(0,$e.jsx)(Cr,{field:t,lang:n,translations:r,value:o,children:e})})}var Ir=require("tailwind-merge");var W=require("react/jsx-runtime");function kr(e){let t=On(e.column?.advanced?.cols);return(0,W.jsxs)("div",{className:"flex w-full flex-col gap-4",children:[(0,W.jsx)("div",{"data-slot":"column",className:(0,Ir.twMerge)("grid grid-cols-1 gap-3 sm:gap-4",t),children:e.children}),e.column?.description&&(0,W.jsx)(fe,{config:e.config,context:e.context,text:e.column.description,translations:e.translations})]})}var Or=require("react");var Er=require("react/jsx-runtime");function Lr(e){let t=Array.isArray(e.field.fields)?e.field.fields.map(n=>te(n)||ee(n)?{...n,name:`${e.field.name}.${e.index}.${n.name}`}:D(n)?{...n,fields:n.fields.map(r=>({...r,name:`${e.field.name}.${e.index}.${r.name}`}))}:n):[];return(0,Er.jsx)(Z,{components:e.components,config:e.config,context:e.context,disabled:e.disabled,fields:t,lang:e.lang,onValueChange:e.onValueChange,style:e.style,translations:e.translations,value:e.value,children:e.children})}var v=require("react/jsx-runtime");function Z(e){let{field:t,list:n}=e.components;return le(e.fields).map((r,o)=>(0,v.jsxs)(Or.Fragment,{children:[D(r)&&(0,v.jsx)(kr,{column:r,config:e.config,context:e.context,translations:e.translations,children:(0,v.jsx)(Z,{...e,fields:r.fields})}),te(r)&&(0,v.jsx)(t,{disabled:e.disabled,field:r,lang:e.lang,style:e.style,translations:e.translations,children:e.children}),ee(r)&&(0,v.jsx)(n,{field:r,lang:e.lang,onValueChange:e.onValueChange,translations:e.translations,value:e.value,children:i=>(0,v.jsx)(Lr,{components:e.components,config:e.config,context:e.context,disabled:e.disabled,field:r,index:i,lang:e.lang,onValueChange:e.onValueChange,style:e.style,translations:e.translations,value:e.value,children:e.children})})]},o))}var Pr=require("react/jsx-runtime");function Dr(e){return n=>(0,Pr.jsx)(Z,{...n,components:e})}var Mr=Dr({field:Tr,list:wr});var xe=require("react/jsx-runtime");function be(e){let t=xn(e.lang,e.translations);return(0,xe.jsx)(Jn,{advanced:e.advanced,config:e.config,control:e.children,definition:e.definition,readOnly:e.readOnly,sections:e.sections,translations:t,children:({disabled:n,fields:r})=>(0,xe.jsx)(Mr,{config:e.config,context:e.context,disabled:n,fields:r,lang:e.lang,style:e.config.style,translations:t,value:e.value,children:o=>(0,xe.jsx)(sr,{...o,config:e.config,context:e.context,translations:t,value:e.value})})})}var _r=require("react");var Ye=require("react/jsx-runtime");function zr(e){return(0,Ye.jsx)(_r.Suspense,{fallback:(0,Ye.jsx)(be,{config:e.config,sections:e.sections,readOnly:!0}),children:e.children})}
|
|
1
|
+
"use strict";var ut=Object.defineProperty;var gr=Object.getOwnPropertyDescriptor;var pr=Object.getOwnPropertyNames;var yr=Object.prototype.hasOwnProperty;var xr=(t,e)=>{for(var n in e)ut(t,n,{get:e[n],enumerable:!0})},br=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of pr(e))!yr.call(t,o)&&o!==n&&ut(t,o,{get:()=>e[o],enumerable:!(r=gr(e,o))||r.enumerable});return t};var Tr=t=>br(ut({},"__esModule",{value:!0}),t);var yo={};xr(yo,{Fallback:()=>mr,Form:()=>st});module.exports=Tr(yo);var Mt=require("react/jsx-runtime");function Pt(t){let e=typeof t.children=="function"?t.children({isPending:t.isPending}):t.children;return(0,Mt.jsx)("div",{"data-slot":"field-control",className:"w-full",children:e})}var Y="input",_t="input/date",zt="input/email",Vt="input/number",Gt="input/time";var Bt="textarea",Ht="radio",Ut="checkbox",dt="list",$t="select",Yt="select/active",Xt="select/day",Kt="select/month",Wt="select/timezone",Zt="select/year";var qt="chips",Jt="chips/day",Qt="chips/month",P="column",jt="description",ft="fields",te="label",mt="value",X="options",gt="email",ee="number",ne="password",re="tel",M="text",oe="aria-errormessage",ie="aria-invalid",le="data-invalid",ae="data-readonly",se="aria",ce="data",ue="max",de="maxLength",fe="min",me="minLength",L="$ref";var ge="type",pe={Africa:"Africa",America:"Americas",Asia:"Asia / Pacific",Atlantic:"Atlantic",Australia:"Asia / Pacific",Europe:"Europe",Indian:"Asia / Pacific",Pacific:"Asia / Pacific"};var m=require("date-fns"),C=require("date-fns/locale");function f(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function g(t){return c(t)||typeof t=="number"||hr(t)}function ye(t){return Array.isArray(t)&&t.every(g)}function c(t){return typeof t=="string"}function hr(t){return typeof t=="boolean"}var xe={en:C.enUS,"en-US":C.enUS,es:C.es,"es-ES":C.es,"es-MX":C.es},Rr={short:"M/d/yy",medium:"MMM d, yyyy",long:"MMMM d, yyyy",full:"EEEE, MMMM d, yyyy"},Sr={ms:1,s:1e3,min:6e4,h:36e5,d:864e5};function be(t){if(t)return xe[t]??xe[t.split("-")[0]]}function K(t){if(typeof t=="number"&&!Number.isNaN(t))return t;if(c(t)&&t.trim()!==""){let e=Number(t);return Number.isNaN(e)?null:e}return null}function Te(t,e,n){let r=Sr[e];if(r===void 0)return String(t);let o=t*r,i=(0,m.intervalToDuration)({start:0,end:o});return(0,m.formatDuration)(i,{locale:n})}function he(t){if(t instanceof Date)return(0,m.isValid)(t)?t:null;if(c(t)){let e=(0,m.parseISO)(t);if((0,m.isValid)(e))return e;let n=new Date(t);return(0,m.isValid)(n)?n:null}if(typeof t=="number"){let e=new Date(t);return(0,m.isValid)(e)?e:null}return null}var Ar={currency:(t,e,n)=>{let r=K(t);if(r===null)return String(t);let o=e[0]??"USD";return new Intl.NumberFormat(n.locale,{style:"currency",currency:o}).format(r)},percent:(t,e,n)=>{let r=K(t);return r===null?String(t):new Intl.NumberFormat(n.locale,{style:"percent"}).format(r)},number:(t,e,n)=>{let r=K(t);return r===null?String(t):new Intl.NumberFormat(n.locale).format(r)},date:(t,e,n)=>{let r=he(t);if(!r)return String(t);let o=e[0]??"short",i=be(n.locale);if(o==="relative")return(0,m.formatDistanceToNow)(r,{addSuffix:!0,locale:i});let l=Rr[o]??o;return(0,m.format)(r,l,{locale:i})},duration:(t,e,n)=>{let r=be(n.locale);if(typeof t=="number")return Te(t,e[0]??"ms",r);if(c(t)){let i=K(t);if(i!==null)return Te(i,e[0]??"ms",r)}let o=he(t);return o?(0,m.formatDistanceToNow)(o,{addSuffix:!0,locale:r}):String(t)}};function Re(t,e,n){let r=e.split(":").map(a=>a.trim()).filter(a=>a.length>0);if(r.length===0)return;let[o,...i]=r,l=Ar[o];if(l)return l(t,i,n)}function pt(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var _={found:!1,value:void 0};function Fr(t,e){if(!Array.isArray(e)&&pt(e,t))return{found:!0,value:e[t]};if(!t.includes("."))return _;let n=e;for(let r of t.split(".")){if(n==null)return _;if(Array.isArray(n)){let o=Number(r);if(!Number.isInteger(o)||!pt(n,r))return _;n=n[o]}else if(f(n)){if(!pt(n,r))return _;n=n[r]}else return _}return{found:!0,value:n}}function Se(t,e=mt){if(t!=null){if(ye(t)||g(t))return t;if(f(t)){let n=Nr(t,e);if(g(n))return n}}}function Nr(t,e){let n=p(t,e);if(g(n))return n}function p(t,e){if(!e||!t||typeof t!="object")return null;let n=Fr(e,t);return n.found?n.value:null}function Ae(t,e={description:jt,label:te,value:mt}){return t.map(n=>{if(f(n)){let r=p(n,e.label),o=p(n,e.value);if(g(r)&&g(o)){let i=p(n,e.description);return{label:`${r}`,value:`${o}`,...g(i)&&{description:`${i}`}}}}return n})}function Fe(t=M){let e=t.lastIndexOf("/"),n=e===-1?t:t.slice(e+1);return n&&n!==Y?n.trim().toLowerCase():M}var Cr=/\[([^\]]{1,500})\]\(([^)]{1,2000})\)/g,Er=/{([^}]{1,200})}/,wr=/{([^}]{1,200})}/g;function yt(t,e={},n={}){if(c(t))return kr(t,e,n);if(Array.isArray(t))return t.map(r=>yt(r,e,n));if(f(t)){let r={};for(let o in t)r[o]=yt(t[o],e,n);return r}return t}function W(t,e={},n={}){return xt(t)?yt(t,e,n):t}function xt(t){return c(t)?Er.test(t):Array.isArray(t)?t.some(e=>xt(e)):f(t)?Object.values(t).some(e=>xt(e)):!1}function Ir(t,e){return e.includes(".")?p(t,e):t[e]}function kr(t,e={},n={}){return t.replace(wr,(r,o)=>{let i=String(o).split("|").map(x=>x.trim()),[l,...a]=i;if(!l)return r;let s=Ir(e,l);if(a.length===0)return g(s)?String(s):r;if(s==null)return r;let u=s;for(let x of a){let $=Re(u,x,{locale:n.locale});if($===void 0)return r;u=$}return String(u)})}function Ne(t,e){if(!c(t)||!t||t.trim().length===0)return null;let n,r=0,o=!1,i=[];for(;(n=Cr.exec(t))!==null;){let[l,a,s]=n,u=n.index;o=!0,u>r&&i.push(t.substring(r,u));let x=e?e(u,s,a):l;i.push(x),r=u+l.length}return o?(r<t.length&&i.push(t.substring(r)),i):t}var Ce=t=>d(Yt)(t),Ee=t=>d(Xt)(t),we=t=>d(Kt)(t),Ie=t=>d(Zt)(t),ke=t=>d(Wt)(t),Le=t=>d(Jt)(t),De=t=>d(Qt)(t),ve=d(_t),bt=d(Gt),y=d(Ut),D=d(qt),E=d(Ht),Oe=d(Y),S=d($t),Pe=d(Bt),Me=d(M,gt,ne,re),Do=d(zt,gt),Tt=d(Vt,ee);function _e(t){return E(t)||y(t)}function Z(t){return t.type===dt}function w(t){return t.type===P}function q(t){return t.type!==P&&t.type!==dt}function ht(t){return S(t)||E(t)||D(t)}function z(t){return t!=null&&t!==""}function d(...t){return e=>{let n=c(e.type)?e.type:void 0;return n?t.some(r=>n===r||n?.startsWith(`${r}/`)):!1}}function ze(t,e={}){if(S(t)&&t.disabled){let n=t.name?e?.[t.name]:void 0;if(n&&f(n))return[n]}}function Ve(t){return E(t)||y(t)?!0:t.advanced?.horizontal}function Ge(t){return y(t)?t.advanced?.reverse!==!1:!1}function Be(t,e){let n=t.readonly??!1;return e||n}function He(t,e){return!!t.readonly&&!e&&!t.disabled}function Ue(t){let e=t.advanced?.step;if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e}function Rt(t){if(Lr(t)){let e=t.source;if(Array.isArray(e)||f(e)&&!(L in e))return e}}function $e(t){return Array.isArray(Rt(t))}function Lr(t){return E(t)||D(t)||S(t)&&!t.disabled}var b=require("date-fns"),Dr=/^\d+$/,Ke=new Date(2e3,0,1),vr=()=>"supportedValuesOf"in Intl?Intl.supportedValuesOf("timeZone"):[],St="default";function We(t){if(!t)return St;try{return Intl.getCanonicalLocales(t)[0]??St}catch{return St}}function At(t){let e=We(t);return Array.from({length:12},(n,r)=>({value:(r+1).toString(),label:new Date(0,r).toLocaleString(e,{month:"long"})}))}function Ft(t){let e=We(t);return Array.from({length:7},(n,r)=>({value:r.toString(),label:new Date(2e3,0,2+r).toLocaleString(e,{weekday:"long"})}))}function Ze(t,e){return e>=t?Array.from({length:e-t+1},(n,r)=>{let o=t+r;return{value:o.toString(),label:o.toString()}}):[]}function Nt(){return new Date().getFullYear()}function Or(){return Intl.DateTimeFormat().resolvedOptions().timeZone}function Pr(t){let e=t.indexOf("/"),n=e===-1?t:t.slice(0,e);return pe[n]??"Other"}function Mr(t,e){return(t.find(r=>r.type==="timeZoneName")?.value??e).replace(/\s+(?:Standard|Daylight(?: Saving)?|Summer|Winter)\s+Time$/,"")}function Ye(t,e){let n=new Intl.DateTimeFormat("en",{timeZone:t,timeZoneName:"longOffset"}).formatToParts(e),r=new Intl.DateTimeFormat("en",{timeZone:t,timeZoneName:"long"}).formatToParts(e),i=(n.find(a=>a.type==="timeZoneName")?.value??"GMT+00:00").replace("GMT","UTC"),l=Mr(r,t);return{offset:i,longName:l}}function Xe(t){return t.slice(t.lastIndexOf("/")+1).replace(/_/g," ")}function qe(){let t=new Date,e=Or(),n=new Map,r=Xe(e),{offset:o,longName:i}=Ye(e,t),l={value:e,label:`${r} - ${i} (${o})`};for(let s of vr()){if(s===e)continue;let u=Xe(s),{offset:x,longName:$}=Ye(s,t),vt={value:s,label:`${u} - ${$} (${x})`},ct=Pr(s);if(ct==="Other")continue;let Ot=n.get(ct);Ot?Ot.push(vt):n.set(ct,[vt])}for(let s of n.values())s.sort((u,x)=>u.label.localeCompare(x.label));let a=Array.from(n.entries()).sort(([s],[u])=>s.localeCompare(u)).map(([s,u])=>({label:s,items:u}));return[{label:"Suggested",items:[l]},...a]}function Ct(t,e){if(typeof t=="number")return t;let n=e??Nt(),r=t.trim().toLowerCase();if(r.startsWith("current")){let o=r.match(/^current([+-])(\d+)$/);if(o){let[,i,l]=o,a=parseInt(l,10);if(!isNaN(a))return i==="+"?n+a:n-a}return n}return Dr.test(r)?parseInt(r,10):n}function Je(t,e){if(!t)return"";try{let n=(0,b.parse)(t,e,Ke);return(0,b.isValid)(n)?(0,b.format)(n,"yyyy-MM-dd"):""}catch{return""}}function Qe(t,e){if(!t)return"";try{let n=(0,b.parse)(t,e,Ke);return(0,b.isValid)(n)?(0,b.format)(n,"HH:mm:ss"):""}catch{return""}}function Et(t){return t.advanced?.format??"HH:mm"}function je(t){return t.advanced?.format??"MMMM d, yyyy"}var _r={es:{"(Optional)":"(Opcional)","Add item":"A\xF1adir elemento","An unexpected error occurred submitting the form.":"Ocurri\xF3 un error inesperado al enviar el formulario.","Collapse {label} {index}":"Contraer {label} {index}","Expand {label} {index}":"Expandir {label} {index}","Please correct the errors and try again.":"Corrige los errores e int\xE9ntalo de nuevo.","Remove {label} item {index}":"Eliminar {label} {index}","There were validation errors submitting the form.":"Se encontraron errores de validaci\xF3n al enviar el formulario.","Unknown error":"Error desconocido",No:"No",Yes:"S\xED"}};function en(t,e){return T(t,e)}function nn(t,e){let n=e?.[t??""],r=t?_r[zr(t)]:void 0;return r?n?{...r,...n}:r:n}function zr(t){return t.toLowerCase().split(/[-_]/)[0]}function T(t,e){return t?e?e[t]??t:t:""}function v(t,e){return t?T(t,e):void 0}function J(t,e){if(!e)return t;let n=!1,r=t.map(o=>{let i=Vr(o,e);return i!==o&&(n=!0),i});return n?r:t}function Vr(t,e){if(!f(t))return t;let n=tn(t.label,e),r=t.items;if(Array.isArray(r)){let i=J(r,e);return i===r&&n===t.label?t:{...t,...n!==void 0&&{label:n},items:i}}let o=tn(t.description,e);return n===t.label&&o===t.description?t:{...t,...n!==void 0&&{label:n},...o!==void 0&&{description:o}}}function tn(t,e){return c(t)?T(t,e):t}var Q=Nt();function Gr(t,e){if(D(t))return Br(t,e?.lang)}function Br(t,e){if(Le(t))return Ft(e);if(De(t))return At(e)}function Hr(t,e){if(S(t))return Ur(t,e)}function Ur(t,e){let{lang:n,translations:r}=e??{};if(Ee(t))return Ft(n);if(we(t))return At(n);if(Ie(t)){let o=t.advanced?.length?.min??Q,i=t.advanced?.length?.max??Q+5;return Ze(Ct(o,Q),Ct(i,Q))}if(ke(t))return qe();if(Ce(t))return J([{value:"true",label:"Yes"},{value:"false",label:"No"}],r)}function rn(t,e=!1,n){let r={disabled:e,id:t.name,name:t.name,placeholder:t.placeholder,required:t.required};return Oe(t)?{...r,...$r(t)}:S(t)?{...r,...on(Hr(t,n))}:Pe(t)?{...r,...Kr(t)}:D(t)?{...r,...Xr(t,n)}:r}function $r(t){let e=Fe(t.type),n={...t,type:e};return{...Zr(t),...ln(t),...Wr(n),...Yr(n),...Me(n)?an(n):{},type:e}}function Yr(t){let e=Ue(t);return Tt(t)&&e!==void 0?{step:e}:{}}function on(t){return t?{options:t}:{}}function Xr(t,e){let n=on(Gr(t,e)),r=t.advanced?.multiple??!0;return{...n,multiple:r}}function Kr(t){return{...ln(t),...an(t)}}function ln(t){let e=t.advanced?.autocomplete;return e?{autoComplete:e}:{}}function Wr(t){return Tt(t)?qr(t):{}}function Zr(t){if(bt(t)){let e=Et(t);return{step:e==="HH:mm:ss"||e==="hh:mm:ss a"?"1":"60"}}return{}}function an(t){return sn(t,{min:me,max:de})}function qr(t){return sn(t,{min:fe,max:ue})}function sn(t,e){let n={},r=t.advanced?.length;return r&&(r.min!==void 0&&(n[e.min]=r.min),r.max!==void 0&&(n[e.max]=r.max)),n}function cn(t,e){let n=Rt(t);return n||ze(t,e)}function Jr(t,e){let n=f(e)&&t.name in e?e[t.name]:e,r=Se(n,t.advanced?.entity),o=z(r)?r:t.defaultValue;return bt(t)&&z(o)?Qr(t,o):ve(t)&&z(o)?no(t,o):o}function Qr(t,e){let n=Et(t);return c(e)?Qe(e,n):e}function jr(t,e,n){return ht(t)&&Array.isArray(n)?{...e,[X]:n}:e}function to(t,e,n){if(t.required&&!z(n)&&S(t)&&t.advanced?.preselected!==!1&&X in e){let r=e[X];if(Array.isArray(r)&&r.length===1)return r[0]}return n}function eo(t,e,n){if(ht(t)&&Array.isArray(e)){let r=Ae(e,t.advanced?.options);return $e(t)?J(r,n):r}return e}function un(t,e,n,r,o){let i=Jr(t,r),l=Array.isArray(n)?eo(t,n,o):n,a=jr(t,e,l),s=to(t,a,i);return{commonPropsWithOptions:a,defaultValue:s}}function dn(t,e){return y(t)?{defaultChecked:!!e}:{defaultValue:e}}function no(t,e){let n=je(t);return c(e)?Je(e,n):e}var ro=/^#\/definition\//,fn=new WeakMap;function tt(t=[],e){if(!yn(e))return mn(t);let n=fn.get(t);return n||(n=new WeakMap,fn.set(t,n)),n.has(e)||n.set(e,mn(j(t,e))),n.get(e)}function mn(t){return Array.isArray(t)?t.filter(oo).sort((e,n)=>gn(e)-gn(n)):[]}function j(t,e,n=new Map,r=new WeakSet){if(!yn(e)||!t||typeof t!="object")return t;if(n.has(t))return n.get(t);if(r.has(t))return t;if(r.add(t),Array.isArray(t)){let l=!1,a=t.map(s=>{let u=j(s,e,n,r);return l||=u!==s,u});return r.delete(t),n.set(t,l?a:t),n.get(t)}if(L in t&&c(t[L])){let l=t[L].replace(ro,""),a=p(e,l);return a!==null?j(a,e,n,r):t}let o={},i=!1;for(let[l,a]of Object.entries(t))o[l]=j(a,e,n,r),i||=o[l]!==a;return r.delete(t),n.set(t,i?o:t),n.get(t)}function pn(t){return Object.entries(t??{})}function gn(t){return t.order??Number.MAX_VALUE}function yn(t){return t!==void 0&&f(t)&&Object.keys(t).length>0}function oo(t){return ge in t?!0:Array.isArray(t[ft])?t[ft].length>0:!0}function xn(t,e){let n={};for(let[r,o]of pn(e))n[`${t}-${r}`]=o;return n}function io(t){return xn(se,t)}function lo(t){return xn(ce,t)}function bn(t,e){let n=io(t.advanced?.aria);return e&&e.length>0&&(n[ie]="true",n[oe]=`${t.name}-error`),n}function Tn(t){return lo(t.advanced?.data)}var hn={1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3"},Rn={1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3"};function Sn(t,e=2){return hn[t&&t in hn?t:e]}function An(t){if(t&&t in Rn)return Rn[t]}function ao(t){return{min:t.advanced?.length?.min??1,max:t.advanced?.length?.max??1/0}}function so(t,e){let n=e?p(e,t.name):null;return co(t,Array.isArray(n)?n.length:0)}function Fn(t){return!Array.isArray(t.fields)||t.fields.length===0?!1:t.fields.length>1||t.fields[0].type===P}function Nn(t,e){let n=so(t,e);return Array.from({length:n},(r,o)=>o)}function Cn(t){return t.advanced?.title??t.label??t.name}function co(t,e){let{min:n,max:r}=ao(t);return Math.min(Math.max(e,n),r)}function et(t,e){let n={...t};for(let r of Object.keys(e??{})){let o=e?.[r];o!==void 0&&(n[r]=o)}return n}var En=require("react/jsx-runtime");function A(t){return Ne(t,(e,n,r)=>(0,En.jsx)("a",{className:"underline",href:n,rel:"noopener noreferrer",target:"_blank",children:r},`${n}-${e}`))}var F=require("react/jsx-runtime");function wn(t){let e=(0,F.jsxs)("div",{className:"flex flex-col",children:[t.title&&(0,F.jsx)("legend",{className:"mb-3 font-medium text-zinc-800 dark:text-zinc-200",children:A(t.title)}),t.description&&(0,F.jsx)("p",{className:"-mt-2 text-sm leading-normal font-normal text-zinc-600 dark:text-zinc-400",children:A(t.description)})]});return t.step?(0,F.jsxs)("div",{className:"flex flex-row items-start gap-4",children:[(0,F.jsx)("div",{className:"bg-primary text-primary-foreground flex size-6 shrink-0 items-center justify-center rounded-full",children:(0,F.jsx)("span",{className:"text-sm font-bold",children:t.step})}),e]}):e}var V=require("react/jsx-runtime");function nt(t){return(0,V.jsxs)("fieldset",{className:"flex w-full min-w-0 flex-col data-[empty=false]:gap-6","data-empty":t.empty,"data-slot":"field-set",id:t.id,children:[(0,V.jsx)(wn,{description:t.description,step:t.step,title:t.title}),(0,V.jsx)("div",{className:"w-full min-w-0",children:t.children})]})}var In=require("react/jsx-runtime");function O(t){return(0,In.jsx)("div",{"data-slot":"field-group","data-compact":t.compact,className:"flex w-full flex-col gap-8 data-[compact=true]:gap-3",children:t.children})}var h=require("react/jsx-runtime");function kn(t){let{fields:e=[]}=t.section,n=t.advanced?.step?t.step:void 0,{compact:r}=et(t.style,{compact:t.section.advanced?.compact}),o=(0,h.jsx)(O,{compact:r,children:t.children});if(!t.section.title&&!t.section.description)return o;let i=v(t.section.title,t.translations),l=v(t.section.description,t.translations);return t.section.advanced?.collapsible?(0,h.jsxs)("fieldset",{"data-slot":"field-set","data-advanced":"true","data-expanded":!0,"data-empty":e.length===0,className:"flex flex-col",id:t.section.id?.toString(),children:[(0,h.jsx)("legend",{children:(0,h.jsx)("span",{className:"flex items-center gap-2 text-base font-medium text-zinc-600 dark:text-zinc-400",children:A(i)})}),(0,h.jsxs)("div",{className:"mt-3 ml-1.5 flex flex-col gap-4 border-l-2 border-zinc-300 pl-4 dark:border-zinc-600","data-slot":"field-set-content",children:[l&&(0,h.jsx)("p",{className:"text-sm leading-normal font-normal text-zinc-600 dark:text-zinc-400",children:A(l)}),o]})]}):(0,h.jsx)(nt,{description:l,empty:e.length===0,id:t.section.id?.toString(),step:n,title:i,children:o})}var wt=require("react/jsx-runtime");function Ln(){return(0,wt.jsx)("div",{"data-slot":"field-separator",className:"relative -my-2 h-5 text-sm",children:(0,wt.jsx)("div",{className:"absolute inset-0 top-1/2 h-px w-full bg-zinc-200 dark:bg-zinc-800"})})}function uo(t,e){return t.fields.every(n=>Dn(n,e))}function Dn(t,e){return e[t.name]?.hidden??t.hidden??!1}function fo(t,e){return w(t)?uo(t,e):Dn(t,e)}function vn(t,e,n){return n&&(t[n.name]?.hidden??n.hidden??!1)||e.length===0?!0:e.every(r=>fo(r,t))}var R=require("react/jsx-runtime");function mo(t){return vn({},t.fields)?null:t.children}function On(t){let e=tt(t.sections,t.definition),n=t.guard??mo,r=t.fieldSet??kn;return(0,R.jsx)("div",{className:"h-full w-full",children:(0,R.jsx)("form",{noValidate:t.noValidate,action:t.action,onSubmit:t.onSubmit,children:(0,R.jsxs)(O,{children:[e.map((o,i)=>(0,R.jsxs)(n,{fields:o.fields??[],children:[(0,R.jsx)(r,{advanced:t.advanced,section:o,step:i+1,style:t.config.style,translations:t.translations,children:t.children({disabled:t.readOnly,fields:o.fields})}),o.advanced?.separator&&(0,R.jsx)(Ln,{})]},`key-${o.id}-${i}`)),t.control&&(0,R.jsx)(Pt,{isPending:t.isPending,children:t.control})]})})})}var Pn=require("tailwind-merge"),G=require("react/jsx-runtime");function Mn(t){let e=t.style?.showOptionalLabel??!0,n=E(t.field)||y(t.field);return(0,G.jsxs)("label",{"data-slot":"field-label","data-normal":n,className:(0,Pn.twMerge)("flex w-fit items-center text-sm leading-snug font-medium select-none","data-[normal=true]:font-normal [[data-slot=column]_&]:md:w-full","group-data-[readonly=true]:cursor-not-allowed group-data-[readonly=true]:opacity-50"),htmlFor:t.field.name,title:c(t.children)?t.children:void 0,children:[(0,G.jsx)("span",{className:"[[data-slot=column]_&]:md:truncate",children:t.children}),e&&!t.field.required&&(0,G.jsx)("span",{className:"ml-2 flex-shrink-0 text-sm text-zinc-600 dark:text-zinc-400",children:en("(Optional)",t.translations)})]})}var It=require("react/jsx-runtime");function go(t){return(0,It.jsx)("p",{className:"-mt-2 text-xs leading-normal font-normal text-zinc-600 dark:text-zinc-400 [[data-slot=column]_&]:md:line-clamp-2",title:t.title,children:t.children})}function rt(t){let e=c(t.text)?t.text:t.text?.message;if(!e)return null;let n=W(e,{context:t.context,env:t.config?.env},{locale:t.config?.env?.locale});return(0,It.jsx)(go,{title:c(t.text)?void 0:t.text?.title,children:A(T(n,t.translations))})}var _n=require("react/jsx-runtime");function ot(t){return(0,_n.jsx)(rt,{config:t.config,context:t.context,text:t.field.description,translations:t.translations})}var B=require("react/jsx-runtime");function zn(t){let e=t.description??ot,n={context:t.context,env:t.config?.env},r=t.config?.env?.locale,o=W(t.field.label,n,{locale:r});return(0,B.jsxs)("div",{"data-slot":"field-content",className:"flex w-full flex-1 flex-col gap-1.5 leading-snug",children:[(0,B.jsx)(Mn,{field:t.field,style:t.config?.style,translations:t.translations,children:T(o,t.translations)}),t.horizontal===!0&&(0,B.jsx)(e,{config:t.config,context:t.context,field:t.field,translations:t.translations})]})}var I=require("react/jsx-runtime");function Vn(t){let e=t.description??ot;return(0,I.jsxs)(I.Fragment,{children:[t.field.name&&t.field.label&&(0,I.jsx)(zn,{config:t.config,context:t.context,description:t.description,field:t.field,horizontal:t.horizontal,translations:t.translations}),t.children,t.horizontal===!1&&(0,I.jsx)(e,{config:t.config,context:t.context,field:t.field,translations:t.translations})]})}function Gn(t,e){return t?e(t):null}var kt=require("react/jsx-runtime");function Bn(t){let e=cn(t.field,t.value),{commonPropsWithOptions:n,defaultValue:r}=un(t.field,t.commonProps,e,t.value,t.translations),o=dn(t.field,r);return Gn(t.config.inputs[t.field.type],i=>(0,kt.jsx)(Vn,{config:t.config,context:t.context,field:t.field,horizontal:t.horizontal,translations:t.translations,children:(0,kt.jsx)(i,{...t.ariaAttributes,...n,...t.dataAttributes,...o})}))}var Hn=require("tailwind-merge"),Un=require("react/jsx-runtime");function it(t){let e=t.errors&&t.errors.length>0;return(0,Un.jsx)("div",{"data-slot":"field","data-clickable":t.isClickable?"true":"false",...e&&{[le]:"true"},...t.disabled&&{[ae]:"true"},"data-orientation":t.orientation,className:(0,Hn.twMerge)("group flex w-full flex-col items-center data-[invalid=true]:text-red-600 data-[invalid=true]:dark:text-red-500","data-[clickable=true]:items-start",t.isCheckbox&&(t.isReversed?"flex-row-reverse!":"flex-row!"),"data-[clickable=true]:has-[>[data-slot=field-content]]:[&>:first-child]:mt-px",t.className),children:t.children})}var $n=require("tailwind-merge"),Xn=require("react/jsx-runtime");function Yn(t){return(0,Xn.jsx)(it,{...t,orientation:"vertical",className:(0,$n.twMerge)("gap-3 has-[>[data-slot=field-content]]:items-start",!t.isClickable&&"[&>*]:w-full"),children:t.children})}var Kn=require("tailwind-merge"),Zn=require("react/jsx-runtime");function Wn(t){return(0,Zn.jsx)(it,{...t,orientation:"horizontal",className:(0,Kn.twMerge)("gap-2 md:flex-row md:gap-4","[&>[data-slot=field-content]]:min-w-0 [&>[data-slot=field-content]]:flex-grow [&>[data-slot=field-content]]:self-start","[&_[role=checkbox]]:mt-[1.5px]",t.isClickable&&"md:flex-col",!t.isClickable&&["md:justify-between","[&>*:not([data-slot=field-content])]:w-full","[&>*:not([data-slot=field-content])]:md:w-1/2","[&>*:not([data-slot=field-content])]:xl:w-2/5"]),children:t.children})}var Lt=require("react/jsx-runtime");function qn(t){let e=_e(t.field),n=y(t.field),r=Ge(t.field);return t.horizontal?(0,Lt.jsx)(Wn,{disabled:t.disabled,errors:t.errors,isCheckbox:n,isReversed:r,isClickable:e,children:t.children}):(0,Lt.jsx)(Yn,{disabled:t.disabled,errors:t.errors,isCheckbox:n,isReversed:r,isClickable:e,children:t.children})}function Jn(t){if(!t.field.type)return null;let e=rn(t.field,t.disabled,{lang:t.lang,translations:t.translations}),n=Tn(t.field),r=bn(t.field,t.errors),o=!!t.field.disabled===e.disabled?t.field:{...t.field,disabled:e.disabled};return t.children({ariaAttributes:r,commonProps:e,dataAttributes:n,field:o,horizontal:t.horizontal,readOnly:t.readOnly})}var Qn=require("tailwind-merge"),lt=require("react/jsx-runtime");function jn(t){let e=t.field.advanced?.cols,{horizontal:n=!1}=et(t.style,{horizontal:Ve(t.field)}),r=Be(t.field,t.disabled),o=He(t.field,t.disabled);return(0,lt.jsx)("div",{className:(0,Qn.twMerge)("flex flex-col gap-3",An(e)),children:(0,lt.jsx)(qn,{disabled:r,field:t.field,horizontal:n,children:(0,lt.jsx)(Jn,{disabled:r,field:t.field,horizontal:n,lang:t.lang,readOnly:o,translations:t.translations,children:t.children})})})}var er=require("react/jsx-runtime");function tr(t){let e=Array.isArray(t.field.fields)&&t.field.fields.length===0,n=v(t.field.label,t.translations),r=v(t.field.description,t.translations);return(0,er.jsx)(nt,{description:r,empty:e,id:t.field.name,title:n,children:t.children})}var k=require("react/jsx-runtime");function nr(t){let e=T(Cn(t.field),t.translations),n=Fn(t.field);return(0,k.jsx)(tr,{field:t.field,translations:t.translations,children:Nn(t.field,t.value).map(r=>(0,k.jsxs)("div",{"data-slot":n?"list-item-card":void 0,className:n?"box-border w-full min-w-0 rounded-lg border border-zinc-100 p-4 dark:border-zinc-900":"box-border flex w-full min-w-0 flex-col gap-2",children:[n&&(0,k.jsx)("div",{className:"flex min-w-0 flex-col font-medium text-zinc-700 dark:text-zinc-400",children:(0,k.jsxs)("span",{className:"text-base",children:[e," ",r+1]})}),(0,k.jsx)(O,{children:t.children(r)})]},r))})}var rr=require("tailwind-merge"),H=require("react/jsx-runtime");function or(t){let e=t.description??rt,n=Sn(t.column?.advanced?.cols);return(0,H.jsxs)("div",{className:"flex w-full flex-col gap-4",children:[(0,H.jsx)("div",{"data-slot":"column",className:(0,rr.twMerge)("grid grid-cols-1 gap-3 sm:gap-4",n),children:t.children}),t.column?.description&&(0,H.jsx)(e,{config:t.config,context:t.context,text:t.column.description,translations:t.translations})]})}var sr=require("react");var ir=require("react"),ar=require("react/jsx-runtime");function lr(t){let{fields:e,name:n}=t.field,{index:r}=t,o=(0,ir.useMemo)(()=>Array.isArray(e)?e.map(i=>q(i)||Z(i)?{...i,name:`${n}.${r}.${i.name}`}:w(i)?{...i,fields:i.fields.map(l=>({...l,name:`${n}.${r}.${l.name}`}))}:i):[],[r,n,e]);return(0,ar.jsx)(U,{components:t.components,config:t.config,context:t.context,disabled:t.disabled,fields:o,lang:t.lang,onValueChange:t.onValueChange,style:t.style,translations:t.translations,value:t.value,children:t.children})}var N=require("react/jsx-runtime");function po(t,e){return w(t)?`column:${t.fields.map(r=>r.name).join("|")||e}`:t.name||`slot:${e}`}function U(t){let{field:e,list:n}=t.components;return tt(t.fields).map((r,o)=>(0,N.jsxs)(sr.Fragment,{children:[w(r)&&(0,N.jsx)(or,{column:r,config:t.config,context:t.context,description:t.components.description,translations:t.translations,children:(0,N.jsx)(U,{...t,fields:r.fields})}),q(r)&&(0,N.jsx)(e,{disabled:t.disabled,field:r,lang:t.lang,style:t.style,translations:t.translations,children:t.children}),Z(r)&&(0,N.jsx)(n,{field:r,lang:t.lang,onValueChange:t.onValueChange,translations:t.translations,value:t.value,children:i=>(0,N.jsx)(lr,{components:t.components,config:t.config,context:t.context,disabled:t.disabled,field:r,index:i,lang:t.lang,onValueChange:t.onValueChange,style:t.style,translations:t.translations,value:t.value,children:t.children})})]},po(r,o)))}var ur=require("react/jsx-runtime");function cr(t){return n=>(0,ur.jsx)(U,{...n,components:t})}var dr=cr({field:jn,list:nr});var at=require("react/jsx-runtime");function st(t){let e=nn(t.lang,t.translations);return(0,at.jsx)(On,{advanced:t.advanced,config:t.config,control:t.children,definition:t.definition,readOnly:t.readOnly,sections:t.sections,translations:e,children:({disabled:n,fields:r})=>(0,at.jsx)(dr,{config:t.config,context:t.context,disabled:n,fields:r,lang:t.lang,style:t.config.style,translations:e,value:t.value,children:o=>(0,at.jsx)(Bn,{...o,config:t.config,context:t.context,translations:e,value:t.value})})})}var fr=require("react");var Dt=require("react/jsx-runtime");function mr(t){return(0,Dt.jsx)(fr.Suspense,{fallback:(0,Dt.jsx)(st,{config:t.config,sections:t.sections,readOnly:!0}),children:t.children})}
|
package/dist/server/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as Rr}from"react/jsx-runtime";function ke(e){let t=typeof e.children=="function"?e.children({isPending:e.isPending}):e.children;return Rr("div",{"data-slot":"field-control",className:"w-full",children:t})}import{jsx as Le}from"react/jsx-runtime";function C(e){return Le("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:`size-4 transition-transform duration-200 ${e.expanded?"rotate-90":""}`,children:Le("path",{fillRule:"evenodd",d:"M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})})}import{Activity as Tr}from"react";import{createContext as hr}from"react";var Ee=hr(!1);import{jsx as Oe}from"react/jsx-runtime";function I({children:e,visible:t}){return Oe(Tr,{mode:t?"visible":"hidden",children:Oe(Ee,{value:!0,children:e})})}var H="input",De="input/date",Pe="input/email",Me="input/number",_e="input/time";var ze="textarea",Ve="radio",Be="checkbox",ae="list",He="select",Ge="select/active",Ue="select/day",$e="select/month",Ye="select/timezone",Xe="select/year";var Ke="chips",We="chips/day",Ze="chips/month",k="column",qe="description",se="fields",Je="label",ce="value",G="options",de="email",Qe="number",je="password",et="tel",L="text",tt="aria-errormessage",nt="aria-invalid",rt="data-invalid",ot="data-readonly",it="aria",lt="data",at="max",st="maxLength",ct="min",dt="minLength",S="$ref";var ut="type",ft={Africa:"Africa",America:"Americas",Asia:"Asia / Pacific",Atlantic:"Atlantic",Australia:"Asia / Pacific",Europe:"Europe",Indian:"Asia / Pacific",Pacific:"Asia / Pacific"};import{format as Fr,formatDistanceToNow as gt,formatDuration as Cr,intervalToDuration as Sr,isValid as U,parseISO as Nr}from"date-fns";import{enUS as pt,es as ue}from"date-fns/locale";function u(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function p(e){return c(e)||typeof e=="number"||Ar(e)}function mt(e){return Array.isArray(e)&&e.every(p)}function c(e){return typeof e=="string"}function Ar(e){return typeof e=="boolean"}var yt={en:pt,"en-US":pt,es:ue,"es-ES":ue,"es-MX":ue},vr={short:"M/d/yy",medium:"MMM d, yyyy",long:"MMMM d, yyyy",full:"EEEE, MMMM d, yyyy"},wr={ms:1,s:1e3,min:6e4,h:36e5,d:864e5};function xt(e){if(e)return yt[e]??yt[e.split("-")[0]]}function $(e){if(typeof e=="number"&&!Number.isNaN(e))return e;if(c(e)&&e.trim()!==""){let t=Number(e);return Number.isNaN(t)?null:t}return null}function bt(e,t,n){let r=wr[t];if(r===void 0)return String(e);let o=e*r,i=Sr({start:0,end:o});return Cr(i,{locale:n})}function Rt(e){if(e instanceof Date)return U(e)?e:null;if(c(e)){let t=Nr(e);if(U(t))return t;let n=new Date(e);return U(n)?n:null}if(typeof e=="number"){let t=new Date(e);return U(t)?t:null}return null}var Ir={currency:(e,t,n)=>{let r=$(e);if(r===null)return String(e);let o=t[0]??"USD";return new Intl.NumberFormat(n.locale,{style:"currency",currency:o}).format(r)},percent:(e,t,n)=>{let r=$(e);return r===null?String(e):new Intl.NumberFormat(n.locale,{style:"percent"}).format(r)},number:(e,t,n)=>{let r=$(e);return r===null?String(e):new Intl.NumberFormat(n.locale).format(r)},date:(e,t,n)=>{let r=Rt(e);if(!r)return String(e);let o=t[0]??"short",i=xt(n.locale);if(o==="relative")return gt(r,{addSuffix:!0,locale:i});let l=vr[o]??o;return Fr(r,l,{locale:i})},duration:(e,t,n)=>{let r=xt(n.locale);if(typeof e=="number")return bt(e,t[0]??"ms",r);if(c(e)){let i=$(e);if(i!==null)return bt(i,t[0]??"ms",r)}let o=Rt(e);return o?gt(o,{addSuffix:!0,locale:r}):String(e)}};function ht(e,t,n){let r=t.split(":").map(a=>a.trim()).filter(a=>a.length>0);if(r.length===0)return;let[o,...i]=r,l=Ir[o];if(l)return l(e,i,n)}function Tt(e,t=ce){if(e!=null){if(mt(e)||p(e))return e;if(u(e)){let n=kr(e,t);if(p(n))return n}}}function kr(e,t){let n=y(e,t);if(p(n))return n}function y(e,t){if(!t||!u(e))return null;let n=t.split(".").filter(o=>o!=="");if(n.length===0)return null;let r=e;for(let o of n)if(u(r)&&o in r)r=r[o];else if(Array.isArray(r)){let i=Number(o);if(!Number.isInteger(i)||i<0||i>=r.length)return null;r=r[i]}else return null;return r}function At(e,t={description:qe,label:Je,value:ce}){return e.map(n=>{if(u(n)){let r=y(n,t.label),o=y(n,t.value);if(p(r)&&p(o)){let i=y(n,t.description);return{label:`${r}`,value:`${o}`,...p(i)&&{description:`${i}`}}}}return n})}function Ft(e=L){let t=e.lastIndexOf("/"),n=t===-1?e:e.slice(t+1);return n&&n!==H?n.trim().toLowerCase():L}var Lr=/\[([^\]]{1,500})\]\(([^)]{1,2000})\)/g,Er=/{([^}]{1,200})}/,Or=/{([^}]{1,200})}/g;function E(e,t={},n={}){if(c(e))return Pr(e,t,n);if(Array.isArray(e))return e.map(r=>E(r,t,n));if(u(e)){let r={};for(let o in e)r[o]=E(e[o],t,n);return r}return e}function O(e,t={},n={}){return fe(e)?E(e,t,n):e}function fe(e){return c(e)?Er.test(e):Array.isArray(e)?e.some(t=>fe(t)):u(e)?Object.values(e).some(t=>fe(t)):!1}function Dr(e,t){return t.includes(".")?y(e,t):e[t]}function Pr(e,t={},n={}){return e.replace(Or,(r,o)=>{let i=String(o).split("|").map(m=>m.trim()),[l,...a]=i;if(!l)return r;let s=Dr(t,l);if(a.length===0)return p(s)?String(s):r;if(s==null)return r;let d=s;for(let m of a){let B=ht(d,m,{locale:n.locale});if(B===void 0)return r;d=B}return String(d)})}function Ct(e,t){if(!c(e)||!e||e.trim().length===0)return null;let n,r=0,o=!1,i=[];for(;(n=Lr.exec(e))!==null;){let[l,a,s]=n,d=n.index;o=!0,d>r&&i.push(e.substring(r,d));let m=t?t(d,s,a):l;i.push(m),r=d+l.length}return o?(r<e.length&&i.push(e.substring(r)),i):e}var St=e=>f(Ge)(e),Nt=e=>f(Ue)(e),vt=e=>f($e)(e),wt=e=>f(Xe)(e),It=e=>f(Ye)(e),kt=e=>f(We)(e),Lt=e=>f(Ze)(e),Et=f(De),me=f(_e),x=f(Be),N=f(Ke),F=f(Ve),Ot=f(H),h=f(He),Dt=f(ze),Pt=f(L,de,je,et),Ii=f(Pe,de),Mt=f(Me,Qe);function _t(e){return F(e)||x(e)}function Y(e){return e.type===ae}function v(e){return e.type===k}function X(e){return e.type!==k&&e.type!==ae}function ge(e){return h(e)||F(e)||N(e)}function D(e){return e!=null&&e!==""}function f(...e){return t=>{let n=c(t.type)?t.type:void 0;return n?e.some(r=>n===r||n?.startsWith(`${r}/`)):!1}}function zt(e,t={}){if(h(e)&&e.disabled){let n=e.name?t?.[e.name]:void 0;if(n&&u(n))return[n]}}function Vt(e){return F(e)||x(e)?!0:e.advanced?.horizontal}function Bt(e){return x(e)?e.advanced?.reverse!==!1:!1}function Ht(e,t){let n=e.readonly??!1;return t||n}function pe(e){if(Mr(e)){let t=e.source;if(Array.isArray(t)||u(t)&&!(S in t))return t}}function Gt(e){return Array.isArray(pe(e))}function Mr(e){return F(e)||N(e)||h(e)&&!e.disabled}import{isValid as Yt,parse as Xt,format as Kt}from"date-fns";var _r=/^\d+$/,Wt=new Date(2e3,0,1),zr=()=>"supportedValuesOf"in Intl?Intl.supportedValuesOf("timeZone"):[],ye="default";function Zt(e){if(!e)return ye;try{return Intl.getCanonicalLocales(e)[0]??ye}catch{return ye}}function xe(e){let t=Zt(e);return Array.from({length:12},(n,r)=>({value:(r+1).toString(),label:new Date(0,r).toLocaleString(t,{month:"long"})}))}function be(e){let t=Zt(e);return Array.from({length:7},(n,r)=>({value:r.toString(),label:new Date(2e3,0,2+r).toLocaleString(t,{weekday:"long"})}))}function qt(e,t){return t>=e?Array.from({length:t-e+1},(n,r)=>{let o=e+r;return{value:o.toString(),label:o.toString()}}):[]}function Re(){return new Date().getFullYear()}function Vr(){return Intl.DateTimeFormat().resolvedOptions().timeZone}function Br(e){let t=e.indexOf("/"),n=t===-1?e:e.slice(0,t);return ft[n]??"Other"}function Hr(e,t){return(e.find(r=>r.type==="timeZoneName")?.value??t).replace(/\s+(?:Standard|Daylight(?: Saving)?|Summer|Winter)\s+Time$/,"")}function Ut(e,t){let n=new Intl.DateTimeFormat("en",{timeZone:e,timeZoneName:"longOffset"}).formatToParts(t),r=new Intl.DateTimeFormat("en",{timeZone:e,timeZoneName:"long"}).formatToParts(t),i=(n.find(a=>a.type==="timeZoneName")?.value??"GMT+00:00").replace("GMT","UTC"),l=Hr(r,e);return{offset:i,longName:l}}function $t(e){return e.slice(e.lastIndexOf("/")+1).replace(/_/g," ")}function Jt(){let e=new Date,t=Vr(),n=new Map,r=$t(t),{offset:o,longName:i}=Ut(t,e),l={value:t,label:`${r} - ${i} (${o})`};for(let s of zr()){if(s===t)continue;let d=$t(s),{offset:m,longName:B}=Ut(s,e),we={value:s,label:`${d} - ${B} (${m})`},le=Br(s);if(le==="Other")continue;let Ie=n.get(le);Ie?Ie.push(we):n.set(le,[we])}for(let s of n.values())s.sort((d,m)=>d.label.localeCompare(m.label));let a=Array.from(n.entries()).sort(([s],[d])=>s.localeCompare(d)).map(([s,d])=>({label:s,items:d}));return[{label:"Suggested",items:[l]},...a]}function he(e,t){if(typeof e=="number")return e;let n=t??Re(),r=e.trim().toLowerCase();if(r.startsWith("current")){let o=r.match(/^current([+-])(\d+)$/);if(o){let[,i,l]=o,a=parseInt(l,10);if(!isNaN(a))return i==="+"?n+a:n-a}return n}return _r.test(r)?parseInt(r,10):n}function Qt(e,t){if(!e)return"";try{let n=Xt(e,t,Wt);return Yt(n)?Kt(n,"yyyy-MM-dd"):""}catch{return""}}function jt(e,t){if(!e)return"";try{let n=Xt(e,t,Wt);return Yt(n)?Kt(n,"HH:mm:ss"):""}catch{return""}}function Te(e){return e.advanced?.format??"HH:mm"}function en(e){return e.advanced?.format??"MMMM d, yyyy"}var Gr={es:{"(Optional)":"(Opcional)","Add item":"A\xF1adir elemento","An unexpected error occurred submitting the form.":"Ocurri\xF3 un error inesperado al enviar el formulario.","Collapse {label} {index}":"Contraer {label} {index}","Expand {label} {index}":"Expandir {label} {index}","Please correct the errors and try again.":"Corrige los errores e int\xE9ntalo de nuevo.","Remove {label} item {index}":"Eliminar {label} {index}","There were validation errors submitting the form.":"Se encontraron errores de validaci\xF3n al enviar el formulario.","Unknown error":"Error desconocido",No:"No",Yes:"S\xED"}};function K(e,t){return b(e,t)}function nn(e,t){let n=t?.[e??""],r=e?Gr[Ur(e)]:void 0;return r?n?{...r,...n}:r:n}function Ur(e){return e.toLowerCase().split(/[-_]/)[0]}function b(e,t){return e?t?t[e]??e:e:""}function w(e,t){return e?b(e,t):void 0}function W(e,t){if(!t)return e;let n=!1,r=e.map(o=>{let i=$r(o,t);return i!==o&&(n=!0),i});return n?r:e}function $r(e,t){if(!u(e))return e;let n=tn(e.label,t),r=e.items;if(Array.isArray(r)){let i=W(r,t);return i===r&&n===e.label?e:{...e,...n!==void 0&&{label:n},items:i}}let o=tn(e.description,t);return n===e.label&&o===e.description?e:{...e,...n!==void 0&&{label:n},...o!==void 0&&{description:o}}}function tn(e,t){return c(e)?b(e,t):e}var Z=Re();function Yr(e,t){if(N(e))return Xr(e,t?.lang)}function Xr(e,t){if(kt(e))return be(t);if(Lt(e))return xe(t)}function Kr(e,t){if(h(e))return Wr(e,t)}function Wr(e,t){let{lang:n,translations:r}=t??{};if(Nt(e))return be(n);if(vt(e))return xe(n);if(wt(e)){let o=e.advanced?.length?.min??Z,i=e.advanced?.length?.max??Z+5;return qt(he(o,Z),he(i,Z))}if(It(e))return Jt();if(St(e))return W([{value:"true",label:"Yes"},{value:"false",label:"No"}],r)}function rn(e,t=!1,n){let r={disabled:t,id:e.name,name:e.name,placeholder:e.placeholder,required:e.required};return Ot(e)?{...r,...Zr(e)}:h(e)?{...r,...on(Kr(e,n))}:Dt(e)?{...r,...Jr(e)}:N(e)?{...r,...qr(e,n)}:r}function Zr(e){let t=Ft(e.type),n={...e,type:t};return{...jr(e),...ln(e),...Qr(n),...Pt(n)?an(n):{},type:t}}function on(e){return e?{options:e}:{}}function qr(e,t){let n=on(Yr(e,t)),r=e.advanced?.multiple??!0;return{...n,multiple:r}}function Jr(e){return{...ln(e),...an(e)}}function ln(e){let t=e.advanced?.autocomplete;return t?{autoComplete:t}:{}}function Qr(e){return Mt(e)?eo(e):{}}function jr(e){if(me(e)){let t=Te(e);return{step:t==="HH:mm:ss"||t==="hh:mm:ss a"?"1":"60"}}return{}}function an(e){return sn(e,{min:dt,max:st})}function eo(e){return sn(e,{min:ct,max:at})}function sn(e,t){let n={},r=e.advanced?.length;return r&&(r.min!==void 0&&(n[t.min]=r.min),r.max!==void 0&&(n[t.max]=r.max)),n}function cn(e,t){let n=pe(e);return n||zt(e,t)}function to(e,t){let n=u(t)&&e.name in t?t[e.name]:t,r=Tt(n,e.advanced?.entity),o=D(r)?r:e.defaultValue;return me(e)&&D(o)?no(e,o):Et(e)&&D(o)?lo(e,o):o}function no(e,t){let n=Te(e);return c(t)?jt(t,n):t}function ro(e,t,n){return ge(e)&&Array.isArray(n)?{...t,[G]:n}:t}function oo(e,t,n){if(e.required&&!D(n)&&h(e)&&e.advanced?.preselected!==!1&&G in t){let r=t[G];if(Array.isArray(r)&&r.length===1)return r[0]}return n}function io(e,t,n){if(ge(e)&&Array.isArray(t)){let r=At(t,e.advanced?.options);return Gt(e)?W(r,n):r}return t}function dn(e,t,n,r,o){let i=to(e,r),l=Array.isArray(n)?io(e,n,o):n,a=ro(e,t,l),s=oo(e,a,i);return{commonPropsWithOptions:a,defaultValue:s}}function un(e,t){return x(e)?{defaultChecked:!!t}:{defaultValue:t}}function lo(e,t){let n=en(e);return c(t)?Qt(t,n):t}var ao=/^#\/definition\//;function J(e=[],t){let n=q(e,t);return Array.isArray(n)?n.filter(co).sort((r,o)=>fn(r)-fn(o)):[]}function q(e,t,n=new Map,r=new WeakSet){if(!so(t)||!e||typeof e!="object")return e;if(n.has(e))return n.get(e);if(r.has(e))return e;if(r.add(e),Array.isArray(e))return e.map(i=>q(i,t,n,r));if(S in e&&c(e[S])){let i=e[S].replace(ao,""),l=y(t,i);return l!==null?q(l,t,n,r):e}let o={};for(let[i,l]of Object.entries(e))o[i]=q(l,t,n,r);return r.delete(e),n.set(e,o),o}function mn(e){return Object.entries(e??{})}function fn(e){return e.order??Number.MAX_VALUE}function so(e){return e!==void 0&&u(e)&&Object.keys(e).length>0}function co(e){return ut in e?!0:Array.isArray(e[se])?e[se].length>0:!0}function gn(e,t){let n={};for(let[r,o]of mn(t))n[`${e}-${r}`]=o;return n}function uo(e){return gn(it,e)}function fo(e){return gn(lt,e)}function pn(e,t){let n=uo(e.advanced?.aria);return t&&t.length>0&&(n[nt]="true",n[tt]=`${e.name}-error`),n}function yn(e){return fo(e.advanced?.data)}var xn={1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3"},bn={1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3"};function Rn(e,t=2){return xn[e&&e in xn?e:t]}function hn(e){if(e&&e in bn)return bn[e]}function mo(e){return{min:e.advanced?.length?.min??1,max:e.advanced?.length?.max??1/0}}function go(e,t){let n=t?y(t,e.name):null;return po(e,Array.isArray(n)?n.length:0)}function Tn(e){return!Array.isArray(e.fields)||e.fields.length===0?!1:e.fields.length>1||e.fields[0].type===k}function An(e,t){let n=go(e,t);return Array.from({length:n},(r,o)=>o)}function Fn(e){return e.advanced?.title??e.label??e.name}function po(e,t){let{min:n,max:r}=mo(e);return Math.min(Math.max(t,n),r)}function Q(e,t){let n={...e};for(let r of Object.keys(t??{})){let o=t?.[r];o!==void 0&&(n[r]=o)}return n}import{jsx as yo}from"react/jsx-runtime";function R(e){return Ct(e,(t,n,r)=>yo("a",{className:"underline",href:n,rel:"noopener noreferrer",target:"_blank",children:r},`${n}-${t}`))}import{useCallback as xo,useState as bo}from"react";import{jsx as P,jsxs as Ae}from"react/jsx-runtime";function Cn(e){let{fields:t=[]}=e.section,[n,r]=bo(!1),o=xo(()=>r(i=>!i),[]);return Ae("fieldset",{"data-slot":"field-set","data-advanced":"true","data-expanded":n,"data-empty":t.length===0,className:"flex flex-col",id:e.section.id?.toString(),children:[P("legend",{children:Ae("button",{className:"flex cursor-pointer items-center gap-2 text-base font-medium text-zinc-600 dark:text-zinc-400",onClick:o,type:"button",children:[P(C,{expanded:n}),P("span",{children:R(e.title)})]})}),P(I,{visible:n,children:Ae("div",{className:"mt-3 ml-1.5 flex flex-col gap-4 border-l-2 border-zinc-300 pl-4 dark:border-zinc-600","data-slot":"field-set-content",children:[e.description&&P("p",{className:"text-sm leading-normal font-normal text-zinc-600 dark:text-zinc-400",children:R(e.description)}),e.group]})})]})}import{jsx as j,jsxs as Sn}from"react/jsx-runtime";function Nn(e){let t=Sn("div",{className:"flex flex-col",children:[e.title&&j("legend",{className:"mb-3 font-medium text-zinc-800 dark:text-zinc-200",children:R(e.title)}),e.description&&j("p",{className:"-mt-2 text-sm leading-normal font-normal text-zinc-600 dark:text-zinc-400",children:R(e.description)})]});return e.step?Sn("div",{className:"flex flex-row items-start gap-4",children:[j("div",{className:"bg-primary text-primary-foreground flex size-6 shrink-0 items-center justify-center rounded-full",children:j("span",{className:"text-sm font-bold",children:e.step})}),t]}):t}import{jsx as vn,jsxs as Ro}from"react/jsx-runtime";function ee(e){return Ro("fieldset",{className:"flex w-full min-w-0 flex-col data-[empty=false]:gap-6","data-empty":e.empty,"data-slot":"field-set",id:e.id,children:[vn(Nn,{description:e.description,step:e.step,title:e.title}),vn("div",{className:"w-full min-w-0",children:e.children})]})}import{jsx as ho}from"react/jsx-runtime";function T(e){return ho("div",{"data-slot":"field-group","data-compact":e.compact,className:"flex w-full flex-col gap-8 data-[compact=true]:gap-3",children:e.children})}import{jsx as Fe}from"react/jsx-runtime";function wn(e){let{fields:t=[]}=e.section,n=e.advanced?.step?e.step:void 0,{compact:r}=Q(e.style,{compact:e.section.advanced?.compact}),o=Fe(T,{compact:r,children:e.children});if(!e.section.title&&!e.section.description)return o;let i=w(e.section.title,e.translations),l=w(e.section.description,e.translations);return e.section.advanced?.collapsible?Fe(Cn,{description:l,group:o,section:e.section,title:i}):Fe(ee,{description:l,empty:t.length===0,id:e.section.id?.toString(),step:n,title:i,children:o})}import{jsx as In}from"react/jsx-runtime";function kn(){return In("div",{"data-slot":"field-separator",className:"relative -my-2 h-5 text-sm",children:In("div",{className:"absolute inset-0 top-1/2 h-px w-full bg-zinc-200 dark:bg-zinc-800"})})}import{useAtomValue as vo}from"jotai";import{atom as M}from"jotai";import{atomFamily as To}from"jotai-family";import{deepEqual as Ln}from"fast-equals";function Ao(e,t){let{[t]:n,...r}=e;return r}function Fo(e){return To(t=>M(n=>n(e)[t]??void 0,(n,r,o)=>{let i=n(e);if(o!=null){let l=i[t];Ln(l,o)||r(e,{...i,[t]:o})}else t in i&&r(e,Ao(i,t))}))}function Co(e){return M(null,(t,n)=>{let r=t(e);r&&Object.keys(r).length>0&&n(e,{})})}function So(e){return M(null,(t,n,r)=>{let i={...t(e)},l=!1;for(let a of r)a in i&&(delete i[a],l=!0);l&&n(e,i)})}function No(e){return M(null,(t,n,r)=>{let o=t(e);Ln(o,r)||n(e,r)})}function te(e={}){let t=M(e);return{atom:t,clearAll:Co(t),clear:So(t),bulkReport:No(t),report:Fo(t)}}var En=te(),On=En.atom,Dn=En.report;function wo(e,t){return e.fields.every(n=>Pn(n,t))}function Pn(e,t){return t[e.name]?.hidden??e.hidden??!1}function Io(e,t){return v(e)?wo(e,t):Pn(e,t)}function Mn(e){let t=vo(On);return e.container&&(t[e.container.name]?.hidden??e.container.hidden??!1)||e.fields.length===0||e.fields.every(r=>Io(r,t))?null:e.children}import{jsx as _,jsxs as _n}from"react/jsx-runtime";function zn(e){let t=J(e.sections,e.definition);return _("div",{className:"h-full w-full",children:_("form",{noValidate:e.noValidate,action:e.action,children:_n(T,{children:[t.map((n,r)=>_n(Mn,{fields:n.fields??[],children:[_(wn,{advanced:e.advanced,section:n,step:r+1,style:e.config.style,translations:e.translations,children:e.children({disabled:e.readOnly,fields:n.fields})}),n.advanced?.separator&&_(kn,{})]},`key-${n.id}-${r}`)),e.control&&_(ke,{isPending:e.isPending,children:e.control})]})})})}import{jsx as ko}from"react/jsx-runtime";function Vn(e){return ko("p",{className:"-mt-2 text-xs leading-normal font-normal text-zinc-600 dark:text-zinc-400 [[data-slot=column]_&]:md:line-clamp-2",title:e.title,children:e.children})}import{useState as Lo}from"react";import{jsx as Bn,jsxs as Hn}from"react/jsx-runtime";function ne(e){let t={context:e.context,env:e.config?.env,value:e.value},r={locale:e.config?.env?.locale},[o,i]=Lo(()=>u(e.text)&&"collapsed"in e.text?!e.text.collapsed:!0),l=()=>i(m=>!m),a=u(e.text)&&c(e.text.title)?R(b(O(e.text.title,t,r),e.translations)):void 0,s=b(O(c(e.text)?e.text:e.text?.message,t,r),e.translations),d=R(s);return d?Hn("div",{className:"flex flex-col gap-2",children:[a&&Hn("button",{className:"flex items-center gap-1 text-left text-xs font-medium text-zinc-700 hover:text-zinc-900 dark:text-zinc-300 dark:hover:text-zinc-100",onClick:l,type:"button",children:[a,Bn(C,{expanded:o})]}),o&&Bn(Vn,{title:s,children:d})]}):null}import{atom as Gn}from"jotai";var re=te(),aa=re.atom,sa=re.clearAll,ca=re.clear,Un=re.report,da=Gn({}),ua=Gn(null);import{useAtomValue as $n}from"jotai";import{jsx as Eo}from"react/jsx-runtime";function oe(e){let t=$n(Un(e.field.name)),r=$n(Dn(e.field.name))?.description??e.field.description;return Eo(ne,{config:e.config,context:e.context,text:r,translations:e.translations,value:t})}import{twMerge as Oo}from"tailwind-merge";import{jsx as Yn,jsxs as Do}from"react/jsx-runtime";function Xn(e){let t=e.style?.showOptionalLabel??!0,n=F(e.field)||x(e.field);return Do("label",{"data-slot":"field-label","data-normal":n,className:Oo("flex w-fit items-center text-sm leading-snug font-medium select-none","data-[normal=true]:font-normal [[data-slot=column]_&]:md:w-full","group-data-[readonly=true]:cursor-not-allowed group-data-[readonly=true]:opacity-50"),htmlFor:e.field.name,title:c(e.children)?e.children:void 0,children:[Yn("span",{className:"[[data-slot=column]_&]:md:truncate",children:e.children}),t&&!e.field.required&&Yn("span",{className:"ml-2 flex-shrink-0 text-sm text-zinc-600 dark:text-zinc-400",children:K("(Optional)",e.translations)})]})}import{jsx as Kn,jsxs as Po}from"react/jsx-runtime";function Wn(e){let t={context:e.context,env:e.config?.env},n=e.config?.env?.locale,r=O(e.field.label,t,{locale:n});return Po("div",{"data-slot":"field-content",className:"flex w-full flex-1 flex-col gap-1.5 leading-snug",children:[Kn(Xn,{field:e.field,style:e.config?.style,translations:e.translations,children:b(r,e.translations)}),e.horizontal===!0&&Kn(oe,{config:e.config,context:e.context,field:e.field,translations:e.translations})]})}import{Fragment as Mo,jsx as Zn,jsxs as _o}from"react/jsx-runtime";function qn(e){return _o(Mo,{children:[e.field.name&&e.field.label&&Zn(Wn,{config:e.config,context:e.context,field:e.field,horizontal:e.horizontal,translations:e.translations}),e.children,e.horizontal===!1&&Zn(oe,{config:e.config,context:e.context,field:e.field,translations:e.translations})]})}function Jn(e,t){return e?t(e):null}import{jsx as Qn}from"react/jsx-runtime";function jn(e){let t=cn(e.field,e.value),{commonPropsWithOptions:n,defaultValue:r}=dn(e.field,e.commonProps,t,e.value,e.translations),o=un(e.field,r);return Jn(e.config.inputs[e.field.type],i=>Qn(qn,{config:e.config,context:e.context,field:e.field,horizontal:e.horizontal,translations:e.translations,children:Qn(i,{...e.ariaAttributes,...n,...e.dataAttributes,...o})}))}import{jsx as er}from"react/jsx-runtime";function tr(e){return!e.errors||e.errors.length===0?null:er("ul",{className:"text-sm text-red-600 dark:text-red-500",id:e.name?`${e.name}-error`:void 0,children:e.errors?.map((t,n)=>er("li",{children:t},e.name?`${e.name}-error-${n}`:n))})}import{twMerge as zo}from"tailwind-merge";import{jsx as Vo}from"react/jsx-runtime";function ie(e){let t=e.errors&&e.errors.length>0;return Vo("div",{"data-slot":"field","data-clickable":e.isClickable?"true":"false",...t&&{[rt]:"true"},...e.disabled&&{[ot]:"true"},"data-orientation":e.orientation,className:zo("group flex w-full flex-col items-center data-[invalid=true]:text-red-600 data-[invalid=true]:dark:text-red-500","data-[clickable=true]:items-start",e.isCheckbox&&(e.isReversed?"flex-row-reverse!":"flex-row!"),"data-[clickable=true]:has-[>[data-slot=field-content]]:[&>:first-child]:mt-px",e.className),children:e.children})}import{twMerge as Bo}from"tailwind-merge";import{jsx as Ho}from"react/jsx-runtime";function nr(e){return Ho(ie,{...e,orientation:"vertical",className:Bo("gap-3 has-[>[data-slot=field-content]]:items-start",!e.isClickable&&"[&>*]:w-full"),children:e.children})}import{twMerge as Go}from"tailwind-merge";import{jsx as Uo}from"react/jsx-runtime";function rr(e){return Uo(ie,{...e,orientation:"horizontal",className:Go("gap-2 md:flex-row md:gap-4","[&>[data-slot=field-content]]:min-w-0 [&>[data-slot=field-content]]:flex-grow [&>[data-slot=field-content]]:self-start","[&_[role=checkbox]]:mt-[1.5px]",e.isClickable&&"md:flex-col",!e.isClickable&&["md:justify-between","[&>*:not([data-slot=field-content])]:w-full","[&>*:not([data-slot=field-content])]:md:w-1/2","[&>*:not([data-slot=field-content])]:xl:w-2/5"]),children:e.children})}import{jsx as or}from"react/jsx-runtime";function ir(e){let t=_t(e.field),n=x(e.field),r=Bt(e.field);return e.horizontal?or(rr,{disabled:e.disabled,errors:e.errors,isCheckbox:n,isReversed:r,isClickable:t,children:e.children}):or(nr,{disabled:e.disabled,errors:e.errors,isCheckbox:n,isReversed:r,isClickable:t,children:e.children})}function lr(e){if(!e.field.type)return null;let t=rn(e.field,e.disabled,{lang:e.lang,translations:e.translations}),n=yn(e.field),r=pn(e.field,e.errors),o={...e.field,disabled:t.disabled};return e.children({ariaAttributes:r,commonProps:t,dataAttributes:n,field:o,horizontal:e.horizontal})}import{twMerge as $o}from"tailwind-merge";import{jsx as Ce,jsxs as Yo}from"react/jsx-runtime";function ar(e){let t=e.field.advanced?.cols,n=e.field.name?e.errors?.[e.field.name]:void 0,{horizontal:r=!1}=Q(e.style,{horizontal:Vt(e.field)}),o=Ht(e.field,e.disabled);return Yo("div",{className:$o("flex flex-col gap-3",hn(t)),children:[Ce(ir,{disabled:o,errors:n,field:e.field,horizontal:r,children:Ce(lr,{disabled:o,errors:n,field:e.field,horizontal:r,lang:e.lang,translations:e.translations,children:e.children})}),Ce(tr,{errors:n,name:e.field.name})]})}import{twMerge as Se}from"tailwind-merge";import{useState as Xo}from"react";import{Fragment as Ko,jsx as g,jsxs as A}from"react/jsx-runtime";function sr(e){let t=e.isMultiField||e.collapsed!=null,[n,r]=Xo(t?!e.collapsed:!0);function o(){e.canRemove&&e.onRemove&&e.onRemove(e.index)}function i(){r(m=>!m)}let l=m=>E(K(m,e.translations),{index:e.index+1,label:e.label}),a=e.canRemove&&e.onRemove!=null&&g("button",{"aria-label":l("Remove {label} item {index}"),className:Se("flex size-6 items-center justify-center rounded text-xl leading-none text-zinc-400","transition-colors duration-150","hover:text-red-500","focus-visible:ring-2 focus-visible:ring-zinc-400 focus-visible:outline-none","dark:text-zinc-500 dark:hover:text-red-400"),onClick:o,type:"button",children:g("span",{"aria-hidden":"true",className:"leading-none",children:"\xD7"})}),s=A("div",{className:"flex min-w-0 flex-col font-medium text-zinc-700 dark:text-zinc-400",children:[g("span",{className:"text-base",children:e.previewLabel??A(Ko,{children:[e.label," ",e.index+1]})}),!n&&e.previewTags&&g("div",{className:"flex items-center gap-2 overflow-hidden text-xs font-normal text-ellipsis whitespace-nowrap text-zinc-500 dark:text-zinc-500",children:e.previewTags})]}),d=A("div",{className:Se("flex items-center justify-between gap-2",e.isMultiField&&n&&"mb-3"),children:[t?A("div",{className:"flex min-w-0 grow items-center gap-2",children:[A("button",{"aria-expanded":n,"aria-label":l(n?"Collapse {label} {index}":"Expand {label} {index}"),className:Se("group flex grow items-center gap-2 rounded p-1 text-left text-zinc-400","focus-visible:ring-2 focus-visible:ring-zinc-400 focus-visible:outline-none","dark:text-zinc-500"),onClick:i,type:"button",children:[g(C,{expanded:n}),s]}),!n&&e.previewBadge&&g("div",{className:"ml-auto shrink-0",children:e.previewBadge})]}):s,a]});return e.isMultiField?A("div",{"data-slot":"list-item-card",className:"box-border w-full min-w-0 rounded-lg border border-zinc-100 p-4 dark:border-zinc-900",children:[d,g(I,{visible:n,children:g(T,{children:e.children})})]}):t?A("div",{className:"box-border flex w-full min-w-0 flex-col gap-2",children:[d,g(I,{visible:n,children:g(T,{children:e.children})})]}):A("div",{className:"box-border flex w-full min-w-0 items-start gap-2",children:[g("div",{className:"flex min-w-0 grow flex-col",children:g(T,{children:e.children})}),a&&g("div",{className:"shrink-0",children:a})]})}import{jsx as Wo}from"react/jsx-runtime";function cr(e){let t=b(Fn(e.field),e.translations),n=Tn(e.field);return An(e.field,e.value).map(r=>Wo(sr,{collapsed:e.field.advanced?.collapsed,index:r,isMultiField:n,label:t,translations:e.translations,children:e.children(r)},r))}import{jsx as Zo}from"react/jsx-runtime";function dr(e){let t=Array.isArray(e.field.fields)&&e.field.fields.length===0,n=w(e.field.label,e.translations),r=w(e.field.description,e.translations);return Zo(ee,{description:r,empty:t,id:e.field.name,title:n,children:e.children})}import{jsx as ur}from"react/jsx-runtime";function fr({children:e,field:t,lang:n,translations:r,value:o}){return ur(dr,{field:t,translations:r,children:ur(cr,{field:t,lang:n,translations:r,value:o,children:e})})}import{twMerge as qo}from"tailwind-merge";import{jsx as mr,jsxs as Jo}from"react/jsx-runtime";function gr(e){let t=Rn(e.column?.advanced?.cols);return Jo("div",{className:"flex w-full flex-col gap-4",children:[mr("div",{"data-slot":"column",className:qo("grid grid-cols-1 gap-3 sm:gap-4",t),children:e.children}),e.column?.description&&mr(ne,{config:e.config,context:e.context,text:e.column.description,translations:e.translations})]})}import{Fragment as jo}from"react";import{jsx as Qo}from"react/jsx-runtime";function pr(e){let t=Array.isArray(e.field.fields)?e.field.fields.map(n=>X(n)||Y(n)?{...n,name:`${e.field.name}.${e.index}.${n.name}`}:v(n)?{...n,fields:n.fields.map(r=>({...r,name:`${e.field.name}.${e.index}.${r.name}`}))}:n):[];return Qo(z,{components:e.components,config:e.config,context:e.context,disabled:e.disabled,fields:t,lang:e.lang,onValueChange:e.onValueChange,style:e.style,translations:e.translations,value:e.value,children:e.children})}import{jsx as V,jsxs as ei}from"react/jsx-runtime";function z(e){let{field:t,list:n}=e.components;return J(e.fields).map((r,o)=>ei(jo,{children:[v(r)&&V(gr,{column:r,config:e.config,context:e.context,translations:e.translations,children:V(z,{...e,fields:r.fields})}),X(r)&&V(t,{disabled:e.disabled,field:r,lang:e.lang,style:e.style,translations:e.translations,children:e.children}),Y(r)&&V(n,{field:r,lang:e.lang,onValueChange:e.onValueChange,translations:e.translations,value:e.value,children:i=>V(pr,{components:e.components,config:e.config,context:e.context,disabled:e.disabled,field:r,index:i,lang:e.lang,onValueChange:e.onValueChange,style:e.style,translations:e.translations,value:e.value,children:e.children})})]},o))}import{jsx as ti}from"react/jsx-runtime";function yr(e){return n=>ti(z,{...n,components:e})}var xr=yr({field:ar,list:fr});import{jsx as Ne}from"react/jsx-runtime";function ve(e){let t=nn(e.lang,e.translations);return Ne(zn,{advanced:e.advanced,config:e.config,control:e.children,definition:e.definition,readOnly:e.readOnly,sections:e.sections,translations:t,children:({disabled:n,fields:r})=>Ne(xr,{config:e.config,context:e.context,disabled:n,fields:r,lang:e.lang,style:e.config.style,translations:t,value:e.value,children:o=>Ne(jn,{...o,config:e.config,context:e.context,translations:t,value:e.value})})})}import{Suspense as ni}from"react";import{jsx as br}from"react/jsx-runtime";function ri(e){return br(ni,{fallback:br(ve,{config:e.config,sections:e.sections,readOnly:!0}),children:e.children})}export{ri as Fallback,ve as Form};
|
|
1
|
+
import{jsx as er}from"react/jsx-runtime";function At(t){let e=typeof t.children=="function"?t.children({isPending:t.isPending}):t.children;return er("div",{"data-slot":"field-control",className:"w-full",children:e})}var P="input",Ft="input/date",Nt="input/email",Ct="input/number",Et="input/time";var wt="textarea",It="radio",kt="checkbox",j="list",Lt="select",Dt="select/active",vt="select/day",Ot="select/month",Pt="select/timezone",Mt="select/year";var _t="chips",zt="chips/day",Vt="chips/month",C="column",Gt="description",tt="fields",Bt="label",et="value",M="options",nt="email",Ht="number",Ut="password",$t="tel",E="text",Yt="aria-errormessage",Xt="aria-invalid",Kt="data-invalid",Wt="data-readonly",Zt="aria",qt="data",Jt="max",Qt="maxLength",jt="min",te="minLength",S="$ref";var ee="type",ne={Africa:"Africa",America:"Americas",Asia:"Asia / Pacific",Atlantic:"Atlantic",Australia:"Asia / Pacific",Europe:"Europe",Indian:"Asia / Pacific",Pacific:"Asia / Pacific"};import{format as rr,formatDistanceToNow as oe,formatDuration as or,intervalToDuration as ir,isValid as _,parseISO as lr}from"date-fns";import{enUS as ie,es as rt}from"date-fns/locale";function f(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function m(t){return c(t)||typeof t=="number"||nr(t)}function re(t){return Array.isArray(t)&&t.every(m)}function c(t){return typeof t=="string"}function nr(t){return typeof t=="boolean"}var le={en:ie,"en-US":ie,es:rt,"es-ES":rt,"es-MX":rt},ar={short:"M/d/yy",medium:"MMM d, yyyy",long:"MMMM d, yyyy",full:"EEEE, MMMM d, yyyy"},sr={ms:1,s:1e3,min:6e4,h:36e5,d:864e5};function ae(t){if(t)return le[t]??le[t.split("-")[0]]}function z(t){if(typeof t=="number"&&!Number.isNaN(t))return t;if(c(t)&&t.trim()!==""){let e=Number(t);return Number.isNaN(e)?null:e}return null}function se(t,e,n){let r=sr[e];if(r===void 0)return String(t);let o=t*r,i=ir({start:0,end:o});return or(i,{locale:n})}function ce(t){if(t instanceof Date)return _(t)?t:null;if(c(t)){let e=lr(t);if(_(e))return e;let n=new Date(t);return _(n)?n:null}if(typeof t=="number"){let e=new Date(t);return _(e)?e:null}return null}var cr={currency:(t,e,n)=>{let r=z(t);if(r===null)return String(t);let o=e[0]??"USD";return new Intl.NumberFormat(n.locale,{style:"currency",currency:o}).format(r)},percent:(t,e,n)=>{let r=z(t);return r===null?String(t):new Intl.NumberFormat(n.locale,{style:"percent"}).format(r)},number:(t,e,n)=>{let r=z(t);return r===null?String(t):new Intl.NumberFormat(n.locale).format(r)},date:(t,e,n)=>{let r=ce(t);if(!r)return String(t);let o=e[0]??"short",i=ae(n.locale);if(o==="relative")return oe(r,{addSuffix:!0,locale:i});let l=ar[o]??o;return rr(r,l,{locale:i})},duration:(t,e,n)=>{let r=ae(n.locale);if(typeof t=="number")return se(t,e[0]??"ms",r);if(c(t)){let i=z(t);if(i!==null)return se(i,e[0]??"ms",r)}let o=ce(t);return o?oe(o,{addSuffix:!0,locale:r}):String(t)}};function ue(t,e,n){let r=e.split(":").map(a=>a.trim()).filter(a=>a.length>0);if(r.length===0)return;let[o,...i]=r,l=cr[o];if(l)return l(t,i,n)}function ot(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var w={found:!1,value:void 0};function ur(t,e){if(!Array.isArray(e)&&ot(e,t))return{found:!0,value:e[t]};if(!t.includes("."))return w;let n=e;for(let r of t.split(".")){if(n==null)return w;if(Array.isArray(n)){let o=Number(r);if(!Number.isInteger(o)||!ot(n,r))return w;n=n[o]}else if(f(n)){if(!ot(n,r))return w;n=n[r]}else return w}return{found:!0,value:n}}function de(t,e=et){if(t!=null){if(re(t)||m(t))return t;if(f(t)){let n=dr(t,e);if(m(n))return n}}}function dr(t,e){let n=g(t,e);if(m(n))return n}function g(t,e){if(!e||!t||typeof t!="object")return null;let n=ur(e,t);return n.found?n.value:null}function fe(t,e={description:Gt,label:Bt,value:et}){return t.map(n=>{if(f(n)){let r=g(n,e.label),o=g(n,e.value);if(m(r)&&m(o)){let i=g(n,e.description);return{label:`${r}`,value:`${o}`,...m(i)&&{description:`${i}`}}}}return n})}function me(t=E){let e=t.lastIndexOf("/"),n=e===-1?t:t.slice(e+1);return n&&n!==P?n.trim().toLowerCase():E}var fr=/\[([^\]]{1,500})\]\(([^)]{1,2000})\)/g,mr=/{([^}]{1,200})}/,gr=/{([^}]{1,200})}/g;function it(t,e={},n={}){if(c(t))return yr(t,e,n);if(Array.isArray(t))return t.map(r=>it(r,e,n));if(f(t)){let r={};for(let o in t)r[o]=it(t[o],e,n);return r}return t}function V(t,e={},n={}){return lt(t)?it(t,e,n):t}function lt(t){return c(t)?mr.test(t):Array.isArray(t)?t.some(e=>lt(e)):f(t)?Object.values(t).some(e=>lt(e)):!1}function pr(t,e){return e.includes(".")?g(t,e):t[e]}function yr(t,e={},n={}){return t.replace(gr,(r,o)=>{let i=String(o).split("|").map(y=>y.trim()),[l,...a]=i;if(!l)return r;let s=pr(e,l);if(a.length===0)return m(s)?String(s):r;if(s==null)return r;let u=s;for(let y of a){let O=ue(u,y,{locale:n.locale});if(O===void 0)return r;u=O}return String(u)})}function ge(t,e){if(!c(t)||!t||t.trim().length===0)return null;let n,r=0,o=!1,i=[];for(;(n=fr.exec(t))!==null;){let[l,a,s]=n,u=n.index;o=!0,u>r&&i.push(t.substring(r,u));let y=e?e(u,s,a):l;i.push(y),r=u+l.length}return o?(r<t.length&&i.push(t.substring(r)),i):t}var pe=t=>d(Dt)(t),ye=t=>d(vt)(t),xe=t=>d(Ot)(t),be=t=>d(Mt)(t),Te=t=>d(Pt)(t),he=t=>d(zt)(t),Re=t=>d(Vt)(t),Se=d(Ft),at=d(Et),p=d(kt),A=d(_t),h=d(It),Ae=d(P),b=d(Lt),Fe=d(wt),Ne=d(E,nt,Ut,$t),Yo=d(Nt,nt),st=d(Ct,Ht);function Ce(t){return h(t)||p(t)}function G(t){return t.type===j}function R(t){return t.type===C}function B(t){return t.type!==C&&t.type!==j}function ct(t){return b(t)||h(t)||A(t)}function I(t){return t!=null&&t!==""}function d(...t){return e=>{let n=c(e.type)?e.type:void 0;return n?t.some(r=>n===r||n?.startsWith(`${r}/`)):!1}}function Ee(t,e={}){if(b(t)&&t.disabled){let n=t.name?e?.[t.name]:void 0;if(n&&f(n))return[n]}}function we(t){return h(t)||p(t)?!0:t.advanced?.horizontal}function Ie(t){return p(t)?t.advanced?.reverse!==!1:!1}function ke(t,e){let n=t.readonly??!1;return e||n}function Le(t,e){return!!t.readonly&&!e&&!t.disabled}function De(t){let e=t.advanced?.step;if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e}function ut(t){if(xr(t)){let e=t.source;if(Array.isArray(e)||f(e)&&!(S in e))return e}}function ve(t){return Array.isArray(ut(t))}function xr(t){return h(t)||A(t)||b(t)&&!t.disabled}import{isValid as Me,parse as _e,format as ze}from"date-fns";var br=/^\d+$/,Ve=new Date(2e3,0,1),Tr=()=>"supportedValuesOf"in Intl?Intl.supportedValuesOf("timeZone"):[],dt="default";function Ge(t){if(!t)return dt;try{return Intl.getCanonicalLocales(t)[0]??dt}catch{return dt}}function ft(t){let e=Ge(t);return Array.from({length:12},(n,r)=>({value:(r+1).toString(),label:new Date(0,r).toLocaleString(e,{month:"long"})}))}function mt(t){let e=Ge(t);return Array.from({length:7},(n,r)=>({value:r.toString(),label:new Date(2e3,0,2+r).toLocaleString(e,{weekday:"long"})}))}function Be(t,e){return e>=t?Array.from({length:e-t+1},(n,r)=>{let o=t+r;return{value:o.toString(),label:o.toString()}}):[]}function gt(){return new Date().getFullYear()}function hr(){return Intl.DateTimeFormat().resolvedOptions().timeZone}function Rr(t){let e=t.indexOf("/"),n=e===-1?t:t.slice(0,e);return ne[n]??"Other"}function Sr(t,e){return(t.find(r=>r.type==="timeZoneName")?.value??e).replace(/\s+(?:Standard|Daylight(?: Saving)?|Summer|Winter)\s+Time$/,"")}function Oe(t,e){let n=new Intl.DateTimeFormat("en",{timeZone:t,timeZoneName:"longOffset"}).formatToParts(e),r=new Intl.DateTimeFormat("en",{timeZone:t,timeZoneName:"long"}).formatToParts(e),i=(n.find(a=>a.type==="timeZoneName")?.value??"GMT+00:00").replace("GMT","UTC"),l=Sr(r,t);return{offset:i,longName:l}}function Pe(t){return t.slice(t.lastIndexOf("/")+1).replace(/_/g," ")}function He(){let t=new Date,e=hr(),n=new Map,r=Pe(e),{offset:o,longName:i}=Oe(e,t),l={value:e,label:`${r} - ${i} (${o})`};for(let s of Tr()){if(s===e)continue;let u=Pe(s),{offset:y,longName:O}=Oe(s,t),Rt={value:s,label:`${u} - ${O} (${y})`},Q=Rr(s);if(Q==="Other")continue;let St=n.get(Q);St?St.push(Rt):n.set(Q,[Rt])}for(let s of n.values())s.sort((u,y)=>u.label.localeCompare(y.label));let a=Array.from(n.entries()).sort(([s],[u])=>s.localeCompare(u)).map(([s,u])=>({label:s,items:u}));return[{label:"Suggested",items:[l]},...a]}function pt(t,e){if(typeof t=="number")return t;let n=e??gt(),r=t.trim().toLowerCase();if(r.startsWith("current")){let o=r.match(/^current([+-])(\d+)$/);if(o){let[,i,l]=o,a=parseInt(l,10);if(!isNaN(a))return i==="+"?n+a:n-a}return n}return br.test(r)?parseInt(r,10):n}function Ue(t,e){if(!t)return"";try{let n=_e(t,e,Ve);return Me(n)?ze(n,"yyyy-MM-dd"):""}catch{return""}}function $e(t,e){if(!t)return"";try{let n=_e(t,e,Ve);return Me(n)?ze(n,"HH:mm:ss"):""}catch{return""}}function yt(t){return t.advanced?.format??"HH:mm"}function Ye(t){return t.advanced?.format??"MMMM d, yyyy"}var Ar={es:{"(Optional)":"(Opcional)","Add item":"A\xF1adir elemento","An unexpected error occurred submitting the form.":"Ocurri\xF3 un error inesperado al enviar el formulario.","Collapse {label} {index}":"Contraer {label} {index}","Expand {label} {index}":"Expandir {label} {index}","Please correct the errors and try again.":"Corrige los errores e int\xE9ntalo de nuevo.","Remove {label} item {index}":"Eliminar {label} {index}","There were validation errors submitting the form.":"Se encontraron errores de validaci\xF3n al enviar el formulario.","Unknown error":"Error desconocido",No:"No",Yes:"S\xED"}};function Ke(t,e){return x(t,e)}function We(t,e){let n=e?.[t??""],r=t?Ar[Fr(t)]:void 0;return r?n?{...r,...n}:r:n}function Fr(t){return t.toLowerCase().split(/[-_]/)[0]}function x(t,e){return t?e?e[t]??t:t:""}function F(t,e){return t?x(t,e):void 0}function H(t,e){if(!e)return t;let n=!1,r=t.map(o=>{let i=Nr(o,e);return i!==o&&(n=!0),i});return n?r:t}function Nr(t,e){if(!f(t))return t;let n=Xe(t.label,e),r=t.items;if(Array.isArray(r)){let i=H(r,e);return i===r&&n===t.label?t:{...t,...n!==void 0&&{label:n},items:i}}let o=Xe(t.description,e);return n===t.label&&o===t.description?t:{...t,...n!==void 0&&{label:n},...o!==void 0&&{description:o}}}function Xe(t,e){return c(t)?x(t,e):t}var U=gt();function Cr(t,e){if(A(t))return Er(t,e?.lang)}function Er(t,e){if(he(t))return mt(e);if(Re(t))return ft(e)}function wr(t,e){if(b(t))return Ir(t,e)}function Ir(t,e){let{lang:n,translations:r}=e??{};if(ye(t))return mt(n);if(xe(t))return ft(n);if(be(t)){let o=t.advanced?.length?.min??U,i=t.advanced?.length?.max??U+5;return Be(pt(o,U),pt(i,U))}if(Te(t))return He();if(pe(t))return H([{value:"true",label:"Yes"},{value:"false",label:"No"}],r)}function Ze(t,e=!1,n){let r={disabled:e,id:t.name,name:t.name,placeholder:t.placeholder,required:t.required};return Ae(t)?{...r,...kr(t)}:b(t)?{...r,...qe(wr(t,n))}:Fe(t)?{...r,...vr(t)}:A(t)?{...r,...Dr(t,n)}:r}function kr(t){let e=me(t.type),n={...t,type:e};return{...Pr(t),...Je(t),...Or(n),...Lr(n),...Ne(n)?Qe(n):{},type:e}}function Lr(t){let e=De(t);return st(t)&&e!==void 0?{step:e}:{}}function qe(t){return t?{options:t}:{}}function Dr(t,e){let n=qe(Cr(t,e)),r=t.advanced?.multiple??!0;return{...n,multiple:r}}function vr(t){return{...Je(t),...Qe(t)}}function Je(t){let e=t.advanced?.autocomplete;return e?{autoComplete:e}:{}}function Or(t){return st(t)?Mr(t):{}}function Pr(t){if(at(t)){let e=yt(t);return{step:e==="HH:mm:ss"||e==="hh:mm:ss a"?"1":"60"}}return{}}function Qe(t){return je(t,{min:te,max:Qt})}function Mr(t){return je(t,{min:jt,max:Jt})}function je(t,e){let n={},r=t.advanced?.length;return r&&(r.min!==void 0&&(n[e.min]=r.min),r.max!==void 0&&(n[e.max]=r.max)),n}function tn(t,e){let n=ut(t);return n||Ee(t,e)}function _r(t,e){let n=f(e)&&t.name in e?e[t.name]:e,r=de(n,t.advanced?.entity),o=I(r)?r:t.defaultValue;return at(t)&&I(o)?zr(t,o):Se(t)&&I(o)?Hr(t,o):o}function zr(t,e){let n=yt(t);return c(e)?$e(e,n):e}function Vr(t,e,n){return ct(t)&&Array.isArray(n)?{...e,[M]:n}:e}function Gr(t,e,n){if(t.required&&!I(n)&&b(t)&&t.advanced?.preselected!==!1&&M in e){let r=e[M];if(Array.isArray(r)&&r.length===1)return r[0]}return n}function Br(t,e,n){if(ct(t)&&Array.isArray(e)){let r=fe(e,t.advanced?.options);return ve(t)?H(r,n):r}return e}function en(t,e,n,r,o){let i=_r(t,r),l=Array.isArray(n)?Br(t,n,o):n,a=Vr(t,e,l),s=Gr(t,a,i);return{commonPropsWithOptions:a,defaultValue:s}}function nn(t,e){return p(t)?{defaultChecked:!!e}:{defaultValue:e}}function Hr(t,e){let n=Ye(t);return c(e)?Ue(e,n):e}var Ur=/^#\/definition\//,rn=new WeakMap;function Y(t=[],e){if(!sn(e))return on(t);let n=rn.get(t);return n||(n=new WeakMap,rn.set(t,n)),n.has(e)||n.set(e,on($(t,e))),n.get(e)}function on(t){return Array.isArray(t)?t.filter($r).sort((e,n)=>ln(e)-ln(n)):[]}function $(t,e,n=new Map,r=new WeakSet){if(!sn(e)||!t||typeof t!="object")return t;if(n.has(t))return n.get(t);if(r.has(t))return t;if(r.add(t),Array.isArray(t)){let l=!1,a=t.map(s=>{let u=$(s,e,n,r);return l||=u!==s,u});return r.delete(t),n.set(t,l?a:t),n.get(t)}if(S in t&&c(t[S])){let l=t[S].replace(Ur,""),a=g(e,l);return a!==null?$(a,e,n,r):t}let o={},i=!1;for(let[l,a]of Object.entries(t))o[l]=$(a,e,n,r),i||=o[l]!==a;return r.delete(t),n.set(t,i?o:t),n.get(t)}function an(t){return Object.entries(t??{})}function ln(t){return t.order??Number.MAX_VALUE}function sn(t){return t!==void 0&&f(t)&&Object.keys(t).length>0}function $r(t){return ee in t?!0:Array.isArray(t[tt])?t[tt].length>0:!0}function cn(t,e){let n={};for(let[r,o]of an(e))n[`${t}-${r}`]=o;return n}function Yr(t){return cn(Zt,t)}function Xr(t){return cn(qt,t)}function un(t,e){let n=Yr(t.advanced?.aria);return e&&e.length>0&&(n[Xt]="true",n[Yt]=`${t.name}-error`),n}function dn(t){return Xr(t.advanced?.data)}var fn={1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3"},mn={1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3"};function gn(t,e=2){return fn[t&&t in fn?t:e]}function pn(t){if(t&&t in mn)return mn[t]}function Kr(t){return{min:t.advanced?.length?.min??1,max:t.advanced?.length?.max??1/0}}function Wr(t,e){let n=e?g(e,t.name):null;return Zr(t,Array.isArray(n)?n.length:0)}function yn(t){return!Array.isArray(t.fields)||t.fields.length===0?!1:t.fields.length>1||t.fields[0].type===C}function xn(t,e){let n=Wr(t,e);return Array.from({length:n},(r,o)=>o)}function bn(t){return t.advanced?.title??t.label??t.name}function Zr(t,e){let{min:n,max:r}=Kr(t);return Math.min(Math.max(e,n),r)}function X(t,e){let n={...t};for(let r of Object.keys(e??{})){let o=e?.[r];o!==void 0&&(n[r]=o)}return n}import{jsx as qr}from"react/jsx-runtime";function T(t){return ge(t,(e,n,r)=>qr("a",{className:"underline",href:n,rel:"noopener noreferrer",target:"_blank",children:r},`${n}-${e}`))}import{jsx as K,jsxs as Tn}from"react/jsx-runtime";function hn(t){let e=Tn("div",{className:"flex flex-col",children:[t.title&&K("legend",{className:"mb-3 font-medium text-zinc-800 dark:text-zinc-200",children:T(t.title)}),t.description&&K("p",{className:"-mt-2 text-sm leading-normal font-normal text-zinc-600 dark:text-zinc-400",children:T(t.description)})]});return t.step?Tn("div",{className:"flex flex-row items-start gap-4",children:[K("div",{className:"bg-primary text-primary-foreground flex size-6 shrink-0 items-center justify-center rounded-full",children:K("span",{className:"text-sm font-bold",children:t.step})}),e]}):e}import{jsx as Rn,jsxs as Jr}from"react/jsx-runtime";function W(t){return Jr("fieldset",{className:"flex w-full min-w-0 flex-col data-[empty=false]:gap-6","data-empty":t.empty,"data-slot":"field-set",id:t.id,children:[Rn(hn,{description:t.description,step:t.step,title:t.title}),Rn("div",{className:"w-full min-w-0",children:t.children})]})}import{jsx as Qr}from"react/jsx-runtime";function N(t){return Qr("div",{"data-slot":"field-group","data-compact":t.compact,className:"flex w-full flex-col gap-8 data-[compact=true]:gap-3",children:t.children})}import{jsx as k,jsxs as Sn}from"react/jsx-runtime";function An(t){let{fields:e=[]}=t.section,n=t.advanced?.step?t.step:void 0,{compact:r}=X(t.style,{compact:t.section.advanced?.compact}),o=k(N,{compact:r,children:t.children});if(!t.section.title&&!t.section.description)return o;let i=F(t.section.title,t.translations),l=F(t.section.description,t.translations);return t.section.advanced?.collapsible?Sn("fieldset",{"data-slot":"field-set","data-advanced":"true","data-expanded":!0,"data-empty":e.length===0,className:"flex flex-col",id:t.section.id?.toString(),children:[k("legend",{children:k("span",{className:"flex items-center gap-2 text-base font-medium text-zinc-600 dark:text-zinc-400",children:T(i)})}),Sn("div",{className:"mt-3 ml-1.5 flex flex-col gap-4 border-l-2 border-zinc-300 pl-4 dark:border-zinc-600","data-slot":"field-set-content",children:[l&&k("p",{className:"text-sm leading-normal font-normal text-zinc-600 dark:text-zinc-400",children:T(l)}),o]})]}):k(W,{description:l,empty:e.length===0,id:t.section.id?.toString(),step:n,title:i,children:o})}import{jsx as Fn}from"react/jsx-runtime";function Nn(){return Fn("div",{"data-slot":"field-separator",className:"relative -my-2 h-5 text-sm",children:Fn("div",{className:"absolute inset-0 top-1/2 h-px w-full bg-zinc-200 dark:bg-zinc-800"})})}function jr(t,e){return t.fields.every(n=>Cn(n,e))}function Cn(t,e){return e[t.name]?.hidden??t.hidden??!1}function to(t,e){return R(t)?jr(t,e):Cn(t,e)}function En(t,e,n){return n&&(t[n.name]?.hidden??n.hidden??!1)||e.length===0?!0:e.every(r=>to(r,t))}import{jsx as L,jsxs as wn}from"react/jsx-runtime";function eo(t){return En({},t.fields)?null:t.children}function In(t){let e=Y(t.sections,t.definition),n=t.guard??eo,r=t.fieldSet??An;return L("div",{className:"h-full w-full",children:L("form",{noValidate:t.noValidate,action:t.action,onSubmit:t.onSubmit,children:wn(N,{children:[e.map((o,i)=>wn(n,{fields:o.fields??[],children:[L(r,{advanced:t.advanced,section:o,step:i+1,style:t.config.style,translations:t.translations,children:t.children({disabled:t.readOnly,fields:o.fields})}),o.advanced?.separator&&L(Nn,{})]},`key-${o.id}-${i}`)),t.control&&L(At,{isPending:t.isPending,children:t.control})]})})})}import{twMerge as no}from"tailwind-merge";import{jsx as kn,jsxs as ro}from"react/jsx-runtime";function Ln(t){let e=t.style?.showOptionalLabel??!0,n=h(t.field)||p(t.field);return ro("label",{"data-slot":"field-label","data-normal":n,className:no("flex w-fit items-center text-sm leading-snug font-medium select-none","data-[normal=true]:font-normal [[data-slot=column]_&]:md:w-full","group-data-[readonly=true]:cursor-not-allowed group-data-[readonly=true]:opacity-50"),htmlFor:t.field.name,title:c(t.children)?t.children:void 0,children:[kn("span",{className:"[[data-slot=column]_&]:md:truncate",children:t.children}),e&&!t.field.required&&kn("span",{className:"ml-2 flex-shrink-0 text-sm text-zinc-600 dark:text-zinc-400",children:Ke("(Optional)",t.translations)})]})}import{jsx as Dn}from"react/jsx-runtime";function oo(t){return Dn("p",{className:"-mt-2 text-xs leading-normal font-normal text-zinc-600 dark:text-zinc-400 [[data-slot=column]_&]:md:line-clamp-2",title:t.title,children:t.children})}function Z(t){let e=c(t.text)?t.text:t.text?.message;if(!e)return null;let n=V(e,{context:t.context,env:t.config?.env},{locale:t.config?.env?.locale});return Dn(oo,{title:c(t.text)?void 0:t.text?.title,children:T(x(n,t.translations))})}import{jsx as io}from"react/jsx-runtime";function q(t){return io(Z,{config:t.config,context:t.context,text:t.field.description,translations:t.translations})}import{jsx as vn,jsxs as lo}from"react/jsx-runtime";function On(t){let e=t.description??q,n={context:t.context,env:t.config?.env},r=t.config?.env?.locale,o=V(t.field.label,n,{locale:r});return lo("div",{"data-slot":"field-content",className:"flex w-full flex-1 flex-col gap-1.5 leading-snug",children:[vn(Ln,{field:t.field,style:t.config?.style,translations:t.translations,children:x(o,t.translations)}),t.horizontal===!0&&vn(e,{config:t.config,context:t.context,field:t.field,translations:t.translations})]})}import{Fragment as ao,jsx as Pn,jsxs as so}from"react/jsx-runtime";function Mn(t){let e=t.description??q;return so(ao,{children:[t.field.name&&t.field.label&&Pn(On,{config:t.config,context:t.context,description:t.description,field:t.field,horizontal:t.horizontal,translations:t.translations}),t.children,t.horizontal===!1&&Pn(e,{config:t.config,context:t.context,field:t.field,translations:t.translations})]})}function _n(t,e){return t?e(t):null}import{jsx as zn}from"react/jsx-runtime";function Vn(t){let e=tn(t.field,t.value),{commonPropsWithOptions:n,defaultValue:r}=en(t.field,t.commonProps,e,t.value,t.translations),o=nn(t.field,r);return _n(t.config.inputs[t.field.type],i=>zn(Mn,{config:t.config,context:t.context,field:t.field,horizontal:t.horizontal,translations:t.translations,children:zn(i,{...t.ariaAttributes,...n,...t.dataAttributes,...o})}))}import{twMerge as co}from"tailwind-merge";import{jsx as uo}from"react/jsx-runtime";function J(t){let e=t.errors&&t.errors.length>0;return uo("div",{"data-slot":"field","data-clickable":t.isClickable?"true":"false",...e&&{[Kt]:"true"},...t.disabled&&{[Wt]:"true"},"data-orientation":t.orientation,className:co("group flex w-full flex-col items-center data-[invalid=true]:text-red-600 data-[invalid=true]:dark:text-red-500","data-[clickable=true]:items-start",t.isCheckbox&&(t.isReversed?"flex-row-reverse!":"flex-row!"),"data-[clickable=true]:has-[>[data-slot=field-content]]:[&>:first-child]:mt-px",t.className),children:t.children})}import{twMerge as fo}from"tailwind-merge";import{jsx as mo}from"react/jsx-runtime";function Gn(t){return mo(J,{...t,orientation:"vertical",className:fo("gap-3 has-[>[data-slot=field-content]]:items-start",!t.isClickable&&"[&>*]:w-full"),children:t.children})}import{twMerge as go}from"tailwind-merge";import{jsx as po}from"react/jsx-runtime";function Bn(t){return po(J,{...t,orientation:"horizontal",className:go("gap-2 md:flex-row md:gap-4","[&>[data-slot=field-content]]:min-w-0 [&>[data-slot=field-content]]:flex-grow [&>[data-slot=field-content]]:self-start","[&_[role=checkbox]]:mt-[1.5px]",t.isClickable&&"md:flex-col",!t.isClickable&&["md:justify-between","[&>*:not([data-slot=field-content])]:w-full","[&>*:not([data-slot=field-content])]:md:w-1/2","[&>*:not([data-slot=field-content])]:xl:w-2/5"]),children:t.children})}import{jsx as Hn}from"react/jsx-runtime";function Un(t){let e=Ce(t.field),n=p(t.field),r=Ie(t.field);return t.horizontal?Hn(Bn,{disabled:t.disabled,errors:t.errors,isCheckbox:n,isReversed:r,isClickable:e,children:t.children}):Hn(Gn,{disabled:t.disabled,errors:t.errors,isCheckbox:n,isReversed:r,isClickable:e,children:t.children})}function $n(t){if(!t.field.type)return null;let e=Ze(t.field,t.disabled,{lang:t.lang,translations:t.translations}),n=dn(t.field),r=un(t.field,t.errors),o=!!t.field.disabled===e.disabled?t.field:{...t.field,disabled:e.disabled};return t.children({ariaAttributes:r,commonProps:e,dataAttributes:n,field:o,horizontal:t.horizontal,readOnly:t.readOnly})}import{twMerge as yo}from"tailwind-merge";import{jsx as xt}from"react/jsx-runtime";function Yn(t){let e=t.field.advanced?.cols,{horizontal:n=!1}=X(t.style,{horizontal:we(t.field)}),r=ke(t.field,t.disabled),o=Le(t.field,t.disabled);return xt("div",{className:yo("flex flex-col gap-3",pn(e)),children:xt(Un,{disabled:r,field:t.field,horizontal:n,children:xt($n,{disabled:r,field:t.field,horizontal:n,lang:t.lang,readOnly:o,translations:t.translations,children:t.children})})})}import{jsx as xo}from"react/jsx-runtime";function Xn(t){let e=Array.isArray(t.field.fields)&&t.field.fields.length===0,n=F(t.field.label,t.translations),r=F(t.field.description,t.translations);return xo(W,{description:r,empty:e,id:t.field.name,title:n,children:t.children})}import{jsx as bt,jsxs as Kn}from"react/jsx-runtime";function Wn(t){let e=x(bn(t.field),t.translations),n=yn(t.field);return bt(Xn,{field:t.field,translations:t.translations,children:xn(t.field,t.value).map(r=>Kn("div",{"data-slot":n?"list-item-card":void 0,className:n?"box-border w-full min-w-0 rounded-lg border border-zinc-100 p-4 dark:border-zinc-900":"box-border flex w-full min-w-0 flex-col gap-2",children:[n&&bt("div",{className:"flex min-w-0 flex-col font-medium text-zinc-700 dark:text-zinc-400",children:Kn("span",{className:"text-base",children:[e," ",r+1]})}),bt(N,{children:t.children(r)})]},r))})}import{twMerge as bo}from"tailwind-merge";import{jsx as Zn,jsxs as To}from"react/jsx-runtime";function qn(t){let e=t.description??Z,n=gn(t.column?.advanced?.cols);return To("div",{className:"flex w-full flex-col gap-4",children:[Zn("div",{"data-slot":"column",className:bo("grid grid-cols-1 gap-3 sm:gap-4",n),children:t.children}),t.column?.description&&Zn(e,{config:t.config,context:t.context,text:t.column.description,translations:t.translations})]})}import{Fragment as So}from"react";import{useMemo as ho}from"react";import{jsx as Ro}from"react/jsx-runtime";function Jn(t){let{fields:e,name:n}=t.field,{index:r}=t,o=ho(()=>Array.isArray(e)?e.map(i=>B(i)||G(i)?{...i,name:`${n}.${r}.${i.name}`}:R(i)?{...i,fields:i.fields.map(l=>({...l,name:`${n}.${r}.${l.name}`}))}:i):[],[r,n,e]);return Ro(D,{components:t.components,config:t.config,context:t.context,disabled:t.disabled,fields:o,lang:t.lang,onValueChange:t.onValueChange,style:t.style,translations:t.translations,value:t.value,children:t.children})}import{jsx as v,jsxs as Fo}from"react/jsx-runtime";function Ao(t,e){return R(t)?`column:${t.fields.map(r=>r.name).join("|")||e}`:t.name||`slot:${e}`}function D(t){let{field:e,list:n}=t.components;return Y(t.fields).map((r,o)=>Fo(So,{children:[R(r)&&v(qn,{column:r,config:t.config,context:t.context,description:t.components.description,translations:t.translations,children:v(D,{...t,fields:r.fields})}),B(r)&&v(e,{disabled:t.disabled,field:r,lang:t.lang,style:t.style,translations:t.translations,children:t.children}),G(r)&&v(n,{field:r,lang:t.lang,onValueChange:t.onValueChange,translations:t.translations,value:t.value,children:i=>v(Jn,{components:t.components,config:t.config,context:t.context,disabled:t.disabled,field:r,index:i,lang:t.lang,onValueChange:t.onValueChange,style:t.style,translations:t.translations,value:t.value,children:t.children})})]},Ao(r,o)))}import{jsx as No}from"react/jsx-runtime";function Qn(t){return n=>No(D,{...n,components:t})}var jn=Qn({field:Yn,list:Wn});import{jsx as Tt}from"react/jsx-runtime";function ht(t){let e=We(t.lang,t.translations);return Tt(In,{advanced:t.advanced,config:t.config,control:t.children,definition:t.definition,readOnly:t.readOnly,sections:t.sections,translations:e,children:({disabled:n,fields:r})=>Tt(jn,{config:t.config,context:t.context,disabled:n,fields:r,lang:t.lang,style:t.config.style,translations:e,value:t.value,children:o=>Tt(Vn,{...o,config:t.config,context:t.context,translations:e,value:t.value})})})}import{Suspense as Co}from"react";import{jsx as tr}from"react/jsx-runtime";function Eo(t){return tr(Co,{fallback:tr(ht,{config:t.config,sections:t.sections,readOnly:!0}),children:t.children})}export{Eo as Fallback,ht as Form};
|
|
@@ -31,22 +31,6 @@ type Orderable = {
|
|
|
31
31
|
};
|
|
32
32
|
type Hideable = {
|
|
33
33
|
hidden?: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Whether hiding this field leaves its value behind instead of taking it.
|
|
36
|
-
*
|
|
37
|
-
* Hiding a field normally clears what it held, and says so, because on a
|
|
38
|
-
* controlled form a value the host still carries comes back the moment the
|
|
39
|
-
* field is shown again -- so a clear nobody was told about undoes itself.
|
|
40
|
-
* That is the right default: a field nobody can see is usually a field whose
|
|
41
|
-
* data no longer applies.
|
|
42
|
-
*
|
|
43
|
-
* It is the wrong default for a field that is put away rather than dropped --
|
|
44
|
-
* two views of the same thing, where hiding one is a change of scenery and
|
|
45
|
-
* not a change of mind. Declared on the FIELD and not on the rule that hides
|
|
46
|
-
* it: a field either survives being put away or it does not, and which of
|
|
47
|
-
* several rules happened to hide it this time says nothing about that.
|
|
48
|
-
*/
|
|
49
|
-
keepValue?: boolean;
|
|
50
34
|
};
|
|
51
35
|
export type Sections = Section[];
|
|
52
36
|
export type Multiple = readonly (string | number | boolean)[];
|
|
@@ -66,6 +50,13 @@ export type List = {
|
|
|
66
50
|
title?: string;
|
|
67
51
|
action?: string;
|
|
68
52
|
collapsed?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Whether hiding this list leaves the values behind instead of taking
|
|
55
|
+
* them. See `Field`'s, which this one is a statement about: a list holds
|
|
56
|
+
* nothing under its own name, so declaring it here covers every value its
|
|
57
|
+
* rows hold.
|
|
58
|
+
*/
|
|
59
|
+
keepValue?: boolean;
|
|
69
60
|
length?: Length<number>;
|
|
70
61
|
preview?: {
|
|
71
62
|
label?: PreviewItem;
|
|
@@ -191,6 +182,7 @@ export type Validation = {
|
|
|
191
182
|
requiredWhen?: WhenRule | Array<WhenRule>;
|
|
192
183
|
pattern?: PatternRule;
|
|
193
184
|
rules?: Array<AssertRule>;
|
|
185
|
+
step?: string;
|
|
194
186
|
};
|
|
195
187
|
export type Field = CommonProps & {
|
|
196
188
|
advanced?: {
|
|
@@ -200,6 +192,27 @@ export type Field = CommonProps & {
|
|
|
200
192
|
data?: DataAttributes;
|
|
201
193
|
entity?: string;
|
|
202
194
|
horizontal?: boolean;
|
|
195
|
+
/**
|
|
196
|
+
* Whether hiding this field leaves its value behind instead of taking it.
|
|
197
|
+
*
|
|
198
|
+
* Hiding a field normally clears what it held, and says so, because on a
|
|
199
|
+
* controlled form a value the host still carries comes back the moment the
|
|
200
|
+
* field is shown again -- so a clear nobody was told about undoes itself.
|
|
201
|
+
* That is the right default: a field nobody can see is usually a field
|
|
202
|
+
* whose data no longer applies.
|
|
203
|
+
*
|
|
204
|
+
* It is the wrong default for a field that is put away rather than dropped
|
|
205
|
+
* -- two views of the same thing, where hiding one is a change of scenery
|
|
206
|
+
* and not a change of mind. Declared on the FIELD and not on the rule that
|
|
207
|
+
* hides it: a field either survives being put away or it does not, and
|
|
208
|
+
* which of several rules happened to hide it this time says nothing about
|
|
209
|
+
* that.
|
|
210
|
+
*
|
|
211
|
+
* Alongside `transient`, which also decides what ends up stored, rather
|
|
212
|
+
* than beside `hidden`: the two read as a pair, but `hidden` is what the
|
|
213
|
+
* form does and this is what the field is.
|
|
214
|
+
*/
|
|
215
|
+
keepValue?: boolean;
|
|
203
216
|
reverse?: boolean;
|
|
204
217
|
/**
|
|
205
218
|
* Marks a field that fires its change events and keeps nothing of its own:
|
|
@@ -244,6 +257,7 @@ export type Transform = 'lowercase' | 'uppercase' | 'remove-space' | 'remove-acc
|
|
|
244
257
|
export type Input = Field & {
|
|
245
258
|
advanced?: {
|
|
246
259
|
length?: Length<number>;
|
|
260
|
+
step?: number;
|
|
247
261
|
transform?: Transform | Transform[];
|
|
248
262
|
};
|
|
249
263
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type { Field, Nullable } from '../type';
|
|
1
|
+
import type { Field, Input, Nullable } from '../type';
|
|
2
2
|
export declare function buildOptions(field: Field, values?: Nullable<Record<string, unknown>>): Record<string, unknown>[] | undefined;
|
|
3
3
|
export declare function buildOrientation(field: Field): boolean | undefined;
|
|
4
4
|
export declare function buildReverse(field: Field): boolean;
|
|
5
5
|
export declare function buildDisabled(field: Field, disabled?: boolean): boolean;
|
|
6
|
+
export declare function buildReadOnly(field: Field, disabled?: boolean): boolean;
|
|
7
|
+
export declare function buildNumberStep(input: Input): number | undefined;
|
|
6
8
|
export declare function buildSource(field: Field): import("..").DataSource | unknown[] | undefined;
|
|
7
9
|
export declare function isArraySource(field: Field): boolean;
|
|
@@ -1,4 +1,26 @@
|
|
|
1
1
|
import type { Nullable, Option, Value } from '../type';
|
|
2
|
+
export declare function hasOwn(value: object, key: string): boolean;
|
|
3
|
+
export type Entry = {
|
|
4
|
+
found: boolean;
|
|
5
|
+
value: unknown;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* The one walk of a dotted path, for every reader of one.
|
|
9
|
+
*
|
|
10
|
+
* A flat key that is literally the path wins, because that is how the form
|
|
11
|
+
* keeps a list's leaves -- `items.0.name` is a key, not a route -- and a
|
|
12
|
+
* definition is free to name a field the same way. Then objects by key and
|
|
13
|
+
* arrays by numeric index.
|
|
14
|
+
*
|
|
15
|
+
* There were two of these, one per package, and they disagreed about that first
|
|
16
|
+
* step: a list named `config.items` was found by the reader in luna-react and
|
|
17
|
+
* not by the one here, so whether a form hydrated depended on which one the
|
|
18
|
+
* caller happened to use. `extract` and `resolveValue` are both this now.
|
|
19
|
+
*
|
|
20
|
+
* Every step asks `hasOwn`, so an inherited member is not a value and a name
|
|
21
|
+
* that reaches a prototype resolves to nothing. See SEG-2.
|
|
22
|
+
*/
|
|
23
|
+
export declare function resolveEntry(name: string, currentValue: Record<string, unknown> | unknown[]): Entry;
|
|
2
24
|
export declare function getEntity<T>(selected: Value, collection?: Nullable<T[]>, entity?: string): NonNullable<T> | {
|
|
3
25
|
value: import("..").Multiple;
|
|
4
26
|
} | {
|
|
@@ -23,4 +23,17 @@ export declare function isColumn(slot: Field | Column | List): slot is Column;
|
|
|
23
23
|
export declare function isField(slot: Field | Column | List): slot is Field;
|
|
24
24
|
export declare function isOptions(field: Field): field is Select;
|
|
25
25
|
export declare function isTextable(field: Field): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Whether hiding this slot leaves its value behind instead of taking it.
|
|
28
|
+
*
|
|
29
|
+
* Four places ask the question -- the two clears, the list that hands the
|
|
30
|
+
* answer to its leaves, and the registry a list publishes itself into -- and
|
|
31
|
+
* they used to ask it by reaching for the key themselves. One of them reaching
|
|
32
|
+
* a level too high is a `false` that typechecks and quietly drops the user's
|
|
33
|
+
* data, so the reach lives here once instead.
|
|
34
|
+
*
|
|
35
|
+
* `Field | List` and not `Column`: those are the two the runtime reads it off,
|
|
36
|
+
* and a signature wider than the implementation is a promise nothing keeps.
|
|
37
|
+
*/
|
|
38
|
+
export declare function keepsValue(slot: Field | List): boolean;
|
|
26
39
|
export declare function isValidValue<T>(value?: Nullable<T>): boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Definition, Filterable, Nullable } from '../type';
|
|
2
|
-
export declare function prepare<T extends Filterable>(base?: readonly T[], definition?: Definition):
|
|
2
|
+
export declare function prepare<T extends Filterable>(base?: readonly T[], definition?: Definition): T[];
|
|
3
3
|
export declare function resolveRefs(base: unknown, definition?: Definition, cache?: Map<object, unknown>, visited?: WeakSet<object>): unknown;
|
|
4
4
|
export declare function entries<T>(values?: Nullable<Record<string, T>>): [key: string, value: T][];
|
|
@@ -3,11 +3,11 @@ import type { CustomValidation, Definition, Field, Input, Schemas, Sections, Zod
|
|
|
3
3
|
export declare function buildSchema(schemas: Schemas, fields?: Field[], translations?: Record<string, string>): ZodSchema;
|
|
4
4
|
export declare function flatten(error: z.ZodError<Record<string, unknown>>): Record<string, string[]>;
|
|
5
5
|
export declare function getSchema(input: Input, translations?: Record<string, string>): z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
6
|
-
export declare function getEmail(input: Input, translations?: Record<string, string>): z.ZodPreprocess<z.ZodPipe<z.ZodString, z.ZodEmail>, unknown> | z.ZodNullable<z.ZodUnion<[z.ZodPipe<z.ZodString, z.ZodEmail>, z.ZodLiteral<"">]
|
|
7
|
-
export declare function getText(input: Input, translations?: Record<string, string>): z.ZodPreprocess<z.ZodCoercedString<unknown>, unknown> | z.ZodNullable<z.ZodCoercedString<unknown
|
|
8
|
-
export declare function getNumber(input: Input, translations?: Record<string, string>): z.ZodNullable<z.
|
|
9
|
-
export declare function getYearSchema(input: Input, translations?: Record<string, string>): z.ZodNullable<z.
|
|
10
|
-
export declare function getMonthSchema(input: Input, translations?: Record<string, string>): z.
|
|
6
|
+
export declare function getEmail(input: Input, translations?: Record<string, string>): z.ZodPreprocess<z.ZodPipe<z.ZodString, z.ZodEmail>, unknown> | z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodPipe<z.ZodString, z.ZodEmail>, z.ZodLiteral<"">]>>>;
|
|
7
|
+
export declare function getText(input: Input, translations?: Record<string, string>): z.ZodPreprocess<z.ZodCoercedString<unknown>, unknown> | z.ZodOptional<z.ZodNullable<z.ZodCoercedString<unknown>>>;
|
|
8
|
+
export declare function getNumber(input: Input, translations?: Record<string, string>): z.ZodPreprocess<z.ZodOptional<z.ZodNullable<z.ZodType<number, unknown, z.core.$ZodTypeInternals<number, unknown>>>>, unknown> | z.ZodPreprocess<z.ZodPipe<z.ZodUnknown, z.ZodType<number, unknown, z.core.$ZodTypeInternals<number, unknown>>>, unknown>;
|
|
9
|
+
export declare function getYearSchema(input: Input, translations?: Record<string, string>): z.ZodPreprocess<z.ZodOptional<z.ZodNullable<z.ZodType<number, unknown, z.core.$ZodTypeInternals<number, unknown>>>>, unknown> | z.ZodPreprocess<z.ZodPipe<z.ZodUnknown, z.ZodType<number, unknown, z.core.$ZodTypeInternals<number, unknown>>>, unknown>;
|
|
10
|
+
export declare function getMonthSchema(input: Input, translations?: Record<string, string>): z.ZodPreprocess<z.ZodOptional<z.ZodNullable<z.ZodType<number, unknown, z.core.$ZodTypeInternals<number, unknown>>>>, unknown> | z.ZodPreprocess<z.ZodPipe<z.ZodUnknown, z.ZodType<number, unknown, z.core.$ZodTypeInternals<number, unknown>>>, unknown>;
|
|
11
11
|
export declare function applyCustomValidation(schema: ZodSchema, fields?: Field[], translations?: Record<string, string>): ZodSchema;
|
|
12
12
|
export declare function validateCustom(value: unknown, rules: CustomValidation | Array<CustomValidation>, getValue: (name: string) => unknown, translations?: Record<string, string>): string[];
|
|
13
13
|
export declare function buildFormSchema(sections: Sections, translations?: Record<string, string>, definition?: Definition): z.ZodType;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Fields, PreviewItem } from '../../../../../luna-core/index';
|
|
2
|
-
|
|
2
|
+
type PreviewProps = Readonly<{
|
|
3
3
|
className?: string;
|
|
4
4
|
fields?: Fields;
|
|
5
5
|
label?: string;
|
|
@@ -8,4 +8,6 @@ export declare function FieldPreview({ className, fields, label, lang, name, pre
|
|
|
8
8
|
previews: PreviewItem | PreviewItem[];
|
|
9
9
|
translations?: Record<string, string>;
|
|
10
10
|
value?: Record<string, unknown> | unknown[] | null;
|
|
11
|
-
}
|
|
11
|
+
}>;
|
|
12
|
+
export declare function FieldPreview(props: PreviewProps): import("react").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Section, type Style } from '../../../../../luna-core/index';
|
|
2
|
+
export declare function FieldSet(props: Readonly<{
|
|
3
|
+
advanced?: {
|
|
4
|
+
step?: boolean;
|
|
5
|
+
};
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
section: Section;
|
|
8
|
+
step?: number;
|
|
9
|
+
style?: Style;
|
|
10
|
+
translations?: Record<string, string>;
|
|
11
|
+
}>): import("react").JSX.Element;
|
|
@@ -1,9 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import type { FieldProps } from '../../../component/field/field';
|
|
2
|
+
/**
|
|
3
|
+
* Everything a field reads from the store, in one component, with the memo
|
|
4
|
+
* around it rather than inside.
|
|
5
|
+
*
|
|
6
|
+
* Two wrappers used to sit outside that memo, one per atom, and both of them
|
|
7
|
+
* ran on every render of the form: a hundred fields cost two hundred renders a
|
|
8
|
+
* keystroke on a controlled host, for the memo underneath to then find every
|
|
9
|
+
* prop unchanged. Outside, the same comparison stops the field whole, the two
|
|
10
|
+
* reads included.
|
|
11
|
+
*
|
|
12
|
+
* Stopping there does not cut a field off from the store. What it reads are
|
|
13
|
+
* subscriptions, so its own state and its own errors render it whatever its
|
|
14
|
+
* props do -- which is the only way either of them changes.
|
|
15
|
+
*/
|
|
16
|
+
declare function FieldWithMeta(props: FieldProps): import("react").JSX.Element | null;
|
|
17
|
+
/**
|
|
18
|
+
* A field renders when something it can see has changed, and not because a
|
|
19
|
+
* field elsewhere in the form did.
|
|
20
|
+
*
|
|
21
|
+
* The default comparison, on purpose. An earlier attempt wrote its own, and
|
|
22
|
+
* that is a list of props kept in step by hand: the day someone adds one and
|
|
23
|
+
* forgets this file, the field silently stops updating, and nothing -- not the
|
|
24
|
+
* compiler, which does not ask a comparator to be exhaustive -- says so. The
|
|
25
|
+
* failure is wrong data on screen, which is exactly how that attempt was found
|
|
26
|
+
* out.
|
|
27
|
+
*
|
|
28
|
+
* What makes the default enough is that every prop reaching this component is
|
|
29
|
+
* steady across a keystroke. The value the host holds no longer travels as a
|
|
30
|
+
* prop, so `children` is a stable callback rather than a closure rebuilt
|
|
31
|
+
* whenever that value moved; a field reads its own entry from the store, and
|
|
32
|
+
* the one thing that has to be read while rendering comes through a context
|
|
33
|
+
* whose identity never changes. What used to move, `errors`, is read from the
|
|
34
|
+
* store now, on the inside of this comparison.
|
|
35
|
+
*/
|
|
36
|
+
export declare const Field: import("react").MemoExoticComponent<typeof FieldWithMeta>;
|
|
37
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type Description as DescriptionType } from '
|
|
2
|
-
import type { Config } from '
|
|
1
|
+
import { type Description as DescriptionType } from '../../../../luna-core/index';
|
|
2
|
+
import type { Config } from '../../type';
|
|
3
3
|
export declare function FormattedDescription(props: Readonly<{
|
|
4
4
|
config?: Config;
|
|
5
5
|
context?: Record<string, unknown>;
|
|
@@ -30,7 +30,7 @@ export type InputStrategies = Readonly<{
|
|
|
30
30
|
valueRef: React.RefObject<unknown>;
|
|
31
31
|
}>) => boolean;
|
|
32
32
|
dispatchChange: (ctx: Readonly<{
|
|
33
|
-
applyChangeEventsRef: React.RefObject<(
|
|
33
|
+
applyChangeEventsRef: React.RefObject<(s: unknown) => void>;
|
|
34
34
|
data: Nullable<unknown[]>;
|
|
35
35
|
entity?: string;
|
|
36
36
|
inputValue: Value;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const RevealContext: import("react").Context<() => void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useDisclosure(initialOpen?: boolean | (() => boolean)): readonly [boolean, () => void, () => void];
|