@arudovwen/form-builder-react 1.2.7 → 1.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/form-builder.es.js
CHANGED
|
@@ -37422,119 +37422,120 @@ const yD = ({
|
|
|
37422
37422
|
onSubmitData: n,
|
|
37423
37423
|
isReadOnly: a,
|
|
37424
37424
|
renderType: s = "multi",
|
|
37425
|
-
children: i
|
|
37425
|
+
children: i,
|
|
37426
|
+
hideFooter: o
|
|
37426
37427
|
}) => {
|
|
37427
|
-
const [
|
|
37428
|
-
resolver: Tf(
|
|
37428
|
+
const [l, c] = Ce(0), f = Qe(() => e.length, [e]), u = xD(e), d = _f({
|
|
37429
|
+
resolver: Tf(u),
|
|
37429
37430
|
mode: "onSubmit",
|
|
37430
37431
|
defaultValues: {}
|
|
37431
37432
|
}), {
|
|
37432
|
-
register:
|
|
37433
|
-
setValue:
|
|
37434
|
-
watch:
|
|
37435
|
-
handleSubmit:
|
|
37436
|
-
reset:
|
|
37437
|
-
getValues:
|
|
37438
|
-
formState: { errors:
|
|
37439
|
-
trigger:
|
|
37440
|
-
} =
|
|
37441
|
-
const
|
|
37442
|
-
(
|
|
37443
|
-
id:
|
|
37444
|
-
value:
|
|
37445
|
-
sectionId:
|
|
37446
|
-
type:
|
|
37433
|
+
register: p,
|
|
37434
|
+
setValue: h,
|
|
37435
|
+
watch: x,
|
|
37436
|
+
handleSubmit: m,
|
|
37437
|
+
reset: v,
|
|
37438
|
+
getValues: y,
|
|
37439
|
+
formState: { errors: g, isSubmitting: S },
|
|
37440
|
+
trigger: O
|
|
37441
|
+
} = d, k = ga("config"), _ = (C) => {
|
|
37442
|
+
const R = e.flatMap(
|
|
37443
|
+
(D) => D.questionData.map((W) => ({
|
|
37444
|
+
id: W.id,
|
|
37445
|
+
value: C[W.id],
|
|
37446
|
+
sectionId: D.id,
|
|
37447
|
+
type: W.type
|
|
37447
37448
|
}))
|
|
37448
37449
|
);
|
|
37449
|
-
n == null || n(
|
|
37450
|
+
n == null || n(R);
|
|
37450
37451
|
};
|
|
37451
37452
|
Ie(() => {
|
|
37452
37453
|
if (r != null && r.length) {
|
|
37453
|
-
const
|
|
37454
|
-
|
|
37454
|
+
const C = mD(r);
|
|
37455
|
+
v(C);
|
|
37455
37456
|
}
|
|
37456
|
-
}, [r,
|
|
37457
|
-
async function
|
|
37458
|
-
var
|
|
37459
|
-
!t && !await
|
|
37460
|
-
(
|
|
37461
|
-
) ||
|
|
37457
|
+
}, [r, v]);
|
|
37458
|
+
async function T() {
|
|
37459
|
+
var C;
|
|
37460
|
+
!t && !await O(
|
|
37461
|
+
(C = e == null ? void 0 : e[l].questionData) == null ? void 0 : C.map((D) => D.id)
|
|
37462
|
+
) || c((R) => R + 1);
|
|
37462
37463
|
}
|
|
37463
|
-
function
|
|
37464
|
-
|
|
37464
|
+
function b() {
|
|
37465
|
+
c((C) => C - 1);
|
|
37465
37466
|
}
|
|
37466
|
-
return /* @__PURE__ */ E.jsx(ah, { children: /* @__PURE__ */ E.jsx(Rb, { ...
|
|
37467
|
+
return /* @__PURE__ */ E.jsx(ah, { children: /* @__PURE__ */ E.jsx(Rb, { ...d, children: /* @__PURE__ */ E.jsxs(
|
|
37467
37468
|
"form",
|
|
37468
37469
|
{
|
|
37469
|
-
onSubmit:
|
|
37470
|
+
onSubmit: m(_),
|
|
37470
37471
|
className: "container h-full mx-auto",
|
|
37471
37472
|
children: [
|
|
37472
37473
|
/* @__PURE__ */ E.jsx("div", { className: "relative flex flex-col w-full py-4 gap-y-12", children: /* @__PURE__ */ E.jsxs("div", { children: [
|
|
37473
37474
|
s === "multi" && /* @__PURE__ */ E.jsxs("div", { className: "mb-4", children: [
|
|
37474
|
-
(e == null ? void 0 : e[
|
|
37475
|
-
(e == null ? void 0 : e[
|
|
37475
|
+
(e == null ? void 0 : e[l].title) && /* @__PURE__ */ E.jsx("h2", { className: "text-lg font-semibold mb-[6px]", children: e[l].title }),
|
|
37476
|
+
(e == null ? void 0 : e[l].description) && /* @__PURE__ */ E.jsx("p", { className: "text-sm", children: e[l].description })
|
|
37476
37477
|
] }),
|
|
37477
37478
|
s === "multi" ? /* @__PURE__ */ E.jsx(
|
|
37478
37479
|
vD,
|
|
37479
37480
|
{
|
|
37480
37481
|
form_data: e,
|
|
37481
37482
|
options: {
|
|
37482
|
-
register:
|
|
37483
|
-
setValue:
|
|
37484
|
-
watch:
|
|
37485
|
-
errors:
|
|
37486
|
-
trigger:
|
|
37487
|
-
isSubmitting:
|
|
37483
|
+
register: p,
|
|
37484
|
+
setValue: h,
|
|
37485
|
+
watch: x,
|
|
37486
|
+
errors: g,
|
|
37487
|
+
trigger: O,
|
|
37488
|
+
isSubmitting: S,
|
|
37488
37489
|
isReadOnly: a,
|
|
37489
|
-
getValues:
|
|
37490
|
+
getValues: y
|
|
37490
37491
|
},
|
|
37491
|
-
current:
|
|
37492
|
+
current: l
|
|
37492
37493
|
}
|
|
37493
37494
|
) : /* @__PURE__ */ E.jsx(
|
|
37494
37495
|
gD,
|
|
37495
37496
|
{
|
|
37496
37497
|
form_data: e,
|
|
37497
37498
|
options: {
|
|
37498
|
-
register:
|
|
37499
|
-
setValue:
|
|
37500
|
-
watch:
|
|
37501
|
-
errors:
|
|
37502
|
-
trigger:
|
|
37503
|
-
isSubmitting:
|
|
37499
|
+
register: p,
|
|
37500
|
+
setValue: h,
|
|
37501
|
+
watch: x,
|
|
37502
|
+
errors: g,
|
|
37503
|
+
trigger: O,
|
|
37504
|
+
isSubmitting: S,
|
|
37504
37505
|
isReadOnly: a,
|
|
37505
|
-
getValues:
|
|
37506
|
+
getValues: y
|
|
37506
37507
|
}
|
|
37507
37508
|
}
|
|
37508
37509
|
)
|
|
37509
|
-
] }, e == null ? void 0 : e[
|
|
37510
|
-
/* @__PURE__ */ E.jsxs("footer", { className: "flex items-center justify-end gap-4 pt-5 mt-8 border-t border-gray-100 footer", children: [
|
|
37510
|
+
] }, e == null ? void 0 : e[l].id) }),
|
|
37511
|
+
!o && /* @__PURE__ */ E.jsxs("footer", { className: "flex items-center justify-end gap-4 pt-5 mt-8 border-t border-gray-100 footer", children: [
|
|
37511
37512
|
s === "multi" && /* @__PURE__ */ E.jsxs(E.Fragment, { children: [
|
|
37512
|
-
|
|
37513
|
+
l !== 0 && /* @__PURE__ */ E.jsx(
|
|
37513
37514
|
Pn,
|
|
37514
37515
|
{
|
|
37515
37516
|
type: "button",
|
|
37516
37517
|
text: "Back",
|
|
37517
|
-
onClick:
|
|
37518
|
+
onClick: b,
|
|
37518
37519
|
btnClass: "text-gray-700 border-[#98A2B3] !font-medium !py-[10px] px-10 bg-gray-200 rounded-lg"
|
|
37519
37520
|
}
|
|
37520
37521
|
),
|
|
37521
|
-
|
|
37522
|
+
l !== f - 1 ? /* @__PURE__ */ E.jsx(
|
|
37522
37523
|
Pn,
|
|
37523
37524
|
{
|
|
37524
37525
|
type: "button",
|
|
37525
37526
|
text: "Continue",
|
|
37526
|
-
onClick:
|
|
37527
|
-
style: { background: (
|
|
37527
|
+
onClick: T,
|
|
37528
|
+
style: { background: (k == null ? void 0 : k.buttonColor) || "#333" },
|
|
37528
37529
|
btnClass: "text-gray-700 border-[#98A2B3] !font-medium !py-[10px] px-10 bg-blue-600 text-white rounded-lg continue_btn"
|
|
37529
37530
|
}
|
|
37530
37531
|
) : !t && (i || /* @__PURE__ */ E.jsx(
|
|
37531
37532
|
Pn,
|
|
37532
37533
|
{
|
|
37533
|
-
isDisabled:
|
|
37534
|
-
isLoading:
|
|
37534
|
+
isDisabled: S,
|
|
37535
|
+
isLoading: S,
|
|
37535
37536
|
type: "submit",
|
|
37536
37537
|
text: "Submit",
|
|
37537
|
-
style: { background: (
|
|
37538
|
+
style: { background: (k == null ? void 0 : k.buttonColor) || "#333" },
|
|
37538
37539
|
btnClass: "text-gray-700 border-[#98A2B3] !font-medium !py-[10px] px-10 bg-blue-600 text-white rounded-lg submit_btn"
|
|
37539
37540
|
}
|
|
37540
37541
|
))
|
|
@@ -37542,11 +37543,11 @@ const yD = ({
|
|
|
37542
37543
|
s === "single" && !t && (i || /* @__PURE__ */ E.jsx(
|
|
37543
37544
|
Pn,
|
|
37544
37545
|
{
|
|
37545
|
-
isDisabled:
|
|
37546
|
-
isLoading:
|
|
37546
|
+
isDisabled: S,
|
|
37547
|
+
isLoading: S,
|
|
37547
37548
|
type: "submit",
|
|
37548
37549
|
text: "Submit",
|
|
37549
|
-
style: { background: (
|
|
37550
|
+
style: { background: (k == null ? void 0 : k.buttonColor) || "#333" },
|
|
37550
37551
|
btnClass: "text-gray-700 border-[#98A2B3] !font-medium !py-[10px] px-10 bg-blue-600 text-white rounded-lg submit_btn"
|
|
37551
37552
|
}
|
|
37552
37553
|
))
|
|
@@ -37566,7 +37567,8 @@ function wD({
|
|
|
37566
37567
|
buttonColor: "#333"
|
|
37567
37568
|
},
|
|
37568
37569
|
renderType: o,
|
|
37569
|
-
children: l
|
|
37570
|
+
children: l,
|
|
37571
|
+
hideFooter: c
|
|
37570
37572
|
}) {
|
|
37571
37573
|
return Ie(() => {
|
|
37572
37574
|
i && Yp("config", i);
|
|
@@ -37579,7 +37581,8 @@ function wD({
|
|
|
37579
37581
|
onSubmitData: n,
|
|
37580
37582
|
isReadOnly: a,
|
|
37581
37583
|
renderType: o,
|
|
37582
|
-
children: l
|
|
37584
|
+
children: l,
|
|
37585
|
+
hideFooter: c
|
|
37583
37586
|
}
|
|
37584
37587
|
) }) : /* @__PURE__ */ E.jsx("div", { children: /* @__PURE__ */ E.jsx("p", { className: "p-6 text-gray-400 tex-sm", children: "Error: No form data available." }) });
|
|
37585
37588
|
}
|
package/dist/form-builder.umd.js
CHANGED
|
@@ -120,4 +120,4 @@ License: MIT
|
|
|
120
120
|
* @license MIT
|
|
121
121
|
*/function Lt(e,r){if(e===!1||e===null||typeof e>"u")throw new Error(r)}function dn(e,r){if(!e){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function Mf({pathname:e="/",search:r="",hash:t=""}){return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),t&&t!=="#"&&(e+=t.charAt(0)==="#"?t:"#"+t),e}function Bf(e){let r={};if(e){let t=e.indexOf("#");t>=0&&(r.hash=e.substring(t),e=e.substring(0,t));let n=e.indexOf("?");n>=0&&(r.search=e.substring(n),e=e.substring(0,n)),e&&(r.pathname=e)}return r}function Mm(e,r,t="/"){return m5(e,r,t,!1)}function m5(e,r,t,n){let a=typeof r=="string"?Bf(r):r,i=ha(a.pathname||"/",t);if(i==null)return null;let s=Bm(e);g5(s);let o=null;for(let l=0;o==null&&l<s.length;++l){let c=C5(i);o=S5(s[l],c,n)}return o}function Bm(e,r=[],t=[],n=""){let a=(i,s,o)=>{let l={relativePath:o===void 0?i.path||"":o,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};l.relativePath.startsWith("/")&&(Lt(l.relativePath.startsWith(n),`Absolute route path "${l.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),l.relativePath=l.relativePath.slice(n.length));let c=hn([n,l.relativePath]),f=t.concat(l);i.children&&i.children.length>0&&(Lt(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),Bm(i.children,r,f,c)),!(i.path==null&&!i.index)&&r.push({path:c,score:T5(c,i.index),routesMeta:f})};return e.forEach((i,s)=>{var o;if(i.path===""||!((o=i.path)!=null&&o.includes("?")))a(i,s);else for(let l of jm(i.path))a(i,s,l)}),r}function jm(e){let r=e.split("/");if(r.length===0)return[];let[t,...n]=r,a=t.endsWith("?"),i=t.replace(/\?$/,"");if(n.length===0)return a?[i,""]:[i];let s=jm(n.join("/")),o=[];return o.push(...s.map(l=>l===""?i:[i,l].join("/"))),a&&o.push(...s),o.map(l=>e.startsWith("/")&&l===""?"/":l)}function g5(e){e.sort((r,t)=>r.score!==t.score?t.score-r.score:k5(r.routesMeta.map(n=>n.childrenIndex),t.routesMeta.map(n=>n.childrenIndex)))}var v5=/^:[\w-]+$/,y5=3,b5=2,w5=1,_5=10,E5=-2,$m=e=>e==="*";function T5(e,r){let t=e.split("/"),n=t.length;return t.some($m)&&(n+=E5),r&&(n+=b5),t.filter(a=>!$m(a)).reduce((a,i)=>a+(v5.test(i)?y5:i===""?w5:_5),n)}function k5(e,r){return e.length===r.length&&e.slice(0,-1).every((n,a)=>n===r[a])?e[e.length-1]-r[r.length-1]:0}function S5(e,r,t=!1){let{routesMeta:n}=e,a={},i="/",s=[];for(let o=0;o<n.length;++o){let l=n[o],c=o===n.length-1,f=i==="/"?r:r.slice(i.length)||"/",u=No({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},f),d=l.route;if(!u&&c&&t&&!n[n.length-1].route.index&&(u=No({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},f)),!u)return null;Object.assign(a,u.params),s.push({params:a,pathname:hn([i,u.pathname]),pathnameBase:N5(hn([i,u.pathnameBase])),route:d}),u.pathnameBase!=="/"&&(i=hn([i,u.pathnameBase]))}return s}function No(e,r){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[t,n]=F5(e.path,e.caseSensitive,e.end),a=r.match(t);if(!a)return null;let i=a[0],s=i.replace(/(.)\/+$/,"$1"),o=a.slice(1);return{params:n.reduce((c,{paramName:f,isOptional:u},d)=>{if(f==="*"){let h=o[d]||"";s=i.slice(0,i.length-h.length).replace(/(.)\/+$/,"$1")}const p=o[d];return u&&!p?c[f]=void 0:c[f]=(p||"").replace(/%2F/g,"/"),c},{}),pathname:i,pathnameBase:s,pattern:e}}function F5(e,r=!1,t=!0){dn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,o,l)=>(n.push({paramName:o,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,r?void 0:"i"),n]}function C5(e){try{return e.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return dn(!1,`The URL path "${e}" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding (${r}).`),e}}function ha(e,r){if(r==="/")return e;if(!e.toLowerCase().startsWith(r.toLowerCase()))return null;let t=r.endsWith("/")?r.length-1:r.length,n=e.charAt(t);return n&&n!=="/"?null:e.slice(t)||"/"}function A5(e,r="/"){let{pathname:t,search:n="",hash:a=""}=typeof e=="string"?Bf(e):e;return{pathname:t?t.startsWith("/")?t:O5(t,r):r,search:I5(n),hash:P5(a)}}function O5(e,r){let t=r.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?t.length>1&&t.pop():a!=="."&&t.push(a)}),t.length>1?t.join("/"):"/"}function jf(e,r,t,n){return`Cannot include a '${e}' character in a manually specified \`to.${r}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${t}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function D5(e){return e.filter((r,t)=>t===0||r.route.path&&r.route.path.length>0)}function Um(e){let r=D5(e);return r.map((t,n)=>n===r.length-1?t.pathname:t.pathnameBase)}function Vm(e,r,t,n=!1){let a;typeof e=="string"?a=Bf(e):(a={...e},Lt(!a.pathname||!a.pathname.includes("?"),jf("?","pathname","search",a)),Lt(!a.pathname||!a.pathname.includes("#"),jf("#","pathname","hash",a)),Lt(!a.search||!a.search.includes("#"),jf("#","search","hash",a)));let i=e===""||a.pathname==="",s=i?"/":a.pathname,o;if(s==null)o=t;else{let u=r.length-1;if(!n&&s.startsWith("..")){let d=s.split("/");for(;d[0]==="..";)d.shift(),u-=1;a.pathname=d.join("/")}o=u>=0?r[u]:"/"}let l=A5(a,o),c=s&&s!=="/"&&s.endsWith("/"),f=(i||s===".")&&t.endsWith("/");return!l.pathname.endsWith("/")&&(c||f)&&(l.pathname+="/"),l}var hn=e=>e.join("/").replace(/\/\/+/g,"/"),N5=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),I5=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,P5=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function L5(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var Hm=["POST","PUT","PATCH","DELETE"];new Set(Hm);var R5=["GET",...Hm];new Set(R5);var Va=ee.createContext(null);Va.displayName="DataRouter";var Io=ee.createContext(null);Io.displayName="DataRouterState";var Wm=ee.createContext({isTransitioning:!1});Wm.displayName="ViewTransition";var M5=ee.createContext(new Map);M5.displayName="Fetchers";var B5=ee.createContext(null);B5.displayName="Await";var pn=ee.createContext(null);pn.displayName="Navigation";var $f=ee.createContext(null);$f.displayName="Location";var xn=ee.createContext({outlet:null,matches:[],isDataRoute:!1});xn.displayName="Route";var Uf=ee.createContext(null);Uf.displayName="RouteError";function j5(e,{relative:r}={}){Lt(Po(),"useHref() may be used only in the context of a <Router> component.");let{basename:t,navigator:n}=ee.useContext(pn),{hash:a,pathname:i,search:s}=Zi(e,{relative:r}),o=i;return t!=="/"&&(o=i==="/"?t:hn([t,i])),n.createHref({pathname:o,search:s,hash:a})}function Po(){return ee.useContext($f)!=null}function pa(){return Lt(Po(),"useLocation() may be used only in the context of a <Router> component."),ee.useContext($f).location}var zm="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Gm(e){ee.useContext(pn).static||ee.useLayoutEffect(e)}function $5(){let{isDataRoute:e}=ee.useContext(xn);return e?Q5():U5()}function U5(){Lt(Po(),"useNavigate() may be used only in the context of a <Router> component.");let e=ee.useContext(Va),{basename:r,navigator:t}=ee.useContext(pn),{matches:n}=ee.useContext(xn),{pathname:a}=pa(),i=JSON.stringify(Um(n)),s=ee.useRef(!1);return Gm(()=>{s.current=!0}),ee.useCallback((l,c={})=>{if(dn(s.current,zm),!s.current)return;if(typeof l=="number"){t.go(l);return}let f=Vm(l,JSON.parse(i),a,c.relative==="path");e==null&&r!=="/"&&(f.pathname=f.pathname==="/"?r:hn([r,f.pathname])),(c.replace?t.replace:t.push)(f,c.state,c)},[r,t,i,a,e])}ee.createContext(null);function Zi(e,{relative:r}={}){let{matches:t}=ee.useContext(xn),{pathname:n}=pa(),a=JSON.stringify(Um(t));return ee.useMemo(()=>Vm(e,JSON.parse(a),n,r==="path"),[e,a,n,r])}function V5(e,r,t,n){Lt(Po(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=ee.useContext(pn),{matches:i}=ee.useContext(xn),s=i[i.length-1],o=s?s.params:{},l=s?s.pathname:"/",c=s?s.pathnameBase:"/",f=s&&s.route;{let v=f&&f.path||"";Xm(l,!f||v.endsWith("*")||v.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${v}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
122
122
|
|
|
123
|
-
Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}/*`}">.`)}let u=pa(),d;d=u;let p=d.pathname||"/",h=p;if(c!=="/"){let v=c.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(v.length).join("/")}let x=Mm(e,{pathname:h});return dn(f||x!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),dn(x==null||x[x.length-1].route.element!==void 0||x[x.length-1].route.Component!==void 0||x[x.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),q5(x&&x.map(v=>Object.assign({},v,{params:Object.assign({},o,v.params),pathname:hn([c,a.encodeLocation?a.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?c:hn([c,a.encodeLocation?a.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),i,t,n)}function H5(){let e=Z5(),r=L5(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),t=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:n},i={padding:"2px 4px",backgroundColor:n},s=null;return console.error("Error handled by React Router default ErrorBoundary:",e),s=ee.createElement(ee.Fragment,null,ee.createElement("p",null,"💿 Hey developer 👋"),ee.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",ee.createElement("code",{style:i},"ErrorBoundary")," or"," ",ee.createElement("code",{style:i},"errorElement")," prop on your route.")),ee.createElement(ee.Fragment,null,ee.createElement("h2",null,"Unexpected Application Error!"),ee.createElement("h3",{style:{fontStyle:"italic"}},r),t?ee.createElement("pre",{style:a},t):null,s)}var W5=ee.createElement(H5,null),z5=class extends ee.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,r){return r.location!==e.location||r.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:r.error,location:r.location,revalidation:e.revalidation||r.revalidation}}componentDidCatch(e,r){console.error("React Router caught the following error during render",e,r)}render(){return this.state.error!==void 0?ee.createElement(xn.Provider,{value:this.props.routeContext},ee.createElement(Uf.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function G5({routeContext:e,match:r,children:t}){let n=ee.useContext(Va);return n&&n.static&&n.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=r.route.id),ee.createElement(xn.Provider,{value:e},t)}function q5(e,r=[],t=null,n=null){if(e==null){if(!t)return null;if(t.errors)e=t.matches;else if(r.length===0&&!t.initialized&&t.matches.length>0)e=t.matches;else return null}let a=e,i=t==null?void 0:t.errors;if(i!=null){let l=a.findIndex(c=>c.route.id&&(i==null?void 0:i[c.route.id])!==void 0);Lt(l>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),a=a.slice(0,Math.min(a.length,l+1))}let s=!1,o=-1;if(t)for(let l=0;l<a.length;l++){let c=a[l];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(o=l),c.route.id){let{loaderData:f,errors:u}=t,d=c.route.loader&&!f.hasOwnProperty(c.route.id)&&(!u||u[c.route.id]===void 0);if(c.route.lazy||d){s=!0,o>=0?a=a.slice(0,o+1):a=[a[0]];break}}}return a.reduceRight((l,c,f)=>{let u,d=!1,p=null,h=null;t&&(u=i&&c.route.id?i[c.route.id]:void 0,p=c.route.errorElement||W5,s&&(o<0&&f===0?(Xm("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,h=null):o===f&&(d=!0,h=c.route.hydrateFallbackElement||null)));let x=r.concat(a.slice(0,f+1)),m=()=>{let v;return u?v=p:d?v=h:c.route.Component?v=ee.createElement(c.route.Component,null):c.route.element?v=c.route.element:v=l,ee.createElement(G5,{match:c,routeContext:{outlet:l,matches:x,isDataRoute:t!=null},children:v})};return t&&(c.route.ErrorBoundary||c.route.errorElement||f===0)?ee.createElement(z5,{location:t.location,revalidation:t.revalidation,component:p,error:u,children:m(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):m()},null)}function Vf(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function X5(e){let r=ee.useContext(Va);return Lt(r,Vf(e)),r}function K5(e){let r=ee.useContext(Io);return Lt(r,Vf(e)),r}function Y5(e){let r=ee.useContext(xn);return Lt(r,Vf(e)),r}function Hf(e){let r=Y5(e),t=r.matches[r.matches.length-1];return Lt(t.route.id,`${e} can only be used on routes that contain a unique "id"`),t.route.id}function J5(){return Hf("useRouteId")}function Z5(){var n;let e=ee.useContext(Uf),r=K5("useRouteError"),t=Hf("useRouteError");return e!==void 0?e:(n=r.errors)==null?void 0:n[t]}function Q5(){let{router:e}=X5("useNavigate"),r=Hf("useNavigate"),t=ee.useRef(!1);return Gm(()=>{t.current=!0}),ee.useCallback(async(a,i={})=>{dn(t.current,zm),t.current&&(typeof a=="number"?e.navigate(a):await e.navigate(a,{fromRouteId:r,...i}))},[e,r])}var qm={};function Xm(e,r,t){!r&&!qm[e]&&(qm[e]=!0,dn(!1,t))}ee.memo(e6);function e6({routes:e,future:r,state:t}){return V5(e,void 0,t,r)}var Lo="get",Ro="application/x-www-form-urlencoded";function Mo(e){return e!=null&&typeof e.tagName=="string"}function t6(e){return Mo(e)&&e.tagName.toLowerCase()==="button"}function r6(e){return Mo(e)&&e.tagName.toLowerCase()==="form"}function n6(e){return Mo(e)&&e.tagName.toLowerCase()==="input"}function a6(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function i6(e,r){return e.button===0&&(!r||r==="_self")&&!a6(e)}var Bo=null;function s6(){if(Bo===null)try{new FormData(document.createElement("form"),0),Bo=!1}catch{Bo=!0}return Bo}var o6=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Wf(e){return e!=null&&!o6.has(e)?(dn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ro}"`),null):e}function l6(e,r){let t,n,a,i,s;if(r6(e)){let o=e.getAttribute("action");n=o?ha(o,r):null,t=e.getAttribute("method")||Lo,a=Wf(e.getAttribute("enctype"))||Ro,i=new FormData(e)}else if(t6(e)||n6(e)&&(e.type==="submit"||e.type==="image")){let o=e.form;if(o==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||o.getAttribute("action");if(n=l?ha(l,r):null,t=e.getAttribute("formmethod")||o.getAttribute("method")||Lo,a=Wf(e.getAttribute("formenctype"))||Wf(o.getAttribute("enctype"))||Ro,i=new FormData(o,e),!s6()){let{name:c,type:f,value:u}=e;if(f==="image"){let d=c?`${c}.`:"";i.append(`${d}x`,"0"),i.append(`${d}y`,"0")}else c&&i.append(c,u)}}else{if(Mo(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');t=Lo,n=null,a=Ro,s=e}return i&&a==="text/plain"&&(s=i,i=void 0),{action:n,method:t.toLowerCase(),encType:a,formData:i,body:s}}function zf(e,r){if(e===!1||e===null||typeof e>"u")throw new Error(r)}async function c6(e,r){if(e.id in r)return r[e.id];try{let t=await import(e.module);return r[e.id]=t,t}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function f6(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function u6(e,r,t){let n=await Promise.all(e.map(async a=>{let i=r.routes[a.route.id];if(i){let s=await c6(i,t);return s.links?s.links():[]}return[]}));return x6(n.flat(1).filter(f6).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function Km(e,r,t,n,a,i){let s=(l,c)=>t[c]?l.route.id!==t[c].route.id:!0,o=(l,c)=>{var f;return t[c].pathname!==l.pathname||((f=t[c].route.path)==null?void 0:f.endsWith("*"))&&t[c].params["*"]!==l.params["*"]};return i==="assets"?r.filter((l,c)=>s(l,c)||o(l,c)):i==="data"?r.filter((l,c)=>{var u;let f=n.routes[l.route.id];if(!f||!f.hasLoader)return!1;if(s(l,c)||o(l,c))return!0;if(l.route.shouldRevalidate){let d=l.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((u=t[0])==null?void 0:u.params)||{},nextUrl:new URL(e,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof d=="boolean")return d}return!0}):[]}function d6(e,r){return h6(e.map(t=>{let n=r.routes[t.route.id];if(!n)return[];let a=[n.module];return n.imports&&(a=a.concat(n.imports)),a}).flat(1))}function h6(e){return[...new Set(e)]}function p6(e){let r={},t=Object.keys(e).sort();for(let n of t)r[n]=e[n];return r}function x6(e,r){let t=new Set;return new Set(r),e.reduce((n,a)=>{let i=JSON.stringify(p6(a));return t.has(i)||(t.add(i),n.push({key:i,link:a})),n},[])}function m6(e){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname="_root.data":r.pathname=`${r.pathname.replace(/\/$/,"")}.data`,r}function g6(){let e=ee.useContext(Va);return zf(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function v6(){let e=ee.useContext(Io);return zf(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Gf=ee.createContext(void 0);Gf.displayName="FrameworkContext";function Ym(){let e=ee.useContext(Gf);return zf(e,"You must render this element inside a <HydratedRouter> element"),e}function y6(e,r){let t=ee.useContext(Gf),[n,a]=ee.useState(!1),[i,s]=ee.useState(!1),{onFocus:o,onBlur:l,onMouseEnter:c,onMouseLeave:f,onTouchStart:u}=r,d=ee.useRef(null);ee.useEffect(()=>{if(e==="render"&&s(!0),e==="viewport"){let x=v=>{v.forEach(y=>{s(y.isIntersecting)})},m=new IntersectionObserver(x,{threshold:.5});return d.current&&m.observe(d.current),()=>{m.disconnect()}}},[e]),ee.useEffect(()=>{if(n){let x=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(x)}}},[n]);let p=()=>{a(!0)},h=()=>{a(!1),s(!1)};return t?e!=="intent"?[i,d,{}]:[i,d,{onFocus:Qi(o,p),onBlur:Qi(l,h),onMouseEnter:Qi(c,p),onMouseLeave:Qi(f,h),onTouchStart:Qi(u,p)}]:[!1,d,{}]}function Qi(e,r){return t=>{e&&e(t),t.defaultPrevented||r(t)}}function b6({page:e,...r}){let{router:t}=g6(),n=ee.useMemo(()=>Mm(t.routes,e,t.basename),[t.routes,e,t.basename]);return n?ee.createElement(_6,{page:e,matches:n,...r}):null}function w6(e){let{manifest:r,routeModules:t}=Ym(),[n,a]=ee.useState([]);return ee.useEffect(()=>{let i=!1;return u6(e,r,t).then(s=>{i||a(s)}),()=>{i=!0}},[e,r,t]),n}function _6({page:e,matches:r,...t}){let n=pa(),{manifest:a,routeModules:i}=Ym(),{loaderData:s,matches:o}=v6(),l=ee.useMemo(()=>Km(e,r,o,a,n,"data"),[e,r,o,a,n]),c=ee.useMemo(()=>Km(e,r,o,a,n,"assets"),[e,r,o,a,n]),f=ee.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let p=new Set,h=!1;if(r.forEach(m=>{var y;let v=a.routes[m.route.id];!v||!v.hasLoader||(!l.some(g=>g.route.id===m.route.id)&&m.route.id in s&&((y=i[m.route.id])!=null&&y.shouldRevalidate)||v.hasClientLoader?h=!0:p.add(m.route.id))}),p.size===0)return[];let x=m6(e);return h&&p.size>0&&x.searchParams.set("_routes",r.filter(m=>p.has(m.route.id)).map(m=>m.route.id).join(",")),[x.pathname+x.search]},[s,n,a,l,r,e,i]),u=ee.useMemo(()=>d6(c,a),[c,a]),d=w6(c);return ee.createElement(ee.Fragment,null,f.map(p=>ee.createElement("link",{key:p,rel:"prefetch",as:"fetch",href:p,...t})),u.map(p=>ee.createElement("link",{key:p,rel:"modulepreload",href:p,...t})),d.map(({key:p,link:h})=>ee.createElement("link",{key:p,...h})))}function E6(...e){return r=>{e.forEach(t=>{typeof t=="function"?t(r):t!=null&&(t.current=r)})}}var Jm=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Jm&&(window.__reactRouterVersion="7.1.1")}catch{}var Zm=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,qf=ee.forwardRef(function({onClick:r,discover:t="render",prefetch:n="none",relative:a,reloadDocument:i,replace:s,state:o,target:l,to:c,preventScrollReset:f,viewTransition:u,...d},p){let{basename:h}=ee.useContext(pn),x=typeof c=="string"&&Zm.test(c),m,v=!1;if(typeof c=="string"&&x&&(m=c,Jm))try{let w=new URL(window.location.href),O=c.startsWith("//")?new URL(w.protocol+c):new URL(c),N=ha(O.pathname,h);O.origin===w.origin&&N!=null?c=N+O.search+O.hash:v=!0}catch{dn(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let y=j5(c,{relative:a}),[g,F,D]=y6(n,d),S=F6(c,{replace:s,state:o,target:l,preventScrollReset:f,relative:a,viewTransition:u});function E(w){r&&r(w),w.defaultPrevented||S(w)}let T=ee.createElement("a",{...d,...D,href:m||y,onClick:v||i?r:E,ref:E6(p,F),target:l,"data-discover":!x&&t==="render"?"true":void 0});return g&&!x?ee.createElement(ee.Fragment,null,T,ee.createElement(b6,{page:y})):T});qf.displayName="Link";var T6=ee.forwardRef(function({"aria-current":r="page",caseSensitive:t=!1,className:n="",end:a=!1,style:i,to:s,viewTransition:o,children:l,...c},f){let u=Zi(s,{relative:c.relative}),d=pa(),p=ee.useContext(Io),{navigator:h,basename:x}=ee.useContext(pn),m=p!=null&&N6(u)&&o===!0,v=h.encodeLocation?h.encodeLocation(u).pathname:u.pathname,y=d.pathname,g=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(y=y.toLowerCase(),g=g?g.toLowerCase():null,v=v.toLowerCase()),g&&x&&(g=ha(g,x)||g);const F=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let D=y===v||!a&&y.startsWith(v)&&y.charAt(F)==="/",S=g!=null&&(g===v||!a&&g.startsWith(v)&&g.charAt(v.length)==="/"),E={isActive:D,isPending:S,isTransitioning:m},T=D?r:void 0,w;typeof n=="function"?w=n(E):w=[n,D?"active":null,S?"pending":null,m?"transitioning":null].filter(Boolean).join(" ");let O=typeof i=="function"?i(E):i;return ee.createElement(qf,{...c,"aria-current":T,className:w,ref:f,style:O,to:s,viewTransition:o},typeof l=="function"?l(E):l)});T6.displayName="NavLink";var k6=ee.forwardRef(({discover:e="render",fetcherKey:r,navigate:t,reloadDocument:n,replace:a,state:i,method:s=Lo,action:o,onSubmit:l,relative:c,preventScrollReset:f,viewTransition:u,...d},p)=>{let h=O6(),x=D6(o,{relative:c}),m=s.toLowerCase()==="get"?"get":"post",v=typeof o=="string"&&Zm.test(o),y=g=>{if(l&&l(g),g.defaultPrevented)return;g.preventDefault();let F=g.nativeEvent.submitter,D=(F==null?void 0:F.getAttribute("formmethod"))||s;h(F||g.currentTarget,{fetcherKey:r,method:D,navigate:t,replace:a,state:i,relative:c,preventScrollReset:f,viewTransition:u})};return ee.createElement("form",{ref:p,method:m,action:x,onSubmit:n?l:y,...d,"data-discover":!v&&e==="render"?"true":void 0})});k6.displayName="Form";function S6(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Qm(e){let r=ee.useContext(Va);return Lt(r,S6(e)),r}function F6(e,{target:r,replace:t,state:n,preventScrollReset:a,relative:i,viewTransition:s}={}){let o=$5(),l=pa(),c=Zi(e,{relative:i});return ee.useCallback(f=>{if(i6(f,r)){f.preventDefault();let u=t!==void 0?t:Mf(l)===Mf(c);o(e,{replace:u,state:n,preventScrollReset:a,relative:i,viewTransition:s})}},[l,o,c,t,n,r,e,a,i,s])}var C6=0,A6=()=>`__${String(++C6)}__`;function O6(){let{router:e}=Qm("useSubmit"),{basename:r}=ee.useContext(pn),t=J5();return ee.useCallback(async(n,a={})=>{let{action:i,method:s,encType:o,formData:l,body:c}=l6(n,r);if(a.navigate===!1){let f=a.fetcherKey||A6();await e.fetch(f,t,a.action||i,{preventScrollReset:a.preventScrollReset,formData:l,body:c,formMethod:a.method||s,formEncType:a.encType||o,flushSync:a.flushSync})}else await e.navigate(a.action||i,{preventScrollReset:a.preventScrollReset,formData:l,body:c,formMethod:a.method||s,formEncType:a.encType||o,replace:a.replace,state:a.state,fromRouteId:t,flushSync:a.flushSync,viewTransition:a.viewTransition})},[e,r,t])}function D6(e,{relative:r}={}){let{basename:t}=ee.useContext(pn),n=ee.useContext(xn);Lt(n,"useFormAction must be used inside a RouteContext");let[a]=n.matches.slice(-1),i={...Zi(e||".",{relative:r})},s=pa();if(e==null){i.search=s.search;let o=new URLSearchParams(i.search),l=o.getAll("index");if(l.some(f=>f==="")){o.delete("index"),l.filter(u=>u).forEach(u=>o.append("index",u));let f=o.toString();i.search=f?`?${f}`:""}}return(!e||e===".")&&a.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),t!=="/"&&(i.pathname=i.pathname==="/"?t:hn([t,i.pathname])),Mf(i)}function N6(e,r={}){let t=ee.useContext(Wm);Lt(t!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=Qm("useViewTransitionState"),a=Zi(e,{relative:r.relative});if(!t.isTransitioning)return!1;let i=ha(t.currentLocation.pathname,n)||t.currentLocation.pathname,s=ha(t.nextLocation.pathname,n)||t.nextLocation.pathname;return No(a.pathname,s)!=null||No(a.pathname,i)!=null}new TextEncoder;const Ln=({text:e="",isDisabled:r=!1,isLoading:t=!1,btnClass:n="bg-primary-500 text-white",icon:a="",iconPosition:i="left",iconClass:s="text-[20px]",loadingClass:o="",link:l="",div:c=!1,type:f="button",style:u,onClick:d})=>{const p=We("btn inline-flex justify-center",{"pointer-events-none":t,"opacity-40 cursor-not-allowed":r},n),h=()=>t?_.jsxs(_.Fragment,{children:[_.jsxs("svg",{className:`animate-spin -ml-1 mr-3 h-5 w-5 ${o}`,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[_.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),_.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Loading..."]}):_.jsxs("span",{className:"flex items-center",children:[a&&i==="left"&&_.jsx("span",{className:`mr-[6px] ${s}`,children:_.jsx(ct,{icon:a})}),e&&_.jsx("span",{children:e}),a&&i==="right"&&_.jsx("span",{className:`ml-[6px] ${s}`,children:_.jsx(ct,{icon:a})})]});return c?_.jsx("div",{className:p,children:h()}):l?_.jsx(qf,{to:l,className:p,children:h()}):_.jsx("button",{disabled:r,type:f,className:p,"data-testid":"btn",onClick:d,style:u,children:h()})},I6=({isOpen:e,onClose:r})=>{const{formData:t}=k.useContext(Fr);if(!e)return null;const n=Yn("config");return _.jsx("div",{className:"fixed inset-0 bg-black/30 flex items-center justify-center z-[999] cursor-default no-drag select-none",children:_.jsxs("div",{className:"max-w-[700px] bg-white rounded-xl shadow-xl relative flex flex-col items-center w-full py-6 px-6",children:[_.jsx("button",{type:"button",onClick:r,className:"absolute text-sm top-3 right-4",children:"Close"}),_.jsx("div",{className:"max-h-[90vh] overflow-y-auto h-full min-h-[600px] w-full ",children:_.jsx(t1,{form_data:t,ignoreValidation:!0,config:n})})]})})},tr=Yn("config");function P6({title:e,goBackUrl:r,onSubmit:t,onPublish:n}){const{addSection:a,formData:i}=k.useContext(Fr),[s,o]=k.useState(!1);function l(){localStorage.setItem("formData",JSON.stringify(i)),t==null||t(i)}function c(){localStorage.setItem("formData",JSON.stringify(i)),n==null||n(i)}return _.jsxs("div",{className:"px-[30px] py-3 flex justify-between items-center bg-[#F9F9FB] top_bar",children:[_.jsxs("span",{className:"flex items-center gap-x-[6px]",children:[" ",r&&_.jsx("button",{type:"button",onClick:()=>r(),style:{color:(tr==null?void 0:tr.buttonColor)||"#333"},children:_.jsx(ct,{icon:"bxs:chevron-left-square",iconClass:"text-2xl"})})," ",_.jsx("h1",{className:"text-base font-semibold form_title",children:e||""})]}),s&&_.jsx(I6,{isOpen:s,onClose:()=>o(!1),element:void 0}),_.jsxs("div",{className:"flex justify-end text-xs gap-x-3",children:[_.jsx(Ln,{onClick:()=>a(),text:"Add section",btnClass:" !px-2 !font-medium bg-transparent !text-sm form_section !normal-case",icon:"icon-park-outline:plus",iconClass:"text-base",style:{color:(tr==null?void 0:tr.buttonColor)||"#333"}}),_.jsx(Ln,{onClick:()=>o(!0),text:"Preview",btnClass:"!px-2 bg-transparent !font-medium !text-sm form_preview",icon:"solar:eye-bold-duotone",iconClass:"text-base",style:{color:(tr==null?void 0:tr.buttonColor)||"#333"}}),_.jsx(Ln,{onClick:()=>l(),text:"Save",btnClass:"!px-2 bg-transparent !font-medium !text-sm form_save__btn",icon:"lets-icons:save-duotone",iconClass:"text-base",style:{color:(tr==null?void 0:tr.buttonColor)||"#333"}}),_.jsx(Ln,{onClick:()=>c(),text:"Publish",style:{background:(tr==null?void 0:tr.buttonColor)||"#333"},btnClass:"border-[#98A2B3] !font-medium !text-sm !py-[8px] px-6 text-white rounded-lg form_publish__btn"})]})]})}const e1=({loadingClass:e})=>{const r=We("h-full w-full min-h-[300px] flex justify-center items-center",e);return k.useEffect(()=>{const t=Yn("config"),n=(t==null?void 0:t.loaderColor)||"#333";document.documentElement.style.setProperty("--loader-color",n)},[]),_.jsx("div",{className:r,children:_.jsx("span",{className:"loader"})})};function L6({onSubmit:e,questionData:r,title:t,goBackUrl:n,loading:a,onPublish:i}){return _.jsx(m0,{children:_.jsxs("div",{className:"w-full h-full bg-[#F5F5F5] flex flex-col",children:[_.jsx(j1,{}),_.jsx("div",{className:"border-b bg-white border-[#E4E7EC]",children:_.jsx(P6,{title:t,goBackUrl:n,onSubmit:e,onPublish:i})}),_.jsxs("div",{className:"flex flex-1 p-4 gap-x-4",children:[_.jsx("div",{children:_.jsx("div",{className:"w-[270px] border border-[#E4E7EC] bg-white max-h-[calc(100vh-100px)] overflow-y-auto side_shadow rounded-lg no-scrollbar",children:_.jsx(p5,{})})}),_.jsx("div",{className:"flex-1 h-full max-h-full z-[1] ",children:a?_.jsx(e1,{loadingClass:"!w-full !h-[800px]"}):_.jsx(d5,{questionData:r})})]})]})})}const R6=({onSubmit:e,questionData:r,isReadOnly:t,config:n={buttonColor:"#333"},title:a,loading:i,goBackUrl:s,onPublish:o})=>(k.useEffect(()=>{n&&uh("config",n)},[n]),_.jsx(L6,{onSubmit:e,onPublish:o,questionData:r,isReadOnly:t,title:a,goBackUrl:s,loading:i})),xa={required:"This field is required",email:"Invalid email format",minLength:e=>`Minimum length is ${e}`,maxLength:e=>`Maximum length is ${e}`,minAmount:e=>`Minimum amount is ${e}`,maxAmount:e=>`Maximum amount is ${e}`},M6=e=>({textField:Ze().nullable(),longText:Ze().nullable(),numberField:Ca().nullable().transform(t=>isNaN(t)?null:t),amountField:Ca().nullable().transform(t=>isNaN(t)?null:t),selectField:Ze().nullable(),checkbox:Fa().nullable(),radio:Fa().nullable(),email:Ze().nullable().email(xa.email),date:Ec().typeError("Invalid date").nullable()})[e]||Fa().nullable(),B6=(e,r,t)=>r?e.type==="boolean"?e.oneOf([!0],t||xa.required):e.required(t||xa.required):e,j6=(e,{minLength:r,maxLength:t,minLengthMessage:n,maxLengthMessage:a})=>{let i=e;return r&&(i=i.min(r,n||xa.minLength(r))),t&&(i=i.max(t,a||xa.maxLength(t))),i},$6=(e,{minAmount:r,maxAmount:t,minAmountMessage:n,maxAmountMessage:a})=>{let i=e;return r&&(i=i.min(parseFloat(String(r)),n||xa.minAmount(r))),t&&(i=i.max(parseFloat(String(t)),a||xa.maxAmount(t))),i};function U6(e){const r={};return e.forEach(({questionData:t})=>{t.forEach(n=>{const{id:a,type:i,isRequired:s,requiredMessage:o}=n;let l=M6(i);l=B6(l,s,o),i==="textField"||i==="longText"||i==="email"?l=j6(l,n):(i==="numberField"||i==="amountField")&&(l=$6(l,n)),r[a]=l})}),yi().shape(r)}function V6(e){return e.reduce((r,t)=>(r[t.id]=t.value,r),{})}const jo=(e,r)=>{const t=Im[e.type];return t?_.jsxs("div",{children:[e.inputLabel&&_.jsx("label",{className:"block text-sm font-medium mb-[5px]",children:e.inputLabel}),_.jsx(t,{element:e,state:"edit",validationData:r})]}):null};function H6({form_data:e,options:r}){return _.jsx("div",{className:"grid gap-y-10",children:e.flatMap(t=>{var n;return _.jsxs("div",{className:"pb-6 border-b border-gray-100 last:border-none",children:[_.jsxs("div",{className:"mb-4",children:[t.title&&_.jsx("h2",{className:"text-lg font-semibold mb-[4px]",children:t==null?void 0:t.title}),t.description&&_.jsx("p",{className:"text-sm",children:t==null?void 0:t.description})]}),(n=t.questionData)==null?void 0:n.map(a=>{var i,s;if(a.type==="grid"){const o=t.questionData.filter(l=>l.gridId===a.id);return _.jsx(Lf,{element:a,customClass:"p-0 min-h-[60px] border-none",children:o.map(l=>{var c;return _.jsx(Pf,{col:(c=l.gridPosition)==null?void 0:c.col,customClass:"p-0",children:jo(l,r)},l.id)})},a.id)}return a.gridId?null:_.jsxs("div",{className:We("group relative grid gap-y-[6px]",a.elementClass),children:[jo(a,r),_.jsx("div",{className:"mt-1 text-xs text-red-600",children:(s=(i=r==null?void 0:r.errors)==null?void 0:i[a.id])==null?void 0:s.message})]},a.id)})]})})})}function W6({form_data:e,options:r,current:t}){var n;return _.jsx("div",{className:"grid gap-y-6",children:(n=e[t].questionData)==null?void 0:n.map(a=>{var i,s;if(a.type==="grid"){const o=e[t].questionData.filter(l=>l.gridId===a.id);return _.jsx(Lf,{element:a,customClass:"p-0 min-h-[60px] border-none",children:o.map(l=>{var c;return _.jsx(Pf,{col:(c=l.gridPosition)==null?void 0:c.col,customClass:"p-0",children:jo(l,r)},l.id)})},a.id)}return a.gridId?null:_.jsxs("div",{className:We("group relative grid gap-y-[6px]",a.elementClass),children:[jo(a,r),_.jsx("div",{className:"text-xs text-red-600 mt-1",children:(s=(i=r==null?void 0:r.errors)==null?void 0:i[a.id])==null?void 0:s.message})]},a.id)})})}const z6=({form_data:e,answerData:r,ignoreValidation:t,onSubmitData:n,isReadOnly:a,renderType:i="multi",children:s})=>{const[o,l]=k.useState(0),c=k.useMemo(()=>e.length,[e]),f=U6(e),u=xc({resolver:mc(f),mode:"onSubmit",defaultValues:{}}),{register:d,setValue:p,watch:h,handleSubmit:x,reset:m,getValues:v,formState:{errors:y,isSubmitting:g},trigger:F}=u,D=Yn("config"),S=w=>{const O=e.flatMap(N=>N.questionData.map(P=>({id:P.id,value:w[P.id],sectionId:N.id,type:P.type})));n==null||n(O)};k.useEffect(()=>{if(r!=null&&r.length){const w=V6(r);m(w)}},[r,m]);async function E(){var w;!t&&!await F((w=e==null?void 0:e[o].questionData)==null?void 0:w.map(N=>N.id))||l(O=>O+1)}function T(){l(w=>w-1)}return _.jsx(m0,{children:_.jsx(f2,{...u,children:_.jsxs("form",{onSubmit:x(S),className:"container h-full mx-auto",children:[_.jsx("div",{className:"relative flex flex-col w-full py-4 gap-y-12",children:_.jsxs("div",{children:[i==="multi"&&_.jsxs("div",{className:"mb-4",children:[(e==null?void 0:e[o].title)&&_.jsx("h2",{className:"text-lg font-semibold mb-[6px]",children:e[o].title}),(e==null?void 0:e[o].description)&&_.jsx("p",{className:"text-sm",children:e[o].description})]}),i==="multi"?_.jsx(W6,{form_data:e,options:{register:d,setValue:p,watch:h,errors:y,trigger:F,isSubmitting:g,isReadOnly:a,getValues:v},current:o}):_.jsx(H6,{form_data:e,options:{register:d,setValue:p,watch:h,errors:y,trigger:F,isSubmitting:g,isReadOnly:a,getValues:v}})]},e==null?void 0:e[o].id)}),_.jsxs("footer",{className:"flex items-center justify-end gap-4 pt-5 mt-8 border-t border-gray-100 footer",children:[i==="multi"&&_.jsxs(_.Fragment,{children:[o!==0&&_.jsx(Ln,{type:"button",text:"Back",onClick:T,btnClass:"text-gray-700 border-[#98A2B3] !font-medium !py-[10px] px-10 bg-gray-200 rounded-lg"}),o!==c-1?_.jsx(Ln,{type:"button",text:"Continue",onClick:E,style:{background:(D==null?void 0:D.buttonColor)||"#333"},btnClass:"text-gray-700 border-[#98A2B3] !font-medium !py-[10px] px-10 bg-blue-600 text-white rounded-lg continue_btn"}):!t&&(s||_.jsx(Ln,{isDisabled:g,isLoading:g,type:"submit",text:"Submit",style:{background:(D==null?void 0:D.buttonColor)||"#333"},btnClass:"text-gray-700 border-[#98A2B3] !font-medium !py-[10px] px-10 bg-blue-600 text-white rounded-lg submit_btn"}))]}),i==="single"&&!t&&(s||_.jsx(Ln,{isDisabled:g,isLoading:g,type:"submit",text:"Submit",style:{background:(D==null?void 0:D.buttonColor)||"#333"},btnClass:"text-gray-700 border-[#98A2B3] !font-medium !py-[10px] px-10 bg-blue-600 text-white rounded-lg submit_btn"}))]})]})})})};function t1({answerData:e,form_data:r,ignoreValidation:t,onSubmit:n,isReadOnly:a=!1,loading:i=!1,config:s={buttonColor:"#333"},renderType:o,children:l}){return k.useEffect(()=>{s&&uh("config",s)},[s]),i?_.jsx(e1,{}):r?_.jsx("div",{className:"w-full h-full",children:_.jsx(z6,{form_data:r,answerData:e,ignoreValidation:t,onSubmitData:n,isReadOnly:a,renderType:o,children:l})}):_.jsx("div",{children:_.jsx("p",{className:"p-6 text-gray-400 tex-sm",children:"Error: No form data available."})})}en.FormBuilder=R6,en.FormViewer=t1,Object.defineProperty(en,Symbol.toStringTag,{value:"Module"})});
|
|
123
|
+
Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}/*`}">.`)}let u=pa(),d;d=u;let p=d.pathname||"/",h=p;if(c!=="/"){let v=c.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(v.length).join("/")}let x=Mm(e,{pathname:h});return dn(f||x!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),dn(x==null||x[x.length-1].route.element!==void 0||x[x.length-1].route.Component!==void 0||x[x.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),q5(x&&x.map(v=>Object.assign({},v,{params:Object.assign({},o,v.params),pathname:hn([c,a.encodeLocation?a.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?c:hn([c,a.encodeLocation?a.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),i,t,n)}function H5(){let e=Z5(),r=L5(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),t=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:n},i={padding:"2px 4px",backgroundColor:n},s=null;return console.error("Error handled by React Router default ErrorBoundary:",e),s=ee.createElement(ee.Fragment,null,ee.createElement("p",null,"💿 Hey developer 👋"),ee.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",ee.createElement("code",{style:i},"ErrorBoundary")," or"," ",ee.createElement("code",{style:i},"errorElement")," prop on your route.")),ee.createElement(ee.Fragment,null,ee.createElement("h2",null,"Unexpected Application Error!"),ee.createElement("h3",{style:{fontStyle:"italic"}},r),t?ee.createElement("pre",{style:a},t):null,s)}var W5=ee.createElement(H5,null),z5=class extends ee.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,r){return r.location!==e.location||r.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:r.error,location:r.location,revalidation:e.revalidation||r.revalidation}}componentDidCatch(e,r){console.error("React Router caught the following error during render",e,r)}render(){return this.state.error!==void 0?ee.createElement(xn.Provider,{value:this.props.routeContext},ee.createElement(Uf.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function G5({routeContext:e,match:r,children:t}){let n=ee.useContext(Va);return n&&n.static&&n.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=r.route.id),ee.createElement(xn.Provider,{value:e},t)}function q5(e,r=[],t=null,n=null){if(e==null){if(!t)return null;if(t.errors)e=t.matches;else if(r.length===0&&!t.initialized&&t.matches.length>0)e=t.matches;else return null}let a=e,i=t==null?void 0:t.errors;if(i!=null){let l=a.findIndex(c=>c.route.id&&(i==null?void 0:i[c.route.id])!==void 0);Lt(l>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),a=a.slice(0,Math.min(a.length,l+1))}let s=!1,o=-1;if(t)for(let l=0;l<a.length;l++){let c=a[l];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(o=l),c.route.id){let{loaderData:f,errors:u}=t,d=c.route.loader&&!f.hasOwnProperty(c.route.id)&&(!u||u[c.route.id]===void 0);if(c.route.lazy||d){s=!0,o>=0?a=a.slice(0,o+1):a=[a[0]];break}}}return a.reduceRight((l,c,f)=>{let u,d=!1,p=null,h=null;t&&(u=i&&c.route.id?i[c.route.id]:void 0,p=c.route.errorElement||W5,s&&(o<0&&f===0?(Xm("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,h=null):o===f&&(d=!0,h=c.route.hydrateFallbackElement||null)));let x=r.concat(a.slice(0,f+1)),m=()=>{let v;return u?v=p:d?v=h:c.route.Component?v=ee.createElement(c.route.Component,null):c.route.element?v=c.route.element:v=l,ee.createElement(G5,{match:c,routeContext:{outlet:l,matches:x,isDataRoute:t!=null},children:v})};return t&&(c.route.ErrorBoundary||c.route.errorElement||f===0)?ee.createElement(z5,{location:t.location,revalidation:t.revalidation,component:p,error:u,children:m(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):m()},null)}function Vf(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function X5(e){let r=ee.useContext(Va);return Lt(r,Vf(e)),r}function K5(e){let r=ee.useContext(Io);return Lt(r,Vf(e)),r}function Y5(e){let r=ee.useContext(xn);return Lt(r,Vf(e)),r}function Hf(e){let r=Y5(e),t=r.matches[r.matches.length-1];return Lt(t.route.id,`${e} can only be used on routes that contain a unique "id"`),t.route.id}function J5(){return Hf("useRouteId")}function Z5(){var n;let e=ee.useContext(Uf),r=K5("useRouteError"),t=Hf("useRouteError");return e!==void 0?e:(n=r.errors)==null?void 0:n[t]}function Q5(){let{router:e}=X5("useNavigate"),r=Hf("useNavigate"),t=ee.useRef(!1);return Gm(()=>{t.current=!0}),ee.useCallback(async(a,i={})=>{dn(t.current,zm),t.current&&(typeof a=="number"?e.navigate(a):await e.navigate(a,{fromRouteId:r,...i}))},[e,r])}var qm={};function Xm(e,r,t){!r&&!qm[e]&&(qm[e]=!0,dn(!1,t))}ee.memo(e6);function e6({routes:e,future:r,state:t}){return V5(e,void 0,t,r)}var Lo="get",Ro="application/x-www-form-urlencoded";function Mo(e){return e!=null&&typeof e.tagName=="string"}function t6(e){return Mo(e)&&e.tagName.toLowerCase()==="button"}function r6(e){return Mo(e)&&e.tagName.toLowerCase()==="form"}function n6(e){return Mo(e)&&e.tagName.toLowerCase()==="input"}function a6(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function i6(e,r){return e.button===0&&(!r||r==="_self")&&!a6(e)}var Bo=null;function s6(){if(Bo===null)try{new FormData(document.createElement("form"),0),Bo=!1}catch{Bo=!0}return Bo}var o6=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Wf(e){return e!=null&&!o6.has(e)?(dn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ro}"`),null):e}function l6(e,r){let t,n,a,i,s;if(r6(e)){let o=e.getAttribute("action");n=o?ha(o,r):null,t=e.getAttribute("method")||Lo,a=Wf(e.getAttribute("enctype"))||Ro,i=new FormData(e)}else if(t6(e)||n6(e)&&(e.type==="submit"||e.type==="image")){let o=e.form;if(o==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||o.getAttribute("action");if(n=l?ha(l,r):null,t=e.getAttribute("formmethod")||o.getAttribute("method")||Lo,a=Wf(e.getAttribute("formenctype"))||Wf(o.getAttribute("enctype"))||Ro,i=new FormData(o,e),!s6()){let{name:c,type:f,value:u}=e;if(f==="image"){let d=c?`${c}.`:"";i.append(`${d}x`,"0"),i.append(`${d}y`,"0")}else c&&i.append(c,u)}}else{if(Mo(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');t=Lo,n=null,a=Ro,s=e}return i&&a==="text/plain"&&(s=i,i=void 0),{action:n,method:t.toLowerCase(),encType:a,formData:i,body:s}}function zf(e,r){if(e===!1||e===null||typeof e>"u")throw new Error(r)}async function c6(e,r){if(e.id in r)return r[e.id];try{let t=await import(e.module);return r[e.id]=t,t}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function f6(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function u6(e,r,t){let n=await Promise.all(e.map(async a=>{let i=r.routes[a.route.id];if(i){let s=await c6(i,t);return s.links?s.links():[]}return[]}));return x6(n.flat(1).filter(f6).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function Km(e,r,t,n,a,i){let s=(l,c)=>t[c]?l.route.id!==t[c].route.id:!0,o=(l,c)=>{var f;return t[c].pathname!==l.pathname||((f=t[c].route.path)==null?void 0:f.endsWith("*"))&&t[c].params["*"]!==l.params["*"]};return i==="assets"?r.filter((l,c)=>s(l,c)||o(l,c)):i==="data"?r.filter((l,c)=>{var u;let f=n.routes[l.route.id];if(!f||!f.hasLoader)return!1;if(s(l,c)||o(l,c))return!0;if(l.route.shouldRevalidate){let d=l.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((u=t[0])==null?void 0:u.params)||{},nextUrl:new URL(e,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof d=="boolean")return d}return!0}):[]}function d6(e,r){return h6(e.map(t=>{let n=r.routes[t.route.id];if(!n)return[];let a=[n.module];return n.imports&&(a=a.concat(n.imports)),a}).flat(1))}function h6(e){return[...new Set(e)]}function p6(e){let r={},t=Object.keys(e).sort();for(let n of t)r[n]=e[n];return r}function x6(e,r){let t=new Set;return new Set(r),e.reduce((n,a)=>{let i=JSON.stringify(p6(a));return t.has(i)||(t.add(i),n.push({key:i,link:a})),n},[])}function m6(e){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname="_root.data":r.pathname=`${r.pathname.replace(/\/$/,"")}.data`,r}function g6(){let e=ee.useContext(Va);return zf(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function v6(){let e=ee.useContext(Io);return zf(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Gf=ee.createContext(void 0);Gf.displayName="FrameworkContext";function Ym(){let e=ee.useContext(Gf);return zf(e,"You must render this element inside a <HydratedRouter> element"),e}function y6(e,r){let t=ee.useContext(Gf),[n,a]=ee.useState(!1),[i,s]=ee.useState(!1),{onFocus:o,onBlur:l,onMouseEnter:c,onMouseLeave:f,onTouchStart:u}=r,d=ee.useRef(null);ee.useEffect(()=>{if(e==="render"&&s(!0),e==="viewport"){let x=v=>{v.forEach(y=>{s(y.isIntersecting)})},m=new IntersectionObserver(x,{threshold:.5});return d.current&&m.observe(d.current),()=>{m.disconnect()}}},[e]),ee.useEffect(()=>{if(n){let x=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(x)}}},[n]);let p=()=>{a(!0)},h=()=>{a(!1),s(!1)};return t?e!=="intent"?[i,d,{}]:[i,d,{onFocus:Qi(o,p),onBlur:Qi(l,h),onMouseEnter:Qi(c,p),onMouseLeave:Qi(f,h),onTouchStart:Qi(u,p)}]:[!1,d,{}]}function Qi(e,r){return t=>{e&&e(t),t.defaultPrevented||r(t)}}function b6({page:e,...r}){let{router:t}=g6(),n=ee.useMemo(()=>Mm(t.routes,e,t.basename),[t.routes,e,t.basename]);return n?ee.createElement(_6,{page:e,matches:n,...r}):null}function w6(e){let{manifest:r,routeModules:t}=Ym(),[n,a]=ee.useState([]);return ee.useEffect(()=>{let i=!1;return u6(e,r,t).then(s=>{i||a(s)}),()=>{i=!0}},[e,r,t]),n}function _6({page:e,matches:r,...t}){let n=pa(),{manifest:a,routeModules:i}=Ym(),{loaderData:s,matches:o}=v6(),l=ee.useMemo(()=>Km(e,r,o,a,n,"data"),[e,r,o,a,n]),c=ee.useMemo(()=>Km(e,r,o,a,n,"assets"),[e,r,o,a,n]),f=ee.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let p=new Set,h=!1;if(r.forEach(m=>{var y;let v=a.routes[m.route.id];!v||!v.hasLoader||(!l.some(g=>g.route.id===m.route.id)&&m.route.id in s&&((y=i[m.route.id])!=null&&y.shouldRevalidate)||v.hasClientLoader?h=!0:p.add(m.route.id))}),p.size===0)return[];let x=m6(e);return h&&p.size>0&&x.searchParams.set("_routes",r.filter(m=>p.has(m.route.id)).map(m=>m.route.id).join(",")),[x.pathname+x.search]},[s,n,a,l,r,e,i]),u=ee.useMemo(()=>d6(c,a),[c,a]),d=w6(c);return ee.createElement(ee.Fragment,null,f.map(p=>ee.createElement("link",{key:p,rel:"prefetch",as:"fetch",href:p,...t})),u.map(p=>ee.createElement("link",{key:p,rel:"modulepreload",href:p,...t})),d.map(({key:p,link:h})=>ee.createElement("link",{key:p,...h})))}function E6(...e){return r=>{e.forEach(t=>{typeof t=="function"?t(r):t!=null&&(t.current=r)})}}var Jm=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Jm&&(window.__reactRouterVersion="7.1.1")}catch{}var Zm=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,qf=ee.forwardRef(function({onClick:r,discover:t="render",prefetch:n="none",relative:a,reloadDocument:i,replace:s,state:o,target:l,to:c,preventScrollReset:f,viewTransition:u,...d},p){let{basename:h}=ee.useContext(pn),x=typeof c=="string"&&Zm.test(c),m,v=!1;if(typeof c=="string"&&x&&(m=c,Jm))try{let w=new URL(window.location.href),O=c.startsWith("//")?new URL(w.protocol+c):new URL(c),N=ha(O.pathname,h);O.origin===w.origin&&N!=null?c=N+O.search+O.hash:v=!0}catch{dn(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let y=j5(c,{relative:a}),[g,F,D]=y6(n,d),S=F6(c,{replace:s,state:o,target:l,preventScrollReset:f,relative:a,viewTransition:u});function E(w){r&&r(w),w.defaultPrevented||S(w)}let T=ee.createElement("a",{...d,...D,href:m||y,onClick:v||i?r:E,ref:E6(p,F),target:l,"data-discover":!x&&t==="render"?"true":void 0});return g&&!x?ee.createElement(ee.Fragment,null,T,ee.createElement(b6,{page:y})):T});qf.displayName="Link";var T6=ee.forwardRef(function({"aria-current":r="page",caseSensitive:t=!1,className:n="",end:a=!1,style:i,to:s,viewTransition:o,children:l,...c},f){let u=Zi(s,{relative:c.relative}),d=pa(),p=ee.useContext(Io),{navigator:h,basename:x}=ee.useContext(pn),m=p!=null&&N6(u)&&o===!0,v=h.encodeLocation?h.encodeLocation(u).pathname:u.pathname,y=d.pathname,g=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(y=y.toLowerCase(),g=g?g.toLowerCase():null,v=v.toLowerCase()),g&&x&&(g=ha(g,x)||g);const F=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let D=y===v||!a&&y.startsWith(v)&&y.charAt(F)==="/",S=g!=null&&(g===v||!a&&g.startsWith(v)&&g.charAt(v.length)==="/"),E={isActive:D,isPending:S,isTransitioning:m},T=D?r:void 0,w;typeof n=="function"?w=n(E):w=[n,D?"active":null,S?"pending":null,m?"transitioning":null].filter(Boolean).join(" ");let O=typeof i=="function"?i(E):i;return ee.createElement(qf,{...c,"aria-current":T,className:w,ref:f,style:O,to:s,viewTransition:o},typeof l=="function"?l(E):l)});T6.displayName="NavLink";var k6=ee.forwardRef(({discover:e="render",fetcherKey:r,navigate:t,reloadDocument:n,replace:a,state:i,method:s=Lo,action:o,onSubmit:l,relative:c,preventScrollReset:f,viewTransition:u,...d},p)=>{let h=O6(),x=D6(o,{relative:c}),m=s.toLowerCase()==="get"?"get":"post",v=typeof o=="string"&&Zm.test(o),y=g=>{if(l&&l(g),g.defaultPrevented)return;g.preventDefault();let F=g.nativeEvent.submitter,D=(F==null?void 0:F.getAttribute("formmethod"))||s;h(F||g.currentTarget,{fetcherKey:r,method:D,navigate:t,replace:a,state:i,relative:c,preventScrollReset:f,viewTransition:u})};return ee.createElement("form",{ref:p,method:m,action:x,onSubmit:n?l:y,...d,"data-discover":!v&&e==="render"?"true":void 0})});k6.displayName="Form";function S6(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Qm(e){let r=ee.useContext(Va);return Lt(r,S6(e)),r}function F6(e,{target:r,replace:t,state:n,preventScrollReset:a,relative:i,viewTransition:s}={}){let o=$5(),l=pa(),c=Zi(e,{relative:i});return ee.useCallback(f=>{if(i6(f,r)){f.preventDefault();let u=t!==void 0?t:Mf(l)===Mf(c);o(e,{replace:u,state:n,preventScrollReset:a,relative:i,viewTransition:s})}},[l,o,c,t,n,r,e,a,i,s])}var C6=0,A6=()=>`__${String(++C6)}__`;function O6(){let{router:e}=Qm("useSubmit"),{basename:r}=ee.useContext(pn),t=J5();return ee.useCallback(async(n,a={})=>{let{action:i,method:s,encType:o,formData:l,body:c}=l6(n,r);if(a.navigate===!1){let f=a.fetcherKey||A6();await e.fetch(f,t,a.action||i,{preventScrollReset:a.preventScrollReset,formData:l,body:c,formMethod:a.method||s,formEncType:a.encType||o,flushSync:a.flushSync})}else await e.navigate(a.action||i,{preventScrollReset:a.preventScrollReset,formData:l,body:c,formMethod:a.method||s,formEncType:a.encType||o,replace:a.replace,state:a.state,fromRouteId:t,flushSync:a.flushSync,viewTransition:a.viewTransition})},[e,r,t])}function D6(e,{relative:r}={}){let{basename:t}=ee.useContext(pn),n=ee.useContext(xn);Lt(n,"useFormAction must be used inside a RouteContext");let[a]=n.matches.slice(-1),i={...Zi(e||".",{relative:r})},s=pa();if(e==null){i.search=s.search;let o=new URLSearchParams(i.search),l=o.getAll("index");if(l.some(f=>f==="")){o.delete("index"),l.filter(u=>u).forEach(u=>o.append("index",u));let f=o.toString();i.search=f?`?${f}`:""}}return(!e||e===".")&&a.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),t!=="/"&&(i.pathname=i.pathname==="/"?t:hn([t,i.pathname])),Mf(i)}function N6(e,r={}){let t=ee.useContext(Wm);Lt(t!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=Qm("useViewTransitionState"),a=Zi(e,{relative:r.relative});if(!t.isTransitioning)return!1;let i=ha(t.currentLocation.pathname,n)||t.currentLocation.pathname,s=ha(t.nextLocation.pathname,n)||t.nextLocation.pathname;return No(a.pathname,s)!=null||No(a.pathname,i)!=null}new TextEncoder;const Ln=({text:e="",isDisabled:r=!1,isLoading:t=!1,btnClass:n="bg-primary-500 text-white",icon:a="",iconPosition:i="left",iconClass:s="text-[20px]",loadingClass:o="",link:l="",div:c=!1,type:f="button",style:u,onClick:d})=>{const p=We("btn inline-flex justify-center",{"pointer-events-none":t,"opacity-40 cursor-not-allowed":r},n),h=()=>t?_.jsxs(_.Fragment,{children:[_.jsxs("svg",{className:`animate-spin -ml-1 mr-3 h-5 w-5 ${o}`,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[_.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),_.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Loading..."]}):_.jsxs("span",{className:"flex items-center",children:[a&&i==="left"&&_.jsx("span",{className:`mr-[6px] ${s}`,children:_.jsx(ct,{icon:a})}),e&&_.jsx("span",{children:e}),a&&i==="right"&&_.jsx("span",{className:`ml-[6px] ${s}`,children:_.jsx(ct,{icon:a})})]});return c?_.jsx("div",{className:p,children:h()}):l?_.jsx(qf,{to:l,className:p,children:h()}):_.jsx("button",{disabled:r,type:f,className:p,"data-testid":"btn",onClick:d,style:u,children:h()})},I6=({isOpen:e,onClose:r})=>{const{formData:t}=k.useContext(Fr);if(!e)return null;const n=Yn("config");return _.jsx("div",{className:"fixed inset-0 bg-black/30 flex items-center justify-center z-[999] cursor-default no-drag select-none",children:_.jsxs("div",{className:"max-w-[700px] bg-white rounded-xl shadow-xl relative flex flex-col items-center w-full py-6 px-6",children:[_.jsx("button",{type:"button",onClick:r,className:"absolute text-sm top-3 right-4",children:"Close"}),_.jsx("div",{className:"max-h-[90vh] overflow-y-auto h-full min-h-[600px] w-full ",children:_.jsx(t1,{form_data:t,ignoreValidation:!0,config:n})})]})})},tr=Yn("config");function P6({title:e,goBackUrl:r,onSubmit:t,onPublish:n}){const{addSection:a,formData:i}=k.useContext(Fr),[s,o]=k.useState(!1);function l(){localStorage.setItem("formData",JSON.stringify(i)),t==null||t(i)}function c(){localStorage.setItem("formData",JSON.stringify(i)),n==null||n(i)}return _.jsxs("div",{className:"px-[30px] py-3 flex justify-between items-center bg-[#F9F9FB] top_bar",children:[_.jsxs("span",{className:"flex items-center gap-x-[6px]",children:[" ",r&&_.jsx("button",{type:"button",onClick:()=>r(),style:{color:(tr==null?void 0:tr.buttonColor)||"#333"},children:_.jsx(ct,{icon:"bxs:chevron-left-square",iconClass:"text-2xl"})})," ",_.jsx("h1",{className:"text-base font-semibold form_title",children:e||""})]}),s&&_.jsx(I6,{isOpen:s,onClose:()=>o(!1),element:void 0}),_.jsxs("div",{className:"flex justify-end text-xs gap-x-3",children:[_.jsx(Ln,{onClick:()=>a(),text:"Add section",btnClass:" !px-2 !font-medium bg-transparent !text-sm form_section !normal-case",icon:"icon-park-outline:plus",iconClass:"text-base",style:{color:(tr==null?void 0:tr.buttonColor)||"#333"}}),_.jsx(Ln,{onClick:()=>o(!0),text:"Preview",btnClass:"!px-2 bg-transparent !font-medium !text-sm form_preview",icon:"solar:eye-bold-duotone",iconClass:"text-base",style:{color:(tr==null?void 0:tr.buttonColor)||"#333"}}),_.jsx(Ln,{onClick:()=>l(),text:"Save",btnClass:"!px-2 bg-transparent !font-medium !text-sm form_save__btn",icon:"lets-icons:save-duotone",iconClass:"text-base",style:{color:(tr==null?void 0:tr.buttonColor)||"#333"}}),_.jsx(Ln,{onClick:()=>c(),text:"Publish",style:{background:(tr==null?void 0:tr.buttonColor)||"#333"},btnClass:"border-[#98A2B3] !font-medium !text-sm !py-[8px] px-6 text-white rounded-lg form_publish__btn"})]})]})}const e1=({loadingClass:e})=>{const r=We("h-full w-full min-h-[300px] flex justify-center items-center",e);return k.useEffect(()=>{const t=Yn("config"),n=(t==null?void 0:t.loaderColor)||"#333";document.documentElement.style.setProperty("--loader-color",n)},[]),_.jsx("div",{className:r,children:_.jsx("span",{className:"loader"})})};function L6({onSubmit:e,questionData:r,title:t,goBackUrl:n,loading:a,onPublish:i}){return _.jsx(m0,{children:_.jsxs("div",{className:"w-full h-full bg-[#F5F5F5] flex flex-col",children:[_.jsx(j1,{}),_.jsx("div",{className:"border-b bg-white border-[#E4E7EC]",children:_.jsx(P6,{title:t,goBackUrl:n,onSubmit:e,onPublish:i})}),_.jsxs("div",{className:"flex flex-1 p-4 gap-x-4",children:[_.jsx("div",{children:_.jsx("div",{className:"w-[270px] border border-[#E4E7EC] bg-white max-h-[calc(100vh-100px)] overflow-y-auto side_shadow rounded-lg no-scrollbar",children:_.jsx(p5,{})})}),_.jsx("div",{className:"flex-1 h-full max-h-full z-[1] ",children:a?_.jsx(e1,{loadingClass:"!w-full !h-[800px]"}):_.jsx(d5,{questionData:r})})]})]})})}const R6=({onSubmit:e,questionData:r,isReadOnly:t,config:n={buttonColor:"#333"},title:a,loading:i,goBackUrl:s,onPublish:o})=>(k.useEffect(()=>{n&&uh("config",n)},[n]),_.jsx(L6,{onSubmit:e,onPublish:o,questionData:r,isReadOnly:t,title:a,goBackUrl:s,loading:i})),xa={required:"This field is required",email:"Invalid email format",minLength:e=>`Minimum length is ${e}`,maxLength:e=>`Maximum length is ${e}`,minAmount:e=>`Minimum amount is ${e}`,maxAmount:e=>`Maximum amount is ${e}`},M6=e=>({textField:Ze().nullable(),longText:Ze().nullable(),numberField:Ca().nullable().transform(t=>isNaN(t)?null:t),amountField:Ca().nullable().transform(t=>isNaN(t)?null:t),selectField:Ze().nullable(),checkbox:Fa().nullable(),radio:Fa().nullable(),email:Ze().nullable().email(xa.email),date:Ec().typeError("Invalid date").nullable()})[e]||Fa().nullable(),B6=(e,r,t)=>r?e.type==="boolean"?e.oneOf([!0],t||xa.required):e.required(t||xa.required):e,j6=(e,{minLength:r,maxLength:t,minLengthMessage:n,maxLengthMessage:a})=>{let i=e;return r&&(i=i.min(r,n||xa.minLength(r))),t&&(i=i.max(t,a||xa.maxLength(t))),i},$6=(e,{minAmount:r,maxAmount:t,minAmountMessage:n,maxAmountMessage:a})=>{let i=e;return r&&(i=i.min(parseFloat(String(r)),n||xa.minAmount(r))),t&&(i=i.max(parseFloat(String(t)),a||xa.maxAmount(t))),i};function U6(e){const r={};return e.forEach(({questionData:t})=>{t.forEach(n=>{const{id:a,type:i,isRequired:s,requiredMessage:o}=n;let l=M6(i);l=B6(l,s,o),i==="textField"||i==="longText"||i==="email"?l=j6(l,n):(i==="numberField"||i==="amountField")&&(l=$6(l,n)),r[a]=l})}),yi().shape(r)}function V6(e){return e.reduce((r,t)=>(r[t.id]=t.value,r),{})}const jo=(e,r)=>{const t=Im[e.type];return t?_.jsxs("div",{children:[e.inputLabel&&_.jsx("label",{className:"block text-sm font-medium mb-[5px]",children:e.inputLabel}),_.jsx(t,{element:e,state:"edit",validationData:r})]}):null};function H6({form_data:e,options:r}){return _.jsx("div",{className:"grid gap-y-10",children:e.flatMap(t=>{var n;return _.jsxs("div",{className:"pb-6 border-b border-gray-100 last:border-none",children:[_.jsxs("div",{className:"mb-4",children:[t.title&&_.jsx("h2",{className:"text-lg font-semibold mb-[4px]",children:t==null?void 0:t.title}),t.description&&_.jsx("p",{className:"text-sm",children:t==null?void 0:t.description})]}),(n=t.questionData)==null?void 0:n.map(a=>{var i,s;if(a.type==="grid"){const o=t.questionData.filter(l=>l.gridId===a.id);return _.jsx(Lf,{element:a,customClass:"p-0 min-h-[60px] border-none",children:o.map(l=>{var c;return _.jsx(Pf,{col:(c=l.gridPosition)==null?void 0:c.col,customClass:"p-0",children:jo(l,r)},l.id)})},a.id)}return a.gridId?null:_.jsxs("div",{className:We("group relative grid gap-y-[6px]",a.elementClass),children:[jo(a,r),_.jsx("div",{className:"mt-1 text-xs text-red-600",children:(s=(i=r==null?void 0:r.errors)==null?void 0:i[a.id])==null?void 0:s.message})]},a.id)})]})})})}function W6({form_data:e,options:r,current:t}){var n;return _.jsx("div",{className:"grid gap-y-6",children:(n=e[t].questionData)==null?void 0:n.map(a=>{var i,s;if(a.type==="grid"){const o=e[t].questionData.filter(l=>l.gridId===a.id);return _.jsx(Lf,{element:a,customClass:"p-0 min-h-[60px] border-none",children:o.map(l=>{var c;return _.jsx(Pf,{col:(c=l.gridPosition)==null?void 0:c.col,customClass:"p-0",children:jo(l,r)},l.id)})},a.id)}return a.gridId?null:_.jsxs("div",{className:We("group relative grid gap-y-[6px]",a.elementClass),children:[jo(a,r),_.jsx("div",{className:"text-xs text-red-600 mt-1",children:(s=(i=r==null?void 0:r.errors)==null?void 0:i[a.id])==null?void 0:s.message})]},a.id)})})}const z6=({form_data:e,answerData:r,ignoreValidation:t,onSubmitData:n,isReadOnly:a,renderType:i="multi",children:s,hideFooter:o})=>{const[l,c]=k.useState(0),f=k.useMemo(()=>e.length,[e]),u=U6(e),d=xc({resolver:mc(u),mode:"onSubmit",defaultValues:{}}),{register:p,setValue:h,watch:x,handleSubmit:m,reset:v,getValues:y,formState:{errors:g,isSubmitting:F},trigger:D}=d,S=Yn("config"),E=O=>{const N=e.flatMap(P=>P.questionData.map(z=>({id:z.id,value:O[z.id],sectionId:P.id,type:z.type})));n==null||n(N)};k.useEffect(()=>{if(r!=null&&r.length){const O=V6(r);v(O)}},[r,v]);async function T(){var O;!t&&!await D((O=e==null?void 0:e[l].questionData)==null?void 0:O.map(P=>P.id))||c(N=>N+1)}function w(){c(O=>O-1)}return _.jsx(m0,{children:_.jsx(f2,{...d,children:_.jsxs("form",{onSubmit:m(E),className:"container h-full mx-auto",children:[_.jsx("div",{className:"relative flex flex-col w-full py-4 gap-y-12",children:_.jsxs("div",{children:[i==="multi"&&_.jsxs("div",{className:"mb-4",children:[(e==null?void 0:e[l].title)&&_.jsx("h2",{className:"text-lg font-semibold mb-[6px]",children:e[l].title}),(e==null?void 0:e[l].description)&&_.jsx("p",{className:"text-sm",children:e[l].description})]}),i==="multi"?_.jsx(W6,{form_data:e,options:{register:p,setValue:h,watch:x,errors:g,trigger:D,isSubmitting:F,isReadOnly:a,getValues:y},current:l}):_.jsx(H6,{form_data:e,options:{register:p,setValue:h,watch:x,errors:g,trigger:D,isSubmitting:F,isReadOnly:a,getValues:y}})]},e==null?void 0:e[l].id)}),!o&&_.jsxs("footer",{className:"flex items-center justify-end gap-4 pt-5 mt-8 border-t border-gray-100 footer",children:[i==="multi"&&_.jsxs(_.Fragment,{children:[l!==0&&_.jsx(Ln,{type:"button",text:"Back",onClick:w,btnClass:"text-gray-700 border-[#98A2B3] !font-medium !py-[10px] px-10 bg-gray-200 rounded-lg"}),l!==f-1?_.jsx(Ln,{type:"button",text:"Continue",onClick:T,style:{background:(S==null?void 0:S.buttonColor)||"#333"},btnClass:"text-gray-700 border-[#98A2B3] !font-medium !py-[10px] px-10 bg-blue-600 text-white rounded-lg continue_btn"}):!t&&(s||_.jsx(Ln,{isDisabled:F,isLoading:F,type:"submit",text:"Submit",style:{background:(S==null?void 0:S.buttonColor)||"#333"},btnClass:"text-gray-700 border-[#98A2B3] !font-medium !py-[10px] px-10 bg-blue-600 text-white rounded-lg submit_btn"}))]}),i==="single"&&!t&&(s||_.jsx(Ln,{isDisabled:F,isLoading:F,type:"submit",text:"Submit",style:{background:(S==null?void 0:S.buttonColor)||"#333"},btnClass:"text-gray-700 border-[#98A2B3] !font-medium !py-[10px] px-10 bg-blue-600 text-white rounded-lg submit_btn"}))]})]})})})};function t1({answerData:e,form_data:r,ignoreValidation:t,onSubmit:n,isReadOnly:a=!1,loading:i=!1,config:s={buttonColor:"#333"},renderType:o,children:l,hideFooter:c}){return k.useEffect(()=>{s&&uh("config",s)},[s]),i?_.jsx(e1,{}):r?_.jsx("div",{className:"w-full h-full",children:_.jsx(z6,{form_data:r,answerData:e,ignoreValidation:t,onSubmitData:n,isReadOnly:a,renderType:o,children:l,hideFooter:c})}):_.jsx("div",{children:_.jsx("p",{className:"p-6 text-gray-400 tex-sm",children:"Error: No form data available."})})}en.FormBuilder=R6,en.FormViewer=t1,Object.defineProperty(en,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -13,6 +13,7 @@ export interface FormRendererProps {
|
|
|
13
13
|
isReadOnly?: boolean;
|
|
14
14
|
renderType?: RenderType;
|
|
15
15
|
children?: ReactNode;
|
|
16
|
+
hideFooter?: boolean;
|
|
16
17
|
}
|
|
17
|
-
declare const FormRenderer: ({ form_data, answerData, ignoreValidation, onSubmitData, isReadOnly, renderType, children, }: any) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
declare const FormRenderer: ({ form_data, answerData, ignoreValidation, onSubmitData, isReadOnly, renderType, children, hideFooter, }: any) => import("react/jsx-runtime").JSX.Element;
|
|
18
19
|
export default FormRenderer;
|
|
@@ -9,5 +9,6 @@ export interface RenderProps {
|
|
|
9
9
|
config?: any;
|
|
10
10
|
renderType?: "multi" | "single";
|
|
11
11
|
children?: ReactNode;
|
|
12
|
+
hideFooter?: boolean;
|
|
12
13
|
}
|
|
13
|
-
export default function Viewer({ answerData, form_data, ignoreValidation, onSubmit, isReadOnly, loading, config, renderType, children, }: RenderProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export default function Viewer({ answerData, form_data, ignoreValidation, onSubmit, isReadOnly, loading, config, renderType, children, hideFooter }: RenderProps): import("react/jsx-runtime").JSX.Element;
|