@nocobase/plugin-workflow 1.5.0-alpha.5 → 1.5.0-beta.10
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/client/5ed8ff0f70ed5911.js +10 -0
- package/dist/client/739d458621edf81f.js +10 -0
- package/dist/client/92877729dbcede8f.js +10 -0
- package/dist/client/components/TriggerCollectionRecordSelect.d.ts +10 -0
- package/dist/client/components/index.d.ts +1 -0
- package/dist/client/constants.d.ts +1 -0
- package/dist/client/e7b9d67c6a964bec.js +10 -0
- package/dist/client/index.js +1 -1
- package/dist/client/triggers/collection.d.ts +14 -0
- package/dist/client/triggers/index.d.ts +3 -3
- package/dist/client/triggers/schedule/ScheduleModes.d.ts +167 -0
- package/dist/client/triggers/schedule/TriggerScheduleConfig.d.ts +10 -0
- package/dist/client/triggers/schedule/index.d.ts +11 -0
- package/dist/externalVersion.js +10 -10
- package/dist/locale/zh-CN.json +14 -0
- package/dist/node_modules/cron-parser/package.json +1 -1
- package/dist/node_modules/lru-cache/package.json +1 -1
- package/dist/server/Plugin.d.ts +5 -1
- package/dist/server/Plugin.js +34 -25
- package/dist/server/Processor.d.ts +4 -0
- package/dist/server/Processor.js +13 -5
- package/dist/server/actions/workflows.d.ts +5 -0
- package/dist/server/actions/workflows.js +56 -61
- package/dist/server/collections/workflows.js +2 -2
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +2 -0
- package/dist/server/repositories/WorkflowRepository.d.ts +12 -0
- package/dist/server/repositories/WorkflowRepository.js +112 -0
- package/dist/server/triggers/CollectionTrigger.d.ts +9 -1
- package/dist/server/triggers/CollectionTrigger.js +76 -57
- package/dist/server/triggers/ScheduleTrigger/DateFieldScheduleTrigger.d.ts +1 -1
- package/dist/server/triggers/ScheduleTrigger/DateFieldScheduleTrigger.js +7 -4
- package/dist/server/triggers/ScheduleTrigger/index.d.ts +2 -0
- package/dist/server/triggers/ScheduleTrigger/index.js +4 -0
- package/dist/server/triggers/index.d.ts +4 -2
- package/dist/server/triggers/index.js +4 -0
- package/package.json +3 -3
package/dist/client/index.js
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@nocobase/client"),require("@formily/react"),require("react"),require("react-i18next"),require("@nocobase/evaluators/client"),require("dayjs"),require("antd"),require("react-router-dom"),require("@ant-design/icons"),require("@formily/antd-v5"),require("@formily/shared"),require("@nocobase/utils/client"),require("@formily/core"),require("lodash"),require("@formily/reactive")):"function"==typeof define&&define.amd?define("@nocobase/plugin-workflow",["@nocobase/client","@formily/react","react","react-i18next","@nocobase/evaluators/client","dayjs","antd","react-router-dom","@ant-design/icons","@formily/antd-v5","@formily/shared","@nocobase/utils/client","@formily/core","lodash","@formily/reactive"],t):"object"==typeof exports?exports["@nocobase/plugin-workflow"]=t(require("@nocobase/client"),require("@formily/react"),require("react"),require("react-i18next"),require("@nocobase/evaluators/client"),require("dayjs"),require("antd"),require("react-router-dom"),require("@ant-design/icons"),require("@formily/antd-v5"),require("@formily/shared"),require("@nocobase/utils/client"),require("@formily/core"),require("lodash"),require("@formily/reactive")):e["@nocobase/plugin-workflow"]=t(e["@nocobase/client"],e["@formily/react"],e.react,e["react-i18next"],e["@nocobase/evaluators/client"],e.dayjs,e.antd,e["react-router-dom"],e["@ant-design/icons"],e["@formily/antd-v5"],e["@formily/shared"],e["@nocobase/utils/client"],e["@formily/core"],e.lodash,e["@formily/reactive"])}(self,function(e,t,n,r,o,i,a,l,c,u,s,f,p,d,m){return function(){var y={801:function(e,t,n){"use strict";var r=n(156),o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,l=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function u(e,t,n){var r,i={},u=null,s=null;for(r in void 0!==n&&(u=""+n),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(s=t.ref),t)a.call(t,r)&&!c.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:o,type:e,key:u,ref:s,props:i,_owner:l.current}}t.Fragment=i,t.jsx=u,t.jsxs=u},704:function(e,t,n){"use strict";e.exports=n(801)},482:function(e){"use strict";e.exports=c},632:function(e){"use strict";e.exports=u},563:function(e){"use strict";e.exports=p},505:function(e){"use strict";e.exports=t},229:function(e){"use strict";e.exports=m},875:function(e){"use strict";e.exports=s},772:function(t){"use strict";t.exports=e},47:function(e){"use strict";e.exports=o},584:function(e){"use strict";e.exports=f},721:function(e){"use strict";e.exports=a},760:function(e){"use strict";e.exports=i},467:function(e){"use strict";e.exports=d},156:function(e){"use strict";e.exports=n},238:function(e){"use strict";e.exports=r},128:function(e){"use strict";e.exports=l},527:function(e){!function(){"use strict";var t={}.hasOwnProperty;function n(){for(var e="",o=0;o<arguments.length;o++){var i=arguments[o];i&&(e=r(e,function(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return n.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var o="";for(var i in e)t.call(e,i)&&e[i]&&(o=r(o,i));return o}(i)))}return e}function r(e,t){return t?e?e+" "+t:e+t:e}e.exports?(n.default=n,e.exports=n):"function"==typeof define&&"object"==typeof define.amd&&define.amd?define("classnames",[],function(){return n}):window.classNames=n}()}},b={};function v(e){var t=b[e];if(void 0!==t)return t.exports;var n=b[e]={exports:{}};return y[e](n,n.exports,v),n.exports}v.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return v.d(t,{a:t}),t},v.d=function(e,t){for(var n in t)v.o(t,n)&&!v.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},v.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},v.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var h={};return!function(){"use strict";v.r(h),v.d(h,{JobStatusOptionsMap:function(){return ea},WorkflowVariableJSON:function(){return tg},useWorkflowAnyExecuted:function(){return rD},systemOptions:function(){return ti},useRecordTriggerWorkflowsActionProps:function(){return rP},Trigger:function(){return ng},JobStatusOptions:function(){return ei},ValueBlock:function(){return tP},WorkflowVariableInput:function(){return tb},useWorkflowVariableOptions:function(){return tf},Fieldset:function(){return tX},CollectionBlockInitializer:function(){return M},ExecutionStatusOptions:function(){return en},nodesOptions:function(){return tn},FilterDynamicComponent:function(){return tO},useNodeSavedConfig:function(){return eG},Instruction:function(){return eq},NodeDefaultView:function(){return e5},getWorkflowDetailPath:function(){return D},useWorkflowExecuted:function(){return rA},scopeOptions:function(){return to},traverseSchema:function(){return A},CalculationConfig:function(){return tQ},defaultFieldNames:function(){return tt},WorkflowVariableRawTextArea:function(){return th},useGetAriaLabelOfAddButton:function(){return el},SimpleDesigner:function(){return tE},DetailsBlockProvider:function(){return _},useStyles:function(){return eP},FlowContext:function(){return x},JobButton:function(){return eQ},NodeContext:function(){return e$},useTrigger:function(){return nj},useUpstreamScopes:function(){return eH},Node:function(){return eY},useTriggerWorkflowsActionProps:function(){return rC},BaseTypeSets:function(){return ta},triggerOptions:function(){return tr},RadioWithTooltip:function(){return tx},useGetCollectionFields:function(){return ty},RemoveButton:function(){return eK},default:function(){return ab},EXECUTION_STATUS:function(){return et},useNodeContext:function(){return eU},ExecutionStatusOptionsMap:function(){return er},JOB_STATUS:function(){return eo},ExecutionContextProvider:function(){return aa},getWorkflowExecutionsPath:function(){return T},linkNodes:function(){return P},WorkflowVariableTextArea:function(){return tv},CheckboxGroupWithTooltip:function(){return tS},calculators:function(){return t$},Branch:function(){return na},useFlowContext:function(){return j},renderEngineReference:function(){return tT},FieldsSelect:function(){return q},useAvailableUpstreams:function(){return eJ},getCollectionFieldOptions:function(){return tm}});var e,t,n,r,o,i,a,l=v("156"),c=v.n(l),u=v("505"),s=v("875"),f=v("772"),p=v("584"),d=v("128"),m=v("721");let y=(0,l.createContext)(null),b={didCatch:!1,error:null};class g extends l.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=b}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){let{error:e}=this.state;if(null!==e){for(var t,n,r=arguments.length,o=Array(r),i=0;i<r;i++)o[i]=arguments[i];null===(t=(n=this.props).onReset)||void 0===t||t.call(n,{args:o,reason:"imperative-api"}),this.setState(b)}}componentDidCatch(e,t){var n,r;null===(n=(r=this.props).onError)||void 0===n||n.call(r,e,t)}componentDidUpdate(e,t){let{didCatch:n}=this.state,{resetKeys:r}=this.props;if(n&&null!==t.error&&function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length!==t.length||e.some((e,n)=>!Object.is(e,t[n]))}(e.resetKeys,r)){var o,i;null===(o=(i=this.props).onReset)||void 0===o||o.call(i,{next:r,prev:e.resetKeys,reason:"keys"}),this.setState(b)}}render(){let{children:e,fallbackRender:t,FallbackComponent:n,fallback:r}=this.props,{didCatch:o,error:i}=this.state,a=e;if(o){let e={error:i,resetErrorBoundary:this.resetErrorBoundary};if((0,l.isValidElement)(r))a=r;else if("function"==typeof t)a=t(e);else if(n)a=(0,l.createElement)(n,e);else throw i}return(0,l.createElement)(y.Provider,{value:{didCatch:o,error:i,resetErrorBoundary:this.resetErrorBoundary}},a)}}var O=v("482"),w=v("563"),x=c().createContext({});function j(){return(0,l.useContext)(x)}var S=v("238"),E="workflow";function k(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return f.i18n.t(e,(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}({},r),n=(n={ns:E},n),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))}function C(){return(0,S.useTranslation)(E)}function P(e){var t=new Map;e.forEach(function(e){return t.set(e.id,e)});var n=!0,r=!1,o=void 0;try{for(var i,a=t.values()[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var l=i.value;l.upstreamId&&(l.upstream=t.get(l.upstreamId)),l.downstreamId&&(l.downstream=t.get(l.downstreamId))}}catch(e){r=!0,o=e}finally{try{!n&&null!=a.return&&a.return()}finally{if(r)throw o}}}function A(e,t){t(e),e.properties&&Object.keys(e.properties).forEach(function(n){A(e.properties[n],t)})}function D(e){return"/admin/workflow/workflows/".concat(e)}function T(e){return"/admin/workflow/executions/".concat(e)}function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function F(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function N(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}function R(e){var t,n,r,o=e.collection,i=e.dataPath,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){if(n=i[r],!(t.indexOf(n)>=0))Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}(e,["collection","dataPath"]),l=(0,f.useSchemaInitializer)().insert,u=(0,f.useSchemaTemplateManager)().getTemplateSchemaByMode,p=(0,f.useCollectionManager_deprecated)().getCollection,d=(0,f.useRecordCollectionDataSourceItems)("FormItem");if("string"==typeof o){var m,y,b=(m=(0,f.parseCollectionName)(o),y=2,function(e){if(Array.isArray(e))return e}(m)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(m,2)||function(e,t){if(e){if("string"==typeof e)return I(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return I(e,t)}}(m,y)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),v=b[0];r=p(b[1],v)}else r=o;function h(){var e;return e=function(e){var t,n,c,f;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(p){switch(p.label){case 0:if(!(t=e.item).template)return[3,2];return[4,u(t)];case 1:return c=p.sent(),[3,3];case 2:c=null,p.label=3;case 3:return n=c,A(f={type:"void",name:(0,s.uid)(),title:r.title,"x-decorator":"DetailsBlockProvider","x-decorator-props":{collection:o,dataPath:i},"x-component":"CardItem","x-component-props":{title:a.title},"x-designer":"SimpleDesigner",properties:{grid:{type:"void","x-component":"FormV2","x-use-component-props":"useDetailsBlockProps","x-read-pretty":!0,properties:{grid:n||{type:"void","x-component":"Grid","x-initializer":"details:configureFields",properties:{}}}}}},function(e){e["x-uid"]&&delete e["x-uid"]}),l(f),[2]}})},(h=function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){F(i,r,o,a,l,"next",e)}function l(e){F(i,r,o,a,l,"throw",e)}a(void 0)})}).apply(this,arguments)}return c().createElement(f.SchemaInitializerItem,(t=N({},a),n=(n={onClick:function(e){return h.apply(this,arguments)},items:d},n),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))}function M(e){var t,n,r,o=(0,f.useSchemaInitializerItem)(),i=null!==(t=null==e?void 0:e.collection)&&void 0!==t?t:o.collection;if("string"==typeof i){var a=(0,f.parseCollectionName)(i);n=a[0],r=a[1]}else r=i;return c().createElement(f.CollectionProvider_deprecated,{dataSource:n,collection:r},c().createElement(R,N({},o,e)))}var B=v("467");function V(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _(e){var t,n,r,o,i,a,s,p,d=e.collection,m=e.dataPath,y=e.children,b=(0,u.useField)(),v=(0,l.useRef)(null),h=(0,(0,f.useAssociationNames)().getAssociationAppends)(),g=h.appends,O=h.updateAssociationValues;var x=(t=m,r=(n=j()).execution,o=n.nodes,i=(0,l.useMemo)(function(){return o.reduce(function(e,t){return Object.assign(e,V({},t.id,t.key))},{})},[o]),a=(0,l.useMemo)(function(){var e;return{$context:null==r?void 0:r.context,$jobsMapByNodeKey:(null!==(e=null==r?void 0:r.jobs)&&void 0!==e?e:[]).reduce(function(e,t){return Object.assign(e,V({},i[t.nodeId],t.result))},{})}},[null==r?void 0:r.context,null==r?void 0:r.jobs,i]),(0,l.useMemo)(function(){return(0,B.get)(a,t)},[a,t]));if("string"==typeof d){var S=(0,f.parseCollectionName)(d);s=S[0],p=S[1]}else p=d;var E=(0,l.useMemo)(function(){return(0,w.createForm)({values:x,readPretty:!0})},[x]),k={loading:!1,data:{data:x}},C=(0,f.useAPIClient)().resource(p),P=(0,f.useBlockRequestContext)();return c().createElement(f.CollectionProvider_deprecated,{dataSource:s,collection:p},c().createElement(f.RecordProvider,{record:x,parent:null},c().createElement(f.BlockRequestContext_deprecated.Provider,{value:{block:"form",field:b,service:k,resource:C,__parent:P}},c().createElement(f.FormBlockContext.Provider,{value:{params:{appends:g},form:E,field:b,service:k,updateAssociationValues:O,formBlockRef:v}},y))))}function W(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function z(){return!0}var q=(0,u.observer)(function(e){var t,n,r,o,i=e.filter,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){if(n=i[r],!(t.indexOf(n)>=0))Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}(e,["filter"]),l=(0,f.useCompile)(),s=(0,f.useCollectionManager_deprecated)().getCollectionFields,p=(0,u.useForm)().values;var d=(t=(0,f.parseCollectionName)(null==p?void 0:p.collection),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return W(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return W(e,t)}}(t,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),y=d[0],b=s(d[1],y);return c().createElement(m.Select,(r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}({popupMatchSelectWidth:!1},a),o=(o={options:b.filter(void 0===i?z:i).map(function(e){var t;return{label:l(null===(t=e.uiSchema)||void 0===t?void 0:t.title),value:e.name}})},o),Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(o)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}),r))},{displayName:"FieldsSelect"}),L=v("229");function $(){var e,t,n=(e=["\n margin-bottom: 1.5em;\n padding: 1em;\n background-color: ",";\n\n > *:last-child {\n margin-bottom: 0;\n }\n\n dl {\n display: flex;\n align-items: baseline;\n\n dt {\n color: ",";\n &:after {\n content: ':';\n margin-right: 0.5em;\n }\n }\n }\n\n p {\n color: ",";\n }\n "],!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return $=function(){return n},n}var U=(0,f.createStyles)(function(e){var t=e.css,n=e.token;return{container:t($(),n.colorFillAlter,n.colorText,n.colorTextDescription)}});function G(e){var t=e.label,n=e.title,r=e.description,o=U().styles;return c().createElement("div",{className:(0,f.cx)(o.container,e.className)},c().createElement("dl",null,c().createElement("dt",null,t),c().createElement("dd",null,c().createElement(m.Tag,{style:{background:"none"}},n))),r?c().createElement("p",null,r):null)}var J=v("527"),H=v.n(J);function Y(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function K(){var e=Y(["\n border: none;\n .ant-tag {\n width: 100%;\n height: 100%;\n padding: 0;\n margin-right: 0;\n border-radius: 50%;\n text-align: center;\n }\n "]);return K=function(){return e},e}function Q(){var e=Y(["\n border-width: 2px;\n "]);return Q=function(){return e},e}var Z=(0,f.createStyles)(function(e){var t=e.css;return e.token,{statusButtonClass:t(K()),noStatusButtonClass:t(Q())}});function X(e){var t,n,r=e.status,o=e.statusMap,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){if(n=i[r],!(t.indexOf(n)>=0))Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}(e,["status","statusMap"]),a=Z().styles,l=null;if(void 0!==r&&(null==o?void 0:o[r])){var u=o[r],s=u.icon,f=u.color;l=c().createElement(m.Tag,{color:f},s)}return c().createElement(m.Button,(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}({},i),n=(n={shape:"circle",size:"small",className:H()(l?a.statusButtonClass:a.noStatusButtonClass,e.className)},n),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t),l)}function ee(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var et={QUEUEING:null,STARTED:0,RESOLVED:1,FAILED:-1,ERROR:-2,ABORTED:-3,CANCELED:-4,REJECTED:-5,RETRY_NEEDED:-6},en=[{value:et.QUEUEING,label:'{{t("Queueing", { ns: "'.concat(E,'" })}}'),color:"blue",icon:c().createElement(O.HourglassOutlined,null),description:'{{t("Triggered but still waiting in queue to execute.", { ns: "'.concat(E,'" })}}')},{value:et.STARTED,label:'{{t("On going", { ns: "'.concat(E,'" })}}'),color:"gold",icon:c().createElement(O.LoadingOutlined,null),description:'{{t("Started and executing, maybe waiting for an async callback (manual, delay etc.).", { ns: "'.concat(E,'" })}}')},{value:et.RESOLVED,label:'{{t("Resolved", { ns: "'.concat(E,'" })}}'),color:"green",icon:c().createElement(O.CheckOutlined,null),description:'{{t("Successfully finished.", { ns: "'.concat(E,'" })}}')},{value:et.FAILED,label:'{{t("Failed", { ns: "'.concat(E,'" })}}'),color:"red",icon:c().createElement(O.ExclamationOutlined,null),description:'{{t("Failed to satisfy node configurations.", { ns: "'.concat(E,'" })}}')},{value:et.ERROR,label:'{{t("Error", { ns: "'.concat(E,'" })}}'),color:"red",icon:c().createElement(O.CloseOutlined,null),description:'{{t("Some node meets error.", { ns: "'.concat(E,'" })}}')},{value:et.ABORTED,label:'{{t("Aborted", { ns: "'.concat(E,'" })}}'),color:"red",icon:c().createElement(O.MinusOutlined,{rotate:90}),description:'{{t("Running of some node was aborted by program flow.", { ns: "'.concat(E,'" })}}')},{value:et.CANCELED,label:'{{t("Canceled", { ns: "'.concat(E,'" })}}'),color:"volcano",icon:c().createElement(O.MinusOutlined,{rotate:45}),description:'{{t("Manually canceled whole execution when waiting.", { ns: "'.concat(E,'" })}}')},{value:et.REJECTED,label:'{{t("Rejected", { ns: "'.concat(E,'" })}}'),color:"volcano",icon:c().createElement(O.MinusOutlined,null),description:'{{t("Rejected from a manual node.", { ns: "'.concat(E,'" })}}')},{value:et.RETRY_NEEDED,label:'{{t("Retry needed", { ns: "'.concat(E,'" })}}'),color:"volcano",icon:c().createElement(O.RedoOutlined,null),description:'{{t("General failed but should do another try.", { ns: "'.concat(E,'" })}}')}],er=en.reduce(function(e,t){return Object.assign(e,ee({},t.value,t))},{}),eo={PENDING:0,RESOLVED:1,FAILED:-1,ERROR:-2,ABORTED:-3,CANCELED:-4,REJECTED:-5,RETRY_NEEDED:-6},ei=[{value:eo.PENDING,label:'{{t("Pending", { ns: "'.concat(E,'" })}}'),color:"gold",icon:c().createElement(O.ClockCircleOutlined,null)},{value:eo.RESOLVED,label:'{{t("Resolved", { ns: "'.concat(E,'" })}}'),color:"green",icon:c().createElement(O.CheckOutlined,null)},{value:eo.FAILED,label:'{{t("Failed", { ns: "'.concat(E,'" })}}'),color:"red",icon:c().createElement(O.ExclamationOutlined,null)},{value:eo.ERROR,label:'{{t("Error", { ns: "'.concat(E,'" })}}'),color:"red",icon:c().createElement(O.CloseOutlined,null)},{value:eo.ABORTED,label:'{{t("Aborted", { ns: "'.concat(E,'" })}}'),color:"red",icon:c().createElement(O.MinusOutlined,{rotate:90})},{value:eo.CANCELED,label:'{{t("Canceled", { ns: "'.concat(E,'" })}}'),color:"volcano",icon:c().createElement(O.MinusOutlined,{rotate:45})},{value:eo.REJECTED,label:'{{t("Rejected", { ns: "'.concat(E,'" })}}'),color:"volcano",icon:c().createElement(O.MinusOutlined,null)},{value:eo.RETRY_NEEDED,label:'{{t("Retry needed", { ns: "'.concat(E,'" })}}'),color:"volcano",icon:c().createElement(O.RedoOutlined,null)}],ea=ei.reduce(function(e,t){return Object.assign(e,ee({},t.value,t))},{}),el=function(e,t){return{getAriaLabel:(0,l.useCallback)(function(n){return["add-button",null==e?void 0:e.type,null==e?void 0:e.title,null!=t?String(t):"",n].filter(Boolean).join("-")},[t,null==e?void 0:e.title,null==e?void 0:e.type])}};function ec(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function eu(){var e=ec(["\n flex-grow: 1;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n\n .workflow-toolbar {\n display: flex;\n align-items: center;\n justify-content: space-between;\n position: relative;\n padding: 0.5rem 1rem;\n background: ",";\n border-bottom: 1px solid ",";\n\n header {\n display: flex;\n align-items: center;\n }\n\n aside {\n display: flex;\n align-items: center;\n gap: 0.5em;\n }\n\n .workflow-versions {\n label {\n margin-right: 0.5em;\n }\n }\n }\n\n .workflow-canvas-wrapper {\n flex-grow: 1;\n overflow: hidden;\n position: relative;\n }\n\n .workflow-canvas-zoomer {\n display: flex;\n align-items: center;\n position: absolute;\n top: 2em;\n right: 2em;\n height: 10em;\n padding: 1em 0;\n border-radius: 0.5em;\n background: ",";\n }\n\n .workflow-canvas {\n overflow: auto;\n height: 100%;\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 2em;\n\n > .ant-alert {\n margin-bottom: 2em;\n font-size: 85%;\n }\n }\n "]);return eu=function(){return e},e}function es(){var e=ec(["\n .ant-dropdown-menu-item {\n justify-content: flex-end;\n .ant-dropdown-menu-title-content {\n display: flex;\n align-items: baseline;\n justify-content: flex-end;\n text-align: right;\n\n time {\n width: 14em;\n font-size: 80%;\n }\n }\n }\n "]);return es=function(){return e},e}function ef(){var e=ec(["\n max-height: 80vh;\n overflow-y: auto;\n\n .ant-dropdown-menu-item {\n .ant-dropdown-menu-title-content {\n strong {\n font-weight: normal;\n }\n\n > .enabled {\n strong {\n font-weight: bold;\n }\n }\n\n > .unexecuted {\n strong {\n font-style: italic;\n }\n }\n }\n }\n "]);return ef=function(){return e},e}function ep(){var e=ec(["\n .ant-dropdown-menu-item {\n .id {\n flex-grow: 1;\n text-align: right;\n }\n }\n "]);return ep=function(){return e},e}function ed(){var e=ec(["\n display: flex;\n position: relative;\n margin: 2em auto auto auto;\n\n :before {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n left: calc(50% - 0.5px);\n width: 1px;\n background-color: ",";\n }\n "]);return ed=function(){return e},e}function em(){var e=ec(["\n display: flex;\n flex-direction: column;\n align-items: center;\n position: relative;\n min-width: 20em;\n padding: 0 2em;\n\n .workflow-node-list {\n flex-grow: 1;\n }\n\n .workflow-branch-lines {\n position: absolute;\n top: 0;\n bottom: 0;\n width: 1px;\n background-color: ",";\n }\n\n :before,\n :after {\n content: '';\n position: absolute;\n height: 1px;\n background-color: ",";\n }\n\n :before {\n top: 0;\n }\n\n :after {\n bottom: 0;\n }\n\n :not(:first-child):not(:last-child) {\n :before,\n :after {\n left: 0;\n width: 100%;\n }\n }\n\n :last-child:not(:first-child) {\n :before,\n :after {\n right: 50%;\n width: 50%;\n }\n }\n\n :first-child:not(:last-child) {\n :before,\n :after {\n left: 50%;\n width: 50%;\n }\n }\n\n .end-sign {\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n width: 0;\n height: 6em;\n border-left: 1px dashed ",";\n\n .anticon {\n font-size: 1.5em;\n line-height: 100%;\n }\n }\n "]);return em=function(){return e},e}function ey(){var e=ec(["\n flex-grow: 1;\n flex-shrink: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n position: relative;\n "]);return ey=function(){return e},e}function eb(){var e=ec(["\n flex-shrink: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n "]);return eb=function(){return e},e}function ev(){var e=ec(["\n position: relative;\n width: 20em;\n background: ",";\n padding: 1em;\n box-shadow: ",";\n border-radius: ","px;\n cursor: pointer;\n transition: box-shadow 0.3s ease;\n\n &:hover {\n box-shadow: ",";\n\n .workflow-node-remove-button {\n display: block;\n }\n }\n\n &.configuring {\n box-shadow: ",";\n }\n\n .workflow-node-remove-button {\n display: none;\n position: absolute;\n right: 0;\n top: 0;\n color: ",";\n\n &[disabled] {\n display: none;\n }\n\n &:hover {\n color: ",";\n }\n }\n\n .ant-input {\n font-weight: bold;\n\n &:not(:focus) {\n transition:\n background-color 0.3s ease,\n border-color 0.3s ease;\n border-color: ",";\n background-color: ",";\n\n &:not(:disabled):hover {\n border-color: ",";\n }\n\n &:disabled:hover {\n border-color: ",";\n }\n }\n }\n\n .workflow-node-config-button {\n padding: 0;\n }\n\n &:hover {\n box-shadow: 0 0.25em 0.5em rgba(0, 0, 0, 0.25);\n\n .workflow-node-remove-button {\n display: block;\n }\n }\n "]);return ev=function(){return e},e}function eh(){var e=ec(["\n display: flex;\n position: absolute;\n top: 0;\n right: 0;\n justify-content: center;\n align-items: center;\n color: ",";\n "]);return eh=function(){return e},e}function eg(){var e=ec(["\n display: flex;\n margin-bottom: 0.5em;\n\n .workflow-node-actions {\n position: relative;\n }\n "]);return eg=function(){return e},e}function eO(){var e=ec(["\n flex-grow: 1;\n\n .workflow-node-id {\n color: ",";\n\n &:before {\n content: '#';\n }\n }\n "]);return eO=function(){return e},e}function ew(){var e=ec(["\n display: flex;\n align-items: center;\n font-weight: normal;\n .workflow-node-id {\n color: ",";\n }\n "]);return ew=function(){return e},e}function ex(){var e=ec(["\n display: flex;\n flex-direction: column-reverse;\n align-items: center;\n margin: auto;\n "]);return ex=function(){return e},e}function ej(){var e=ec(["\n background-color: #f3f3f3;\n "]);return ej=function(){return e},e}function eS(){var e=ec(["\n flex-shrink: 0;\n padding: 2em 0;\n\n > .ant-btn {\n &:disabled {\n visibility: hidden;\n }\n }\n "]);return eS=function(){return e},e}function eE(){var e=ec(["\n position: relative;\n overflow: visible;\n\n > span {\n position: absolute;\n top: calc(1.5em - 1px);\n line-height: 1em;\n color: ",";\n background-color: ",";\n padding: 1px;\n }\n "]);return eE=function(){return e},e}function ek(){var e=ec(["\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n width: 2em;\n height: 6em;\n "]);return ek=function(){return e},e}function eC(){var e=ec(["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: 4em;\n height: 4em;\n border-radius: 50%;\n background-color: ",";\n color: ",";\n "]);return eC=function(){return e},e}var eP=(0,f.createStyles)(function(e){var t=e.css,n=e.token;return{workflowPageClass:t(eu(),n.colorBgContainer,n.colorBorderSecondary,n.colorBgContainer),dropdownClass:t(es()),workflowVersionDropdownClass:t(ef()),executionsDropdownRowClass:t(ep()),branchBlockClass:t(ed(),n.colorBgLayout),branchClass:t(em(),n.colorBorder,n.colorBorder,n.colorBgLayout),nodeBlockClass:t(ey()),nodeClass:t(eb()),nodeCardClass:t(ev(),n.colorBgContainer,n.boxShadowTertiary,n.borderRadiusLG,n.boxShadow,n.boxShadow,n.colorText,n.colorErrorHover,n.colorBorderBg,n.colorBgContainerDisabled,n.colorPrimaryBorderHover,n.colorBorderBg),nodeJobButtonClass:t(eh(),n.colorTextLightSolid),nodeHeaderClass:t(eg()),nodeMetaClass:t(eO(),n.colorTextDescription),nodeTitleClass:t(ew(),n.colorTextDescription),nodeSubtreeClass:t(ex()),nodeJobResultClass:t(ej()),addButtonClass:t(eS()),conditionClass:t(eE(),n.colorTextSecondary,n.colorBgLayout),loopLineClass:t(ek()),terminalClass:t(eC(),n.colorText,n.colorBgContainer)}});function eA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function eD(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function eT(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){eD(i,r,o,a,l,"next",e)}function l(e){eD(i,r,o,a,l,"throw",e)}a(void 0)})}}function eI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function eF(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eN(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){eF(e,t,n[t])})}return e}function eR(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function eM(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return eA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eA(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eB(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function eV(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}function e_(){var e=eB(["\n margin-bottom: 1em;\n "]);return e_=function(){return e},e}function eW(){var e=eB(["\n display: flex;\n justify-content: space-between;\n\n strong {\n font-weight: bold;\n }\n\n .ant-tag {\n margin-inline-end: 0;\n }\n\n code {\n font-weight: normal;\n }\n "]);return eW=function(){return e},e}function ez(){var e=eB(["\n .ant-input,\n .ant-select,\n .ant-cascader-picker,\n .ant-picker,\n .ant-input-number,\n .ant-input-affix-wrapper {\n &.auto-width {\n width: auto;\n min-width: 6em;\n }\n }\n "]);return ez=function(){return e},e}var eq=function(){var e,t,n;function r(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,r),eF(this,"title",void 0),eF(this,"type",void 0),eF(this,"group",void 0),eF(this,"description",void 0),eF(this,"options",void 0),eF(this,"fieldset",void 0),eF(this,"presetFieldset",void 0),eF(this,"branching",void 0),eF(this,"view",void 0),eF(this,"scope",void 0),eF(this,"components",void 0),eF(this,"end",void 0),eF(this,"testable",void 0)}return e=r,t=[{key:"createDefaultConfig",value:function(){return{}}}],eI(e.prototype,t),r}();function eL(){var e=(0,u.useForm)(),t=(0,f.useAPIClient)(),n=(0,f.useActionContext)(),r=(0,f.useResourceActionContext)().refresh,o=eU(),i=j().workflow;return{run:function(){return eT(function(){var a,l;return eV(this,function(c){switch(c.label){case 0:if(i.executed)return m.message.error(k("Node in executed workflow cannot be modified")),[2];return[4,e.submit()];case 1:return c.sent(),[4,null===(a=(l=t.resource("flow_nodes")).update)||void 0===a?void 0:a.call(l,{filterByTk:o.id,values:{config:e.values}})];case 2:return c.sent(),e.setInitialValues((0,L.toJS)(e.values)),n.setFormValueChanged(!1),n.setVisible(!1),r(),[2]}})})()}}}var e$=c().createContext({});function eU(){return(0,l.useContext)(e$)}function eG(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=eU();return e.some(function(e){return null!=(0,B.get)(t.config,e)})}function eJ(e,t){var n=[];if(!e)return[];for(var r=e.upstream;r;r=r.upstream)("function"!=typeof t||t(r))&&n.push(r);return n}function eH(e){var t=[];if(!e)return[];for(var n=e;n;n=n.upstream)n.upstream&&null!=n.branchIndex&&t.push(n.upstream);return t}function eY(e){var t,n=e.data,r=eP().styles,o=el(n).getAriaLabel,i=null!==(t=(0,f.usePlugin)(ab).instructions.get(n.type))&&void 0!==t?t:{},a=i.Component,l=i.end;return c().createElement(e$.Provider,{value:n},c().createElement("div",{className:(0,f.cx)(r.nodeBlockClass)},c().createElement(void 0===a?e5:a,{data:n}),l&&("function"!=typeof l||l(n))?c().createElement("div",{className:"end-sign"},c().createElement(O.CloseOutlined,null)):c().createElement(t7,{"aria-label":o(),upstream:n})))}function eK(){var e,t=(0,S.useTranslation)().t,n=(0,f.useAPIClient)(),r=null!==(e=j())&&void 0!==e?e:{},o=r.workflow,i=r.nodes,a=r.refresh,u=eU(),s=m.App.useApp().modal,d=n.resource("flow_nodes"),y=(0,l.useCallback)(eT(function(){var e;return eV(this,function(t){switch(t.label){case 0:return[4,null===(e=d.destroy)||void 0===e?void 0:e.call(d,{filterByTk:u.id})];case 1:return t.sent(),a(),[2]}})}),[u.id,a,d]),b=(0,l.useCallback)(eT(function(){var e,n;return eV(this,function(r){return(e=i.filter(function(e){return e!==u&&(0,p.parse)(e.config).parameters.filter(function(e){var t=e.key;return t.startsWith("$jobsMapByNodeKey.".concat(u.key,"."))||t==="$jobsMapByNodeKey.".concat(u.key)}).length})).length?(s.error({title:k("Can not delete"),content:k("The result of this node has been referenced by other nodes ({{nodes}}), please remove the usage before deleting.",{nodes:e.map(function(e){return"#".concat(e.id)}).join(", ")})}),[2]):(n=i.find(function(e){return e.upstream===u&&null!=e.branchIndex})?k("This node contains branches, deleting will also be preformed to them, are you sure?"):t("Are you sure you want to delete it?"),s.confirm({title:t("Delete"),content:n,onOk:y}),[2])})}),[u,s,i,y,t]);return o?o.executed?null:c().createElement(m.Button,{type:"text",shape:"circle",icon:c().createElement(O.DeleteOutlined,null),onClick:b,className:"workflow-node-remove-button",size:"small"}):null}function eQ(){var e,t=j(),n=t.execution,r=t.setViewJob,o=(null!==(e=eU())&&void 0!==e?e:{}).jobs,i=eP().styles;return n?o.length?c().createElement(m.Tooltip,{title:k("View result")},o.length>1?c().createElement(m.Dropdown,{menu:{items:o.map(function(e){return{key:e.id,label:c().createElement(c().Fragment,null,c().createElement(X,{statusMap:ea,status:e.status}),c().createElement("time",null,(0,p.str2moment)(e.updatedAt).format("YYYY-MM-DD HH:mm:ss")))}}),onClick:function(e){var t=e.key;r(o.find(function(e){return e.id==t}))},className:i.dropdownClass}},c().createElement(X,{statusMap:ea,status:o[o.length-1].status,className:i.nodeJobButtonClass})):c().createElement(X,{statusMap:ea,status:o[0].status,onClick:function(){return r(o[0])},className:i.nodeJobButtonClass})):c().createElement(X,{className:i.nodeJobButtonClass,disabled:!0}):null}function eZ(){return{form:(0,u.useForm)()}}var eX=function(){var e=(0,u.useForm)(),t=e.values,n=e.query,r=eU(),o=(0,f.useAPIClient)(),i=(0,f.useActionContext)(),a=(0,u.useField)();return{run:function(){return eT(function(){var e,l,c,u;return eV(this,function(s){switch(s.label){case 0:e=(0,p.parse)(r.config)((0,L.toJS)(t.config)),(l=n("result").take()).setValue(null),l.setFeedback({}),a.data=a.data||{},a.data.loading=!0,s.label=1;case 1:return s.trys.push([1,3,,4]),[4,o.resource("flow_nodes").test({values:{config:e,type:r.type}})];case 2:return c=s.sent().data.data,l.setFeedback({type:c.status>0?"success":"error",messages:c.status>0?[k("Resolved")]:[k("Failed")]}),l.setValue(c.result),[3,4];case 3:return u=s.sent(),l.setFeedback({type:"error",messages:u.message}),[3,4];case 4:return a.data.loading=!1,i.setFormValueChanged(!1),[2]}})})()}}},e0=(0,l.createContext)([]);function e1(e){var t=e.name,n=e.value,r=e.onChange;return c().createElement(m.Space,null,c().createElement(tb,{variableOptions:{},value:"{{".concat(t,"}}"),disabled:!0}),c().createElement(f.Variable.Input,{useTypedConstant:["string","number","boolean","date"],value:n,onChange:r}))}function e2(e){var t=e.value,n=e.onChange,r=(0,l.useContext)(e0);return r.length?c().createElement(c().Fragment,null,r.map(function(e){return c().createElement(e1,{key:e,name:e,value:(0,B.get)(t,e),onChange:function(r){(0,B.set)(t,e,r),n(t)}})})):c().createElement(m.Empty,{image:m.Empty.PRESENTED_IMAGE_SIMPLE,description:k("No variable"),style:{margin:"1em"}})}function e3(){var e=eU(),t=(0,u.useForm)().values,n=(0,p.parse)(t).parameters.map(function(e){return e.key}),r=(0,l.useMemo)(function(){return(0,w.createForm)()},[]);return c().createElement(e$.Provider,{value:{type:e.type,config:t}},c().createElement(e0.Provider,{value:n},c().createElement(f.SchemaComponent,{components:{Alert:m.Alert},scope:{useCancelAction:f.useCancelAction,useRunAction:eX},schema:{type:"void",name:"testButton",title:'{{t("Test run")}}',"x-component":"Action","x-component-props":{icon:"CaretRightOutlined"},properties:{modal:{type:"void","x-decorator":"FormV2","x-decorator-props":{form:r},"x-component":"Action.Modal",title:'{{t("Test run", { ns: "workflow" })}}',properties:{alert:{type:"void","x-component":"Alert","x-component-props":{message:'{{t("Test run will do the actual data manipulating or API calling, please use with caution.", { ns: "workflow" })}}',type:"warning",showIcon:!0,className:(0,f.css)(e_())}},config:{type:"object",title:'{{t("Replace variables", { ns: "workflow" })}}',"x-decorator":"FormItem","x-component":e2},actions:{type:"void","x-component":"ActionBar",properties:{submit:{type:"void",title:'{{t("Run")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ useRunAction }}"}}}},result:{type:"string",title:'{{t("Result", { ns: "workflow" })}}',"x-decorator":"FormItem","x-component":"Input.JSON","x-component-props":{autoSize:{minRows:5,maxRows:20},style:{whiteSpace:"pre",cursor:"text"}},"x-pattern":"disabled"},footer:{type:"void","x-component":"Action.Modal.Footer",properties:{cancel:{type:"void",title:'{{t("Close")}}',"x-component":"Action","x-component-props":{useAction:"{{ useCancelAction }}"}}}}}}}}})))}function e5(e){var t,n,r=e.data,o=e.children,i=(0,f.useCompile)(),a=(0,f.useAPIClient)(),s=null!==(n=j())&&void 0!==n?n:{},p=s.workflow,d=s.refresh,y=eP().styles,b=(0,f.usePlugin)(ab).instructions.get(r.type),v=p.executed?'{{t("View")}}':'{{t("Configure")}}',h=eM((0,l.useState)(r.title),2),g=h[0],O=h[1],x=eM((0,l.useState)(!1),2),S=x[0],E=x[1],C=eM((0,l.useState)(!1),2),P=C[0],A=C[1],D=(0,l.useMemo)(function(){var e=(0,B.cloneDeep)(r.config);return(0,w.createForm)({initialValues:e,disabled:p.executed})},[r,p]),T=(0,l.useCallback)(function(e){E(e),!e&&D.reset()},[D]);var I=(0,l.useCallback)((t=eT(function(e){var t,n,o;return eV(this,function(l){switch(l.label){case 0:if(O(o=e||i(null==b?void 0:b.title)),o===r.title)return[2];return[4,null===(t=(n=a.resource("flow_nodes")).update)||void 0===t?void 0:t.call(n,{filterByTk:r.id,values:{title:o}})];case 1:return l.sent(),d(),[2]}})}),function(e){return t.apply(this,arguments)}),[r,b]),F=(0,l.useCallback)(function(e){if(e.target===e.currentTarget){E(!0);return}for(var t=new Set(["workflow-node-meta","workflow-node-config-button","ant-input-disabled"]),n=e.target;n&&n!==e.currentTarget&&n!==document.documentElement;n=n.parentNode)if(Array.from(n.classList).some(function(e){return t.has(e)})){E(!0),e.stopPropagation();return}},[]);if(!b)return c().createElement("div",{className:(0,f.cx)(y.nodeClass,"workflow-node-type-".concat(r.type))},c().createElement(m.Tooltip,{title:k("Node with unknown type will cause error. Please delete it or check plugin which provide this type.")},c().createElement("div",{role:"button","aria-label":"_untyped-".concat(g),className:(0,f.cx)(y.nodeCardClass,"invalid")},c().createElement("div",{className:y.nodeHeaderClass},c().createElement("div",{className:(0,f.cx)(y.nodeMetaClass,"workflow-node-meta")},c().createElement(m.Tag,{color:"error"},k("Unknown node")),c().createElement("span",{className:"workflow-node-id"},r.id)),c().createElement("div",{className:"workflow-node-actions"},c().createElement(eK,null),c().createElement(eQ,null))),c().createElement(m.Input.TextArea,{value:g,disabled:!0,autoSize:!0}))));var N=i(b.title);return c().createElement("div",{className:(0,f.cx)(y.nodeClass,"workflow-node-type-".concat(r.type))},c().createElement("div",{role:"button","aria-label":"".concat(N,"-").concat(g),className:(0,f.cx)(y.nodeCardClass,{configuring:S}),onClick:F},c().createElement("div",{className:y.nodeHeaderClass},c().createElement("div",{className:(0,f.cx)(y.nodeMetaClass,"workflow-node-meta")},c().createElement(m.Tag,null,N),c().createElement("span",{className:"workflow-node-id"},r.id)),c().createElement("div",{className:"workflow-node-actions"},c().createElement(eK,null),c().createElement(eQ,null))),c().createElement(m.Input.TextArea,{disabled:p.executed,value:g,onChange:function(e){return O(e.target.value)},onBlur:function(e){return I(e.target.value)},autoSize:!0}),c().createElement(f.ActionContextProvider,{value:{visible:S,setVisible:T,formValueChanged:P,setFormValueChanged:A}},c().createElement(f.FormProvider,{form:D},c().createElement(f.SchemaComponent,{distributed:!1,scope:eR(eN({},b.scope),{useFormProviderProps:eZ,useUpdateAction:eL}),components:b.components,schema:{type:"void",properties:eR(eN({},b.view?{view:b.view}:{}),eF({button:{type:"void","x-content":v,"x-component":m.Button,"x-component-props":{type:"link",className:"workflow-node-config-button"}}},r.id,{type:"void",title:c().createElement("div",{className:(0,f.css)(eW())},c().createElement("strong",null,r.title),c().createElement(m.Tooltip,{title:k("Variable key of node")},c().createElement(m.Tag,null,c().createElement("code",null,r.key)))),"x-decorator":"FormV2","x-use-decorator-props":"useFormProviderProps","x-component":"Action.Drawer",properties:eR(eN({},b.description?{description:{type:"void","x-component":G,"x-component-props":{label:k("Node type"),title:b.title,description:b.description}}}:{}),{fieldset:{type:"void","x-component":"fieldset","x-component-props":{className:(0,f.css)(ez())},properties:b.fieldset},footer:p.executed?null:{type:"void","x-component":"Action.Drawer.Footer",properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{flexGrow:1}},properties:eR(eN({},b.testable?{test:{type:"void","x-component":(0,u.observer)(e3),"x-align":"left"}}:{}),{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ useUpdateAction }}"}}})}}}})}))}})))),o)}function e6(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function e4(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function e8(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){e4(e,t,n[t])})}return e}function e7(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function e9(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){if(n=i[r],!(t.indexOf(n)>=0))Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function te(e,t){if(e){if("string"==typeof e)return e6(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e6(e,t)}}var tt={label:"label",value:"value",children:"children"},tn={label:'{{t("Node result", { ns: "'.concat(E,'" })}}'),value:"$jobsMapByNodeKey",useOptions:function(e){var t=(0,f.usePlugin)(ab).instructions,n=eJ(eU()),r=[];return n.forEach(function(n){var o,i=t.get(n.type),a=null===(o=i.useVariables)||void 0===o?void 0:o.call(i,n,e);a&&r.push(a)}),r}},tr={label:'{{t("Trigger variables", { ns: "'.concat(E,'" })}}'),value:"$context",useOptions:function(e){var t,n,r=(0,f.usePlugin)(ab).triggers,o=j().workflow,i=r.get(o.type);return null!==(n=null==i?void 0:null===(t=i.useVariables)||void 0===t?void 0:t.call(i,o.config,e))&&void 0!==n?n:null}},to={label:'{{t("Scope variables", { ns: "'.concat(E,'" })}}'),value:"$scopes",useOptions:function(e){var t=e.fieldNames,n=void 0===t?tt:t,r=e.current,o=(0,f.usePlugin)(ab).instructions,i=eU(),a=eH(null!=r?r:i),l=[];return a.forEach(function(t){var r,i,a,c=o.get(t.type),u=null===(r=c.useScopeVariables)||void 0===r?void 0:r.call(c,t,e);u&&l.push((e4(a={key:t.key},n.value,t.key),e4(a,n.label,null!==(i=t.title)&&void 0!==i?i:"#".concat(t.id)),e4(a,n.children,u),a))}),l}},ti={label:'{{t("System variables", { ns: "'.concat(E,'" })}}'),value:"$system",useOptions:function(e){var t=(0,f.usePlugin)(ab).systemVariables;return(0,f.useCompile)()(Array.from(t.getValues()))}},ta={boolean:new Set(["checkbox"]),number:new Set(["integer","number","percent"]),string:new Set(["input","password","email","phone","select","radioGroup","text","markdown","richText","expression","time"]),date:new Set(["date","createdAt","updatedAt"])};function tl(e,t){var n,r,o,i,a,l,c;if("string"==typeof t)return null===(n=ta[t])||void 0===n?void 0:n.has(e.interface);if((void 0===t?"undefined":(c=t)&&"undefined"!=typeof Symbol&&c.constructor===Symbol?"symbol":typeof c)=="object"&&"reference"===t.type)return tc(e)?(null===(r=t.options)||void 0===r?void 0:r.entity)&&(e.collectionName===(null===(o=t.options)||void 0===o?void 0:o.collection)||(null===(i=t.options)||void 0===i?void 0:i.collection)==="*"):!!e.isForeignKey&&(e.collectionName===(null===(a=t.options)||void 0===a?void 0:a.collection)&&"id"===e.name||e.target===(null===(l=t.options)||void 0===l?void 0:l.collection));return"function"==typeof t&&t(e)}function tc(e){return["belongsTo","hasOne","hasMany","belongsToMany","belongsToArray"].includes(e.type)}function tu(e,t){if(null==t)return null;var n="".concat(e.name,".");return t.filter(function(e){return e.startsWith(n)}).map(function(e){return e.replace(n,"")})}function ts(e,t){var n,r,o,i=(0,f.useCompile)(),a=null===(r=e.useOptions)||void 0===r?void 0:null===(n=r.call(e,t))||void 0===n?void 0:n.filter(Boolean),l=t.fieldNames;return e4(o={},l.label,i(e.label)),e4(o,l.value,e.value),e4(o,"key",e[l.value]),e4(o,l.children,a),e4(o,"disabled",!a||!a.length),o}function tf(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=Object.assign({},tt,null!==(e=t.fieldNames)&&void 0!==e?e:{}),r=Object.assign(t,{fieldNames:n});return[ts(to,r),ts(tn,r),ts(tr,r),ts(ti,r)]}function tp(e,t){var n,r,o,i=t.compile,a=t.getCollectionFields;var l=(n=(0,f.parseCollectionName)(e),r=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(n,2)||te(n,r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),c=l[0],u=a(l[1],c),s=[],p=[];u.forEach(function(e){if(e.isForeignKey&&!e.primaryKey)s.push(e);else{var t=u.find(function(t){return t.name===e.foreignKey});t&&s.push(t),p.push(e)}});for(var d=(0,B.uniqBy)(s,"name"),m=p.length-1;m>=0;m--)!function(e){var t=p[e];if("belongsTo"===t.type){var n,r,o=d.findIndex(function(e){return e.name===t.foreignKey});if(o>-1){var a,l,c=d[o];p.splice(e,0,e7(e8({},t,c),{uiSchema:e7(e8({},t.uiSchema),{title:(null===(a=c.uiSchema)||void 0===a?void 0:a.title)?i(null===(l=c.uiSchema)||void 0===l?void 0:l.title):c.name})})),d.splice(o,1)}else p.splice(e,0,e7(e8({},t),{name:t.foreignKey,type:"bigInt",isForeignKey:!0,interface:t.interface,uiSchema:e7(e8({},t.uiSchema),{title:(null===(n=t.uiSchema)||void 0===n?void 0:n.title)?"".concat(i(null===(r=t.uiSchema)||void 0===r?void 0:r.title)," ID"):t.name})}))}else"context"===t.type&&"users"===t.collectionName&&p.splice(e,1)}(m);return p.push.apply(p,function(e){if(Array.isArray(e))return e6(e)}(o=d)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(o)||te(o)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),(0,B.uniqBy)(p,"name").filter(function(e){return e.interface&&!e.hidden})}function td(e){var t=tu(e.field,e.appends),n=tm(e8({collection:"".concat(e.field.dataSourceKey&&"main"!==e.field.dataSourceKey?"".concat(e.field.dataSourceKey,":"):"").concat(e.field.target),types:e.types,appends:t,depth:e.depth-1},this));e.loadChildren=null,n.length?e.children=n:(e.isLeaf=!0,!(!e.types||e.types.some(function(t){return tl(e.field,t)}))&&(e.disabled=!0))}function tm(e){var t=e.fields,n=e.collection,r=e.types,o=e.appends,i=void 0===o?[]:o,a=e.depth,l=void 0===a?1:a,c=e.compile,u=e.getCollectionFields,s=e.fieldNames,f=void 0===s?tt:s,p=null!=t?t:tp(n,{compile:c,getCollectionFields:u}),d=td.bind({compile:c,getCollectionFields:u,fieldNames:f});return(function e(t){var n=t.fields,r=t.types,o=t.appends,i=t.depth,a=void 0===i?1:i,l=t.compile,c=t.getCollectionFields;return n.filter(function(t){var n=null==r||!r.length||r.some(function(e){return tl(t,e)});if(!tc(t))return n;if(null===o)return!!a&&(n||e({fields:tp(t.target,{compile:l,getCollectionFields:c}),types:r,depth:a-1,appends:o,compile:l,getCollectionFields:c}));var i=tu(t,o),u=o.includes(t.name);return n?u:((null==i?void 0:i.length)||u)&&e({fields:tp(t.target,{compile:l,getCollectionFields:c}),types:r,appends:i,compile:l,getCollectionFields:c}).length})})({fields:p,types:r,depth:l,appends:i,compile:c,getCollectionFields:u}).map(function(e){var t,n,o=c((null===(t=e.uiSchema)||void 0===t?void 0:t.title)||e.name),a=tu(e,i),u=!tc(e)||a&&!a.length&&!i.includes(e.name)||!1;return e4(n={},f.label,o),e4(n,"key",e.name),e4(n,f.value,e.name),e4(n,"isLeaf",u),e4(n,"loadChildren",u?null:d),e4(n,"field",e),e4(n,"depth",l),e4(n,"appends",i),e4(n,"types",r),n})}function ty(e){var t=(0,f.useApp)().dataSourceManager.getDataSource(e).collectionManager;return(0,l.useCallback)(function(e){return t.getCollectionAllFields(e)},[t])}function tb(e){var t=e.variableOptions,n=e9(e,["variableOptions"]),r=tf(t);return c().createElement(f.Variable.Input,e8({scope:r},n))}function tv(e){var t=e.variableOptions,n=e9(e,["variableOptions"]),r=tf(t);return c().createElement(f.Variable.TextArea,e8({scope:r},n))}function th(e){var t=e.variableOptions,n=e9(e,["variableOptions"]),r=tf(t);return c().createElement(f.Variable.RawTextArea,e8({scope:r},n))}function tg(e){var t=e.variableOptions,n=e9(e,["variableOptions"]),r=tf(t);return c().createElement(f.Variable.JSON,e8({scope:r},n))}function tO(e){var t=e.value,n=e.onChange,r=e.renderSchemaComponent,o=tf();return c().createElement(f.Variable.Input,{value:t,onChange:n,scope:o},r())}function tw(){var e,t,n=(e=["\n & + .anticon {\n margin-left: 0.25em;\n }\n "],!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return tw=function(){return n},n}function tx(e){var t=e.options,n=e.direction,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){if(n=i[r],!(t.indexOf(n)>=0))Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}(e,["options","direction"]),o=(0,f.useCompile)();return c().createElement(m.Radio.Group,r,c().createElement(m.Space,{direction:n},(void 0===t?[]:t).map(function(e){return c().createElement(m.Radio,{key:e.value,value:e.value},c().createElement("span",{className:(0,f.css)(tw())},o(e.label)),e.tooltip&&c().createElement(m.Tooltip,{title:o(e.tooltip)},c().createElement(O.QuestionCircleOutlined,{style:{color:"#666"}})))})))}function tj(){var e,t,n=(e=["\n & + .anticon {\n margin-left: 0.25em;\n }\n "],!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return tj=function(){return n},n}function tS(e){var t=e.options,n=e.direction,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){if(n=i[r],!(t.indexOf(n)>=0))Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}(e,["options","direction"]),o=(0,f.useCompile)();return c().createElement(m.Checkbox.Group,r,c().createElement(m.Space,{direction:n},(void 0===t?[]:t).map(function(e){return c().createElement(m.Checkbox,{key:e.value,value:e.value},c().createElement("span",{className:(0,f.css)(tj())},o(e.label)),e.tooltip&&c().createElement(m.Tooltip,{title:o(e.tooltip)},c().createElement(O.QuestionCircleOutlined,{style:{color:"#666"}})))})))}function tE(){var e=(0,u.useFieldSchema)(),t=(0,f.useCompile)();return c().createElement(f.GeneralSchemaDesigner,{title:t(e.title)},c().createElement(f.SchemaSettingsBlockTitleItem,null),c().createElement(f.SchemaSettingsDivider,null),c().createElement(f.SchemaSettingsRemove,{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}}))}function tk(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tC(){var e,t,n=(e=["\n margin: 0;\n "],!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return tC=function(){return n},n}var tP=function(){return null};tP.Initializer=function(){var e,t,n=(0,f.useSchemaInitializerItem)(),r=n.node,o=n.resultTitle,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){if(n=i[r],!(t.indexOf(n)>=0))Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}(n,["node","resultTitle"]),a=(0,f.useSchemaInitializer)().insert;return c().createElement(f.SchemaInitializerItem,(e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){tk(e,t,n[t])})}return e}({},i),t=(t={onClick:function(){var e;a({type:"void",name:r.id,title:r.title,"x-component":"CardItem","x-component-props":{title:null!==(e=r.title)&&void 0!==e?e:"#".concat(r.id)},"x-designer":"ValueBlock.Designer",properties:{result:{type:"void",title:o,"x-component":"ValueBlock.Result","x-component-props":{dataSource:"{{$jobsMapByNodeKey.".concat(r.key,"}}")}}}})}},t),Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e))},tP.Result=function(e){var t,n=e.dataSource,r=(0,u.useFieldSchema)(),o=j().execution;if(!o)return r.title;var i=(0,p.parse)(n)({$jobsMapByNodeKey:(null!==(t=o.jobs)&&void 0!==t?t:[]).reduce(function(e,t){return Object.assign(e,tk({},t.nodeKey,t.result))},{})});return c().createElement("pre",{className:(0,f.css)(tC())},JSON.stringify(i,null,2))},tP.Designer=tE;var tA=v("47");function tD(){var e,t,n=(e=["\n &:after {\n content: ':';\n }\n & + a {\n margin-left: 0.25em;\n }\n "],!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return tD=function(){return n},n}var tT=function(e){var t=tA.evaluators.get(e);return t?t.link?c().createElement(c().Fragment,null,c().createElement("span",{className:(0,f.css)(tD())},f.i18n.t("Syntax references")),c().createElement("a",{href:t.link,target:"_blank",rel:"noreferrer"},t.label)):null:null};function tI(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function tF(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}function tN(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function tR(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(e,t)||tV(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tM(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function tB(e){return function(e){if(Array.isArray(e))return tI(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||tV(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tV(e,t){if(e){if("string"==typeof e)return tI(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tI(e,t)}}function t_(){var e=tM(["\n display: flex;\n gap: 0.5em;\n align-items: center;\n flex-wrap: wrap;\n "]);return t_=function(){return e},e}function tW(){var e=tM(["\n display: flex;\n position: relative;\n margin: 0.5em 0;\n "]);return tW=function(){return e},e}function tz(){var e=tM(["\n position: relative;\n width: 100%;\n .node-type-condition-group {\n padding: 0.5em 1em;\n border: 1px dashed #ddd;\n }\n + button {\n position: absolute;\n right: 0;\n }\n "]);return tz=function(){return e},e}function tq(){var e=tM(["\n display: flex;\n align-items: center;\n gap: 0.5em;\n .ant-select {\n width: auto;\n min-width: 6em;\n }\n "]);return tq=function(){return e},e}function tL(){var e=tM(["\n button {\n padding: 0;\n &:not(:last-child) {\n margin-right: 1em;\n }\n }\n "]);return tL=function(){return e},e}var t$=new p.Registry;t$.register("equal",{name:"=",type:"boolean",group:"boolean"}),t$.register("notEqual",{name:"≠",type:"boolean",group:"boolean"}),t$.register("gt",{name:">",type:"boolean",group:"boolean"}),t$.register("gte",{name:"≥",type:"boolean",group:"boolean"}),t$.register("lt",{name:"<",type:"boolean",group:"boolean"}),t$.register("lte",{name:"≤",type:"boolean",group:"boolean"}),t$.register("add",{name:"+",type:"number",group:"number"}),t$.register("minus",{name:"-",type:"number",group:"number"}),t$.register("multiple",{name:"*",type:"number",group:"number"}),t$.register("divide",{name:"/",type:"number",group:"number"}),t$.register("mod",{name:"%",type:"number",group:"number"}),t$.register("includes",{name:'{{t("contains")}}',type:"boolean",group:"string"}),t$.register("notIncludes",{name:'{{t("does not contain")}}',type:"boolean",group:"string"}),t$.register("startsWith",{name:'{{t("starts with")}}',type:"boolean",group:"string"}),t$.register("notStartsWith",{name:'{{t("not starts with")}}',type:"boolean",group:"string"}),t$.register("endsWith",{name:'{{t("ends with")}}',type:"boolean",group:"string"}),t$.register("notEndsWith",{name:'{{t("not ends with")}}',type:"boolean",group:"string"}),t$.register("concat",{name:'{{t("concat", { ns: "'.concat(E,'" })}}'),type:"string",group:"string"});var tU=[{value:"boolean",title:'{{t("Comparision")}}'},{value:"number",title:'{{t("Arithmetic calculation", { ns: "'.concat(E,'" })}}')},{value:"string",title:'{{t("String operation", { ns: "'.concat(E,'" })}}')},{value:"date",title:'{{t("Date", { ns: "'.concat(E,'" })}}')}];function tG(e){return Array.from(t$.getEntities()).filter(function(t){var n=tR(t,2);return(n[0],n[1]).group===e})}function tJ(e){var t=e.calculator,n=e.operands,r=void 0===n?[]:n,o=e.onChange,i=(0,f.useCompile)(),a=(0,l.useContext)(tK),u=a(),s=a(),p=(0,l.useCallback)(function(e){return o({calculator:t,operands:[e,r[1]]})},[t,o,r]),d=(0,l.useCallback)(function(e){return o({calculator:t,operands:[r[0],e]})},[t,o,r]),y=(0,l.useCallback)(function(e){return o({operands:r,calculator:e})},[o,r]);return c().createElement("fieldset",{className:(0,f.css)(t_())},c().createElement(f.Variable.Input,{changeOnSelect:!0,value:r[0],onChange:p,scope:u,useTypedConstant:!0}),c().createElement(m.Select,{role:"button","aria-label":"select-operator-calc",value:t,onChange:y,placeholder:k("Operator"),popupMatchSelectWidth:!1,className:"auto-width"},tU.filter(function(e){return!!tG(e.value).length}).map(function(e){return c().createElement(m.Select.OptGroup,{key:e.value,label:i(e.title)},tG(e.value).map(function(e){var t=tR(e,2),n=t[0],r=t[1].name;return c().createElement(m.Select.Option,{key:n,value:n},i(r))}))})),c().createElement(f.Variable.Input,{changeOnSelect:!0,value:r[1],onChange:d,scope:s,useTypedConstant:!0}))}function tH(e){var t=e.value,n=e.onChange,r=e.onRemove;if(!t)return null;var o=t.calculator,i=t.operands;return c().createElement("div",{className:(0,f.css)(tW())},t.group?c().createElement(tY,{value:t.group,onChange:function(e){return n(tN(tF({},t),{group:e}))}}):c().createElement(tJ,{operands:void 0===i?[]:i,calculator:o,onChange:n}),c().createElement(m.Button,{"aria-label":"icon-close",onClick:r,type:"link",icon:c().createElement(O.CloseCircleOutlined,null)}))}function tY(e){var t=this,n=e.value,r=e.onChange,o=(0,S.useTranslation)().t,i=n.type,a=n.calculations,u=void 0===a?[]:a,s=(0,l.useCallback)(function(){r(tN(tF({},n),{calculations:tB(u).concat([{not:!1,calculator:"equal"}])}))},[n,u,r]),p=(0,l.useCallback)(function(){r(tN(tF({},n),{calculations:tB(u).concat([{not:!1,group:{type:"and",calculations:[]}}])}))},[n,u,r]),d=(0,l.useCallback)(function(e){u.splice(e,1),r(tN(tF({},n),{calculations:tB(u)}))},[n,u,r]),y=(0,l.useCallback)(function(e,t){u.splice(e,1,t),r(tN(tF({},n),{calculations:tB(u)}))},[n,u,r]);return c().createElement("div",{className:(0,f.cx)("node-type-condition-group",(0,f.css)(tz()))},c().createElement("div",{className:(0,f.css)(tq())},c().createElement(S.Trans,null,"Meet ",c().createElement(m.Select,{role:"button","data-testid":"filter-select-all-or-any",value:void 0===i?"and":i,onChange:function(e){return r(tN(tF({},n),{type:e}))}},c().createElement(m.Select.Option,{value:"and"},"All"),c().createElement(m.Select.Option,{value:"or"},"Any"))," conditions in the group")),c().createElement("div",{className:"calculation-items"},u.map(function(e,n){return c().createElement(tH,{key:"".concat(e.calculator,"_").concat(n),value:e,onChange:y.bind(t,n),onRemove:function(){return d(n)}})})),c().createElement("div",{className:(0,f.css)(tL())},c().createElement(m.Button,{type:"link",onClick:s},o("Add condition")),c().createElement(m.Button,{type:"link",onClick:p},o("Add condition group"))))}var tK=(0,l.createContext)(tf);function tQ(e){var t=e.value,n=e.onChange,r=e.useVariableHook,o=void 0===r?tf:r,i=t&&Object.keys(t).length?t:{group:{type:"and",calculations:[]}};return c().createElement(tK.Provider,{value:o},c().createElement(tY,{value:i.group,onChange:function(e){return n(tN(tF({},i),{group:e}))}}))}var tZ=v("632");function tX(e){return c().createElement(m.Card,null,c().createElement(tZ.FormLayout,{layout:e.layout||"vertical"},e.children))}function t0(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function t1(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function t2(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){t1(i,r,o,a,l,"next",e)}function l(e){t1(i,r,o,a,l,"throw",e)}a(void 0)})}}function t3(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}function t5(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function t6(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return t0(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return t0(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function t4(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}function t8(){var e,t,n=(e=["\n .ant-dropdown-menu-root {\n max-height: 30em;\n overflow-y: auto;\n }\n "],!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return t8=function(){return n},n}function t7(e){var t,n,r=e.upstream,o=e.branchIndex,i=void 0===o?null:o,a=(0,f.usePlugin)(ab),u=(0,f.useCompile)(),s=(null!==(n=j())&&void 0!==n?n:{}).workflow,p=Array.from(a.instructions.getValues()),d=eP().styles,y=nt(),b=y.onCreate,v=y.creating,h=(0,l.useMemo)(function(){return u([{key:"control",label:'{{t("Control", { ns: "'.concat(E,'" })}}')},{key:"calculation",label:'{{t("Calculation", { ns: "'.concat(E,'" })}}')},{key:"collection",label:'{{t("Collection operations", { ns: "'.concat(E,'" })}}')},{key:"manual",label:'{{t("Manual", { ns: "'.concat(E,'" })}}')},{key:"extended",label:'{{t("Extended types", { ns: "'.concat(E,'" })}}')}].map(function(e){var t=p.filter(function(t){return t.group===e.key&&(!t.isAvailable||t.isAvailable({engine:a,workflow:s,upstream:r,branchIndex:i}))});return t5(t3({},e),{type:"group",children:t.map(function(e){return{role:"button","aria-label":e.type,key:e.type,label:e.title}})})}).filter(function(e){return e.children.length}))},[i,u,a,p,r,s]);var g=(0,l.useCallback)((t=t2(function(e){return t4(this,function(t){return b({type:t6(e.keyPath,1)[0],upstream:r,branchIndex:i}),[2]})}),function(e){return t.apply(this,arguments)}),[i,b,r]);return s?c().createElement("div",{className:d.addButtonClass},c().createElement(m.Dropdown,{menu:{items:h,onClick:g},disabled:s.executed,overlayClassName:(0,f.css)(t8())},c().createElement(m.Button,{"aria-label":e["aria-label"]||"add-button",shape:"circle",icon:c().createElement(O.PlusOutlined,null),loading:(null==v?void 0:v.upstreamId)==(null==r?void 0:r.id)&&(null==v?void 0:v.branchIndex)===i,size:"small"}))):null}function t9(){var e=(0,u.useForm)(),t=(0,f.useAPIClient)(),n=j(),r=n.workflow,o=n.refresh,i=nt(),a=i.presetting,l=i.setPresetting,c=i.setCreating,s=(0,f.useActionContext)();return{run:function(){return t2(function(){var n;return t4(this,function(i){switch(i.label){case 0:if(!a)return[2];return[4,e.submit()];case 1:i.sent(),c(a.data),i.label=2;case 2:return i.trys.push([2,6,7,8]),[4,t.resource("workflows.nodes",r.id).create({values:t5(t3({},a.data),{config:t3({},a.data.config,e.values.config)})})];case 3:if(n=i.sent().data.data,!("number"==typeof e.values.downstreamBranchIndex&&n.downstreamId))return[3,5];return[4,t.resource("flow_nodes").update({filterByTk:n.downstreamId,values:{branchIndex:e.values.downstreamBranchIndex,upstream:{id:n.id,downstreamId:null}},updateAssociationValues:["upstream"]})];case 4:i.sent(),i.label=5;case 5:return s.setVisible(!1),l(null),o(),[3,8];case 6:return console.error(i.sent()),[3,8];case 7:return c(null),[7];case 8:return[2]}})})()}}}var ne=(0,l.createContext)(null);function nt(){return(0,l.useContext)(ne)}var nn=[{label:"{{t('After end of branches', { ns: \"".concat(E,'" })}}'),value:!1},{label:"{{t('Inside of branch', { ns: \"".concat(E,'" })}}'),value:0}],nr=(0,u.observer)(function(e){var t,n,r=nt().presetting,o=j().nodes,i=(0,u.useForm)().values,a=(0,l.useMemo)(function(){if(!(null==r?void 0:r.instruction))return[];var e,t=r.instruction,n=r.data;if(!(n.upstreamId?o.find(function(e){return e.upstreamId===n.upstreamId&&e.branchIndex===n.branchIndex}):o.find(function(e){return null===e.upstreamId})))return[];var a="function"==typeof t.branching?t.branching(null!==(e=i.config)&&void 0!==e?e:{}):t.branching;return a?!0===a?nn:a:[]},[r,o,i.config]);if(!a.length)return null;var s=r.data;return c().createElement(f.SchemaComponent,{components:{RadioWithTooltip:tx},schema:{name:"".concat(null!==(t=s.type)&&void 0!==t?t:"unknown","-").concat(null!==(n=s.upstreamId)&&void 0!==n?n:"root","-").concat(s.branchIndex),type:"void",properties:{downstreamBranchIndex:{type:"number",title:k("Move all downstream nodes to",{ns:E}),"x-decorator":"FormItem","x-component":"RadioWithTooltip","x-component-props":{options:a,direction:"vertical"},default:!1,required:!0}}}})});function no(){var e=nt().presetting;return(null==e?void 0:e.instruction.presetFieldset)?c().createElement(f.SchemaComponent,{schema:{type:"void",properties:{config:{type:"object",properties:e.instruction.presetFieldset}}}}):null}function ni(e){var t,n,r=(0,f.useAPIClient)(),o=(0,f.useCompile)(),i=(0,f.usePlugin)(ab),a=t6((0,l.useState)(null),2),u=a[0],s=a[1],d=t6((0,l.useState)(null),2),m=d[0],y=d[1],b=t6((0,l.useState)(!1),2),v=b[0],h=b[1],g=null!==(n=j())&&void 0!==n?n:{},O=g.workflow,x=g.nodes,S=g.refresh,k=(0,l.useMemo)(function(){return(0,w.createForm)()},[]),C=(0,l.useCallback)(function(e){!e&&(k.reset(),k.clearFormGraph("*"),y(null))},[k]);var P=(0,l.useCallback)((t=t2(function(e){return t4(this,function(t){switch(t.label){case 0:s(e),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,r.resource("workflows.nodes",O.id).create({values:e})];case 2:return t.sent(),S(),[3,5];case 3:return console.error(t.sent()),[3,5];case 4:return s(null),[7];case 5:return[2]}})}),function(e){return t.apply(this,arguments)}),[r,S,O.id]),A=(0,l.useCallback)(function(e){var t,n,r,a=e.type,l=e.upstream,c=e.branchIndex,u=i.instructions.get(a);if(!u){console.error('Instruction "'.concat(a,'" not found'));return}var s={key:(0,p.uid)(),type:a,upstreamId:null!==(n=null==l?void 0:l.id)&&void 0!==n?n:null,branchIndex:c,title:o(u.title),config:null!==(r=null===(t=u.createDefaultConfig)||void 0===t?void 0:t.call(u))&&void 0!==r?r:{}},f=(null==l?void 0:l.id)?x.find(function(e){return e.upstreamId===s.upstreamId&&e.branchIndex===s.branchIndex}):x.find(function(e){return null===e.upstreamId});if(u.presetFieldset||("function"==typeof u.branching?u.branching(s.config):u.branching)&&f){y({data:s,instruction:u});return}P(s)},[o,P,i.instructions]);return c().createElement(ne.Provider,{value:{presetting:m,setPresetting:y,onCreate:A,creating:u,setCreating:s}},e.children,c().createElement(f.ActionContextProvider,{value:{visible:!!m,setVisible:C,formValueChanged:v,setFormValueChanged:h,openSize:"small"}},c().createElement(f.SchemaComponent,{components:{DownstreamBranchIndex:nr,PresetFieldset:no},scope:{useCancelAction:f.useCancelAction,useAddNodeSubmitAction:t9},schema:{name:"modal",type:"void","x-decorator":"FormV2","x-decorator-props":{form:k},"x-component":"Action.Modal",title:'{{ t("Add node", { ns: "'.concat(E,'" }) }}'),properties:{config:{type:"void","x-component":"PresetFieldset"},downstreamBranchIndex:{type:"void","x-component":"DownstreamBranchIndex"},footer:{"x-component":"Action.Modal.Footer",properties:{actions:{type:"void","x-component":"ActionBar",properties:{cancel:{type:"void",title:'{{ t("Cancel") }}',"x-component":"Action","x-component-props":{useAction:"{{ useCancelAction }}"}},submit:{type:"void",title:'{{ t("Submit") }}',"x-component":"Action","x-component-props":{type:"primary",htmlType:"submit",useAction:"{{ useAddNodeSubmitAction }}"}}}}}}}}})))}function na(e){for(var t=e.from,n=void 0===t?null:t,r=e.entry,o=void 0===r?null:r,i=e.branchIndex,a=void 0===i?null:i,l=e.controller,u=e.className,s=e.end,p=eP().styles,d=el(n,a).getAriaLabel,m=[],y=o;y;y=y.downstream)m.push(y);return c().createElement("div",{className:(0,f.cx)("workflow-branch",p.branchClass,u)},c().createElement("div",{className:"workflow-branch-lines"}),void 0===l?null:l,c().createElement(t7,{"aria-label":d(),upstream:n,branchIndex:a}),c().createElement("div",{className:"workflow-node-list"},m.map(function(e){return c().createElement(eY,{data:e,key:e.id})})),s?c().createElement("div",{className:"end-sign"},c().createElement(O.CloseOutlined,null)):null)}function nl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nc(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function nu(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){nc(i,r,o,a,l,"next",e)}function l(e){nc(i,r,o,a,l,"throw",e)}a(void 0)})}}function ns(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){ns(e,t,n[t])})}return e}function np(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function nd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return nl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nl(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nm(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ny(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}function nb(){var e=nm(["\n padding: 1em;\n background-color: #f3f3f3;\n "]);return nb=function(){return e},e}function nv(){var e=nm(["\n .ant-select.auto-width {\n width: auto;\n min-width: 6em;\n }\n "]);return nv=function(){return e},e}function nh(){var e,t=(0,u.useForm)(),n=(0,f.useAPIClient)(),r=(null!==(e=j())&&void 0!==e?e:{}).workflow,o=(0,f.useActionContext)(),i=(0,f.useResourceActionContext)().refresh;return{run:function(){return nu(function(){return ny(this,function(e){switch(e.label){case 0:if(r.executed)return m.message.error(k("Trigger in executed workflow cannot be modified")),[2];return[4,t.submit()];case 1:return e.sent(),[4,n.resource("workflows").update({filterByTk:r.id,values:{config:t.values}})];case 2:return e.sent(),o.setFormValueChanged(!1),o.setVisible(!1),i(),[2]}})})()}}}var ng=function e(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,e),ns(this,"sync",void 0),ns(this,"title",void 0),ns(this,"description",void 0),ns(this,"fieldset",void 0),ns(this,"view",void 0),ns(this,"scope",void 0),ns(this,"components",void 0),ns(this,"initializers",void 0),ns(this,"isActionTriggerable",void 0)};function nO(){var e=(0,f.useCompile)(),t=j(),n=t.workflow,r=t.execution,o=eP().styles,i=nj();return r?c().createElement(f.SchemaComponent,{components:{Tooltip:m.Tooltip},schema:{type:"void",name:"execution","x-decorator":"Tooltip","x-decorator-props":{title:k("View result")},"x-component":"Action","x-component-props":{title:c().createElement(O.InfoOutlined,null),shape:"circle",size:"small",className:o.nodeJobButtonClass,type:"primary"},properties:ns({},r.id,{type:"void","x-decorator":"Form","x-decorator-props":{initialValue:r},"x-component":"Action.Modal",title:c().createElement("div",{className:(0,f.cx)(o.nodeTitleClass)},c().createElement(m.Tag,null,e(i.title)),c().createElement("strong",null,n.title),c().createElement("span",{className:"workflow-node-id"},"#",r.id)),properties:{createdAt:{type:"string",title:'{{t("Triggered at", { ns: "'.concat(E,'" })}}'),"x-decorator":"FormItem","x-component":"DatePicker","x-component-props":{showTime:!0},"x-read-pretty":!0},context:{type:"object",title:'{{t("Trigger variables", { ns: "'.concat(E,'" })}}'),"x-decorator":"FormItem","x-component":"Input.JSON","x-component-props":{className:(0,f.css)(nb())},"x-read-pretty":!0}}})}}):null}function nw(){return{form:(0,u.useForm)()}}var nx=function(){var e,t=(0,f.useAPIClient)(),n=j(),r=n.workflow,o=n.refresh,i=nd((0,l.useState)(""),2),a=i[0],u=i[1],s=nd((0,l.useState)(!1),2),p=s[0],d=s[1],y=nd((0,l.useState)(!1),2),b=y[0],v=y[1],h=eP().styles,g=(0,f.useCompile)(),x=nj();(0,l.useEffect)(function(){if(r){var e,t;u(null!==(t=null!==(e=r.triggerTitle)&&void 0!==e?e:r.title)&&void 0!==t?t:g(null==x?void 0:x.title))}},[r,x]);var S=(0,l.useMemo)(function(){var e=(0,B.cloneDeep)(r.config);return(0,w.createForm)({initialValues:e,disabled:r.executed})},[r]),E=(0,l.useCallback)(function(e){d(e),!e&&S.reset()},[S]);var C=(0,l.useCallback)((e=nu(function(e){var n;return ny(this,function(i){switch(i.label){case 0:if(u(n=e||g(null==x?void 0:x.title)),n===r.triggerTitle)return[2];return[4,t.resource("workflows").update({filterByTk:r.id,values:{triggerTitle:n}})];case 1:return i.sent(),o(),[2]}})}),function(t){return e.apply(this,arguments)}),[r,x]),P=(0,l.useCallback)(function(e){if(e.target===e.currentTarget){d(!0);return}for(var t,n=new Set(["workflow-node-meta","workflow-node-config-button","ant-input-disabled"]),r=e.target;r&&r!==e.currentTarget;r=r.parentNode)if(Array.from(null!==(t=r.classList)&&void 0!==t?t:[]).some(function(e){return n.has(e)})){d(!0),e.stopPropagation();return}},[]),A=r.executed?'{{t("View")}}':'{{t("Configure")}}',D=k("Trigger");if(!x)return c().createElement(m.Tooltip,{title:k("Workflow with unknown type will cause error. Please delete it or check plugin which provide this type.")},c().createElement("div",{role:"button","aria-label":"".concat(D,"-").concat(a),className:(0,f.cx)(h.nodeCardClass,"invalid"),onClick:P},c().createElement("div",{className:h.nodeHeaderClass},c().createElement("div",{className:(0,f.cx)(h.nodeMetaClass,"workflow-node-meta")},c().createElement(m.Tag,{color:"error"},k("Unknown trigger")))),c().createElement("div",{className:"workflow-node-title"},c().createElement(m.Input.TextArea,{value:a,disabled:!0,autoSize:!0}))));var T=x.fieldset,I=x.scope,F=x.components;return c().createElement("div",{role:"button","aria-label":"".concat(D,"-").concat(a),className:(0,f.cx)(h.nodeCardClass),onClick:P},c().createElement("div",{className:h.nodeHeaderClass},c().createElement("div",{className:(0,f.cx)(h.nodeMetaClass,"workflow-node-meta")},c().createElement(m.Tag,{color:"gold"},c().createElement(O.ThunderboltOutlined,null),c().createElement("span",{className:"type"},g(x.title)))),c().createElement("div",{className:"workflow-node-actions"},c().createElement(nO,null))),c().createElement("div",{className:"workflow-node-title"},c().createElement(m.Input.TextArea,{value:a,onChange:function(e){return u(e.target.value)},onBlur:function(e){return C(e.target.value)},autoSize:!0,disabled:r.executed})),c().createElement(f.ActionContextProvider,{value:{visible:p,setVisible:E,formValueChanged:b,setFormValueChanged:v}},c().createElement(f.FormProvider,{form:S},c().createElement(f.SchemaComponent,{scope:np(nf({},I),{useFormProviderProps:nw}),components:F,schema:{name:"workflow-trigger-".concat(r.id),type:"void",properties:{config:{type:"void","x-content":A,"x-component":m.Button,"x-component-props":{type:"link",className:"workflow-node-config-button"}},drawer:{type:"void",title:D,"x-component":"Action.Drawer","x-decorator":"FormV2","x-use-decorator-props":"useFormProviderProps",properties:np(nf({},x.description?{description:{type:"void","x-component":G,"x-component-props":{label:k("Trigger type"),title:x.title,description:x.description}}}:{}),{fieldset:{type:"void","x-component":"fieldset","x-component-props":{className:(0,f.css)(nv())},properties:T},actions:nf({},r.executed?{}:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:nh}}}})})}}}}))))};function nj(){var e=(0,f.usePlugin)(ab),t=j().workflow;return e.triggers.get(t.type)}function nS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nE(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function nk(){var e=nE(["\n margin-top: 0 !important;\n "]);return nk=function(){return e},e}function nC(){var e=nE(["\n margin-bottom: 1em;\n "]);return nC=function(){return e},e}function nP(){var e=nE(["\n margin-top: 0 !important;\n "]);return nP=function(){return e},e}function nA(e){var t,n,r=e.entry,o=eP().styles,i=j().workflow;var a=(t=c().useState(100),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return nS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nS(e,t)}}(t,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),l=a[0],u=a[1];return c().createElement("div",{className:"workflow-canvas-wrapper"},c().createElement(g,{FallbackComponent:f.ErrorFallback,onError:console.error},c().createElement(ni,null,c().createElement("div",{className:"workflow-canvas",style:{zoom:l/100}},c().createElement("div",{className:(0,f.cx)(o.branchBlockClass,(0,f.css)(nk()))},c().createElement("div",{className:o.branchClass},(null==i?void 0:i.executed)?c().createElement(m.Alert,{type:"warning",message:k("Executed workflow cannot be modified. Could be copied to a new version to modify."),showIcon:!0,className:(0,f.css)(nC())}):null,c().createElement(nx,null),c().createElement("div",{className:(0,f.cx)(o.branchBlockClass,(0,f.css)(nP()))},c().createElement(na,{entry:r})),c().createElement("div",{className:o.terminalClass},k("End"))))))),c().createElement("div",{className:"workflow-canvas-zoomer"},c().createElement(m.Slider,{vertical:!0,reverse:!0,defaultValue:100,step:10,min:10,value:l,onChange:u})))}function nD(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nT(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){if(n=i[r],!(t.indexOf(n)>=0))Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function nI(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(e,t)||nN(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nF(e){return function(e){if(Array.isArray(e))return nD(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||nN(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nN(e,t){if(e){if("string"==typeof e)return nD(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nD(e,t)}}function nR(){var e,t,n,r=(0,f.usePlugin)(ab).instructions,o=(0,f.useCompile)(),i=j(),a=i.viewJob,l=i.setViewJob,u=eP().styles,s=(null!=a?a:{}).node,p=void 0===s?{}:s,d=r.get(p.type);return c().createElement(f.ActionContextProvider,{value:{visible:!!a,setVisible:l}},c().createElement(f.SchemaComponent,{schema:{type:"void",properties:(e={},t="".concat(null==a?void 0:a.id,"-").concat(null==a?void 0:a.updatedAt,"-modal"),n={type:"void","x-decorator":"Form","x-decorator-props":{initialValue:a},"x-component":"Action.Modal",title:c().createElement("div",{className:u.nodeTitleClass},c().createElement(m.Tag,null,o(null==d?void 0:d.title)),c().createElement("strong",null,p.title),c().createElement("span",{className:"workflow-node-id"},"#",p.id)),properties:{status:{type:"number",title:'{{t("Status", { ns: "'.concat(E,'" })}}'),"x-decorator":"FormItem","x-component":"Select",enum:ei,"x-read-pretty":!0},updatedAt:{type:"string",title:'{{t("Executed at", { ns: "'.concat(E,'" })}}'),"x-decorator":"FormItem","x-component":"DatePicker","x-component-props":{showTime:!0},"x-read-pretty":!0},result:{type:"object",title:'{{t("Node result", { ns: "'.concat(E,'" })}}'),"x-decorator":"FormItem","x-component":"Input.JSON","x-component-props":{className:u.nodeJobResultClass},"x-read-pretty":!0}}},t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e)}}))}function nM(e){var t=j().execution,n=(0,f.useAPIClient)(),r=(0,d.useNavigate)(),o=eP().styles,i=nI((0,l.useState)([]),2),a=i[0],u=i[1],s=nI((0,l.useState)([]),2),y=s[0],b=s[1];(0,l.useEffect)(function(){if(!!t)n.resource("executions").list({filter:{key:t.key,id:{$lt:t.id}},sort:"-createdAt",pageSize:10,fields:["id","status","createdAt"]}).then(function(e){u(e.data.data)}).catch(function(){})},[t]),(0,l.useEffect)(function(){if(!!t)n.resource("executions").list({filter:{key:t.key,id:{$gt:t.id}},sort:"createdAt",pageSize:10,fields:["id","status","createdAt"]}).then(function(e){b(e.data.data.reverse())}).catch(function(){})},[t]);var v=(0,l.useCallback)(function(e){var n=e.key;n!=t.id&&r(T(n))},[t]);return t?c().createElement(m.Dropdown,{menu:{onClick:v,defaultSelectedKeys:["".concat(t.id)],className:(0,f.cx)(o.dropdownClass,o.executionsDropdownRowClass),items:nF(y).concat([t],nF(a)).map(function(e){return{key:e.id,label:c().createElement(c().Fragment,null,c().createElement("span",{className:"id"},"#".concat(e.id)),c().createElement("time",null,(0,p.str2moment)(e.createdAt).format("YYYY-MM-DD HH:mm:ss"))),icon:c().createElement("span",null,c().createElement(X,{statusMap:er,status:e.status}))}})}},c().createElement(m.Space,null,c().createElement("strong",null,"#".concat(t.id)),c().createElement(O.DownOutlined,null))):null}function nB(){var e,t=(0,S.useTranslation)().t,n=(0,f.useCompile)(),r=(0,f.useResourceActionContext)(),o=r.data,i=r.loading,a=r.refresh,u=(0,f.useDocumentTitle)().setTitle,s=nI((0,l.useState)(null),2),y=s[0],b=s[1],v=(0,f.useApp)(),h=(0,f.useAPIClient)();(0,l.useEffect)(function(){var e,t=(null!==(e=null==o?void 0:o.data)&&void 0!==e?e:{}).workflow;null==u||u("".concat((null==t?void 0:t.title)?"".concat(t.title," - "):"").concat(k("Execution history")))},[null==o?void 0:o.data]);var g=(0,l.useCallback)(function(){m.Modal.confirm({title:k("Cancel the execution"),icon:c().createElement(O.ExclamationCircleFilled,null),content:k("Are you sure you want to cancel the execution?"),onOk:function(){h.resource("executions").cancel({filterByTk:null==o?void 0:o.data.id}).then(function(){m.message.success(t("Operation succeeded")),a()}).catch(function(e){console.error(e.data.error)})}})},[null==o?void 0:o.data]);if(!(null==o?void 0:o.data))return i?c().createElement(m.Spin,null):c().createElement(m.Result,{status:"404",title:"Not found"});var w=null!==(e=null==o?void 0:o.data)&&void 0!==e?e:{},j=w.jobs,E=w.workflow,C=void 0===E?{}:E,A=C.nodes,T=void 0===A?[]:A,I=(C.revisions,nT(w.workflow,["nodes","revisions"])),F=nT(w,["jobs","workflow"]);P(T),!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=new Map;e.forEach(function(e){e.jobs=[],n.set(e.id,e)}),t.forEach(function(e){var t=n.get(e.nodeId);t.jobs.push(e),e.node={id:t.id,key:t.key,title:t.title,type:t.type}}),e.forEach(function(e){e.jobs=e.jobs.sort(function(e,t){return e.id-t.id})})}(T,void 0===j?[]:j);var N=T.find(function(e){return!e.upstream}),R=er[F.status];return c().createElement(x.Provider,{value:{workflow:I.type?I:null,nodes:T,execution:F,viewJob:y,setViewJob:b}},c().createElement("div",{className:"workflow-toolbar"},c().createElement("header",null,c().createElement(m.Breadcrumb,{items:[{title:c().createElement(d.Link,{to:v.pluginSettingsManager.getRoutePath("workflow")},k("Workflow"))},{title:c().createElement(m.Tooltip,{title:"Key: ".concat(I.key)},c().createElement(d.Link,{to:D(I.id)},I.title))},{title:c().createElement(nM,null)}]})),c().createElement("aside",null,c().createElement(m.Tag,{color:R.color},n(R.label)),F.status?null:c().createElement(m.Tooltip,{title:k("Cancel the execution")},c().createElement(m.Button,{type:"link",danger:!0,onClick:g,shape:"circle",size:"small",icon:c().createElement(O.StopOutlined,null)})),c().createElement("time",null,(0,p.str2moment)(F.updatedAt).format("YYYY-MM-DD HH:mm:ss")))),c().createElement(nA,{entry:N}),c().createElement(nR,null))}var nV=function(){var e,t,n,r=(0,d.useParams)(),o=eP().styles;return c().createElement("div",{className:(0,f.cx)(o.workflowPageClass)},c().createElement(f.SchemaComponent,{schema:{type:"void",properties:(e={},t="execution_".concat(r.id),n={type:"void","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:{name:"executions",fields:[]},resourceName:"executions",request:{resource:"executions",action:"get",params:{filter:r,appends:["jobs","workflow","workflow.nodes"]}}},"x-component":"ExecutionCanvas"},t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e)},components:{ExecutionCanvas:nB}}))},n_=function(){var e=(0,S.useTranslation)().t,t=(0,f.useRecord)().id,n=(0,f.useActionContext)().setVisible;return c().createElement(d.Link,{to:T(t),onClick:function(){return n(!1)}},e("View"))};function nW(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}var nz={name:"execution-executions",fields:[{interface:"id",type:"bigInt",name:"id",uiSchema:{type:"number",title:'{{t("ID")}}',"x-component":"Input","x-component-props":{},"x-read-pretty":!0}},{interface:"createdAt",type:"datetime",name:"createdAt",uiSchema:{type:"datetime",title:'{{t("Triggered at", { ns: "'.concat(E,'" })}}'),"x-component":"DatePicker","x-component-props":{},"x-read-pretty":!0}},{interface:"m2o",type:"belongsTo",name:"workflowId",uiSchema:(e={type:"number",title:'{{t("Version", { ns: "'.concat(E,'" })}}')},t="x-component",n=function(e){var t=e.value,n=(0,f.useActionContext)().setVisible;return c().createElement(d.Link,{to:D(t),onClick:function(){return n(!1)}},"#".concat(t))},t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e)},{type:"number",name:"status",interface:"select",uiSchema:{title:'{{t("Status", { ns: "'.concat(E,'" })}}'),type:"string","x-component":"Select","x-decorator":"FormItem",enum:en}}]},nq={type:"void",name:"executionHistoryDrawer",title:'{{t("Execution history", { ns: "'.concat(E,'" })}}'),"x-component":"Action.Drawer",properties:{content:{type:"void","x-decorator":"ExecutionResourceProvider","x-decorator-props":{collection:nz,resourceName:"executions",request:{resource:"executions",action:"list",params:{appends:["workflow.id","workflow.title"],pageSize:20,sort:["-createdAt"],filter:{}}}},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{refresher:{type:"void",title:'{{ t("Refresh") }}',"x-component":"Action","x-use-component-props":"useRefreshActionProps","x-component-props":{icon:"ReloadOutlined"}},delete:{type:"void",title:'{{t("Delete")}}',"x-component":"Action","x-component-props":{icon:"DeleteOutlined",useAction:"{{ cm.useBulkDestroyAction }}",confirm:{title:"{{t('Delete record')}}",content:"{{t('Are you sure you want to delete it?')}}"}}},clear:{type:"void",title:'{{t("Clear")}}',"x-component":"Action","x-component-props":{useAction:function(){var e=(0,S.useTranslation)().t,t=(0,f.useResourceActionContext)(),n=t.refresh,r=t.defaultRequest,o=(0,f.useResourceContext)().resource,i=(0,f.useActionContext)().setVisible;return{run:function(){var t;return(t=function(){var t;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(a){switch(a.label){case 0:return[4,o.destroy({filter:null===(t=r.params)||void 0===t?void 0:t.filter})];case 1:return a.sent(),m.message.success(e("Operation succeeded")),n(),i(!1),[2]}})},function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(e){nW(i,r,o,a,l,"next",e)}function l(e){nW(i,r,o,a,l,"throw",e)}a(void 0)})})()}}},confirm:{title:'{{t("Clear all executions", { ns: "'.concat(E,'" })}}'),content:'{{t("Clear executions will not reset executed count, and started executions will not be deleted, are you sure you want to delete them all?", { ns: "'.concat(E,'" })}}')}}}}},table:{type:"void","x-component":"Table.Void","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"},useDataSource:"{{ cm.useDataSourceFromRAC }}"},properties:{id:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{id:{type:"number","x-component":"CollectionField","x-read-pretty":!0}}},createdAt:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{createdAt:{type:"datetime","x-component":"CollectionField","x-component-props":{showTime:!0},"x-read-pretty":!0}}},workflowId:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{workflowId:{type:"number","x-component":"CollectionField","x-read-pretty":!0}}},status:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",title:'{{t("Status", { ns: "'.concat(E,'" })}}'),properties:{status:{type:"number","x-decorator":"ExecutionStatusColumn","x-component":"CollectionField","x-read-pretty":!0}}},actions:{type:"void",title:'{{ t("Actions") }}',"x-component":"Table.Column",properties:{actions:{type:"void","x-component":"Space","x-component-props":{split:"|"},properties:{link:{type:"void","x-component":"ExecutionLink"},delete:{type:"void",title:'{{ t("Delete") }}',"x-component":"Action.Link","x-component-props":{confirm:{title:"{{t('Delete record')}}",content:"{{t('Are you sure you want to delete it?')}}"},useAction:"{{ cm.useDestroyActionAndRefreshCM }}"},"x-reactions":[{dependencies:["..status"],fulfill:{state:{visible:"{{ $deps[0] !== ".concat(et.STARTED," }}")}}}]}}}}}}}}}}};function nL(){return(nL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function n$(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}function nU(){var e,t,n=(e=["\n display: flex;\n "],!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return nU=function(){return n},n}function nG(e){var t,n=(0,f.useCompile)()(e.label),r=(0,l.useCallback)(function(e){e.preventDefault(),e.stopPropagation()},[]),o=(null!==(t=er[e.value])&&void 0!==t?t:{}).color;return c().createElement(m.Tag,{color:o,onMouseDown:r,closable:e.closable,onClose:e.onClose},n)}function nJ(e){var t=(0,f.useCompile)();return c().createElement(c().Fragment,null,c().createElement(nG,e),e.description?c().createElement("span",null,t(e.description)):null)}function nH(e){var t,n,r=nL({},function(e){if(null==e)throw TypeError("Cannot destructure "+e);return e}(e)),o=r.multiple?"multiple":null;return c().createElement(m.Select,(t=n$({role:"button","data-testid":"select-".concat(o||"single")},r),n=(n={mode:o,optionLabelProp:"label",tagRender:nG},n),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t),en.filter(function(e){return!!e.value&&e.value!==et.ABORTED}).map(function(e){return c().createElement(m.Select.Option,n$({key:e.value},e),c().createElement(nJ,e))}))}function nY(e){var t=(0,S.useTranslation)().t,n=(0,f.useResourceActionContext)().refresh,r=(0,f.useResourceContext)().resource,o=(0,f.useRecord)(),i=(0,l.useCallback)(function(){m.Modal.confirm({title:k("Cancel the execution"),icon:c().createElement(O.ExclamationCircleFilled,null),content:k("Are you sure you want to cancel the execution?"),onOk:function(){r.cancel({filterByTk:o.id}).then(function(){m.message.success(t("Operation succeeded")),n()}).catch(function(e){console.error(e.data.error)})}})},[o]);return c().createElement("div",{className:(0,f.css)(nU())},e.children,o.status?null:c().createElement(m.Tooltip,{title:k("Cancel the execution")},c().createElement(m.Button,{type:"link",danger:!0,onClick:i,shape:"circle",size:"small",icon:c().createElement(O.StopOutlined,null)})))}function nK(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function nQ(){var e=(0,f.useResourceActionContext)();return{onClick:function(){var t;return(t=function(){var t;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(n){return null==e||null===(t=e.refresh)||void 0===t||t.call(e),[2]})},function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(e){nK(i,r,o,a,l,"next",e)}function l(e){nK(i,r,o,a,l,"throw",e)}a(void 0)})})()}}}function nZ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nX(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function n0(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){nX(i,r,o,a,l,"next",e)}function l(e){nX(i,r,o,a,l,"throw",e)}a(void 0)})}}function n1(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}function n2(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function n3(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){if(n=i[r],!(t.indexOf(n)>=0))Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function n5(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}function n6(e){var t,n=e.request,r=(e.filter,n3(e,["request","filter"])),o=j().workflow,i=n2(n1({},r),{request:n2(n1({},n),{params:n2(n1({},null==n?void 0:n.params),{filter:n2(n1({},null==n?void 0:null===(t=n.params)||void 0===t?void 0:t.filter),{key:o.key})})})});return c().createElement(f.ResourceActionProvider,i)}function n4(){var e,t,n,r=(0,d.useNavigate)(),o=(0,S.useTranslation)().t,i=(0,f.useApp)(),a=(0,f.useResourceActionContext)(),u=a.data,s=a.refresh,y=a.loading,b=(0,f.useResourceContext)().resource,v=(0,f.useDocumentTitle)().setTitle;var h=(e=(0,l.useState)(!1),t=2,function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(e,2)||function(e,t){if(e){if("string"==typeof e)return nZ(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nZ(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),g=h[0],w=h[1],j=eP().styles,E=m.App.useApp().modal;if((0,l.useEffect)(function(){var e,t=(null!==(e=null==u?void 0:u.data)&&void 0!==e?e:{}).title;null==v||v("".concat(k("Workflow")).concat(t?": ".concat(t):""))},[null==u?void 0:u.data]),!(null==u?void 0:u.data))return y?c().createElement(m.Spin,null):c().createElement(m.Result,{status:"404",title:"Not found",extra:c().createElement(m.Button,{onClick:function(){return r(-1)}},k("Go back"))});var C=null!==(n=null==u?void 0:u.data)&&void 0!==n?n:{},A=C.nodes,T=void 0===A?[]:A,I=C.revisions,F=void 0===I?[]:I,N=n3(C,["nodes","revisions"]);P(T);var R=T.find(function(e){return!e.upstream});function M(){return(M=n0(function(e){return n5(this,function(t){switch(t.label){case 0:return[4,b.update({filterByTk:N.id,values:{enabled:e}})];case 1:return t.sent(),s(),[2]}})})).apply(this,arguments)}function B(){return(B=n0(function(){var e;return n5(this,function(t){switch(t.label){case 0:return[4,b.revision({filterByTk:N.id,filter:{key:N.key}})];case 1:return e=t.sent().data.data,m.message.success(o("Operation succeeded")),r("/admin/workflow/workflows/".concat(e.id)),[2]}})})).apply(this,arguments)}function V(){return(V=n0(function(){var e;return n5(this,function(t){return e=N.current?k("Delete a main version will cause all other revisions to be deleted too."):"",E.confirm({title:o("Are you sure you want to delete it?"),content:e,onOk:function(){return n0(function(){var e;return n5(this,function(t){switch(t.label){case 0:return[4,b.destroy({filterByTk:N.id})];case 1:return t.sent(),m.message.success(o("Operation succeeded")),r(N.current?i.pluginSettingsManager.getRoutePath("workflow"):D(null===(e=F.find(function(e){return e.current}))||void 0===e?void 0:e.id)),[2]}})})()}}),[2]})})).apply(this,arguments)}function _(){return(_=n0(function(e){return n5(this,function(t){switch(e.key){case"history":w(!0);break;case"revision":return[2,function(){return B.apply(this,arguments)}()];case"delete":return[2,function(){return V.apply(this,arguments)}()]}return[2]})})).apply(this,arguments)}var W=N.executed&&!F.find(function(e){return!e.executed&&new Date(e.createdAt)>new Date(N.createdAt)});return c().createElement(x.Provider,{value:{workflow:N,nodes:T,refresh:s}},c().createElement("div",{className:"workflow-toolbar"},c().createElement("header",null,c().createElement(m.Breadcrumb,{items:[{title:c().createElement(d.Link,{to:i.pluginSettingsManager.getRoutePath("workflow")},k("Workflow"))},{title:c().createElement(m.Tooltip,{title:"Key: ".concat(N.key)},c().createElement("strong",null,N.title))}]})),c().createElement("aside",null,N.sync?c().createElement(m.Tag,{color:"orange"},k("Synchronously")):c().createElement(m.Tag,{color:"cyan"},k("Asynchronously")),c().createElement(m.Dropdown,{className:"workflow-versions",trigger:["click"],menu:{onClick:function(e){var t=e.key;t!=N.id&&r(D(t))},defaultSelectedKeys:["".concat(N.id)],className:(0,f.cx)(j.dropdownClass,j.workflowVersionDropdownClass),items:F.sort(function(e,t){return t.id-e.id}).map(function(e,t){return{role:"button","aria-label":"version-".concat(t),key:"".concat(e.id),icon:e.current?c().createElement(O.RightOutlined,null):null,className:(0,f.cx)({executed:e.executed,unexecuted:!e.executed,enabled:e.enabled}),label:c().createElement(c().Fragment,null,c().createElement("strong",null,"#".concat(e.id)),c().createElement("time",null,(0,p.str2moment)(e.createdAt).format("YYYY-MM-DD HH:mm:ss")))}})}},c().createElement(m.Button,{type:"text","aria-label":"version"},c().createElement("label",null,k("Version")),c().createElement("span",null,(null==N?void 0:N.id)?"#".concat(N.id):null),c().createElement(O.DownOutlined,null))),c().createElement(m.Switch,{checked:N.enabled,onChange:function(e){return M.apply(this,arguments)},checkedChildren:k("On"),unCheckedChildren:k("Off")}),c().createElement(m.Dropdown,{menu:{items:[{key:"key",label:"Key: ".concat(N.key),disabled:!0},{type:"divider"},{role:"button","aria-label":"history",key:"history",label:k("Execution history"),disabled:!N.allExecuted},{role:"button","aria-label":"revision",key:"revision",label:k("Copy to new version"),disabled:!W},{type:"divider"},{role:"button","aria-label":"delete",danger:!0,key:"delete",label:o("Delete")}],onClick:function(e){return _.apply(this,arguments)}}},c().createElement(m.Button,{"aria-label":"more",type:"text",icon:c().createElement(O.EllipsisOutlined,null)})),c().createElement(f.ActionContextProvider,{value:{visible:g,setVisible:w}},c().createElement(f.SchemaComponent,{schema:nq,components:{ExecutionResourceProvider:n6,ExecutionLink:n_,ExecutionStatusColumn:nY},scope:{useRefreshActionProps:nQ}})))),c().createElement(nA,{entry:R}))}var n8=function(){var e,t,n,r=(0,d.useParams)(),o=eP().styles;return c().createElement("div",{className:(0,f.cx)(o.workflowPageClass)},c().createElement(f.SchemaComponent,{schema:{type:"void",properties:(e={},t="provider_".concat(r.id),n={type:"void","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:{name:"workflows",fields:[]},resourceName:"workflows",request:{resource:"workflows",action:"get",params:{filter:{id:r.id},appends:["nodes","revisions.id","revisions.createdAt","revisions.current","revisions.executed","revisions.enabled"]}}},"x-component":"WorkflowCanvas"},t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e)},components:{WorkflowCanvas:n4}}))};function n7(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}function n9(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}var re=function(e){var t,n=e.request,r=(e.filter,function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){if(n=i[r],!(t.indexOf(n)>=0))Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}(e,["request","filter"])),o=(0,f.useRecord)(),i=n9(n7({},r),{request:n9(n7({},n),{params:n9(n7({},null==n?void 0:n.params),{filter:n9(n7({},null==n?void 0:null===(t=n.params)||void 0===t?void 0:t.filter),{key:o.key})})})});return c().createElement(f.ResourceActionProvider,i)},rt=function(){var e=(0,S.useTranslation)().t,t=(0,f.useRecord)().id,n=(0,f.useActionContext)().setVisible,r=(0,f.useGetAriaLabelOfAction)("Configure").getAriaLabel;return c().createElement(d.Link,{"aria-label":r(),to:D(t),onClick:function(){return n(!1)}},e("Configure"))};function rn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function rr(e){var t,n,r,o,i=e.component,a=e.children,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){if(n=i[r],!(t.indexOf(n)>=0))Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}(e,["component","children"]);var p=(t=(0,l.useState)(!1),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return rn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rn(e,t)}}(t,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),d=p[0],m=p[1],y=(0,u.useFieldSchema)();return c().createElement(f.ActionContextProvider,{value:{visible:d,setVisible:m,fieldSchema:y}},c().createElement(void 0===i?"div":i,(r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}({},s),o=(o={onClick:function(){m(!0)}},o),Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(o)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}),r),a),c().createElement(f.SchemaComponent,{schema:y,onlyRenderProperties:!0}))}function ro(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function ri(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){ro(i,r,o,a,l,"next",e)}function l(e){ro(i,r,o,a,l,"throw",e)}a(void 0)})}}function ra(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rl(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}var rc={name:"workflows",fields:[{type:"string",name:"title",interface:"input",uiSchema:{title:'{{t("Name")}}',type:"string","x-component":"Input",required:!0}},{type:"string",name:"type",interface:"select",uiSchema:{title:'{{t("Trigger type", { ns: "'.concat(E,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"Select",enum:"{{useTriggersOptions()}}","x-component-props":{optionRender:function(e){var t=e.data,n=t.label,r=t.color,o=t.options,i=(0,f.useCompile)();return c().createElement(m.Space,{direction:"vertical"},c().createElement(m.Tag,{color:r},i(n)),c().createElement(m.Typography.Text,{type:"secondary",style:{whiteSpace:"normal"}},i(o.description)))},popupMatchSelectWidth:!0,listHeight:300},required:!0}},{type:"boolean",name:"sync",interface:"select",uiSchema:{title:'{{t("Mode", { ns: "'.concat(E,'" })}}'),type:"boolean","x-decorator":"FormItem","x-component":"Select",enum:[{label:'{{ t("Asynchronously", { ns: "'.concat(E,'" }) }}'),value:!1,color:"cyan"},{label:'{{ t("Synchronously", { ns: "'.concat(E,'" }) }}'),value:!0,color:"orange"}],required:!0}},{type:"string",name:"description",interface:"textarea",uiSchema:{title:'{{t("Description")}}',type:"string","x-component":"Input.TextArea"}},{type:"boolean",name:"enabled",interface:"radioGroup",uiSchema:{title:'{{t("Status", { ns: "'.concat(E,'" })}}'),type:"string",enum:[{label:'{{t("On", { ns: "'.concat(E,'" })}}'),value:!0,color:"#52c41a"},{label:'{{t("Off", { ns: "'.concat(E,'" })}}'),value:!1}],"x-component":"Radio.Group","x-decorator":"FormItem",default:!1}},{type:"number",name:"allExecuted",interface:"integer",uiSchema:{title:'{{t("Executed", { ns: "'.concat(E,'" })}}'),type:"number","x-component":"InputNumber","x-decorator":"FormItem"}},{type:"object",name:"options"}]},ru={title:{"x-component":"CollectionField","x-decorator":"FormItem"},type:{"x-component":"CollectionField","x-decorator":"FormItem"},sync:{type:"boolean",title:'{{ t("Execute mode", { ns: "'.concat(E,'" }) }}'),description:'{{ t("Execute workflow asynchronously or synchronously based on trigger type, and could not be changed after created.", { ns: "'.concat(E,'" }) }}'),"x-decorator":"FormItem","x-component":"SyncOptionSelect","x-component-props":{options:[{label:'{{ t("Asynchronously", { ns: "'.concat(E,'" }) }}'),value:!1,tooltip:'{{ t("Will be executed in the background as a queued task.", { ns: "'.concat(E,'" }) }}')},{label:'{{ t("Synchronously", { ns: "'.concat(E,'" }) }}'),value:!0,tooltip:'{{ t("For user actions that require immediate feedback. Can not use asynchronous nodes in such mode, and it is not recommended to perform time-consuming operations under synchronous mode.", { ns: "'.concat(E,'" }) }}')}]}},enabled:{"x-component":"CollectionField","x-decorator":"FormItem"},description:{"x-component":"CollectionField","x-decorator":"FormItem"},options:{type:"object","x-component":"fieldset",properties:{deleteExecutionOnStatus:{type:"array",title:'{{ t("Auto delete history when execution is on end status", { ns: "'.concat(E,'" }) }}'),"x-decorator":"FormItem","x-component":"ExecutionStatusSelect","x-component-props":{multiple:!0}}}}},rs=ra({name:"workflow",type:"void"},"properties",ra({},"provider",ra({type:"void","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:rc,resourceName:"workflows",request:{resource:"workflows",action:"list",params:{filter:{current:!0},sort:["-createdAt"],except:["config"]}}},"x-component":"CollectionProvider_deprecated","x-component-props":{collection:rc}},"properties",ra({actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{filter:{type:"void",title:'{{ t("Filter") }}',default:{$and:[{title:{$includes:""}}]},"x-action":"filter","x-component":"Filter.Action","x-use-component-props":"cm.useFilterActionProps","x-component-props":{icon:"FilterOutlined"},"x-align":"left"},refresher:{type:"void",title:'{{ t("Refresh") }}',"x-component":"Action","x-use-component-props":"useRefreshActionProps","x-component-props":{icon:"ReloadOutlined"}},sync:{type:"void",title:'{{t("Sync", { ns: "'.concat(E,'" })}}'),"x-decorator":"Tooltip","x-decorator-props":{title:'{{ t("Sync enabled status of all workflows from database", { ns: "'.concat(E,'" }) }}')},"x-component":"Action","x-component-props":{icon:"SyncOutlined",useAction:function(){var e=(0,S.useTranslation)().t,t=(0,f.useResourceContext)().resource,n=(0,f.useResourceActionContext)();return{run:function(){return ri(function(){return rl(this,function(r){switch(r.label){case 0:return[4,t.sync()];case 1:return r.sent(),[4,null==n?void 0:n.refresh()];case 2:return r.sent(),m.message.success(e("Operation succeeded")),[2]}})})()}}}},"x-reactions":["{{useWorkflowSyncAction}}"]},delete:{type:"void",title:'{{t("Delete")}}',"x-component":"Action","x-component-props":{icon:"DeleteOutlined",useAction:"{{ cm.useBulkDestroyAction }}",confirm:{title:"{{t('Delete record')}}",content:"{{t('Are you sure you want to delete it?')}}"}}},create:{type:"void",title:'{{t("Add new")}}',"x-component":"Action","x-component-props":{type:"primary",icon:"PlusOutlined"},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{initialValue:{current:!0}},title:'{{t("Add new")}}',properties:{title:ru.title,type:ru.type,sync:ru.sync,description:ru.description,options:ru.options,footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{ t("Cancel") }}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{ t("Submit") }}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ cm.useCreateAction }}"}}}}}}}}}}},"table",ra({type:"void","x-component":"Table.Void","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"},useDataSource:"{{ cm.useDataSourceFromRAC }}"}},"properties",ra({title:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{title:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},type:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{type:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},sync:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{sync:{type:"boolean","x-component":"CollectionField","x-read-pretty":!0}}},enabled:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{enabled:{type:"boolean","x-component":"CollectionField","x-read-pretty":!0,default:!1}}},allExecuted:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{allExecuted:{type:"number","x-decorator":"OpenDrawer","x-decorator-props":{component:function(e){var t=(0,f.useRecord)();return c().createElement("a",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){ra(e,t,n[t])})}return e}({"aria-label":"executed-".concat(t.title)},e))}},"x-component":"CollectionField","x-read-pretty":!0,properties:{drawer:nq}}}}},"actions",ra({type:"void",title:'{{ t("Actions") }}',"x-component":"Table.Column"},"properties",ra({},"actions",ra({type:"void","x-component":"Space","x-component-props":{split:"|"}},"properties",(ra(i={configure:{type:"void","x-component":"WorkflowLink"},update:{type:"void",title:'{{ t("Edit") }}',"x-component":"Action.Link","x-component-props":{type:"primary"},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues:"{{ cm.useValuesFromRecord }}"},title:'{{ t("Edit") }}',properties:{title:ru.title,enabled:ru.enabled,sync:ru.sync,description:ru.description,options:ru.options,footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{ t("Cancel") }}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{ t("Submit") }}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ cm.useUpdateAction }}"}}}}}}}}},"revision",ra({type:"void",title:'{{t("Duplicate", { ns: "'.concat(E,'" })}}'),"x-component":"Action.Link","x-component-props":{openSize:"small"}},"properties",ra({},"modal",ra({type:"void",title:'{{t("Duplicate to new workflow", { ns: "'.concat(E,'" })}}'),"x-decorator":"FormV2","x-component":"Action.Modal"},"properties",ra({title:{type:"string",title:'{{t("Title")}}',"x-decorator":"FormItem","x-component":"Input"}},"footer",ra({type:"void","x-component":"Action.Modal.Footer"},"properties",(ra(o={},"submit",ra({type:"void",title:'{{t("Submit")}}',"x-component":"Action"},"x-component-props",ra({type:"primary"},"useAction",function(){var e=(0,S.useTranslation)().t,t=(0,f.useResourceActionContext)().refresh,n=(0,f.useResourceContext)(),r=n.resource,o=n.targetKey,i=(0,f.useActionContext)().setVisible,a=(0,f.useRecord)()[o],l=(0,u.useForm)().values;return{run:function(){return ri(function(){return rl(this,function(n){switch(n.label){case 0:return[4,r.revision({filterByTk:a,values:l})];case 1:return n.sent(),m.message.success(e("Operation succeeded")),t(),i(!1),[2]}})})()}}}))),ra(o,"cancel",{type:"void",title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}}),o))))))),ra(i,"delete",{type:"void",title:'{{ t("Delete") }}',"x-component":"Action.Link","x-component-props":{confirm:{title:"{{t('Delete record')}}",content:"{{t('Are you sure you want to delete it?')}}"},useAction:"{{ cm.useDestroyActionAndRefreshCM }}"}}),i))))))))));function rf(e){var t=(0,u.useField)(),n=(0,f.useRecord)(),r=(0,f.usePlugin)(ab);return(0,u.useFormEffects)(function(e){(0,w.onFieldChange)("type",function(e){var o=n.id||!e.value;if(e.value){var i=r.triggers.get(e.value);null!=i.sync?(o=!0,t.setValue(i.sync)):t.setInitialValue(!1)}t.setPattern(o?"disabled":"editable")})}),(0,l.useEffect)(function(){if(n.id){t.setPattern("disabled");var e=r.triggers.get(n.type);null!=e.sync?t.setValue(e.sync):t.setInitialValue(!1)}},[n.id,t,r.triggers]),c().createElement(tx,e)}function rp(e){var t=(0,f.useApp)();e.visible=!!((0,f.usePlugin)("multi-app-share-collection")||"main"!==t.name)}function rd(){var e,t,n=(0,l.useContext)(f.SchemaComponentContext),r=(0,f.usePlugin)(ab).useTriggersOptions;return c().createElement(m.Card,{bordered:!1},c().createElement(f.SchemaComponentContext.Provider,{value:(e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}({},n),t=(t={designable:!1},t),Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e)},c().createElement(f.SchemaComponent,{schema:rs,components:{WorkflowLink:rt,ExecutionResourceProvider:re,ExecutionLink:n_,OpenDrawer:rr,ExecutionStatusSelect:nH,SyncOptionSelect:rf,ExecutionStatusColumn:nY,Tooltip:m.Tooltip},scope:{useTriggersOptions:r,useWorkflowSyncAction:rp,useRefreshActionProps:nQ}})))}function rm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ry(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function rb(){var e=ry(["\n flex-direction: column;\n "]);return rb=function(){return e},e}function rv(){var e=ry(["\n position: relative;\n width: 100%;\n "]);return rv=function(){return e},e}var rh={type:"string",title:'{{t("Collection")}}',required:!0,"x-reactions":[],"x-decorator":"FormItem","x-component":"DataSourceCollectionCascader"},rg={type:"object",title:'{{t("Fields values")}}',description:'{{t("Unassigned fields will be set to default values, and those without default values will be set to null.", { ns: "'.concat(E,'" })}}'),"x-decorator":"FormItem","x-decorator-props":{labelAlign:"left",className:(0,f.css)(rb())},"x-component":"CollectionFieldset"},rO={type:"object",title:'{{t("Filter")}}',"x-decorator":"FormItem","x-component":"Filter","x-use-component-props":function(){var e,t,n=(0,u.useForm)().values;var r=(e=(0,f.parseCollectionName)(null==n?void 0:n.collection),t=2,function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(e,2)||function(e,t){if(e){if("string"==typeof e)return rm(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rm(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=r[0],i=r[1];return{options:(0,f.useCollectionFilterOptions)(i,o),className:(0,f.css)(rv())}},"x-component-props":{dynamicComponent:"FilterDynamicComponent"}},rw={type:"array",title:'{{t("Sort")}}',"x-decorator":"FormItem","x-component":"ArrayItems",items:{type:"object",properties:{space:{type:"void","x-component":"Space",properties:{sort:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.SortHandle"},field:{type:"string",enum:"{{useSortableFields()}}",required:!0,"x-decorator":"FormItem","x-component":"Select","x-component-props":{style:{width:260}}},direction:{type:"string","x-decorator":"FormItem","x-component":"Radio.Group","x-component-props":{optionType:"button"},enum:[{label:'{{t("ASC")}}',value:"asc"},{label:'{{t("DESC")}}',value:"desc"}]},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:'{{t("Add sort field")}}',"x-component":"ArrayItems.Addition"}}},rx={type:"void",title:'{{t("Pagination")}}',"x-decorator":"SchemaComponentContext.Provider","x-decorator-props":{value:{designable:!1}},"x-component":"Grid",properties:{row:{type:"void","x-component":"Grid.Row",properties:{page:{type:"void","x-component":"Grid.Col",properties:{page:{type:"number",title:'{{t("Page number")}}',"x-decorator":"FormItem","x-component":"WorkflowVariableInput","x-component-props":{useTypedConstant:["number","null"]},default:1}}},pageSize:{type:"void","x-component":"Grid.Col",properties:{pageSize:{type:"number",title:'{{t("Page size")}}',"x-decorator":"FormItem","x-component":"InputNumber","x-component-props":{min:1},default:20}}}}}}},rj={type:"array",title:'{{t("Preload associations", { ns: "'.concat(E,'" })}}'),description:'{{t("Please select the associated fields that need to be accessed in subsequent nodes. With more than two levels of to-many associations may cause performance issue, please use with caution.", { ns: "'.concat(E,'" })}}'),"x-decorator":"FormItem","x-component":"AppendsTreeSelect","x-component-props":{title:"Preload associations",multiple:!0,useCollection:function(){var e=(0,u.useForm)().values;return null==e?void 0:e.collection}},"x-reactions":[{dependencies:["collection"],fulfill:{state:{visible:"{{!!$deps[0]}}"}}}]};function rS(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function rE(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){rS(i,r,o,a,l,"next",e)}function l(e){rS(i,r,o,a,l,"throw",e)}a(void 0)})}}function rk(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}function rC(){var e=(0,f.useAPIClient)(),t=(0,u.useForm)(),n=(0,f.useBlockRequestContext)(),r=n.field,o=n.__parent,i=(0,f.useActionContext)().setVisible,a=(0,d.useNavigate)(),l=(0,u.useFieldSchema)(),c=(0,u.useField)(),s=(0,f.useCompile)(),y=m.App.useApp().modal,b=(0,f.useCollectValuesToSubmit)(),v=c.componentProps.filterKeys||[];return{onClick:function(){return rE(function(){var n,u,f,d,h,g,O,w,x,j;return rk(this,function(j){switch(j.label){case 0:if(f=(u=null!==(n=null==l?void 0:l["x-action-settings"])&&void 0!==n?n:{}).onSuccess,d=u.skipValidator,h=u.triggerWorkflows,d)return[3,2];return[4,t.submit()];case 1:j.sent(),j.label=2;case 2:return[4,b()];case 3:g=j.sent(),c.data=r.data||{},c.data.loading=!0,j.label=4;case 4:return j.trys.push([4,6,,7]),[4,e.resource("workflows").trigger({values:g,filterKeys:v,triggerWorkflows:(null==h?void 0:h.length)?h.map(function(e){return[e.workflowKey,e.context].filter(Boolean).join("!")}).join(","):void 0})];case 5:if(x=j.sent(),c.data.loading=!1,c.data.data=x,null==o||null===(w=o.service)||void 0===w||null===(O=w.refresh)||void 0===O||O.call(w),null==i||i(!1),!(null==f?void 0:f.successMessage))return[2];return(null==f?void 0:f.manualClose)?y.success({title:s(null==f?void 0:f.successMessage),onOk:rE(function(){return rk(this,function(e){switch(e.label){case 0:return[4,t.reset()];case 1:return e.sent(),(null==f?void 0:f.redirecting)&&(null==f?void 0:f.redirectTo)&&((0,p.isURL)(f.redirectTo)?window.location.href=f.redirectTo:a(f.redirectTo)),[2]}})})}):m.message.success(s(null==f?void 0:f.successMessage)),[3,7];case 6:return j.sent(),c.data.loading=!1,[3,7];case 7:return[2]}})})()}}}function rP(){var e,t=(0,f.useCompile)(),n=(0,f.useAPIClient)(),r=(0,f.useRecord)(),o=(0,u.useField)(),i=(0,u.useFieldSchema)(),a=(0,f.useBlockRequestContext)(),l=a.field;a.__parent;var c=(0,f.useActionContext)(),s=c.setVisible,y=c.setSubmitted,b=m.App.useApp().modal,v=(0,d.useNavigate)(),h=null!==(e=null==i?void 0:i["x-action-settings"])&&void 0!==e?e:{},g=h.onSuccess,O=h.triggerWorkflows;return{onClick:function(e,i){return rE(function(){return rk(this,function(e){switch(e.label){case 0:o.data=l.data||{},o.data.loading=!0,e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,n.resource("workflows").trigger({values:r,triggerWorkflows:(null==O?void 0:O.length)?O.map(function(e){return[e.workflowKey,e.context].filter(Boolean).join("!")}).join(","):void 0})];case 2:if(e.sent(),i&&i(),null==s||s(!1),null==y||y(!0),!(null==g?void 0:g.successMessage))return[2];return(null==g?void 0:g.manualClose)?b.success({title:t(null==g?void 0:g.successMessage),onOk:function(){return rE(function(){return rk(this,function(e){return(null==g?void 0:g.redirecting)&&(null==g?void 0:g.redirectTo)&&((0,p.isURL)(g.redirectTo)?window.location.href=g.redirectTo:v(g.redirectTo)),[2]})})()}}):m.message.success(t(null==g?void 0:g.successMessage)),[3,5];case 3:return console.error(e.sent()),[3,5];case 4:return o.data.loading=!1,[7];case 5:return[2]}})})()}}}function rA(){var e=j().workflow;return!!(null==e?void 0:e.executed)}function rD(){var e=j().workflow;return!!(null==e?void 0:e.allExecuted)}function rT(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function rI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function rF(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rN(e){return(rN=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function rR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){rF(e,t,n[t])})}return e}function rM(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function rB(e,t){return(rB=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function rV(e){return function(e){if(Array.isArray(e))return rT(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||r_(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r_(e,t){if(e){if("string"==typeof e)return rT(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rT(e,t)}}function rW(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(rW=function(){return!!e})()}var rz=1,rq=2,rL=3,r$=4,rU=[{label:'{{t("After record added", { ns: "'.concat(E,'" })}}'),value:rz},{label:'{{t("After record updated", { ns: "'.concat(E,'" })}}'),value:rq},{label:'{{t("After record added or updated", { ns: "'.concat(E,'" })}}'),value:rL},{label:'{{t("After record deleted", { ns: "'.concat(E,'" })}}'),value:r$}];function rG(e,t){var n,r,o,i=(n=(0,f.parseCollectionName)(e.collection),r=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(n,2)||r_(n,r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=i[0],l=i[1],c=(0,f.useCompile)(),u=ty(a),s=[{collectionName:l,name:"data",type:"hasOne",target:l,uiSchema:{title:k("Trigger data")}}];return tm(rM(rR({appends:["data"].concat(rV((null===(o=e.appends)||void 0===o?void 0:o.map(function(e){return"data.".concat(e)}))||[]))},t),{fields:s,compile:c,getCollectionFields:u}))}var rJ=function(e){var t,n,r;function o(){var e,t,n,r;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,o),t=this,n=o,r=arguments,n=rN(n),rF(e=function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(t,rW()?Reflect.construct(n,r||[],rN(t).constructor):n.apply(t,r)),"title",'{{t("Collection event", { ns: "'.concat(E,'" })}}')),rF(e,"description",'{{t(\'Triggered when data changes in the collection, such as after adding, updating, or deleting a record. Unlike "Post-action event", Collection event listens for data changes rather than HTTP requests. Unless you understand the exact meaning, it is recommended to use "Post-action event".\', { ns: "'.concat(E,'" })}}')),rF(e,"fieldset",{collection:rM(rR({},rh),rF({"x-disabled":"{{ useWorkflowAnyExecuted() }}","x-component-props":{dataSourceFilter:function(e){return"main"===e.options.key||e.options.isDBInstance}}},"x-reactions",rV(rh["x-reactions"]).concat([{target:"changed",effects:["onFieldValueChange"],fulfill:{state:{value:[]}}},{target:"condition",effects:["onFieldValueChange"],fulfill:{state:{value:null}}},{target:"appends",effects:["onFieldValueChange"],fulfill:{state:{value:[]}}}]))),mode:{type:"number",title:'{{t("Trigger on", { ns: "'.concat(E,'" })}}'),"x-decorator":"FormItem","x-component":"Select","x-component-props":{popupMatchSelectWidth:!1,placeholder:'{{t("Trigger on", { ns: "'.concat(E,'" })}}'),className:"auto-width"},enum:rU,required:!0,"x-reactions":[{dependencies:["collection"],fulfill:{state:{visible:"{{!!$deps[0]}}"}}}]},changed:{type:"array",title:'{{t("Changed fields", { ns: "'.concat(E,'" })}}'),description:'{{t("Triggered only if one of the selected fields changes. If unselected, it means that it will be triggered when any field changes. When record is added or deleted, any field is considered to have been changed.", { ns: "'.concat(E,'" })}}'),"x-decorator":"FormItem","x-component":"FieldsSelect","x-component-props":{mode:"multiple",placeholder:'{{t("Select field")}}',filter:function(e){return!e.hidden&&(!e.uiSchema||!e.uiSchema["x-read-pretty"])&&!["linkTo","hasOne","hasMany","belongsToMany"].includes(e.type)}},"x-reactions":[{dependencies:["collection","mode"],fulfill:{state:{visible:"{{!!$deps[0] && ($deps[1] & ".concat(rq,")}}")}}}]},condition:rM(rR({},rO),{title:'{{t("Only triggers when match conditions", { ns: "'.concat(E,'" })}}'),"x-component-props":{},"x-reactions":[{dependencies:["collection","mode"],fulfill:{state:{visible:"{{!!$deps[0] && !($deps[1] & ".concat(r$,")}}")}}}]}),appends:rM(rR({},rj),{"x-reactions":rV(rj["x-reactions"]).concat([{dependencies:["mode"],fulfill:{state:{visible:"{{!($deps[0] & ".concat(r$,")}}")}}}])})}),rF(e,"scope",{useCollectionDataSource:f.useCollectionDataSource,useWorkflowAnyExecuted:rD}),rF(e,"components",{FieldsSelect:q}),rF(e,"useVariables",rG),e}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&rB(e,t)}(o,e),t=o,n=[{key:"useInitializers",value:function(e){return e.collection?{name:"triggerData",type:"item",key:"triggerData",title:'{{t("Trigger data", { ns: "'.concat(E,'" })}}'),Component:M,collection:e.collection,dataPath:"$context.data"}:null}}],rI(t.prototype,n),o}(ng),rH=0,rY=1,rK=v("760"),rQ=v.n(rK);function rZ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function rX(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}function r0(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function r1(){var e,t,n=(e=["\n display: flex;\n gap: 0.5em;\n "],!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return r1=function(){return n},n}function r2(e){return!e.hidden&&!!e.uiSchema&&"date"===e.type}function r3(e){var t,n,r=e.value,o=e.onChange,i=null!=r?r:{},a=(0,S.useTranslation)().t;var u=(t=(0,l.useState)(i.offset?i.offset/Math.abs(i.offset):0),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return rZ(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rZ(e,t)}}(t,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=u[0],p=u[1];return c().createElement("fieldset",{className:(0,f.css)(r1())},c().createElement(q,{value:i.field,onChange:function(e){return o(r0(rX({},i),{field:e}))},filter:r2,placeholder:a("Select field"),className:"auto-width"}),i.field?c().createElement(m.Select,{value:s,onChange:function(e){p(e),o(r0(rX({},i),{offset:Math.abs(i.offset)*e}))},options:[{value:0,label:k("Exactly at")},{value:-1,label:a("Before")},{value:1,label:a("After")}],className:"auto-width"}):null,s?c().createElement(c().Fragment,null,c().createElement(m.InputNumber,{value:Math.abs(i.offset),onChange:function(e){return o(r0(rX({},i),{offset:(null!=e?e:0)*s}))}}),c().createElement(m.Select,{value:i.unit||864e5,onChange:function(e){return o(r0(rX({},i),{unit:e}))},options:[{value:864e5,label:k("Days")},{value:36e5,label:k("Hours")},{value:6e4,label:k("Minutes")},{value:1e3,label:k("Seconds")}],className:"auto-width"})):null)}function r5(){var e,t,n=(e=["\n display: flex;\n gap: 0.5em;\n "],!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return r5=function(){return n},n}function r6(e){var t,n,r,o=e.value,i=e.onChange,a=C().t;var l=null!=o?(void 0===o?"undefined":(t=o)&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t)!="object"||(n=o,null!=(r=Date)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](n):n instanceof r)?"date":"field":null;return c().createElement("fieldset",{className:(0,f.css)(r5())},c().createElement(m.Select,{value:l,onChange:function(e){i(e?"field"===e?{}:new Date:null)},className:"auto-width"},c().createElement(m.Select.Option,{value:null},a("No end")),c().createElement(m.Select.Option,{value:"field"},a("By field")),c().createElement(m.Select.Option,{value:"date"},a("By custom date"))),"field"===l?c().createElement(r3,{value:o,onChange:i}):null,"date"===l?c().createElement(m.DatePicker,{showTime:!0,value:rQ()(o),onChange:function(e){i(e?e.toDate():null)}}):null)}var r4=v("704"),r8=function(){return(r8=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function r7(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function r9(e,t,n){if(n||2==arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}var oe=[{name:"@yearly",value:"0 0 1 1 *"},{name:"@annually",value:"0 0 1 1 *"},{name:"@monthly",value:"0 0 1 * *"},{name:"@weekly",value:"0 0 * * 0"},{name:"@daily",value:"0 0 * * *"},{name:"@midnight",value:"0 0 * * *"},{name:"@hourly",value:"0 * * * *"}],ot=[{type:"minutes",min:0,max:59,total:60},{type:"hours",min:0,max:23,total:24},{type:"month-days",min:1,max:31,total:31},{type:"months",min:1,max:12,total:12,alt:["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"]},{type:"week-days",min:0,max:6,total:7,alt:["SUN","MON","TUE","WED","THU","FRI","SAT"]}],on={everyText:"every",emptyMonths:"every month",emptyMonthDays:"every day of the month",emptyMonthDaysShort:"day of the month",emptyWeekDays:"every day of the week",emptyWeekDaysShort:"day of the week",emptyHours:"every hour",emptyMinutes:"every minute",emptyMinutesForHourPeriod:"every",yearOption:"year",monthOption:"month",weekOption:"week",dayOption:"day",hourOption:"hour",minuteOption:"minute",rebootOption:"reboot",prefixPeriod:"Every",prefixMonths:"in",prefixMonthDays:"on",prefixWeekDays:"on",prefixWeekDaysForMonthAndYearPeriod:"and",prefixHours:"at",prefixMinutes:":",prefixMinutesForHourPeriod:"at",suffixMinutesForHourPeriod:"minute(s)",errorInvalidCron:"Invalid cron expression",clearButtonText:"Clear",weekDays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],altWeekDays:["SUN","MON","TUE","WED","THU","FRI","SAT"],altMonths:["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"]};function or(e,t){for(var n=[],r=e;r<=t;r++)n.push(r);return n}function oo(e){return e.sort(function(e,t){return e-t}),e}function oi(e){var t=[];return e.forEach(function(e){0>t.indexOf(e)&&t.push(e)}),t}function oa(e){return Object.entries(e).filter(function(e){var t=e[0],n=e[1];return t&&n}).map(function(e){return e[0]}).join(" ")}function ol(e,t){e&&e({type:"invalid_cron",description:t.errorInvalidCron||on.errorInvalidCron})}function oc(e){var t=parseInt(e,10),n=Number(e);return t===n?n:NaN}function ou(e,t,n,r,o,i,a,l,c,u,s,f,p,d){n&&n(void 0),t(!1);var m=!1;if(!e){if("always"===r||i&&"for-default-value"===r)return;m=!0}if(!m){if(l&&(!0===l||l.includes(e))){if("@reboot"===e)return void d("reboot");var y=oe.find(function(t){return t.name===e});y&&(e=y.value)}try{var b,v=function(e){if("string"!=typeof e)throw Error("Invalid cron string");var t=e.replace(/\s+/g," ").trim().split(" ");if(5===t.length)return t.map(function(e,t){return function(e,t){if("*"===e||"*/1"===e)return[];var n=oo(oi(om((function(e,t,n){if(n){e=e.toUpperCase();for(var r=0;r<n.length;r++)e=e.replace(n[r],"".concat(r+t))}return e})(e,t.min,t.alt).split(",").map(function(n){var r,o=n.split("/");if(o.length>2)throw Error('Invalid value "'.concat(e,' for "').concat(t.type,'"'));var i=o[0],a=o[1];r="*"===i?or(t.min,t.max):function(e,t,n){var r=e.split("-");if(1===r.length){var o=oc(r[0]);if(isNaN(o))throw Error('Invalid value "'.concat(t,'" for ').concat(n.type));return[o]}if(2===r.length){var i=oc(r[0]),a=oc(r[1]);if(isNaN(i)||isNaN(a))throw Error('Invalid value "'.concat(t,'" for ').concat(n.type));if(a<i)throw Error('Max range is less than min range in "'.concat(e,'" for ').concat(n.type));return or(i,a)}throw Error('Invalid value "'.concat(e,'" for ').concat(n.type))}(i,e,t);var l=function(e,t){if(void 0!==e){var n=oc(e);if(isNaN(n)||n<1)throw Error('Invalid interval step value "'.concat(e,'" for ').concat(t.type));return n}}(a,t);return function(e,t){if(t){var n=e[0];e=e.filter(function(e){return e%t==n%t||e===n})}return e}(r,l)}).flat(),t))),r=oy(n,t);if(void 0!==r)throw Error('Value "'.concat(r,'" out of range for ').concat(t.type));return n.length===t.total?[]:n}(e,ot[t])});throw Error("Invalid cron string format")}(e),h=(b=v)[3].length>0?"year":b[2].length>0?"month":b[4].length>0?"week":b[1].length>0?"day":b[0].length>0?"hour":"minute";d(h),c(v[0]),u(v[1]),s(v[2]),f(v[3]),p(v[4])}catch(e){m=!0}}m&&(o.current=e,t(!0),ol(n,a))}function os(e,t,n,r,o,i,a){var l,c;if("reboot"===e)return"@reboot";return(l=["minute"!==e&&i?i:[],"minute"!==e&&"hour"!==e&&o?o:[],("year"===e||"month"===e)&&n?n:[],"year"===e&&t?t:[],("year"===e||"month"===e||"week"===e)&&r?r:[]],c=a,l.map(function(e,t){var n=ot[t];return of(od(e,n),n,c)})).join(" ")}function of(e,t,n,r,o){var i="";if(a=e,l=t,a.length===l.max-l.min+1||0===e.length)i="*";else{var a,l,c,u,s,f,p,d,m,y,b=function(e){if(e.length>2){var t=e[1]-e[0];if(t>1)return t}}(e);i=b&&function(e,t){for(var n=1;n<e.length;n++){var r=e[n-1];if(e[n]-r!==t)return!1}return!0}(e,b)?(c=e,u=t,s=b,f=function(e){return e[0]}(c),p=ov(c),d=c.length===(p-f)/s+1,f===u.min&&p+s>u.max&&d)?"*/".concat(b):"".concat(op(function(e){return e[0]}(e),t,n,r,o),"-").concat(op(ov(e),t,n,r,o),"/").concat(b):(m=[],y=null,e.forEach(function(e,t,n){e!==n[t+1]-1?null!==y?(m.push([y,e]),y=null):m.push(e):null===y&&(y=e)}),m).map(function(e){return Array.isArray(e)?"".concat(op(e[0],t,n,r,o),"-").concat(op(e[1],t,n,r,o)):op(e,t,n,r,o)}).join(",")}return i}function op(e,t,n,r,o){var i=e.toString(),a=t.type,l=t.alt,c=t.min,u=r&&(!0===r||r.includes(a)),s="24-hour-clock"===o&&("hours"===a||"minutes"===a);if(n&&"week-days"===a||n&&"months"===a?i=l[e-c]:e<10&&(u||s)&&(i=i.padStart(2,"0")),"hours"===a&&"12-hour-clock"===o){var f=e>=12?"PM":"AM",p=e%12||12;p<10&&u&&(p=p.toString().padStart(2,"0")),i="".concat(p).concat(f)}return i}function od(e,t){var n=oo(oi(om(e,t)));if(0===n.length)return n;var r=oy(n,t);if(void 0!==r)throw Error('Value "'.concat(r,'" out of range for ').concat(t.type));return n}function om(e,t){return"week-days"===t.type&&(e=e.map(function(e){return 7===e?0:e})),e}function oy(e,t){var n=e[0],r=e[e.length-1];return n<t.min?n:r>t.max?r:void 0}function ob(e){return e[0]}function ov(e){return e[e.length-1]}function oh(e){var t=e.value,n=e.grid,r=void 0===n||n,o=e.optionsList,i=e.setValue,a=e.locale,c=e.className,u=e.humanizeLabels,s=e.disabled,f=e.readOnly,p=e.leadingZero,d=e.clockFormat,y=e.period,b=e.unit,v=e.periodicityOnDoubleClick,h=e.mode,g=r7(e,["value","grid","optionsList","setValue","locale","className","humanizeLabels","disabled","readOnly","leadingZero","clockFormat","period","unit","periodicityOnDoubleClick","mode"]),O=(0,l.useMemo)(function(){if(t&&Array.isArray(t))return t.map(function(e){return e.toString()})},[t]),w=(0,l.useMemo)(function(){return o?o.map(function(e,t){return{value:(0===b.min?t:t+1).toString(),label:e}}):r9([],Array(b.total),!0).map(function(e,t){var n=0===b.min?t:t+1;return{value:n.toString(),label:op(n,b,u,p,d)}})},[o,p,u,d]),x=JSON.stringify(a),j=(0,l.useCallback)(function(e){var n=e.value;if(!t||t[0]!==Number(n))return(0,r4.jsx)(r4.Fragment,{});var r=of(od(t,b),b,u,p,d),o=r.match(/^\*\/([0-9]+),?/)||[];return(0,r4.jsx)("div",{children:o[1]?"".concat(a.everyText||on.everyText," ").concat(o[1]):r})},[t,x,u,p,d]),S=(0,l.useCallback)(function(e){var n=Array.isArray(e)?oo(e):[e],r=n;t&&(r="single"===h?[]:r9([],t,!0),n.forEach(function(e){var n=Number(e);r=t.some(function(e){return e===n})?r.filter(function(e){return e!==n}):oo(r9(r9([],r,!0),[n],!1))})),r.length===b.total?i([]):i(r)},[i,t]),E=(0,l.useCallback)(function(e){if(0!==e&&1!==e){for(var n=b.total+b.min,r=[],o=b.min;o<n;o++)o%e==0&&r.push(o);var a=t&&r&&t.length===r.length&&t.every(function(e,t){return e===r[t]});i(r.length===w.length||a?[]:r)}else i([])},[t,w,i]),k=(0,l.useRef)([]),C=(0,l.useCallback)(function(e){if(!f){var t=k.current;t.push({time:(new Date).getTime(),value:Number(e)});var n=window.setTimeout(function(){v&&t.length>1&&t[t.length-1].time-t[t.length-2].time<300?t[t.length-1].value===t[t.length-2].value?E(Number(e)):S([t[t.length-2].value,t[t.length-1].value]):S(Number(e)),k.current=[]},300);return function(){window.clearTimeout(n)}}},[k,S,E,f,v]),P=(0,l.useCallback)(function(){f||i([])},[i,f]),A=(0,l.useMemo)(function(){var e;return oa(((e={"react-js-cron-select":!0,"react-js-cron-custom-select":!0})["".concat(c,"-select")]=!!c,e))},[c]),D=(0,l.useMemo)(function(){var e;return oa(((e={"react-js-cron-select-dropdown":!0})["react-js-cron-select-dropdown-".concat(b.type)]=!0,e["react-js-cron-custom-select-dropdown"]=!0,e["react-js-cron-custom-select-dropdown-".concat(b.type)]=!0,e["react-js-cron-custom-select-dropdown-minutes-large"]="minutes"===b.type&&"hour"!==y&&"day"!==y,e["react-js-cron-custom-select-dropdown-minutes-medium"]="minutes"===b.type&&("day"===y||"hour"===y),e["react-js-cron-custom-select-dropdown-hours-twelve-hour-clock"]="hours"===b.type&&"12-hour-clock"===d,e["react-js-cron-custom-select-dropdown-grid"]=!!r,e["".concat(c,"-select-dropdown")]=!!c,e["".concat(c,"-select-dropdown-").concat(b.type)]=!!c,e))},[c,r,d,y]);return(0,r4.jsx)(m.Select,r8({mode:"single"!==h||v?"multiple":void 0,allowClear:!f,virtual:!1,open:!f&&void 0,value:O,onClear:P,tagRender:j,className:A,popupClassName:D,options:w,showSearch:!1,showArrow:!f,menuItemSelectedIcon:null,dropdownMatchSelectWidth:!1,onSelect:C,onDeselect:C,disabled:s,dropdownAlign:"minutes"!==b.type&&"hours"!==b.type||"day"===y||"hour"===y?void 0:{points:["tr","br"]},"data-testid":"custom-select-".concat(b.type)},g))}function og(e){var t=e.value,n=e.setValue,r=e.locale,o=e.className,i=e.disabled,a=e.readOnly,c=e.leadingZero,u=e.clockFormat,s=e.period,f=e.periodicityOnDoubleClick,p=e.mode,d=(0,l.useMemo)(function(){var e;return oa(((e={"react-js-cron-field":!0,"react-js-cron-hours":!0})["".concat(o,"-field")]=!!o,e["".concat(o,"-hours")]=!!o,e))},[o]);return(0,r4.jsxs)("div",r8({className:d},{children:[""!==r.prefixHours&&(0,r4.jsx)("span",{children:r.prefixHours||on.prefixHours}),(0,r4.jsx)(oh,{placeholder:r.emptyHours||on.emptyHours,value:t,unit:ot[1],setValue:n,locale:r,className:o,disabled:i,readOnly:a,leadingZero:c,clockFormat:u,period:s,periodicityOnDoubleClick:f,mode:p})]}))}function oO(e){var t=e.value,n=e.setValue,r=e.locale,o=e.className,i=e.disabled,a=e.readOnly,c=e.leadingZero,u=e.clockFormat,s=e.period,f=e.periodicityOnDoubleClick,p=e.mode,d=(0,l.useMemo)(function(){var e;return oa(((e={"react-js-cron-field":!0,"react-js-cron-minutes":!0})["".concat(o,"-field")]=!!o,e["".concat(o,"-minutes")]=!!o,e))},[o]);return(0,r4.jsxs)("div",r8({className:d},{children:["hour"===s?""!==r.prefixMinutesForHourPeriod&&(0,r4.jsx)("span",{children:r.prefixMinutesForHourPeriod||on.prefixMinutesForHourPeriod}):""!==r.prefixMinutes&&(0,r4.jsx)("span",{children:r.prefixMinutes||on.prefixMinutes}),(0,r4.jsx)(oh,{placeholder:"hour"===s?r.emptyMinutesForHourPeriod||on.emptyMinutesForHourPeriod:r.emptyMinutes||on.emptyMinutes,value:t,unit:ot[0],setValue:n,locale:r,className:o,disabled:i,readOnly:a,leadingZero:c,clockFormat:u,period:s,periodicityOnDoubleClick:f,mode:p}),"hour"===s&&""!==r.suffixMinutesForHourPeriod&&(0,r4.jsx)("span",{children:r.suffixMinutesForHourPeriod||on.suffixMinutesForHourPeriod})]}))}function ow(e){var t=e.value,n=e.setValue,r=e.locale,o=e.className,i=e.weekDays,a=e.disabled,c=e.readOnly,u=e.leadingZero,s=e.period,f=e.periodicityOnDoubleClick,p=e.mode,d=!i||0===i.length,m=(0,l.useMemo)(function(){var e;return oa(((e={"react-js-cron-field":!0,"react-js-cron-month-days":!0,"react-js-cron-month-days-placeholder":!d})["".concat(o,"-field")]=!!o,e["".concat(o,"-month-days")]=!!o,e))},[o,d]),y=JSON.stringify(r),b=(0,l.useMemo)(function(){return d?r.emptyMonthDays||on.emptyMonthDays:r.emptyMonthDaysShort||on.emptyMonthDaysShort},[d,y]);return c&&(!t||!(t.length>0))&&(t&&0!==t.length||i&&0!==i.length)?null:(0,r4.jsxs)("div",r8({className:m},{children:[""!==r.prefixMonthDays&&(0,r4.jsx)("span",{children:r.prefixMonthDays||on.prefixMonthDays}),(0,r4.jsx)(oh,{placeholder:b,value:t,setValue:n,unit:ot[2],locale:r,className:o,disabled:a,readOnly:c,leadingZero:u,period:s,periodicityOnDoubleClick:f,mode:p})]}))}function ox(e){var t=e.value,n=e.setValue,r=e.locale,o=e.className,i=e.humanizeLabels,a=e.disabled,c=e.readOnly,u=e.period,s=e.periodicityOnDoubleClick,f=e.mode,p=r.months||on.months,d=(0,l.useMemo)(function(){var e;return oa(((e={"react-js-cron-field":!0,"react-js-cron-months":!0})["".concat(o,"-field")]=!!o,e["".concat(o,"-months")]=!!o,e))},[o]);return(0,r4.jsxs)("div",r8({className:d},{children:[""!==r.prefixMonths&&(0,r4.jsx)("span",{children:r.prefixMonths||on.prefixMonths}),(0,r4.jsx)(oh,{placeholder:r.emptyMonths||on.emptyMonths,optionsList:p,grid:!1,value:t,unit:r8(r8({},ot[3]),{alt:r.altMonths||on.altMonths}),setValue:n,locale:r,className:o,humanizeLabels:i,disabled:a,readOnly:c,period:u,periodicityOnDoubleClick:s,mode:f})]}))}function oj(e){var t=e.value,n=e.setValue,r=e.locale,o=e.className,i=e.disabled,a=e.readOnly,c=e.shortcuts,u=e.allowedPeriods,s=[];u.includes("year")&&s.push({value:"year",label:r.yearOption||on.yearOption}),u.includes("month")&&s.push({value:"month",label:r.monthOption||on.monthOption}),u.includes("week")&&s.push({value:"week",label:r.weekOption||on.weekOption}),u.includes("day")&&s.push({value:"day",label:r.dayOption||on.dayOption}),u.includes("hour")&&s.push({value:"hour",label:r.hourOption||on.hourOption}),u.includes("minute")&&s.push({value:"minute",label:r.minuteOption||on.minuteOption}),u.includes("reboot")&&c&&(!0===c||c.includes("@reboot"))&&s.push({value:"reboot",label:r.rebootOption||on.rebootOption});var f=(0,l.useCallback)(function(e){a||n(e)},[n,a]),p=(0,l.useMemo)(function(){var e;return oa(((e={"react-js-cron-field":!0,"react-js-cron-period":!0})["".concat(o,"-field")]=!!o,e["".concat(o,"-period")]=!!o,e))},[o]),d=(0,l.useMemo)(function(){var e;return oa(((e={"react-js-cron-select":!0,"react-js-cron-select-no-prefix":""===r.prefixPeriod})["".concat(o,"-select")]=!!o,e))},[o,r.prefixPeriod]),y=(0,l.useMemo)(function(){var e;return oa(((e={"react-js-cron-select-dropdown":!0,"react-js-cron-select-dropdown-period":!0})["".concat(o,"-select-dropdown")]=!!o,e["".concat(o,"-select-dropdown-period")]=!!o,e))},[o]);return(0,r4.jsxs)("div",r8({className:p},{children:[""!==r.prefixPeriod&&(0,r4.jsx)("span",{children:r.prefixPeriod||on.prefixPeriod}),(0,r4.jsx)(m.Select,{defaultValue:t,value:t,onChange:f,options:s,className:d,popupClassName:y,disabled:i,showArrow:!a,open:!a&&void 0,"data-testid":"select-period"},JSON.stringify(r))]}))}function oS(e){var t=e.value,n=e.setValue,r=e.locale,o=e.className,i=e.humanizeLabels,a=e.monthDays,c=e.disabled,u=e.readOnly,s=e.period,f=e.periodicityOnDoubleClick,p=e.mode,d=r.weekDays||on.weekDays,m="week"===s||!a||0===a.length,y=(0,l.useMemo)(function(){var e;return oa(((e={"react-js-cron-field":!0,"react-js-cron-week-days":!0,"react-js-cron-week-days-placeholder":!m})["".concat(o,"-field")]=!!o,e["".concat(o,"-week-days")]=!!o,e))},[o,m]),b=JSON.stringify(r),v=(0,l.useMemo)(function(){return m?r.emptyWeekDays||on.emptyWeekDays:r.emptyWeekDaysShort||on.emptyWeekDaysShort},[m,b]),h="week"===s||!u||t&&t.length>0||(!t||0===t.length)&&(!a||0===a.length),g=!u||a&&a.length>0||(!a||0===a.length)&&(!t||0===t.length);return h?(0,r4.jsxs)("div",r8({className:y},{children:[""!==r.prefixWeekDays&&("week"===s||!g)&&(0,r4.jsx)("span",{children:r.prefixWeekDays||on.prefixWeekDays}),""!==r.prefixWeekDaysForMonthAndYearPeriod&&"week"!==s&&g&&(0,r4.jsx)("span",{children:r.prefixWeekDaysForMonthAndYearPeriod||on.prefixWeekDaysForMonthAndYearPeriod}),(0,r4.jsx)(oh,{placeholder:v,optionsList:d,grid:!1,value:t,unit:r8(r8({},ot[4]),{alt:r.altWeekDays||on.altWeekDays}),setValue:n,locale:r,className:o,humanizeLabels:i,disabled:c,readOnly:u,period:s,periodicityOnDoubleClick:f,mode:p})]})):null}function oE(e){var t,n,r=e.clearButton,o=void 0===r||r,i=e.clearButtonProps,a=void 0===i?{}:i,c=e.clearButtonAction,u=void 0===c?"fill-with-every":c,s=e.locale,f=void 0===s?on:s,p=e.value,d=void 0===p?"":p,y=e.setValue,b=e.displayError,v=void 0===b||b,h=e.onError,g=e.className,O=e.defaultPeriod,w=e.allowEmpty,x=void 0===w?"for-default-value":w,j=e.humanizeLabels,S=void 0===j||j,E=e.humanizeValue,k=void 0!==E&&E,C=e.disabled,P=void 0!==C&&C,A=e.readOnly,D=void 0!==A&&A,T=e.leadingZero,I=void 0!==T&&T,F=e.shortcuts,N=void 0===F?["@yearly","@annually","@monthly","@weekly","@daily","@midnight","@hourly"]:F,R=e.clockFormat,M=e.periodicityOnDoubleClick,B=void 0===M||M,V=e.mode,_=void 0===V?"multiple":V,W=e.allowedDropdowns,z=void 0===W?["period","months","month-days","week-days","hours","minutes"]:W,q=e.allowedPeriods,L=(0,l.useRef)(d),$=(0,l.useRef)(void 0===O?"day":O),U=(0,l.useState)(),G=U[0],J=U[1],H=(0,l.useState)(),Y=H[0],K=H[1],Q=(0,l.useState)(),Z=Q[0],X=Q[1],ee=(0,l.useState)(),et=ee[0],en=ee[1],er=(0,l.useState)(),eo=er[0],ei=er[1],ea=(0,l.useState)(),el=ea[0],ec=ea[1],eu=(0,l.useState)(!1),es=eu[0],ef=eu[1],ep=(0,l.useState)(!1),ed=ep[0],em=ep[1],ey=(t=ed,n=(0,l.useRef)(t),(0,l.useEffect)(function(){n.current=t},[t]),n.current),eb=JSON.stringify(f);(0,l.useEffect)(function(){ou(d,ef,h,x,L,!0,f,N,ec,ei,K,X,en,J)},[]),(0,l.useEffect)(function(){d!==L.current&&ou(d,ef,h,x,L,!1,f,N,ec,ei,K,X,en,J)},[d,L,eb,x,N]),(0,l.useEffect)(function(){if(!(G||el||Z||Y||et||eo)||ed||ey)ed&&em(!1);else{var e=G||$.current,t=os(e,Z,Y,et,eo,el,k);y(t,{selectedPeriod:e}),L.current=t,h&&h(void 0),ef(!1)}},[G,Y,Z,et,eo,el,k,ed]);var ev=(0,l.useCallback)(function(){K(void 0),X(void 0),en(void 0),ei(void 0),ec(void 0);var e="",t="reboot"!==G&&G?G:$.current;t!==G&&J(t),"fill-with-every"===u&&(e=os(t,void 0,void 0,void 0,void 0,void 0)),y(e,{selectedPeriod:t}),L.current=e,em(!0),"never"===x&&"empty"===u?(ef(!0),ol(h,f)):(h&&h(void 0),ef(!1))},[G,y,h,u]),eh=(0,l.useMemo)(function(){var e;return oa(((e={"react-js-cron":!0,"react-js-cron-error":es&&v,"react-js-cron-disabled":P,"react-js-cron-read-only":D})["".concat(g)]=!!g,e["".concat(g,"-error")]=es&&v&&!!g,e["".concat(g,"-disabled")]=P&&!!g,e["".concat(g,"-read-only")]=D&&!!g,e))},[g,es,v,P,D]),eg=a.className,eO=r7(a,["className"]),ew=(0,l.useMemo)(function(){var e;return oa(((e={"react-js-cron-clear-button":!0})["".concat(g,"-clear-button")]=!!g,e["".concat(eg)]=!!eg,e))},[g,eg]),ex=JSON.stringify(eO),ej=(0,l.useMemo)(function(){return o&&!D?(0,r4.jsx)(m.Button,r8({className:ew,danger:!0,type:"primary",disabled:P},eO,{onClick:ev},{children:f.clearButtonText||on.clearButtonText})):null},[o,D,eb,ew,P,ex,ev]),eS=G||$.current;return(0,r4.jsxs)("div",r8({className:eh},{children:[z.includes("period")&&(0,r4.jsx)(oj,{value:eS,setValue:J,locale:f,className:g,disabled:P,readOnly:D,shortcuts:N,allowedPeriods:void 0===q?["year","month","week","day","hour","minute","reboot"]:q}),"reboot"===eS?ej:(0,r4.jsxs)(r4.Fragment,{children:["year"===eS&&z.includes("months")&&(0,r4.jsx)(ox,{value:Z,setValue:X,locale:f,className:g,humanizeLabels:S,disabled:P,readOnly:D,period:eS,periodicityOnDoubleClick:B,mode:_}),("year"===eS||"month"===eS)&&z.includes("month-days")&&(0,r4.jsx)(ow,{value:Y,setValue:K,locale:f,className:g,weekDays:et,disabled:P,readOnly:D,leadingZero:I,period:eS,periodicityOnDoubleClick:B,mode:_}),("year"===eS||"month"===eS||"week"===eS)&&z.includes("week-days")&&(0,r4.jsx)(oS,{value:et,setValue:en,locale:f,className:g,humanizeLabels:S,monthDays:Y,disabled:P,readOnly:D,period:eS,periodicityOnDoubleClick:B,mode:_}),(0,r4.jsxs)("div",{children:["minute"!==eS&&"hour"!==eS&&z.includes("hours")&&(0,r4.jsx)(og,{value:eo,setValue:ei,locale:f,className:g,disabled:P,readOnly:D,leadingZero:I,clockFormat:R,period:eS,periodicityOnDoubleClick:B,mode:_}),"minute"!==eS&&z.includes("minutes")&&(0,r4.jsx)(oO,{value:el,setValue:ec,locale:f,period:eS,className:g,disabled:P,readOnly:D,leadingZero:I,clockFormat:R,periodicityOnDoubleClick:B,mode:_}),ej]})]})]}))}Object.freeze({__proto__:null,setValuesFromCronString:ou,getCronStringFromValues:os,partToString:of,formatValue:op,parsePartArray:od});function ok(){var e,t,n=(e=["\n display: flex;\n flex-direction: ",";\n align-items: flex-start;\n gap: 0.5em;\n\n .react-js-cron {\n width: 100%;\n padding: 0.5em 0.5em 0 0.5em;\n border: 1px dashed #ccc;\n\n .react-js-cron-field {\n margin-bottom: 0.5em;\n\n > span {\n margin: 0 0.5em 0 0;\n }\n\n > .react-js-cron-select {\n margin: 0 0.5em 0 0;\n }\n }\n\n .react-js-cron-week-days {\n > span {\n min-width: 2em;\n }\n }\n }\n "],!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return ok=function(){return n},n}var oC=[{value:"none",text:"No repeat"},{value:6e4,text:"By minute",unitText:"Minutes"},{value:36e5,text:"By hour",unitText:"Hours"},{value:864e5,text:"By day",unitText:"Days"},{value:6048e5,text:"By week",unitText:"Weeks"},{value:"cron",text:"Advanced"}];function oP(e){return oC.filter(function(e){return"number"==typeof e.value}).reverse().find(function(t){return!(e%t.value)})}function oA(e){var t=e.value,n=e.onChange,r=C().t,o=oP(t);return c().createElement(m.InputNumber,{value:t/o.value,onChange:function(e){return n(e*o.value)},min:1,addonBefore:r("Every"),addonAfter:r(o.unitText),className:"auto-width"})}function oD(e){var t=e.value,n=void 0===t?null:t,r=e.onChange,o=C().t,i=function(e){var t,n;switch(void 0===e?"undefined":(n=e)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n){case"number":return(t=oP(e))?t.value:"none";case"string":return"cron"}return"none"}(n),a=(0,l.useCallback)(function(e){if("none"===e){r(null);return}if("cron"===e){r("0 * * * * *");return}r(e)},[r]);return c().createElement("fieldset",{className:(0,f.css)(ok(),"cron"===i?"column":"row")},c().createElement(m.Select,{value:i,onChange:a,className:"auto-width"},oC.map(function(e){return c().createElement(m.Select.Option,{key:e.value,value:e.value},o(e.text))})),"number"==typeof i?c().createElement(oA,{value:n,onChange:r}):null,"cron"===i?c().createElement(oE,{value:n.trim().split(/\s+/).slice(1).join(" "),setValue:function(e){return r("0 ".concat(e))},clearButton:!1,locale:window.cronLocale}):null)}function oT(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function oI(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oF(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){oI(e,t,n[t])})}return e}function oN(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function oR(e,t){if(e){if("string"==typeof e)return oT(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oT(e,t)}}function oM(){var e,t,n=(e=["\n .ant-input-number {\n width: auto;\n min-width: 6em;\n }\n\n .ant-picker {\n width: auto;\n }\n "],!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return oM=function(){return n},n}var oB=(oI(a={},rH,{startsOn:{type:"datetime",title:'{{t("Starts on", { ns: "'.concat(E,'" })}}'),"x-decorator":"FormItem","x-component":"DatePicker","x-component-props":{showTime:!0},required:!0},repeat:{type:"string",title:'{{t("Repeat mode", { ns: "'.concat(E,'" })}}'),"x-decorator":"FormItem","x-component":"RepeatField","x-reactions":[{target:"endsOn",fulfill:{state:{visible:"{{!!$self.value}}"}}},{target:"limit",fulfill:{state:{visible:"{{!!$self.value}}"}}}]},endsOn:{type:"datetime",title:'{{t("Ends on", { ns: "'.concat(E,'" })}}'),"x-decorator":"FormItem","x-component":"DatePicker","x-component-props":{showTime:!0}},limit:{type:"number",title:'{{t("Repeat limit", { ns: "'.concat(E,'" })}}'),"x-decorator":"FormItem","x-component":"InputNumber","x-component-props":{placeholder:'{{t("No limit", { ns: "'.concat(E,'" })}}'),min:0}}}),oI(a,rY,{collection:oN(oF({},rh),{"x-component-props":{dataSourceFilter:function(e){return"main"===e.options.key||e.options.isDBInstance}},"x-reactions":((function(e){if(Array.isArray(e))return oT(e)})(r=rh["x-reactions"])||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||oR(r)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([{target:"startsOn",effects:["onFieldValueChange"],fulfill:{state:{visible:"{{!!$self.value}}",value:"{{Object.create({})}}"}}}])}),startsOn:{type:"object",title:'{{t("Starts on", { ns: "'.concat(E,'" })}}'),"x-decorator":"FormItem","x-component":"OnField","x-reactions":[{target:"repeat",fulfill:{state:{visible:"{{!!$self.value}}"}}}],required:!0},repeat:{type:"string",title:'{{t("Repeat mode", { ns: "'.concat(E,'" })}}'),"x-decorator":"FormItem","x-component":"RepeatField","x-reactions":[{target:"endsOn",fulfill:{state:{visible:"{{!!$self.value}}"}}},{target:"limit",fulfill:{state:{visible:"{{!!$self.value}}"}}}]},endsOn:{type:"object",title:'{{t("Ends on", { ns: "'.concat(E,'" })}}'),"x-decorator":"FormItem","x-component":"EndsByField"},limit:{type:"number",title:'{{t("Repeat limit", { ns: "'.concat(E,'" })}}'),"x-decorator":"FormItem","x-component":"InputNumber","x-component-props":{placeholder:'{{t("No limit", { ns: "'.concat(E,'" })}}'),min:0}},appends:oN(oF({},rj),{"x-reactions":[{dependencies:["mode","collection"],fulfill:{state:{visible:"{{$deps[0] === ".concat(rY," && $deps[1]}}")}}}]})}),a),oV=[{value:rH,label:'{{t("Based on certain date", { ns: "'.concat(E,'" })}}')},{value:rY,label:'{{t("Based on date field of collection", { ns: "'.concat(E,'" })}}')}],o_=function(){var e,t,n=(0,u.useForm)(),r=n.values,o=n.clearFormGraph;var i=(e=(0,l.useState)((void 0===r?{}:r).mode),t=2,function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(e,2)||oR(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=i[0],s=i[1];return(0,u.useFormEffects)(function(){(0,w.onFieldValueChange)("mode",function(e){s(e.value),o("collection"),o("startsOn"),o("repeat"),o("endsOn"),o("limit")})}),c().createElement(c().Fragment,null,c().createElement(f.SchemaComponent,{schema:{type:"number",title:'{{t("Trigger mode", { ns: "'.concat(E,'" })}}'),name:"mode","x-decorator":"FormItem","x-component":"Radio.Group","x-component-props":{options:oV},required:!0,default:rH}}),c().createElement(f.SchemaComponent,{schema:{type:"void",properties:oI({},"mode-".concat(a),{type:"void","x-component":"fieldset","x-component-props":{className:(0,f.css)(oM())},properties:oB[a]})},components:{OnField:r3,RepeatField:oD,EndsByField:r6}}))};function oW(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function oz(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function oq(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oL(e){return(oL=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o$(e,t){return(o$=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function oU(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(e,t)||oG(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function oG(e,t){if(e){if("string"==typeof e)return oW(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oW(e,t)}}function oJ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(oJ=function(){return!!e})()}function oH(e,t){var n=oU((0,f.parseCollectionName)(e.collection),2),r=n[0];n[1];var o=(0,f.useCompile)(),i=ty(r),a=[];if((!(null==t?void 0:t.types)||t.types.includes("date"))&&a.push({key:"date",value:"date",label:k("Trigger time")}),e.mode===rY){var l,c,u,s,p=oU(tm((c=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){oq(e,t,n[t])})}return e}({appends:["data"].concat(function(e){if(Array.isArray(e))return oW(e)}(l=(null===(s=e.appends)||void 0===s?void 0:s.map(function(e){return"data.".concat(e)}))||[])||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(l)||oG(l)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())},t),u=(u={fields:[{collectionName:e.collection,name:"data",type:"hasOne",target:e.collection,uiSchema:{title:k("Trigger data")}}],compile:o,getCollectionFields:i},u),Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(u)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(u)).forEach(function(e){Object.defineProperty(c,e,Object.getOwnPropertyDescriptor(u,e))}),c)),1)[0];p&&a.push(p)}return a}var oY=function(e){var t,n,r;function o(){var e,t,n,r;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,o),t=this,n=o,r=arguments,n=oL(n),oq(e=function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(t,oJ()?Reflect.construct(n,r||[],oL(t).constructor):n.apply(t,r)),"sync",!1),oq(e,"title",'{{t("Schedule event", { ns: "'.concat(E,'" })}}')),oq(e,"description",'{{t("Triggered according to preset time conditions. Suitable for one-time or periodic tasks, such as sending notifications and cleaning data on a schedule.", { ns: "'.concat(E,'" })}}')),oq(e,"fieldset",{config:{type:"void","x-component":"ScheduleConfig","x-component-props":{}}}),oq(e,"scope",{useCollectionDataSource:f.useCollectionDataSource}),oq(e,"components",{ScheduleConfig:o_}),oq(e,"useVariables",oH),e}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o$(e,t)}(o,e),t=o,n=[{key:"useInitializers",value:function(e){return e.collection?{name:"triggerData",type:"item",title:'{{t("Trigger data", { ns: "'.concat(E,'" })}}'),Component:M,collection:e.collection,dataPath:"$context.data"}:null}}],oz(t.prototype,n),o}(ng);function oK(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function oQ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oZ(e){return(oZ=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function oX(e,t){return(oX=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function o0(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(o0=function(){return!!e})()}var o1=function(e){var t,n,r;function o(){var e,t,n,r,i;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,o),n=this,r=o,i=arguments,r=oZ(r),oQ(e=function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(n,o0()?Reflect.construct(r,i||[],oZ(n).constructor):r.apply(n,i)),"title",'{{t("Calculation", { ns: "'.concat(E,'" })}}')),oQ(e,"type","calculation"),oQ(e,"group","calculation"),oQ(e,"description",'{{t("Calculate an expression based on a calculation engine and obtain a value as the result. Variables in the upstream nodes can be used in the expression.", { ns: "'.concat(E,'" })}}')),oQ(e,"fieldset",{engine:{type:"string",title:'{{t("Calculation engine", { ns: "'.concat(E,'" })}}'),"x-decorator":"FormItem","x-component":"RadioWithTooltip","x-component-props":{options:(0,tA.getOptions)()},required:!0,default:"formula.js"},expression:(oQ(t={type:"string",title:'{{t("Calculation expression", { ns: "'.concat(E,'" })}}'),"x-decorator":"FormItem","x-component":"WorkflowVariableTextArea","x-component-props":{changeOnSelect:!0}},"x-validator",function(e,t,n){var r=n.form.values,o=tA.evaluators.get(r.engine).evaluate,i=e.trim().replace(/{{([^{}]+)}}/g,' "1" ');try{return o(i),""}catch(e){return k("Expression syntax error")}}),oQ(t,"x-reactions",[{dependencies:["engine"],fulfill:{schema:{description:"{{renderEngineReference($deps[0])}}"}}}]),oQ(t,"required",!0),t)}),oQ(e,"scope",{renderEngineReference:tT}),oQ(e,"components",{WorkflowVariableTextArea:tv,RadioWithTooltip:tx,ValueBlock:tP}),e}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&oX(e,t)}(o,e),t=o,n=[{key:"useVariables",value:function(e,t){var n=e.key,r=e.title,o=t.types;return(t.fieldNames,o&&!o.some(function(e){return e in ta||Object.values(ta).some(function(t){return t.has(e)})}))?null:{value:n,label:r}}},{key:"useInitializers",value:function(e){var t,n;return{name:null!==(t=e.title)&&void 0!==t?t:"#".concat(e.id),type:"item",title:null!==(n=e.title)&&void 0!==n?n:"#".concat(e.id),Component:tP.Initializer,node:e,resultTitle:k("Calculation result")}}}],oK(t.prototype,n),o}(eq);function o2(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function o3(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o5(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o6(e){return(o6=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o4(e,t){return(o4=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function o8(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(e,t)||o7(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o7(e,t){if(e){if("string"==typeof e)return o2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o2(e,t)}}function o9(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(o9=function(){return!!e})()}var ie={ON_TRUE:1,ON_FALSE:0},it=function(e){var t,n,r;function o(){var e,t,n,r,i,a;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,o),n=this,r=o,i=arguments,r=o6(r),o5(e=function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(n,o9()?Reflect.construct(r,i||[],o6(n).constructor):r.apply(n,i)),"title",'{{t("Condition", { ns: "'.concat(E,'" })}}')),o5(e,"type","condition"),o5(e,"group","control"),o5(e,"description",'{{t(\'Based on boolean result of the calculation to determine whether to "continue" or "exit" the process, or continue on different branches of "yes" and "no".\', { ns: "'.concat(E,'" })}}')),o5(e,"fieldset",{rejectOnFalse:{type:"boolean",title:'{{t("Mode", { ns: "'.concat(E,'" })}}'),"x-decorator":"FormItem","x-component":"Radio.Group","x-component-props":{disabled:!0},enum:[{value:!0,label:'{{t(\'Continue when "Yes"\', { ns: "'.concat(E,'" })}}')},{value:!1,label:'{{t(\'Branch into "Yes" and "No"\', { ns: "'.concat(E,'" })}}')}]},engine:{type:"string",title:'{{t("Calculation engine", { ns: "'.concat(E,'" })}}'),"x-decorator":"FormItem","x-component":"RadioWithTooltip","x-component-props":{options:[["basic",{label:'{{t("Basic", { ns: "'.concat(E,'" })}}')}]].concat(function(e){if(Array.isArray(e))return o2(e)}(a=Array.from(tA.evaluators.getEntities()).filter(function(e){return["math.js","formula.js"].includes(o8(e,1)[0])}))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(a)||o7(a)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).reduce(function(e,t){var n=o8(t,2),r=n[0],o=n[1];return e.concat(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){o5(e,t,n[t])})}return e}({value:r},o))},[])},required:!0,default:"basic"},calculation:{type:"object",title:'{{t("Condition", { ns: "'.concat(E,'" })}}'),"x-decorator":"FormItem","x-component":"CalculationConfig","x-reactions":{dependencies:["engine"],fulfill:{state:{visible:'{{$deps[0] === "basic"}}'}}},required:!0},expression:(o5(t={type:"string",title:'{{t("Condition expression", { ns: "'.concat(E,'" })}}'),"x-decorator":"FormItem","x-component":"WorkflowVariableTextArea","x-component-props":{changeOnSelect:!0}},"x-validator",function(e,t,n){var r=n.form.values,o=tA.evaluators.get(r.engine).evaluate,i=e.trim().replace(/{{([^{}]+)}}/g,' "1" ');try{return o(i),""}catch(e){return k("Expression syntax error")}}),o5(t,"x-reactions",{dependencies:["engine"],fulfill:{state:{visible:'{{$deps[0] !== "basic"}}'},schema:{description:"{{renderEngineReference($deps[0])}}"}}}),o5(t,"required",!0),t)}),o5(e,"presetFieldset",{rejectOnFalse:{type:"boolean",title:'{{t("Mode", { ns: "'.concat(E,'" })}}'),"x-decorator":"FormItem","x-component":"Radio.Group",enum:[{label:'{{t(\'Continue when "Yes"\', { ns: "'.concat(E,'" })}}'),value:!0},{label:'{{t(\'Branch into "Yes" and "No"\', { ns: "'.concat(E,'" })}}'),value:!1}],default:!0}}),o5(e,"branching",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.rejectOnFalse;return!(void 0===t||t)&&[{label:"{{t('After end of branches', { ns: \"".concat(E,'" })}}'),value:!1},{label:'{{t(\'Inside of "Yes" branch\', { ns: "'.concat(E,'" })}}'),value:ie.ON_TRUE},{label:'{{t(\'Inside of "No" branch\', { ns: "'.concat(E,'" })}}'),value:ie.ON_FALSE}]}),o5(e,"scope",{renderEngineReference:tT,useWorkflowVariableOptions:tf}),o5(e,"components",{CalculationConfig:tQ,WorkflowVariableTextArea:tv,RadioWithTooltip:tx}),e}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o4(e,t)}(o,e),t=o,n=[{key:"Component",value:function(e){var t=e.data,n=(0,S.useTranslation)().t,r=j().nodes,o=eP().styles,i=t.id,a=t.config.rejectOnFalse,l=r.find(function(e){return e.upstreamId===i&&1===e.branchIndex}),u=r.find(function(e){return e.upstreamId===i&&0===e.branchIndex});return c().createElement(e5,{data:t},a?null:c().createElement("div",{className:o.nodeSubtreeClass},c().createElement("div",{className:o.branchBlockClass},c().createElement(na,{from:t,entry:u,branchIndex:0}),c().createElement(na,{from:t,entry:l,branchIndex:1})),c().createElement("div",{className:o.conditionClass},c().createElement("span",{style:{right:"4em"}},n("No")),c().createElement("span",{style:{left:"4em"}},n("Yes")))))}}],o3(t.prototype,n),o}(eq);function ir(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function io(e){return(io=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ii(e,t){return(ii=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ia(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ia=function(){return!!e})()}var il=function(e){function t(){var e,n,r,o;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),n=this,r=t,o=arguments,r=io(r),ir(e=function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(n,ia()?Reflect.construct(r,o||[],io(n).constructor):r.apply(n,o)),"title",'{{t("End process", { ns: "'.concat(E,'" })}}')),ir(e,"type","end"),ir(e,"group","control"),ir(e,"description",'{{t("End the process immediately, with set status.", { ns: "'.concat(E,'" })}}')),ir(e,"fieldset",{endStatus:{type:"number",title:'{{t("End status", { ns: "'.concat(E,'" })}}'),"x-decorator":"FormItem","x-component":"Radio.Group",enum:[{label:'{{t("Succeeded", { ns: "'.concat(E,'" })}}'),value:eo.RESOLVED},{label:'{{t("Failed", { ns: "'.concat(E,'" })}}'),value:eo.FAILED}],required:!0,default:eo.RESOLVED}}),ir(e,"end",!0),e}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ii(e,t)}(t,e),t}(eq);function ic(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function iu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function is(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ip(e){return(ip=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function id(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){is(e,t,n[t])})}return e}function im(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function iy(e,t){return(iy=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ib(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(e,t)||ih(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function iv(e){return function(e){if(Array.isArray(e))return ic(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||ih(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ih(e,t){if(e){if("string"==typeof e)return ic(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ic(e,t)}}function ig(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ig=function(){return!!e})()}function iO(e,t){var n,r,o=e.key,i=e.title,a=e.config,l=ib((0,f.parseCollectionName)(a.collection),2),c=l[0],u=l[1],s=(0,f.useCompile)(),p=ty(c);return ib(tm(im(id({appends:[o].concat(iv((null===(r=a.params)||void 0===r?void 0:null===(n=r.appends)||void 0===n?void 0:n.map(function(e){return"".concat(o,".").concat(e)}))||[]))},t),{fields:[{collectionName:u,name:o,type:"hasOne",target:u,uiSchema:{title:i}}],compile:s,getCollectionFields:p})),1)[0]}var iw=function(e){var t,n,r;function o(){var e,t,n,r;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,o),t=this,n=o,r=arguments,n=ip(n),is(e=function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(t,ig()?Reflect.construct(n,r||[],ip(t).constructor):n.apply(t,r)),"title",'{{t("Query record", { ns: "'.concat(E,'" })}}')),is(e,"type","query"),is(e,"group","collection"),is(e,"description",'{{t("Query records from a collection. You can use variables from upstream nodes as query conditions.", { ns: "'.concat(E,'" })}}')),is(e,"fieldset",{collection:im(id({},rh),{"x-disabled":'{{ useNodeSavedConfig(["collection"]) }}',"x-reactions":iv(rh["x-reactions"]).concat([{target:"params",effects:["onFieldValueChange"],fulfill:{state:{visible:"{{!!$self.value}}",value:"{{Object.create({})}}"}}}])}),multiple:{type:"boolean",title:'{{t("Result type", { ns: "'.concat(E,'" })}}'),"x-decorator":"FormItem","x-component":"RadioWithTooltip","x-component-props":{options:[{label:'{{t("Single record", { ns: "'.concat(E,'" })}}'),value:!1,tooltip:'{{t("The result will be an object of the first matching record only, or null if no matched record.", { ns: "'.concat(E,'" })}}')},{label:'{{t("Multiple records", { ns: "'.concat(E,'" })}}'),value:!0,tooltip:'{{t("The result will be an array containing matched records, or an empty one if no matching records. This can be used to be processed in a loop node.", { ns: "'.concat(E,'" })}}')}]},required:!0,default:!1},params:{type:"object","x-component":"fieldset",properties:{filter:rO,sort:rw,pagination:rx,appends:rj},"x-reactions":[{dependencies:["collection"],fulfill:{state:{visible:"{{$deps[0] != null}}"}}}]},failOnEmpty:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-content":'{{t("Exit when query result is null", { ns: "'.concat(E,'" })}}')}}),is(e,"scope",{useNodeSavedConfig:eG,useCollectionDataSource:f.useCollectionDataSource,useSortableFields:function(){var e=(0,f.useCompile)(),t=(0,u.useForm)().values,n=ib((0,f.parseCollectionName)(t.collection),2),r=n[0],o=n[1],i=(0,f.useApp)();return i.dataSourceManager.getDataSource(r).collectionManager.getCollectionFields(o).filter(function(e){if(!e.interface)return!1;var t=i.dataSourceManager.collectionFieldInterfaceManager.getFieldInterface(e.interface);return(null==t?!!void 0:!!t.sortable)||!1}).map(function(t){var n,r;return{value:t.name,label:(null==t?void 0:null===(n=t.uiSchema)||void 0===n?void 0:n.title)?e(null==t?void 0:null===(r=t.uiSchema)||void 0===r?void 0:r.title):t.name}})}}),is(e,"components",{ArrayItems:tZ.ArrayItems,FilterDynamicComponent:tO,SchemaComponentContext:f.SchemaComponentContext,WorkflowVariableInput:tb,RadioWithTooltip:tx}),is(e,"useVariables",iO),e}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&iy(e,t)}(o,e),t=o,n=[{key:"useInitializers",value:function(e){var t,n;return!e.config.collection||e.config.multiple?null:{name:null!==(t=e.title)&&void 0!==t?t:"#".concat(e.id),type:"item",title:null!==(n=e.title)&&void 0!==n?n:"#".concat(e.id),Component:M,collection:e.config.collection,dataPath:"$jobsMapByNodeKey.".concat(e.key)}}}],iu(t.prototype,n),o}(eq);function ix(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ij(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){ij(e,t,n[t])})}return e}function iE(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function ik(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ix(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ix(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function iC(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function iP(e){var t=function(e,t){if("object"!==iA(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==iA(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===iA(t)?t:String(t)}function iA(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function iD(){var e=iC(["\n margin-top: 0.5em;\n\n > .ant-formily-item {\n flex-direction: column;\n\n > .ant-formily-item-label {\n line-height: 32px;\n }\n }\n "]);return iD=function(){return e},e}function iT(){var e=iC(["\n .ant-form-item-control-input-content {\n display: flex;\n }\n "]);return iT=function(){return e},e}function iI(e){var t=(0,f.useCollectionManager_deprecated)().getCollectionFields,n=(0,u.useField)().path,r=n.segments[n.segments.length-1],o=(0,u.useForm)().values,i=ik((0,f.parseCollectionName)(null==o?void 0:o.collection),2),a=i[0],s=t(i[1],a).find(function(e){return e.name===r}).type,p=Array.isArray(e.value)?e.value.join(","):e.value,d=(0,l.useCallback)(function(t){var n=t.target.value.trim(),r=["belongsTo","hasOne"].includes(s)?n||null:n.split(",").map(function(e){return e.trim()}).filter(function(e){return""!==e});e.onChange(r)},[e.onChange,s]);return c().createElement(m.Input,iE(iS({},e),{value:p,onChange:d}))}var iF=(0,u.observer)(function(e){var t=e.value,n=e.disabled,r=e.onChange,o=e.filter,i=(0,f.useToken)().token,a=(0,S.useTranslation)().t,s=(0,f.useCompile)(),p=(0,u.useForm)(),d=(0,f.useCollectionManager_deprecated)().getCollectionFields,y=tf(),b=p.values,v=ik((0,f.parseCollectionName)(null==b?void 0:b.collection),2),h=v[0],g=v[1],w=d(g,h).filter(function(e){return e.uiSchema}),x=o?w.filter(o.bind(b)):w,j=(0,l.useMemo)(function(){return x.filter(function(e){return!t||!(e.name in t)})},[x,t]),E=n||p.disabled,C=(0,l.useMemo)(function(){return{onClick:function(e){var n=e.key;r(iE(iS({},t),ij({},n,null)))},style:{maxHeight:300,overflowY:"auto"},items:j.map(function(e){var t,n;return{key:e.name,label:s(null!==(n=null===(t=e.uiSchema)||void 0===t?void 0:t.title)&&void 0!==n?n:e.name)}})}},[r,j,t]);return c().createElement("fieldset",{className:(0,f.css)(iD())},x.length?c().createElement(f.CollectionProvider_deprecated,{name:g,dataSource:h},x.filter(function(e){return t&&e.name in t}).map(function(e){var n,o,i=["belongsTo","hasOne","hasMany","belongsToMany"].includes(e.type)?iI:f.CollectionField;return c().createElement(m.Form.Item,{key:e.name,label:s(null!==(o=null===(n=e.uiSchema)||void 0===n?void 0:n.title)&&void 0!==o?o:e.name),labelAlign:"left",className:(0,f.css)(iT())},c().createElement(f.Variable.Input,{scope:y,value:t[e.name],changeOnSelect:!0,onChange:function(n){r(iE(iS({},t),ij({},e.name,n)))}},c().createElement(f.SchemaComponent,{schema:{type:"void",properties:ij({},e.name,ij({"x-component":i},"x-validator",function(){return""}))}})),E?null:c().createElement(m.Button,ij({"aria-label":"icon-close",type:"link",icon:c().createElement(O.CloseCircleOutlined,null)},"onClick",function(){var n=e.name;r((t[n],function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){if(n=i[r],!(t.indexOf(n)>=0))Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}(t,[n].map(iP))))})))}),j.length?c().createElement(m.Dropdown,{menu:C},c().createElement(m.Button,{icon:c().createElement(O.PlusOutlined,null)},a("Add field"))):null):c().createElement("p",{style:{color:i.colorText}},k("Please select collection first")))},{displayName:"CollectionFieldSet"});function iN(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function iR(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function iM(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return iN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return iN(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function iB(){return{name:(0,s.uid)(),type:"void","x-component":"Grid","x-initializer":"assignFieldValuesForm:configureFields"}}function iV(e){var t=j().workflow,n=(0,f.useActionContext)().setFormValueChanged;(0,f.useAPIClient)();var r=tf(),o=(0,u.useForm)(),i=o.values,a=o.setValuesIn,s=o.disabled,p=(0,L.toJS)(i.params),d=iM((0,f.parseCollectionName)(i.collection),2),y=d[0],b=d[1],v=(0,f.useSchemaOptionsContext)(),h=iM((0,l.useState)(e.value&&Object.keys(e.value).length?e.value:iB()),2),g=h[0],O=h[1],x=(0,l.useMemo)(function(){return(0,w.createForm)({initialValues:p.values,disabled:t.executed,effects:function(){(0,w.onFormValuesChange)(function(e){a("params.values",(0,L.toJS)(e.values)),n(!0)})}})},[t.executed]);(0,u.useFormEffects)(function(){var e,t;(0,w.onFieldValueChange)("collection",(t=(e=function(e){var t;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(e){return x.clearFormGraph("*"),t=iB(),a("params.values",{}),O(t),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){iR(i,r,o,a,l,"next",e)}function l(e){iR(i,r,o,a,l,"throw",e)}a(void 0)})}),function(e){return t.apply(this,arguments)}))});var S=(0,l.useCallback)(function(t){var n=iM(Object.values(t.toJSON().properties),1)[0];e.onChange(n);var r=new Set;!function e(t,n){n(t),(null==t?void 0:t.properties)&&Object.values(t.properties).forEach(function(t){e(t,n)})}(n,function(e){if("AssignedField"===e["x-component"]){var t;if(null===(t=e["x-collection-field"])||void 0===t?void 0:t.startsWith("".concat(b,"."))){var n=iM(e["x-collection-field"].split("."),2)[1];r.add(n)}}});var o={};Array.from(r).forEach(function(e){e in x.values&&(o[e]=x.values[e])}),a("params.values",o)},[b,e.onChange]);return c().createElement(m.Card,null,c().createElement(f.CollectionManagerProvider,{dataSource:y},c().createElement(f.CollectionProvider,{name:b},c().createElement(f.RerenderDataBlockProvider,null,c().createElement(f.FormProvider,{form:x},c().createElement(tZ.FormLayout,{layout:"vertical"},c().createElement(f.VariableScopeProvider,{scope:r},c().createElement(f.SchemaComponentProvider,{form:x,designable:!s},c().createElement(f.SchemaComponentOptions,v,c().createElement(f.SchemaComponent,{schema:g,onChange:S}))))))))))}function i_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function iW(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function iz(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iq(e){return(iq=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function iL(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){iz(e,t,n[t])})}return e}function i$(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function iU(e,t){return(iU=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function iG(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(e,t)||iH(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function iJ(e){return function(e){if(Array.isArray(e))return i_(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||iH(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function iH(e,t){if(e){if("string"==typeof e)return i_(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i_(e,t)}}function iY(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(iY=function(){return!!e})()}function iK(e,t){var n,r,o=e.key,i=e.title,a=e.config,l=iG((0,f.parseCollectionName)(a.collection),2),c=l[0],u=l[1],s=(0,f.useCompile)(),p=ty(c);return iG(tm(i$(iL({appends:[o].concat(iJ((null===(r=a.params)||void 0===r?void 0:null===(n=r.appends)||void 0===n?void 0:n.map(function(e){return"".concat(o,".").concat(e)}))||[]))},t),{fields:[{collectionName:u,name:o,type:"hasOne",target:u,uiSchema:{title:i}}],compile:s,getCollectionFields:p})),1)[0]}var iQ=function(e){var t,n,r;function o(){var e,t,n,r;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,o),t=this,n=o,r=arguments,n=iq(n),iz(e=function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(t,iY()?Reflect.construct(n,r||[],iq(t).constructor):n.apply(t,r)),"title",'{{t("Create record", { ns: "'.concat(E,'" })}}')),iz(e,"type","create"),iz(e,"group","collection"),iz(e,"description",'{{t("Add new record to a collection. You can use variables from upstream nodes to assign values to fields.", { ns: "'.concat(E,'" })}}')),iz(e,"fieldset",{collection:i$(iL({},rh),{"x-disabled":'{{ useNodeSavedConfig(["collection"]) }}',"x-reactions":iJ(rh["x-reactions"]).concat([{target:"params",effects:["onFieldValueChange"],fulfill:{state:{value:"{{Object.create({})}}"}}}])}),usingAssignFormSchema:{type:"boolean"},assignFormSchema:{type:"object",title:'{{t("Fields values")}}',"x-decorator":"FormItem","x-component":"AssignedFieldsFormSchemaConfig","x-reactions":[{dependencies:["collection","usingAssignFormSchema"],fulfill:{state:{display:'{{($deps[0] && $deps[1]) ? "visible" : "hidden"}}'}}}]},params:{type:"object",properties:{values:i$(iL({},rg),{"x-reactions":[{dependencies:["collection","usingAssignFormSchema"],fulfill:{state:{display:'{{($deps[0] && !$deps[1]) ? "visible" : "hidden"}}'}}}]}),appends:rj}}}),iz(e,"scope",{useCollectionDataSource:f.useCollectionDataSource,useNodeSavedConfig:eG}),iz(e,"components",{CollectionFieldset:iF,AssignedFieldsFormSchemaConfig:iV}),iz(e,"useVariables",iK),e}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&iU(e,t)}(o,e),t=o,n=[{key:"createDefaultConfig",value:function(){return{usingAssignFormSchema:!0,assignFormSchema:{}}}},{key:"useInitializers",value:function(e){var t,n;return e.config.collection?{name:null!==(t=e.title)&&void 0!==t?t:"#".concat(e.id),type:"item",title:null!==(n=e.title)&&void 0!==n?n:"#".concat(e.id),Component:M,collection:e.config.collection,dataPath:"$jobsMapByNodeKey.".concat(e.key)}:null}}],iW(t.prototype,n),o}(eq);function iZ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function iX(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i0(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i1(e){return(i1=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function i2(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){i0(e,t,n[t])})}return e}function i3(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function i5(e,t){return(i5=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(i6=function(){return!!e})()}var i4=function(e){var t,n,r;function o(){var e,t,n,r,i;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,o),t=this,n=o,r=arguments,n=i1(n),i0(e=function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(t,i6()?Reflect.construct(n,r||[],i1(t).constructor):n.apply(t,r)),"title",'{{t("Update record", { ns: "'.concat(E,'" })}}')),i0(e,"type","update"),i0(e,"group","collection"),i0(e,"description",'{{t("Update records of a collection. You can use variables from upstream nodes as query conditions and field values.", { ns: "'.concat(E,'" })}}')),i0(e,"fieldset",{collection:i3(i2({},rh),{"x-disabled":'{{ useNodeSavedConfig(["collection"]) }}',"x-reactions":((function(e){if(Array.isArray(e))return iZ(e)})(i=rh["x-reactions"])||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||function(e,t){if(e){if("string"==typeof e)return iZ(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return iZ(e,t)}}(i)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([{target:"params",fulfill:{state:{visible:"{{!!$self.value}}"}}},{target:"params.filter",effects:["onFieldValueChange"],fulfill:{state:{value:"{{Object.create({})}}"}}},{target:"params.values",effects:["onFieldValueChange"],fulfill:{state:{value:"{{Object.create({})}}"}}}])}),params:{type:"object",properties:{individualHooks:{type:"boolean",title:'{{t("Update mode", { ns: "'.concat(E,'" })}}'),"x-decorator":"FormItem","x-component":"RadioWithTooltip","x-component-props":{options:[{label:'{{t("Update in a batch", { ns: "'.concat(E,'" })}}'),value:!1,tooltip:'{{t("Update all eligible data at one time, which has better performance when the amount of data is large. But association fields are not supported (unless foreign key in current collection), and the updated data will not trigger other workflows.", { ns: "'.concat(E,'" })}}')},{label:'{{t("Update one by one", { ns: "'.concat(E,'" })}}'),value:!0,tooltip:'{{t("The updated data can trigger other workflows, and the audit log will also be recorded. But it is usually only applicable to several or dozens of pieces of data, otherwise there will be performance problems.", { ns: "'.concat(E,'" })}}')}]},default:!1},filter:i3(i2({},rO),i0({title:'{{t("Only update records matching conditions", { ns: "'.concat(E,'" })}}')},"x-validator",function(e){return(0,p.isValidFilter)(e)?"":k("Please add at least one condition")})),values:i3(i2({},rg),{"x-reactions":[{dependencies:["collection","usingAssignFormSchema"],fulfill:{state:{display:'{{($deps[0] && !$deps[1]) ? "visible" : "hidden"}}'}}}]})}},usingAssignFormSchema:{type:"boolean"},assignFormSchema:{type:"object",title:'{{t("Fields values")}}',"x-decorator":"FormItem","x-component":"AssignedFieldsFormSchemaConfig","x-reactions":[{dependencies:["collection","usingAssignFormSchema"],fulfill:{state:{display:'{{($deps[0] && $deps[1]) ? "visible" : "hidden"}}'}}}]}}),i0(e,"scope",{useCollectionDataSource:f.useCollectionDataSource,useNodeSavedConfig:eG}),i0(e,"components",{FilterDynamicComponent:tO,CollectionFieldset:iF,AssignedFieldsFormSchemaConfig:iV,RadioWithTooltip:tx}),e}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i5(e,t)}(o,e),t=o,n=[{key:"createDefaultConfig",value:function(){return{usingAssignFormSchema:!0,assignFormSchema:{}}}}],iX(t.prototype,n),o}(eq);function i8(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function i7(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i9(e){return(i9=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ae(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){i7(e,t,n[t])})}return e}function at(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function an(e,t){return(an=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ar(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ar=function(){return!!e})()}var ao=function(e){function t(){var e,n,r,o,i;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),n=this,r=t,o=arguments,r=i9(r),i7(e=function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(n,ar()?Reflect.construct(r,o||[],i9(n).constructor):r.apply(n,o)),"title",'{{t("Delete record")}}'),i7(e,"type","destroy"),i7(e,"group","collection"),i7(e,"description",'{{t("Delete records of a collection. Could use variables in workflow context as filter. All records match the filter will be deleted.", { ns: "'.concat(E,'" })}}')),i7(e,"fieldset",{collection:at(ae({},rh),{"x-disabled":'{{ useNodeSavedConfig(["collection"]) }}',"x-reactions":((function(e){if(Array.isArray(e))return i8(e)})(i=rh["x-reactions"])||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||function(e,t){if(e){if("string"==typeof e)return i8(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i8(e,t)}}(i)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([{target:"params",fulfill:{state:{visible:"{{!!$self.value}}"}}},{target:"params",effects:["onFieldValueChange"],fulfill:{state:{value:"{{Object.create({})}}"}}}])}),params:{type:"object",properties:{filter:at(ae({},rO),i7({},"x-validator",function(e){return(0,p.isValidFilter)(e)?"":k("Please add at least one condition")}))}}}),i7(e,"scope",{useNodeSavedConfig:eG,useCollectionDataSource:f.useCollectionDataSource}),i7(e,"components",{FilterDynamicComponent:tO}),e}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&an(e,t)}(t,e),t}(eq),ai=new f.SchemaSettings({name:"actionSettings:submitToWorkflow",items:[{name:"editButton",Component:f.ButtonEditor,useComponentProps:function(){return(0,f.useSchemaToolbar)().buttonEditorProps}},{name:"secondConfirmation",Component:f.SecondConFirm},{name:"assignFieldValues",Component:f.AssignedFieldValues},{name:"skipRequiredValidation",Component:f.SkipValidation},{name:"afterSuccessfulSubmission",Component:f.AfterSuccess},{name:"bindWorkflow",Component:f.WorkflowConfig},{name:"delete",sort:100,Component:f.RemoveButton,useComponentProps:function(){return(0,f.useSchemaToolbar)().removeButtonProps}}]});function aa(e){var t=e.children,n=e.workflow,r=e.execution,o=e.nodes,i=(0,f.usePlugin)(ab),a=i.triggers.get(n.type).components,l=o.reduce(function(e,t){var n=t.type;return Object.assign(e,i.instructions.get(n).components)},{});return c().createElement(x.Provider,{value:{workflow:n,nodes:o,execution:r}},c().createElement(f.SchemaComponentOptions,{components:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}({},a,l)},t))}function al(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ac(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function au(e,t,n){return(au=ay()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&ad(o,n.prototype),o}).apply(null,arguments)}function as(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function af(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ap(e){return(ap=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ad(e,t){return(ad=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function am(e){var t="function"==typeof Map?new Map:void 0;return(am=function(e){var n;if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return au(e,arguments,ap(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),ad(r,e)})(e)}function ay(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ay=function(){return!!e})()}var ab=function(e){var t,n,r;function o(){var e,t,n,r;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,o),t=this,n=o,r=arguments,n=ap(n),af(e=function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(t,ay()?Reflect.construct(n,r||[],ap(t).constructor):n.apply(t,r)),"triggers",new p.Registry),af(e,"instructions",new p.Registry),af(e,"systemVariables",new p.Registry),af(e,"useTriggersOptions",function(){var t=(0,f.useCompile)();return Array.from(e.triggers.getEntities()).map(function(e){var n,r,o=(r=2,function(e){if(Array.isArray(e))return e}(n=e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(n,2)||function(e,t){if(e){if("string"==typeof e)return al(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return al(e,t)}}(n,r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),i=o[0],a=o[1].title,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){if(n=i[r],!(t.indexOf(n)>=0))Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}(e[1],["title"]);return{value:i,label:t(a),color:"gold",options:l}})}),e}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ad(e,t)}(o,e),t=o,n=[{key:"isWorkflowSync",value:function(e){var t,n;return null!==(n=null===(t=this.triggers.get(e.type))||void 0===t?void 0:t.sync)&&void 0!==n?n:e.sync}},{key:"registerTrigger",value:function(e,t){if("function"==typeof t)this.triggers.register(e,new t);else if(t)this.triggers.register(e,t);else throw TypeError("invalid trigger type to register")}},{key:"registerInstruction",value:function(e,t){if("function"==typeof t)this.instructions.register(e,new t);else{var n,r;if(n=t,null!=(r=eq)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](n):n instanceof r)this.instructions.register(e,t);else throw TypeError("invalid instruction type to register")}}},{key:"registerSystemVariable",value:function(e){this.systemVariables.register(e.key,e)}},{key:"load",value:function(){var e,t=this;return(e=function(){return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(e){return t.app.router.add("admin.workflow.workflows.id",{path:D(":id"),element:c().createElement(n8,null)}),t.app.router.add("admin.workflow.executions.id",{path:T(":id"),element:c().createElement(nV,null)}),t.app.addComponents({WorkflowPage:n8,ExecutionPage:nV}),t.app.pluginSettingsManager.add(E,{icon:"PartitionOutlined",title:'{{t("Workflow", { ns: "'.concat(E,'" })}}'),Component:rd,aclSnippet:"pm.workflow.workflows"}),t.app.schemaSettingsManager.add(ai),t.app.schemaSettingsManager.addItem("actionSettings:delete","workflowConfig",{Component:f.WorkflowConfig,useVisible:function(){var e,t=(0,u.useFieldSchema)();return(0,s.isValid)(null==t?void 0:null===(e=t["x-action-settings"])||void 0===e?void 0:e.triggerWorkflows)}}),t.registerTrigger("collection",rJ),t.registerTrigger("schedule",oY),t.registerInstruction("calculation",o1),t.registerInstruction("condition",it),t.registerInstruction("end",il),t.registerInstruction("query",iw),t.registerInstruction("create",iQ),t.registerInstruction("update",i4),t.registerInstruction("destroy",ao),t.registerSystemVariable({key:"now",label:'{{t("System time", { ns: "'.concat(E,'" })}}'),value:"now"}),t.registerSystemVariable({key:"dateRange",label:'{{t("Date range", { ns: "'.concat(E,'" })}}'),value:"dateRange",children:[{key:"yesterday",value:"yesterday",label:'{{t("Yesterday", { ns: "'.concat(E,'" })}}')},{key:"today",value:"today",label:'{{t("Today", { ns: "'.concat(E,'" })}}')},{key:"tomorrow",value:"tomorrow",label:'{{t("Tomorrow", { ns: "'.concat(E,'" })}}')},{key:"lastWeek",value:"lastWeek",label:'{{t("Last week", { ns: "'.concat(E,'" })}}')},{key:"thisWeek",value:"thisWeek",label:'{{t("This week", { ns: "'.concat(E,'" })}}')},{key:"nextWeek",value:"nextWeek",label:'{{t("Next week", { ns: "'.concat(E,'" })}}')},{key:"lastMonth",value:"lastMonth",label:'{{t("Last month", { ns: "'.concat(E,'" })}}')},{key:"thisMonth",value:"thisMonth",label:'{{t("This month", { ns: "'.concat(E,'" })}}')},{key:"nextMonth",value:"nextMonth",label:'{{t("Next month", { ns: "'.concat(E,'" })}}')},{key:"lastQuarter",value:"lastQuarter",label:'{{t("Last quarter", { ns: "'.concat(E,'" })}}')},{key:"thisQuarter",value:"thisQuarter",label:'{{t("This quarter", { ns: "'.concat(E,'" })}}')},{key:"nextQuarter",value:"nextQuarter",label:'{{t("Next quarter", { ns: "'.concat(E,'" })}}')},{key:"lastYear",value:"lastYear",label:'{{t("Last year", { ns: "'.concat(E,'" })}}')},{key:"thisYear",value:"thisYear",label:'{{t("This year", { ns: "'.concat(E,'" })}}')},{key:"nextYear",value:"nextYear",label:'{{t("Next year", { ns: "'.concat(E,'" })}}')},{key:"last7Days",value:"last7Days",label:'{{t("Last 7 days", { ns: "'.concat(E,'" })}}')},{key:"next7Days",value:"next7Days",label:'{{t("Next 7 days", { ns: "'.concat(E,'" })}}')},{key:"last30Days",value:"last30Days",label:'{{t("Last 30 days", { ns: "'.concat(E,'" })}}')},{key:"next30Days",value:"next30Days",label:'{{t("Next 30 days", { ns: "'.concat(E,'" })}}')},{key:"last90Days",value:"last90Days",label:'{{t("Last 90 days", { ns: "'.concat(E,'" })}}')},{key:"next90Days",value:"next90Days",label:'{{t("Next 90 days", { ns: "'.concat(E,'" })}}')}]}),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){ac(i,r,o,a,l,"next",e)}function l(e){ac(i,r,o,a,l,"throw",e)}a(void 0)})})()}}],as(t.prototype,n),o}(am(f.Plugin))}(),h}()});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@nocobase/client"),require("@formily/react"),require("react"),require("react-i18next"),require("@nocobase/evaluators/client"),require("antd"),require("dayjs"),require("react-router-dom"),require("@ant-design/icons"),require("@formily/antd-v5"),require("@formily/shared"),require("@nocobase/utils/client"),require("@formily/core"),require("lodash"),require("@formily/reactive")):"function"==typeof define&&define.amd?define("@nocobase/plugin-workflow",["@nocobase/client","@formily/react","react","react-i18next","@nocobase/evaluators/client","antd","dayjs","react-router-dom","@ant-design/icons","@formily/antd-v5","@formily/shared","@nocobase/utils/client","@formily/core","lodash","@formily/reactive"],t):"object"==typeof exports?exports["@nocobase/plugin-workflow"]=t(require("@nocobase/client"),require("@formily/react"),require("react"),require("react-i18next"),require("@nocobase/evaluators/client"),require("antd"),require("dayjs"),require("react-router-dom"),require("@ant-design/icons"),require("@formily/antd-v5"),require("@formily/shared"),require("@nocobase/utils/client"),require("@formily/core"),require("lodash"),require("@formily/reactive")):e["@nocobase/plugin-workflow"]=t(e["@nocobase/client"],e["@formily/react"],e.react,e["react-i18next"],e["@nocobase/evaluators/client"],e.antd,e.dayjs,e["react-router-dom"],e["@ant-design/icons"],e["@formily/antd-v5"],e["@formily/shared"],e["@nocobase/utils/client"],e["@formily/core"],e.lodash,e["@formily/reactive"])}(self,function(e,t,n,r,o,i,a,l,c,u,s,f,d,p,m){return function(){var y,b,v,h,g,O={5071:function(e,t,n){"use strict";n.d(t,{E1:function(){return I},HS:function(){return j}});var r=n(8156),o=n.n(r),i=n(8563),a=n(3505),l=n(3772),c=n(5019),u=n(8018),s=n(573),f=n(7380),d=n(7584),p=n(2721),m=n(482);function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function b(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function v(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){b(i,r,o,a,l,"next",e)}function l(e){b(i,r,o,a,l,"throw",e)}a(void 0)})}}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}function g(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function O(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}function x(){var e,t,n=(e=["\n .ant-dropdown-menu-root {\n max-height: 30em;\n overflow-y: auto;\n }\n "],!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return x=function(){return n},n}function j(e){var t,n,i=e.upstream,a=e.branchIndex,f=void 0===a?null:a,d=(0,l.usePlugin)(c.default),y=(0,l.useCompile)(),b=(null!==(n=(0,u.G)())&&void 0!==n?n:{}).workflow,j=Array.from(d.instructions.getValues()),S=(0,c.useStyles)().styles,C=k(),E=C.onCreate,A=C.creating,P=(0,r.useMemo)(function(){return y([{key:"control",label:'{{t("Control", { ns: "'.concat(s.A7,'" })}}')},{key:"calculation",label:'{{t("Calculation", { ns: "'.concat(s.A7,'" })}}')},{key:"collection",label:'{{t("Collection operations", { ns: "'.concat(s.A7,'" })}}')},{key:"manual",label:'{{t("Manual", { ns: "'.concat(s.A7,'" })}}')},{key:"extended",label:'{{t("Extended types", { ns: "'.concat(s.A7,'" })}}')}].map(function(e){var t=j.filter(function(t){return t.group===e.key&&(!t.isAvailable||t.isAvailable({engine:d,workflow:b,upstream:i,branchIndex:f}))});return g(h({},e),{type:"group",children:t.map(function(e){return{role:"button","aria-label":e.type,key:e.type,label:e.title}})})}).filter(function(e){return e.children.length}))},[f,y,d,j,i,b]);var I=(0,r.useCallback)((t=v(function(e){return w(this,function(t){return E({type:O(e.keyPath,1)[0],upstream:i,branchIndex:f}),[2]})}),function(e){return t.apply(this,arguments)}),[f,E,i]);return b?o().createElement("div",{className:S.addButtonClass},o().createElement(p.Dropdown,{menu:{items:P,onClick:I},disabled:b.executed,overlayClassName:(0,l.css)(x())},o().createElement(p.Button,{"aria-label":e["aria-label"]||"add-button",shape:"circle",icon:o().createElement(m.PlusOutlined,null),loading:(null==A?void 0:A.upstreamId)==(null==i?void 0:i.id)&&(null==A?void 0:A.branchIndex)===f,size:"small"}))):null}function S(){var e=(0,a.useForm)(),t=(0,l.useAPIClient)(),n=(0,u.G)(),r=n.workflow,o=n.refresh,i=k(),c=i.presetting,s=i.setPresetting,f=i.setCreating,d=(0,l.useActionContext)();return{run:function(){return v(function(){var n;return w(this,function(i){switch(i.label){case 0:if(!c)return[2];return[4,e.submit()];case 1:i.sent(),f(c.data),i.label=2;case 2:return i.trys.push([2,6,7,8]),[4,t.resource("workflows.nodes",r.id).create({values:g(h({},c.data),{config:h({},c.data.config,e.values.config)})})];case 3:if(n=i.sent().data.data,!("number"==typeof e.values.downstreamBranchIndex&&n.downstreamId))return[3,5];return[4,t.resource("flow_nodes").update({filterByTk:n.downstreamId,values:{branchIndex:e.values.downstreamBranchIndex,upstream:{id:n.id,downstreamId:null}},updateAssociationValues:["upstream"]})];case 4:i.sent(),i.label=5;case 5:return d.setVisible(!1),s(null),o(),[3,8];case 6:return console.error(i.sent()),[3,8];case 7:return f(null),[7];case 8:return[2]}})})()}}}var C=(0,r.createContext)(null);function k(){return(0,r.useContext)(C)}var E=[{label:"{{t('After end of branches', { ns: \"".concat(s.A7,'" })}}'),value:!1},{label:"{{t('Inside of branch', { ns: \"".concat(s.A7,'" })}}'),value:0}],A=(0,a.observer)(function(e){var t,n,i=k().presetting,c=(0,u.G)().nodes,d=(0,a.useForm)().values,p=(0,r.useMemo)(function(){if(!(null==i?void 0:i.instruction))return[];var e,t=i.instruction,n=i.data;if(!(n.upstreamId?c.find(function(e){return e.upstreamId===n.upstreamId&&e.branchIndex===n.branchIndex}):c.find(function(e){return null===e.upstreamId})))return[];var r="function"==typeof t.branching?t.branching(null!==(e=d.config)&&void 0!==e?e:{}):t.branching;return r?!0===r?E:r:[]},[i,c,d.config]);if(!p.length)return null;var m=i.data;return o().createElement(l.SchemaComponent,{components:{RadioWithTooltip:f.W5},schema:{name:"".concat(null!==(t=m.type)&&void 0!==t?t:"unknown","-").concat(null!==(n=m.upstreamId)&&void 0!==n?n:"root","-").concat(m.branchIndex),type:"void",properties:{downstreamBranchIndex:{type:"number",title:(0,s.KQ)("Move all downstream nodes to",{ns:s.A7}),"x-decorator":"FormItem","x-component":"RadioWithTooltip","x-component-props":{options:p,direction:"vertical"},default:!1,required:!0}}}})});function P(){var e=k().presetting;return(null==e?void 0:e.instruction.presetFieldset)?o().createElement(l.SchemaComponent,{schema:{type:"void",properties:{config:{type:"object",properties:e.instruction.presetFieldset}}}}):null}function I(e){var t,n,a=(0,l.useAPIClient)(),f=(0,l.useCompile)(),p=(0,l.usePlugin)(c.default),m=O((0,r.useState)(null),2),y=m[0],b=m[1],h=O((0,r.useState)(null),2),g=h[0],x=h[1],j=O((0,r.useState)(!1),2),k=j[0],E=j[1],I=null!==(n=(0,u.G)())&&void 0!==n?n:{},T=I.workflow,F=I.nodes,D=I.refresh,N=(0,r.useMemo)(function(){return(0,i.createForm)()},[]),M=(0,r.useCallback)(function(e){!e&&(N.reset(),N.clearFormGraph("*"),x(null))},[N]);var R=(0,r.useCallback)((t=v(function(e){return w(this,function(t){switch(t.label){case 0:b(e),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,a.resource("workflows.nodes",T.id).create({values:e})];case 2:return t.sent(),D(),[3,5];case 3:return console.error(t.sent()),[3,5];case 4:return b(null),[7];case 5:return[2]}})}),function(e){return t.apply(this,arguments)}),[a,D,T.id]),_=(0,r.useCallback)(function(e){var t,n,r,o=e.type,i=e.upstream,a=e.branchIndex,l=p.instructions.get(o);if(!l){console.error('Instruction "'.concat(o,'" not found'));return}var c={key:(0,d.uid)(),type:o,upstreamId:null!==(n=null==i?void 0:i.id)&&void 0!==n?n:null,branchIndex:a,title:f(l.title),config:null!==(r=null===(t=l.createDefaultConfig)||void 0===t?void 0:t.call(l))&&void 0!==r?r:{}},u=(null==i?void 0:i.id)?F.find(function(e){return e.upstreamId===c.upstreamId&&e.branchIndex===c.branchIndex}):F.find(function(e){return null===e.upstreamId});if(l.presetFieldset||("function"==typeof l.branching?l.branching(c.config):l.branching)&&u){x({data:c,instruction:l});return}R(c)},[f,R,p.instructions]);return o().createElement(C.Provider,{value:{presetting:g,setPresetting:x,onCreate:_,creating:y,setCreating:b}},e.children,o().createElement(l.ActionContextProvider,{value:{visible:!!g,setVisible:M,formValueChanged:k,setFormValueChanged:E,openSize:"small"}},o().createElement(l.SchemaComponent,{components:{DownstreamBranchIndex:A,PresetFieldset:P},scope:{useCancelAction:l.useCancelAction,useAddNodeSubmitAction:S},schema:{name:"modal",type:"void","x-decorator":"FormV2","x-decorator-props":{form:N},"x-component":"Action.Modal",title:'{{ t("Add node", { ns: "'.concat(s.A7,'" }) }}'),properties:{config:{type:"void","x-component":"PresetFieldset"},downstreamBranchIndex:{type:"void","x-component":"DownstreamBranchIndex"},footer:{"x-component":"Action.Modal.Footer",properties:{actions:{type:"void","x-component":"ActionBar",properties:{cancel:{type:"void",title:'{{ t("Cancel") }}',"x-component":"Action","x-component-props":{useAction:"{{ useCancelAction }}"}},submit:{type:"void",title:'{{ t("Submit") }}',"x-component":"Action","x-component-props":{type:"primary",htmlType:"submit",useAction:"{{ useAddNodeSubmitAction }}"}}}}}}}}})))}},2708:function(e,t,n){"use strict";n.d(t,{I:function(){return f}});var r=n(8156),o=n.n(r),i=n(482),a=n(3772),l=n(5071),c=n(6279),u=n(3461),s=n(8378);function f(e){for(var t=e.from,n=void 0===t?null:t,r=e.entry,f=void 0===r?null:r,d=e.branchIndex,p=void 0===d?null:d,m=e.controller,y=e.className,b=e.end,v=(0,s.Z)().styles,h=(0,c.C)(n,p).getAriaLabel,g=[],O=f;O;O=O.downstream)g.push(O);return o().createElement("div",{className:(0,a.cx)("workflow-branch",v.branchClass,y)},o().createElement("div",{className:"workflow-branch-lines"}),void 0===m?null:m,o().createElement(l.HS,{"aria-label":h(),upstream:n,branchIndex:p}),o().createElement("div",{className:"workflow-node-list"},g.map(function(e){return o().createElement(u.NB,{data:e,key:e.id})})),b?o().createElement("div",{className:"end-sign"},o().createElement(i.CloseOutlined,null)):null)}},8018:function(e,t,n){"use strict";n.d(t,{G:function(){return i},i:function(){return o}});var r=n(8156),o=n.n(r)().createContext({});function i(){return(0,r.useContext)(o)}},3430:function(e,t,n){"use strict";n.d(t,{G:function(){return T},n:function(){return S}});var r=n(7584),o=n(8156),i=n.n(o),a=n(573),l=n(3772),c=n(6805),u=n(2721),s=n(3238),f=n(482);function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}function m(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(e,t)||h(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function v(e){return function(e){if(Array.isArray(e))return d(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||h(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){if(e){if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,t)}}function g(){var e=b(["\n display: flex;\n gap: 0.5em;\n align-items: center;\n flex-wrap: wrap;\n "]);return g=function(){return e},e}function O(){var e=b(["\n display: flex;\n position: relative;\n margin: 0.5em 0;\n "]);return O=function(){return e},e}function w(){var e=b(["\n position: relative;\n width: 100%;\n .node-type-condition-group {\n padding: 0.5em 1em;\n border: 1px dashed #ddd;\n }\n + button {\n position: absolute;\n right: 0;\n }\n "]);return w=function(){return e},e}function x(){var e=b(["\n display: flex;\n align-items: center;\n gap: 0.5em;\n .ant-select {\n width: auto;\n min-width: 6em;\n }\n "]);return x=function(){return e},e}function j(){var e=b(["\n button {\n padding: 0;\n &:not(:last-child) {\n margin-right: 1em;\n }\n }\n "]);return j=function(){return e},e}var S=new r.Registry;S.register("equal",{name:"=",type:"boolean",group:"boolean"}),S.register("notEqual",{name:"≠",type:"boolean",group:"boolean"}),S.register("gt",{name:">",type:"boolean",group:"boolean"}),S.register("gte",{name:"≥",type:"boolean",group:"boolean"}),S.register("lt",{name:"<",type:"boolean",group:"boolean"}),S.register("lte",{name:"≤",type:"boolean",group:"boolean"}),S.register("add",{name:"+",type:"number",group:"number"}),S.register("minus",{name:"-",type:"number",group:"number"}),S.register("multiple",{name:"*",type:"number",group:"number"}),S.register("divide",{name:"/",type:"number",group:"number"}),S.register("mod",{name:"%",type:"number",group:"number"}),S.register("includes",{name:'{{t("contains")}}',type:"boolean",group:"string"}),S.register("notIncludes",{name:'{{t("does not contain")}}',type:"boolean",group:"string"}),S.register("startsWith",{name:'{{t("starts with")}}',type:"boolean",group:"string"}),S.register("notStartsWith",{name:'{{t("not starts with")}}',type:"boolean",group:"string"}),S.register("endsWith",{name:'{{t("ends with")}}',type:"boolean",group:"string"}),S.register("notEndsWith",{name:'{{t("not ends with")}}',type:"boolean",group:"string"}),S.register("concat",{name:'{{t("concat", { ns: "'.concat(a.A7,'" })}}'),type:"string",group:"string"});var C=[{value:"boolean",title:'{{t("Comparision")}}'},{value:"number",title:'{{t("Arithmetic calculation", { ns: "'.concat(a.A7,'" })}}')},{value:"string",title:'{{t("String operation", { ns: "'.concat(a.A7,'" })}}')},{value:"date",title:'{{t("Date", { ns: "'.concat(a.A7,'" })}}')}];function k(e){return Array.from(S.getEntities()).filter(function(t){var n=y(t,2);return(n[0],n[1]).group===e})}function E(e){var t=e.calculator,n=e.operands,r=void 0===n?[]:n,c=e.onChange,s=(0,l.useCompile)(),f=(0,o.useContext)(I),d=f(),p=f(),m=(0,o.useCallback)(function(e){return c({calculator:t,operands:[e,r[1]]})},[t,c,r]),b=(0,o.useCallback)(function(e){return c({calculator:t,operands:[r[0],e]})},[t,c,r]),v=(0,o.useCallback)(function(e){return c({operands:r,calculator:e})},[c,r]);return i().createElement("fieldset",{className:(0,l.css)(g())},i().createElement(l.Variable.Input,{changeOnSelect:!0,value:r[0],onChange:m,scope:d,useTypedConstant:!0}),i().createElement(u.Select,{role:"button","aria-label":"select-operator-calc",value:t,onChange:v,placeholder:(0,a.KQ)("Operator"),popupMatchSelectWidth:!1,className:"auto-width"},C.filter(function(e){return!!k(e.value).length}).map(function(e){return i().createElement(u.Select.OptGroup,{key:e.value,label:s(e.title)},k(e.value).map(function(e){var t=y(e,2),n=t[0],r=t[1].name;return i().createElement(u.Select.Option,{key:n,value:n},s(r))}))})),i().createElement(l.Variable.Input,{changeOnSelect:!0,value:r[1],onChange:b,scope:p,useTypedConstant:!0}))}function A(e){var t=e.value,n=e.onChange,r=e.onRemove;if(!t)return null;var o=t.calculator,a=t.operands;return i().createElement("div",{className:(0,l.css)(O())},t.group?i().createElement(P,{value:t.group,onChange:function(e){return n(m(p({},t),{group:e}))}}):i().createElement(E,{operands:void 0===a?[]:a,calculator:o,onChange:n}),i().createElement(u.Button,{"aria-label":"icon-close",onClick:r,type:"link",icon:i().createElement(f.CloseCircleOutlined,null)}))}function P(e){var t=this,n=e.value,r=e.onChange,a=(0,s.useTranslation)().t,c=n.type,f=n.calculations,d=void 0===f?[]:f,y=(0,o.useCallback)(function(){r(m(p({},n),{calculations:v(d).concat([{not:!1,calculator:"equal"}])}))},[n,d,r]),b=(0,o.useCallback)(function(){r(m(p({},n),{calculations:v(d).concat([{not:!1,group:{type:"and",calculations:[]}}])}))},[n,d,r]),h=(0,o.useCallback)(function(e){d.splice(e,1),r(m(p({},n),{calculations:v(d)}))},[n,d,r]),g=(0,o.useCallback)(function(e,t){d.splice(e,1,t),r(m(p({},n),{calculations:v(d)}))},[n,d,r]);return i().createElement("div",{className:(0,l.cx)("node-type-condition-group",(0,l.css)(w()))},i().createElement("div",{className:(0,l.css)(x())},i().createElement(s.Trans,null,"Meet ",i().createElement(u.Select,{role:"button","data-testid":"filter-select-all-or-any",value:void 0===c?"and":c,onChange:function(e){return r(m(p({},n),{type:e}))}},i().createElement(u.Select.Option,{value:"and"},"All"),i().createElement(u.Select.Option,{value:"or"},"Any"))," conditions in the group")),i().createElement("div",{className:"calculation-items"},d.map(function(e,n){return i().createElement(A,{key:"".concat(e.calculator,"_").concat(n),value:e,onChange:g.bind(t,n),onRemove:function(){return h(n)}})})),i().createElement("div",{className:(0,l.css)(j())},i().createElement(u.Button,{type:"link",onClick:y},a("Add condition")),i().createElement(u.Button,{type:"link",onClick:b},a("Add condition group"))))}var I=(0,o.createContext)(c.rX);function T(e){var t=e.value,n=e.onChange,r=e.useVariableHook,o=void 0===r?c.rX:r,a=t&&Object.keys(t).length?t:{group:{type:"and",calculations:[]}};return i().createElement(I.Provider,{value:o},i().createElement(P,{value:a.group,onChange:function(e){return n(m(p({},a),{group:e}))}}))}},8500:function(e,t,n){"use strict";n.d(t,{P:function(){return d}});var r=n(8156),o=n.n(r),i=n(8875),a=n(3772),l=n(7893);function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}function f(e){var t,n,r,f=e.collection,d=e.dataPath,p=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){if(n=i[r],!(t.indexOf(n)>=0))Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}(e,["collection","dataPath"]),m=(0,a.useSchemaInitializer)().insert,y=(0,a.useSchemaTemplateManager)().getTemplateSchemaByMode,b=(0,a.useCollectionManager_deprecated)().getCollection,v=(0,a.useRecordCollectionDataSourceItems)("FormItem");if("string"==typeof f){var h,g,O=(h=(0,a.parseCollectionName)(f),g=2,function(e){if(Array.isArray(e))return e}(h)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(h,2)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}}(h,g)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),w=O[0];r=b(O[1],w)}else r=f;function x(){var e;return e=function(e){var t,n,o,a;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(c){switch(c.label){case 0:if(!(t=e.item).template)return[3,2];return[4,y(t)];case 1:return o=c.sent(),[3,3];case 2:o=null,c.label=3;case 3:return n=o,a={type:"void",name:(0,i.uid)(),title:r.title,"x-decorator":"DetailsBlockProvider","x-decorator-props":{collection:f,dataPath:d},"x-component":"CardItem","x-component-props":{title:p.title},"x-designer":"SimpleDesigner",properties:{grid:{type:"void","x-component":"FormV2","x-use-component-props":"useDetailsBlockProps","x-read-pretty":!0,properties:{grid:n||{type:"void","x-component":"Grid","x-initializer":"details:configureFields",properties:{}}}}}},(0,l.dF)(a,function(e){e["x-uid"]&&delete e["x-uid"]}),m(a),[2]}})},(x=function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){u(i,r,o,a,l,"next",e)}function l(e){u(i,r,o,a,l,"throw",e)}a(void 0)})}).apply(this,arguments)}return o().createElement(a.SchemaInitializerItem,(t=s({},p),n=(n={onClick:function(e){return x.apply(this,arguments)},items:v},n),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))}function d(e){var t,n,r,i=(0,a.useSchemaInitializerItem)(),l=null!==(t=null==e?void 0:e.collection)&&void 0!==t?t:i.collection;if("string"==typeof l){var c=(0,a.parseCollectionName)(l);n=c[0],r=c[1]}else r=l;return o().createElement(a.CollectionProvider_deprecated,{dataSource:n,collection:r},o().createElement(f,s({},i,e)))}},1220:function(e,t,n){"use strict";n.d(t,{u:function(){return u}});var r=n(3772),o=n(2721),i=n(8156),a=n.n(i);function l(){var e,t,n=(e=["\n margin-bottom: 1.5em;\n padding: 1em;\n background-color: ",";\n\n > *:last-child {\n margin-bottom: 0;\n }\n\n dl {\n display: flex;\n align-items: baseline;\n\n dt {\n color: ",";\n &:after {\n content: ':';\n margin-right: 0.5em;\n }\n }\n }\n\n p {\n color: ",";\n }\n "],!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return l=function(){return n},n}var c=(0,r.createStyles)(function(e){var t=e.css,n=e.token;return{container:t(l(),n.colorFillAlter,n.colorText,n.colorTextDescription)}});function u(e){var t=e.label,n=e.title,i=e.description,l=c().styles;return a().createElement("div",{className:(0,r.cx)(l.container,e.className)},a().createElement("dl",null,a().createElement("dt",null,t),a().createElement("dd",null,a().createElement(o.Tag,{style:{background:"none"}},n))),i?a().createElement("p",null,i):null)}},4514:function(e,t,n){"use strict";n.d(t,{x:function(){return s}});var r=n(3505),o=n(2721),i=n(8156),a=n.n(i),l=n(3772);function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u(){return!0}var s=(0,r.observer)(function(e){var t,n,i,s,f=e.filter,d=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){if(n=i[r],!(t.indexOf(n)>=0))Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}(e,["filter"]),p=(0,l.useCompile)(),m=(0,l.useCollectionManager_deprecated)().getCollectionFields,y=(0,r.useForm)().values;var b=(t=(0,l.parseCollectionName)(null==y?void 0:y.collection),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}}(t,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),v=b[0],h=m(b[1],v);return a().createElement(o.Select,(i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}({popupMatchSelectWidth:!1},d),s=(s={options:h.filter(void 0===f?u:f).map(function(e){var t;return{label:p(null===(t=e.uiSchema)||void 0===t?void 0:t.title),value:e.name}})},s),Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(s)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(s)).forEach(function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(s,e))}),i))},{displayName:"FieldsSelect"})},1188:function(e,t,n){"use strict";n.d(t,{p:function(){return l}});var r=n(8156),o=n.n(r),i=n(4632),a=n(2721);function l(e){return o().createElement(a.Card,null,o().createElement(i.FormLayout,{layout:e.layout||"vertical"},e.children))}},4339:function(e,t,n){"use strict";n.d(t,{V:function(){return l}});var r=n(8156),o=n.n(r),i=n(3772),a=n(6805);function l(e){var t=e.value,n=e.onChange,r=e.renderSchemaComponent,l=(0,a.rX)();return o().createElement(i.Variable.Input,{value:t,onChange:n,scope:l},r())}},799:function(e,t,n){"use strict";n.d(t,{W:function(){return u}});var r=n(482),o=n(3772),i=n(2721),a=n(8156),l=n.n(a);function c(){var e,t,n=(e=["\n & + .anticon {\n margin-left: 0.25em;\n }\n "],!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return c=function(){return n},n}function u(e){var t=e.options,n=e.direction,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){if(n=i[r],!(t.indexOf(n)>=0))Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}(e,["options","direction"]),u=(0,o.useCompile)();return l().createElement(i.Radio.Group,a,l().createElement(i.Space,{direction:n},(void 0===t?[]:t).map(function(e){return l().createElement(i.Radio,{key:e.value,value:e.value},l().createElement("span",{className:(0,o.css)(c())},u(e.label)),e.tooltip&&l().createElement(i.Tooltip,{title:u(e.tooltip)},l().createElement(r.QuestionCircleOutlined,{style:{color:"#666"}})))})))}},5676:function(e,t,n){"use strict";n.d(t,{D:function(){return l}});var r=n(8156),o=n.n(r),i=n(3505),a=n(3772);function l(){var e=(0,i.useFieldSchema)(),t=(0,a.useCompile)();return o().createElement(a.GeneralSchemaDesigner,{title:t(e.title)},o().createElement(a.SchemaSettingsBlockTitleItem,null),o().createElement(a.SchemaSettingsDivider,null),o().createElement(a.SchemaSettingsRemove,{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}}))}},6594:function(e,t,n){"use strict";n.d(t,{Y:function(){return p}});var r=n(8156),o=n.n(r),i=n(2721),a=n(9527),l=n.n(a),c=n(3772);function u(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function s(){var e=u(["\n border: none;\n .ant-tag {\n width: 100%;\n height: 100%;\n padding: 0;\n margin-right: 0;\n border-radius: 50%;\n text-align: center;\n }\n "]);return s=function(){return e},e}function f(){var e=u(["\n border-width: 2px;\n "]);return f=function(){return e},e}var d=(0,c.createStyles)(function(e){var t=e.css;return e.token,{statusButtonClass:t(s()),noStatusButtonClass:t(f())}});function p(e){var t,n,r=e.status,a=e.statusMap,c=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){if(n=i[r],!(t.indexOf(n)>=0))Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}(e,["status","statusMap"]),u=d().styles,s=null;if(void 0!==r&&(null==a?void 0:a[r])){var f=a[r],p=f.icon,m=f.color;s=o().createElement(i.Tag,{color:m},p)}return o().createElement(i.Button,(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}({},c),n=(n={shape:"circle",size:"small",className:l()(s?u.statusButtonClass:u.noStatusButtonClass,e.className)},n),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t),s)}},6922:function(e,t,n){"use strict";n.d(t,{P:function(){return c}});var r=n(8156),o=n.n(r),i=n(3772),a=n(8018);function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function c(e){var t,n,r=(0,a.G)().workflow,c=(0,i.useApp)();var u=(t=(0,i.parseCollectionName)(r.config.collection),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(e,t)}}(t,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=u[0],f=u[1],d=c.dataSourceManager.getDataSource(s).collectionManager.getCollection(f);return o().createElement(i.RemoteSelect,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}({objectValue:!0,dataSource:s,fieldNames:{label:d.titleField,value:"id"},service:{resource:f},manual:!1},e))}},8060:function(e,t,n){"use strict";n.d(t,{X:function(){return d}});var r=n(3505),o=n(3772),i=n(7584),a=n(8156),l=n.n(a),c=n(8018),u=n(5676);function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(){var e,t,n=(e=["\n margin: 0;\n "],!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return f=function(){return n},n}var d=function(){return null};d.Initializer=function(){var e,t,n=(0,o.useSchemaInitializerItem)(),r=n.node,i=n.resultTitle,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){if(n=i[r],!(t.indexOf(n)>=0))Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}(n,["node","resultTitle"]),c=(0,o.useSchemaInitializer)().insert;return l().createElement(o.SchemaInitializerItem,(e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){s(e,t,n[t])})}return e}({},a),t=(t={onClick:function(){var e;c({type:"void",name:r.id,title:r.title,"x-component":"CardItem","x-component-props":{title:null!==(e=r.title)&&void 0!==e?e:"#".concat(r.id)},"x-designer":"ValueBlock.Designer",properties:{result:{type:"void",title:i,"x-component":"ValueBlock.Result","x-component-props":{dataSource:"{{$jobsMapByNodeKey.".concat(r.key,"}}")}}}})}},t),Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e))},d.Result=function(e){var t,n=e.dataSource,a=(0,r.useFieldSchema)(),u=(0,c.G)().execution;if(!u)return a.title;var d=(0,i.parse)(n)({$jobsMapByNodeKey:(null!==(t=u.jobs)&&void 0!==t?t:[]).reduce(function(e,t){return Object.assign(e,s({},t.nodeKey,t.result))},{})});return l().createElement("pre",{className:(0,o.css)(f())},JSON.stringify(d,null,2))},d.Designer=u.D},3048:function(e,t,n){"use strict";n.d(t,{$:function(){return c}});var r=n(3772),o=n(47),i=n(8156),a=n.n(i);function l(){var e,t,n=(e=["\n &:after {\n content: ':';\n }\n & + a {\n margin-left: 0.25em;\n }\n "],!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return l=function(){return n},n}var c=function(e){var t=o.evaluators.get(e);return t?t.link?a().createElement(a().Fragment,null,a().createElement("span",{className:(0,r.css)(l())},r.i18n.t("Syntax references")),a().createElement("a",{href:t.link,target:"_blank",rel:"noreferrer"},t.label)):null:null}},9144:function(e,t,n){"use strict";n.d(t,{C6:function(){return u},Vh:function(){return d},jf:function(){return f},ke:function(){return p},r9:function(){return c},uy:function(){return s}});var r=n(8156),o=n.n(r),i=n(482),a=n(573);function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var c={QUEUEING:null,STARTED:0,RESOLVED:1,FAILED:-1,ERROR:-2,ABORTED:-3,CANCELED:-4,REJECTED:-5,RETRY_NEEDED:-6},u=[{value:c.QUEUEING,label:'{{t("Queueing", { ns: "'.concat(a.A7,'" })}}'),color:"blue",icon:o().createElement(i.HourglassOutlined,null),statusType:"info",description:'{{t("Triggered but still waiting in queue to execute.", { ns: "'.concat(a.A7,'" })}}')},{value:c.STARTED,label:'{{t("On going", { ns: "'.concat(a.A7,'" })}}'),color:"gold",icon:o().createElement(i.LoadingOutlined,null),statusType:"warning",description:'{{t("Started and executing, maybe waiting for an async callback (manual, delay etc.).", { ns: "'.concat(a.A7,'" })}}')},{value:c.RESOLVED,label:'{{t("Resolved", { ns: "'.concat(a.A7,'" })}}'),color:"green",icon:o().createElement(i.CheckOutlined,null),statusType:"success",description:'{{t("Successfully finished.", { ns: "'.concat(a.A7,'" })}}')},{value:c.FAILED,label:'{{t("Failed", { ns: "'.concat(a.A7,'" })}}'),color:"red",icon:o().createElement(i.ExclamationOutlined,null),statusType:"error",description:'{{t("Failed to satisfy node configurations.", { ns: "'.concat(a.A7,'" })}}')},{value:c.ERROR,label:'{{t("Error", { ns: "'.concat(a.A7,'" })}}'),color:"red",icon:o().createElement(i.CloseOutlined,null),statusType:"error",description:'{{t("Some node meets error.", { ns: "'.concat(a.A7,'" })}}')},{value:c.ABORTED,label:'{{t("Aborted", { ns: "'.concat(a.A7,'" })}}'),color:"red",icon:o().createElement(i.MinusOutlined,{rotate:90}),statusType:"error",description:'{{t("Running of some node was aborted by program flow.", { ns: "'.concat(a.A7,'" })}}')},{value:c.CANCELED,label:'{{t("Canceled", { ns: "'.concat(a.A7,'" })}}'),color:"volcano",icon:o().createElement(i.MinusOutlined,{rotate:45}),statusType:"error",description:'{{t("Manually canceled whole execution when waiting.", { ns: "'.concat(a.A7,'" })}}')},{value:c.REJECTED,label:'{{t("Rejected", { ns: "'.concat(a.A7,'" })}}'),color:"volcano",icon:o().createElement(i.MinusOutlined,null),statusType:"error",description:'{{t("Rejected from a manual node.", { ns: "'.concat(a.A7,'" })}}')},{value:c.RETRY_NEEDED,label:'{{t("Retry needed", { ns: "'.concat(a.A7,'" })}}'),color:"volcano",icon:o().createElement(i.RedoOutlined,null),statusType:"error",description:'{{t("General failed but should do another try.", { ns: "'.concat(a.A7,'" })}}')}],s=u.reduce(function(e,t){return Object.assign(e,l({},t.value,t))},{}),f={PENDING:0,RESOLVED:1,FAILED:-1,ERROR:-2,ABORTED:-3,CANCELED:-4,REJECTED:-5,RETRY_NEEDED:-6},d=[{value:f.PENDING,label:'{{t("Pending", { ns: "'.concat(a.A7,'" })}}'),color:"gold",icon:o().createElement(i.ClockCircleOutlined,null)},{value:f.RESOLVED,label:'{{t("Resolved", { ns: "'.concat(a.A7,'" })}}'),color:"green",icon:o().createElement(i.CheckOutlined,null)},{value:f.FAILED,label:'{{t("Failed", { ns: "'.concat(a.A7,'" })}}'),color:"red",icon:o().createElement(i.ExclamationOutlined,null)},{value:f.ERROR,label:'{{t("Error", { ns: "'.concat(a.A7,'" })}}'),color:"red",icon:o().createElement(i.CloseOutlined,null)},{value:f.ABORTED,label:'{{t("Aborted", { ns: "'.concat(a.A7,'" })}}'),color:"red",icon:o().createElement(i.MinusOutlined,{rotate:90})},{value:f.CANCELED,label:'{{t("Canceled", { ns: "'.concat(a.A7,'" })}}'),color:"volcano",icon:o().createElement(i.MinusOutlined,{rotate:45})},{value:f.REJECTED,label:'{{t("Rejected", { ns: "'.concat(a.A7,'" })}}'),color:"volcano",icon:o().createElement(i.MinusOutlined,null)},{value:f.RETRY_NEEDED,label:'{{t("Retry needed", { ns: "'.concat(a.A7,'" })}}'),color:"volcano",icon:o().createElement(i.RedoOutlined,null)}],p=d.reduce(function(e,t){return Object.assign(e,l({},t.value,t))},{})},5019:function(e,t,n){"use strict";n.r(t),n.d(t,{JobStatusOptionsMap:function(){return tI.ke},WorkflowVariableJSON:function(){return S.RU},useWorkflowAnyExecuted:function(){return M},systemOptions:function(){return S.PL},useRecordTriggerWorkflowsActionProps:function(){return F},Trigger:function(){return R.xz},JobStatusOptions:function(){return tI.Vh},ValueBlock:function(){return tB.XB},WorkflowVariableInput:function(){return S.kw},useWorkflowVariableOptions:function(){return S.rX},Fieldset:function(){return tB.pg},CollectionBlockInitializer:function(){return tB.PW},ExecutionStatusOptions:function(){return tI.C6},nodesOptions:function(){return S.h9},FilterDynamicComponent:function(){return tB.VT},useNodeSavedConfig:function(){return ta.WH},Instruction:function(){return ta.vr},NodeDefaultView:function(){return ta.v9},getWorkflowDetailPath:function(){return n_.SI},useWorkflowExecuted:function(){return N},scopeOptions:function(){return S.UE},traverseSchema:function(){return n_.dF},CalculationConfig:function(){return tB.Gs},defaultFieldNames:function(){return S.Ox},WorkflowVariableRawTextArea:function(){return S.gz},useGetAriaLabelOfAddButton:function(){return C.C},SimpleDesigner:function(){return tB.D4},TriggerCollectionRecordSelect:function(){return tB.PO},DetailsBlockProvider:function(){return tB.nw},useStyles:function(){return th.Z},FlowContext:function(){return D.i},JobButton:function(){return ta.E9},NodeContext:function(){return ta.sy},useTrigger:function(){return R.cC},useUpstreamScopes:function(){return ta.Kd},Node:function(){return ta.NB},useTriggerWorkflowsActionProps:function(){return T},BaseTypeSets:function(){return S.VW},triggerOptions:function(){return S.DU},RadioWithTooltip:function(){return tB.W5},useGetCollectionFields:function(){return S.G$},RemoveButton:function(){return ta.xZ},default:function(){return nX},EXECUTION_STATUS:function(){return tI.r9},useNodeContext:function(){return ta.h6},ExecutionStatusOptionsMap:function(){return tI.uy},JOB_STATUS:function(){return tI.jf},ExecutionContextProvider:function(){return nV},getWorkflowExecutionsPath:function(){return n_.s_},linkNodes:function(){return n_.Yc},WorkflowVariableTextArea:function(){return S.r$},CheckboxGroupWithTooltip:function(){return tB.JF},calculators:function(){return tB.nF},Branch:function(){return tv.I},useFlowContext:function(){return D.G},renderEngineReference:function(){return tB.$W},FieldsSelect:function(){return tB.xH},useAvailableUpstreams:function(){return ta.Lu},getCollectionFieldOptions:function(){return S._5}});var r,o,i=n("8156"),a=n.n(i),l=n("3505"),c=n("8875"),u=n("3772"),s=n("7584"),f=n("8500"),d=n("4514"),p=n("573");function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function y(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function b(){var e=y(["\n flex-direction: column;\n "]);return b=function(){return e},e}function v(){var e=y(["\n position: relative;\n width: 100%;\n "]);return v=function(){return e},e}var h={type:"string",title:'{{t("Collection")}}',required:!0,"x-reactions":[],"x-decorator":"FormItem","x-component":"DataSourceCollectionCascader"},g={type:"object",title:'{{t("Fields values")}}',description:'{{t("Unassigned fields will be set to default values, and those without default values will be set to null.", { ns: "'.concat(p.A7,'" })}}'),"x-decorator":"FormItem","x-decorator-props":{labelAlign:"left",className:(0,u.css)(b())},"x-component":"CollectionFieldset"},O={type:"object",title:'{{t("Filter")}}',"x-decorator":"FormItem","x-component":"Filter","x-use-component-props":function(){var e,t,n=(0,l.useForm)().values;var r=(e=(0,u.parseCollectionName)(null==n?void 0:n.collection),t=2,function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(e,2)||function(e,t){if(e){if("string"==typeof e)return m(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=r[0],i=r[1];return{options:(0,u.useCollectionFilterOptions)(i,o),className:(0,u.css)(v())}},"x-component-props":{dynamicComponent:"FilterDynamicComponent"}},w={type:"array",title:'{{t("Sort")}}',"x-decorator":"FormItem","x-component":"ArrayItems",items:{type:"object",properties:{space:{type:"void","x-component":"Space",properties:{sort:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.SortHandle"},field:{type:"string",enum:"{{useSortableFields()}}",required:!0,"x-decorator":"FormItem","x-component":"Select","x-component-props":{style:{width:260}}},direction:{type:"string","x-decorator":"FormItem","x-component":"Radio.Group","x-component-props":{optionType:"button"},enum:[{label:'{{t("ASC")}}',value:"asc"},{label:'{{t("DESC")}}',value:"desc"}]},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:'{{t("Add sort field")}}',"x-component":"ArrayItems.Addition"}}},x={type:"void",title:'{{t("Pagination")}}',"x-decorator":"SchemaComponentContext.Provider","x-decorator-props":{value:{designable:!1}},"x-component":"Grid",properties:{row:{type:"void","x-component":"Grid.Row",properties:{page:{type:"void","x-component":"Grid.Col",properties:{page:{type:"number",title:'{{t("Page number")}}',"x-decorator":"FormItem","x-component":"WorkflowVariableInput","x-component-props":{useTypedConstant:["number","null"]},default:1}}},pageSize:{type:"void","x-component":"Grid.Col",properties:{pageSize:{type:"number",title:'{{t("Page size")}}',"x-decorator":"FormItem","x-component":"InputNumber","x-component-props":{min:1},default:20}}}}}}},j={type:"array",title:'{{t("Preload associations", { ns: "'.concat(p.A7,'" })}}'),description:'{{t("Please select the associated fields that need to be accessed in subsequent nodes. With more than two levels of to-many associations may cause performance issue, please use with caution.", { ns: "'.concat(p.A7,'" })}}'),"x-decorator":"FormItem","x-component":"AppendsTreeSelect","x-component-props":{title:"Preload associations",multiple:!0,useCollection:function(){var e=(0,l.useForm)().values;return null==e?void 0:e.collection}},"x-reactions":[{dependencies:["collection"],fulfill:{state:{visible:"{{!!$deps[0]}}"}}}]},S=n("6805"),C=n("6279"),k=n("6128"),E=n("2721");function A(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function P(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){A(i,r,o,a,l,"next",e)}function l(e){A(i,r,o,a,l,"throw",e)}a(void 0)})}}function I(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}function T(){var e=(0,u.useAPIClient)(),t=(0,l.useForm)(),n=(0,u.useBlockRequestContext)(),r=n.field,o=n.__parent,i=(0,u.useActionContext)().setVisible,a=(0,k.useNavigate)(),c=(0,l.useFieldSchema)(),f=(0,l.useField)(),d=(0,u.useCompile)(),p=E.App.useApp().modal,m=(0,u.useCollectValuesToSubmit)(),y=f.componentProps.filterKeys||[];return{onClick:function(){return P(function(){var n,l,u,b,v,h,g,O,w,x;return I(this,function(x){switch(x.label){case 0:if(u=(l=null!==(n=null==c?void 0:c["x-action-settings"])&&void 0!==n?n:{}).onSuccess,b=l.skipValidator,v=l.triggerWorkflows,b)return[3,2];return[4,t.submit()];case 1:x.sent(),x.label=2;case 2:return[4,m()];case 3:h=x.sent(),f.data=r.data||{},f.data.loading=!0,x.label=4;case 4:return x.trys.push([4,6,,7]),[4,e.resource("workflows").trigger({values:h,filterKeys:y,triggerWorkflows:(null==v?void 0:v.length)?v.map(function(e){return[e.workflowKey,e.context].filter(Boolean).join("!")}).join(","):void 0})];case 5:if(w=x.sent(),f.data.loading=!1,f.data.data=w,null==o||null===(O=o.service)||void 0===O||null===(g=O.refresh)||void 0===g||g.call(O),null==i||i(!1),!(null==u?void 0:u.successMessage))return[2];return(null==u?void 0:u.manualClose)?p.success({title:d(null==u?void 0:u.successMessage),onOk:P(function(){return I(this,function(e){switch(e.label){case 0:return[4,t.reset()];case 1:return e.sent(),(null==u?void 0:u.redirecting)&&(null==u?void 0:u.redirectTo)&&((0,s.isURL)(u.redirectTo)?window.location.href=u.redirectTo:a(u.redirectTo)),[2]}})})}):E.message.success(d(null==u?void 0:u.successMessage)),[3,7];case 6:return x.sent(),f.data.loading=!1,[3,7];case 7:return[2]}})})()}}}function F(){var e,t=(0,u.useCompile)(),n=(0,u.useAPIClient)(),r=(0,u.useRecord)(),o=(0,l.useField)(),i=(0,l.useFieldSchema)(),a=(0,u.useBlockRequestContext)(),c=a.field;a.__parent;var f=(0,u.useActionContext)(),d=f.setVisible,p=f.setSubmitted,m=E.App.useApp().modal,y=(0,k.useNavigate)(),b=null!==(e=null==i?void 0:i["x-action-settings"])&&void 0!==e?e:{},v=b.onSuccess,h=b.triggerWorkflows;return{onClick:function(e,i){return P(function(){return I(this,function(e){switch(e.label){case 0:o.data=c.data||{},o.data.loading=!0,e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,n.resource("workflows").trigger({values:r,triggerWorkflows:(null==h?void 0:h.length)?h.map(function(e){return[e.workflowKey,e.context].filter(Boolean).join("!")}).join(","):void 0})];case 2:if(e.sent(),i&&i(),null==d||d(!1),null==p||p(!0),!(null==v?void 0:v.successMessage))return[2];return(null==v?void 0:v.manualClose)?m.success({title:t(null==v?void 0:v.successMessage),onOk:function(){return P(function(){return I(this,function(e){return(null==v?void 0:v.redirecting)&&(null==v?void 0:v.redirectTo)&&((0,s.isURL)(v.redirectTo)?window.location.href=v.redirectTo:y(v.redirectTo)),[2]})})()}}):E.message.success(t(null==v?void 0:v.successMessage)),[3,5];case 3:return console.error(e.sent()),[3,5];case 4:return o.data.loading=!1,[7];case 5:return[2]}})})()}}}var D=n("8018");function N(){var e=(0,D.G)().workflow;return!!(null==e?void 0:e.executed)}function M(){var e=(0,D.G)().workflow;return!!(null==e?void 0:e.allExecuted)}var R=n("336"),_=n("6922");function B(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function V(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function W(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function z(e){return(z=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function $(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){W(e,t,n[t])})}return e}function G(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function q(e,t){return(q=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function L(e){return function(e){if(Array.isArray(e))return B(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||U(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function U(e,t){if(e){if("string"==typeof e)return B(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return B(e,t)}}function K(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(K=function(){return!!e})()}var H=1,Q=2,J=3,Y=4,Z=[{label:'{{t("After record added", { ns: "'.concat(p.A7,'" })}}'),value:H},{label:'{{t("After record updated", { ns: "'.concat(p.A7,'" })}}'),value:Q},{label:'{{t("After record added or updated", { ns: "'.concat(p.A7,'" })}}'),value:J},{label:'{{t("After record deleted", { ns: "'.concat(p.A7,'" })}}'),value:Y}];function X(e,t){var n,r,o,i=(n=(0,u.parseCollectionName)(e.collection),r=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(n,2)||U(n,r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=i[0],l=i[1],c=(0,u.useCompile)(),s=(0,S.G$)(a),f=[{collectionName:l,name:"data",type:"hasOne",target:l,uiSchema:{title:(0,p.KQ)("Trigger data")}}];return(0,S._5)(G($({appends:["data"].concat(L((null===(o=e.appends)||void 0===o?void 0:o.map(function(e){return"data.".concat(e)}))||[]))},t),{fields:f,compile:c,getCollectionFields:s}))}var ee=function(e){var t,n,r;function o(){var e,t,n,r;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,o),t=this,n=o,r=arguments,n=z(n),W(e=function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(t,K()?Reflect.construct(n,r||[],z(t).constructor):n.apply(t,r)),"title",'{{t("Collection event", { ns: "'.concat(p.A7,'" })}}')),W(e,"description",'{{t(\'Triggered when data changes in the collection, such as after adding, updating, or deleting a record. Unlike "Post-action event", Collection event listens for data changes rather than HTTP requests. Unless you understand the exact meaning, it is recommended to use "Post-action event".\', { ns: "'.concat(p.A7,'" })}}')),W(e,"fieldset",{collection:G($({},h),W({"x-disabled":"{{ useWorkflowAnyExecuted() }}","x-component-props":{dataSourceFilter:function(e){return"main"===e.options.key||e.options.isDBInstance}}},"x-reactions",L(h["x-reactions"]).concat([{target:"changed",effects:["onFieldValueChange"],fulfill:{state:{value:[]}}},{target:"condition",effects:["onFieldValueChange"],fulfill:{state:{value:null}}},{target:"appends",effects:["onFieldValueChange"],fulfill:{state:{value:[]}}}]))),mode:{type:"number",title:'{{t("Trigger on", { ns: "'.concat(p.A7,'" })}}'),"x-decorator":"FormItem","x-component":"Select","x-component-props":{popupMatchSelectWidth:!1,placeholder:'{{t("Trigger on", { ns: "'.concat(p.A7,'" })}}'),className:"auto-width"},enum:Z,required:!0,"x-reactions":[{dependencies:["collection"],fulfill:{state:{visible:"{{!!$deps[0]}}"}}}]},changed:{type:"array",title:'{{t("Changed fields", { ns: "'.concat(p.A7,'" })}}'),description:'{{t("Triggered only if one of the selected fields changes. If unselected, it means that it will be triggered when any field changes. When record is added or deleted, any field is considered to have been changed.", { ns: "'.concat(p.A7,'" })}}'),"x-decorator":"FormItem","x-component":"FieldsSelect","x-component-props":{mode:"multiple",placeholder:'{{t("Select field")}}',filter:function(e){return!e.hidden&&(!e.uiSchema||!e.uiSchema["x-read-pretty"])&&!["linkTo","hasOne","hasMany","belongsToMany"].includes(e.type)}},"x-reactions":[{dependencies:["collection","mode"],fulfill:{state:{visible:"{{!!$deps[0] && ($deps[1] & ".concat(Q,")}}")}}}]},condition:G($({},O),{title:'{{t("Only triggers when match conditions", { ns: "'.concat(p.A7,'" })}}'),"x-component-props":{},"x-reactions":[{dependencies:["collection","mode"],fulfill:{state:{visible:"{{!!$deps[0] && !($deps[1] & ".concat(Y,")}}")}}}]}),appends:G($({},j),{"x-reactions":L(j["x-reactions"]).concat([{dependencies:["mode"],fulfill:{state:{visible:"{{!($deps[0] & ".concat(Y,")}}")}}}])})}),W(e,"scope",{useCollectionDataSource:u.useCollectionDataSource,useWorkflowAnyExecuted:M}),W(e,"components",{FieldsSelect:d.x,TriggerCollectionRecordSelect:_.P}),W(e,"triggerFieldset",{data:{type:"object",title:'{{t("Trigger data", { ns: "'.concat(p.A7,'" })}}'),description:'{{t("Choose a record of the collection to trigger.", { ns: "'.concat(p.A7,'" })}}'),"x-decorator":"FormItem","x-component":"TriggerCollectionRecordSelect",default:null,required:!0}}),W(e,"useVariables",X),e}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&q(e,t)}(o,e),t=o,n=[{key:"validate",value:function(e){return e.collection&&e.mode}},{key:"useInitializers",value:function(e){return e.collection?{name:"triggerData",type:"item",key:"triggerData",title:'{{t("Trigger data", { ns: "'.concat(p.A7,'" })}}'),Component:f.P,collection:e.collection,dataPath:"$context.data"}:null}}],V(t.prototype,n),o}(R.xz),et=n("8563"),en=0,er=1,eo=n("5760"),ei=n.n(eo),ea=n("3238");function el(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ec(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}function eu(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function es(){var e,t,n=(e=["\n display: flex;\n gap: 0.5em;\n "],!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return es=function(){return n},n}function ef(e){return!e.hidden&&!!e.uiSchema&&["date","datetimeTz","datetimeNoTz"].includes(e.type)}function ed(e){var t,n,r=e.value,o=e.onChange,l=null!=r?r:{},c=(0,ea.useTranslation)().t;var s=(t=(0,i.useState)(l.offset?l.offset/Math.abs(l.offset):0),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return el(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return el(e,t)}}(t,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),f=s[0],m=s[1];return a().createElement("fieldset",{className:(0,u.css)(es())},a().createElement(d.x,{value:l.field,onChange:function(e){return o(eu(ec({},l),{field:e}))},filter:ef,placeholder:c("Select field"),className:"auto-width"}),l.field?a().createElement(E.Select,{value:f,onChange:function(e){m(e),o(eu(ec({},l),{offset:Math.abs(l.offset)*e}))},options:[{value:0,label:(0,p.KQ)("Exactly at")},{value:-1,label:c("Before")},{value:1,label:c("After")}],className:"auto-width"}):null,f?a().createElement(a().Fragment,null,a().createElement(E.InputNumber,{value:Math.abs(l.offset),onChange:function(e){return o(eu(ec({},l),{offset:(null!=e?e:0)*f}))}}),a().createElement(E.Select,{value:l.unit||864e5,onChange:function(e){return o(eu(ec({},l),{unit:e}))},options:[{value:864e5,label:(0,p.KQ)("Days")},{value:36e5,label:(0,p.KQ)("Hours")},{value:6e4,label:(0,p.KQ)("Minutes")},{value:1e3,label:(0,p.KQ)("Seconds")}],className:"auto-width"})):null)}function ep(){var e,t,n=(e=["\n display: flex;\n gap: 0.5em;\n "],!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return ep=function(){return n},n}function em(e){var t,n,r,o=e.value,i=e.onChange,l=(0,p.cC)().t;var c=null!=o?(void 0===o?"undefined":(t=o)&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t)!="object"||(n=o,null!=(r=Date)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](n):n instanceof r)?"date":"field":null;return a().createElement("fieldset",{className:(0,u.css)(ep())},a().createElement(E.Select,{value:c,onChange:function(e){i(e?"field"===e?{}:new Date:null)},className:"auto-width"},a().createElement(E.Select.Option,{value:null},l("No end")),a().createElement(E.Select.Option,{value:"field"},l("By field")),a().createElement(E.Select.Option,{value:"date"},l("By custom date"))),"field"===c?a().createElement(ed,{value:o,onChange:i}):null,"date"===c?a().createElement(E.DatePicker,{showTime:!0,value:ei()(o),onChange:function(e){i(e?e.toDate():null)}}):null)}var ey=n("3704"),eb=function(){return(eb=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function ev(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function eh(e,t,n){if(n||2==arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}var eg=[{name:"@yearly",value:"0 0 1 1 *"},{name:"@annually",value:"0 0 1 1 *"},{name:"@monthly",value:"0 0 1 * *"},{name:"@weekly",value:"0 0 * * 0"},{name:"@daily",value:"0 0 * * *"},{name:"@midnight",value:"0 0 * * *"},{name:"@hourly",value:"0 * * * *"}],eO=[{type:"minutes",min:0,max:59,total:60},{type:"hours",min:0,max:23,total:24},{type:"month-days",min:1,max:31,total:31},{type:"months",min:1,max:12,total:12,alt:["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"]},{type:"week-days",min:0,max:6,total:7,alt:["SUN","MON","TUE","WED","THU","FRI","SAT"]}],ew={everyText:"every",emptyMonths:"every month",emptyMonthDays:"every day of the month",emptyMonthDaysShort:"day of the month",emptyWeekDays:"every day of the week",emptyWeekDaysShort:"day of the week",emptyHours:"every hour",emptyMinutes:"every minute",emptyMinutesForHourPeriod:"every",yearOption:"year",monthOption:"month",weekOption:"week",dayOption:"day",hourOption:"hour",minuteOption:"minute",rebootOption:"reboot",prefixPeriod:"Every",prefixMonths:"in",prefixMonthDays:"on",prefixWeekDays:"on",prefixWeekDaysForMonthAndYearPeriod:"and",prefixHours:"at",prefixMinutes:":",prefixMinutesForHourPeriod:"at",suffixMinutesForHourPeriod:"minute(s)",errorInvalidCron:"Invalid cron expression",clearButtonText:"Clear",weekDays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],altWeekDays:["SUN","MON","TUE","WED","THU","FRI","SAT"],altMonths:["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"]};function ex(e,t){for(var n=[],r=e;r<=t;r++)n.push(r);return n}function ej(e){return e.sort(function(e,t){return e-t}),e}function eS(e){var t=[];return e.forEach(function(e){0>t.indexOf(e)&&t.push(e)}),t}function eC(e){return Object.entries(e).filter(function(e){var t=e[0],n=e[1];return t&&n}).map(function(e){return e[0]}).join(" ")}function ek(e,t){e&&e({type:"invalid_cron",description:t.errorInvalidCron||ew.errorInvalidCron})}function eE(e){var t=parseInt(e,10),n=Number(e);return t===n?n:NaN}function eA(e,t,n,r,o,i,a,l,c,u,s,f,d,p){n&&n(void 0),t(!1);var m=!1;if(!e){if("always"===r||i&&"for-default-value"===r)return;m=!0}if(!m){if(l&&(!0===l||l.includes(e))){if("@reboot"===e)return void p("reboot");var y=eg.find(function(t){return t.name===e});y&&(e=y.value)}try{var b,v=function(e){if("string"!=typeof e)throw Error("Invalid cron string");var t=e.replace(/\s+/g," ").trim().split(" ");if(5===t.length)return t.map(function(e,t){return function(e,t){if("*"===e||"*/1"===e)return[];var n=ej(eS(eD((function(e,t,n){if(n){e=e.toUpperCase();for(var r=0;r<n.length;r++)e=e.replace(n[r],"".concat(r+t))}return e})(e,t.min,t.alt).split(",").map(function(n){var r,o=n.split("/");if(o.length>2)throw Error('Invalid value "'.concat(e,' for "').concat(t.type,'"'));var i=o[0],a=o[1];r="*"===i?ex(t.min,t.max):function(e,t,n){var r=e.split("-");if(1===r.length){var o=eE(r[0]);if(isNaN(o))throw Error('Invalid value "'.concat(t,'" for ').concat(n.type));return[o]}if(2===r.length){var i=eE(r[0]),a=eE(r[1]);if(isNaN(i)||isNaN(a))throw Error('Invalid value "'.concat(t,'" for ').concat(n.type));if(a<i)throw Error('Max range is less than min range in "'.concat(e,'" for ').concat(n.type));return ex(i,a)}throw Error('Invalid value "'.concat(e,'" for ').concat(n.type))}(i,e,t);var l=function(e,t){if(void 0!==e){var n=eE(e);if(isNaN(n)||n<1)throw Error('Invalid interval step value "'.concat(e,'" for ').concat(t.type));return n}}(a,t);return function(e,t){if(t){var n=e[0];e=e.filter(function(e){return e%t==n%t||e===n})}return e}(r,l)}).flat(),t))),r=eN(n,t);if(void 0!==r)throw Error('Value "'.concat(r,'" out of range for ').concat(t.type));return n.length===t.total?[]:n}(e,eO[t])});throw Error("Invalid cron string format")}(e),h=(b=v)[3].length>0?"year":b[2].length>0?"month":b[4].length>0?"week":b[1].length>0?"day":b[0].length>0?"hour":"minute";p(h),c(v[0]),u(v[1]),s(v[2]),f(v[3]),d(v[4])}catch(e){m=!0}}m&&(o.current=e,t(!0),ek(n,a))}function eP(e,t,n,r,o,i,a){var l,c;if("reboot"===e)return"@reboot";return(l=["minute"!==e&&i?i:[],"minute"!==e&&"hour"!==e&&o?o:[],("year"===e||"month"===e)&&n?n:[],"year"===e&&t?t:[],("year"===e||"month"===e||"week"===e)&&r?r:[]],c=a,l.map(function(e,t){var n=eO[t];return eI(eF(e,n),n,c)})).join(" ")}function eI(e,t,n,r,o){var i="";if(a=e,l=t,a.length===l.max-l.min+1||0===e.length)i="*";else{var a,l,c,u,s,f,d,p,m,y,b=function(e){if(e.length>2){var t=e[1]-e[0];if(t>1)return t}}(e);i=b&&function(e,t){for(var n=1;n<e.length;n++){var r=e[n-1];if(e[n]-r!==t)return!1}return!0}(e,b)?(c=e,u=t,s=b,f=function(e){return e[0]}(c),d=eR(c),p=c.length===(d-f)/s+1,f===u.min&&d+s>u.max&&p)?"*/".concat(b):"".concat(eT(function(e){return e[0]}(e),t,n,r,o),"-").concat(eT(eR(e),t,n,r,o),"/").concat(b):(m=[],y=null,e.forEach(function(e,t,n){e!==n[t+1]-1?null!==y?(m.push([y,e]),y=null):m.push(e):null===y&&(y=e)}),m).map(function(e){return Array.isArray(e)?"".concat(eT(e[0],t,n,r,o),"-").concat(eT(e[1],t,n,r,o)):eT(e,t,n,r,o)}).join(",")}return i}function eT(e,t,n,r,o){var i=e.toString(),a=t.type,l=t.alt,c=t.min,u=r&&(!0===r||r.includes(a)),s="24-hour-clock"===o&&("hours"===a||"minutes"===a);if(n&&"week-days"===a||n&&"months"===a?i=l[e-c]:e<10&&(u||s)&&(i=i.padStart(2,"0")),"hours"===a&&"12-hour-clock"===o){var f=e>=12?"PM":"AM",d=e%12||12;d<10&&u&&(d=d.toString().padStart(2,"0")),i="".concat(d).concat(f)}return i}function eF(e,t){var n=ej(eS(eD(e,t)));if(0===n.length)return n;var r=eN(n,t);if(void 0!==r)throw Error('Value "'.concat(r,'" out of range for ').concat(t.type));return n}function eD(e,t){return"week-days"===t.type&&(e=e.map(function(e){return 7===e?0:e})),e}function eN(e,t){var n=e[0],r=e[e.length-1];return n<t.min?n:r>t.max?r:void 0}function eM(e){return e[0]}function eR(e){return e[e.length-1]}function e_(e){var t=e.value,n=e.grid,r=void 0===n||n,o=e.optionsList,a=e.setValue,l=e.locale,c=e.className,u=e.humanizeLabels,s=e.disabled,f=e.readOnly,d=e.leadingZero,p=e.clockFormat,m=e.period,y=e.unit,b=e.periodicityOnDoubleClick,v=e.mode,h=ev(e,["value","grid","optionsList","setValue","locale","className","humanizeLabels","disabled","readOnly","leadingZero","clockFormat","period","unit","periodicityOnDoubleClick","mode"]),g=(0,i.useMemo)(function(){if(t&&Array.isArray(t))return t.map(function(e){return e.toString()})},[t]),O=(0,i.useMemo)(function(){return o?o.map(function(e,t){return{value:(0===y.min?t:t+1).toString(),label:e}}):eh([],Array(y.total),!0).map(function(e,t){var n=0===y.min?t:t+1;return{value:n.toString(),label:eT(n,y,u,d,p)}})},[o,d,u,p]),w=JSON.stringify(l),x=(0,i.useCallback)(function(e){var n=e.value;if(!t||t[0]!==Number(n))return(0,ey.jsx)(ey.Fragment,{});var r=eI(eF(t,y),y,u,d,p),o=r.match(/^\*\/([0-9]+),?/)||[];return(0,ey.jsx)("div",{children:o[1]?"".concat(l.everyText||ew.everyText," ").concat(o[1]):r})},[t,w,u,d,p]),j=(0,i.useCallback)(function(e){var n=Array.isArray(e)?ej(e):[e],r=n;t&&(r="single"===v?[]:eh([],t,!0),n.forEach(function(e){var n=Number(e);r=t.some(function(e){return e===n})?r.filter(function(e){return e!==n}):ej(eh(eh([],r,!0),[n],!1))})),r.length===y.total?a([]):a(r)},[a,t]),S=(0,i.useCallback)(function(e){if(0!==e&&1!==e){for(var n=y.total+y.min,r=[],o=y.min;o<n;o++)o%e==0&&r.push(o);var i=t&&r&&t.length===r.length&&t.every(function(e,t){return e===r[t]});a(r.length===O.length||i?[]:r)}else a([])},[t,O,a]),C=(0,i.useRef)([]),k=(0,i.useCallback)(function(e){if(!f){var t=C.current;t.push({time:(new Date).getTime(),value:Number(e)});var n=window.setTimeout(function(){b&&t.length>1&&t[t.length-1].time-t[t.length-2].time<300?t[t.length-1].value===t[t.length-2].value?S(Number(e)):j([t[t.length-2].value,t[t.length-1].value]):j(Number(e)),C.current=[]},300);return function(){window.clearTimeout(n)}}},[C,j,S,f,b]),A=(0,i.useCallback)(function(){f||a([])},[a,f]),P=(0,i.useMemo)(function(){var e;return eC(((e={"react-js-cron-select":!0,"react-js-cron-custom-select":!0})["".concat(c,"-select")]=!!c,e))},[c]),I=(0,i.useMemo)(function(){var e;return eC(((e={"react-js-cron-select-dropdown":!0})["react-js-cron-select-dropdown-".concat(y.type)]=!0,e["react-js-cron-custom-select-dropdown"]=!0,e["react-js-cron-custom-select-dropdown-".concat(y.type)]=!0,e["react-js-cron-custom-select-dropdown-minutes-large"]="minutes"===y.type&&"hour"!==m&&"day"!==m,e["react-js-cron-custom-select-dropdown-minutes-medium"]="minutes"===y.type&&("day"===m||"hour"===m),e["react-js-cron-custom-select-dropdown-hours-twelve-hour-clock"]="hours"===y.type&&"12-hour-clock"===p,e["react-js-cron-custom-select-dropdown-grid"]=!!r,e["".concat(c,"-select-dropdown")]=!!c,e["".concat(c,"-select-dropdown-").concat(y.type)]=!!c,e))},[c,r,p,m]);return(0,ey.jsx)(E.Select,eb({mode:"single"!==v||b?"multiple":void 0,allowClear:!f,virtual:!1,open:!f&&void 0,value:g,onClear:A,tagRender:x,className:P,popupClassName:I,options:O,showSearch:!1,showArrow:!f,menuItemSelectedIcon:null,dropdownMatchSelectWidth:!1,onSelect:k,onDeselect:k,disabled:s,dropdownAlign:"minutes"!==y.type&&"hours"!==y.type||"day"===m||"hour"===m?void 0:{points:["tr","br"]},"data-testid":"custom-select-".concat(y.type)},h))}function eB(e){var t=e.value,n=e.setValue,r=e.locale,o=e.className,a=e.disabled,l=e.readOnly,c=e.leadingZero,u=e.clockFormat,s=e.period,f=e.periodicityOnDoubleClick,d=e.mode,p=(0,i.useMemo)(function(){var e;return eC(((e={"react-js-cron-field":!0,"react-js-cron-hours":!0})["".concat(o,"-field")]=!!o,e["".concat(o,"-hours")]=!!o,e))},[o]);return(0,ey.jsxs)("div",eb({className:p},{children:[""!==r.prefixHours&&(0,ey.jsx)("span",{children:r.prefixHours||ew.prefixHours}),(0,ey.jsx)(e_,{placeholder:r.emptyHours||ew.emptyHours,value:t,unit:eO[1],setValue:n,locale:r,className:o,disabled:a,readOnly:l,leadingZero:c,clockFormat:u,period:s,periodicityOnDoubleClick:f,mode:d})]}))}function eV(e){var t=e.value,n=e.setValue,r=e.locale,o=e.className,a=e.disabled,l=e.readOnly,c=e.leadingZero,u=e.clockFormat,s=e.period,f=e.periodicityOnDoubleClick,d=e.mode,p=(0,i.useMemo)(function(){var e;return eC(((e={"react-js-cron-field":!0,"react-js-cron-minutes":!0})["".concat(o,"-field")]=!!o,e["".concat(o,"-minutes")]=!!o,e))},[o]);return(0,ey.jsxs)("div",eb({className:p},{children:["hour"===s?""!==r.prefixMinutesForHourPeriod&&(0,ey.jsx)("span",{children:r.prefixMinutesForHourPeriod||ew.prefixMinutesForHourPeriod}):""!==r.prefixMinutes&&(0,ey.jsx)("span",{children:r.prefixMinutes||ew.prefixMinutes}),(0,ey.jsx)(e_,{placeholder:"hour"===s?r.emptyMinutesForHourPeriod||ew.emptyMinutesForHourPeriod:r.emptyMinutes||ew.emptyMinutes,value:t,unit:eO[0],setValue:n,locale:r,className:o,disabled:a,readOnly:l,leadingZero:c,clockFormat:u,period:s,periodicityOnDoubleClick:f,mode:d}),"hour"===s&&""!==r.suffixMinutesForHourPeriod&&(0,ey.jsx)("span",{children:r.suffixMinutesForHourPeriod||ew.suffixMinutesForHourPeriod})]}))}function eW(e){var t=e.value,n=e.setValue,r=e.locale,o=e.className,a=e.weekDays,l=e.disabled,c=e.readOnly,u=e.leadingZero,s=e.period,f=e.periodicityOnDoubleClick,d=e.mode,p=!a||0===a.length,m=(0,i.useMemo)(function(){var e;return eC(((e={"react-js-cron-field":!0,"react-js-cron-month-days":!0,"react-js-cron-month-days-placeholder":!p})["".concat(o,"-field")]=!!o,e["".concat(o,"-month-days")]=!!o,e))},[o,p]),y=JSON.stringify(r),b=(0,i.useMemo)(function(){return p?r.emptyMonthDays||ew.emptyMonthDays:r.emptyMonthDaysShort||ew.emptyMonthDaysShort},[p,y]);return c&&(!t||!(t.length>0))&&(t&&0!==t.length||a&&0!==a.length)?null:(0,ey.jsxs)("div",eb({className:m},{children:[""!==r.prefixMonthDays&&(0,ey.jsx)("span",{children:r.prefixMonthDays||ew.prefixMonthDays}),(0,ey.jsx)(e_,{placeholder:b,value:t,setValue:n,unit:eO[2],locale:r,className:o,disabled:l,readOnly:c,leadingZero:u,period:s,periodicityOnDoubleClick:f,mode:d})]}))}function ez(e){var t=e.value,n=e.setValue,r=e.locale,o=e.className,a=e.humanizeLabels,l=e.disabled,c=e.readOnly,u=e.period,s=e.periodicityOnDoubleClick,f=e.mode,d=r.months||ew.months,p=(0,i.useMemo)(function(){var e;return eC(((e={"react-js-cron-field":!0,"react-js-cron-months":!0})["".concat(o,"-field")]=!!o,e["".concat(o,"-months")]=!!o,e))},[o]);return(0,ey.jsxs)("div",eb({className:p},{children:[""!==r.prefixMonths&&(0,ey.jsx)("span",{children:r.prefixMonths||ew.prefixMonths}),(0,ey.jsx)(e_,{placeholder:r.emptyMonths||ew.emptyMonths,optionsList:d,grid:!1,value:t,unit:eb(eb({},eO[3]),{alt:r.altMonths||ew.altMonths}),setValue:n,locale:r,className:o,humanizeLabels:a,disabled:l,readOnly:c,period:u,periodicityOnDoubleClick:s,mode:f})]}))}function e$(e){var t=e.value,n=e.setValue,r=e.locale,o=e.className,a=e.disabled,l=e.readOnly,c=e.shortcuts,u=e.allowedPeriods,s=[];u.includes("year")&&s.push({value:"year",label:r.yearOption||ew.yearOption}),u.includes("month")&&s.push({value:"month",label:r.monthOption||ew.monthOption}),u.includes("week")&&s.push({value:"week",label:r.weekOption||ew.weekOption}),u.includes("day")&&s.push({value:"day",label:r.dayOption||ew.dayOption}),u.includes("hour")&&s.push({value:"hour",label:r.hourOption||ew.hourOption}),u.includes("minute")&&s.push({value:"minute",label:r.minuteOption||ew.minuteOption}),u.includes("reboot")&&c&&(!0===c||c.includes("@reboot"))&&s.push({value:"reboot",label:r.rebootOption||ew.rebootOption});var f=(0,i.useCallback)(function(e){l||n(e)},[n,l]),d=(0,i.useMemo)(function(){var e;return eC(((e={"react-js-cron-field":!0,"react-js-cron-period":!0})["".concat(o,"-field")]=!!o,e["".concat(o,"-period")]=!!o,e))},[o]),p=(0,i.useMemo)(function(){var e;return eC(((e={"react-js-cron-select":!0,"react-js-cron-select-no-prefix":""===r.prefixPeriod})["".concat(o,"-select")]=!!o,e))},[o,r.prefixPeriod]),m=(0,i.useMemo)(function(){var e;return eC(((e={"react-js-cron-select-dropdown":!0,"react-js-cron-select-dropdown-period":!0})["".concat(o,"-select-dropdown")]=!!o,e["".concat(o,"-select-dropdown-period")]=!!o,e))},[o]);return(0,ey.jsxs)("div",eb({className:d},{children:[""!==r.prefixPeriod&&(0,ey.jsx)("span",{children:r.prefixPeriod||ew.prefixPeriod}),(0,ey.jsx)(E.Select,{defaultValue:t,value:t,onChange:f,options:s,className:p,popupClassName:m,disabled:a,showArrow:!l,open:!l&&void 0,"data-testid":"select-period"},JSON.stringify(r))]}))}function eG(e){var t=e.value,n=e.setValue,r=e.locale,o=e.className,a=e.humanizeLabels,l=e.monthDays,c=e.disabled,u=e.readOnly,s=e.period,f=e.periodicityOnDoubleClick,d=e.mode,p=r.weekDays||ew.weekDays,m="week"===s||!l||0===l.length,y=(0,i.useMemo)(function(){var e;return eC(((e={"react-js-cron-field":!0,"react-js-cron-week-days":!0,"react-js-cron-week-days-placeholder":!m})["".concat(o,"-field")]=!!o,e["".concat(o,"-week-days")]=!!o,e))},[o,m]),b=JSON.stringify(r),v=(0,i.useMemo)(function(){return m?r.emptyWeekDays||ew.emptyWeekDays:r.emptyWeekDaysShort||ew.emptyWeekDaysShort},[m,b]),h="week"===s||!u||t&&t.length>0||(!t||0===t.length)&&(!l||0===l.length),g=!u||l&&l.length>0||(!l||0===l.length)&&(!t||0===t.length);return h?(0,ey.jsxs)("div",eb({className:y},{children:[""!==r.prefixWeekDays&&("week"===s||!g)&&(0,ey.jsx)("span",{children:r.prefixWeekDays||ew.prefixWeekDays}),""!==r.prefixWeekDaysForMonthAndYearPeriod&&"week"!==s&&g&&(0,ey.jsx)("span",{children:r.prefixWeekDaysForMonthAndYearPeriod||ew.prefixWeekDaysForMonthAndYearPeriod}),(0,ey.jsx)(e_,{placeholder:v,optionsList:p,grid:!1,value:t,unit:eb(eb({},eO[4]),{alt:r.altWeekDays||ew.altWeekDays}),setValue:n,locale:r,className:o,humanizeLabels:a,disabled:c,readOnly:u,period:s,periodicityOnDoubleClick:f,mode:d})]})):null}function eq(e){var t,n,r=e.clearButton,o=void 0===r||r,a=e.clearButtonProps,l=void 0===a?{}:a,c=e.clearButtonAction,u=void 0===c?"fill-with-every":c,s=e.locale,f=void 0===s?ew:s,d=e.value,p=void 0===d?"":d,m=e.setValue,y=e.displayError,b=void 0===y||y,v=e.onError,h=e.className,g=e.defaultPeriod,O=e.allowEmpty,w=void 0===O?"for-default-value":O,x=e.humanizeLabels,j=void 0===x||x,S=e.humanizeValue,C=void 0!==S&&S,k=e.disabled,A=void 0!==k&&k,P=e.readOnly,I=void 0!==P&&P,T=e.leadingZero,F=void 0!==T&&T,D=e.shortcuts,N=void 0===D?["@yearly","@annually","@monthly","@weekly","@daily","@midnight","@hourly"]:D,M=e.clockFormat,R=e.periodicityOnDoubleClick,_=void 0===R||R,B=e.mode,V=void 0===B?"multiple":B,W=e.allowedDropdowns,z=void 0===W?["period","months","month-days","week-days","hours","minutes"]:W,$=e.allowedPeriods,G=(0,i.useRef)(p),q=(0,i.useRef)(void 0===g?"day":g),L=(0,i.useState)(),U=L[0],K=L[1],H=(0,i.useState)(),Q=H[0],J=H[1],Y=(0,i.useState)(),Z=Y[0],X=Y[1],ee=(0,i.useState)(),et=ee[0],en=ee[1],er=(0,i.useState)(),eo=er[0],ei=er[1],ea=(0,i.useState)(),el=ea[0],ec=ea[1],eu=(0,i.useState)(!1),es=eu[0],ef=eu[1],ed=(0,i.useState)(!1),ep=ed[0],em=ed[1],eh=(t=ep,n=(0,i.useRef)(t),(0,i.useEffect)(function(){n.current=t},[t]),n.current),eg=JSON.stringify(f);(0,i.useEffect)(function(){eA(p,ef,v,w,G,!0,f,N,ec,ei,J,X,en,K)},[]),(0,i.useEffect)(function(){p!==G.current&&eA(p,ef,v,w,G,!1,f,N,ec,ei,J,X,en,K)},[p,G,eg,w,N]),(0,i.useEffect)(function(){if(!(U||el||Z||Q||et||eo)||ep||eh)ep&&em(!1);else{var e=U||q.current,t=eP(e,Z,Q,et,eo,el,C);m(t,{selectedPeriod:e}),G.current=t,v&&v(void 0),ef(!1)}},[U,Q,Z,et,eo,el,C,ep]);var eO=(0,i.useCallback)(function(){J(void 0),X(void 0),en(void 0),ei(void 0),ec(void 0);var e="",t="reboot"!==U&&U?U:q.current;t!==U&&K(t),"fill-with-every"===u&&(e=eP(t,void 0,void 0,void 0,void 0,void 0)),m(e,{selectedPeriod:t}),G.current=e,em(!0),"never"===w&&"empty"===u?(ef(!0),ek(v,f)):(v&&v(void 0),ef(!1))},[U,m,v,u]),ex=(0,i.useMemo)(function(){var e;return eC(((e={"react-js-cron":!0,"react-js-cron-error":es&&b,"react-js-cron-disabled":A,"react-js-cron-read-only":I})["".concat(h)]=!!h,e["".concat(h,"-error")]=es&&b&&!!h,e["".concat(h,"-disabled")]=A&&!!h,e["".concat(h,"-read-only")]=I&&!!h,e))},[h,es,b,A,I]),ej=l.className,eS=ev(l,["className"]),eE=(0,i.useMemo)(function(){var e;return eC(((e={"react-js-cron-clear-button":!0})["".concat(h,"-clear-button")]=!!h,e["".concat(ej)]=!!ej,e))},[h,ej]),eI=JSON.stringify(eS),eT=(0,i.useMemo)(function(){return o&&!I?(0,ey.jsx)(E.Button,eb({className:eE,danger:!0,type:"primary",disabled:A},eS,{onClick:eO},{children:f.clearButtonText||ew.clearButtonText})):null},[o,I,eg,eE,A,eI,eO]),eF=U||q.current;return(0,ey.jsxs)("div",eb({className:ex},{children:[z.includes("period")&&(0,ey.jsx)(e$,{value:eF,setValue:K,locale:f,className:h,disabled:A,readOnly:I,shortcuts:N,allowedPeriods:void 0===$?["year","month","week","day","hour","minute","reboot"]:$}),"reboot"===eF?eT:(0,ey.jsxs)(ey.Fragment,{children:["year"===eF&&z.includes("months")&&(0,ey.jsx)(ez,{value:Z,setValue:X,locale:f,className:h,humanizeLabels:j,disabled:A,readOnly:I,period:eF,periodicityOnDoubleClick:_,mode:V}),("year"===eF||"month"===eF)&&z.includes("month-days")&&(0,ey.jsx)(eW,{value:Q,setValue:J,locale:f,className:h,weekDays:et,disabled:A,readOnly:I,leadingZero:F,period:eF,periodicityOnDoubleClick:_,mode:V}),("year"===eF||"month"===eF||"week"===eF)&&z.includes("week-days")&&(0,ey.jsx)(eG,{value:et,setValue:en,locale:f,className:h,humanizeLabels:j,monthDays:Q,disabled:A,readOnly:I,period:eF,periodicityOnDoubleClick:_,mode:V}),(0,ey.jsxs)("div",{children:["minute"!==eF&&"hour"!==eF&&z.includes("hours")&&(0,ey.jsx)(eB,{value:eo,setValue:ei,locale:f,className:h,disabled:A,readOnly:I,leadingZero:F,clockFormat:M,period:eF,periodicityOnDoubleClick:_,mode:V}),"minute"!==eF&&z.includes("minutes")&&(0,ey.jsx)(eV,{value:el,setValue:ec,locale:f,period:eF,className:h,disabled:A,readOnly:I,leadingZero:F,clockFormat:M,periodicityOnDoubleClick:_,mode:V}),eT]})]})]}))}Object.freeze({__proto__:null,setValuesFromCronString:eA,getCronStringFromValues:eP,partToString:eI,formatValue:eT,parsePartArray:eF});function eL(){var e,t,n=(e=["\n display: flex;\n flex-direction: ",";\n align-items: flex-start;\n gap: 0.5em;\n\n .react-js-cron {\n width: 100%;\n padding: 0.5em 0.5em 0 0.5em;\n border: 1px dashed #ccc;\n\n .react-js-cron-field {\n margin-bottom: 0.5em;\n\n > span {\n margin: 0 0.5em 0 0;\n }\n\n > .react-js-cron-select {\n margin: 0 0.5em 0 0;\n }\n }\n\n .react-js-cron-week-days {\n > span {\n min-width: 2em;\n }\n }\n }\n "],!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return eL=function(){return n},n}var eU=[{value:"none",text:"No repeat"},{value:6e4,text:"By minute",unitText:"Minutes"},{value:36e5,text:"By hour",unitText:"Hours"},{value:864e5,text:"By day",unitText:"Days"},{value:6048e5,text:"By week",unitText:"Weeks"},{value:"cron",text:"Advanced"}];function eK(e){return eU.filter(function(e){return"number"==typeof e.value}).reverse().find(function(t){return!(e%t.value)})}function eH(e){var t=e.value,n=e.onChange,r=(0,p.cC)().t,o=eK(t);return a().createElement(E.InputNumber,{value:t/o.value,onChange:function(e){return n(e*o.value)},min:1,addonBefore:r("Every"),addonAfter:r(o.unitText),className:"auto-width"})}function eQ(e){var t=e.value,n=void 0===t?null:t,r=e.onChange,o=(0,p.cC)().t,l=function(e){var t,n;switch(void 0===e?"undefined":(n=e)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n){case"number":return(t=eK(e))?t.value:"none";case"string":return"cron"}return"none"}(n),c=(0,i.useCallback)(function(e){if("none"===e){r(null);return}if("cron"===e){r("0 * * * * *");return}r(e)},[r]);return a().createElement("fieldset",{className:(0,u.css)(eL(),"cron"===l?"column":"row")},a().createElement(E.Select,{value:l,onChange:c,className:"auto-width"},eU.map(function(e){return a().createElement(E.Select.Option,{key:e.value,value:e.value},o(e.text))})),"number"==typeof l?a().createElement(eH,{value:n,onChange:r}):null,"cron"===l?a().createElement(eq,{value:n.trim().split(/\s+/).slice(1).join(" "),setValue:function(e){return r("0 ".concat(e))},clearButton:!1,locale:window.cronLocale}):null)}function eJ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function eY(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eZ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){eY(e,t,n[t])})}return e}function eX(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}var e0=(eY(o={},en,{fieldset:{startsOn:{type:"datetime",title:'{{t("Starts on", { ns: "'.concat(p.A7,'" })}}'),"x-decorator":"FormItem","x-component":"DatePicker","x-component-props":{showTime:!0},required:!0},repeat:{type:"string",title:'{{t("Repeat mode", { ns: "'.concat(p.A7,'" })}}'),"x-decorator":"FormItem","x-component":"RepeatField","x-reactions":[{target:"endsOn",fulfill:{state:{visible:"{{!!$self.value}}"}}},{target:"limit",fulfill:{state:{visible:"{{!!$self.value}}"}}}]},endsOn:{type:"datetime",title:'{{t("Ends on", { ns: "'.concat(p.A7,'" })}}'),"x-decorator":"FormItem","x-component":"DatePicker","x-component-props":{showTime:!0}},limit:{type:"number",title:'{{t("Repeat limit", { ns: "'.concat(p.A7,'" })}}'),"x-decorator":"FormItem","x-component":"InputNumber","x-component-props":{placeholder:'{{t("No limit", { ns: "'.concat(p.A7,'" })}}'),min:0}}},triggerFieldset:{date:{type:"string",title:"{{t('Execute on', { ns: \"".concat(p.A7,'" })}}'),"x-decorator":"FormItem","x-component":"DatePicker","x-component-props":{showTime:!0,placeholder:"{{t('Current time', { ns: \"".concat(p.A7,'" })}}')}}}}),eY(o,er,{fieldset:{collection:eX(eZ({},h),{"x-component-props":{dataSourceFilter:function(e){return"main"===e.options.key||e.options.isDBInstance}},"x-reactions":((function(e){if(Array.isArray(e))return eJ(e)})(r=h["x-reactions"])||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return eJ(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eJ(e,t)}}(r)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([{target:"startsOn",effects:["onFieldValueChange"],fulfill:{state:{visible:"{{!!$self.value}}",value:"{{Object.create({})}}"}}}])}),startsOn:{type:"object",title:'{{t("Starts on", { ns: "'.concat(p.A7,'" })}}'),"x-decorator":"FormItem","x-component":"OnField","x-reactions":[{target:"repeat",fulfill:{state:{visible:"{{!!$self.value}}"}}}],required:!0},repeat:{type:"string",title:'{{t("Repeat mode", { ns: "'.concat(p.A7,'" })}}'),"x-decorator":"FormItem","x-component":"RepeatField","x-reactions":[{target:"endsOn",fulfill:{state:{visible:"{{!!$self.value}}"}}},{target:"limit",fulfill:{state:{visible:"{{!!$self.value}}"}}}]},endsOn:{type:"object",title:'{{t("Ends on", { ns: "'.concat(p.A7,'" })}}'),"x-decorator":"FormItem","x-component":"EndsByField"},limit:{type:"number",title:'{{t("Repeat limit", { ns: "'.concat(p.A7,'" })}}'),"x-decorator":"FormItem","x-component":"InputNumber","x-component-props":{placeholder:'{{t("No limit", { ns: "'.concat(p.A7,'" })}}'),min:0}},appends:eX(eZ({},j),{"x-reactions":[{dependencies:["mode","collection"],fulfill:{state:{visible:"{{$deps[0] === ".concat(er," && $deps[1]}}")}}}]})},triggerFieldset:{data:{type:"object",title:'{{t("Trigger data", { ns: "'.concat(p.A7,'" })}}'),description:'{{t("Choose a record of the collection to trigger.", { ns: "'.concat(p.A7,'" })}}'),"x-decorator":"FormItem","x-component":"TriggerCollectionRecordSelect",default:null,required:!0}},validate:function(e){return e.collection&&e.startsOn}}),o);function e1(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function e2(){var e,t,n=(e=["\n .ant-input-number {\n width: auto;\n min-width: 6em;\n }\n\n .ant-picker {\n width: auto;\n }\n "],!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return e2=function(){return n},n}var e7=[{value:en,label:'{{t("Based on certain date", { ns: "'.concat(p.A7,'" })}}')},{value:er,label:'{{t("Based on date field of collection", { ns: "'.concat(p.A7,'" })}}')}],e5=function(){var e,t,n,r,o,c,s=(0,l.useForm)(),f=s.values,d=s.clearFormGraph;var m=(e=(0,i.useState)((void 0===f?{}:f).mode),t=2,function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(e,2)||function(e,t){if(e){if("string"==typeof e)return e1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e1(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),y=m[0],b=m[1];return(0,l.useFormEffects)(function(){(0,et.onFieldValueChange)("mode",function(e){b(e.value),d("collection"),d("startsOn"),d("repeat"),d("endsOn"),d("limit")})}),a().createElement(a().Fragment,null,a().createElement(u.SchemaComponent,{schema:{type:"number",title:'{{t("Trigger mode", { ns: "'.concat(p.A7,'" })}}'),name:"mode","x-decorator":"FormItem","x-component":"Radio.Group",enum:e7,required:!0,default:en}}),a().createElement(u.SchemaComponent,{schema:{type:"void",properties:(n={},r="mode-".concat(y),o={type:"void","x-component":"fieldset","x-component-props":{className:(0,u.css)(e2())},properties:null===(c=e0[y])||void 0===c?void 0:c.fieldset},r in n?Object.defineProperty(n,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[r]=o,n)},components:{OnField:ed,RepeatField:eQ,EndsByField:em}}))};function e3(){var e=(0,D.G)().workflow,t=(0,R.cC)();return a().createElement(u.SchemaComponent,{components:t.components,schema:{type:"void",properties:e0[e.config.mode].triggerFieldset}})}function e8(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function e6(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function e4(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function e9(e){return(e9=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function te(e,t){return(te=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function tt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(e,t)||tn(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tn(e,t){if(e){if("string"==typeof e)return e8(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e8(e,t)}}function tr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(tr=function(){return!!e})()}function to(e,t){var n=tt((0,u.parseCollectionName)(e.collection),2),r=n[0];n[1];var o=(0,u.useCompile)(),i=(0,S.G$)(r),a=[];if((!(null==t?void 0:t.types)||t.types.includes("date"))&&a.push({key:"date",value:"date",label:(0,p.KQ)("Trigger time")}),e.mode===er){var l,c,s,f,d=tt((0,S._5)((c=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){e4(e,t,n[t])})}return e}({appends:["data"].concat(function(e){if(Array.isArray(e))return e8(e)}(l=(null===(f=e.appends)||void 0===f?void 0:f.map(function(e){return"data.".concat(e)}))||[])||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(l)||tn(l)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())},t),s=(s={fields:[{collectionName:e.collection,name:"data",type:"hasOne",target:e.collection,uiSchema:{title:(0,p.KQ)("Trigger data")}}],compile:o,getCollectionFields:i},s),Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(s)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(s)).forEach(function(e){Object.defineProperty(c,e,Object.getOwnPropertyDescriptor(s,e))}),c)),1)[0];d&&a.push(d)}return a}var ti=function(e){var t,n,r;function o(){var e,t,n,r;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,o),t=this,n=o,r=arguments,n=e9(n),e4(e=function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(t,tr()?Reflect.construct(n,r||[],e9(t).constructor):n.apply(t,r)),"sync",!1),e4(e,"title",'{{t("Schedule event", { ns: "'.concat(p.A7,'" })}}')),e4(e,"description",'{{t("Triggered according to preset time conditions. Suitable for one-time or periodic tasks, such as sending notifications and cleaning data on a schedule.", { ns: "'.concat(p.A7,'" })}}')),e4(e,"fieldset",{config:{type:"void","x-component":"ScheduleConfig","x-component-props":{}}}),e4(e,"triggerFieldset",{proxy:{type:"void","x-component":"TriggerScheduleConfig"}}),e4(e,"scope",{useCollectionDataSource:u.useCollectionDataSource}),e4(e,"components",{ScheduleConfig:e5,TriggerScheduleConfig:e3,TriggerCollectionRecordSelect:_.P}),e4(e,"useVariables",to),e}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&te(e,t)}(o,e),t=o,n=[{key:"validate",value:function(e){if(null==e.mode)return!1;var t=e0[e.mode].validate;return!t||t(e)}},{key:"useInitializers",value:function(e){return e.collection?{name:"triggerData",type:"item",title:'{{t("Trigger data", { ns: "'.concat(p.A7,'" })}}'),Component:f.P,collection:e.collection,dataPath:"$context.data"}:null}}],e6(t.prototype,n),o}(R.xz),ta=n("3461"),tl=n("47"),tc=n("799"),tu=n("8060"),ts=n("3048");function tf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function td(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tp(e){return(tp=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function tm(e,t){return(tm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ty(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ty=function(){return!!e})()}var tb=function(e){var t,n,r;function o(){var e,t,n,r,i;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,o),n=this,r=o,i=arguments,r=tp(r),td(e=function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(n,ty()?Reflect.construct(r,i||[],tp(n).constructor):r.apply(n,i)),"title",'{{t("Calculation", { ns: "'.concat(p.A7,'" })}}')),td(e,"type","calculation"),td(e,"group","calculation"),td(e,"description",'{{t("Calculate an expression based on a calculation engine and obtain a value as the result. Variables in the upstream nodes can be used in the expression.", { ns: "'.concat(p.A7,'" })}}')),td(e,"fieldset",{engine:{type:"string",title:'{{t("Calculation engine", { ns: "'.concat(p.A7,'" })}}'),"x-decorator":"FormItem","x-component":"RadioWithTooltip","x-component-props":{options:(0,tl.getOptions)()},required:!0,default:"formula.js"},expression:(td(t={type:"string",title:'{{t("Calculation expression", { ns: "'.concat(p.A7,'" })}}'),"x-decorator":"FormItem","x-component":"WorkflowVariableTextArea","x-component-props":{changeOnSelect:!0}},"x-validator",function(e,t,n){var r=n.form.values,o=tl.evaluators.get(r.engine).evaluate,i=e.trim().replace(/{{([^{}]+)}}/g,' "1" ');try{return o(i),""}catch(e){return(0,p.KQ)("Expression syntax error")}}),td(t,"x-reactions",[{dependencies:["engine"],fulfill:{schema:{description:"{{renderEngineReference($deps[0])}}"}}}]),td(t,"required",!0),t)}),td(e,"scope",{renderEngineReference:ts.$}),td(e,"components",{WorkflowVariableTextArea:S.r$,RadioWithTooltip:tc.W,ValueBlock:tu.X}),e}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&tm(e,t)}(o,e),t=o,n=[{key:"useVariables",value:function(e,t){var n=e.key,r=e.title,o=t.types,i=t.fieldNames;return(void 0===i&&S.Ox,o&&!o.some(function(e){return e in S.VW||Object.values(S.VW).some(function(t){return t.has(e)})}))?null:{value:n,label:r}}},{key:"useInitializers",value:function(e){var t,n;return{name:null!==(t=e.title)&&void 0!==t?t:"#".concat(e.id),type:"item",title:null!==(n=e.title)&&void 0!==n?n:"#".concat(e.id),Component:tu.X.Initializer,node:e,resultTitle:(0,p.KQ)("Calculation result")}}}],tf(t.prototype,n),o}(ta.vr),tv=n("2708"),th=n("8378"),tg=n("3430");function tO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function tw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function tx(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tj(e){return(tj=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function tS(e,t){return(tS=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function tC(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(e,t)||tk(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tk(e,t){if(e){if("string"==typeof e)return tO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tO(e,t)}}function tE(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(tE=function(){return!!e})()}var tA={ON_TRUE:1,ON_FALSE:0},tP=function(e){var t,n,r;function o(){var e,t,n,r,i,a;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,o),n=this,r=o,i=arguments,r=tj(r),tx(e=function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(n,tE()?Reflect.construct(r,i||[],tj(n).constructor):r.apply(n,i)),"title",'{{t("Condition", { ns: "'.concat(p.A7,'" })}}')),tx(e,"type","condition"),tx(e,"group","control"),tx(e,"description",'{{t(\'Based on boolean result of the calculation to determine whether to "continue" or "exit" the process, or continue on different branches of "yes" and "no".\', { ns: "'.concat(p.A7,'" })}}')),tx(e,"fieldset",{rejectOnFalse:{type:"boolean",title:'{{t("Mode", { ns: "'.concat(p.A7,'" })}}'),"x-decorator":"FormItem","x-component":"Radio.Group","x-component-props":{disabled:!0},enum:[{value:!0,label:'{{t(\'Continue when "Yes"\', { ns: "'.concat(p.A7,'" })}}')},{value:!1,label:'{{t(\'Branch into "Yes" and "No"\', { ns: "'.concat(p.A7,'" })}}')}]},engine:{type:"string",title:'{{t("Calculation engine", { ns: "'.concat(p.A7,'" })}}'),"x-decorator":"FormItem","x-component":"RadioWithTooltip","x-component-props":{options:[["basic",{label:'{{t("Basic", { ns: "'.concat(p.A7,'" })}}')}]].concat(function(e){if(Array.isArray(e))return tO(e)}(a=Array.from(tl.evaluators.getEntities()).filter(function(e){return["math.js","formula.js"].includes(tC(e,1)[0])}))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(a)||tk(a)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).reduce(function(e,t){var n=tC(t,2),r=n[0],o=n[1];return e.concat(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){tx(e,t,n[t])})}return e}({value:r},o))},[])},required:!0,default:"basic"},calculation:{type:"object",title:'{{t("Condition", { ns: "'.concat(p.A7,'" })}}'),"x-decorator":"FormItem","x-component":"CalculationConfig","x-reactions":{dependencies:["engine"],fulfill:{state:{visible:'{{$deps[0] === "basic"}}'}}},required:!0},expression:(tx(t={type:"string",title:'{{t("Condition expression", { ns: "'.concat(p.A7,'" })}}'),"x-decorator":"FormItem","x-component":"WorkflowVariableTextArea","x-component-props":{changeOnSelect:!0}},"x-validator",function(e,t,n){var r=n.form.values,o=tl.evaluators.get(r.engine).evaluate,i=e.trim().replace(/{{([^{}]+)}}/g,' "1" ');try{return o(i),""}catch(e){return(0,p.KQ)("Expression syntax error")}}),tx(t,"x-reactions",{dependencies:["engine"],fulfill:{state:{visible:'{{$deps[0] !== "basic"}}'},schema:{description:"{{renderEngineReference($deps[0])}}"}}}),tx(t,"required",!0),t)}),tx(e,"presetFieldset",{rejectOnFalse:{type:"boolean",title:'{{t("Mode", { ns: "'.concat(p.A7,'" })}}'),"x-decorator":"FormItem","x-component":"Radio.Group",enum:[{label:'{{t(\'Continue when "Yes"\', { ns: "'.concat(p.A7,'" })}}'),value:!0},{label:'{{t(\'Branch into "Yes" and "No"\', { ns: "'.concat(p.A7,'" })}}'),value:!1}],default:!0}}),tx(e,"branching",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.rejectOnFalse;return!(void 0===t||t)&&[{label:"{{t('After end of branches', { ns: \"".concat(p.A7,'" })}}'),value:!1},{label:'{{t(\'Inside of "Yes" branch\', { ns: "'.concat(p.A7,'" })}}'),value:tA.ON_TRUE},{label:'{{t(\'Inside of "No" branch\', { ns: "'.concat(p.A7,'" })}}'),value:tA.ON_FALSE}]}),tx(e,"scope",{renderEngineReference:ts.$,useWorkflowVariableOptions:S.rX}),tx(e,"components",{CalculationConfig:tg.G,WorkflowVariableTextArea:S.r$,RadioWithTooltip:tc.W}),e}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&tS(e,t)}(o,e),t=o,n=[{key:"Component",value:function(e){var t=e.data,n=(0,ea.useTranslation)().t,r=(0,D.G)().nodes,o=(0,th.Z)().styles,i=t.id,l=t.config.rejectOnFalse,c=r.find(function(e){return e.upstreamId===i&&1===e.branchIndex}),u=r.find(function(e){return e.upstreamId===i&&0===e.branchIndex});return a().createElement(ta.v9,{data:t},l?null:a().createElement("div",{className:o.nodeSubtreeClass},a().createElement("div",{className:o.branchBlockClass},a().createElement(tv.I,{from:t,entry:u,branchIndex:0}),a().createElement(tv.I,{from:t,entry:c,branchIndex:1})),a().createElement("div",{className:o.conditionClass},a().createElement("span",{style:{right:"4em"}},n("No")),a().createElement("span",{style:{left:"4em"}},n("Yes")))))}}],tw(t.prototype,n),o}(ta.vr),tI=n("9144");function tT(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tF(e){return(tF=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function tD(e,t){return(tD=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function tN(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(tN=function(){return!!e})()}var tM=function(e){function t(){var e,n,r,o;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),n=this,r=t,o=arguments,r=tF(r),tT(e=function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(n,tN()?Reflect.construct(r,o||[],tF(n).constructor):r.apply(n,o)),"title",'{{t("End process", { ns: "'.concat(p.A7,'" })}}')),tT(e,"type","end"),tT(e,"group","control"),tT(e,"description",'{{t("End the process immediately, with set status.", { ns: "'.concat(p.A7,'" })}}')),tT(e,"fieldset",{endStatus:{type:"number",title:'{{t("End status", { ns: "'.concat(p.A7,'" })}}'),"x-decorator":"FormItem","x-component":"Radio.Group",enum:[{label:'{{t("Succeeded", { ns: "'.concat(p.A7,'" })}}'),value:tI.jf.RESOLVED},{label:'{{t("Failed", { ns: "'.concat(p.A7,'" })}}'),value:tI.jf.FAILED}],required:!0,default:tI.jf.RESOLVED}}),tT(e,"end",!0),e}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&tD(e,t)}(t,e),t}(ta.vr),tR=n("4632"),t_=n("4339"),tB=n("7380");function tV(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function tW(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function tz(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t$(e){return(t$=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function tG(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){tz(e,t,n[t])})}return e}function tq(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function tL(e,t){return(tL=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function tU(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(e,t)||tH(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tK(e){return function(e){if(Array.isArray(e))return tV(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||tH(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tH(e,t){if(e){if("string"==typeof e)return tV(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tV(e,t)}}function tQ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(tQ=function(){return!!e})()}function tJ(e,t){var n,r,o=e.key,i=e.title,a=e.config,l=tU((0,u.parseCollectionName)(a.collection),2),c=l[0],s=l[1],f=(0,u.useCompile)(),d=(0,S.G$)(c);return tU((0,S._5)(tq(tG({appends:[o].concat(tK((null===(r=a.params)||void 0===r?void 0:null===(n=r.appends)||void 0===n?void 0:n.map(function(e){return"".concat(o,".").concat(e)}))||[]))},t),{fields:[{collectionName:s,name:o,type:"hasOne",target:s,uiSchema:{title:i}}],compile:f,getCollectionFields:d})),1)[0]}var tY=function(e){var t,n,r;function o(){var e,t,n,r;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,o),t=this,n=o,r=arguments,n=t$(n),tz(e=function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(t,tQ()?Reflect.construct(n,r||[],t$(t).constructor):n.apply(t,r)),"title",'{{t("Query record", { ns: "'.concat(p.A7,'" })}}')),tz(e,"type","query"),tz(e,"group","collection"),tz(e,"description",'{{t("Query records from a collection. You can use variables from upstream nodes as query conditions.", { ns: "'.concat(p.A7,'" })}}')),tz(e,"fieldset",{collection:tq(tG({},h),{"x-disabled":'{{ useNodeSavedConfig(["collection"]) }}',"x-reactions":tK(h["x-reactions"]).concat([{target:"params",effects:["onFieldValueChange"],fulfill:{state:{visible:"{{!!$self.value}}",value:"{{Object.create({})}}"}}}])}),multiple:{type:"boolean",title:'{{t("Result type", { ns: "'.concat(p.A7,'" })}}'),"x-decorator":"FormItem","x-component":"RadioWithTooltip","x-component-props":{options:[{label:'{{t("Single record", { ns: "'.concat(p.A7,'" })}}'),value:!1,tooltip:'{{t("The result will be an object of the first matching record only, or null if no matched record.", { ns: "'.concat(p.A7,'" })}}')},{label:'{{t("Multiple records", { ns: "'.concat(p.A7,'" })}}'),value:!0,tooltip:'{{t("The result will be an array containing matched records, or an empty one if no matching records. This can be used to be processed in a loop node.", { ns: "'.concat(p.A7,'" })}}')}]},required:!0,default:!1},params:{type:"object","x-component":"fieldset",properties:{filter:O,sort:w,pagination:x,appends:j},"x-reactions":[{dependencies:["collection"],fulfill:{state:{visible:"{{$deps[0] != null}}"}}}]},failOnEmpty:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-content":'{{t("Exit when query result is null", { ns: "'.concat(p.A7,'" })}}')}}),tz(e,"scope",{useNodeSavedConfig:ta.WH,useCollectionDataSource:u.useCollectionDataSource,useSortableFields:function(){var e=(0,u.useCompile)(),t=(0,l.useForm)().values,n=tU((0,u.parseCollectionName)(t.collection),2),r=n[0],o=n[1],i=(0,u.useApp)();return i.dataSourceManager.getDataSource(r).collectionManager.getCollectionFields(o).filter(function(e){if(!e.interface)return!1;var t=i.dataSourceManager.collectionFieldInterfaceManager.getFieldInterface(e.interface);return(null==t?!!void 0:!!t.sortable)||!1}).map(function(t){var n,r;return{value:t.name,label:(null==t?void 0:null===(n=t.uiSchema)||void 0===n?void 0:n.title)?e(null==t?void 0:null===(r=t.uiSchema)||void 0===r?void 0:r.title):t.name}})}}),tz(e,"components",{ArrayItems:tR.ArrayItems,FilterDynamicComponent:t_.V,SchemaComponentContext:u.SchemaComponentContext,WorkflowVariableInput:S.kw,RadioWithTooltip:tB.W5}),tz(e,"useVariables",tJ),e}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&tL(e,t)}(o,e),t=o,n=[{key:"useInitializers",value:function(e){var t,n;return!e.config.collection||e.config.multiple?null:{name:null!==(t=e.title)&&void 0!==t?t:"#".concat(e.id),type:"item",title:null!==(n=e.title)&&void 0!==n?n:"#".concat(e.id),Component:f.P,collection:e.config.collection,dataPath:"$jobsMapByNodeKey.".concat(e.key)}}}],tW(t.prototype,n),o}(ta.vr),tZ=n("482");function tX(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function t0(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t1(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){t0(e,t,n[t])})}return e}function t2(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function t7(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return tX(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tX(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function t5(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function t3(e){var t=function(e,t){if("object"!==t8(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==t8(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===t8(t)?t:String(t)}function t8(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function t6(){var e=t5(["\n margin-top: 0.5em;\n\n > .ant-formily-item {\n flex-direction: column;\n\n > .ant-formily-item-label {\n line-height: 32px;\n }\n }\n "]);return t6=function(){return e},e}function t4(){var e=t5(["\n .ant-form-item-control-input-content {\n display: flex;\n }\n "]);return t4=function(){return e},e}function t9(e){var t=(0,u.useCollectionManager_deprecated)().getCollectionFields,n=(0,l.useField)().path,r=n.segments[n.segments.length-1],o=(0,l.useForm)().values,c=t7((0,u.parseCollectionName)(null==o?void 0:o.collection),2),s=c[0],f=t(c[1],s).find(function(e){return e.name===r}).type,d=Array.isArray(e.value)?e.value.join(","):e.value,p=(0,i.useCallback)(function(t){var n=t.target.value.trim(),r=["belongsTo","hasOne"].includes(f)?n||null:n.split(",").map(function(e){return e.trim()}).filter(function(e){return""!==e});e.onChange(r)},[e.onChange,f]);return a().createElement(E.Input,t2(t1({},e),{value:d,onChange:p}))}var ne=(0,l.observer)(function(e){var t=e.value,n=e.disabled,r=e.onChange,o=e.filter,c=(0,u.useToken)().token,s=(0,ea.useTranslation)().t,f=(0,u.useCompile)(),d=(0,l.useForm)(),m=(0,u.useCollectionManager_deprecated)().getCollectionFields,y=(0,S.rX)(),b=d.values,v=t7((0,u.parseCollectionName)(null==b?void 0:b.collection),2),h=v[0],g=v[1],O=m(g,h).filter(function(e){return e.uiSchema}),w=o?O.filter(o.bind(b)):O,x=(0,i.useMemo)(function(){return w.filter(function(e){return!t||!(e.name in t)})},[w,t]),j=n||d.disabled,C=(0,i.useMemo)(function(){return{onClick:function(e){var n=e.key;r(t2(t1({},t),t0({},n,null)))},style:{maxHeight:300,overflowY:"auto"},items:x.map(function(e){var t,n;return{key:e.name,label:f(null!==(n=null===(t=e.uiSchema)||void 0===t?void 0:t.title)&&void 0!==n?n:e.name)}})}},[r,x,t]);return a().createElement("fieldset",{className:(0,u.css)(t6())},w.length?a().createElement(u.CollectionProvider_deprecated,{name:g,dataSource:h},w.filter(function(e){return t&&e.name in t}).map(function(e){var n,o,i=["belongsTo","hasOne","hasMany","belongsToMany"].includes(e.type)?t9:u.CollectionField;return a().createElement(E.Form.Item,{key:e.name,label:f(null!==(o=null===(n=e.uiSchema)||void 0===n?void 0:n.title)&&void 0!==o?o:e.name),labelAlign:"left",className:(0,u.css)(t4())},a().createElement(u.Variable.Input,{scope:y,value:t[e.name],changeOnSelect:!0,onChange:function(n){r(t2(t1({},t),t0({},e.name,n)))}},a().createElement(u.SchemaComponent,{schema:{type:"void",properties:t0({},e.name,t0({"x-component":i},"x-validator",function(){return""}))}})),j?null:a().createElement(E.Button,t0({"aria-label":"icon-close",type:"link",icon:a().createElement(tZ.CloseCircleOutlined,null)},"onClick",function(){var n=e.name;r((t[n],function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){if(n=i[r],!(t.indexOf(n)>=0))Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}(t,[n].map(t3))))})))}),x.length?a().createElement(E.Dropdown,{menu:C},a().createElement(E.Button,{icon:a().createElement(tZ.PlusOutlined,null)},s("Add field"))):null):a().createElement("p",{style:{color:c.colorText}},(0,p.KQ)("Please select collection first")))},{displayName:"CollectionFieldSet"}),nt=n("5229");function nn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nr(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function no(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return nn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nn(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ni(){return{name:(0,c.uid)(),type:"void","x-component":"Grid","x-initializer":"assignFieldValuesForm:configureFields"}}function na(e){var t=(0,D.G)().workflow,n=(0,u.useActionContext)().setFormValueChanged;(0,u.useAPIClient)();var r=(0,S.rX)(),o=(0,l.useForm)(),c=o.values,s=o.setValuesIn,f=o.disabled,d=(0,nt.toJS)(c.params),p=no((0,u.parseCollectionName)(c.collection),2),m=p[0],y=p[1],b=(0,u.useSchemaOptionsContext)(),v=no((0,i.useState)(e.value&&Object.keys(e.value).length?e.value:ni()),2),h=v[0],g=v[1],O=(0,i.useMemo)(function(){return(0,et.createForm)({initialValues:d.values,disabled:t.executed,effects:function(){(0,et.onFormValuesChange)(function(e){s("params.values",(0,nt.toJS)(e.values)),n(!0)})}})},[t.executed]);(0,l.useFormEffects)(function(){var e,t;(0,et.onFieldValueChange)("collection",(t=(e=function(e){var t;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(e){return O.clearFormGraph("*"),t=ni(),s("params.values",{}),g(t),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){nr(i,r,o,a,l,"next",e)}function l(e){nr(i,r,o,a,l,"throw",e)}a(void 0)})}),function(e){return t.apply(this,arguments)}))});var w=(0,i.useCallback)(function(t){var n=no(Object.values(t.toJSON().properties),1)[0];e.onChange(n);var r=new Set;!function e(t,n){n(t),(null==t?void 0:t.properties)&&Object.values(t.properties).forEach(function(t){e(t,n)})}(n,function(e){if("AssignedField"===e["x-component"]){var t;if(null===(t=e["x-collection-field"])||void 0===t?void 0:t.startsWith("".concat(y,"."))){var n=no(e["x-collection-field"].split("."),2)[1];r.add(n)}}});var o={};Array.from(r).forEach(function(e){e in O.values&&(o[e]=O.values[e])}),s("params.values",o)},[y,e.onChange]);return a().createElement(E.Card,null,a().createElement(u.CollectionManagerProvider,{dataSource:m},a().createElement(u.CollectionProvider,{name:y},a().createElement(u.RerenderDataBlockProvider,null,a().createElement(u.FormProvider,{form:O},a().createElement(tR.FormLayout,{layout:"vertical"},a().createElement(u.VariableScopeProvider,{scope:r},a().createElement(u.SchemaComponentProvider,{form:O,designable:!f},a().createElement(u.SchemaComponentOptions,b,a().createElement(u.SchemaComponent,{schema:h,onChange:w}))))))))))}function nl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function nu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ns(e){return(ns=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function nf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){nu(e,t,n[t])})}return e}function nd(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function np(e,t){return(np=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function nm(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(e,t)||nb(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ny(e){return function(e){if(Array.isArray(e))return nl(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||nb(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nb(e,t){if(e){if("string"==typeof e)return nl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nl(e,t)}}function nv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(nv=function(){return!!e})()}function nh(e,t){var n,r,o=e.key,i=e.title,a=e.config,l=nm((0,u.parseCollectionName)(a.collection),2),c=l[0],s=l[1],f=(0,u.useCompile)(),d=(0,S.G$)(c);return nm((0,S._5)(nd(nf({appends:[o].concat(ny((null===(r=a.params)||void 0===r?void 0:null===(n=r.appends)||void 0===n?void 0:n.map(function(e){return"".concat(o,".").concat(e)}))||[]))},t),{fields:[{collectionName:s,name:o,type:"hasOne",target:s,uiSchema:{title:i}}],compile:f,getCollectionFields:d})),1)[0]}var ng=function(e){var t,n,r;function o(){var e,t,n,r;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,o),t=this,n=o,r=arguments,n=ns(n),nu(e=function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(t,nv()?Reflect.construct(n,r||[],ns(t).constructor):n.apply(t,r)),"title",'{{t("Create record", { ns: "'.concat(p.A7,'" })}}')),nu(e,"type","create"),nu(e,"group","collection"),nu(e,"description",'{{t("Add new record to a collection. You can use variables from upstream nodes to assign values to fields.", { ns: "'.concat(p.A7,'" })}}')),nu(e,"fieldset",{collection:nd(nf({},h),{"x-disabled":'{{ useNodeSavedConfig(["collection"]) }}',"x-reactions":ny(h["x-reactions"]).concat([{target:"params",effects:["onFieldValueChange"],fulfill:{state:{value:"{{Object.create({})}}"}}}])}),usingAssignFormSchema:{type:"boolean"},assignFormSchema:{type:"object",title:'{{t("Fields values")}}',"x-decorator":"FormItem","x-component":"AssignedFieldsFormSchemaConfig","x-reactions":[{dependencies:["collection","usingAssignFormSchema"],fulfill:{state:{display:'{{($deps[0] && $deps[1]) ? "visible" : "hidden"}}'}}}]},params:{type:"object",properties:{values:nd(nf({},g),{"x-reactions":[{dependencies:["collection","usingAssignFormSchema"],fulfill:{state:{display:'{{($deps[0] && !$deps[1]) ? "visible" : "hidden"}}'}}}]}),appends:j}}}),nu(e,"scope",{useCollectionDataSource:u.useCollectionDataSource,useNodeSavedConfig:ta.WH}),nu(e,"components",{CollectionFieldset:ne,AssignedFieldsFormSchemaConfig:na}),nu(e,"useVariables",nh),e}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&np(e,t)}(o,e),t=o,n=[{key:"createDefaultConfig",value:function(){return{usingAssignFormSchema:!0,assignFormSchema:{}}}},{key:"useInitializers",value:function(e){var t,n;return e.config.collection?{name:null!==(t=e.title)&&void 0!==t?t:"#".concat(e.id),type:"item",title:null!==(n=e.title)&&void 0!==n?n:"#".concat(e.id),Component:f.P,collection:e.config.collection,dataPath:"$jobsMapByNodeKey.".concat(e.key)}:null}}],nc(t.prototype,n),o}(ta.vr);function nO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function nx(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nj(e){return(nj=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function nS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){nx(e,t,n[t])})}return e}function nC(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function nk(e,t){return(nk=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function nE(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(nE=function(){return!!e})()}var nA=function(e){var t,n,r;function o(){var e,t,n,r,i;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,o),t=this,n=o,r=arguments,n=nj(n),nx(e=function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(t,nE()?Reflect.construct(n,r||[],nj(t).constructor):n.apply(t,r)),"title",'{{t("Update record", { ns: "'.concat(p.A7,'" })}}')),nx(e,"type","update"),nx(e,"group","collection"),nx(e,"description",'{{t("Update records of a collection. You can use variables from upstream nodes as query conditions and field values.", { ns: "'.concat(p.A7,'" })}}')),nx(e,"fieldset",{collection:nC(nS({},h),{"x-disabled":'{{ useNodeSavedConfig(["collection"]) }}',"x-reactions":((function(e){if(Array.isArray(e))return nO(e)})(i=h["x-reactions"])||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||function(e,t){if(e){if("string"==typeof e)return nO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nO(e,t)}}(i)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([{target:"params",fulfill:{state:{visible:"{{!!$self.value}}"}}},{target:"params.filter",effects:["onFieldValueChange"],fulfill:{state:{value:"{{Object.create({})}}"}}},{target:"params.values",effects:["onFieldValueChange"],fulfill:{state:{value:"{{Object.create({})}}"}}}])}),params:{type:"object",properties:{individualHooks:{type:"boolean",title:'{{t("Update mode", { ns: "'.concat(p.A7,'" })}}'),"x-decorator":"FormItem","x-component":"RadioWithTooltip","x-component-props":{options:[{label:'{{t("Update in a batch", { ns: "'.concat(p.A7,'" })}}'),value:!1,tooltip:'{{t("Update all eligible data at one time, which has better performance when the amount of data is large. But association fields are not supported (unless foreign key in current collection), and the updated data will not trigger other workflows.", { ns: "'.concat(p.A7,'" })}}')},{label:'{{t("Update one by one", { ns: "'.concat(p.A7,'" })}}'),value:!0,tooltip:'{{t("The updated data can trigger other workflows, and the audit log will also be recorded. But it is usually only applicable to several or dozens of pieces of data, otherwise there will be performance problems.", { ns: "'.concat(p.A7,'" })}}')}]},default:!1},filter:nC(nS({},O),nx({title:'{{t("Only update records matching conditions", { ns: "'.concat(p.A7,'" })}}')},"x-validator",function(e){return(0,s.isValidFilter)(e)?"":(0,p.KQ)("Please add at least one condition")})),values:nC(nS({},g),{"x-reactions":[{dependencies:["collection","usingAssignFormSchema"],fulfill:{state:{display:'{{($deps[0] && !$deps[1]) ? "visible" : "hidden"}}'}}}]})}},usingAssignFormSchema:{type:"boolean"},assignFormSchema:{type:"object",title:'{{t("Fields values")}}',"x-decorator":"FormItem","x-component":"AssignedFieldsFormSchemaConfig","x-reactions":[{dependencies:["collection","usingAssignFormSchema"],fulfill:{state:{display:'{{($deps[0] && $deps[1]) ? "visible" : "hidden"}}'}}}]}}),nx(e,"scope",{useCollectionDataSource:u.useCollectionDataSource,useNodeSavedConfig:ta.WH}),nx(e,"components",{FilterDynamicComponent:t_.V,CollectionFieldset:ne,AssignedFieldsFormSchemaConfig:na,RadioWithTooltip:tc.W}),e}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&nk(e,t)}(o,e),t=o,n=[{key:"createDefaultConfig",value:function(){return{usingAssignFormSchema:!0,assignFormSchema:{}}}}],nw(t.prototype,n),o}(ta.vr);function nP(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nI(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nT(e){return(nT=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function nF(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){nI(e,t,n[t])})}return e}function nD(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function nN(e,t){return(nN=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function nM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(nM=function(){return!!e})()}var nR=function(e){function t(){var e,n,r,o,i;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),n=this,r=t,o=arguments,r=nT(r),nI(e=function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(n,nM()?Reflect.construct(r,o||[],nT(n).constructor):r.apply(n,o)),"title",'{{t("Delete record")}}'),nI(e,"type","destroy"),nI(e,"group","collection"),nI(e,"description",'{{t("Delete records of a collection. Could use variables in workflow context as filter. All records match the filter will be deleted.", { ns: "'.concat(p.A7,'" })}}')),nI(e,"fieldset",{collection:nD(nF({},h),{"x-disabled":'{{ useNodeSavedConfig(["collection"]) }}',"x-reactions":((function(e){if(Array.isArray(e))return nP(e)})(i=h["x-reactions"])||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||function(e,t){if(e){if("string"==typeof e)return nP(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nP(e,t)}}(i)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([{target:"params",fulfill:{state:{visible:"{{!!$self.value}}"}}},{target:"params",effects:["onFieldValueChange"],fulfill:{state:{value:"{{Object.create({})}}"}}}])}),params:{type:"object",properties:{filter:nD(nF({},O),nI({},"x-validator",function(e){return(0,s.isValidFilter)(e)?"":(0,p.KQ)("Please add at least one condition")}))}}}),nI(e,"scope",{useNodeSavedConfig:ta.WH,useCollectionDataSource:u.useCollectionDataSource}),nI(e,"components",{FilterDynamicComponent:t_.V}),e}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&nN(e,t)}(t,e),t}(ta.vr),n_=n("7893"),nB=new u.SchemaSettings({name:"actionSettings:submitToWorkflow",items:[{name:"editButton",Component:u.ButtonEditor,useComponentProps:function(){return(0,u.useSchemaToolbar)().buttonEditorProps}},{name:"secondConfirmation",Component:u.SecondConFirm},{name:"assignFieldValues",Component:u.AssignedFieldValues},{name:"skipRequiredValidation",Component:u.SkipValidation},{name:"afterSuccessfulSubmission",Component:u.AfterSuccess},{name:"bindWorkflow",Component:u.WorkflowConfig},{name:"delete",sort:100,Component:u.RemoveButton,useComponentProps:function(){return(0,u.useSchemaToolbar)().removeButtonProps}}]});function nV(e){var t=e.children,n=e.workflow,r=e.execution,o=e.nodes,i=(0,u.usePlugin)(nX),l=i.triggers.get(n.type).components,c=o.reduce(function(e,t){var n=t.type;return Object.assign(e,i.instructions.get(n).components)},{});return a().createElement(D.i.Provider,{value:{workflow:n,nodes:o,execution:r}},a().createElement(u.SchemaComponentOptions,{components:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}({},l,c)},t))}var nW=n(3581);function nz(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function n$(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function nG(e,t,n){return(nG=nQ()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&nK(o,n.prototype),o}).apply(null,arguments)}function nq(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function nL(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nU(e){return(nU=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function nK(e,t){return(nK=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function nH(e){var t="function"==typeof Map?new Map:void 0;return(nH=function(e){var n;if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return nG(e,arguments,nU(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),nK(r,e)})(e)}function nQ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(nQ=function(){return!!e})()}var nJ=(0,u.lazy)(function(){return nW("imported_-1mcq5or_component",n.e("999").then(n.bind(n,5625)))},"ExecutionPage").ExecutionPage,nY=(0,u.lazy)(function(){return nW("imported_-1vg6s1k_component",Promise.all([n.e("383"),n.e("929")]).then(n.bind(n,5437)))},"WorkflowPage").WorkflowPage,nZ=(0,u.lazy)(function(){return nW("imported_18jsd45_component",Promise.all([n.e("383"),n.e("923")]).then(n.bind(n,1837)))},"WorkflowPane").WorkflowPane,nX=function(e){var t,n,r;function o(){var e,t,n,r;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,o),t=this,n=o,r=arguments,n=nU(n),nL(e=function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(t,nQ()?Reflect.construct(n,r||[],nU(t).constructor):n.apply(t,r)),"triggers",new s.Registry),nL(e,"instructions",new s.Registry),nL(e,"systemVariables",new s.Registry),nL(e,"useTriggersOptions",function(){var t=(0,u.useCompile)();return Array.from(e.triggers.getEntities()).map(function(e){var n,r,o=(r=2,function(e){if(Array.isArray(e))return e}(n=e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(n,2)||function(e,t){if(e){if("string"==typeof e)return nz(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nz(e,t)}}(n,r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),i=o[0],a=o[1].title,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){if(n=i[r],!(t.indexOf(n)>=0))Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}(e[1],["title"]);return{value:i,label:t(a),color:"gold",options:l}}).sort(function(e,t){return e.label.localeCompare(t.label)})}),e}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&nK(e,t)}(o,e),t=o,n=[{key:"isWorkflowSync",value:function(e){var t,n;return null!==(n=null===(t=this.triggers.get(e.type))||void 0===t?void 0:t.sync)&&void 0!==n?n:e.sync}},{key:"registerTrigger",value:function(e,t){if("function"==typeof t)this.triggers.register(e,new t);else if(t)this.triggers.register(e,t);else throw TypeError("invalid trigger type to register")}},{key:"registerInstruction",value:function(e,t){if("function"==typeof t)this.instructions.register(e,new t);else{var n,r;if(n=t,null!=(r=ta.vr)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](n):n instanceof r)this.instructions.register(e,t);else throw TypeError("invalid instruction type to register")}}},{key:"registerSystemVariable",value:function(e){this.systemVariables.register(e.key,e)}},{key:"load",value:function(){var e,t=this;return(e=function(){return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(e){return t.app.router.add("admin.workflow.workflows.id",{path:(0,n_.SI)(":id"),element:a().createElement(nY,null)}),t.app.router.add("admin.workflow.executions.id",{path:(0,n_.s_)(":id"),element:a().createElement(nJ,null)}),t.app.pluginSettingsManager.add(p.A7,{icon:"PartitionOutlined",title:'{{t("Workflow", { ns: "'.concat(p.A7,'" })}}'),Component:nZ,aclSnippet:"pm.workflow.workflows"}),t.app.schemaSettingsManager.add(nB),t.app.schemaSettingsManager.addItem("actionSettings:delete","workflowConfig",{Component:u.WorkflowConfig,useVisible:function(){var e,t=(0,l.useFieldSchema)();return(0,c.isValid)(null==t?void 0:null===(e=t["x-action-settings"])||void 0===e?void 0:e.triggerWorkflows)}}),t.registerTrigger("collection",ee),t.registerTrigger("schedule",ti),t.registerInstruction("calculation",tb),t.registerInstruction("condition",tP),t.registerInstruction("end",tM),t.registerInstruction("query",tY),t.registerInstruction("create",ng),t.registerInstruction("update",nA),t.registerInstruction("destroy",nR),t.registerSystemVariable({key:"now",label:'{{t("System time", { ns: "'.concat(p.A7,'" })}}'),value:"now"}),t.registerSystemVariable({key:"dateRange",label:'{{t("Date range", { ns: "'.concat(p.A7,'" })}}'),value:"dateRange",children:[{key:"yesterday",value:"yesterday",label:'{{t("Yesterday", { ns: "'.concat(p.A7,'" })}}')},{key:"today",value:"today",label:'{{t("Today", { ns: "'.concat(p.A7,'" })}}')},{key:"tomorrow",value:"tomorrow",label:'{{t("Tomorrow", { ns: "'.concat(p.A7,'" })}}')},{key:"lastWeek",value:"lastWeek",label:'{{t("Last week", { ns: "'.concat(p.A7,'" })}}')},{key:"thisWeek",value:"thisWeek",label:'{{t("This week", { ns: "'.concat(p.A7,'" })}}')},{key:"nextWeek",value:"nextWeek",label:'{{t("Next week", { ns: "'.concat(p.A7,'" })}}')},{key:"lastMonth",value:"lastMonth",label:'{{t("Last month", { ns: "'.concat(p.A7,'" })}}')},{key:"thisMonth",value:"thisMonth",label:'{{t("This month", { ns: "'.concat(p.A7,'" })}}')},{key:"nextMonth",value:"nextMonth",label:'{{t("Next month", { ns: "'.concat(p.A7,'" })}}')},{key:"lastQuarter",value:"lastQuarter",label:'{{t("Last quarter", { ns: "'.concat(p.A7,'" })}}')},{key:"thisQuarter",value:"thisQuarter",label:'{{t("This quarter", { ns: "'.concat(p.A7,'" })}}')},{key:"nextQuarter",value:"nextQuarter",label:'{{t("Next quarter", { ns: "'.concat(p.A7,'" })}}')},{key:"lastYear",value:"lastYear",label:'{{t("Last year", { ns: "'.concat(p.A7,'" })}}')},{key:"thisYear",value:"thisYear",label:'{{t("This year", { ns: "'.concat(p.A7,'" })}}')},{key:"nextYear",value:"nextYear",label:'{{t("Next year", { ns: "'.concat(p.A7,'" })}}')},{key:"last7Days",value:"last7Days",label:'{{t("Last 7 days", { ns: "'.concat(p.A7,'" })}}')},{key:"next7Days",value:"next7Days",label:'{{t("Next 7 days", { ns: "'.concat(p.A7,'" })}}')},{key:"last30Days",value:"last30Days",label:'{{t("Last 30 days", { ns: "'.concat(p.A7,'" })}}')},{key:"next30Days",value:"next30Days",label:'{{t("Next 30 days", { ns: "'.concat(p.A7,'" })}}')},{key:"last90Days",value:"last90Days",label:'{{t("Last 90 days", { ns: "'.concat(p.A7,'" })}}')},{key:"next90Days",value:"next90Days",label:'{{t("Next 90 days", { ns: "'.concat(p.A7,'" })}}')}]}),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){n$(i,r,o,a,l,"next",e)}function l(e){n$(i,r,o,a,l,"throw",e)}a(void 0)})})()}}],nq(t.prototype,n),o}(nH(u.Plugin))},3461:function(e,t,n){"use strict";n.d(t,{E9:function(){return U},Kd:function(){return G},Lu:function(){return $},NB:function(){return q},WH:function(){return z},h6:function(){return W},sy:function(){return V},v9:function(){return X},vr:function(){return _},xZ:function(){return L}});var r=n(482),o=n(8563),i=n(5229),a=n(3505),l=n(2721),c=n(467),u=n(8156),s=n.n(u),f=n(3238),d=n(3772),p=n(7584),m=n(5019),y=n(5071),b=n(8018),v=n(1220),h=n(6594),g=n(9144),O=n(6279),w=n(573),x=n(8378),j=n(6805);function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function C(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function k(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){C(i,r,o,a,l,"next",e)}function l(e){C(i,r,o,a,l,"throw",e)}a(void 0)})}}function E(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function A(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){A(e,t,n[t])})}return e}function I(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function T(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return S(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function F(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function D(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}function N(){var e=F(["\n margin-bottom: 1em;\n "]);return N=function(){return e},e}function M(){var e=F(["\n display: flex;\n justify-content: space-between;\n\n strong {\n font-weight: bold;\n }\n\n .ant-tag {\n margin-inline-end: 0;\n }\n\n code {\n font-weight: normal;\n }\n "]);return M=function(){return e},e}function R(){var e=F(["\n .ant-input,\n .ant-select,\n .ant-cascader-picker,\n .ant-picker,\n .ant-input-number,\n .ant-input-affix-wrapper {\n &.auto-width {\n width: auto;\n min-width: 6em;\n }\n }\n "]);return R=function(){return e},e}var _=function(){var e,t,n;function r(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,r),A(this,"title",void 0),A(this,"type",void 0),A(this,"group",void 0),A(this,"description",void 0),A(this,"options",void 0),A(this,"fieldset",void 0),A(this,"presetFieldset",void 0),A(this,"branching",void 0),A(this,"view",void 0),A(this,"scope",void 0),A(this,"components",void 0),A(this,"end",void 0),A(this,"testable",void 0)}return e=r,t=[{key:"createDefaultConfig",value:function(){return{}}}],E(e.prototype,t),r}();function B(){var e=(0,a.useForm)(),t=(0,d.useAPIClient)(),n=(0,d.useActionContext)(),r=(0,d.useResourceActionContext)().refresh,o=W(),c=(0,b.G)().workflow;return{run:function(){return k(function(){var a,u;return D(this,function(s){switch(s.label){case 0:if(c.executed)return l.message.error((0,w.KQ)("Node in executed workflow cannot be modified")),[2];return[4,e.submit()];case 1:return s.sent(),[4,null===(a=(u=t.resource("flow_nodes")).update)||void 0===a?void 0:a.call(u,{filterByTk:o.id,values:{config:e.values}})];case 2:return s.sent(),e.setInitialValues((0,i.toJS)(e.values)),n.setFormValueChanged(!1),n.setVisible(!1),r(),[2]}})})()}}}var V=s().createContext({});function W(){return(0,u.useContext)(V)}function z(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=W();return e.some(function(e){return null!=(0,c.get)(t.config,e)})}function $(e,t){var n=[];if(!e)return[];for(var r=e.upstream;r;r=r.upstream)("function"!=typeof t||t(r))&&n.push(r);return n}function G(e){for(var t=[],n=e;n;n=n.upstream)n.upstream&&null!=n.branchIndex&&t.push(n.upstream);return t}function q(e){var t,n=e.data,o=(0,x.Z)().styles,i=(0,O.C)(n).getAriaLabel,a=null!==(t=(0,d.usePlugin)(m.default).instructions.get(n.type))&&void 0!==t?t:{},l=a.Component,c=a.end;return s().createElement(V.Provider,{value:n},s().createElement("div",{className:(0,d.cx)(o.nodeBlockClass)},s().createElement(void 0===l?X:l,{data:n}),c&&("function"!=typeof c||c(n))?s().createElement("div",{className:"end-sign"},s().createElement(r.CloseOutlined,null)):s().createElement(y.HS,{"aria-label":i(),upstream:n})))}function L(){var e,t=(0,f.useTranslation)().t,n=(0,d.useAPIClient)(),o=null!==(e=(0,b.G)())&&void 0!==e?e:{},i=o.workflow,a=o.nodes,c=o.refresh,m=W(),y=l.App.useApp().modal,v=n.resource("flow_nodes"),h=(0,u.useCallback)(k(function(){var e;return D(this,function(t){switch(t.label){case 0:return[4,null===(e=v.destroy)||void 0===e?void 0:e.call(v,{filterByTk:m.id})];case 1:return t.sent(),c(),[2]}})}),[m.id,c,v]),g=(0,u.useCallback)(k(function(){var e,n;return D(this,function(r){return(e=a.filter(function(e){return e!==m&&(0,p.parse)(e.config).parameters.filter(function(e){var t=e.key;return t.startsWith("$jobsMapByNodeKey.".concat(m.key,"."))||t==="$jobsMapByNodeKey.".concat(m.key)}).length})).length?(y.error({title:(0,w.KQ)("Can not delete"),content:(0,w.KQ)("The result of this node has been referenced by other nodes ({{nodes}}), please remove the usage before deleting.",{nodes:e.map(function(e){return"#".concat(e.id)}).join(", ")})}),[2]):(n=a.find(function(e){return e.upstream===m&&null!=e.branchIndex})?(0,w.KQ)("This node contains branches, deleting will also be preformed to them, are you sure?"):t("Are you sure you want to delete it?"),y.confirm({title:t("Delete"),content:n,onOk:h}),[2])})}),[m,y,a,h,t]);return i?i.executed?null:s().createElement(l.Button,{type:"text",shape:"circle",icon:s().createElement(r.DeleteOutlined,null),onClick:g,className:"workflow-node-remove-button",size:"small"}):null}function U(){var e,t=(0,b.G)(),n=t.execution,r=t.setViewJob,o=(null!==(e=W())&&void 0!==e?e:{}).jobs,i=(0,x.Z)().styles;return n?o.length?s().createElement(l.Tooltip,{title:(0,w.KQ)("View result")},o.length>1?s().createElement(l.Dropdown,{menu:{items:o.map(function(e){return{key:e.id,label:s().createElement(s().Fragment,null,s().createElement(h.Y,{statusMap:g.ke,status:e.status}),s().createElement("time",null,(0,p.str2moment)(e.updatedAt).format("YYYY-MM-DD HH:mm:ss")))}}),onClick:function(e){var t=e.key;r(o.find(function(e){return e.id==t}))},className:i.dropdownClass}},s().createElement(h.Y,{statusMap:g.ke,status:o[o.length-1].status,className:i.nodeJobButtonClass})):s().createElement(h.Y,{statusMap:g.ke,status:o[0].status,onClick:function(){return r(o[0])},className:i.nodeJobButtonClass})):s().createElement(h.Y,{className:i.nodeJobButtonClass,disabled:!0}):null}function K(){return{form:(0,a.useForm)()}}var H=function(){var e=(0,a.useForm)(),t=e.values,n=e.query,r=W(),o=(0,d.useAPIClient)(),l=(0,d.useActionContext)(),c=(0,a.useField)();return{run:function(){return k(function(){var e,a,u,s;return D(this,function(f){switch(f.label){case 0:e=(0,p.parse)(r.config)((0,i.toJS)(t.config)),(a=n("result").take()).setValue(null),a.setFeedback({}),c.data=c.data||{},c.data.loading=!0,f.label=1;case 1:return f.trys.push([1,3,,4]),[4,o.resource("flow_nodes").test({values:{config:e,type:r.type}})];case 2:return u=f.sent().data.data,a.setFeedback({type:u.status>0?"success":"error",messages:u.status>0?[(0,w.KQ)("Resolved")]:[(0,w.KQ)("Failed")]}),a.setValue(u.result),[3,4];case 3:return s=f.sent(),a.setFeedback({type:"error",messages:s.message}),[3,4];case 4:return c.data.loading=!1,l.setFormValueChanged(!1),[2]}})})()}}},Q=(0,u.createContext)([]);function J(e){var t=e.name,n=e.value,r=e.onChange;return s().createElement(l.Space,null,s().createElement(j.kw,{variableOptions:{},value:"{{".concat(t,"}}"),disabled:!0}),s().createElement(d.Variable.Input,{useTypedConstant:["string","number","boolean","date"],value:n,onChange:r}))}function Y(e){var t=e.value,n=e.onChange,r=(0,u.useContext)(Q);return r.length?s().createElement(s().Fragment,null,r.map(function(e){return s().createElement(J,{key:e,name:e,value:(0,c.get)(t,e),onChange:function(r){(0,c.set)(t,e,r),n(t)}})})):s().createElement(l.Empty,{image:l.Empty.PRESENTED_IMAGE_SIMPLE,description:(0,w.KQ)("No variable"),style:{margin:"1em"}})}function Z(){var e=W(),t=(0,a.useForm)().values,n=(0,p.parse)(t).parameters.map(function(e){return e.key}),r=(0,u.useMemo)(function(){return(0,o.createForm)()},[]);return s().createElement(V.Provider,{value:I(P({},e),{config:t})},s().createElement(Q.Provider,{value:n},s().createElement(d.SchemaComponent,{components:{Alert:l.Alert,TestFormFieldset:Y},scope:{useCancelAction:d.useCancelAction,useRunAction:H},schema:{type:"void",name:"testButton",title:'{{t("Test run")}}',"x-component":"Action","x-component-props":{icon:"CaretRightOutlined"},properties:{modal:{type:"void","x-decorator":"FormV2","x-decorator-props":{form:r},"x-component":"Action.Modal",title:'{{t("Test run", { ns: "workflow" })}}',properties:{alert:{type:"void","x-component":"Alert","x-component-props":{message:'{{t("Test run will do the actual data manipulating or API calling, please use with caution.", { ns: "workflow" })}}',type:"warning",showIcon:!0,className:(0,d.css)(N())}},config:{type:"object",title:'{{t("Replace variables", { ns: "workflow" })}}',"x-decorator":"FormItem","x-component":"TestFormFieldset"},actions:{type:"void","x-component":"ActionBar",properties:{submit:{type:"void",title:'{{t("Run")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ useRunAction }}"}}}},result:{type:"string",title:'{{t("Result", { ns: "workflow" })}}',"x-decorator":"FormItem","x-component":"Input.JSON","x-component-props":{autoSize:{minRows:5,maxRows:20},style:{whiteSpace:"pre",cursor:"text"}},"x-pattern":"disabled"},footer:{type:"void","x-component":"Action.Modal.Footer",properties:{cancel:{type:"void",title:'{{t("Close")}}',"x-component":"Action","x-component-props":{useAction:"{{ useCancelAction }}"}}}}}}}}})))}function X(e){var t,n,r=e.data,i=e.children,f=(0,d.useCompile)(),p=(0,d.useAPIClient)(),y=null!==(n=(0,b.G)())&&void 0!==n?n:{},h=y.workflow,g=y.refresh,O=(0,x.Z)().styles,j=(0,d.usePlugin)(m.default).instructions.get(r.type),S=h.executed?'{{t("View")}}':'{{t("Configure")}}',C=T((0,u.useState)(r.title),2),E=C[0],F=C[1],N=T((0,u.useState)(!1),2),_=N[0],V=N[1],W=T((0,u.useState)(!1),2),z=W[0],$=W[1],G=(0,u.useMemo)(function(){var e=(0,c.cloneDeep)(r.config);return(0,o.createForm)({initialValues:e,disabled:h.executed})},[r,h]),q=(0,u.useCallback)(function(e){V(e),!e&&G.reset()},[G]);var H=(0,u.useCallback)((t=k(function(e){var t,n,o;return D(this,function(i){switch(i.label){case 0:if(F(o=e||f(null==j?void 0:j.title)),o===r.title)return[2];return[4,null===(t=(n=p.resource("flow_nodes")).update)||void 0===t?void 0:t.call(n,{filterByTk:r.id,values:{title:o}})];case 1:return i.sent(),g(),[2]}})}),function(e){return t.apply(this,arguments)}),[r,j]),Q=(0,u.useCallback)(function(e){if(e.target===e.currentTarget){V(!0);return}for(var t=new Set(["workflow-node-meta","workflow-node-config-button","ant-input-disabled"]),n=e.target;n&&n!==e.currentTarget&&n!==document.documentElement;n=n.parentNode)if(Array.from(n.classList).some(function(e){return t.has(e)})){V(!0),e.stopPropagation();return}},[]);if(!j)return s().createElement("div",{className:(0,d.cx)(O.nodeClass,"workflow-node-type-".concat(r.type))},s().createElement(l.Tooltip,{title:(0,w.KQ)("Node with unknown type will cause error. Please delete it or check plugin which provide this type.")},s().createElement("div",{role:"button","aria-label":"_untyped-".concat(E),className:(0,d.cx)(O.nodeCardClass,"invalid")},s().createElement("div",{className:O.nodeHeaderClass},s().createElement("div",{className:(0,d.cx)(O.nodeMetaClass,"workflow-node-meta")},s().createElement(l.Tag,{color:"error"},(0,w.KQ)("Unknown node")),s().createElement("span",{className:"workflow-node-id"},r.id)),s().createElement("div",{className:"workflow-node-actions"},s().createElement(L,null),s().createElement(U,null))),s().createElement(l.Input.TextArea,{value:E,disabled:!0,autoSize:!0}))));var J=f(j.title);return s().createElement("div",{className:(0,d.cx)(O.nodeClass,"workflow-node-type-".concat(r.type))},s().createElement("div",{role:"button","aria-label":"".concat(J,"-").concat(E),className:(0,d.cx)(O.nodeCardClass,{configuring:_}),onClick:Q},s().createElement("div",{className:O.nodeHeaderClass},s().createElement("div",{className:(0,d.cx)(O.nodeMetaClass,"workflow-node-meta")},s().createElement(l.Tag,null,J),s().createElement("span",{className:"workflow-node-id"},r.id)),s().createElement("div",{className:"workflow-node-actions"},s().createElement(L,null),s().createElement(U,null))),s().createElement(l.Input.TextArea,{disabled:h.executed,value:E,onChange:function(e){return F(e.target.value)},onBlur:function(e){return H(e.target.value)},autoSize:!0}),s().createElement(d.ActionContextProvider,{value:{visible:_,setVisible:q,formValueChanged:z,setFormValueChanged:$}},s().createElement(d.FormProvider,{form:G},s().createElement(d.SchemaComponent,{distributed:!1,scope:I(P({},j.scope),{useFormProviderProps:K,useUpdateAction:B}),components:j.components,schema:{type:"void",properties:I(P({},j.view?{view:j.view}:{}),A({button:{type:"void","x-content":S,"x-component":l.Button,"x-component-props":{type:"link",className:"workflow-node-config-button"}}},r.id,{type:"void",title:s().createElement("div",{className:(0,d.css)(M())},s().createElement("strong",null,r.title),s().createElement(l.Tooltip,{title:(0,w.KQ)("Variable key of node")},s().createElement(l.Tag,null,s().createElement("code",null,r.key)))),"x-decorator":"FormV2","x-use-decorator-props":"useFormProviderProps","x-component":"Action.Drawer",properties:I(P({},j.description?{description:{type:"void","x-component":v.u,"x-component-props":{label:(0,w.KQ)("Node type"),title:j.title,description:j.description}}}:{}),{fieldset:{type:"void","x-component":"fieldset","x-component-props":{className:(0,d.css)(R())},properties:j.fieldset},footer:h.executed?null:{type:"void","x-component":"Action.Drawer.Footer",properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{flexGrow:1}},properties:I(P({},j.testable?{test:{type:"void","x-component":(0,a.observer)(Z),"x-align":"left"}}:{}),{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ useUpdateAction }}"}}})}}}})}))}})))),i)}},8378:function(e,t,n){"use strict";function r(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function o(){var e=r(["\n flex-grow: 1;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n\n .workflow-toolbar {\n display: flex;\n align-items: center;\n justify-content: space-between;\n position: relative;\n padding: 0.5rem 1rem;\n background: ",";\n border-bottom: 1px solid ",";\n\n header {\n display: flex;\n align-items: center;\n gap: 1em;\n }\n\n aside {\n display: flex;\n align-items: center;\n gap: 0.5em;\n }\n\n .workflow-versions {\n label {\n margin-right: 0.5em;\n }\n }\n }\n\n .workflow-canvas-wrapper {\n flex-grow: 1;\n overflow: hidden;\n position: relative;\n }\n\n .workflow-canvas-zoomer {\n display: flex;\n align-items: center;\n position: absolute;\n top: 2em;\n right: 2em;\n height: 10em;\n padding: 1em 0;\n border-radius: 0.5em;\n background: ",";\n }\n\n .workflow-canvas {\n overflow: auto;\n height: 100%;\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 2em;\n\n > .ant-alert {\n margin-bottom: 2em;\n font-size: 85%;\n }\n }\n "]);return o=function(){return e},e}function i(){var e=r(["\n .ant-dropdown-menu-item {\n justify-content: flex-end;\n .ant-dropdown-menu-title-content {\n display: flex;\n align-items: baseline;\n justify-content: flex-end;\n text-align: right;\n\n time {\n width: 14em;\n font-size: 80%;\n }\n }\n }\n "]);return i=function(){return e},e}function a(){var e=r(["\n max-height: 80vh;\n overflow-y: auto;\n\n .ant-dropdown-menu-item {\n .ant-dropdown-menu-title-content {\n strong {\n font-weight: normal;\n }\n }\n\n &.enabled {\n strong {\n font-weight: bold;\n }\n }\n\n &.unexecuted {\n strong {\n font-style: italic;\n opacity: 0.75;\n }\n }\n }\n "]);return a=function(){return e},e}function l(){var e=r(["\n .ant-dropdown-menu-item {\n .id {\n flex-grow: 1;\n text-align: right;\n }\n }\n "]);return l=function(){return e},e}function c(){var e=r(["\n display: flex;\n position: relative;\n margin: 2em auto auto auto;\n\n :before {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n left: calc(50% - 0.5px);\n width: 1px;\n background-color: ",";\n }\n "]);return c=function(){return e},e}function u(){var e=r(["\n display: flex;\n flex-direction: column;\n align-items: center;\n position: relative;\n min-width: 20em;\n padding: 0 2em;\n\n .workflow-node-list {\n flex-grow: 1;\n }\n\n .workflow-branch-lines {\n position: absolute;\n top: 0;\n bottom: 0;\n width: 1px;\n background-color: ",";\n }\n\n :before,\n :after {\n content: '';\n position: absolute;\n height: 1px;\n background-color: ",";\n }\n\n :before {\n top: 0;\n }\n\n :after {\n bottom: 0;\n }\n\n :not(:first-child):not(:last-child) {\n :before,\n :after {\n left: 0;\n width: 100%;\n }\n }\n\n :last-child:not(:first-child) {\n :before,\n :after {\n right: 50%;\n width: 50%;\n }\n }\n\n :first-child:not(:last-child) {\n :before,\n :after {\n left: 50%;\n width: 50%;\n }\n }\n\n .end-sign {\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n width: 0;\n height: 6em;\n border-left: 1px dashed ",";\n\n .anticon {\n font-size: 1.5em;\n line-height: 100%;\n }\n }\n "]);return u=function(){return e},e}function s(){var e=r(["\n flex-grow: 1;\n flex-shrink: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n position: relative;\n "]);return s=function(){return e},e}function f(){var e=r(["\n flex-shrink: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n "]);return f=function(){return e},e}function d(){var e=r(["\n position: relative;\n width: 20em;\n background: ",";\n padding: 1em;\n box-shadow: ",";\n border-radius: ","px;\n cursor: pointer;\n transition: box-shadow 0.3s ease;\n\n &:hover {\n box-shadow: ",";\n\n .workflow-node-remove-button {\n display: block;\n }\n }\n\n &.configuring {\n box-shadow: ",";\n }\n\n .workflow-node-remove-button {\n display: none;\n position: absolute;\n right: 0;\n top: 0;\n color: ",";\n\n &[disabled] {\n display: none;\n }\n\n &:hover {\n color: ",";\n }\n }\n\n .ant-input {\n font-weight: bold;\n\n &:not(:focus) {\n transition:\n background-color 0.3s ease,\n border-color 0.3s ease;\n border-color: ",";\n background-color: ",";\n\n &:not(:disabled):hover {\n border-color: ",";\n }\n\n &:disabled:hover {\n border-color: ",";\n }\n }\n }\n\n .workflow-node-config-button {\n padding: 0;\n }\n\n &:hover {\n box-shadow: 0 0.25em 0.5em rgba(0, 0, 0, 0.25);\n\n .workflow-node-remove-button {\n display: block;\n }\n }\n "]);return d=function(){return e},e}function p(){var e=r(["\n display: flex;\n position: absolute;\n top: 0;\n right: 0;\n justify-content: center;\n align-items: center;\n color: ",";\n "]);return p=function(){return e},e}function m(){var e=r(["\n display: flex;\n margin-bottom: 0.5em;\n\n .workflow-node-actions {\n position: relative;\n }\n "]);return m=function(){return e},e}function y(){var e=r(["\n flex-grow: 1;\n\n .workflow-node-id {\n color: ",";\n\n &:before {\n content: '#';\n }\n }\n "]);return y=function(){return e},e}function b(){var e=r(["\n display: flex;\n align-items: center;\n font-weight: normal;\n .workflow-node-id {\n color: ",";\n }\n "]);return b=function(){return e},e}function v(){var e=r(["\n display: flex;\n flex-direction: column-reverse;\n align-items: center;\n margin: auto;\n "]);return v=function(){return e},e}function h(){var e=r(["\n background-color: #f3f3f3;\n "]);return h=function(){return e},e}function g(){var e=r(["\n flex-shrink: 0;\n padding: 2em 0;\n\n > .ant-btn {\n &:disabled {\n visibility: hidden;\n }\n }\n "]);return g=function(){return e},e}function O(){var e=r(["\n position: relative;\n overflow: visible;\n\n > span {\n position: absolute;\n top: calc(1.5em - 1px);\n line-height: 1em;\n color: ",";\n background-color: ",";\n padding: 1px;\n }\n "]);return O=function(){return e},e}function w(){var e=r(["\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n width: 2em;\n height: 6em;\n "]);return w=function(){return e},e}function x(){var e=r(["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: 4em;\n height: 4em;\n border-radius: 50%;\n background-color: ",";\n color: ",";\n "]);return x=function(){return e},e}var j=(0,n(3772).createStyles)(function(e){var t=e.css,n=e.token;return{workflowPageClass:t(o(),n.colorBgContainer,n.colorBorderSecondary,n.colorBgContainer),dropdownClass:t(i()),workflowVersionDropdownClass:t(a()),executionsDropdownRowClass:t(l()),branchBlockClass:t(c(),n.colorBgLayout),branchClass:t(u(),n.colorBorder,n.colorBorder,n.colorBgLayout),nodeBlockClass:t(s()),nodeClass:t(f()),nodeCardClass:t(d(),n.colorBgContainer,n.boxShadowTertiary,n.borderRadiusLG,n.boxShadow,n.boxShadow,n.colorText,n.colorErrorHover,n.colorBorderBg,n.colorBgContainerDisabled,n.colorPrimaryBorderHover,n.colorBorderBg),nodeJobButtonClass:t(p(),n.colorTextLightSolid),nodeHeaderClass:t(m()),nodeMetaClass:t(y(),n.colorTextDescription),nodeTitleClass:t(b(),n.colorTextDescription),nodeSubtreeClass:t(v()),nodeJobResultClass:t(h()),addButtonClass:t(g()),conditionClass:t(O(),n.colorTextSecondary,n.colorBgLayout),loopLineClass:t(w()),terminalClass:t(x(),n.colorText,n.colorBgContainer)}});t.Z=j},336:function(e,t,n){"use strict";n.d(t,{Gk:function(){return I},cC:function(){return T},xz:function(){return E}});var r=n(8156),o=n.n(r),i=n(2721),a=n(467),l=n(482),c=n(8563),u=n(3505),s=n(3772),f=n(5019),d=n(8018),p=n(1220),m=n(573),y=n(8378);function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function v(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function h(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){v(i,r,o,a,l,"next",e)}function l(e){v(i,r,o,a,l,"throw",e)}a(void 0)})}}function g(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function O(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){O(e,t,n[t])})}return e}function x(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function j(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}function C(){var e,t,n=(e=["\n .ant-select.auto-width {\n width: auto;\n min-width: 6em;\n }\n "],!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return C=function(){return n},n}function k(){var e,t=(0,u.useForm)(),n=(0,s.useAPIClient)(),r=(null!==(e=(0,d.G)())&&void 0!==e?e:{}).workflow,o=(0,s.useActionContext)(),a=(0,s.useResourceActionContext)().refresh;return{run:function(){return h(function(){return S(this,function(e){switch(e.label){case 0:if(r.executed)return i.message.error((0,m.KQ)("Trigger in executed workflow cannot be modified")),[2];return[4,t.submit()];case 1:return e.sent(),[4,n.resource("workflows").update({filterByTk:r.id,values:{config:t.values}})];case 2:return e.sent(),o.setFormValueChanged(!1),o.setVisible(!1),a(),[2]}})})()}}}var E=function(){var e,t,n;function r(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,r),O(this,"sync",void 0),O(this,"title",void 0),O(this,"description",void 0),O(this,"fieldset",void 0),O(this,"triggerFieldset",void 0),O(this,"view",void 0),O(this,"scope",void 0),O(this,"components",void 0),O(this,"initializers",void 0),O(this,"isActionTriggerable",void 0)}return e=r,t=[{key:"validate",value:function(e){return!0}}],g(e.prototype,t),r}();function A(){var e=(0,s.useCompile)(),t=(0,d.G)(),n=t.workflow,r=t.execution,a=(0,y.Z)().styles,c=T();return r?o().createElement(s.SchemaComponent,{components:{Tooltip:i.Tooltip},schema:{type:"void",name:"execution","x-decorator":"Tooltip","x-decorator-props":{title:(0,m.KQ)("View result")},"x-component":"Action","x-component-props":{title:o().createElement(l.InfoOutlined,null),shape:"circle",size:"small",className:a.nodeJobButtonClass,type:"primary"},properties:O({},r.id,{type:"void","x-decorator":"Form","x-decorator-props":{initialValue:r},"x-component":"Action.Modal",title:o().createElement("div",{className:(0,s.cx)(a.nodeTitleClass)},o().createElement(i.Tag,null,e(c.title)),o().createElement("strong",null,n.title),o().createElement("span",{className:"workflow-node-id"},"#",r.id)),properties:{createdAt:{type:"string",title:'{{t("Triggered at", { ns: "'.concat(m.A7,'" })}}'),"x-decorator":"FormItem","x-component":"DatePicker","x-component-props":{showTime:!0},"x-read-pretty":!0},context:{type:"object",title:'{{t("Trigger variables", { ns: "'.concat(m.A7,'" })}}'),"x-decorator":"FormItem","x-component":"Input.JSON","x-component-props":{className:a.nodeJobResultClass,autoSize:{minRows:4,maxRows:32}},"x-disabled":!0}}})}}):null}function P(){return{form:(0,u.useForm)()}}var I=function(){var e,t=(0,s.useAPIClient)(),n=(0,d.G)(),u=n.workflow,f=n.refresh,b=j((0,r.useState)(""),2),v=b[0],g=b[1],O=j((0,r.useState)(!1),2),E=O[0],I=O[1],F=j((0,r.useState)(!1),2),D=F[0],N=F[1],M=(0,y.Z)().styles,R=(0,s.useCompile)(),_=T();(0,r.useEffect)(function(){if(u){var e,t;g(null!==(t=null!==(e=u.triggerTitle)&&void 0!==e?e:u.title)&&void 0!==t?t:R(null==_?void 0:_.title))}},[u,_]);var B=(0,r.useMemo)(function(){var e=(0,a.cloneDeep)(u.config);return(0,c.createForm)({initialValues:e,disabled:u.executed})},[u]),V=(0,r.useCallback)(function(e){I(e),!e&&B.reset()},[B]);var W=(0,r.useCallback)((e=h(function(e){var n;return S(this,function(r){switch(r.label){case 0:if(g(n=e||R(null==_?void 0:_.title)),n===u.triggerTitle)return[2];return[4,t.resource("workflows").update({filterByTk:u.id,values:{triggerTitle:n}})];case 1:return r.sent(),f(),[2]}})}),function(t){return e.apply(this,arguments)}),[u,_]),z=(0,r.useCallback)(function(e){if(e.target===e.currentTarget){I(!0);return}for(var t,n=new Set(["workflow-node-meta","workflow-node-config-button","ant-input-disabled"]),r=e.target;r&&r!==e.currentTarget;r=r.parentNode)if(Array.from(null!==(t=r.classList)&&void 0!==t?t:[]).some(function(e){return n.has(e)})){I(!0),e.stopPropagation();return}},[]),$=u.executed?'{{t("View")}}':'{{t("Configure")}}',G=(0,m.KQ)("Trigger");if(!_)return o().createElement(i.Tooltip,{title:(0,m.KQ)("Workflow with unknown type will cause error. Please delete it or check plugin which provide this type.")},o().createElement("div",{role:"button","aria-label":"".concat(G,"-").concat(v),className:(0,s.cx)(M.nodeCardClass,"invalid"),onClick:z},o().createElement("div",{className:M.nodeHeaderClass},o().createElement("div",{className:(0,s.cx)(M.nodeMetaClass,"workflow-node-meta")},o().createElement(i.Tag,{color:"error"},(0,m.KQ)("Unknown trigger")))),o().createElement("div",{className:"workflow-node-title"},o().createElement(i.Input.TextArea,{value:v,disabled:!0,autoSize:!0}))));var q=_.fieldset,L=_.scope,U=_.components;return o().createElement("div",{role:"button","aria-label":"".concat(G,"-").concat(v),className:(0,s.cx)(M.nodeCardClass),onClick:z},o().createElement("div",{className:M.nodeHeaderClass},o().createElement("div",{className:(0,s.cx)(M.nodeMetaClass,"workflow-node-meta")},o().createElement(i.Tag,{color:"gold"},o().createElement(l.ThunderboltOutlined,null),o().createElement("span",{className:"type"},R(_.title)))),o().createElement("div",{className:"workflow-node-actions"},o().createElement(A,null))),o().createElement("div",{className:"workflow-node-title"},o().createElement(i.Input.TextArea,{value:v,onChange:function(e){return g(e.target.value)},onBlur:function(e){return W(e.target.value)},autoSize:!0,disabled:u.executed})),o().createElement(s.ActionContextProvider,{value:{visible:E,setVisible:V,formValueChanged:D,setFormValueChanged:N}},o().createElement(s.FormProvider,{form:B},o().createElement(s.SchemaComponent,{scope:x(w({},L),{useFormProviderProps:P}),components:U,schema:{name:"workflow-trigger-".concat(u.id),type:"void",properties:{config:{type:"void","x-content":$,"x-component":i.Button,"x-component-props":{type:"link",className:"workflow-node-config-button"}},drawer:{type:"void",title:G,"x-component":"Action.Drawer","x-decorator":"FormV2","x-use-decorator-props":"useFormProviderProps",properties:x(w({},_.description?{description:{type:"void","x-component":p.u,"x-component-props":{label:(0,m.KQ)("Trigger type"),title:_.title,description:_.description}}}:{}),{fieldset:{type:"void","x-component":"fieldset","x-component-props":{className:(0,s.css)(C())},properties:q},actions:w({},u.executed?{}:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:k}}}})})}}}}))))};function T(){var e=(0,s.usePlugin)(f.default),t=(0,d.G)().workflow;return e.triggers.get(t.type)}},6805:function(e,t,n){"use strict";n.d(t,{DU:function(){return g},G$:function(){return T},Ox:function(){return v},PL:function(){return w},RU:function(){return M},UE:function(){return O},VW:function(){return x},_5:function(){return I},gz:function(){return N},h9:function(){return h},kw:function(){return F},r$:function(){return D},rX:function(){return E}});var r=n(8156),o=n.n(r),i=n(467),a=n(3772),l=n(8018),c=n(573),u=n(3461),s=n(5019);function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){d(e,t,n[t])})}return e}function m(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function y(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){if(n=i[r],!(t.indexOf(n)>=0))Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}function b(e,t){if(e){if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}}var v={label:"label",value:"value",children:"children"},h={label:'{{t("Node result", { ns: "'.concat(c.A7,'" })}}'),value:"$jobsMapByNodeKey",useOptions:function(e){var t=(0,a.usePlugin)(s.default).instructions,n=(0,u.h6)(),r=(0,u.Lu)(n),o=[];return r.forEach(function(n){var r,i=t.get(n.type),a=null===(r=i.useVariables)||void 0===r?void 0:r.call(i,n,e);a&&o.push(a)}),o}},g={label:'{{t("Trigger variables", { ns: "'.concat(c.A7,'" })}}'),value:"$context",useOptions:function(e){var t,n,r=(0,a.usePlugin)(s.default).triggers,o=(0,l.G)().workflow,i=r.get(o.type);return null!==(n=null==i?void 0:null===(t=i.useVariables)||void 0===t?void 0:t.call(i,o.config,e))&&void 0!==n?n:null}},O={label:'{{t("Scope variables", { ns: "'.concat(c.A7,'" })}}'),value:"$scopes",useOptions:function(e){var t=e.fieldNames,n=void 0===t?v:t,r=e.current,o=(0,a.usePlugin)(s.default).instructions,i=(0,u.h6)(),l=(0,u.Kd)(null!=r?r:i),c=[];return l.forEach(function(t){var r,i,a,l=o.get(t.type),u=null===(r=l.useScopeVariables)||void 0===r?void 0:r.call(l,t,e);u&&c.push((d(a={key:t.key},n.value,t.key),d(a,n.label,null!==(i=t.title)&&void 0!==i?i:"#".concat(t.id)),d(a,n.children,u),a))}),c}},w={label:'{{t("System variables", { ns: "'.concat(c.A7,'" })}}'),value:"$system",useOptions:function(e){var t=(0,a.usePlugin)(s.default).systemVariables;return(0,a.useCompile)()(Array.from(t.getValues()))}},x={boolean:new Set(["checkbox"]),number:new Set(["integer","number","percent"]),string:new Set(["input","password","email","phone","select","radioGroup","text","markdown","richText","expression","time"]),date:new Set(["date","createdAt","updatedAt"])};function j(e,t){var n,r,o,i,a,l,c;if("string"==typeof t)return null===(n=x[t])||void 0===n?void 0:n.has(e.interface);if((void 0===t?"undefined":(c=t)&&"undefined"!=typeof Symbol&&c.constructor===Symbol?"symbol":typeof c)=="object"&&"reference"===t.type)return S(e)?(null===(r=t.options)||void 0===r?void 0:r.entity)&&(e.collectionName===(null===(o=t.options)||void 0===o?void 0:o.collection)||(null===(i=t.options)||void 0===i?void 0:i.collection)==="*"):!!e.isForeignKey&&(e.collectionName===(null===(a=t.options)||void 0===a?void 0:a.collection)&&"id"===e.name||e.target===(null===(l=t.options)||void 0===l?void 0:l.collection));return"function"==typeof t&&t(e)}function S(e){return["belongsTo","hasOne","hasMany","belongsToMany","belongsToArray"].includes(e.type)}function C(e,t){if(null==t)return null;var n="".concat(e.name,".");return t.filter(function(e){return e.startsWith(n)}).map(function(e){return e.replace(n,"")})}function k(e,t){var n,r,o,i=(0,a.useCompile)(),l=null===(r=e.useOptions)||void 0===r?void 0:null===(n=r.call(e,t))||void 0===n?void 0:n.filter(Boolean),c=t.fieldNames;return d(o={},c.label,i(e.label)),d(o,c.value,e.value),d(o,"key",e[c.value]),d(o,c.children,l),d(o,"disabled",!l||!l.length),o}function E(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=Object.assign({},v,null!==(e=t.fieldNames)&&void 0!==e?e:{}),r=Object.assign(t,{fieldNames:n});return[k(O,r),k(h,r),k(g,r),k(w,r)]}function A(e,t){var n,r,o,l=t.compile,c=t.getCollectionFields;var u=(n=(0,a.parseCollectionName)(e),r=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(n,2)||b(n,r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=u[0],d=c(u[1],s),y=[],v=[];d.forEach(function(e){if(e.isForeignKey&&!e.primaryKey)y.push(e);else{var t=d.find(function(t){return t.name===e.foreignKey});t&&y.push(t),v.push(e)}});for(var h=(0,i.uniqBy)(y,"name"),g=v.length-1;g>=0;g--)!function(e){var t=v[e];if("belongsTo"===t.type){var n,r,o=h.findIndex(function(e){return e.name===t.foreignKey});if(o>-1){var i,a,c=h[o];v.splice(e,0,m(p({},t,c),{uiSchema:m(p({},t.uiSchema),{title:(null===(i=c.uiSchema)||void 0===i?void 0:i.title)?l(null===(a=c.uiSchema)||void 0===a?void 0:a.title):c.name})})),h.splice(o,1)}else v.splice(e,0,m(p({},t),{name:t.foreignKey,type:"bigInt",isForeignKey:!0,interface:t.interface,uiSchema:m(p({},t.uiSchema),{title:(null===(n=t.uiSchema)||void 0===n?void 0:n.title)?"".concat(l(null===(r=t.uiSchema)||void 0===r?void 0:r.title)," ID"):t.name})}))}else"context"===t.type&&"users"===t.collectionName&&v.splice(e,1)}(g);return v.push.apply(v,function(e){if(Array.isArray(e))return f(e)}(o=h)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(o)||b(o)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),(0,i.uniqBy)(v,"name").filter(function(e){return e.interface&&!e.hidden})}function P(e){var t=C(e.field,e.appends),n=I(p({collection:"".concat(e.field.dataSourceKey&&"main"!==e.field.dataSourceKey?"".concat(e.field.dataSourceKey,":"):"").concat(e.field.target),types:e.types,appends:t,depth:e.depth-1},this));e.loadChildren=null,n.length?e.children=n:(e.isLeaf=!0,!(!e.types||e.types.some(function(t){return j(e.field,t)}))&&(e.disabled=!0))}function I(e){var t=e.fields,n=e.collection,r=e.types,o=e.appends,i=void 0===o?[]:o,a=e.depth,l=void 0===a?1:a,c=e.compile,u=e.getCollectionFields,s=e.fieldNames,f=void 0===s?v:s,p=null!=t?t:A(n,{compile:c,getCollectionFields:u}),m=P.bind({compile:c,getCollectionFields:u,fieldNames:f});return(function e(t){var n=t.fields,r=t.types,o=t.appends,i=t.depth,a=void 0===i?1:i,l=t.compile,c=t.getCollectionFields;return n.filter(function(t){var n=null==r||!r.length||r.some(function(e){return j(t,e)});if(!S(t))return n;if(null===o)return!!a&&(n||e({fields:A(t.target,{compile:l,getCollectionFields:c}),types:r,depth:a-1,appends:o,compile:l,getCollectionFields:c}));var i=C(t,o),u=o.includes(t.name);return n?u:((null==i?void 0:i.length)||u)&&e({fields:A(t.target,{compile:l,getCollectionFields:c}),types:r,appends:i,compile:l,getCollectionFields:c}).length})})({fields:p,types:r,depth:l,appends:i,compile:c,getCollectionFields:u}).map(function(e){var t,n,o=c((null===(t=e.uiSchema)||void 0===t?void 0:t.title)||e.name),a=C(e,i),u=!S(e)||a&&!a.length&&!i.includes(e.name)||!1;return d(n={},f.label,o),d(n,"key",e.name),d(n,f.value,e.name),d(n,"isLeaf",u),d(n,"loadChildren",u?null:m),d(n,"field",e),d(n,"depth",l),d(n,"appends",i),d(n,"types",r),n})}function T(e){var t=(0,a.useApp)().dataSourceManager.getDataSource(e).collectionManager;return(0,r.useCallback)(function(e){return t.getCollectionAllFields(e)},[t])}function F(e){var t=e.variableOptions,n=y(e,["variableOptions"]),r=E(t);return o().createElement(a.Variable.Input,p({scope:r},n))}function D(e){var t=e.variableOptions,n=y(e,["variableOptions"]),r=E(t);return o().createElement(a.Variable.TextArea,p({scope:r},n))}function N(e){var t=e.variableOptions,n=y(e,["variableOptions"]),r=E(t);return o().createElement(a.Variable.RawTextArea,p({scope:r},n))}function M(e){var t=e.variableOptions,n=y(e,["variableOptions"]),r=E(t);return o().createElement(a.Variable.JSON,p({scope:r},n))}},7380:function(e,t,n){"use strict";n.d(t,{nF:function(){return j.n},$W:function(){return x.$},nw:function(){return d},xH:function(){return p.x},pg:function(){return S.p},VT:function(){return m.V},Gs:function(){return j.G},JF:function(){return g},PW:function(){return r.P},W5:function(){return y.W},D4:function(){return w.D},PO:function(){return C.P},XB:function(){return O.X}});var r=n("8500"),o=n("8156"),i=n.n(o),a=n("8563"),l=n("3505"),c=n("467"),u=n("3772"),s=n("8018");function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e){var t,n,r,d,p,m,y,b,v=e.collection,h=e.dataPath,g=e.children,O=(0,l.useField)(),w=(0,o.useRef)(null),x=(0,(0,u.useAssociationNames)().getAssociationAppends)(),j=x.appends,S=x.updateAssociationValues;var C=(t=h,r=(n=(0,s.G)()).execution,d=n.nodes,p=(0,o.useMemo)(function(){return d.reduce(function(e,t){return Object.assign(e,f({},t.id,t.key))},{})},[d]),m=(0,o.useMemo)(function(){var e;return{$context:null==r?void 0:r.context,$jobsMapByNodeKey:(null!==(e=null==r?void 0:r.jobs)&&void 0!==e?e:[]).reduce(function(e,t){return Object.assign(e,f({},p[t.nodeId],t.result))},{})}},[null==r?void 0:r.context,null==r?void 0:r.jobs,p]),(0,o.useMemo)(function(){return(0,c.get)(m,t)},[m,t]));if("string"==typeof v){var k=(0,u.parseCollectionName)(v);y=k[0],b=k[1]}else b=v;var E=(0,o.useMemo)(function(){return(0,a.createForm)({values:C,readPretty:!0})},[C]),A={loading:!1,data:{data:C}},P=(0,u.useAPIClient)().resource(b),I=(0,u.useBlockRequestContext)();return i().createElement(u.CollectionProvider_deprecated,{dataSource:y,collection:b},i().createElement(u.RecordProvider,{record:C,parent:null},i().createElement(u.BlockRequestContext_deprecated.Provider,{value:{block:"form",field:O,service:A,resource:P,__parent:I}},i().createElement(u.FormBlockContext.Provider,{value:{params:{appends:j},form:E,field:O,service:A,updateAssociationValues:S,formBlockRef:w}},g))))}var p=n("4514"),m=n("4339"),y=n("799"),b=n("482"),v=n("2721");function h(){var e,t,n=(e=["\n & + .anticon {\n margin-left: 0.25em;\n }\n "],!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return h=function(){return n},n}function g(e){var t=e.options,n=e.direction,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){if(n=i[r],!(t.indexOf(n)>=0))Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}}return o}(e,["options","direction"]),o=(0,u.useCompile)();return i().createElement(v.Checkbox.Group,r,i().createElement(v.Space,{direction:n},(void 0===t?[]:t).map(function(e){return i().createElement(v.Checkbox,{key:e.value,value:e.value},i().createElement("span",{className:(0,u.css)(h())},o(e.label)),e.tooltip&&i().createElement(v.Tooltip,{title:o(e.tooltip)},i().createElement(b.QuestionCircleOutlined,{style:{color:"#666"}})))})))}var O=n("8060"),w=n("5676"),x=n("3048"),j=n("3430"),S=n("1188"),C=n("6922")},6279:function(e,t,n){"use strict";n.d(t,{C:function(){return o}});var r=n(8156),o=function(e,t){return{getAriaLabel:(0,r.useCallback)(function(n){return["add-button",null==e?void 0:e.type,null==e?void 0:e.title,null!=t?String(t):"",n].filter(Boolean).join("-")},[t,null==e?void 0:e.title,null==e?void 0:e.type])}}},573:function(e,t,n){"use strict";n.d(t,{A7:function(){return i},KQ:function(){return a},cC:function(){return l}});var r=n(3772),o=n(3238),i="workflow";function a(e){var t,n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r.i18n.t(e,(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}({},o),n=(n={ns:i},n),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))}function l(){return(0,o.useTranslation)(i)}},7893:function(e,t,n){"use strict";function r(e){var t=new Map;e.forEach(function(e){return t.set(e.id,e)});var n=!0,r=!1,o=void 0;try{for(var i,a=t.values()[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var l=i.value;l.upstreamId&&(l.upstream=t.get(l.upstreamId)),l.downstreamId&&(l.downstream=t.get(l.downstreamId))}}catch(e){r=!0,o=e}finally{try{!n&&null!=a.return&&a.return()}finally{if(r)throw o}}}n.d(t,{SI:function(){return o},Yc:function(){return r},dF:function(){return function e(t,n){n(t),t.properties&&Object.keys(t.properties).forEach(function(r){e(t.properties[r],n)})}},s_:function(){return i}});function o(e){return"/admin/workflow/workflows/".concat(e)}function i(e){return"/admin/workflow/executions/".concat(e)}},3581:function(e){e.exports=function(e,t){return"undefined"!=typeof __deoptimization_sideEffect__&&__deoptimization_sideEffect__(e,t),t}},1801:function(e,t,n){"use strict";var r=n(8156),o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,l=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function u(e,t,n){var r,i={},u=null,s=null;for(r in void 0!==n&&(u=""+n),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(s=t.ref),t)a.call(t,r)&&!c.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:o,type:e,key:u,ref:s,props:i,_owner:l.current}}t.Fragment=i,t.jsx=u,t.jsxs=u},3704:function(e,t,n){"use strict";e.exports=n(1801)},482:function(e){"use strict";e.exports=c},4632:function(e){"use strict";e.exports=u},8563:function(e){"use strict";e.exports=d},3505:function(e){"use strict";e.exports=t},5229:function(e){"use strict";e.exports=m},8875:function(e){"use strict";e.exports=s},3772:function(t){"use strict";t.exports=e},47:function(e){"use strict";e.exports=o},7584:function(e){"use strict";e.exports=f},2721:function(e){"use strict";e.exports=i},5760:function(e){"use strict";e.exports=a},467:function(e){"use strict";e.exports=p},8156:function(e){"use strict";e.exports=n},3238:function(e){"use strict";e.exports=r},6128:function(e){"use strict";e.exports=l},9527:function(e){!function(){"use strict";var t={}.hasOwnProperty;function n(){for(var e="",o=0;o<arguments.length;o++){var i=arguments[o];i&&(e=r(e,function(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return n.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var o="";for(var i in e)t.call(e,i)&&e[i]&&(o=r(o,i));return o}(i)))}return e}function r(e,t){return t?e?e+" "+t:e+t:e}e.exports?(n.default=n,e.exports=n):"function"==typeof define&&"object"==typeof define.amd&&define.amd?define("classnames",[],function(){return n}):window.classNames=n}()}},w={};function x(e){var t=w[e];if(void 0!==t)return t.exports;var n=w[e]={exports:{}};return O[e](n,n.exports,x),n.exports}return x.m=O,x.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return x.d(t,{a:t}),t},x.d=function(e,t){for(var n in t)x.o(t,n)&&!x.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},x.f={},x.e=function(e){return Promise.all(Object.keys(x.f).reduce(function(t,n){return x.f[n](e,t),t},[]))},x.u=function(e){return""+({383:"739d458621edf81f",923:"e7b9d67c6a964bec",929:"5ed8ff0f70ed5911",999:"92877729dbcede8f"})[e]+".js"},x.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},y={},b="@nocobase/plugin-workflow:",x.l=function(e,t,n,r){if(y[e]){y[e].push(t);return}if(void 0!==n){for(var o,i,a=document.getElementsByTagName("script"),l=0;l<a.length;l++){var c=a[l];if(c.getAttribute("src")==e||c.getAttribute("data-webpack")==b+n){o=c;break}}}!o&&(i=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,x.nc&&o.setAttribute("nonce",x.nc),o.setAttribute("data-webpack",b+n),o.src=e),y[e]=[t];var u=function(t,n){o.onerror=o.onload=null,clearTimeout(s);var r=y[e];if(delete y[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},s=setTimeout(u.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=u.bind(null,o.onerror),o.onload=u.bind(null,o.onload),i&&document.head.appendChild(o)},x.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},x.p="/static/plugins/@nocobase/plugin-workflow/dist/client/",v={909:0},x.f.j=function(e,t){var n=x.o(v,e)?v[e]:void 0;if(0!==n){if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=v[e]=[t,r]});t.push(n[2]=r);var o=x.p+x.u(e),i=Error();x.l(o,function(t){if(x.o(v,e)&&(0!==(n=v[e])&&(v[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}}},h=function(e,t){var n=t[0],r=t[1],o=t[2],i,a,l=0;if(n.some(function(e){return 0!==v[e]})){for(i in r)x.o(r,i)&&(x.m[i]=r[i]);o&&o(x)}for(e&&e(t);l<n.length;l++)a=n[l],x.o(v,a)&&v[a]&&v[a][0](),v[a]=0},(g=self.webpackChunk_nocobase_plugin_workflow=self.webpackChunk_nocobase_plugin_workflow||[]).forEach(h.bind(null,0)),g.push=h.bind(null,g.push.bind(g)),x("5019")}()});
|