@notmrabhi/flowforge 0.1.7 → 0.1.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/{SchemaBuilderDrawer-BAOGl8dt.js → SchemaBuilderDrawer-8NVbccYd.js} +1 -1
- package/dist/{SchemaBuilderDrawer-CP-Lqo0S.js → SchemaBuilderDrawer-CrnQm9HM.js} +1 -1
- package/dist/canvas.cjs +1 -1
- package/dist/canvas.js +1 -1
- package/dist/form.cjs +1 -1
- package/dist/form.js +2 -2
- package/dist/{index-ucLEoH8L.js → index-BSP3H9Cn.js} +3 -3
- package/dist/{index-CiAhn6cP.js → index-BxjUA9XG.js} +1 -1
- package/dist/{index-D6g2IXSf.js → index-DO5qci03.js} +34 -17
- package/dist/{index-9Ahm5dnn.js → index-hwowTIsv.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -3
- package/dist/{templateSkeletons-BIQDennR.js → templateSkeletons-BT6obP5g.js} +345 -332
- package/dist/templateSkeletons-Vr97QWjf.js +1 -0
- package/package.json +1 -1
- package/dist/templateSkeletons-DQGmO1Yu.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState as E, useRef as G, useEffect as me, useCallback as be, useMemo as ue } from "react";
|
|
2
2
|
import { useFormik as Pt } from "formik";
|
|
3
|
-
import { A as Lt, F as ze, n as Vt, j as qt, l as Wt, B as ot, f as De, a as We, t as Ke, T as Ut, c as Bt, V as Zt } from "./index-
|
|
3
|
+
import { A as Lt, F as ze, n as Vt, j as qt, l as Wt, B as ot, f as De, a as We, t as Ke, T as Ut, c as Bt, V as Zt } from "./index-DO5qci03.js";
|
|
4
4
|
import { jsxs as f, jsx as l, Fragment as Te } from "react/jsx-runtime";
|
|
5
5
|
import { Box as d, Collapse as Ht, Tooltip as te, Dialog as ct, Typography as A, IconButton as Fe, Stepper as Yt, Step as Gt, StepLabel as Jt, Drawer as Kt, Chip as Xt, Divider as Qt } from "@mui/material";
|
|
6
6
|
import { MdSearch as ut, MdClose as re, MdCheck as Ee, MdAdd as _e, MdArrowBack as dt, MdEdit as er, MdDeleteOutline as tr, MdSettings as ft, MdArrowForward as rr } from "react-icons/md";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const b=require("react"),wt=require("formik"),B=require("./index-ucLEoH8L.js"),n=require("react/jsx-runtime"),o=require("@mui/material"),E=require("react-icons/md"),kt=require("react-icons/fa6"),Tt=require("./_commonjsHelpers-DKOUU3wS.js");function oe(r){this._maxSize=r,this.clear()}oe.prototype.clear=function(){this._size=0,this._values=Object.create(null)};oe.prototype.get=function(r){return this._values[r]};oe.prototype.set=function(r,e){return this._size>=this._maxSize&&this.clear(),r in this._values||this._size++,this._values[r]=e};var Ct=/[^.^\]^[]+|(?=\[\]|\.\.)/g,Ye=/^\d+$/,Ft=/^\d/,Ot=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,Et=/^\s*(['"]?)(.*?)(\1)\s*$/,Ne=512,De=new oe(Ne);new oe(Ne);var Me=new oe(Ne),re={split:Fe,normalizePath:Pe,getter:function(r,e){var t=Pe(r);return Me.get(r)||Me.set(r,function(i){for(var l=0,a=t.length;l<a;)if(i!=null||!e)i=i[t[l++]];else return;return i})},join:function(r){return r.reduce(function(e,t){return e+(Ae(t)||Ye.test(t)?"["+t+"]":(e?".":"")+t)},"")},forEach:function(r,e,t){$t(Array.isArray(r)?r:Fe(r),e,t)}};function Pe(r){return De.get(r)||De.set(r,Fe(r).map(function(e){return e.replace(Et,"$2")}))}function Fe(r){return r.match(Ct)||[""]}function $t(r,e,t){var s=r.length,i,l,a,c;for(l=0;l<s;l++)i=r[l],i&&(Nt(i)&&(i='"'+i+'"'),c=Ae(i),a=!c&&/^\d+$/.test(i),e.call(t,i,c,a,l,r))}function Ae(r){return typeof r=="string"&&r&&["'",'"'].indexOf(r.charAt(0))!==-1}function _t(r){return r.match(Ft)&&!r.match(Ye)}function Bt(r){return Ot.test(r)}function Nt(r){return!Ae(r)&&(_t(r)||Bt(r))}const At=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,Ge=r=>r.match(At)||[],Rt=(r,e)=>Ge(r).join(e).toLowerCase(),zt=r=>Ge(r).reduce((e,t)=>`${e}${e?t[0].toUpperCase()+t.slice(1).toLowerCase():t.toLowerCase()}`,""),It=r=>Rt(r,"_");var Te={camelCase:zt,snakeCase:It},Re={exports:{}};Re.exports=function(r){return Je(Dt(r),r)};Re.exports.array=Je;function Je(r,e){var t=r.length,s=new Array(t),i={},l=t,a=Mt(e),c=Pt(r);for(e.forEach(function(f){if(!c.has(f[0])||!c.has(f[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});l--;)i[l]||u(r[l],l,new Set);return s;function u(f,h,x){if(x.has(f)){var p;try{p=", node was:"+JSON.stringify(f)}catch{p=""}throw new Error("Cyclic dependency"+p)}if(!c.has(f))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(f));if(!i[h]){i[h]=!0;var d=a.get(f)||new Set;if(d=Array.from(d),h=d.length){x.add(f);do{var g=d[--h];u(g,c.get(g),x)}while(h);x.delete(f)}s[--t]=f}}}function Dt(r){for(var e=new Set,t=0,s=r.length;t<s;t++){var i=r[t];e.add(i[0]),e.add(i[1])}return Array.from(e)}function Mt(r){for(var e=new Map,t=0,s=r.length;t<s;t++){var i=r[t];e.has(i[0])||e.set(i[0],new Set),e.has(i[1])||e.set(i[1],new Set),e.get(i[0]).add(i[1])}return e}function Pt(r){for(var e=new Map,t=0,s=r.length;t<s;t++)e.set(r[t],t);return e}var Lt=Re.exports;const qt=Tt.getDefaultExportFromCjs(Lt),Vt=Object.prototype.toString,Wt=Error.prototype.toString,Ut=RegExp.prototype.toString,Zt=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Ht=/^Symbol\((.*)\)(.*)$/;function Yt(r){return r!=+r?"NaN":r===0&&1/r<0?"-0":""+r}function Le(r,e=!1){if(r==null||r===!0||r===!1)return""+r;const t=typeof r;if(t==="number")return Yt(r);if(t==="string")return e?`"${r}"`:r;if(t==="function")return"[Function "+(r.name||"anonymous")+"]";if(t==="symbol")return Zt.call(r).replace(Ht,"Symbol($1)");const s=Vt.call(r).slice(8,-1);return s==="Date"?isNaN(r.getTime())?""+r:r.toISOString(r):s==="Error"||r instanceof Error?"["+Wt.call(r)+"]":s==="RegExp"?Ut.call(r):null}function J(r,e){let t=Le(r,e);return t!==null?t:JSON.stringify(r,function(s,i){let l=Le(this[s],e);return l!==null?l:i},2)}function Ke(r){return r==null?[]:[].concat(r)}let Xe,Qe,et,Gt=/\$\{\s*(\w+)\s*\}/g;Xe=Symbol.toStringTag;class qe{constructor(e,t,s,i){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[Xe]="Error",this.name="ValidationError",this.value=t,this.path=s,this.type=i,this.errors=[],this.inner=[],Ke(e).forEach(l=>{if(I.isError(l)){this.errors.push(...l.errors);const a=l.inner.length?l.inner:[l];this.inner.push(...a)}else this.errors.push(l)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}Qe=Symbol.hasInstance;et=Symbol.toStringTag;class I extends Error{static formatError(e,t){const s=t.label||t.path||"this";return t=Object.assign({},t,{path:s,originalPath:t.path}),typeof e=="string"?e.replace(Gt,(i,l)=>J(t[l])):typeof e=="function"?e(t):e}static isError(e){return e&&e.name==="ValidationError"}constructor(e,t,s,i,l){const a=new qe(e,t,s,i);if(l)return a;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[et]="Error",this.name=a.name,this.message=a.message,this.type=a.type,this.value=a.value,this.path=a.path,this.errors=a.errors,this.inner=a.inner,Error.captureStackTrace&&Error.captureStackTrace(this,I)}static[Qe](e){return qe[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let Y={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:r,type:e,value:t,originalValue:s})=>{const i=s!=null&&s!==t?` (cast from the value \`${J(s,!0)}\`).`:".";return e!=="mixed"?`${r} must be a \`${e}\` type, but the final value was: \`${J(t,!0)}\``+i:`${r} must match the configured type. The validated value was: \`${J(t,!0)}\``+i}},M={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},Q={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Oe={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Ee={isValue:"${path} field must be ${value}"},he={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},xe={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},Jt={notType:r=>{const{path:e,value:t,spec:s}=r,i=s.types.length;if(Array.isArray(t)){if(t.length<i)return`${e} tuple value has too few items, expected a length of ${i} but got ${t.length} for value: \`${J(t,!0)}\``;if(t.length>i)return`${e} tuple value has too many items, expected a length of ${i} but got ${t.length} for value: \`${J(t,!0)}\``}return I.formatError(Y.notType,r)}};Object.assign(Object.create(null),{mixed:Y,string:M,number:Q,date:Oe,object:he,array:xe,boolean:Ee,tuple:Jt});const je=r=>r&&r.__isYupSchema__;class ye{static fromOptions(e,t){if(!t.then&&!t.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:s,then:i,otherwise:l}=t,a=typeof s=="function"?s:(...c)=>c.every(u=>u===s);return new ye(e,(c,u)=>{var f;let h=a(...c)?i:l;return(f=h==null?void 0:h(u))!=null?f:u})}constructor(e,t){this.fn=void 0,this.refs=e,this.refs=e,this.fn=t}resolve(e,t){let s=this.refs.map(l=>l.getValue(t==null?void 0:t.value,t==null?void 0:t.parent,t==null?void 0:t.context)),i=this.fn(s,e,t);if(i===void 0||i===e)return e;if(!je(i))throw new TypeError("conditions must return a schema object");return i.resolve(t)}}const fe={context:"$",value:"."};class se{constructor(e,t={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof e!="string")throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),e==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===fe.context,this.isValue=this.key[0]===fe.value,this.isSibling=!this.isContext&&!this.isValue;let s=this.isContext?fe.context:this.isValue?fe.value:"";this.path=this.key.slice(s.length),this.getter=this.path&&re.getter(this.path,!0),this.map=t.map}getValue(e,t,s){let i=this.isContext?s:this.isValue?e:t;return this.getter&&(i=this.getter(i||{})),this.map&&(i=this.map(i)),i}cast(e,t){return this.getValue(e,t==null?void 0:t.parent,t==null?void 0:t.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}se.prototype.__isYupRef=!0;const Z=r=>r==null;function ie(r){function e({value:t,path:s="",options:i,originalValue:l,schema:a},c,u){const{name:f,test:h,params:x,message:p,skipAbsent:d}=r;let{parent:g,context:m,abortEarly:v=a.spec.abortEarly,disableStackTrace:j=a.spec.disableStackTrace}=i;const C={value:t,parent:g,context:m};function _(O={}){const S=tt(Object.assign({value:t,originalValue:l,label:a.spec.label,path:O.path||s,spec:a.spec,disableStackTrace:O.disableStackTrace||j},x,O.params),C),X=new I(I.formatError(O.message||p,S),t,S.path,O.type||f,S.disableStackTrace);return X.params=S,X}const F=v?c:u;let z={path:s,parent:g,type:f,from:i.from,createError:_,resolve(O){return rt(O,C)},options:i,originalValue:l,schema:a};const q=O=>{I.isError(O)?F(O):O?u(null):F(_())},K=O=>{I.isError(O)?F(O):c(O)};if(d&&Z(t))return q(!0);let D;try{var V;if(D=h.call(z,t,z),typeof((V=D)==null?void 0:V.then)=="function"){if(i.sync)throw new Error(`Validation test of type: "${z.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(D).then(q,K)}}catch(O){K(O);return}q(D)}return e.OPTIONS=r,e}function tt(r,e){if(!r)return r;for(const t of Object.keys(r))r[t]=rt(r[t],e);return r}function rt(r,e){return se.isRef(r)?r.getValue(e.value,e.parent,e.context):r}function Kt(r,e,t,s=t){let i,l,a;return e?(re.forEach(e,(c,u,f)=>{let h=u?c.slice(1,c.length-1):c;r=r.resolve({context:s,parent:i,value:t});let x=r.type==="tuple",p=f?parseInt(h,10):0;if(r.innerType||x){if(x&&!f)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${a}" must contain an index to the tuple element, e.g. "${a}[0]"`);if(t&&p>=t.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${c}, in the path: ${e}. because there is no value at that index. `);i=t,t=t&&t[p],r=x?r.spec.types[p]:r.innerType}if(!f){if(!r.fields||!r.fields[h])throw new Error(`The schema does not contain the path: ${e}. (failed at: ${a} which is a type: "${r.type}")`);i=t,t=t&&t[h],r=r.fields[h]}l=h,a=u?"["+c+"]":"."+c}),{schema:r,parent:i,parentPath:l}):{parent:i,parentPath:e,schema:r}}class ve extends Set{describe(){const e=[];for(const t of this.values())e.push(se.isRef(t)?t.describe():t);return e}resolveAll(e){let t=[];for(const s of this.values())t.push(e(s));return t}clone(){return new ve(this.values())}merge(e,t){const s=this.clone();return e.forEach(i=>s.add(i)),t.forEach(i=>s.delete(i)),s}}function ae(r,e=new Map){if(je(r)||!r||typeof r!="object")return r;if(e.has(r))return e.get(r);let t;if(r instanceof Date)t=new Date(r.getTime()),e.set(r,t);else if(r instanceof RegExp)t=new RegExp(r),e.set(r,t);else if(Array.isArray(r)){t=new Array(r.length),e.set(r,t);for(let s=0;s<r.length;s++)t[s]=ae(r[s],e)}else if(r instanceof Map){t=new Map,e.set(r,t);for(const[s,i]of r.entries())t.set(s,ae(i,e))}else if(r instanceof Set){t=new Set,e.set(r,t);for(const s of r)t.add(ae(s,e))}else if(r instanceof Object){t={},e.set(r,t);for(const[s,i]of Object.entries(r))t[s]=ae(i,e)}else throw Error(`Unable to clone ${r}`);return t}function Xt(r){if(!(r!=null&&r.length))return;const e=[];let t="",s=!1,i=!1;for(let l=0;l<r.length;l++){const a=r[l];if(a==="["&&!i){t&&(e.push(...t.split(".").filter(Boolean)),t=""),s=!0;continue}if(a==="]"&&!i){t&&(/^\d+$/.test(t)?e.push(t):e.push(t.replace(/^"|"$/g,"")),t=""),s=!1;continue}if(a==='"'){i=!i;continue}if(a==="."&&!s&&!i){t&&(e.push(t),t="");continue}t+=a}return t&&e.push(...t.split(".").filter(Boolean)),e}function Qt(r,e){const t=e?`${e}.${r.path}`:r.path;return r.errors.map(s=>({message:s,path:Xt(t)}))}function st(r,e){var t;if(!((t=r.inner)!=null&&t.length)&&r.errors.length)return Qt(r,e);const s=e?`${e}.${r.path}`:r.path;return r.inner.flatMap(i=>st(i,s))}class L{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new ve,this._blacklist=new ve,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Y.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},e==null?void 0:e.spec),this.withMutation(t=>{t.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeCheck=this._typeCheck,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.internalTests=Object.assign({},this.internalTests),t.exclusiveTests=Object.assign({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=ae(Object.assign({},this.spec,e)),t}label(e){let t=this.clone();return t.spec.label=e,t}meta(...e){if(e.length===0)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let s=e(this);return this._mutate=t,s}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,s=e.clone();const i=Object.assign({},t.spec,s.spec);return s.spec=i,s.internalTests=Object.assign({},t.internalTests,s.internalTests),s._whitelist=t._whitelist.merge(e._whitelist,e._blacklist),s._blacklist=t._blacklist.merge(e._blacklist,e._whitelist),s.tests=t.tests,s.exclusiveTests=t.exclusiveTests,s.withMutation(l=>{e.tests.forEach(a=>{l.test(a.OPTIONS)})}),s.transforms=[...t.transforms,...s.transforms],s}isType(e){return e==null?!!(this.spec.nullable&&e===null||this.spec.optional&&e===void 0):this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let s=t.conditions;t=t.clone(),t.conditions=[],t=s.reduce((i,l)=>l.resolve(i,e),t),t=t.resolve(e)}return t}resolveOptions(e){var t,s,i,l;return Object.assign({},e,{from:e.from||[],strict:(t=e.strict)!=null?t:this.spec.strict,abortEarly:(s=e.abortEarly)!=null?s:this.spec.abortEarly,recursive:(i=e.recursive)!=null?i:this.spec.recursive,disableStackTrace:(l=e.disableStackTrace)!=null?l:this.spec.disableStackTrace})}cast(e,t={}){let s=this.resolve(Object.assign({},t,{value:e})),i=t.assert==="ignore-optionality",l=s._cast(e,t);if(t.assert!==!1&&!s.isType(l)){if(i&&Z(l))return l;let a=J(e),c=J(l);throw new TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${s.type}".
|
|
1
|
+
"use strict";const b=require("react"),wt=require("formik"),B=require("./index-BSP3H9Cn.js"),n=require("react/jsx-runtime"),o=require("@mui/material"),E=require("react-icons/md"),kt=require("react-icons/fa6"),Tt=require("./_commonjsHelpers-DKOUU3wS.js");function oe(r){this._maxSize=r,this.clear()}oe.prototype.clear=function(){this._size=0,this._values=Object.create(null)};oe.prototype.get=function(r){return this._values[r]};oe.prototype.set=function(r,e){return this._size>=this._maxSize&&this.clear(),r in this._values||this._size++,this._values[r]=e};var Ct=/[^.^\]^[]+|(?=\[\]|\.\.)/g,Ye=/^\d+$/,Ft=/^\d/,Ot=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,Et=/^\s*(['"]?)(.*?)(\1)\s*$/,Ne=512,De=new oe(Ne);new oe(Ne);var Me=new oe(Ne),re={split:Fe,normalizePath:Pe,getter:function(r,e){var t=Pe(r);return Me.get(r)||Me.set(r,function(i){for(var l=0,a=t.length;l<a;)if(i!=null||!e)i=i[t[l++]];else return;return i})},join:function(r){return r.reduce(function(e,t){return e+(Ae(t)||Ye.test(t)?"["+t+"]":(e?".":"")+t)},"")},forEach:function(r,e,t){$t(Array.isArray(r)?r:Fe(r),e,t)}};function Pe(r){return De.get(r)||De.set(r,Fe(r).map(function(e){return e.replace(Et,"$2")}))}function Fe(r){return r.match(Ct)||[""]}function $t(r,e,t){var s=r.length,i,l,a,c;for(l=0;l<s;l++)i=r[l],i&&(Nt(i)&&(i='"'+i+'"'),c=Ae(i),a=!c&&/^\d+$/.test(i),e.call(t,i,c,a,l,r))}function Ae(r){return typeof r=="string"&&r&&["'",'"'].indexOf(r.charAt(0))!==-1}function _t(r){return r.match(Ft)&&!r.match(Ye)}function Bt(r){return Ot.test(r)}function Nt(r){return!Ae(r)&&(_t(r)||Bt(r))}const At=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,Ge=r=>r.match(At)||[],Rt=(r,e)=>Ge(r).join(e).toLowerCase(),zt=r=>Ge(r).reduce((e,t)=>`${e}${e?t[0].toUpperCase()+t.slice(1).toLowerCase():t.toLowerCase()}`,""),It=r=>Rt(r,"_");var Te={camelCase:zt,snakeCase:It},Re={exports:{}};Re.exports=function(r){return Je(Dt(r),r)};Re.exports.array=Je;function Je(r,e){var t=r.length,s=new Array(t),i={},l=t,a=Mt(e),c=Pt(r);for(e.forEach(function(f){if(!c.has(f[0])||!c.has(f[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});l--;)i[l]||u(r[l],l,new Set);return s;function u(f,h,x){if(x.has(f)){var p;try{p=", node was:"+JSON.stringify(f)}catch{p=""}throw new Error("Cyclic dependency"+p)}if(!c.has(f))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(f));if(!i[h]){i[h]=!0;var d=a.get(f)||new Set;if(d=Array.from(d),h=d.length){x.add(f);do{var g=d[--h];u(g,c.get(g),x)}while(h);x.delete(f)}s[--t]=f}}}function Dt(r){for(var e=new Set,t=0,s=r.length;t<s;t++){var i=r[t];e.add(i[0]),e.add(i[1])}return Array.from(e)}function Mt(r){for(var e=new Map,t=0,s=r.length;t<s;t++){var i=r[t];e.has(i[0])||e.set(i[0],new Set),e.has(i[1])||e.set(i[1],new Set),e.get(i[0]).add(i[1])}return e}function Pt(r){for(var e=new Map,t=0,s=r.length;t<s;t++)e.set(r[t],t);return e}var Lt=Re.exports;const qt=Tt.getDefaultExportFromCjs(Lt),Vt=Object.prototype.toString,Wt=Error.prototype.toString,Ut=RegExp.prototype.toString,Zt=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Ht=/^Symbol\((.*)\)(.*)$/;function Yt(r){return r!=+r?"NaN":r===0&&1/r<0?"-0":""+r}function Le(r,e=!1){if(r==null||r===!0||r===!1)return""+r;const t=typeof r;if(t==="number")return Yt(r);if(t==="string")return e?`"${r}"`:r;if(t==="function")return"[Function "+(r.name||"anonymous")+"]";if(t==="symbol")return Zt.call(r).replace(Ht,"Symbol($1)");const s=Vt.call(r).slice(8,-1);return s==="Date"?isNaN(r.getTime())?""+r:r.toISOString(r):s==="Error"||r instanceof Error?"["+Wt.call(r)+"]":s==="RegExp"?Ut.call(r):null}function J(r,e){let t=Le(r,e);return t!==null?t:JSON.stringify(r,function(s,i){let l=Le(this[s],e);return l!==null?l:i},2)}function Ke(r){return r==null?[]:[].concat(r)}let Xe,Qe,et,Gt=/\$\{\s*(\w+)\s*\}/g;Xe=Symbol.toStringTag;class qe{constructor(e,t,s,i){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[Xe]="Error",this.name="ValidationError",this.value=t,this.path=s,this.type=i,this.errors=[],this.inner=[],Ke(e).forEach(l=>{if(I.isError(l)){this.errors.push(...l.errors);const a=l.inner.length?l.inner:[l];this.inner.push(...a)}else this.errors.push(l)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}Qe=Symbol.hasInstance;et=Symbol.toStringTag;class I extends Error{static formatError(e,t){const s=t.label||t.path||"this";return t=Object.assign({},t,{path:s,originalPath:t.path}),typeof e=="string"?e.replace(Gt,(i,l)=>J(t[l])):typeof e=="function"?e(t):e}static isError(e){return e&&e.name==="ValidationError"}constructor(e,t,s,i,l){const a=new qe(e,t,s,i);if(l)return a;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[et]="Error",this.name=a.name,this.message=a.message,this.type=a.type,this.value=a.value,this.path=a.path,this.errors=a.errors,this.inner=a.inner,Error.captureStackTrace&&Error.captureStackTrace(this,I)}static[Qe](e){return qe[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let Y={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:r,type:e,value:t,originalValue:s})=>{const i=s!=null&&s!==t?` (cast from the value \`${J(s,!0)}\`).`:".";return e!=="mixed"?`${r} must be a \`${e}\` type, but the final value was: \`${J(t,!0)}\``+i:`${r} must match the configured type. The validated value was: \`${J(t,!0)}\``+i}},M={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},Q={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Oe={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Ee={isValue:"${path} field must be ${value}"},he={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},xe={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},Jt={notType:r=>{const{path:e,value:t,spec:s}=r,i=s.types.length;if(Array.isArray(t)){if(t.length<i)return`${e} tuple value has too few items, expected a length of ${i} but got ${t.length} for value: \`${J(t,!0)}\``;if(t.length>i)return`${e} tuple value has too many items, expected a length of ${i} but got ${t.length} for value: \`${J(t,!0)}\``}return I.formatError(Y.notType,r)}};Object.assign(Object.create(null),{mixed:Y,string:M,number:Q,date:Oe,object:he,array:xe,boolean:Ee,tuple:Jt});const je=r=>r&&r.__isYupSchema__;class ye{static fromOptions(e,t){if(!t.then&&!t.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:s,then:i,otherwise:l}=t,a=typeof s=="function"?s:(...c)=>c.every(u=>u===s);return new ye(e,(c,u)=>{var f;let h=a(...c)?i:l;return(f=h==null?void 0:h(u))!=null?f:u})}constructor(e,t){this.fn=void 0,this.refs=e,this.refs=e,this.fn=t}resolve(e,t){let s=this.refs.map(l=>l.getValue(t==null?void 0:t.value,t==null?void 0:t.parent,t==null?void 0:t.context)),i=this.fn(s,e,t);if(i===void 0||i===e)return e;if(!je(i))throw new TypeError("conditions must return a schema object");return i.resolve(t)}}const fe={context:"$",value:"."};class se{constructor(e,t={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof e!="string")throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),e==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===fe.context,this.isValue=this.key[0]===fe.value,this.isSibling=!this.isContext&&!this.isValue;let s=this.isContext?fe.context:this.isValue?fe.value:"";this.path=this.key.slice(s.length),this.getter=this.path&&re.getter(this.path,!0),this.map=t.map}getValue(e,t,s){let i=this.isContext?s:this.isValue?e:t;return this.getter&&(i=this.getter(i||{})),this.map&&(i=this.map(i)),i}cast(e,t){return this.getValue(e,t==null?void 0:t.parent,t==null?void 0:t.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}se.prototype.__isYupRef=!0;const Z=r=>r==null;function ie(r){function e({value:t,path:s="",options:i,originalValue:l,schema:a},c,u){const{name:f,test:h,params:x,message:p,skipAbsent:d}=r;let{parent:g,context:m,abortEarly:v=a.spec.abortEarly,disableStackTrace:j=a.spec.disableStackTrace}=i;const C={value:t,parent:g,context:m};function _(O={}){const S=tt(Object.assign({value:t,originalValue:l,label:a.spec.label,path:O.path||s,spec:a.spec,disableStackTrace:O.disableStackTrace||j},x,O.params),C),X=new I(I.formatError(O.message||p,S),t,S.path,O.type||f,S.disableStackTrace);return X.params=S,X}const F=v?c:u;let z={path:s,parent:g,type:f,from:i.from,createError:_,resolve(O){return rt(O,C)},options:i,originalValue:l,schema:a};const q=O=>{I.isError(O)?F(O):O?u(null):F(_())},K=O=>{I.isError(O)?F(O):c(O)};if(d&&Z(t))return q(!0);let D;try{var V;if(D=h.call(z,t,z),typeof((V=D)==null?void 0:V.then)=="function"){if(i.sync)throw new Error(`Validation test of type: "${z.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(D).then(q,K)}}catch(O){K(O);return}q(D)}return e.OPTIONS=r,e}function tt(r,e){if(!r)return r;for(const t of Object.keys(r))r[t]=rt(r[t],e);return r}function rt(r,e){return se.isRef(r)?r.getValue(e.value,e.parent,e.context):r}function Kt(r,e,t,s=t){let i,l,a;return e?(re.forEach(e,(c,u,f)=>{let h=u?c.slice(1,c.length-1):c;r=r.resolve({context:s,parent:i,value:t});let x=r.type==="tuple",p=f?parseInt(h,10):0;if(r.innerType||x){if(x&&!f)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${a}" must contain an index to the tuple element, e.g. "${a}[0]"`);if(t&&p>=t.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${c}, in the path: ${e}. because there is no value at that index. `);i=t,t=t&&t[p],r=x?r.spec.types[p]:r.innerType}if(!f){if(!r.fields||!r.fields[h])throw new Error(`The schema does not contain the path: ${e}. (failed at: ${a} which is a type: "${r.type}")`);i=t,t=t&&t[h],r=r.fields[h]}l=h,a=u?"["+c+"]":"."+c}),{schema:r,parent:i,parentPath:l}):{parent:i,parentPath:e,schema:r}}class ve extends Set{describe(){const e=[];for(const t of this.values())e.push(se.isRef(t)?t.describe():t);return e}resolveAll(e){let t=[];for(const s of this.values())t.push(e(s));return t}clone(){return new ve(this.values())}merge(e,t){const s=this.clone();return e.forEach(i=>s.add(i)),t.forEach(i=>s.delete(i)),s}}function ae(r,e=new Map){if(je(r)||!r||typeof r!="object")return r;if(e.has(r))return e.get(r);let t;if(r instanceof Date)t=new Date(r.getTime()),e.set(r,t);else if(r instanceof RegExp)t=new RegExp(r),e.set(r,t);else if(Array.isArray(r)){t=new Array(r.length),e.set(r,t);for(let s=0;s<r.length;s++)t[s]=ae(r[s],e)}else if(r instanceof Map){t=new Map,e.set(r,t);for(const[s,i]of r.entries())t.set(s,ae(i,e))}else if(r instanceof Set){t=new Set,e.set(r,t);for(const s of r)t.add(ae(s,e))}else if(r instanceof Object){t={},e.set(r,t);for(const[s,i]of Object.entries(r))t[s]=ae(i,e)}else throw Error(`Unable to clone ${r}`);return t}function Xt(r){if(!(r!=null&&r.length))return;const e=[];let t="",s=!1,i=!1;for(let l=0;l<r.length;l++){const a=r[l];if(a==="["&&!i){t&&(e.push(...t.split(".").filter(Boolean)),t=""),s=!0;continue}if(a==="]"&&!i){t&&(/^\d+$/.test(t)?e.push(t):e.push(t.replace(/^"|"$/g,"")),t=""),s=!1;continue}if(a==='"'){i=!i;continue}if(a==="."&&!s&&!i){t&&(e.push(t),t="");continue}t+=a}return t&&e.push(...t.split(".").filter(Boolean)),e}function Qt(r,e){const t=e?`${e}.${r.path}`:r.path;return r.errors.map(s=>({message:s,path:Xt(t)}))}function st(r,e){var t;if(!((t=r.inner)!=null&&t.length)&&r.errors.length)return Qt(r,e);const s=e?`${e}.${r.path}`:r.path;return r.inner.flatMap(i=>st(i,s))}class L{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new ve,this._blacklist=new ve,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Y.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},e==null?void 0:e.spec),this.withMutation(t=>{t.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeCheck=this._typeCheck,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.internalTests=Object.assign({},this.internalTests),t.exclusiveTests=Object.assign({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=ae(Object.assign({},this.spec,e)),t}label(e){let t=this.clone();return t.spec.label=e,t}meta(...e){if(e.length===0)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let s=e(this);return this._mutate=t,s}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,s=e.clone();const i=Object.assign({},t.spec,s.spec);return s.spec=i,s.internalTests=Object.assign({},t.internalTests,s.internalTests),s._whitelist=t._whitelist.merge(e._whitelist,e._blacklist),s._blacklist=t._blacklist.merge(e._blacklist,e._whitelist),s.tests=t.tests,s.exclusiveTests=t.exclusiveTests,s.withMutation(l=>{e.tests.forEach(a=>{l.test(a.OPTIONS)})}),s.transforms=[...t.transforms,...s.transforms],s}isType(e){return e==null?!!(this.spec.nullable&&e===null||this.spec.optional&&e===void 0):this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let s=t.conditions;t=t.clone(),t.conditions=[],t=s.reduce((i,l)=>l.resolve(i,e),t),t=t.resolve(e)}return t}resolveOptions(e){var t,s,i,l;return Object.assign({},e,{from:e.from||[],strict:(t=e.strict)!=null?t:this.spec.strict,abortEarly:(s=e.abortEarly)!=null?s:this.spec.abortEarly,recursive:(i=e.recursive)!=null?i:this.spec.recursive,disableStackTrace:(l=e.disableStackTrace)!=null?l:this.spec.disableStackTrace})}cast(e,t={}){let s=this.resolve(Object.assign({},t,{value:e})),i=t.assert==="ignore-optionality",l=s._cast(e,t);if(t.assert!==!1&&!s.isType(l)){if(i&&Z(l))return l;let a=J(e),c=J(l);throw new TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${s.type}".
|
|
2
2
|
|
|
3
3
|
attempted value: ${a}
|
|
4
4
|
`+(c!==a?`result of cast: ${c}`:""))}return l}_cast(e,t){let s=e===void 0?e:this.transforms.reduce((i,l)=>l.call(this,i,e,this,t),e);return s===void 0&&(s=this.getDefault(t)),s}_validate(e,t={},s,i){let{path:l,originalValue:a=e,strict:c=this.spec.strict}=t,u=e;c||(u=this._cast(u,Object.assign({assert:!1},t)));let f=[];for(let h of Object.values(this.internalTests))h&&f.push(h);this.runTests({path:l,value:u,originalValue:a,options:t,tests:f},s,h=>{if(h.length)return i(h,u);this.runTests({path:l,value:u,originalValue:a,options:t,tests:this.tests},s,i)})}runTests(e,t,s){let i=!1,{tests:l,value:a,originalValue:c,path:u,options:f}=e,h=m=>{i||(i=!0,t(m,a))},x=m=>{i||(i=!0,s(m,a))},p=l.length,d=[];if(!p)return x([]);let g={value:a,originalValue:c,path:u,options:f,schema:this};for(let m=0;m<l.length;m++){const v=l[m];v(g,h,function(C){C&&(Array.isArray(C)?d.push(...C):d.push(C)),--p<=0&&x(d)})}}asNestedTest({key:e,index:t,parent:s,parentPath:i,originalParent:l,options:a}){const c=e??t;if(c==null)throw TypeError("Must include `key` or `index` for nested validations");const u=typeof c=="number";let f=s[c];const h=Object.assign({},a,{strict:!0,parent:s,value:f,originalValue:l[c],key:void 0,[u?"index":"key"]:c,path:u||c.includes(".")?`${i||""}[${u?c:`"${c}"`}]`:(i?`${i}.`:"")+e});return(x,p,d)=>this.resolve(h)._validate(f,h,p,d)}validate(e,t){var s;let i=this.resolve(Object.assign({},t,{value:e})),l=(s=t==null?void 0:t.disableStackTrace)!=null?s:i.spec.disableStackTrace;return new Promise((a,c)=>i._validate(e,t,(u,f)=>{I.isError(u)&&(u.value=f),c(u)},(u,f)=>{u.length?c(new I(u,f,void 0,void 0,l)):a(f)}))}validateSync(e,t){var s;let i=this.resolve(Object.assign({},t,{value:e})),l,a=(s=t==null?void 0:t.disableStackTrace)!=null?s:i.spec.disableStackTrace;return i._validate(e,Object.assign({},t,{sync:!0}),(c,u)=>{throw I.isError(c)&&(c.value=u),c},(c,u)=>{if(c.length)throw new I(c,e,void 0,void 0,a);l=u}),l}isValid(e,t){return this.validate(e,t).then(()=>!0,s=>{if(I.isError(s))return!1;throw s})}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(s){if(I.isError(s))return!1;throw s}}_getDefault(e){let t=this.spec.default;return t==null?t:typeof t=="function"?t.call(this,e):ae(t)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return arguments.length===0?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,t){const s=this.clone({nullable:e});return s.internalTests.nullable=ie({message:t,name:"nullable",test(i){return i===null?this.schema.spec.nullable:!0}}),s}optionality(e,t){const s=this.clone({optional:e});return s.internalTests.optionality=ie({message:t,name:"optionality",test(i){return i===void 0?this.schema.spec.optional:!0}}),s}optional(){return this.optionality(!0)}defined(e=Y.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=Y.notNull){return this.nullability(!1,e)}required(e=Y.required){return this.clone().withMutation(t=>t.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(e.length===1?typeof e[0]=="function"?t={test:e[0]}:t=e[0]:e.length===2?t={name:e[0],test:e[1]}:t={name:e[0],message:e[1],test:e[2]},t.message===void 0&&(t.message=Y.default),typeof t.test!="function")throw new TypeError("`test` is a required parameters");let s=this.clone(),i=ie(t),l=t.exclusive||t.name&&s.exclusiveTests[t.name]===!0;if(t.exclusive&&!t.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(s.exclusiveTests[t.name]=!!t.exclusive),s.tests=s.tests.filter(a=>!(a.OPTIONS.name===t.name&&(l||a.OPTIONS.test===i.OPTIONS.test))),s.tests.push(i),s}when(e,t){!Array.isArray(e)&&typeof e!="string"&&(t=e,e=".");let s=this.clone(),i=Ke(e).map(l=>new se(l));return i.forEach(l=>{l.isSibling&&s.deps.push(l.key)}),s.conditions.push(typeof t=="function"?new ye(i,t):ye.fromOptions(i,t)),s}typeError(e){let t=this.clone();return t.internalTests.typeError=ie({message:e,name:"typeError",skipAbsent:!0,test(s){return this.schema._typeCheck(s)?!0:this.createError({params:{type:this.schema.type}})}}),t}oneOf(e,t=Y.oneOf){let s=this.clone();return e.forEach(i=>{s._whitelist.add(i),s._blacklist.delete(i)}),s.internalTests.whiteList=ie({message:t,name:"oneOf",skipAbsent:!0,test(i){let l=this.schema._whitelist,a=l.resolveAll(this.resolve);return a.includes(i)?!0:this.createError({params:{values:Array.from(l).join(", "),resolved:a}})}}),s}notOneOf(e,t=Y.notOneOf){let s=this.clone();return e.forEach(i=>{s._blacklist.add(i),s._whitelist.delete(i)}),s.internalTests.blacklist=ie({message:t,name:"notOneOf",test(i){let l=this.schema._blacklist,a=l.resolveAll(this.resolve);return a.includes(i)?this.createError({params:{values:Array.from(l).join(", "),resolved:a}}):!0}}),s}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(e){const t=(e?this.resolve(e):this).clone(),{label:s,meta:i,optional:l,nullable:a}=t.spec;return{meta:i,label:s,optional:l,nullable:a,default:t.getDefault(e),type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.filter((u,f,h)=>h.findIndex(x=>x.OPTIONS.name===u.OPTIONS.name)===f).map(u=>{const f=u.OPTIONS.params&&e?tt(Object.assign({},u.OPTIONS.params),e):u.OPTIONS.params;return{name:u.OPTIONS.name,params:f}})}}get"~standard"(){const e=this;return{version:1,vendor:"yup",async validate(s){try{return{value:await e.validate(s,{abortEarly:!1})}}catch(i){if(i instanceof I)return{issues:st(i)};throw i}}}}}L.prototype.__isYupSchema__=!0;for(const r of["validate","validateSync"])L.prototype[`${r}At`]=function(e,t,s={}){const{parent:i,parentPath:l,schema:a}=Kt(this,e,t,s.context);return a[r](i&&i[l],Object.assign({},s,{parent:i,path:e}))};for(const r of["equals","is"])L.prototype[r]=L.prototype.oneOf;for(const r of["not","nope"])L.prototype[r]=L.prototype.notOneOf;function nt(){return new it}class it extends L{constructor(){super({type:"boolean",check(e){return e instanceof Boolean&&(e=e.valueOf()),typeof e=="boolean"}}),this.withMutation(()=>{this.transform((e,t)=>{if(this.spec.coerce&&!this.isType(e)){if(/^(true|1)$/i.test(String(e)))return!0;if(/^(false|0)$/i.test(String(e)))return!1}return e})})}isTrue(e=Ee.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"true"},test(t){return Z(t)||t===!0}})}isFalse(e=Ee.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"false"},test(t){return Z(t)||t===!1}})}default(e){return super.default(e)}defined(e){return super.defined(e)}optional(){return super.optional()}required(e){return super.required(e)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(e){return super.nonNullable(e)}strip(e){return super.strip(e)}}nt.prototype=it.prototype;const er=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function tr(r){const e=$e(r);if(!e)return Date.parse?Date.parse(r):Number.NaN;if(e.z===void 0&&e.plusMinus===void 0)return new Date(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond).valueOf();let t=0;return e.z!=="Z"&&e.plusMinus!==void 0&&(t=e.hourOffset*60+e.minuteOffset,e.plusMinus==="+"&&(t=0-t)),Date.UTC(e.year,e.month,e.day,e.hour,e.minute+t,e.second,e.millisecond)}function $e(r){var e,t;const s=er.exec(r);return s?{year:G(s[1]),month:G(s[2],1)-1,day:G(s[3],1),hour:G(s[4]),minute:G(s[5]),second:G(s[6]),millisecond:s[7]?G(s[7].substring(0,3)):0,precision:(e=(t=s[7])==null?void 0:t.length)!=null?e:void 0,z:s[8]||void 0,plusMinus:s[9]||void 0,hourOffset:G(s[10]),minuteOffset:G(s[11])}:null}function G(r,e=0){return Number(r)||e}let rr=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,sr=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,nr=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,ir="^\\d{4}-\\d{2}-\\d{2}",lr="\\d{2}:\\d{2}:\\d{2}",ar="(([+-]\\d{2}(:?\\d{2})?)|Z)",or=new RegExp(`${ir}T${lr}(\\.\\d+)?${ar}$`),cr=r=>Z(r)||r===r.trim(),ur={}.toString();function me(){return new lt}class lt extends L{constructor(){super({type:"string",check(e){return e instanceof String&&(e=e.valueOf()),typeof e=="string"}}),this.withMutation(()=>{this.transform((e,t)=>{if(!this.spec.coerce||this.isType(e)||Array.isArray(e))return e;const s=e!=null&&e.toString?e.toString():e;return s===ur?e:s})})}required(e){return super.required(e).withMutation(t=>t.test({message:e||Y.required,name:"required",skipAbsent:!0,test:s=>!!s.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(t=>t.OPTIONS.name!=="required"),e))}length(e,t=M.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(s){return s.length===this.resolve(e)}})}min(e,t=M.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(s){return s.length>=this.resolve(e)}})}max(e,t=M.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:e},skipAbsent:!0,test(s){return s.length<=this.resolve(e)}})}matches(e,t){let s=!1,i,l;return t&&(typeof t=="object"?{excludeEmptyString:s=!1,message:i,name:l}=t:i=t),this.test({name:l||"matches",message:i||M.matches,params:{regex:e},skipAbsent:!0,test:a=>a===""&&s||a.search(e)!==-1})}email(e=M.email){return this.matches(rr,{name:"email",message:e,excludeEmptyString:!0})}url(e=M.url){return this.matches(sr,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=M.uuid){return this.matches(nr,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let t="",s,i;return e&&(typeof e=="object"?{message:t="",allowOffset:s=!1,precision:i=void 0}=e:t=e),this.matches(or,{name:"datetime",message:t||M.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:t||M.datetime_offset,params:{allowOffset:s},skipAbsent:!0,test:l=>{if(!l||s)return!0;const a=$e(l);return a?!!a.z:!1}}).test({name:"datetime_precision",message:t||M.datetime_precision,params:{precision:i},skipAbsent:!0,test:l=>{if(!l||i==null)return!0;const a=$e(l);return a?a.precision===i:!1}})}ensure(){return this.default("").transform(e=>e===null?"":e)}trim(e=M.trim){return this.transform(t=>t!=null?t.trim():t).test({message:e,name:"trim",test:cr})}lowercase(e=M.lowercase){return this.transform(t=>Z(t)?t:t.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:t=>Z(t)||t===t.toLowerCase()})}uppercase(e=M.uppercase){return this.transform(t=>Z(t)?t:t.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:t=>Z(t)||t===t.toUpperCase()})}}me.prototype=lt.prototype;let dr=r=>r!=+r;function at(){return new ot}class ot extends L{constructor(){super({type:"number",check(e){return e instanceof Number&&(e=e.valueOf()),typeof e=="number"&&!dr(e)}}),this.withMutation(()=>{this.transform((e,t)=>{if(!this.spec.coerce)return e;let s=e;if(typeof s=="string"){if(s=s.replace(/\s/g,""),s==="")return NaN;s=+s}return this.isType(s)||s===null?s:parseFloat(s)})})}min(e,t=Q.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(s){return s>=this.resolve(e)}})}max(e,t=Q.max){return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(s){return s<=this.resolve(e)}})}lessThan(e,t=Q.lessThan){return this.test({message:t,name:"max",exclusive:!0,params:{less:e},skipAbsent:!0,test(s){return s<this.resolve(e)}})}moreThan(e,t=Q.moreThan){return this.test({message:t,name:"min",exclusive:!0,params:{more:e},skipAbsent:!0,test(s){return s>this.resolve(e)}})}positive(e=Q.positive){return this.moreThan(0,e)}negative(e=Q.negative){return this.lessThan(0,e)}integer(e=Q.integer){return this.test({name:"integer",message:e,skipAbsent:!0,test:t=>Number.isInteger(t)})}truncate(){return this.transform(e=>Z(e)?e:e|0)}round(e){var t;let s=["ceil","floor","round","trunc"];if(e=((t=e)==null?void 0:t.toLowerCase())||"round",e==="trunc")return this.truncate();if(s.indexOf(e.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+s.join(", "));return this.transform(i=>Z(i)?i:Math[e](i))}}at.prototype=ot.prototype;let fr=new Date(""),pr=r=>Object.prototype.toString.call(r)==="[object Date]";class ze extends L{constructor(){super({type:"date",check(e){return pr(e)&&!isNaN(e.getTime())}}),this.withMutation(()=>{this.transform((e,t)=>!this.spec.coerce||this.isType(e)||e===null?e:(e=tr(e),isNaN(e)?ze.INVALID_DATE:new Date(e)))})}prepareParam(e,t){let s;if(se.isRef(e))s=e;else{let i=this.cast(e);if(!this._typeCheck(i))throw new TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);s=i}return s}min(e,t=Oe.min){let s=this.prepareParam(e,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(i){return i>=this.resolve(s)}})}max(e,t=Oe.max){let s=this.prepareParam(e,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(i){return i<=this.resolve(s)}})}}ze.INVALID_DATE=fr;function hr(r,e=[]){let t=[],s=new Set,i=new Set(e.map(([a,c])=>`${a}-${c}`));function l(a,c){let u=re.split(a)[0];s.add(u),i.has(`${c}-${u}`)||t.push([c,u])}for(const a of Object.keys(r)){let c=r[a];s.add(a),se.isRef(c)&&c.isSibling?l(c.path,a):je(c)&&"deps"in c&&c.deps.forEach(u=>l(u,a))}return qt.array(Array.from(s),t).reverse()}function Ve(r,e){let t=1/0;return r.some((s,i)=>{var l;if((l=e.path)!=null&&l.includes(s))return t=i,!0}),t}function ct(r){return(e,t)=>Ve(r,e)-Ve(r,t)}const ut=(r,e,t)=>{if(typeof r!="string")return r;let s=r;try{s=JSON.parse(r)}catch{}return t.isType(s)?s:r};function be(r){if("fields"in r){const e={};for(const[t,s]of Object.entries(r.fields))e[t]=be(s);return r.setFields(e)}if(r.type==="array"){const e=r.optional();return e.innerType&&(e.innerType=be(e.innerType)),e}return r.type==="tuple"?r.optional().clone({types:r.spec.types.map(be)}):"optional"in r?r.optional():r}const xr=(r,e)=>{const t=[...re.normalizePath(e)];if(t.length===1)return t[0]in r;let s=t.pop(),i=re.getter(re.join(t),!0)(r);return!!(i&&s in i)};let We=r=>Object.prototype.toString.call(r)==="[object Object]";function Ue(r,e){let t=Object.keys(r.fields);return Object.keys(e).filter(s=>t.indexOf(s)===-1)}const mr=ct([]);function _e(r){return new dt(r)}class dt extends L{constructor(e){super({type:"object",check(t){return We(t)||typeof t=="function"}}),this.fields=Object.create(null),this._sortErrors=mr,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,t={}){var s;let i=super._cast(e,t);if(i===void 0)return this.getDefault(t);if(!this._typeCheck(i))return i;let l=this.fields,a=(s=t.stripUnknown)!=null?s:this.spec.noUnknown,c=[].concat(this._nodes,Object.keys(i).filter(x=>!this._nodes.includes(x))),u={},f=Object.assign({},t,{parent:u,__validating:t.__validating||!1}),h=!1;for(const x of c){let p=l[x],d=x in i,g=i[x];if(p){let m;f.path=(t.path?`${t.path}.`:"")+x,p=p.resolve({value:g,context:t.context,parent:u});let v=p instanceof L?p.spec:void 0,j=v==null?void 0:v.strict;if(v!=null&&v.strip){h=h||x in i;continue}m=!t.__validating||!j?p.cast(g,f):g,m!==void 0&&(u[x]=m)}else d&&!a&&(u[x]=g);(d!==x in u||u[x]!==g)&&(h=!0)}return h?u:i}_validate(e,t={},s,i){let{from:l=[],originalValue:a=e,recursive:c=this.spec.recursive}=t;t.from=[{schema:this,value:a},...l],t.__validating=!0,t.originalValue=a,super._validate(e,t,s,(u,f)=>{if(!c||!We(f)){i(u,f);return}a=a||f;let h=[];for(let x of this._nodes){let p=this.fields[x];!p||se.isRef(p)||h.push(p.asNestedTest({options:t,key:x,parent:f,parentPath:t.path,originalParent:a}))}this.runTests({tests:h,value:f,originalValue:a,options:t},s,x=>{i(x.sort(this._sortErrors).concat(u),f)})})}clone(e){const t=super.clone(e);return t.fields=Object.assign({},this.fields),t._nodes=this._nodes,t._excludedEdges=this._excludedEdges,t._sortErrors=this._sortErrors,t}concat(e){let t=super.concat(e),s=t.fields;for(let[i,l]of Object.entries(this.fields)){const a=s[i];s[i]=a===void 0?l:a}return t.withMutation(i=>i.setFields(s,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let t={};return this._nodes.forEach(s=>{var i;const l=this.fields[s];let a=e;(i=a)!=null&&i.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[s]})),t[s]=l&&"getDefault"in l?l.getDefault(a):void 0}),t}setFields(e,t){let s=this.clone();return s.fields=e,s._nodes=hr(e,t),s._sortErrors=ct(Object.keys(e)),t&&(s._excludedEdges=t),s}shape(e,t=[]){return this.clone().withMutation(s=>{let i=s._excludedEdges;return t.length&&(Array.isArray(t[0])||(t=[t]),i=[...s._excludedEdges,...t]),s.setFields(Object.assign(s.fields,e),i)})}partial(){const e={};for(const[t,s]of Object.entries(this.fields))e[t]="optional"in s&&s.optional instanceof Function?s.optional():s;return this.setFields(e)}deepPartial(){return be(this)}pick(e){const t={};for(const s of e)this.fields[s]&&(t[s]=this.fields[s]);return this.setFields(t,this._excludedEdges.filter(([s,i])=>e.includes(s)&&e.includes(i)))}omit(e){const t=[];for(const s of Object.keys(this.fields))e.includes(s)||t.push(s);return this.pick(t)}from(e,t,s){let i=re.getter(e,!0);return this.transform(l=>{if(!l)return l;let a=l;return xr(l,e)&&(a=Object.assign({},l),s||delete a[e],a[t]=i(l)),a})}json(){return this.transform(ut)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||he.exact,test(t){if(t==null)return!0;const s=Ue(this.schema,t);return s.length===0||this.createError({params:{properties:s.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,t=he.noUnknown){typeof e!="boolean"&&(t=e,e=!0);let s=this.test({name:"noUnknown",exclusive:!0,message:t,test(i){if(i==null)return!0;const l=Ue(this.schema,i);return!e||l.length===0||this.createError({params:{unknown:l.join(", ")}})}});return s.spec.noUnknown=e,s}unknown(e=!0,t=he.noUnknown){return this.noUnknown(!e,t)}transformKeys(e){return this.transform(t=>{if(!t)return t;const s={};for(const i of Object.keys(t))s[e(i)]=t[i];return s})}camelCase(){return this.transformKeys(Te.camelCase)}snakeCase(){return this.transformKeys(Te.snakeCase)}constantCase(){return this.transformKeys(e=>Te.snakeCase(e).toUpperCase())}describe(e){const t=(e?this.resolve(e):this).clone(),s=super.describe(e);s.fields={};for(const[l,a]of Object.entries(t.fields)){var i;let c=e;(i=c)!=null&&i.value&&(c=Object.assign({},c,{parent:c.value,value:c.value[l]})),s.fields[l]=a.describe(c)}return s}}_e.prototype=dt.prototype;function ft(r){return new pt(r)}class pt extends L{constructor(e){super({type:"array",spec:{types:e},check(t){return Array.isArray(t)}}),this.innerType=void 0,this.innerType=e}_cast(e,t){const s=super._cast(e,t);if(!this._typeCheck(s)||!this.innerType)return s;let i=!1;const l=s.map((a,c)=>{const u=this.innerType.cast(a,Object.assign({},t,{path:`${t.path||""}[${c}]`,parent:s,originalValue:a,value:a,index:c}));return u!==a&&(i=!0),u});return i?l:s}_validate(e,t={},s,i){var l;let a=this.innerType,c=(l=t.recursive)!=null?l:this.spec.recursive;t.originalValue!=null&&t.originalValue,super._validate(e,t,s,(u,f)=>{var h;if(!c||!a||!this._typeCheck(f)){i(u,f);return}let x=new Array(f.length);for(let d=0;d<f.length;d++){var p;x[d]=a.asNestedTest({options:t,index:d,parent:f,parentPath:t.path,originalParent:(p=t.originalValue)!=null?p:e})}this.runTests({value:f,tests:x,originalValue:(h=t.originalValue)!=null?h:e,options:t},s,d=>i(d.concat(u),f))})}clone(e){const t=super.clone(e);return t.innerType=this.innerType,t}json(){return this.transform(ut)}concat(e){let t=super.concat(e);return t.innerType=this.innerType,e.innerType&&(t.innerType=t.innerType?t.innerType.concat(e.innerType):e.innerType),t}of(e){let t=this.clone();if(!je(e))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+J(e));return t.innerType=e,t.spec=Object.assign({},t.spec,{types:e}),t}length(e,t=xe.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(s){return s.length===this.resolve(e)}})}min(e,t){return t=t||xe.min,this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(s){return s.length>=this.resolve(e)}})}max(e,t){return t=t||xe.max,this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(s){return s.length<=this.resolve(e)}})}ensure(){return this.default(()=>[]).transform((e,t)=>this._typeCheck(e)?e:t==null?[]:[].concat(t))}compact(e){let t=e?(s,i,l)=>!e(s,i,l):s=>!!s;return this.transform(s=>s!=null?s.filter(t):s)}describe(e){const t=(e?this.resolve(e):this).clone(),s=super.describe(e);if(t.innerType){var i;let l=e;(i=l)!=null&&i.value&&(l=Object.assign({},l,{parent:l.value,value:l.value[0]})),s.innerType=t.innerType.describe(l)}return s}}ft.prototype=pt.prototype;class br{constructor(){this.sources=new Map}register(e,t){this.sources.set(e,t)}get(e){return this.sources.get(e)}has(e){return this.sources.has(e)}}const ht=new br,gr=8,T={wrapper:r=>({border:`1px solid ${r?B.FF.BORDER_COLOR_ERROR:B.FF.BORDER_COLOR}`,borderRadius:B.FF.BORDER_RADIUS,overflow:"hidden",background:"#fff",fontSize:13}),toolbar:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 12px",borderBottom:"1px solid #e0e0e0",minHeight:40,background:"#fff"},selectedLink:{fontSize:13,color:"#1976d2",cursor:"pointer",background:"none",border:"none",padding:0,fontWeight:500},searchWrap:{display:"flex",alignItems:"center",gap:6,border:"1px solid #e0e0e0",borderRadius:4,padding:"3px 8px",background:"#fafafa",flex:"0 0 220px"},searchInput:{border:"none",outline:"none",fontSize:13,background:"transparent",width:"100%"},table:{width:"100%",borderCollapse:"collapse"},thead:{background:"#f5f5f5"},th:r=>({textAlign:"left",padding:"0 16px",height:44,fontSize:12,fontWeight:600,color:"rgba(0,0,0,0.6)",borderBottom:"1px solid #e0e0e0",whiteSpace:"nowrap",width:r,letterSpacing:"0.01em"}),checkTh:{width:48,padding:"0 0 0 12px",height:44,borderBottom:"1px solid #e0e0e0",background:"#f5f5f5"},td:{padding:"0 16px",height:48,borderBottom:"1px solid #f0f0f0",color:"rgba(0,0,0,0.87)",verticalAlign:"middle"},checkTd:{padding:"0 0 0 12px",height:48,borderBottom:"1px solid #f0f0f0",verticalAlign:"middle",width:48},statusRow:{textAlign:"center",padding:"24px 16px",color:"rgba(0,0,0,0.38)",fontSize:13},footer:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:16,padding:"4px 8px",borderTop:"1px solid #e0e0e0",fontSize:12,color:"rgba(0,0,0,0.6)",background:"#fafafa",minHeight:40},pageBtn:r=>({display:"flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:"50%",border:"none",background:"transparent",cursor:r?"default":"pointer",color:r?"rgba(0,0,0,0.26)":"rgba(0,0,0,0.54)",fontSize:16,transition:"background 0.15s"}),overlay:{position:"fixed",inset:0,background:"rgba(0,0,0,0.5)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center"},modal:{background:"#fff",borderRadius:8,width:560,maxWidth:"90vw",maxHeight:"80vh",display:"flex",flexDirection:"column",boxShadow:"0 8px 32px rgba(0,0,0,0.18)"},modalHeader:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid #e0e0e0",fontSize:16,fontWeight:600,color:"rgba(0,0,0,0.87)"},modalCloseBtn:{background:"none",border:"none",cursor:"pointer",color:"rgba(0,0,0,0.54)",display:"flex",alignItems:"center",padding:4,borderRadius:4},modalSearch:{display:"flex",alignItems:"center",gap:8,margin:"12px 20px",border:"1px solid #e0e0e0",borderRadius:20,padding:"6px 12px",background:"#fafafa"},modalSearchInput:{flex:1,border:"none",outline:"none",fontSize:14,background:"transparent"},modalList:{flex:1,overflowY:"auto",padding:"0 20px 8px"},modalRow:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 0",borderBottom:"1px solid #f0f0f0",fontSize:14,color:"rgba(0,0,0,0.87)"},modalRemoveBtn:{background:"none",border:"none",cursor:"pointer",color:"#e53935",display:"flex",alignItems:"center",padding:2,borderRadius:4,flexShrink:0},modalFooter:{display:"flex",justifyContent:"flex-end",padding:"12px 20px",borderTop:"1px solid #e0e0e0"},closeBtn:{padding:"6px 20px",border:"1px solid #e0e0e0",borderRadius:4,background:"#fff",cursor:"pointer",fontSize:14,color:"rgba(0,0,0,0.87)"}};function Ze({checked:r,onChange:e,indeterminate:t,disabled:s}){const i=b.useRef(null);return b.useEffect(()=>{i.current&&(i.current.indeterminate=!!t)},[t]),n.jsx("input",{ref:i,type:"checkbox",checked:r,onChange:e,disabled:s,style:{width:16,height:16,cursor:s?"default":"pointer",accentColor:"#1976d2"}})}function yr({selected:r,onRemove:e,onClose:t}){const[s,i]=b.useState(""),l=r.filter(a=>a.label.toLowerCase().includes(s.toLowerCase()));return n.jsx("div",{style:T.overlay,onClick:t,children:n.jsxs("div",{style:T.modal,onClick:a=>a.stopPropagation(),children:[n.jsxs("div",{style:T.modalHeader,children:[n.jsx("span",{children:"Selected Rows"}),n.jsx("button",{type:"button",style:T.modalCloseBtn,onClick:t,children:n.jsx(E.MdClose,{size:20})})]}),n.jsxs("div",{style:T.modalSearch,children:[n.jsx(E.MdSearch,{size:18,color:"rgba(0,0,0,0.38)"}),n.jsx("input",{autoFocus:!0,type:"text",placeholder:"Search",value:s,onChange:a=>i(a.target.value),style:T.modalSearchInput})]}),n.jsxs("div",{style:T.modalList,children:[l.length===0&&n.jsx("div",{style:{textAlign:"center",padding:"24px 0",color:"rgba(0,0,0,0.38)",fontSize:13},children:"No items found"}),l.map(a=>n.jsxs("div",{style:T.modalRow,children:[n.jsx("span",{children:a.label}),n.jsx("button",{type:"button",style:T.modalRemoveBtn,onClick:()=>e(a.value),title:"Remove",children:n.jsx(E.MdClose,{size:16})})]},a.value))]}),n.jsx("div",{style:T.modalFooter,children:n.jsx("button",{type:"button",style:T.closeBtn,onClick:t,children:"Close"})})]})})}function xt({field:r,value:e,onChange:t,onBlur:s,error:i,touched:l}){const a=r,c=!!(l&&i),u=a.isMulti??!1,f=a.pageSize??gr,h=a.id??a.name??"",[x,p]=b.useState(""),[d,g]=b.useState(1),[m,v]=b.useState([]),[j,C]=b.useState(!1),[_,F]=b.useState(!1),[z,q]=b.useState(null),[K,U]=b.useState(!1),D=b.useRef(null),V=b.useRef(0),O=b.useRef(!0);b.useEffect(()=>()=>{O.current=!1,D.current&&clearTimeout(D.current)},[]);const S=u?Array.isArray(e)?e:[]:e?[e]:[],X=S.length,ce=b.useCallback((y,$)=>{if(a.fetchOptions)return a.fetchOptions(y,$);if(a.dataSource){const N=ht.get(a.dataSource);return N?N.fetch(y,$):Promise.reject(new Error(`[FlowForge] DataSource "${a.dataSource}" is not registered.`))}return Promise.reject(new Error(`[FlowForge] table-picker "${a.id}" requires fetchOptions or dataSource.`))},[a.fetchOptions,a.dataSource,a.id]),R=b.useCallback((y,$)=>{const N=++V.current;F(!0),ce(y,$).then(A=>{!O.current||N!==V.current||(v(A.options.slice(0,f)),C(A.hasNextPage))}).catch(()=>{!O.current||N!==V.current||(v([]),C(!1))}).finally(()=>{!O.current||N!==V.current||F(!1)})},[ce,f]);b.useEffect(()=>{R("",1)},[]);const ee=y=>{const $=y.target.value;p($),g(1),D.current&&clearTimeout(D.current),D.current=setTimeout(()=>R($,1),300)},te=y=>{if(u){const $=Array.isArray(e)?e:[],N=$.some(A=>A.value===y.value);t(N?$.filter(A=>A.value!==y.value):[...$,y])}else t((e==null?void 0:e.value)===y.value?null:y);s==null||s()},ue=()=>{if(!u)return;const y=Array.isArray(e)?e:[];if(m.every(N=>y.some(A=>A.value===N.value)))t(y.filter(N=>!m.some(A=>A.value===N.value)));else{const N=m.filter(A=>!y.some(St=>St.value===A.value));t([...y,...N])}},P=y=>{if(u){const N=(Array.isArray(e)?e:[]).filter(A=>A.value!==y);t(N),N.length===0&&U(!1)}else t(null),U(!1);s==null||s()},ne=a.columns.length+1,W=m.length>0&&m.every(y=>S.some($=>$.value===y.value)),Ie=m.some(y=>S.some($=>$.value===y.value)),ke=y=>S.some($=>$.value===y.value);return n.jsxs("div",{style:{marginBottom:16},children:[n.jsx(B.FieldLabel,{label:a.label,required:a.required,showOptional:a.showOptional,info:a.info,htmlFor:h,dataTestId:a.dataTestId??h}),n.jsxs("div",{style:T.wrapper(c),onBlur:s,id:h,children:[n.jsxs("div",{style:T.toolbar,children:[X>0?n.jsxs("button",{type:"button",style:T.selectedLink,onClick:()=>U(!0),children:[X," ",X===1?"Item":"Items"," Selected"]}):n.jsx("span",{style:{fontSize:13,color:"rgba(0,0,0,0.38)"},children:"No selection"}),n.jsxs("div",{style:T.searchWrap,children:[n.jsx(E.MdSearch,{size:15,color:"rgba(0,0,0,0.38)"}),n.jsx("input",{type:"text",placeholder:a.placeholder??"Search…",value:x,onChange:ee,style:T.searchInput,"aria-label":`Search ${a.label??""}`})]})]}),n.jsx("div",{style:{overflowX:"auto"},children:n.jsxs("table",{style:T.table,children:[n.jsx("thead",{style:T.thead,children:n.jsxs("tr",{children:[n.jsx("th",{style:T.checkTh,children:u&&n.jsx(Ze,{checked:W,indeterminate:!W&&Ie,onChange:ue,disabled:_||m.length===0})}),a.columns.map(y=>n.jsx("th",{style:T.th(y.width),children:y.label},y.key))]})}),n.jsx("tbody",{children:_?n.jsx("tr",{children:n.jsx("td",{colSpan:ne,style:T.statusRow,children:"Loading…"})}):m.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:ne,style:T.statusRow,children:"No results found"})}):m.map(y=>{const $=ke(y),N=z===y.value;return n.jsxs("tr",{style:{cursor:"pointer",background:$?"rgba(25,118,210,0.06)":N?"rgba(0,0,0,0.03)":"#fff",transition:"background 0.1s"},onClick:()=>te(y),onMouseEnter:()=>q(y.value),onMouseLeave:()=>q(null),"aria-selected":$,children:[n.jsx("td",{style:T.checkTd,children:u?n.jsx(Ze,{checked:$,onChange:()=>te(y)}):n.jsx("input",{type:"radio",checked:$,onChange:()=>te(y),onClick:A=>A.stopPropagation(),name:h,style:{accentColor:"#1976d2",width:16,height:16,cursor:"pointer"}})}),a.columns.map(A=>n.jsx("td",{style:T.td,children:String(y[A.key]??"")},A.key))]},y.value)})})]})}),n.jsxs("div",{style:T.footer,children:[n.jsx("span",{children:`${(d-1)*f+1}–${(d-1)*f+m.length} of many`}),n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[n.jsx("button",{type:"button",onClick:()=>{const y=d-1;g(y),R(x,y)},disabled:d<=1,style:T.pageBtn(d<=1),"aria-label":"Previous page",children:"‹"}),n.jsx("button",{type:"button",onClick:()=>{const y=d+1;g(y),R(x,y)},disabled:!j,style:T.pageBtn(!j),"aria-label":"Next page",children:"›"})]})]})]}),a.helperText&&!c&&n.jsx("small",{style:B.helperTextStyle,children:a.helperText}),c&&n.jsx("small",{"data-testid":`${h}-error`,style:B.errorTextStyle,children:i}),K&&n.jsx(yr,{selected:S,onRemove:P,onClose:()=>U(!1)})]})}class vr{constructor(){this.fields=new Map,this.register({type:"text",label:"Text"}),this.register({type:"textarea",label:"Textarea"}),this.register({type:"number",label:"Number",configSchema:{fields:[{id:"min",type:"number",label:"Minimum limit"},{id:"max",type:"number",label:"Maximum limit"},{id:"step",type:"number",label:"Step size"},{id:"prefix",type:"text",label:"Prefix (e.g. $)"},{id:"suffix",type:"text",label:"Suffix (e.g. USD)"}]}}),this.register({type:"toggle",label:"Toggle/Switch"}),this.register({type:"select",label:"Select"}),this.register({type:"descriptive-select",label:"Descriptive Select"}),this.register({type:"radio-group",label:"Radio Group"}),this.register({type:"key-value",label:"Key-Value"}),this.register({type:"reference",label:"Reference"}),this.register({type:"cron",label:"Cron"}),this.register({type:"object",label:"Object"}),this.register({type:"schema",label:"Schema (nested form)"}),this.register({type:"tabs",label:"Tabs"}),this.register({type:"date",label:"Date"}),this.register({type:"datetime",label:"Date & Time"}),this.register({type:"time",label:"Time"}),this.register({type:"tags",label:"Tags",configSchema:{fields:[{id:"placeholder",type:"text",label:"Placeholder text"},{id:"maxTags",type:"number",label:"Max tags (leave empty for unlimited)"}]}}),this.register({type:"slider",label:"Slider",configSchema:{fields:[{id:"min",type:"number",label:"Minimum value"},{id:"max",type:"number",label:"Maximum value"},{id:"step",type:"number",label:"Step size"},{id:"showValue",type:"toggle",label:"Show current value"},{id:"marks",type:"toggle",label:"Show tick marks"}]}}),this.register({type:"color",label:"Color",configSchema:{fields:[{id:"showHex",type:"toggle",label:"Show hex input"}]}}),this.register({type:"file",label:"File Upload",configSchema:{fields:[{id:"accept",type:"text",label:"Accepted file types (e.g. .pdf,.png)"},{id:"maxSizeMb",type:"number",label:"Max file size (MB)"},{id:"multiple",type:"toggle",label:"Allow multiple files"}]}}),this.register({type:"json-editor",label:"JSON Editor",configSchema:{fields:[{id:"rows",type:"number",label:"Editor height (rows)"}]}}),this.register({type:"code",label:"Code",configSchema:{fields:[{id:"language",type:"select",label:"Language",options:[{value:"javascript",label:"JavaScript"},{value:"typescript",label:"TypeScript"},{value:"python",label:"Python"},{value:"json",label:"JSON"}]},{id:"rows",type:"number",label:"Editor height (rows)"}]}}),this.register({type:"rich-text",label:"Rich Text",configSchema:{fields:[{id:"rows",type:"number",label:"Editor height (rows)"},{id:"toolbar",type:"toggle",label:"Show toolbar"}]}}),this.register({type:"table-picker",label:"Table Picker",component:xt,configSchema:{fields:[{id:"label",type:"text",label:"Label"},{id:"required",type:"toggle",label:"Required"},{id:"isMulti",type:"toggle",label:"Multi-select"},{id:"pageSize",type:"number",label:"Page size"}]}})}register(e){this.fields.set(e.type,e),e.component&&B.fieldRegistry.register(e.type,e.component)}get(e){return this.fields.get(e)}getAll(){return Array.from(this.fields.values())}getTypeOptions(){return this.getAll().map(e=>({value:e.type,label:e.label}))}}const Se=new vr;function we(r){const e={};for(const t of r){let s;try{s=B.resolveFieldKey(t)}catch{continue}if(!s||t.hidden)continue;if(t.validation){e[s]=t.validation;continue}let i;const l=Se.get(t.type);if(l!=null&&l.buildValidation)i=l.buildValidation(t);else switch(t.type){case"select":case"descriptive-select":case"radio-group":i=me(),t.required&&(i=i.required(`${t.label??s} is required`));break;case"number":case"slider":{let a=at().typeError(`${t.label??s} must be a number`);t.min!=null&&(a=a.min(t.min,`${t.label??s} must be at least ${t.min}`)),t.max!=null&&(a=a.max(t.max,`${t.label??s} must be at most ${t.max}`)),t.required&&(a=a.required(`${t.label??s} is required`)),i=a;break}case"toggle":case"checkbox":i=nt(),t.required&&(i=i.oneOf([!0],`${t.label??s} must be checked`));break;case"array":case"tags":{let a=ft();t.required&&(a=a.min(1,`${t.label??s} must have at least one item`)),t.maxTags!=null&&(a=a.max(t.maxTags,`${t.label??s} can have at most ${t.maxTags} items`)),i=a;break}case"object":case"schema":{const a=t.children??[];i=a.length>0?we(a):_e(),t.required&&(i=i.required(`${t.label??s} is required`));break}case"date":case"datetime":case"time":{let a=me();t.required&&(a=a.required(`${t.label??s} is required`)),i=a;break}default:{const a=t.inputType;let c=me();a==="email"?c=c.email(`${t.label??s} must be a valid email address`):a==="url"&&(c=c.url(`${t.label??s} must be a valid URL`));const u=t.minLength,f=t.maxLength;u!=null&&(c=c.min(u,`${t.label??s} must be at least ${u} characters`)),f!=null&&(c=c.max(f,`${t.label??s} must be at most ${f} characters`)),t.required&&(c=c.trim().required(`${t.label??s} is required`)),i=c;break}}e[s]=i}return _e().shape(e)}function jr({schema:r,initialValues:e,onSubmit:t,showErrorsImmediately:s=!1}){const i=r.fields??[],l=b.useMemo(()=>we(i),[i]),a=b.useMemo(()=>{if(s)return i.reduce((m,v)=>{const j=B.resolveFieldKey(v);return j&&(m[j]=!0),m},{})},[i,s]),[c,u]=b.useState({}),[f,h]=b.useState({}),x=b.useRef(e);b.useEffect(()=>{x.current!==e&&(x.current=e,u({}),h({}))},[e]);const p=wt.useFormik({initialValues:e,validationSchema:l,initialTouched:a,validateOnMount:s,validateOnChange:!0,validateOnBlur:!0,enableReinitialize:!0,onSubmit:async m=>{const v=B.buildEvaluationPayload({values:m,conditionConfig:f});await t(m,v)}}),d=b.useCallback(()=>{p.submitForm()},[p]),g=b.useCallback(m=>{p.resetForm(m?{values:m}:void 0),u({}),h({})},[p]);return{values:p.values,errors:p.errors,isValid:p.isValid,isDirty:p.dirty,isSubmitting:p.isSubmitting,formulaConfig:c,conditionConfig:f,submit:d,reset:g,setFieldValue:p.setFieldValue,_schema:r,_formik:p,_formulaConfig:c,_onFormulaConfigChange:u,_conditionConfig:f,_onConditionConfigChange:h}}const mt=Se.getTypeOptions(),k="form-control font-14",w="text-14 text-dark fw-medium mb-1 align-items-center d-flex gap-1",H={fontSize:10,fontWeight:700,color:"#94a3b8",textTransform:"uppercase",letterSpacing:.6,marginBottom:8,display:"block"},Sr=[{value:"text",label:"Text"},{value:"number",label:"Number"},{value:"email",label:"Email"},{value:"url",label:"URL"},{value:"password",label:"Password"},{value:"select",label:"Select"},{value:"object",label:"Object (sub-fields)"},{value:"array",label:"Array (nested)"}],wr=[{value:3,label:"1/4"},{value:4,label:"1/3"},{value:6,label:"1/2"},{value:8,label:"2/3"},{value:12,label:"Full"}];function kr({value:r,onChange:e}){const t=r??12;return n.jsxs(o.Box,{children:[n.jsx("span",{className:w,children:"Column width"}),n.jsx(o.Box,{sx:{display:"flex",gap:.5},children:wr.map(s=>n.jsx(o.Tooltip,{title:`colSpan: ${s.value}`,placement:"top",children:n.jsx(o.Box,{component:"button",onClick:()=>e(s.value),sx:{flex:1,border:"1px solid",borderColor:t===s.value?"#6366f1":"#dee2e6",borderRadius:"6px",cursor:"pointer",bgcolor:t===s.value?"#eef2ff":"#fff",color:t===s.value?"#6366f1":"#6c757d",fontSize:11,fontWeight:600,py:.6,px:0,"&:hover":{borderColor:"#6366f1",bgcolor:"#f5f3ff"}},children:s.label})},s.value))}),n.jsx(o.Box,{sx:{display:"flex",gap:"3px",mt:.75},children:Array.from({length:12}).map((s,i)=>n.jsx(o.Box,{sx:{flex:1,height:4,borderRadius:"2px",bgcolor:i<t?"#6366f1":"#e2e8f0",transition:"background 0.12s"}},i))})]})}function bt({options:r=[],onChange:e}){function t(s,i,l){e(r.map((a,c)=>c===s?{...a,[i]:l}:a))}return n.jsxs(o.Box,{children:[n.jsxs("span",{className:w,children:["Options ",n.jsx("span",{style:{color:"#dc3545"},children:"*"})]}),n.jsx(o.Box,{sx:{display:"flex",flexDirection:"column",gap:.5,mb:.75},children:r.map((s,i)=>n.jsxs(o.Box,{sx:{display:"flex",gap:.5,alignItems:"center"},children:[n.jsx("input",{className:k,style:{flex:1},placeholder:"Label",value:s.label,onChange:l=>t(i,"label",l.target.value)}),n.jsx("input",{className:k,style:{flex:1},placeholder:"Value",value:s.value,onChange:l=>t(i,"value",l.target.value)}),n.jsx(o.Box,{component:"button",onClick:()=>e(r.filter((l,a)=>a!==i)),sx:{background:"none",border:"none",cursor:"pointer",color:"#94a3b8",display:"flex",p:.25,"&:hover":{color:"#dc2626"}},children:n.jsx(E.MdClose,{size:13})})]},i))}),n.jsxs(o.Box,{component:"button",onClick:()=>e([...r,{label:"",value:""}]),sx:{display:"flex",alignItems:"center",gap:.5,background:"none",border:"1px dashed #dee2e6",cursor:"pointer",fontSize:11,fontWeight:600,px:1,py:.5,borderRadius:"6px",color:"#6366f1",width:"100%","&:hover":{borderColor:"#6366f1",bgcolor:"#f5f3ff"}},children:[n.jsx(E.MdAdd,{size:13})," Add option"]})]})}const gt=[{value:"operator",label:"Operator (predefined)"},{value:"select",label:"Select"},{value:"text",label:"Text"}];function Tr({col:r,onChange:e,onDelete:t}){const s=r.type==="select",i=r.type==="operator";return n.jsxs(o.Box,{sx:{border:"1px solid #e2e8f0",borderRadius:"7px",p:1.25,bgcolor:"#fff",display:"flex",flexDirection:"column",gap:1},children:[n.jsxs(o.Box,{sx:{display:"flex",alignItems:"center",gap:.75},children:[n.jsx(o.Box,{sx:{fontSize:10,fontWeight:700,px:.75,py:.2,borderRadius:"4px",bgcolor:i?"#fef9c3":"#eef2ff",color:i?"#92400e":"#6366f1",flexShrink:0},children:i?"OPERATOR":r.type.toUpperCase()}),n.jsx(o.Box,{sx:{fontSize:12,fontWeight:600,color:"#0f172a",flex:1},children:r.label||r.id||"Unnamed"}),n.jsx(o.Box,{component:"button",onClick:t,sx:{background:"none",border:"none",cursor:"pointer",color:"#94a3b8",display:"flex",p:.25,"&:hover":{color:"#dc2626"}},children:n.jsx(E.MdClose,{size:13})})]}),n.jsxs(o.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:1},children:[n.jsxs(o.Box,{children:[n.jsx("label",{className:w,children:"Column type"}),n.jsx("select",{value:r.type,onChange:l=>e({...r,type:l.target.value,options:void 0}),className:k,style:{cursor:"pointer"},children:gt.map(l=>n.jsx("option",{value:l.value,children:l.label},l.value))})]}),n.jsxs(o.Box,{children:[n.jsxs("label",{className:w,children:["Column key ",n.jsx("span",{style:{color:"#dc3545"},children:"*"})]}),n.jsx("input",{className:`${k} ${r.id?"":"border-danger"}`,value:r.id,onChange:l=>e({...r,id:l.target.value}),placeholder:"e.g. field, operator, value"}),!r.id&&n.jsx("span",{style:{fontSize:10,color:"#dc3545"},children:"Required — used as data key"})]})]}),!i&&n.jsxs(o.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:1},children:[n.jsxs(o.Box,{children:[n.jsx("label",{className:w,children:"Label"}),n.jsx("input",{className:k,value:r.label??"",onChange:l=>e({...r,label:l.target.value||void 0}),placeholder:"Column label"})]}),n.jsxs(o.Box,{children:[n.jsx("label",{className:w,children:"Placeholder"}),n.jsx("input",{className:k,value:r.placeholder??"",onChange:l=>e({...r,placeholder:l.target.value||void 0}),placeholder:"Hint…"})]})]}),s&&n.jsx(bt,{options:r.options??[],onChange:l=>e({...r,options:l})}),i&&n.jsx(o.Box,{sx:{bgcolor:"#fefce8",border:"1px solid #fef08a",borderRadius:"6px",px:1.25,py:.75},children:n.jsx(o.Box,{sx:{fontSize:11,color:"#78350f"},children:"Predefined: equals, not equals, contains, starts with, ends with, is present, is not present, greater than, less than…"})}),!i&&n.jsxs(o.Box,{sx:{display:"flex",alignItems:"center",gap:.75},children:[n.jsx("input",{type:"checkbox",id:`formula-${r.id}`,checked:!!r.formula,onChange:l=>e({...r,formula:l.target.checked||void 0}),style:{cursor:"pointer",width:14,height:14}}),n.jsx("label",{htmlFor:`formula-${r.id}`,className:w,style:{margin:0,cursor:"pointer"},children:"Formula input (chip editor)"})]})]})}function Cr({condition:r,onChange:e}){const t=!!r;function s(){e(t?void 0:{fields:[]})}function i(c){if(!r)return;const u=c==="operator"?"operator":r.fields.filter(f=>f.type!=="operator").length===0?"field":"value";e({...r,fields:[...r.fields,{id:u,type:c}]})}function l(c,u){if(!r)return;const f=[...r.fields];f[c]=u,e({...r,fields:f})}function a(c){r&&e({...r,fields:r.fields.filter((u,f)=>f!==c)})}return n.jsxs(o.Box,{sx:{borderTop:"1px solid #e2e8f0",pt:1.5},children:[n.jsxs(o.Box,{sx:{display:"flex",alignItems:"center",gap:.75,mb:t?1.25:0},children:[n.jsx("input",{type:"checkbox",id:"enable-condition",checked:t,onChange:s,style:{cursor:"pointer",width:14,height:14}}),n.jsx("span",{style:{...H,margin:0,color:t?"#6366f1":"#94a3b8"},children:"Condition row"})]}),t&&r&&n.jsxs(o.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:[r.fields.map((c,u)=>n.jsx(Tr,{col:c,onChange:f=>l(u,f),onDelete:()=>a(u)},u)),n.jsx(o.Box,{sx:{display:"flex",gap:.5},children:gt.map(c=>n.jsxs(o.Box,{component:"button",onClick:()=>i(c.value),sx:{flex:1,background:"none",border:"1px dashed #dee2e6",cursor:"pointer",fontSize:11,fontWeight:600,py:.5,borderRadius:"6px",color:c.value==="operator"?"#92400e":"#6366f1","&:hover":{borderColor:"#6366f1",bgcolor:"#f5f3ff"}},children:["+ ",c.value==="operator"?"Operator":c.label.split(" ")[0]]},c.value))}),n.jsxs(o.Box,{sx:{display:"flex",alignItems:"center",gap:2,flexWrap:"wrap"},children:[n.jsxs(o.Box,{sx:{display:"flex",alignItems:"center",gap:.75},children:[n.jsx("input",{type:"checkbox",id:"allow-groups",checked:!!r.allowGroups,onChange:c=>e({...r,allowGroups:c.target.checked||void 0}),style:{cursor:"pointer",width:14,height:14}}),n.jsx("label",{htmlFor:"allow-groups",className:w,style:{margin:0,cursor:"pointer"},children:"Allow nested groups"})]}),r.allowGroups&&n.jsxs(o.Box,{sx:{display:"flex",alignItems:"center",gap:.75},children:[n.jsx("label",{className:w,style:{margin:0},children:"Max depth"}),n.jsx("input",{type:"number",min:1,max:5,className:k,style:{width:60,textAlign:"center"},value:r.maxGroupDepth??"",onChange:c=>e({...r,maxGroupDepth:c.target.value?Number(c.target.value):void 0}),placeholder:"∞"})]})]})]})]})}function le({id:r,label:e,checked:t,onChange:s}){return n.jsxs(o.Box,{sx:{display:"flex",alignItems:"center",gap:.75},children:[n.jsx("input",{type:"checkbox",id:r,checked:t,onChange:i=>s(i.target.checked),style:{cursor:"pointer",width:14,height:14,flexShrink:0}}),n.jsx("label",{htmlFor:r,className:w,style:{margin:0,cursor:"pointer"},children:e})]})}function Fr({views:r=[],onChange:e}){function t(i,l,a){e(r.map((c,u)=>u===i?{...c,[l]:a}:c))}function s(){const i=`tab${r.length+1}`;e([...r,{id:i,label:`Tab ${r.length+1}`}])}return n.jsxs(o.Box,{children:[n.jsx("span",{className:w,children:"Views"}),n.jsx(o.Box,{sx:{display:"flex",flexDirection:"column",gap:.5,mb:.75},children:r.map((i,l)=>n.jsxs(o.Box,{sx:{display:"flex",gap:.5,alignItems:"center"},children:[n.jsx("input",{className:k,style:{flex:1},placeholder:"Label",value:i.label,onChange:a=>t(l,"label",a.target.value)}),n.jsx("input",{className:k,style:{flex:1},placeholder:"ID (no spaces)",value:i.id,onChange:a=>t(l,"id",a.target.value.replace(/\s/g,"_"))}),n.jsx(o.Box,{component:"button",onClick:()=>e(r.filter((a,c)=>c!==l)),sx:{background:"none",border:"none",cursor:"pointer",color:"#94a3b8",display:"flex",p:.25,"&:hover":{color:"#dc2626"}},children:n.jsx(E.MdClose,{size:13})})]},l))}),n.jsxs(o.Box,{component:"button",onClick:s,sx:{display:"flex",alignItems:"center",gap:.5,background:"none",border:"1px dashed #dee2e6",cursor:"pointer",fontSize:11,fontWeight:600,px:1,py:.5,borderRadius:"6px",color:"#6366f1",width:"100%","&:hover":{borderColor:"#6366f1",bgcolor:"#f5f3ff"}},children:[n.jsx(E.MdAdd,{size:13})," Add view"]})]})}function pe({label:r,value:e,options:t,onChange:s}){return n.jsxs(o.Box,{children:[n.jsx("span",{className:w,children:r}),n.jsx(o.Box,{sx:{display:"flex",border:"1px solid #dee2e6",borderRadius:"7px",overflow:"hidden"},children:t.map(i=>n.jsx(o.Box,{component:"button",onClick:()=>s(i.value),sx:{flex:1,border:"none",borderRight:"1px solid #dee2e6",cursor:"pointer",fontSize:12,fontWeight:600,py:.6,bgcolor:e===i.value?"#eef2ff":"#fff",color:e===i.value?"#6366f1":"#6c757d","&:last-child":{borderRight:"none"},"&:hover":{bgcolor:"#f5f3ff"}},children:i.label},i.value))})]})}function yt({field:r,onChange:e,onSave:t,onCancel:s,noFooter:i}){const[l,a]=b.useState(!1),c=r.id??r.name??"",u=r,f=r.type==="select"||r.type==="descriptive-select"||r.type==="radio-group",h=Se.get(r.type),x=h==null?void 0:h.configSchema;function p(d,g){e({...r,[d]:g})}return n.jsxs(n.Fragment,{children:[n.jsxs(o.Box,{sx:{flex:1,overflowY:"auto",px:2.5,py:2,display:"flex",flexDirection:"column",gap:1.75},children:[n.jsxs(o.Box,{children:[n.jsx("span",{style:H,children:"Required"}),n.jsxs(o.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:[n.jsxs(o.Box,{children:[n.jsx("label",{className:w,children:"Type"}),n.jsx("select",{value:r.type,onChange:d=>p("type",d.target.value),className:k,style:{cursor:"pointer"},children:mt.map(d=>n.jsx("option",{value:d.value,children:d.label},d.value))})]}),n.jsxs(o.Box,{sx:{display:"grid",gridTemplateColumns:r.type==="tabs"?"1fr":"1fr 1fr",gap:1},children:[n.jsxs(o.Box,{children:[n.jsxs("label",{className:w,children:["Field ID ",n.jsx("span",{style:{color:"#dc3545"},children:"*"})]}),n.jsx("input",{className:k,value:r.id??r.name??"",onChange:d=>p("id",d.target.value),placeholder:"e.g. email"})]}),r.type!=="tabs"&&n.jsxs(o.Box,{children:[n.jsxs("label",{className:w,children:["Label ",n.jsx("span",{style:{color:"#dc3545"},children:"*"})]}),n.jsx("input",{className:k,value:r.label??"",onChange:d=>p("label",d.target.value),placeholder:"Display label"})]})]}),r.type!=="tabs"&&n.jsx(kr,{value:r.colSpan,onChange:d=>p("colSpan",d===12?void 0:d)})]})]}),x&&n.jsxs(o.Box,{sx:{borderTop:"1px solid #e2e8f0",pt:1.5},children:[n.jsx("span",{style:H,children:"Specific Settings"}),n.jsx(B.FlowForm,{schema:{layout:"flat",compact:!0,fields:x.fields},initialValues:r,onValuesChange:d=>e({...r,...d}),onSubmit:()=>{}})]}),r.type==="tabs"&&n.jsxs(o.Box,{sx:{borderTop:"1px solid #e2e8f0",pt:1.5,display:"flex",flexDirection:"column",gap:1.5},children:[n.jsx("span",{style:H,children:"Content"}),n.jsx(Fr,{views:(u.tabs??[]).map(d=>({id:d.id,label:d.label})),onChange:d=>{const g=u.tabs??[],m=d.map(v=>{const j=g.find(C=>C.id===v.id);return j?{...j,...v}:{...v,fields:[]}});e({...r,tabs:m})}}),n.jsx("span",{style:{...H,marginTop:4},children:"Interaction"}),n.jsxs(o.Box,{children:[n.jsx("label",{className:w,children:"Disabled"}),n.jsx("input",{className:k,value:u.disabledExpr??"",onChange:d=>e({...r,disabledExpr:d.target.value||void 0}),placeholder:"false"})]}),n.jsx("span",{style:{...H,marginTop:4},children:"Appearance"}),n.jsx(pe,{label:"Alignment",value:u.alignment??"left",options:[{value:"left",label:"|←"},{value:"center-left",label:"←|"},{value:"center",label:"|·|"},{value:"center-right",label:"|→"},{value:"right",label:"→|"}],onChange:d=>e({...r,alignment:d})}),n.jsxs(o.Box,{children:[n.jsx("label",{className:w,children:"Hidden"}),n.jsx("input",{className:k,value:u.hiddenExpr??"",onChange:d=>e({...r,hiddenExpr:d.target.value||void 0}),placeholder:"false"})]}),n.jsx(pe,{label:"Variant",value:u.variant??"line",options:[{value:"pill",label:"Pill"},{value:"line",label:"Line"}],onChange:d=>e({...r,variant:d})}),n.jsxs(o.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:1},children:[n.jsxs(o.Box,{children:[n.jsx("label",{className:w,children:"Active color"}),n.jsxs(o.Box,{sx:{display:"flex",alignItems:"center",gap:.5},children:[n.jsx("input",{type:"color",value:u.activeColor??"#6366f1",onChange:d=>e({...r,activeColor:d.target.value}),style:{width:28,height:28,border:"1px solid #dee2e6",borderRadius:6,cursor:"pointer",padding:2,background:"#fff"}}),n.jsx("input",{className:k,value:u.activeColor??"",onChange:d=>e({...r,activeColor:d.target.value||void 0}),placeholder:"#6366f1",style:{flex:1}})]})]}),n.jsxs(o.Box,{children:[n.jsx("label",{className:w,children:"Active text"}),n.jsxs(o.Box,{sx:{display:"flex",alignItems:"center",gap:.5},children:[n.jsx("input",{type:"color",value:u.activeTextColor??"#ffffff",onChange:d=>e({...r,activeTextColor:d.target.value}),style:{width:28,height:28,border:"1px solid #dee2e6",borderRadius:6,cursor:"pointer",padding:2,background:"#fff"}}),n.jsx("input",{className:k,value:u.activeTextColor??"",onChange:d=>e({...r,activeTextColor:d.target.value||void 0}),placeholder:"auto",style:{flex:1}})]})]}),n.jsxs(o.Box,{children:[n.jsx("label",{className:w,children:"Inactive text"}),n.jsxs(o.Box,{sx:{display:"flex",alignItems:"center",gap:.5},children:[n.jsx("input",{type:"color",value:u.inactiveTextColor??"#64748b",onChange:d=>e({...r,inactiveTextColor:d.target.value}),style:{width:28,height:28,border:"1px solid #dee2e6",borderRadius:6,cursor:"pointer",padding:2,background:"#fff"}}),n.jsx("input",{className:k,value:u.inactiveTextColor??"",onChange:d=>e({...r,inactiveTextColor:d.target.value||void 0}),placeholder:"#64748b",style:{flex:1}})]})]})]}),n.jsxs(o.Box,{children:[n.jsx("label",{className:w,children:"Styles"}),n.jsx("input",{className:k,value:u.styles??"",onChange:d=>e({...r,styles:d.target.value||void 0}),placeholder:"None"})]}),n.jsx("span",{style:{...H,marginTop:4},children:"Spacing"}),n.jsx(pe,{label:"Height",value:u.height??"auto",options:[{value:"auto",label:"Auto"},{value:"fixed",label:"Fixed"}],onChange:d=>e({...r,height:d})}),n.jsx(pe,{label:"Margin",value:u.margin??"normal",options:[{value:"normal",label:"Normal"},{value:"none",label:"None"}],onChange:d=>e({...r,margin:d})})]}),f&&n.jsxs(o.Box,{sx:{borderTop:"1px solid #e2e8f0",pt:1.5},children:[n.jsx("span",{style:H,children:"Options"}),n.jsx(bt,{options:u.options??[],onChange:d=>e({...r,options:d})})]}),r.type==="array"&&n.jsxs(o.Box,{sx:{borderTop:"1px solid #e2e8f0",pt:1.5,display:"flex",flexDirection:"column",gap:1},children:[n.jsx("span",{style:H,children:"Array settings"}),n.jsxs(o.Box,{children:[n.jsx("label",{className:w,children:"Item type"}),n.jsx("select",{className:k,style:{cursor:"pointer"},value:u.itemType??"text",onChange:d=>e({...r,itemType:d.target.value}),children:Sr.map(d=>n.jsx("option",{value:d.value,children:d.label},d.value))})]}),n.jsxs(o.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:1},children:[n.jsxs(o.Box,{children:[n.jsx("label",{className:w,children:"Item label"}),n.jsx("input",{className:k,value:u.itemLabel??"",onChange:d=>e({...r,itemLabel:d.target.value||void 0}),placeholder:'e.g. "Member"'})]}),n.jsxs(o.Box,{children:[n.jsx("label",{className:w,children:"Add button label"}),n.jsx("input",{className:k,value:u.addLabel??"",onChange:d=>e({...r,addLabel:d.target.value||void 0}),placeholder:"Add item"})]})]}),n.jsxs(o.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:1},children:[n.jsxs(o.Box,{children:[n.jsx("label",{className:w,children:"Min items"}),n.jsx("input",{type:"number",min:0,className:k,value:u.minItems??"",onChange:d=>e({...r,minItems:d.target.value?Number(d.target.value):void 0}),placeholder:"0"})]}),n.jsxs(o.Box,{children:[n.jsx("label",{className:w,children:"Max items"}),n.jsx("input",{type:"number",min:1,className:k,value:u.maxItems??"",onChange:d=>e({...r,maxItems:d.target.value?Number(d.target.value):void 0}),placeholder:"∞"})]})]}),!["object","array","select"].includes(u.itemType??"text")&&n.jsxs(o.Box,{children:[n.jsx("label",{className:w,children:"Item placeholder"}),n.jsx("input",{className:k,value:u.itemPlaceholder??"",onChange:d=>e({...r,itemPlaceholder:d.target.value||void 0}),placeholder:"Enter value…"})]})]}),n.jsx(Cr,{condition:r.condition,onChange:d=>e({...r,condition:d})}),n.jsxs(o.Box,{sx:{borderTop:"1px solid #e2e8f0",pt:1.5},children:[n.jsx(o.Box,{component:"button",onClick:()=>a(d=>!d),sx:{background:"none",border:"none",cursor:"pointer",display:"flex",alignItems:"center",gap:.5,p:0,mb:l?1.25:0},children:n.jsxs("span",{style:{...H,margin:0,color:l?"#6366f1":"#94a3b8"},children:[l?"▾":"▸"," Optional settings"]})}),n.jsx(o.Collapse,{in:l,children:n.jsxs(o.Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[n.jsxs(o.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:1},children:[n.jsxs(o.Box,{children:[n.jsx("label",{className:w,children:"Placeholder"}),n.jsx("input",{className:k,value:r.placeholder??"",onChange:d=>p("placeholder",d.target.value||void 0),placeholder:"Hint text…"})]}),n.jsxs(o.Box,{children:[n.jsx("label",{className:w,children:"Helper text"}),n.jsx("input",{className:k,value:r.helperText??"",onChange:d=>p("helperText",d.target.value||void 0),placeholder:"Description…"})]})]}),n.jsxs(o.Box,{children:[n.jsx("label",{className:w,children:"Info tooltip"}),n.jsx("input",{className:k,value:r.info??"",onChange:d=>p("info",d.target.value||void 0),placeholder:"Shown in ℹ tooltip"})]}),n.jsxs(o.Box,{sx:{display:"flex",flexWrap:"wrap",gap:1.5},children:[n.jsx(le,{id:`${c}-req`,label:"Required",checked:!!r.required,onChange:d=>p("required",d||void 0)}),n.jsx(le,{id:`${c}-dis`,label:"Disabled",checked:!!r.disabled,onChange:d=>p("disabled",d||void 0)}),n.jsx(le,{id:`${c}-hid`,label:"Hidden",checked:!!r.hidden,onChange:d=>p("hidden",d||void 0)}),n.jsx(le,{id:`${c}-opt`,label:"Show optional",checked:!!r.showOptional,onChange:d=>p("showOptional",d||void 0)}),n.jsx(le,{id:`${c}-div`,label:"Divider after",checked:!!r.dividerAfter,onChange:d=>p("dividerAfter",d||void 0)}),n.jsx(le,{id:`${c}-frm`,label:"Formula input",checked:!!r.formula,onChange:d=>p("formula",d||void 0)})]})]})})]})]}),!i&&n.jsxs(o.Box,{sx:{borderTop:"1px solid #e2e8f0",px:2.5,py:1.5,display:"flex",gap:1,justifyContent:"flex-end",bgcolor:"#f8fafc",flexShrink:0},children:[n.jsx(o.Box,{component:"button",onClick:s,sx:{background:"none",border:"1px solid #dee2e6",cursor:"pointer",fontSize:13,fontWeight:500,px:2,py:.75,borderRadius:"7px",color:"#6c757d","&:hover":{bgcolor:"#f8f9fa"}},children:"Cancel"}),n.jsxs(o.Box,{component:"button",onClick:t,sx:{border:"none",cursor:"pointer",fontSize:13,fontWeight:600,px:2.5,py:.75,borderRadius:"7px",bgcolor:"#6366f1",color:"#fff",display:"flex",alignItems:"center",gap:.75,"&:hover":{bgcolor:"#4f46e5"}},children:[n.jsx(E.MdCheck,{size:15})," Save"]})]})]})}const ge={text:"#0f172a",textMuted:"#64748b",borderInput:"rgba(0,0,0,0.23)",bg:"#ffffff"},Or={md:"6px"},vt={sm:11,md:13},Ce={width:"100%",fontSize:vt.md,fontFamily:"inherit",padding:"8px 12px",border:`1px solid ${ge.borderInput}`,borderRadius:Or.md,outline:"none",background:ge.bg,color:ge.text,boxSizing:"border-box",transition:"border-color 0.15s, box-shadow 0.15s"};function He(){return{type:"text",id:"",label:"",colSpan:12}}function Er(r){return r.type==="object"||r.type==="array"||r.type==="schema"}function $r(r){if(r.type==="object")return"Child Fields";if(r.type==="schema")return"Schema Fields";const e=r.itemType??"text";return e==="object"?"Item Fields":e==="select"?"Item Options":"Item Config"}function _r({field:r,onChange:e}){var i;const t=r,s=t.itemType??"text";if(r.type==="object")return n.jsxs(o.Box,{sx:{p:2.5},children:[n.jsx(o.Typography,{sx:{fontSize:12,color:"#64748b",mb:2},children:"Define the fields nested inside this object. Each child field can itself be an object or array."}),n.jsx(de,{value:r.children??[],onChange:l=>e({...r,children:l}),label:"Child fields"})]});if(r.type==="schema")return n.jsxs(o.Box,{sx:{p:2.5},children:[n.jsx(o.Typography,{sx:{fontSize:12,color:"#64748b",mb:2},children:"Define the fields inside this schema. When the form is filled, their values are collected into a single object as this field's value."}),n.jsx(de,{value:r.children??[],onChange:l=>e({...r,children:l}),label:"Schema fields"})]});if(r.type==="array"){if(s==="object")return n.jsxs(o.Box,{sx:{p:2.5},children:[n.jsx(o.Typography,{sx:{fontSize:12,color:"#64748b",mb:2},children:"Define the fields for each item in the array. Each item will be an object with these fields."}),n.jsx(de,{value:t.itemFields??[],onChange:l=>e({...r,itemFields:l}),label:"Item fields"})]});if(s==="select"){const l=t.itemOptions??[];return n.jsxs(o.Box,{sx:{p:2.5},children:[n.jsx(o.Typography,{sx:{fontSize:12,color:"#64748b",mb:2},children:"Options available in each select item."}),n.jsx(o.Box,{sx:{display:"flex",flexDirection:"column",gap:.5,mb:.75},children:l.map((a,c)=>n.jsxs(o.Box,{sx:{display:"flex",gap:.5,alignItems:"center"},children:[n.jsx("input",{style:{...Ce,flex:1,padding:"6px 10px"},placeholder:"Label",value:a.label,onChange:u=>{const f=l.map((h,x)=>x===c?{...h,label:u.target.value}:h);e({...r,itemOptions:f})}}),n.jsx("input",{style:{...Ce,flex:1,padding:"6px 10px"},placeholder:"Value",value:a.value,onChange:u=>{const f=l.map((h,x)=>x===c?{...h,value:u.target.value}:h);e({...r,itemOptions:f})}}),n.jsx(o.Box,{component:"button",onClick:()=>e({...r,itemOptions:l.filter((u,f)=>f!==c)}),sx:{background:"none",border:"none",cursor:"pointer",color:"#94a3b8",display:"flex",p:.25,"&:hover":{color:"#dc2626"}},children:"✕"})]},c))}),n.jsx(o.Box,{component:"button",onClick:()=>e({...r,itemOptions:[...l,{label:"",value:""}]}),sx:{display:"flex",alignItems:"center",gap:.5,background:"none",border:"1px dashed #dee2e6",cursor:"pointer",fontSize:11,fontWeight:600,px:1,py:.5,borderRadius:"6px",color:"#6366f1",width:"100%",justifyContent:"center","&:hover":{borderColor:"#6366f1",bgcolor:"#f5f3ff"}},children:"+ Add option"})]})}if(s==="array"){const l=((i=t.itemSchema)==null?void 0:i.itemType)??"text",a=[{value:"text",label:"Text"},{value:"number",label:"Number"},{value:"email",label:"Email"},{value:"url",label:"URL"},{value:"password",label:"Password"},{value:"select",label:"Select"},{value:"object",label:"Object"}];return n.jsxs(o.Box,{sx:{p:2.5},children:[n.jsx(o.Typography,{sx:{fontSize:12,color:"#64748b",mb:2},children:"Each item is itself an array. Configure the type of items inside the nested array."}),n.jsx("label",{style:{fontSize:vt.sm,fontWeight:600,color:ge.textMuted,display:"block",marginBottom:3},children:"Nested item type"}),n.jsx("select",{style:{...Ce,padding:"6px 10px",cursor:"pointer"},value:l,onChange:c=>e({...r,itemSchema:{...t.itemSchema??{},itemType:c.target.value}}),children:a.map(c=>n.jsx("option",{value:c.value,children:c.label},c.value))})]})}return n.jsx(o.Box,{sx:{p:2.5},children:n.jsxs(o.Box,{sx:{border:"1.5px dashed #e2e8f0",borderRadius:"8px",py:3,textAlign:"center"},children:[n.jsxs(o.Typography,{sx:{fontSize:13,color:"#94a3b8"},children:["No extra configuration needed for ",n.jsx("strong",{children:s})," items."]}),n.jsx(o.Typography,{sx:{fontSize:11,color:"#cbd5e1",mt:.5},children:"Item placeholder and labels are set in the previous step."})]})})}return null}function Br({field:r}){var a;const[e,t]=b.useState({}),s=r.id??r.name??"preview",i=[{value:3,label:"1/4"},{value:4,label:"1/3"},{value:6,label:"1/2"},{value:8,label:"2/3"},{value:12,label:"Full"}],l=r.colSpan&&r.colSpan<12?((a=i.find(c=>c.value===r.colSpan))==null?void 0:a.label)??r.colSpan:"Full";return n.jsxs(o.Box,{sx:{p:2.5},children:[n.jsxs(o.Box,{sx:{display:"flex",alignItems:"center",mb:2,px:1.25,py:.75,bgcolor:"#f0fdf4",border:"1px solid #bbf7d0",borderRadius:"7px"},children:[n.jsx(o.Typography,{sx:{fontSize:11,color:"#15803d",fontWeight:500,flex:1},children:"Live preview — interact to test the field"}),n.jsxs(o.Typography,{sx:{fontSize:11,color:"#64748b"},children:["Width: ",l]})]}),n.jsx(B.FlowForm,{schema:{layout:"flat",fields:[r]},initialValues:{[s]:r.type==="array"?[]:r.type==="object"||r.type==="schema"?{}:""},onSubmit:()=>{},conditionConfig:e,onConditionConfigChange:t})]})}function Be({open:r,initial:e,onSave:t,onClose:s,editMode:i=!1}){const[l,a]=b.useState(1),[c,u]=b.useState(()=>e??He());function f(){u(e??He()),a(1)}const h=Er(c),x=h?3:2,p=h?["Configure",$r(c),"Preview"]:["Configure","Preview"],d=!!(c.id||c.name)&&!!c.type;function g(){a(F=>Math.min(F+1,x))}function m(){a(F=>Math.max(F-1,1))}function v(){t(c),s()}const j=l-1,C=l===x,_=h&&l===3||!h&&l===2;return n.jsxs(o.Dialog,{open:r,onClose:s,TransitionProps:{onEnter:f},maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{borderRadius:"12px",overflow:"hidden",display:"flex",flexDirection:"column",maxHeight:"90vh"}},children:[n.jsxs(o.Box,{sx:{px:2.5,pt:1.75,pb:0,borderBottom:"1px solid #e2e8f0",flexShrink:0},children:[n.jsxs(o.Box,{sx:{display:"flex",alignItems:"center",mb:1.5},children:[n.jsx(o.Typography,{sx:{fontSize:14,fontWeight:700,color:"#0f172a",flex:1},children:i?"Edit Field":"Add Field"}),n.jsx(o.IconButton,{size:"small",onClick:s,sx:{color:"#94a3b8"},children:n.jsx(E.MdClose,{size:17})})]}),n.jsx(o.Stepper,{activeStep:j,sx:{pb:1.5},children:p.map((F,z)=>n.jsx(o.Step,{completed:j>z,children:n.jsx(o.StepLabel,{children:F})},F))})]}),n.jsxs(o.Box,{sx:{flex:1,overflowY:"auto"},children:[l===1&&n.jsx(yt,{field:c,onChange:u,onSave:g,onCancel:s,noFooter:!0}),l===2&&h&&n.jsx(_r,{field:c,onChange:u}),_&&n.jsx(Br,{field:c})]}),n.jsxs(o.Box,{sx:{borderTop:"1px solid #e2e8f0",px:2.5,py:1.5,display:"flex",alignItems:"center",gap:1,flexShrink:0,bgcolor:"#f8fafc"},children:[l>1&&n.jsxs(o.Box,{component:"button",onClick:m,sx:{display:"flex",alignItems:"center",gap:.5,background:"none",border:"none",cursor:"pointer",fontSize:13,fontWeight:500,color:"#6c757d",px:0,"&:hover":{color:"#0f172a"}},children:[n.jsx(E.MdArrowBack,{size:14})," Back"]}),n.jsx(o.Box,{sx:{flex:1}}),n.jsx(o.Box,{component:"button",onClick:s,sx:{background:"none",border:"1px solid #dee2e6",cursor:"pointer",fontSize:13,fontWeight:500,px:2,py:.75,borderRadius:"7px",color:"#6c757d","&:hover":{bgcolor:"#f8f9fa"}},children:"Cancel"}),C?n.jsxs(o.Box,{component:"button",onClick:v,sx:{border:"none",cursor:"pointer",fontSize:13,fontWeight:600,px:2.5,py:.75,borderRadius:"7px",bgcolor:"#6366f1",color:"#fff",display:"flex",alignItems:"center",gap:.75,"&:hover":{bgcolor:"#4f46e5"}},children:[n.jsx(E.MdCheck,{size:15})," ",i?"Save changes":"Add field"]}):n.jsx(o.Box,{component:"button",onClick:g,disabled:!d,sx:{border:"none",cursor:d?"pointer":"not-allowed",fontSize:13,fontWeight:600,px:2.5,py:.75,borderRadius:"7px",bgcolor:d?"#6366f1":"#c7d2fe",color:"#fff","&:hover":{bgcolor:d?"#4f46e5":"#c7d2fe"}},children:"Next →"})]})]})}function Nr({field:r,index:e,total:t,onEdit:s,onDelete:i,onMoveUp:l,onMoveDown:a}){const c=r.label||r.id||r.name||"Untitled",u=r.id??r.name??"";return n.jsxs(o.Box,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,border:"1px solid #e2e8f0",borderRadius:"8px",bgcolor:"#fff"},children:[n.jsxs(o.Box,{sx:{display:"flex",flexDirection:"column",gap:.25,color:"#cbd5e1"},children:[n.jsx(o.Box,{component:"button",onClick:l,disabled:e===0,sx:{background:"none",border:"none",p:0,cursor:e===0?"default":"pointer",color:e===0?"#e2e8f0":"#94a3b8",lineHeight:1,fontSize:10,"&:hover":{color:e===0?"#e2e8f0":"#475569"}},children:"▲"}),n.jsx(o.Box,{component:"button",onClick:a,disabled:e===t-1,sx:{background:"none",border:"none",p:0,cursor:e===t-1?"default":"pointer",color:e===t-1?"#e2e8f0":"#94a3b8",lineHeight:1,fontSize:10,"&:hover":{color:e===t-1?"#e2e8f0":"#475569"}},children:"▼"})]}),n.jsx(o.Box,{sx:{fontSize:10,fontWeight:700,px:.75,py:.2,borderRadius:"4px",bgcolor:"#eef2ff",color:"#6366f1",flexShrink:0},children:r.type}),n.jsxs(o.Box,{sx:{flex:1,minWidth:0},children:[n.jsxs(o.Typography,{sx:{fontSize:13,fontWeight:600,color:"#0f172a",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[c,r.required&&n.jsx(o.Box,{component:"span",sx:{color:"#dc3545",ml:.25},children:"*"})]}),n.jsx(o.Typography,{sx:{fontSize:11,color:"#94a3b8",fontFamily:"monospace"},children:u})]}),n.jsx(o.Tooltip,{title:"Edit field",placement:"top",children:n.jsx(o.Box,{component:"button",onClick:s,sx:{background:"none",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:"6px",p:0,color:"#94a3b8","&:hover":{bgcolor:"#f1f5f9",color:"#475569"}},children:n.jsx(E.MdEdit,{size:14})})}),n.jsx(o.Tooltip,{title:"Remove field",placement:"top",children:n.jsx(o.Box,{component:"button",onClick:i,sx:{background:"none",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:"6px",p:0,color:"#94a3b8","&:hover":{bgcolor:"#fee2e2",color:"#dc2626"}},children:n.jsx(E.MdDeleteOutline,{size:16})})})]})}function Ar({open:r,value:e,onSave:t,onClose:s}){const[i,l]=b.useState(e),[a,c]=b.useState(null);function u(){l(e),c(null)}function f(g){l(m=>m.filter((v,j)=>j!==g))}function h(g,m){l(v=>{const j=[...v],C=g+m;return C<0||C>=j.length?v:([j[g],j[C]]=[j[C],j[g]],j)})}function x(g){a!==null&&(l(m=>{const v=[...m];return v[a]=g,v}),c(null))}function p(){t(i),s()}const d=JSON.stringify(i)!==JSON.stringify(e);return n.jsxs(n.Fragment,{children:[n.jsxs(o.Dialog,{open:r,onClose:s,TransitionProps:{onEnter:u},maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{borderRadius:"12px",overflow:"hidden",display:"flex",flexDirection:"column",maxHeight:"85vh"}},children:[n.jsxs(o.Box,{sx:{display:"flex",alignItems:"center",px:2.5,py:1.75,borderBottom:"1px solid #e2e8f0",flexShrink:0},children:[n.jsxs(o.Box,{sx:{flex:1},children:[n.jsx(o.Typography,{sx:{fontSize:14,fontWeight:700,color:"#0f172a"},children:"Edit Schema"}),n.jsxs(o.Typography,{sx:{fontSize:11,color:"#94a3b8"},children:[i.length," field",i.length!==1?"s":""," defined"]})]}),n.jsx(o.IconButton,{size:"small",onClick:s,sx:{color:"#94a3b8"},children:n.jsx(E.MdClose,{size:17})})]}),n.jsx(o.Box,{sx:{flex:1,overflowY:"auto",p:2.5},children:i.length===0?n.jsx(o.Box,{sx:{border:"1.5px dashed rgba(0,0,0,0.12)",borderRadius:"8px",py:4,textAlign:"center"},children:n.jsx(o.Typography,{sx:{fontSize:13,color:"#94a3b8"},children:"No fields defined yet"})}):n.jsx(o.Box,{sx:{display:"flex",flexDirection:"column",gap:.75},children:i.map((g,m)=>n.jsx(Nr,{field:g,index:m,total:i.length,onEdit:()=>c(m),onDelete:()=>f(m),onMoveUp:()=>h(m,-1),onMoveDown:()=>h(m,1)},`${g.id??g.name}-${m}`))})}),n.jsxs(o.Box,{sx:{borderTop:"1px solid #e2e8f0",px:2.5,py:1.5,display:"flex",alignItems:"center",gap:1,flexShrink:0,bgcolor:"#f8fafc"},children:[d?n.jsx(o.Typography,{sx:{fontSize:11,color:"#f59e0b",fontWeight:500,flex:1},children:"Unsaved changes"}):n.jsx(o.Box,{sx:{flex:1}}),n.jsx(o.Box,{component:"button",onClick:s,sx:{background:"none",border:"1px solid #dee2e6",cursor:"pointer",fontSize:13,fontWeight:500,px:2,py:.75,borderRadius:"7px",color:"#6c757d","&:hover":{bgcolor:"#f8f9fa"}},children:"Cancel"}),n.jsxs(o.Box,{component:"button",onClick:p,sx:{border:"none",cursor:"pointer",fontSize:13,fontWeight:600,px:2.5,py:.75,borderRadius:"7px",bgcolor:"#6366f1",color:"#fff",display:"flex",alignItems:"center",gap:.75,"&:hover":{bgcolor:"#4f46e5"}},children:[n.jsx(E.MdCheck,{size:15})," Done"]})]})]}),a!==null&&n.jsx(Be,{open:a!==null,initial:i[a],onSave:x,onClose:()=>c(null),editMode:!0})]})}function jt(r){const e={};for(const t of r){const s=t.id??t.name??"";s&&(t.type==="array"?e[s]=[]:t.type==="object"||t.type==="schema"?e[s]=jt(t.children??[]):e[s]="")}return e}function de({value:r,onChange:e,suggestions:t,label:s="Fields",onPayload:i,validate:l=!0,onValidityChange:a,variableGroups:c,initialValues:u,initialFormulaConfig:f,initialConditionConfig:h}){const[x,p]=b.useState(!1),[d,g]=b.useState(!1),[m,v]=b.useState(null),[j,C]=b.useState(f??{}),[_,F]=b.useState(h??{}),z=b.useRef(u??{}),q=b.useMemo(()=>jt(r),[r]),K=b.useMemo(()=>u&&Object.keys(u).length>0?{...q,...u}:q,[q,u]),U=b.useMemo(()=>l?we(r):void 0,[l,r]);b.useEffect(()=>{i&&i({schema:r,formulaConfig:j,conditionConfig:_,conditionExpressions:B.serializeConditionExpressions(_),values:z.current,evaluationPayload:B.buildEvaluationPayload({values:z.current,conditionConfig:_})})},[_,j,r]);const D=b.useCallback(R=>{z.current=R,i&&i({schema:r,formulaConfig:j,conditionConfig:_,conditionExpressions:B.serializeConditionExpressions(_),values:R,evaluationPayload:B.buildEvaluationPayload({values:R,conditionConfig:_})})},[r,j,_,i]);function V(R){e([...r,R])}function O(R){if(!m)return;const{containerFieldId:ee,tabId:te}=m,ue=r.map(P=>{if((P.id??P.name)!==ee)return P;const ne=P.tabs??[];return{...P,tabs:ne.map(W=>W.id===te?{...W,fields:[...W.fields??[],R]}:W)}});e(ue),v(null)}function S(R,ee,te){const ue=r.map(P=>{if((P.id??P.name)!==R)return P;const ne=P.tabs??[];return{...P,tabs:ne.map(W=>W.id===ee?{...W,fields:(W.fields??[]).filter((Ie,ke)=>ke!==te)}:W)}});e(ue)}const X=b.useMemo(()=>({openAddFieldDialog:(R,ee)=>v({containerFieldId:R,tabId:ee}),removeFieldFromTab:S}),[r,e]),ce=n.jsxs("div",{className:"schema-builder-root",children:[r.length>0&&n.jsx("div",{className:"schema-builder-header",children:n.jsxs("div",{className:"schema-builder-actions",children:[n.jsx(o.Tooltip,{title:"Edit schema",placement:"top",children:n.jsxs("button",{className:"sb-btn sb-btn-outline",onClick:()=>g(!0),children:[n.jsx(E.MdSettings,{size:13})," Edit Schema"]})}),n.jsx(o.Tooltip,{title:"Add a new field",placement:"top",children:n.jsxs("button",{className:"sb-btn sb-btn-primary",onClick:()=>p(!0),children:[n.jsx(E.MdAdd,{size:14})," Add Field"]})})]})}),r.length>0?n.jsx(B.TabsEditContext.Provider,{value:X,children:n.jsx(B.FlowForm,{schema:{layout:"flat",fields:r},initialValues:K,onSubmit:()=>{},validationSchema:U,onValidityChange:a,onValuesChange:i?D:void 0,formulaConfig:j,onFormulaConfigChange:C,conditionConfig:_,onConditionConfigChange:F})}):n.jsxs("div",{className:"schema-builder-empty-state",children:[n.jsx(kt.FaWpforms,{size:40,className:"schema-builder-empty-icon"}),n.jsx("p",{className:"schema-builder-empty-title",children:"Tell us what fields should be in the list, and assign values to them."}),n.jsx("div",{className:"schema-builder-empty-actions",children:n.jsx("button",{className:"btn",onClick:()=>p(!0),children:"Add field"})})]}),n.jsx(Be,{open:x,onSave:V,onClose:()=>p(!1)}),n.jsx(Ar,{open:d,value:r,onSave:e,onClose:()=>g(!1)}),n.jsx(Be,{open:!!m,onSave:O,onClose:()=>v(null)})]});return c?n.jsxs(B.VariablePickerProvider,{groups:c,children:[n.jsx(B.VariablePicker,{width:260,mode:"popover"}),ce]}):ce}function Rr({fields:r,onOpen:e}){return n.jsxs(o.Box,{sx:{border:"1px solid #e2e8f0",borderRadius:"8px",bgcolor:"#fff",overflow:"hidden"},children:[r.length>0?n.jsx(o.Box,{sx:{px:1.5,py:1.25,display:"flex",flexWrap:"wrap",gap:.5},children:r.map((t,s)=>{const i=t.id??t.name??"";return n.jsx(o.Tooltip,{title:`${t.type} · ${i}`,placement:"top",children:n.jsx(o.Chip,{label:t.label||i,size:"small",sx:{fontSize:11,fontWeight:500,height:22,bgcolor:"#f1f5f9",color:"#334155",border:"1px solid #e2e8f0","& .MuiChip-label":{px:1}}})},s)})}):n.jsx(o.Box,{sx:{px:1.5,py:1.5},children:n.jsx(o.Typography,{sx:{fontSize:12,color:"#94a3b8"},children:"No fields defined yet"})}),n.jsx(o.Divider,{sx:{borderColor:"#f1f5f9"}}),n.jsxs(o.Box,{onClick:e,sx:{display:"flex",alignItems:"center",gap:.75,px:1.5,py:1,cursor:"pointer","&:hover":{bgcolor:"#f8fafc"},transition:"background 0.12s"},children:[r.length===0?n.jsx(E.MdAdd,{size:14,color:"#6366f1"}):n.jsx(E.MdSettings,{size:13,color:"#6366f1"}),n.jsx(o.Typography,{sx:{fontSize:12,fontWeight:600,color:"#6366f1",flex:1},children:r.length===0?"Add fields":"Configure fields"}),n.jsx(E.MdArrowForward,{size:13,color:"#94a3b8"})]})]})}function zr({value:r,onChange:e,suggestions:t,onPayload:s,onDone:i,validate:l,onValidityChange:a,label:c="Fields",drawerTitle:u="Configure Fields",drawerWidth:f=580}){const[h,x]=b.useState(!1),[p,d]=b.useState({type:"list"}),[g,m]=b.useState(r),v=b.useRef(null),j=b.useRef(void 0),C=b.useRef(void 0),_=b.useRef(void 0),[F,z]=b.useState(null);function q(){m(r),d({type:"list"}),x(!0)}function K(){const S=v.current;S&&(j.current=S.values,C.current=S.formulaConfig,_.current=S.conditionConfig),e(g),x(!1),i==null||i(g,S)}function U(){const S=v.current;S&&(j.current=S.values,C.current=S.formulaConfig,_.current=S.conditionConfig),m(r),x(!1)}function D(){if(p.type!=="edit"||!F)return;const S=[...g];S[p.index]=F,m(S),d({type:"list"}),z(null)}function V(){d({type:"list"}),z(null)}const O=JSON.stringify(g)!==JSON.stringify(r);return p.type==="edit"&&g[p.index],n.jsxs(n.Fragment,{children:[n.jsxs(o.Box,{children:[n.jsx(o.Typography,{sx:{fontSize:12,fontWeight:700,color:"#64748b",textTransform:"uppercase",letterSpacing:.5,mb:.75},children:c}),n.jsx(Rr,{fields:r,onOpen:q})]}),n.jsxs(o.Drawer,{anchor:"right",open:h,onClose:U,PaperProps:{sx:{width:f,display:"flex",flexDirection:"column",boxShadow:"-4px 0 24px rgba(0,0,0,0.12)",overflow:"hidden"}},children:[n.jsxs(o.Box,{sx:{display:"flex",alignItems:"center",px:2,py:1.5,borderBottom:"1px solid #e2e8f0",flexShrink:0,gap:1},children:[p.type==="edit"&&n.jsx(o.Tooltip,{title:"Back to fields",placement:"bottom",children:n.jsx(o.IconButton,{size:"small",onClick:V,sx:{color:"#64748b"},children:n.jsx(E.MdArrowBack,{size:17})})}),n.jsxs(o.Box,{sx:{flex:1},children:[n.jsx(o.Typography,{sx:{fontSize:14,fontWeight:700,color:"#0f172a"},children:p.type==="edit"?(F==null?void 0:F.label)||(F==null?void 0:F.id)||"Edit field":u}),n.jsx(o.Typography,{sx:{fontSize:11,color:"#94a3b8"},children:p.type==="edit"?"Configure field properties":`${g.length} field${g.length!==1?"s":""} defined`})]}),p.type==="list"&&n.jsx(o.Tooltip,{title:"Close",placement:"bottom",children:n.jsx(o.IconButton,{size:"small",onClick:U,sx:{color:"#94a3b8"},children:n.jsx(E.MdClose,{size:17})})})]}),p.type==="list"&&n.jsxs(n.Fragment,{children:[n.jsx(o.Box,{sx:{flex:1,overflowY:"auto",p:2.5},children:n.jsx(de,{value:g,onChange:m,suggestions:t,onPayload:S=>{v.current=S,j.current=S.values,C.current=S.formulaConfig,_.current=S.conditionConfig,s==null||s(S)},validate:l,onValidityChange:a,label:c,initialValues:j.current,initialFormulaConfig:C.current,initialConditionConfig:_.current})}),n.jsxs(o.Box,{sx:{borderTop:"1px solid #e2e8f0",px:2.5,py:1.5,display:"flex",alignItems:"center",gap:1,flexShrink:0,bgcolor:"#f8fafc"},children:[O?n.jsx(o.Typography,{sx:{fontSize:11,color:"#f59e0b",fontWeight:500,flex:1},children:"Unsaved changes"}):n.jsx(o.Box,{sx:{flex:1}}),n.jsx(o.Box,{component:"button",onClick:U,sx:{background:"none",border:"1px solid #dee2e6",cursor:"pointer",fontSize:13,fontWeight:500,px:2,py:.75,borderRadius:"7px",color:"#6c757d","&:hover":{bgcolor:"#f8f9fa"}},children:"Cancel"}),n.jsxs(o.Box,{component:"button",onClick:K,sx:{border:"none",cursor:"pointer",fontSize:13,fontWeight:600,px:2.5,py:.75,borderRadius:"7px",bgcolor:"#6366f1",color:"#fff",display:"flex",alignItems:"center",gap:.75,"&:hover":{bgcolor:"#4f46e5"}},children:[n.jsx(E.MdCheck,{size:15})," Done"]})]})]}),p.type==="edit"&&F&&n.jsx(yt,{field:F,onChange:z,onSave:D,onCancel:V})]})]})}exports.FIELD_TYPE_OPTIONS=mt;exports.FlowForgeRegistry=Se;exports.SchemaBuilder=de;exports.SchemaBuilderDrawer=zr;exports.TablePickerField=xt;exports.buildValidationSchema=we;exports.dataSourceRegistry=ht;exports.useFlowForm=jr;
|
package/dist/canvas.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./templateSkeletons-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./templateSkeletons-Vr97QWjf.js"),t=require("./messages-O9Tw_XXR.js"),r=require("./bpmn-CcuE2X_Q.js"),e=require("./GatewayBranchEdge-DJql3GUT.js");exports.FlowForgeCanvas=o.FlowForgeCanvas;exports.SubWorkflowPreviewDrawer=o.SubWorkflowPreviewDrawer;exports.WorkflowCanvas=o.FlowForgeCanvas;exports.WorkflowExecutionHistory=o.WorkflowExecutionHistory;exports.WorkflowTemplateLibrary=o.WorkflowTemplateLibrary;exports.accessRequestSkeleton=o.accessRequestSkeleton;exports.offboardingSkeleton=o.offboardingSkeleton;exports.userOnboardingSkeleton=o.userOnboardingSkeleton;exports.webhookIntegrationSkeleton=o.webhookIntegrationSkeleton;exports.defaultFlowForgeMessages=t.defaultFlowForgeMessages;exports.loadWorkflowFromBpmn=r.loadWorkflowFromBpmn;exports.saveWorkflowToBpmn=r.saveWorkflowToBpmn;exports.ActionNode=e.ActionNode;exports.ApprovalNode=e.ApprovalNode;exports.EdgeWithPlusLabel=e.EdgeWithPlusLabel;exports.EndNode=e.EndNode;exports.FilterNode=e.FilterNode;exports.RestApiNode=e.RestApiNode;exports.StartNode=e.StartNode;exports.TriggerNode=e.TriggerNode;exports.WebhookTriggerNode=e.WebhookTriggerNode;exports.builtInNodeTypes=e.builtInNodeTypes;
|
package/dist/canvas.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as a, S as s, F as r, W as t, a as l, b as n, o as d, u as i, w as f } from "./templateSkeletons-
|
|
1
|
+
import { F as a, S as s, F as r, W as t, a as l, b as n, o as d, u as i, w as f } from "./templateSkeletons-BT6obP5g.js";
|
|
2
2
|
import { d as w } from "./messages-CO299wPN.js";
|
|
3
3
|
import { l as p, s as b } from "./bpmn-CtfWDaOY.js";
|
|
4
4
|
import { A as F, b as N, E as m, c as u, F as S, R as T, S as c, T as v, W as x, e as A } from "./GatewayBranchEdge-C9tybnDE.js";
|
package/dist/form.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BSP3H9Cn.js"),r=require("./SchemaBuilderDrawer-CrnQm9HM.js");require("react/jsx-runtime");require("react");require("@mui/material");require("react-icons/md");exports.DynamicFormRenderer=e.DynamicFormRenderer;exports.FF=e.FF;exports.FlowForm=e.FlowForm;exports.FormulaInput=e.FormulaInput;exports.InfiniteSelectField=e.InfiniteSelectField;exports.VariablePicker=e.VariablePicker;exports.VariablePickerProvider=e.VariablePickerProvider;exports.astHasRefs=e.astHasRefs;exports.astToTokens=e.astToTokens;exports.buildEvaluationPayload=e.buildEvaluationPayload;exports.buildFieldConfig=e.buildFieldConfig;exports.buildFormulaPath=e.buildFormulaPath;exports.buildSelectStyles=e.buildSelectStyles;exports.errorTextStyle=e.errorTextStyle;exports.extractLabel=e.extractLabel;exports.fieldRegistry=e.fieldRegistry;exports.hasFormulaTokens=e.hasFormulaTokens;exports.helperTextStyle=e.helperTextStyle;exports.inputStyle=e.inputStyle;exports.isFormula=e.isFormula;exports.parseToAST=e.parseToAST;exports.serializeAST=e.serializeAST;exports.serializeASTAsConfig=e.serializeASTAsConfig;exports.serializeConditionExpressions=e.serializeConditionExpressions;exports.stripFormulaTokens=e.stripFormulaTokens;exports.tokenize=e.tokenize;exports.unwrapFormula=e.unwrapFormula;exports.useVariablePickerContext=e.useVariablePickerContext;exports.wrapFormula=e.wrapFormula;exports.FIELD_TYPE_OPTIONS=r.FIELD_TYPE_OPTIONS;exports.FlowForgeRegistry=r.FlowForgeRegistry;exports.SchemaBuilder=r.SchemaBuilder;exports.SchemaBuilderDrawer=r.SchemaBuilderDrawer;exports.TablePickerField=r.TablePickerField;exports.buildValidationSchema=r.buildValidationSchema;exports.useFlowForm=r.useFlowForm;
|
package/dist/form.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as o, F as t, a as u, b as F, I as m, V as n, c as d, d as p, e as S, f as T, g as c, h as b, i as k, j as y, k as P, l as f, m as x, n as h, o as w, p as g, q as I, s as V, r as z, t as A, u as C, v as D, w as E, x as R, y as v } from "./index-
|
|
2
|
-
import { F as L, a as O, S as _, b as j, T as q, c as H, u as N } from "./SchemaBuilderDrawer-
|
|
1
|
+
import { D as o, F as t, a as u, b as F, I as m, V as n, c as d, d as p, e as S, f as T, g as c, h as b, i as k, j as y, k as P, l as f, m as x, n as h, o as w, p as g, q as I, s as V, r as z, t as A, u as C, v as D, w as E, x as R, y as v } from "./index-DO5qci03.js";
|
|
2
|
+
import { F as L, a as O, S as _, b as j, T as q, c as H, u as N } from "./SchemaBuilderDrawer-8NVbccYd.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
5
|
import "@mui/material";
|