PageSourceSearch

https://login.commonsku.com/dist/react/WorkflowAutomationsApp.0065746e.chunk.js

js commonsku.com collected 2026-10-02 03:14:52 UTC 24,137 bytes, 3 lines download raw bytes

1/*! For license information please see WorkflowAutomationsApp.0065746e.chunk.js.LICENSE.txt */
2"use strict";(globalThis.__LOADABLE_LOADED_CHUNKS__=globalThis.__LOADABLE_LOADED_CHUNKS__||[]).push([[7277],{30353(e,t,n){n.r(t),n.d(t,{default:()=>Te});var o=n(41594),a=n.n(o),r=n(3602),l=n(95132),i=n(3915),d=(n(97494),n(2596)),s=n(73021),c=n(51904),u=n(28420),m=n(98483),g=n(26926),p=n(34586),f=n(20652),w=n(47203),E=n(42732),v=n(22078),k=n(75158),y=n(64128),h=n(23204),b=n(75174);const _=e=>({value:"id"in e?e.id:e.key,label:e.label}),A=e=>{switch(e.operator){case"in":case"is":return Object.assign(Object.assign({},e),{options:e.options.map(_)});case"does not change":return e}},C=e=>{if("message reminder"===e.type)return Object.assign(Object.assign({},e),{assignee_options:e.assignee_options.map(_)})};var O=function(e,t,n,o){return new(n||(n=Promise))(function(a,r){function l(e){try{d(o.next(e))}catch(e){r(e)}}function i(e){try{d(o.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(l,i)}d((o=o.apply(e,t||[])).next())})};const x=function(e,t){for(var n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];return O(void 0,[e,t,...o],void 0,function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){const{json:o}=yield(0,v.oD)(e,t,n);return o}()})},z=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var n;return Object.assign({workflow_id:e.workflow_id,name:e.name,description:e.description,model_type:e.model_type,active:e.active,trigger:null!==(n=e.trigger)&&void 0!==n?n:null,conditions:e.conditions,tasks:e.tasks},t)},S=(e,t)=>{var n,o,a;const r=null===(n=null==e?void 0:e.json)||void 0===n?void 0:n.errors;return Array.isArray(r)&&r.length>0?(null===(o=r[0])||void 0===o?void 0:o.message)||String(r[0]):"string"==typeof(null===(a=null==e?void 0:e.json)||void 0===a?void 0:a.message)?e.json.message:t},j=(e,t)=>{const n=e.automations.findIndex(e=>e.workflow_id===t.workflow_id);-1!==n&&(e.automations[n]=Object.assign(Object.assign({},e.automations[n]),{name:t.name,model_type:t.model_type,active:t.active,last_triggered_at:t.last_triggered_at,updated_by:t.updated_by,n8n_provisioned:t.n8n_provisioned}))},T=(0,h.zD)("workflowAutomations/fetchAutomations",()=>O(void 0,void 0,void 0,function*(){const{workflows:e}=yield x("GET","workflow");return e})),I=(0,h.zD)("workflowAutomations/fetchAutomation",e=>O(void 0,void 0,void 0,function*(){const{workflow:t}=yield x("GET",`workflow/${e}`);return t})),L=(0,h.zD)("workflowAutomations/createAutomation",(e,t)=>O(void 0,[e,t],void 0,function(e,t){let{rejectWithValue:n}=t;return function*(){try{const{workflow:t}=yield x("POST","workflow",{workflow:e});return t}catch(e){return n(S(e,"Failed to create workflow automation"))}}()})),W=(0,h.zD)("workflowAutomations/saveAutomation",(e,t)=>O(void 0,[e,t],void 0,function(e,t){let{workflowId:n,workflow:o}=e,{rejectWithValue:a}=t;return function*(){try{const{workflow:e}=yield x("PUT",`workflow/${n}`,{workflow:o});return e}catch(e){return a(S(e,"Failed to save workflow automation"))}}()})),D=(0,h.zD)("workflowAutomations/fetchConfigurationOptions",e=>O(void 0,void 0,void 0,function*(){return{model_options:(t=yield x("GET","workflow/configuration-options",e?{model_type:e}:{})).model_options,condition_options:t.condition_options.map(A),trigger_options:t.trigger_options.map(A),task_options:t.task_options.map(C)};var t})),Y=(0,h.zD)("workflowAutomations/toggleAutomationActive",(e,t)=>O(void 0,[e,t],void 0,function(e,t){let{workflowId:n,active:o}=e,{rejectWithValue:a}=t;return function*(){try{const{workflow:e}=yield x("GET",`workflow/${n}`),t=z(e,{active:o}),{workflow:a}=yield x("PUT",`workflow/${n}`,{workflow:t});return a}catch(e){return a(S(e,"Failed to update workflow automation status"))}}()})),N=(0,h.zD)("workflowAutomations/createPredefinedAutomations",(e,t)=>O(void 0,[e,t],void 0,function(e,t){let{rejectWithValue:n}=t;return function*(){try{return yield x("POST","workflow/predefined")}catch(e){return n(S(e,"Failed to create predefined workflow automations"))}}()})),R=(0,h.zD)("workflowAutomations/initializeAutomationsList",(e,t)=>O(void 0,[e,t],void 0,function(e,t){let{dispatch:n}=t;return function*(){if(!((yield n(T()).unwrap()).length>0)){try{yield n(N()).unwrap()}catch(e){return}yield n(T()).unwrap()}}()}
2),{condition:(e,t)=>{let{getState:n}=t;return"pending"!==n().workflowAutomations.listLoading}}),F=(0,h.Z0)({name:"workflowAutomations",initialState:{automations:[],currentAutomation:null,draftAutomation:null,configurationOptions:null,listLoading:"idle",detailLoading:"idle",saveLoading:"idle",configurationOptionsLoading:"idle",togglingWorkflowId:null,error:null},reducers:{clearError:e=>{e.error=null},clearCurrentAutomation:e=>{e.currentAutomation=null,e.draftAutomation=null},setDraftAutomation:(e,t)=>{e.draftAutomation=t.payload},discardDraftAutomation:e=>{e.draftAutomation=e.currentAutomation}},extraReducers:e=>{e.addCase(T.pending,e=>{e.listLoading="pending",e.error=null}).addCase(T.fulfilled,(e,t)=>{e.listLoading="idle",e.automations=t.payload}).addCase(T.rejected,(e,t)=>{var n;e.listLoading="idle",e.error=(null===(n=t.error)||void 0===n?void 0:n.message)||"Failed to load workflow automations",i.oR.error(e.error)}).addCase(I.pending,e=>{e.detailLoading="pending",e.error=null}).addCase(I.fulfilled,(e,t)=>{e.detailLoading="idle",e.currentAutomation=t.payload,e.draftAutomation=t.payload}).addCase(I.rejected,(e,t)=>{var n;e.detailLoading="idle",e.error=(null===(n=t.error)||void 0===n?void 0:n.message)||"Failed to load workflow automation",i.oR.error(e.error)}).addCase(L.pending,e=>{e.saveLoading="pending",e.error=null}).addCase(L.fulfilled,(e,t)=>{e.saveLoading="idle",e.currentAutomation=t.payload,e.draftAutomation=t.payload,e.automations.push({workflow_id:t.payload.workflow_id,name:t.payload.name,model_type:t.payload.model_type,active:t.payload.active,days:0,last_triggered_at:t.payload.last_triggered_at,updated_by:t.payload.updated_by,n8n_provisioned:t.payload.n8n_provisioned})}).addCase(L.rejected,(e,t)=>{var n;e.saveLoading="idle",e.error=t.payload||(null===(n=t.error)||void 0===n?void 0:n.message)||"Failed to create workflow automation",i.oR.error(e.error)}).addCase(W.pending,e=>{e.saveLoading="pending",e.error=null}).addCase(W.fulfilled,(e,t)=>{e.saveLoading="idle",e.currentAutomation=t.payload,e.draftAutomation=t.payload,j(e,t.payload),i.oR.success("Workflow configuration saved")}).addCase(W.rejected,(e,t)=>{var n;e.saveLoading="idle",e.error=t.payload||(null===(n=t.error)||void 0===n?void 0:n.message)||"Failed to save workflow automation",i.oR.error(e.error)}).addCase(D.pending,e=>{e.configurationOptionsLoading="pending",e.error=null}).addCase(D.fulfilled,(e,t)=>{e.configurationOptionsLoading="idle",e.configurationOptions=t.payload}).addCase(D.rejected,(e,t)=>{var n;e.configurationOptionsLoading="idle",e.error=(null===(n=t.error)||void 0===n?void 0:n.message)||"Failed to load workflow configuration options",i.oR.error(e.error)}).addCase(Y.pending,(e,t)=>{e.togglingWorkflowId=t.meta.arg.workflowId,e.error=null}).addCase(Y.fulfilled,(e,t)=>{e.togglingWorkflowId=null,j(e,t.payload)}).addCase(Y.rejected,(e,t)=>{var n;e.togglingWorkflowId=null,e.error=t.payload||(null===(n=t.error)||void 0===n?void 0:n.message)||"Failed to update workflow automation status",i.oR.error(e.error)}).addCase(N.pending,e=>{e.listLoading="pending",e.error=null}).addCase(N.fulfilled,e=>{e.listLoading="idle"}).addCase(N.rejected,(e,t)=>{var n;e.listLoading="idle",e.error=t.payload||(null===(n=t.error)||void 0===n?void 0:n.message)||"Failed to create predefined workflow automations",i.oR.error(e.error)})}}),{clearError:H,clearCurrentAutomation:B,setDraftAutomation:M,discardDraftAutomation:P}=F.actions,$=e=>e.workflowAutomations.automations,Z=((0,b.Mz)([$,(e,t)=>t],(e,t)=>{var n;return null!==(n=e.find(e=>e.workflow_id===t))&&void 0!==n?n:null}),e=>e.workflowAutomations.draftAutomation),V=(0,b.Mz)([e=>e.workflowAutomations.currentAutomation,Z],(e,t)=>null!==e&&null!==t&&JSON.stringify(e)!==JSON.stringify(t)),U=e=>e.workflowAutomations.error,q=F,K=()=>a().createElement(l.ZT,{status:"info"},a().createElement(l.Mp,null),a().createElement(l.kN,{gap:"0"},a().createElement(l.BX,{fontWeight:"semibold"},"This is an early version of Automations"),a().createElement(l.n4,null,"You can enable or disable the automation and adjust which phases and days trigger it. More automation types and configuration options are coming soon.")));var J=n(5033);const G=e=>{let{status:t}=e;return a().createElement(l.Ex,{size:"xs",variant:"subtle",colorPalette:"Active"===t?"success":"neutral"},"      ",t)};var X=n(9599);const Q=e=>{let{isChecked:t,disabled:n=!0,label:o,onCheckedChange:r}=e;return a().createElement(l.dO.Root,{checked:t,disabled:n,size:"lg",onCheckedChange:e=>r(e.checked)},a().createElement(l.dO.HiddenInput,{"aria-label":null!=o?o:"Enable automation"}),a().createElement(l.dO.Control,{padding:"0.5"},a().createElement(l.dO.Thumb,{boxSize:"5",scale:"1"},t&&a().createElement(X.sk9,{size:16}))),o&&a().createElement(l.dO.Label,null,o))},ee=e=>{let{workflowId:t,disabled:n=!0}=e;const o=(0,w.Zp)();return a().createElement(l.K0,{label:"Edit automation",size:"md",variant:"ghost",onClick:()=>{o(`/automations/${t}`)},disabled:n},a().createElement(X.H6t,{size:20}))},te=e=>{let{workflow:t,toggling:n,onToggleActive:o}=e;const r=(0,k.u7)(Oe,!0),i=!r||n;return a().createElement(l.Zp.Root,{variant:"outline"},a().createElement(l.Zp.Body,{gap:"2.5",padding:"4"},a().createElement(l.zt,{justify:"space-between"},a().createElement(l.Tk,{align:"flex-start"},a().createElement(l.EY,{margin:"0!",fontWeight:"semibold"},t.name),a().createElement(l.zt,{gap:"2.5",alignItems:"center"},a().createElement(G,{status:t.active?"Active":"Inactive"}),t.last_triggered_at&&a().createElement(l.EY,{textStyle:"sm",margin:"0!",color:"neutral.fg"},"Last triggered"," ",a().createElement(J.h,{value:t.last_triggered_at,interval:3e5})),t.last_triggered_at&&t.updated_by&&a().createElement(l.EY,{textStyle:"sm",margin:"0!",color:"neutral.fg"},"·"),t.updated_by&&a().createElement(l.EY,{textStyle:"sm",margin:"0!",color:"neutral.fg"},"Last edited by ",t.updated_by.name))),a().createElement(l.zt,{align:"flex-end",alignItems:"center",gap:"4"},a().createElement(Q,{isChecked:t.active,disabled:i,onCheckedChange:e=>o(t.workflow_id,e)}),a().createElement(ee,{workflowId:t.workflow_id,disabled:!r})))))},ne=e=>{let{workflows:t,loading:n,togglingWorkflowId:o,onToggleActive:i}=e;return n?a().createElement(l.ov,{paddingY:"12"},a().createElement(r.SkubotSpinner,null)):0===t.length?a().createElement(l.ov,{paddingY:"12"},a().createElement(l.EY,{color:"fg.muted",margin:"0!"},"You don't have any automations yet.")):a().createElement(l.Tk,{gap:"4",align:"stretch",width:"full"},t.map(e=>a().createElement(te,{key:e.workflow_id,workflow:e,toggling:o===e.workflow_id,onToggleActive:i})))},oe=()=>{const{workflows:e,loading:t,togglingWorkflowId:n,toggleActive:r}=function(){const e=(0,m.wA)(),t=(0,k.u7)(Oe,!0),n=(0,m.d4)(e=>$(e)),a=(0,m.d4)(e=>(e=>"pending"===e.workflowAutomations.listLoading)(e)),r=(0,m.d4)(e=>(e=>
2e.workflowAutomations.togglingWorkflowId)(e)),l=(0,m.d4)(e=>U(e));return(0,o.useEffect)(()=>{e(t?R():T())},[t,e]),{workflows:n,loading:a,error:l,togglingWorkflowId:r,toggleActive:(0,o.useCallback)((t,n)=>{e(Y({workflowId:t,active:n}))},[e])}}();return a().createElement(l.BJ,{gap:"6",paddingBottom:"4",paddingRight:"4",align:"stretch"},a().createElement(l.BJ,{gap:"2"},a().createElement(l.DZ,{size:"2xl",margin:"0!"},"Automations"),a().createElement(l.EY,{fontSize:"sm",color:"fg.muted",margin:"0!"},"This is where you can view and manage your automations.")),a().createElement(K,null),a().createElement(ne,{workflows:e,loading:t,togglingWorkflowId:n,onToggleActive:r}))},ae=()=>a().createElement(l.so,{align:"center",height:"20",justify:"center",width:"24"},a().createElement(l.az,{backgroundImage:"linear-gradient(to bottom, var(--chakra-colors-border-muted) 0 2px, transparent 2px 8px, var(--chakra-colors-border-muted) 8px 12px, transparent 12px 18px, var(--chakra-colors-border-muted) 18px 22px, transparent 22px 28px, var(--chakra-colors-border-muted) 28px 32px, transparent 32px 38px, var(--chakra-colors-border-muted) 38px 42px, transparent 42px 46px, var(--chakra-colors-border-muted) 46px 48px)",height:"12",width:"1px"})),re=e=>{let{workflowName:t}=e;return a().createElement(l.Qp,null,a().createElement(l.w1,{href:"/automations",isCurrent:!1},"Automations"),a().createElement(l.tH,null),a().createElement(l.w1,{isCurrent:!0},t))},le=e=>{let{isDirty:t,saving:n,error:o,onSave:r,onCancel:i}=e;return a().createElement(l.zt,{gap:"4"},o&&a().createElement(l.EY,{fontSize:"sm",color:"fg.critical",margin:"0!"},o),a().createElement(l.$n,{borderStyle:"solid",variant:"outline",onClick:i,disabled:n},"Cancel"),a().createElement(l.$n,{onClick:r,disabled:!t||n,loading:n},"Save"))},ie=e=>{let{workflowName:t,isDirty:n,saving:o,error:r,onSave:i,onCancel:d}=e;return a().createElement(l.zt,{justify:"space-between",align:"center",width:"full"},a().createElement(re,{workflowName:t}),a().createElement(le,{isDirty:n,saving:o,error:r,onSave:i,onCancel:d}))};var de=n(45457);const se=(0,de.A)("git-fork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]),ce=e=>{let{icon:t,title:n,stepNumber:o,children:r}=e;return a().createElement(l.az,{background:"bg.panel",borderColor:"border.muted",borderRadius:"md",borderStyle:"solid",borderWidth:"1px",padding:"7",width:"full"},a().createElement(l.so,{direction:"column",gap:"2.5"},a().createElement(l.so,{align:"center",justify:"space-between",width:"full"},a().createElement(l.zt,{align:"center",gap:"1"},t,a().createElement(l.EY,{fontSize:"md",lineHeight:"unset",margin:"0!"},n)),a().createElement(l.EY,{color:"fg.muted",fontSize:"sm",lineHeight:"unset",margin:"0!"},"Step ",o)),a().createElement(l.wv,{borderColor:"border"}),a().createElement(l.az,{paddingX:"3",paddingY:"2"},r)))},ue=e=>{let{options:t,selectedValues:n,onToggle:o}=e;return a().createElement(l.az,{display:"grid",gap:"4",gridTemplateColumns:"repeat(auto-fit, minmax(14rem, 1fr))",width:"full"},t.map(e=>{const t=n.includes(e.value);return a().createElement(l.YW.Root,{checked:t,colorPalette:"neutral",key:e.value,onCheckedChange:()=>o(e.value),size:"sm",variant:"outline"},a().createElement(l.YW.HiddenInput,null),a().createElement(l.YW.Control,null,a().createElement(l.YW.Content,null,a().createElement(l.YW.Label,null,e.label)),a().createElement(l.YW.Indicator,{alignSelf:"center",borderStyle:"solid",borderWidth:"1px",colorPalette:"brand"})))}))},me={"status_id:in":e=>{let{modelType:t,condition:n,option:o,onChange:r}=e;if(!(e=>"status_id"===e.type&&"in"===e.operator)(o))return null;const i=(d=n.value,Array.isArray(d)?d:[]);var d;const s=(0,v.Sn)(t),c="stage"===o.status_term?"stages":"statuses";return a().createElement(l.BJ,{gap:"4"},a().createElement(l.EY,{fontSize:"md",fontWeight:"medium",lineHeight:"unset",margin:"0!"},"and the ",s," is in one of these ",c),a().createElement(ue,{onToggle:e=>{const t=i.includes(e);if(t&&1===i.length)return;const o=t?i.filter(t=>t!==e):[...new Set([...i,e])];r(Object.assign(Object.assign({},n),{value:o}))},options:o.options,selectedValues:i}))}},ge=()=>a().createElement(l.In,{ariaHidden:!0,as:se,boxSize:"6"},null),pe=e=>{let{modelType:t,conditions:n,configurationOptions:o,onChange:r}=e;return a().createElement(ce,{icon:a().createElement(ge,null),stepNumber:2,title:"Conditions"},n.map(e=>{const n=(l=e.type,i=e.operator,me[`${l}:${i}`]);var l,i;const d=o.condition_options.find(n=>n.model_type===t&&n.type===e.type&&n.operator===e.operator);return n&&d?a().createElement(n,{key:e.workflow_condition_id,condition:e,modelType:t,onChange:r,option:d}):null}))},fe=(0,de.A)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),we=/^P(\d+)D$/,Ee={"status_id:does not change":e=>{let{modelType:t,trigger:n,option:o,onChange:r}=e;const i=(e=>{if("string"!=typeof e)return"";const t=we.exec(e);return t?Number(t[1]):""})(n.value),d=""===i?"":String(i),[s,c]=a().useState(d);if(a().useEffect(()=>{c(d)},[d]),!(e=>"status_id"===e.type&&"does not change"===e.operator)(o))return null;const u=(0,v.Sn)(t),m=/^[aeiou]/i.test(u)?"an":"a";return a().createElement(l.so,{align:"center",flexWrap:"wrap",gap:"2"},a().createElement(l.EY,{fontSize:"md",fontWeight:"medium",lineHeight:"unset",margin:"0!"},"When ",m," ",u," has been stalled for"),a().createElement(l.az,{flex:"none",width:"16"},a().createElement(l.pd,{"aria-label":"Number of days stalled",height:"10",margin:"0!",max:o.max_days,min:o.min_days,onBlur:()=>{const e=Number(s);if(""===s||!Number.isInteger(e))return void c(d);const t=Math.min(o.max_days,Math.max(o.min_days,e));t!==e&&(c(String(t)),r(Object.assign(Object.assign({},n),{value:`P${t}D`})))},onChange:e=>{const t=e.target.value;if(c(t),""===t)return;const a=Number(t);!Number.isInteger(a)||a<o.min_days||a>o.max_days||r(Object.assign(Object.assign({},n),{value:`P${a}D`}))},textAlign:"right",type:"number",value:s,width:"full"})),a().createElement(l.EY,{fontSize:"md",fontWeight:"medium",lineHeight:"unset",margin:"0!"},"days"))}},ve=()=>a().createElement(l.In,{ariaHidden:!0,as:fe,boxSize:"6"},null),ke=e=>{let{modelType:t,trigger:n,configurationOptions:o,onChange:r}=e;const l=n?(i=n.type,d=n.operator,Ee[`${i}:${d}`]):void 0;var i,d;const s=n?o.trigger_options.find(e=>e.model_type===t&&e.type===n.type&&e.operator===n.operator):void 0;return a().createElement(ce,{icon:a().createElement(ve,null),stepNumber:1,title:"Triggers"},l&&n&&s&&a().createElement(l,{modelType:t,onChange:r,option:s,trigger:n}))};const ye=(0,de.A)("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),he=e=>{let{value:t,options:n,onChange:o}=e;const r=(0,l.Rk)({items:n});return a().createElement(l.zt,{width:"full",gap:"2"},a().createElement(l.EY,{fontSize:"md",fontWeight:"semibold",margin:"0!"},"Create a task for"),a().createElement(l.l6.Root,{width:"300px",variant:"outline",size:"md",collection:r,value:[t],onValueChange:e=>o(e.value[0])},a().createElement(l.l6.HiddenSelect,null),a().createElement(l.l6.Control,null,a().createElement(l.l6.Trigger,null,a().createElement(l.l6.ValueText,null)),a().createElement(l.l6.IndicatorGroup,null,a().createElement(l.l6.Indicator,null))),a().createElement(l.ZL,null,a().createElement(l.l6.Positioner,null,a().createElement(l.l6.Content,null,r.items.map(e=>a().createElement(l.l6.Item,{item:e,key:e.value},e.label)))))))},be=e=>{let{messageText:t,dueInDays:n}=e;return a().createElement(l.Zp.Root,null,a().createElement(l.Zp.Body,{gap:"2.5",padding:"4"},a().createElement(l.EY,{fontSize:"md",margin:"0!",fontWeight:"semibold"},t),a().createElement(l.EY,{fontSize:"sm",margin:"0!",color:"fg.muted"},"Due: ",n," days from task creation")))},_e=()=>a().createElement(l.In,{ariaHidden:!0,as:ye,boxSize:"6"},null),Ae=e=>{let{tasks:t,modelType:n,configurationOptions:o,onChange:r}=e;return a().createElement(ce,{icon:a().createElement(_e,null),stepNumber:3,title:"Actions"},t.map(e=>{var t;const i=o.task_options.find(t=>t.type===e.type&&t.model_type===n),d=e.metadata;
2return a().createElement(l.Tk,{alignItems:"flex-start",gap:"4",width:"full",key:e.workflow_task_id},a().createElement(he,{value:d.assignee_strategy,options:null!==(t=null==i?void 0:i.assignee_options)&&void 0!==t?t:[],onChange:t=>((e,t)=>{r(Object.assign(Object.assign({},e),{metadata:Object.assign(Object.assign({},e.metadata),{assignee_strategy:t})}))})(e,t)}),a().createElement(be,{messageText:d.message_text,dueInDays:d.due_in_days}))}))},Ce=()=>{const{workflowId:e}=(0,w.g)(),{workflow:t,configurationOptions:n,loading:i,saving:d,error:s,isDirty:c,setWorkflow:u,save:g,cancel:p}=function(e){const t=(0,w.Zp)(),n=(0,m.wA)(),a=(0,m.d4)(e=>Z(e)),r=(0,m.d4)(e=>V(e)),l=(0,m.d4)(e=>(e=>"pending"===e.workflowAutomations.detailLoading)(e)),i=(0,m.d4)(e=>(e=>e.workflowAutomations.configurationOptions)(e)),d=(0,m.d4)(e=>(e=>"pending"===e.workflowAutomations.configurationOptionsLoading)(e)),s=(0,m.d4)(e=>(e=>"pending"===e.workflowAutomations.saveLoading)(e)),c=(0,m.d4)(e=>U(e));(0,o.useEffect)(()=>(n(I(e)),n(D(void 0)),()=>{n(B())}),[n,e]);const u=(0,o.useCallback)(e=>{n(M(e))},[n]),g=(0,o.useCallback)(()=>{return t=this,o=void 0,l=function*(){a&&(n(H()),yield n(W({workflowId:e,workflow:z(a)})))},new((r=void 0)||(r=Promise))(function(e,n){function a(e){try{d(l.next(e))}catch(e){n(e)}}function i(e){try{d(l.throw(e))}catch(e){n(e)}}function d(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r(function(e){e(n)})).then(a,i)}d((l=l.apply(t,o||[])).next())});var t,o,r,l},[n,a,e]),p=(0,o.useCallback)(()=>{n(P()),n(H()),t("/automations")},[n,t]);return{workflow:a,configurationOptions:i,loading:l||d,saving:s,error:c,isDirty:r,setWorkflow:u,save:g,cancel:p}}(null!=e?e:"");return!i&&t&&n?a().createElement(l.BJ,{gap:"6",paddingBottom:"4",paddingRight:"4",align:"stretch"},a().createElement(ie,{workflowName:t.name,isDirty:c,saving:d,error:s,onSave:g,onCancel:p}),a().createElement(K,null),a().createElement(l.zt,{justify:"space-between",align:"center",width:"full"},a().createElement(l.DZ,{size:"lg",margin:"0!"},t.name),a().createElement(Q,{disabled:!1,isChecked:t.active,label:"Enable automation",onCheckedChange:e=>u(Object.assign(Object.assign({},t),{active:e}))})),a().createElement(l.BJ,{gap:"0",align:"stretch"},a().createElement(ke,{configurationOptions:n,modelType:t.model_type,trigger:t.trigger,onChange:e=>{t.trigger&&u(Object.assign(Object.assign({},t),{trigger:Object.assign(Object.assign({},t.trigger),e)}))}}),a().createElement(ae,null),a().createElement(pe,{conditions:t.conditions,configurationOptions:n,modelType:t.model_type,onChange:e=>{u(Object.assign(Object.assign({},t),{conditions:t.conditions.map(t=>t.workflow_condition_id===e.workflow_condition_id?e:t)}))}}),a().createElement(ae,null),a().createElement(Ae,{tasks:t.tasks,modelType:t.model_type,configurationOptions:n,onChange:e=>{u(Object.assign(Object.assign({},t),{tasks:t.tasks.map(t=>t.workflow_task_id===e.workflow_task_id?e:t)}))}}))):a().createElement(l.ov,{paddingY:"12"},a().createElement(r.SkubotSpinner,null))},Oe="MODIFY-WORKFLOW-AUTOMATION",xe=()=>{const e=(0,w.zy)();return a().createElement(f.A,{location:e})},ze=()=>{const e=(0,k.u7)("HAS-WORKFLOW-AUTOMATION",!0),t=(0,w.zy)(),{workflowId:n}=(0,w.g)();if(!e)throw new Error("Unauthorized to access automations");return t.pathname!==`/automations/${n}`||(0,v.iv)(n)?a().createElement(w.sv,null):a().createElement(f.A,{location:t})},Se=()=>{if(!(0,k.u7)("MODIFY-WORKFLOW-AUTOMATION"))throw new Error("Unauthorized to access the automation editor");return a().createElement(w.sv,null)},je=(0,y.A)(e=>{let{basename:t}=e;return a().createElement(E.Kd,{basename:t},a().createElement(w.BV,null,a().createElement(w.qh,{element:a().createElement(ze,null)},a().createElement(w.qh,{path:"/automations",element:a().createElement(oe,null)}),a().createElement(w.qh,{element:a().createElement(Se,null)},a().createElement(w.qh,{path:"/automations/:workflowId",element:a().createElement(Ce,null)})),a().createElement(w.qh,{path:"*",element:a().createElement(xe,null)}))))},{[q.name]:q.reducer}),Te=()=>{const e=(0,m.d4)(g.ag);return a().createElement(r.Theme,{theme:r.themeOptions},a().createElement(p.GlobalStyle,null),a().createElement(d.A,null,a().createElement(s.A,null),a().createElement(c.A,null,a().createElement("div",{className:"main-content"},a().createElement(l.Kq,null,a().createElement(l.az,{fontFamily:"body"},a().createElement(je,null))),a().createElement(i.N9,{autoClose:3e3,hideProgressBar:!0}))),a().createElement(u.A,{popups:e})))}}}]);
3//# sourceMappingURL=WorkflowAutomationsApp.0065746e.chunk.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.