@boltic/swirl 1.0.2-sit.84 → 1.0.2-sit.85

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/swirl.es.js CHANGED
@@ -114672,7 +114672,7 @@ const TO = (e) => {
114672
114672
  id: y
114673
114673
  }
114674
114674
  ) });
114675
- }, M2 = "FYND_AIPIM", W$e = "blt-int.ai-pim", G$e = Nr((e, t) => {
114675
+ }, M2 = "FYND_AIPIM", W$e = "blt-int.fynd-aipim", G$e = Nr((e, t) => {
114676
114676
  const r = Rr(), {
114677
114677
  control: n,
114678
114678
  watch: i,
@@ -114781,13 +114781,13 @@ const TO = (e) => {
114781
114781
  placeholder: String(w.size ?? 50)
114782
114782
  })
114783
114783
  ] }), V = () => y ? y === "products.list_external" ? /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
114784
- Q("inbound_id", "Inbound Connector ID", { required: !0 }),
114784
+ Q("inbound_id", "Inbound Connector ID", { required: !0, placeholder: "e.g. 64f3a2b1c8d9e10001234567" }),
114785
114785
  U()
114786
114786
  ] }) : y === "products.get_meta" ? /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
114787
- Q("inbound_id", "Inbound Connector ID", { required: !0 }),
114788
- Q("product_id", "Product ID", { required: !0 })
114787
+ Q("inbound_id", "Inbound Connector ID", { required: !0, placeholder: "e.g. 64f3a2b1c8d9e10001234567" }),
114788
+ Q("product_id", "Product ID", { required: !0, placeholder: "e.g. 64f3a2b1c8d9e10001234567" })
114789
114789
  ] }) : y === "products.bulk_export" ? /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
114790
- Q("inbound_id", "Inbound Connector ID", { required: !0 }),
114790
+ Q("inbound_id", "Inbound Connector ID", { required: !0, placeholder: "e.g. 64f3a2b1c8d9e10001234567" }),
114791
114791
  /* @__PURE__ */ d.jsx(Ce, { item: !0, xs: 12, children: /* @__PURE__ */ d.jsx(sr, { fullWidth: !0, children: /* @__PURE__ */ d.jsx(
114792
114792
  ir,
114793
114793
  {
@@ -114807,35 +114807,35 @@ const TO = (e) => {
114807
114807
  L("payload", "Export Request", {
114808
114808
  description: "Bulk export request body."
114809
114809
  })
114810
- ] }) : y === "templates.list" ? U() : y === "templates.get" || y === "templates.delete" || y === "templates.validation_schema" ? Q("template_id", "Template ID", { required: !0 }) : y === "templates.create" ? L("template", "Template", {
114810
+ ] }) : y === "templates.list" ? U() : y === "templates.get" || y === "templates.delete" || y === "templates.validation_schema" ? Q("template_id", "Template ID", { required: !0, placeholder: "e.g. 64f3a2b1c8d9e10001234567" }) : y === "templates.create" ? L("template", "Template", {
114811
114811
  required: !0,
114812
114812
  description: "Template definition (name, slug, attributes, etc.)."
114813
114813
  }) : y === "templates.update" ? /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
114814
- Q("template_id", "Template ID", { required: !0 }),
114814
+ Q("template_id", "Template ID", { required: !0, placeholder: "e.g. 64f3a2b1c8d9e10001234567" }),
114815
114815
  L("template", "Template Update", { required: !0 })
114816
114816
  ] }) : y === "attributes.list" ? /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
114817
114817
  U(),
114818
- Q("tag", "Filter by Tag")
114818
+ Q("tag", "Filter by Tag", { placeholder: "e.g. apparel, electronics" })
114819
114819
  ] }) : y === "attributes.list_tags" ? null : y === "attributes.create" ? L("attribute", "Attribute", {
114820
114820
  required: !0,
114821
114821
  description: "Attribute definition (name, slug, type, options, etc.)."
114822
- }) : y === "attributes.get" || y === "attributes.delete" ? Q("attribute_id", "Attribute ID", { required: !0 }) : y === "attributes.update" ? /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
114823
- Q("attribute_id", "Attribute ID", { required: !0 }),
114822
+ }) : y === "attributes.get" || y === "attributes.delete" ? Q("attribute_id", "Attribute ID", { required: !0, placeholder: "e.g. 64f3a2b1c8d9e10001234567" }) : y === "attributes.update" ? /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
114823
+ Q("attribute_id", "Attribute ID", { required: !0, placeholder: "e.g. 64f3a2b1c8d9e10001234567" }),
114824
114824
  L("attribute", "Attribute Update", { required: !0 })
114825
114825
  ] }) : y === "categories.list" || y === "categories.list_mappings" ? U() : y === "categories.create" ? L("category", "Category", {
114826
114826
  required: !0,
114827
114827
  description: "Category definition (name, slug, parent_id, attributes, etc.)."
114828
- }) : y === "categories.get" || y === "categories.delete" ? Q("category_id", "Category ID", { required: !0 }) : y === "categories.update" ? /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
114829
- Q("category_id", "Category ID", { required: !0 }),
114828
+ }) : y === "categories.get" || y === "categories.delete" ? Q("category_id", "Category ID", { required: !0, placeholder: "e.g. 64f3a2b1c8d9e10001234567" }) : y === "categories.update" ? /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
114829
+ Q("category_id", "Category ID", { required: !0, placeholder: "e.g. 64f3a2b1c8d9e10001234567" }),
114830
114830
  L("category", "Category Update", { required: !0 })
114831
114831
  ] }) : y === "categories.create_mapping" ? L("mapping", "Mapping", {
114832
114832
  required: !0,
114833
114833
  description: "Category-mapping definition."
114834
- }) : y === "categories.get_mapping_by_code" ? Q("code", "Mapping Code", { required: !0 }) : y === "inbound.list" ? U() : y === "inbound.create" ? L("connector", "Connector", {
114834
+ }) : y === "categories.get_mapping_by_code" ? Q("code", "Mapping Code", { required: !0, placeholder: "e.g. category_apparel_main" }) : y === "inbound.list" ? U() : y === "inbound.create" ? L("connector", "Connector", {
114835
114835
  required: !0,
114836
114836
  description: "Inbound connector definition."
114837
- }) : y === "inbound.get" || y === "inbound.delete" ? Q("inbound_id", "Inbound ID", { required: !0 }) : y === "inbound.update" ? /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
114838
- Q("inbound_id", "Inbound ID", { required: !0 }),
114837
+ }) : y === "inbound.get" || y === "inbound.delete" ? Q("inbound_id", "Inbound ID", { required: !0, placeholder: "e.g. 64f3a2b1c8d9e10001234567" }) : y === "inbound.update" ? /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
114838
+ Q("inbound_id", "Inbound ID", { required: !0, placeholder: "e.g. 64f3a2b1c8d9e10001234567" }),
114839
114839
  L("connector", "Connector Update", { required: !0 })
114840
114840
  ] }) : y === "mapper.list" ? U() : y === "mapper.create" ? L("mapper", "Mapper", {
114841
114841
  required: !0,
@@ -114843,8 +114843,8 @@ const TO = (e) => {
114843
114843
  }) : y === "mapper.execute" ? L("payload", "Execution Input", {
114844
114844
  required: !0,
114845
114845
  description: "Mapper code + input data for sandbox execution."
114846
- }) : y === "mapper.get" || y === "mapper.delete" ? Q("mapper_id", "Mapper ID", { required: !0 }) : y === "mapper.update" ? /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
114847
- Q("mapper_id", "Mapper ID", { required: !0 }),
114846
+ }) : y === "mapper.get" || y === "mapper.delete" ? Q("mapper_id", "Mapper ID", { required: !0, placeholder: "e.g. 64f3a2b1c8d9e10001234567" }) : y === "mapper.update" ? /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
114847
+ Q("mapper_id", "Mapper ID", { required: !0, placeholder: "e.g. 64f3a2b1c8d9e10001234567" }),
114848
114848
  L("mapper", "Mapper Update", { required: !0 })
114849
114849
  ] }) : y === "custom.custom_api" ? /* @__PURE__ */ d.jsx(
114850
114850
  lc,
package/dist/swirl.umd.js CHANGED
@@ -502,7 +502,7 @@ Expecting `+X.join(", ")+", got '"+(this.terminals_[P]||P)+"'":F="Parse error on
502
502
  `))):q=D.stylize("[Circular]","special")),P(W)){if(Q&&z.match(/^\d+$/))return q;W=JSON.stringify(""+z),W.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(W=W.substr(1,W.length-2),W=D.stylize(W,"name")):(W=W.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),W=D.stylize(W,"string"))}return W+": "+q}function T(D,$,U){var Y=D.reduce(function(z,Q){return Q.indexOf(`
503
503
  `)>=0,z+Q.replace(/\u001b\[\d\d?m/g,"").length+1},0);return Y>60?U[0]+($===""?"":$+`
504
504
  `)+" "+D.join(`,
505
- `)+" "+U[1]:U[0]+$+" "+D.join(", ")+" "+U[1]}function v(D){return Array.isArray(D)}i.isArray=v;function C(D){return typeof D=="boolean"}i.isBoolean=C;function x(D){return D===null}i.isNull=x;function b(D){return D==null}i.isNullOrUndefined=b;function w(D){return typeof D=="number"}i.isNumber=w;function R(D){return typeof D=="string"}i.isString=R;function I(D){return typeof D=="symbol"}i.isSymbol=I;function P(D){return D===void 0}i.isUndefined=P;function k(D){return N(D)&&j(D)==="[object RegExp]"}i.isRegExp=k;function N(D){return typeof D=="object"&&D!==null}i.isObject=N;function L(D){return N(D)&&j(D)==="[object Date]"}i.isDate=L;function M(D){return N(D)&&(j(D)==="[object Error]"||D instanceof Error)}i.isError=M;function B(D){return typeof D=="function"}i.isFunction=B;function H(D){return D===null||typeof D=="boolean"||typeof D=="number"||typeof D=="string"||typeof D=="symbol"||typeof D>"u"}i.isPrimitive=H,i.isBuffer=r("./support/isBuffer");function j(D){return Object.prototype.toString.call(D)}function X(D){return D<10?"0"+D.toString(10):D.toString(10)}var F=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function V(){var D=new Date,$=[X(D.getHours()),X(D.getMinutes()),X(D.getSeconds())].join(":");return[D.getDate(),F[D.getMonth()],$].join(" ")}i.log=function(){},i.inherits=r("inherits"),i._extend=function(D,$){if(!$||!N($))return D;for(var U=Object.keys($),Y=U.length;Y--;)D[U[Y]]=$[U[Y]];return D};function G(D,$){return Object.prototype.hasOwnProperty.call(D,$)}}).call(this,r("_process"),typeof Ur<"u"?Ur:typeof self<"u"?self:typeof window<"u"?window:{})},{"./support/isBuffer":10,_process:14,inherits:9}],12:[function(r,n,i){},{}],13:[function(r,n,i){(function(o){function s(c,f){for(var p=0,h=c.length-1;h>=0;h--){var A=c[h];A==="."?c.splice(h,1):A===".."?(c.splice(h,1),p++):p&&(c.splice(h,1),p--)}if(f)for(;p--;p)c.unshift("..");return c}i.resolve=function(){for(var c="",f=!1,p=arguments.length-1;p>=-1&&!f;p--){var h=p>=0?arguments[p]:o.cwd();if(typeof h!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!h)continue;c=h+"/"+c,f=h.charAt(0)==="/"}return c=s(l(c.split("/"),function(A){return!!A}),!f).join("/"),(f?"/":"")+c||"."},i.normalize=function(c){var f=i.isAbsolute(c),p=u(c,-1)==="/";return c=s(l(c.split("/"),function(h){return!!h}),!f).join("/"),!c&&!f&&(c="."),c&&p&&(c+="/"),(f?"/":"")+c},i.isAbsolute=function(c){return c.charAt(0)==="/"},i.join=function(){var c=Array.prototype.slice.call(arguments,0);return i.normalize(l(c,function(f,p){if(typeof f!="string")throw new TypeError("Arguments to path.join must be strings");return f}).join("/"))},i.relative=function(c,f){c=i.resolve(c).substr(1),f=i.resolve(f).substr(1);function p(T){for(var v=0;v<T.length&&T[v]==="";v++);for(var C=T.length-1;C>=0&&T[C]==="";C--);return v>C?[]:T.slice(v,C-v+1)}for(var h=p(c.split("/")),A=p(f.split("/")),g=Math.min(h.length,A.length),m=g,O=0;O<g;O++)if(h[O]!==A[O]){m=O;break}for(var y=[],O=m;O<h.length;O++)y.push("..");return y=y.concat(A.slice(m)),y.join("/")},i.sep="/",i.delimiter=":",i.dirname=function(c){if(typeof c!="string"&&(c=c+""),c.length===0)return".";for(var f=c.charCodeAt(0),p=f===47,h=-1,A=!0,g=c.length-1;g>=1;--g)if(f=c.charCodeAt(g),f===47){if(!A){h=g;break}}else A=!1;return h===-1?p?"/":".":p&&h===1?"/":c.slice(0,h)};function a(c){typeof c!="string"&&(c=c+"");var f=0,p=-1,h=!0,A;for(A=c.length-1;A>=0;--A)if(c.charCodeAt(A)===47){if(!h){f=A+1;break}}else p===-1&&(h=!1,p=A+1);return p===-1?"":c.slice(f,p)}i.basename=function(c,f){var p=a(c);return f&&p.substr(-1*f.length)===f&&(p=p.substr(0,p.length-f.length)),p},i.extname=function(c){typeof c!="string"&&(c=c+"");for(var f=-1,p=0,h=-1,A=!0,g=0,m=c.length-1;m>=0;--m){var O=c.charCodeAt(m);if(O===47){if(!A){p=m+1;break}continue}h===-1&&(A=!1,h=m+1),O===46?f===-1?f=m:g!==1&&(g=1):f!==-1&&(g=-1)}return f===-1||h===-1||g===0||g===1&&f===h-1&&f===p+1?"":c.slice(f,h)};function l(c,f){if(c.filter)return c.filter(f);for(var p=[],h=0;h<c.length;h++)f(c[h],h,c)&&p.push(c[h]);return p}var u="ab".substr(-1)==="b"?function(c,f,p){return c.substr(f,p)}:function(c,f,p){return f<0&&(f=c.length+f),c.substr(f,p)}}).call(this,r("_process"))},{_process:14}],14:[function(r,n,i){var o=n.exports={},s,a;function l(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?s=setTimeout:s=l}catch{s=l}try{typeof clearTimeout=="function"?a=clearTimeout:a=u}catch{a=u}})();function c(v){if(s===setTimeout)return setTimeout(v,0);if((s===l||!s)&&setTimeout)return s=setTimeout,setTimeout(v,0);try{return s(v,0)}catch{try{return s.call(null,v,0)}catch{return s.call(this,v,0)}}}function f(v){if(a===clearTimeout)return clearTimeout(v);if((a===u||!a)&&clearTimeout)return a=clearTimeout,clearTimeout(v);try{return a(v)}catch{try{return a.call(null,v)}catch{return a.call(this,v)}}}var p=[],h=!1,A,g=-1;function m(){!h||!A||(h=!1,A.length?p=A.concat(p):g=-1,p.length&&O())}function O(){if(!h){var v=c(m);h=!0;for(var C=p.length;C;){for(A=p,p=[];++g<C;)A&&A[g].run();g=-1,C=p.length}A=null,h=!1,f(v)}}o.nextTick=function(v){var C=new Array(arguments.length-1);if(arguments.length>1)for(var x=1;x<arguments.length;x++)C[x-1]=arguments[x];p.push(new y(v,C)),p.length===1&&!h&&c(O)};function y(v,C){this.fun=v,this.array=C}y.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={};function T(){}o.on=T,o.addListener=T,o.once=T,o.off=T,o.removeListener=T,o.removeAllListeners=T,o.emit=T,o.prependListener=T,o.prependOnceListener=T,o.listeners=function(v){return[]},o.binding=function(v){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(v){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],15:[function(r,n,i){var o=r("escodegen").generate;n.exports=function(a,l,u){u||(u={});var c=!u.allowAccessToMethodsOnFunctions;l||(l={});var f={},p=(function h(A,g){if(A.type==="Literal")return A.value;if(A.type==="UnaryExpression"){var m=h(A.argument,g);return A.operator==="+"?+m:A.operator==="-"?-m:A.operator==="~"?~m:A.operator==="!"?!m:f}else if(A.type==="ArrayExpression"){for(var O=[],y=0,T=A.elements.length;y<T;y++){var v=h(A.elements[y],g);if(v===f)return f;O.push(v)}return O}else if(A.type==="ObjectExpression"){for(var C={},y=0;y<A.properties.length;y++){var x=A.properties[y],b=x.value===null?x.value:h(x.value,g);if(b===f)return f;C[x.key.value||x.key.name]=b}return C}else if(A.type==="BinaryExpression"||A.type==="LogicalExpression"){var w=A.operator;if(w==="&&"){var T=h(A.left);if(T===f)return f;if(!T)return T;var R=h(A.right);return R===f?f:R}else if(w==="||"){var T=h(A.left);if(T===f)return f;if(T)return T;var R=h(A.right);return R===f?f:R}var T=h(A.left,g);if(T===f)return f;var R=h(A.right,g);return R===f?f:w==="=="?T==R:w==="==="?T===R:w==="!="?T!=R:w==="!=="?T!==R:w==="+"?T+R:w==="-"?T-R:w==="*"?T*R:w==="/"?T/R:w==="%"?T%R:w==="<"?T<R:w==="<="?T<=R:w===">"?T>R:w===">="?T>=R:w==="|"?T|R:w==="&"?T&R:w==="^"?T^R:f}else{if(A.type==="Identifier")return{}.hasOwnProperty.call(l,A.name)?l[A.name]:f;if(A.type==="ThisExpression")return{}.hasOwnProperty.call(l,"this")?l.this:f;if(A.type==="CallExpression"){var I=h(A.callee,g);if(I===f||typeof I!="function")return f;var P=A.callee.object?h(A.callee.object,g):f;P===f&&(P=null);for(var k=[],y=0,T=A.arguments.length;y<T;y++){var v=h(A.arguments[y],g);if(v===f)return f;k.push(v)}return g?void 0:I.apply(P,k)}else if(A.type==="MemberExpression"){var C=h(A.object,g);if(C===f||typeof C=="function"&&c)return f;if(A.property.type==="Identifier"&&!A.computed)return s(A.property.name)?f:C[A.property.name];var x=h(A.property,g);return x===null||x===f||s(x)?f:C[x]}else if(A.type==="ConditionalExpression"){var m=h(A.test,g);return m===f?f:m?h(A.consequent):h(A.alternate,g)}else if(A.type==="ExpressionStatement"){var m=h(A.expression,g);return m===f?f:m}else{if(A.type==="ReturnStatement")return h(A.argument,g);if(A.type==="FunctionExpression"){var N=A.body.body,L={};Object.keys(l).forEach(function(D){L[D]=l[D]});for(var y=0;y<A.params.length;y++){var M=A.params[y];if(M.type=="Identifier")l[M.name]=null;else return f}for(var y in N)if(h(N[y],!0)===f)return f;l=L;var B=Object.keys(l),H=B.map(function(D){return l[D]});return Function(B.join(", "),"return "+o(A)).apply(null,H)}else if(A.type==="TemplateLiteral"){for(var j="",y=0;y<A.expressions.length;y++)j+=h(A.quasis[y],g),j+=h(A.expressions[y],g);return j+=h(A.quasis[y],g),j}else if(A.type==="TaggedTemplateExpression"){var X=h(A.tag,g),F=A.quasi,V=F.quasis.map(h),G=F.expressions.map(h);return X.apply(null,[V].concat(G))}else return A.type==="TemplateElement"?A.value.cooked:f}}})(a);return p===f?void 0:p};function s(a){return a==="constructor"||a==="__proto__"}},{escodegen:12}],jsonpath:[function(r,n,i){n.exports=r("./lib/index")},{"./lib/index":5}]},{},["jsonpath"])("jsonpath")})})(GP)),GP.exports}var pBe=fBe();const hBe=Un(pBe),ABe=e=>{try{return dBe(e),!0}catch(t){return t}},mBe=e=>{try{return hBe.query({},e),!0}catch(t){return t}},gBe=_.forwardRef((e,t)=>{const{type:r,isLoop:n,suggestionsData:i,id:o,viewOnly:s=!1}=e,{loopSuggestionsData:a={}}=ct.useSelector(m=>m.loopActivity),{watch:l,control:u,setValue:c,formState:{errors:f}}=Rr(),p=l("properties.from_type"),h=l("properties.to_type"),A=tue.filter(m=>!!m.visibleKey.find(O=>O===p)),g=m=>m==="json"?"json":m==="xml"?"xml":"html";return _.useEffect(()=>{h===""&&c("properties.query","")},[h]),d.jsx(En,{children:d.jsxs(E.Grid,{container:!0,gap:1.5,children:[d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Yt,{name:"properties.from_type",control:u,meta:{options:eue,displayName:"Convert from",searchFieldPlaceholder:"Search",description:"Choose the type of data you are starting with.",placeholder:"Select Convert from"},validationRules:{required:"Convert from is required"},handleChange:()=>{c("properties.to_type","")},viewOnly:s,required:!0})}),p&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(pr,{name:"properties.data",control:u,rules:{required:"Data is required"},render:({field:m})=>d.jsx(Fi,{...m,label:"Data",showSuggestions:!0,suggestionsData:n?a:i,id:`${r}-data`,size:"md",suggestionLabel:"Data",viewOnly:s,language:g(p?.toLowerCase()),showHtmlPreview:p?.toLowerCase()?.includes("html"),placeholder:"Enter the input data to be converted.",handleChange:O=>m.onChange(O),showExpandOption:!0,error:!!f.properties?.data?.message,errorMsg:f.properties?.data?.message,helperText:"Paste or enter the input data to be converted.",required:!0})})}),d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Yt,{name:"properties.to_type",control:u,meta:{options:A,displayName:"Convert to",searchFieldPlaceholder:"Search",description:"Choose the type you want to convert the data into.",placeholder:"Select Convert to"},validationRules:{required:"Convert to is required"},viewOnly:s,required:!0})}),h==="jsonata"&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(pr,{name:"properties.query",control:u,rules:{validate:m=>m&&ABe(m)!==!0?"Error in JSONata expression. Please check the expression's syntax.":!0},render:({field:m})=>d.jsx(Fi,{...m,language:"javascript",suggestionLabel:"Query",placeholder:"Enter a JSONata / JSONPath query to transform the data",size:"md",suggestionsData:n?a:i,id:`${r}-query2`,showSuggestions:!0,viewOnly:s,handleChange:O=>{Et(O)||m.onChange(O)},label:"Query",helperText:"To know more about how to use jsonata, visit https://docs.jsonata.org/overview.html.",showExpandOption:!0,error:!!f.properties?.query?.message,errorMsg:f.properties?.query?.message})})}),h==="jsonpath"&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(pr,{name:"properties.query",control:u,rules:{validate:m=>m&&mBe(m)!==!0?"Error in JSONPath expression. Please check the expression's syntax.":!0},render:({field:m})=>d.jsx(Fi,{...m,language:"javascript",placeholder:"Enter a JSONata / JSONPath query to transform the data",size:"md",suggestionsData:n?a:i,id:`${r}-query`,showSuggestions:!0,viewOnly:s,handleChange:O=>{Et(O)||m.onChange(O)},suggestionLabel:"Query",label:"Query",helperText:"To know more about how to use JSONPath, visit https://goessner.net/articles/JsonPath/",error:!!f.properties?.query?.message,errorMsg:f.properties?.query?.message,showExpandOption:!0})})}),h==="graphql"&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(kr,{id:o,name:"properties.query_options",control:u,meta:{displayName:"Query Options",description:"Provide GraphQL-specific options if your query needs them.",placeholder:"Specify Query Options"},viewOnly:s,editorId:`${r}-query_options`})}),!n&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Mi,{viewOnly:s,type:r})})]})})}),EBe=Gi(gBe,"");var jo=(e=>(e.STRING="string",e.NUMBER="number",e.BOOLEAN="boolean",e.OBJECT="object",e.ARRAY="array",e.NULL="null",e))(jo||{});const _X={string:"",boolean:!0,number:0,object:{},array:[],null:[]},wX=e=>e?.jsonGui??Eb.colors.jsonGui,WP=e=>{const t=wX(e);return[{value:"string",label:"abc",color:t.string,icon:"ic_string",name:"String"},{value:"number",label:"123",color:t.number,icon:"ic_number",name:"Number"},{value:"boolean",label:"true",color:t.boolean,icon:"ic_boolean",name:"Boolean"},{value:"array",label:"[]",color:t.array,icon:"ic_array",name:"Array"},{value:"object",label:"{}",color:t.object,icon:"ic_object",name:"Object"},{value:"null",label:"null",color:t.null,icon:"ic_null",name:"Null"}]},IX=e=>{const t=wX(e);return[{value:"string",label:"abc",color:t.string,icon:"ic_string",name:"String"},{value:"number",label:"123",color:t.number,icon:"ic_number",name:"Number"},{value:"boolean",label:"true",color:t.boolean,icon:"ic_boolean",name:"Boolean"},{value:"null",label:"null",color:t.null,icon:"ic_null",name:"Null"}]};WP(null),IX(null);const bT=e=>Object.prototype.toString.call(e).match(/\w+/g)?.[1].toLowerCase(),DX=(e,t,r)=>{const n=e.shift(),i=Object.keys(t);if(e.length)return DX(e,t[i[n]],r);t[i[n]]=r},RX=(e,t,r)=>(DX(t,r,e),r),PX=e=>e.split("-").slice(1),OBe=e=>e&&typeof e=="object",ag=_.createContext(null),QP=e=>{const{setEditObject:t,editObject:r,setTempData:n}=_.useContext(ag),i=E.useTheme(),o=WP(i.palette),{uniqueKey:s,sourceData:a,id:l,showSuggestions:u,excludePayloadSuggestions:c=!1,onChange:f,setIsEditing:p}=e,h=Array.isArray(a),[A,g]=_.useState({}),[m,O]=_.useState({}),[y,T]=_.useState(""),v={fontSize:"18px",marginRight:"5px"},C=(N,L)=>{m[N]=L,A[N]={},T(""),g({...A}),O({...m}),p?.(!0),n(L?M=>({...M,"":""}):M=>{const B={...M};return delete B[""],B})},x=()=>{g({}),O({}),T("")};_.useEffect(()=>{x()},[h]);const b=(N,L)=>{const M=N.target.value.trim();A[L].key=M,g({...A});const B=LP(M,a);T(B)},w=(N,L)=>{A[N].value=L,g({...A})},R=(N,L)=>{A[N].type=L,A[N].value=_X[L],g({...A})},I=(N,L)=>{switch(L){case jo.NULL:return null;case jo.BOOLEAN:return typeof N=="string"?N==="true":!!N;case jo.NUMBER:return Number(N);case jo.STRING:return String(N||"");default:return N||""}},P=(N,L)=>{const M=A[N];if(!M)return;const{key:B,value:H,type:j}=M,F=j===jo.OBJECT||j===jo.ARRAY?j===jo.ARRAY?[]:{}:I(H,j);if(!h){const V=LP(B,L);if(V){T(V);return}}h?L.push(F):L[B]=F,t({...r}),x(),n?.({...r}),p?.(!1)},k=N=>{switch(N){case jo.STRING:return d.jsx(E.Stack,{width:"150px",children:d.jsx(lo,{viewOnly:e.viewOnly,fullWidth:!0,onChange:L=>w(s,L.target.value),showSuggestion:u,id:l,placeholder:"value",editorId:`${l}-${N}-${s}`,"data-testid":`${l}-${N}-${s}`,excludePayloadSuggestions:c})});case jo.NUMBER:return d.jsx(E.Stack,{width:"150px",ml:-1.5,children:d.jsx(lo,{viewOnly:e.viewOnly,fullWidth:!0,type:"number",placeholder:"value",autoComplete:"off",onChange:L=>w(s,+L.target.value),"data-testid":`${l}-${N}-${s}`,excludePayloadSuggestions:c})});case jo.BOOLEAN:return d.jsx(E.Stack,{width:"150px",ml:-1.5,children:d.jsxs(E.Select,{disabled:e.viewOnly,size:"small",value:A[s]?.value!==!1,"data-testid":`${l}-${N}-${s}`,sx:{".MuiInputBase-inputSizeSmall":{height:"auto !important"}},onChange:L=>{const M=L.target.value==="true";w(s,M)},children:[d.jsx(E.MenuItem,{value:"true",children:"true"}),d.jsx(E.MenuItem,{value:"false",children:"false"})]})});default:return null}};return d.jsx(E.Box,{className:"addItem",width:"100%",children:m[s]?d.jsxs(E.Stack,{direction:"row",alignItems:y?"flex-start":"center",width:"100%",children:[!h&&d.jsxs(E.Stack,{sx:{position:"relative"},children:[d.jsx(lo,{viewOnly:e.viewOnly,fullWidth:!0,onChange:N=>b(N,s),showSuggestion:u,id:l,sx:{width:"130px"},placeholder:"key",editorId:`key-${s}`,"data-testid":`key-${s}`,error:!!y,excludePayloadSuggestions:c}),y&&d.jsx(E.Box,{sx:{position:"absolute",top:38,left:0,color:i.palette.error.main,fontSize:"0.75rem",lineHeight:1},children:d.jsx(E.FormHelperText,{"data-testid":`errorMsg-${s}`,error:!0,children:y})})]}),d.jsx(E.Select,{size:"small","data-testid":`select-type-${s}`,disabled:e.viewOnly,sx:{mx:1,mr:2.1,".MuiSelect-select":{padding:"10px 38px 10px 14px",fontSize:10},".MuiInputBase-inputSizeSmall":{height:"auto !important"},".MuiOutlinedInput-notchedOutline":{p:0,width:"120px"}},MenuProps:{PaperProps:{sx:{minWidth:"120px !important",marginLeft:"4px !important"}}},onChange:N=>R(s,N.target.value),value:A[s]?.type||jo.STRING,renderValue:N=>{const L=o.find(M=>M.value===N);return d.jsxs(E.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:1,children:[d.jsx(Ue,{src:L?.icon,width:14,height:14,sx:{marginRight:8,color:L?.color}}),d.jsx(E.Typography,{variant:"smMedium",color:"text.secondary",children:L?.name})]})},children:o.map(N=>d.jsxs(E.MenuItem,{value:N.value,sx:{...vf,minHeight:"40px !important","@media (min-width: 600px)":{minHeight:"40px !important"}},children:[d.jsx(Ue,{src:N.icon,width:18,height:18,sx:{color:N.color}}),d.jsx(E.Typography,{variant:"smMedium",color:"text.secondary",children:N.name})]},N.value))}),d.jsx("span",{className:"jsonValue",children:k(A[s]?.type||jo.STRING)}),d.jsxs(E.Stack,{direction:"row",spacing:1,ml:Et(r)?1:0,children:[d.jsx(E.IconButton,{size:"small",color:"primary",onClick:()=>{P(s,a),f&&f(r)},sx:{minWidth:0},"data-testid":`confirm-${s}`,disabled:!!y||e?.viewOnly,children:d.jsx(Ue,{src:"ic_done",width:16,height:16})}),d.jsx(E.IconButton,{"data-testid":`close-btn-${s}`,size:"small",onClick:()=>{C(s,!1),p?.(!1)},disabled:e?.viewOnly,sx:{minWidth:0},children:d.jsx(Ue,{width:16,height:16,src:"ic_close"})})]})]}):d.jsxs(E.Button,{variant:"text",disabled:e.viewOnly,"data-testid":"json-gui-add-btn",sx:{color:N=>N.palette.primary[60],mt:Et(r)?0:2,"&:hover":{backgroundColor:"transparent",color:N=>N.palette.primary[50],"& .MuiTypography-root":{color:N=>N.palette.primary[50]},"& svg path":{fill:N=>N.palette.primary[50]}}},disableFocusRipple:!0,disableTouchRipple:!0,disableRipple:!0,disableElevation:!0,onClick:()=>C(s,!0),children:[d.jsx(Ue,{src:"ic_plus",sx:{...v,path:{fill:"currentColor"}}}),d.jsx(E.Typography,{variant:"smNormal",sx:{alignItems:"center"},children:"Add"})]})},s)},zP={base:{transformOrigin:"center",transition:"transform 0.2s cubic-bezier(0.4, 0, 0.2, 1)",mr:.5},right:{transform:"rotate(0deg)"},down:{transform:"rotate(90deg)"}};function XP({fieldValue:e,uniqueKey:t}){const{onChangeAllow:r,allowMap:n}=_.useContext(ag);if(!OBe(e))return d.jsx("span",{});const i=!!n[t];return d.jsx(E.IconButton,{onClick:()=>r(t),"data-testid":`collapse-${t}`,sx:{...zP.base,...i?zP.down:zP.right},children:d.jsx(Ue,{src:"ic_right_arrow"})})}function NX(e){const t=E.useTheme(),r=WP(t.palette);return d.jsx(ag.Consumer,{children:({onChangeType:n})=>d.jsx(E.Select,{size:"small","data-testid":`select-type-${e.uniqueKey}`,disabled:e.viewOnly,sx:{".MuiSelect-select":{fontSize:10},".MuiInputBase-inputSizeSmall":{height:"auto !important"},".MuiOutlinedInput-notchedOutline":{p:0}},onChange:i=>n(i.target.value,e.uniqueKey),value:bT(e.fieldValue),renderValue:i=>{const o=r.find(s=>s.value===i);return d.jsxs(E.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:1,children:[d.jsx(Ue,{src:o?.icon,width:14,height:14,sx:{marginRight:8,color:o?.color}}),d.jsx(E.Typography,{variant:"smMedium",color:"text.secondary",children:o?.name})]})},children:r.map(i=>d.jsxs(E.MenuItem,{value:i.value,sx:{...vf},children:[d.jsx(Ue,{src:i.icon,width:18,height:18,sx:{color:i.color}}),d.jsx(E.Typography,{variant:"smMedium",color:"text.secondary",children:i.name})]},i.value))})})}function yBe(e){const{setIsEditing:t,fieldValue:r,parentUniqueKey:n,viewOnly:i,getValue:o,deepLevel:s,id:a,showSuggestions:l,excludePayloadSuggestions:u,onClickDelete:c,onChange:f}=e,{allowMap:p}=_.useContext(ag),h=200,[A,g]=_.useState(h);_.useEffect(()=>{g(h)},[r]);const m=r.slice(0,A),O=r.length>A;return d.jsxs(E.Box,{className:"arrayContent",children:[d.jsx(E.Box,{sx:{marginTop:"10px"},"data-testid":"arrayContent",children:m.map((y,T)=>{const v=`${n}-${T}`,C=bT(y),x=["object","array"].includes(C)&&!!p[v];return d.jsxs(E.Stack,{className:"indexLine",direction:"row",alignItems:"center",gap:1,justifyContent:"flex-start",flexWrap:x?"wrap":"nowrap",sx:{"& .jsonValue":{flex:x?"1 1 100%":"0 0 auto",width:x?"100%":"auto",minWidth:x?"auto":"150px"}},children:[["object","array"].includes(C)&&d.jsx(XP,{uniqueKey:v,fieldValue:y}),d.jsx(NX,{viewOnly:i,uniqueKey:v,fieldValue:y,fieldKey:`${T}`,sourceData:r,"data-testid":`tools-${v}`,type:"array"}),d.jsx("span",{className:"jsonValue",children:o(y,T,r,s+1,v)}),d.jsx(E.Stack,{ml:1,alignItems:"center",direction:"row","data-testid":`delete-${v}`,sx:x?{position:"absolute",right:260,top:4}:{position:"relative",ml:1},children:d.jsx(E.IconButton,{disabled:i,onClick:()=>c(T,r),sx:{ml:.5,"&:hover":{backgroundColor:"transparent"}},children:d.jsx(Ue,{src:"ic_delete"})})})]},v)})}),O&&d.jsxs(E.Stack,{direction:"row",alignItems:"center",gap:1,sx:{mt:1},"data-testid":`array-load-more-${n}`,children:[d.jsx(E.Button,{size:"small",variant:"outlined",onClick:()=>g(y=>Math.min(y+h,r.length)),sx:{textTransform:"none"},children:`Load ${Math.min(h,r.length-A)} more`}),d.jsx(E.Typography,{variant:"xsNormal",color:"text.secondary",children:`Showing ${A} of ${r.length}`})]}),d.jsx(E.Box,{children:d.jsx(QP,{viewOnly:i,uniqueKey:n,deepLevel:s,sourceData:r,id:a,showSuggestions:l,excludePayloadSuggestions:u,setIsEditing:t,onChange:f},n)})]})}function LX(e){const t=E.useTheme(),{editObject:r,setEditObject:n,id:i,showSuggestions:o,setTempData:s,tempData:a,excludePayloadSuggestions:l=!1,viewOnly:u=!1,onChange:c,setIsEditing:f}=e,[p,h]=_.useState({}),[A,g]=_.useState({}),[m,O]=_.useState(!0),[y,T]=_.useState(!1),v=200,[C,x]=_.useState(v);_.useEffect(()=>{x(v)},[r]);const b=F=>{n({...F}),c?.(F),s&&s({...F})};_.useEffect(()=>{const F=setTimeout(()=>{O(!1)},500);return()=>clearTimeout(F)},[]);const w=(F,V)=>{Array.isArray(V)?(V.splice(+F,1),c&&c(V)):(Reflect.deleteProperty(V,F),c&&c(V)),b(r)},R=(F,V)=>{const G=F===jo.NULL?null:_X[F],D=RX(G,PX(V),r);b(D)},I=(F,V,G,D)=>{const $=F.target.value.trim();if(V!==$){const Q=LP($,D);if(g(W=>({...W,[G]:Q})),Q)return}const U={};for(const Q in D)Object.prototype.hasOwnProperty.call(D,Q)&&(Q===V?U[F.target.value]=D[Q]:U[Q]=D[Q]);g(Q=>{const W={...Q};return delete W[G],W});const Y=PX(G);if(Y.length===1)b(U);else{Y.pop();const Q=RX(U,Y,r);b(Q)}},P=(F,V,G,D="")=>{G[V]=D==="number"?Number(F):F,b(r)},k=F=>!!(typeof F!="object"||F===null||Array.isArray(F)||Object.keys(F).length===0),N={position:"absolute",left:-4,width:"2px",height:"calc(100% - 22px)",borderLeft:`1px solid ${t.palette.grey.outlined.border}`,"&::after":{content:'""',position:"absolute",bottom:0,width:"20px",height:"1px",backgroundColor:t.palette.grey.outlined.border},zIndex:1},L={position:"absolute",left:8,width:"2px",height:"calc(100% - 76px)",borderLeft:`1px solid ${t.palette.grey.outlined.border}`,zIndex:0,"&::after":{content:'""',position:"absolute",bottom:0,width:"30px",height:"1px",backgroundColor:t.palette.grey.outlined.border}},M=(F,V,G,D,$)=>{const U=bT(F),Y={autoComplete:"off",onChange:W=>P(W.target.value,V,G),value:F},z={position:"relative",paddingLeft:0},Q=k(F);switch(U){case jo.ARRAY:return!p[$]?d.jsx(E.Typography,{component:"span",variant:"smMedium",sx:{color:t.palette.text.secondary,opacity:.7,display:"inline-flex",alignItems:"center",height:24,whiteSpace:"nowrap"},"data-testid":`array-collapsed-${V}`,children:`[${F.length} ${F.length===1?"item":"items"}]`}):d.jsxs(E.Stack,{sx:z,children:[d.jsx(E.Box,{sx:{...N,height:"calc(100% - 17px)"}}),d.jsx(yBe,{viewOnly:u,fieldValue:F,fieldKey:V,sourceData:G,deepLevel:D,parentUniqueKey:$,getValue:M,id:i,showSuggestions:o,onClickDelete:w,"data-testid":`array-${V}`,excludePayloadSuggestions:l,setIsEditing:f,onChange:b})]});case jo.OBJECT:{const W=!!p[$],q=Object.keys(F||{}).length;return W?d.jsxs(E.Stack,{sx:z,"data-testid":`object-${V}`,children:[d.jsx(E.Box,{sx:{...N,height:Q?"calc(100% - 10px)":N.height}}),d.jsx("span",{children:X(F,D+1,$)})]}):d.jsx(E.Typography,{component:"span",variant:"smMedium",sx:{color:t.palette.text.secondary,opacity:.7,display:"inline-flex",alignItems:"center",height:24,whiteSpace:"nowrap"},"data-testid":`object-collapsed-${V}`,children:`{${q} ${q===1?"key":"keys"}}`})}case jo.STRING:return d.jsx(lo,{"data-testid":`text-string-${V}`,sx:{width:"140px"},size:"xs",disabled:u,id:i,showSuggestions:o,excludePayloadSuggestions:l,...Y,placeholder:"value"});case jo.NUMBER:return d.jsx(lo,{id:i,size:"xs",disabled:u,type:"number",placeholder:F,autoComplete:"off",showSuggestions:o,excludePayloadSuggestions:l,value:F,sx:{width:"140px"},"data-testid":`text-number-${V}`,onBlur:W=>P(+W.target.value,V,G),onChange:W=>P(W.target.value===""?"":+W.target.value,V,G,"number")});case jo.BOOLEAN:return d.jsxs(E.Select,{disabled:u,size:"small",sx:{width:"140px","& .MuiSelect-select":{display:"flex",alignItems:"center",paddingTop:"6px",paddingBottom:"6px"},"& .MuiOutlinedInput-input":{display:"flex",alignItems:"center"}},value:F?"true":"false","data-testid":`text-boolean-${V}`,onChange:W=>P(W.target.value==="true",V,G),children:[d.jsx(E.MenuItem,{value:"true",children:"true"}),d.jsx(E.MenuItem,{value:"false",children:"false"})]})}},B=F=>{p[F]=!p[F],h({...p})},H=()=>{T(!y)},j=1,X=(F,V=j,G=`${V}`)=>{const D=Object.keys(F);if(!D.length)return d.jsx(E.Box,{"data-testid":`addItem-${G}`,mt:Et(r)?0:"9px",ml:Et(r)?0:3,children:d.jsx(QP,{viewOnly:u,uniqueKey:`${G}`,deepLevel:V,sourceData:F,id:i,showSuggestions:o,excludePayloadSuggestions:l,onChange:z=>{c&&c(z)},setIsEditing:f})});const $=V===j,U=$?D.slice(0,C):D,Y=$&&D.length>C;return d.jsxs(E.Stack,{className:"objectContent","data-testid":"objectContent",sx:{marginLeft:j===V?"15px":"10px",py:1.5},onClick:z=>z.stopPropagation(),children:[d.jsx(E.Box,{children:U.map((z,Q)=>{const W=`${G}-${Q}`,q=F[z],Z=bT(q),te=["object","array"].includes(Z)&&!!p[W];return d.jsxs(E.Stack,{className:"indexLine",direction:"row",alignItems:A[W]?"flex-start":"center",gap:1,justifyContent:"flex-start",flexWrap:te?"wrap":"nowrap",sx:{"& .jsonValue":{flex:te?"1 1 100%":"0 0 auto",width:te?"100%":"auto",minWidth:te?"auto":"150px"},"& .jsonKey":{flex:"0 0 auto",minWidth:"auto"}},children:[["object","array"].includes(Z)&&d.jsx(E.Box,{sx:{width:j===V?"18px":"",display:"inline-block"},children:d.jsx(XP,{uniqueKey:W,fieldValue:q})}),d.jsxs(E.Stack,{direction:"row",alignItems:A[W]?"flex-start":"center",justifyContent:"flex-start",className:"jsonKey",gap:1,children:[d.jsx(lo,{disabled:u,size:"xs",sx:{width:"130px"},id:i,placeholder:"key",value:z||"",tabIndex:Q+1,onChange:ae=>I(ae,z,W,F),"data-testid":`text-key-${z}`,error:!!A[W],errorMsg:A[W],helperText:A[W]}),d.jsx(NX,{viewOnly:u,uniqueKey:W,fieldValue:q,fieldKey:z,sourceData:F,"data-testid":`tools-${z}`,type:"object"})]}),d.jsx("span",{className:Z!=="number"&&Z!=="boolean"?"jsonValue":"",children:M(q,z,F,V,W)}),d.jsx("span",{children:d.jsx(E.Stack,{ml:1,alignItems:"center",direction:"row",sx:{position:"absolute",right:te?150:30,top:4},"data-testid":`delete-${z}`,children:d.jsx(E.IconButton,{disabled:u,onClick:()=>w(z,F),sx:{"& path":{fill:t.palette.neutral.solid.bg},"&:hover":{backgroundColor:"transparent","& path":{fill:t.palette.error[60]}}},children:d.jsx(Ue,{src:"ic_delete",sx:{"& path":{fill:t.palette.neutral.solid.bg}}})})})})]},W)})}),Y&&d.jsxs(E.Stack,{direction:"row",alignItems:"center",gap:1,sx:{mt:1,ml:2},"data-testid":`load-more-${G}`,children:[d.jsx(E.Button,{size:"small",variant:"outlined",onClick:()=>x(z=>Math.min(z+v,D.length)),sx:{textTransform:"none"},children:`Load ${Math.min(v,D.length-C)} more`}),d.jsx(E.Typography,{variant:"xsNormal",color:"text.secondary",children:`Showing ${C} of ${D.length}`})]}),d.jsx(E.Box,{"data-testid":`addItem-button-${G}`,ml:j===V?4.5:2,children:d.jsx(QP,{viewOnly:u,uniqueKey:G,deepLevel:V,sourceData:F,id:i,showSuggestions:o,excludePayloadSuggestions:l,onChange:z=>{c&&c(z)},setIsEditing:f},G)})]})};return d.jsx(ag.Provider,{value:{editObject:r,setEditObject:n,setTempData:s,onChangeType:R,onClickDelete:w,onChangeAllow:B,allowMap:p},children:m?d.jsx(E.Box,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",minHeight:"300px",children:d.jsx(E.CircularProgress,{})}):d.jsxs(E.Box,{sx:{width:"100%",position:"relative",minHeight:y||Et(a)?0:"100px",paddingTop:"2rem"},"data-testid":"root-collapsible-json",children:[!Et(r)&&d.jsx(E.Box,{onClick:H,"data-testid":"root-collapse-part",children:d.jsx(XP,{uniqueKey:"ROOT_KEY",fieldValue:r})}),!y&&!Et(r)&&d.jsx(E.Box,{sx:L}),!y&&X(r,1,"ROOT_KEY")]})})}const kX=_.lazy(()=>Promise.resolve().then(()=>nX)),FX=()=>d.jsx(E.Stack,{alignItems:"center",justifyContent:"center",sx:{p:2,minHeight:120},children:d.jsx(hi,{size:30})}),vBe=_.forwardRef(({data:e={},label:t,infoVisible:r=!1,viewOnly:n=!1,helperText:i,required:o=!1,suggestionsData:s,showSuggestions:a=!1,errorMsg:l="",id:u,excludePayloadSuggestions:c=!1,onChange:f,title:p="",isDynamic:h=!1,fullScreen:A=!1,handleValidate:g,name:m},O)=>{const[y,T]=_.useState("GUI"),[v,C]=_.useState("GUI"),[x,b]=_.useState("Static"),[w,R]=_.useState({}),[I,P]=_.useState(!0),[k,N]=_.useState(!0),[L,M]=_.useState(!1),[B,H]=_.useState({}),[j,X]=_.useState(""),[F,V]=_.useState({}),G=E.useTheme(),[D,$]=_.useState(!1),[U,Y]=_.useState(!1),[z,Q]=_.useState([]),W=_.useRef(!1),q=_.useCallback(he=>{const Ae=he.trim();return/^\{\{[^}]+\}\}$/.test(Ae)},[]),Z=_.useMemo(()=>typeof w=="string"&&q(w),[w,q]),te=[{title:"GUI",disabled:U||Z},{title:"Raw",disabled:U}],ae=_.useCallback(he=>{if(he==null||he==="")return{};if(typeof he=="string"){if(q(he))return he;try{return JSON.parse(he)}catch{return{}}}return Lo(he)},[q]);_.useEffect(()=>{const he=ae(e);if(R(he),H(he),V(he),typeof he=="string"&&q(he))X(he),W.current=!1,P(!1),N(!1),T("Raw"),C("Raw");else{const Ae=JSON.stringify(he,null,2);Ae==="{}"&&W.current?(X(""),W.current=!1):(X(Ae),W.current=!1)}},[e,ae,q]);const ne=_.useMemo(()=>nA(B),[B]),ue=_.useCallback(()=>{if(!ne){if(Q([]),g&&g([]),I)typeof F=="string"&&q(F)?X(F):X(JSON.stringify(F,null,2));else if(q(j))V(j),R(j),H(j);else try{const he=JSON.parse(j);V(he),R(he),H(he)}catch{}P(he=>!he)}},[ne,I,F,j,g,q]),Oe=_.useCallback(()=>{if(Q([]),g&&g([]),k)typeof w=="string"&&q(w)?X(w):X(JSON.stringify(w,null,2));else if(q(j))R(j),H(j),V(j);else try{const he=JSON.parse(j);R(he),H(he),V(he)}catch{}N(he=>!he)},[k,w,j,g,q]),Te=()=>{H(he=>{const Ae={...he};return delete Ae[""],Ae}),M(!L)},se=_.useCallback(he=>{const Ae=ae(he);R(Ae),H(Ae),V(Ae)},[ae]),ie=_.useCallback(he=>{W.current=he.trim()==="",X(he)},[]),J=_.useCallback(he=>{try{if(!he||he.trim()===""){se({}),f&&f({});return}if(q(he)){f&&f(he.trim());return}let Ae;if(typeof he=="string")try{Ae=JSON.parse(he)}catch{return}else Ae=he;se(Ae),f&&f(Ae)}catch{}},[se,f,q]),K=_.useCallback(()=>{hd(JSON.stringify(w,null,2),"Copied to clipboard"),$(!0),setTimeout(()=>$(!1),2e3)},[w]),re=_.useCallback(he=>{if(he&&he.length>0){const Ae=he.map(fe=>fe.message);Q(Ae)}else Q([]);g&&g(he)},[g]),le={border:"1px solid",borderColor:l?G.palette.error.main:G.palette.grey.outlined.border,borderRadius:2};return d.jsxs(E.Stack,{spacing:1,"data-testid":"json-gui",ref:O,children:[r&&d.jsx(TBe,{"data-testid":"json-info-msg",message:"We recommend you expand this editor to full view for the best experience."}),d.jsx(Co,{open:L,"data-testid":"json-gui-fullscreen-popup",handleClose:Te,title:t||"Global variables",content:d.jsxs(E.Stack,{sx:{width:"100%",height:"80vh"},children:[d.jsx(ss,{variant:"normal",tabs:[{title:"GUI"},{title:"Raw"}],selectedTab:v,sx:{height:24,width:"fit-content",ml:"auto",mb:1},setSelectedTab:()=>{Oe(),C(v==="GUI"?"Raw":"GUI")}}),d.jsxs(E.Box,{sx:{overflow:"auto",position:"relative",height:"100%",background:G.palette.background.paper,...k?{borderRadius:"4px",border:`1px solid ${G.palette.grey[200]}`,p:1}:{}},children:[k?d.jsx(E.Stack,{"data-testid":"json-gui-builder",sx:{"& .MuiPaper-root":{width:"100% !important",borderRadius:"8px !important"}},children:d.jsx(E.Stack,{sx:{width:"100%",height:"auto",position:"relative",top:"unset",left:"unset",zIndex:"auto",maxWidth:"1200px",overflow:typeof w=="object"&&Object.keys(w).length===0?"visible":"auto"},p:1,children:d.jsx(E.Stack,{children:d.jsx(E.Stack,{minHeight:typeof B=="object"&&Object.keys(B).length===1?50:"auto",children:typeof w=="object"&&typeof B=="object"&&d.jsx(LX,{viewOnly:n,editObject:w,setEditObject:R,setTempData:H,id:u,showSuggestions:a,tempData:B,excludePayloadSuggestions:c,onChange:he=>{V(he),f&&f(he)},setIsEditing:Y})})})})}):d.jsx(E.Box,{sx:{height:"100%",overflowY:n?"visible":"auto"},children:d.jsx(_.Suspense,{fallback:d.jsx(FX,{}),children:d.jsx(kX,{size:"lg",language:"json",viewOnly:n,handleChange:ie,handleBlur:J,value:j,id:"code-editor-gui-full",suggestionsData:s,required:o,enableJsonGuiValidation:!0,handleValidate:re,"data-testid":"json-gui-code-editor-full",sx:{border:"none"},height:"75vh",allowArrayAtRoot:!!(m&&m.endsWith("payload"))||!!(m&&m.includes(".payload"))})})}),d.jsx(E.Stack,{onClick:K,sx:{position:"absolute",top:6,right:6,cursor:"pointer"},children:d.jsx(E.Tooltip,{"data-testid":"json-copy-tooltip",title:D?"Copied!":"Copy JSON",children:d.jsx(E.IconButton,{"data-testid":"json-gui-copy",onClick:K,size:"small",children:d.jsx(Ue,{src:"ic_copy",width:15,height:15,sx:{path:{fill:G.palette.common.black}}})})})})]})]})}),d.jsxs(E.Stack,{children:[d.jsxs(E.Stack,{direction:"row",alignItems:"flex-end",justifyContent:"space-between",children:[d.jsx(gn,{label:t||"",required:o,description:i}),h&&d.jsx(ss,{variant:"normal",tabs:[{title:"Static"},{title:"Dynamic"}],selectedTab:x,sx:{height:24},setSelectedTab:()=>{b(x==="Static"?"Dynamic":"Static")}})]}),I?d.jsxs(E.Stack,{children:[d.jsxs(E.Stack,{"data-testid":"json-gui-builder",sx:{...le},children:[d.jsxs(E.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:1,p:1.5,children:[d.jsx(E.Typography,{variant:"smNormal",children:p}),d.jsxs(E.Stack,{direction:"row",position:"relative",alignItems:"center",children:[d.jsx(ss,{variant:"normal",tabs:te,selectedTab:y,sx:{height:24},setSelectedTab:()=>{ue(),T(y==="GUI"?"Raw":"GUI")}}),A&&d.jsx(E.IconButton,{"data-testid":"json-gui-fullscreen-button",onClick:Te,sx:{ml:1,position:"absolute",top:44,right:0,zIndex:999},children:d.jsx(Ue,{src:"ic_maximize"})})]})]}),d.jsx(E.Divider,{}),d.jsx(E.Stack,{sx:{width:"100%",height:"auto",position:"relative",maxWidth:"600px",maxHeight:"calc(80vh - 306px)",overflow:"auto"},p:1,children:d.jsx(E.Stack,{children:typeof w=="object"&&typeof B=="object"&&d.jsx(LX,{viewOnly:n,editObject:w,setEditObject:R,setTempData:H,id:u,showSuggestions:a,tempData:B,excludePayloadSuggestions:c,onChange:he=>{V(he),f&&f(he)},setIsEditing:Y})})})]}),z.length>0?d.jsx(E.Box,{sx:{mt:1},children:z.map((he,Ae)=>d.jsx(E.FormHelperText,{error:!0,children:he},`validation-error-${he}-${Ae}`))}):l?d.jsx(E.FormHelperText,{error:!0,children:l}):null,i&&d.jsx(E.FormHelperText,{children:i})]}):d.jsxs(E.Box,{children:[d.jsxs(E.Box,{sx:{...le,opacity:n?.6:1},children:[d.jsxs(E.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:1,p:1.5,children:[d.jsx(E.Typography,{variant:"smNormal",children:p}),d.jsxs(E.Stack,{direction:"row",alignItems:"center",position:"relative",children:[d.jsx(ss,{variant:"normal",tabs:te,selectedTab:y,sx:{height:24},setSelectedTab:()=>{ue(),T(x==="GUI"?"Raw":"GUI")}}),A&&d.jsx(E.IconButton,{"data-testid":"json-gui-fullscreen-button",onClick:Te,sx:{ml:1,position:"absolute",top:44,right:0,zIndex:999},children:d.jsx(Ue,{src:"ic_maximize"})})]})]}),d.jsx(E.Divider,{}),d.jsx(E.Box,{sx:{height:"100%",overflowY:n?"visible":"auto"},children:d.jsx(_.Suspense,{fallback:d.jsx(FX,{}),children:d.jsx(kX,{size:"lg",language:"json",viewOnly:n,handleChange:ie,handleBlur:J,value:j,id:`code-editor-gui-${u}`,suggestionsData:s,error:!!l,required:o,enableJsonGuiValidation:!0,handleValidate:re,"data-testid":"json-gui-code-editor",showSuggestions:a,codeEditorStyles:{border:"none"},allowArrayAtRoot:!!(m&&m.endsWith("payload"))||!!(m&&m.includes(".payload"))})})})]}),z.length>0?d.jsx(E.Box,{sx:{mt:1},children:z.map((he,Ae)=>d.jsx(E.FormHelperText,{error:!0,children:he},`validation-error-${he}-${Ae}`))}):l?d.jsx(E.FormHelperText,{error:!0,children:l}):null,i&&d.jsx(E.FormHelperText,{children:i})]})]})]})}),TBe=({message:e})=>{const t=E.useTheme();return d.jsxs(E.Stack,{alignItems:"center",spacing:1,direction:"row",sx:{background:t.palette.success[10],borderRadius:2,border:"1px solid",borderColor:t.palette.success[40]},p:1,children:[d.jsx(Ue,{src:"ic_success",sx:{path:{fill:t.palette.success.main}}}),d.jsx(E.Typography,{variant:"xsMedium",children:e})]})},MX=Gi(vBe),Wu=e=>{const{name:t,label:r,viewOnly:n=!1,validationRules:i={},required:o=!1,id:s,description:a,error:l,suggestionsData:u,...c}=e,{trigger:f,control:p}=Rr(),h=_.useRef(null),A=_.useRef([]),g=_.useCallback(y=>{const T=y?.length>0?y.map(v=>v.message):[];A.current=T,f(t)},[t,f]),m=_.useCallback(async y=>{if(i.validate){const v=typeof i.validate=="function"?await i.validate(y):!0;if(v!==!0)return v}const T=A.current;return T.length>0?T[0]:!0},[i.validate]),O=_.useMemo(()=>({...i,validate:m}),[i,m]);return d.jsx(pr,{name:t,control:p,rules:O,render:({field:y,fieldState:{error:T}})=>d.jsx(MX,{...y,ref:h,label:r,data:y.value,viewOnly:n,suggestionsData:u,helperText:a,errorMsg:T?.message||l?.errorMsg,required:o,id:s,showSuggestions:!0,handleValidate:g,onChange:v=>{f(t),y.onChange(v)},...c})})},SBe=_.forwardRef((e,t)=>{const r=ct.useDispatch(),{type:n,openIntegrationDrawer:i,TESSERACT_MAIN_URL:o,ENTITY_ID:s,FRONTEND_URL:a,INTEGRATION_DATA:l,viewOnly:u=!1,id:c}=e,[f,p]=_.useState([]),[h,A]=_.useState(!1),{control:g,watch:m,setValue:O,resetField:y}=Rr(),T=m("properties.auth_type"),v=()=>{A(!0);const C={page_size:999,current_page:1,type:"SOURCE"},x=Xt(o,"/v1/integrations/entity/AUTHENTICATION");zt.get(x,{params:C}).then(({data:b})=>{const w=ro(b.data,["integration_meta"]),R=dT(w);p(fT(R))}).catch(b=>{sr(b,r)}).finally(()=>{A(!1)})};return _.useEffect(()=>{v()},[]),_.useEffect(()=>{l?._id&&l?.meta?.entity==="AUTHENTICATION"&&(v(),O("properties.auth_id",l._id,{shouldValidate:!0}))},[l]),_.useEffect(()=>{!Et(T)&&T!==Nl.NONE?v():y("properties.auth_id")},[T]),d.jsxs(E.Stack,{gap:2.5,children:[d.jsx(Ei,{children:d.jsxs(E.Grid,{container:!0,gap:1.5,children:[d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Yt,{name:"properties.auth_type",control:g,meta:{options:zO,displayName:"Authentication Type",searchFieldPlaceholder:"Search authentication type",placeholder:"Select Authentication Type"},validationRules:{required:"Auth type is required"},id:"auth_type",viewOnly:u,required:!0,onChange:C=>{O("properties.auth_type",C.target.value),O("properties.auth_id","")}})}),T&&T!==Nl.NONE&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Yt,{required:!0,name:"properties.auth_id",control:g,meta:{options:yn(f),displayProps:{loading:h},displayName:"Authentication",value:"",htmlProps:{showAddNew:!0},TESSERACT_MAIN_URL:o,FRONTEND_URL:a,ENTITY_ID:s,openIntegrationDrawer:i,addNewButtonText:"Add new",searchFieldPlaceholder:"Search authentication",authType:"AUTHENTICATION",placeholder:"Select Authentication"},validationRules:{required:"Authentication is required"},viewOnly:u,id:n,groupBy:"integration_meta.auth_type"})})]})}),d.jsx(E.Divider,{}),d.jsx(En,{children:d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Wu,{name:"properties.test_payload",control:g,label:"Test Trigger Payload",viewOnly:u,showSuggestions:!0,excludePayloadSuggestions:!0,id:c})})})]})}),xBe=_.forwardRef(({placeholder:e="",onChange:t,value:r,height:n="100%",width:i="100%",label:o="",required:s=!1,errorMsg:a,helperText:l="",nodeId:u="",name:c,isLoop:f,viewOnly:p=!1,hideLabel:h=!1},A)=>{const g=E.useTheme(),{MCP_INTEGRATION_FORM:m}=aa(),{getNodes:O}=Rt.useReactFlow(),{selectedActivityId:y,aiGeneratedFieldMap:T}=ct.useSelector(G=>G.canvas),v=ao(l),[C,x]=_.useState(""),b=_.useRef(null),w=_.useRef(null),[R,I]=_.useState(""),P=G=>{x(G.target.value)},k=()=>{if(C.trim()!==""){const D=[...Array.isArray(r)?r:[],C.trim().split(",")[0]],$=new Set(D);t([...$]),x("")}},N=G=>{G.preventDefault();const{keyCode:D}=G;[13,32,188].includes(D)&&k()},L=G=>()=>{typeof r=="object"&&Array.isArray(r)&&t(r.filter(D=>D!==G))},M=(G,D)=>{G?.stopPropagation?.(),G?.preventDefault?.(),Array.isArray(r)&&t(r.filter($=>$!==D))},B=G=>{G.keyCode===8&&C.trim()===""?Array.isArray(r)&&r.length>0&&L(r[r.length-1])():G.key==="Enter"&&G.preventDefault()},H=()=>{b.current?.focus()},j=G=>{G.stopPropagation()};_.useEffect(()=>(document.addEventListener("mousedown",j),()=>{document.removeEventListener("mousedown",j)}),[]),_.useEffect(()=>{I(typeof r=="string"?"Dynamic":"Static")},[r]);const X=(()=>{const G=O()||[],D=String(u||""),$=G.find(W=>W?.selected),U=G.find(W=>String(W?.id)===D)||G.find(W=>String(W?.id)===String(y))||$,Y=String(U?.id||""),Q=(T||{})[Y]||(T||{})[String(y||"")]||(T||{})[D];return Q&&typeof Q=="object"?Q:{}})(),F=String(c||"").replace(/^properties\./,""),V=!!F&&F in X&&r!==void 0&&r!==null&&(typeof r!="string"||r.trim()!=="")&&(!Array.isArray(r)||r.length>0);return d.jsx(E.FormControl,{fullWidth:!0,children:d.jsxs(E.Stack,{children:[o&&!h&&d.jsxs(E.Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-end",children:[d.jsx(gn,{required:s,label:o,description:v}),!p&&!m&&d.jsx(E.Stack,{pb:.5,children:d.jsx(ss,{variant:"normal",tabs:[{title:"Static"},{title:"Dynamic"}],selectedTab:R,setSelectedTab:()=>{R==="Static"?(t(""),I("Dynamic")):(t([]),I("Static"))}})})]}),typeof r=="object"&&Array.isArray(r)?d.jsxs(d.Fragment,{children:[d.jsxs(E.Stack,{spacing:1,border:1,sx:{position:"relative",borderColor:a?g.palette.error.main:g.palette.grey[300],":focus-within":{border:`1px solid ${g.palette.neutral.plain}`,transition:"all 100ms ease-in"}},height:n,width:i,borderRadius:2,px:1,py:0,maxHeight:"20rem",overflow:"auto",onClick:H,children:[V&&d.jsx(E.Stack,{sx:{position:"absolute",right:"1px",top:1,bottom:1,width:"15%",minWidth:64,maxWidth:96,borderTopRightRadius:8,borderBottomRightRadius:8,pointerEvents:"none",zIndex:0,background:`linear-gradient(90deg, ${E.alpha(g.palette.primary[5],0)} 0%, ${E.alpha(g.palette.primary[5],.35)} 62%, ${E.alpha(g.palette.primary[5],.9)} 100%)`}}),V&&d.jsx(E.Stack,{sx:{position:"absolute",right:12,top:11,zIndex:3,pointerEvents:"none",width:18,height:18,alignItems:"center",justifyContent:"center"},children:d.jsx(Ue,{src:"ic_AI",width:18,height:18,sx:{display:"block","& svg path":{fill:`${g.palette.primary.main} !important`,fillOpacity:"1 !important"}}})}),d.jsxs(E.Stack,{direction:"row",flexWrap:"nowrap",gap:1,alignItems:"center",ref:w,sx:{maxWidth:"100%",overflow:"hidden",minHeight:40,pr:V?4.75:0,position:"relative",zIndex:1},children:[(()=>{if(!r||!Array.isArray(r)||r.length===0)return null;const{visible:G,extra:D,hiddenSelections:$}=Ub(r||[],w);return d.jsxs(d.Fragment,{children:[G.map((U,Y)=>d.jsx(E.Chip,{label:U,disabled:p,deleteIcon:d.jsx(Ue,{sx:{"& svg":{width:16,height:16}},src:"ic_close"}),onDelete:L(U),sx:{flex:"0 0 auto",minWidth:"40px"}},`input-chip-${U}-${Y}`)),D>0&&d.jsx(Bw,{hiddenSelections:$,extra:D,handleChipDelete:M})]})})(),d.jsx(E.InputBase,{ref:A,fullWidth:!0,autoComplete:"off",placeholder:e,value:C,onChange:P,inputRef:b,onKeyUp:N,readOnly:p,disabled:p,onKeyDown:B,onBlur:()=>k(),sx:{"&.MuiInput-root":{border:"none",flex:1},"& .MuiInputBase-input":{padding:"4px"},":focus":{border:"none"},":focus-within":{border:"none",transition:"none",boxShadow:"none"},":active":{backgroundColor:"transparent"}}})]})]}),a&&d.jsx(E.FormHelperText,{error:!0,children:a})]}):d.jsx(lo,{id:u,language:"plaintext",required:!0,value:r,isLoop:f,viewOnly:p,editorId:`${u}-${c}`,showSuggestions:!0,placeholder:e,handleChange:G=>{t(G)},errorMsg:a,loading:null})]})})}),Qc=vc(xBe),BX=({field:e,type:t,nodeId:r,isLoop:n,viewOnly:i})=>{const o=E.useTheme(),{watch:s,control:a,setValue:l}=Rr(),u=s(e),c=p=>{l(e,u.filter((h,A)=>p!==A))},f=_.useMemo(()=>u?.map((p,h)=>`${r}-${t}-${Date.now()}-${h}`),[r,t,u?.length]);return d.jsx(d.Fragment,{children:u&&u?.map((p,h)=>d.jsxs(E.Grid,{container:!0,sx:{mb:1,py:1},alignItems:"flex-end",justifyContent:"space-between",children:[d.jsx(E.Grid,{item:!0,xs:11,children:d.jsx(kr,{autoFocus:!0,id:r,name:`${e}.${h}`,control:a,meta:{displayName:`Attachment ${h+1}`,description:_n(t,"attachments"),placeholder:`Attachment ${h+1}`},editorId:`${t}-attachment_${h}`,isLoop:n,viewOnly:i})}),d.jsx(E.Grid,{item:!0,xs:.5,sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:u.length>0&&d.jsx(E.IconButton,{sx:{p:.75,width:28,height:28,"& path":{fill:o.palette.neutral.solid.bg},"&:hover path":{fill:o.palette.error[60]},"&:hover":{backgroundColor:"transparent"}},disabled:i,onClick:()=>c(h),children:d.jsx(Ue,{src:"ic_delete",width:20,height:20})})})]},f[h]))})},bBe=e=>{const{field:t,viewOnly:r}=e,{watch:n,setValue:i,unregister:o}=Rr(),{setFieldControlState:s}=aa(),a=n(t),[l,u]=_.useState("BOLTIC_AI"),c=_.useRef([]);_.useEffect(()=>{a==="BOLTIC_AI"||a==="BOLTIC_AI_IGNORE"?u(a):Array.isArray(a)&&u("specific")},[a]);const f=p=>{const h=p.target.value;if(u(h),s(t,h),h==="specific"){const A=Array.isArray(a)&&a.length>0?a:c.current.length>0?c.current:[""];i(t,A)}else Array.isArray(a)&&(c.current=a,a.forEach((A,g)=>{o?.(`${t}.${g}`)}),o?.(t)),i(t,h)};return d.jsxs(E.Stack,{spacing:1.5,mt:.5,children:[d.jsx(E.FormControl,{fullWidth:!0,disabled:r,children:d.jsxs(E.Select,{value:l,onChange:f,children:[d.jsx(E.MenuItem,{sx:{py:.8},value:"BOLTIC_AI",children:"Have AI generate a value for this field"}),d.jsx(E.MenuItem,{sx:{py:.8},value:"BOLTIC_AI_IGNORE",children:"Do not include a value for this field"}),d.jsx(E.MenuItem,{sx:{py:.8},value:"specific",children:"Set a specific value for this field"})]})}),l==="specific"&&d.jsx(BX,{...e})]})},qP=e=>{const{MCP_INTEGRATION_FORM:t}=aa();return t?d.jsx(bBe,{...e}):d.jsx(BX,{...e})},CBe=_.forwardRef((e,t)=>{const{VORTEX_MAIN_URL:r,ENTITY_ID:n,TESSERACT_MAIN_URL:i,WORKFLOW_URLS:o,type:s,id:a,isLoop:l,FRONTEND_URL:u,suggestionsData:c,INTEGRATION_DATA:f,viewOnly:p=!1,openIntegrationDrawer:h}=e,A=ct.useDispatch(),g=E.useTheme(),{control:m,setValue:O,watch:y,getValues:T,formState:{errors:v}}=Rr(),{BOLTIC_EMAIL_DOMAIN:C}=o,x=y("properties"),[b,w]=_.useState([]),[R,I]=_.useState(!1),{loopSuggestionsData:P={}}=ct.useSelector(X=>X.loopActivity),k=_.useCallback(()=>{I(!0);const X={page_size:999,current_page:1,type:"DESTINATION"},F=Xt(i,"/v1/integrations/entity/EMAIL");zt.get(F,{params:X}).then(({data:V})=>{w(ro(V.data))}).catch(V=>{sr(V,A)}).finally(()=>{I(!1)})},[]),N=C?.split(",").map(X=>({title:`@${X.trim()}`,value:`@${X.trim()}`})),[L,M]=_.useState(()=>x.from?`@${x.from?.split("@")[1]}`:N[0]?.value),[B,H]=_.useState(()=>x.from?.split("@")[0]||"");_.useEffect(()=>{k()},[]),_.useEffect(()=>{f?._id&&f?.meta?.entity==="EMAIL"&&(k(),O("properties.email_auth_id",f._id,{shouldValidate:!0}))},[f]);const j=X=>{O(`properties.${X}`,[...T(`properties.${X}`)||[],""])};return d.jsxs(E.Stack,{gap:2.5,children:[d.jsx(Ei,{children:d.jsx(E.Grid,{container:!0,gap:1.5,children:d.jsx(E.Grid,{item:!0,xs:12,children:x.integration_slug==="blt-int.boltic-email"?d.jsxs(E.Stack,{direction:"row",children:[d.jsx(E.Box,{sx:{width:"60%"},children:d.jsx(kr,{id:a,name:"properties.from",control:m,meta:{displayName:"From",description:_n(s,"from"),renderFieldValue:()=>B},viewOnly:p,editorId:`${s}-from`,showSuggestions:!0,isLoop:l,handleChange:X=>{const{value:F}=X;O("properties.from",`${F}${L}`),H(F)},sx:{"& .MuiPaper-root":{borderTopRightRadius:0,borderBottomRightRadius:0,borderRight:"none"}}})}),d.jsx(E.Box,{sx:{width:"40%"},children:d.jsx(Yt,{name:"properties.from",control:m,meta:{options:N,displayName:"Domain",searchFieldPlaceholder:"Search Domain"},viewOnly:p,id:s,renderFieldValue:()=>L,handleChange:X=>{const{value:F}=X;O("properties.from",`${B}${F}`),M(F)},sx:{"& .MuiOutlinedInput-notchedOutline":{borderTopLeftRadius:0,borderBottomLeftRadius:0}}})})]}):d.jsx(Yt,{required:!0,name:"properties.email_auth_id",control:m,meta:{options:yn(b),displayProps:{loading:R},displayName:"Email Account",value:"",htmlProps:{showAddNew:!0},TESSERACT_MAIN_URL:i,FRONTEND_URL:u,ENTITY_ID:n,openIntegrationDrawer:h,addNewButtonText:"Add new account",searchFieldPlaceholder:"Search email account",authType:"EMAIL",description:"Select Email secret here.",placeholder:"Select Email Account"},validationRules:{required:"Email account is required"},viewOnly:p,id:s})})})}),(x.email_auth_id||x.integration_slug==="blt-int.boltic-email")&&d.jsx(E.Divider,{}),(x.email_auth_id||x.integration_slug==="blt-int.boltic-email")&&d.jsx(En,{children:d.jsxs(E.Grid,{container:!0,gap:1.5,children:[d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(kr,{required:!0,id:a,name:"properties.subject",control:m,meta:{displayName:"Subject",description:"Enter the subject to send in the email.",placeholder:"Type or add suggestion"},validationRules:{required:"Subject is required"},viewOnly:p,editorId:`${s}-subject-${l}`,showSuggestions:!0,isLoop:l})}),d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(pr,{name:"properties.to",control:m,rules:{required:"To is required",validate:X=>Array.isArray(X)&&!X.every(V=>fu(V))?"To must have all the valid emails":!0},render:({field:X})=>d.jsx(Qc,{...X,required:!0,nodeId:a,label:"To",name:"to",viewOnly:p,isLoop:l,placeholder:"Enter email",onChange:F=>{X.onChange(typeof F=="string"?F:[...F])},errorMsg:v.properties?.to?.message})})}),d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(pr,{name:"properties.email_template",control:m,rules:{required:"Email body is required"},render:({field:X})=>d.jsx(Fi,{...X,label:"Email body",suggestionLabel:"Email body",id:`${s}-email_template`,activityType:s,VORTEX_MAIN_URL:r,ENTITY_ID:n,size:"md",viewOnly:p,showSuggestions:!0,language:"html",suggestionsData:l?P:c,showExpandOption:!0,showHtmlPreview:!0,errorMsg:v.properties?.email_template?.message,error:!!v.properties?.email_template?.message,handleChange:F=>{X.onChange(F)},required:!0})})}),d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(pr,{name:"properties.cc",control:m,rules:{validate:X=>Array.isArray(X)&&!X.every(V=>fu(V))?"Cc must have all the valid emails":!0},render:({field:X})=>d.jsx(Qc,{...X,nodeId:a,label:"Cc",name:"cc",viewOnly:p,placeholder:"Enter email",isLoop:l,onChange:F=>{X.onChange(typeof F=="string"?F:[...F])},errorMsg:v.properties?.cc?.message})})}),d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(pr,{name:"properties.bcc",control:m,rules:{validate:X=>Array.isArray(X)&&!X.every(V=>fu(V))?"Bcc must have all the valid emails":!0},render:({field:X})=>d.jsx(Qc,{...X,nodeId:a,label:"Bcc",name:"bcc",isLoop:l,viewOnly:p,placeholder:"Enter email",onChange:F=>{X.onChange(typeof F=="string"?F:[...F])},errorMsg:v.properties?.bcc?.message})})}),d.jsxs(E.Grid,{item:!0,xs:12,children:[d.jsxs(E.Box,{sx:{display:"flex",alignItems:"center"},children:[d.jsx(E.FormControl,{fullWidth:!0,sx:{"& > .MuiStack-root > .MuiStack-root":{pb:0}},children:d.jsx(gn,{label:"Attachments",description:"The maximum attachment limit is 25Mb"})}),d.jsx(E.IconButton,{disabled:p,onClick:()=>j("attachments"),sx:{float:"right",p:.75,border:X=>`1px solid ${X.palette.grey.brainstem}`,fontSize:X=>X.typography.mdNormal.fontSize},color:"primary",children:d.jsx(Ue,{src:"ic_plus",width:g.icons.md,height:g.icons.md,sx:{svg:{path:{fill:g.palette.primary.main}}}})})]}),d.jsx(qP,{nodeId:a,type:s,isLoop:l,viewOnly:p,field:"properties.attachments"})]}),!l&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Mi,{viewOnly:p,type:s})})]})})]})}),_Be=Gi(CBe),wBe=_.forwardRef((e,t)=>{const{workflow:r}=ct.useSelector(x=>x.workflows),n=ct.useDispatch(),{type:i,VORTEX_MAIN_URL:o,ENTITY_ID:s,suggestionsData:a,viewOnly:l=!1,id:u}=e,[c,f]=_.useState([]),[p,h]=_.useState(!1),{control:A,setValue:g,watch:m}=Rr(),O=m("properties"),y=E.useTheme(),T=m("properties.child_workflow_id"),v=m("properties.child_workflow_name"),C=async(x="")=>{h(!0);const b={include:["scheduled","published"],limit:100,page:1,name:x};r&&(b.draft_id=r?.id);const w=Xt(o,`/v1.0/${s}/workflows`);zt.get(w,{params:b}).then(({data:R})=>{f(()=>T&&!R.data.find(I=>I.id===T)?[{id:T,name:v,version:O.version},...R.data]:R.data)}).catch(R=>{sr(R,n)}).finally(()=>{h(!1)})};return _.useEffect(()=>{C()},[]),_.useEffect(()=>{if(!T)g("properties",{...O,child_workflow_id:"",version:"",child_workflow_name:""});else{const x=c.find(b=>b.id===T);g("properties",{...O,version:x?.version,child_workflow_name:x?.name})}},[T]),d.jsxs(E.Stack,{gap:2.5,children:[d.jsx(Ei,{children:d.jsx(E.Grid,{container:!0,gap:1.5,children:d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Yt,{required:!0,name:"properties.child_workflow_id",control:A,meta:{options:yn(c),displayName:"Workflow",searchFieldPlaceholder:"Search workflow",description:"Select the child workflow that you want to run",displayProps:{loading:p},placeholder:"Select Workflow"},validationRules:{required:"Workflow is required"},viewOnly:l,id:"child_workflow_id",handleChange:x=>{const{value:b}=x;if(b===""){const w=m("properties");g("properties",{...w,child_workflow_id:"",child_workflow_name:"",version:""})}},renderValueUi:x=>{if(!x)return d.jsx(E.Typography,{sx:{fontSize:"14px",color:y.palette.neutral.solid.bg,fontFamily:"inherit",":hover":{color:y.palette.neutral.main}},children:"Select Workflow"});const b=yn(c)?.find(w=>w?.value===x);return d.jsxs(E.Stack,{direction:"row",gap:1,children:[d.jsx(E.Typography,{sx:{fontSize:"14px",color:y.palette.text.primary,fontFamily:"inherit",...uu,maxWidth:"95%"},children:b?.title}),d.jsx(E.Chip,{sx:{fontSize:11},size:"small",label:`v${b?.version}`})]})},renderOption:(x,b)=>{const{title:w,value:R,version:I}=b;return d.jsx(E.MenuItem,{value:R,sx:{p:"8px !important",mx:1,height:"auto","&.Mui-selected":{"& .MuiTypography-root":{color:y.palette.primary.main}}},children:d.jsxs(E.Stack,{width:"100%",direction:"row",flexWrap:"wrap",sx:{...vf,gap:1},children:[d.jsx(E.Typography,{sx:{fontSize:"1rem",fontWeight:400,color:y.palette.text.primary,whiteSpace:"normal",wordBreak:"break-word",maxWidth:"88%"},children:w}),d.jsx(E.Chip,{sx:{fontSize:11},size:"small",label:`v${I}`})]})},R)}})})})}),O.child_workflow_id&&d.jsx(E.Divider,{}),O.child_workflow_id&&d.jsx(En,{children:d.jsxs(E.Grid,{container:!0,gap:1.5,children:[d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Wu,{name:"properties.payload",label:"Payload",viewOnly:l,id:u,suggestionsData:a,fullScreen:!0,showSuggestions:!0,helperText:"Provide the data needed for the child workflow, which will be available under the 'payload' property in the child workflow. This should always be an object. If you provide an array, only the first element will be used.",validationRules:{required:"Payload is required"}})}),d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Mi,{viewOnly:l,type:i})})]})})]})}),IBe=Gi(wBe,"");var lg={exports:{}};lg.exports;var jX;function DBe(){return jX||(jX=1,(function(e,t){var r=200,n="Expected a function",i="__lodash_hash_undefined__",o=1,s=2,a=9007199254740991,l="[object Arguments]",u="[object Array]",c="[object Boolean]",f="[object Date]",p="[object Error]",h="[object Function]",A="[object GeneratorFunction]",g="[object Map]",m="[object Number]",O="[object Object]",y="[object Promise]",T="[object RegExp]",v="[object Set]",C="[object String]",x="[object Symbol]",b="[object WeakMap]",w="[object ArrayBuffer]",R="[object DataView]",I="[object Float32Array]",P="[object Float64Array]",k="[object Int8Array]",N="[object Int16Array]",L="[object Int32Array]",M="[object Uint8Array]",B="[object Uint8ClampedArray]",H="[object Uint16Array]",j="[object Uint32Array]",X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,F=/^\w*$/,V=/^\./,G=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,D=/[\\^$.*+?()[\]{}|]/g,$=/\\(\\)?/g,U=/^\[object .+?Constructor\]$/,Y=/^(?:0|[1-9]\d*)$/,z={};z[I]=z[P]=z[k]=z[N]=z[L]=z[M]=z[B]=z[H]=z[j]=!0,z[l]=z[u]=z[w]=z[c]=z[R]=z[f]=z[p]=z[h]=z[g]=z[m]=z[O]=z[T]=z[v]=z[C]=z[b]=!1;var Q=typeof Ur=="object"&&Ur&&Ur.Object===Object&&Ur,W=typeof self=="object"&&self&&self.Object===Object&&self,q=Q||W||Function("return this")(),Z=t&&!t.nodeType&&t,te=Z&&!0&&e&&!e.nodeType&&e,ae=te&&te.exports===Z,ne=ae&&Q.process,ue=(function(){try{return ne&&ne.binding("util")}catch{}})(),Oe=ue&&ue.isTypedArray;function Te(xe,We,dt,Tt){for(var qt=-1,Qt=xe?xe.length:0;++qt<Qt;){var or=xe[qt];We(Tt,or,dt(or),xe)}return Tt}function se(xe,We){for(var dt=-1,Tt=xe?xe.length:0;++dt<Tt;)if(We(xe[dt],dt,xe))return!0;return!1}function ie(xe){return function(We){return We?.[xe]}}function J(xe,We){for(var dt=-1,Tt=Array(xe);++dt<xe;)Tt[dt]=We(dt);return Tt}function K(xe){return function(We){return xe(We)}}function re(xe,We){return xe?.[We]}function le(xe){var We=!1;if(xe!=null&&typeof xe.toString!="function")try{We=!!(xe+"")}catch{}return We}function he(xe){var We=-1,dt=Array(xe.size);return xe.forEach(function(Tt,qt){dt[++We]=[qt,Tt]}),dt}function Ae(xe,We){return function(dt){return xe(We(dt))}}function fe(xe){var We=-1,dt=Array(xe.size);return xe.forEach(function(Tt){dt[++We]=Tt}),dt}var Se=Array.prototype,ge=Function.prototype,ye=Object.prototype,je=q["__core-js_shared__"],Qe=(function(){var xe=/[^.]+$/.exec(je&&je.keys&&je.keys.IE_PROTO||"");return xe?"Symbol(src)_1."+xe:""})(),$e=ge.toString,Je=ye.hasOwnProperty,rt=ye.toString,tt=RegExp("^"+$e.call(Je).replace(D,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ie=q.Symbol,Ve=q.Uint8Array,He=ye.propertyIsEnumerable,Ee=Se.splice,_e=Ae(Object.keys,Object),we=Gn(q,"DataView"),ee=Gn(q,"Map"),de=Gn(q,"Promise"),be=Gn(q,"Set"),Ge=Gn(q,"WeakMap"),Ne=Gn(Object,"create"),Me=Be(we),mt=Be(ee),St=Be(de),De=Be(be),nt=Be(Ge),ut=Ie?Ie.prototype:void 0,Ot=ut?ut.valueOf:void 0,It=ut?ut.toString:void 0;function Mt(xe){var We=-1,dt=xe?xe.length:0;for(this.clear();++We<dt;){var Tt=xe[We];this.set(Tt[0],Tt[1])}}function Dt(){this.__data__=Ne?Ne(null):{}}function Fe(xe){return this.has(xe)&&delete this.__data__[xe]}function Ye(xe){var We=this.__data__;if(Ne){var dt=We[xe];return dt===i?void 0:dt}return Je.call(We,xe)?We[xe]:void 0}function Xe(xe){var We=this.__data__;return Ne?We[xe]!==void 0:Je.call(We,xe)}function at(xe,We){var dt=this.__data__;return dt[xe]=Ne&&We===void 0?i:We,this}Mt.prototype.clear=Dt,Mt.prototype.delete=Fe,Mt.prototype.get=Ye,Mt.prototype.has=Xe,Mt.prototype.set=at;function yt(xe){var We=-1,dt=xe?xe.length:0;for(this.clear();++We<dt;){var Tt=xe[We];this.set(Tt[0],Tt[1])}}function vt(){this.__data__=[]}function $t(xe){var We=this.__data__,dt=vr(We,xe);if(dt<0)return!1;var Tt=We.length-1;return dt==Tt?We.pop():Ee.call(We,dt,1),!0}function Re(xe){var We=this.__data__,dt=vr(We,xe);return dt<0?void 0:We[dt][1]}function it(xe){return vr(this.__data__,xe)>-1}function et(xe,We){var dt=this.__data__,Tt=vr(dt,xe);return Tt<0?dt.push([xe,We]):dt[Tt][1]=We,this}yt.prototype.clear=vt,yt.prototype.delete=$t,yt.prototype.get=Re,yt.prototype.has=it,yt.prototype.set=et;function Pe(xe){var We=-1,dt=xe?xe.length:0;for(this.clear();++We<dt;){var Tt=xe[We];this.set(Tt[0],Tt[1])}}function st(){this.__data__={hash:new Mt,map:new(ee||yt),string:new Mt}}function gt(xe){return sn(this,xe).delete(xe)}function Zt(xe){return sn(this,xe).get(xe)}function dr(xe){return sn(this,xe).has(xe)}function Mr(xe,We){return sn(this,xe).set(xe,We),this}Pe.prototype.clear=st,Pe.prototype.delete=gt,Pe.prototype.get=Zt,Pe.prototype.has=dr,Pe.prototype.set=Mr;function hn(xe){var We=-1,dt=xe?xe.length:0;for(this.__data__=new Pe;++We<dt;)this.add(xe[We])}function dn(xe){return this.__data__.set(xe,i),this}function An(xe){return this.__data__.has(xe)}hn.prototype.add=hn.prototype.push=dn,hn.prototype.has=An;function lr(xe){this.__data__=new yt(xe)}function _r(){this.__data__=new yt}function wn(xe){return this.__data__.delete(xe)}function Ft(xe){return this.__data__.get(xe)}function Jt(xe){return this.__data__.has(xe)}function $r(xe,We){var dt=this.__data__;if(dt instanceof yt){var Tt=dt.__data__;if(!ee||Tt.length<r-1)return Tt.push([xe,We]),this;dt=this.__data__=new Pe(Tt)}return dt.set(xe,We),this}lr.prototype.clear=_r,lr.prototype.delete=wn,lr.prototype.get=Ft,lr.prototype.has=Jt,lr.prototype.set=$r;function Cr(xe,We){var dt=rn(xe)||wr(xe)?J(xe.length,String):[],Tt=dt.length,qt=!!Tt;for(var Qt in xe)Je.call(xe,Qt)&&!(qt&&(Qt=="length"||zs(Qt,Tt)))&&dt.push(Qt);return dt}function vr(xe,We){for(var dt=xe.length;dt--;)if(Xr(xe[dt][0],We))return dt;return-1}function Fr(xe,We,dt,Tt){return Vr(xe,function(qt,Qt,or){We(Tt,qt,dt(qt),or)}),Tt}var Vr=Ca(Cn),Br=Dl();function Cn(xe,We){return xe&&Br(xe,We,Ke)}function Sn(xe,We){We=Xs(We,xe)?[We]:ti(We);for(var dt=0,Tt=We.length;xe!=null&&dt<Tt;)xe=xe[me(We[dt++])];return dt&&dt==Tt?xe:void 0}function Ln(xe){return rt.call(xe)}function Ti(xe,We){return xe!=null&&We in Object(xe)}function eo(xe,We,dt,Tt,qt){return xe===We?!0:xe==null||We==null||!so(xe)&&!ri(We)?xe!==xe&&We!==We:en(xe,We,eo,dt,Tt,qt)}function en(xe,We,dt,Tt,qt,Qt){var or=rn(xe),gr=rn(We),mr=u,Ir=u;or||(mr=Si(xe),mr=mr==l?O:mr),gr||(Ir=Si(We),Ir=Ir==l?O:Ir);var qr=mr==O&&!le(xe),jr=Ir==O&&!le(We),nn=mr==Ir;if(nn&&!qr)return Qt||(Qt=new lr),or||to(xe)?rs(xe,We,dt,Tt,qt,Qt):pi(xe,We,mr,dt,Tt,qt,Qt);if(!(qt&s)){var Zr=qr&&Je.call(xe,"__wrapped__"),Ui=jr&&Je.call(We,"__wrapped__");if(Zr||Ui){var Wo=Zr?xe.value():xe,Ds=Ui?We.value():We;return Qt||(Qt=new lr),dt(Wo,Ds,Tt,qt,Qt)}}return nn?(Qt||(Qt=new lr),Rl(xe,We,dt,Tt,qt,Qt)):!1}function To(xe,We,dt,Tt){var qt=dt.length,Qt=qt;if(xe==null)return!Qt;for(xe=Object(xe);qt--;){var or=dt[qt];if(or[2]?or[1]!==xe[or[0]]:!(or[0]in xe))return!1}for(;++qt<Qt;){or=dt[qt];var gr=or[0],mr=xe[gr],Ir=or[1];if(or[2]){if(mr===void 0&&!(gr in xe))return!1}else{var qr=new lr,jr;if(!(jr===void 0?eo(Ir,mr,Tt,o|s,qr):jr))return!1}}return!0}function oe(xe){if(!so(xe)||So(xe))return!1;var We=kn(xe)||le(xe)?tt:U;return We.test(Be(xe))}function Ce(xe){return ri(xe)&&Qi(xe.length)&&!!z[rt.call(xe)]}function ze(xe){return typeof xe=="function"?xe:xe==null?pt:typeof xe=="object"?rn(xe)?er(xe[0],xe[1]):Pt(xe):Ut(xe)}function lt(xe){if(!Is(xe))return _e(xe);var We=[];for(var dt in Object(xe))Je.call(xe,dt)&&dt!="constructor"&&We.push(dt);return We}function Pt(xe){var We=zn(xe);return We.length==1&&We[0][2]?au(We[0][0],We[0][1]):function(dt){return dt===xe||To(dt,xe,We)}}function er(xe,We){return Xs(xe)&&Go(We)?au(me(xe),We):function(dt){var Tt=pe(dt,xe);return Tt===void 0&&Tt===We?Le(dt,xe):eo(We,Tt,void 0,o|s)}}function Yr(xe){return function(We){return Sn(We,xe)}}function Kr(xe){if(typeof xe=="string")return xe;if(zi(xe))return It?It.call(xe):"";var We=xe+"";return We=="0"&&1/xe==-1/0?"-0":We}function ti(xe){return rn(xe)?xe:lc(xe)}function Mn(xe,We){return function(dt,Tt){var qt=rn(dt)?Te:Fr,Qt={};return qt(dt,xe,ze(Tt),Qt)}}function Ca(xe,We){return function(dt,Tt){if(dt==null)return dt;if(!mn(dt))return xe(dt,Tt);for(var qt=dt.length,Qt=-1,or=Object(dt);++Qt<qt&&Tt(or[Qt],Qt,or)!==!1;);return dt}}function Dl(xe){return function(We,dt,Tt){for(var qt=-1,Qt=Object(We),or=Tt(We),gr=or.length;gr--;){var mr=or[++qt];if(dt(Qt[mr],mr,Qt)===!1)break}return We}}function rs(xe,We,dt,Tt,qt,Qt){var or=qt&s,gr=xe.length,mr=We.length;if(gr!=mr&&!(or&&mr>gr))return!1;var Ir=Qt.get(xe);if(Ir&&Qt.get(We))return Ir==We;var qr=-1,jr=!0,nn=qt&o?new hn:void 0;for(Qt.set(xe,We),Qt.set(We,xe);++qr<gr;){var Zr=xe[qr],Ui=We[qr];if(Tt)var Wo=or?Tt(Ui,Zr,qr,We,xe,Qt):Tt(Zr,Ui,qr,xe,We,Qt);if(Wo!==void 0){if(Wo)continue;jr=!1;break}if(nn){if(!se(We,function(Ds,Xi){if(!nn.has(Xi)&&(Zr===Ds||dt(Zr,Ds,Tt,qt,Qt)))return nn.add(Xi)})){jr=!1;break}}else if(!(Zr===Ui||dt(Zr,Ui,Tt,qt,Qt))){jr=!1;break}}return Qt.delete(xe),Qt.delete(We),jr}function pi(xe,We,dt,Tt,qt,Qt,or){switch(dt){case R:if(xe.byteLength!=We.byteLength||xe.byteOffset!=We.byteOffset)return!1;xe=xe.buffer,We=We.buffer;case w:return!(xe.byteLength!=We.byteLength||!Tt(new Ve(xe),new Ve(We)));case c:case f:case m:return Xr(+xe,+We);case p:return xe.name==We.name&&xe.message==We.message;case T:case C:return xe==We+"";case g:var gr=he;case v:var mr=Qt&s;if(gr||(gr=fe),xe.size!=We.size&&!mr)return!1;var Ir=or.get(xe);if(Ir)return Ir==We;Qt|=o,or.set(xe,We);var qr=rs(gr(xe),gr(We),Tt,qt,Qt,or);return or.delete(xe),qr;case x:if(Ot)return Ot.call(xe)==Ot.call(We)}return!1}function Rl(xe,We,dt,Tt,qt,Qt){var or=qt&s,gr=Ke(xe),mr=gr.length,Ir=Ke(We),qr=Ir.length;if(mr!=qr&&!or)return!1;for(var jr=mr;jr--;){var nn=gr[jr];if(!(or?nn in We:Je.call(We,nn)))return!1}var Zr=Qt.get(xe);if(Zr&&Qt.get(We))return Zr==We;var Ui=!0;Qt.set(xe,We),Qt.set(We,xe);for(var Wo=or;++jr<mr;){nn=gr[jr];var Ds=xe[nn],Xi=We[nn];if(Tt)var gf=or?Tt(Xi,Ds,nn,We,xe,Qt):Tt(Ds,Xi,nn,xe,We,Qt);if(!(gf===void 0?Ds===Xi||dt(Ds,Xi,Tt,qt,Qt):gf)){Ui=!1;break}Wo||(Wo=nn=="constructor")}if(Ui&&!Wo){var Wx=xe.constructor,Qx=We.constructor;Wx!=Qx&&"constructor"in xe&&"constructor"in We&&!(typeof Wx=="function"&&Wx instanceof Wx&&typeof Qx=="function"&&Qx instanceof Qx)&&(Ui=!1)}return Qt.delete(xe),Qt.delete(We),Ui}function sn(xe,We){var dt=xe.__data__;return ac(We)?dt[typeof We=="string"?"string":"hash"]:dt.map}function zn(xe){for(var We=Ke(xe),dt=We.length;dt--;){var Tt=We[dt],qt=xe[Tt];We[dt]=[Tt,qt,Go(qt)]}return We}function Gn(xe,We){var dt=re(xe,We);return oe(dt)?dt:void 0}var Si=Ln;(we&&Si(new we(new ArrayBuffer(1)))!=R||ee&&Si(new ee)!=g||de&&Si(de.resolve())!=y||be&&Si(new be)!=v||Ge&&Si(new Ge)!=b)&&(Si=function(xe){var We=rt.call(xe),dt=We==O?xe.constructor:void 0,Tt=dt?Be(dt):void 0;if(Tt)switch(Tt){case Me:return R;case mt:return g;case St:return y;case De:return v;case nt:return b}return We});function Qs(xe,We,dt){We=Xs(We,xe)?[We]:ti(We);for(var Tt,qt=-1,or=We.length;++qt<or;){var Qt=me(We[qt]);if(!(Tt=xe!=null&&dt(xe,Qt)))break;xe=xe[Qt]}if(Tt)return Tt;var or=xe?xe.length:0;return!!or&&Qi(or)&&zs(Qt,or)&&(rn(xe)||wr(xe))}function zs(xe,We){return We=We??a,!!We&&(typeof xe=="number"||Y.test(xe))&&xe>-1&&xe%1==0&&xe<We}function Xs(xe,We){if(rn(xe))return!1;var dt=typeof xe;return dt=="number"||dt=="symbol"||dt=="boolean"||xe==null||zi(xe)?!0:F.test(xe)||!X.test(xe)||We!=null&&xe in Object(We)}function ac(xe){var We=typeof xe;return We=="string"||We=="number"||We=="symbol"||We=="boolean"?xe!=="__proto__":xe===null}function So(xe){return!!Qe&&Qe in xe}function Is(xe){var We=xe&&xe.constructor,dt=typeof We=="function"&&We.prototype||ye;return xe===dt}function Go(xe){return xe===xe&&!so(xe)}function au(xe,We){return function(dt){return dt==null?!1:dt[xe]===We&&(We!==void 0||xe in Object(dt))}}var lc=kt(function(xe){xe=qs(xe);var We=[];return V.test(xe)&&We.push(""),xe.replace(G,function(dt,Tt,qt,Qt){We.push(qt?Qt.replace($,"$1"):Tt||dt)}),We});function me(xe){if(typeof xe=="string"||zi(xe))return xe;var We=xe+"";return We=="0"&&1/xe==-1/0?"-0":We}function Be(xe){if(xe!=null){try{return $e.call(xe)}catch{}try{return xe+""}catch{}}return""}var ot=Mn(function(xe,We,dt){Je.call(xe,dt)?xe[dt].push(We):xe[dt]=[We]});function kt(xe,We){if(typeof xe!="function"||We&&typeof We!="function")throw new TypeError(n);var dt=function(){var Tt=arguments,qt=We?We.apply(this,Tt):Tt[0],Qt=dt.cache;if(Qt.has(qt))return Qt.get(qt);var or=xe.apply(this,Tt);return dt.cache=Qt.set(qt,or),or};return dt.cache=new(kt.Cache||Pe),dt}kt.Cache=Pe;function Xr(xe,We){return xe===We||xe!==xe&&We!==We}function wr(xe){return $i(xe)&&Je.call(xe,"callee")&&(!He.call(xe,"callee")||rt.call(xe)==l)}var rn=Array.isArray;function mn(xe){return xe!=null&&Qi(xe.length)&&!kn(xe)}function $i(xe){return ri(xe)&&mn(xe)}function kn(xe){var We=so(xe)?rt.call(xe):"";return We==h||We==A}function Qi(xe){return typeof xe=="number"&&xe>-1&&xe%1==0&&xe<=a}function so(xe){var We=typeof xe;return!!xe&&(We=="object"||We=="function")}function ri(xe){return!!xe&&typeof xe=="object"}function zi(xe){return typeof xe=="symbol"||ri(xe)&&rt.call(xe)==x}var to=Oe?K(Oe):Ce;function qs(xe){return xe==null?"":Kr(xe)}function pe(xe,We,dt){var Tt=xe==null?void 0:Sn(xe,We);return Tt===void 0?dt:Tt}function Le(xe,We){return xe!=null&&Qs(xe,We,Ti)}function Ke(xe){return mn(xe)?Cr(xe):lt(xe)}function pt(xe){return xe}function Ut(xe){return Xs(xe)?ie(me(xe)):Yr(xe)}e.exports=ot})(lg,lg.exports)),lg.exports}var RBe=DBe();const YP=Un(RBe);var ug={exports:{}};ug.exports;var $X;function PBe(){return $X||($X=1,(function(e,t){var r=200,n="Expected a function",i="__lodash_hash_undefined__",o=1,s=2,a=9007199254740991,l="[object Arguments]",u="[object Array]",c="[object Boolean]",f="[object Date]",p="[object Error]",h="[object Function]",A="[object GeneratorFunction]",g="[object Map]",m="[object Number]",O="[object Object]",y="[object Promise]",T="[object RegExp]",v="[object Set]",C="[object String]",x="[object Symbol]",b="[object WeakMap]",w="[object ArrayBuffer]",R="[object DataView]",I="[object Float32Array]",P="[object Float64Array]",k="[object Int8Array]",N="[object Int16Array]",L="[object Int32Array]",M="[object Uint8Array]",B="[object Uint8ClampedArray]",H="[object Uint16Array]",j="[object Uint32Array]",X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,F=/^\w*$/,V=/^\./,G=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,D=/[\\^$.*+?()[\]{}|]/g,$=/\\(\\)?/g,U=/^\[object .+?Constructor\]$/,Y=/^(?:0|[1-9]\d*)$/,z={};z[I]=z[P]=z[k]=z[N]=z[L]=z[M]=z[B]=z[H]=z[j]=!0,z[l]=z[u]=z[w]=z[c]=z[R]=z[f]=z[p]=z[h]=z[g]=z[m]=z[O]=z[T]=z[v]=z[C]=z[b]=!1;var Q=typeof Ur=="object"&&Ur&&Ur.Object===Object&&Ur,W=typeof self=="object"&&self&&self.Object===Object&&self,q=Q||W||Function("return this")(),Z=t&&!t.nodeType&&t,te=Z&&!0&&e&&!e.nodeType&&e,ae=te&&te.exports===Z,ne=ae&&Q.process,ue=(function(){try{return ne&&ne.binding("util")}catch{}})(),Oe=ue&&ue.isTypedArray;function Te(pe,Le){for(var Ke=-1,pt=pe?pe.length:0;++Ke<pt;)if(Le(pe[Ke],Ke,pe))return!0;return!1}function se(pe){return function(Le){return Le?.[pe]}}function ie(pe,Le){for(var Ke=-1,pt=Array(pe);++Ke<pe;)pt[Ke]=Le(Ke);return pt}function J(pe){return function(Le){return pe(Le)}}function K(pe,Le){return pe?.[Le]}function re(pe){var Le=!1;if(pe!=null&&typeof pe.toString!="function")try{Le=!!(pe+"")}catch{}return Le}function le(pe){var Le=-1,Ke=Array(pe.size);return pe.forEach(function(pt,Ut){Ke[++Le]=[Ut,pt]}),Ke}function he(pe,Le){return function(Ke){return pe(Le(Ke))}}function Ae(pe){var Le=-1,Ke=Array(pe.size);return pe.forEach(function(pt){Ke[++Le]=pt}),Ke}var fe=Array.prototype,Se=Function.prototype,ge=Object.prototype,ye=q["__core-js_shared__"],je=(function(){var pe=/[^.]+$/.exec(ye&&ye.keys&&ye.keys.IE_PROTO||"");return pe?"Symbol(src)_1."+pe:""})(),Qe=Se.toString,$e=ge.hasOwnProperty,Je=ge.toString,rt=RegExp("^"+Qe.call($e).replace(D,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),tt=q.Symbol,Ie=q.Uint8Array,Ve=ge.propertyIsEnumerable,He=fe.splice,Ee=he(Object.keys,Object),_e=rs(q,"DataView"),we=rs(q,"Map"),ee=rs(q,"Promise"),de=rs(q,"Set"),be=rs(q,"WeakMap"),Ge=rs(Object,"create"),Ne=Is(_e),Me=Is(we),mt=Is(ee),St=Is(de),De=Is(be),nt=tt?tt.prototype:void 0,ut=nt?nt.valueOf:void 0,Ot=nt?nt.toString:void 0;function It(pe){var Le=-1,Ke=pe?pe.length:0;for(this.clear();++Le<Ke;){var pt=pe[Le];this.set(pt[0],pt[1])}}function Mt(){this.__data__=Ge?Ge(null):{}}function Dt(pe){return this.has(pe)&&delete this.__data__[pe]}function Fe(pe){var Le=this.__data__;if(Ge){var Ke=Le[pe];return Ke===i?void 0:Ke}return $e.call(Le,pe)?Le[pe]:void 0}function Ye(pe){var Le=this.__data__;return Ge?Le[pe]!==void 0:$e.call(Le,pe)}function Xe(pe,Le){var Ke=this.__data__;return Ke[pe]=Ge&&Le===void 0?i:Le,this}It.prototype.clear=Mt,It.prototype.delete=Dt,It.prototype.get=Fe,It.prototype.has=Ye,It.prototype.set=Xe;function at(pe){var Le=-1,Ke=pe?pe.length:0;for(this.clear();++Le<Ke;){var pt=pe[Le];this.set(pt[0],pt[1])}}function yt(){this.__data__=[]}function vt(pe){var Le=this.__data__,Ke=Cr(Le,pe);if(Ke<0)return!1;var pt=Le.length-1;return Ke==pt?Le.pop():He.call(Le,Ke,1),!0}function $t(pe){var Le=this.__data__,Ke=Cr(Le,pe);return Ke<0?void 0:Le[Ke][1]}function Re(pe){return Cr(this.__data__,pe)>-1}function it(pe,Le){var Ke=this.__data__,pt=Cr(Ke,pe);return pt<0?Ke.push([pe,Le]):Ke[pt][1]=Le,this}at.prototype.clear=yt,at.prototype.delete=vt,at.prototype.get=$t,at.prototype.has=Re,at.prototype.set=it;function et(pe){var Le=-1,Ke=pe?pe.length:0;for(this.clear();++Le<Ke;){var pt=pe[Le];this.set(pt[0],pt[1])}}function Pe(){this.__data__={hash:new It,map:new(we||at),string:new It}}function st(pe){return Ca(this,pe).delete(pe)}function gt(pe){return Ca(this,pe).get(pe)}function Zt(pe){return Ca(this,pe).has(pe)}function dr(pe,Le){return Ca(this,pe).set(pe,Le),this}et.prototype.clear=Pe,et.prototype.delete=st,et.prototype.get=gt,et.prototype.has=Zt,et.prototype.set=dr;function Mr(pe){var Le=-1,Ke=pe?pe.length:0;for(this.__data__=new et;++Le<Ke;)this.add(pe[Le])}function hn(pe){return this.__data__.set(pe,i),this}function dn(pe){return this.__data__.has(pe)}Mr.prototype.add=Mr.prototype.push=hn,Mr.prototype.has=dn;function An(pe){this.__data__=new at(pe)}function lr(){this.__data__=new at}function _r(pe){return this.__data__.delete(pe)}function wn(pe){return this.__data__.get(pe)}function Ft(pe){return this.__data__.has(pe)}function Jt(pe,Le){var Ke=this.__data__;if(Ke instanceof at){var pt=Ke.__data__;if(!we||pt.length<r-1)return pt.push([pe,Le]),this;Ke=this.__data__=new et(pt)}return Ke.set(pe,Le),this}An.prototype.clear=lr,An.prototype.delete=_r,An.prototype.get=wn,An.prototype.has=Ft,An.prototype.set=Jt;function $r(pe,Le){var Ke=me(pe)||lc(pe)?ie(pe.length,String):[],pt=Ke.length,Ut=!!pt;for(var xe in pe)$e.call(pe,xe)&&!(Ut&&(xe=="length"||sn(xe,pt)))&&Ke.push(xe);return Ke}function Cr(pe,Le){for(var Ke=pe.length;Ke--;)if(au(pe[Ke][0],Le))return Ke;return-1}var vr=Yr();function Fr(pe,Le){return pe&&vr(pe,Le,ri)}function Vr(pe,Le){Le=zn(Le,pe)?[Le]:er(Le);for(var Ke=0,pt=Le.length;pe!=null&&Ke<pt;)pe=pe[So(Le[Ke++])];return Ke&&Ke==pt?pe:void 0}function Br(pe){return Je.call(pe)}function Cn(pe,Le){return pe!=null&&Le in Object(pe)}function Sn(pe,Le,Ke,pt,Ut){return pe===Le?!0:pe==null||Le==null||!wr(pe)&&!rn(Le)?pe!==pe&&Le!==Le:Ln(pe,Le,Sn,Ke,pt,Ut)}function Ln(pe,Le,Ke,pt,Ut,xe){var We=me(pe),dt=me(Le),Tt=u,qt=u;We||(Tt=pi(pe),Tt=Tt==l?O:Tt),dt||(qt=pi(Le),qt=qt==l?O:qt);var Qt=Tt==O&&!re(pe),or=qt==O&&!re(Le),gr=Tt==qt;if(gr&&!Qt)return xe||(xe=new An),We||$i(pe)?Kr(pe,Le,Ke,pt,Ut,xe):ti(pe,Le,Tt,Ke,pt,Ut,xe);if(!(Ut&s)){var mr=Qt&&$e.call(pe,"__wrapped__"),Ir=or&&$e.call(Le,"__wrapped__");if(mr||Ir){var qr=mr?pe.value():pe,jr=Ir?Le.value():Le;return xe||(xe=new An),Ke(qr,jr,pt,Ut,xe)}}return gr?(xe||(xe=new An),Mn(pe,Le,Ke,pt,Ut,xe)):!1}function Ti(pe,Le,Ke,pt){var Ut=Ke.length,xe=Ut;if(pe==null)return!xe;for(pe=Object(pe);Ut--;){var We=Ke[Ut];if(We[2]?We[1]!==pe[We[0]]:!(We[0]in pe))return!1}for(;++Ut<xe;){We=Ke[Ut];var dt=We[0],Tt=pe[dt],qt=We[1];if(We[2]){if(Tt===void 0&&!(dt in pe))return!1}else{var Qt=new An,or;if(!(or===void 0?Sn(qt,Tt,pt,o|s,Qt):or))return!1}}return!0}function eo(pe){if(!wr(pe)||Si(pe))return!1;var Le=kt(pe)||re(pe)?rt:U;return Le.test(Is(pe))}function en(pe){return rn(pe)&&Xr(pe.length)&&!!z[Je.call(pe)]}function To(pe){return typeof pe=="function"?pe:pe==null?to:typeof pe=="object"?me(pe)?ze(pe[0],pe[1]):Ce(pe):qs(pe)}function oe(pe){if(!Qs(pe))return Ee(pe);var Le=[];for(var Ke in Object(pe))$e.call(pe,Ke)&&Ke!="constructor"&&Le.push(Ke);return Le}function Ce(pe){var Le=Dl(pe);return Le.length==1&&Le[0][2]?Xs(Le[0][0],Le[0][1]):function(Ke){return Ke===pe||Ti(Ke,pe,Le)}}function ze(pe,Le){return zn(pe)&&zs(Le)?Xs(So(pe),Le):function(Ke){var pt=Qi(Ke,pe);return pt===void 0&&pt===Le?so(Ke,pe):Sn(Le,pt,void 0,o|s)}}function lt(pe){return function(Le){return Vr(Le,pe)}}function Pt(pe){if(typeof pe=="string")return pe;if(mn(pe))return Ot?Ot.call(pe):"";var Le=pe+"";return Le=="0"&&1/pe==-1/0?"-0":Le}function er(pe){return me(pe)?pe:ac(pe)}function Yr(pe){return function(Le,Ke,pt){for(var Ut=-1,xe=Object(Le),We=pt(Le),dt=We.length;dt--;){var Tt=We[++Ut];if(Ke(xe[Tt],Tt,xe)===!1)break}return Le}}function Kr(pe,Le,Ke,pt,Ut,xe){var We=Ut&s,dt=pe.length,Tt=Le.length;if(dt!=Tt&&!(We&&Tt>dt))return!1;var qt=xe.get(pe);if(qt&&xe.get(Le))return qt==Le;var Qt=-1,or=!0,gr=Ut&o?new Mr:void 0;for(xe.set(pe,Le),xe.set(Le,pe);++Qt<dt;){var mr=pe[Qt],Ir=Le[Qt];if(pt)var qr=We?pt(Ir,mr,Qt,Le,pe,xe):pt(mr,Ir,Qt,pe,Le,xe);if(qr!==void 0){if(qr)continue;or=!1;break}if(gr){if(!Te(Le,function(jr,nn){if(!gr.has(nn)&&(mr===jr||Ke(mr,jr,pt,Ut,xe)))return gr.add(nn)})){or=!1;break}}else if(!(mr===Ir||Ke(mr,Ir,pt,Ut,xe))){or=!1;break}}return xe.delete(pe),xe.delete(Le),or}function ti(pe,Le,Ke,pt,Ut,xe,We){switch(Ke){case R:if(pe.byteLength!=Le.byteLength||pe.byteOffset!=Le.byteOffset)return!1;pe=pe.buffer,Le=Le.buffer;case w:return!(pe.byteLength!=Le.byteLength||!pt(new Ie(pe),new Ie(Le)));case c:case f:case m:return au(+pe,+Le);case p:return pe.name==Le.name&&pe.message==Le.message;case T:case C:return pe==Le+"";case g:var dt=le;case v:var Tt=xe&s;if(dt||(dt=Ae),pe.size!=Le.size&&!Tt)return!1;var qt=We.get(pe);if(qt)return qt==Le;xe|=o,We.set(pe,Le);var Qt=Kr(dt(pe),dt(Le),pt,Ut,xe,We);return We.delete(pe),Qt;case x:if(ut)return ut.call(pe)==ut.call(Le)}return!1}function Mn(pe,Le,Ke,pt,Ut,xe){var We=Ut&s,dt=ri(pe),Tt=dt.length,qt=ri(Le),Qt=qt.length;if(Tt!=Qt&&!We)return!1;for(var or=Tt;or--;){var gr=dt[or];if(!(We?gr in Le:$e.call(Le,gr)))return!1}var mr=xe.get(pe);if(mr&&xe.get(Le))return mr==Le;var Ir=!0;xe.set(pe,Le),xe.set(Le,pe);for(var qr=We;++or<Tt;){gr=dt[or];var jr=pe[gr],nn=Le[gr];if(pt)var Zr=We?pt(nn,jr,gr,Le,pe,xe):pt(jr,nn,gr,pe,Le,xe);if(!(Zr===void 0?jr===nn||Ke(jr,nn,pt,Ut,xe):Zr)){Ir=!1;break}qr||(qr=gr=="constructor")}if(Ir&&!qr){var Ui=pe.constructor,Wo=Le.constructor;Ui!=Wo&&"constructor"in pe&&"constructor"in Le&&!(typeof Ui=="function"&&Ui instanceof Ui&&typeof Wo=="function"&&Wo instanceof Wo)&&(Ir=!1)}return xe.delete(pe),xe.delete(Le),Ir}function Ca(pe,Le){var Ke=pe.__data__;return Gn(Le)?Ke[typeof Le=="string"?"string":"hash"]:Ke.map}function Dl(pe){for(var Le=ri(pe),Ke=Le.length;Ke--;){var pt=Le[Ke],Ut=pe[pt];Le[Ke]=[pt,Ut,zs(Ut)]}return Le}function rs(pe,Le){var Ke=K(pe,Le);return eo(Ke)?Ke:void 0}var pi=Br;(_e&&pi(new _e(new ArrayBuffer(1)))!=R||we&&pi(new we)!=g||ee&&pi(ee.resolve())!=y||de&&pi(new de)!=v||be&&pi(new be)!=b)&&(pi=function(pe){var Le=Je.call(pe),Ke=Le==O?pe.constructor:void 0,pt=Ke?Is(Ke):void 0;if(pt)switch(pt){case Ne:return R;case Me:return g;case mt:return y;case St:return v;case De:return b}return Le});function Rl(pe,Le,Ke){Le=zn(Le,pe)?[Le]:er(Le);for(var pt,Ut=-1,We=Le.length;++Ut<We;){var xe=So(Le[Ut]);if(!(pt=pe!=null&&Ke(pe,xe)))break;pe=pe[xe]}if(pt)return pt;var We=pe?pe.length:0;return!!We&&Xr(We)&&sn(xe,We)&&(me(pe)||lc(pe))}function sn(pe,Le){return Le=Le??a,!!Le&&(typeof pe=="number"||Y.test(pe))&&pe>-1&&pe%1==0&&pe<Le}function zn(pe,Le){if(me(pe))return!1;var Ke=typeof pe;return Ke=="number"||Ke=="symbol"||Ke=="boolean"||pe==null||mn(pe)?!0:F.test(pe)||!X.test(pe)||Le!=null&&pe in Object(Le)}function Gn(pe){var Le=typeof pe;return Le=="string"||Le=="number"||Le=="symbol"||Le=="boolean"?pe!=="__proto__":pe===null}function Si(pe){return!!je&&je in pe}function Qs(pe){var Le=pe&&pe.constructor,Ke=typeof Le=="function"&&Le.prototype||ge;return pe===Ke}function zs(pe){return pe===pe&&!wr(pe)}function Xs(pe,Le){return function(Ke){return Ke==null?!1:Ke[pe]===Le&&(Le!==void 0||pe in Object(Ke))}}var ac=Go(function(pe){pe=kn(pe);var Le=[];return V.test(pe)&&Le.push(""),pe.replace(G,function(Ke,pt,Ut,xe){Le.push(Ut?xe.replace($,"$1"):pt||Ke)}),Le});function So(pe){if(typeof pe=="string"||mn(pe))return pe;var Le=pe+"";return Le=="0"&&1/pe==-1/0?"-0":Le}function Is(pe){if(pe!=null){try{return Qe.call(pe)}catch{}try{return pe+""}catch{}}return""}function Go(pe,Le){if(typeof pe!="function"||Le&&typeof Le!="function")throw new TypeError(n);var Ke=function(){var pt=arguments,Ut=Le?Le.apply(this,pt):pt[0],xe=Ke.cache;if(xe.has(Ut))return xe.get(Ut);var We=pe.apply(this,pt);return Ke.cache=xe.set(Ut,We),We};return Ke.cache=new(Go.Cache||et),Ke}Go.Cache=et;function au(pe,Le){return pe===Le||pe!==pe&&Le!==Le}function lc(pe){return ot(pe)&&$e.call(pe,"callee")&&(!Ve.call(pe,"callee")||Je.call(pe)==l)}var me=Array.isArray;function Be(pe){return pe!=null&&Xr(pe.length)&&!kt(pe)}function ot(pe){return rn(pe)&&Be(pe)}function kt(pe){var Le=wr(pe)?Je.call(pe):"";return Le==h||Le==A}function Xr(pe){return typeof pe=="number"&&pe>-1&&pe%1==0&&pe<=a}function wr(pe){var Le=typeof pe;return!!pe&&(Le=="object"||Le=="function")}function rn(pe){return!!pe&&typeof pe=="object"}function mn(pe){return typeof pe=="symbol"||rn(pe)&&Je.call(pe)==x}var $i=Oe?J(Oe):en;function kn(pe){return pe==null?"":Pt(pe)}function Qi(pe,Le,Ke){var pt=pe==null?void 0:Vr(pe,Le);return pt===void 0?Ke:pt}function so(pe,Le){return pe!=null&&Rl(pe,Le,Cn)}function ri(pe){return Be(pe)?$r(pe):oe(pe)}function zi(pe,Le){var Ke={};return Le=To(Le),Fr(pe,function(pt,Ut,xe){Ke[Ut]=Le(pt,Ut,xe)}),Ke}function to(pe){return pe}function qs(pe){return zn(pe)?se(So(pe)):lt(pe)}e.exports=zi})(ug,ug.exports)),ug.exports}var NBe=PBe();const LBe=Un(NBe);var KP,UX;function kBe(){if(UX)return KP;UX=1;var e=200,t="__lodash_hash_undefined__",r=9007199254740991,n="[object Arguments]",i="[object Function]",o="[object GeneratorFunction]",s="[object Symbol]",a=/[\\^$.*+?()[\]{}|]/g,l=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,c=typeof Ur=="object"&&Ur&&Ur.Object===Object&&Ur,f=typeof self=="object"&&self&&self.Object===Object&&self,p=c||f||Function("return this")();function h(Re,it,et){switch(et.length){case 0:return Re.call(it);case 1:return Re.call(it,et[0]);case 2:return Re.call(it,et[0],et[1]);case 3:return Re.call(it,et[0],et[1],et[2])}return Re.apply(it,et)}function A(Re,it){var et=Re?Re.length:0;return!!et&&y(Re,it,0)>-1}function g(Re,it){for(var et=-1,Pe=Re?Re.length:0,st=Array(Pe);++et<Pe;)st[et]=it(Re[et],et,Re);return st}function m(Re,it){for(var et=-1,Pe=it.length,st=Re.length;++et<Pe;)Re[st+et]=it[et];return Re}function O(Re,it,et,Pe){for(var st=Re.length,gt=et+-1;++gt<st;)if(it(Re[gt],gt,Re))return gt;return-1}function y(Re,it,et){if(it!==it)return O(Re,T,et);for(var Pe=et-1,st=Re.length;++Pe<st;)if(Re[Pe]===it)return Pe;return-1}function T(Re){return Re!==Re}function v(Re,it){for(var et=-1,Pe=Array(Re);++et<Re;)Pe[et]=it(et);return Pe}function C(Re,it){return Re.has(it)}function x(Re,it){return Re?.[it]}function b(Re){var it=!1;if(Re!=null&&typeof Re.toString!="function")try{it=!!(Re+"")}catch{}return it}function w(Re,it){return function(et){return Re(it(et))}}var R=Array.prototype,I=Function.prototype,P=Object.prototype,k=p["__core-js_shared__"],N=(function(){var Re=/[^.]+$/.exec(k&&k.keys&&k.keys.IE_PROTO||"");return Re?"Symbol(src)_1."+Re:""})(),L=I.toString,M=P.hasOwnProperty,B=P.toString,H=RegExp("^"+L.call(M).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),j=p.Symbol,X=w(Object.getPrototypeOf,Object),F=P.propertyIsEnumerable,V=R.splice,G=j?j.isConcatSpreadable:void 0,D=Object.getOwnPropertySymbols,$=Math.max,U=_e(p,"Map"),Y=_e(Object,"create");function z(Re){var it=-1,et=Re?Re.length:0;for(this.clear();++it<et;){var Pe=Re[it];this.set(Pe[0],Pe[1])}}function Q(){this.__data__=Y?Y(null):{}}function W(Re){return this.has(Re)&&delete this.__data__[Re]}function q(Re){var it=this.__data__;if(Y){var et=it[Re];return et===t?void 0:et}return M.call(it,Re)?it[Re]:void 0}function Z(Re){var it=this.__data__;return Y?it[Re]!==void 0:M.call(it,Re)}function te(Re,it){var et=this.__data__;return et[Re]=Y&&it===void 0?t:it,this}z.prototype.clear=Q,z.prototype.delete=W,z.prototype.get=q,z.prototype.has=Z,z.prototype.set=te;function ae(Re){var it=-1,et=Re?Re.length:0;for(this.clear();++it<et;){var Pe=Re[it];this.set(Pe[0],Pe[1])}}function ne(){this.__data__=[]}function ue(Re){var it=this.__data__,et=ye(it,Re);if(et<0)return!1;var Pe=it.length-1;return et==Pe?it.pop():V.call(it,et,1),!0}function Oe(Re){var it=this.__data__,et=ye(it,Re);return et<0?void 0:it[et][1]}function Te(Re){return ye(this.__data__,Re)>-1}function se(Re,it){var et=this.__data__,Pe=ye(et,Re);return Pe<0?et.push([Re,it]):et[Pe][1]=it,this}ae.prototype.clear=ne,ae.prototype.delete=ue,ae.prototype.get=Oe,ae.prototype.has=Te,ae.prototype.set=se;function ie(Re){var it=-1,et=Re?Re.length:0;for(this.clear();++it<et;){var Pe=Re[it];this.set(Pe[0],Pe[1])}}function J(){this.__data__={hash:new z,map:new(U||ae),string:new z}}function K(Re){return Ee(this,Re).delete(Re)}function re(Re){return Ee(this,Re).get(Re)}function le(Re){return Ee(this,Re).has(Re)}function he(Re,it){return Ee(this,Re).set(Re,it),this}ie.prototype.clear=J,ie.prototype.delete=K,ie.prototype.get=re,ie.prototype.has=le,ie.prototype.set=he;function Ae(Re){var it=-1,et=Re?Re.length:0;for(this.__data__=new ie;++it<et;)this.add(Re[it])}function fe(Re){return this.__data__.set(Re,t),this}function Se(Re){return this.__data__.has(Re)}Ae.prototype.add=Ae.prototype.push=fe,Ae.prototype.has=Se;function ge(Re,it){var et=Ot(Re)||ut(Re)?v(Re.length,String):[],Pe=et.length,st=!!Pe;for(var gt in Re)st&&(gt=="length"||be(gt,Pe))||et.push(gt);return et}function ye(Re,it){for(var et=Re.length;et--;)if(nt(Re[et][0],it))return et;return-1}function je(Re,it,et,Pe){var st=-1,gt=A,Zt=!0,dr=Re.length,Mr=[],hn=it.length;if(!dr)return Mr;it.length>=e&&(gt=C,Zt=!1,it=new Ae(it));e:for(;++st<dr;){var dn=Re[st],An=dn;if(dn=dn!==0?dn:0,Zt&&An===An){for(var lr=hn;lr--;)if(it[lr]===An)continue e;Mr.push(dn)}else gt(it,An,Pe)||Mr.push(dn)}return Mr}function Qe(Re,it,et,Pe,st){var gt=-1,Zt=Re.length;for(et||(et=de),st||(st=[]);++gt<Zt;){var dr=Re[gt];et(dr)?m(st,dr):st[st.length]=dr}return st}function $e(Re,it,et){var Pe=it(Re);return Ot(Re)?Pe:m(Pe,et(Re))}function Je(Re){if(!Ye(Re)||Ne(Re))return!1;var it=Dt(Re)||b(Re)?H:l;return it.test(De(Re))}function rt(Re){if(!Ye(Re))return mt(Re);var it=Me(Re),et=[];for(var Pe in Re)Pe=="constructor"&&(it||!M.call(Re,Pe))||et.push(Pe);return et}function tt(Re,it){return Re=Object(Re),Ie(Re,it,function(et,Pe){return Pe in Re})}function Ie(Re,it,et){for(var Pe=-1,st=it.length,gt={};++Pe<st;){var Zt=it[Pe],dr=Re[Zt];et(dr,Zt)&&(gt[Zt]=dr)}return gt}function Ve(Re,it){return it=$(it===void 0?Re.length-1:it,0),function(){for(var et=arguments,Pe=-1,st=$(et.length-it,0),gt=Array(st);++Pe<st;)gt[Pe]=et[it+Pe];Pe=-1;for(var Zt=Array(it+1);++Pe<it;)Zt[Pe]=et[Pe];return Zt[it]=gt,h(Re,this,Zt)}}function He(Re){return $e(Re,yt,ee)}function Ee(Re,it){var et=Re.__data__;return Ge(it)?et[typeof it=="string"?"string":"hash"]:et.map}function _e(Re,it){var et=x(Re,it);return Je(et)?et:void 0}var we=D?w(D,Object):$t,ee=D?function(Re){for(var it=[];Re;)m(it,we(Re)),Re=X(Re);return it}:$t;function de(Re){return Ot(Re)||ut(Re)||!!(G&&Re&&Re[G])}function be(Re,it){return it=it??r,!!it&&(typeof Re=="number"||u.test(Re))&&Re>-1&&Re%1==0&&Re<it}function Ge(Re){var it=typeof Re;return it=="string"||it=="number"||it=="symbol"||it=="boolean"?Re!=="__proto__":Re===null}function Ne(Re){return!!N&&N in Re}function Me(Re){var it=Re&&Re.constructor,et=typeof it=="function"&&it.prototype||P;return Re===et}function mt(Re){var it=[];if(Re!=null)for(var et in Object(Re))it.push(et);return it}function St(Re){if(typeof Re=="string"||at(Re))return Re;var it=Re+"";return it=="0"&&1/Re==-1/0?"-0":it}function De(Re){if(Re!=null){try{return L.call(Re)}catch{}try{return Re+""}catch{}}return""}function nt(Re,it){return Re===it||Re!==Re&&it!==it}function ut(Re){return Mt(Re)&&M.call(Re,"callee")&&(!F.call(Re,"callee")||B.call(Re)==n)}var Ot=Array.isArray;function It(Re){return Re!=null&&Fe(Re.length)&&!Dt(Re)}function Mt(Re){return Xe(Re)&&It(Re)}function Dt(Re){var it=Ye(Re)?B.call(Re):"";return it==i||it==o}function Fe(Re){return typeof Re=="number"&&Re>-1&&Re%1==0&&Re<=r}function Ye(Re){var it=typeof Re;return!!Re&&(it=="object"||it=="function")}function Xe(Re){return!!Re&&typeof Re=="object"}function at(Re){return typeof Re=="symbol"||Xe(Re)&&B.call(Re)==s}function yt(Re){return It(Re)?ge(Re):rt(Re)}var vt=Ve(function(Re,it){return Re==null?{}:(it=g(Qe(it),St),tt(Re,je(He(Re),it)))});function $t(){return[]}return KP=vt,KP}var FBe=kBe();const MBe=Un(FBe),BBe=_.forwardRef((e,t)=>{const{type:r,VORTEX_MAIN_URL:n,ENTITY_ID:i,TESSERACT_MAIN_URL:o,FRONTEND_URL:s,INTEGRATION_DATA:a,viewOnly:l=!1,openIntegrationDrawer:u}=e,c=ct.useDispatch(),{workflow:f}=ct.useSelector(Q=>Q.workflows),{source:p=""}=f,[h,A]=_.useState({}),[g,m]=_.useState([]),[O,y]=_.useState([]),[T,v]=_.useState(!1),[C,x]=_.useState(!1),[b,w]=_.useState(!1),[R,I]=_.useState(null),P=_.useRef([]),{control:k,watch:N,setValue:L,trigger:M}=Rr(),B=p?.includes("commerce_"),H=p?.split("_"),j=H&&H.length>1?H[1]:null,X=H&&H.length>2?H.slice(2).join("_"):j,F=N("properties"),V=N("properties.fp_auth_id"),G=async()=>{if(B)m([{name:X,id:p?.toLowerCase()||""}]),L("properties.fp_auth_id",p?.toLowerCase()||"",{shouldValidate:!0});else{v(!0);try{const{data:Q}=await zt.get(Xt(o,"/v1/integrations/entity/FYND_PLATFORM?get_form_data=true"),{params:{page_size:999,current_page:1,type:"BOTH"}});m(ro(Q.data))}catch(Q){sr(Q,c)}finally{v(!1)}}},D=async Q=>{w(!0);try{const W=Xt(n,`/v1.0/${i}`,"/utility/events-config"),q=Q?{id:Q}:{},{data:Z}=await zt.get(W,{params:q});P.current=Z.data.event_configs;const te=Z.data.event_configs.map(ue=>({...ue,display_name:`${ue.display_name}_${ue.event_category}`})),ae=YP(te,"event_category"),ne={application:$(ae.application),company:$(ae.company)};A(ne)}catch(W){sr(W,c)}finally{w(!1)}},$=Q=>{if(!Q)return{};const W={},q=YP(Q,"event_name");return Object.keys(q).forEach(Z=>{const te=YP(q[Z],"version");W[Z]=LBe(te,ae=>ae.map(ne=>MBe(ne,"version"))),W[Z].versions=Object.keys(te).map(ae=>({text:`V${ae}`,value:ae}))}),W},U=async Q=>{x(!0);try{const W=Xt(n,`/v1.0/${i}`,`/utility/applications?id=${Q}`),{data:q}=await zt.get(W);y(q?.data?.map(Z=>({id:Z.id,name:Z.name})))}catch(W){sr(W,c)}finally{x(!1)}};_.useEffect(()=>{const{fp_auth_id:Q}=F;Q&&(p?.includes("commerce_")?D(""):D(Q))},[]),_.useEffect(()=>{G()},[]),_.useEffect(()=>{a?._id&&a?.meta?.entity==="FYND_PLATFORM"&&(G(),L("properties.fp_auth_id",a._id,{shouldValidate:!0}))},[a]),_.useEffect(()=>{const{fp_auth_id:Q}=F;F?.event_details?.event_category==="application"&&U(Q)},[V,F?.event_details?.event_category]),_.useEffect(()=>{if(!Et(F?.event_details?.event_name)&&!Et(F?.event_details?.event_category)&&!Et(h)){const{event_name:Q,event_category:W}=F?.event_details;I(h[W][Q])}},[h]),_.useEffect(()=>{const Q=F?.event_id;if(!Q?.length||!P.current.length||F?.events?.length>0)return;const W=Q.map(q=>P.current.find(Z=>Z.id===q)).filter(Boolean);W.length&&L("properties.events",W.map(q=>({slug:`${q.event_category}/${q.event_name}/${q.event_type}/v${q.version}`})))},[h]);const Y=Q=>Et(Q)?[]:F.event_details?.event_category==="application"?Object.keys(Q.application).map(W=>({title:W,value:W})):F.event_details?.event_category==="company"?Object.keys(Q.company).map(W=>({title:W,value:W})):[],z=N("properties.version")&&!Et(R)&&R[parseFloat(N("properties.version"))]?R[parseFloat(N("properties.version"))].map(Q=>({title:Q.event_type,value:Q.id,event_name:Q.event_name,event_type:Q.event_type,event_category:Q.event_category})):[];return d.jsxs(E.Stack,{gap:2.5,children:[d.jsx(Ei,{children:d.jsx(Yt,{required:!0,name:"properties.fp_auth_id",control:k,meta:{options:yn(g),displayProps:{loading:T},displayName:"Fynd Platform Account",value:"",htmlProps:{showAddNew:!0},TESSERACT_MAIN_URL:o,FRONTEND_URL:s,ENTITY_ID:i,openIntegrationDrawer:u,addNewButtonText:"Add new account",searchFieldPlaceholder:"Search Fynd Platform account",authType:"FYND_PLATFORM",description:"Fynd Platform is a secure partner with Boltic. Your credentials are encrypted & can be removed at any time.",placeholder:"Select Fynd Platform Account"},validationRules:{required:"Fynd platform account is required"},id:r,viewOnly:l||B,handleChange:Q=>{const{value:W}=Q;W&&(p?.includes("commerce_")?D(""):D(W))}})}),F.fp_auth_id&&d.jsx(E.Divider,{}),F.fp_auth_id&&d.jsx(En,{children:d.jsxs(E.Grid,{container:!0,gap:1.5,children:[d.jsx(E.Grid,{item:!0,xs:12,children:d.jsxs(E.Grid,{container:!0,gap:1.5,children:[d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Yt,{required:!0,name:"properties.event_details.event_category",control:k,meta:{options:Zle,displayName:"Event Category",searchFieldPlaceholder:"Search",placeholder:"Select Event Category",displayProps:{loading:b}},validationRules:{required:"Event category is required"},viewOnly:l,id:r,handleChange:Q=>{const{value:W}=Q,q=W.split("_").pop();L("properties",{...F,event_details:{...F.event_details,event_category:q,event_name:""},event_id:[],events:[],application_id:[],version:[]}),I([])}})}),d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Yt,{required:!0,name:"properties.event_details.event_name",control:k,meta:{options:Y(h),displayName:"Event Name",searchFieldPlaceholder:"Search",placeholder:"Select Event Name",displayProps:{loading:b}},validationRules:{required:"Event name is required"},viewOnly:l,id:r,handleChange:Q=>{const{value:W}=Q,q=F.event_details.event_category,Z=h[q][W].versions.length;L("properties",{...F,event_id:[],events:[],application_id:[],version:h[q][W].versions[Z-1].value}),M("properties.event_details"),I(h[q][W])}})})]})}),!Et(R?.versions)&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Yt,{required:!0,name:"properties.version",control:k,meta:{options:R.versions.map(Q=>({title:Q.text,value:Q.value})),displayName:"Version",searchFieldPlaceholder:"Search",placeholder:"Select Version",displayProps:{loading:b}},validationRules:{required:"Version is required"},viewOnly:l,handleChange:Q=>{const{value:W}=Q;L("properties",{...F,event_id:[],events:[],version:W,application_id:[]})}})}),!Et(z)&&!Et(F.event_details)&&!Et(F.version)&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Yt,{required:!0,name:"properties.event_id",control:k,meta:{options:z,displayProps:{loading:b},displayName:"Events",searchFieldPlaceholder:"Search",placeholder:"Select Events"},renderFieldValue:Q=>Q.map(W=>W),validationRules:{validate:Q=>Q.length===0?"Events is required":!0},viewOnly:l,id:r,multiple:!0,placeholder:"Select Events",handleChange:Q=>{const{value:W}=Q,q=F.version,Z=W.map(ae=>{const ne=z.find(ue=>ue.value===ae);return{slug:`${ne?.event_category}/${ne?.event_name}/${ne?.event_type}/v${q}`}});L("properties.events",Z);const te=z.find(ae=>ae.value===W?.[0]);L("properties.event_details.event_type",te?.title)},getSelectedValue:Q=>Q.map(W=>z.find(q=>q.value===W)).filter(W=>W?.title)})}),F?.event_details?.event_category==="application"&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Yt,{name:"properties.application_id",control:k,meta:{options:yn(O),displayName:"Applications",searchFieldPlaceholder:"Search",displayProps:{loading:C},placeholder:"Select Applications"},validationRules:{validate:Q=>Q.length===0?"Application is required":!0},multiple:!0,renderFieldValue:Q=>Q.map(W=>W),viewOnly:l,getSelectedValue:Q=>Q.map(W=>yn(O).find(q=>q.value===W)).filter(W=>W?.title),required:!0})})]})})]})}),jBe=_.forwardRef((e,t)=>{const{VORTEX_MAIN_URL:r,ENTITY_ID:n,type:i,id:o,isLoop:s=!1,suggestionsData:a,WORKFLOW_URLS:l,viewOnly:u=!1}=e,{GYRATE_MAIN_URL:c}=l,{control:f,watch:p,setValue:h,formState:{errors:A}}=Rr(),g=p("properties");return d.jsx(En,{children:d.jsxs(E.Grid,{container:!0,gap:1.5,children:[d.jsxs(E.Grid,{item:!0,xs:12,children:[d.jsx(gn,{required:!0,label:"Input Data"}),d.jsx(Aa,{id:o,field:"input_data",type:"functionActivity",title:"Input Data",viewOnly:u,isLoop:s,hideLabel:!0,name:"properties.input_data"})]}),d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Yt,{required:!0,name:"properties.language",control:f,meta:{options:Jle,displayName:"Language",searchFieldPlaceholder:"Search language",description:_n(i,"method"),placeholder:"Select language"},handleChange:()=>{h("properties.func",'return { "hello": "world" }')},validationRules:{required:"Language is required"},viewOnly:u,id:i})}),d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(pr,{name:"properties.func",control:f,rules:{required:"Error: Function is required. Please review your function syntax."},render:({field:m})=>d.jsx(E.FormControl,{fullWidth:!0,children:d.jsx(Fi,{...m,required:!0,suggestionLabel:"Code",id:`${i}-${g.language}-func`,activityType:i,size:"xl",viewOnly:u,showSuggestions:!0,VORTEX_MAIN_URL:r,ENTITY_ID:n,language:g.language,suggestionsData:a,showExpandOption:!0,label:"Code",helperText:d.jsxs(E.Box,{children:["Need help? Refer to the",d.jsx(E.Link,{href:g.language==="python"?`${c}/integrations/Helpers/function/#python`:`${c}/integrations/Helpers/function/#javascript`,target:"_blank",children:d.jsx("span",{children:" Function Documentation "})}),"for examples, guidelines, and troubleshooting tips to write Javascript in your workflow."]}),error:!!A.properties?.func?.message,errorMsg:A.properties?.func?.message,handleChange:m.onChange})})})}),!s&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Mi,{viewOnly:u,type:i})})]})})}),$Be=Gi(jBe,""),ml=_.forwardRef(({id:e,type:t,isLoop:r=!1,viewOnly:n=!1,customSelectedTab:i,setCustomSelectedTab:o},s)=>{const{control:a,watch:l,setValue:u}=Rr(),{MCP_INTEGRATION_FORM:c}=aa(),f=l("properties.custom"),p=l("properties.custom.headers"),h=l("properties.custom.query_params"),A=l("properties.custom.state_params"),g=l("properties.custom.method");return _.useEffect(()=>{f&&(p&&!Array.isArray(p)&&typeof p=="object"&&u("properties.custom.headers",pc(p),{shouldValidate:!1,shouldDirty:!1}),h&&!Array.isArray(h)&&typeof h=="object"&&u("properties.custom.query_params",pc(h),{shouldValidate:!1,shouldDirty:!1}),A&&!Array.isArray(A)&&typeof A=="object"&&u("properties.custom.state_params",pc(A),{shouldValidate:!1,shouldDirty:!1}))},[f,p,h,A,u]),_.useEffect(()=>{if(c&&(g==="BOLTIC_AI"||g==="BOLTIC_AI_IGNORE"))return;const m=(QO||[]).map(T=>T.value),O=typeof g=="string"&&g.length?String(g).toLowerCase():"",y=O&&m.includes(O)?O:QO?.[0]?.value||"get";g!==y&&u("properties.custom.method",y,{shouldValidate:!1,shouldDirty:!1})},[g,u]),d.jsxs(d.Fragment,{children:[d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Yt,{required:!0,name:"properties.custom.method",control:a,meta:{options:QO,displayName:"Method",searchFieldPlaceholder:"Search Method",placeholder:"Select Method"},validationRules:{required:"Method is required",validate:m=>m!=null&&String(m).trim()!==""?!0:"Method is required"},viewOnly:n,id:t})}),d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(kr,{required:!0,id:e,name:"properties.custom.endpoint",control:a,meta:{displayName:"URL",placeholder:rde(t)},validationRules:{required:"URL is required"},viewOnly:n,editorId:`${t}-custom-url-${r}`,showSuggestions:!0})}),d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(ss,{variant:"full-width",tabs:xle,selectedTab:i,setSelectedTab:o})}),i==="Query Params"&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Aa,{id:e,name:"properties.custom.query_params",field:"query_params",type:t,title:"Query Params",viewOnly:n,isLoop:r})}),i==="State Params"&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Aa,{id:e,name:"properties.custom.state_params",field:"state_params",type:t,title:"State Params",viewOnly:n,isLoop:r})}),i==="Headers"&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Aa,{id:e,name:"properties.custom.headers",field:"headers",type:t,title:"Headers",viewOnly:n,isLoop:r})}),i==="Body"&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Aa,{id:e,name:"properties.custom.body",field:"body",type:t,title:"Body",viewOnly:n,isLoop:r,showKeyValuePair:!1})})]})});ml.displayName="CustomApiSection";const cg=e=>{const{control:t,name:r,label:n,placeholder:i,addNewButtonText:o,searchFieldPlaceholder:s,description:a,authType:l,options:u,isLoading:c,TESSERACT_MAIN_URL:f,FRONTEND_URL:p,ENTITY_ID:h,openIntegrationDrawer:A,viewOnly:g,isTokenRevoked:m,handleReconnect:O,handleChange:y,validationMessage:T,id:v}=e;return d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Yt,{required:!0,name:r,control:t,renderValueUi:C=>{const x=u.find(b=>b.value===C);return d.jsx(tf,{isTokenRevoked:m,onReconnect:O,disabled:g,optionTitle:x?.title})},meta:{options:u,displayProps:{loading:c},displayName:n,value:"",htmlProps:{showAddNew:!0},TESSERACT_MAIN_URL:f,FRONTEND_URL:p,ENTITY_ID:h,openIntegrationDrawer:A,addNewButtonText:o,searchFieldPlaceholder:s,authType:l,description:a,placeholder:i},validationRules:{required:T},handleChange:y,viewOnly:g,id:v})})},ZP="FYND_AIPIM",UBe="blt-int.ai-pim",HBe=_.forwardRef((e,t)=>{const r=ct.useDispatch(),{control:n,watch:i,setValue:o,formState:{errors:s}}=Rr(),{ENTITY_ID:a,TESSERACT_MAIN_URL:l,FRONTEND_URL:u,type:c,id:f,isLoop:p=!1,suggestionsData:h,INTEGRATION_DATA:A,VORTEX_MAIN_URL:g,viewOnly:m=!1,openIntegrationDrawer:O}=e,{loopSuggestionsData:y={}}=ct.useSelector(D=>D.loopActivity),T=i("properties"),v=T?.operation||"",C=T?.resource||"",x=_.useMemo(()=>{if(!C)return[];const D=`${C}.`;return gue.filter($=>$.value.startsWith(D)).sort(($,U)=>$.title.localeCompare(U.title))},[C]),[b,w]=_.useState([]),[R,I]=_.useState(!1),[P,k]=_.useState("Query Params"),N=yn(b),{isTokenRevoked:L,setTokenRevoked:M,handleReconnect:B}=Al({credentialId:T?.secret||"",TESSERACT_MAIN_URL:l,FRONTEND_URL:u,ENTITY_ID:a,openIntegrationDrawer:O}),H=()=>{I(!0);const D={page_size:999,current_page:1,type:"BOTH"},$=Xt(l,`/v1/integrations/entity/${ZP}`);zt.get($,{params:D}).then(({data:U})=>{w(ro(U.data))}).catch(U=>{sr(U,r)}).finally(()=>{I(!1)})};_.useEffect(()=>{if(H(),T?.integration_slug||o("properties.integration_slug",UBe,{shouldValidate:!1}),!C&&v){const D=v.split(".")[0];D&&o("properties.resource",D,{shouldValidate:!1})}},[]),_.useEffect(()=>{A?._id&&A?.meta?.entity===ZP&&(A?.meta?.auth_status==="ACTIVE"&&M(!1),H(),o("properties.secret",A._id,{shouldValidate:!0}))},[A]);const j={VORTEX_MAIN_URL:g,ENTITY_ID:a,viewOnly:m,showSuggestions:!0,language:"json",showExpandOption:!0,suggestionsData:p?y:h},X=(D,$,U={})=>d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(kr,{required:U.required,id:f,name:`properties.${D}`,control:n,type:U.type==="number"?"number":"text",meta:{displayName:$,placeholder:U.placeholder||`Enter ${$.toLowerCase()}`,description:U.description,displayType:U.type==="number"?"number":"text"},validationRules:U.required?{required:`${$} is required`}:{},viewOnly:m,editorId:`${c}-${D}-${p}`,showSuggestions:!0,isLoop:p})},D),F=(D,$,U={})=>d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(pr,{name:`properties.${D}`,control:n,rules:U.required?{required:`${$} is required`}:{},render:({field:Y})=>d.jsx(Fi,{...Y,...j,label:$,suggestionLabel:$,id:`${c}-${D}`,activityType:c,size:"md",helperText:U.description,errorMsg:s.properties?.[D]?.message,error:!!s.properties?.[D]?.message,handleChange:z=>Y.onChange(z),required:U.required})})},D),V=(D={})=>d.jsxs(d.Fragment,{children:[X("page_no","Page Number",{type:"number",placeholder:String(D.page??1)}),X("page_size","Page Size",{type:"number",placeholder:String(D.size??50)})]}),G=()=>v?v==="products.list_external"?d.jsxs(d.Fragment,{children:[X("inbound_id","Inbound Connector ID",{required:!0}),V()]}):v==="products.get_meta"?d.jsxs(d.Fragment,{children:[X("inbound_id","Inbound Connector ID",{required:!0}),X("product_id","Product ID",{required:!0})]}):v==="products.bulk_export"?d.jsxs(d.Fragment,{children:[X("inbound_id","Inbound Connector ID",{required:!0}),d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(E.FormControl,{fullWidth:!0,children:d.jsx(Yt,{name:"properties.entity",control:n,meta:{options:Oue,displayName:"Entity Type",searchFieldPlaceholder:"Search entity",placeholder:"Select entity"},validationRules:{required:"Entity Type is required"},viewOnly:m,required:!0})})}),F("payload","Export Request",{description:"Bulk export request body."})]}):v==="templates.list"?V():v==="templates.get"||v==="templates.delete"||v==="templates.validation_schema"?X("template_id","Template ID",{required:!0}):v==="templates.create"?F("template","Template",{required:!0,description:"Template definition (name, slug, attributes, etc.)."}):v==="templates.update"?d.jsxs(d.Fragment,{children:[X("template_id","Template ID",{required:!0}),F("template","Template Update",{required:!0})]}):v==="attributes.list"?d.jsxs(d.Fragment,{children:[V(),X("tag","Filter by Tag")]}):v==="attributes.list_tags"?null:v==="attributes.create"?F("attribute","Attribute",{required:!0,description:"Attribute definition (name, slug, type, options, etc.)."}):v==="attributes.get"||v==="attributes.delete"?X("attribute_id","Attribute ID",{required:!0}):v==="attributes.update"?d.jsxs(d.Fragment,{children:[X("attribute_id","Attribute ID",{required:!0}),F("attribute","Attribute Update",{required:!0})]}):v==="categories.list"||v==="categories.list_mappings"?V():v==="categories.create"?F("category","Category",{required:!0,description:"Category definition (name, slug, parent_id, attributes, etc.)."}):v==="categories.get"||v==="categories.delete"?X("category_id","Category ID",{required:!0}):v==="categories.update"?d.jsxs(d.Fragment,{children:[X("category_id","Category ID",{required:!0}),F("category","Category Update",{required:!0})]}):v==="categories.create_mapping"?F("mapping","Mapping",{required:!0,description:"Category-mapping definition."}):v==="categories.get_mapping_by_code"?X("code","Mapping Code",{required:!0}):v==="inbound.list"?V():v==="inbound.create"?F("connector","Connector",{required:!0,description:"Inbound connector definition."}):v==="inbound.get"||v==="inbound.delete"?X("inbound_id","Inbound ID",{required:!0}):v==="inbound.update"?d.jsxs(d.Fragment,{children:[X("inbound_id","Inbound ID",{required:!0}),F("connector","Connector Update",{required:!0})]}):v==="mapper.list"?V():v==="mapper.create"?F("mapper","Mapper",{required:!0,description:"Transform function definition (name, code, etc.)."}):v==="mapper.execute"?F("payload","Execution Input",{required:!0,description:"Mapper code + input data for sandbox execution."}):v==="mapper.get"||v==="mapper.delete"?X("mapper_id","Mapper ID",{required:!0}):v==="mapper.update"?d.jsxs(d.Fragment,{children:[X("mapper_id","Mapper ID",{required:!0}),F("mapper","Mapper Update",{required:!0})]}):v==="custom.custom_api"?d.jsx(ml,{id:f,type:c,isLoop:p,viewOnly:m,customSelectedTab:P,setCustomSelectedTab:k}):null:null;return d.jsxs(E.Stack,{gap:2.5,children:[d.jsx(Ei,{children:d.jsxs(E.Grid,{container:!0,gap:1.5,children:[d.jsx(cg,{control:n,name:"properties.secret",label:"Fynd AIPIM Account",placeholder:"Select Fynd AIPIM account",addNewButtonText:"Add new account",searchFieldPlaceholder:"Search Fynd AIPIM account",description:"Fynd AIPIM credentials are encrypted and can be removed at any time.",authType:ZP,options:N,isLoading:R,TESSERACT_MAIN_URL:l,FRONTEND_URL:u,ENTITY_ID:a,openIntegrationDrawer:O,viewOnly:m,isTokenRevoked:L,handleReconnect:B,handleChange:D=>{D.value&&M(!1)},validationMessage:"AI PIM account is required",id:c}),T?.secret&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(E.FormControl,{fullWidth:!0,children:d.jsx(Yt,{name:"properties.resource",control:n,meta:{options:mue,displayName:"Resource",searchFieldPlaceholder:"Search resource",description:"Select the AI PIM resource.",placeholder:"Select a resource"},validationRules:{required:"Resource is required"},handleChange:({value:D})=>{D!==C&&o("properties.operation","",{shouldValidate:!1})},viewOnly:m,required:!0})})}),T?.secret&&C&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(E.FormControl,{fullWidth:!0,children:d.jsx(Yt,{name:"properties.operation",control:n,meta:{options:x,displayName:"Operation",searchFieldPlaceholder:"Search operation",description:"Select the action to perform.",placeholder:"Select an operation"},validationRules:{required:"Operation is required"},viewOnly:m,required:!0})})})]})}),T?.secret&&v&&d.jsx(E.Divider,{}),T?.secret&&v&&d.jsx(En,{children:d.jsx(E.Grid,{container:!0,gap:1.5,children:G()})})]})}),VBe=Gi(HBe,""),JP="FYND_COMMERCE_B2B",GBe="blt-int.commerce-b2b",WBe=_.forwardRef((e,t)=>{const r=ct.useDispatch(),{control:n,watch:i,setValue:o,formState:{errors:s}}=Rr(),{ENTITY_ID:a,TESSERACT_MAIN_URL:l,FRONTEND_URL:u,type:c,id:f,isLoop:p=!1,suggestionsData:h,INTEGRATION_DATA:A,VORTEX_MAIN_URL:g,viewOnly:m=!1,openIntegrationDrawer:O}=e,{loopSuggestionsData:y={}}=ct.useSelector(V=>V.loopActivity),T=i("properties"),v=T?.operation||"",[C,x]=_.useState([]),[b,w]=_.useState(!1),[R,I]=_.useState("Query Params"),P=yn(C),{isTokenRevoked:k,setTokenRevoked:N,handleReconnect:L}=Al({credentialId:T?.secret||"",TESSERACT_MAIN_URL:l,FRONTEND_URL:u,ENTITY_ID:a,openIntegrationDrawer:O}),M=()=>{w(!0);const V={page_size:999,current_page:1,type:"BOTH"},G=Xt(l,`/v1/integrations/entity/${JP}`);zt.get(G,{params:V}).then(({data:D})=>{x(ro(D.data))}).catch(D=>{sr(D,r)}).finally(()=>{w(!1)})};_.useEffect(()=>{M(),T?.integration_slug||o("properties.integration_slug",GBe,{shouldValidate:!1})},[]),_.useEffect(()=>{A?._id&&A?.meta?.entity===JP&&(A?.meta?.auth_status==="ACTIVE"&&N(!1),M(),o("properties.secret",A._id,{shouldValidate:!0}))},[A]);const B={VORTEX_MAIN_URL:g,ENTITY_ID:a,viewOnly:m,showSuggestions:!0,language:"json",showExpandOption:!0,suggestionsData:p?y:h},H=(V,G,D={})=>d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(kr,{required:D.required,id:f,name:`properties.${V}`,control:n,type:D.type==="number"?"number":"text",multiline:D.multiline,meta:{displayName:G,placeholder:D.placeholder||`Enter ${G.toLowerCase()}`,description:D.description,displayType:D.type==="number"?"number":"text"},validationRules:D.required?{required:`${G} is required`}:{},viewOnly:m,editorId:`${c}-${V}-${p}`,showSuggestions:!0,isLoop:p})},V),j=(V,G,D={})=>d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(pr,{name:`properties.${V}`,control:n,rules:D.required?{required:`${G} is required`}:{},render:({field:$})=>d.jsx(Fi,{...$,...B,label:G,suggestionLabel:G,id:`${c}-${V}`,activityType:c,size:"md",helperText:D.description,errorMsg:s.properties?.[V]?.message,error:!!s.properties?.[V]?.message,handleChange:U=>$.onChange(U),required:D.required})})},V),X=()=>d.jsxs(d.Fragment,{children:[H("page_no","Page Number",{type:"number",placeholder:"1"}),H("page_size","Page Size",{type:"number",placeholder:"50"})]}),F=()=>{if(!v)return null;const V=[{title:"True",value:"true"},{title:"False",value:"false"}],G=[{title:"Pending",value:"pending"},{title:"In Progress",value:"inprogress"},{title:"Success",value:"success"},{title:"Failed",value:"failed"},{title:"Validating",value:"validating"},{title:"Syncing",value:"syncing"}],D=[{title:"Submitted",value:"submitted"},{title:"Approved",value:"approved"},{title:"Rejected",value:"rejected"},{title:"Renegotiated by Seller",value:"renegotiated_by_seller"}],$=(U,Y,z,Q)=>d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(E.FormControl,{fullWidth:!0,children:d.jsx(Yt,{name:`properties.${U}`,control:n,meta:{options:z,displayName:Y,placeholder:`Select ${Y.toLowerCase()}`,description:Q},viewOnly:m})})},U);if(v==="best_price.list")return d.jsxs(d.Fragment,{children:[j("items","Items",{required:!0,description:"Array of items to fetch best prices for (item_id, slug, item_code, price.effective {min,max}, price.marked {min,max})."}),H("currency_code","Currency Code",{required:!0,placeholder:"INR"}),H("currency_symbol","Currency Symbol",{required:!0,placeholder:"₹"}),H("app_user_id","App User ID",{required:!0}),H("app_currency_code","Override App Currency Code"),H("app_country_code","Override App Country Code")]});if(v==="contract.list")return d.jsxs(d.Fragment,{children:[X(),$("is_active","Is Active",V),$("status","Status",G),$("unmask","Unmask Sensitive Fields",V,"When true, returns unmasked merchant_id / notification_email.")]});if(v==="contract.get")return d.jsxs(d.Fragment,{children:[H("contract_id","Contract ID",{required:!0,placeholder:"MongoDB ObjectId"}),$("unmask","Unmask Sensitive Fields",V)]});if(v==="contract.create"||v==="contract.update"){const U=v==="contract.update";return d.jsxs(d.Fragment,{children:[U&&H("contract_id","Contract ID",{required:!0}),H("name","Name",{required:!U,placeholder:"Contract Pricing Offer 1"}),j("store_id","Store IDs",{required:!U,description:"Array of integer store IDs the contract applies to."}),H("schedule_start","Schedule Start",{placeholder:"2026-03-17T11:00:00.000Z",required:!U}),H("schedule_end","Schedule End",{placeholder:"2026-03-18T11:00:00.000Z",required:!U}),H("uploaded_file_url","Uploaded File URL",{required:!U}),j("notification_email","Notification Emails",{description:"Array of emails to notify on frequency thresholds."}),j("notification_frequency","Notification Frequency (days)",{description:"Array of integer day intervals at which notification emails are sent."}),$("is_active","Is Active",V)]})}if(v==="contract.delete"||v==="contract.sync")return H("contract_id","Contract ID",{required:!0});if(v==="ladder.list")return d.jsxs(d.Fragment,{children:[X(),$("is_active","Is Active",V),$("status","Status",G)]});if(v==="ladder.get"||v==="ladder.delete"||v==="ladder.sync")return H("ladder_id","Ladder ID",{required:!0});if(v==="ladder.create"||v==="ladder.update"){const U=v==="ladder.update";return d.jsxs(d.Fragment,{children:[U&&H("ladder_id","Ladder ID",{required:!0}),H("name","Name",{required:!U,placeholder:"Testing Ladder"}),j("store_id","Store IDs",{required:!U,description:"Array of integer store IDs."}),j("store_name_code","Store Name Code",{description:'Map of store ID (string) → display name. e.g. { "137595": "Bangalore" }'}),H("schedule_start","Schedule Start",{placeholder:"2026-03-30T16:24:00.000Z",required:!U}),H("schedule_end","Schedule End",{placeholder:"2026-03-31T16:24:00.000Z",required:!U}),H("uploaded_file_url","Uploaded File URL",{required:!U}),$("is_active","Is Active",V)]})}return v==="quotation.list"?d.jsxs(d.Fragment,{children:[X(),$("status","Status",D),H("from_date","From Date",{description:"ISO 8601 timestamp."}),H("to_date","To Date",{description:"ISO 8601 timestamp."}),$("unmask","Unmask Sensitive Fields",V,"When true, returns unmasked user.email / user.phone.")]}):v==="quotation.get"?d.jsxs(d.Fragment,{children:[H("quote_request_id","Quote Request ID",{required:!0}),$("unmask","Unmask Sensitive Fields",V)]}):v==="quotation.approve"?d.jsxs(d.Fragment,{children:[H("quote_request_id","Quote Request ID",{required:!0}),j("quotes","Quotes",{description:"Per-line approval payload — each item carries final/seller_quoted prices."}),j("notes","Notes")]}):v==="quotation.reject"?d.jsxs(d.Fragment,{children:[H("quote_request_id","Quote Request ID",{required:!0}),H("reason","Rejection Reason",{required:!0,multiline:!0}),j("notes","Notes")]}):v==="quotation.renegotiate"?d.jsxs(d.Fragment,{children:[H("quote_request_id","Quote Request ID",{required:!0}),j("quotes","Renegotiated Quotes",{required:!0,description:"Per-line renegotiated prices."}),H("due_date","Due Date",{placeholder:"2025-01-20"}),j("notes","Notes")]}):v==="quotation.add_note"?d.jsxs(d.Fragment,{children:[H("quote_request_id","Quote Request ID",{required:!0}),H("text","Note Text",{required:!0,multiline:!0})]}):v==="custom.custom_api"?d.jsx(ml,{id:f,type:c,isLoop:p,viewOnly:m,customSelectedTab:R,setCustomSelectedTab:I}):null};return d.jsxs(E.Stack,{gap:2.5,children:[d.jsx(Ei,{children:d.jsxs(E.Grid,{container:!0,gap:1.5,children:[d.jsx(cg,{control:n,name:"properties.secret",label:"Fynd Commerce B2B Account",placeholder:"Select Fynd Commerce B2B account",addNewButtonText:"Add new account",searchFieldPlaceholder:"Search Fynd Commerce B2B account",description:"Fynd Commerce B2B credentials are encrypted and can be removed at any time.",authType:JP,options:P,isLoading:b,TESSERACT_MAIN_URL:l,FRONTEND_URL:u,ENTITY_ID:a,openIntegrationDrawer:O,viewOnly:m,isTokenRevoked:k,handleReconnect:L,handleChange:V=>{V.value&&N(!1)},validationMessage:"Commerce B2B account is required",id:c}),T?.secret&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(E.FormControl,{fullWidth:!0,children:d.jsx(Yt,{name:"properties.operation",control:n,meta:{options:Eue,displayName:"Operation",searchFieldPlaceholder:"Search operation",description:"Select the Commerce B2B resource and action to perform.",placeholder:"Select an operation"},validationRules:{required:"Operation is required"},viewOnly:m,required:!0})})})]})}),T?.secret&&v&&d.jsx(E.Divider,{}),T?.secret&&v&&d.jsx(En,{children:d.jsx(E.Grid,{container:!0,gap:1.5,children:F()})})]})}),QBe=Gi(WBe,""),$s=e=>{const{name:t,label:r,description:n,addItemLabel:i,itemLabel:o,newItem:s,renderItem:a,minItems:l=0,viewOnly:u=!1}=e,c=E.useTheme(),{control:f}=Rr(),{fields:p,append:h,remove:A}=KAe({control:f,name:t});return d.jsxs(E.Stack,{gap:1.25,sx:{width:"100%"},children:[d.jsxs(E.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[d.jsx(gn,{label:r,description:n}),!u&&d.jsx(E.IconButton,{onClick:()=>h(s()),sx:{p:.75,border:`1px solid ${c.palette.grey.brainstem}`,fontSize:c.typography.mdNormal.fontSize},color:"primary","aria-label":i||`Add ${r}`,children:d.jsx(Ue,{src:"ic_plus",sx:{path:{fill:c.palette.primary.main}}})})]}),p.length===0&&d.jsx(E.Typography,{variant:"body2",color:"text.secondary",children:"No items yet — click + to add one."}),p.map((g,m)=>d.jsxs(E.Box,{sx:{border:`1px solid ${c.palette.grey.brainstem}`,borderRadius:1,p:1.5},children:[d.jsxs(E.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",mb:1,children:[d.jsx(E.Typography,{variant:"subtitle2",children:o?.(m)||`${r.replace(/s$/,"")} ${m+1}`}),!u&&p.length>l&&d.jsx(E.Button,{size:"small",color:"error",onClick:()=>A(m),"aria-label":`Remove item ${m+1}`,children:"Remove"})]}),d.jsx(E.Grid,{container:!0,gap:1.5,children:a(m)})]},g.id)),!u&&p.length>0&&d.jsxs(E.Button,{onClick:()=>h(s()),variant:"outlined",size:"small",sx:{alignSelf:"flex-start"},children:["+ ",i||`Add ${r.replace(/s$/,"")}`]})]})},eN="FYND_ENGAGE",zBe="blt-int.engage",XBe=_.forwardRef((e,t)=>{const r=ct.useDispatch(),{control:n,watch:i,setValue:o,formState:{errors:s}}=Rr(),{ENTITY_ID:a,TESSERACT_MAIN_URL:l,FRONTEND_URL:u,type:c,id:f,isLoop:p=!1,suggestionsData:h,INTEGRATION_DATA:A,VORTEX_MAIN_URL:g,viewOnly:m=!1,openIntegrationDrawer:O}=e,{loopSuggestionsData:y={}}=ct.useSelector(V=>V.loopActivity),T=i("properties"),v=T?.operation||"",[C,x]=_.useState([]),[b,w]=_.useState(!1),[R,I]=_.useState("Query Params"),P=yn(C),{isTokenRevoked:k,setTokenRevoked:N,handleReconnect:L}=Al({credentialId:T?.secret||"",TESSERACT_MAIN_URL:l,FRONTEND_URL:u,ENTITY_ID:a,openIntegrationDrawer:O}),M=()=>{w(!0);const V={page_size:999,current_page:1,type:"BOTH"},G=Xt(l,`/v1/integrations/entity/${eN}`);zt.get(G,{params:V}).then(({data:D})=>{x(ro(D.data))}).catch(D=>{sr(D,r)}).finally(()=>{w(!1)})};_.useEffect(()=>{M(),T?.integration_slug||o("properties.integration_slug",zBe,{shouldValidate:!1})},[]),_.useEffect(()=>{A?._id&&A?.meta?.entity===eN&&(A?.meta?.auth_status==="ACTIVE"&&N(!1),M(),o("properties.secret",A._id,{shouldValidate:!0}))},[A]);const B={VORTEX_MAIN_URL:g,ENTITY_ID:a,viewOnly:m,showSuggestions:!0,language:"json",showExpandOption:!0,suggestionsData:p?y:h},H=(V,G,D={})=>d.jsx(E.Grid,{item:!0,xs:D.xs??12,children:d.jsx(kr,{required:D.required,id:f,name:V,control:n,type:D.type==="number"?"number":"text",meta:{displayName:G,placeholder:D.placeholder||`Enter ${G.toLowerCase()}`,description:D.description,displayType:D.type==="number"?"number":"text"},validationRules:D.required?{required:`${G} is required`}:{},viewOnly:m,editorId:`${c}-${V}-${p}`,showSuggestions:!0,isLoop:p})},V),j=(V,G,D={})=>H(`properties.${V}`,G,D),X=(V,G,D={})=>d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(pr,{name:`properties.${V}`,control:n,rules:D.required?{required:`${G} is required`}:{},render:({field:$})=>d.jsx(Fi,{...$,...B,label:G,suggestionLabel:G,id:`${c}-${V}`,activityType:c,size:"md",helperText:D.description,errorMsg:s.properties?.[V]?.message,error:!!s.properties?.[V]?.message,handleChange:U=>$.onChange(U),required:D.required})})},V),F=()=>{if(!v)return null;if(v==="users.create")return d.jsxs(d.Fragment,{children:[j("external_id","External ID",{required:!0,description:"Your internal user identifier."}),j("name","Name"),j("email","Email"),j("phone","Phone",{placeholder:"+91XXXXXXXXXX"}),j("gender","Gender",{placeholder:"male / female / other"}),j("date_of_birth","Date of Birth",{placeholder:"YYYY-MM-DD"}),X("custom_attributes","Custom Attributes",{description:"Free-form JSON object for additional profile attributes."})]});if(v==="users.get"||v==="users.delete"||v==="users.tier_status"||v==="users.tier_journey")return j("user_id","User ID",{required:!0});if(v==="users.update")return d.jsxs(d.Fragment,{children:[j("user_id","User ID",{required:!0}),j("name","Name"),j("email","Email"),j("phone","Phone",{placeholder:"+91XXXXXXXXXX"}),j("gender","Gender",{placeholder:"male / female / other"}),j("date_of_birth","Date of Birth",{placeholder:"YYYY-MM-DD"}),X("custom_attributes","Custom Attributes",{description:"Free-form JSON object for additional profile attributes."})]});if(v==="users.points_history")return d.jsxs(d.Fragment,{children:[j("user_id","User ID",{required:!0}),j("page","Page",{type:"number",placeholder:"1"}),j("limit","Limit",{type:"number",placeholder:"50"})]});if(v==="users.apply_referral")return d.jsxs(d.Fragment,{children:[j("user_id","User ID",{required:!0}),j("referral_code","Referral Code",{required:!0})]});if(v==="tiers.list")return null;if(v==="tiers.get")return j("tier_id","Tier ID",{required:!0});if(v==="wallet.balance")return j("user_id","User ID",{required:!0});if(v==="wallet.transfer")return d.jsxs(d.Fragment,{children:[j("user_id","From User ID",{required:!0}),j("to_user_id","To User ID",{required:!0}),j("points","Points",{required:!0,type:"number"}),j("reason","Reason")]});if(v==="wallet.add_points")return d.jsxs(d.Fragment,{children:[j("user_id","User ID",{required:!0}),j("points","Points to Credit",{required:!0,type:"number"}),j("reason","Reason"),X("metadata","Metadata")]});if(v==="wallet.redeem_points")return d.jsxs(d.Fragment,{children:[j("user_id","User ID",{required:!0}),j("points","Points to Redeem",{required:!0,type:"number"}),j("reason","Reason")]});if(v==="events.publish")return d.jsxs(d.Fragment,{children:[j("event_name","Event Name",{required:!0}),j("user_id","User ID",{required:!0}),X("properties","Event Properties")]});const V=G=>d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx($s,{name:G,label:"Items",description:"Items in the order — one row per SKU.",addItemLabel:"Add item",itemLabel:D=>`Item ${D+1}`,newItem:()=>({item_id:"",sku_code:"",ean_identifier:"",article_id:"",quantity:"",amount:"",currency:"",return_period:""}),viewOnly:m,renderItem:D=>d.jsxs(d.Fragment,{children:[H(`${G}.${D}.item_id`,"Item ID",{required:!0,xs:6}),H(`${G}.${D}.sku_code`,"SKU Code",{xs:6}),H(`${G}.${D}.ean_identifier`,"EAN Identifier",{xs:6}),H(`${G}.${D}.article_id`,"Article ID",{xs:6}),H(`${G}.${D}.quantity`,"Quantity",{required:!0,type:"number",xs:4}),H(`${G}.${D}.amount`,"Amount",{required:!0,type:"number",xs:4}),H(`${G}.${D}.currency`,"Currency",{placeholder:"INR",xs:4}),H(`${G}.${D}.return_period`,"Return Period (days)",{type:"number"})]})})});if(v==="orders.create"||v==="orders.update"||v==="orders.calculate_loyalty"){const G=v==="orders.update";return d.jsxs(d.Fragment,{children:[j("order.transaction_id","Transaction ID",{required:!G,placeholder:"TXN-1"}),j("order.cart_id","Cart ID",{required:!G}),j("order.phoneNumber","Phone Number",{placeholder:"+91XXXXXXXXXX"}),j("order.order_amount","Order Amount",{required:!G,type:"number"}),j("order.currency","Currency",{placeholder:"INR",required:!G}),V("properties.order.items")]})}return v==="orders.get"?j("transaction_id","Transaction ID",{required:!0}):v==="orders.return"?d.jsxs(d.Fragment,{children:[j("return_payload.transaction_id","Transaction ID",{required:!0}),j("return_payload.trace_id","Trace ID"),j("return_payload.is_partial_refund_allowed","Allow Partial Refund",{placeholder:"true / false"}),d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx($s,{name:"properties.return_payload.return_items",label:"Return Items",addItemLabel:"Add return item",itemLabel:G=>`Return Item ${G+1}`,newItem:()=>({item_id:"",quantity:""}),viewOnly:m,renderItem:G=>d.jsxs(d.Fragment,{children:[H(`properties.return_payload.return_items.${G}.item_id`,"Item ID",{required:!0,xs:6}),H(`properties.return_payload.return_items.${G}.quantity`,"Quantity",{required:!0,type:"number",xs:6})]})})}),j("return_payload.meta.cart_id","Meta — Cart ID"),j("return_payload.meta.order_id","Meta — Order ID")]}):v==="orders.apply_discount"?d.jsxs(d.Fragment,{children:[j("payload.cart_id","Cart ID",{required:!0}),j("payload.phoneNumber","Phone Number"),j("payload.order_amount","Order Amount",{required:!0,type:"number"}),j("payload.currency","Currency",{placeholder:"INR"}),V("properties.payload.items")]}):v==="orders.award_points"?d.jsxs(d.Fragment,{children:[j("payload.transaction_id","Transaction ID",{required:!0}),j("payload.cart_id","Cart ID",{required:!0}),j("payload.order_amount","Order Amount",{required:!0,type:"number"}),j("payload.currency","Currency",{placeholder:"INR"}),V("properties.payload.items")]}):v==="orders.discount_rules"?X("filters","Filters"):v==="custom.custom_api"?d.jsx(ml,{id:f,type:c,isLoop:p,viewOnly:m,customSelectedTab:R,setCustomSelectedTab:I}):null};return d.jsxs(E.Stack,{gap:2.5,children:[d.jsx(Ei,{children:d.jsxs(E.Grid,{container:!0,gap:1.5,children:[d.jsx(cg,{control:n,name:"properties.secret",label:"Fynd Engage Account",placeholder:"Select Fynd Engage account",addNewButtonText:"Add new account",searchFieldPlaceholder:"Search Fynd Engage account",description:"Fynd Engage credentials are encrypted and can be removed at any time.",authType:eN,options:P,isLoading:b,TESSERACT_MAIN_URL:l,FRONTEND_URL:u,ENTITY_ID:a,openIntegrationDrawer:O,viewOnly:m,isTokenRevoked:k,handleReconnect:L,handleChange:V=>{V.value&&N(!1)},validationMessage:"Engage account is required",id:c}),T?.secret&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(E.FormControl,{fullWidth:!0,children:d.jsx(Yt,{name:"properties.operation",control:n,meta:{options:Aue,displayName:"Operation",searchFieldPlaceholder:"Search operation",description:"Select the Engage resource and action to perform.",placeholder:"Select an operation"},validationRules:{required:"Operation is required"},viewOnly:m,required:!0})})})]})}),T?.secret&&v&&d.jsx(E.Divider,{}),T?.secret&&v&&d.jsx(En,{children:d.jsx(E.Grid,{container:!0,gap:1.5,children:F()})})]})}),qBe=Gi(XBe,""),tN="FYND_KONNECT",YBe="blt-int.konnect",KBe=_.forwardRef((e,t)=>{const r=ct.useDispatch(),{control:n,watch:i,setValue:o,formState:{errors:s}}=Rr(),{ENTITY_ID:a,TESSERACT_MAIN_URL:l,FRONTEND_URL:u,type:c,id:f,isLoop:p=!1,suggestionsData:h,INTEGRATION_DATA:A,VORTEX_MAIN_URL:g,viewOnly:m=!1,openIntegrationDrawer:O}=e,{loopSuggestionsData:y={}}=ct.useSelector(F=>F.loopActivity),T=i("properties"),v=T?.operation||"",[C,x]=_.useState([]),[b,w]=_.useState(!1),[R,I]=_.useState("Query Params"),P=yn(C),{isTokenRevoked:k,setTokenRevoked:N,handleReconnect:L}=Al({credentialId:T?.secret||"",TESSERACT_MAIN_URL:l,FRONTEND_URL:u,ENTITY_ID:a,openIntegrationDrawer:O}),M=()=>{w(!0);const F={page_size:999,current_page:1,type:"BOTH"},V=Xt(l,`/v1/integrations/entity/${tN}`);zt.get(V,{params:F}).then(({data:G})=>{x(ro(G.data))}).catch(G=>{sr(G,r)}).finally(()=>{w(!1)})};_.useEffect(()=>{M(),T?.integration_slug||o("properties.integration_slug",YBe,{shouldValidate:!1})},[]),_.useEffect(()=>{A?._id&&A?.meta?.entity===tN&&(A?.meta?.auth_status==="ACTIVE"&&N(!1),M(),o("properties.secret",A._id,{shouldValidate:!0}))},[A]);const B={VORTEX_MAIN_URL:g,ENTITY_ID:a,viewOnly:m,showSuggestions:!0,language:"json",showExpandOption:!0,suggestionsData:p?y:h},H=(F,V,G={})=>d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(kr,{required:G.required,id:f,name:`properties.${F}`,control:n,type:G.type==="number"?"number":"text",meta:{displayName:V,placeholder:G.placeholder||`Enter ${V.toLowerCase()}`,description:G.description,displayType:G.type==="number"?"number":"text"},validationRules:G.required?{required:`${V} is required`}:{},viewOnly:m,editorId:`${c}-${F}-${p}`,showSuggestions:!0,isLoop:p})},F),j=(F,V,G={})=>d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(pr,{name:`properties.${F}`,control:n,rules:G.required?{required:`${V} is required`}:{},render:({field:D})=>d.jsx(Fi,{...D,...B,label:V,suggestionLabel:V,id:`${c}-${F}`,activityType:c,size:"md",helperText:G.description,errorMsg:s.properties?.[F]?.message,error:!!s.properties?.[F]?.message,handleChange:$=>D.onChange($),required:G.required})})},F),X=()=>{if(!v)return null;switch(v){case"catalog.list_departments":case"catalog.list_brands":return d.jsxs(d.Fragment,{children:[H("page_no","Page Number",{type:"number",placeholder:"1"}),H("page_size","Page Size",{type:"number",placeholder:"50"})]});case"catalog.list_categories":return d.jsxs(d.Fragment,{children:[H("department_id","Department ID",{description:"Filter categories by department."}),H("page_no","Page Number",{type:"number",placeholder:"1"}),H("page_size","Page Size",{type:"number",placeholder:"50"})]});case"catalog.list_attributes":case"catalog.list_hscodes":return null;case"catalog.list_templates":return d.jsxs(d.Fragment,{children:[H("department","Department"),H("page_no","Page Number",{type:"number",placeholder:"1"}),H("page_size","Page Size",{type:"number",placeholder:"50"})]});case"catalog.list_tax_rules":return d.jsxs(d.Fragment,{children:[H("status","Status"),H("version_status","Version Status"),H("rule_name","Rule Name"),H("page_no","Page Number",{type:"number",placeholder:"1"}),H("page_size","Page Size",{type:"number",placeholder:"50"})]});case"listings.count":return null;case"products.get":return d.jsxs(d.Fragment,{children:[H("name","Product Name"),H("slug","Slug"),H("item_code","Item Code(s)",{description:"Comma-separated list of item codes."}),H("sort_on","Sort On"),H("page_no","Page Number",{type:"number",placeholder:"1"}),H("page_size","Page Size",{type:"number",placeholder:"50"})]});case"products.check_status":return H("trace_id","Trace ID",{required:!0,description:"Trace ID returned by a previous create / update / delete call."});case"products.create":return j("products","Products",{required:!0,description:"Bulk product payload (max 500 records)."});case"products.update":return j("products","Products",{required:!0,description:"Bulk product update payload (max 500 records)."});case"products.delete":return j("products","Products",{required:!0,description:"Bulk product delete payload identifying products to remove."});case"inventory.update":return j("inventory","Inventory Records",{required:!0,description:"Bulk inventory payload (max 500 records). Each record specifies SKU, location, and stock count."});case"pricing.update":return j("pricing","Pricing Records",{required:!0,description:"Bulk pricing payload (max 500 records). Each record sets MRP / ESP per SKU per location."});case"listings.list":return d.jsxs(d.Fragment,{children:[H("page_no","Page Number",{type:"number",placeholder:"1"}),H("page_size","Page Size",{type:"number",placeholder:"50"}),H("from_date","From Date",{description:"ISO 8601 timestamp."}),H("to_date","To Date",{description:"ISO 8601 timestamp."}),H("sku","SKU Filter")]});case"orders.list":return d.jsxs(d.Fragment,{children:[H("page_no","Page Number",{type:"number",placeholder:"1"}),H("page_size","Page Size",{type:"number",placeholder:"20"}),H("status","Status"),H("from_date","From Date",{description:"ISO 8601 timestamp."}),H("to_date","To Date",{description:"ISO 8601 timestamp."})]});case"orders.info":return H("shipment_id","Shipment ID",{required:!0});case"orders.cancel":return j("shipments","Shipments",{required:!0,description:"Cancellation payload (max 20 shipments)."});case"orders.confirm":return j("shipments","Shipments",{required:!0});case"orders.pack":return j("shipments","Shipments",{required:!0});case"orders.update_awb":return j("shipments","AWB Updates",{required:!0,description:"AWB / courier update payload."});case"orders.invoice_update":return j("invoices","Invoice Updates",{required:!0});case"orders.dispatch":return j("shipments","Shipments",{required:!0,description:"Shipments to mark as dispatched (max 20)."});case"orders.fetch_invoice":return j("shipments","Shipments",{required:!0,description:"Shipments to fetch customer invoices for (max 20)."});case"orders.shipping_labels":return j("shipments","Shipments",{required:!0,description:"Shipments to generate shipping labels for (max 20)."});case"orders.courier_details":return j("shipments","Shipments",{required:!0,description:"Shipments to fetch courier details for (max 20)."});case"orders.update_status":return j("shipments","Shipment Status Updates",{required:!0,description:"Shipment status update payload (max 20)."});case"orders.track":return d.jsxs(d.Fragment,{children:[H("awb_number","AWB Number"),H("shipment_id","Shipment ID")]});case"returns.create":return j("returns","Returns",{required:!0,description:"Returns / RTO payload (max 20 records)."});case"custom.custom_api":return d.jsx(ml,{id:f,type:c,isLoop:p,viewOnly:m,customSelectedTab:R,setCustomSelectedTab:I});default:return null}};return d.jsxs(E.Stack,{gap:2.5,children:[d.jsx(Ei,{children:d.jsxs(E.Grid,{container:!0,gap:1.5,children:[d.jsx(cg,{control:n,name:"properties.secret",label:"Fynd Konnect Account",placeholder:"Select Fynd Konnect account",addNewButtonText:"Add new account",searchFieldPlaceholder:"Search Konnect account",description:"Fynd Konnect credentials are encrypted and can be removed at any time.",authType:tN,options:P,isLoading:b,TESSERACT_MAIN_URL:l,FRONTEND_URL:u,ENTITY_ID:a,openIntegrationDrawer:O,viewOnly:m,isTokenRevoked:k,handleReconnect:L,handleChange:F=>{F.value&&N(!1)},validationMessage:"Konnect account is required",id:c}),T?.secret&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(E.FormControl,{fullWidth:!0,children:d.jsx(Yt,{name:"properties.operation",control:n,meta:{options:hue,displayName:"Operation",searchFieldPlaceholder:"Search operation",description:"Select the Konnect resource and action to perform.",placeholder:"Select an operation"},validationRules:{required:"Operation is required"},viewOnly:m,required:!0})})})]})}),T?.secret&&v&&d.jsx(E.Divider,{}),T?.secret&&v&&d.jsx(En,{children:d.jsx(E.Grid,{container:!0,gap:1.5,children:X()})})]})}),ZBe=Gi(KBe,""),rN="FYND_TMS",JBe="blt-int.fynd-tms",e7e=_.forwardRef((e,t)=>{const r=ct.useDispatch(),{control:n,watch:i,setValue:o,formState:{errors:s}}=Rr(),{ENTITY_ID:a,TESSERACT_MAIN_URL:l,FRONTEND_URL:u,type:c,id:f,isLoop:p=!1,suggestionsData:h,INTEGRATION_DATA:A,VORTEX_MAIN_URL:g,viewOnly:m=!1,openIntegrationDrawer:O}=e,{loopSuggestionsData:y={}}=ct.useSelector(D=>D.loopActivity),T=i("properties"),v=T?.operation||"",[C,x]=_.useState([]),[b,w]=_.useState(!1),[R,I]=_.useState("Query Params"),P=yn(C),{isTokenRevoked:k,setTokenRevoked:N,handleReconnect:L}=Al({credentialId:T?.secret||"",TESSERACT_MAIN_URL:l,FRONTEND_URL:u,ENTITY_ID:a,openIntegrationDrawer:O}),M=()=>{w(!0);const D={page_size:999,current_page:1,type:"BOTH"},$=Xt(l,`/v1/integrations/entity/${rN}`);zt.get($,{params:D}).then(({data:U})=>{x(ro(U.data))}).catch(U=>{sr(U,r)}).finally(()=>{w(!1)})};_.useEffect(()=>{M(),T?.integration_slug||o("properties.integration_slug",JBe,{shouldValidate:!1})},[]),_.useEffect(()=>{A?._id&&A?.meta?.entity===rN&&(A?.meta?.auth_status==="ACTIVE"&&N(!1),M(),o("properties.secret",A._id,{shouldValidate:!0}))},[A]);const B={VORTEX_MAIN_URL:g,ENTITY_ID:a,viewOnly:m,showSuggestions:!0,language:"json",showExpandOption:!0,suggestionsData:p?y:h},H=(D,$,U={})=>d.jsx(E.Grid,{item:!0,xs:U.xs??12,children:d.jsx(kr,{required:U.required,id:f,name:D,control:n,type:U.type==="number"?"number":"text",meta:{displayName:$,placeholder:U.placeholder||`Enter ${$.toLowerCase()}`,description:U.description,displayType:U.type==="number"?"number":"text"},validationRules:U.required?{required:`${$} is required`}:{},viewOnly:m,editorId:`${c}-${D}-${p}`,showSuggestions:!0,isLoop:p})},D),j=(D,$,U={})=>H(`properties.${D}`,$,U),X=(D,$,U={})=>d.jsx(E.Grid,{item:!0,xs:U.xs??12,children:d.jsx(pr,{name:D,control:n,rules:U.required?{required:`${$} is required`}:{},render:({field:Y})=>d.jsx(Fi,{...Y,...B,label:$,suggestionLabel:$,id:`${c}-${D}`,activityType:c,size:"md",helperText:U.description,placeholder:U.placeholder,handleChange:z=>Y.onChange(z),required:U.required})})},D),F=(D,$,U={})=>d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(pr,{name:`properties.${D}`,control:n,rules:U.required?{required:`${$} is required`}:{},render:({field:Y})=>d.jsx(Fi,{...Y,...B,label:$,suggestionLabel:$,id:`${c}-${D}`,activityType:c,size:"md",helperText:U.description,errorMsg:s.properties?.[D]?.message,error:!!s.properties?.[D]?.message,handleChange:z=>Y.onChange(z),required:U.required})})},D),V=()=>d.jsxs(d.Fragment,{children:[j("page","Page",{type:"number",placeholder:"1"}),j("size","Page Size",{type:"number",placeholder:"20"})]}),G=()=>v?v==="shipments.list"?d.jsxs(d.Fragment,{children:[V(),j("awb_number","AWB Numbers (comma separated)"),j("reference_id","Reference IDs"),j("order_id","Order IDs"),j("status_code","Status Codes"),j("created_from","Created From",{description:"ISO 8601 timestamp."}),j("created_to","Created To",{description:"ISO 8601 timestamp."}),j("pickup_serviceability_code","Pickup Serviceability Code"),j("drop_serviceability_code","Drop Serviceability Code"),j("dispatch_strategy","Dispatch Strategy"),j("hub_id","Hub IDs"),j("courier_identifier","Courier Identifier"),j("invoice_number","Invoice Number"),j("journey_type","Journey Type"),j("sort_field","Sort Field"),j("sort_order","Sort Order"),j("column","Columns")]}):v==="shipments.create"?d.jsxs(d.Fragment,{children:[j("identifier","Identifier",{description:"Optional batch identifier echoed back in the response."}),d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx($s,{name:"properties.data",label:"Shipments",description:"One ShipmentCreatePublic item per row.",addItemLabel:"Add shipment",itemLabel:D=>`Shipment ${D+1}`,newItem:()=>({reference_id:"",courier_identifier:"",journey_type:"",mps:"",length:"",width:"",height:"",weight:"",amount_to_collect:"",pickup_location:"",drop_location:"",rto_location:"",invoice:"",payment_method:"",packages:""}),viewOnly:m,renderItem:D=>d.jsxs(d.Fragment,{children:[H(`properties.data.${D}.reference_id`,"Reference ID",{placeholder:"REF-1",xs:6}),H(`properties.data.${D}.courier_identifier`,"Courier Identifier",{placeholder:"e.g. delhivery",xs:6}),H(`properties.data.${D}.journey_type`,"Journey Type",{placeholder:"forward / return",xs:6}),H(`properties.data.${D}.mps`,"Multi-Piece Shipment (MPS)",{placeholder:"true / false",xs:6}),H(`properties.data.${D}.length`,"Length",{type:"number",xs:3}),H(`properties.data.${D}.width`,"Width",{type:"number",xs:3}),H(`properties.data.${D}.height`,"Height",{type:"number",xs:3}),H(`properties.data.${D}.weight`,"Weight",{type:"number",xs:3}),H(`properties.data.${D}.amount_to_collect`,"Amount to Collect (COD)",{type:"number",placeholder:"0"}),X(`properties.data.${D}.pickup_location`,"Pickup Location",{required:!0,description:"Address + contact object.",placeholder:`{
505
+ `)+" "+U[1]:U[0]+$+" "+D.join(", ")+" "+U[1]}function v(D){return Array.isArray(D)}i.isArray=v;function C(D){return typeof D=="boolean"}i.isBoolean=C;function x(D){return D===null}i.isNull=x;function b(D){return D==null}i.isNullOrUndefined=b;function w(D){return typeof D=="number"}i.isNumber=w;function R(D){return typeof D=="string"}i.isString=R;function I(D){return typeof D=="symbol"}i.isSymbol=I;function P(D){return D===void 0}i.isUndefined=P;function k(D){return N(D)&&j(D)==="[object RegExp]"}i.isRegExp=k;function N(D){return typeof D=="object"&&D!==null}i.isObject=N;function L(D){return N(D)&&j(D)==="[object Date]"}i.isDate=L;function M(D){return N(D)&&(j(D)==="[object Error]"||D instanceof Error)}i.isError=M;function B(D){return typeof D=="function"}i.isFunction=B;function H(D){return D===null||typeof D=="boolean"||typeof D=="number"||typeof D=="string"||typeof D=="symbol"||typeof D>"u"}i.isPrimitive=H,i.isBuffer=r("./support/isBuffer");function j(D){return Object.prototype.toString.call(D)}function X(D){return D<10?"0"+D.toString(10):D.toString(10)}var F=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function V(){var D=new Date,$=[X(D.getHours()),X(D.getMinutes()),X(D.getSeconds())].join(":");return[D.getDate(),F[D.getMonth()],$].join(" ")}i.log=function(){},i.inherits=r("inherits"),i._extend=function(D,$){if(!$||!N($))return D;for(var U=Object.keys($),Y=U.length;Y--;)D[U[Y]]=$[U[Y]];return D};function G(D,$){return Object.prototype.hasOwnProperty.call(D,$)}}).call(this,r("_process"),typeof Ur<"u"?Ur:typeof self<"u"?self:typeof window<"u"?window:{})},{"./support/isBuffer":10,_process:14,inherits:9}],12:[function(r,n,i){},{}],13:[function(r,n,i){(function(o){function s(c,f){for(var p=0,h=c.length-1;h>=0;h--){var A=c[h];A==="."?c.splice(h,1):A===".."?(c.splice(h,1),p++):p&&(c.splice(h,1),p--)}if(f)for(;p--;p)c.unshift("..");return c}i.resolve=function(){for(var c="",f=!1,p=arguments.length-1;p>=-1&&!f;p--){var h=p>=0?arguments[p]:o.cwd();if(typeof h!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!h)continue;c=h+"/"+c,f=h.charAt(0)==="/"}return c=s(l(c.split("/"),function(A){return!!A}),!f).join("/"),(f?"/":"")+c||"."},i.normalize=function(c){var f=i.isAbsolute(c),p=u(c,-1)==="/";return c=s(l(c.split("/"),function(h){return!!h}),!f).join("/"),!c&&!f&&(c="."),c&&p&&(c+="/"),(f?"/":"")+c},i.isAbsolute=function(c){return c.charAt(0)==="/"},i.join=function(){var c=Array.prototype.slice.call(arguments,0);return i.normalize(l(c,function(f,p){if(typeof f!="string")throw new TypeError("Arguments to path.join must be strings");return f}).join("/"))},i.relative=function(c,f){c=i.resolve(c).substr(1),f=i.resolve(f).substr(1);function p(T){for(var v=0;v<T.length&&T[v]==="";v++);for(var C=T.length-1;C>=0&&T[C]==="";C--);return v>C?[]:T.slice(v,C-v+1)}for(var h=p(c.split("/")),A=p(f.split("/")),g=Math.min(h.length,A.length),m=g,O=0;O<g;O++)if(h[O]!==A[O]){m=O;break}for(var y=[],O=m;O<h.length;O++)y.push("..");return y=y.concat(A.slice(m)),y.join("/")},i.sep="/",i.delimiter=":",i.dirname=function(c){if(typeof c!="string"&&(c=c+""),c.length===0)return".";for(var f=c.charCodeAt(0),p=f===47,h=-1,A=!0,g=c.length-1;g>=1;--g)if(f=c.charCodeAt(g),f===47){if(!A){h=g;break}}else A=!1;return h===-1?p?"/":".":p&&h===1?"/":c.slice(0,h)};function a(c){typeof c!="string"&&(c=c+"");var f=0,p=-1,h=!0,A;for(A=c.length-1;A>=0;--A)if(c.charCodeAt(A)===47){if(!h){f=A+1;break}}else p===-1&&(h=!1,p=A+1);return p===-1?"":c.slice(f,p)}i.basename=function(c,f){var p=a(c);return f&&p.substr(-1*f.length)===f&&(p=p.substr(0,p.length-f.length)),p},i.extname=function(c){typeof c!="string"&&(c=c+"");for(var f=-1,p=0,h=-1,A=!0,g=0,m=c.length-1;m>=0;--m){var O=c.charCodeAt(m);if(O===47){if(!A){p=m+1;break}continue}h===-1&&(A=!1,h=m+1),O===46?f===-1?f=m:g!==1&&(g=1):f!==-1&&(g=-1)}return f===-1||h===-1||g===0||g===1&&f===h-1&&f===p+1?"":c.slice(f,h)};function l(c,f){if(c.filter)return c.filter(f);for(var p=[],h=0;h<c.length;h++)f(c[h],h,c)&&p.push(c[h]);return p}var u="ab".substr(-1)==="b"?function(c,f,p){return c.substr(f,p)}:function(c,f,p){return f<0&&(f=c.length+f),c.substr(f,p)}}).call(this,r("_process"))},{_process:14}],14:[function(r,n,i){var o=n.exports={},s,a;function l(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?s=setTimeout:s=l}catch{s=l}try{typeof clearTimeout=="function"?a=clearTimeout:a=u}catch{a=u}})();function c(v){if(s===setTimeout)return setTimeout(v,0);if((s===l||!s)&&setTimeout)return s=setTimeout,setTimeout(v,0);try{return s(v,0)}catch{try{return s.call(null,v,0)}catch{return s.call(this,v,0)}}}function f(v){if(a===clearTimeout)return clearTimeout(v);if((a===u||!a)&&clearTimeout)return a=clearTimeout,clearTimeout(v);try{return a(v)}catch{try{return a.call(null,v)}catch{return a.call(this,v)}}}var p=[],h=!1,A,g=-1;function m(){!h||!A||(h=!1,A.length?p=A.concat(p):g=-1,p.length&&O())}function O(){if(!h){var v=c(m);h=!0;for(var C=p.length;C;){for(A=p,p=[];++g<C;)A&&A[g].run();g=-1,C=p.length}A=null,h=!1,f(v)}}o.nextTick=function(v){var C=new Array(arguments.length-1);if(arguments.length>1)for(var x=1;x<arguments.length;x++)C[x-1]=arguments[x];p.push(new y(v,C)),p.length===1&&!h&&c(O)};function y(v,C){this.fun=v,this.array=C}y.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={};function T(){}o.on=T,o.addListener=T,o.once=T,o.off=T,o.removeListener=T,o.removeAllListeners=T,o.emit=T,o.prependListener=T,o.prependOnceListener=T,o.listeners=function(v){return[]},o.binding=function(v){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(v){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],15:[function(r,n,i){var o=r("escodegen").generate;n.exports=function(a,l,u){u||(u={});var c=!u.allowAccessToMethodsOnFunctions;l||(l={});var f={},p=(function h(A,g){if(A.type==="Literal")return A.value;if(A.type==="UnaryExpression"){var m=h(A.argument,g);return A.operator==="+"?+m:A.operator==="-"?-m:A.operator==="~"?~m:A.operator==="!"?!m:f}else if(A.type==="ArrayExpression"){for(var O=[],y=0,T=A.elements.length;y<T;y++){var v=h(A.elements[y],g);if(v===f)return f;O.push(v)}return O}else if(A.type==="ObjectExpression"){for(var C={},y=0;y<A.properties.length;y++){var x=A.properties[y],b=x.value===null?x.value:h(x.value,g);if(b===f)return f;C[x.key.value||x.key.name]=b}return C}else if(A.type==="BinaryExpression"||A.type==="LogicalExpression"){var w=A.operator;if(w==="&&"){var T=h(A.left);if(T===f)return f;if(!T)return T;var R=h(A.right);return R===f?f:R}else if(w==="||"){var T=h(A.left);if(T===f)return f;if(T)return T;var R=h(A.right);return R===f?f:R}var T=h(A.left,g);if(T===f)return f;var R=h(A.right,g);return R===f?f:w==="=="?T==R:w==="==="?T===R:w==="!="?T!=R:w==="!=="?T!==R:w==="+"?T+R:w==="-"?T-R:w==="*"?T*R:w==="/"?T/R:w==="%"?T%R:w==="<"?T<R:w==="<="?T<=R:w===">"?T>R:w===">="?T>=R:w==="|"?T|R:w==="&"?T&R:w==="^"?T^R:f}else{if(A.type==="Identifier")return{}.hasOwnProperty.call(l,A.name)?l[A.name]:f;if(A.type==="ThisExpression")return{}.hasOwnProperty.call(l,"this")?l.this:f;if(A.type==="CallExpression"){var I=h(A.callee,g);if(I===f||typeof I!="function")return f;var P=A.callee.object?h(A.callee.object,g):f;P===f&&(P=null);for(var k=[],y=0,T=A.arguments.length;y<T;y++){var v=h(A.arguments[y],g);if(v===f)return f;k.push(v)}return g?void 0:I.apply(P,k)}else if(A.type==="MemberExpression"){var C=h(A.object,g);if(C===f||typeof C=="function"&&c)return f;if(A.property.type==="Identifier"&&!A.computed)return s(A.property.name)?f:C[A.property.name];var x=h(A.property,g);return x===null||x===f||s(x)?f:C[x]}else if(A.type==="ConditionalExpression"){var m=h(A.test,g);return m===f?f:m?h(A.consequent):h(A.alternate,g)}else if(A.type==="ExpressionStatement"){var m=h(A.expression,g);return m===f?f:m}else{if(A.type==="ReturnStatement")return h(A.argument,g);if(A.type==="FunctionExpression"){var N=A.body.body,L={};Object.keys(l).forEach(function(D){L[D]=l[D]});for(var y=0;y<A.params.length;y++){var M=A.params[y];if(M.type=="Identifier")l[M.name]=null;else return f}for(var y in N)if(h(N[y],!0)===f)return f;l=L;var B=Object.keys(l),H=B.map(function(D){return l[D]});return Function(B.join(", "),"return "+o(A)).apply(null,H)}else if(A.type==="TemplateLiteral"){for(var j="",y=0;y<A.expressions.length;y++)j+=h(A.quasis[y],g),j+=h(A.expressions[y],g);return j+=h(A.quasis[y],g),j}else if(A.type==="TaggedTemplateExpression"){var X=h(A.tag,g),F=A.quasi,V=F.quasis.map(h),G=F.expressions.map(h);return X.apply(null,[V].concat(G))}else return A.type==="TemplateElement"?A.value.cooked:f}}})(a);return p===f?void 0:p};function s(a){return a==="constructor"||a==="__proto__"}},{escodegen:12}],jsonpath:[function(r,n,i){n.exports=r("./lib/index")},{"./lib/index":5}]},{},["jsonpath"])("jsonpath")})})(GP)),GP.exports}var pBe=fBe();const hBe=Un(pBe),ABe=e=>{try{return dBe(e),!0}catch(t){return t}},mBe=e=>{try{return hBe.query({},e),!0}catch(t){return t}},gBe=_.forwardRef((e,t)=>{const{type:r,isLoop:n,suggestionsData:i,id:o,viewOnly:s=!1}=e,{loopSuggestionsData:a={}}=ct.useSelector(m=>m.loopActivity),{watch:l,control:u,setValue:c,formState:{errors:f}}=Rr(),p=l("properties.from_type"),h=l("properties.to_type"),A=tue.filter(m=>!!m.visibleKey.find(O=>O===p)),g=m=>m==="json"?"json":m==="xml"?"xml":"html";return _.useEffect(()=>{h===""&&c("properties.query","")},[h]),d.jsx(En,{children:d.jsxs(E.Grid,{container:!0,gap:1.5,children:[d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Yt,{name:"properties.from_type",control:u,meta:{options:eue,displayName:"Convert from",searchFieldPlaceholder:"Search",description:"Choose the type of data you are starting with.",placeholder:"Select Convert from"},validationRules:{required:"Convert from is required"},handleChange:()=>{c("properties.to_type","")},viewOnly:s,required:!0})}),p&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(pr,{name:"properties.data",control:u,rules:{required:"Data is required"},render:({field:m})=>d.jsx(Fi,{...m,label:"Data",showSuggestions:!0,suggestionsData:n?a:i,id:`${r}-data`,size:"md",suggestionLabel:"Data",viewOnly:s,language:g(p?.toLowerCase()),showHtmlPreview:p?.toLowerCase()?.includes("html"),placeholder:"Enter the input data to be converted.",handleChange:O=>m.onChange(O),showExpandOption:!0,error:!!f.properties?.data?.message,errorMsg:f.properties?.data?.message,helperText:"Paste or enter the input data to be converted.",required:!0})})}),d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Yt,{name:"properties.to_type",control:u,meta:{options:A,displayName:"Convert to",searchFieldPlaceholder:"Search",description:"Choose the type you want to convert the data into.",placeholder:"Select Convert to"},validationRules:{required:"Convert to is required"},viewOnly:s,required:!0})}),h==="jsonata"&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(pr,{name:"properties.query",control:u,rules:{validate:m=>m&&ABe(m)!==!0?"Error in JSONata expression. Please check the expression's syntax.":!0},render:({field:m})=>d.jsx(Fi,{...m,language:"javascript",suggestionLabel:"Query",placeholder:"Enter a JSONata / JSONPath query to transform the data",size:"md",suggestionsData:n?a:i,id:`${r}-query2`,showSuggestions:!0,viewOnly:s,handleChange:O=>{Et(O)||m.onChange(O)},label:"Query",helperText:"To know more about how to use jsonata, visit https://docs.jsonata.org/overview.html.",showExpandOption:!0,error:!!f.properties?.query?.message,errorMsg:f.properties?.query?.message})})}),h==="jsonpath"&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(pr,{name:"properties.query",control:u,rules:{validate:m=>m&&mBe(m)!==!0?"Error in JSONPath expression. Please check the expression's syntax.":!0},render:({field:m})=>d.jsx(Fi,{...m,language:"javascript",placeholder:"Enter a JSONata / JSONPath query to transform the data",size:"md",suggestionsData:n?a:i,id:`${r}-query`,showSuggestions:!0,viewOnly:s,handleChange:O=>{Et(O)||m.onChange(O)},suggestionLabel:"Query",label:"Query",helperText:"To know more about how to use JSONPath, visit https://goessner.net/articles/JsonPath/",error:!!f.properties?.query?.message,errorMsg:f.properties?.query?.message,showExpandOption:!0})})}),h==="graphql"&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(kr,{id:o,name:"properties.query_options",control:u,meta:{displayName:"Query Options",description:"Provide GraphQL-specific options if your query needs them.",placeholder:"Specify Query Options"},viewOnly:s,editorId:`${r}-query_options`})}),!n&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Mi,{viewOnly:s,type:r})})]})})}),EBe=Gi(gBe,"");var jo=(e=>(e.STRING="string",e.NUMBER="number",e.BOOLEAN="boolean",e.OBJECT="object",e.ARRAY="array",e.NULL="null",e))(jo||{});const _X={string:"",boolean:!0,number:0,object:{},array:[],null:[]},wX=e=>e?.jsonGui??Eb.colors.jsonGui,WP=e=>{const t=wX(e);return[{value:"string",label:"abc",color:t.string,icon:"ic_string",name:"String"},{value:"number",label:"123",color:t.number,icon:"ic_number",name:"Number"},{value:"boolean",label:"true",color:t.boolean,icon:"ic_boolean",name:"Boolean"},{value:"array",label:"[]",color:t.array,icon:"ic_array",name:"Array"},{value:"object",label:"{}",color:t.object,icon:"ic_object",name:"Object"},{value:"null",label:"null",color:t.null,icon:"ic_null",name:"Null"}]},IX=e=>{const t=wX(e);return[{value:"string",label:"abc",color:t.string,icon:"ic_string",name:"String"},{value:"number",label:"123",color:t.number,icon:"ic_number",name:"Number"},{value:"boolean",label:"true",color:t.boolean,icon:"ic_boolean",name:"Boolean"},{value:"null",label:"null",color:t.null,icon:"ic_null",name:"Null"}]};WP(null),IX(null);const bT=e=>Object.prototype.toString.call(e).match(/\w+/g)?.[1].toLowerCase(),DX=(e,t,r)=>{const n=e.shift(),i=Object.keys(t);if(e.length)return DX(e,t[i[n]],r);t[i[n]]=r},RX=(e,t,r)=>(DX(t,r,e),r),PX=e=>e.split("-").slice(1),OBe=e=>e&&typeof e=="object",ag=_.createContext(null),QP=e=>{const{setEditObject:t,editObject:r,setTempData:n}=_.useContext(ag),i=E.useTheme(),o=WP(i.palette),{uniqueKey:s,sourceData:a,id:l,showSuggestions:u,excludePayloadSuggestions:c=!1,onChange:f,setIsEditing:p}=e,h=Array.isArray(a),[A,g]=_.useState({}),[m,O]=_.useState({}),[y,T]=_.useState(""),v={fontSize:"18px",marginRight:"5px"},C=(N,L)=>{m[N]=L,A[N]={},T(""),g({...A}),O({...m}),p?.(!0),n(L?M=>({...M,"":""}):M=>{const B={...M};return delete B[""],B})},x=()=>{g({}),O({}),T("")};_.useEffect(()=>{x()},[h]);const b=(N,L)=>{const M=N.target.value.trim();A[L].key=M,g({...A});const B=LP(M,a);T(B)},w=(N,L)=>{A[N].value=L,g({...A})},R=(N,L)=>{A[N].type=L,A[N].value=_X[L],g({...A})},I=(N,L)=>{switch(L){case jo.NULL:return null;case jo.BOOLEAN:return typeof N=="string"?N==="true":!!N;case jo.NUMBER:return Number(N);case jo.STRING:return String(N||"");default:return N||""}},P=(N,L)=>{const M=A[N];if(!M)return;const{key:B,value:H,type:j}=M,F=j===jo.OBJECT||j===jo.ARRAY?j===jo.ARRAY?[]:{}:I(H,j);if(!h){const V=LP(B,L);if(V){T(V);return}}h?L.push(F):L[B]=F,t({...r}),x(),n?.({...r}),p?.(!1)},k=N=>{switch(N){case jo.STRING:return d.jsx(E.Stack,{width:"150px",children:d.jsx(lo,{viewOnly:e.viewOnly,fullWidth:!0,onChange:L=>w(s,L.target.value),showSuggestion:u,id:l,placeholder:"value",editorId:`${l}-${N}-${s}`,"data-testid":`${l}-${N}-${s}`,excludePayloadSuggestions:c})});case jo.NUMBER:return d.jsx(E.Stack,{width:"150px",ml:-1.5,children:d.jsx(lo,{viewOnly:e.viewOnly,fullWidth:!0,type:"number",placeholder:"value",autoComplete:"off",onChange:L=>w(s,+L.target.value),"data-testid":`${l}-${N}-${s}`,excludePayloadSuggestions:c})});case jo.BOOLEAN:return d.jsx(E.Stack,{width:"150px",ml:-1.5,children:d.jsxs(E.Select,{disabled:e.viewOnly,size:"small",value:A[s]?.value!==!1,"data-testid":`${l}-${N}-${s}`,sx:{".MuiInputBase-inputSizeSmall":{height:"auto !important"}},onChange:L=>{const M=L.target.value==="true";w(s,M)},children:[d.jsx(E.MenuItem,{value:"true",children:"true"}),d.jsx(E.MenuItem,{value:"false",children:"false"})]})});default:return null}};return d.jsx(E.Box,{className:"addItem",width:"100%",children:m[s]?d.jsxs(E.Stack,{direction:"row",alignItems:y?"flex-start":"center",width:"100%",children:[!h&&d.jsxs(E.Stack,{sx:{position:"relative"},children:[d.jsx(lo,{viewOnly:e.viewOnly,fullWidth:!0,onChange:N=>b(N,s),showSuggestion:u,id:l,sx:{width:"130px"},placeholder:"key",editorId:`key-${s}`,"data-testid":`key-${s}`,error:!!y,excludePayloadSuggestions:c}),y&&d.jsx(E.Box,{sx:{position:"absolute",top:38,left:0,color:i.palette.error.main,fontSize:"0.75rem",lineHeight:1},children:d.jsx(E.FormHelperText,{"data-testid":`errorMsg-${s}`,error:!0,children:y})})]}),d.jsx(E.Select,{size:"small","data-testid":`select-type-${s}`,disabled:e.viewOnly,sx:{mx:1,mr:2.1,".MuiSelect-select":{padding:"10px 38px 10px 14px",fontSize:10},".MuiInputBase-inputSizeSmall":{height:"auto !important"},".MuiOutlinedInput-notchedOutline":{p:0,width:"120px"}},MenuProps:{PaperProps:{sx:{minWidth:"120px !important",marginLeft:"4px !important"}}},onChange:N=>R(s,N.target.value),value:A[s]?.type||jo.STRING,renderValue:N=>{const L=o.find(M=>M.value===N);return d.jsxs(E.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:1,children:[d.jsx(Ue,{src:L?.icon,width:14,height:14,sx:{marginRight:8,color:L?.color}}),d.jsx(E.Typography,{variant:"smMedium",color:"text.secondary",children:L?.name})]})},children:o.map(N=>d.jsxs(E.MenuItem,{value:N.value,sx:{...vf,minHeight:"40px !important","@media (min-width: 600px)":{minHeight:"40px !important"}},children:[d.jsx(Ue,{src:N.icon,width:18,height:18,sx:{color:N.color}}),d.jsx(E.Typography,{variant:"smMedium",color:"text.secondary",children:N.name})]},N.value))}),d.jsx("span",{className:"jsonValue",children:k(A[s]?.type||jo.STRING)}),d.jsxs(E.Stack,{direction:"row",spacing:1,ml:Et(r)?1:0,children:[d.jsx(E.IconButton,{size:"small",color:"primary",onClick:()=>{P(s,a),f&&f(r)},sx:{minWidth:0},"data-testid":`confirm-${s}`,disabled:!!y||e?.viewOnly,children:d.jsx(Ue,{src:"ic_done",width:16,height:16})}),d.jsx(E.IconButton,{"data-testid":`close-btn-${s}`,size:"small",onClick:()=>{C(s,!1),p?.(!1)},disabled:e?.viewOnly,sx:{minWidth:0},children:d.jsx(Ue,{width:16,height:16,src:"ic_close"})})]})]}):d.jsxs(E.Button,{variant:"text",disabled:e.viewOnly,"data-testid":"json-gui-add-btn",sx:{color:N=>N.palette.primary[60],mt:Et(r)?0:2,"&:hover":{backgroundColor:"transparent",color:N=>N.palette.primary[50],"& .MuiTypography-root":{color:N=>N.palette.primary[50]},"& svg path":{fill:N=>N.palette.primary[50]}}},disableFocusRipple:!0,disableTouchRipple:!0,disableRipple:!0,disableElevation:!0,onClick:()=>C(s,!0),children:[d.jsx(Ue,{src:"ic_plus",sx:{...v,path:{fill:"currentColor"}}}),d.jsx(E.Typography,{variant:"smNormal",sx:{alignItems:"center"},children:"Add"})]})},s)},zP={base:{transformOrigin:"center",transition:"transform 0.2s cubic-bezier(0.4, 0, 0.2, 1)",mr:.5},right:{transform:"rotate(0deg)"},down:{transform:"rotate(90deg)"}};function XP({fieldValue:e,uniqueKey:t}){const{onChangeAllow:r,allowMap:n}=_.useContext(ag);if(!OBe(e))return d.jsx("span",{});const i=!!n[t];return d.jsx(E.IconButton,{onClick:()=>r(t),"data-testid":`collapse-${t}`,sx:{...zP.base,...i?zP.down:zP.right},children:d.jsx(Ue,{src:"ic_right_arrow"})})}function NX(e){const t=E.useTheme(),r=WP(t.palette);return d.jsx(ag.Consumer,{children:({onChangeType:n})=>d.jsx(E.Select,{size:"small","data-testid":`select-type-${e.uniqueKey}`,disabled:e.viewOnly,sx:{".MuiSelect-select":{fontSize:10},".MuiInputBase-inputSizeSmall":{height:"auto !important"},".MuiOutlinedInput-notchedOutline":{p:0}},onChange:i=>n(i.target.value,e.uniqueKey),value:bT(e.fieldValue),renderValue:i=>{const o=r.find(s=>s.value===i);return d.jsxs(E.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:1,children:[d.jsx(Ue,{src:o?.icon,width:14,height:14,sx:{marginRight:8,color:o?.color}}),d.jsx(E.Typography,{variant:"smMedium",color:"text.secondary",children:o?.name})]})},children:r.map(i=>d.jsxs(E.MenuItem,{value:i.value,sx:{...vf},children:[d.jsx(Ue,{src:i.icon,width:18,height:18,sx:{color:i.color}}),d.jsx(E.Typography,{variant:"smMedium",color:"text.secondary",children:i.name})]},i.value))})})}function yBe(e){const{setIsEditing:t,fieldValue:r,parentUniqueKey:n,viewOnly:i,getValue:o,deepLevel:s,id:a,showSuggestions:l,excludePayloadSuggestions:u,onClickDelete:c,onChange:f}=e,{allowMap:p}=_.useContext(ag),h=200,[A,g]=_.useState(h);_.useEffect(()=>{g(h)},[r]);const m=r.slice(0,A),O=r.length>A;return d.jsxs(E.Box,{className:"arrayContent",children:[d.jsx(E.Box,{sx:{marginTop:"10px"},"data-testid":"arrayContent",children:m.map((y,T)=>{const v=`${n}-${T}`,C=bT(y),x=["object","array"].includes(C)&&!!p[v];return d.jsxs(E.Stack,{className:"indexLine",direction:"row",alignItems:"center",gap:1,justifyContent:"flex-start",flexWrap:x?"wrap":"nowrap",sx:{"& .jsonValue":{flex:x?"1 1 100%":"0 0 auto",width:x?"100%":"auto",minWidth:x?"auto":"150px"}},children:[["object","array"].includes(C)&&d.jsx(XP,{uniqueKey:v,fieldValue:y}),d.jsx(NX,{viewOnly:i,uniqueKey:v,fieldValue:y,fieldKey:`${T}`,sourceData:r,"data-testid":`tools-${v}`,type:"array"}),d.jsx("span",{className:"jsonValue",children:o(y,T,r,s+1,v)}),d.jsx(E.Stack,{ml:1,alignItems:"center",direction:"row","data-testid":`delete-${v}`,sx:x?{position:"absolute",right:260,top:4}:{position:"relative",ml:1},children:d.jsx(E.IconButton,{disabled:i,onClick:()=>c(T,r),sx:{ml:.5,"&:hover":{backgroundColor:"transparent"}},children:d.jsx(Ue,{src:"ic_delete"})})})]},v)})}),O&&d.jsxs(E.Stack,{direction:"row",alignItems:"center",gap:1,sx:{mt:1},"data-testid":`array-load-more-${n}`,children:[d.jsx(E.Button,{size:"small",variant:"outlined",onClick:()=>g(y=>Math.min(y+h,r.length)),sx:{textTransform:"none"},children:`Load ${Math.min(h,r.length-A)} more`}),d.jsx(E.Typography,{variant:"xsNormal",color:"text.secondary",children:`Showing ${A} of ${r.length}`})]}),d.jsx(E.Box,{children:d.jsx(QP,{viewOnly:i,uniqueKey:n,deepLevel:s,sourceData:r,id:a,showSuggestions:l,excludePayloadSuggestions:u,setIsEditing:t,onChange:f},n)})]})}function LX(e){const t=E.useTheme(),{editObject:r,setEditObject:n,id:i,showSuggestions:o,setTempData:s,tempData:a,excludePayloadSuggestions:l=!1,viewOnly:u=!1,onChange:c,setIsEditing:f}=e,[p,h]=_.useState({}),[A,g]=_.useState({}),[m,O]=_.useState(!0),[y,T]=_.useState(!1),v=200,[C,x]=_.useState(v);_.useEffect(()=>{x(v)},[r]);const b=F=>{n({...F}),c?.(F),s&&s({...F})};_.useEffect(()=>{const F=setTimeout(()=>{O(!1)},500);return()=>clearTimeout(F)},[]);const w=(F,V)=>{Array.isArray(V)?(V.splice(+F,1),c&&c(V)):(Reflect.deleteProperty(V,F),c&&c(V)),b(r)},R=(F,V)=>{const G=F===jo.NULL?null:_X[F],D=RX(G,PX(V),r);b(D)},I=(F,V,G,D)=>{const $=F.target.value.trim();if(V!==$){const Q=LP($,D);if(g(W=>({...W,[G]:Q})),Q)return}const U={};for(const Q in D)Object.prototype.hasOwnProperty.call(D,Q)&&(Q===V?U[F.target.value]=D[Q]:U[Q]=D[Q]);g(Q=>{const W={...Q};return delete W[G],W});const Y=PX(G);if(Y.length===1)b(U);else{Y.pop();const Q=RX(U,Y,r);b(Q)}},P=(F,V,G,D="")=>{G[V]=D==="number"?Number(F):F,b(r)},k=F=>!!(typeof F!="object"||F===null||Array.isArray(F)||Object.keys(F).length===0),N={position:"absolute",left:-4,width:"2px",height:"calc(100% - 22px)",borderLeft:`1px solid ${t.palette.grey.outlined.border}`,"&::after":{content:'""',position:"absolute",bottom:0,width:"20px",height:"1px",backgroundColor:t.palette.grey.outlined.border},zIndex:1},L={position:"absolute",left:8,width:"2px",height:"calc(100% - 76px)",borderLeft:`1px solid ${t.palette.grey.outlined.border}`,zIndex:0,"&::after":{content:'""',position:"absolute",bottom:0,width:"30px",height:"1px",backgroundColor:t.palette.grey.outlined.border}},M=(F,V,G,D,$)=>{const U=bT(F),Y={autoComplete:"off",onChange:W=>P(W.target.value,V,G),value:F},z={position:"relative",paddingLeft:0},Q=k(F);switch(U){case jo.ARRAY:return!p[$]?d.jsx(E.Typography,{component:"span",variant:"smMedium",sx:{color:t.palette.text.secondary,opacity:.7,display:"inline-flex",alignItems:"center",height:24,whiteSpace:"nowrap"},"data-testid":`array-collapsed-${V}`,children:`[${F.length} ${F.length===1?"item":"items"}]`}):d.jsxs(E.Stack,{sx:z,children:[d.jsx(E.Box,{sx:{...N,height:"calc(100% - 17px)"}}),d.jsx(yBe,{viewOnly:u,fieldValue:F,fieldKey:V,sourceData:G,deepLevel:D,parentUniqueKey:$,getValue:M,id:i,showSuggestions:o,onClickDelete:w,"data-testid":`array-${V}`,excludePayloadSuggestions:l,setIsEditing:f,onChange:b})]});case jo.OBJECT:{const W=!!p[$],q=Object.keys(F||{}).length;return W?d.jsxs(E.Stack,{sx:z,"data-testid":`object-${V}`,children:[d.jsx(E.Box,{sx:{...N,height:Q?"calc(100% - 10px)":N.height}}),d.jsx("span",{children:X(F,D+1,$)})]}):d.jsx(E.Typography,{component:"span",variant:"smMedium",sx:{color:t.palette.text.secondary,opacity:.7,display:"inline-flex",alignItems:"center",height:24,whiteSpace:"nowrap"},"data-testid":`object-collapsed-${V}`,children:`{${q} ${q===1?"key":"keys"}}`})}case jo.STRING:return d.jsx(lo,{"data-testid":`text-string-${V}`,sx:{width:"140px"},size:"xs",disabled:u,id:i,showSuggestions:o,excludePayloadSuggestions:l,...Y,placeholder:"value"});case jo.NUMBER:return d.jsx(lo,{id:i,size:"xs",disabled:u,type:"number",placeholder:F,autoComplete:"off",showSuggestions:o,excludePayloadSuggestions:l,value:F,sx:{width:"140px"},"data-testid":`text-number-${V}`,onBlur:W=>P(+W.target.value,V,G),onChange:W=>P(W.target.value===""?"":+W.target.value,V,G,"number")});case jo.BOOLEAN:return d.jsxs(E.Select,{disabled:u,size:"small",sx:{width:"140px","& .MuiSelect-select":{display:"flex",alignItems:"center",paddingTop:"6px",paddingBottom:"6px"},"& .MuiOutlinedInput-input":{display:"flex",alignItems:"center"}},value:F?"true":"false","data-testid":`text-boolean-${V}`,onChange:W=>P(W.target.value==="true",V,G),children:[d.jsx(E.MenuItem,{value:"true",children:"true"}),d.jsx(E.MenuItem,{value:"false",children:"false"})]})}},B=F=>{p[F]=!p[F],h({...p})},H=()=>{T(!y)},j=1,X=(F,V=j,G=`${V}`)=>{const D=Object.keys(F);if(!D.length)return d.jsx(E.Box,{"data-testid":`addItem-${G}`,mt:Et(r)?0:"9px",ml:Et(r)?0:3,children:d.jsx(QP,{viewOnly:u,uniqueKey:`${G}`,deepLevel:V,sourceData:F,id:i,showSuggestions:o,excludePayloadSuggestions:l,onChange:z=>{c&&c(z)},setIsEditing:f})});const $=V===j,U=$?D.slice(0,C):D,Y=$&&D.length>C;return d.jsxs(E.Stack,{className:"objectContent","data-testid":"objectContent",sx:{marginLeft:j===V?"15px":"10px",py:1.5},onClick:z=>z.stopPropagation(),children:[d.jsx(E.Box,{children:U.map((z,Q)=>{const W=`${G}-${Q}`,q=F[z],Z=bT(q),te=["object","array"].includes(Z)&&!!p[W];return d.jsxs(E.Stack,{className:"indexLine",direction:"row",alignItems:A[W]?"flex-start":"center",gap:1,justifyContent:"flex-start",flexWrap:te?"wrap":"nowrap",sx:{"& .jsonValue":{flex:te?"1 1 100%":"0 0 auto",width:te?"100%":"auto",minWidth:te?"auto":"150px"},"& .jsonKey":{flex:"0 0 auto",minWidth:"auto"}},children:[["object","array"].includes(Z)&&d.jsx(E.Box,{sx:{width:j===V?"18px":"",display:"inline-block"},children:d.jsx(XP,{uniqueKey:W,fieldValue:q})}),d.jsxs(E.Stack,{direction:"row",alignItems:A[W]?"flex-start":"center",justifyContent:"flex-start",className:"jsonKey",gap:1,children:[d.jsx(lo,{disabled:u,size:"xs",sx:{width:"130px"},id:i,placeholder:"key",value:z||"",tabIndex:Q+1,onChange:ae=>I(ae,z,W,F),"data-testid":`text-key-${z}`,error:!!A[W],errorMsg:A[W],helperText:A[W]}),d.jsx(NX,{viewOnly:u,uniqueKey:W,fieldValue:q,fieldKey:z,sourceData:F,"data-testid":`tools-${z}`,type:"object"})]}),d.jsx("span",{className:Z!=="number"&&Z!=="boolean"?"jsonValue":"",children:M(q,z,F,V,W)}),d.jsx("span",{children:d.jsx(E.Stack,{ml:1,alignItems:"center",direction:"row",sx:{position:"absolute",right:te?150:30,top:4},"data-testid":`delete-${z}`,children:d.jsx(E.IconButton,{disabled:u,onClick:()=>w(z,F),sx:{"& path":{fill:t.palette.neutral.solid.bg},"&:hover":{backgroundColor:"transparent","& path":{fill:t.palette.error[60]}}},children:d.jsx(Ue,{src:"ic_delete",sx:{"& path":{fill:t.palette.neutral.solid.bg}}})})})})]},W)})}),Y&&d.jsxs(E.Stack,{direction:"row",alignItems:"center",gap:1,sx:{mt:1,ml:2},"data-testid":`load-more-${G}`,children:[d.jsx(E.Button,{size:"small",variant:"outlined",onClick:()=>x(z=>Math.min(z+v,D.length)),sx:{textTransform:"none"},children:`Load ${Math.min(v,D.length-C)} more`}),d.jsx(E.Typography,{variant:"xsNormal",color:"text.secondary",children:`Showing ${C} of ${D.length}`})]}),d.jsx(E.Box,{"data-testid":`addItem-button-${G}`,ml:j===V?4.5:2,children:d.jsx(QP,{viewOnly:u,uniqueKey:G,deepLevel:V,sourceData:F,id:i,showSuggestions:o,excludePayloadSuggestions:l,onChange:z=>{c&&c(z)},setIsEditing:f},G)})]})};return d.jsx(ag.Provider,{value:{editObject:r,setEditObject:n,setTempData:s,onChangeType:R,onClickDelete:w,onChangeAllow:B,allowMap:p},children:m?d.jsx(E.Box,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",minHeight:"300px",children:d.jsx(E.CircularProgress,{})}):d.jsxs(E.Box,{sx:{width:"100%",position:"relative",minHeight:y||Et(a)?0:"100px",paddingTop:"2rem"},"data-testid":"root-collapsible-json",children:[!Et(r)&&d.jsx(E.Box,{onClick:H,"data-testid":"root-collapse-part",children:d.jsx(XP,{uniqueKey:"ROOT_KEY",fieldValue:r})}),!y&&!Et(r)&&d.jsx(E.Box,{sx:L}),!y&&X(r,1,"ROOT_KEY")]})})}const kX=_.lazy(()=>Promise.resolve().then(()=>nX)),FX=()=>d.jsx(E.Stack,{alignItems:"center",justifyContent:"center",sx:{p:2,minHeight:120},children:d.jsx(hi,{size:30})}),vBe=_.forwardRef(({data:e={},label:t,infoVisible:r=!1,viewOnly:n=!1,helperText:i,required:o=!1,suggestionsData:s,showSuggestions:a=!1,errorMsg:l="",id:u,excludePayloadSuggestions:c=!1,onChange:f,title:p="",isDynamic:h=!1,fullScreen:A=!1,handleValidate:g,name:m},O)=>{const[y,T]=_.useState("GUI"),[v,C]=_.useState("GUI"),[x,b]=_.useState("Static"),[w,R]=_.useState({}),[I,P]=_.useState(!0),[k,N]=_.useState(!0),[L,M]=_.useState(!1),[B,H]=_.useState({}),[j,X]=_.useState(""),[F,V]=_.useState({}),G=E.useTheme(),[D,$]=_.useState(!1),[U,Y]=_.useState(!1),[z,Q]=_.useState([]),W=_.useRef(!1),q=_.useCallback(he=>{const Ae=he.trim();return/^\{\{[^}]+\}\}$/.test(Ae)},[]),Z=_.useMemo(()=>typeof w=="string"&&q(w),[w,q]),te=[{title:"GUI",disabled:U||Z},{title:"Raw",disabled:U}],ae=_.useCallback(he=>{if(he==null||he==="")return{};if(typeof he=="string"){if(q(he))return he;try{return JSON.parse(he)}catch{return{}}}return Lo(he)},[q]);_.useEffect(()=>{const he=ae(e);if(R(he),H(he),V(he),typeof he=="string"&&q(he))X(he),W.current=!1,P(!1),N(!1),T("Raw"),C("Raw");else{const Ae=JSON.stringify(he,null,2);Ae==="{}"&&W.current?(X(""),W.current=!1):(X(Ae),W.current=!1)}},[e,ae,q]);const ne=_.useMemo(()=>nA(B),[B]),ue=_.useCallback(()=>{if(!ne){if(Q([]),g&&g([]),I)typeof F=="string"&&q(F)?X(F):X(JSON.stringify(F,null,2));else if(q(j))V(j),R(j),H(j);else try{const he=JSON.parse(j);V(he),R(he),H(he)}catch{}P(he=>!he)}},[ne,I,F,j,g,q]),Oe=_.useCallback(()=>{if(Q([]),g&&g([]),k)typeof w=="string"&&q(w)?X(w):X(JSON.stringify(w,null,2));else if(q(j))R(j),H(j),V(j);else try{const he=JSON.parse(j);R(he),H(he),V(he)}catch{}N(he=>!he)},[k,w,j,g,q]),Te=()=>{H(he=>{const Ae={...he};return delete Ae[""],Ae}),M(!L)},se=_.useCallback(he=>{const Ae=ae(he);R(Ae),H(Ae),V(Ae)},[ae]),ie=_.useCallback(he=>{W.current=he.trim()==="",X(he)},[]),J=_.useCallback(he=>{try{if(!he||he.trim()===""){se({}),f&&f({});return}if(q(he)){f&&f(he.trim());return}let Ae;if(typeof he=="string")try{Ae=JSON.parse(he)}catch{return}else Ae=he;se(Ae),f&&f(Ae)}catch{}},[se,f,q]),K=_.useCallback(()=>{hd(JSON.stringify(w,null,2),"Copied to clipboard"),$(!0),setTimeout(()=>$(!1),2e3)},[w]),re=_.useCallback(he=>{if(he&&he.length>0){const Ae=he.map(fe=>fe.message);Q(Ae)}else Q([]);g&&g(he)},[g]),le={border:"1px solid",borderColor:l?G.palette.error.main:G.palette.grey.outlined.border,borderRadius:2};return d.jsxs(E.Stack,{spacing:1,"data-testid":"json-gui",ref:O,children:[r&&d.jsx(TBe,{"data-testid":"json-info-msg",message:"We recommend you expand this editor to full view for the best experience."}),d.jsx(Co,{open:L,"data-testid":"json-gui-fullscreen-popup",handleClose:Te,title:t||"Global variables",content:d.jsxs(E.Stack,{sx:{width:"100%",height:"80vh"},children:[d.jsx(ss,{variant:"normal",tabs:[{title:"GUI"},{title:"Raw"}],selectedTab:v,sx:{height:24,width:"fit-content",ml:"auto",mb:1},setSelectedTab:()=>{Oe(),C(v==="GUI"?"Raw":"GUI")}}),d.jsxs(E.Box,{sx:{overflow:"auto",position:"relative",height:"100%",background:G.palette.background.paper,...k?{borderRadius:"4px",border:`1px solid ${G.palette.grey[200]}`,p:1}:{}},children:[k?d.jsx(E.Stack,{"data-testid":"json-gui-builder",sx:{"& .MuiPaper-root":{width:"100% !important",borderRadius:"8px !important"}},children:d.jsx(E.Stack,{sx:{width:"100%",height:"auto",position:"relative",top:"unset",left:"unset",zIndex:"auto",maxWidth:"1200px",overflow:typeof w=="object"&&Object.keys(w).length===0?"visible":"auto"},p:1,children:d.jsx(E.Stack,{children:d.jsx(E.Stack,{minHeight:typeof B=="object"&&Object.keys(B).length===1?50:"auto",children:typeof w=="object"&&typeof B=="object"&&d.jsx(LX,{viewOnly:n,editObject:w,setEditObject:R,setTempData:H,id:u,showSuggestions:a,tempData:B,excludePayloadSuggestions:c,onChange:he=>{V(he),f&&f(he)},setIsEditing:Y})})})})}):d.jsx(E.Box,{sx:{height:"100%",overflowY:n?"visible":"auto"},children:d.jsx(_.Suspense,{fallback:d.jsx(FX,{}),children:d.jsx(kX,{size:"lg",language:"json",viewOnly:n,handleChange:ie,handleBlur:J,value:j,id:"code-editor-gui-full",suggestionsData:s,required:o,enableJsonGuiValidation:!0,handleValidate:re,"data-testid":"json-gui-code-editor-full",sx:{border:"none"},height:"75vh",allowArrayAtRoot:!!(m&&m.endsWith("payload"))||!!(m&&m.includes(".payload"))})})}),d.jsx(E.Stack,{onClick:K,sx:{position:"absolute",top:6,right:6,cursor:"pointer"},children:d.jsx(E.Tooltip,{"data-testid":"json-copy-tooltip",title:D?"Copied!":"Copy JSON",children:d.jsx(E.IconButton,{"data-testid":"json-gui-copy",onClick:K,size:"small",children:d.jsx(Ue,{src:"ic_copy",width:15,height:15,sx:{path:{fill:G.palette.common.black}}})})})})]})]})}),d.jsxs(E.Stack,{children:[d.jsxs(E.Stack,{direction:"row",alignItems:"flex-end",justifyContent:"space-between",children:[d.jsx(gn,{label:t||"",required:o,description:i}),h&&d.jsx(ss,{variant:"normal",tabs:[{title:"Static"},{title:"Dynamic"}],selectedTab:x,sx:{height:24},setSelectedTab:()=>{b(x==="Static"?"Dynamic":"Static")}})]}),I?d.jsxs(E.Stack,{children:[d.jsxs(E.Stack,{"data-testid":"json-gui-builder",sx:{...le},children:[d.jsxs(E.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:1,p:1.5,children:[d.jsx(E.Typography,{variant:"smNormal",children:p}),d.jsxs(E.Stack,{direction:"row",position:"relative",alignItems:"center",children:[d.jsx(ss,{variant:"normal",tabs:te,selectedTab:y,sx:{height:24},setSelectedTab:()=>{ue(),T(y==="GUI"?"Raw":"GUI")}}),A&&d.jsx(E.IconButton,{"data-testid":"json-gui-fullscreen-button",onClick:Te,sx:{ml:1,position:"absolute",top:44,right:0,zIndex:999},children:d.jsx(Ue,{src:"ic_maximize"})})]})]}),d.jsx(E.Divider,{}),d.jsx(E.Stack,{sx:{width:"100%",height:"auto",position:"relative",maxWidth:"600px",maxHeight:"calc(80vh - 306px)",overflow:"auto"},p:1,children:d.jsx(E.Stack,{children:typeof w=="object"&&typeof B=="object"&&d.jsx(LX,{viewOnly:n,editObject:w,setEditObject:R,setTempData:H,id:u,showSuggestions:a,tempData:B,excludePayloadSuggestions:c,onChange:he=>{V(he),f&&f(he)},setIsEditing:Y})})})]}),z.length>0?d.jsx(E.Box,{sx:{mt:1},children:z.map((he,Ae)=>d.jsx(E.FormHelperText,{error:!0,children:he},`validation-error-${he}-${Ae}`))}):l?d.jsx(E.FormHelperText,{error:!0,children:l}):null,i&&d.jsx(E.FormHelperText,{children:i})]}):d.jsxs(E.Box,{children:[d.jsxs(E.Box,{sx:{...le,opacity:n?.6:1},children:[d.jsxs(E.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:1,p:1.5,children:[d.jsx(E.Typography,{variant:"smNormal",children:p}),d.jsxs(E.Stack,{direction:"row",alignItems:"center",position:"relative",children:[d.jsx(ss,{variant:"normal",tabs:te,selectedTab:y,sx:{height:24},setSelectedTab:()=>{ue(),T(x==="GUI"?"Raw":"GUI")}}),A&&d.jsx(E.IconButton,{"data-testid":"json-gui-fullscreen-button",onClick:Te,sx:{ml:1,position:"absolute",top:44,right:0,zIndex:999},children:d.jsx(Ue,{src:"ic_maximize"})})]})]}),d.jsx(E.Divider,{}),d.jsx(E.Box,{sx:{height:"100%",overflowY:n?"visible":"auto"},children:d.jsx(_.Suspense,{fallback:d.jsx(FX,{}),children:d.jsx(kX,{size:"lg",language:"json",viewOnly:n,handleChange:ie,handleBlur:J,value:j,id:`code-editor-gui-${u}`,suggestionsData:s,error:!!l,required:o,enableJsonGuiValidation:!0,handleValidate:re,"data-testid":"json-gui-code-editor",showSuggestions:a,codeEditorStyles:{border:"none"},allowArrayAtRoot:!!(m&&m.endsWith("payload"))||!!(m&&m.includes(".payload"))})})})]}),z.length>0?d.jsx(E.Box,{sx:{mt:1},children:z.map((he,Ae)=>d.jsx(E.FormHelperText,{error:!0,children:he},`validation-error-${he}-${Ae}`))}):l?d.jsx(E.FormHelperText,{error:!0,children:l}):null,i&&d.jsx(E.FormHelperText,{children:i})]})]})]})}),TBe=({message:e})=>{const t=E.useTheme();return d.jsxs(E.Stack,{alignItems:"center",spacing:1,direction:"row",sx:{background:t.palette.success[10],borderRadius:2,border:"1px solid",borderColor:t.palette.success[40]},p:1,children:[d.jsx(Ue,{src:"ic_success",sx:{path:{fill:t.palette.success.main}}}),d.jsx(E.Typography,{variant:"xsMedium",children:e})]})},MX=Gi(vBe),Wu=e=>{const{name:t,label:r,viewOnly:n=!1,validationRules:i={},required:o=!1,id:s,description:a,error:l,suggestionsData:u,...c}=e,{trigger:f,control:p}=Rr(),h=_.useRef(null),A=_.useRef([]),g=_.useCallback(y=>{const T=y?.length>0?y.map(v=>v.message):[];A.current=T,f(t)},[t,f]),m=_.useCallback(async y=>{if(i.validate){const v=typeof i.validate=="function"?await i.validate(y):!0;if(v!==!0)return v}const T=A.current;return T.length>0?T[0]:!0},[i.validate]),O=_.useMemo(()=>({...i,validate:m}),[i,m]);return d.jsx(pr,{name:t,control:p,rules:O,render:({field:y,fieldState:{error:T}})=>d.jsx(MX,{...y,ref:h,label:r,data:y.value,viewOnly:n,suggestionsData:u,helperText:a,errorMsg:T?.message||l?.errorMsg,required:o,id:s,showSuggestions:!0,handleValidate:g,onChange:v=>{f(t),y.onChange(v)},...c})})},SBe=_.forwardRef((e,t)=>{const r=ct.useDispatch(),{type:n,openIntegrationDrawer:i,TESSERACT_MAIN_URL:o,ENTITY_ID:s,FRONTEND_URL:a,INTEGRATION_DATA:l,viewOnly:u=!1,id:c}=e,[f,p]=_.useState([]),[h,A]=_.useState(!1),{control:g,watch:m,setValue:O,resetField:y}=Rr(),T=m("properties.auth_type"),v=()=>{A(!0);const C={page_size:999,current_page:1,type:"SOURCE"},x=Xt(o,"/v1/integrations/entity/AUTHENTICATION");zt.get(x,{params:C}).then(({data:b})=>{const w=ro(b.data,["integration_meta"]),R=dT(w);p(fT(R))}).catch(b=>{sr(b,r)}).finally(()=>{A(!1)})};return _.useEffect(()=>{v()},[]),_.useEffect(()=>{l?._id&&l?.meta?.entity==="AUTHENTICATION"&&(v(),O("properties.auth_id",l._id,{shouldValidate:!0}))},[l]),_.useEffect(()=>{!Et(T)&&T!==Nl.NONE?v():y("properties.auth_id")},[T]),d.jsxs(E.Stack,{gap:2.5,children:[d.jsx(Ei,{children:d.jsxs(E.Grid,{container:!0,gap:1.5,children:[d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Yt,{name:"properties.auth_type",control:g,meta:{options:zO,displayName:"Authentication Type",searchFieldPlaceholder:"Search authentication type",placeholder:"Select Authentication Type"},validationRules:{required:"Auth type is required"},id:"auth_type",viewOnly:u,required:!0,onChange:C=>{O("properties.auth_type",C.target.value),O("properties.auth_id","")}})}),T&&T!==Nl.NONE&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Yt,{required:!0,name:"properties.auth_id",control:g,meta:{options:yn(f),displayProps:{loading:h},displayName:"Authentication",value:"",htmlProps:{showAddNew:!0},TESSERACT_MAIN_URL:o,FRONTEND_URL:a,ENTITY_ID:s,openIntegrationDrawer:i,addNewButtonText:"Add new",searchFieldPlaceholder:"Search authentication",authType:"AUTHENTICATION",placeholder:"Select Authentication"},validationRules:{required:"Authentication is required"},viewOnly:u,id:n,groupBy:"integration_meta.auth_type"})})]})}),d.jsx(E.Divider,{}),d.jsx(En,{children:d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Wu,{name:"properties.test_payload",control:g,label:"Test Trigger Payload",viewOnly:u,showSuggestions:!0,excludePayloadSuggestions:!0,id:c})})})]})}),xBe=_.forwardRef(({placeholder:e="",onChange:t,value:r,height:n="100%",width:i="100%",label:o="",required:s=!1,errorMsg:a,helperText:l="",nodeId:u="",name:c,isLoop:f,viewOnly:p=!1,hideLabel:h=!1},A)=>{const g=E.useTheme(),{MCP_INTEGRATION_FORM:m}=aa(),{getNodes:O}=Rt.useReactFlow(),{selectedActivityId:y,aiGeneratedFieldMap:T}=ct.useSelector(G=>G.canvas),v=ao(l),[C,x]=_.useState(""),b=_.useRef(null),w=_.useRef(null),[R,I]=_.useState(""),P=G=>{x(G.target.value)},k=()=>{if(C.trim()!==""){const D=[...Array.isArray(r)?r:[],C.trim().split(",")[0]],$=new Set(D);t([...$]),x("")}},N=G=>{G.preventDefault();const{keyCode:D}=G;[13,32,188].includes(D)&&k()},L=G=>()=>{typeof r=="object"&&Array.isArray(r)&&t(r.filter(D=>D!==G))},M=(G,D)=>{G?.stopPropagation?.(),G?.preventDefault?.(),Array.isArray(r)&&t(r.filter($=>$!==D))},B=G=>{G.keyCode===8&&C.trim()===""?Array.isArray(r)&&r.length>0&&L(r[r.length-1])():G.key==="Enter"&&G.preventDefault()},H=()=>{b.current?.focus()},j=G=>{G.stopPropagation()};_.useEffect(()=>(document.addEventListener("mousedown",j),()=>{document.removeEventListener("mousedown",j)}),[]),_.useEffect(()=>{I(typeof r=="string"?"Dynamic":"Static")},[r]);const X=(()=>{const G=O()||[],D=String(u||""),$=G.find(W=>W?.selected),U=G.find(W=>String(W?.id)===D)||G.find(W=>String(W?.id)===String(y))||$,Y=String(U?.id||""),Q=(T||{})[Y]||(T||{})[String(y||"")]||(T||{})[D];return Q&&typeof Q=="object"?Q:{}})(),F=String(c||"").replace(/^properties\./,""),V=!!F&&F in X&&r!==void 0&&r!==null&&(typeof r!="string"||r.trim()!=="")&&(!Array.isArray(r)||r.length>0);return d.jsx(E.FormControl,{fullWidth:!0,children:d.jsxs(E.Stack,{children:[o&&!h&&d.jsxs(E.Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-end",children:[d.jsx(gn,{required:s,label:o,description:v}),!p&&!m&&d.jsx(E.Stack,{pb:.5,children:d.jsx(ss,{variant:"normal",tabs:[{title:"Static"},{title:"Dynamic"}],selectedTab:R,setSelectedTab:()=>{R==="Static"?(t(""),I("Dynamic")):(t([]),I("Static"))}})})]}),typeof r=="object"&&Array.isArray(r)?d.jsxs(d.Fragment,{children:[d.jsxs(E.Stack,{spacing:1,border:1,sx:{position:"relative",borderColor:a?g.palette.error.main:g.palette.grey[300],":focus-within":{border:`1px solid ${g.palette.neutral.plain}`,transition:"all 100ms ease-in"}},height:n,width:i,borderRadius:2,px:1,py:0,maxHeight:"20rem",overflow:"auto",onClick:H,children:[V&&d.jsx(E.Stack,{sx:{position:"absolute",right:"1px",top:1,bottom:1,width:"15%",minWidth:64,maxWidth:96,borderTopRightRadius:8,borderBottomRightRadius:8,pointerEvents:"none",zIndex:0,background:`linear-gradient(90deg, ${E.alpha(g.palette.primary[5],0)} 0%, ${E.alpha(g.palette.primary[5],.35)} 62%, ${E.alpha(g.palette.primary[5],.9)} 100%)`}}),V&&d.jsx(E.Stack,{sx:{position:"absolute",right:12,top:11,zIndex:3,pointerEvents:"none",width:18,height:18,alignItems:"center",justifyContent:"center"},children:d.jsx(Ue,{src:"ic_AI",width:18,height:18,sx:{display:"block","& svg path":{fill:`${g.palette.primary.main} !important`,fillOpacity:"1 !important"}}})}),d.jsxs(E.Stack,{direction:"row",flexWrap:"nowrap",gap:1,alignItems:"center",ref:w,sx:{maxWidth:"100%",overflow:"hidden",minHeight:40,pr:V?4.75:0,position:"relative",zIndex:1},children:[(()=>{if(!r||!Array.isArray(r)||r.length===0)return null;const{visible:G,extra:D,hiddenSelections:$}=Ub(r||[],w);return d.jsxs(d.Fragment,{children:[G.map((U,Y)=>d.jsx(E.Chip,{label:U,disabled:p,deleteIcon:d.jsx(Ue,{sx:{"& svg":{width:16,height:16}},src:"ic_close"}),onDelete:L(U),sx:{flex:"0 0 auto",minWidth:"40px"}},`input-chip-${U}-${Y}`)),D>0&&d.jsx(Bw,{hiddenSelections:$,extra:D,handleChipDelete:M})]})})(),d.jsx(E.InputBase,{ref:A,fullWidth:!0,autoComplete:"off",placeholder:e,value:C,onChange:P,inputRef:b,onKeyUp:N,readOnly:p,disabled:p,onKeyDown:B,onBlur:()=>k(),sx:{"&.MuiInput-root":{border:"none",flex:1},"& .MuiInputBase-input":{padding:"4px"},":focus":{border:"none"},":focus-within":{border:"none",transition:"none",boxShadow:"none"},":active":{backgroundColor:"transparent"}}})]})]}),a&&d.jsx(E.FormHelperText,{error:!0,children:a})]}):d.jsx(lo,{id:u,language:"plaintext",required:!0,value:r,isLoop:f,viewOnly:p,editorId:`${u}-${c}`,showSuggestions:!0,placeholder:e,handleChange:G=>{t(G)},errorMsg:a,loading:null})]})})}),Qc=vc(xBe),BX=({field:e,type:t,nodeId:r,isLoop:n,viewOnly:i})=>{const o=E.useTheme(),{watch:s,control:a,setValue:l}=Rr(),u=s(e),c=p=>{l(e,u.filter((h,A)=>p!==A))},f=_.useMemo(()=>u?.map((p,h)=>`${r}-${t}-${Date.now()}-${h}`),[r,t,u?.length]);return d.jsx(d.Fragment,{children:u&&u?.map((p,h)=>d.jsxs(E.Grid,{container:!0,sx:{mb:1,py:1},alignItems:"flex-end",justifyContent:"space-between",children:[d.jsx(E.Grid,{item:!0,xs:11,children:d.jsx(kr,{autoFocus:!0,id:r,name:`${e}.${h}`,control:a,meta:{displayName:`Attachment ${h+1}`,description:_n(t,"attachments"),placeholder:`Attachment ${h+1}`},editorId:`${t}-attachment_${h}`,isLoop:n,viewOnly:i})}),d.jsx(E.Grid,{item:!0,xs:.5,sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:u.length>0&&d.jsx(E.IconButton,{sx:{p:.75,width:28,height:28,"& path":{fill:o.palette.neutral.solid.bg},"&:hover path":{fill:o.palette.error[60]},"&:hover":{backgroundColor:"transparent"}},disabled:i,onClick:()=>c(h),children:d.jsx(Ue,{src:"ic_delete",width:20,height:20})})})]},f[h]))})},bBe=e=>{const{field:t,viewOnly:r}=e,{watch:n,setValue:i,unregister:o}=Rr(),{setFieldControlState:s}=aa(),a=n(t),[l,u]=_.useState("BOLTIC_AI"),c=_.useRef([]);_.useEffect(()=>{a==="BOLTIC_AI"||a==="BOLTIC_AI_IGNORE"?u(a):Array.isArray(a)&&u("specific")},[a]);const f=p=>{const h=p.target.value;if(u(h),s(t,h),h==="specific"){const A=Array.isArray(a)&&a.length>0?a:c.current.length>0?c.current:[""];i(t,A)}else Array.isArray(a)&&(c.current=a,a.forEach((A,g)=>{o?.(`${t}.${g}`)}),o?.(t)),i(t,h)};return d.jsxs(E.Stack,{spacing:1.5,mt:.5,children:[d.jsx(E.FormControl,{fullWidth:!0,disabled:r,children:d.jsxs(E.Select,{value:l,onChange:f,children:[d.jsx(E.MenuItem,{sx:{py:.8},value:"BOLTIC_AI",children:"Have AI generate a value for this field"}),d.jsx(E.MenuItem,{sx:{py:.8},value:"BOLTIC_AI_IGNORE",children:"Do not include a value for this field"}),d.jsx(E.MenuItem,{sx:{py:.8},value:"specific",children:"Set a specific value for this field"})]})}),l==="specific"&&d.jsx(BX,{...e})]})},qP=e=>{const{MCP_INTEGRATION_FORM:t}=aa();return t?d.jsx(bBe,{...e}):d.jsx(BX,{...e})},CBe=_.forwardRef((e,t)=>{const{VORTEX_MAIN_URL:r,ENTITY_ID:n,TESSERACT_MAIN_URL:i,WORKFLOW_URLS:o,type:s,id:a,isLoop:l,FRONTEND_URL:u,suggestionsData:c,INTEGRATION_DATA:f,viewOnly:p=!1,openIntegrationDrawer:h}=e,A=ct.useDispatch(),g=E.useTheme(),{control:m,setValue:O,watch:y,getValues:T,formState:{errors:v}}=Rr(),{BOLTIC_EMAIL_DOMAIN:C}=o,x=y("properties"),[b,w]=_.useState([]),[R,I]=_.useState(!1),{loopSuggestionsData:P={}}=ct.useSelector(X=>X.loopActivity),k=_.useCallback(()=>{I(!0);const X={page_size:999,current_page:1,type:"DESTINATION"},F=Xt(i,"/v1/integrations/entity/EMAIL");zt.get(F,{params:X}).then(({data:V})=>{w(ro(V.data))}).catch(V=>{sr(V,A)}).finally(()=>{I(!1)})},[]),N=C?.split(",").map(X=>({title:`@${X.trim()}`,value:`@${X.trim()}`})),[L,M]=_.useState(()=>x.from?`@${x.from?.split("@")[1]}`:N[0]?.value),[B,H]=_.useState(()=>x.from?.split("@")[0]||"");_.useEffect(()=>{k()},[]),_.useEffect(()=>{f?._id&&f?.meta?.entity==="EMAIL"&&(k(),O("properties.email_auth_id",f._id,{shouldValidate:!0}))},[f]);const j=X=>{O(`properties.${X}`,[...T(`properties.${X}`)||[],""])};return d.jsxs(E.Stack,{gap:2.5,children:[d.jsx(Ei,{children:d.jsx(E.Grid,{container:!0,gap:1.5,children:d.jsx(E.Grid,{item:!0,xs:12,children:x.integration_slug==="blt-int.boltic-email"?d.jsxs(E.Stack,{direction:"row",children:[d.jsx(E.Box,{sx:{width:"60%"},children:d.jsx(kr,{id:a,name:"properties.from",control:m,meta:{displayName:"From",description:_n(s,"from"),renderFieldValue:()=>B},viewOnly:p,editorId:`${s}-from`,showSuggestions:!0,isLoop:l,handleChange:X=>{const{value:F}=X;O("properties.from",`${F}${L}`),H(F)},sx:{"& .MuiPaper-root":{borderTopRightRadius:0,borderBottomRightRadius:0,borderRight:"none"}}})}),d.jsx(E.Box,{sx:{width:"40%"},children:d.jsx(Yt,{name:"properties.from",control:m,meta:{options:N,displayName:"Domain",searchFieldPlaceholder:"Search Domain"},viewOnly:p,id:s,renderFieldValue:()=>L,handleChange:X=>{const{value:F}=X;O("properties.from",`${B}${F}`),M(F)},sx:{"& .MuiOutlinedInput-notchedOutline":{borderTopLeftRadius:0,borderBottomLeftRadius:0}}})})]}):d.jsx(Yt,{required:!0,name:"properties.email_auth_id",control:m,meta:{options:yn(b),displayProps:{loading:R},displayName:"Email Account",value:"",htmlProps:{showAddNew:!0},TESSERACT_MAIN_URL:i,FRONTEND_URL:u,ENTITY_ID:n,openIntegrationDrawer:h,addNewButtonText:"Add new account",searchFieldPlaceholder:"Search email account",authType:"EMAIL",description:"Select Email secret here.",placeholder:"Select Email Account"},validationRules:{required:"Email account is required"},viewOnly:p,id:s})})})}),(x.email_auth_id||x.integration_slug==="blt-int.boltic-email")&&d.jsx(E.Divider,{}),(x.email_auth_id||x.integration_slug==="blt-int.boltic-email")&&d.jsx(En,{children:d.jsxs(E.Grid,{container:!0,gap:1.5,children:[d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(kr,{required:!0,id:a,name:"properties.subject",control:m,meta:{displayName:"Subject",description:"Enter the subject to send in the email.",placeholder:"Type or add suggestion"},validationRules:{required:"Subject is required"},viewOnly:p,editorId:`${s}-subject-${l}`,showSuggestions:!0,isLoop:l})}),d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(pr,{name:"properties.to",control:m,rules:{required:"To is required",validate:X=>Array.isArray(X)&&!X.every(V=>fu(V))?"To must have all the valid emails":!0},render:({field:X})=>d.jsx(Qc,{...X,required:!0,nodeId:a,label:"To",name:"to",viewOnly:p,isLoop:l,placeholder:"Enter email",onChange:F=>{X.onChange(typeof F=="string"?F:[...F])},errorMsg:v.properties?.to?.message})})}),d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(pr,{name:"properties.email_template",control:m,rules:{required:"Email body is required"},render:({field:X})=>d.jsx(Fi,{...X,label:"Email body",suggestionLabel:"Email body",id:`${s}-email_template`,activityType:s,VORTEX_MAIN_URL:r,ENTITY_ID:n,size:"md",viewOnly:p,showSuggestions:!0,language:"html",suggestionsData:l?P:c,showExpandOption:!0,showHtmlPreview:!0,errorMsg:v.properties?.email_template?.message,error:!!v.properties?.email_template?.message,handleChange:F=>{X.onChange(F)},required:!0})})}),d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(pr,{name:"properties.cc",control:m,rules:{validate:X=>Array.isArray(X)&&!X.every(V=>fu(V))?"Cc must have all the valid emails":!0},render:({field:X})=>d.jsx(Qc,{...X,nodeId:a,label:"Cc",name:"cc",viewOnly:p,placeholder:"Enter email",isLoop:l,onChange:F=>{X.onChange(typeof F=="string"?F:[...F])},errorMsg:v.properties?.cc?.message})})}),d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(pr,{name:"properties.bcc",control:m,rules:{validate:X=>Array.isArray(X)&&!X.every(V=>fu(V))?"Bcc must have all the valid emails":!0},render:({field:X})=>d.jsx(Qc,{...X,nodeId:a,label:"Bcc",name:"bcc",isLoop:l,viewOnly:p,placeholder:"Enter email",onChange:F=>{X.onChange(typeof F=="string"?F:[...F])},errorMsg:v.properties?.bcc?.message})})}),d.jsxs(E.Grid,{item:!0,xs:12,children:[d.jsxs(E.Box,{sx:{display:"flex",alignItems:"center"},children:[d.jsx(E.FormControl,{fullWidth:!0,sx:{"& > .MuiStack-root > .MuiStack-root":{pb:0}},children:d.jsx(gn,{label:"Attachments",description:"The maximum attachment limit is 25Mb"})}),d.jsx(E.IconButton,{disabled:p,onClick:()=>j("attachments"),sx:{float:"right",p:.75,border:X=>`1px solid ${X.palette.grey.brainstem}`,fontSize:X=>X.typography.mdNormal.fontSize},color:"primary",children:d.jsx(Ue,{src:"ic_plus",width:g.icons.md,height:g.icons.md,sx:{svg:{path:{fill:g.palette.primary.main}}}})})]}),d.jsx(qP,{nodeId:a,type:s,isLoop:l,viewOnly:p,field:"properties.attachments"})]}),!l&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Mi,{viewOnly:p,type:s})})]})})]})}),_Be=Gi(CBe),wBe=_.forwardRef((e,t)=>{const{workflow:r}=ct.useSelector(x=>x.workflows),n=ct.useDispatch(),{type:i,VORTEX_MAIN_URL:o,ENTITY_ID:s,suggestionsData:a,viewOnly:l=!1,id:u}=e,[c,f]=_.useState([]),[p,h]=_.useState(!1),{control:A,setValue:g,watch:m}=Rr(),O=m("properties"),y=E.useTheme(),T=m("properties.child_workflow_id"),v=m("properties.child_workflow_name"),C=async(x="")=>{h(!0);const b={include:["scheduled","published"],limit:100,page:1,name:x};r&&(b.draft_id=r?.id);const w=Xt(o,`/v1.0/${s}/workflows`);zt.get(w,{params:b}).then(({data:R})=>{f(()=>T&&!R.data.find(I=>I.id===T)?[{id:T,name:v,version:O.version},...R.data]:R.data)}).catch(R=>{sr(R,n)}).finally(()=>{h(!1)})};return _.useEffect(()=>{C()},[]),_.useEffect(()=>{if(!T)g("properties",{...O,child_workflow_id:"",version:"",child_workflow_name:""});else{const x=c.find(b=>b.id===T);g("properties",{...O,version:x?.version,child_workflow_name:x?.name})}},[T]),d.jsxs(E.Stack,{gap:2.5,children:[d.jsx(Ei,{children:d.jsx(E.Grid,{container:!0,gap:1.5,children:d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Yt,{required:!0,name:"properties.child_workflow_id",control:A,meta:{options:yn(c),displayName:"Workflow",searchFieldPlaceholder:"Search workflow",description:"Select the child workflow that you want to run",displayProps:{loading:p},placeholder:"Select Workflow"},validationRules:{required:"Workflow is required"},viewOnly:l,id:"child_workflow_id",handleChange:x=>{const{value:b}=x;if(b===""){const w=m("properties");g("properties",{...w,child_workflow_id:"",child_workflow_name:"",version:""})}},renderValueUi:x=>{if(!x)return d.jsx(E.Typography,{sx:{fontSize:"14px",color:y.palette.neutral.solid.bg,fontFamily:"inherit",":hover":{color:y.palette.neutral.main}},children:"Select Workflow"});const b=yn(c)?.find(w=>w?.value===x);return d.jsxs(E.Stack,{direction:"row",gap:1,children:[d.jsx(E.Typography,{sx:{fontSize:"14px",color:y.palette.text.primary,fontFamily:"inherit",...uu,maxWidth:"95%"},children:b?.title}),d.jsx(E.Chip,{sx:{fontSize:11},size:"small",label:`v${b?.version}`})]})},renderOption:(x,b)=>{const{title:w,value:R,version:I}=b;return d.jsx(E.MenuItem,{value:R,sx:{p:"8px !important",mx:1,height:"auto","&.Mui-selected":{"& .MuiTypography-root":{color:y.palette.primary.main}}},children:d.jsxs(E.Stack,{width:"100%",direction:"row",flexWrap:"wrap",sx:{...vf,gap:1},children:[d.jsx(E.Typography,{sx:{fontSize:"1rem",fontWeight:400,color:y.palette.text.primary,whiteSpace:"normal",wordBreak:"break-word",maxWidth:"88%"},children:w}),d.jsx(E.Chip,{sx:{fontSize:11},size:"small",label:`v${I}`})]})},R)}})})})}),O.child_workflow_id&&d.jsx(E.Divider,{}),O.child_workflow_id&&d.jsx(En,{children:d.jsxs(E.Grid,{container:!0,gap:1.5,children:[d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Wu,{name:"properties.payload",label:"Payload",viewOnly:l,id:u,suggestionsData:a,fullScreen:!0,showSuggestions:!0,helperText:"Provide the data needed for the child workflow, which will be available under the 'payload' property in the child workflow. This should always be an object. If you provide an array, only the first element will be used.",validationRules:{required:"Payload is required"}})}),d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Mi,{viewOnly:l,type:i})})]})})]})}),IBe=Gi(wBe,"");var lg={exports:{}};lg.exports;var jX;function DBe(){return jX||(jX=1,(function(e,t){var r=200,n="Expected a function",i="__lodash_hash_undefined__",o=1,s=2,a=9007199254740991,l="[object Arguments]",u="[object Array]",c="[object Boolean]",f="[object Date]",p="[object Error]",h="[object Function]",A="[object GeneratorFunction]",g="[object Map]",m="[object Number]",O="[object Object]",y="[object Promise]",T="[object RegExp]",v="[object Set]",C="[object String]",x="[object Symbol]",b="[object WeakMap]",w="[object ArrayBuffer]",R="[object DataView]",I="[object Float32Array]",P="[object Float64Array]",k="[object Int8Array]",N="[object Int16Array]",L="[object Int32Array]",M="[object Uint8Array]",B="[object Uint8ClampedArray]",H="[object Uint16Array]",j="[object Uint32Array]",X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,F=/^\w*$/,V=/^\./,G=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,D=/[\\^$.*+?()[\]{}|]/g,$=/\\(\\)?/g,U=/^\[object .+?Constructor\]$/,Y=/^(?:0|[1-9]\d*)$/,z={};z[I]=z[P]=z[k]=z[N]=z[L]=z[M]=z[B]=z[H]=z[j]=!0,z[l]=z[u]=z[w]=z[c]=z[R]=z[f]=z[p]=z[h]=z[g]=z[m]=z[O]=z[T]=z[v]=z[C]=z[b]=!1;var Q=typeof Ur=="object"&&Ur&&Ur.Object===Object&&Ur,W=typeof self=="object"&&self&&self.Object===Object&&self,q=Q||W||Function("return this")(),Z=t&&!t.nodeType&&t,te=Z&&!0&&e&&!e.nodeType&&e,ae=te&&te.exports===Z,ne=ae&&Q.process,ue=(function(){try{return ne&&ne.binding("util")}catch{}})(),Oe=ue&&ue.isTypedArray;function Te(xe,We,dt,Tt){for(var qt=-1,Qt=xe?xe.length:0;++qt<Qt;){var or=xe[qt];We(Tt,or,dt(or),xe)}return Tt}function se(xe,We){for(var dt=-1,Tt=xe?xe.length:0;++dt<Tt;)if(We(xe[dt],dt,xe))return!0;return!1}function ie(xe){return function(We){return We?.[xe]}}function J(xe,We){for(var dt=-1,Tt=Array(xe);++dt<xe;)Tt[dt]=We(dt);return Tt}function K(xe){return function(We){return xe(We)}}function re(xe,We){return xe?.[We]}function le(xe){var We=!1;if(xe!=null&&typeof xe.toString!="function")try{We=!!(xe+"")}catch{}return We}function he(xe){var We=-1,dt=Array(xe.size);return xe.forEach(function(Tt,qt){dt[++We]=[qt,Tt]}),dt}function Ae(xe,We){return function(dt){return xe(We(dt))}}function fe(xe){var We=-1,dt=Array(xe.size);return xe.forEach(function(Tt){dt[++We]=Tt}),dt}var Se=Array.prototype,ge=Function.prototype,ye=Object.prototype,je=q["__core-js_shared__"],Qe=(function(){var xe=/[^.]+$/.exec(je&&je.keys&&je.keys.IE_PROTO||"");return xe?"Symbol(src)_1."+xe:""})(),$e=ge.toString,Je=ye.hasOwnProperty,rt=ye.toString,tt=RegExp("^"+$e.call(Je).replace(D,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ie=q.Symbol,Ve=q.Uint8Array,He=ye.propertyIsEnumerable,Ee=Se.splice,_e=Ae(Object.keys,Object),we=Gn(q,"DataView"),ee=Gn(q,"Map"),de=Gn(q,"Promise"),be=Gn(q,"Set"),Ge=Gn(q,"WeakMap"),Ne=Gn(Object,"create"),Me=Be(we),mt=Be(ee),St=Be(de),De=Be(be),nt=Be(Ge),ut=Ie?Ie.prototype:void 0,Ot=ut?ut.valueOf:void 0,It=ut?ut.toString:void 0;function Mt(xe){var We=-1,dt=xe?xe.length:0;for(this.clear();++We<dt;){var Tt=xe[We];this.set(Tt[0],Tt[1])}}function Dt(){this.__data__=Ne?Ne(null):{}}function Fe(xe){return this.has(xe)&&delete this.__data__[xe]}function Ye(xe){var We=this.__data__;if(Ne){var dt=We[xe];return dt===i?void 0:dt}return Je.call(We,xe)?We[xe]:void 0}function Xe(xe){var We=this.__data__;return Ne?We[xe]!==void 0:Je.call(We,xe)}function at(xe,We){var dt=this.__data__;return dt[xe]=Ne&&We===void 0?i:We,this}Mt.prototype.clear=Dt,Mt.prototype.delete=Fe,Mt.prototype.get=Ye,Mt.prototype.has=Xe,Mt.prototype.set=at;function yt(xe){var We=-1,dt=xe?xe.length:0;for(this.clear();++We<dt;){var Tt=xe[We];this.set(Tt[0],Tt[1])}}function vt(){this.__data__=[]}function $t(xe){var We=this.__data__,dt=vr(We,xe);if(dt<0)return!1;var Tt=We.length-1;return dt==Tt?We.pop():Ee.call(We,dt,1),!0}function Re(xe){var We=this.__data__,dt=vr(We,xe);return dt<0?void 0:We[dt][1]}function it(xe){return vr(this.__data__,xe)>-1}function et(xe,We){var dt=this.__data__,Tt=vr(dt,xe);return Tt<0?dt.push([xe,We]):dt[Tt][1]=We,this}yt.prototype.clear=vt,yt.prototype.delete=$t,yt.prototype.get=Re,yt.prototype.has=it,yt.prototype.set=et;function Pe(xe){var We=-1,dt=xe?xe.length:0;for(this.clear();++We<dt;){var Tt=xe[We];this.set(Tt[0],Tt[1])}}function st(){this.__data__={hash:new Mt,map:new(ee||yt),string:new Mt}}function gt(xe){return sn(this,xe).delete(xe)}function Zt(xe){return sn(this,xe).get(xe)}function dr(xe){return sn(this,xe).has(xe)}function Mr(xe,We){return sn(this,xe).set(xe,We),this}Pe.prototype.clear=st,Pe.prototype.delete=gt,Pe.prototype.get=Zt,Pe.prototype.has=dr,Pe.prototype.set=Mr;function hn(xe){var We=-1,dt=xe?xe.length:0;for(this.__data__=new Pe;++We<dt;)this.add(xe[We])}function dn(xe){return this.__data__.set(xe,i),this}function An(xe){return this.__data__.has(xe)}hn.prototype.add=hn.prototype.push=dn,hn.prototype.has=An;function lr(xe){this.__data__=new yt(xe)}function _r(){this.__data__=new yt}function wn(xe){return this.__data__.delete(xe)}function Ft(xe){return this.__data__.get(xe)}function Jt(xe){return this.__data__.has(xe)}function $r(xe,We){var dt=this.__data__;if(dt instanceof yt){var Tt=dt.__data__;if(!ee||Tt.length<r-1)return Tt.push([xe,We]),this;dt=this.__data__=new Pe(Tt)}return dt.set(xe,We),this}lr.prototype.clear=_r,lr.prototype.delete=wn,lr.prototype.get=Ft,lr.prototype.has=Jt,lr.prototype.set=$r;function Cr(xe,We){var dt=rn(xe)||wr(xe)?J(xe.length,String):[],Tt=dt.length,qt=!!Tt;for(var Qt in xe)Je.call(xe,Qt)&&!(qt&&(Qt=="length"||zs(Qt,Tt)))&&dt.push(Qt);return dt}function vr(xe,We){for(var dt=xe.length;dt--;)if(Xr(xe[dt][0],We))return dt;return-1}function Fr(xe,We,dt,Tt){return Vr(xe,function(qt,Qt,or){We(Tt,qt,dt(qt),or)}),Tt}var Vr=Ca(Cn),Br=Dl();function Cn(xe,We){return xe&&Br(xe,We,Ke)}function Sn(xe,We){We=Xs(We,xe)?[We]:ti(We);for(var dt=0,Tt=We.length;xe!=null&&dt<Tt;)xe=xe[me(We[dt++])];return dt&&dt==Tt?xe:void 0}function Ln(xe){return rt.call(xe)}function Ti(xe,We){return xe!=null&&We in Object(xe)}function eo(xe,We,dt,Tt,qt){return xe===We?!0:xe==null||We==null||!so(xe)&&!ri(We)?xe!==xe&&We!==We:en(xe,We,eo,dt,Tt,qt)}function en(xe,We,dt,Tt,qt,Qt){var or=rn(xe),gr=rn(We),mr=u,Ir=u;or||(mr=Si(xe),mr=mr==l?O:mr),gr||(Ir=Si(We),Ir=Ir==l?O:Ir);var qr=mr==O&&!le(xe),jr=Ir==O&&!le(We),nn=mr==Ir;if(nn&&!qr)return Qt||(Qt=new lr),or||to(xe)?rs(xe,We,dt,Tt,qt,Qt):pi(xe,We,mr,dt,Tt,qt,Qt);if(!(qt&s)){var Zr=qr&&Je.call(xe,"__wrapped__"),Ui=jr&&Je.call(We,"__wrapped__");if(Zr||Ui){var Wo=Zr?xe.value():xe,Ds=Ui?We.value():We;return Qt||(Qt=new lr),dt(Wo,Ds,Tt,qt,Qt)}}return nn?(Qt||(Qt=new lr),Rl(xe,We,dt,Tt,qt,Qt)):!1}function To(xe,We,dt,Tt){var qt=dt.length,Qt=qt;if(xe==null)return!Qt;for(xe=Object(xe);qt--;){var or=dt[qt];if(or[2]?or[1]!==xe[or[0]]:!(or[0]in xe))return!1}for(;++qt<Qt;){or=dt[qt];var gr=or[0],mr=xe[gr],Ir=or[1];if(or[2]){if(mr===void 0&&!(gr in xe))return!1}else{var qr=new lr,jr;if(!(jr===void 0?eo(Ir,mr,Tt,o|s,qr):jr))return!1}}return!0}function oe(xe){if(!so(xe)||So(xe))return!1;var We=kn(xe)||le(xe)?tt:U;return We.test(Be(xe))}function Ce(xe){return ri(xe)&&Qi(xe.length)&&!!z[rt.call(xe)]}function ze(xe){return typeof xe=="function"?xe:xe==null?pt:typeof xe=="object"?rn(xe)?er(xe[0],xe[1]):Pt(xe):Ut(xe)}function lt(xe){if(!Is(xe))return _e(xe);var We=[];for(var dt in Object(xe))Je.call(xe,dt)&&dt!="constructor"&&We.push(dt);return We}function Pt(xe){var We=zn(xe);return We.length==1&&We[0][2]?au(We[0][0],We[0][1]):function(dt){return dt===xe||To(dt,xe,We)}}function er(xe,We){return Xs(xe)&&Go(We)?au(me(xe),We):function(dt){var Tt=pe(dt,xe);return Tt===void 0&&Tt===We?Le(dt,xe):eo(We,Tt,void 0,o|s)}}function Yr(xe){return function(We){return Sn(We,xe)}}function Kr(xe){if(typeof xe=="string")return xe;if(zi(xe))return It?It.call(xe):"";var We=xe+"";return We=="0"&&1/xe==-1/0?"-0":We}function ti(xe){return rn(xe)?xe:lc(xe)}function Mn(xe,We){return function(dt,Tt){var qt=rn(dt)?Te:Fr,Qt={};return qt(dt,xe,ze(Tt),Qt)}}function Ca(xe,We){return function(dt,Tt){if(dt==null)return dt;if(!mn(dt))return xe(dt,Tt);for(var qt=dt.length,Qt=-1,or=Object(dt);++Qt<qt&&Tt(or[Qt],Qt,or)!==!1;);return dt}}function Dl(xe){return function(We,dt,Tt){for(var qt=-1,Qt=Object(We),or=Tt(We),gr=or.length;gr--;){var mr=or[++qt];if(dt(Qt[mr],mr,Qt)===!1)break}return We}}function rs(xe,We,dt,Tt,qt,Qt){var or=qt&s,gr=xe.length,mr=We.length;if(gr!=mr&&!(or&&mr>gr))return!1;var Ir=Qt.get(xe);if(Ir&&Qt.get(We))return Ir==We;var qr=-1,jr=!0,nn=qt&o?new hn:void 0;for(Qt.set(xe,We),Qt.set(We,xe);++qr<gr;){var Zr=xe[qr],Ui=We[qr];if(Tt)var Wo=or?Tt(Ui,Zr,qr,We,xe,Qt):Tt(Zr,Ui,qr,xe,We,Qt);if(Wo!==void 0){if(Wo)continue;jr=!1;break}if(nn){if(!se(We,function(Ds,Xi){if(!nn.has(Xi)&&(Zr===Ds||dt(Zr,Ds,Tt,qt,Qt)))return nn.add(Xi)})){jr=!1;break}}else if(!(Zr===Ui||dt(Zr,Ui,Tt,qt,Qt))){jr=!1;break}}return Qt.delete(xe),Qt.delete(We),jr}function pi(xe,We,dt,Tt,qt,Qt,or){switch(dt){case R:if(xe.byteLength!=We.byteLength||xe.byteOffset!=We.byteOffset)return!1;xe=xe.buffer,We=We.buffer;case w:return!(xe.byteLength!=We.byteLength||!Tt(new Ve(xe),new Ve(We)));case c:case f:case m:return Xr(+xe,+We);case p:return xe.name==We.name&&xe.message==We.message;case T:case C:return xe==We+"";case g:var gr=he;case v:var mr=Qt&s;if(gr||(gr=fe),xe.size!=We.size&&!mr)return!1;var Ir=or.get(xe);if(Ir)return Ir==We;Qt|=o,or.set(xe,We);var qr=rs(gr(xe),gr(We),Tt,qt,Qt,or);return or.delete(xe),qr;case x:if(Ot)return Ot.call(xe)==Ot.call(We)}return!1}function Rl(xe,We,dt,Tt,qt,Qt){var or=qt&s,gr=Ke(xe),mr=gr.length,Ir=Ke(We),qr=Ir.length;if(mr!=qr&&!or)return!1;for(var jr=mr;jr--;){var nn=gr[jr];if(!(or?nn in We:Je.call(We,nn)))return!1}var Zr=Qt.get(xe);if(Zr&&Qt.get(We))return Zr==We;var Ui=!0;Qt.set(xe,We),Qt.set(We,xe);for(var Wo=or;++jr<mr;){nn=gr[jr];var Ds=xe[nn],Xi=We[nn];if(Tt)var gf=or?Tt(Xi,Ds,nn,We,xe,Qt):Tt(Ds,Xi,nn,xe,We,Qt);if(!(gf===void 0?Ds===Xi||dt(Ds,Xi,Tt,qt,Qt):gf)){Ui=!1;break}Wo||(Wo=nn=="constructor")}if(Ui&&!Wo){var Wx=xe.constructor,Qx=We.constructor;Wx!=Qx&&"constructor"in xe&&"constructor"in We&&!(typeof Wx=="function"&&Wx instanceof Wx&&typeof Qx=="function"&&Qx instanceof Qx)&&(Ui=!1)}return Qt.delete(xe),Qt.delete(We),Ui}function sn(xe,We){var dt=xe.__data__;return ac(We)?dt[typeof We=="string"?"string":"hash"]:dt.map}function zn(xe){for(var We=Ke(xe),dt=We.length;dt--;){var Tt=We[dt],qt=xe[Tt];We[dt]=[Tt,qt,Go(qt)]}return We}function Gn(xe,We){var dt=re(xe,We);return oe(dt)?dt:void 0}var Si=Ln;(we&&Si(new we(new ArrayBuffer(1)))!=R||ee&&Si(new ee)!=g||de&&Si(de.resolve())!=y||be&&Si(new be)!=v||Ge&&Si(new Ge)!=b)&&(Si=function(xe){var We=rt.call(xe),dt=We==O?xe.constructor:void 0,Tt=dt?Be(dt):void 0;if(Tt)switch(Tt){case Me:return R;case mt:return g;case St:return y;case De:return v;case nt:return b}return We});function Qs(xe,We,dt){We=Xs(We,xe)?[We]:ti(We);for(var Tt,qt=-1,or=We.length;++qt<or;){var Qt=me(We[qt]);if(!(Tt=xe!=null&&dt(xe,Qt)))break;xe=xe[Qt]}if(Tt)return Tt;var or=xe?xe.length:0;return!!or&&Qi(or)&&zs(Qt,or)&&(rn(xe)||wr(xe))}function zs(xe,We){return We=We??a,!!We&&(typeof xe=="number"||Y.test(xe))&&xe>-1&&xe%1==0&&xe<We}function Xs(xe,We){if(rn(xe))return!1;var dt=typeof xe;return dt=="number"||dt=="symbol"||dt=="boolean"||xe==null||zi(xe)?!0:F.test(xe)||!X.test(xe)||We!=null&&xe in Object(We)}function ac(xe){var We=typeof xe;return We=="string"||We=="number"||We=="symbol"||We=="boolean"?xe!=="__proto__":xe===null}function So(xe){return!!Qe&&Qe in xe}function Is(xe){var We=xe&&xe.constructor,dt=typeof We=="function"&&We.prototype||ye;return xe===dt}function Go(xe){return xe===xe&&!so(xe)}function au(xe,We){return function(dt){return dt==null?!1:dt[xe]===We&&(We!==void 0||xe in Object(dt))}}var lc=kt(function(xe){xe=qs(xe);var We=[];return V.test(xe)&&We.push(""),xe.replace(G,function(dt,Tt,qt,Qt){We.push(qt?Qt.replace($,"$1"):Tt||dt)}),We});function me(xe){if(typeof xe=="string"||zi(xe))return xe;var We=xe+"";return We=="0"&&1/xe==-1/0?"-0":We}function Be(xe){if(xe!=null){try{return $e.call(xe)}catch{}try{return xe+""}catch{}}return""}var ot=Mn(function(xe,We,dt){Je.call(xe,dt)?xe[dt].push(We):xe[dt]=[We]});function kt(xe,We){if(typeof xe!="function"||We&&typeof We!="function")throw new TypeError(n);var dt=function(){var Tt=arguments,qt=We?We.apply(this,Tt):Tt[0],Qt=dt.cache;if(Qt.has(qt))return Qt.get(qt);var or=xe.apply(this,Tt);return dt.cache=Qt.set(qt,or),or};return dt.cache=new(kt.Cache||Pe),dt}kt.Cache=Pe;function Xr(xe,We){return xe===We||xe!==xe&&We!==We}function wr(xe){return $i(xe)&&Je.call(xe,"callee")&&(!He.call(xe,"callee")||rt.call(xe)==l)}var rn=Array.isArray;function mn(xe){return xe!=null&&Qi(xe.length)&&!kn(xe)}function $i(xe){return ri(xe)&&mn(xe)}function kn(xe){var We=so(xe)?rt.call(xe):"";return We==h||We==A}function Qi(xe){return typeof xe=="number"&&xe>-1&&xe%1==0&&xe<=a}function so(xe){var We=typeof xe;return!!xe&&(We=="object"||We=="function")}function ri(xe){return!!xe&&typeof xe=="object"}function zi(xe){return typeof xe=="symbol"||ri(xe)&&rt.call(xe)==x}var to=Oe?K(Oe):Ce;function qs(xe){return xe==null?"":Kr(xe)}function pe(xe,We,dt){var Tt=xe==null?void 0:Sn(xe,We);return Tt===void 0?dt:Tt}function Le(xe,We){return xe!=null&&Qs(xe,We,Ti)}function Ke(xe){return mn(xe)?Cr(xe):lt(xe)}function pt(xe){return xe}function Ut(xe){return Xs(xe)?ie(me(xe)):Yr(xe)}e.exports=ot})(lg,lg.exports)),lg.exports}var RBe=DBe();const YP=Un(RBe);var ug={exports:{}};ug.exports;var $X;function PBe(){return $X||($X=1,(function(e,t){var r=200,n="Expected a function",i="__lodash_hash_undefined__",o=1,s=2,a=9007199254740991,l="[object Arguments]",u="[object Array]",c="[object Boolean]",f="[object Date]",p="[object Error]",h="[object Function]",A="[object GeneratorFunction]",g="[object Map]",m="[object Number]",O="[object Object]",y="[object Promise]",T="[object RegExp]",v="[object Set]",C="[object String]",x="[object Symbol]",b="[object WeakMap]",w="[object ArrayBuffer]",R="[object DataView]",I="[object Float32Array]",P="[object Float64Array]",k="[object Int8Array]",N="[object Int16Array]",L="[object Int32Array]",M="[object Uint8Array]",B="[object Uint8ClampedArray]",H="[object Uint16Array]",j="[object Uint32Array]",X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,F=/^\w*$/,V=/^\./,G=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,D=/[\\^$.*+?()[\]{}|]/g,$=/\\(\\)?/g,U=/^\[object .+?Constructor\]$/,Y=/^(?:0|[1-9]\d*)$/,z={};z[I]=z[P]=z[k]=z[N]=z[L]=z[M]=z[B]=z[H]=z[j]=!0,z[l]=z[u]=z[w]=z[c]=z[R]=z[f]=z[p]=z[h]=z[g]=z[m]=z[O]=z[T]=z[v]=z[C]=z[b]=!1;var Q=typeof Ur=="object"&&Ur&&Ur.Object===Object&&Ur,W=typeof self=="object"&&self&&self.Object===Object&&self,q=Q||W||Function("return this")(),Z=t&&!t.nodeType&&t,te=Z&&!0&&e&&!e.nodeType&&e,ae=te&&te.exports===Z,ne=ae&&Q.process,ue=(function(){try{return ne&&ne.binding("util")}catch{}})(),Oe=ue&&ue.isTypedArray;function Te(pe,Le){for(var Ke=-1,pt=pe?pe.length:0;++Ke<pt;)if(Le(pe[Ke],Ke,pe))return!0;return!1}function se(pe){return function(Le){return Le?.[pe]}}function ie(pe,Le){for(var Ke=-1,pt=Array(pe);++Ke<pe;)pt[Ke]=Le(Ke);return pt}function J(pe){return function(Le){return pe(Le)}}function K(pe,Le){return pe?.[Le]}function re(pe){var Le=!1;if(pe!=null&&typeof pe.toString!="function")try{Le=!!(pe+"")}catch{}return Le}function le(pe){var Le=-1,Ke=Array(pe.size);return pe.forEach(function(pt,Ut){Ke[++Le]=[Ut,pt]}),Ke}function he(pe,Le){return function(Ke){return pe(Le(Ke))}}function Ae(pe){var Le=-1,Ke=Array(pe.size);return pe.forEach(function(pt){Ke[++Le]=pt}),Ke}var fe=Array.prototype,Se=Function.prototype,ge=Object.prototype,ye=q["__core-js_shared__"],je=(function(){var pe=/[^.]+$/.exec(ye&&ye.keys&&ye.keys.IE_PROTO||"");return pe?"Symbol(src)_1."+pe:""})(),Qe=Se.toString,$e=ge.hasOwnProperty,Je=ge.toString,rt=RegExp("^"+Qe.call($e).replace(D,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),tt=q.Symbol,Ie=q.Uint8Array,Ve=ge.propertyIsEnumerable,He=fe.splice,Ee=he(Object.keys,Object),_e=rs(q,"DataView"),we=rs(q,"Map"),ee=rs(q,"Promise"),de=rs(q,"Set"),be=rs(q,"WeakMap"),Ge=rs(Object,"create"),Ne=Is(_e),Me=Is(we),mt=Is(ee),St=Is(de),De=Is(be),nt=tt?tt.prototype:void 0,ut=nt?nt.valueOf:void 0,Ot=nt?nt.toString:void 0;function It(pe){var Le=-1,Ke=pe?pe.length:0;for(this.clear();++Le<Ke;){var pt=pe[Le];this.set(pt[0],pt[1])}}function Mt(){this.__data__=Ge?Ge(null):{}}function Dt(pe){return this.has(pe)&&delete this.__data__[pe]}function Fe(pe){var Le=this.__data__;if(Ge){var Ke=Le[pe];return Ke===i?void 0:Ke}return $e.call(Le,pe)?Le[pe]:void 0}function Ye(pe){var Le=this.__data__;return Ge?Le[pe]!==void 0:$e.call(Le,pe)}function Xe(pe,Le){var Ke=this.__data__;return Ke[pe]=Ge&&Le===void 0?i:Le,this}It.prototype.clear=Mt,It.prototype.delete=Dt,It.prototype.get=Fe,It.prototype.has=Ye,It.prototype.set=Xe;function at(pe){var Le=-1,Ke=pe?pe.length:0;for(this.clear();++Le<Ke;){var pt=pe[Le];this.set(pt[0],pt[1])}}function yt(){this.__data__=[]}function vt(pe){var Le=this.__data__,Ke=Cr(Le,pe);if(Ke<0)return!1;var pt=Le.length-1;return Ke==pt?Le.pop():He.call(Le,Ke,1),!0}function $t(pe){var Le=this.__data__,Ke=Cr(Le,pe);return Ke<0?void 0:Le[Ke][1]}function Re(pe){return Cr(this.__data__,pe)>-1}function it(pe,Le){var Ke=this.__data__,pt=Cr(Ke,pe);return pt<0?Ke.push([pe,Le]):Ke[pt][1]=Le,this}at.prototype.clear=yt,at.prototype.delete=vt,at.prototype.get=$t,at.prototype.has=Re,at.prototype.set=it;function et(pe){var Le=-1,Ke=pe?pe.length:0;for(this.clear();++Le<Ke;){var pt=pe[Le];this.set(pt[0],pt[1])}}function Pe(){this.__data__={hash:new It,map:new(we||at),string:new It}}function st(pe){return Ca(this,pe).delete(pe)}function gt(pe){return Ca(this,pe).get(pe)}function Zt(pe){return Ca(this,pe).has(pe)}function dr(pe,Le){return Ca(this,pe).set(pe,Le),this}et.prototype.clear=Pe,et.prototype.delete=st,et.prototype.get=gt,et.prototype.has=Zt,et.prototype.set=dr;function Mr(pe){var Le=-1,Ke=pe?pe.length:0;for(this.__data__=new et;++Le<Ke;)this.add(pe[Le])}function hn(pe){return this.__data__.set(pe,i),this}function dn(pe){return this.__data__.has(pe)}Mr.prototype.add=Mr.prototype.push=hn,Mr.prototype.has=dn;function An(pe){this.__data__=new at(pe)}function lr(){this.__data__=new at}function _r(pe){return this.__data__.delete(pe)}function wn(pe){return this.__data__.get(pe)}function Ft(pe){return this.__data__.has(pe)}function Jt(pe,Le){var Ke=this.__data__;if(Ke instanceof at){var pt=Ke.__data__;if(!we||pt.length<r-1)return pt.push([pe,Le]),this;Ke=this.__data__=new et(pt)}return Ke.set(pe,Le),this}An.prototype.clear=lr,An.prototype.delete=_r,An.prototype.get=wn,An.prototype.has=Ft,An.prototype.set=Jt;function $r(pe,Le){var Ke=me(pe)||lc(pe)?ie(pe.length,String):[],pt=Ke.length,Ut=!!pt;for(var xe in pe)$e.call(pe,xe)&&!(Ut&&(xe=="length"||sn(xe,pt)))&&Ke.push(xe);return Ke}function Cr(pe,Le){for(var Ke=pe.length;Ke--;)if(au(pe[Ke][0],Le))return Ke;return-1}var vr=Yr();function Fr(pe,Le){return pe&&vr(pe,Le,ri)}function Vr(pe,Le){Le=zn(Le,pe)?[Le]:er(Le);for(var Ke=0,pt=Le.length;pe!=null&&Ke<pt;)pe=pe[So(Le[Ke++])];return Ke&&Ke==pt?pe:void 0}function Br(pe){return Je.call(pe)}function Cn(pe,Le){return pe!=null&&Le in Object(pe)}function Sn(pe,Le,Ke,pt,Ut){return pe===Le?!0:pe==null||Le==null||!wr(pe)&&!rn(Le)?pe!==pe&&Le!==Le:Ln(pe,Le,Sn,Ke,pt,Ut)}function Ln(pe,Le,Ke,pt,Ut,xe){var We=me(pe),dt=me(Le),Tt=u,qt=u;We||(Tt=pi(pe),Tt=Tt==l?O:Tt),dt||(qt=pi(Le),qt=qt==l?O:qt);var Qt=Tt==O&&!re(pe),or=qt==O&&!re(Le),gr=Tt==qt;if(gr&&!Qt)return xe||(xe=new An),We||$i(pe)?Kr(pe,Le,Ke,pt,Ut,xe):ti(pe,Le,Tt,Ke,pt,Ut,xe);if(!(Ut&s)){var mr=Qt&&$e.call(pe,"__wrapped__"),Ir=or&&$e.call(Le,"__wrapped__");if(mr||Ir){var qr=mr?pe.value():pe,jr=Ir?Le.value():Le;return xe||(xe=new An),Ke(qr,jr,pt,Ut,xe)}}return gr?(xe||(xe=new An),Mn(pe,Le,Ke,pt,Ut,xe)):!1}function Ti(pe,Le,Ke,pt){var Ut=Ke.length,xe=Ut;if(pe==null)return!xe;for(pe=Object(pe);Ut--;){var We=Ke[Ut];if(We[2]?We[1]!==pe[We[0]]:!(We[0]in pe))return!1}for(;++Ut<xe;){We=Ke[Ut];var dt=We[0],Tt=pe[dt],qt=We[1];if(We[2]){if(Tt===void 0&&!(dt in pe))return!1}else{var Qt=new An,or;if(!(or===void 0?Sn(qt,Tt,pt,o|s,Qt):or))return!1}}return!0}function eo(pe){if(!wr(pe)||Si(pe))return!1;var Le=kt(pe)||re(pe)?rt:U;return Le.test(Is(pe))}function en(pe){return rn(pe)&&Xr(pe.length)&&!!z[Je.call(pe)]}function To(pe){return typeof pe=="function"?pe:pe==null?to:typeof pe=="object"?me(pe)?ze(pe[0],pe[1]):Ce(pe):qs(pe)}function oe(pe){if(!Qs(pe))return Ee(pe);var Le=[];for(var Ke in Object(pe))$e.call(pe,Ke)&&Ke!="constructor"&&Le.push(Ke);return Le}function Ce(pe){var Le=Dl(pe);return Le.length==1&&Le[0][2]?Xs(Le[0][0],Le[0][1]):function(Ke){return Ke===pe||Ti(Ke,pe,Le)}}function ze(pe,Le){return zn(pe)&&zs(Le)?Xs(So(pe),Le):function(Ke){var pt=Qi(Ke,pe);return pt===void 0&&pt===Le?so(Ke,pe):Sn(Le,pt,void 0,o|s)}}function lt(pe){return function(Le){return Vr(Le,pe)}}function Pt(pe){if(typeof pe=="string")return pe;if(mn(pe))return Ot?Ot.call(pe):"";var Le=pe+"";return Le=="0"&&1/pe==-1/0?"-0":Le}function er(pe){return me(pe)?pe:ac(pe)}function Yr(pe){return function(Le,Ke,pt){for(var Ut=-1,xe=Object(Le),We=pt(Le),dt=We.length;dt--;){var Tt=We[++Ut];if(Ke(xe[Tt],Tt,xe)===!1)break}return Le}}function Kr(pe,Le,Ke,pt,Ut,xe){var We=Ut&s,dt=pe.length,Tt=Le.length;if(dt!=Tt&&!(We&&Tt>dt))return!1;var qt=xe.get(pe);if(qt&&xe.get(Le))return qt==Le;var Qt=-1,or=!0,gr=Ut&o?new Mr:void 0;for(xe.set(pe,Le),xe.set(Le,pe);++Qt<dt;){var mr=pe[Qt],Ir=Le[Qt];if(pt)var qr=We?pt(Ir,mr,Qt,Le,pe,xe):pt(mr,Ir,Qt,pe,Le,xe);if(qr!==void 0){if(qr)continue;or=!1;break}if(gr){if(!Te(Le,function(jr,nn){if(!gr.has(nn)&&(mr===jr||Ke(mr,jr,pt,Ut,xe)))return gr.add(nn)})){or=!1;break}}else if(!(mr===Ir||Ke(mr,Ir,pt,Ut,xe))){or=!1;break}}return xe.delete(pe),xe.delete(Le),or}function ti(pe,Le,Ke,pt,Ut,xe,We){switch(Ke){case R:if(pe.byteLength!=Le.byteLength||pe.byteOffset!=Le.byteOffset)return!1;pe=pe.buffer,Le=Le.buffer;case w:return!(pe.byteLength!=Le.byteLength||!pt(new Ie(pe),new Ie(Le)));case c:case f:case m:return au(+pe,+Le);case p:return pe.name==Le.name&&pe.message==Le.message;case T:case C:return pe==Le+"";case g:var dt=le;case v:var Tt=xe&s;if(dt||(dt=Ae),pe.size!=Le.size&&!Tt)return!1;var qt=We.get(pe);if(qt)return qt==Le;xe|=o,We.set(pe,Le);var Qt=Kr(dt(pe),dt(Le),pt,Ut,xe,We);return We.delete(pe),Qt;case x:if(ut)return ut.call(pe)==ut.call(Le)}return!1}function Mn(pe,Le,Ke,pt,Ut,xe){var We=Ut&s,dt=ri(pe),Tt=dt.length,qt=ri(Le),Qt=qt.length;if(Tt!=Qt&&!We)return!1;for(var or=Tt;or--;){var gr=dt[or];if(!(We?gr in Le:$e.call(Le,gr)))return!1}var mr=xe.get(pe);if(mr&&xe.get(Le))return mr==Le;var Ir=!0;xe.set(pe,Le),xe.set(Le,pe);for(var qr=We;++or<Tt;){gr=dt[or];var jr=pe[gr],nn=Le[gr];if(pt)var Zr=We?pt(nn,jr,gr,Le,pe,xe):pt(jr,nn,gr,pe,Le,xe);if(!(Zr===void 0?jr===nn||Ke(jr,nn,pt,Ut,xe):Zr)){Ir=!1;break}qr||(qr=gr=="constructor")}if(Ir&&!qr){var Ui=pe.constructor,Wo=Le.constructor;Ui!=Wo&&"constructor"in pe&&"constructor"in Le&&!(typeof Ui=="function"&&Ui instanceof Ui&&typeof Wo=="function"&&Wo instanceof Wo)&&(Ir=!1)}return xe.delete(pe),xe.delete(Le),Ir}function Ca(pe,Le){var Ke=pe.__data__;return Gn(Le)?Ke[typeof Le=="string"?"string":"hash"]:Ke.map}function Dl(pe){for(var Le=ri(pe),Ke=Le.length;Ke--;){var pt=Le[Ke],Ut=pe[pt];Le[Ke]=[pt,Ut,zs(Ut)]}return Le}function rs(pe,Le){var Ke=K(pe,Le);return eo(Ke)?Ke:void 0}var pi=Br;(_e&&pi(new _e(new ArrayBuffer(1)))!=R||we&&pi(new we)!=g||ee&&pi(ee.resolve())!=y||de&&pi(new de)!=v||be&&pi(new be)!=b)&&(pi=function(pe){var Le=Je.call(pe),Ke=Le==O?pe.constructor:void 0,pt=Ke?Is(Ke):void 0;if(pt)switch(pt){case Ne:return R;case Me:return g;case mt:return y;case St:return v;case De:return b}return Le});function Rl(pe,Le,Ke){Le=zn(Le,pe)?[Le]:er(Le);for(var pt,Ut=-1,We=Le.length;++Ut<We;){var xe=So(Le[Ut]);if(!(pt=pe!=null&&Ke(pe,xe)))break;pe=pe[xe]}if(pt)return pt;var We=pe?pe.length:0;return!!We&&Xr(We)&&sn(xe,We)&&(me(pe)||lc(pe))}function sn(pe,Le){return Le=Le??a,!!Le&&(typeof pe=="number"||Y.test(pe))&&pe>-1&&pe%1==0&&pe<Le}function zn(pe,Le){if(me(pe))return!1;var Ke=typeof pe;return Ke=="number"||Ke=="symbol"||Ke=="boolean"||pe==null||mn(pe)?!0:F.test(pe)||!X.test(pe)||Le!=null&&pe in Object(Le)}function Gn(pe){var Le=typeof pe;return Le=="string"||Le=="number"||Le=="symbol"||Le=="boolean"?pe!=="__proto__":pe===null}function Si(pe){return!!je&&je in pe}function Qs(pe){var Le=pe&&pe.constructor,Ke=typeof Le=="function"&&Le.prototype||ge;return pe===Ke}function zs(pe){return pe===pe&&!wr(pe)}function Xs(pe,Le){return function(Ke){return Ke==null?!1:Ke[pe]===Le&&(Le!==void 0||pe in Object(Ke))}}var ac=Go(function(pe){pe=kn(pe);var Le=[];return V.test(pe)&&Le.push(""),pe.replace(G,function(Ke,pt,Ut,xe){Le.push(Ut?xe.replace($,"$1"):pt||Ke)}),Le});function So(pe){if(typeof pe=="string"||mn(pe))return pe;var Le=pe+"";return Le=="0"&&1/pe==-1/0?"-0":Le}function Is(pe){if(pe!=null){try{return Qe.call(pe)}catch{}try{return pe+""}catch{}}return""}function Go(pe,Le){if(typeof pe!="function"||Le&&typeof Le!="function")throw new TypeError(n);var Ke=function(){var pt=arguments,Ut=Le?Le.apply(this,pt):pt[0],xe=Ke.cache;if(xe.has(Ut))return xe.get(Ut);var We=pe.apply(this,pt);return Ke.cache=xe.set(Ut,We),We};return Ke.cache=new(Go.Cache||et),Ke}Go.Cache=et;function au(pe,Le){return pe===Le||pe!==pe&&Le!==Le}function lc(pe){return ot(pe)&&$e.call(pe,"callee")&&(!Ve.call(pe,"callee")||Je.call(pe)==l)}var me=Array.isArray;function Be(pe){return pe!=null&&Xr(pe.length)&&!kt(pe)}function ot(pe){return rn(pe)&&Be(pe)}function kt(pe){var Le=wr(pe)?Je.call(pe):"";return Le==h||Le==A}function Xr(pe){return typeof pe=="number"&&pe>-1&&pe%1==0&&pe<=a}function wr(pe){var Le=typeof pe;return!!pe&&(Le=="object"||Le=="function")}function rn(pe){return!!pe&&typeof pe=="object"}function mn(pe){return typeof pe=="symbol"||rn(pe)&&Je.call(pe)==x}var $i=Oe?J(Oe):en;function kn(pe){return pe==null?"":Pt(pe)}function Qi(pe,Le,Ke){var pt=pe==null?void 0:Vr(pe,Le);return pt===void 0?Ke:pt}function so(pe,Le){return pe!=null&&Rl(pe,Le,Cn)}function ri(pe){return Be(pe)?$r(pe):oe(pe)}function zi(pe,Le){var Ke={};return Le=To(Le),Fr(pe,function(pt,Ut,xe){Ke[Ut]=Le(pt,Ut,xe)}),Ke}function to(pe){return pe}function qs(pe){return zn(pe)?se(So(pe)):lt(pe)}e.exports=zi})(ug,ug.exports)),ug.exports}var NBe=PBe();const LBe=Un(NBe);var KP,UX;function kBe(){if(UX)return KP;UX=1;var e=200,t="__lodash_hash_undefined__",r=9007199254740991,n="[object Arguments]",i="[object Function]",o="[object GeneratorFunction]",s="[object Symbol]",a=/[\\^$.*+?()[\]{}|]/g,l=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,c=typeof Ur=="object"&&Ur&&Ur.Object===Object&&Ur,f=typeof self=="object"&&self&&self.Object===Object&&self,p=c||f||Function("return this")();function h(Re,it,et){switch(et.length){case 0:return Re.call(it);case 1:return Re.call(it,et[0]);case 2:return Re.call(it,et[0],et[1]);case 3:return Re.call(it,et[0],et[1],et[2])}return Re.apply(it,et)}function A(Re,it){var et=Re?Re.length:0;return!!et&&y(Re,it,0)>-1}function g(Re,it){for(var et=-1,Pe=Re?Re.length:0,st=Array(Pe);++et<Pe;)st[et]=it(Re[et],et,Re);return st}function m(Re,it){for(var et=-1,Pe=it.length,st=Re.length;++et<Pe;)Re[st+et]=it[et];return Re}function O(Re,it,et,Pe){for(var st=Re.length,gt=et+-1;++gt<st;)if(it(Re[gt],gt,Re))return gt;return-1}function y(Re,it,et){if(it!==it)return O(Re,T,et);for(var Pe=et-1,st=Re.length;++Pe<st;)if(Re[Pe]===it)return Pe;return-1}function T(Re){return Re!==Re}function v(Re,it){for(var et=-1,Pe=Array(Re);++et<Re;)Pe[et]=it(et);return Pe}function C(Re,it){return Re.has(it)}function x(Re,it){return Re?.[it]}function b(Re){var it=!1;if(Re!=null&&typeof Re.toString!="function")try{it=!!(Re+"")}catch{}return it}function w(Re,it){return function(et){return Re(it(et))}}var R=Array.prototype,I=Function.prototype,P=Object.prototype,k=p["__core-js_shared__"],N=(function(){var Re=/[^.]+$/.exec(k&&k.keys&&k.keys.IE_PROTO||"");return Re?"Symbol(src)_1."+Re:""})(),L=I.toString,M=P.hasOwnProperty,B=P.toString,H=RegExp("^"+L.call(M).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),j=p.Symbol,X=w(Object.getPrototypeOf,Object),F=P.propertyIsEnumerable,V=R.splice,G=j?j.isConcatSpreadable:void 0,D=Object.getOwnPropertySymbols,$=Math.max,U=_e(p,"Map"),Y=_e(Object,"create");function z(Re){var it=-1,et=Re?Re.length:0;for(this.clear();++it<et;){var Pe=Re[it];this.set(Pe[0],Pe[1])}}function Q(){this.__data__=Y?Y(null):{}}function W(Re){return this.has(Re)&&delete this.__data__[Re]}function q(Re){var it=this.__data__;if(Y){var et=it[Re];return et===t?void 0:et}return M.call(it,Re)?it[Re]:void 0}function Z(Re){var it=this.__data__;return Y?it[Re]!==void 0:M.call(it,Re)}function te(Re,it){var et=this.__data__;return et[Re]=Y&&it===void 0?t:it,this}z.prototype.clear=Q,z.prototype.delete=W,z.prototype.get=q,z.prototype.has=Z,z.prototype.set=te;function ae(Re){var it=-1,et=Re?Re.length:0;for(this.clear();++it<et;){var Pe=Re[it];this.set(Pe[0],Pe[1])}}function ne(){this.__data__=[]}function ue(Re){var it=this.__data__,et=ye(it,Re);if(et<0)return!1;var Pe=it.length-1;return et==Pe?it.pop():V.call(it,et,1),!0}function Oe(Re){var it=this.__data__,et=ye(it,Re);return et<0?void 0:it[et][1]}function Te(Re){return ye(this.__data__,Re)>-1}function se(Re,it){var et=this.__data__,Pe=ye(et,Re);return Pe<0?et.push([Re,it]):et[Pe][1]=it,this}ae.prototype.clear=ne,ae.prototype.delete=ue,ae.prototype.get=Oe,ae.prototype.has=Te,ae.prototype.set=se;function ie(Re){var it=-1,et=Re?Re.length:0;for(this.clear();++it<et;){var Pe=Re[it];this.set(Pe[0],Pe[1])}}function J(){this.__data__={hash:new z,map:new(U||ae),string:new z}}function K(Re){return Ee(this,Re).delete(Re)}function re(Re){return Ee(this,Re).get(Re)}function le(Re){return Ee(this,Re).has(Re)}function he(Re,it){return Ee(this,Re).set(Re,it),this}ie.prototype.clear=J,ie.prototype.delete=K,ie.prototype.get=re,ie.prototype.has=le,ie.prototype.set=he;function Ae(Re){var it=-1,et=Re?Re.length:0;for(this.__data__=new ie;++it<et;)this.add(Re[it])}function fe(Re){return this.__data__.set(Re,t),this}function Se(Re){return this.__data__.has(Re)}Ae.prototype.add=Ae.prototype.push=fe,Ae.prototype.has=Se;function ge(Re,it){var et=Ot(Re)||ut(Re)?v(Re.length,String):[],Pe=et.length,st=!!Pe;for(var gt in Re)st&&(gt=="length"||be(gt,Pe))||et.push(gt);return et}function ye(Re,it){for(var et=Re.length;et--;)if(nt(Re[et][0],it))return et;return-1}function je(Re,it,et,Pe){var st=-1,gt=A,Zt=!0,dr=Re.length,Mr=[],hn=it.length;if(!dr)return Mr;it.length>=e&&(gt=C,Zt=!1,it=new Ae(it));e:for(;++st<dr;){var dn=Re[st],An=dn;if(dn=dn!==0?dn:0,Zt&&An===An){for(var lr=hn;lr--;)if(it[lr]===An)continue e;Mr.push(dn)}else gt(it,An,Pe)||Mr.push(dn)}return Mr}function Qe(Re,it,et,Pe,st){var gt=-1,Zt=Re.length;for(et||(et=de),st||(st=[]);++gt<Zt;){var dr=Re[gt];et(dr)?m(st,dr):st[st.length]=dr}return st}function $e(Re,it,et){var Pe=it(Re);return Ot(Re)?Pe:m(Pe,et(Re))}function Je(Re){if(!Ye(Re)||Ne(Re))return!1;var it=Dt(Re)||b(Re)?H:l;return it.test(De(Re))}function rt(Re){if(!Ye(Re))return mt(Re);var it=Me(Re),et=[];for(var Pe in Re)Pe=="constructor"&&(it||!M.call(Re,Pe))||et.push(Pe);return et}function tt(Re,it){return Re=Object(Re),Ie(Re,it,function(et,Pe){return Pe in Re})}function Ie(Re,it,et){for(var Pe=-1,st=it.length,gt={};++Pe<st;){var Zt=it[Pe],dr=Re[Zt];et(dr,Zt)&&(gt[Zt]=dr)}return gt}function Ve(Re,it){return it=$(it===void 0?Re.length-1:it,0),function(){for(var et=arguments,Pe=-1,st=$(et.length-it,0),gt=Array(st);++Pe<st;)gt[Pe]=et[it+Pe];Pe=-1;for(var Zt=Array(it+1);++Pe<it;)Zt[Pe]=et[Pe];return Zt[it]=gt,h(Re,this,Zt)}}function He(Re){return $e(Re,yt,ee)}function Ee(Re,it){var et=Re.__data__;return Ge(it)?et[typeof it=="string"?"string":"hash"]:et.map}function _e(Re,it){var et=x(Re,it);return Je(et)?et:void 0}var we=D?w(D,Object):$t,ee=D?function(Re){for(var it=[];Re;)m(it,we(Re)),Re=X(Re);return it}:$t;function de(Re){return Ot(Re)||ut(Re)||!!(G&&Re&&Re[G])}function be(Re,it){return it=it??r,!!it&&(typeof Re=="number"||u.test(Re))&&Re>-1&&Re%1==0&&Re<it}function Ge(Re){var it=typeof Re;return it=="string"||it=="number"||it=="symbol"||it=="boolean"?Re!=="__proto__":Re===null}function Ne(Re){return!!N&&N in Re}function Me(Re){var it=Re&&Re.constructor,et=typeof it=="function"&&it.prototype||P;return Re===et}function mt(Re){var it=[];if(Re!=null)for(var et in Object(Re))it.push(et);return it}function St(Re){if(typeof Re=="string"||at(Re))return Re;var it=Re+"";return it=="0"&&1/Re==-1/0?"-0":it}function De(Re){if(Re!=null){try{return L.call(Re)}catch{}try{return Re+""}catch{}}return""}function nt(Re,it){return Re===it||Re!==Re&&it!==it}function ut(Re){return Mt(Re)&&M.call(Re,"callee")&&(!F.call(Re,"callee")||B.call(Re)==n)}var Ot=Array.isArray;function It(Re){return Re!=null&&Fe(Re.length)&&!Dt(Re)}function Mt(Re){return Xe(Re)&&It(Re)}function Dt(Re){var it=Ye(Re)?B.call(Re):"";return it==i||it==o}function Fe(Re){return typeof Re=="number"&&Re>-1&&Re%1==0&&Re<=r}function Ye(Re){var it=typeof Re;return!!Re&&(it=="object"||it=="function")}function Xe(Re){return!!Re&&typeof Re=="object"}function at(Re){return typeof Re=="symbol"||Xe(Re)&&B.call(Re)==s}function yt(Re){return It(Re)?ge(Re):rt(Re)}var vt=Ve(function(Re,it){return Re==null?{}:(it=g(Qe(it),St),tt(Re,je(He(Re),it)))});function $t(){return[]}return KP=vt,KP}var FBe=kBe();const MBe=Un(FBe),BBe=_.forwardRef((e,t)=>{const{type:r,VORTEX_MAIN_URL:n,ENTITY_ID:i,TESSERACT_MAIN_URL:o,FRONTEND_URL:s,INTEGRATION_DATA:a,viewOnly:l=!1,openIntegrationDrawer:u}=e,c=ct.useDispatch(),{workflow:f}=ct.useSelector(Q=>Q.workflows),{source:p=""}=f,[h,A]=_.useState({}),[g,m]=_.useState([]),[O,y]=_.useState([]),[T,v]=_.useState(!1),[C,x]=_.useState(!1),[b,w]=_.useState(!1),[R,I]=_.useState(null),P=_.useRef([]),{control:k,watch:N,setValue:L,trigger:M}=Rr(),B=p?.includes("commerce_"),H=p?.split("_"),j=H&&H.length>1?H[1]:null,X=H&&H.length>2?H.slice(2).join("_"):j,F=N("properties"),V=N("properties.fp_auth_id"),G=async()=>{if(B)m([{name:X,id:p?.toLowerCase()||""}]),L("properties.fp_auth_id",p?.toLowerCase()||"",{shouldValidate:!0});else{v(!0);try{const{data:Q}=await zt.get(Xt(o,"/v1/integrations/entity/FYND_PLATFORM?get_form_data=true"),{params:{page_size:999,current_page:1,type:"BOTH"}});m(ro(Q.data))}catch(Q){sr(Q,c)}finally{v(!1)}}},D=async Q=>{w(!0);try{const W=Xt(n,`/v1.0/${i}`,"/utility/events-config"),q=Q?{id:Q}:{},{data:Z}=await zt.get(W,{params:q});P.current=Z.data.event_configs;const te=Z.data.event_configs.map(ue=>({...ue,display_name:`${ue.display_name}_${ue.event_category}`})),ae=YP(te,"event_category"),ne={application:$(ae.application),company:$(ae.company)};A(ne)}catch(W){sr(W,c)}finally{w(!1)}},$=Q=>{if(!Q)return{};const W={},q=YP(Q,"event_name");return Object.keys(q).forEach(Z=>{const te=YP(q[Z],"version");W[Z]=LBe(te,ae=>ae.map(ne=>MBe(ne,"version"))),W[Z].versions=Object.keys(te).map(ae=>({text:`V${ae}`,value:ae}))}),W},U=async Q=>{x(!0);try{const W=Xt(n,`/v1.0/${i}`,`/utility/applications?id=${Q}`),{data:q}=await zt.get(W);y(q?.data?.map(Z=>({id:Z.id,name:Z.name})))}catch(W){sr(W,c)}finally{x(!1)}};_.useEffect(()=>{const{fp_auth_id:Q}=F;Q&&(p?.includes("commerce_")?D(""):D(Q))},[]),_.useEffect(()=>{G()},[]),_.useEffect(()=>{a?._id&&a?.meta?.entity==="FYND_PLATFORM"&&(G(),L("properties.fp_auth_id",a._id,{shouldValidate:!0}))},[a]),_.useEffect(()=>{const{fp_auth_id:Q}=F;F?.event_details?.event_category==="application"&&U(Q)},[V,F?.event_details?.event_category]),_.useEffect(()=>{if(!Et(F?.event_details?.event_name)&&!Et(F?.event_details?.event_category)&&!Et(h)){const{event_name:Q,event_category:W}=F?.event_details;I(h[W][Q])}},[h]),_.useEffect(()=>{const Q=F?.event_id;if(!Q?.length||!P.current.length||F?.events?.length>0)return;const W=Q.map(q=>P.current.find(Z=>Z.id===q)).filter(Boolean);W.length&&L("properties.events",W.map(q=>({slug:`${q.event_category}/${q.event_name}/${q.event_type}/v${q.version}`})))},[h]);const Y=Q=>Et(Q)?[]:F.event_details?.event_category==="application"?Object.keys(Q.application).map(W=>({title:W,value:W})):F.event_details?.event_category==="company"?Object.keys(Q.company).map(W=>({title:W,value:W})):[],z=N("properties.version")&&!Et(R)&&R[parseFloat(N("properties.version"))]?R[parseFloat(N("properties.version"))].map(Q=>({title:Q.event_type,value:Q.id,event_name:Q.event_name,event_type:Q.event_type,event_category:Q.event_category})):[];return d.jsxs(E.Stack,{gap:2.5,children:[d.jsx(Ei,{children:d.jsx(Yt,{required:!0,name:"properties.fp_auth_id",control:k,meta:{options:yn(g),displayProps:{loading:T},displayName:"Fynd Platform Account",value:"",htmlProps:{showAddNew:!0},TESSERACT_MAIN_URL:o,FRONTEND_URL:s,ENTITY_ID:i,openIntegrationDrawer:u,addNewButtonText:"Add new account",searchFieldPlaceholder:"Search Fynd Platform account",authType:"FYND_PLATFORM",description:"Fynd Platform is a secure partner with Boltic. Your credentials are encrypted & can be removed at any time.",placeholder:"Select Fynd Platform Account"},validationRules:{required:"Fynd platform account is required"},id:r,viewOnly:l||B,handleChange:Q=>{const{value:W}=Q;W&&(p?.includes("commerce_")?D(""):D(W))}})}),F.fp_auth_id&&d.jsx(E.Divider,{}),F.fp_auth_id&&d.jsx(En,{children:d.jsxs(E.Grid,{container:!0,gap:1.5,children:[d.jsx(E.Grid,{item:!0,xs:12,children:d.jsxs(E.Grid,{container:!0,gap:1.5,children:[d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Yt,{required:!0,name:"properties.event_details.event_category",control:k,meta:{options:Zle,displayName:"Event Category",searchFieldPlaceholder:"Search",placeholder:"Select Event Category",displayProps:{loading:b}},validationRules:{required:"Event category is required"},viewOnly:l,id:r,handleChange:Q=>{const{value:W}=Q,q=W.split("_").pop();L("properties",{...F,event_details:{...F.event_details,event_category:q,event_name:""},event_id:[],events:[],application_id:[],version:[]}),I([])}})}),d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Yt,{required:!0,name:"properties.event_details.event_name",control:k,meta:{options:Y(h),displayName:"Event Name",searchFieldPlaceholder:"Search",placeholder:"Select Event Name",displayProps:{loading:b}},validationRules:{required:"Event name is required"},viewOnly:l,id:r,handleChange:Q=>{const{value:W}=Q,q=F.event_details.event_category,Z=h[q][W].versions.length;L("properties",{...F,event_id:[],events:[],application_id:[],version:h[q][W].versions[Z-1].value}),M("properties.event_details"),I(h[q][W])}})})]})}),!Et(R?.versions)&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Yt,{required:!0,name:"properties.version",control:k,meta:{options:R.versions.map(Q=>({title:Q.text,value:Q.value})),displayName:"Version",searchFieldPlaceholder:"Search",placeholder:"Select Version",displayProps:{loading:b}},validationRules:{required:"Version is required"},viewOnly:l,handleChange:Q=>{const{value:W}=Q;L("properties",{...F,event_id:[],events:[],version:W,application_id:[]})}})}),!Et(z)&&!Et(F.event_details)&&!Et(F.version)&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Yt,{required:!0,name:"properties.event_id",control:k,meta:{options:z,displayProps:{loading:b},displayName:"Events",searchFieldPlaceholder:"Search",placeholder:"Select Events"},renderFieldValue:Q=>Q.map(W=>W),validationRules:{validate:Q=>Q.length===0?"Events is required":!0},viewOnly:l,id:r,multiple:!0,placeholder:"Select Events",handleChange:Q=>{const{value:W}=Q,q=F.version,Z=W.map(ae=>{const ne=z.find(ue=>ue.value===ae);return{slug:`${ne?.event_category}/${ne?.event_name}/${ne?.event_type}/v${q}`}});L("properties.events",Z);const te=z.find(ae=>ae.value===W?.[0]);L("properties.event_details.event_type",te?.title)},getSelectedValue:Q=>Q.map(W=>z.find(q=>q.value===W)).filter(W=>W?.title)})}),F?.event_details?.event_category==="application"&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Yt,{name:"properties.application_id",control:k,meta:{options:yn(O),displayName:"Applications",searchFieldPlaceholder:"Search",displayProps:{loading:C},placeholder:"Select Applications"},validationRules:{validate:Q=>Q.length===0?"Application is required":!0},multiple:!0,renderFieldValue:Q=>Q.map(W=>W),viewOnly:l,getSelectedValue:Q=>Q.map(W=>yn(O).find(q=>q.value===W)).filter(W=>W?.title),required:!0})})]})})]})}),jBe=_.forwardRef((e,t)=>{const{VORTEX_MAIN_URL:r,ENTITY_ID:n,type:i,id:o,isLoop:s=!1,suggestionsData:a,WORKFLOW_URLS:l,viewOnly:u=!1}=e,{GYRATE_MAIN_URL:c}=l,{control:f,watch:p,setValue:h,formState:{errors:A}}=Rr(),g=p("properties");return d.jsx(En,{children:d.jsxs(E.Grid,{container:!0,gap:1.5,children:[d.jsxs(E.Grid,{item:!0,xs:12,children:[d.jsx(gn,{required:!0,label:"Input Data"}),d.jsx(Aa,{id:o,field:"input_data",type:"functionActivity",title:"Input Data",viewOnly:u,isLoop:s,hideLabel:!0,name:"properties.input_data"})]}),d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Yt,{required:!0,name:"properties.language",control:f,meta:{options:Jle,displayName:"Language",searchFieldPlaceholder:"Search language",description:_n(i,"method"),placeholder:"Select language"},handleChange:()=>{h("properties.func",'return { "hello": "world" }')},validationRules:{required:"Language is required"},viewOnly:u,id:i})}),d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(pr,{name:"properties.func",control:f,rules:{required:"Error: Function is required. Please review your function syntax."},render:({field:m})=>d.jsx(E.FormControl,{fullWidth:!0,children:d.jsx(Fi,{...m,required:!0,suggestionLabel:"Code",id:`${i}-${g.language}-func`,activityType:i,size:"xl",viewOnly:u,showSuggestions:!0,VORTEX_MAIN_URL:r,ENTITY_ID:n,language:g.language,suggestionsData:a,showExpandOption:!0,label:"Code",helperText:d.jsxs(E.Box,{children:["Need help? Refer to the",d.jsx(E.Link,{href:g.language==="python"?`${c}/integrations/Helpers/function/#python`:`${c}/integrations/Helpers/function/#javascript`,target:"_blank",children:d.jsx("span",{children:" Function Documentation "})}),"for examples, guidelines, and troubleshooting tips to write Javascript in your workflow."]}),error:!!A.properties?.func?.message,errorMsg:A.properties?.func?.message,handleChange:m.onChange})})})}),!s&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Mi,{viewOnly:u,type:i})})]})})}),$Be=Gi(jBe,""),ml=_.forwardRef(({id:e,type:t,isLoop:r=!1,viewOnly:n=!1,customSelectedTab:i,setCustomSelectedTab:o},s)=>{const{control:a,watch:l,setValue:u}=Rr(),{MCP_INTEGRATION_FORM:c}=aa(),f=l("properties.custom"),p=l("properties.custom.headers"),h=l("properties.custom.query_params"),A=l("properties.custom.state_params"),g=l("properties.custom.method");return _.useEffect(()=>{f&&(p&&!Array.isArray(p)&&typeof p=="object"&&u("properties.custom.headers",pc(p),{shouldValidate:!1,shouldDirty:!1}),h&&!Array.isArray(h)&&typeof h=="object"&&u("properties.custom.query_params",pc(h),{shouldValidate:!1,shouldDirty:!1}),A&&!Array.isArray(A)&&typeof A=="object"&&u("properties.custom.state_params",pc(A),{shouldValidate:!1,shouldDirty:!1}))},[f,p,h,A,u]),_.useEffect(()=>{if(c&&(g==="BOLTIC_AI"||g==="BOLTIC_AI_IGNORE"))return;const m=(QO||[]).map(T=>T.value),O=typeof g=="string"&&g.length?String(g).toLowerCase():"",y=O&&m.includes(O)?O:QO?.[0]?.value||"get";g!==y&&u("properties.custom.method",y,{shouldValidate:!1,shouldDirty:!1})},[g,u]),d.jsxs(d.Fragment,{children:[d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Yt,{required:!0,name:"properties.custom.method",control:a,meta:{options:QO,displayName:"Method",searchFieldPlaceholder:"Search Method",placeholder:"Select Method"},validationRules:{required:"Method is required",validate:m=>m!=null&&String(m).trim()!==""?!0:"Method is required"},viewOnly:n,id:t})}),d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(kr,{required:!0,id:e,name:"properties.custom.endpoint",control:a,meta:{displayName:"URL",placeholder:rde(t)},validationRules:{required:"URL is required"},viewOnly:n,editorId:`${t}-custom-url-${r}`,showSuggestions:!0})}),d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(ss,{variant:"full-width",tabs:xle,selectedTab:i,setSelectedTab:o})}),i==="Query Params"&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Aa,{id:e,name:"properties.custom.query_params",field:"query_params",type:t,title:"Query Params",viewOnly:n,isLoop:r})}),i==="State Params"&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Aa,{id:e,name:"properties.custom.state_params",field:"state_params",type:t,title:"State Params",viewOnly:n,isLoop:r})}),i==="Headers"&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Aa,{id:e,name:"properties.custom.headers",field:"headers",type:t,title:"Headers",viewOnly:n,isLoop:r})}),i==="Body"&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Aa,{id:e,name:"properties.custom.body",field:"body",type:t,title:"Body",viewOnly:n,isLoop:r,showKeyValuePair:!1})})]})});ml.displayName="CustomApiSection";const cg=e=>{const{control:t,name:r,label:n,placeholder:i,addNewButtonText:o,searchFieldPlaceholder:s,description:a,authType:l,options:u,isLoading:c,TESSERACT_MAIN_URL:f,FRONTEND_URL:p,ENTITY_ID:h,openIntegrationDrawer:A,viewOnly:g,isTokenRevoked:m,handleReconnect:O,handleChange:y,validationMessage:T,id:v}=e;return d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(Yt,{required:!0,name:r,control:t,renderValueUi:C=>{const x=u.find(b=>b.value===C);return d.jsx(tf,{isTokenRevoked:m,onReconnect:O,disabled:g,optionTitle:x?.title})},meta:{options:u,displayProps:{loading:c},displayName:n,value:"",htmlProps:{showAddNew:!0},TESSERACT_MAIN_URL:f,FRONTEND_URL:p,ENTITY_ID:h,openIntegrationDrawer:A,addNewButtonText:o,searchFieldPlaceholder:s,authType:l,description:a,placeholder:i},validationRules:{required:T},handleChange:y,viewOnly:g,id:v})})},ZP="FYND_AIPIM",UBe="blt-int.fynd-aipim",HBe=_.forwardRef((e,t)=>{const r=ct.useDispatch(),{control:n,watch:i,setValue:o,formState:{errors:s}}=Rr(),{ENTITY_ID:a,TESSERACT_MAIN_URL:l,FRONTEND_URL:u,type:c,id:f,isLoop:p=!1,suggestionsData:h,INTEGRATION_DATA:A,VORTEX_MAIN_URL:g,viewOnly:m=!1,openIntegrationDrawer:O}=e,{loopSuggestionsData:y={}}=ct.useSelector(D=>D.loopActivity),T=i("properties"),v=T?.operation||"",C=T?.resource||"",x=_.useMemo(()=>{if(!C)return[];const D=`${C}.`;return gue.filter($=>$.value.startsWith(D)).sort(($,U)=>$.title.localeCompare(U.title))},[C]),[b,w]=_.useState([]),[R,I]=_.useState(!1),[P,k]=_.useState("Query Params"),N=yn(b),{isTokenRevoked:L,setTokenRevoked:M,handleReconnect:B}=Al({credentialId:T?.secret||"",TESSERACT_MAIN_URL:l,FRONTEND_URL:u,ENTITY_ID:a,openIntegrationDrawer:O}),H=()=>{I(!0);const D={page_size:999,current_page:1,type:"BOTH"},$=Xt(l,`/v1/integrations/entity/${ZP}`);zt.get($,{params:D}).then(({data:U})=>{w(ro(U.data))}).catch(U=>{sr(U,r)}).finally(()=>{I(!1)})};_.useEffect(()=>{if(H(),T?.integration_slug||o("properties.integration_slug",UBe,{shouldValidate:!1}),!C&&v){const D=v.split(".")[0];D&&o("properties.resource",D,{shouldValidate:!1})}},[]),_.useEffect(()=>{A?._id&&A?.meta?.entity===ZP&&(A?.meta?.auth_status==="ACTIVE"&&M(!1),H(),o("properties.secret",A._id,{shouldValidate:!0}))},[A]);const j={VORTEX_MAIN_URL:g,ENTITY_ID:a,viewOnly:m,showSuggestions:!0,language:"json",showExpandOption:!0,suggestionsData:p?y:h},X=(D,$,U={})=>d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(kr,{required:U.required,id:f,name:`properties.${D}`,control:n,type:U.type==="number"?"number":"text",meta:{displayName:$,placeholder:U.placeholder||`Enter ${$.toLowerCase()}`,description:U.description,displayType:U.type==="number"?"number":"text"},validationRules:U.required?{required:`${$} is required`}:{},viewOnly:m,editorId:`${c}-${D}-${p}`,showSuggestions:!0,isLoop:p})},D),F=(D,$,U={})=>d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(pr,{name:`properties.${D}`,control:n,rules:U.required?{required:`${$} is required`}:{},render:({field:Y})=>d.jsx(Fi,{...Y,...j,label:$,suggestionLabel:$,id:`${c}-${D}`,activityType:c,size:"md",helperText:U.description,errorMsg:s.properties?.[D]?.message,error:!!s.properties?.[D]?.message,handleChange:z=>Y.onChange(z),required:U.required})})},D),V=(D={})=>d.jsxs(d.Fragment,{children:[X("page_no","Page Number",{type:"number",placeholder:String(D.page??1)}),X("page_size","Page Size",{type:"number",placeholder:String(D.size??50)})]}),G=()=>v?v==="products.list_external"?d.jsxs(d.Fragment,{children:[X("inbound_id","Inbound Connector ID",{required:!0,placeholder:"e.g. 64f3a2b1c8d9e10001234567"}),V()]}):v==="products.get_meta"?d.jsxs(d.Fragment,{children:[X("inbound_id","Inbound Connector ID",{required:!0,placeholder:"e.g. 64f3a2b1c8d9e10001234567"}),X("product_id","Product ID",{required:!0,placeholder:"e.g. 64f3a2b1c8d9e10001234567"})]}):v==="products.bulk_export"?d.jsxs(d.Fragment,{children:[X("inbound_id","Inbound Connector ID",{required:!0,placeholder:"e.g. 64f3a2b1c8d9e10001234567"}),d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(E.FormControl,{fullWidth:!0,children:d.jsx(Yt,{name:"properties.entity",control:n,meta:{options:Oue,displayName:"Entity Type",searchFieldPlaceholder:"Search entity",placeholder:"Select entity"},validationRules:{required:"Entity Type is required"},viewOnly:m,required:!0})})}),F("payload","Export Request",{description:"Bulk export request body."})]}):v==="templates.list"?V():v==="templates.get"||v==="templates.delete"||v==="templates.validation_schema"?X("template_id","Template ID",{required:!0,placeholder:"e.g. 64f3a2b1c8d9e10001234567"}):v==="templates.create"?F("template","Template",{required:!0,description:"Template definition (name, slug, attributes, etc.)."}):v==="templates.update"?d.jsxs(d.Fragment,{children:[X("template_id","Template ID",{required:!0,placeholder:"e.g. 64f3a2b1c8d9e10001234567"}),F("template","Template Update",{required:!0})]}):v==="attributes.list"?d.jsxs(d.Fragment,{children:[V(),X("tag","Filter by Tag",{placeholder:"e.g. apparel, electronics"})]}):v==="attributes.list_tags"?null:v==="attributes.create"?F("attribute","Attribute",{required:!0,description:"Attribute definition (name, slug, type, options, etc.)."}):v==="attributes.get"||v==="attributes.delete"?X("attribute_id","Attribute ID",{required:!0,placeholder:"e.g. 64f3a2b1c8d9e10001234567"}):v==="attributes.update"?d.jsxs(d.Fragment,{children:[X("attribute_id","Attribute ID",{required:!0,placeholder:"e.g. 64f3a2b1c8d9e10001234567"}),F("attribute","Attribute Update",{required:!0})]}):v==="categories.list"||v==="categories.list_mappings"?V():v==="categories.create"?F("category","Category",{required:!0,description:"Category definition (name, slug, parent_id, attributes, etc.)."}):v==="categories.get"||v==="categories.delete"?X("category_id","Category ID",{required:!0,placeholder:"e.g. 64f3a2b1c8d9e10001234567"}):v==="categories.update"?d.jsxs(d.Fragment,{children:[X("category_id","Category ID",{required:!0,placeholder:"e.g. 64f3a2b1c8d9e10001234567"}),F("category","Category Update",{required:!0})]}):v==="categories.create_mapping"?F("mapping","Mapping",{required:!0,description:"Category-mapping definition."}):v==="categories.get_mapping_by_code"?X("code","Mapping Code",{required:!0,placeholder:"e.g. category_apparel_main"}):v==="inbound.list"?V():v==="inbound.create"?F("connector","Connector",{required:!0,description:"Inbound connector definition."}):v==="inbound.get"||v==="inbound.delete"?X("inbound_id","Inbound ID",{required:!0,placeholder:"e.g. 64f3a2b1c8d9e10001234567"}):v==="inbound.update"?d.jsxs(d.Fragment,{children:[X("inbound_id","Inbound ID",{required:!0,placeholder:"e.g. 64f3a2b1c8d9e10001234567"}),F("connector","Connector Update",{required:!0})]}):v==="mapper.list"?V():v==="mapper.create"?F("mapper","Mapper",{required:!0,description:"Transform function definition (name, code, etc.)."}):v==="mapper.execute"?F("payload","Execution Input",{required:!0,description:"Mapper code + input data for sandbox execution."}):v==="mapper.get"||v==="mapper.delete"?X("mapper_id","Mapper ID",{required:!0,placeholder:"e.g. 64f3a2b1c8d9e10001234567"}):v==="mapper.update"?d.jsxs(d.Fragment,{children:[X("mapper_id","Mapper ID",{required:!0,placeholder:"e.g. 64f3a2b1c8d9e10001234567"}),F("mapper","Mapper Update",{required:!0})]}):v==="custom.custom_api"?d.jsx(ml,{id:f,type:c,isLoop:p,viewOnly:m,customSelectedTab:P,setCustomSelectedTab:k}):null:null;return d.jsxs(E.Stack,{gap:2.5,children:[d.jsx(Ei,{children:d.jsxs(E.Grid,{container:!0,gap:1.5,children:[d.jsx(cg,{control:n,name:"properties.secret",label:"Fynd AIPIM Account",placeholder:"Select Fynd AIPIM account",addNewButtonText:"Add new account",searchFieldPlaceholder:"Search Fynd AIPIM account",description:"Fynd AIPIM credentials are encrypted and can be removed at any time.",authType:ZP,options:N,isLoading:R,TESSERACT_MAIN_URL:l,FRONTEND_URL:u,ENTITY_ID:a,openIntegrationDrawer:O,viewOnly:m,isTokenRevoked:L,handleReconnect:B,handleChange:D=>{D.value&&M(!1)},validationMessage:"AI PIM account is required",id:c}),T?.secret&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(E.FormControl,{fullWidth:!0,children:d.jsx(Yt,{name:"properties.resource",control:n,meta:{options:mue,displayName:"Resource",searchFieldPlaceholder:"Search resource",description:"Select the AI PIM resource.",placeholder:"Select a resource"},validationRules:{required:"Resource is required"},handleChange:({value:D})=>{D!==C&&o("properties.operation","",{shouldValidate:!1})},viewOnly:m,required:!0})})}),T?.secret&&C&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(E.FormControl,{fullWidth:!0,children:d.jsx(Yt,{name:"properties.operation",control:n,meta:{options:x,displayName:"Operation",searchFieldPlaceholder:"Search operation",description:"Select the action to perform.",placeholder:"Select an operation"},validationRules:{required:"Operation is required"},viewOnly:m,required:!0})})})]})}),T?.secret&&v&&d.jsx(E.Divider,{}),T?.secret&&v&&d.jsx(En,{children:d.jsx(E.Grid,{container:!0,gap:1.5,children:G()})})]})}),VBe=Gi(HBe,""),JP="FYND_COMMERCE_B2B",GBe="blt-int.commerce-b2b",WBe=_.forwardRef((e,t)=>{const r=ct.useDispatch(),{control:n,watch:i,setValue:o,formState:{errors:s}}=Rr(),{ENTITY_ID:a,TESSERACT_MAIN_URL:l,FRONTEND_URL:u,type:c,id:f,isLoop:p=!1,suggestionsData:h,INTEGRATION_DATA:A,VORTEX_MAIN_URL:g,viewOnly:m=!1,openIntegrationDrawer:O}=e,{loopSuggestionsData:y={}}=ct.useSelector(V=>V.loopActivity),T=i("properties"),v=T?.operation||"",[C,x]=_.useState([]),[b,w]=_.useState(!1),[R,I]=_.useState("Query Params"),P=yn(C),{isTokenRevoked:k,setTokenRevoked:N,handleReconnect:L}=Al({credentialId:T?.secret||"",TESSERACT_MAIN_URL:l,FRONTEND_URL:u,ENTITY_ID:a,openIntegrationDrawer:O}),M=()=>{w(!0);const V={page_size:999,current_page:1,type:"BOTH"},G=Xt(l,`/v1/integrations/entity/${JP}`);zt.get(G,{params:V}).then(({data:D})=>{x(ro(D.data))}).catch(D=>{sr(D,r)}).finally(()=>{w(!1)})};_.useEffect(()=>{M(),T?.integration_slug||o("properties.integration_slug",GBe,{shouldValidate:!1})},[]),_.useEffect(()=>{A?._id&&A?.meta?.entity===JP&&(A?.meta?.auth_status==="ACTIVE"&&N(!1),M(),o("properties.secret",A._id,{shouldValidate:!0}))},[A]);const B={VORTEX_MAIN_URL:g,ENTITY_ID:a,viewOnly:m,showSuggestions:!0,language:"json",showExpandOption:!0,suggestionsData:p?y:h},H=(V,G,D={})=>d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(kr,{required:D.required,id:f,name:`properties.${V}`,control:n,type:D.type==="number"?"number":"text",multiline:D.multiline,meta:{displayName:G,placeholder:D.placeholder||`Enter ${G.toLowerCase()}`,description:D.description,displayType:D.type==="number"?"number":"text"},validationRules:D.required?{required:`${G} is required`}:{},viewOnly:m,editorId:`${c}-${V}-${p}`,showSuggestions:!0,isLoop:p})},V),j=(V,G,D={})=>d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(pr,{name:`properties.${V}`,control:n,rules:D.required?{required:`${G} is required`}:{},render:({field:$})=>d.jsx(Fi,{...$,...B,label:G,suggestionLabel:G,id:`${c}-${V}`,activityType:c,size:"md",helperText:D.description,errorMsg:s.properties?.[V]?.message,error:!!s.properties?.[V]?.message,handleChange:U=>$.onChange(U),required:D.required})})},V),X=()=>d.jsxs(d.Fragment,{children:[H("page_no","Page Number",{type:"number",placeholder:"1"}),H("page_size","Page Size",{type:"number",placeholder:"50"})]}),F=()=>{if(!v)return null;const V=[{title:"True",value:"true"},{title:"False",value:"false"}],G=[{title:"Pending",value:"pending"},{title:"In Progress",value:"inprogress"},{title:"Success",value:"success"},{title:"Failed",value:"failed"},{title:"Validating",value:"validating"},{title:"Syncing",value:"syncing"}],D=[{title:"Submitted",value:"submitted"},{title:"Approved",value:"approved"},{title:"Rejected",value:"rejected"},{title:"Renegotiated by Seller",value:"renegotiated_by_seller"}],$=(U,Y,z,Q)=>d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(E.FormControl,{fullWidth:!0,children:d.jsx(Yt,{name:`properties.${U}`,control:n,meta:{options:z,displayName:Y,placeholder:`Select ${Y.toLowerCase()}`,description:Q},viewOnly:m})})},U);if(v==="best_price.list")return d.jsxs(d.Fragment,{children:[j("items","Items",{required:!0,description:"Array of items to fetch best prices for (item_id, slug, item_code, price.effective {min,max}, price.marked {min,max})."}),H("currency_code","Currency Code",{required:!0,placeholder:"INR"}),H("currency_symbol","Currency Symbol",{required:!0,placeholder:"₹"}),H("app_user_id","App User ID",{required:!0}),H("app_currency_code","Override App Currency Code"),H("app_country_code","Override App Country Code")]});if(v==="contract.list")return d.jsxs(d.Fragment,{children:[X(),$("is_active","Is Active",V),$("status","Status",G),$("unmask","Unmask Sensitive Fields",V,"When true, returns unmasked merchant_id / notification_email.")]});if(v==="contract.get")return d.jsxs(d.Fragment,{children:[H("contract_id","Contract ID",{required:!0,placeholder:"MongoDB ObjectId"}),$("unmask","Unmask Sensitive Fields",V)]});if(v==="contract.create"||v==="contract.update"){const U=v==="contract.update";return d.jsxs(d.Fragment,{children:[U&&H("contract_id","Contract ID",{required:!0}),H("name","Name",{required:!U,placeholder:"Contract Pricing Offer 1"}),j("store_id","Store IDs",{required:!U,description:"Array of integer store IDs the contract applies to."}),H("schedule_start","Schedule Start",{placeholder:"2026-03-17T11:00:00.000Z",required:!U}),H("schedule_end","Schedule End",{placeholder:"2026-03-18T11:00:00.000Z",required:!U}),H("uploaded_file_url","Uploaded File URL",{required:!U}),j("notification_email","Notification Emails",{description:"Array of emails to notify on frequency thresholds."}),j("notification_frequency","Notification Frequency (days)",{description:"Array of integer day intervals at which notification emails are sent."}),$("is_active","Is Active",V)]})}if(v==="contract.delete"||v==="contract.sync")return H("contract_id","Contract ID",{required:!0});if(v==="ladder.list")return d.jsxs(d.Fragment,{children:[X(),$("is_active","Is Active",V),$("status","Status",G)]});if(v==="ladder.get"||v==="ladder.delete"||v==="ladder.sync")return H("ladder_id","Ladder ID",{required:!0});if(v==="ladder.create"||v==="ladder.update"){const U=v==="ladder.update";return d.jsxs(d.Fragment,{children:[U&&H("ladder_id","Ladder ID",{required:!0}),H("name","Name",{required:!U,placeholder:"Testing Ladder"}),j("store_id","Store IDs",{required:!U,description:"Array of integer store IDs."}),j("store_name_code","Store Name Code",{description:'Map of store ID (string) → display name. e.g. { "137595": "Bangalore" }'}),H("schedule_start","Schedule Start",{placeholder:"2026-03-30T16:24:00.000Z",required:!U}),H("schedule_end","Schedule End",{placeholder:"2026-03-31T16:24:00.000Z",required:!U}),H("uploaded_file_url","Uploaded File URL",{required:!U}),$("is_active","Is Active",V)]})}return v==="quotation.list"?d.jsxs(d.Fragment,{children:[X(),$("status","Status",D),H("from_date","From Date",{description:"ISO 8601 timestamp."}),H("to_date","To Date",{description:"ISO 8601 timestamp."}),$("unmask","Unmask Sensitive Fields",V,"When true, returns unmasked user.email / user.phone.")]}):v==="quotation.get"?d.jsxs(d.Fragment,{children:[H("quote_request_id","Quote Request ID",{required:!0}),$("unmask","Unmask Sensitive Fields",V)]}):v==="quotation.approve"?d.jsxs(d.Fragment,{children:[H("quote_request_id","Quote Request ID",{required:!0}),j("quotes","Quotes",{description:"Per-line approval payload — each item carries final/seller_quoted prices."}),j("notes","Notes")]}):v==="quotation.reject"?d.jsxs(d.Fragment,{children:[H("quote_request_id","Quote Request ID",{required:!0}),H("reason","Rejection Reason",{required:!0,multiline:!0}),j("notes","Notes")]}):v==="quotation.renegotiate"?d.jsxs(d.Fragment,{children:[H("quote_request_id","Quote Request ID",{required:!0}),j("quotes","Renegotiated Quotes",{required:!0,description:"Per-line renegotiated prices."}),H("due_date","Due Date",{placeholder:"2025-01-20"}),j("notes","Notes")]}):v==="quotation.add_note"?d.jsxs(d.Fragment,{children:[H("quote_request_id","Quote Request ID",{required:!0}),H("text","Note Text",{required:!0,multiline:!0})]}):v==="custom.custom_api"?d.jsx(ml,{id:f,type:c,isLoop:p,viewOnly:m,customSelectedTab:R,setCustomSelectedTab:I}):null};return d.jsxs(E.Stack,{gap:2.5,children:[d.jsx(Ei,{children:d.jsxs(E.Grid,{container:!0,gap:1.5,children:[d.jsx(cg,{control:n,name:"properties.secret",label:"Fynd Commerce B2B Account",placeholder:"Select Fynd Commerce B2B account",addNewButtonText:"Add new account",searchFieldPlaceholder:"Search Fynd Commerce B2B account",description:"Fynd Commerce B2B credentials are encrypted and can be removed at any time.",authType:JP,options:P,isLoading:b,TESSERACT_MAIN_URL:l,FRONTEND_URL:u,ENTITY_ID:a,openIntegrationDrawer:O,viewOnly:m,isTokenRevoked:k,handleReconnect:L,handleChange:V=>{V.value&&N(!1)},validationMessage:"Commerce B2B account is required",id:c}),T?.secret&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(E.FormControl,{fullWidth:!0,children:d.jsx(Yt,{name:"properties.operation",control:n,meta:{options:Eue,displayName:"Operation",searchFieldPlaceholder:"Search operation",description:"Select the Commerce B2B resource and action to perform.",placeholder:"Select an operation"},validationRules:{required:"Operation is required"},viewOnly:m,required:!0})})})]})}),T?.secret&&v&&d.jsx(E.Divider,{}),T?.secret&&v&&d.jsx(En,{children:d.jsx(E.Grid,{container:!0,gap:1.5,children:F()})})]})}),QBe=Gi(WBe,""),$s=e=>{const{name:t,label:r,description:n,addItemLabel:i,itemLabel:o,newItem:s,renderItem:a,minItems:l=0,viewOnly:u=!1}=e,c=E.useTheme(),{control:f}=Rr(),{fields:p,append:h,remove:A}=KAe({control:f,name:t});return d.jsxs(E.Stack,{gap:1.25,sx:{width:"100%"},children:[d.jsxs(E.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[d.jsx(gn,{label:r,description:n}),!u&&d.jsx(E.IconButton,{onClick:()=>h(s()),sx:{p:.75,border:`1px solid ${c.palette.grey.brainstem}`,fontSize:c.typography.mdNormal.fontSize},color:"primary","aria-label":i||`Add ${r}`,children:d.jsx(Ue,{src:"ic_plus",sx:{path:{fill:c.palette.primary.main}}})})]}),p.length===0&&d.jsx(E.Typography,{variant:"body2",color:"text.secondary",children:"No items yet — click + to add one."}),p.map((g,m)=>d.jsxs(E.Box,{sx:{border:`1px solid ${c.palette.grey.brainstem}`,borderRadius:1,p:1.5},children:[d.jsxs(E.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",mb:1,children:[d.jsx(E.Typography,{variant:"subtitle2",children:o?.(m)||`${r.replace(/s$/,"")} ${m+1}`}),!u&&p.length>l&&d.jsx(E.Button,{size:"small",color:"error",onClick:()=>A(m),"aria-label":`Remove item ${m+1}`,children:"Remove"})]}),d.jsx(E.Grid,{container:!0,gap:1.5,children:a(m)})]},g.id)),!u&&p.length>0&&d.jsxs(E.Button,{onClick:()=>h(s()),variant:"outlined",size:"small",sx:{alignSelf:"flex-start"},children:["+ ",i||`Add ${r.replace(/s$/,"")}`]})]})},eN="FYND_ENGAGE",zBe="blt-int.engage",XBe=_.forwardRef((e,t)=>{const r=ct.useDispatch(),{control:n,watch:i,setValue:o,formState:{errors:s}}=Rr(),{ENTITY_ID:a,TESSERACT_MAIN_URL:l,FRONTEND_URL:u,type:c,id:f,isLoop:p=!1,suggestionsData:h,INTEGRATION_DATA:A,VORTEX_MAIN_URL:g,viewOnly:m=!1,openIntegrationDrawer:O}=e,{loopSuggestionsData:y={}}=ct.useSelector(V=>V.loopActivity),T=i("properties"),v=T?.operation||"",[C,x]=_.useState([]),[b,w]=_.useState(!1),[R,I]=_.useState("Query Params"),P=yn(C),{isTokenRevoked:k,setTokenRevoked:N,handleReconnect:L}=Al({credentialId:T?.secret||"",TESSERACT_MAIN_URL:l,FRONTEND_URL:u,ENTITY_ID:a,openIntegrationDrawer:O}),M=()=>{w(!0);const V={page_size:999,current_page:1,type:"BOTH"},G=Xt(l,`/v1/integrations/entity/${eN}`);zt.get(G,{params:V}).then(({data:D})=>{x(ro(D.data))}).catch(D=>{sr(D,r)}).finally(()=>{w(!1)})};_.useEffect(()=>{M(),T?.integration_slug||o("properties.integration_slug",zBe,{shouldValidate:!1})},[]),_.useEffect(()=>{A?._id&&A?.meta?.entity===eN&&(A?.meta?.auth_status==="ACTIVE"&&N(!1),M(),o("properties.secret",A._id,{shouldValidate:!0}))},[A]);const B={VORTEX_MAIN_URL:g,ENTITY_ID:a,viewOnly:m,showSuggestions:!0,language:"json",showExpandOption:!0,suggestionsData:p?y:h},H=(V,G,D={})=>d.jsx(E.Grid,{item:!0,xs:D.xs??12,children:d.jsx(kr,{required:D.required,id:f,name:V,control:n,type:D.type==="number"?"number":"text",meta:{displayName:G,placeholder:D.placeholder||`Enter ${G.toLowerCase()}`,description:D.description,displayType:D.type==="number"?"number":"text"},validationRules:D.required?{required:`${G} is required`}:{},viewOnly:m,editorId:`${c}-${V}-${p}`,showSuggestions:!0,isLoop:p})},V),j=(V,G,D={})=>H(`properties.${V}`,G,D),X=(V,G,D={})=>d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(pr,{name:`properties.${V}`,control:n,rules:D.required?{required:`${G} is required`}:{},render:({field:$})=>d.jsx(Fi,{...$,...B,label:G,suggestionLabel:G,id:`${c}-${V}`,activityType:c,size:"md",helperText:D.description,errorMsg:s.properties?.[V]?.message,error:!!s.properties?.[V]?.message,handleChange:U=>$.onChange(U),required:D.required})})},V),F=()=>{if(!v)return null;if(v==="users.create")return d.jsxs(d.Fragment,{children:[j("external_id","External ID",{required:!0,description:"Your internal user identifier."}),j("name","Name"),j("email","Email"),j("phone","Phone",{placeholder:"+91XXXXXXXXXX"}),j("gender","Gender",{placeholder:"male / female / other"}),j("date_of_birth","Date of Birth",{placeholder:"YYYY-MM-DD"}),X("custom_attributes","Custom Attributes",{description:"Free-form JSON object for additional profile attributes."})]});if(v==="users.get"||v==="users.delete"||v==="users.tier_status"||v==="users.tier_journey")return j("user_id","User ID",{required:!0});if(v==="users.update")return d.jsxs(d.Fragment,{children:[j("user_id","User ID",{required:!0}),j("name","Name"),j("email","Email"),j("phone","Phone",{placeholder:"+91XXXXXXXXXX"}),j("gender","Gender",{placeholder:"male / female / other"}),j("date_of_birth","Date of Birth",{placeholder:"YYYY-MM-DD"}),X("custom_attributes","Custom Attributes",{description:"Free-form JSON object for additional profile attributes."})]});if(v==="users.points_history")return d.jsxs(d.Fragment,{children:[j("user_id","User ID",{required:!0}),j("page","Page",{type:"number",placeholder:"1"}),j("limit","Limit",{type:"number",placeholder:"50"})]});if(v==="users.apply_referral")return d.jsxs(d.Fragment,{children:[j("user_id","User ID",{required:!0}),j("referral_code","Referral Code",{required:!0})]});if(v==="tiers.list")return null;if(v==="tiers.get")return j("tier_id","Tier ID",{required:!0});if(v==="wallet.balance")return j("user_id","User ID",{required:!0});if(v==="wallet.transfer")return d.jsxs(d.Fragment,{children:[j("user_id","From User ID",{required:!0}),j("to_user_id","To User ID",{required:!0}),j("points","Points",{required:!0,type:"number"}),j("reason","Reason")]});if(v==="wallet.add_points")return d.jsxs(d.Fragment,{children:[j("user_id","User ID",{required:!0}),j("points","Points to Credit",{required:!0,type:"number"}),j("reason","Reason"),X("metadata","Metadata")]});if(v==="wallet.redeem_points")return d.jsxs(d.Fragment,{children:[j("user_id","User ID",{required:!0}),j("points","Points to Redeem",{required:!0,type:"number"}),j("reason","Reason")]});if(v==="events.publish")return d.jsxs(d.Fragment,{children:[j("event_name","Event Name",{required:!0}),j("user_id","User ID",{required:!0}),X("properties","Event Properties")]});const V=G=>d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx($s,{name:G,label:"Items",description:"Items in the order — one row per SKU.",addItemLabel:"Add item",itemLabel:D=>`Item ${D+1}`,newItem:()=>({item_id:"",sku_code:"",ean_identifier:"",article_id:"",quantity:"",amount:"",currency:"",return_period:""}),viewOnly:m,renderItem:D=>d.jsxs(d.Fragment,{children:[H(`${G}.${D}.item_id`,"Item ID",{required:!0,xs:6}),H(`${G}.${D}.sku_code`,"SKU Code",{xs:6}),H(`${G}.${D}.ean_identifier`,"EAN Identifier",{xs:6}),H(`${G}.${D}.article_id`,"Article ID",{xs:6}),H(`${G}.${D}.quantity`,"Quantity",{required:!0,type:"number",xs:4}),H(`${G}.${D}.amount`,"Amount",{required:!0,type:"number",xs:4}),H(`${G}.${D}.currency`,"Currency",{placeholder:"INR",xs:4}),H(`${G}.${D}.return_period`,"Return Period (days)",{type:"number"})]})})});if(v==="orders.create"||v==="orders.update"||v==="orders.calculate_loyalty"){const G=v==="orders.update";return d.jsxs(d.Fragment,{children:[j("order.transaction_id","Transaction ID",{required:!G,placeholder:"TXN-1"}),j("order.cart_id","Cart ID",{required:!G}),j("order.phoneNumber","Phone Number",{placeholder:"+91XXXXXXXXXX"}),j("order.order_amount","Order Amount",{required:!G,type:"number"}),j("order.currency","Currency",{placeholder:"INR",required:!G}),V("properties.order.items")]})}return v==="orders.get"?j("transaction_id","Transaction ID",{required:!0}):v==="orders.return"?d.jsxs(d.Fragment,{children:[j("return_payload.transaction_id","Transaction ID",{required:!0}),j("return_payload.trace_id","Trace ID"),j("return_payload.is_partial_refund_allowed","Allow Partial Refund",{placeholder:"true / false"}),d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx($s,{name:"properties.return_payload.return_items",label:"Return Items",addItemLabel:"Add return item",itemLabel:G=>`Return Item ${G+1}`,newItem:()=>({item_id:"",quantity:""}),viewOnly:m,renderItem:G=>d.jsxs(d.Fragment,{children:[H(`properties.return_payload.return_items.${G}.item_id`,"Item ID",{required:!0,xs:6}),H(`properties.return_payload.return_items.${G}.quantity`,"Quantity",{required:!0,type:"number",xs:6})]})})}),j("return_payload.meta.cart_id","Meta — Cart ID"),j("return_payload.meta.order_id","Meta — Order ID")]}):v==="orders.apply_discount"?d.jsxs(d.Fragment,{children:[j("payload.cart_id","Cart ID",{required:!0}),j("payload.phoneNumber","Phone Number"),j("payload.order_amount","Order Amount",{required:!0,type:"number"}),j("payload.currency","Currency",{placeholder:"INR"}),V("properties.payload.items")]}):v==="orders.award_points"?d.jsxs(d.Fragment,{children:[j("payload.transaction_id","Transaction ID",{required:!0}),j("payload.cart_id","Cart ID",{required:!0}),j("payload.order_amount","Order Amount",{required:!0,type:"number"}),j("payload.currency","Currency",{placeholder:"INR"}),V("properties.payload.items")]}):v==="orders.discount_rules"?X("filters","Filters"):v==="custom.custom_api"?d.jsx(ml,{id:f,type:c,isLoop:p,viewOnly:m,customSelectedTab:R,setCustomSelectedTab:I}):null};return d.jsxs(E.Stack,{gap:2.5,children:[d.jsx(Ei,{children:d.jsxs(E.Grid,{container:!0,gap:1.5,children:[d.jsx(cg,{control:n,name:"properties.secret",label:"Fynd Engage Account",placeholder:"Select Fynd Engage account",addNewButtonText:"Add new account",searchFieldPlaceholder:"Search Fynd Engage account",description:"Fynd Engage credentials are encrypted and can be removed at any time.",authType:eN,options:P,isLoading:b,TESSERACT_MAIN_URL:l,FRONTEND_URL:u,ENTITY_ID:a,openIntegrationDrawer:O,viewOnly:m,isTokenRevoked:k,handleReconnect:L,handleChange:V=>{V.value&&N(!1)},validationMessage:"Engage account is required",id:c}),T?.secret&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(E.FormControl,{fullWidth:!0,children:d.jsx(Yt,{name:"properties.operation",control:n,meta:{options:Aue,displayName:"Operation",searchFieldPlaceholder:"Search operation",description:"Select the Engage resource and action to perform.",placeholder:"Select an operation"},validationRules:{required:"Operation is required"},viewOnly:m,required:!0})})})]})}),T?.secret&&v&&d.jsx(E.Divider,{}),T?.secret&&v&&d.jsx(En,{children:d.jsx(E.Grid,{container:!0,gap:1.5,children:F()})})]})}),qBe=Gi(XBe,""),tN="FYND_KONNECT",YBe="blt-int.konnect",KBe=_.forwardRef((e,t)=>{const r=ct.useDispatch(),{control:n,watch:i,setValue:o,formState:{errors:s}}=Rr(),{ENTITY_ID:a,TESSERACT_MAIN_URL:l,FRONTEND_URL:u,type:c,id:f,isLoop:p=!1,suggestionsData:h,INTEGRATION_DATA:A,VORTEX_MAIN_URL:g,viewOnly:m=!1,openIntegrationDrawer:O}=e,{loopSuggestionsData:y={}}=ct.useSelector(F=>F.loopActivity),T=i("properties"),v=T?.operation||"",[C,x]=_.useState([]),[b,w]=_.useState(!1),[R,I]=_.useState("Query Params"),P=yn(C),{isTokenRevoked:k,setTokenRevoked:N,handleReconnect:L}=Al({credentialId:T?.secret||"",TESSERACT_MAIN_URL:l,FRONTEND_URL:u,ENTITY_ID:a,openIntegrationDrawer:O}),M=()=>{w(!0);const F={page_size:999,current_page:1,type:"BOTH"},V=Xt(l,`/v1/integrations/entity/${tN}`);zt.get(V,{params:F}).then(({data:G})=>{x(ro(G.data))}).catch(G=>{sr(G,r)}).finally(()=>{w(!1)})};_.useEffect(()=>{M(),T?.integration_slug||o("properties.integration_slug",YBe,{shouldValidate:!1})},[]),_.useEffect(()=>{A?._id&&A?.meta?.entity===tN&&(A?.meta?.auth_status==="ACTIVE"&&N(!1),M(),o("properties.secret",A._id,{shouldValidate:!0}))},[A]);const B={VORTEX_MAIN_URL:g,ENTITY_ID:a,viewOnly:m,showSuggestions:!0,language:"json",showExpandOption:!0,suggestionsData:p?y:h},H=(F,V,G={})=>d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(kr,{required:G.required,id:f,name:`properties.${F}`,control:n,type:G.type==="number"?"number":"text",meta:{displayName:V,placeholder:G.placeholder||`Enter ${V.toLowerCase()}`,description:G.description,displayType:G.type==="number"?"number":"text"},validationRules:G.required?{required:`${V} is required`}:{},viewOnly:m,editorId:`${c}-${F}-${p}`,showSuggestions:!0,isLoop:p})},F),j=(F,V,G={})=>d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(pr,{name:`properties.${F}`,control:n,rules:G.required?{required:`${V} is required`}:{},render:({field:D})=>d.jsx(Fi,{...D,...B,label:V,suggestionLabel:V,id:`${c}-${F}`,activityType:c,size:"md",helperText:G.description,errorMsg:s.properties?.[F]?.message,error:!!s.properties?.[F]?.message,handleChange:$=>D.onChange($),required:G.required})})},F),X=()=>{if(!v)return null;switch(v){case"catalog.list_departments":case"catalog.list_brands":return d.jsxs(d.Fragment,{children:[H("page_no","Page Number",{type:"number",placeholder:"1"}),H("page_size","Page Size",{type:"number",placeholder:"50"})]});case"catalog.list_categories":return d.jsxs(d.Fragment,{children:[H("department_id","Department ID",{description:"Filter categories by department."}),H("page_no","Page Number",{type:"number",placeholder:"1"}),H("page_size","Page Size",{type:"number",placeholder:"50"})]});case"catalog.list_attributes":case"catalog.list_hscodes":return null;case"catalog.list_templates":return d.jsxs(d.Fragment,{children:[H("department","Department"),H("page_no","Page Number",{type:"number",placeholder:"1"}),H("page_size","Page Size",{type:"number",placeholder:"50"})]});case"catalog.list_tax_rules":return d.jsxs(d.Fragment,{children:[H("status","Status"),H("version_status","Version Status"),H("rule_name","Rule Name"),H("page_no","Page Number",{type:"number",placeholder:"1"}),H("page_size","Page Size",{type:"number",placeholder:"50"})]});case"listings.count":return null;case"products.get":return d.jsxs(d.Fragment,{children:[H("name","Product Name"),H("slug","Slug"),H("item_code","Item Code(s)",{description:"Comma-separated list of item codes."}),H("sort_on","Sort On"),H("page_no","Page Number",{type:"number",placeholder:"1"}),H("page_size","Page Size",{type:"number",placeholder:"50"})]});case"products.check_status":return H("trace_id","Trace ID",{required:!0,description:"Trace ID returned by a previous create / update / delete call."});case"products.create":return j("products","Products",{required:!0,description:"Bulk product payload (max 500 records)."});case"products.update":return j("products","Products",{required:!0,description:"Bulk product update payload (max 500 records)."});case"products.delete":return j("products","Products",{required:!0,description:"Bulk product delete payload identifying products to remove."});case"inventory.update":return j("inventory","Inventory Records",{required:!0,description:"Bulk inventory payload (max 500 records). Each record specifies SKU, location, and stock count."});case"pricing.update":return j("pricing","Pricing Records",{required:!0,description:"Bulk pricing payload (max 500 records). Each record sets MRP / ESP per SKU per location."});case"listings.list":return d.jsxs(d.Fragment,{children:[H("page_no","Page Number",{type:"number",placeholder:"1"}),H("page_size","Page Size",{type:"number",placeholder:"50"}),H("from_date","From Date",{description:"ISO 8601 timestamp."}),H("to_date","To Date",{description:"ISO 8601 timestamp."}),H("sku","SKU Filter")]});case"orders.list":return d.jsxs(d.Fragment,{children:[H("page_no","Page Number",{type:"number",placeholder:"1"}),H("page_size","Page Size",{type:"number",placeholder:"20"}),H("status","Status"),H("from_date","From Date",{description:"ISO 8601 timestamp."}),H("to_date","To Date",{description:"ISO 8601 timestamp."})]});case"orders.info":return H("shipment_id","Shipment ID",{required:!0});case"orders.cancel":return j("shipments","Shipments",{required:!0,description:"Cancellation payload (max 20 shipments)."});case"orders.confirm":return j("shipments","Shipments",{required:!0});case"orders.pack":return j("shipments","Shipments",{required:!0});case"orders.update_awb":return j("shipments","AWB Updates",{required:!0,description:"AWB / courier update payload."});case"orders.invoice_update":return j("invoices","Invoice Updates",{required:!0});case"orders.dispatch":return j("shipments","Shipments",{required:!0,description:"Shipments to mark as dispatched (max 20)."});case"orders.fetch_invoice":return j("shipments","Shipments",{required:!0,description:"Shipments to fetch customer invoices for (max 20)."});case"orders.shipping_labels":return j("shipments","Shipments",{required:!0,description:"Shipments to generate shipping labels for (max 20)."});case"orders.courier_details":return j("shipments","Shipments",{required:!0,description:"Shipments to fetch courier details for (max 20)."});case"orders.update_status":return j("shipments","Shipment Status Updates",{required:!0,description:"Shipment status update payload (max 20)."});case"orders.track":return d.jsxs(d.Fragment,{children:[H("awb_number","AWB Number"),H("shipment_id","Shipment ID")]});case"returns.create":return j("returns","Returns",{required:!0,description:"Returns / RTO payload (max 20 records)."});case"custom.custom_api":return d.jsx(ml,{id:f,type:c,isLoop:p,viewOnly:m,customSelectedTab:R,setCustomSelectedTab:I});default:return null}};return d.jsxs(E.Stack,{gap:2.5,children:[d.jsx(Ei,{children:d.jsxs(E.Grid,{container:!0,gap:1.5,children:[d.jsx(cg,{control:n,name:"properties.secret",label:"Fynd Konnect Account",placeholder:"Select Fynd Konnect account",addNewButtonText:"Add new account",searchFieldPlaceholder:"Search Konnect account",description:"Fynd Konnect credentials are encrypted and can be removed at any time.",authType:tN,options:P,isLoading:b,TESSERACT_MAIN_URL:l,FRONTEND_URL:u,ENTITY_ID:a,openIntegrationDrawer:O,viewOnly:m,isTokenRevoked:k,handleReconnect:L,handleChange:F=>{F.value&&N(!1)},validationMessage:"Konnect account is required",id:c}),T?.secret&&d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(E.FormControl,{fullWidth:!0,children:d.jsx(Yt,{name:"properties.operation",control:n,meta:{options:hue,displayName:"Operation",searchFieldPlaceholder:"Search operation",description:"Select the Konnect resource and action to perform.",placeholder:"Select an operation"},validationRules:{required:"Operation is required"},viewOnly:m,required:!0})})})]})}),T?.secret&&v&&d.jsx(E.Divider,{}),T?.secret&&v&&d.jsx(En,{children:d.jsx(E.Grid,{container:!0,gap:1.5,children:X()})})]})}),ZBe=Gi(KBe,""),rN="FYND_TMS",JBe="blt-int.fynd-tms",e7e=_.forwardRef((e,t)=>{const r=ct.useDispatch(),{control:n,watch:i,setValue:o,formState:{errors:s}}=Rr(),{ENTITY_ID:a,TESSERACT_MAIN_URL:l,FRONTEND_URL:u,type:c,id:f,isLoop:p=!1,suggestionsData:h,INTEGRATION_DATA:A,VORTEX_MAIN_URL:g,viewOnly:m=!1,openIntegrationDrawer:O}=e,{loopSuggestionsData:y={}}=ct.useSelector(D=>D.loopActivity),T=i("properties"),v=T?.operation||"",[C,x]=_.useState([]),[b,w]=_.useState(!1),[R,I]=_.useState("Query Params"),P=yn(C),{isTokenRevoked:k,setTokenRevoked:N,handleReconnect:L}=Al({credentialId:T?.secret||"",TESSERACT_MAIN_URL:l,FRONTEND_URL:u,ENTITY_ID:a,openIntegrationDrawer:O}),M=()=>{w(!0);const D={page_size:999,current_page:1,type:"BOTH"},$=Xt(l,`/v1/integrations/entity/${rN}`);zt.get($,{params:D}).then(({data:U})=>{x(ro(U.data))}).catch(U=>{sr(U,r)}).finally(()=>{w(!1)})};_.useEffect(()=>{M(),T?.integration_slug||o("properties.integration_slug",JBe,{shouldValidate:!1})},[]),_.useEffect(()=>{A?._id&&A?.meta?.entity===rN&&(A?.meta?.auth_status==="ACTIVE"&&N(!1),M(),o("properties.secret",A._id,{shouldValidate:!0}))},[A]);const B={VORTEX_MAIN_URL:g,ENTITY_ID:a,viewOnly:m,showSuggestions:!0,language:"json",showExpandOption:!0,suggestionsData:p?y:h},H=(D,$,U={})=>d.jsx(E.Grid,{item:!0,xs:U.xs??12,children:d.jsx(kr,{required:U.required,id:f,name:D,control:n,type:U.type==="number"?"number":"text",meta:{displayName:$,placeholder:U.placeholder||`Enter ${$.toLowerCase()}`,description:U.description,displayType:U.type==="number"?"number":"text"},validationRules:U.required?{required:`${$} is required`}:{},viewOnly:m,editorId:`${c}-${D}-${p}`,showSuggestions:!0,isLoop:p})},D),j=(D,$,U={})=>H(`properties.${D}`,$,U),X=(D,$,U={})=>d.jsx(E.Grid,{item:!0,xs:U.xs??12,children:d.jsx(pr,{name:D,control:n,rules:U.required?{required:`${$} is required`}:{},render:({field:Y})=>d.jsx(Fi,{...Y,...B,label:$,suggestionLabel:$,id:`${c}-${D}`,activityType:c,size:"md",helperText:U.description,placeholder:U.placeholder,handleChange:z=>Y.onChange(z),required:U.required})})},D),F=(D,$,U={})=>d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx(pr,{name:`properties.${D}`,control:n,rules:U.required?{required:`${$} is required`}:{},render:({field:Y})=>d.jsx(Fi,{...Y,...B,label:$,suggestionLabel:$,id:`${c}-${D}`,activityType:c,size:"md",helperText:U.description,errorMsg:s.properties?.[D]?.message,error:!!s.properties?.[D]?.message,handleChange:z=>Y.onChange(z),required:U.required})})},D),V=()=>d.jsxs(d.Fragment,{children:[j("page","Page",{type:"number",placeholder:"1"}),j("size","Page Size",{type:"number",placeholder:"20"})]}),G=()=>v?v==="shipments.list"?d.jsxs(d.Fragment,{children:[V(),j("awb_number","AWB Numbers (comma separated)"),j("reference_id","Reference IDs"),j("order_id","Order IDs"),j("status_code","Status Codes"),j("created_from","Created From",{description:"ISO 8601 timestamp."}),j("created_to","Created To",{description:"ISO 8601 timestamp."}),j("pickup_serviceability_code","Pickup Serviceability Code"),j("drop_serviceability_code","Drop Serviceability Code"),j("dispatch_strategy","Dispatch Strategy"),j("hub_id","Hub IDs"),j("courier_identifier","Courier Identifier"),j("invoice_number","Invoice Number"),j("journey_type","Journey Type"),j("sort_field","Sort Field"),j("sort_order","Sort Order"),j("column","Columns")]}):v==="shipments.create"?d.jsxs(d.Fragment,{children:[j("identifier","Identifier",{description:"Optional batch identifier echoed back in the response."}),d.jsx(E.Grid,{item:!0,xs:12,children:d.jsx($s,{name:"properties.data",label:"Shipments",description:"One ShipmentCreatePublic item per row.",addItemLabel:"Add shipment",itemLabel:D=>`Shipment ${D+1}`,newItem:()=>({reference_id:"",courier_identifier:"",journey_type:"",mps:"",length:"",width:"",height:"",weight:"",amount_to_collect:"",pickup_location:"",drop_location:"",rto_location:"",invoice:"",payment_method:"",packages:""}),viewOnly:m,renderItem:D=>d.jsxs(d.Fragment,{children:[H(`properties.data.${D}.reference_id`,"Reference ID",{placeholder:"REF-1",xs:6}),H(`properties.data.${D}.courier_identifier`,"Courier Identifier",{placeholder:"e.g. delhivery",xs:6}),H(`properties.data.${D}.journey_type`,"Journey Type",{placeholder:"forward / return",xs:6}),H(`properties.data.${D}.mps`,"Multi-Piece Shipment (MPS)",{placeholder:"true / false",xs:6}),H(`properties.data.${D}.length`,"Length",{type:"number",xs:3}),H(`properties.data.${D}.width`,"Width",{type:"number",xs:3}),H(`properties.data.${D}.height`,"Height",{type:"number",xs:3}),H(`properties.data.${D}.weight`,"Weight",{type:"number",xs:3}),H(`properties.data.${D}.amount_to_collect`,"Amount to Collect (COD)",{type:"number",placeholder:"0"}),X(`properties.data.${D}.pickup_location`,"Pickup Location",{required:!0,description:"Address + contact object.",placeholder:`{
506
506
  "name": "Warehouse",
507
507
  "address": "...",
508
508
  "pincode": "400001",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boltic/swirl",
3
- "version": "1.0.2-sit.84",
3
+ "version": "1.0.2-sit.85",
4
4
  "description": "Visual workflow builder library for React — drag-and-drop automation with React Flow and Material-UI",
5
5
  "type": "commonjs",
6
6
  "main": "dist/swirl.umd.js",