orAnimation(e){if(0===e.length||!e.includes(`
`)||!shouldSplitText(e))return[e];let t=[""];for(let a=0;a<e.length;a++){let n=e[a],r=t[t.length-1].endsWith(`
`);`
`!==n&&r&&t.push(""),t[t.length-1]+=n}return t}function shouldSplitText(e){return e.split(`
`).filter(e=>e.trim().length>10).length>1}function createAnimatedBlocks(e){let t=[];for(let[a,n]of e.elements.entries())if("rich_text_section"===n.type)for(let[r,l]of n.elements.entries())if("text"===l.type)for(let[i,s]of splitTextIntoChunksForAnimation(l.text).entries())t.push({...e,elements:[{...n,elements:[{...l,text:s}]}],block_id:`${e.block_id}-${a}-${r}-${i}`});else t.push({...e,elements:[{...n,elements:[l]}],block_id:`${e.block_id}-${a}-${r}`});else t.push({...e,elements:[n],block_id:`${e.block_id}-${a}`});return t}function FadeInRichText({containerActionsPayload:e,block:t,onAnimationComplete:a,blocksContainerContext:r,animationDurationSeconds:l=1,onAction:i,onLinkClick:o,enableCitationImpression:d,className:u}){let m=(0,c.pc)(),p=(0,n.useMemo)(()=>createAnimatedBlocks(t).map(e=>[e]),[t]),b=(0,n.useCallback)(e=>{let t=e===p.length-1;return{variants:{hidden:{opacity:0,y:20},visible:{opacity:1,y:0}},transition:{duration:.4,ease:"easeOut",delay:.4>l||0===p.length?0:e*((l-.4)/p.length)},onAnimationComplete:t?a:void 0}},[l,p,a]);return n.createElement(m.span,{initial:"hidden",animate:"visible"},p.map((t,a)=>n.createElement(m.span,{key:t[0].block_id,...b(a)},n.createElement(s.c,{containerActionsPayload:e,blocks:t,blocksContainerContext:r,inline:!0,streaming:!1,onAction:i,onLinkClick:o,enableCitationImpression:d,className:u}))))}function getTokenCount(e){let t=0;for(let a of e)"text"===a.type?t+=getTextElementTokens(a).length:t+=1;return t}function getTextElementTokens(e){return""===e.text?[""]:e.text.split("")}function getRichTextBlockLength(e){let t=0;for(let a of e.elements)t+=getRichTextElementLength(a);return t}function getRichTextElementLength(e){switch(e.type){case"rich_text_section":return getRichTextSectionLength(e);case"rich_text_quote":return getRichTextQuoteLength(e);case"rich_text_preformatted":return getRichTextPreformattedLength(e);case"rich_text_list":return getRichTextListLength(e);default:return 1}}function getRichTextSectionLength(e){return getTokenCount(e.elements)}function getRichTextQuoteLength(e){return getTokenCount(e.elements)}function getRichTextPreformattedLength(e){return getTokenCount(e.elements)}function getRichTextListLength(e){let t=0;for(let a of e.elements)t+=getRichTextSectionLength(a);return t}function sliceRichTextBlock(e,{start:t=0,end:a}){let n={...e,elements:[]};if(t>=a)return n;let r=0;for(let l of e.elements){if(r>=a)break;if("rich_text_section"===l.type){let{slicedElement:e,newPosition:i}=processRichText(l,t,a,r,sliceRichTextSection);e&&n.elements.push(e),r=i}else if("rich_text_quote"===l.type){let{slicedElement:e,newPosition:i}=processRichText(l,t,a,r,sliceRichTextQuote);e&&n.elements.push(e),r=i}else if("rich_text_preformatted"===l.type){let{slicedElement:e,newPosition:i}=processRichText(l,t,a,r,sliceRichTextPreformatted);e&&n.elements.push(e),r=i}else if("rich_text_list"===l.type){let e={...l,elements:[]};for(let n of l.elements){if(r>=a)break;if("rich_text_section"===n.type){let l=getTokenCount(n.elements);if(r+l<=t){r+=l;continue}let i=Math.max(0,t-r),s=Math.min(l,a-r);if(i<s){let t=sliceRichTextSection(n,{start:i,end:s});t.elements.length>0&&e.elements.push(t)}r+=l}else r>=t&&r<a&&e.elements.push(n),r+=1}e.elements.length>0&&n.elements.push(e)}else r>=t&&r<a&&n.elements.push(l),r+=1}return n}function sliceRichTextElements(e,{start:t=0,end:a}){let n=[],r=0;for(let l of e)if("text"===l.type){let e=getTextElementTokens(l),i=e.length;if(r+i<=t){r+=i;continue}if(r>=a)break;let s=Math.max(0,t-r),o=Math.min(i,a-r);if(s<o){let t=e.slice(s,o);t.length>0&&n.push({...l,text:t.join("")})}r+=i}else if(r>=t&&r<a&&n.push(l),(r+=1)>=a)break;return n}function processRichText(e,t,a,n,r){let l=getTokenCount(e.elements);if(n+l<=t)return{slicedElement:null,newPosition:n+l};let i=Math.max(0,t-n),s=Math.min(l,a-n);if(i<s){let t=r(e,{start:i,end:s});if(t.elements.length>0)return{slicedElement:t,newPosition:n+l}}return{slicedElement:null,newPosition:n+l}}function sliceRichTextSection(e,{start:t=0,end:a}){return{...e,elements:sliceRichTextElements(e.elements,{start:t,end:a})}}function sliceRichTextQuote(e,{start:t=0,end:a}){return{...e,elements:sliceRichTextElements(e.elements,{start:t,end:a})}}function sliceRichTextPreformatted(e,{start:t=0,end:a}){return{...e,elements:sliceRichTextElements(e.elements,{start:t,end:a})}}function getCompletionSplitIndex(e,t){let a=0;for(let n of e.elements){let e=a+getRichTextElementLength(n);if("rich_text_preformatted"===n.type&&a<t&&t<e)return e;if((a=e)>=t)break}return t}function StreamingRichTextBlock({containerActionsPayload:e,block:t,advanceBlock:a,blocksContainerContext:r,streamingAnimationSpeed:c=o.WU,completionAnimationSpeed:d=o.Ez,remainingTokensForCompletionAnimation:u=o.Gk,streamingRefreshRate:m=o.q6,inline:p,isComplete:b=!1,onAction:f,isMessageStreamingRegistered:g,onStreamingRichTextBlockRender:h,onLinkClick:_,enableCitationImpression:y,className:x}){let{windowRef:v}=(0,n.useContext)(i._0);(0,n.useEffect)(()=>{h?.()},[h]);let E=(0,n.useMemo)(()=>getRichTextBlockLength(t),[t]),[k,S]=(0,n.useState)(g?E:0),w=(0,n.useRef)(0),C=(0,n.useRef)(),A=b&&E-k>=u,T=A?getCompletionSplitIndex(t,k):k,I=(0,n.useMemo)(()=>[sliceRichTextBlock(t,{end:T})],[t,T]),N=(0,n.useMemo)(()=>!A||T>=E?null:sliceRichTextBlock(t,{start:T,end:E+1}),[t,T,A,E]),M=(0,n.useMemo)(()=>!!(k>=E)||!!A&&!!(T>=E),[E,k,A,T]),F=(0,n.useCallback)(()=>{a()},[a]);return(0,n.useEffect)(()=>{M&&a()},[M,a]),(0,n.useEffect)(()=>{let e=v?.deref();if(M||A||!e)return;w.current=e.performance.now();let t=0,animate=a=>{let n=a-w.current;if(n<m){C.current=e.requestAnimationFrame(animate);return}let r=Math.floor((t+=n)/1e3*c);if(r>0&&(S(e=>e+r),t-=r/c*1e3),w.current=a,!M&&!A){let e=v?.deref();e&&(C.current=e.requestAnimationFrame(animate))}};return C.current=e.requestAnimationFrame(animate),()=>{C.current&&v?.deref()?.cancelAnimationFrame(C.current)}},[M,a,c,v,t,A,m]),n.createElement("div",{className:l()({display_inline:p})},n.createElement(s.c,{containerActionsPayload:e,blocks:I,blocksContainerContext:r,inline:p,streaming:!1,onAction:f,onLinkClick:_,enableCitationImpression:y,className:x}),N?n.createElement(FadeInRichText,{containerActionsPayload:e,block:N,onAnimationComplete:F,blocksContainerContext:r,onAction:f,animationDurationSeconds:d/1e3,onLinkClick:_,enableCitationImpression:y,className:x}):null)}FadeInRichText.displayName="FadeInRichText",StreamingRichTextBlock.displayName="StreamingRichTextBlock"},0x17a0daeef:(e,t,a)=>{"use strict";a.d(t,{w:()=>n});let n=a(0xbad225b5).createContext({shouldDecode:!1})},0xb214261e:(e,t,a)=>{"use strict";a.d(t,{G:()=>TokenizerInput});var n=a(0xbad225b5),r=a(0x120c268ad),l=a.n(r),i=a(0x1cbdfeceb),s=a(0x20bafd237),o=a(0x1a256ff50),c=a(0x1e586fbba),d=a(0x11aaf59fe),u=a(0x1229d92d),m=a(0x2343fde45),p=a(0xb6f15b90),b=a(0x1d8fbce0b),f=a(0x106d9c7ac),g=a(0x17feb01e0),h=a(0x1c91944c9),_=a(0xb6085b19);let y=/:([a-zA-Z0-9_+-]+)$/,x=class extends n.Component{constructor(e){super(e),this.state={isOpen:!1,query:"",results:[],selectedIndex:void 0,triggerPosition:void 0},this.handleKeyDown=this.handleKeyDown.bind(this),this.handleFilterQueryChange=this.handleFilterQueryChange.bind(this),this.closeEmojiAutocomplete=this.closeEmojiAutocomplete.bind(this),this.onEmojiSelect=this.onEmojiSelect.bind(this),this.onEmojiSelectedIndexChange=this.onEmojiSelectedIndexChange.bind(this)}componentDidUpdate(e){this.props.filterQuery!==e.filterQuery&&this.props.filterQuery&&this.checkEmojiAutocomplete(this.props.filterQuery)}checkEmojiAutocomplete(e){let t=e.match(y);if(t){let e=t[1];if(e.length>=2&&e.length<=50){let t=this.props.windowRef.deref()?.getSelection(),a=t?.getRangeAt(0),n=a?.getBoundingClientRect();n&&(this.setState(()=>({isOpen:!0,query:e,triggerPosition:{top:n.bottom,left:n.left,right:n.left,bottom:n.bottom,width:0,height:0}})),this.fetchEmojiResults(e))}else this.closeEmojiAutocomplete()}else this.state.isOpen&&this.closeEmojiAutocomplete()}fetchEmojiResults(e){this.props.autocompleteEmoji({query:e,limit:10,searcherKey:"multi-select-input"}).then(e=>{let t=Array.isArray(e)?e:[];this.setState(e=>({...e,results:t,selectedIndex:t.length>0?0:void 0}))}).catch(e=>{console.error("Emoji search failed:",e),this.setState(e=>({...e,results:[],selectedIndex:void 0}))})}closeEmojiAutocomplete(){this.setState(()=>({isOpen:!1,query:"",results:[],selectedIndex:void 0}))}onEmojiSelect(e){let t=this.state.results[e];t?.item?.name&&this.insertEmoji(t.item.name),this.closeEmojiAutocomplete()}onEmojiSelectedIndexChange(e){this.setState(t=>({...t,selectedIndex:e}))}insertEmoji(e){let{filterQuery:t,onSetFilterQuery:a}=this.props,n=`:${e}:`,r=t?.replace(y,n)||n;a&&a(r)}handleEmojiNavigation(e){let t,{results:a,selectedIndex:n}=this.state;a.length&&((t="number"==typeof n?n+e:e>0?0:a.length-1)<0?t=a.length-1:t>=a.length&&(t=0),this.setState(e=>({...e,selectedIndex:t})))}handleKeyDown(e){if(!this.state.isOpen)return;let{key:t}=e;if("ArrowUp"===t||"ArrowDown"===t){e.preventDefault(),this.handleEmojiNavigation("ArrowDown"===t?1:-1);return}if("Enter"===t){e.preventDefault(),"number"==typeof this.state.selectedIndex&&this.onEmojiSelect(this.state.selectedIndex);return}"Escape"===t&&(e.preventDefault(),this.closeEmojiAutocomplete())}handleFilterQueryChange(e){this.props.onFilterQueryChange&&this.props.onFilterQueryChange(e)}getTargetBounds(){let{triggerPosition:e}=this.state;if(e)return{top:e.top,left:e.left,right:e.right,bottom:e.bottom,width:e.width,height:e.height}}renderEmojiAutocomplete(){let{isOpen:e,results:t,selectedIndex:a}=this.state,r=this.getTargetBounds();return e&&r?n.createElement(f.Ay,{isOpen:e,position:"bottom-left",targetBounds:r,offsetY:5,zIndex:"menu",shouldObserveResize:!1,shouldFocusAfterRender:!1,shouldFade:!1,ariaHideApp:!1,onClose:this.closeEmojiAutocomplete},n.createElement(g.A,{results:t,selectedIndex:a,onSelect:this.onEmojiSelect,onSelectedIndexChange:this.onEmojiSelectedIndexChange})):null}render(){let{children:e}=this.props,t=n.cloneElement(e,{onKeyDown:t=>{this.handleKeyDown(t),e.props.onKeyDown&&e.props.onKeyDown(t)},onBlur:t=>{this.state.isOpen&&this.closeEmojiAutocomplete(),e.props.onBlur&&e.props.onBlur(t)}});return n.createElement(n.Fragment,null,t,this.renderEmojiAutocomplete())}};x.displayName="EmojiAutocompleteWrapper";let v={autocompleteEmoji:_.A},E=(0,h.N)(null,v)(x),k="Blur",S="Enter",w="Mount",C="EmojiAutocomplete",MultiSelectInputWithEmoji=e=>{let{enableEmojiAutocomplete:t,setSelectState:a,selectState:r,...l}=e,i=(0,n.useCallback)(e=>{a(()=>({...r,filterQuery:e}),C)},[a,r]),s=n.createElement(p.Z,{...l,setSelectState:a,selectState:r});return t?n.createElement(E,{windowRef:e.windowRef,windowId:e.windowId,filterQuery:r.filterQuery,onSetFilterQuery:i},s):s};MultiSelectInputWithEmoji.displayName="MultiSelectInputWithEmoji";let A=(0,b.v)((0,u.A)((0,m.A)(MultiSelectInputWithEmoji)));var T=a(0x17a0daeef);let TokenizerInput=class TokenizerInput extends n.Component{static contextType=T.w;static defaultProps={className:"",dataQa:void 0,inputClassPrefix:"c-tokenizer_input",inputDataQaPrefix:"tokenizer_input",untokenizedText:"",errorMessage:void 0,helpText:void 0,hideUntokenizedTextOnBlur:!1,tokenizeOnMount:!1,tokenizeOnBlur:!0,keepFocusOnInputOnError:!1,onChange:i.A,onBlur:i.A,onKeyDown:i.A,itemValidator:()=>!0,makeOption:(e,t)=>({key:`${t}-${e}`,label:e,value:e,entity:{isValid:!0}}),splitQuery:e=>e.split(",").map(e=>e.trim()).filter(Boolean),setInputRef:i.A,isDisabled:!1,isInvalid:!1,placeholderText:void 0,ariaLabel:void 0,ariaLabelledBy:void 0,size:d.hu.MEDIUM,maxHeight:void 0,focusOnMount:!1,disableIdParsing:!1,enableEmojiAutocomplete:!1};textWasPasted=!1;skipNextTokenization=!1;lastOnChangePayload={tokenizedItems:[],untokenizedText:TokenizerInput.defaultProps.untokenizedText};inputRef=n.createRef();constructor(e){super(e);const{setInputRef:t,makeOption:a,tokenizedItems:n}=this.props;this.lastOnChangePayload.tokenizedItems=n,t(this.inputRef),this.state={selectState:{filterQuery:e.untokenizedText,selectedOptions:e.tokenizedItems.map(a),isInvalid:e.isInvalid,isDisabled:e.isDisabled}}}componentDidMount(){let{untokenizedText:e,tokenizeOnMount:t}=this.props;t&&e.length>0&&this.tokenize({filterQuery:e,tokenizationSource:w})}componentDidUpdate(e){(0,o.Ay)(e.tokenizedItems,this.props.tokenizedItems)?e.isDisabled!==this.props.isDisabled&&this.setSelectState(()=>({isDisabled:this.props.isDisabled})):this.setSelectState(()=>({selectedOptions:this.props.tokenizedItems.map(this.props.makeOption),filterQuery:""}))}compareAndCallOnChange=(e,t,a=!1)=>{let{onChange:n,keepFocusOnInputOnError:r}=this.props;(e.join()!==this.lastOnChangePayload.tokenizedItems.join()||t!==this.lastOnChangePayload.untokenizedText||a)&&(this.lastOnChangePayload={tokenizedItems:e.slice(),untokenizedText:t},","===t&&(this.lastOnChangePayload.untokenizedText=TokenizerInput.defaultProps.untokenizedText),r&&a&&""!==this.lastOnChangePayload.untokenizedText&&this.inputRef.current?.focus(),n(this.lastOnChangePayload.tokenizedItems,this.lastOnChangePayload.untokenizedText,a))};onFilterQueryPaste=()=>{this.textWasPasted=!0};onBlur=()=>{let{tokenizeOnBlur:e,onBlur:t}=this.props;e&&this.tokenize({tokenizationSource:k}),t()};onKeyDown=e=>{let{untokenizedText:t,onKeyDown:a}=this.props,{key:n}=e;if(this.skipNextTokenization){this.skipNextTokenization=!1;return}if(a&&a(e),"Enter"===n)return void this.tokenize({tokenizationSource:S});if(","===n){this.tokenize({tokenizationSource:","}),e.preventDefault();return}!t.length||"Tab"!==n||this.tokenize({tokenizationSource:"Tab"}).length&&e.preventDefault()};tokenize=({filterQuery:e,tokenizationSource:t}={})=>{let{tokenizedItems:a,untokenizedText:n,itemValidator:r,splitQuery:l}=this.props,i=void 0!==e?e:n,o=l(i),c=this.textWasPasted;this.textWasPasted=!1;let d=o.filter(e=>r(e)),u=!!d.length&&(0,s.A)(o),m=u&&i.length-i.lastIndexOf(u)-u.length>0,p=u&&t===S;if(d.length>0&&(t===k||"Tab"===t||","===t||t===w||c||m||p)){let{shouldDecode:e}=this.context;return this.compareAndCallOnChange(a.concat(d.map(t=>{let a;return e?((a=document.createElement("textarea")).innerHTML=t,a.value):t})),TokenizerInput.defaultProps.untokenizedText,t===k),d}return d.length>0&&t===C?(this.compareAndCallOnChange(a.concat(d),i),this.skipNextTokenization=!0,d):(this.compareAndCallOnChange(a,i,t===k),[])};setSelectState=(e,t)=>{let a=e(),{selectState:n}=this.state,r={...n,...a};(r.filterQuery||""===r.filterQuery)&&r.filterQuery!==n.filterQuery&&this.tokenize({filterQuery:r.filterQuery,tokenizationSource:t}),r.selectedOptions?.length!==n.selectedOptions?.length&&this.compareAndCallOnChange(r.selectedOptions.map(e=>e.value),r.filterQuery);let l={selectState:r};this.setState(()=>l)};render(){let{className:e,dataQa:t,errorMessage:a,placeholderText:r,ariaLabel:i,ariaLabelledBy:s,size:o,hideUntokenizedTextOnBlur:d,focusOnMount:u,helpText:m,maxHeight:p,inputDataQaPrefix:b,inputClassPrefix:f,disableIdParsing:g,isTokenEditable:h,enableEmojiAutocomplete:_}=this.props,y=l()({[`${f}__help_text`]:f});return n.createElement("div",{className:e,"data-qa":t},n.createElement(A,{selectDataQa:b,classPrefix:f,maxHeight:p,selectState:this.state.selectState,setSelectState:this.setSelectState,size:o,width:"100%",placeholderText:r,ariaLabelledBy:s,ariaLabel:i,focusOnMount:u,onKeyDown:this.onKeyDown,onFilterQueryPaste:this.onFilterQueryPaste,inputRef:this.inputRef,measurePopoverEventName:"fakeEvent",onBlur:this.onBlur,hideFilterQueryOnBlur:d,disableIdParsing:g,isTokenEditable:h,enableEmojiAutocomplete:_}),a&&n.createElement(c.A,{"data-qa":`${b}-inline-alert`},a),m&&n.createElement("div",{className:y},m))}};TokenizerInput.displayName="TokenizerInput"},0x28d59ea1:(e,t,a)=>{"use strict";a.d(t,{J:()=>o});var n=a(0xe874a88a),r=a(0x22a29f141),l=a(0x1dfdeb1c8),i=a(0x1ec68d6a3),s=a(0xe747dd27);let o=(0,l.A)("apps.datasources.external.fieldreferences.list generated fetcher",(e,t,a)=>new n.S((n,l)=>{let{abortSignal:o,reason:c,...d}=a,u=(0,s.VA)(d);e((0,r.apiCall)({method:"apps.datasources.external.fieldreferences.list",args:u,abortSignal:o,reason:c})).then(e=>{n(e)}).catch(e=>{(0,i.default)({getState:t}).error(`API call to apps.datasources.external.fieldreferences.list
						with reason ${c} failed, initiated by generated fetcher`),l(e)})}));o.meta={name:"appsDatasourcesExternalFieldreferencesListFetcher",key:"createFetcherAppsDatasourcesExternalFieldreferencesListFetcher",description:"apps.datasources.external.fieldreferences.list generated fetcher"}},0xbdbf0a38:(e,t,a)=>{"use strict";a.d(t,{O:()=>o});var n=a(0xe874a88a),r=a(0x22a29f141),l=a(0x1dfdeb1c8),i=a(0x1ec68d6a3),s=a(0xe747dd27);let o=(0,l.A)("apps.datasources.external.schema.objects.list generated fetcher",(e,t,a)=>new n.S((n,l)=>{let{abortSignal:o,reason:c,...d}=a,u=(0,s.VA)(d);e((0,r.apiCall)({method:"apps.datasources.external.schema.objects.list",args:u,abortSignal:o,reason:c})).then(e=>{n(e)}).catch(e=>{(0,i.default)({getState:t}).error(`API call to apps.datasources.external.schema.objects.list
						with reason ${c} failed, initiated by generated fetcher`),l(e)})}));o.meta={name:"appsDatasourcesExternalSchemaObjectsListFetcher",key:"createFetcherAppsDatasourcesExternalSchemaObjectsListFetcher",description:"apps.datasources.external.schema.objects.list generated fetcher"}},0x1318fdf2a:(e,t,a)=>{"use strict";a.d(t,{i:()=>o});var n=a(0xe874a88a),r=a(0x22a29f141),l=a(0x1dfdeb1c8),i=a(0x1ec68d6a3),s=a(0xe747dd27);let o=(0,l.A)("apps.datasources.external.schema.info generated fetcher",(e,t,a)=>new n.S((n,l)=>{let{abortSignal:o,reason:c,...d}=a,u=(0,s.VA)(d);e((0,r.apiCall)({method:"apps.datasources.external.schema.info",args:u,abortSignal:o,reason:c})).then(e=>{n(e)}).catch(e=>{(0,i.default)({getState:t}).error(`API call to apps.datasources.external.schema.info
						with reason ${c} failed, initiated by generated fetcher`),l(e)})}));o.meta={name:"appsDatasourcesExternalSchemaInfoFetcher",key:"createFetcherAppsDatasourcesExternalSchemaInfoFetcher",description:"apps.datasources.external.schema.info generated fetcher"}},0x3b26a95e:(e,t,a)=>{"use strict";a.d(t,{A:()=>useClientRect});var n=a(0xbad225b5),r=a(0x162afc153);function useClientRect(e){let[t,a]=(0,n.useState)(e?.getBoundingClientRect()||null);return(0,n.useEffect)(()=>{let t=(0,r.A)(()=>{a(e.getBoundingClientRect())},150);return window.addEventListener("resize",t),window.addEventListener("scroll",t),()=>{window.removeEventListener("resize",t),window.removeEventListener("scroll",t)}},[e]),t}},0x15e922395:(e,t,a)=>{"use strict";a.d(t,{D:()=>n});let n=(0,a(0xcf658893).Ay)("External Auth Completed");n.meta={name:"externalAuthCompleted",key:"createActionExternalAuthCompleted",description:"External Auth Completed"}},0x8921b4af:(e,t,a)=>{"use strict";a.d(t,{T:()=>r});var n=a(0x22b3402cb);let r=(0,a(0x11c82607b).Ay)("Clean message text",(e,t,{text:a,isInternalMessage:r})=>{let l=t();return(0,n.A)(l,a,{isInternalMessage:r})});r.meta={name:"cleanMessageTextWithState",key:"createThunkCleanMessageTextWithState",description:"Clean message text"}},0x852588ab:(e,t,a)=>{"use strict";a.d(t,{n:()=>r});var n=a(0x1634acce7);let r=(0,a(0x11c82607b).Ay)("Prepare message",(e,t,a)=>{let r=t();return(0,n.A)(r,a)});r.meta={name:"prepareMessageThunk",key:"createThunkPrepareMessageThunk",description:"Prepare message"}},0x106932267:(e,t,a)=>{"use strict";a.d(t,{D6:()=>c,R7:()=>u,Tt:()=>i,Yl:()=>o,ZT:()=>d,ad:()=>m,wv:()=>s,ys:()=>p});var n=a(0x1df96de4c),r=a(0x1cf0d97e1),l=a(0xdf55e8f3);let i=(0,r.Ay)(e=>e?.appManifest?.json);i.meta={name:"getJson",key:"createSelectorGetJson",description:e=>e?.appManifest?.json};let s=(0,r.Ay)(e=>e?.appManifest?.lastSavedJson);s.meta={name:"getLastSavedJson",key:"createSelectorGetLastSavedJson",description:e=>e?.appManifest?.lastSavedJson};let o=(0,r.Ay)(e=>e?.appManifest?.errors||n.Ml);o.meta={name:"getErrors",key:"createSelectorGetErrors",description:e=>e?.appManifest?.errors||n.Ml};let c=(0,r.Ay)(e=>e?.appManifest?.teamToken);c.meta={name:"getTeamToken",key:"createSelectorGetTeamToken",description:e=>e?.appManifest?.teamToken};let d=(0,r.Ay)(e=>e?.appManifest?.teamId);d.meta={name:"getTeamId",key:"createSelectorGetTeamId",description:e=>e?.appManifest?.teamId};let u=(0,r.Ay)(e=>e?.appManifest?.appId);u.meta={name:"getAppId",key:"createSelectorGetAppId",description:e=>e?.appManifest?.appId};let m=(0,r.Ay)(e=>e?.appManifest?.warnings||n.Ml);m.meta={name:"getWarnings",key:"createSelectorGetWarnings",description:e=>e?.appManifest?.warnings||n.Ml};let p=(0,l.eI)(e=>o(e).concat(m(e)))},0x95c66692:(e,t,a)=>{"use strict";a.d(t,{u:()=>d});var n=a(0x95583610),r=a(0x1ec68d6a3),l=a(0x11c82607b),i=a(0x110d7b067),s=a(0x19561ce96),o=a(0x65561a6f),c=a(0x184767f39);let d=(0,l.Ay)("Add connector app step",async(e,t,{appId:a,appName:l,onOpenModal:d,onRequestAppModal:u,reason:m})=>{if(!a)return;let p=(0,s.Ez)(t(),a);try{if(p===c.pY.INSTALL_SHOW_STEP_FUNCTION){e((0,i.B$)({appId:a,appInstallationInFlight:!0}));let t=await e((0,n.y)({appId:a,reason:m??"step-library/install-connector-app"}));t&&t.ok&&(e((0,i.B$)({appId:a,appInstallationInFlight:!1})),e((0,o.o)({appIds:[a]})),d())}else p===c.pY.SHOW_STEP_FUNCTION?d():p===c.pY.INIT_APP_REQUEST_FLOW&&u()}catch(n){(0,r.default)({getState:t}).error(`error installing connector app info: ${a}`,n),e((0,i.B$)({appId:a,appInstallationInFlight:!1})),e((0,i.H)({appName:l||a}))}});d.meta={name:"addConnectorAppStep",key:"createThunkAddConnectorAppStep",description:"Add connector app step"}},0x212b4c697:(e,t,a)=>{"use strict";a.d(t,{BX:()=>r,RV:()=>i,RZ:()=>l});var n=a(0xcf658893);let r=(0,n.Ay)("Add function auths");r.meta={name:"addFunctionAuths",key:"createActionAddFunctionAuths",description:"Add function auths"};let l=(0,n.Ay)("Reset function auths");l.meta={name:"resetFunctionAuths",key:"createActionResetFunctionAuths",description:"Reset function auths"};let i=(0,n.Ay)("Set default auth token");i.meta={name:"setDefaultAuthToken",key:"createActionSetDefaultAuthToken",description:"Set default auth token"}},0xddd27d94:(e,t,a)=>{"use strict";a.d(t,{$:()=>generateFunctionAuthKey,A:()=>i});var n=a(0xba77ecb9),r=a(0x15e922395),l=a(0x212b4c697);let getInitialState=()=>({}),generateFunctionAuthKey=({functionId:e,providerKey:t})=>`${e}-${t}`,i=(0,n.Ay)({},getInitialState(),{storeKey:"hermesFunctionAuth",persistenceEnabled:!1}).on(l.BX,(e,{auths:t})=>t.reduce((e,t)=>(e[generateFunctionAuthKey(t)]=t,e),{...e})).on(l.RZ,()=>getInitialState()).on(l.RV,(e,{functionId:t,providerKey:a,externalTokenId:n})=>{let r=generateFunctionAuthKey({functionId:t,providerKey:a}),l=e[r],i=l?.validTokens.find(e=>e.externalTokenId===n);if(!i||i.isDefault)return e;let s=l.validTokens.map(e=>{let t=e.externalTokenId===n;return{...e,isDefault:t}});return{...e,[r]:{...l,validTokens:s}}}).on(r.D,(e,{external_token_id:t,external_user_id:a,provider_key:n,provider_name:r,app_id:l,function_id:i,user_id:s})=>{let o=generateFunctionAuthKey({functionId:i,providerKey:n}),c=e[o],d={externalTokenId:t,externalUserId:a,isDefault:!0,userId:s};if(!c)return{...e,[o]:{appId:l,functionId:i,providerKey:n,providerName:r,validTokens:[d]}};let u=[d,...c.validTokens.filter(e=>e.externalTokenId!==t).map(e=>({...e,isDefault:!1}))];return{...e,[o]:{...c,validTokens:u}}})},0x157b4a886:(e,t,a)=>{"use strict";a.d(t,{JG:()=>c,WZ:()=>d,mh:()=>getFunctionAuthState,rl:()=>u});var n=a(0x19b3ba9fd),r=a(0x1df96de4c),l=a(0x1cf0d97e1),i=a(0xdf55e8f3),s=a(0x1bc4b3ad8),o=a(0xddd27d94);let getFunctionAuthState=e=>e.hermesFunctionAuth,c=(0,l.Ay)((e,{functionId:t,providerKey:a})=>{let n=(0,o.$)({functionId:t,providerKey:a});return getFunctionAuthState(e)[n]});c.meta={name:"getFunctionAuth",key:"createSelectorGetFunctionAuth",description:(e,{functionId:t,providerKey:a})=>{let n=(0,o.$)({functionId:t,providerKey:a});return getFunctionAuthState(e)[n]}};let d=(0,i.eI)((e,t)=>t.map(({functionId:t,providerKey:a})=>c(e,{functionId:t,providerKey:a})).filter(n.b)),u=(0,s.F)(getFunctionAuthState,(e,{appId:t})=>t,(e,{functionId:t})=>t,(e,t,a)=>{let n=Object.values(e).filter(e=>e.appId===t&&e.functionId===a);return n.length?n:r.Ml});(0,l.Ay)(e=>Object.values(getFunctionAuthState(e)).reduce((e,t)=>(e[t.appId]=e[t.appId]??[],e[t.appId].push(t),e),{})).meta={name:"getUserAuthsGroupedByAppId",key:"createSelectorGetUserAuthsGroupedByAppId",description:e=>Object.values(getFunctionAuthState(e)).reduce((e,t)=>(e[t.appId]=e[t.appId]??[],e[t.appId].push(t),e),{})},(0,s.F)(getFunctionAuthState,(e,t)=>t,(e,t)=>{let a=Object.values(e).filter(e=>e.appId===t);return a.length?a:r.Ml})},0x1a7c0453a:(e,t,a)=>{"use strict";a.d(t,{N:()=>l,x:()=>i});var n=a(0x220ca72b1),r=a(0x11c82607b);let l=(0,r.Ay)("Start Function OAuth",async(e,t,{appId:a,providerKey:r,functionId:l,workflowId:i,reason:s="start_function_auth"})=>{let o=(await e((0,n.$)({appId:a,providerKey:r,functionId:l,workflowId:i,reason:s}))).authorization_url;window.open(o,"_blank","popup,noopener,noreferrer")});l.meta={name:"startFunctionAuth",key:"createThunkStartFunctionAuth",description:"Start Function OAuth"};let i=(0,r.Ay)("Start OAuth flow",async(e,t,{appId:a,providerKey:r,reason:l="start_oauth_flow",channelId:i,ephemeralMsgTs:s})=>{let o=(await e((0,n.$)({appId:a,providerKey:r,reason:l,channelId:i,ephemeralMsgTs:s}))).authorization_url;window.open(o,"_blank","popup,noopener,noreferrer")});i.meta={name:"startAuth",key:"createThunkStartAuth",description:"Start OAuth flow"}},0x3b8174d2:(e,t,a)=>{"use strict";a.d(t,{Jk:()=>f,Ui:()=>g,W1:()=>y,Z0:()=>h,cq:()=>b,gL:()=>p,hj:()=>m,oS:()=>_,pk:()=>x,sw:()=>k,vp:()=>E,zy:()=>v});var n=a(0xbe0b63ff),r=a(0x1df96de4c),l=a(0x1846f5916),i=a(0x9b971e7e),s=a(0xdf55e8f3),o=a(0x58fa6f7f),c=a(0xa7a4ed65),d=a(0xea788d49),u=a(0x1be8212b1);let m=(0,s.eI)((e,t,a=!0)=>{let r=e?.hermesFunctions?.functionsById?.[t],l=(0,i.ZT)(e);return l?r?((0,o.J)().maybeRefetch(l,t),r):a?(0,d.Ss)().fetchObjectWithId(l,t):(0,n.WQ)(t):(0,n.WQ)(t)}),p=(0,s.eI)((e,{ids:t})=>t.length?t.map(t=>m(e,t,!0)):r.Ml),b=(0,s.eI)(e=>e.hermesFunctions.functionsById),f=(0,s.eI)(e=>e.hermesFunctions.categories),g=(0,s.eI)(e=>Object.entries(b(e)).reduce((e,[t,a])=>(a&&!a.is_hidden&&(e[t]=a),e),{})),h=(0,s.eI)(e=>Object.entries(f(e)).reduce((e,[t,a])=>(a.isHidden||(e[t]=a),e),{}));(0,s.eI)(e=>e.hermesFunctions.collections);let _=(0,s.eI)(e=>{let t=b(e);return Object.values(e.hermesFunctions.collections).reduce((e,a)=>{let n=Object.keys(a.functionIds.reduce((e,a)=>{let n=t[a],r=n?.app_id||n?.category_id;return r&&(e[r]=!0),e},{}));return n.length>=l.$x&&(e[a.id]={...a,categories:n}),e},{})}),y=(0,s.eI)((e,t)=>{let a=b(e),n=(0,u.g)(t),r=[],l=Object.values(a),i={};for(let{app_id:e,id:s,title:o,category_label:c,callback_id:d,type:u,is_hidden:m}of l){if(!o||!o.length||m)continue;let l=RegExp(`\\b${t}\\b`,"i"),p=o.search(l),b=n.customMatch(o);b=p>-1?-5:b;let f=n.customMatch(c||""),g=Math.min(n.fuzzyMatcher.normalizeAndScore(o)-1,b,c?n.fuzzyMatcher.normalizeAndScore(c||"")+1:1/0,f);isFinite(g)&&(i[s]=g,r.push({id:s,title:o||s,categoryLabel:c,type:u,appId:e||d,isCategory:!1,productLevelAvailability:{isAvailable:a[s]?.product_level_availability?.is_available??!0,availableTo:a[s]?.product_level_availability?.available_to}}))}return r.sort((e,t)=>i[e.id]-i[t.id]).slice(0,10)}),x=(0,s.eI)((e,t)=>{let a=h(e),n=(0,u.g)(t),r=[],l=Object.entries(a),i={};for(let e of l){let[t,{name:a,type:l}]=e,s=Math.min(n.fuzzyMatcher.normalizeAndScore(a),n.customMatch(a));a.length&&isFinite(s)&&(i[a]=s,r.push({id:t,title:a,type:l,appId:t,isCategory:!0}))}return r.sort((e,t)=>i[e.id]-i[t.id]).slice(0,2)}),v=(0,s.eI)(e=>{let t=m(e,c.Ez.case_step,!0);return!(0,n.lv)(t)}),E=(0,s.eI)(e=>{let t=m(e,c.Ez.case_step,!0);return t?.product_level_availability?.is_available??!0}),k=(0,s.eI)((e,t)=>Object.values(b(e)).filter(e=>e&&e.callback_id&&t.includes(e.callback_id)))},0x52b05cae:(e,t,a)=>{"use strict";a.d(t,{b:()=>i});var n=a(0x1dc39a002),r=a(0x11c82607b),l=a(0x16b708a7f);let i=(0,r.Ay)("Fetches notification prefs for given salesforce org id",async(e,t,{salesforceOrgId:a})=>{if(!a)return null;let r=await e((0,n.s)({salesforceOrgId:a,keys:["allow_slack_connect_channels","allow_channel_workspaces","send_notification_to_channel_permission","allow_admins_to_send_to_all_channel_types"],reason:"modern-selling"}));if(!r.ok||!r.org_configs||!r.org_configs.length)return null;let{datasource_id:i,allow_channel_workspaces:s,allow_slack_connect_channels:o,send_notification_to_channel_permission:c,allow_admins_to_send_to_all_channel_types:d}=r.org_configs[0],u={salesforce_org_id:a,datasource_id:i,allowed_channel_workspaces:s,allow_slack_connect_channels:o,send_notification_to_channel_permission:c,allow_admins_to_send_to_all_channel_types:d};return e((0,l.iQ)({[a]:u})),u});i.meta={name:"fetchNotificationPrefsBySalesforceOrgId",key:"createThunkFetchNotificationPrefsBySalesforceOrgId",description:"Fetches notification prefs for given salesforce org id"}},0xcefedbca:(e,t,a)=>{"use strict";a.d(t,{A:()=>g});var n=a(0xe874a88a),r=a(0x22a29f141),l=a(0x1dfdeb1c8),i=a(0x1ec68d6a3),s=a(0xe747dd27);let o=(0,l.A)("salesHome.workflows.get generated fetcher",(e,t,a)=>new n.S((n,l)=>{let{abortSignal:o,reason:c,...d}=a,u=(0,s.VA)(d);e((0,r.apiCall)({method:"salesHome.workflows.get",args:u,abortSignal:o,reason:c})).then(e=>{n(e)}).catch(e=>{(0,i.default)({getState:t}).error(`API call to salesHome.workflows.get
						with reason ${c} failed, initiated by generated fetcher`),l(e)})}));o.meta={name:"salesHomeWorkflowsGetFetcher",key:"createFetcherSalesHomeWorkflowsGetFetcher",description:"salesHome.workflows.get generated fetcher"};var c=a(0x11c82607b),d=a(0x16b708a7f),u=a(0x2fd935d8),m=a(0x1d104c491);let p={ADMIN_SALES_HOME_DEAL_WON:m.Lb.adminDealWon,ADMIN_SALES_HOME_FORECAST_REMINDER:m.Lb.adminForecastReminder,ADMIN_SALES_HOME_NEW_OPPORTUNITY:m.Lb.adminNewOpportunityAlert,ADMIN_SALES_HOME_OPPORTUNITY_AMOUNT_CHANGED:m.Lb.adminAmountChanged,ADMIN_SALES_HOME_OPPORTUNITY_CLOSE_DATE_CHANGED:m.Lb.adminCloseDateChanged,ADMIN_SALES_HOME_OPPORTUNITY_STAGE_CHANGED:m.Lb.adminStageChanged,ADMIN_SALES_HOME_OPPORTUNITY_CLOSING_SOON:m.Lb.adminClosingSoonAlert,ADMIN_SALES_HOME_OPPORTUNITY_PAST_CLOSE_DATE:m.Lb.adminPastCloseDateAlert,ADMIN_SALES_HOME_OUTDATED_FIELD:m.YB.adminOutdatedFields,ADMIN_SALES_HOME_MISSING_FIELD:m.YB.adminMissingFields},b={SALES_HOME_DEAL_WON:m.Lb.userDealWon,SALES_HOME_FORECAST_REMINDER:m.Lb.userForecastReminder,SALES_HOME_NEW_OPPORTUNITY:m.Lb.userNewOpportunityAlert,SALES_HOME_OPPORTUNITY_AMOUNT_CHANGED:m.Lb.userAmountChanged,SALES_HOME_OPPORTUNITY_CLOSE_DATE_CHANGED:m.Lb.userCloseDateChanged,SALES_HOME_OPPORTUNITY_STAGE_CHANGED:m.Lb.userStageChanged},f=(0,c.Ay)("Fetches data for existing workflow, hydrates form data and opens notification builder",(e,t,{workflowId:a,isAdmin:n=!1,reason:r="modern-selling"})=>(n?e((0,d.MB)(!0)):e((0,d.gG)(!0)),e(o({workflowId:a,reason:r})).then(({template_id:t,payload:a,salesforce_org_id:r})=>{let l=a.acn?.account?.id||a.condition?.account?.id,i=a.acn?.opportunity?.id||a.condition?.opportunity?.id;if(l||i){let s;return e((0,u.R)({sobjects:[{sobjectApiName:l?"Account":"Opportunity",fields:["Name"]}],asIntegrationUser:n,query:(s=l||i||"",`https://fake.com/sobjects/?record_id=${s}`),...r&&{salesforceOrgId:r},reason:"edit_workflow"})).then(({records:e})=>{let[s]=e,o={...a};return s&&(n&&l?o.acn.account.name=s.label:n&&i?o.acn.opportunity.name=s.label:!n&&l?o.condition.account.name=s.label:o.condition.opportunity.name=s.label),{templateId:t,payload:o,salesforceOrgId:r}})}return{templateId:t,payload:a,salesforceOrgId:r}}).then(({templateId:t,payload:r,salesforceOrgId:l})=>{if(n){let n=p[t];e((0,d.kC)({workflowView:n,workflowId:a,payload:r,salesforceOrgId:l}))}else{let n=b[t];e((0,d.yK)({workflowView:n,workflowId:a,payload:r,salesforceOrgId:l}))}}).finally(()=>{n?e((0,d.MB)(!1)):e((0,d.gG)(!1))})));f.meta={name:"openEditWorkflow",key:"createThunkOpenEditWorkflow",description:"Fetches data for existing workflow, hydrates form data and opens notification builder"};let g=f},0x1cbba0fb:(e,t,a)=>{"use strict";a.d(t,{S_:()=>l,VN:()=>i,yz:()=>r});var n=a(0x1cf0d97e1);let r=(0,n.Ay)((e,t)=>e?.slackConnectExternalTeamsList[t].teamIdList);r.meta={name:"getSlackConnectExternalTeamListByConnectionType",key:"createSelectorGetSlackConnectExternalTeamListByConnectionType",description:(e,t)=>e?.slackConnectExternalTeamsList[t].teamIdList};let l=(0,n.Ay)((e,t)=>e.slackConnectExternalTeamsList[t].marker);l.meta={name:"getSlackConnectExternalTeamListMarkerByConnectionType",key:"createSelectorGetSlackConnectExternalTeamListMarkerByConnectionType",description:(e,t)=>e.slackConnectExternalTeamsList[t].marker};let i=(0,n.Ay)((e,t)=>e.slackConnectExternalTeamsList[t].lastUpdated);i.meta={name:"getSlackConnectExternalTeamListLastUpdatedByConnectionType",key:"createSelectorGetSlackConnectExternalTeamListLastUpdatedByConnectionType",description:(e,t)=>e.slackConnectExternalTeamsList[t].lastUpdated}},0x1eb98d98a:(e,t,a)=>{"use strict";a.d(t,{J:()=>r,O:()=>l});var n=a(0xcf658893);let r=(0,n.Ay)("ADD_STREAMING_MESSAGE");r.meta={name:"addStreamingMessage",key:"createActionAddStreamingMessage",description:"ADD_STREAMING_MESSAGE"};let l=(0,n.Ay)("REMOVE_STREAMING_MESSAGE");l.meta={name:"removeStreamingMessage",key:"createActionRemoveStreamingMessage",description:"REMOVE_STREAMING_MESSAGE"}},0x507d338f:(e,t,a)=>{"use strict";a.d(t,{_:()=>s,v:()=>o});var n=a(0x1337d9fa2),r=a(0x1cf0d97e1),l=a(0x1ccef1c6f),i=a(0x14149c126);let s=(0,r.Ay)((e,{channelId:t,ts:a})=>e?.streamingMessages?.[`${t}-${a}`]??!1);s.meta={name:"isMessageStreaming",key:"createSelectorIsMessageStreaming",description:(e,{channelId:t,ts:a})=>e?.streamingMessages?.[`${t}-${a}`]??!1};let o=(0,r.Ay)((e,t)=>{let a=(0,l.ty)(e,"a11y_animations")??!0,r="on"===(0,i._Z)(e,"animated_text_streaming");return!!(a&&!(0,n.gn)(t)&&r)});o.meta={name:"shouldMessageStream",key:"createSelectorShouldMessageStream",description:(e,t)=>{let a=(0,l.ty)(e,"a11y_animations")??!0,r="on"===(0,i._Z)(e,"animated_text_streaming");return!!(a&&!(0,n.gn)(t)&&r)}}},0x42654967:(e,t,a)=>{"use strict";a.d(t,{$n:()=>y,$z:()=>resolveNextCursorMark,BQ:()=>f,CS:()=>A,F6:()=>S,H3:()=>E,HC:()=>formatDateInterval,HM:()=>getNumberAnnotation,IV:()=>g,Nq:()=>getUiPageForType,Ph:()=>C,S5:()=>N,VZ:()=>createQuery,Yx:()=>k,Zq:()=>v,a$:()=>h,cU:()=>formatYYYYMMDDToUnixTime,lV:()=>_,mB:()=>I,p5:()=>b,r5:()=>x,uL:()=>w,w5:()=>T});var n,r,l,i,s,o,c,d,u=a(0x205f4fb61),m=a(0x3711e82d),p=a(0x6960d8b9);a(0xb1f0729f);let b=350;var f=((n={}).Channels="channels",n.Messages="messages",n.Users="users",n.Files="files",n.Apps="apps",n.Teams="teams",n),g=((r={}).Overview="overview",r.Teams="teams",r.Channels="channels",r.Members="users",r.Apps="apps",r.Huddles="huddles",r.Clips="clips",r.SlackAi="slack-ai",r.Canvas="canvas",r.Workflows="workflows",r.Lists="lists",r),h=((l={}).TwentyEightDays="28d",l.SevenDays="7d",l.OneDay="1d",l.Custom="custom",l);let _={ThreeMonths:"3mo",TwentyEightDays:"28d",SevenDays:"7d",Custom:"custom",SelectNewRange:"selectNewRange"},y={ThreeMonths:"3mo",TwentyEightDays:"28d",SevenDays:"7d",Custom:"custom",SelectNewRange:"selectNewRange"},x={ThreeMonths:"3mo",TwentyEightDays:"28d",SevenDays:"7d",Custom:"custom",SelectNewRange:"selectNewRange"};var v=((i={}).ThirtyDays="30d",i.AllTime="all",i.Custom="custom",i.PrevMonth="prevMonth",i);let E={ThirtyDays:"30d",TwentyEightDays:"28d",ThirteenMonths:"13mo",AllTime:"all",Custom:"custom",PrevMonth:"prevMonth",SelectNewRange:"selectNewRange"},k={ThreeMonths:"3mo",TwentyEightDays:"28d",SevenDays:"7d",Custom:"custom",SelectNewRange:"selectNewRange"},S={ThreeMonths:"3mo",TwentyEightDays:"28d",SevenDays:"7d",Custom:"custom",SelectNewRange:"selectNewRange"};var w=((s={}).Default="default",s.Daily="daily",s.Monthly="monthly",s),C=((o={}).Number="number",o.Percentage="percentage",o.Date="date",o.String="string",o),A=((c={}).All="all",c.Audio="audio",c.Video="video",c),T=((d={}).All="all",d.Standalone="standalone",d.Channel="channel_canvas",d);let I=6,N={number:u.Ay,percentage:e=>(0,u.KN)(e/100),date:e=>(0,p.Yq)(e,"{date_num}"),string:e=>e},getUiPageForType=(e,t)=>t?({overview:m.UiPage.ADMIN_ANALYTICS_TEAM_SITE_OVERVIEW,channels:m.UiPage.ADMIN_ANALYTICS_TEAM_SITE_CHANNELS,users:m.UiPage.ADMIN_ANALYTICS_TEAM_SITE_MEMBERS,apps:m.UiPage.ADMIN_ANALYTICS_TEAM_SITE_APPS,"slack-ai":m.UiPage.ADMIN_ANALYTICS_TEAM_SITE_SLACK_AI})[e]:({overview:m.UiPage.ADMIN_ANALYTICS_ADMIN_SITE_OVERVIEW,channels:m.UiPage.ADMIN_ANALYTICS_ADMIN_SITE_CHANNELS,teams:m.UiPage.ADMIN_ANALYTICS_ADMIN_SITE_TEAMS,users:m.UiPage.ADMIN_ANALYTICS_ADMIN_SITE_MEMBERS,apps:m.UiPage.ADMIN_ANALYTICS_ADMIN_SITE_APPS,clips:m.UiPage.ADMIN_ANALYTICS_ADMIN_SITE_CLIPS,canvas:m.UiPage.ADMIN_ANALYTICS_ADMIN_SITE_CANVAS,huddles:m.UiPage.ADMIN_ANALYTICS_ADMIN_SITE_HUDDLES,"slack-ai":m.UiPage.ADMIN_ANALYTICS_TEAM_SITE_SLACK_AI,workflows:m.UiPage.ADMIN_ANALYTICS_ADMIN_SITE_WORKFLOWS,lists:m.UiPage.ADMIN_ANALYTICS_ADMIN_SITE_LISTS})[e];function getNumberAnnotation(e,t){let a="";if("ja-JP"===e)switch(t){case"channels":case"messages":a="\u4EF6";break;case"users":a="\u4EBA";break;case"files":case"apps":a="\u500B"}return a}let resolveNextCursorMark=({cursorMark:e,numFound:t,countRequested:a,countReturned:n,countSoFar:r})=>0===n||t<=a||t===r+n?null:e,formatYYYYMMDDToUnixTime=e=>{let t=new Date(e),a=6e4*t.getTimezoneOffset();return new Date(t.getTime()+a).getTime()};function formatDateInterval(e){let[t="",a=""]=e?.startDate.split("-")??[];return`${t}-${a}`}function createQuery({searchQuery:e,searchType:t="fuzzy_with_email"}){try{if("string"!=typeof e||!e.trim().length)return;let a=e.trim().split(/\s+/).map(e=>({type:t,value:e})),n=1===a.length?a[0]:{type:"and",clauses:a};return JSON.stringify(n)}catch{return}}},0x8ba4f2d8:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});var n=a(0xe874a88a),r=a(0x154933c60),l=a(0x1ecc7f772),i=a(0x1c8f352ff);let s=(0,a(0x11c82607b).Ay)("Returns the result of channel name validation for the Channel Create modal",async(e,t,{channelName:a,skipNameTakenValidation:s=!1,validateNameTakenAgainstLocalStore:o=!0}={})=>{if(s){let e=t(),r=(0,i.cv)(e,a,"",(0,i.zU)(),s);return n.S.resolve(r)}let c=await e((0,r.hq)({query:a})),d=t();if(!o){let e=!!c?.channels?.find(e=>(0,l.Mn)(e)===a);return{...(0,i.cv)(d,a,"",(0,i.zU)()),hasNameTakenWarning:e}}return(0,i.cv)(d,a,"",(0,i.zU)())});s.meta={name:"validateChannelName",key:"createThunkValidateChannelName",description:"Returns the result of channel name validation for the Channel Create modal"};let o=s},0x33830eed:(e,t,a)=>{"use strict";let n,r;a.d(t,{Ay:()=>m});var l=a(0xe874a88a),i=a(0x20482ad21),s=a(0x1f7b0911b),o=a(0x3ed00af5),c=a(0x11c82607b);let d=new i.Ay("user_groups");function initErrorStrings(e){n={hasHandleRequiredWarning:d.t("Please enter a handle for this group."),hasMaxLengthWarning:d.t("Handles can\u2019t be more than {maxLength} characters.",{maxLength:80}),hasReservedHandle:d.t("The group name @{handle} is reserved and cannot be used.",{handle:e}),hasSpecialsWarning:d.t("Handles can only contain letters or numbers."),hasPunctuationWarning:d.t("Handles can only contain letters or numbers."),hasLowercaseWarning:d.t("Handles can only be in lowercase."),hasHandleTakenWarning:d.t("This handle is already in use by a member, channel, or another group."),nonLatinCharacterWarning:d.t("Handles can only contain letters or numbers."),unknownError:d.t("Sorry, something went wrong. Please try a different handle.")}}function initReservedHandles(){r={admins:d.t("admins"),owners:d.t("owners")}}let u=(0,c.Ay)("Validate user group handle",(e,t,{handle:a,prevHandle:i,reason:c,targetTeam:d})=>(initErrorStrings(a),initReservedHandles(),a&&a.trim())?a===i?l.S.resolve(""):a.toLowerCase()===r.admins.toLowerCase()||a.toLowerCase()===r.owners.toLowerCase()?l.S.resolve(n.hasReservedHandle):/[ ,;'`~!@#$%^&*+=\\:"<>?|]/.test(a.trim())?l.S.resolve(n.hasSpecialsWarning):/^[-|_]+$/.test(a)?l.S.resolve(n.hasPunctuationWarning):/[A-Z]/.test(a)?l.S.resolve(n.hasLowercaseWarning):(0,o.A)(a)>80?l.S.resolve(n.hasMaxLengthWarning):e((0,s.S)({handle:a,reason:c,targetTeam:d})).then(()=>"").catch(e=>{let t=e?.data?.error;return"handle_already_exists"===t?n.hasHandleTakenWarning:"bad_handle"===t?n.nonLatinCharacterWarning:n.unknownError}):l.S.resolve(n.hasHandleRequiredWarning));u.meta={name:"validateUserGroupHandle",key:"createThunkValidateUserGroupHandle",description:"Validate user group handle"};let m=u;Object.defineProperty({},"handleErrorStrings",{get:()=>n,set:e=>{n=e}})},0x15e263568:(e,t,a)=>{"use strict";let n,r;a.d(t,{Ay:()=>m});var l=a(0xe874a88a),i=a(0x20482ad21),s=a(0x69509bae),o=a(0x3ed00af5),c=a(0x11c82607b);let d=new i.Ay("user_groups");function initErrorStrings(e){r={hasNameRequiredWarning:d.t("Please enter a name for this group."),hasReservedName:d.t('The name "{name}" is reserved and cannot be used.',{name:e}),hasMaxLengthWarning:d.t("Names can\u2019t be more than {maxLength} characters.",{maxLength:80}),hasNameTakenWarning:d.t("This name is already in use by another group."),unknownError:d.t("Sorry, something went wrong. Please try a different name.")}}function initReservedNames(){n={admins:d.t("Team Admins"),owners:d.t("Team Owners")}}let u=(0,c.Ay)("Validate user group name",async(e,t,{name:a,prevName:i,reason:c,targetTeam:d})=>{if(initErrorStrings(a),initReservedNames(),!a||!a.trim())return l.S.resolve(r.hasNameRequiredWarning);let u=a.toLowerCase().trim();return i&&u===i.toLowerCase().trim()?l.S.resolve(""):u===n.admins.toLowerCase()||u===n.owners.toLowerCase()?l.S.resolve(r.hasReservedName):(0,o.A)(a)>80?l.S.resolve(r.hasMaxLengthWarning):e((0,s.N)({name:a,reason:c,targetTeam:d})).then(()=>"").catch(e=>"name_already_exists"===e?.data?.error?r.hasNameTakenWarning:r.unknownError)});u.meta={name:"validateUserGroupName",key:"createThunkValidateUserGroupName",description:"Validate user group name"};let m=u;Object.defineProperty({},"nameErrorStrings",{get:()=>r,set:e=>{r=e}})},0xccd97fa5:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var n=a(0xbad225b5),r=a(0x16cf1da63),l=a(0x120c268ad),i=a.n(l),s=a(0x20482ad21),o=a(0xdb33a144);let c=new s.Ay("threads");function ThreadSeparatorRowGeneric({replyCount:e=0,separatorType:t="default",clientTheme:a="light",ghost:l=!1,unreadMarkerKey:s,willPulse:d,threadsUnreadDataQa:u="",messageContainerType:m}){let p=(0,r.wA)(),b=Math.max(1,e),f=c.t("{count, plural, =1 {# reply} other {# replies}}",{count:b}),g=c.t("New"),h=i()("p-thread_separator_row_generic",{"p-thread_separator_row_generic--dark":"dark"===a,"p-thread_separator_row_generic--ghost":l}),[_,y]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{let e;return!l&&d&&(y(!0),e=window.setTimeout(()=>{y(!1),p((0,o.S)({unreadMarkerKey:s||"",messageContainerType:m,willPulse:!1}))},600)),()=>{e&&clearTimeout(e)}},[l,d,p,s,m]),n.createElement("div",{className:h},n.createElement("div",{className:"p-threads_flexpane__separator"},n.createElement("span",{className:"p-threads_flexpane__separator_count"},f),"default"===t&&n.createElement("hr",{className:"p-threads_flexpane__separator_line"}),"default"!==t&&n.createElement(n.Fragment,null,n.createElement("hr",{className:i()("p-threads_flexpane__separator_line",`p-threads_flexpane__separator_line__${t}`,{"p-threads_flexpane__separator_line--pulsing":_}),"aria-hidden":"true","data-qa":u}),n.createElement("span",{className:`p-threads_flexpane__${t}_divider__label`},g))))}ThreadSeparatorRowGeneric.displayName="ThreadSeparatorRowGeneric";let d=n.memo(ThreadSeparatorRowGeneric)},0x133aee58f:(e,t,a)=>{"use strict";a.d(t,{A:()=>useGetSelectedSalesforceOrgIdForSearch});var n=a(0x226892387),r=a(0x1c8beab7f);function useGetSelectedSalesforceOrgIdForSearch(e=!1){let t=!!(0,n.d4)(t=>(0,r.DY)(t,e)),a=(0,n.d4)(r.rg),l=(0,n.d4)(r.RC),i=(0,n.d4)(e?r.MH:r.gE);return t?i:e?a:l}},0x10490d62c:(e,t,a)=>{"use strict";a.d(t,{A:()=>useMuteNotification});var n=a(0xbad225b5),r=a(0x16cf1da63),l=a(0x20482ad21),i=a(0x6e87d4ec),s=a(0xe874a88a),o=a(0x22a29f141),c=a(0x1dfdeb1c8),d=a(0x1ec68d6a3),u=a(0xe747dd27);let m=(0,c.A)("salesHome.notifications.mutePrefs.update generated fetcher",(e,t,a)=>new s.S((n,r)=>{let{abortSignal:l,reason:i,...s}=a,c=(0,u.VA)(s);e((0,o.apiCall)({method:"salesHome.notifications.mutePrefs.update",args:c,abortSignal:l,reason:i})).then(e=>{n(e)}).catch(e=>{(0,d.default)({getState:t}).error(`API call to salesHome.notifications.mutePrefs.update
						with reason ${i} failed, initiated by generated fetcher`),r(e)})}));m.meta={name:"salesHomeNotificationsMutePrefsUpdateFetcher",key:"createFetcherSalesHomeNotificationsMutePrefsUpdateFetcher",description:"salesHome.notifications.mutePrefs.update generated fetcher"};var p=a(0x16ffed5ab);let b=new l.Ay("modernselling");function useMuteNotification(){let e=(0,r.wA)(),t=(0,n.useCallback)(t=>{e((0,p.M)({element:n.createElement(i.A,{svgIconProps:{name:"check"}},t?b.t("Notification muted. You\u2019ll stop receiving notifications with these conditions."):b.t("Notification unmuted"))}))},[e]);return(0,n.useCallback)(async(a,n)=>{await e(m({workflowId:a,isMuted:n,reason:"sales-notifications"})),t(n)},[e,t])}useMuteNotification.displayName="useMuteNotification"},0x200c38ed8:(e,t,a)=>{"use strict";a.d(t,{aV:()=>useNotificationsOpportunitySchema,jv:()=>useNotificationsOpportunitySchemaForEndUser,qI:()=>useSalesHomeNotificationsSearcherOptions});var n=a(0xbad225b5),r=a(0x16cf1da63),l=a(0x133aee58f),i=a(0x3d5a0d18),s=a(0x12185e091),o=a(0x1fe613d6e),c=a(0x226892387),d=a(0x4f86f8f5),u=a(0x1c8beab7f),m=a(0x52b05cae),p=a(0x1d104c491);function useNotificationsOpportunitySchema(){return(0,c.d4)(e=>(0,u.Y)(e,p.hd.Opportunity))}function useNotificationsOpportunitySchemaForEndUser(){let e=!!(0,c.d4)(e=>(0,u.DY)(e,!1)),t=(0,l.A)(!1),a=(0,c.d4)(e=>(0,u.vV)(e,p.hd.Opportunity,t)),n=(0,c.d4)(e=>(0,u.oL)(e,p.hd.Opportunity));return e?a:n}function getChannelPermissions(e,t){let a=e?.send_notification_to_channel_permission,n=e?.allow_admins_to_send_to_all_channel_types??!1,r=!0,l=!0,i=e?.allow_slack_connect_channels??!1;if(t&&n)return{shouldIncludePublicChannels:r,shouldIncludePrivateChannels:l,shouldIncludeSlackConnectChannels:i=!0};switch(a){case p.$4.PRIVATE_CHANNELS_ONLY:r=!1;break;case p.$4.NO_CHANNELS:r=!1,l=!1;case p.$4.ALL_CHANNELS:}return{shouldIncludePublicChannels:r,shouldIncludePrivateChannels:l,shouldIncludeSlackConnectChannels:i}}function useSalesHomeNotificationsSearcherOptions(e=""){let[t,a]=(0,n.useState)(!1),l=(0,r.wA)(),p=(0,c.d4)(t=>(0,u.uS)(t,e)),b=(0,c.d4)(o.K),f=p?.allowed_channel_workspaces,{shouldIncludePublicChannels:g,shouldIncludePrivateChannels:h,shouldIncludeSlackConnectChannels:_}=getChannelPermissions(p,b),y=(0,n.useMemo)(()=>({workspaceFilter:{type:d.MR.All},peopleFilter:{type:d.E7.All}}),[]),x=(0,i.J)(y),v=(0,n.useCallback)(e=>!(0,s.jq)(e)||x(e),[x]);return(0,n.useEffect)(()=>{a(!p),e&&!p&&l((0,m.b)({salesforceOrgId:e}))},[e,p,l]),{isFetchingPrefs:t,searcherOptions:(0,n.useMemo)(()=>({entities:{channels:{includeOnlyExternallyShared:_,includePrivate:h,includePublic:g,includeArchived:!1,includeMpims:!1,excludeElmChannels:!0,allowedInternalTeams:f,onlyIfMember:!0},members:!1,userGroups:!1},allowEmptyQuery:!0,limit:100,sort:{frecency:!0,preferChannelsUserBelongsTo:!0,preferExactMatch:!0},filter:v}),[f,_,h,g,v])}}},0x1b7f0cd57:(e,t,a)=>{"use strict";a.d(t,{R:()=>WorkflowAvatar});var n=a(0xbad225b5),r=a(0x120c268ad),l=a.n(r),i=a(0x85512121),s=a(0x710afd12),o=a.n(s);let WorkflowAvatar=class WorkflowAvatar extends n.PureComponent{static defaultProps={size:"medium",hasDecorativeAltTag:!0};render(){let{size:e,className:t,hasDecorativeAltTag:a,iconSrcUrl:r,altText:s}=this.props,c=r;return c||(c=i),n.createElement("img",{alt:a?"":s,className:l()(o().image,o()[e],t),src:c})}};WorkflowAvatar.displayName="WorkflowAvatar"},0x1fc68d76:(e,t,a)=>{"use strict";a.d(t,{_:()=>getWrappedFunctionIds});var n=a(0xe0376d2),r=a(0x1903d373d);let getWrappedFunctionIds=e=>(0,n.A)(e.map(e=>(0,r.lK)(e)).filter(e=>!!e))},0x207b33662:(e,t,a)=>{"use strict";a.d(t,{c:()=>ed});var n=a(0xbad225b5),r=a(0x120c268ad),l=a.n(r),i=a(0x21f3c49e8),s=a(0x2286acf6c),o=a(0x1cbdfeceb),c=a(0x118cdcdea),d=a.n(c),u=a(0x1229d92d),m=a(0x20482ad21),p=a(0x677a139e),b=a(0x1d2cd7755),f=a(0x1e586fbba),g=a(0x2501a2cee),h=a(0x1c2ea7265),_=a(0x235d78b7c),y=a(0x99233ecb),x=a(0x6aeae8a3),v=a(0x1a3c2e1af),E=a(0x222a04717),k=a(0x1c9338be7),S=a(0x1a6afe63b),w=a(0x88881d67),C=a(0xe9c32bb),A=a(0x1e1fc678),T=a(0x3b26a95e),I=a(0x1795d8821),N=a(0x133096d9b),M=a.n(N);let F=new m.Ay("workflow_builder"),getMenuItemDataQa=({source:e,name:t})=>`${e}-${t}`,PlaceholderVariablePopover=({onSelect:e,data:t,customDataFilter:a,tetherElement:r,onClose:l})=>{let i=(0,T.A)(r?.lastElementChild??r),s=F.t("Insert a variable"),o=F.t("Variables allow you to insert data from previous steps into your workflow."),c=F.t("No variables available"),d=(0,S.D)(),u=(0,n.useCallback)(t=>()=>{e(t)},[e]),m=(0,w.PW)(t,a),p=(0,n.useCallback)((e,t)=>n.createElement(y.Dr,{key:e.id,onSelected:u(e),label:n.createElement("div",{className:M().menuItem,"data-qa":getMenuItemDataQa(e)},n.createElement("div",null,n.createElement(C.nB,{element:"span"},n.createElement(k.P,{data:e,isObjectPropertySubmenuItem:t}))))}),[u]),b=(0,n.useCallback)(e=>n.createElement(C.HL,null," ",e," "),[]),f=(0,n.useCallback)(e=>t=>n.createElement(y.Ay,t,n.createElement(y.c$,{label:b(e.label)}),n.createElement(y.bX,{key:`${e.id}-separator`}),e.objectProperties?.map(e=>p(e,!0))),[b,p]),g=(0,n.useCallback)(e=>n.createElement(C.nB,{element:"span"},n.createElement(k.P,{data:e})),[]),h=(0,n.useCallback)(e=>n.createElement(C.HL,{className:M().groupHeaderLabel},e.stepIndex&&`${e.stepIndex}. `,(0,A.k)(e.type)?(0,A.T)(e.type,e.label,e.subtype):e.label),[]),_=(0,n.useMemo)(()=>{let e=[];return 0===m.length||m.forEach(t=>{e.push(n.createElement(y.bX,{key:`${t.id}-separator`}),n.createElement(y.c$,{key:`${t.id}-header`,label:h(t)})),t.data.forEach(t=>{t.type===I.TE.Object&&t.objectProperties?e.push(n.createElement(v.A,{key:t.id,"data-qa":getMenuItemDataQa(t),label:g(t),renderSubmenu:f(t)})):e.push(p(t))})}),e},[m,h,g,f,p]),N=_.length>0,O=(0,n.useMemo)(()=>N?s:c,[s,c,N]),L=(0,n.useMemo)(()=>n.createElement(n.Fragment,null,n.createElement(C.Pd,null,n.createElement(E._,null),n.createElement("span",{className:M().menuTriggerText},O)),n.createElement("div",null,N?o:d)),[O,N,o,d]);return n.createElement(x.AM,{isOpen:!0,position:"bottom-left",targetBounds:i,allowanceX:10,allowanceY:10,offsetY:5,onClose:l},n.createElement(y.Ay,{width:400},n.createElement(y.c$,{label:L}),_))};PlaceholderVariablePopover.displayName="PlaceholderVariablePopover";var O=a(0x13f7d86f3),L=a(0x242c34757),D=a(0x162b19a86),P=a(0x1ba35eb3b),R=a(0x1db69cda),B=a(0x668181b3),W=a(0x1ebe91b72),V=a(0x10a716a94),q=a(0x1b77d8ef3),H=a(0x15bc54ead),U=a(0x2c5a5afa),z=a(0x1f9888e24),j=a(0x1d45db25c),$=a(0x1a4072e61),G=a(0x1cd3157a9),K=a(0x13f30d329),Y=a(0x1242da2eb),Q=a(0x86e5e8cf),Z=a(0x1c91944c9),J=a(0x9b971e7e),X=a(0x8921b4af),ee=a(0x7854dbfe);let et=(0,a(0x11c82607b).Ay)("Message to contents string",(e,t,{text:a,tsfMode:n="EDIT",workflowTokens:r=[]})=>{let l=t();return(0,ee.A)(l,{text:a,tsfMode:n,workflowTokens:r})});et.meta={name:"messageToContentsString",key:"createThunkMessageToContentsString",description:"Message to contents string"};var ea=a(0x852588ab),en=a(0x24429189c),er=a(0x1461e71d1),el=a.n(er);let ei=new m.Ay("workflow_builder"),es=["canvas_update_content","canvas_create","channel_canvas_create"],eo=class extends n.PureComponent{static defaultProps={enableEmoji:!0,errorText:null,initialText:"",initialBlocks:[],enableDynamicData:!1,onBlur:null,onEnter:null,shouldAddNewLineOnEnter:!0,isDisabled:!1,focusOnMount:!1,useBlocks:!1,useLimitedBlocks:!1,formatVariableBeforeInsert:null,canInsertAllVariablesByGroup:!1,experimentUserAuthoredWorkflowPostsFeGroupOn:!1,sendAsUserValue:!1,wfbAiPromptButtons:null};texty;constructor(e){super(e);const{useBlocks:t,useLimitedBlocks:a,initialText:n="",initialBlocks:r=[],data:l,convertTextToContentsObject:o,convertBlocksToDelta:c,prepareMessage:d}=this.props;let u=null;if((t||a)&&!(0,i.A)(r)){const{processedDelta:e}=d({delta:(0,h.G)(r,l.list,c)});u={contents:e}}else u=o({text:n,workflowTokens:l.list});this.state={initialContentsObject:u,hasMissingData:this.checkForMissingData(n),activeTokenData:null,activeTokenVariableData:null,activeTokenIndex:null,activeTokenElement:null,showCustomizeDataPopover:!1},this.onEnter=this.onEnter.bind(this),this.insertDynamicData=this.insertDynamicData.bind(this),this.updateDynamicData=this.updateDynamicData.bind(this),this.onTextChange=this.onTextChange.bind(this),this.onWorkflowTokenClick=this.onWorkflowTokenClick.bind(this),this.hideCustomizeDataPopover=this.hideCustomizeDataPopover.bind(this),this.setTextyRef=this.setTextyRef.bind(this),this.renderErrorBoundary=this.renderErrorBoundary.bind(this),this.getBroadcastKeywords=this.getBroadcastKeywords.bind(this),this.onGroupInsertClick=this.onGroupInsertClick.bind(this),this.customDataFilter=this.customDataFilter.bind(this),this.richTextCustomDataFilter=this.richTextCustomDataFilter.bind(this),this.stringCustomDataFilter=this.stringCustomDataFilter.bind(this),this.handleOnSelectVariable=this.handleOnSelectVariable.bind(this),this.renderWorkflowBuilderEditLinkInput=this.renderWorkflowBuilderEditLinkInput.bind(this),this.renderUrlWithWorkflowBuilderVariable=this.renderUrlWithWorkflowBuilderVariable.bind(this),this.getCursorBlockType=this.getCursorBlockType.bind(this),this.debouncedTextChange=(0,s.A)(this.debouncedTextChange.bind(this),150,{leading:!0}),this.debouncedEnterPressed=(0,s.A)(this.debouncedEnterPressed.bind(this),150,{leading:!0})}componentDidMount(){let{data:e,callbackId:t,initialText:a,initialBlocks:n}=this.props;if(e.groups.length>0){let{id:r,subtype:l}=e.groups[e.groups.length-1],i=!a&&n?.length===0;l===I.oW.OpenForm&&t===I.oW.SendMessage&&i&&this.onGroupInsertClick(r)}}componentDidUpdate(e){if(this.props.sendAsUserValue!==e.sendAsUserValue&&this.props.experimentUserAuthoredWorkflowPostsFeGroupOn){let e,{texty:t}=this,{useBlocks:a,useLimitedBlocks:n,useExpandedRichText:r,cleanMessageText:l,convertTextToContentsObject:i,convertBlocksToDelta:s,convertDeltaToBlocks:o,data:c}=this.props,u=null,m=l({text:t.value(),isInternalMessage:!1});a||n?(e=o({delta:new(d())(this.texty.getContents().contents),useExpandedRichText:r}).blocks,u={contents:(0,h.G)(e,c.list,s)}):u=i({text:m,workflowTokens:c.list}),t.setContents(u);let p=(0,w.j2)(t.value(),c.list);this.setState(()=>({hasMissingData:p}))}}onEnter(e={}){let{shouldAddNewLineOnEnter:t}=this.props;return!0!==e.metaKey&&(!!t||!0===e.shiftKey||(this.debouncedEnterPressed(),!1))}onTextChange(){this.texty&&this.debouncedTextChange()}onWorkflowTokenClick({token:e,element:t,index:a}){let{data:n}=this.props,r=(0,B.x)(n.list,e.id);if(!r){e.isPlaceholder&&this.setState(()=>({activeTokenIndex:a,activeTokenData:e,activeTokenVariableData:null,activeTokenElement:t,showCustomizeDataPopover:!0}));return}let l=(0,w.Jq)(r);this.setState(()=>({activeTokenIndex:a,activeTokenData:e,activeTokenVariableData:l,activeTokenElement:t,showCustomizeDataPopover:!0}))}getBroadcastKeywords(){return(0,j.A)()}setTextyRef(e){this.texty=e,this.onTextChange()}checkForMissingData(e){let{data:t}=this.props;return(0,w.ke)(e,t.list)}debouncedEnterPressed(){let{useBlocks:e,useLimitedBlocks:t,useExpandedRichText:a,onEnter:n,convertDeltaToBlocks:r,cleanMessageText:l,prepareMessage:i}=this.props;if(!this.texty||!n)return;let s=null,o=this.texty.value();if(e||t){let{processedDelta:e}=i({delta:new(d())(this.texty.getContents().contents)});s=r({delta:e,useExpandedRichText:a}).blocks}n({blocks:s,text:l({text:o,isInternalMessage:!1})})}debouncedTextChange(){let{useBlocks:e,useLimitedBlocks:t,useExpandedRichText:a,onTextChange:n,convertDeltaToBlocks:r,cleanMessageText:l,prepareMessage:i}=this.props,s=null,o=this.texty.value();if(e||t){let{processedDelta:e}=i({delta:new(d())(this.texty.getContents().contents)});s=(e=>{if(!e)return[];let t=(0,R.A)(e),a=!1,n=t.map(e=>"rich_text"===e.type&&e.elements?{...e,elements:e.elements.reduce((e,t)=>{if("rich_text_preformatted"!==t.type||!t.elements)return e.push(t),e;let n={...t,elements:t.elements.reduce((e,t)=>{if("workflowtoken"!==t.type)return e.push(t),e;let n={...t};switch(n.data_type){case I.TE.SlackTypesRichText:n.id=`{slack.plain_text(rich_text=${n.id})}`,a=!0;break;case I.TE.SlackTypesLimitedRichText:n.id=`{slack.plain_text(limited_rich_text=${n.id})}`,a=!0;break;case I.TE.SlackTypesUserId:n.id=`{slack.user_display_name(user_id=${n.id})}`,a=!0}return n.data_type="string",e.push(n),e},[])};return e.push(n),e},[])}:e);return a?n:e})(s=r({delta:e,useExpandedRichText:a}).blocks)}let c=this.checkForMissingData(o);this.setState(()=>({hasMissingData:c})),n({text:l({text:o,isInternalMessage:!1}),blocks:s})}hideCustomizeDataPopover(){let e=this.state.activeTokenIndex;this.setState(()=>({activeTokenIndex:null,activeTokenData:null,activeTokenElement:null,showCustomizeDataPopover:!1}));let{quill:t}=this.texty.instance;t.setSelection(e)}getCursorBlockType(){let{quill:e}=this.texty.instance,{index:t}=e.getSelection(!0),a=e.getContents(t);for(let e of a?.ops??[]){if(e.attributes?.["code-block"])return"code-block";if(e.attributes?.blockquote)return"blockquote";if(e.attributes?.list==="ordered")return"ordered";if(e.attributes?.list==="bullet")return"bullet"}return null}insertDynamicData({variable:e,idx:t=0,insertAll:a,currentBlockType:n}){let{formatVariableBeforeInsert:r,interceptVariablesInsertion:l}=this.props;if(!a&&l&&0===l([e]).length)return;let{quill:i}=this.texty.instance,{index:s,length:o}=i.getSelection(!0),c=new(d())().retain(s);o>0&&i.deleteText(s,o,"user");let u=r?.(e,{isRichText:!0})??e;a&&e.prependLabel&&c.insert(`${e.prependLabel}
`,{bold:!0});let m=(0,w.Jq)(u);if(c.insert({workflowtoken:{id:m.id,type:(0,G.Z)(m.id,u.type),label:m.label,sourceLabel:m.sourceLabel,isAvailable:m.isAvailable,variableData:m}},{bold:!1}),a)switch(n){case"ordered":case"bullet":c.retain(1,{list:n}).insert(`
`);break;case"blockquote":case"code-block":c.retain(1,{[n]:!0}).insert(`
`);break;default:c.insert(`
`)}i.updateContents(c),i.setSelection(c.length()),u.type===I.TE.SlackTypesRichText||u.type===I.TE.SlackTypesLimitedRichText||u.type===I.TE.SlackTypesExpandedRichText?i.setSelection({index:i.getLength(),length:0}):0!==t&&c.insert(`
`)}customDataFilter(e,t){let{callbackId:a}=this.props;return!("message_link"===t.name&&a&&es.includes(a))&&(e?(0,P.SA)(t,a)||(0,P.xY)({variable:t,parameter:{type:I.TE.SlackTypesRichText,name:"rich_text_input"}}):(0,P.qO)(t,a)||(0,P.xY)({variable:t,parameter:{type:I.TE.String,name:"plain_text_input"}}))}richTextCustomDataFilter(e){return this.customDataFilter(!0,e)}stringCustomDataFilter(e){return this.customDataFilter(!1,e)}onGroupInsertClick(e,t){let{data:a,interceptVariablesInsertion:n}=this.props,r=a.groups.find(t=>t.id===e),l=r?.data.filter(this.richTextCustomDataFilter),{quill:i}=this.texty.instance,{index:s,length:o}=i.getSelection(!0);o>0&&i.deleteText(s,o,"user");let c=l;n&&l&&(c=n(l));let d=c&&r?.subtype===I.oW.OpenForm;d&&t?c=c?.filter(e=>!(0,Q.q)(e.id)):d&&(c=c?.filter(e=>!!(0,Q.q)(e.id)));let u=this.getCursorBlockType();c?.forEach((e,t)=>{e.type===I.TE.Object?e.objectProperties?.filter(this.richTextCustomDataFilter).forEach((e,t)=>this.insertDynamicData({variable:e,idx:t,insertAll:!0,currentBlockType:u})):this.insertDynamicData({variable:e,idx:t,insertAll:!0,currentBlockType:u})})}updateDynamicData({dataItem:e,property:t,propertyUpdated:a}){let n,{texty:r}=this,{quill:l}=r.instance,{activeTokenIndex:i}=this.state,{useBlocks:s,useLimitedBlocks:o,useExpandedRichText:c,cleanMessageText:u,convertTextToContentsObject:m,convertBlocksToDelta:p,convertDeltaToBlocks:b,data:f,onTextChange:g}=this.props;a&&(l.deleteText(i,1,"user"),l.insertEmbed(i,"workflowtoken",{id:e.id,type:e.type,label:e.label,sourceLabel:e.sourceLabel,isAvailable:e.isAvailable,property:t,variableData:e},"user"));let _=null,y=u({text:r.value(),isInternalMessage:!1});s||o?(n=b({delta:new(d())(this.texty.getContents().contents),useExpandedRichText:c}).blocks,_={contents:(0,h.G)(n,f.list,p)}):_=m({text:y,workflowTokens:f.list}),r.setContents(_),null!==i&&r.instance.setSelection(i+1,0,"silent"),g({text:y,blocks:n}),this.hideCustomizeDataPopover()}handleOnSelectVariable(e){return this.insertDynamicData({variable:e})}renderErrorBoundary(){return n.createElement("div",null,n.createElement(f.A,null,ei.t("Something went wrong")))}renderWorkflowBuilderEditLinkInput({id:e,onChange:t,url:a="",ariaLabel:r,focusUrlOnMount:l}){let{data:i,enableDynamicData:s=!0,formatVariableBeforeInsert:c,onVariableMenuOpen:d}=this.props;return n.createElement(b.A,{text:ei.t("Link",{fallbackHash:"d0517071aa376e797705058bbad4b658954b9930",fallbackHashNs:"message-input"}),htmlFor:"composer-link-modal-url",id:e,className:"p-composer_edit_link_popover__builder_texty","data-qa":"composer-link-modal-label"},n.createElement(L.A,{id:e,initialText:String(a),variables:i,allowVariables:s,ariaLabel:r,shouldAddNewLineOnEnter:!1,onTextChange:({text:e})=>{t("url",(0,D.cY)(e))},formatVariableBeforeInsert:(e,t)=>{if(e.type===z.W.SlackTypesRichText||e.type===z.W.SlackTypesLimitedRichText){let t=e.type===z.W.SlackTypesLimitedRichText;return{...e,id:`{slack.plain_text(${t?"limited_":""}rich_text=${e.id})}`}}return c?.(e,t)??e},onBlur:o.A,customDataFilter:this.stringCustomDataFilter,renderDataMenuLocation:"inline",onVariableMenuOpen:d,focusOnMount:l}))}renderUrlWithWorkflowBuilderVariable(e){let{data:t}=this.props,a=(0,$.t)([(0,W.Mx)(),(0,W.cL)(),(0,W.fE)()],"gi"),r=(e||"").match(a);if(null===r)return e||null;let{result:l}=r.reduce((e,t,a)=>{let[n,l]=(e.url||"").split(t);return e.url=l,n&&e.result.push(n),e.result.push(t),a===r.length-1&&e.url&&e.result.push(e.url),e},{url:e,result:[]});function renderLinkElement(e,r){if(e.match(a)){let a=t.list,[l]=(0,K.A)(e,a)?.contents||[],i=(0,Y.Ay)(l)&&l.insert.workflowtoken.variableData,s=i&&(0,O.L4)(i)?i.label:ei.t("Missing Data");return n.createElement("span",{className:el().variable_container,key:r},n.createElement(g.Ah,{inline:!0,name:"css"})," ",s)}return n.createElement("span",{key:r},e)}return renderLinkElement.displayName="renderLinkElement",n.createElement(n.Fragment,null,l.map((e,t)=>renderLinkElement(e,t)))}render(){let{initialContentsObject:e,hasMissingData:t,showCustomizeDataPopover:a,activeTokenData:r,activeTokenVariableData:i,activeTokenElement:s}=this.state,{enableDynamicData:o,enableEmoji:c,data:d,errorText:u,isDisabled:m,isSingleLine:b,focusOnMount:g,teamId:h,useBlocks:y,useLimitedBlocks:x,canInsertAllVariablesByGroup:v,callbackId:E,hint:k,getVariableCustomizeMenu:S,onVariableMenuOpen:C,useExpandedRichText:A,wfbAiPromptButtons:T,excludePrivateChannelAutocomplete:I,privateChannelTeamIds:N,...M}=this.props;T&&(T.insertVariableButton=n.createElement(_.jx,{key:"dynamic-data-menu",onGroupInsertClick:this.onGroupInsertClick,onSelect:this.handleOnSelectVariable,data:d.groups,canInsertAllVariablesByGroup:v,customDataFilter:this.richTextCustomDataFilter,onMenuTriggerClick:C,renderIconInside:!0,iconSize:"18",className:el().inputToolbarVariablesButton}));let F=t||u&&u.length>0,O=ei.t("There is a missing data reference."),L=(0,w.hM)(d.groups).length>0,D=`${M.id}_errorMessage`,P=n.createElement(U.A,{...M,includeAllBroadcastKeywords:!0,ariaDescribedBy:D,ariaInvalid:!!F,completeOnMembers:!0,completeOnChannels:!b,completeOnEmoji:!0,position:"bottom",forcePlainTextModeDisabled:y||x,focusOnMount:g,enableBroadcastKeywords:!0,maxLines:b?1:8,initialText:e||void 0,isSingleLine:b,workflowTokens:d.list,ref:this.setTextyRef,onTextChange:this.onTextChange,isDisabled:m,onEnter:this.onEnter,useWysiwyg:y||x,useWorkflowTokens:!0,useExpandedRichText:!b&&A,workflowTokenClick:this.onWorkflowTokenClick,getBroadcastKeywords:this.getBroadcastKeywords,"data-qa":"builder-texty__input",renderWorkflowBuilderEditLinkInput:this.renderWorkflowBuilderEditLinkInput,renderUrlWithWorkflowBuilderVariable:this.renderUrlWithWorkflowBuilderVariable,disableSlugging:!0,excludePrivateChannelAutocomplete:I,privateChannelTeamIds:N});P=c?n.createElement(H.A,{className:l()("normal",{margin_bottom_150:!L}),enableEmojiButton:!m,enableComposerButton:!m&&y,isDisabled:m,isInvalid:!!F,numMaxLines:b?1:8,numMinLines:b?1:void 0,forcePlainTextModeDisabled:y||x,withWorkflowTokens:!0,useExpandedRichText:A,withBasicContainerBorder:!0,forceToolbarDisabled:!y||x,renderWorkflowBuilderEditLinkInput:this.renderWorkflowBuilderEditLinkInput,wfbAiPromptButtons:T},P):n.createElement(q.A,{className:l()("normal",{margin_bottom_150:!L}),isDisabled:m,isInvalid:!!F},P);let handlePlaceholderReplace=e=>{this.updateDynamicData({dataItem:(0,w.Jq)(e),propertyUpdated:!0})},maybeRenderCustomizeMenu=()=>!m&&a&&r&&s?r.isPlaceholder?n.createElement(PlaceholderVariablePopover,{onSelect:handlePlaceholderReplace,data:d.groups,customDataFilter:this.richTextCustomDataFilter,tetherElement:s,onClose:this.hideCustomizeDataPopover}):i?S({activeTokenElement:s,activeTokenData:r,activeTokenVariableData:i,hideCustomizeDataPopover:this.hideCustomizeDataPopover,updateDynamicData:this.updateDynamicData}):null:null;maybeRenderCustomizeMenu.displayName="maybeRenderCustomizeMenu";let maybeRenderFiles=()=>this.props.renderFiles?this.props.renderFiles():null;return n.createElement(V.A,{subtype:"builder_texty",renderError:this.renderErrorBoundary},P,maybeRenderFiles(),k&&n.createElement(p.A,{className:"margin_bottom_0"},k),n.createElement("div",{className:"display_flex justify_content_between position_relative"},n.createElement("div",null,F&&n.createElement(f.A,{id:D,className:"margin_bottom_0"},t?O:u)),o&&!m&&!T?.insertVariableButton&&L&&n.createElement("div",{className:"margin_top_50"},n.createElement(_.jx,{onGroupInsertClick:this.onGroupInsertClick,onSelect:this.handleOnSelectVariable,data:d.groups,canInsertAllVariablesByGroup:v,customDataFilter:this.richTextCustomDataFilter,onMenuTriggerClick:C})),maybeRenderCustomizeMenu()))}};eo.displayName="_BuilderTexty";let ec={convertDeltaToBlocks:en.y,convertBlocksToDelta:en.f,convertTextToContentsObject:et,cleanMessageText:X.T,prepareMessage:ea.n},ed=(0,Z.N)(e=>({teamId:(0,J.ZT)(e)}),ec)((0,u.A)(eo))},0x1c2ea7265:(e,t,a)=>{"use strict";a.d(t,{G:()=>convertBlocksToDeltaWithMergedMetadata,Q:()=>getVariableSourceIdsInBlock});var n=a(0x125763ad),r=a(0x88881d67),l=a(0x668181b3),i=a(0x1242da2eb);function convertBlocksToDeltaWithMergedMetadata(e,t,a){let s=a({blocks:e});return s.ops=s.ops.map(e=>{if((0,i.Ay)(e)){let a=e.insert.workflowtoken,i=(0,l.x)(t,a.id);if(!i){let t=a.isPlaceholder?(0,r.sx)({id:a.id,placeholderLabel:a.label,sourceLabel:a.sourceLabel}):(0,r.Mu)({id:a.id,type:a.type,sourceLabel:a.sourceLabel});return(0,n.A)({},e,{insert:{workflowtoken:t}})}let s=(0,r.Jq)(i);return(0,n.A)({},e,{insert:{workflowtoken:{...a,variableData:s}}})}return e}),s}function getVariableSourceIdsInBlock(e,t,a){return a({blocks:e}).ops.filter(e=>(0,i.Ay)(e)).map(e=>{if((0,i.Ay)(e)){let a=e.insert.workflowtoken,n=(0,l.x)(t,a?.id);return n?n.source_id:""}return""})}},0x1576dac7:(e,t,a)=>{"use strict";a.d(t,{I:()=>DynamicDataCustomizeMenuV2});var n=a(0xbad225b5),r=a(0x21f3c49e8),l=a(0x1cbdfeceb),i=a(0x1b63e435a),s=a.n(i),o=a(0x20482ad21),c=a(0x99233ecb),d=a(0x133aaa7da),u=a(0x6aeae8a3),m=a(0x1a3c2e1af),p=a(0x91728dda),b=a(0x88881d67),f=a(0x3b26a95e),g=a(0x21c50a68b),h=a(0x145d46a61),_=a(0x1795d8821),y=a(0x223ac29bb),x=a(0x1cd3157a9),v=a(0x161a994e6),E=a(0x192814923),k=a(0x158cf1cb),S=a(0x1840248cf),w=a(0x25054cb9f),C=a(0x2241421be),A=a(0x1ccef1c6f),T=a(0x226892387),I=a(0x1de687e0f),N=a.n(I);let M=new o.Ay("workflow_builder"),F=new Set([_.Zk.AddSpreadsheetRow,_.Zk.DeleteSpreadsheetRow,_.Zk.UpdateSpreadsheetRow,_.Zk.SelectSpreadsheetRow]),O=["utcDate","utcFull","utcCompact","utcCompactMinuteAccuracy","localDate","localFull","localCompact","localCompactMinuteAccuracy"],L=[...O,"localSortableDate","dateTimeLocal","internationalDateLocal","canvasDate"],DynamicDataCustomizeMenuV2=({tetherElement:e,onClose:t,tokenData:a,variableData:i,updateDynamicData:o,fromRichText:_,callbackId:I})=>{let[D,P]=(0,n.useState)(a.id),R=(0,f.A)(e?.lastElementChild??e),B=(0,T.d4)(h.tQ),W=(0,T.d4)(p.R5),V=(0,T.d4)(e=>(0,A.ty)(e,"tz")),q=V&&s().tz(V).zoneAbbr(),H=(0,g.JK)(),U=(0,y.Dh)();Object.entries(U).forEach(([e,t])=>{U[e.toLowerCase()]=t});let z=U[H],j=(0,n.useMemo)(()=>(0,C.KC)(D),[D]),$=(0,n.useCallback)(({id:e,type:t})=>()=>{o({dataItem:{...i,id:e,type:t},propertyUpdated:!0}),P(e)},[o,i]),G=(0,n.useCallback)(({formatPreview:e,myLocaleLabel:t,myTimezoneAbbr:a,savedLocale:r,savedTimezoneAbbr:l,wrappedId:s})=>()=>{let o=(0,x.Z)(s,i.type),d=M.t("Update to match my Slack settings:"),u=M.t("Update to match my Slack language,"),m=l?d:u,p=l?`${a}, `:"",b=M.t("Format:"),f=M.t("Timezone:"),g=M.t("Language:");return n.createElement(c.Ay,null,n.createElement(c.c$,{label:n.createElement(n.Fragment,null,n.createElement("div",null,n.createElement("span",{className:"bold"},b)," ",e),l&&n.createElement("div",null,n.createElement("span",{className:"bold"},f)," ",l),r&&n.createElement("div",null,n.createElement("span",{className:"bold"},g," "),U[r]))}),n.createElement(c.bX,{key:"change-localization-separator"}),n.createElement(c.Dr,{key:"change-timezone-and-language",label:`${m} ${p}${t}`,onSelected:$({id:s,type:o})}))},[U,$,i]),K=M.t("Select another format"),Y=M.t("Unknown format"),Q=(0,n.useMemo)(()=>(0,w.zz)({callbackId:I,fromRichText:_,type:i.type,arrayItemType:i.items?.type,variableId:D,supplementalType:i.supplementalType,isCanvasLiveDataFieldsTemplatesEnabled:W}),[I,D,_,i.items?.type,i.type,i.supplementalType,W]),Z=(0,n.useMemo)(()=>(0,E.z)(a,i),[a,i]),J=(0,n.useMemo)(()=>Q&&!(0,r.A)(Q)&&!Object.values(Q).every(e=>e.shouldHideFromUi?.({})||e.isDeprecated?.({})),[Q]),X=(0,n.useMemo)(()=>{let t=(0,S.z)(D);if(!J)return n.createElement(c.Dr,{label:M.t("Update this variable"),onSelected:$({id:t,type:i.type}),type:d.A.radio});let a=!1,r=Object.entries(Q??{}).map(([r,{getLabel:o,getExample:u,isDeprecated:p,shouldHideFromUi:f,wrapWithMacro:g}])=>{let h,y,E={fromRichText:_,callbackId:I},k=L.includes(r),S=O.includes(r);k&&(E.timezone=y=(0,w.C8)(D)),S&&(E.locale=h=(0,w.CE)(D));let A=g(t,E);j?.length&&(A=(0,C.uE)(A,j));let T=Z&&D===A;if(T&&(a=!0),"qualified_emoji"===r&&!F.has(I))return null;(k||S)&&(A=g(t,{fromRichText:_,callbackId:I,locale:H,timezone:V}));let N=(0,x.Z)(A,i.type);if((0,b.Sg)(e)&&("string"!==N||"emoji"===r))return null;let M={timezone:T&&k?y:V,locale:T&&S?h:H,experimentWfbBackToBasicsEclairReleaseGroupOn:B},P=!!p?.(M),R=o(M);return!P&&T&&(y&&y!==V||h&&h!==H)?n.createElement(m.A,{key:R,label:R,renderSubmenu:G({formatPreview:u(M),myLocale:H,myLocaleLabel:z,myTimezoneAbbr:q,savedLocale:h,savedTimezoneAbbr:y&&((0,v.o)(y)?y:s().tz(y).zoneAbbr()),wrappedId:A}),type:d.A.radio,checked:!0}):P&&!T||f?.(M)?null:n.createElement(c.Dr,{key:R,label:R,shortcut:u(M),onSelected:P?l.A:$({id:A,type:N}),type:d.A.radio,checked:T})}).filter(e=>null!==e);return D&&!a&&r.unshift(n.createElement(c.Dr,{key:"unknown_option",label:Y,shortcut:K,onSelected:l.A,type:d.A.radio,checked:!0})),r},[D,j,J,Q,$,i.type,_,I,Z,e,V,H,K,G,z,q,Y,B]);if(null===X||Array.isArray(X)&&0===X.length)return null;let ee=!J&&!Z,et=M.t("Select variable display option"),ea=k.pn[i.type]?.()??et,en="slack#/types/timestamp"===i.type?n.createElement(n.Fragment,null,n.createElement("div",{className:"bold"},ea),q&&n.createElement("div",null,`${M.t("Local options use your timezone,")} ${q}`)):ea;return n.createElement(u.AM,{isOpen:!0,position:"bottom-left",targetBounds:R,allowanceX:10,allowanceY:10,offsetY:5,onClose:t},n.createElement("div",{className:N().dynamic_data_display_options_container},n.createElement(c.Ay,null,!ee&&n.createElement(c.c$,{label:en}),X)))};DynamicDataCustomizeMenuV2.displayName="DynamicDataCustomizeMenuV2"},0x235d78b7c:(e,t,a)=>{"use strict";a.d(t,{jx:()=>DynamicDataMenu});var n=a(0xbad225b5),r=a(0x120c268ad),l=a.n(r),i=a(0x1cbdfeceb),s=a(0x9e671ad),o=a(0x20482ad21),c=a(0x210cf696f),d=a(0x99233ecb),u=a(0x2ab73abf),m=a(0x1a3c2e1af),p=a(0x2501a2cee),b=a(0x4c96e5d9),f=a(0x222a04717),g=a(0x1c9338be7),h=a(0x1a6afe63b),_=a(0x88881d67),y=a(0xe9c32bb),x=a(0x1e1fc678),v=a(0x668181b3),E=a(0x1ebe91b72),k=a(0x145d46a61),S=a(0x1795d8821),w=a(0x226892387),C=a(0x133096d9b),A=a.n(C);let T=new o.Ay("workflow_builder"),I=["external","service"],getMenuItemDataQa=({source:e,name:t})=>`${e}-${t}`,getGroupMenuItemDataQa=({id:e},t)=>t?`${e}_function_outputs`:e,DynamicDataMenu=({data:e,onSelect:t,canInsertAllVariablesByGroup:a,onGroupInsertClick:r=i.A,renderIconInside:o=!1,renderIconInline:C=!1,customDataFilter:N,isDisabled:M=!1,onMenuTriggerClick:F,inputType:O,allowEmptyState:L,hasDependentField:D,className:P,suggestedVariableConfig:R={enable:!1},value:B,iconSize:W="20"})=>{let V=(0,w.d4)(k.sQ),q=O===S.TE.SlackTypesSalesforceRecordId,H=T.t("Suggested variables"),U=T.t("Insert a variable"),z=T.t("Variables allow you to insert data from previous steps into your workflow."),j=T.t("This field dynamically populates additional fields based on your choice, so variables are not available."),$=D?T.t("Variables not allowed"):T.t("No variables available"),G=(0,h.D)(O),K=D?j:G,[Y,Q]=(0,n.useState)(!1),Z=(0,n.useCallback)(()=>{Q(!0)},[]),J=(0,n.useCallback)(()=>{Q(!1),F()},[F]),X=(0,n.useCallback)(()=>n.createElement(n.Fragment,{key:"see-all-variables-fragment"},n.createElement(d.bX,{key:"see-all-variables-separator"}),n.createElement(d.Dr,{key:"see-all-variables",label:T.t("See all variables"),link:!0,onSelected:Z})),[Z]),ee=(0,n.useCallback)(e=>()=>{q?(t(e),(0,u.K7)()):t(e)},[q,t]),et=(0,n.useCallback)((e,t)=>()=>r(e,t),[r]),ea=(0,n.useMemo)(()=>({...R,type:R?.type??O}),[O,R]),en=(0,_.PW)(e,N),er=(0,_.k4)(en,ea),el=(0,n.useMemo)(()=>(Array.isArray(B)?B:[B]).some(e=>{if("string"!=typeof e)return!1;let t=e.match((0,E.cL)());return t?.some(e=>{let t=!!(0,v.x)(en.flatMap(e=>e.data),e),a=!!(0,v.x)(er.flatMap(e=>e.data),e);return t&&!a})}),[en,er,B]),ei=(0,n.useMemo)(()=>!el&&!Y&&!(0,s.A)(en,er)&&!(er.length<1),[Y,en,el,er]),es=(0,n.useCallback)((e,t)=>n.createElement(d.Dr,{key:e.id,onSelected:ee(e),label:n.createElement("div",{className:A().menuItem,"data-qa":getMenuItemDataQa(e)},n.createElement("div",null,n.createElement(y.nB,{element:"span"},n.createElement(g.P,{data:e,isObjectPropertySubmenuItem:t}),V&&e.disabledReason&&n.createElement(y.HL,{element:"span"}," (",e.disabledReason,")")))),disabled:e.isDisabled}),[ee,V]),eo=(0,n.useCallback)((e,t)=>{let a="function"!==e.type||e.subtype!==S.oW.OpenForm||t?T.t("Insert all data"):T.t("Insert all form responses");return n.createElement("div",{className:A().menuItem,"data-qa":getGroupMenuItemDataQa(e,t)},n.createElement(y.nB,{element:"span"},n.createElement("span",null,a)))},[]),ec=(0,n.useCallback)((e,t)=>n.createElement(d.Dr,{key:getGroupMenuItemDataQa(e,t),onSelected:et(e.id,t),label:eo(e,t)}),[et,eo]),ed=(0,n.useCallback)(e=>n.createElement(y.HL,null," ",e," "),[]),eu=(0,n.useCallback)(e=>t=>e.objectProperties?n.createElement(d.Ay,t,n.createElement(d.c$,{label:ed(e.label)}),n.createElement(d.bX,{key:`${e.id}-separator`}),e.objectProperties.map(e=>es(e,!0))):null,[ed,es]),em=(0,n.useCallback)(e=>n.createElement(y.nB,{element:"span"},n.createElement(g.P,{data:e})),[]),ep=(0,n.useCallback)(e=>n.createElement(y.HL,{className:A().groupHeaderLabel},e.stepIndex&&`${e.stepIndex}. `,(0,x.k)(e.type)?(0,x.T)(e.type,e.label,e.subtype):e.label),[]),eb=(0,n.useMemo)(()=>{let e=[];return 0===en.length||((q&&ei?er:en).forEach(t=>{e.push(n.createElement(d.bX,{key:`${t.id}-separator`}),n.createElement(d.c$,{key:`${t.id}-header`,label:ep(t)}));let r="function"===t.type&&t.subtype===S.oW.OpenForm,l=!1,i=r?t.data.filter(({id:e})=>!!e.includes(".fields.")).length:0,s=(i||t.data.length)>=3;a&&s&&!I.includes(t.type)&&e.push(ec(t));let o=t.data.some(e=>e.id.includes(".fields."));t.data.forEach(s=>{if(s.type===S.TE.Object&&s.objectProperties)e.push(n.createElement(m.A,{key:s.id,"data-qa":getMenuItemDataQa(s),label:em(s),renderSubmenu:eu(s)}));else{if(r&&!l&&!s.id.includes(".fields.")){o&&e.push(n.createElement("div",{className:A().variableTypeSeparator,key:`${t.id}-separator-nonfield-container`},n.createElement(d.bX,{key:`${t.id}-separator-nonfield`})));let r=t.data.length-i;a&&r>=3&&!I.includes(t.type)&&e.push(ec(t,!0)),l=!0}e.push(es(s))}})}),ei&&q&&e.push(X())),e},[en,q,ei,er,ep,a,ec,em,eu,es,X]),ef=eb.length>0&&!D,eg=(0,n.useMemo)(()=>q?ef?ei?H:U:$:ef?U:$,[q,ei,U,$,ef,H]),eh=(0,n.useMemo)(()=>n.createElement(n.Fragment,null,n.createElement(y.Pd,null,n.createElement(f._,null),n.createElement("span",{className:A().menuTriggerText},eg)),n.createElement("div",null,ef?z:K)),[eg,ef,z,K]),e_=(0,n.useCallback)(e=>n.createElement("div",{className:A().variablesMenuContainer},n.createElement(d.Ay,{...e,"data-qa":"variables-dropdown-menu"},n.createElement(d.c$,{label:eh}),ef?eb:[])),[eh,ef,eb]);return ef||L?n.createElement(d.cQ,{renderMenu:e_,position:"bottom-right",offsetX:0,onClick:J,isDisabled:M,closeOnSelect:!q},n.createElement(b.Ay,{tip:U,position:"top",offsetY:-7,delay:500,zIndex:"above_fs"},n.createElement(c.A,{className:l()(P,{[A().menuTriggerButtonIconOnly]:o,[A().menuTriggerButton]:!o,[A().menuTriggerButtonDisable]:!ef}),"aria-label":U,"data-qa":"variables-dropdown-trigger"},n.createElement(p.Ah,{name:"css",size:o||C?W:void 0,inline:!0}),o||C?null:n.createElement("span",{className:A().menuTriggerText},U)))):null};DynamicDataMenu.displayName="DynamicDataMenu"},0x380ee7b0:(e,t,a)=>{"use strict";a.d(t,{P:()=>VariableSelect});var n=a(0xbad225b5),r=a(0x120c268ad),l=a.n(r),i=a(0x20482ad21),s=a(0x15dd8a31),o=a(0x6b359530),c=a(0x88881d67),d=a(0x1c09d8c36),u=a(0x668181b3),m=a(0x2772625d),p=a(0x1d62f3e69),b=a(0x1795d8821),f=a(0xebf2b1aa),g=a.n(f);let h=new i.Ay("workflow_builder"),VariableSelect=({onChange:e,variables:t,value:a,customDataFilter:r,label:i,isDisabled:f=!1,formatVariableBeforeInsert:_,parameterType:y})=>{let x=(0,n.useMemo)(()=>(0,c.PW)(t.groups,r).reduce((e,t)=>{let a=t.data.reduce((e,t)=>(e.push({value:t.id,label:t.label,data:t}),e),[]),n=t.label;return t.stepIndex&&(n=`${t.stepIndex}. ${n}`),e.push({label:n,options:a,type:"group"}),e},[]),[t,r]),v=(0,n.useMemo)(()=>{if(!a)return null;let e=(0,u.x)(t.list,a);if(!e&&a&&(0,m.cn)(a))e=(0,p.x7)(a,b.TE.SlackTypesUserId);else if(!e)return null;return{value:e.id,label:e.label,data:e}},[t.list,a]),E=(0,n.useCallback)(()=>v?.data?.label?n.createElement(o.R,{data:v.data,size:"medium"}):v?.label,[v]),k=(0,n.useCallback)(({value:a})=>{if("string"==typeof a){let n=(0,u.x)(t.list,a);if(n&&_&&y)return void e(_(n,{parameterType:y}).id)}e(a)},[_,e,y,t.list]);return n.createElement("div",{className:l()({[g().has_errors]:v?.data?.isAvailable===!1})},n.createElement(s.A,{width:"auto",options:x,selectedOption:v,onOptionSelected:k,ariaLabel:i??h.t("Select a variable"),renderSelectedOption:E,isRequired:!1,isDisabled:f,minOptionsListWidth:d.XK}))};VariableSelect.displayName="VariableSelect"},0x1a6afe63b:(e,t,a)=>{"use strict";a.d(t,{D:()=>useEmptyStateMessage});var n=a(0x20482ad21),r=a(0x1795d8821);let l=new n.Ay("workflow_builder"),useEmptyStateMessage=e=>{switch(e){case r.TE.Boolean:return l.t("The field only allows boolean values. If boolean values are added to earlier steps, they\u2019ll appear here.");case r.TE.Integer:return l.t("The field only allows whole numbers. If whole number values are added to earlier steps, they\u2019ll appear here.");case r.TE.Number:return l.t("The field only allows numbers. If number values are added to earlier steps, they\u2019ll appear here.");case r.TE.SlackTypesDate:return l.t("The field only allows dates. If date values are added to earlier steps, they\u2019ll appear here.");case r.TE.String:return l.t("The field only allows strings. If string values are added to earlier steps, they\u2019ll appear here.");default:return l.t("No variables for this field type available. If compatible variables are added to earlier steps, they\u2019ll appear here.")}}},0x13262fc8e:(e,t,a)=>{"use strict";a.d(t,{D:()=>b});var n=a(0xbad225b5),r=a(0x20482ad21),l=a(0x1d2cd7755),i=a(0x126f22530),s=a(0xf6b2f43b),o=a(0xd0fb5338),c=a(0xabd92c55),d=a(0x1d1437423),u=a(0x226892387),m=a(0x14149c126);let p=new r.Ay("workflow_builder"),b=(0,n.memo)(({segment:e,onChange:t})=>{let a="on"===(0,u.d4)(e=>(0,m._Z)(e,"wfb_open_form_ui_improvements")),r=(0,s.u)(),b=(0,o.F$)(e),f=(0,o.$o)(e),g=p.t("The form title can\u2019t have more than {maxCharacterLimit, plural, =1 {# character} other {# characters}}.",{maxCharacterLimit:f}),h=p.t("Please add a title for this form."),_=(0,n.useMemo)(()=>(0,c.N8)({dialogTitle:b,maxLength:f}),[b,f]),y=(0,n.useMemo)(()=>_||0!==b.length?g:h,[_,b,g,h]),{onChange:x,errorText:v,okayToDisplay:E}=(0,d.x)({errorMessage:y,isErrored:!_,shouldErrorPreventSave:!0}),k=(0,n.useCallback)(e=>(x(),t(e)),[t,x]);return n.createElement(l.A,{htmlFor:"dialog-title",text:a?p.t("Form title"):p.t("Title"),className:"margin_bottom_125"},n.createElement(i.A,{id:"dialog-title",value:b,onChange:k,name:"dialog-title",maxCharacterLimit:f,emojisShouldCountAsSingleCharacter:!0,placeholder:p.t("Ex: Request Form"),errorText:v,showError:E,isRequired:!0,isDisabled:r,autoComplete:"off",spellCheck:!0,"data-qa":"dialog-title__input",useInlineAlert:!0,className:"margin_bottom_0"}))})},0x1c0b91ebb:(e,t,a)=>{"use strict";a.d(t,{v:()=>getQuestionTypeLabelAndIcon});var n=a(0x20482ad21),r=a(0x38bda683);let l=new n.Ay("workflow_builder"),getQuestionTypeLabelAndIcon=e=>({[r.xi.ShortText]:{label:l.t("Short answer",{fallbackHash:"a280b11de85237c46b8552f5bbb13431e922879a"}),icon:"text"},[r.xi.LongText]:{label:l.t("Paragraph"),icon:"text-snippet"},[r.xi.RichText]:{label:l.t("Rich text composer"),icon:"text-snippet"},[r.xi.Dropdown]:{label:l.t("Dropdown"),icon:"caret-dropdown"},[r.xi.StaticMultiSelect]:{label:l.t("Multiple choice"),icon:"radio-button"},[r.xi.StaticMultiSelectWithCheckboxes]:{label:l.t("Checkboxes"),icon:"checkbox"},[r.xi.Boolean]:{label:l.t("Radio Buttons",{fallbackHash:"bcd9a86f8a8742ffb39d556d80ce1ea4b578ab19"}),icon:"radio-button"},[r.xi.File]:{label:l.t("File upload"),icon:"file-upload"},[r.xi.SelectPerson]:{label:l.t("Slack user"),icon:"user"},[r.xi.UserMultiSelect]:{label:l.t("Multiple Slack users"),icon:"user-groups"},[r.xi.SelectChannel]:{label:l.t("Slack channel"),icon:"channel"},[r.xi.ChannelMultiSelect]:{label:l.t("Multiple Slack channels"),icon:"channel"},[r.xi.Date]:{label:l.t("Date"),icon:"calendar"},[r.xi.DateTime]:{label:l.t("Date / time"),icon:"calendar"},[r.xi.Number]:{label:l.t("Number"),icon:"number"}})[e]},0x93d35cfe:(e,t,a)=>{"use strict";a.d(t,{Y:()=>MessagePreview});var n=a(0xbad225b5),r=a(0x120c268ad),l=a.n(r),i=a(0x20482ad21),s=a(0x2501a2cee),o=a(0xccd97fa5),c=a(0x1b7f0cd57),d=a(0x668181b3),u=a(0x1ebe91b72),m=a(0x231441bf2),p=a(0x1795d8821),b=a(0x113cdbbd7),f=a(0x1991a9b6d),g=a(0xf1cb9c30),h=a(0x150f8d9c),_=a(0x6792c5b4),y=a(0x1bf20af7f),x=a(0xf271ff9b),v=a(0x1269e55c8),E=a(0x226892387),k=a(0x1fb2d2a87),S=a(0x73cfdc00),w=a.n(S);let C=new i.Ay("workflow_builder"),MessagePreview=({blocks:e,dataList:t,isThread:a,isPinned:r,workflowIcon:i,workflowName:S,workflowId:A,isEditor:T})=>{let I=(0,n.useMemo)(()=>({__meta__:{lastUpdatedTs:""},type:"message",ts:"0",channel:"WFB_MESSAGE_PREVIEW",subtype:"",blocks:e}),[e]),N=(0,n.useMemo)(()=>({item:e,getDefaultOutput:a})=>{if(e.type||!e.text)return a();let r=[],{text:l}=e,i=0;return(l.replace((0,u.gK)(),(e,a,s,o)=>{let c=l.substr(i,o-i);r.push(n.createElement(n.Fragment,{key:r.length},c));let u=(0,d.x)(t,a);if(u){let e=null;if(u.isAvailable)switch(u.type){case p.TE.SlackTypesUserId:case p.TE.SlackTypesUsergroupId:e=n.createElement(m.Dt,{key:r.length,variable:u});break;case p.TE.SlackTypesChannelId:e=n.createElement(m.GZ,{key:r.length,variable:u});break;default:e=n.createElement(m.UR,{key:r.length,variable:u})}else e=n.createElement(m.xH,{workflowId:A,key:r.length});r.push(e)}else r.push(n.createElement(n.Fragment,{key:r.length},e));return i=o+e.length,""}),r.length>0)?(i<l.length&&r.push(n.createElement(n.Fragment,{key:r.length},l.substring(i))),r):a()},[t,A]),M=(0,E.d4)(k.to),F=S;F||(F=C.t("Draft"));let O=(0,n.useMemo)(()=>n.createElement(c.R,{iconSrcUrl:i,altText:S}),[i,S]);return n.createElement(h.A,{subtype:"builder_message_preview",msg:I},n.createElement(m.Zs.Provider,{value:t},n.createElement(m.kA.Provider,{value:T?m.pE.WORKFLOW_EDITOR:null},n.createElement(g.Ay,{msg:I,className:l()("c-message_kit__message",w().container,r?w().pinnedBackground:"",{[w().transparent_background]:T})},a&&n.createElement(o.A,{replyCount:1,clientTheme:M,willPulse:!1}),r&&n.createElement("div",{className:w().pin},n.createElement(s.Ah,{name:"pin-filled"}),n.createElement("span",null,C.t("Pinned by {senderName}",{senderName:F,fallbackHash:"86b41d69dbeaa0f72084093ff87b543afabc99f3",fallbackHashNs:"message"}))),n.createElement(x.A,{msg:I},n.createElement(_.A,{light:O},n.createElement(v.A,{className:"c-message_kit__sender",name:F,memberIsHuman:!1,isUnknown:!1,isInteractive:!1,isWorkflow:!0}),n.createElement(y.A,null,n.createElement(f.A,{msg:I,customFormatHandler:N,blocksContainerContext:b.pi.workflow_message_preview}))))))))};MessagePreview.displayName="MessagePreview"},0x68e1de73:(e,t,a)=>{"use strict";a.d(t,{B:()=>QuestionPreviewList});var n=a(0xbad225b5),r=a(0x2501a2cee),l=a(0xc62077ca),i=a(0xe9c32bb),s=a(0x15a4ffb05),o=a(0xeddc23dd),c=a.n(o);let QuestionPreviewList=({dialogTitle:e,questions:t,showArrow:a=!1,showTitle:o=!1})=>n.createElement(n.Fragment,null,a&&n.createElement("span",{className:c().icon},n.createElement(r.Ah,{name:"arrow-down",inline:!0,size:"20"})),o&&n.createElement(i.nB,{className:c().title,weight:"bold"},n.createElement(s.A,{text:e})),n.createElement("ul",{className:c().list},t.map(e=>n.createElement(l.B,{key:e.name,question:e}))))},0xc62077ca:(e,t,a)=>{"use strict";a.d(t,{B:()=>QuestionPreview,s:()=>getQuestionTypeDef});var n=a(0xbad225b5),r=a(0x2501a2cee),l=a(0x38bda683),i=a(0x23465d793),s=a(0x1795d8821),o=a(0x23efb3294),c=a.n(o);let d={[l.xi.Text]:{questionType:l.xi.Text,baseType:"text",icon:"text-snippet"},[l.xi.Boolean]:{questionType:l.xi.Text,baseType:"boolean",icon:"radio-button"},[l.xi.Integer]:{questionType:l.xi.Integer,baseType:"integer",icon:"number"},[l.xi.Number]:{questionType:l.xi.Number,baseType:"number",icon:"number"},[l.xi.Textarea]:{questionType:l.xi.Textarea,baseType:"textarea",icon:"text-snippet"},[l.xi.RichText]:{questionType:l.xi.RichText,baseType:s.TE.SlackTypesRichText,icon:"formatting"},[l.xi.SelectStatic]:{questionType:l.xi.SelectStatic,baseType:"select",icon:"caret-dropdown"},[l.xi.SelectUser]:{questionType:l.xi.SelectUser,baseType:"select",icon:"user"},[l.xi.SelectConversation]:{questionType:l.xi.SelectConversation,baseType:"select",icon:"channel"},[l.xi.Date]:{questionType:l.xi.Date,baseType:s.TE.SlackTypesDate,icon:"calendar"},[l.xi.DateTime]:{questionType:l.xi.DateTime,baseType:s.TE.SlackTypesTimestamp,icon:"calendar"},[l.xi.ShortText]:{questionType:l.xi.ShortText,baseType:"string",icon:"text-snippet"},[l.xi.LongText]:{questionType:l.xi.LongText,baseType:"string",icon:"text-snippet"},[l.xi.SelectPerson]:{questionType:l.xi.SelectPerson,baseType:s.TE.SlackTypesUserId,icon:"user"},[l.xi.SelectChannel]:{questionType:l.xi.SelectChannel,baseType:s.TE.SlackTypesChannelId,icon:"channel"},[l.xi.Dropdown]:{questionType:l.xi.Dropdown,baseType:s.TE.SlackTypesLimitedRichText,icon:"caret-dropdown"},[l.xi.StaticMultiSelect]:{questionType:l.xi.StaticMultiSelect,baseType:"array",icon:"radio-button"},[l.xi.StaticMultiSelectWithCheckboxes]:{questionType:l.xi.StaticMultiSelectWithCheckboxes,baseType:"array",icon:"checkbox"},[l.xi.UserMultiSelect]:{questionType:l.xi.UserMultiSelect,baseType:"array",icon:"user-groups"},[l.xi.ChannelMultiSelect]:{questionType:l.xi.ChannelMultiSelect,baseType:"array",icon:"channel"},[l.xi.File]:{questionType:l.xi.File,baseType:"array",icon:"file"}},getQuestionTypeDef=e=>d[e]||{},QuestionPreview=({question:e})=>{let t=(0,i.l)(e),{icon:a}=t?getQuestionTypeDef(t):{icon:"text-snippet"};return n.createElement("li",{className:c().container},n.createElement("span",{className:c().icon},n.createElement(r.Ah,{inline:!0,name:a,size:"inherit"})),n.createElement("span",{className:c().label},e.label??e.title))};QuestionPreview.displayName="QuestionPreview"},0x85ec090:(e,t,a)=>{"use strict";a.d(t,{M:()=>T,B:()=>CanvasSelection});var n,r=a(0xbad225b5),l=a(0x20482ad21),i=a(0x1d2cd7755),s=a(0x139c79d16),o=a(0xa5dbe09b),c=a(0x1407c6c2c),d=a(0xe874a88a),u=a(0x2172ff7ff),m=a(0x1ad596f5f),p=a(0x253c586a2),b=a(0x668181b3),f=a(0x2772625d),g=a(0x1d62f3e69),h=a(0xa1832ae4),_=a(0x1795d8821),y=a(0x2196ed249),x=a(0x226892387),v=a(0xbc72568a),E=a(0x1ee439e69);let k=new l.Ay("workflow_builder");function transformDataToOption(e){return{value:e.id,label:e.label,data:e}}let InputCanvasTemplateSearcher=({elementId:e,className:t,value:a,data:n,isDisabled:l=!1,isInvalid:i=!1,isRequired:s=!0,searcherOptions:o,onChange:S,workspaceFilterTeamId:w,selectProps:C,onValueChange:A,renderSelectedOption:T})=>{let I=(0,c.A)(),N=(0,x.d4)(E.H7),M=(0,h.F1)(N),F=(0,x.d4)(v.sk),O=(0,x.d4)(v.jM),L=(0,x.d4)(v._I),D=(0,x.d4)(v.iS),P=(0,r.useMemo)(()=>new Set([...F?.map(e=>e.id)??[],...O?.map(e=>e.id)??[],...L?.map(e=>e.id)??[],...D?.map(e=>e.id)??[]]),[F,D,L,O]),R=(0,r.useMemo)(()=>{let optionsReducer=(e,t)=>{if(t.type===_.TE.SlackTypesCanvasTemplateId&&e.push(transformDataToOption(t)),t.type===_.TE.Object&&t.objectProperties){let a=t.objectProperties.reduce(optionsReducer,[]);e.push(...a)}return e};return n.groups.reduce((e,t)=>{let a=t.data.reduce(optionsReducer,[]);return 0===a.length||e.push({label:t.label,options:a}),e},[])},[n.groups]),B=(0,r.useMemo)(()=>{if(C?.selectedOption)return a;let e="string"==typeof a?(0,b.x)(n.list,a):void 0;return!e&&a&&(0,f.cn)(a)&&(e=(0,g.x7)(a,_.TE.SlackTypesUserId)),e?transformDataToOption(e):a},[n.list,a,C]),getFilteredTemplateOptions=(e,t)=>{if(e&&e.length>0){let a=e.map(e=>({label:e.name,value:e.id}));return""===t?a:a.filter(e=>e.label?.toLowerCase().includes(t.toLowerCase()))}return[]},W=(0,r.useCallback)((e,t)=>{let a=[],n=(0,m.A)(R,t);if(n.length>0&&a.push(...n),C){let e=C.processOptions();a.push(...e)}let r=P&&P.size>0?e.filter(e=>!P.has(e.value)):e;r.length>0&&a.push({label:k.t("Recent templates"),options:r});let l=getFilteredTemplateOptions(O,t);l.length>0&&a.push({label:k.t("Your templates"),options:l});let i=getFilteredTemplateOptions(L,t);i.length>0&&a.push({label:k.t("Shared with you"),options:i});let s=getFilteredTemplateOptions(D,t);s.length>0&&a.push({label:k.t("Created by {teamName}",{teamName:M}),options:s});let o=getFilteredTemplateOptions(F,t);return o.length>0&&a.push({label:k.t("Slack built templates"),options:o.sort((e,t)=>(0,u.Ay)(e.label,t.label))}),d.S.resolve(a)},[R,C,P,O,L,D,F,M]),V=(0,r.useCallback)((e,t)=>{e?(A&&A(e),S({id:e,type:y.BA,isDynamic:!!t.data})):S({})},[S,A]),q=(0,r.useMemo)(()=>{let e=[];return C?.hints&&e.push(...C.hints),e},[C?.hints]);return r.createElement(p.NV,{className:t,id:e||I,queryType:p.JM,searcherOptions:o,ariaLabel:k.t("canvas templates dropdown menu"),onChange:V,value:B,placeholder:k.t("Select an option"),isDisabled:l,isInvalid:i,isRequired:s,processOptions:W,selectDataQa:"workflow-destination__select",workspaceFilterTeamId:w,renderSelectedOption:T,hints:q})};InputCanvasTemplateSearcher.displayName="InputCanvasTemplateSearcher";var S=a(0x11fa58239),w=a(0x223beeef);let C=new l.Ay("workflow_builder"),A={groups:[],list:[]};var T=((n={}).Blank="blank",n.Template="template",n);let I={name:"canvas_create_type",type:_.TE.String,is_required:!1},N={name:"content",type:_.TE.SlackTypesRichText,is_required:!1},CanvasSelection=({onChange:e,parameter:t,callbackId:a,viewOnly:n,configuredParameters:l,variables:c,otherParameterValues:d,workflowExternalWorkspaceId:u})=>{let[m,p]=(0,r.useState)(d?.canvas_create_type?.value==="template"?"template":"blank"),b=(0,r.useCallback)(a=>{let n=a.target.value;p(n),e(I,n),"blank"===n&&e(t,null),d?.content?.value&&"template"===n&&e(N,null)},[e,d?.content,t]),f=(0,r.useCallback)(a=>{let{id:n}=a;e(t,n)},[e,t]),g=l&&l[t.name]?.value,h=(0,S.z)({parameter:t,value:g||"",callbackId:a,variables:c,onChange:e});return r.createElement(r.Fragment,null,r.createElement(o.A,{className:"margin_bottom_150",legendText:C.t("What type of canvas do you want to create?")},r.createElement("div",null,r.createElement(i.A,{htmlFor:"blank",text:C.t("Create from scratch"),type:"inline",cursor:"pointer"},r.createElement(s.A,{id:"blank","data-qa":"blank",value:"blank",checked:"blank"===m,onChange:b,disabled:n}))),r.createElement("div",null,r.createElement(i.A,{htmlFor:"template",text:C.t("Create from template"),type:"inline",cursor:"pointer"},r.createElement(s.A,{id:"template","data-qa":"template",value:"template",checked:"template"===m,onChange:b,disabled:n})))),"template"===m&&r.createElement(w.z,{parameter:t,isAlwaysRequired:!0},r.createElement(InputCanvasTemplateSearcher,{key:t.name,data:c||A,value:g||"",onChange:f,workspaceFilterTeamId:u,...h})))};CanvasSelection.displayName="CanvasSelection"},0x476b122:(e,t,a)=>{"use strict";a.d(t,{o:()=>CanvasUpdateSelection,s:()=>p});var n,r=a(0xbad225b5),l=a(0x20482ad21),i=a(0x1d2cd7755),s=a(0x139c79d16),o=a(0xa5dbe09b),c=a(0x10b93423f),d=a(0x1795d8821);let u=new l.Ay("workflow_builder"),m={groups:[],list:[]};var p=((n={}).Standalone="standalone",n.ChannelCanvas="channel_canvas",n.ChannelTab="channel_tab",n);let b={name:"canvas_update_type",type:d.TE.String,is_required:!1},f={name:"canvas_id",type:d.TE.SlackTypesCanvasId,is_required:!1},g={name:"canvas_tab",type:d.TE.String,is_required:!1},CanvasUpdateSelection=({onChange:e,parameter:t,callbackId:a,viewOnly:n,configuredParameters:l,variables:d,otherParameterValues:p,dynamicParameter:h,workflowExternalWorkspaceId:_})=>{let[y,x]=(0,r.useState)(p?.canvas_update_type?.value==="channel_canvas"?"channel_canvas":"standalone"),v=(0,r.useCallback)(a=>{let n=a.target.value;x(n),e(b,n),e(h,null),"standalone"===n&&(e(t,null),e(g,null)),p?.canvas_id?.value&&"channel_canvas"===n&&e(f,null)},[e,p?.canvas_id,t,h]),E=l&&l[t.name]?.value;return r.createElement(r.Fragment,null,r.createElement(o.A,{className:"margin_bottom_150",legendText:u.t("What type of canvas do you want to update?")},r.createElement("div",null,r.createElement(i.A,{htmlFor:"standalone",text:u.t("Standalone canvas"),subtext:u.t("Can be shared across multiple people and channels."),type:"inline",cursor:"pointer"},r.createElement(s.A,{id:"standalone","data-qa":"standalone",value:"standalone",checked:"standalone"===y,onChange:v,disabled:n}))),r.createElement("div",null,r.createElement(i.A,{htmlFor:"channel_canvas",text:u.t("Channel canvas"),subtext:u.t("Attached to a single channel."),type:"inline",cursor:"pointer"},r.createElement(s.A,{id:"channel_canvas","data-qa":"channel_canvas",value:"channel_canvas",checked:"channel_canvas"===y,onChange:v,disabled:n})))),"channel_canvas"===y&&r.createElement(c.O,{key:t.name,variables:d||m,allowVariables:!0,parameter:t,value:E||"",onChange:e,callbackId:a,externalWorkspaceId:_}))};CanvasUpdateSelection.displayName="CanvasUpdateSelection"},0x1525f79d3:(e,t,a)=>{"use strict";a.d(t,{T:()=>CreateCanvasTreatment,w:()=>shouldRenderCreateCanvasTreatment});var n=a(0xbad225b5),r=a(0x85ec090),l=a(0x1407c6c2c),i=a(0x20482ad21),s=a(0x2b7f0bcc),o=a(0x677a139e),c=a(0x380ee7b0),d=a(0x88881d67),u=a(0x223beeef),m=a(0x1ba35eb3b),p=a(0x1d3dd4cbe);let b=new i.Ay("workflow_builder"),SlackFunctionChannelVariablesInput=({value:e,parameter:t,onChange:a,variables:r,formatVariableBeforeInsert:i})=>{let{viewOnly:f}=(0,p.e)(),g=(0,l.A)(),h=(0,n.useCallback)(e=>{a(t,e)},[a,t]),_=(0,n.useCallback)(e=>!(0,m.Bp)(e)&&((0,m.qk)(e)||(0,m.xY)({variable:e,parameter:t})),[t]),y=e;if(!e){let e=(0,d.PW)(r.groups,_);e&&1===e.length&&a(t,y=e[0].data[0].id)}let maybeRenderDeprecationAlert=()=>{let e=b.t("Heads up\u2014this step will soon be changing. Want to get a head start? Replace this step with these two: \u201CCreate a canvas\u201D and \u201CAdd a canvas tab to a channel.\u201D");return n.createElement(s.Ay,{level:s.A_.warning,className:"margin_bottom_75"},e)};return maybeRenderDeprecationAlert.displayName="maybeRenderDeprecationAlert",n.createElement(n.Fragment,null,maybeRenderDeprecationAlert(),n.createElement(u.z,{elementId:g,parameter:t,forceLabel:b.t("Select a canvas")},n.createElement(c.P,{onChange:h,value:y,variables:r,customDataFilter:_,label:t.title??t.description??t.name,isDisabled:f,formatVariableBeforeInsert:i,parameterType:t.type}),n.createElement(o.A,null,null)))};SlackFunctionChannelVariablesInput.displayName="SlackFunctionChannelVariablesInput";var f=a(0x1795d8821);function shouldRenderCreateCanvasTreatment({parameter:e,callbackId:t,otherParameterValues:a}){switch(e.type){case f.TE.SlackTypesCanvasTemplateId:if("canvas_template_id"===e.name)return!0;return!1;case f.TE.SlackTypesChannelId:if("channel_id"===e.name&&t===f.oW.CreateChannelCanvas)return!0;return!1;case f.TE.String:if("canvas_create_type"===e.name)return!0;return!1;case f.TE.SlackTypesExpandedRichText:if(a?.canvas_create_type?.value==="template"&&"content"===e.name)return!0;return!1;default:return!1}}let CreateCanvasTreatment=({parameter:e,value:t,variables:a,configuredParameters:l,required:i,onChange:s,isReference:o,viewOnly:c,callbackId:d,otherParameterValues:u,workflowExternalWorkspaceId:m})=>{switch(e.type){case f.TE.SlackTypesCanvasTemplateId:if("canvas_template_id"===e.name)return n.createElement(r.B,{parameter:e,value:t,variables:a,configuredParameters:l,required:i,onChange:s,isReference:o,viewOnly:c,callbackId:d,otherParameterValues:u,workflowExternalWorkspaceId:m});return null;case f.TE.SlackTypesChannelId:if("channel_id"===e.name&&d===f.oW.CreateChannelCanvas)return n.createElement(SlackFunctionChannelVariablesInput,{parameter:e,value:t,variables:a,onChange:s});return null;case f.TE.String:if("canvas_create_type"===e.name)return n.createElement("div",null);return null;case f.TE.SlackTypesExpandedRichText:if(u?.canvas_create_type?.value==="template"&&"content"===e.name)return n.createElement("div",null);return null;default:return null}};CreateCanvasTreatment.displayName="CreateCanvasTreatment"},0x18de2ae18:(e,t,a)=>{"use strict";a.d(t,{G:()=>UpdateCanvasTreatmentV2,z:()=>shouldRenderUpdateCanvasTreatmentV2});var n,r=a(0xbad225b5),l=a(0x1d01572a2),i=a(0x20482ad21),s=a(0x1d2cd7755),o=a(0x139c79d16),c=a(0xa5dbe09b),d=a(0x145d46a61),u=a(0x1795d8821),m=a(0x226892387);let p=new i.Ay("workflow_builder");var b=((n={}).Standalone="standalone",n.ChannelTab="channel_tab",n);let f={name:"canvas_update_type",type:u.TE.String,is_required:!1},g={name:"canvas_id",type:u.TE.SlackTypesCanvasId,is_required:!1},h={name:"canvas_tab",type:u.TE.String,is_required:!1},CanvasUpdateSelectionV2=({onChange:e,parameter:t,viewOnly:a,otherParameterValues:n,dynamicParameter:i})=>{let[u,b]=(0,r.useState)(n?.canvas_update_type?.value==="channel_tab"?"channel_tab":"standalone"),_=(0,m.d4)(d.$T);(0,l.A)(()=>{_&&u!==n?.canvas_update_type?.value&&e(f,u)});let y=(0,r.useCallback)(a=>{let r=a.target.value;b(r),e(f,r),e(i,null),"standalone"===r&&(e(t,null),e(h,null)),n?.canvas_id?.value&&"channel_tab"===r&&e(g,null)},[e,n?.canvas_id,t,i]);return r.createElement(c.A,{className:"margin_bottom_150",legendText:p.t("Choose how you\u2019d like to find the canvas:",{fallbackHash:"2cdfb663290cc5db016146845ec88cb4baed33c0",fallbackHashNs:"workflow_builder"})},r.createElement("div",null,r.createElement(s.A,{htmlFor:"standalone",text:p.t("By canvas title",{fallbackHash:"f1f06dedad1afa84271ba4cb62a6441b43bf89fb",fallbackHashNs:"workflow_builder"}),type:"inline",cursor:"pointer"},r.createElement(o.A,{id:"standalone","data-qa":"standalone",value:"standalone",checked:"standalone"===u,onChange:y,disabled:a}))),r.createElement("div",null,r.createElement(s.A,{htmlFor:"channel_tab",text:p.t("By channel",{fallbackHash:"698fe85e4f2b0c5a06e28f5a57100e1b67cd0ada",fallbackHashNs:"workflow_builder"}),type:"inline",cursor:"pointer"},r.createElement(o.A,{id:"channel_tab","data-qa":"channel_tab",value:"channel_tab",checked:"channel_tab"===u,onChange:y,disabled:a}))))};CanvasUpdateSelectionV2.displayName="CanvasUpdateSelectionV2";var _=a(0xa1832ae4),y=a(0x1ee439e69);let x={name:"section_id",type:u.TE.String,is_required:!1};function shouldRenderUpdateCanvasTreatmentV2({parameter:e,otherParameterValues:t,isFreeTeam:a}){switch(e.type){case u.TE.SlackTypesChannelId:if("channel_id"===e.name){if(a)return!1;return!0}return!1;case u.TE.String:if("canvas_update_type"===e.name)return!0;return!1;case u.TE.SlackTypesCanvasId:if((t?.canvas_update_type?.value===b.ChannelTab||a)&&"canvas_id"===e.name)return!0;return!1;default:return!1}}let UpdateCanvasTreatmentV2=({parameter:e,value:t,variables:a,configuredParameters:n,onChange:l,isReference:i,viewOnly:s,callbackId:o,otherParameterValues:c,workflowExternalWorkspaceId:d})=>{let p=(0,m.d4)(y.H7),f=!(0,_.qR)(p),[g,h]=(0,r.useState)();switch(e.type){case u.TE.String:if("canvas_update_type"===e.name)return f&&!g&&(l(e,b.ChannelTab),h(!0)),r.createElement(CanvasUpdateSelectionV2,{parameter:e,dynamicParameter:x,value:t,variables:a,configuredParameters:n,required:!1,onChange:l,isReference:i,viewOnly:s,callbackId:o,otherParameterValues:c,workflowExternalWorkspaceId:d});return null;case u.TE.SlackTypesCanvasId:if(f&&"canvas_id"===e.name)return r.createElement("div",null);return null;default:return null}};UpdateCanvasTreatmentV2.displayName="UpdateCanvasTreatmentV2"},0xbdb24cfa:(e,t,a)=>{"use strict";a.d(t,{P:()=>shouldRenderUpdateCanvasTreatment,W:()=>UpdateCanvasTreatment});var n=a(0xbad225b5),r=a(0x476b122),l=a(0xa1832ae4),i=a(0x1795d8821),s=a(0x226892387),o=a(0x1ee439e69);let c={name:"section_id",type:i.TE.String,is_required:!1};function shouldRenderUpdateCanvasTreatment({parameter:e,otherParameterValues:t,isFreeTeam:a}){switch(e.type){case i.TE.SlackTypesChannelId:if("channel_id"===e.name){if(a)return!1;return!0}return!1;case i.TE.String:if("canvas_update_type"===e.name)return!0;return!1;case i.TE.SlackTypesCanvasId:if((t?.canvas_update_type?.value===r.s.ChannelCanvas||a)&&"canvas_id"===e.name)return!0;return!1;default:return!1}}let UpdateCanvasTreatment=({parameter:e,value:t,variables:a,configuredParameters:d,onChange:u,isReference:m,viewOnly:p,callbackId:b,otherParameterValues:f,workflowExternalWorkspaceId:g})=>{let h=(0,s.d4)(o.H7),_=!(0,l.qR)(h),[y,x]=(0,n.useState)();switch(e.type){case i.TE.SlackTypesChannelId:if("channel_id"===e.name){if(_)return null;return n.createElement(r.o,{parameter:e,dynamicParameter:c,value:t,variables:a,configuredParameters:d,required:!1,onChange:u,isReference:m,viewOnly:p,callbackId:b,otherParameterValues:f,workflowExternalWorkspaceId:g})}return null;case i.TE.String:if("canvas_update_type"===e.name)return _&&!y&&(u(e,r.s.ChannelCanvas),x(!0)),n.createElement("div",null);return null;case i.TE.SlackTypesCanvasId:if((f?.canvas_update_type?.value===r.s.ChannelCanvas||_)&&"canvas_id"===e.name)return n.createElement("div",null);return null;default:return null}};UpdateCanvasTreatment.displayName="UpdateCanvasTreatment"},0x162b2271e:(e,t,a)=>{"use strict";a.d(t,{T:()=>UpdateCanvasVariablesTreatment,c:()=>shouldRenderUpdateCanvasVariablesTreatment});var n=a(0xbad225b5),r=a(0x476b122),l=a(0xa1832ae4),i=a(0x1795d8821),s=a(0x226892387),o=a(0x1ee439e69);let c={name:"placeholder_value",type:i.TE.String,is_required:!1};function shouldRenderUpdateCanvasVariablesTreatment({parameter:e,otherParameterValues:t,isFreeTeam:a}){switch(e.type){case i.TE.SlackTypesChannelId:if("channel_id"===e.name){if(a)return!1;return!0}return!1;case i.TE.String:if("canvas_update_type"===e.name)return!0;return!1;case i.TE.SlackTypesCanvasId:if((t?.canvas_update_type?.value===r.s.ChannelCanvas||a)&&"canvas_id"===e.name)return!0;return!1;default:return!1}}let UpdateCanvasVariablesTreatment=({parameter:e,value:t,variables:a,configuredParameters:d,onChange:u,isReference:m,viewOnly:p,callbackId:b,otherParameterValues:f,workflowExternalWorkspaceId:g})=>{let h=(0,s.d4)(o.H7),_=!(0,l.qR)(h),[y,x]=(0,n.useState)();switch(e.type){case i.TE.SlackTypesChannelId:if("channel_id"===e.name){if(_)return null;return n.createElement(r.o,{parameter:e,dynamicParameter:c,value:t,variables:a,configuredParameters:d,required:!1,onChange:u,isReference:m,viewOnly:p,callbackId:b,otherParameterValues:f,workflowExternalWorkspaceId:g})}return null;case i.TE.String:if("canvas_update_type"===e.name)return _&&!y&&(u(e,r.s.ChannelCanvas),x(!0)),n.createElement("div",null);return null;case i.TE.SlackTypesCanvasId:if((f?.canvas_update_type?.value===r.s.ChannelCanvas||_)&&"canvas_id"===e.name)return n.createElement("div",null);return null;default:return null}};UpdateCanvasVariablesTreatment.displayName="UpdateCanvasVariablesTreatment"},0xa4a4f43b:(e,t,a)=>{"use strict";a.d(t,{C:()=>FormFieldValueReadOnly});var n=a(0xbad225b5),r=a(0x174bb7323),l=a(0x1cbdfeceb),i=a(0x20482ad21),s=a(0x2501a2cee),o=a(0x4c96e5d9),c=a(0x223beeef),d=a(0x242c34757),u=a(0x145d46a61),m=a(0x226892387),p=a(0x129d52829),b=a.n(p),f=a(0x9b06c346),g=a.n(f);let h=new i.Ay("workflow_builder"),FormFieldValueReadOnly=({value:e,parameter:t,variables:a,dynamicInput:i})=>{let p=i?`key-value-input-${i.key}`:`input-${t.name}`,f=(0,m.d4)(u.$T),_=h.t("Included in form",{fallbackHash:"0bdb9fe0057325a88dac4c2acd80cb7bbd6774a0"}),renderInput=({inputType:i,ariaLabel:s,textyClassName:o})=>n.createElement(d.A,{id:p,initialText:(0,r.A)(e),variables:a,allowVariables:!1,className:"flex_one",textyClassName:o,ariaLabel:s??"",inputType:i,onVariableMenuOpen:l.A,onTextChange:l.A,onBlur:l.A,isDisabled:!0,hint:t.hint});return f?i?n.createElement("div",{className:b().container},renderInput({inputType:i.type,ariaLabel:i.label,textyClassName:g().textyInput}),n.createElement(o.Ay,{tip:_,position:"top"},n.createElement("div",{className:b().syncIcon},n.createElement(s.Ah,{name:"refresh",size:"20","aria-label":_})))):n.createElement(c.z,{elementId:p,parameter:t,isParameterSyncedWithForm:!0},renderInput({inputType:t.type,ariaLabel:t.title??t.name})):null};FormFieldValueReadOnly.displayName="FormFieldValueReadOnly"},0x16bc32721:(e,t,a)=>{"use strict";a.d(t,{J:()=>formatDynamicOptions});var n=a(0x202470d56),r=a(0x1795d8821);let formatDynamicOptions=({dynamicOptions:e,value:t,displayInline:a,selectionType:l,isParameterFormWrapped:i})=>e.map((e,s)=>{let o=a||e.empty||e.visible||e.is_required;!o&&"string"==typeof e.key&&"object"==typeof t&&e.key in t&&(o=!!i||!(0,n.A)(t[e.key]));let c=e.value;return l===r.Il.KEY_VALUE&&(c="string"==typeof e.key&&"object"==typeof t&&e.key in t?t[e.key]:void 0),{...e,is_required:e.is_required||!1,key:e.key||"",empty:e.empty||!1,label:e.label||"",value:c,visible:!!o,selectable:!o,selected:l===r.Il.SELECT&&t===e.key,index:s}})},0x20f31dc25:(e,t,a)=>{"use strict";a.d(t,{f:()=>useDynamicOptionsWorkflowClient});var n=a(0xbad225b5),r=a(0x16cf1da63),l=a(0x1db69cda),i=a(0xc6a2c86f),s=a(0x242822dfb),o=a(0x347d5813),c=a(0x21dd8a0c2),d=a(0x1806ce928);let useDynamicOptionsWorkflowClient=({function:e,workflowId:t,functionId:a,values:u,inputs:m,stepId:p,isExistingStep:b,hasValidationFunction:f,hierarchicalParameterName:g,optionType:h,serviceTriggerType:_,triggerId:y,isTriggerSegment:x,isOAuthTokenInvalid:v,additionalInputs:E})=>{let k=(0,r.wA)(),S=(0,i.A)(m),w=(0,n.useCallback)(({typeaheadQueryKey:n,typeaheadQueryValue:r}={})=>{let i=m?(0,l.A)(m):{};return n&&(i[n]=r||""),k((0,d.O)({function:e,stepFunctionId:a,workflowStepId:p,workflowId:t,hierarchicalParameterName:g,optionType:h,inputs:i,triggerType:_,reason:"workflow_builder/workflows_get_dynamic_options"}))},[k,a,e,g,m,h,p,t,_]),C=(0,s.p9)(S,m,v),A=(0,n.useCallback)(()=>{let e=!!(b&&p),n=!!(x&&y);if(!f||!e&&!n)return Promise.resolve(void 0);let r=(0,o.V)(u);return k((0,c.X)({stepInputs:r,inputParameterName:g[0],stepFunctionId:a,workflowStepId:p,workflowId:t,triggerType:_,additionalInputs:E,hierarchicalParameterName:g,triggerId:x?y:void 0,reason:"workflow_builder/workflows_validate_options"}))},[b,p,x,y,f,u,k,g,a,t,_,E]);return(0,n.useMemo)(()=>({fetchOptions:w,shouldFetchOptions:C,validateOptions:A,isOAuthTokenInvalid:v}),[w,v,C,A])}},0xee467999:(e,t,a)=>{"use strict";a.d(t,{n:()=>useDynamicOptions});var n=a(0xbad225b5),r=a(0x9e671ad),l=a(0x21f3c49e8);let i="INIT",s="UPDATE_STATE",o="SET_STATUS_PENDING",c="SET_STATUS_COMPLETE",d="FETCH_OPTIONS_SUCCESS",u="FETCH_OPTIONS_ERROR",m="VALIDATE_OPTIONS_SUCCESS",p="VALIDATE_OPTIONS_ERROR",b="UPDATE_VALUE",f="UPDATE_LABEL",g="ADD_EMPTY_OPTION",h="REMOVE_OPTION",_="CHANGE_OPTION",y="SELECT_OPTION",x="CLEAR_STATUS_ERROR";var v=a(0x1165e5027),E=a(0x1feee1711);let shouldDisplayInline=(e,t)=>!!(0,E.A)(t)||t>0&&e<=t;var k=a(0x1795d8821);let combineValidateAndDynamicOptions=({dynamicOptions:e,selectionType:t,validateOptions:a,inlineDisplayThreshold:n})=>{let r,l=shouldDisplayInline((r=t===k.Il.KEY_VALUE?(0,v.A)(a,e,"key").map((e,t)=>({...e,originalIndex:t})):(0,v.A)(a,e,"value").map((e,t)=>({...e,key:"string"==typeof e.value?e.value:String(t),originalIndex:t}))).length,n);return{mappedDynamicOptions:r,displayInline:l}};var S=a(0x16bc32721);let init=({value:e,options:t})=>{let{dynamicOptions:a=[],...n}=t;return{isLoading:!1,isError:!1,isSuccess:!1,displayInline:shouldDisplayInline(a.length,t.inlineDisplayThreshold),dynamicOptions:a,errorMessage:null,errorCode:null,value:e,label:void 0,valueType:void 0,...n}};var w=a(0x1c09d8c36);let updateLabelsForDynamicOptions=(e,t)=>e.map(({valueLabel:e,...a})=>{let n={...a},r=n.key&&t?.[n.key];if(!r||"object"!=typeof r)return n;r.valueLabel&&(n.valueLabel=r.valueLabel);let l=r[w.x3];return l&&(n.filterQueries=l),n});var C=a(0x1e19488b9),A=a(0x1806ce928);let createDynamicOption=e=>({key:"",label:"",value:void 0,visible:!0,selectable:!1,index:0,empty:!0,selected:!1,type:C.J5.String,selection_type:C.p8.NONE,is_required:!1,...e}),reducer=(e,t)=>{switch(t.type){case i:return init({value:t.value,options:{processError:e.processError,dynamicOptions:e.dynamicOptions,inlineDisplayThreshold:e.inlineDisplayThreshold,selectionType:e.selectionType,onSuccess:e.onSuccess,onValueChange:e.onValueChange,...t.options}});case s:return{...e,...t.state};case o:return{...e,isLoading:!0,errorMessage:null,errorCode:null,isError:!1,isSuccess:!1,dynamicOptions:[],validateOptions:[]};case c:return{...e,isLoading:!1};case d:{let{mappedDynamicOptions:a,displayInline:n}=combineValidateAndDynamicOptions({dynamicOptions:t.dynamicOptions,selectionType:e.selectionType,validateOptions:e.validateOptions,inlineDisplayThreshold:e.inlineDisplayThreshold}),r=(0,S.J)({dynamicOptions:a,value:e.value,displayInline:n,selectionType:e.selectionType,isParameterFormWrapped:e.isParameterFormWrapped});if(e.selectionType===k.Il.KEY_VALUE&&(r=updateLabelsForDynamicOptions(r,e.label)),!n&&r.length&&r.every(e=>!e.visible)){let e=createDynamicOption({index:r.length});r.push(e)}return e.onSuccess?.(r),{...e,dynamicOptions:r,valueType:t.valueType,isSuccess:!0,displayInline:n}}case u:{let a=e.processError?.(t.error)??t.error?.data?.error_message;return{...e,dynamicOptions:[],errorMessage:a??null,errorCode:t.error?.data.error??null,isError:!0,isSuccess:!1}}case m:{let{mappedDynamicOptions:a,displayInline:n}=combineValidateAndDynamicOptions({dynamicOptions:t.dynamicOptions,selectionType:e.selectionType,validateOptions:e.validateOptions,inlineDisplayThreshold:e.inlineDisplayThreshold}),r=(0,S.J)({dynamicOptions:a,value:e.value,displayInline:n,selectionType:e.selectionType,isParameterFormWrapped:e.isParameterFormWrapped});return{...e,validateOptions:t.dynamicOptions,dynamicOptions:r,displayInline:n}}case p:{let a=e.processError?.(t.error)??t.error?.data?.error_message;return t.error?.data?.error===A.n.FunctionReturnedError&&"function"==typeof e.onValueChange&&e.onValueChange({value:void 0}),{...e,validateOptions:[],errorMessage:a??null,errorCode:t.error?.data?.error??null,isError:!0}}case b:{if(e.selectionType===k.Il.SELECT){let a=e.dynamicOptions.map(e=>({...e,selected:e.value===t.value}));return{...e,value:t.value,dynamicOptions:a}}let a=(0,S.J)({dynamicOptions:e.dynamicOptions,value:t.value,displayInline:e.displayInline,selectionType:e.selectionType,isParameterFormWrapped:e.isParameterFormWrapped});return{...e,value:t.value,dynamicOptions:a}}case f:if(e.selectionType===k.Il.KEY_VALUE){let a=updateLabelsForDynamicOptions(e.dynamicOptions,t.label);return{...e,dynamicOptions:a,label:t.label}}return{...e,label:t.label};case g:{let t=createDynamicOption({index:e.dynamicOptions.length}),a=[...e.dynamicOptions,t];return{...e,dynamicOptions:a}}case h:{let a=e.dynamicOptions.reduce((e,a)=>{if(a.key===t.dynamicOption.key){if(a.empty)return e;e.push({...a,visible:!1,selectable:!0,value:void 0})}else e.push(a);return e},[]);if("function"==typeof e.onValueChange){let n=a.filter(e=>void 0!==e.value&&e.key!==t.dynamicOption.key),r=a.filter(e=>!e.empty);e.onValueChange({value:n,dynamicOption:t.dynamicOption,nonEmptyDynamicOptions:r})}return{...e,dynamicOptions:a}}case _:{let a,n=[...e.dynamicOptions],r=t.dynamicOption.index,l=!1;if(t.dynamicOption.empty&&t.dynamicOption.key===e.dynamicOptions[t.dynamicOption.index].key)return n[r]=t.dynamicOption,{...e,dynamicOptions:n.map((e,t)=>({...e,index:t}))};if(t.dynamicOption.empty&&t.dynamicOption.key!==e.dynamicOptions[t.dynamicOption.index].key){let e=n.findIndex(e=>e.key===t.dynamicOption.key),r={...t.dynamicOption,value:void 0,label:n[e].label,key:n[e].key,type:n[e].type,selection_type:n[e].selection_type,additional_inputs:n[e].additional_inputs,originalIndex:n[e].originalIndex,empty:!1,available_options:n[e].available_options};r.type!==C.J5.String||r.selection_type&&r.selection_type!==C.p8.NONE||(r.value=t.dynamicOption.value),n[t.dynamicOption.index]={...r},n.splice(e,1),a=[...n],l=!0}else if(e.dynamicOptions[r].key!==t.dynamicOption.key){let i=e.dynamicOptions.find(e=>e.key===t.dynamicOption.key).index,s={...n[i],value:void 0,visible:!0,selectable:!1},o={...n[r],value:void 0,visible:!1,selectable:!0};o?.selection_type&&o.selection_type!==C.p8.NONE||s.selection_type&&s.selection_type!==C.p8.NONE||o.type!==s.type||(s.value=t.dynamicOption.value),n[r]=s,n[i]=o,a=[...n],l=!0}else a=n.map(e=>e.key===t.dynamicOption.key?t.dynamicOption:e);if("function"==typeof e.onValueChange){let r=a.filter(e=>e.visible),i=n.filter(e=>!e.empty);e.onValueChange({value:r,dynamicOption:t.dynamicOption,nonEmptyDynamicOptions:i,isNewDynamicOption:l})}return{...e,dynamicOptions:n.map((e,t)=>({...e,index:t}))}}case y:{let a=e.dynamicOptions.find(e=>(0,r.A)(e.value,t.option?.value)),n=a?{...t.option,...a,selected:!0}:t.option;if("function"==typeof e.onValueChange){let a=e.dynamicOptions.filter(e=>!e.empty);e.onValueChange({value:t.option?.value,dynamicOption:n,nonEmptyDynamicOptions:a})}return{...e,errorMessage:null,errorCode:null,isError:!1}}case x:return{...e,errorMessage:null,errorCode:null,isError:!1};default:return e}};var T=a(0x242822dfb),I=a(0x2772625d),N=a(0x9d5ee87e),M=a(0xf5bbd10a);let useDynamicOptions=({client:e,value:t,label:a,reducerOptions:v,typeahead:E={},minQueryLength:S})=>{let w=(0,M.A)(),{state:C,actions:A}=((e,t,a)=>{let[r,l]=(0,n.useReducer)(reducer,{value:e,label:t,options:a},init);return{state:r,actions:(0,n.useMemo)(()=>({[i]:(e,t)=>l({type:i,value:e,options:t}),[s]:e=>l({type:s,state:e}),[o]:()=>l({type:o}),[c]:()=>l({type:c}),[d]:(e,t)=>l({type:d,dynamicOptions:e,valueType:t}),[u]:e=>l({type:u,error:e}),[m]:e=>l({type:m,dynamicOptions:e}),[p]:e=>l({type:p,error:e}),[b]:e=>l({type:b,value:e}),[f]:e=>l({type:f,label:e}),[g]:()=>l({type:g}),[h]:e=>l({type:h,dynamicOption:e}),[_]:e=>l({type:_,dynamicOption:e}),[y]:(e,t)=>l({type:y,option:e,filterQueries:t}),[x]:()=>l({type:x})}),[l])}})(t,a,v),{typeaheadQueryKey:F}=E,O=(0,n.useCallback)(async()=>{try{let{options:t,value_type:a}=await e.fetchOptions({typeaheadQueryKey:F});A.FETCH_OPTIONS_SUCCESS(t,a)}catch(e){A.FETCH_OPTIONS_ERROR(e),w.error("Something went wrong when trying to fetch dynamic options:",e)}},[A,e,w,F]),L=(0,n.useCallback)(async()=>{try{let t=await e.validateOptions?.();t?.options&&A.VALIDATE_OPTIONS_SUCCESS(t.options)}catch(e){e.data?.error!==N.V.TokenDelegatedError&&A.VALIDATE_OPTIONS_ERROR(e)}},[A,e]),D=(0,n.useCallback)(async()=>{!e.shouldFetchOptions||v.dynamicOptions||(A.SET_STATUS_PENDING(),t&&e.validateOptions&&(v.selectionType===k.Il.MULTI_SELECT||!(0,I.bs)(t))&&await L(),F&&(!F||S)||await O(),A.SET_STATUS_COMPLETE())},[A,e.shouldFetchOptions,v.dynamicOptions,F,O,L]),P=(0,n.useCallback)((e,t)=>(0,T.Xn)(e,t),[]);return(0,n.useEffect)(()=>{D()},[D]),(0,n.useEffect)(()=>{(0,r.A)(t,C.value)||A.UPDATE_VALUE(t)},[t,C.value,A]),(0,n.useEffect)(()=>{(0,r.A)(a,C.label)||A.UPDATE_LABEL(a)},[a,C.label,A]),(0,n.useEffect)(()=>{v.dynamicOptions&&A.INIT(t,{dynamicOptions:v.dynamicOptions})},[A,v.dynamicOptions,t]),(0,n.useEffect)(()=>{let e={};(0,r.A)(v.onValueChange,C.onValueChange)||(e.onValueChange=v.onValueChange),(0,r.A)(v.onSuccess,C.onSuccess)||(e.onSuccess=v.onSuccess),(0,r.A)(v.processError,C.processError)||(e.processError=v.processError),(0,l.A)(e)||A.UPDATE_STATE(e)},[A,v.onSuccess,v.onValueChange,v.processError,C.onSuccess,C.onValueChange,C.processError]),{...C,actions:A,processSelectOptions:P}}},0x1795b5c1b:(e,t,a)=>{"use strict";a.d(t,{g:()=>applyDynamicOptionsAsObjectProperties});var n=a(0x1db69cda),r=a(0xee06738a),l=a(0x242822dfb);let applyDynamicOptionsAsObjectProperties=(e,t,a,i)=>{let s=(0,n.A)(e);if(!s.config.slackFunction)return s;let o=(0,r.q)(s)&&s.config.wrappedSlackFunction?s.config.wrappedSlackFunction.input_parameters:s.config.slackFunction.input_parameters,c=o.findIndex(({name:e})=>e===t.name),d=o[c];if(c<0||!(0,l.sg)(t))return s;let u=a.reduce((e,a)=>{let n=((e,t,a=!1,n={})=>{if(!e.isParameterFormWrapped)return!1;let r=n?.[t.key]??{};return"isParameterFormWrapped"in r?!!r.isParameterFormWrapped:!(!a&&Object.keys(n).some(e=>n[e]&&"isParameterFormWrapped"in n[e]))})(t,a,i,d.properties),r=(0,l.KE)(a,t,n);return r&&(e[a.key]=r),e},{});return d.properties=u,s}},0x1f5430624:(e,t,a)=>{"use strict";a.d(t,{r:()=>SlackFunctionDynamicInputs});var n=a(0xbad225b5),r=a(0x21f3c49e8),l=a(0x1df96de4c),i=a(0xa4a4f43b),s=a(0x1c09d8c36),o=a(0x20482ad21),c=a(0x1806ce928),d=a(0x1795d8821);let u=new o.Ay("workflow_builder"),createGSheetsProcessError=e=>t=>!t?.data?.error||"typeahead"in e&&!0===e.typeahead&&t?.data?.error===c.n.TooManyOptions?null:e.dynamic_options.selectionType===d.Il.KEY_VALUE?u.t("*We had a problem loading your spreadsheet.* Learn more about <{gsheetsLink}|Google Sheets for Workflow Builder>.",{gsheetsLink:s.RE,fallbackHash:"1dd20802d6b9a14c32daa9db95fb5a2231ead6b7",fallbackHashNs:"workflow-builder"}):u.t("We had a problem loading your spreadsheet. Learn more about <{gsheetsLink}|Google Sheets for Workflow Builder>.",{gsheetsLink:s.RE,fallbackHash:"103b8ba13ce647b2cdb8c09934af95a9a7e0e44f",fallbackHashNs:"workflow-builder"});var m=a(0x220a941b7),p=a(0x4ba0a293),b=a(0x59698e4),f=a(0x1101b591d),g=a(0x13ce094e1),h=a(0x11e17f4c1),_=a(0x2a8eb1c6),y=a(0x21c50a68b),x=a(0x25054cb9f),v=a(0x100bcae20),E=a(0x23465d793),k=a(0x153cbdf74);function shouldListsUseDefaultTemplateMacro(e){let t=(0,E.l)(e);return!t||v.g[t]!==k.$.Attachment}var S=a(0x242822dfb),w=a(0xaa8bd6a3);let C=new o.Ay("workflow_builder"),getDynamicOptions=({parameter:e,value:t,variables:a,openFormSteps:n,personWhoSubmittedText:r,timeSubmittedText:l,shouldUseDefaultTemplateMacro:i,keyAsIndex:s=!0,stepId:o,optionType:c})=>(0,S.Wz)(e,t)?!t||"object"!=typeof t||Array.isArray(t)?[]:((e,t,a,n,r,l,i,s=!0,o=()=>!0)=>{let c=(0,b.k)(e.id),u=e.fields.map((e,a)=>{let n=s?(0,p.f)(c,a):(0,p.f)(c,`${(0,m.A)(e.title)}_${a}`),r=t[n];if(o(e)&&"string"==typeof r&&!(0,x.ND)(r)){let t=(0,x.VN)({id:r,type:e.type,items:e.items},{stepId:l});t&&(r=t)}return{label:e.title,key:n,value:r,visible:!0,selectable:!1,type:i??e.type}});if(n){let t=(0,_.C)(e.outputs);if(!t)throw Error("Could not locate submit user variable in step");let a=(0,g.d)(t);u.push({label:n,key:(0,p.f)(c,u.length),value:a,visible:!0,selectable:!1,type:i??d.TE.SlackTypesUserId})}if(r){let e=(0,h.L)(a);if(!e)throw Error("Could not locate trigger event timestamp");let t=(0,f.Q)(e.id,(0,y.JK)());u.push({label:r,key:(0,p.f)(c,u.length),value:t,visible:!0,selectable:!1,type:i??d.TE.SlackTypesTimestamp})}return u.map((e,t)=>({...e,index:t}))})((0,w.H)(t,n),t,a,r,l,o,c,s,i):void 0,getDynamicOptionsForGsheets=({parameter:e,value:t,variables:a,openFormSteps:n})=>{let r=C.t("Form Responses");return e.name===s.dC&&t===s.zK?[{label:r,value:s.zK,key:s.zK,selected:!0,visible:!0,selectable:!1}]:getDynamicOptions({parameter:e,value:t,variables:a,openFormSteps:n,personWhoSubmittedText:C.t("Submitted By"),timeSubmittedText:C.t("Timestamp"),optionType:d.TE.String})};var A=a(0xe874a88a),T=a(0x11e7de8ad),I=a(0x6cc5eee0);let N=new o.Ay("workflow_builder"),getSelectProps=({parameter:e,value:t,openFormSteps:a,functionId:r})=>{let l=N.t("Form Responses"),i=N.t("Create a spreadsheet from a form"),o=N.t("Your spreadsheets"),c=N.t("<{googleSheetUrl}|Open in Google Sheets>",{googleSheetUrl:`${s.BF}/${t}`,fallbackHash:"7a10b850695b39e3c427cb5bb0704d674b8e8858",fallbackHashNs:"files"}),d=N.t("When you save this step, we will create a new spreadsheet for you."),u=N.t("This sheet will be automatically generated from the values below."),m=t?[{id:"spreadsheet-link",message:n.createElement(I.A,{text:c})}]:void 0,p={label:l,value:s.zK};if(e.name===s.dC&&t===s.zK)return{selectedOption:t===s.zK?p:void 0,isDisabled:t===s.zK,hints:[{id:"open-form-create-sheet-hint",message:u}]};if(e.name===s.$S){let n,l,processOptions=async t=>e.name===s.$S&&a.length?A.S.resolve((0,S.ED)({options:t,steps:a,createText:i,existingText:o,wrappedFunctionId:r})):A.S.resolve(t);return t&&("string"==typeof t||"number"==typeof t)?(0,T.B)(t)?{hints:[{id:"open-form-create-spreadsheet-hint",message:d}],processOptions,selectedOption:(n=(0,S.uP)(t),l=a.find(e=>e.id===n),{label:l?.title,value:t})}:{hints:m,processOptions}:{processOptions}}};getSelectProps.displayName="getSelectProps";var M=a(0x1d3dd4cbe);let useGSheetsFunctionProps=({parameter:e,value:t,functionId:a,variables:r,canUserManageStep:l,onChange:i})=>{let{updateRequiredContext:o,updateParameterValue:c,openFormSteps:u}=(0,M.e)(),m=(0,n.useCallback)((e,t,a)=>{let n="string"==typeof a&&(0,S.De)(a,u);if(n){let t={...e};return t.config.inputs={...t.config.inputs,...(0,S.ue)(a,n,r)},o("{{event_timestamp}}"),t}return e},[u,r,o]),p=(0,n.useCallback)(a=>{t||e.name===s.dC&&1===a.length&&c({parameter:e,value:a[0].value,label:{[a[0].value]:a[0].label}})},[e,c,t]);if([s.yZ,s.m$].includes(a)){if(!l)return{processError:createGSheetsProcessError(e)};switch(e.dynamic_options.selectionType){case d.Il.SELECT:return{processError:createGSheetsProcessError(e),onValueChange:({value:t,dynamicOption:a})=>{let n=t&&!(0,T.B)(t)&&a?.label?{[t]:a.label}:void 0;i(e,t,n,{shouldSetSegmentState:S.sd,setSegmentState:m})},onSuccess:p,selectProps:getSelectProps({parameter:e,value:t,openFormSteps:u,functionId:a}),dynamicOptions:getDynamicOptionsForGsheets({parameter:e,value:t,variables:r,openFormSteps:u})};case d.Il.KEY_VALUE:return{processError:createGSheetsProcessError(e),dynamicOptions:getDynamicOptionsForGsheets({parameter:e,value:t,variables:r,openFormSteps:u})};default:throw Error("Unexpected [selectionType] in `useCustomFunctionProps`")}}return[s.zO,s.Ew,s.Qx,s.xh,s.g4,s.yq].includes(a)?{processError:createGSheetsProcessError(e)}:{}},useListsFunctionProps=({parameter:e,value:t,functionId:a,variables:n})=>{let{openFormSteps:r}=(0,M.e)();if([s.rr].includes(a))if(e.dynamic_options.selectionType===d.Il.KEY_VALUE)return{dynamicOptions:(({parameter:e,value:t,variables:a,openFormSteps:n,stepId:r})=>getDynamicOptions({parameter:e,value:t,variables:a,openFormSteps:n,keyAsIndex:!1,shouldUseDefaultTemplateMacro:shouldListsUseDefaultTemplateMacro,stepId:r}))({parameter:e,value:t,variables:n,openFormSteps:r,stepId:a})};else throw Error("Unexpected [selectionType] in `useCustomFunctionProps`");return{}},useNoopProps=()=>({});var F=a(0x1795b5c1b),O=a(0x145d46a61),L=a(0x226892387),D=a(0x9e671ad),P=a(0x12edaa96a),R=a(0x14abc22b0),B=a(0x2b7f0bcc),W=a(0x102edf836),V=a(0xb1ea448c),q=a(0xee467999),H=a(0x20f31dc25);let AlertMarkdown=({text:e})=>n.createElement(B.Ay,{type:"boxed",level:B.A_.error,align:"left"},n.createElement(I.A,{text:e}));AlertMarkdown.displayName="AlertMarkdown";var U=a(0x120c268ad),z=a.n(U),j=a(0x1feee1711),$=a(0x1407c6c2c),G=a(0x11a296110),K=a(0x1d1911997),Y=a(0x2501a2cee),Q=a(0x818fd090);let Z=new o.Ay("workflow_builder"),DefaultLabel=()=>n.createElement("span",{className:"italic"},Z.t("_blank_",{fallbackHash:"f9b302a6528230e8fad06287d3026dae18ccadf3"}));DefaultLabel.displayName="DefaultLabel";var J=a(0x85c4d21),X=a(0x1e19488b9),ee=a(0x1b3ecb90f),et=a(0x9b06c346),ea=a.n(et);let en=new o.Ay("workflow_builder"),SlackFunctionDynamicInputsKeyValueLabelWithSelect=({variables:e,allowVariables:t,value:a,values:r,dynamicInputs:l,parameter:i,onChange:s,onRemove:o,formatVariableBeforeInsert:c,callbackId:d,functionId:u,workflowId:m,stepId:p,isExistingStep:b,functionVariables:f,isFunctionFormWrapped:g,onlyRenderChildInputs:h,focusOnMount:_,activeFieldName:y})=>{let{title:x}=i,v=`dynamic-inputs-key-value-input-${(0,$.A)()}`,{sendMessageToAnnouncerAPI:E}=(0,n.useContext)(R.A),k=(0,n.useCallback)(e=>e?`dynamicinputs-${i.name}-${e}-field`:`dynamicinputs-${i.name}-new-field`,[i.name]),S=(0,n.useMemo)(()=>k(a.key),[k,a.key]),w=(0,n.useCallback)(e=>{s({...a,value:e.value,valueLabel:"valueLabel"in e?e.valueLabel:void 0,filterQueries:"filterQueries"in e?e.filterQueries:void 0},a.key)},[s,a]),C=(0,n.useMemo)(()=>l.filter(e=>e.selectable||e.key===a?.key&&!a.empty).sort((e,t)=>(0,j.A)(e.originalIndex)||(0,j.A)(t.originalIndex)?0:e.originalIndex-t.originalIndex),[l,a?.key,a?.empty]),A=(0,n.useMemo)(()=>l.filter(({visible:e})=>!!e),[l]),T=(0,n.useMemo)(()=>C.map(e=>({label:e.label??e.value??"",value:e.key??""})),[C]),N=(0,n.useCallback)(e=>{let t=k(e?.value);s({...a,key:e.value,value:a?.value??""},t)},[k,s,a]),M=(0,n.useCallback)(e=>e.label&&"string"==typeof e.label?n.createElement("span",null,n.createElement(I.A,{text:e.label,emojiSize:ee.lw.SMALL,noLinking:!0,noHighlights:!0,noCode:!0,noQuotes:!0,noSpecials:!0})):n.createElement(DefaultLabel,null),[]),F=(0,n.useMemo)(()=>{if(!a||a.empty)return;let e=l.find(e=>e.key===a?.key);return{label:e?.label??"",value:e?.key??""}},[a,l]),O=(0,n.useMemo)(()=>T.map(e=>`${e.label}:${e.value}`).join(","),[T]),L=(0,n.useCallback)(()=>{o(a),E({message:en.t("A field has been removed."),uuid:(0,P.A)()})},[o,a,E]),D=(0,n.useMemo)(()=>F?.value&&i.properties?.[F.value]?(0,Q.w)(i.properties[F.value]):void 0,[i.properties,F]),B=(0,n.useMemo)(()=>!!(h&&D?.isParameterFormWrapped),[h,D?.isParameterFormWrapped]),W=(0,n.useMemo)(()=>A.some(e=>{let t=e.key&&i.properties?.[e.key]?(0,Q.w)(i.properties[e.key]):void 0;return!t?.isParameterFormWrapped}),[i.properties,A]),V=(0,n.useMemo)(()=>B&&W,[W,B]);return n.createElement("div",{className:ea().row,"data-qa":`${S}-row`},n.createElement("div",{className:ea().cell},n.createElement(K.Ay,{key:O,ariaLabel:x,options:T,onOptionSelected:N,placeholderText:en.t("Select a field"),selectedOption:F,selectId:`input-select_${v}`,width:"100%",renderSelectedOption:M,renderOption:M,selectDataQa:S,retainPreviousSelectionOnDelete:!0,isDisabled:B,shouldRefocusInputAfterSelection:!0,expandOnFocus:!1,focusOnMount:_||y===S})),n.createElement("div",{className:ea().cell},n.createElement(J.J,{value:a?.value??"",values:r,parameter:i,variables:e,allowVariables:t,onChange:w,formatVariableBeforeInsert:c,callbackId:d,dynamicInput:a,elementId:v,functionId:u,workflowId:m,stepId:p,isExistingStep:b,functionVariables:f,isFunctionFormWrapped:g,isParameterSyncedWithForm:B,focusOnMount:!_&&y===a.key})),a&&!B?n.createElement("div",{className:z()(ea().closeIconCell,ea().overflowSpace,{align_self_start:a.type===X.J5.TimeStamp,margin_top_50:a.type===X.J5.TimeStamp})},n.createElement(G.Nm,{"aria-label":en.t("Remove"),onClick:L},n.createElement(Y.Ah,{name:"close-filled"}))):null,V&&n.createElement("div",{className:ea().overflowSpace,"aria-hidden":!0}))};SlackFunctionDynamicInputsKeyValueLabelWithSelect.displayName="SlackFunctionDynamicInputsKeyValueLabelWithSelect";var er=a(0x1d2cd7755),el=a(0x223beeef);let SlackFunctionDynamicInputsKeyValueLabelWithText=({variables:e,allowVariables:t,value:a,values:r,dynamicInput:l,parameter:i,onChange:s,formatVariableBeforeInsert:o,callbackId:c,functionId:d,workflowId:u,stepId:m,serviceTriggerType:p,isExistingStep:b,functionVariables:f,isFunctionFormWrapped:g,onlyRenderChildInputs:h,focusOnMount:_})=>{let y=`dynamic-inputs-key-value-input-${(0,$.A)()}`,x=(0,n.useMemo)(()=>n.createElement(DefaultLabel,null),[]),v=(0,n.useCallback)(async e=>{s({...l,key:l.key,value:e.value,valueLabel:"valueLabel"in e?e.valueLabel:void 0,filterQueries:"filterQueries"in e?e.filterQueries:void 0})},[s,l]),E=(0,n.useMemo)(()=>l.key&&i.properties?.[l.key]?(0,Q.w)(i.properties[l.key]):void 0,[l.key,i.properties]),k=(0,n.useMemo)(()=>!!(h&&E?.isParameterFormWrapped),[h,E?.isParameterFormWrapped]),S=(0,n.useMemo)(()=>({...i,title:l.label}),[i,l.label]);return n.createElement("div",{className:z()(ea().row,{align_items_baseline:l.type===X.J5.TimeStamp})},n.createElement("div",{className:ea().cell},l.label?n.createElement(el.z,{elementId:y,parameter:S,className:`c-label--has_footer ${ea().cellLabel} `,noMarginBottom:!0,isBold:!1,isAlwaysRequired:l.is_required,isAlwaysOptional:!!i.dynamic_options.options?.is_required_path&&!l.is_required}):n.createElement(er.A,{htmlFor:y,text:x,className:ea().cellLabel,"data-qa-segment-parameter":i.name})),n.createElement("div",{className:ea().cell},n.createElement(J.J,{value:a,values:r,parameter:i,variables:e,allowVariables:t,onChange:v,formatVariableBeforeInsert:o,callbackId:c,dynamicInput:l,elementId:y,functionId:d,workflowId:u,stepId:m,serviceTriggerType:p,isExistingStep:b,functionVariables:f,isFunctionFormWrapped:g,isParameterSyncedWithForm:k,focusOnMount:_})))};SlackFunctionDynamicInputsKeyValueLabelWithText.displayName="SlackFunctionDynamicInputsKeyValueLabelWithText";var ei=a(0x1d4878a74);let es=new o.Ay("workflow_builder"),eo=["canvas_create","channel_canvas_create"],SlackFunctionDynamicInputsKeyValueInput=({value:e,values:t,parsedValues:a,label:r,parameter:l,onValueChange:i,functionId:s,workflowId:o,stepId:c,processError:u,callbackId:m,dynamicOptions:p,serviceTriggerType:b,triggerId:f,isTriggerSegment:g,variables:h,allowVariables:_,formatVariableBeforeInsert:y,isOAuthTokenInvalid:x,isExistingStep:v,functionVariables:E,isFunctionFormWrapped:k,onlyRenderParentInputs:S,onlyRenderChildInputs:w,onLoadingStateChange:C,hasOnlyKeyValueParameter:A})=>{let T=(0,L.d4)(O.$T),I=(0,H.f)({hierarchicalParameterName:[l.name],function:l.dynamic_options.function,workflowId:o,functionId:s,stepId:c,inputs:a,serviceTriggerType:b,triggerId:f,isTriggerSegment:g,isOAuthTokenInvalid:x}),{sendMessageToAnnouncerAPI:N}=(0,n.useContext)(R.A),M=(0,n.useRef)(null),F=l.dynamic_options.options?.max_inline_options??15,[U,z]=(0,n.useState)({}),{isLoading:j,isError:$,errorMessage:G,dynamicOptions:K,displayInline:Y,actions:Q}=(0,q.n)({client:I,value:e,label:r,reducerOptions:{inlineDisplayThreshold:F,processError:u,onValueChange:i,dynamicOptions:p,selectionType:d.Il.KEY_VALUE,isParameterFormWrapped:l.isParameterFormWrapped}}),Z=(0,n.useMemo)(()=>K.filter(e=>e.visible),[K]),J=(0,n.useMemo)(()=>Z.length,[Z.length]),X=(0,n.useMemo)(()=>K.filter(e=>e.selectable).length,[K]),ee=(0,n.useMemo)(()=>K.some(e=>e.empty),[K]),et=K.filter(e=>!e.empty),en=(0,n.useMemo)(()=>et.length,[et.length]),er=(0,n.useMemo)(()=>K.filter(e=>e.is_required).length,[K]),[el,ec]=(0,n.useState)(l.isParameterFormWrapped);(0,n.useEffect)(()=>{M.current&&J-er==0&&M.current.focus()},[J,er]),(0,n.useEffect)(()=>{T&&en&&i?.({value:Z,nonEmptyDynamicOptions:et})},[T,en]),(0,n.useEffect)(()=>{T&&C&&C(j)},[T,j,C]),(0,n.useEffect)(()=>{"function"!=typeof i||(0,D.A)(el,l.isParameterFormWrapped)||(ec(l.isParameterFormWrapped),i({value:Z,nonEmptyDynamicOptions:et}))},[el,l.isParameterFormWrapped]);let ed=(0,n.useCallback)(()=>{Q.ADD_EMPTY_OPTION(),z({name:""}),N({message:es.t("A field has been added, and it has been selected."),uuid:(0,P.A)()})},[Q,N]),eu=(0,n.useCallback)((e,t)=>{Q.CHANGE_OPTION(e),z({name:t})},[Q,z]),em=es.t("Fields to update"),ep=l.title||em,eb=es.t("Values"),ef=(0,n.useCallback)(e=>{Q.CHANGE_OPTION(e),z({name:e.key})},[Q]),eg=(0,n.useCallback)(e=>{let t=Z.filter(e=>!e.is_required),a=t.findIndex(t=>t.key===e.key),n=t[a-1]??t[a+1];n?z({name:n.key,focusOnMount:!0}):z({name:void 0,focusOnMount:void 0}),Q.REMOVE_OPTION(e)},[Q,z,Z]),renderHeader=(e=!1)=>{let t=m&&eo.includes(m);return n.createElement("div",{className:ea().headerRow,"data-qa":`dynamicinputs-${l.name}-key-value-header`},t?n.createElement("div",{className:ea().headerCell},es.t("Update canvas variables")):n.createElement(n.Fragment,null,n.createElement("div",{className:ea().headerCell},ep),n.createElement("div",{className:ea().headerCell},e?es.t("Values (required)"):eb)))};return(renderHeader.displayName="renderHeader",S)?null:j?n.createElement("div",{className:"margin_right_150"},n.createElement(V.A,{color:"blue",size:"jumbo"})):$&&G?n.createElement(AlertMarkdown,{text:G}):K&&(l.is_required||0!==K.length)?l.is_required&&0===K.length?n.createElement(B.Ay,{type:"boxed",level:"warning",icon:"warning",align:"left"},n.createElement("span",null,es.t("The step cannot be saved because {fieldName} field is required but there are no available options for it.",{fieldName:ep}))):Y?n.createElement(n.Fragment,null,!A&&n.createElement("hr",null),renderHeader(),Z.map(e=>n.createElement(SlackFunctionDynamicInputsKeyValueLabelWithText,{key:e.key||e.index,parameter:l,dynamicInput:e,value:e.value??"",values:t,onChange:ef,functionId:s,workflowId:o,stepId:c,callbackId:m,serviceTriggerType:b,variables:h,allowVariables:_,formatVariableBeforeInsert:y,isExistingStep:v,functionVariables:E,isFunctionFormWrapped:k,onlyRenderChildInputs:w,focusOnMount:U.name===e.key}))):n.createElement("div",{className:ea().withSelect},!A&&n.createElement("hr",null),er>0?renderHeader(!0):null,Z.map(e=>e.is_required?n.createElement(SlackFunctionDynamicInputsKeyValueLabelWithText,{key:e.key||e.index,parameter:l,dynamicInput:e,value:e.value??"",values:t,onChange:ef,functionId:s,workflowId:o,stepId:c,callbackId:m,serviceTriggerType:b,variables:h,allowVariables:_,formatVariableBeforeInsert:y,isExistingStep:v,functionVariables:E,isFunctionFormWrapped:k,onlyRenderChildInputs:w,focusOnMount:U.name===e.key}):null),!!F&&!T&&n.createElement(B.Ay,{type:"boxed",level:"default",icon:"slack-logo",align:"left",className:ea().alert},n.createElement("span",null,er>0?es.t("You can add optional fields below and assign values to them."):es.t("There are {count} fields. You can add fields below and assign values to them.",{count:en}))),renderHeader(),Z.map(e=>e.is_required?null:n.createElement(SlackFunctionDynamicInputsKeyValueLabelWithSelect,{key:e.key||e.index,parameter:l,value:e,values:t,dynamicInputs:K,onChange:eu,onRemove:eg,functionId:s,workflowId:o,stepId:c,callbackId:m,variables:h,allowVariables:_,formatVariableBeforeInsert:y,isExistingStep:v,functionVariables:E,isFunctionFormWrapped:k,onlyRenderChildInputs:w,focusOnMount:U.name===e.key&&(U.focusOnMount??""===e.key),activeFieldName:U.name})),X>0?n.createElement("div",null,n.createElement(ei.A,null,n.createElement(W.Ay,{type:"outline",size:"small",onClick:ed,disabled:ee,"aria-label":es.t("Add a Field"),ref:M},es.t("Add a Field"))),T&&n.createElement("span",{className:ea().availableFields},es.rt("{selectableDynamicInputCount, plural, =1 {# field} other {# fields}} available",{selectableDynamicInputCount:X}))):null):null};SlackFunctionDynamicInputsKeyValueInput.displayName="SlackFunctionDynamicInputsKeyValueInput";var ec=a(0x18af67efb),ed=a(0x1d01572a2),eu=a(0x1ad596f5f),em=a(0x235d78b7c),ep=a(0x5fb545d6),eb=a(0x40e8839e),ef=a(0xf33a4f91),eg=a(0x152e7cb26),eh=a(0x1ba35eb3b),e_=a(0x1b05cc3ce),ey=a(0x207fb9b92),ex=a(0x1d1437423),ev=a(0x4a120eb2);let eE=new o.Ay("workflow_builder"),SlackFunctionDynamicInputsMultiSelect=({value:e,label:t,values:a,parsedValues:l,parameter:i,onChange:o,required:c,placeholderText:u,functionId:m,workflowId:p,stepId:b,isExistingStep:f,variables:g={list:[],groups:[]},formatVariableBeforeInsert:h,dynamicOptions:_,client:y,serviceTriggerType:x,triggerId:v,isTriggerSegment:E,allowVariables:k,hasDependentField:w,isOAuthTokenInvalid:C,hideLabel:A})=>{let[T,N]=(0,n.useState)(),[F,O]=(0,n.useState)((0,S.mU)(t)??{}),L=(0,$.A)(),[R,B]=(0,n.useState)(L),{onVariableMenuOpen:W}=(0,M.e)(),{name:U,title:z,typeahead:j,typeaheadQueryKey:G,description:K,hint:Y,isParameterFormWrappable:Q}=i,Z=j&&!C,J=!!i.dynamic_options.validation,X=(0,H.f)({hierarchicalParameterName:[i.name],function:i.dynamic_options.function,workflowId:p,functionId:m,stepId:b,values:a,inputs:l,isExistingStep:f,hasValidationFunction:J,serviceTriggerType:x,triggerId:v,isTriggerSegment:E,isOAuthTokenInvalid:C}),et=y||X,ea=i.dynamic_options.request_config?.search?.min_query_length??s.Bp,{isLoading:en,dynamicOptions:er,actions:ei,processSelectOptions:es,errorCode:eo,errorMessage:ek}=(0,q.n)({client:et,value:e,reducerOptions:{selectionType:d.Il.MULTI_SELECT,dynamicOptions:_},typeahead:{typeaheadQueryKey:G},minQueryLength:ea}),eS=(0,n.useMemo)(()=>{if(Y)return[{id:`${U}-hint`,message:Y}]},[Y,U]),ew=eE.t("Select option\u2026"),eC=eE.t("Search options\u2026"),eA=Z?eC:ew,eT=Z?s.vD:s.hU,{errorText:eI,onBlur:eN}=(0,ey.K)({errorMessage:eE.t("This field is required."),isErrored:!!((c||(0,e_.L$)(i))&&!Q)&&(0,r.A)(e)}),[eM,eF]=(0,n.useState)([]);(0,n.useEffect)(()=>{er.length>0&&eF(e=>(0,ec.A)([...e,...er],"value"))},[er]);let{errorText:eO,onChange:eL}=(0,ex.x)({errorMessage:eE.t("1 or more selections are no longer available. Remove to continue."),isErrored:J&&(0,ep.b)(e,eM),shouldErrorPreventSave:!0});(0,ed.A)(eL);let eD=!("can_flatten"in i&&i.can_flatten)&&e&&"string"!=typeof e&&e.length>1&&e.some(e=>(0,ef.x1)(g,String(e))),{errorText:eP,onChange:eR}=(0,ex.x)({errorMessage:eE.t("Variables containing multiple items must be alone",{fallbackHash:"02605f6dabeee59a9b76627b21f072b71011da74"}),isErrored:!!eD,shouldErrorPreventSave:!0}),eB=(0,n.useCallback)(()=>B((0,P.A)()),[]),eW=(0,n.useCallback)(e=>(0,eg.Y)({value:e,typeahead:Z,minQueryLength:ea,errorCode:eo}),[eo,Z,ea]),eV=(0,S.D$)({emptyErrorMessage:eI,apiErrorMessage:ek,mixedArrayErrorMessage:eP,validationErrorMessage:eO}),eq=(0,n.useCallback)(e=>e.map(({value:e})=>e),[]),eH=(0,n.useCallback)((e,t)=>{let a=t&&!(0,r.A)(t)?{[s.x3]:t}:{};return e?.reduce((e,t)=>(e[t.value]=t.label,e),a)},[]),eU=(0,n.useCallback)(e=>{if(!e)return void o(i,[]);let t=e.reduce((e,t)=>{let a=t.value;return a in F&&(e[a]=F[a]),e},{});1===e.length&&"string"==typeof e[0].value&&(0,ef.x1)(g,e[0].value)?o(i,e[0].value,eH(e,t),{shouldInvalidateDependentInputs:!1}):o(i,eq(e),eH(e,t),{shouldInvalidateDependentInputs:!1}),eR(),eL()},[F,eH,eq,o,eR,i,g,eL]),ez=(0,n.useCallback)((a,n)=>(0,eb.l)({optionValue:a,index:n,variables:g,value:e,label:t,dynamicOptions:J?eM:void 0}),[g,e,t,J,eM]),ej=(0,n.useMemo)(()=>{if((0,r.A)(e)||!e)return[];let t=Array.isArray(e)?e:[e];return t?.map((e,t)=>{let a=er.find(t=>(0,D.A)(t.value,e));return a?{key:`${t}-${e}`,label:a.label||"",value:a.value||e}:"string"==typeof e?ez(e,t):{key:`${t}-${e}`,label:"",value:e}})},[er,ez,e]),e$=(0,n.useCallback)(e=>{T&&(O(t=>({...t,[e.value]:T})),N(void 0))},[T,O]),eG=!eI&&!ek&&!eP&&!eO,eK=(0,n.useCallback)(async e=>{e&&N(e);let t=[],a=!!(e||T);if(Z&&a)try{let{options:a,value_type:n}=await et.fetchOptions({typeaheadQueryKey:G,typeaheadQueryValue:e});ei.FETCH_OPTIONS_SUCCESS(a,n),t=es(a,n)}catch(e){ei.FETCH_OPTIONS_ERROR(e)}else t=(0,eu.A)(er,e);return t},[ei,et,er,T,Z,es,G]),eY=(0,n.useCallback)(e=>{let t=e.label??e.value;return n.createElement("span",null,n.createElement(I.A,{text:t,emojiSize:ee.lw.SMALL,noLinking:!0,noHighlights:!0,noCode:!0,noQuotes:!0,noSpecials:!0}))},[]),eQ=(0,n.useCallback)(e=>!!i&&(i.type===d.TE.Array&&"items"in i?(0,eh.yH)(e,i)||(0,eh.xY)({variable:e,parameter:i}):(0,eh.Lm)({variable:e,parameter:i})||(0,eh.xY)({variable:e,parameter:i})),[i]),eZ=(0,n.useCallback)(e=>{let t=ez((h?.(e,{})??e).id,ej.length);eU(ej.concat(t)),eB()},[h,ez,ej,eU,eB]),eJ=(0,n.useMemo)(()=>({enable:!0}),[]);return n.createElement(el.z,{elementId:L,parameter:i,hideLabel:A},n.createElement("div",{className:"display_flex full_width"},en?n.createElement(V.A,{color:"blue",size:"small",className:"align_self_center"}):n.createElement(ev.x,{key:R,ariaLabel:z,search:eK,debounceWaitPeriod:eT,onSelectedItemsChange:eU,emptyStateMessage:eW,minQueryLength:C?void 0:ea,placeholderText:u||K||eA,selectedOptions:ej,selectId:`input-multi-select_${L}`,width:"100%",onBlur:eN,isInvalid:!eG,errors:eV,renderOption:eY,expandOnFocus:!0,selectDataQa:`dynamicinputs-${i.name}-multi-select`,className:"full_width",hints:eS,onOptionSelected:e$}),k&&n.createElement(em.jx,{value:e,onSelect:eZ,data:g.groups,customDataFilter:eQ,renderIconInline:!0,isDisabled:en,onMenuTriggerClick:W,hasDependentField:w,allowEmptyState:!0,className:"margin_left_50 margin_top_50 display_flex align_items_start",inputType:i.type,suggestedVariableConfig:eJ})))};SlackFunctionDynamicInputsMultiSelect.displayName="SlackFunctionDynamicInputsMultiSelect";var ek=a(0x1fc996df8),eS=a(0x88881d67),ew=a(0xcb24a23b),eC=a(0x4b32db5f);let eA=new o.Ay("workflow_builder"),SlackFunctionDynamicInputsVariableMultiSelectInput=({value:e,parameter:t,onChange:a,variables:l,formatVariableBeforeInsert:i,label:s,hideLabel:o})=>{let c=(0,$.A)(),{name:u,title:m,description:p,hint:b}=t,{onVariableMenuOpen:f}=(0,M.e)(),g=(0,n.useMemo)(()=>{if(b)return[{id:`${u}-hint`,message:b}]},[u,b]),[h,_]=(0,n.useState)(c),y=(0,n.useCallback)(()=>_((0,P.A)()),[]),x=!!(t.is_required||(0,e_.L$)(t)),v=(0,n.useCallback)(e=>!!t&&(t.type===d.TE.Array&&"items"in t?(0,eh.yH)(e,t)||(0,eh.xY)({variable:e,parameter:t}):(0,eh.Lm)({variable:e,parameter:t})||(0,eh.xY)({variable:e,parameter:t})),[t]),E=(0,n.useMemo)(()=>(0,eS.PW)(l.groups,v),[v,l.groups]),k=(0,n.useMemo)(()=>(0,eC.T)(E),[E]),S=(0,n.useCallback)(async e=>(0,eu.A)(k,e),[k]),[w]=(0,n.useMemo)(()=>(0,ew.g)({variables:l,id:u,value:e,isRequired:x,parameter:t}),[l,u,e,x,t]),C=(0,n.useCallback)((t,a)=>(0,eb.l)({optionValue:t,index:a,variables:l,value:e,label:s}),[s,l,e]),{onBlur:A,okayToDisplay:T}=(0,ey.K)({errorMessage:void 0,isErrored:w.length>0,shouldErrorPreventSave:!0}),I=(0,n.useCallback)(e=>{a(t,e.map(e=>e.value))},[a,t]),N=(0,n.useMemo)(()=>(0,r.A)(e)?[]:"string"==typeof e?[C(e,0)]:(e||[]).map((e,t)=>C(String(e),t)),[C,e]),F=(0,n.useCallback)(e=>{let t=C((i?.(e,{})??e).id,N.length);N.find(e=>e.value===t.value)||I(N.concat(t)),y()},[i,C,N,y,I]),O=(0,n.useMemo)(()=>({enable:!0}),[]);return n.createElement(el.z,{elementId:c,parameter:t,hideLabel:o},n.createElement("div",{className:"display_flex full_width"},n.createElement(ev.x,{key:h,ariaLabel:m,search:S,width:"100%",hints:g,selectId:`input-variable-multi-select_${c}`,selectDataQa:`dynamicinputs-${u}-variable-multi-select`,errors:T?w:void 0,onBlur:A,expandOnFocus:!0,selectedOptions:N,onSelectedItemsChange:I,isInvalid:w.length>0&&T,className:"full_width",placeholderText:p||eA.t("Select option\u2026")}),n.createElement(em.jx,{value:e,onSelect:F,data:l.groups,customDataFilter:v,className:"margin_left_50 margin_top_50 display_flex align_items_start",renderIconInline:!0,onMenuTriggerClick:f,inputType:t.type,suggestedVariableConfig:O})))};SlackFunctionDynamicInputsVariableMultiSelectInput.displayName="SlackFunctionDynamicInputsVariableMultiSelectInput";var eT=a(0x204ee6449),eI=a(0x162b19a86),eN=a(0xa03b6325),eM=a(0x2772625d),eF=a(0x8d66e557),eO=a(0x19c76d181),eL=a(0x157b4a886),eD=a(0x20cfa1dc2);let eP={groups:[],list:[]},SlackFunctionDynamicInputs=({value:e,label:t,values:a,parameter:o,onChange:c,functionId:u,workflowId:m,variables:p,formatVariableBeforeInsert:b,callbackId:f,oAuthParameter:g,stepId:h,stepErrorCode:_,isExistingStep:y,serviceTriggerType:x,triggerId:v,isTriggerSegment:E,allowVariables:k,hasDependentField:w,functionVariables:C,isFunctionFormWrapped:A,onlyRenderChildInputs:T,onlyRenderParentInputs:I,hideLabel:N,isParameterSyncedWithForm:M,onLoadingStateChange:D,hasOnlyKeyValueParameter:P})=>{let R=(0,L.d4)(eO.WR),B=(0,S.Bp)(o.dynamic_options?.inputs,a),W=(0,eI.Q$)(B),V=!1;"parentInputs"in o&&Array.isArray(o.parentInputs)&&o.parentInputs.length&&!(0,r.A)(W)&&!(0,eF.e)(f)&&(V=(g?o.parentInputs.filter(e=>e!==g.name):o.parentInputs).some(e=>{let t=W[e]?W[e]:a?.[e]?.value;return Array.isArray(t)?t.some(e=>(0,eM.bs)(e)):(0,eM.bs)(t)}));let q=g?W?.[g.name]:void 0,H=(0,n.useMemo)(()=>(0,S._Y)({parsedParameterValues:W,callbackId:f}),[f,W]),U=(0,L.d4)(e=>g?(0,eL.JG)(e,{functionId:u,providerKey:g.oauth2_provider_key}):void 0),z=!g||U&&(0,S.jS)({currentUserId:R,functionAuth:U}),j=(0,n.useMemo)(()=>{let e=(0,eN.L)(q)&&U?.validTokens?.some(({externalTokenId:e})=>e===q.external_token_id);return(_===eD.oh.INVALID_EXTERNAL_TOKEN_IDS||_===eD.oh.INVALID_SERVICE_TRIGGER_EXTERNAL_TOKEN_IDS)&&!e},[U,q,_]),$=(({parameter:e,onChange:t})=>{let a=(0,L.d4)(O.$T);switch(e.dynamic_options.selectionType){case d.Il.SELECT:{let a="typeahead"in e&&!!e.typeahead;return{processError:t=>{if(t)return(0,S.P)({parameter:e,error:t?.data})},onValueChange:({value:n,dynamicOption:r})=>{let l=r&&"filterQueries"in r?r.filterQueries:void 0,i=a&&l?{[s.x3]:l}:{},o=n&&r?{...i,[n]:r.label}:void 0;t(e,n,o)}}}case d.Il.MULTI_SELECT:return{};case d.Il.KEY_VALUE:return{processError:t=>{if(t)return(0,S.P)({parameter:e,error:t?.data})},onValueChange:({value:n,nonEmptyDynamicOptions:r,isNewDynamicOption:l})=>{let{value:i,label:s}=(0,S.$w)({value:n,parameter:e,dynamicOptions:r}),o=r?.filter(({visible:e})=>!!e)??[];t(e,i,s,{shouldSetSegmentState:()=>(0,S.sg)(e)&&!!r?.length,setSegmentState:(e,t,n)=>(0,F.g)(e,t,a?r??[]:o,!a&&l),dynamicInputState:{options:r}})}};default:throw Error("Unexpected [selectionType] in `useDefaultProps`")}})({parameter:o,onChange:c}),G=(({parameter:e,value:t,functionId:a,variables:n,canUserManageStep:r,onChange:l})=>(e=>{switch(e){case s.yZ:case s.m$:case s.zO:case s.Ew:case s.Qx:case s.xh:case s.g4:case s.yq:return useGSheetsFunctionProps;case s.rr:return useListsFunctionProps;default:return useNoopProps}})(a)({parameter:e,value:t,functionId:a,variables:n,canUserManageStep:r,onChange:l}))({parameter:o,value:e,functionId:u,variables:p,canUserManageStep:z,onChange:c}),K={...$,...G},renderDI=()=>{switch(o.dynamic_options.selectionType){case d.Il.SELECT:if(M)return n.createElement(i.C,{value:e,parameter:o,variables:p});if(k&&V)return n.createElement(eT.F,{value:e||"",parameter:o,onChange:c,variables:p??eP,formatVariableBeforeInsert:b,hideLabel:N});return n.createElement(ek.L,{key:o.name,value:e||"",label:t,values:a,parsedValues:W,parameter:o,required:!!o.is_required,functionId:u,workflowId:m,stepId:h,callbackId:f,isExistingStep:y,variables:p,allowVariables:k,formatVariableBeforeInsert:b,serviceTriggerType:x,triggerId:v,isTriggerSegment:E,hasDependentField:w,isOAuthTokenInvalid:j,hideLabel:N,...K});case d.Il.MULTI_SELECT:if(M)return n.createElement(i.C,{value:e,parameter:o,variables:p});if(k&&V)return n.createElement(SlackFunctionDynamicInputsVariableMultiSelectInput,{value:e,parameter:o,onChange:c,label:t,variables:p??eP,formatVariableBeforeInsert:b,hideLabel:N});return n.createElement(SlackFunctionDynamicInputsMultiSelect,{key:o.name,value:e,label:t,values:a,parsedValues:W,parameter:o,required:!!o.is_required,onChange:c,functionId:u,workflowId:m,stepId:h,isExistingStep:y,variables:p,allowVariables:k,formatVariableBeforeInsert:b,serviceTriggerType:x,triggerId:v,isTriggerSegment:E,hasDependentField:w,isOAuthTokenInvalid:j,hideLabel:N});case d.Il.KEY_VALUE:if(V)return;return n.createElement(SlackFunctionDynamicInputsKeyValueInput,{key:o.name,value:e??l.t0,values:a,parsedValues:W,label:t,parameter:o,variables:p,allowVariables:k,formatVariableBeforeInsert:b,callbackId:f,functionId:u,workflowId:m,stepId:h,serviceTriggerType:x,triggerId:v,isTriggerSegment:E,isOAuthTokenInvalid:j,isExistingStep:y,functionVariables:C,isFunctionFormWrapped:A,onlyRenderParentInputs:I,onlyRenderChildInputs:T,onLoadingStateChange:D,hasOnlyKeyValueParameter:P,...K});default:return null}};return(renderDI.displayName="renderDI",H)?null:n.createElement(n.Fragment,null,renderDI())};SlackFunctionDynamicInputs.displayName="SlackFunctionDynamicInputs"},0x85c4d21:(e,t,a)=>{"use strict";a.d(t,{J:()=>SlackFunctionDynamicInputsKeyValueInput});var n=a(0xbad225b5),r=a(0x21f3c49e8),l=a(0x20482ad21),i=a(0x11a296110),s=a(0xb1ea448c),o=a(0x8716533d),c=a(0x818fd090),d=a(0xa4a4f43b),u=a(0x9e671ad),m=a(0x12edaa96a),p=a(0x15014e268),b=a(0x235d78b7c),f=a(0x242822dfb),g=a(0x137f92494),h=a(0x21e82d4ab),_=a(0x1d3dd4cbe),y=a(0x668181b3),x=a(0x2772625d),v=a(0x1d62f3e69),E=a(0x207fb9b92);let k=new l.Ay("workflow_builder"),SlackFunctionDynamicInputsKeyValueBooleanInput=({value:e,parameter:t,variables:a={list:[],groups:[]},allowVariables:r,onChange:l,customDataFilter:i,formatVariableBeforeInsert:s,elementId:o,ariaLabel:c="",dynamicInput:d,isValidEmptyObject:S,hasInvalidVariable:w})=>{let[C,A]=(0,n.useState)(o),T=(0,n.useCallback)(()=>A((0,m.A)()),[]),{onVariableMenuOpen:I}=(0,_.e)(),{isParameterFormWrappable:N}=t,M=!!d.is_required&&!N,F=(0,n.useCallback)(e=>{if("string"==typeof e.value&&(0,x.bs)(e.value)){let t=(0,y.x)(a.list,e.value);return t||(t=(0,v.x7)(e.value,d.type)),n.createElement(h.j,{variable:t})}return n.createElement("span",null,e.label??e.value)},[d,a.list]),O=(0,n.useCallback)(e=>{if("string"==typeof e.value&&(0,x.bs)(e.value)){let t=(0,y.x)(a.list,e.value),r=(0,v.x7)(e.value,d.type);return n.createElement(h.j,{variable:t||r,defaultStyle:"highlight"})}return n.createElement("span",null,e.label??e.value)},[d.type,a.list]),L=(0,n.useMemo)(()=>{if(e&&"string"==typeof e)return(0,g.r)(a.list,e)},[e,a.list]),D=(0,n.useMemo)(()=>{let e=[{label:k.t("Yes"),value:"true"},{label:k.t("No"),value:"false"}];return L&&e.push(L),T(),e},[L,T]),P=(0,n.useMemo)(()=>{if(L)return L;let t=String(e),a=D.find(e=>(0,u.A)(e.value,t));return a||(t?{label:"",value:t}:void 0)},[D,L,e]),R=(0,n.useCallback)(e=>{null===e.value?l({value:null}):l({value:"true"===e.value}),setTimeout(()=>T(),0)},[l,T]),B=!M||S||!1===e||e?void 0:k.t("This field is required."),W=(0,n.useMemo)(()=>w?k.t("This variable is not supported in this input field."):void 0,[w]),V=(0,f.D$)({emptyErrorMessage:B,invalidVariableErrorMessage:W}),{errorText:q,onBlur:H}=(0,E.K)({errorMessage:B??W,isErrored:!!V?.length,shouldErrorPreventSave:!0,shouldErrorShowImmediately:!B}),U=(0,n.useCallback)(e=>{l({value:(s?.(e,{})??e).id})},[s,l]),z=(0,n.useMemo)(()=>({enable:!0}),[]);return n.createElement("div",{className:"display_flex"},n.createElement("div",{className:"full_width display_flex"},n.createElement(p.Ay,{options:D,renderOption:F,renderSelectedOption:O,selectedOption:P,onOptionSelected:R,className:"flex_one no_min_width",width:"100%",placeholderText:k.t("Select option\u2026"),selectId:o,key:C,ariaLabel:c,isInvalid:!!q,errors:V,onBlur:H,isRequired:M}),r&&n.createElement(b.jx,{value:e,onSelect:U,data:a.groups,customDataFilter:i,renderIconInline:!0,onMenuTriggerClick:I,inputType:d.type,suggestedVariableConfig:z,allowEmptyState:!0,className:"margin_left_50 margin_top_50 display_flex"})))};SlackFunctionDynamicInputsKeyValueBooleanInput.displayName="SlackFunctionDynamicInputsKeyValueBooleanInput";var S=a(0x2503b7c1),w=a(0x1e586fbba),C=a(0x380ee7b0),A=a(0x1558db00c);let T=new l.Ay("workflow_builder"),I={width:"100%"},SlackFunctionDynamicInputsKeyValueDateInput=({value:e,parameter:t,variables:a,allowVariables:r,onChange:l,formatVariableBeforeInsert:i,elementId:s,ariaLabel:o="",customDataFilter:c,dynamicInput:d,isValidEmptyObject:u,hasInvalidVariable:m})=>{let{viewOnly:p,onVariableMenuOpen:g}=(0,_.e)(),{isParameterFormWrappable:h}=t,y=a?a.groups:[],x=!u&&!!d.is_required&&!e&&!h,{errorId:v,errorMessage:k,isErrored:N}=(0,n.useMemo)(()=>{switch(!0){case x:return{errorId:"is_required",errorMessage:T.t("This field is required."),isErrored:!0};case m:return{errorId:"invalid_variable",errorMessage:T.t("This variable is not supported in this input field."),isErrored:!0};default:return{errorId:void 0,errorMessage:void 0,isErrored:!1}}},[x,m]),{errorText:M,onBlur:F}=(0,E.K)({errorMessage:k,isErrored:N,shouldErrorPreventSave:!0,shouldErrorShowImmediately:!!v&&"is_required"!==v}),O=(0,n.useCallback)(e=>l({value:i(e,{parameterType:t.type}).id}),[i,l,t.type]),L=(0,n.useMemo)(()=>{if("string"==typeof e&&a)return(0,f.r2)(a.list,e)},[e,a]),D=(0,n.useCallback)(e=>{l({value:e})},[l]),P=M?n.createElement(w.A,null,M):null,R=(0,n.useMemo)(()=>({enable:!0}),[]);return L&&a?n.createElement(n.Fragment,null,n.createElement(C.P,{onChange:D,value:e??"",variables:a,customDataFilter:c,label:o,isDisabled:p,formatVariableBeforeInsert:i,parameterType:d.type&&(0,A.G)(d.type)?d.type:void 0}),P):n.createElement(n.Fragment,null,n.createElement("div",{className:"display_flex"},n.createElement(S.b,{onDateChange:D,inputClassName:"margin_bottom_100",dateFormat:"YYYY-MM-DD",displayFormat:"YYYY-MM-DD",selectedDate:e??"",id:s,datePlaceholder:T.t("Select a date"),datePickerDisabled:p,"aria-label":o,onBlur:F,isInvalid:!!M,containerStyle:I}),r&&n.createElement(b.jx,{value:e,onSelect:O,data:y,customDataFilter:c,renderIconInline:!0,isDisabled:p,onMenuTriggerClick:g,inputType:d.type,suggestedVariableConfig:R,allowEmptyState:!0,className:"margin_left_50 margin_top_50 display_flex"})),P)};SlackFunctionDynamicInputsKeyValueDateInput.displayName="SlackFunctionDynamicInputsKeyValueDateInput";var N=a(0x120c268ad),M=a.n(N),F=a(0xe874a88a),O=a(0x2264e6ea3),L=a(0x1ad596f5f),D=a(0x6b359530),P=a(0x88881d67),R=a(0x1c09d8c36),B=a(0x40e8839e),W=a(0xfd04a21a),V=a(0xf33a4f91),q=a(0xcb24a23b),H=a(0x4b32db5f),U=a(0x408bdeff),z=a(0x10d53599f),j=a(0x19dc73101),$=a(0x1aad32b98),G=a(0x1795d8821),K=a(0x2a3fb7ec),Y=a(0x16ed1b0dc),Q=a(0xa985ed31),Z=a(0x4f725d55),J=a(0x226892387),X=a(0xe684f705),ee=a(0xdcfa8f6a),et=a.n(ee);let ea=new l.Ay("workflow_builder"),SlackFunctionDynamicInputsMultiSelectEntities=({value:e,parameter:t,parentParameterName:a,variables:l={list:[],groups:[]},allowVariables:i,onChange:s,formatVariableBeforeInsert:o,elementId:c,ariaLabel:d="",customDataFilter:u,dynamicInput:m,isValidEmptyObject:p})=>{let f=(0,J.d4)(X.cA),{onVariableMenuOpen:g}=(0,_.e)(),{name:h}=t??{},y=m.type,x=ea.t("Select users"),v=ea.t("Select channels"),k=ea.t("Select canvases",{fallbackHash:"6b63a8fee06690326b5a1b0522f47b8b49fd9249",fallbackHashNs:"workflow_builder"}),S=ea.t("Select lists",{fallbackHash:"f6cb8141bafc16ddc019d01dbc0b40ca628b8ff7",fallbackHashNs:"workflow_builder"}),w="multi-select-user-id";switch(y){case G.TE.SlackTypesUserId:w="multi-select-user-id";break;case G.TE.SlackTypesChannelId:w="multi-select-channel-id";break;case G.TE.SlackTypesCanvasId:w="multi-select-canvas-id";break;case G.TE.SlackTypesListId:w="multi-select-list-id";break;default:w="multi-select-user-id"}let C=(0,n.useCallback)(e=>{if(!e)return"";switch(e){case G.TE.SlackTypesUserId:return x;case G.TE.SlackTypesChannelId:return v;case G.TE.SlackTypesCanvasId:return k;case G.TE.SlackTypesListId:return S;default:return x}},[k,v,S,x]),[A,T]=(0,n.useMemo)(()=>(0,q.g)({variables:l,id:`${h}-${c}`,value:e,isRequired:!!m.is_required,parameter:t,isValidEmptyObject:p}),[l,h,c,e,m.is_required,t,p]),I=(0,n.useCallback)((t,a)=>(0,B.l)({optionValue:t,index:a,variables:l,value:e??""}),[e,l]),N=(0,n.useMemo)(()=>(0,P.PW)(l.groups,u),[u,l.groups]),ee=(0,n.useMemo)(()=>i?(0,H.T)(N):[],[i,N]),{onBlur:en,okayToDisplay:er}=(0,E.K)({errorMessage:void 0,isErrored:A.length>0,shouldErrorPreventSave:!0}),el=(0,n.useCallback)(e=>(en(),1===e.length&&l&&(0,V.x1)(l,String(e[0])))?s({value:String(e[0])}):e.length?s({value:e}):s({value:null}),[en,s,l]),ei=(0,n.useCallback)(e=>e?.length?el(e.map(e=>e.value)):void el({value:[]}),[el]),es=(0,n.useMemo)(()=>(0,r.A)(e)||!e?[]:(Array.isArray(e)?e:[e]).map((e,t)=>I(String(e),t)),[I,e]),eo=(0,n.useMemo)(()=>{let e=[G.TE.SlackTypesChannelId,G.TE.SlackTypesUserId,G.TE.SlackTypesCanvasId,G.TE.SlackTypesListId];if((0,K.X)(e,m.type))return{...{[G.TE.SlackTypesChannelId]:V.L6,[G.TE.SlackTypesUserId]:V.R_,[G.TE.SlackTypesCanvasId]:V.jO,[G.TE.SlackTypesListId]:V.vU}[m.type],filter:e=>m.type!==G.TE.SlackTypesTeamId||!(0,O.JV)(e.id)&&(0,$.nO)(f,e.id)}},[m.type,f]),ec=(0,n.useCallback)(e=>(0,Y.A)(e.value)?n.createElement(W.A,{channelId:e.value,showTeamForLocalChannels:!0}):(0,Z.A)(e.value)?n.createElement(z.A,{id:e.value,showAvatar:!0,useShortMode:!0,showPresence:!1}):(0,Q.A)(e.value)?n.createElement(U.A,{id:e.value}):e.data&&e.data.label?n.createElement(D.R,{data:e.data}):e.label,[]),ed=(0,n.useCallback)((e,t)=>{let a=[];if(i){let e=(0,L.A)(ee,t);e.length>0&&a.push(...e)}return e.length>0&&a.push(...e),F.S.resolve(a)},[i,ee]),eu=(0,n.useCallback)(t=>{let a=[];a=Array.isArray(e)?e:e?[e]:[];let n=o?.(t,{})??t;a.includes(n.id)||s({value:[...a,n.id]})},[o,s,e]),em=(0,n.useMemo)(()=>({enable:!0}),[]);return n.createElement("div",{className:"display_flex"},n.createElement(j.h,{key:c,id:c,selectId:c,className:M()(et().entity),width:"100%",onSelectedItemsChange:ei,renderSelectedOption:ec,selectedOptions:es,searcherOptions:eo,renderOption:ec,processOptions:ed,placeholderText:C(y),isInvalid:A.length>0&&er,errors:er?A:void 0,expandOnFocus:!0,selectDataQa:`dynamicinputs-${a}-${m.key}-${w}`,ariaLabel:d,onBlur:en,minOptionsListWidth:R.XK,invalidSelectedTokenIndexes:T}),i&&n.createElement(b.jx,{value:e,onSelect:eu,data:l.groups,customDataFilter:u,renderIconInline:!0,allowEmptyState:!0,inputType:m.type,suggestedVariableConfig:em,onMenuTriggerClick:g,className:"margin_left_50 display_flex align_items_center"}))};SlackFunctionDynamicInputsMultiSelectEntities.displayName="SlackFunctionDynamicInputsMultiSelectEntities";var en=a(0x18af67efb),er=a(0x1d01572a2),el=a(0xee467999),ei=a(0x16bc32721),es=a(0x20f31dc25),eo=a(0x1e19488b9),ec=a(0x5fb545d6),ed=a(0x152e7cb26),eu=a(0x162b19a86),em=a(0x6cc5eee0),ep=a(0x1b3ecb90f),eb=a(0x1d1437423),ef=a(0x4a120eb2);let eg=new l.Ay("workflow_builder"),SlackFunctionDynamicInputsKeyValueMultiSelectInput=({value:e,values:t,parameter:a,parentParameterName:l,nestedDynamicOptions:i,onChange:o,functionId:c,workflowId:d,stepId:p,variables:g={list:[],groups:[]},allowVariables:h,formatVariableBeforeInsert:y,elementId:x,ariaLabel:v="",dynamicInput:k,customDataFilter:S,isValidEmptyObject:w,serviceTriggerType:C,triggerId:A,isTriggerSegment:T,isExistingStep:I})=>{let{typeahead:N,typeaheadQueryKey:M}=i??{},{name:F}=a,O="object"==typeof k?.additional_inputs?k.additional_inputs:{},D=(0,eu.Q$)({...(0,f.Bp)(i?.inputs,t),...O}),[P,W]=(0,n.useState)(x),[H,U]=(0,n.useState)(),[z,j]=(0,n.useState)(k.filterQueries??{}),$=[l];k.key&&$.push(k.key);let G=(0,n.useMemo)(()=>{if(k.available_options)return(0,ei.J)({dynamicOptions:k.available_options,value:e,selectionType:eo.p8.MULTI_SELECT})},[k.available_options,e]),K=N&&!G,Y=G?R.Bp:i?.request_config?.search?.min_query_length??R.Bp,Q=!!i?.validation&&!G,Z=(0,es.f)({hierarchicalParameterName:$,function:i?.function??"",workflowId:d,functionId:c,stepId:p,inputs:D,optionType:k.type,serviceTriggerType:C,triggerId:A,isTriggerSegment:T,hasValidationFunction:Q,isExistingStep:I,additionalInputs:k?.validation_function_additional_inputs,values:t}),{isLoading:J,dynamicOptions:X,actions:ee,errorCode:et,processSelectOptions:ea,errorMessage:eh,isError:e_}=(0,el.n)({client:Z,value:e,reducerOptions:{selectionType:eo.p8.MULTI_SELECT,dynamicOptions:G},typeahead:{typeaheadQueryKey:M},minQueryLength:Y}),{onVariableMenuOpen:ey}=(0,_.e)(),ex=K?eg.t("Search options\u2026"):eg.t("Select options\u2026"),ev=K?R.vD:R.hU,eE=(0,n.useCallback)(e=>(0,ed.Y)({value:e,typeahead:N,minQueryLength:Y,errorCode:et}),[et,Y,N]),[ek,eS]=(0,n.useState)([]);(0,n.useEffect)(()=>{X.length>0&&eS(e=>(0,en.A)([...e,...X],"value"))},[X]);let ew=(0,n.useCallback)(()=>W((0,m.A)()),[]),{errorText:eC,onChange:eA}=(0,eb.x)({errorMessage:eg.t("1 or more selections are no longer available. Remove to continue."),isErrored:Q&&(0,ec.b)(e,ek)||!!G&&(0,ec.b)(e,G),shouldErrorPreventSave:!0});(0,er.A)(eA);let[eT]=(0,n.useMemo)(()=>(0,q.g)({variables:g,id:`${F}-${x}`,value:e,isRequired:!!k.is_required,isValidEmptyObject:w,parameter:a}),[g,F,x,e,k.is_required,w,a]),{onBlur:eI,okayToDisplay:eN}=(0,E.K)({errorMessage:void 0,isErrored:eT.length>0,shouldErrorPreventSave:!0,shouldErrorShowImmediately:!0}),eM=(0,f.D$)({apiErrorMessage:eh,validationErrorMessage:eC}),eF=(0,n.useCallback)((t,a)=>(0,B.l)({optionValue:t,index:a,variables:g,value:e||void 0,label:k.valueLabel||{},dynamicOptions:Q?ek:G}),[g,e,k.valueLabel,Q,ek,G]),eO=(0,n.useMemo)(()=>{if((0,r.A)(e)||!e)return[];let t=Array.isArray(e)?e:[e];return t?.map((e,t)=>{let a=X.find(t=>(0,u.A)(t.value,e));return a?{key:`${t}-${e}`,label:a.label,value:a.value}:"string"==typeof e?eF(e,t):{key:`${t}-${e}`,label:(k.valueLabel||{})[e]??e,value:e}})},[k.valueLabel,X,eF,e]),eL=(0,n.useCallback)(async e=>{e&&U(e);let t=[],a=!!(e||H);if(K&&a)try{let{options:a,value_type:n}=await Z.fetchOptions({typeaheadQueryKey:M,typeaheadQueryValue:e});ee.FETCH_OPTIONS_SUCCESS(a,n),t=ea(a,n)}catch(e){ee.FETCH_OPTIONS_ERROR(e)}else t=(0,L.A)(X,e);return t},[ee,Z,X,H,K,ea,M]),eD=(0,n.useCallback)(e=>{let t=e.label??e.value;return n.createElement("span",null,"string"==typeof t?n.createElement(em.A,{text:t,emojiSize:ep.lw.SMALL,noLinking:!0,noHighlights:!0,noCode:!0,noQuotes:!0,noSpecials:!0}):t)},[]),eP=(0,n.useCallback)(e=>{H&&(j(t=>({...t,[e.value]:H})),U(void 0))},[H,j,U]),eR=(0,n.useCallback)(e=>{if(!e?.length)return void o({value:null});let t=e.reduce((e,t)=>(t.value&&(Array.isArray(e.value)&&e.value.push(t.value),"string"==typeof t.label&&(e.valueLabel[t.value]=t.label),z[t.value]&&(e.filterQueries[t.value]=z[t.value])),e),{value:[],valueLabel:{},filterQueries:{}});1===e.length&&"string"==typeof e[0].value&&(0,V.x1)(g,e[0].value)&&(t.value=e[0].value),j(t.filterQueries??{}),o(t),eA()},[z,o,g,eA]),eB=(0,n.useCallback)(t=>{let a=[];a=Array.isArray(e)?e:e?[e]:[];let n=y?.(t,{})??t;0===a.length&&(0,V.x1)(g,n.id)?o({value:n.id}):a.includes(n.id)||o({value:[...a,n.id]}),ew()},[ew,y,o,e,g]),eW=eT.length>0&&eN||e_&&!!eh||!!eC,eV=(0,n.useMemo)(()=>({enable:!0}),[]);return n.createElement("div",{className:"display_flex"},J?n.createElement(s.A,{className:"margin_top_75",color:"blue",size:"small"}):n.createElement(ef.x,{key:P,className:"flex_one no_min_width",ariaLabel:v,debounceWaitPeriod:ev,minQueryLength:Y,onSelectedItemsChange:eR,onOptionSelected:eP,emptyStateMessage:eE,selectedOptions:eO,placeholderText:ex,selectId:x,width:"100%",expandOnFocus:!0,expandOnClick:!0,onScrollablePage:!0,renderOption:eD,selectDataQa:`dynamicinputs-${l}-${k.key}-multi-select`,search:eL,isInvalid:eW,errors:eN&&eT.length>0?eT:eM,onBlur:eI,minOptionsListWidth:R.XK}),h&&n.createElement(b.jx,{value:e,onSelect:eB,data:g.groups,customDataFilter:S,renderIconInline:!0,onMenuTriggerClick:ey,inputType:k.type,suggestedVariableConfig:eV,allowEmptyState:!0,isDisabled:J,className:"margin_left_50 display_flex align_items_center"}))};SlackFunctionDynamicInputsKeyValueMultiSelectInput.displayName="SlackFunctionDynamicInputsKeyValueMultiSelectInput";var eh=a(0x242c34757),e_=a(0xbbd2a32d),ey=a(0x9b06c346),ex=a.n(ey);let ev=new l.Ay("workflow_builder"),SlackFunctionDynamicInputsKeyValueNumberInput=({value:e,parameter:t,variables:a,allowVariables:r,onChange:l,formatVariableBeforeInsert:i,elementId:s,ariaLabel:o="",dynamicInput:c,customDataFilter:d,isValidEmptyObject:u,hasInvalidVariable:m})=>{let p=(0,n.useRef)(),{onVariableMenuOpen:b}=(0,_.e)(),f=!u&&c.is_required,g=c.type===eo.J5.Integer,{isParameterFormWrappable:h}=t,y=""===e||null===e?NaN:Number(e),v=g?(0,e_.zh)(y):(0,e_.gf)(y),k=y>e_.Ig,S=y<e_.kj,w=v&&!k&&!S||"string"==typeof e&&(0,x.bs)(e)&&!m,C=(0,n.useMemo)(()=>f&&""===e?ev.t("This field is required."):k?ev.t("This number is too large."):S?ev.t("This number is too small."):m?ev.t("This variable is not supported in this input field."):g?ev.t("This is not a valid integer."):ev.t("This is not a valid number."),[g,f,k,S,m,e]),A=(0,n.useMemo)(()=>f&&!h?!w:""!==e&&!w,[w,h,f,e]),{errorText:T,onBlur:I}=(0,E.K)({errorMessage:C,isErrored:A,shouldErrorPreventSave:!0,shouldErrorShowImmediately:!(f&&""===e)&&!w}),N=(0,n.useCallback)(({text:e})=>{let t=e;(0,x.bs)(t)?t=t.replace(/{{(.*?)}}/g,"$1"):t.includes(" ")?t=NaN:""!==t&&null!==t&&(t=Number(e)),l({value:t})},[l]),M=(0,n.useCallback)(e=>{p.current=e},[]);return n.createElement(eh.A,{id:s,initialText:String(e),variables:a,allowVariables:r,ariaLabel:o,shouldAddNewLineOnEnter:!1,onTextChange:N,formatVariableBeforeInsert:i,errorText:T,onBlur:I,placeholder:g?ev.t("Add an integer\u2026",{fallbackHash:"e1142a4bb9420c0f0411e5c57ae951362c99c9b5"}):ev.t("Add a number\u2026",{fallbackHash:"e1142a4bb9420c0f0411e5c57ae951362c99c9b5"}),renderDataMenuLocation:"inline",customDataFilter:d,onSetTextyRef:M,replaceValueOnVariableChange:!0,textyClassName:ex().textyInput,onVariableMenuOpen:b,inputType:c.type})};SlackFunctionDynamicInputsKeyValueNumberInput.displayName="SlackFunctionDynamicInputsKeyValueNumberInput";var eE=a(0xa9a7442);let ek=new l.Ay("workflow_builder"),SlackFunctionDynamicInputsKeyValueSelectInput=({value:e,values:t,parameter:a,parentParameterName:l,nestedDynamicOptions:i,onChange:o,functionId:c,workflowId:d,stepId:p,variables:g={list:[],groups:[]},allowVariables:k,formatVariableBeforeInsert:S,elementId:w,ariaLabel:C="",dynamicInput:A,customDataFilter:T,isValidEmptyObject:I,serviceTriggerType:N,triggerId:M,isTriggerSegment:F,isExistingStep:O,hasInvalidVariable:D,focusOnMount:P})=>{let{typeahead:B,typeaheadQueryKey:W}=i??{},{onVariableMenuOpen:V}=(0,_.e)(),{type:q,isParameterFormWrappable:H}=a,U=!!A.is_required&&!H,z="object"==typeof A?.additional_inputs?A.additional_inputs:{},j=(0,eu.Q$)({...(0,f.Bp)(i?.inputs,t),...z}),[$,K]=(0,n.useState)(w),[Y,Q]=(0,n.useState)(),Z=[l];A.key&&Z.push(A.key);let J=(0,n.useMemo)(()=>{if(A.available_options)return(0,ei.J)({dynamicOptions:A.available_options,value:e,selectionType:G.Il.SELECT})},[A.available_options,e]),X=B&&!J,ee=J?R.Bp:i?.request_config?.search?.min_query_length??R.Bp,et=(0,es.f)({hierarchicalParameterName:Z,function:i?.function??"",workflowId:d,functionId:c,stepId:p,inputs:j,optionType:A.type,serviceTriggerType:N,triggerId:M,isTriggerSegment:F,hasValidationFunction:!!i?.validation&&!J,isExistingStep:O,additionalInputs:A?.validation_function_additional_inputs,values:t}),{isLoading:ea,dynamicOptions:eo,actions:ef,errorCode:eg,processSelectOptions:eh,isError:e_,errorMessage:ey}=(0,el.n)({client:et,value:e,reducerOptions:{selectionType:G.Il.SELECT,dynamicOptions:J},typeahead:{typeaheadQueryKey:W},minQueryLength:ee}),ex=X?ek.t("Search options\u2026"):ek.t("Select option\u2026"),ev=X?R.vD:R.hU,eS=(0,n.useCallback)(e=>(0,ed.Y)({value:e,typeahead:B,minQueryLength:ee,errorCode:eg}),[eg,ee,B]),ew=!!J&&(0,ec.b)(e,J),eC=(0,n.useMemo)(()=>A.valueLabel||{},[A.valueLabel]),eA=e?eC[e]??e:"",{errorText:eT,onChange:eI}=(0,eb.x)({errorMessage:ek.t("{fieldLabel} is no longer available as an option.",{fieldLabel:eA}),isErrored:ew,shouldErrorPreventSave:!0});(0,er.A)(eI);let eN=(0,n.useMemo)(()=>D?ek.t("This variable is not supported in this input field."):void 0,[D]),{errorText:eM,onBlur:eF}=(0,E.K)({errorMessage:ek.t("This field is required."),isErrored:!!(U&&!I&&(0,r.A)(e)&&"number"!=typeof e)}),eO=(0,f.D$)({emptyErrorMessage:eM,apiErrorMessage:ey,validationErrorMessage:eT,invalidVariableErrorMessage:eN}),eL=!!eM||e_&&!!ey||ew||D,eD=(0,n.useCallback)(()=>K((0,m.A)()),[]),eP=(0,n.useMemo)(()=>{if(e&&"string"==typeof e)return(0,f.r2)(g.list,e)},[e,g.list]),eR=(0,n.useMemo)(()=>{if(eP)return eP;let t=eo.find(t=>(0,u.A)(t.value,e));return t||(e?{label:eC[e]??e,value:e}:void 0)},[eo,eP,e,eC]),eB=(0,n.useCallback)(async e=>{e&&Q(e);let t=[],a=!!(e||Y);if(X&&a)try{let{options:a,value_type:n}=await et.fetchOptions({typeaheadQueryKey:W,typeaheadQueryValue:e});ef.FETCH_OPTIONS_SUCCESS(a,n),t=eh(a,n);let r=(0,L.A)(eo.filter(e=>e.selected),e);r.length&&(t=(0,en.A)([...r,...t],"value"))}catch(e){ef.FETCH_OPTIONS_ERROR(e)}else t=(0,L.A)(eo,e);return eP&&!e&&(t=[...t,eP]),t},[Y,X,eP,et,W,ef,eh,eo]),eW=(0,n.useCallback)(e=>{if("string"==typeof e.value&&(0,x.bs)(e.value)){let t=(0,y.x)(g.list,e.value);return t||(t=(0,v.x7)(e.value,q)),n.createElement(h.j,{variable:t})}let t=e.label??e.value;return"string"==typeof t?n.createElement(em.A,{text:t,emojiSize:ep.lw.SMALL,noLinking:!0,noHighlights:!0,noCode:!0,noQuotes:!0,noSpecials:!0}):t},[q,g.list]),eV=(0,n.useCallback)(e=>{if("string"==typeof e.value&&(0,x.bs)(e.value)){let t=(0,y.x)(g.list,e.value),a=(0,v.x7)(e.value,A.type);return n.createElement(h.j,{variable:t||a,defaultStyle:"highlight"})}let t=e.label??e.value;return"string"==typeof t?n.createElement(em.A,{text:t,emojiSize:ep.lw.SMALL,noLinking:!0,noHighlights:!0,noCode:!0,noQuotes:!0,noSpecials:!0}):t},[A.type,g.list]),eq=(0,n.useCallback)(e=>{if(e.value){let t=Y?{[e.value]:Y}:void 0;o({value:e.value,valueLabel:{[e.value]:e.label},filterQueries:t})}else o({value:""});e_&&ef.CLEAR_STATUS_ERROR(),eD()},[ef,Y,eD,e_,o]),eH=(0,n.useCallback)(e=>{o({value:(S?.(e,{})??e).id}),eD()},[eD,S,o]),eU=(0,n.useMemo)(()=>({enable:!0}),[]);return n.createElement("div",{className:"display_flex"},ea?n.createElement(s.A,{className:"margin_top_75",color:"blue",size:"small"}):n.createElement(eE.m,{key:$,className:"full_width",ariaLabel:C,debounceWaitPeriod:ev,minQueryLength:ee,onOptionSelected:eq,emptyStateMessage:eS,selectedOption:eR,placeholderText:ex,selectId:w,width:"100%",renderOption:eW,renderSelectedOption:eV,selectDataQa:`dynamicinputs-${l}-${A.key}-select`,search:eB,onBlur:eF,errors:eO,isInvalid:eL,retainPreviousSelectionOnDelete:!0,isRequired:U,shouldRefocusInputAfterSelection:!0,focusOnMount:P,expandOnFocus:!1}),k&&n.createElement(b.jx,{value:e,onSelect:eH,data:g.groups,customDataFilter:T,renderIconInline:!0,onMenuTriggerClick:V,inputType:a.type,suggestedVariableConfig:eU,allowEmptyState:!0,isDisabled:ea,className:"margin_left_50 margin_top_50 display_flex"}))};SlackFunctionDynamicInputsKeyValueSelectInput.displayName="SlackFunctionDynamicInputsKeyValueSelectInput";var eS=a(0x10b93423f),ew=a(0x1846f5916),eC=a(0x81984638),eA=a.n(eC);let SlackFunctionDynamicInputsSingleSelectEntity=({value:e,parameter:t,variables:a=ew.Gs,allowVariables:r,onChange:l,formatVariableBeforeInsert:i,elementId:s,customDataFilter:o,dynamicInput:c,callbackId:d,isValidEmptyObject:u})=>{let{onVariableMenuOpen:m}=(0,_.e)(),p=(0,n.useCallback)((t,a)=>{a===e?l({value:null}):l({value:a})},[l,e]),f=(0,n.useCallback)(e=>{l({value:(i?.(e,{})??e).id})},[i,l]),g=(0,n.useCallback)(e=>(0,Y.A)(e.value)?n.createElement(W.A,{channelId:e.value,showTeamForLocalChannels:!0}):(0,Z.A)(e.value)?n.createElement(z.A,{id:e.value,showAvatar:!0,useShortMode:!0,showPresence:!1}):(0,Q.A)(e.value)?n.createElement(U.A,{id:e.value}):e.data&&e.data.label?n.createElement(D.R,{data:e.data}):e.label,[]),h=(0,n.useMemo)(()=>({enable:!0}),[]);return n.createElement("div",{className:"display_flex"},n.createElement(eS.O,{variables:a,allowVariables:r,parameter:t,value:e||"",onChange:p,callbackId:d,dynamicInput:c,hasLabel:!1,className:eA().entity,elementId:s,renderOption:g,isValidEmptyObject:u}),r&&n.createElement(b.jx,{value:e,onSelect:f,data:a.groups,customDataFilter:o,renderIconInline:!0,allowEmptyState:!0,inputType:t.type,suggestedVariableConfig:h,onMenuTriggerClick:m,className:"margin_left_50 margin_top_50 display_flex"}))};SlackFunctionDynamicInputsSingleSelectEntity.displayName="SlackFunctionDynamicInputsSingleSelectEntity";var eT=a(0xaec6c584);let eI=new l.Ay("workflow_builder"),SlackFunctionDynamicInputsKeyValueTextInput=({value:e,parameter:t,variables:a,allowVariables:r,onChange:l,formatVariableBeforeInsert:i,callbackId:s,elementId:o,ariaLabel:c="",customDataFilter:d,dynamicInput:u,isValidEmptyObject:m,hasInvalidVariable:p})=>{let{error:b,runAsyncTextValidation:f}=(0,eT.m)(s,t),{onVariableMenuOpen:g,hasValidAppPinBuiltInMessage:h}=(0,_.e)(),{isParameterFormWrappable:y}=t,{errorId:x,message:v,isErrored:k}=(0,n.useMemo)(()=>{switch(!0){case!!(!m&&u.is_required&&!e&&!y):return{errorId:"is_required",message:eI.t("This field is required."),isErrored:!0};case[null,!1].includes(h):return{errorId:"falsy",message:eI.t("This is not a valid message URL or timestamp."),isErrored:!0};case p:return{errorId:"invalid_variable",message:eI.t("This variable is not supported in this input field."),isErrored:!0};default:return{errorId:void 0,message:void 0,isErrored:!1}}},[m,p,u.is_required,e,y,h]),{errorText:S,onBlur:w}=(0,E.K)({errorMessage:v,isErrored:k,shouldErrorPreventSave:!0,shouldErrorShowImmediately:!!x&&"is_required"!==x}),C=b?.errorText??S,A=(0,n.useCallback)(async({text:e})=>{let t=(0,eu.cY)(e);l({value:t}),f&&await f(t)},[l,f]);return n.createElement(eh.A,{id:o,initialText:String(e),variables:a,allowVariables:r,ariaLabel:c,shouldAddNewLineOnEnter:!1,onTextChange:A,formatVariableBeforeInsert:i,errorText:C,onBlur:w,placeholder:eI.t("Add a value\u2026"),renderDataMenuLocation:"inline",customDataFilter:d,textyClassName:ex().textyInput,callbackId:s,onVariableMenuOpen:g,inputType:u.type})};SlackFunctionDynamicInputsKeyValueTextInput.displayName="SlackFunctionDynamicInputsKeyValueTextInput";var eN=a(0x1b1820b2c),eM=a(0x677a139e),eF=a(0x18c090e66),eO=a.n(eF);let eL=new l.Ay("workflow_builder"),SlackFunctionDynamicInputsKeyValueTimestampInput=({value:e,parameter:t,variables:a,allowVariables:r,onChange:l,formatVariableBeforeInsert:i,elementId:s,ariaLabel:o="",customDataFilter:c,isValidEmptyObject:d,dynamicInput:u,hasInvalidVariable:m})=>{let{viewOnly:p,onVariableMenuOpen:g}=(0,_.e)(),{isParameterFormWrappable:h}=t,y=!d&&!!u.is_required&&!e&&!h,{errorId:x,errorMessage:v,isErrored:E}=(0,n.useMemo)(()=>{switch(!0){case y:return{errorId:"is_required",errorMessage:eL.t("This field is required."),isErrored:!0};case m:return{errorId:"invalid_variable",errorMessage:eL.t("This variable is not supported in this input field."),isErrored:!0};default:return{errorId:void 0,errorMessage:void 0,isErrored:!1}}},[y,m]),{onChange:k,errorText:S}=(0,eb.x)({errorMessage:v,isErrored:E,shouldErrorPreventSave:!0,shouldErrorShowImmediately:!!x&&"is_required"!==x}),T=a?a.groups:[],I=(0,n.useCallback)(e=>l({value:i(e,{parameterType:t.type}).id}),[i,l,t.type]),N=(0,n.useMemo)(()=>{if("string"==typeof e&&a)return(0,f.r2)(a.list,e)},[e,a]),M=(0,n.useCallback)(e=>{l({value:e}),k()},[l,k]),F=(0,n.useMemo)(()=>n.createElement(n.Fragment,null,t.hint&&n.createElement(eM.A,{className:"margin_bottom_0"},t.hint),S&&n.createElement(w.A,null,S)),[t.hint,S]),O=(0,n.useMemo)(()=>({enable:!0}),[]);return N?n.createElement(n.Fragment,null,n.createElement(C.P,{onChange:M,value:e??"",variables:a||ew.Gs,customDataFilter:c,label:o,isDisabled:p,formatVariableBeforeInsert:i,parameterType:u.type&&(0,A.G)(u.type)?u.type:void 0}),F):n.createElement(n.Fragment,null,n.createElement("div",{className:eO().timestampWrapper},n.createElement(eN.A,{id:s,className:eO().timestampInlineDateTimePicker,onChange:M,valueFormat:"X",value:e??"","aria-label":o,showTimeZone:!1,disabled:p,isInvalid:!!S}),r&&n.createElement(b.jx,{value:e,onSelect:I,data:T,customDataFilter:c,renderIconInline:!0,isDisabled:p,onMenuTriggerClick:g,inputType:t.type,suggestedVariableConfig:O})),F)};SlackFunctionDynamicInputsKeyValueTimestampInput.displayName="SlackFunctionDynamicInputsKeyValueTimestampInput";var eD=a(0x194fe1f5f);let eP=new l.Ay("workflow_builder"),eR={entities:{members:!1,userGroups:!1,channels:!1,teams:!1},allowEmptyQuery:!1},SlackFunctionDynamicInputsKeyValueVariableInput=({value:e,parameter:t,variables:a,allowVariables:r,onChange:l,elementId:i,dynamicInput:s,isValidEmptyObject:o,hasInvalidVariable:c})=>{let{viewOnly:d}=(0,_.e)(),{isParameterFormWrappable:u}=t,m=!o&&!!s.is_required&&!e&&!u,p=(0,n.useMemo)(()=>{switch(!0){case m:return[{id:"is_required",message:eP.t("This field is required.")}];case c:return[{id:"invalid_variable",message:eP.t("This variable is not supported in this input field.")}];default:return[]}},[m,c]),b=(0,n.useCallback)(e=>{let{id:t}=e;if(t&&a?.list){let e=(0,f.r2)(a.list,t);e&&l({value:e.value})}},[l,a?.list]),g=(0,n.useMemo)(()=>s.type===G.TE.SlackTypesSalesforceDataField?G.TE.SlackTypesSalesforceDataField:void 0,[s.type]);return n.createElement(eD.s,{elementId:i,value:e??"",data:a??ew.Gs,allowVariables:r,onChange:b,allowUsers:!1,allowChannels:!1,allowVariablesByType:g,className:"full_width no_margin",errors:p,isInvalid:p.length>0,isDisabled:d,isRequired:s.is_required,placeholder:eP.t("Select option\u2026"),searcherOptions:eR})};SlackFunctionDynamicInputsKeyValueVariableInput.displayName="SlackFunctionDynamicInputsKeyValueVariableInput";var eB=a(0xb3a43d1e),eW=a(0x2151a9a6),eV=a(0xa224974e),eq=a(0x1d922a37e),eH=a(0xbee49e6c),eU=a(0xa21d3b1e),ez=a(0x1ba35eb3b),ej=a(0x1b05cc3ce),e$=a(0x1ebe91b72),eG=a(0x145d46a61),eK=a(0x2241421be);let eY=new l.Ay("workflow_builder"),containsSingleVariableAsValue=e=>"string"==typeof e&&(0,x.cn)(e)&&(0,x.bs)(e),SlackFunctionDynamicInputsKeyValueInput=({value:e,values:t,parameter:a,variables:l,allowVariables:u,onChange:m,formatVariableBeforeInsert:p,callbackId:b,elementId:g,dynamicInput:h,functionId:_,workflowId:v,stepId:k,serviceTriggerType:S,triggerId:w,isTriggerSegment:C,isExistingStep:A,functionVariables:T,isFunctionFormWrapped:I,isParameterSyncedWithForm:N,shouldRenderRichTextInput:M,focusOnMount:F})=>{let O=(0,J.d4)(eG.B$),{title:L,name:D,description:P}=a,R=h.label||L||P||D,B=(0,f.el)(a),W=(0,n.useMemo)(()=>!a.is_required&&!Object.values(a.properties??{}).some(e=>!0===e.is_required)&&!(0,ej.L$)(a)&&(0,r.A)(t?.[a.name]?.value),[a,t]),q=h?.key&&a.properties?.[h.key]?(0,c.w)(a.properties[h.key]):a,H=eY.t("Value is invalid for this field."),U=(0,n.useMemo)(()=>{var t;return e&&h?.type&&(Array.isArray(e)?!e.every(e=>containsSingleVariableAsValue(e)):!containsSingleVariableAsValue(e))&&(!(0,eH.i5)(e,h.type,h.selection_type)||!M&&(t=h.type,[G.TE.SlackTypesRichText,G.TE.SlackTypesExpandedRichText].includes(t))&&"string"!=typeof e)?[{id:"invalid_value_for_type",message:H}]:[]},[e,h.type,h.selection_type,M,H]);(({errorMessage:e,isErrored:t,shouldErrorPreventSave:a})=>{let{errorText:n,okayToDisplay:r}=(0,E.K)({errorMessage:e,isErrored:t,shouldErrorPreventSave:a??!0,shouldErrorShowImmediately:!0})})({errorMessage:void 0,isErrored:!!U.length});let z=(0,n.useMemo)(()=>l?(0,eU.z)({parameterName:a.name,isKeyValueParameter:!0,dynamicOptionKey:h.key,functionVariables:T,variables:l,isFunctionFormWrapped:I,stepId:k}):l,[h.key,T,I,a.name,k,l]),j=(0,n.useCallback)(e=>!!h.type&&((0,ez.RT)(e,h,_)||(0,ez.uK)(e,h)),[h,_]),$=(0,n.useMemo)(()=>{if("string"==typeof e&&(0,x.cn)(e)){let t=e.match((0,e$.cL)());return!!t&&t.some(e=>{let t=z?(0,y.x)(z.list,e):void 0;return!t||!j(t)})}return!1},[j,e,z]),K=(0,n.useCallback)(()=>{m({value:null})},[m]),Y=(0,n.useCallback)((e,t)=>{if(t&&1===t.length&&z&&(0,V.x1)(z,String(t[0])))return m({value:String(t[0])});m({value:t})},[m,z]),Q=(0,n.useCallback)((e,t)=>{m({value:t})},[m]),Z=(0,n.useMemo)(()=>!!(T?.isLoading&&z?.list&&"string"==typeof e&&(0,x.q4)(e)&&!(0,y.x)(z.list,e)),[T?.isLoading,e,z]),X=(0,n.useCallback)((e,t)=>p((0,eq.F)({variable:e,parameterName:a.name,isKeyValueParameter:!0,dynamicOptionKey:h.key,functionVariables:T}),t),[h.key,p,T,a.name]),ee=(0,n.useCallback)((e,t)=>{let a=X(e,t);if(h.type===eo.J5.String&&(0,ez.rf)(e)){let t=eK.pE.join;if(t)return{...e,id:t.wrapWithMacro(e.id)}}return a},[h.type,X]);if(!h)return null;if(Z)return n.createElement(s.A,{className:"margin_top_75",color:"blue",size:"small"});if(N)return n.createElement(d.C,{value:e,parameter:a,variables:z,dynamicInput:h});if(U.length)return n.createElement("div",{className:"display_flex"},n.createElement("div",{className:"full_width"},n.createElement(o.A,{className:"margin_0",errors:U})),n.createElement("div",{className:"margin_left_50"},n.createElement(i.Ay,{type:"danger",onClick:K},eY.t("Clear"))));switch(h.selection_type){case eo.p8.SINGLE_SELECT:if(!B&&!h.available_options)break;return n.createElement(SlackFunctionDynamicInputsKeyValueSelectInput,{parameter:q,parentParameterName:a.name,nestedDynamicOptions:B,value:e,values:t,variables:z,allowVariables:u,onChange:m,elementId:g,ariaLabel:R,functionId:_,workflowId:v,stepId:k,customDataFilter:j,formatVariableBeforeInsert:ee,dynamicInput:h,isValidEmptyObject:W,serviceTriggerType:S,triggerId:w,isTriggerSegment:C,isExistingStep:A,hasInvalidVariable:$,focusOnMount:F});case eo.p8.MULTI_SELECT:if(h.type===eo.J5.UserId||h.type===eo.J5.ChannelId||h.type===eo.J5.CanvasId||h.type===eo.J5.ListId)return n.createElement(SlackFunctionDynamicInputsMultiSelectEntities,{value:e,isValidEmptyObject:W,parameter:q,parentParameterName:a.name,variables:z,allowVariables:u,onChange:m,customDataFilter:j,formatVariableBeforeInsert:X,elementId:g,ariaLabel:R,dynamicInput:h});if(h.type===eo.J5.FileId||!B&&!h.available_options)break;return n.createElement(SlackFunctionDynamicInputsKeyValueMultiSelectInput,{parameter:q,parentParameterName:a.name,nestedDynamicOptions:B,value:e,values:t,variables:z,allowVariables:u,onChange:m,elementId:g,ariaLabel:R,functionId:_,workflowId:v,stepId:k,customDataFilter:j,formatVariableBeforeInsert:X,dynamicInput:h,isValidEmptyObject:W,serviceTriggerType:S,triggerId:w,isTriggerSegment:C,isExistingStep:A});case eo.p8.BASIC_MULTI_SELECT:{let t=(0,f.KE)(h,a,!!a.isParameterFormWrapped);return n.createElement(eW.m,{key:g,parameter:t,value:(0,r.A)(e)?void 0:e,onChange:Y,variables:z??ew.Gs,formatVariableBeforeInsert:X,allowVariables:u,placeholder:eY.t("Add a value\u2026"),hideLabel:!0})}case eo.p8.NONE:default:if(h.type===eo.J5.Integer||h.type===eo.J5.Number)return n.createElement(SlackFunctionDynamicInputsKeyValueNumberInput,{value:e,parameter:q,variables:z,allowVariables:u,onChange:m,customDataFilter:j,formatVariableBeforeInsert:X,elementId:g,ariaLabel:R,dynamicInput:h,isValidEmptyObject:W,hasInvalidVariable:$});if(h?.type===eo.J5.Boolean)return n.createElement(SlackFunctionDynamicInputsKeyValueBooleanInput,{value:e,parameter:q,variables:z,allowVariables:u,onChange:m,customDataFilter:j,formatVariableBeforeInsert:X,elementId:g,ariaLabel:R,isValidEmptyObject:W,dynamicInput:h,hasInvalidVariable:$});if(h?.type===eo.J5.Date)return n.createElement(SlackFunctionDynamicInputsKeyValueDateInput,{value:e,parameter:q,variables:z,allowVariables:u,onChange:m,customDataFilter:j,formatVariableBeforeInsert:X,elementId:g,ariaLabel:R,dynamicInput:h,isValidEmptyObject:W,callbackId:b,hasInvalidVariable:$});if(h?.type===eo.J5.TimeStamp&&O)return n.createElement(SlackFunctionDynamicInputsKeyValueTimestampInput,{value:e,parameter:q,variables:z,allowVariables:u,onChange:m,customDataFilter:j,formatVariableBeforeInsert:X,elementId:g,ariaLabel:R,dynamicInput:h,isValidEmptyObject:W,callbackId:b,hasInvalidVariable:$});if(h?.type===eo.J5.SalesforceDataField)return n.createElement(SlackFunctionDynamicInputsKeyValueVariableInput,{value:e,parameter:q,variables:z,allowVariables:u,onChange:m,customDataFilter:j,formatVariableBeforeInsert:X,elementId:g,ariaLabel:R,dynamicInput:h,isValidEmptyObject:W,callbackId:b,hasInvalidVariable:$});if(h.type===eo.J5.UserId||h.type===eo.J5.ChannelId||h.type===eo.J5.CanvasId||h.type===eo.J5.ListId)return n.createElement(SlackFunctionDynamicInputsSingleSelectEntity,{value:e,parameter:a,variables:z,allowVariables:u,onChange:m,customDataFilter:j,formatVariableBeforeInsert:X,elementId:g,callbackId:b,dynamicInput:h,isValidEmptyObject:W});if(h.type===eo.J5.RichText&&M)return n.createElement(eV.h,{value:(0,eH.p_)(e)&&e||(0,eH.FI)(e)&&e||"",allowVariables:u,onChange:Q,formatVariableBeforeInsert:X,variables:z||ew.Gs,parameter:(0,f.KE)((0,eB.G)(h),a,!0),required:a.is_required,callbackId:b,stepId:k,hideLabel:!0})}return n.createElement(SlackFunctionDynamicInputsKeyValueTextInput,{value:e,parameter:q,variables:z,allowVariables:u,onChange:m,customDataFilter:j,formatVariableBeforeInsert:ee,callbackId:b,elementId:g,ariaLabel:R,dynamicInput:h,isValidEmptyObject:W,hasInvalidVariable:$})};SlackFunctionDynamicInputsKeyValueInput.displayName="SlackFunctionDynamicInputsKeyValueInput"},0x1fc996df8:(e,t,a)=>{"use strict";a.d(t,{L:()=>SlackFunctionDynamicInputsSelectInput});var n=a(0xbad225b5),r=a(0x21f3c49e8),l=a(0x18af67efb),i=a(0x1407c6c2c),s=a(0x20482ad21),o=a(0x12edaa96a),c=a(0xb1ea448c),d=a(0x1ad596f5f),u=a(0x235d78b7c),m=a(0x1c09d8c36),p=a(0xee467999),b=a(0x20f31dc25),f=a(0x242822dfb),g=a(0x21e82d4ab),h=a(0x223beeef),_=a(0x152e7cb26),y=a(0x1ba35eb3b),x=a(0x1d3dd4cbe),v=a(0x668181b3),E=a(0x2772625d),k=a(0x1b05cc3ce),S=a(0x6cc5eee0),w=a(0x1b3ecb90f),C=a(0xb0ca8936),A=a(0x1d9a37519),T=a(0x1d62f3e69),I=a(0x207fb9b92),N=a(0x145d46a61),M=a(0xa9a7442),F=a(0x1795d8821),O=a(0x4003bce0),L=a(0x226892387),D=a(0x11e7d7571),P=a.n(D);let R=new s.Ay("workflow_builder"),SlackFunctionDynamicInputsSelectInput=({required:e,value:t,label:a,values:s,parsedValues:D,parameter:B,functionId:W,workflowId:V,processError:q,onValueChange:H,onSuccess:U,dynamicOptions:z,selectProps:j={},stepId:$,callbackId:G,isExistingStep:K,variables:Y={list:[],groups:[]},formatVariableBeforeInsert:Q,client:Z,serviceTriggerType:J,triggerId:X,isTriggerSegment:ee,allowVariables:et,hasDependentField:ea,isOAuthTokenInvalid:en,hideLabel:er})=>{let el=(0,i.A)(),[ei,es]=(0,n.useState)(((e,t)=>{if(!t)return;let a=(0,f.mU)(e);if(a?.[t])return a[t];let[n]=e&&Array.isArray(e[m.x3])?e[m.x3]:[];return n})(a,t)),[eo,ec]=(0,n.useState)(el),ed=(0,n.useCallback)(()=>ec((0,o.A)()),[]),{onVariableMenuOpen:eu}=(0,x.e)(),[em,ep]=(0,n.useState)(!1),{name:eb,title:ef,typeahead:eg,typeaheadQueryKey:eh,description:e_,hint:ey,isParameterFormWrappable:ex}=B,ev=!!(e||(0,k.L$)(B))&&!ex,eE=eg&&!en,ek=B.dynamic_options.request_config?.search?.min_query_length??m.Bp,eS=eE?R.t("Search options\u2026"):R.t("Select option\u2026"),ew=eE?m.vD:m.hU,eC=(0,b.f)({hierarchicalParameterName:[B.name],function:B.dynamic_options.function,workflowId:V,functionId:W,stepId:$,values:s,inputs:D,isExistingStep:K,hasValidationFunction:!!B.dynamic_options.validation,serviceTriggerType:J,triggerId:X,isTriggerSegment:ee,isOAuthTokenInvalid:en}),eA=Z||eC,{isLoading:eT,dynamicOptions:eI,actions:eN,processSelectOptions:eM,isError:eF,errorCode:eO,errorMessage:eL}=(0,p.n)({client:eA,value:t,reducerOptions:{selectionType:F.Il.SELECT,onValueChange:H,onSuccess:U,dynamicOptions:z,processError:q},typeahead:{typeaheadQueryKey:eh},minQueryLength:ek}),eD=(0,L.d4)(N.dq),eP=(0,n.useMemo)(()=>"string"==typeof t?(0,f.r2)(Y.list,t):void 0,[t,Y.list]),eR=(0,n.useMemo)(()=>{if(eP)return eP;let e=eI.find(e=>e.selected);return e||(t&&"string"==typeof a?.[t]?{label:a[t],value:t}:t?{label:"",value:t}:void 0)},[eI,a,eP,t]),eB=(0,n.useMemo)(()=>{if(ey)return[{id:`${eb}-hint`,message:ey}]},[ey,eb]),eW=(0,n.useCallback)(e=>(0,_.Y)({value:e,typeahead:eE,minQueryLength:ek,errorCode:eO}),[eO,eE,ek]),eV=(0,n.useMemo)(()=>{if("string"==typeof t&&(0,E.bs)(t)){let e=(0,v.x)(Y.list,t);return!e||!e.isAvailable}return!1},[t,Y]),eq=(0,n.useMemo)(()=>"string"==typeof t&&"canvas"===t&&"canvas_tab"===B.name,[t,B]),eH=(0,n.useMemo)(()=>eV?R.t("This variable is not supported in this input field."):void 0,[eV]),eU=(0,n.useMemo)(()=>{let e=R.t("Choose a canvas that has been added as a tab in the channel, or add a canvas as a tab, and then refresh to select it here.");return eq?e:void 0},[eq]),{errorText:ez,onBlur:ej}=(0,I.K)({errorMessage:R.t("This field is required."),isErrored:!!ev&&(0,r.A)(t)&&"number"!=typeof t}),e$=(0,f.D$)({emptyErrorMessage:ez,apiErrorMessage:eL,invalidVariableErrorMessage:eH,invalidCanvasVariableErrorMessage:eU}),eG=!!ez||eF&&!!eL||eV||eq,eK=(0,n.useCallback)(async e=>{es(e);let t=[],a=!!(e||ei);if(eE&&a)try{let{options:a,value_type:n}=await eA.fetchOptions({typeaheadQueryKey:eh,typeaheadQueryValue:e});eN.FETCH_OPTIONS_SUCCESS(a,n),t=eM(a,n);let r=(0,d.A)(eI.filter(e=>e.selected),e);r.length&&(t=(0,l.A)([...r,...t],"value"))}catch(e){eN.FETCH_OPTIONS_ERROR(e)}else t=(0,d.A)(eI,e);return eP&&!e&&(t=[...t,eP]),t},[eN,eA,eI,ei,eE,eM,eP,eh]),eY=(0,n.useCallback)(e=>{let t=!e.value,a=ei?{[e.value]:ei}:{};t?eN.SELECT_OPTION(void 0):eN.SELECT_OPTION({...e,filterQueries:a}),ep(!0),ed()},[eN,ed,ei]),eQ=(0,n.useCallback)(e=>eD&&G&&G===F.oW.AskAgentforce&&"string"==typeof e.value&&(0,O.Ay)(e.value),[eD,G]),eZ=(0,n.useMemo)(()=>(e,t)=>n.createElement("div",{className:"display_flex gap_50 align_items_center"},n.createElement(A.z,{appId:e,size:20,width:20,height:20}),n.createElement(C.EY,{color:"inherit"},t)),[]),eJ=(0,n.useCallback)(e=>{if("string"==typeof e.value&&(0,E.bs)(e.value)){let t=(0,v.x)(Y.list,e.value);return t||(t=(0,T.x7)(e.value,B.type)),n.createElement(g.j,{variable:t})}return"string"==typeof e.value&&"string"==typeof e.label&&eQ(e)?eZ(e.value,e.label):"string"==typeof e.label?n.createElement(S.A,{text:e.label,emojiSize:w.lw.SMALL,noLinking:!0,noHighlights:!0,noCode:!0,noQuotes:!0,noSpecials:!0}):e.label},[B.type,Y.list,eZ,eQ]),eX=(0,n.useCallback)(e=>{if("string"==typeof e.value&&(0,E.bs)(e.value)){let t=(0,v.x)(Y.list,e.value);return t||(t=(0,T.x7)(e.value,B.type)),n.createElement(g.j,{variable:t,defaultStyle:"highlight"})}return"string"==typeof e.value&&"string"==typeof e.label&&eQ(e)?eZ(e.value,e.label):"string"==typeof e.label?n.createElement(S.A,{text:e.label,emojiSize:w.lw.SMALL,noLinking:!0,noHighlights:!0,noCode:!0,noQuotes:!0,noSpecials:!0}):e.label},[B.type,Y.list,eZ,eQ]),e0=(0,n.useCallback)(e=>!!B&&((0,y.Lm)({variable:e,parameter:B})||(0,y.xY)({variable:e,parameter:B})),[B]),e1=(0,n.useCallback)(e=>{let t=Q?.(e,{})??e,a=(0,f.r2)(Y.list,t.id);a&&eN.SELECT_OPTION(a),ed()},[eN,ed,Q,Y.list]),e2=(0,n.useMemo)(()=>({enable:!0}),[]);return n.createElement(h.z,{elementId:el,parameter:B,hideLabel:er},n.createElement("div",{className:"full_width display_flex"},eT?n.createElement(c.A,{color:"blue",size:"small",className:"align_self_center"}):n.createElement(M.m,{key:eo,className:P().select,ariaLabel:ef,search:eK,debounceWaitPeriod:ew,minQueryLength:en?void 0:ek,onOptionSelected:eY,selectedOption:eR,placeholderText:e_||eS,selectId:el,width:"100%",renderOption:eJ,renderSelectedOption:eX,selectDataQa:`dynamicinputs-${B.name}-select`,emptyStateMessage:eW,onBlur:ej,isInvalid:eG,errors:e$,hints:eB,retainPreviousSelectionOnDelete:!0,isRequired:ev,focusOnMount:em,expandOnFocus:!1,...j}),et&&n.createElement(u.jx,{value:t,onSelect:e1,data:Y.groups,customDataFilter:e0,renderIconInline:!0,isDisabled:eT,onMenuTriggerClick:eu,hasDependentField:ea,allowEmptyState:!0,className:"margin_left_50 margin_top_50 display_flex align_items_start",inputType:B.type,suggestedVariableConfig:e2})))};SlackFunctionDynamicInputsSelectInput.displayName="SlackFunctionDynamicInputsSelectInput"},0xb3a43d1e:(e,t,a)=>{"use strict";a.d(t,{G:()=>createDynamicOptionFromDynamicInput});let createDynamicOptionFromDynamicInput=e=>{let{empty:t=!1,index:a,key:n="",label:r="",selected:l,selectable:i,visible:s,value:o}=e;return{...e,key:n,label:r,empty:"boolean"==typeof t&&t,index:"number"==typeof a?a:0,selectable:i??!1,selected:"boolean"==typeof l&&l,visible:"boolean"==typeof s&&s,value:o}}},0x8e309e4d:(e,t,a)=>{"use strict";a.d(t,{c:()=>createDynamicOptionFromParameter});var n=a(0x1e19488b9),r=a(0xb4d361ed),l=a(0x1795d8821);let createDynamicOptionFromParameter=e=>{let{type:t,title:a,additionalInputs:i,name:s,availableOptions:o}=e,c=(0,r.q)(e)?e.dynamic_options?.selectionType:void 0,d=t===l.TE.Array,u={label:a,selection_type:!c&&d?n.p8.MULTI_SELECT:c,type:d?e.items.type:t,key:s};return o&&(u.available_options=o),i&&(u.additional_inputs=i),u}},0x40e8839e:(e,t,a)=>{"use strict";a.d(t,{l:()=>makeOptionForDynamicMultiSelectInput});var n=a(0x20482ad21),r=a(0x137f92494),l=a(0xf33a4f91);let i=new n.Ay("workflow_builder"),makeOptionForDynamicMultiSelectInput=({optionValue:e,index:t,variables:a,value:n,label:s,dynamicOptions:o})=>{let c=n&&"string"!=typeof n&&n.length>1&&n.some(e=>(0,l.x1)(a,String(e))),d=`${t}-${e}`,u=(0,r.r)(a.list,e);return u?(0,l.x1)(a,e)?{...u,label:i.t("{selectedDataLabel} (multiple)",{selectedDataLabel:u.label}),isError:!!c}:{...u,key:d}:{key:d,label:"string"==typeof s?.[e]?s[e]:e,value:e,isError:!!o&&!o.some(t=>t.value===e)}}},0x21e82d4ab:(e,t,a)=>{"use strict";a.d(t,{j:()=>WorkflowToken});var n=a(0xbad225b5),r=a(0x120c268ad),l=a.n(r),i=a(0x1282104f7),s=a(0x1f1acac35),o=a.n(s);let c={name:"css"},WorkflowToken=({variable:e,className:t,defaultStyle:a="inherit",isDisabled:r})=>{let s=!e.isAvailable,d="highlight"===a&&!s&&!r,u=l()(o().token,{[o().highlight]:d,[o().invalid]:s},t);return n.createElement(i.A,{svgIcon:c,size:"small",className:u,entityId:e.id,label:e.label||e.defaultLabel,isInvalid:s,isDisabled:r})};WorkflowToken.displayName="WorkflowToken"},0x1f90df740:(e,t,a)=>{"use strict";a.d(t,{b:()=>SegmentParameterFieldSet});var n=a(0xbad225b5),r=a(0x120c268ad),l=a.n(r),i=a(0x20482ad21),s=a(0xd2bf4d47),o=a(0x1d57b7d4c),c=a(0x2cc8fa56),d=a.n(c);let u=new i.Ay("workflow_builder"),SegmentParameterFieldSet=({parameter:e,children:t,className:a})=>{let{title:r,name:i,description:c}=e;return n.createElement(s.A,{"data-qa-segment-parameter":e.name,className:l()(d().container,a)},n.createElement(o.A,null,r??i??c," ",!e.is_required&&u.t("(optional)",{fallbackHashNs:"app_dialog",fallbackHash:"b16c7ac6faff07d7e255da685e52bd66d3bf1575"})),t)};SegmentParameterFieldSet.displayName="SegmentParameterFieldSet"},0x1d8fafe9f:(e,t,a)=>{"use strict";a.d(t,{F:()=>DisabledWorkflowToken});var n=a(0xbad225b5),r=a(0x21e82d4ab),l=a(0x668181b3),i=a(0x1d62f3e69);let DisabledWorkflowToken=({value:e,variables:t,parameterType:a})=>{let s=(0,l.x)(t.list,e);return s||(s=(0,i.x7)(e,a)),n.createElement(r.j,{variable:s,className:"inline_block",isDisabled:!0})};DisabledWorkflowToken.displayName="DisabledWorkflowToken"},0x17ee9cd72:(e,t,a)=>{"use strict";a.d(t,{a:()=>FormWrappedFieldList});var n=a(0xbad225b5),r=a(0x202470d56),l=a(0x130d89881),i=a(0x20482ad21),s=a(0x24f1e08bb),o=a(0x1d2cd7755),c=a(0x1a043bf26),d=a(0x1903d373d),u=a(0x818fd090),m=a(0x242822dfb),p=a(0x120c268ad),b=a.n(p),f=a(0x8716533d),g=a(0x344bb842),h=a(0x2501a2cee),_=a(0x4c96e5d9),y=a(0x1fdec3e16),x=a(0xc62077ca),v=a(0x1d8fafe9f),E=a(0x211a99e2f),k=a(0x2772625d),S=a(0x247cf31a2),w=a(0xf4097f62),C=a(0x6cc5eee0),A=a(0x231441bf2),T=a(0x1b3ecb90f),I=a(0x1991a9b6d),N=a(0x1795d8821),M=a(0x6960d8b9),F=a(0x18c49b4c3),O=a.n(F);let L=new i.Ay("workflow_builder"),DefaultWrappedFormValue=({parameterType:e,value:t,label:a,variables:r})=>{if("string"==typeof t){if((0,k.bs)(t))return n.createElement(v.F,{value:t,variables:r,parameterType:e});if((0,k.cn)(t))return n.createElement(E.l,{text:t,variables:r,parameterType:e})}let l="string"==typeof t?t:void 0,i=("string"==typeof a?a:void 0)??l;switch(e){case N.TE.SlackTypesChannelId:return"string"==typeof t?n.createElement(S.A,{channelId:t,truncate:!0}):null;case N.TE.SlackTypesUserId:return"string"==typeof t?n.createElement(w.A,{id:t,truncate:!0}):null;case N.TE.Boolean:case N.TE.Integer:case N.TE.Number:return n.createElement(n.Fragment,null,String(a??t));case N.TE.SlackTypesTimestamp:return n.createElement(n.Fragment,null,L.t("{date} at {time}",{date:(0,M.Yq)(String(t),"{date_long}"),time:(0,M.xe)(String(t))}));case N.TE.String:case N.TE.SlackTypesLimitedRichText:case N.TE.SlackTypesRichText:if(Array.isArray(t))return n.createElement(A.Zs.Provider,{value:r.list},n.createElement("div",{className:O().inline},n.createElement(I.A,{msg:{__meta__:{lastUpdatedTs:""},type:"message",ts:"0",channel:"WFB_DEFAULT_FORM_VALUE",subtype:"",blocks:t},inline:!0})));return n.createElement(C.A,{emojiSize:T.lw.SMALL,noLinking:!0,noHighlights:!0,noJumbomoji:!0,noCode:!0,noQuotes:!0,noSpecials:!0,text:i});default:return n.createElement(n.Fragment,null,i)}};DefaultWrappedFormValue.displayName="DefaultWrappedFormValue";var D=a(0xa21d3b1e),P=a(0x23465d793),R=a(0x236f54fae),B=a(0x7019ae94),W=a(0x1b05cc3ce),V=a(0x566fc4c8),q=a.n(V);let H=new i.Ay("workflow_builder"),FormWrappedInput=({parameter:e,value:t,valueLabels:a,variables:r,onChange:l,parentParameterName:i,propertyKey:s,functionVariables:c,stepId:u,isFunctionFormWrapped:m})=>{let p=i??e.name,v=e.title??e.name??s,E=e.type===N.TE.Array?e.items:void 0,k=!!e.isParameterFormWrapped,S=H.t("Hide field"),w=H.t("Show field"),A=k?S:w,I=e.is_required||(0,W.L$)(e),M=(0,n.useMemo)(()=>r?(0,D.z)({parameterName:p,isKeyValueParameter:!!i,dynamicOptionKey:s,functionVariables:c,variables:r,isFunctionFormWrapped:m,stepId:u}):r,[c,m,p,i,s,u,r]),F=(0,n.useMemo)(()=>({name:k?"eye-closed":"eye-open"}),[k]),O=(0,n.useMemo)(()=>I&&!k&&(0,B.$)(t)?[{id:"is_required_error",message:H.t("This field is required.")}]:[],[I,k,t]),L=(0,n.useCallback)(e=>{if("string"==typeof e||"number"==typeof e)return a?.[e]},[a]),V=(0,n.useMemo)(()=>!!O.length,[O.length]),U=(0,n.useMemo)(()=>n.createElement(y.A,{lines:1},n.createElement(C.A,{emojiSize:T.lw.SMALL,noLinking:!0,noHighlights:!0,noCode:!0,noQuotes:!0,noSpecials:!0,noJumbomoji:!0,text:v})),[v]),z=(0,n.useMemo)(()=>{if((0,R.G)(t)){if(t&&Array.isArray(t)&&e.type===N.TE.Array&&E&&"slack#/types/mixed"!==E.type){let e=t.length;return n.createElement(n.Fragment,null,t.map((t,a)=>{let r=`${t}_${a}`,l=L(t),i=!l&&"choices"in E?E.choices?.find(e=>e.value===t)?.title:void 0;return n.createElement(n.Fragment,{key:r},(0,R.G)(t)&&n.createElement(n.Fragment,null,n.createElement(DefaultWrappedFormValue,{parameterType:E.type,value:t,label:l??i,variables:M}),a<e-1?", ":""))}))}return n.createElement(DefaultWrappedFormValue,{parameterType:e.type,value:t,label:L(t),variables:M})}},[L,E,e.type,t,M]),j=(0,n.useMemo)(()=>V?n.createElement(f.A,{errors:O,className:"margin_0"}):(0,R.G)(t)?n.createElement(y.A,{lines:1},n.createElement("span",{className:q().default},H.t("Default"),":\xa0"),z):void 0,[z,O,V,t]),$=(0,n.useCallback)(()=>{l({checked:!k,parameterName:p,propertyKey:s})},[l,k,p,s]),G=(0,n.useMemo)(()=>{if("dynamic_options"in e&&e.dynamic_options||"enum"in e&&e.enum||"choices"in e&&e.choices||"external_select"in e&&e.external_select)return[]},[e]);if(!(0,d.AL)(e))return null;let K=(0,P.l)({...e,options:G}),{icon:Y}=K?(0,x.s)(K):{icon:"text-snippet"};return n.createElement("div",{className:"display_flex align_items_center justify_content_between normal"},n.createElement("div",{className:b()("display_flex flex_one","align_items_center",{half_opacity:!V&&!k})},n.createElement("div",{className:"padding_right_75"},n.createElement(h.Ah,{name:Y,inline:!0,size:"20"})),n.createElement(o.A,{text:U,subtext:j,className:q().label})),n.createElement(_.Ay,{tip:A},n.createElement(g.A,{onClick:$,size:"x-small","aria-label":A,svgIconProps:F})))};FormWrappedInput.displayName="FormWrappedInput";let U=new i.Ay("workflow_builder"),FormWrappedFieldList=({variables:e,slackFunction:t,inputValues:a,functionVariables:i,stepId:p,isFunctionFormWrapped:b,onChange:f})=>{let g=t?.input_parameters,h=(0,n.useMemo)(()=>g?.reduce((e,t)=>{let n=(0,u.w)(t),{label:l,value:i}=a?.[n.name]??{};if(!(0,d.AL)(n,a))return e;if((0,m.sg)(n)){let t=Object.entries(n.properties??{}).reduce((e,[t,a])=>(e[t]=(0,u.w)(a),e),{});return Object.keys(t).forEach(a=>{let s=t[a];if((0,d.AL)(s)){let t=(0,r.A)(i)||"object"!=typeof i?void 0:i[a],o=l?.[a]?.valueLabel;e.push({key:a,parameter:s,value:t,valueLabels:o&&"object"==typeof o?o:void 0,parentParameterName:n.name,propertyKey:a})}}),e}if("object"===n.type)return e;let s="choices"in n&&Array.isArray(n.choices)?n.choices.reduce((e,t)=>(("string"==typeof t.value||"number"==typeof t.value)&&(e[t.value]=t.title),e),{}):void 0;return e.push({key:n.name,parameter:n,value:i,valueLabels:l??s}),e},[])??[],[g,a]),_=(0,n.useCallback)(({parameter:t,parentParameterName:a,propertyKey:r,value:l,valueLabels:s})=>n.createElement(FormWrappedInput,{onChange:f,parameter:t,parentParameterName:a,propertyKey:r,value:l,valueLabels:s,variables:e,functionVariables:i,stepId:p,isFunctionFormWrapped:b}),[i,b,f,p,e]),y=h.map(({key:e})=>e),x=(0,n.useCallback)(e=>{let t=h[e];return n.createElement(s.A,{className:"border_bottom",size:"medium",key:t.key,primaryContent:_(t)})},[h,_]),v=(0,n.useMemo)(()=>{let e=h.filter(({value:e})=>!!(0,R.G)(e)).length,t=h.length-e;return 68*e+52*t+ +h.length+2},[h]),E=U.t("Form questions");return n.createElement(n.Fragment,null,n.createElement(o.A,{text:E,className:"bold",htmlFor:"form-question-list",cursor:null}),n.createElement(l.A,{disableHeight:!0},({width:e})=>n.createElement(c.A,{height:v,keys:y,rowRenderer:x,"aria-label":E,width:e,id:"form-question-list"})))};FormWrappedFieldList.displayName="FormWrappedFieldList"},0x211a99e2f:(e,t,a)=>{"use strict";a.d(t,{l:()=>FormatTextWithVariableTokens});var n=a(0xbad225b5),r=a(0x1d8fafe9f),l=a(0x1ebe91b72),i=a(0x1a4072e61);let FormatTextWithVariableTokens=({text:e,parameterType:t,variables:a})=>{let s=(0,i.t)([(0,l.Mx)(),(0,l.cL)(),(0,l.fE)()],"gi"),o=[],c=0;if(e.replace(s,(l,...i)=>{let s=i[i.length-3];if(s>c){let t=e.slice(c,s);o.push(n.createElement(n.Fragment,{key:`${s}-${t}`},t))}return o.push(n.createElement(r.F,{value:l,variables:a,parameterType:t,key:`${s}-${l}`})),c=s+l.length,""}),!o.length)return n.createElement(n.Fragment,null,e);if(c<e.length){let t=e.substr(c);o.push(n.createElement(n.Fragment,{key:`last-${t}`},t))}return n.createElement(n.Fragment,null,o)};FormatTextWithVariableTokens.displayName="FormatTextWithVariableTokens"},0x2151a9a6:(e,t,a)=>{"use strict";a.d(t,{m:()=>SlackFunctionArrayInput});var n=a(0xbad225b5),r=a(0x16cf1da63),l=a(0x120c268ad),i=a.n(l),s=a(0x21f3c49e8),o=a(0x1407c6c2c),c=a(0xe874a88a),d=a(0x20482ad21),u=a(0x2264e6ea3),m=a(0x2b7f0bcc),p=a(0x45bd075),b=a(0x1d2cd7755),f=a(0x1e586fbba),g=a(0x1ad596f5f),h=a(0x2501a2cee),_=a(0x250295787),y=a(0x7f5a02e8),x=a(0x6b359530),v=a(0x235d78b7c),E=a(0x88881d67),k=a(0x2173e1832),S=a(0x4c96e5d9),w=a(0x12b6a33fc),C=a(0xbd3de346),A=a(0x1c450e1a),T=a(0x11c82607b),I=a(0x14ea3ce99);let N=(0,T.Ay)("checks if a canvas or list has sharing restricted",(e,t,{fileId:a})=>{let n=t(),r=(0,I.Lp)(n,a);return!!r&&!r.isNonExistent&&((0,C.U9)(r)||(0,C.l7)(r))&&(0,C.Zv)(r)&&(0,A.GF)(n,r)});N.meta={name:"doesCanvasOrListHaveRestrictedSharing",key:"createThunkDoesCanvasOrListHaveRestrictedSharing",description:"checks if a canvas or list has sharing restricted"};var M=a(0x408bdeff),F=a(0x145d46a61),O=a(0x1795d8821),L=a(0x226892387),D=a(0xb11cfed4),P=a.n(D),R=a(0xea8a50b7),B=a.n(R);let W=new d.Ay("workflow_builder"),InputArrayFileEntity=({fileId:e,isAiAnswerStepCanvasOrListInput:t,arrayItemType:a})=>{let l=(0,L.d4)(F.dI),i=(0,r.wA)()(N({fileId:e}));if(!(t&&i))return n.createElement(M.A,{id:e,textClassName:P().fileEntityText});let s=l?W.t("You don\u2019t have permission to share this Canvas. You can ask the owner for access."):"You don\u2019t have permission to share this Canvas. You can ask the owner for access.",o=l?W.t("You don\u2019t have permission to share this List. You can ask the owner for access."):"You don\u2019t have permission to share this List. You can ask the owner for access.",c=a===O.TE.SlackTypesCanvasId?s:o;return n.createElement(S.Ay,{tip:c,position:w.Zj.Left,zIndex:k.m.MenuAboveFullScreen},n.createElement("div",{className:B().container},n.createElement(M.A,{id:e,isDisabled:!0,textClassName:P().fileEntityText}),n.createElement("span",{className:"offscreen"},c)))};InputArrayFileEntity.displayName="InputArrayFileEntity";var V=a(0x2241106d2),q=a(0x223beeef),H=a(0x677a139e),U=a(0x67607d6d);let KeyboardAccessibleEmojiButton=({onEmojiSelected:e,disabled:t=!1,ariaLabel:a,className:r})=>{let l=(0,n.useRef)(null),i=(0,n.useCallback)(()=>l.current?.querySelector("button:not([disabled])"),[]),s=(0,n.useCallback)(e=>{let{key:t,ctrlKey:a,shiftKey:n,metaKey:r,altKey:l}=e;if(!(n||r||a||l)&&("Enter"===t||" "===t)){e.preventDefault();let t=i();t?.click()}},[i]),o=(0,n.useCallback)(e=>{let{target:t,currentTarget:a}=e;if(t!==a)return;let n=i();n&&(n.setAttribute("tabindex","0"),a.setAttribute("tabindex","-1"),n.focus())},[i]),c=(0,n.useCallback)(()=>{let e=l.current,t=i();e&&t&&(e.setAttribute("tabindex","0"),t.setAttribute("tabindex","-1"))},[i]);return((0,n.useEffect)(()=>{let e=i();if(e)return e.addEventListener("blur",c),()=>{e.removeEventListener("blur",c)}},[i,c]),(0,n.useEffect)(()=>{let e=i();e&&e.setAttribute("tabindex","-1")},[i]),t)?n.createElement(U.A,{onEmojiSelected:e,disabled:t}):n.createElement("div",{ref:l,role:"toolbar",tabIndex:0,"aria-label":a,className:r,onKeyDown:s,onFocus:o},n.createElement(U.A,{onEmojiSelected:e,disabled:t}))};KeyboardAccessibleEmojiButton.displayName="KeyboardAccessibleEmojiButton";var z=a(0xb214261e),j=a(0x8c7f74eb),$=a.n(j);let TokenizerInputWrapper=({hasEmojiButton:e=!1,children:t,className:a,...r})=>{let l=i()(a,{[$().withEmojiButton]:e});return t?n.createElement("div",{className:l},t):n.createElement(z.G,{...r,className:l})};TokenizerInputWrapper.displayName="TokenizerInputWrapper";var G=a(0x1ebe91b72),K=a(0x207fb9b92),Y=a(0x21c50a68b),Q=a(0x22b3dbb67),Z=a.n(Q);let J=new d.Ay("workflow_builder"),SlackFunctionTokenizedArray=({value:e,onChange:t,onBlur:a,placeholderText:r,elementId:l,className:i,parameter:c,makeOption:d,splitQuery:u,validator:m,validatorErrorMessage:p="",isDisabled:b=!1,isTokenEditable:f,isErrorVisible:g,hintClassName:h="margin_bottom_0",shouldAutoFocus:_,onSetAddTokenFunction:y,showEmojiButton:x=!1,onEmojiSelected:v,enableEmojiAutocomplete:E,disableIdParsing:k})=>{let S=(0,Y.JK)(),w=(0,o.A)(),C=l||w,A=c.items.type===O.HN.String,[T,I]=(0,n.useState)({currentTokenizerInputText:"",tokenizerInputError:!1}),N=(0,n.useMemo)(()=>"string"==typeof e||"number"==typeof e?[e]:e.map(e=>String(e)),[e]),M=(0,n.useMemo)(()=>!(0,s.A)(e)||m&&T.currentTokenizerInputText&&!m(T.currentTokenizerInputText)?p:J.t("This field is required."),[S,e]),F=T.tokenizerInputError&&!(0,s.A)(T.currentTokenizerInputText.trim()),{errorText:L,onBlur:D}=(0,K.K)({errorMessage:M,isErrored:F}),P=(0,n.useCallback)(()=>{D(),a()},[a,D]),R=(0,n.useCallback)((e,a,n)=>{let r=e.map(e=>(0,G.cL)().test(e)?e:Number(e));t(A?e:r);let l={currentTokenizerInputText:a,tokenizerInputError:!1};return n&&""!==a&&(l.tokenizerInputError=!0),I(l),l},[A,t]),B=(0,n.useCallback)(t=>{R([..."string"==typeof e||"number"==typeof e?[String(e)]:e.map(String),t],"",!1)},[e,R]),W=(0,n.useCallback)(e=>{v?.(e),B(`:${e}:`)},[v,B]);(0,n.useEffect)(()=>{y&&y(B)},[y,B]);let V=!g&&c.hint;return n.createElement("div",null,n.createElement("div",{className:Z().inputWrapper},n.createElement(TokenizerInputWrapper,{hasEmojiButton:x,className:i,tokenizedItems:N,untokenizedText:T.currentTokenizerInputText,onChange:R,isInvalid:b??!!L,errorMessage:b?p:L,isDisabled:b,onBlur:P,placeholderText:r,itemValidator:m,ariaLabelledBy:C,ariaLabel:N.length>0&&c.title?c.title:r,makeOption:d,splitQuery:u,inputDataQaPrefix:C,isTokenEditable:f,focusOnMount:_,enableEmojiAutocomplete:E,disableIdParsing:k}),x&&!b&&n.createElement(KeyboardAccessibleEmojiButton,{onEmojiSelected:W,disabled:b,ariaLabel:J.t("Emoji"),className:Z().emojiButton})),V&&n.createElement(H.A,{className:h},c.hint))};SlackFunctionTokenizedArray.displayName="SlackFunctionTokenizedArray";var X=a(0x1a740dbac),ee=a(0xf33a4f91),et=a(0x118f04a01),ea=a(0xcb24a23b),en=a(0x1d3dd4cbe);let er=new d.Ay("workflow_builder");var el=a(0x668181b3),ei=a(0x2772625d),es=a(0xc67f3d80);let eo=new d.Ay("workflow_builder");var ec=a(0x1ba35eb3b),ed=a(0x4b32db5f),eu=a(0x1b05cc3ce),em=a(0x10d53599f),ep=a(0x1de80d519),eb=a(0x213c0555e),ef=a(0x19dc73101),eg=a(0x1aad32b98),eh=a(0xa1832ae4),e_=a(0xb8504a42),ey=a(0x4a120eb2),ex=a(0x2a3fb7ec),ev=a(0x16ed1b0dc),eE=a(0xa985ed31),ek=a(0x4f725d55),eS=a(0xd2fa49d0),ew=a(0x1b18cac4b),eC=a(0x17f39e0ff),eA=a(0xe684f705),eT=a(0x1ee439e69),eI=a(0xdcfa8f6a),eN=a.n(eI),eM=a(0x2310bfb55),eF=a.n(eM);let eO=new d.Ay("workflow_builder"),SlackFunctionArrayInput=({value:e=[],parameter:t,onChange:a,variables:l,functionId:d,selectDataQa:k,formatVariableBeforeInsert:S,externalWorkspaceId:w,callbackId:A,allowVariables:T,hideLabel:M,placeholder:D,isParameterSyncedWithForm:P,shouldAlwaysDisplayVariableSelector:R,invalidKeyword:B,shouldAutoFocus:W,enableEmojiAutocomplete:H})=>{let U=(0,r.wA)(),z=(0,L.d4)(eA.cA),j=(0,L.d4)(eT.H7),$=(0,eh.ZT)(j),G=(0,eh.F1)(j),Y=(0,e_.kA)(j),Q=(0,o.A)(),{viewOnly:Z,onVariableMenuOpen:J,messagePostedTriggerPrivateChannelAccess:eI,messagePostedTriggerPrivateChannelTeamIds:eM,aiStepPrivateChannelAccess:eL,aiStepPrivateChannelTeamIds:eD}=(0,en.e)(),eP=(0,L.d4)(F.sQ),eR=(0,L.d4)(eC.o),eB=(0,L.d4)(I.Pz),{is_required:eW=!1,isParameterFormWrappable:eV,name:eq}=t,eH="display_type"in t?t.display_type:void 0,eU=(eW||(0,eu.L$)(t))&&!eV,[ez,ej]=(0,n.useState)(null),e$=t.items,eG=e$.type,eK=eG===O.TE.String?e$.format:void 0,eY=eG===O.TE.Boolean,eQ=eG===O.TE.SlackTypesUserId||eG===O.TE.SlackTypesChannelId||eG===O.TE.SlackTypesUsergroupId||eG===O.TE.SlackTypesTeamId||eG===O.TE.SlackTypesCanvasId||eG===O.TE.SlackTypesListId||eG===O.TE.SlackTypesFileId,eZ=eO.t("True"),eJ=eO.t("False"),eX=D??t?.description,e0=eO.t("Select channels"),e1=eO.t("Select users"),e2=eO.t("Select user groups"),e8=eO.t("Select numbers"),e4=eO.t("Select integers"),e5=eO.t("Select strings"),e6=eO.t("Select emails"),e3=eO.t("Select URLs"),e7=eO.t("Select booleans"),e9=eO.t("Select timestamps"),te=eO.t("Select teams"),tt=eO.t("Select canvases"),ta=eO.t("Select lists"),tn=(0,L.d4)(F.HD),tr=(0,L.d4)(F.dI),tl=(0,L.d4)(F.EY),ti=(0,n.useMemo)(()=>A===O.Uk.MessagePosted&&eG===O.TE.String,[eG,A]),ts=(0,n.useMemo)(()=>(eG===O.TE.SlackTypesCanvasId||eG===O.TE.SlackTypesListId)&&A===O.oW.AiAnswer,[eG,A]),to=(0,n.useCallback)(e=>{ez&&ti&&ez(`:${e}:`)},[ez,ti]),tc=(0,n.useCallback)(e=>{ej(()=>e)},[]),td=(0,n.useMemo)(()=>A!==O.Uk.MessagePosted?void 0:eI?eP?eO.t("Select up to 20 public and private channels in {teamName}.",{teamName:G}):`Select up to 20 public and private channels in ${G}.`:eO.t("Select up to 20 public channels in {teamName}.",{teamName:G}),[A,G,eI,eP]),tu=(0,n.useMemo)(()=>!ee.gY.some(e=>e===eG)||Z||P,[eG,P,Z]),tm=(0,n.useMemo)(()=>eY?[{label:eZ,value:"true"},{label:eJ,value:"false"}]:"choices"in e$?e$.choices?.map(e=>({label:e.title,value:e.value})):"enum"in e$?e$.enum?.map(e=>({label:String(e),value:e})):void 0,[e$,eJ,eY,eZ]),tp=T&&!tu&&(!("enum"in e$)||!!R),tb=(0,n.useCallback)(e=>eX||(e?({number:e8,integer:e4,string:e5,boolean:e7,"slack#/types/channel_id":e0,"slack#/types/user_id":e1,"slack#/types/user_email":e1,"slack#/types/usergroup_id":e2,"slack#/types/timestamp":e9,"slack#/types/team_id":te,"slack#/types/list_id":ta,"slack#/types/canvas_id":tt,"slack#/types/dynamic_pair":"","slack#/types/channel_canvas_id":"","slack#/types/canvas_template_id":"","slack#/types/currency":"","slack#/types/message_context":"","slack#/types/file_id":"","slack#/types/mixed":""})[e]:""),[eX,e8,e4,e5,e7,e0,e1,e2,e9,te,ta,tt]),tf=A===O.oW.SummarizeChannel,tg=A===O.oW.AddAgentToChannel,th=(0,V.N)({callbackId:A,parameterType:eG,externalWorkspaceId:w}),t_=eU&&eG===O.TE.SlackTypesTeamId;(0,n.useEffect)(()=>{t_&&(Y||w||e.includes($)?w&&!e.includes(w)&&a(t,[w]):a(t,[$]))},[t_,a,t,e,w,eU,Y,$]);let ty=(0,n.useCallback)(e=>(0,ec.yH)(e,t)||(0,ec.xY)({variable:e,parameter:t}),[t]),[tx,tv]=(({variables:e,parameter:t,id:a,isRequired:r,value:l,isValidEmptyObject:i,callbackId:s,arrayItemType:o,allChannels:c,allFiles:d})=>{let{messagePostedTriggerPrivateChannelAccess:u,messagePostedTriggerPrivateChannelTeamIds:m}=(0,en.e)(),p=(0,L.d4)(F.sQ);return(0,n.useMemo)(()=>{let[n,b]=(0,ea.g)({variables:e,id:a,value:l,isValidEmptyObject:i,isRequired:r,parameter:t,arrayItemType:o,allFiles:d});if(!p)return[n,b];let f=(0,et.Se)(l,{callbackId:s,arrayItemType:o??"",allChannels:c??{},privateChannelAccess:u,privateChannelTeamIds:m,experimentMessagePostedTriggerInPrivateChannelsGroupOn:p}),g=[...b];f.forEach(e=>{g.includes(e)||g.push(e)});let h=[...n];return f.length>0&&h.push({id:`${a}_permission_error`,message:er.t("This trigger can\u2019t use private channels. Remove private channels to continue.")}),[h,g]},[e,a,l,i,r,t,s,o,c,d,u,m,p])})({variables:l,id:eq,value:e,isRequired:eU,parameter:t,callbackId:A,arrayItemType:eG,allChannels:eR,allFiles:eB}),{onBlur:tE,okayToDisplay:tk}=(0,K.K)({errorMessage:void 0,isErrored:tx.length>0}),tS=(0,n.useMemo)(()=>tk?tx:tx?.filter(e=>e.id.endsWith("_permission_error")||e.id.endsWith("_is_deleted_file")),[tk,tx]),tw=(({variables:e,value:t,id:a,callbackId:r,arrayItemType:l})=>{let i=(0,L.d4)(F.dI),s=[],o=(0,n.useMemo)(()=>r===O.oW.AiAnswer&&!!Array.isArray(t)&&l===O.TE.SlackTypesChannelId&&t.some(e=>"string"==typeof e&&((0,es.sU)(e)||(0,ei.cn)(e))),[r,t,l]),c=i?eo.t("The contents of any channel used with this step can be shared via the AI response and become visible to workflow users. Make sure you\u2019re ok with sharing this content before continuing."):"The contents of any channel used with this step can be shared via the AI response and become visible to workflow users. Make sure you\u2019re ok with sharing this content before continuing.";if(o&&s.push({id:`${a}_has_channels`,message:c}),(0,L.d4)(a=>r===O.oW.AiAnswer&&(l===O.TE.SlackTypesCanvasId||l===O.TE.SlackTypesFileId||l===O.TE.SlackTypesListId)&&Array.isArray(t)?t.some(t=>{if("string"!=typeof t)return!1;if((0,ei.cn)(t)){let a=(0,el.x)(e.list,t);return!!(a&&!a.isTombstone&&a.isAvailable&&a.type===l)}return!!(0,I.Lp)(a,t)}):null)){let e,t;l===O.TE.SlackTypesCanvasId?(e=eo.t("Canvas",{fallbackHash:"a3f80b87a456136fc59c442bd1ee5b5eec2430f1",fallbackHashNs:"files"}),t="canvas_or_canvas_variable"):l===O.TE.SlackTypesFileId?(e=eo.t("File",{fallbackHash:"2c3cafa4db3f3e1e51b3dff4303502dbe42b7a89",fallbackHashNs:"files"}),t="file_or_file_variable"):l===O.TE.SlackTypesListId&&(e=eo.t("List",{fallbackHash:"a1fffaaafb7cc996685bceb829c053cc4f7de43d",fallbackHashNs:"files"}),t="list");let n=i?eo.t("The contents of any {entityTypeText} used with this step can be shared via the AI response and become visible to workflow users. Make sure you\u2019re ok with sharing this content before continuing.",{entityTypeText:e}):`The contents of any ${e} used with this step can be shared via the AI response and become visible to workflow users. Make sure you\u{2019}re ok with sharing this content before continuing`;s.push({id:`${a}_has_${t}`,message:n})}return s})({variables:l,id:eq,value:e,callbackId:A,arrayItemType:eG}),tC=ti&&!eQ&&tk&&eU&&!eV&&(0,s.A)(e),tA=ti&&!Z&&tn,tT=(0,n.useCallback)(e=>(ti||tE(),1===e.length&&(0,ee.x1)(l,String(e[0])))?a(t,String(e[0])):a(t,e),[tE,a,t,l,ti]),tI=(0,n.useCallback)(e=>tT(e.map(e=>e.value)),[tT]),tN=(0,n.useCallback)(e=>tT(e.map(e=>Number(e.value))),[tT]),tM=(0,n.useCallback)(e=>tT(e.map(e=>e.value)),[tT]),tF=(0,n.useCallback)((a,n)=>{let r=`${n}-${a}`,i=!1,s="string"==typeof a?a:String(a);if("choices"in e$&&(s=e$.choices?.find(e=>e.value===a)?.title??s),"string"==typeof a){if((0,ei.cn)(a)){let n=(0,el.x)(l.list,a);if(!n)return{key:r,label:eO.t("Missing Data"),isError:!1,svgIcon:{name:"css"},value:a};if(s=n.label||s,i=!n.isAvailable||n.isTombstone||!(0,ec.yH)(n,t),n.type===O.TE.Array){let a="string"!=typeof e&&e.length>1,r=t.can_flatten;s=eO.t("{selectedDataLabel} (multiple)",{selectedDataLabel:n.label}),i=i||a&&!r}return{key:r,label:s,svgIcon:{name:"css"},value:a,isError:i}}if((eG===O.TE.SlackTypesCanvasId||eG===O.TE.SlackTypesListId)&&(0,eE.A)(a)){let e=eB?.[a];if(!e||e.isNonExistent||(0,C.uO)(e)){let e=eG===O.TE.SlackTypesCanvasId?"Canvas":"List";return{key:r,label:eO.t("Deleted {fileType}",{fileType:e,fallbackHash:"3876d76c9dd08c3442581204e246d74ade686acd",fallbackHashNs:"files"}),isError:!0,svgIcon:{name:"css"},value:a}}}t.items.type===O.TE.Boolean&&(s="true"===a.toLowerCase()?eZ:eJ),t.items.type===O.TE.Number&&(i=!(0,ee.Fr)(a)),t.items.type===O.TE.Integer&&(i=!(0,ee.o6)(a)),t.items.type===O.TE.SlackTypesTimestamp&&(i=!(0,ee.ak)(a)),ti&&(i=!!B&&a.toLowerCase()===B),t.items.type===O.TE.String&&("email"===eK?i=!(0,ee.V2)(a):"url"===eK&&(i=!(0,ee.U6)(a)))}return{key:r,label:s,value:a,isError:i}},[e$,eJ,t,eZ,e,l.list,ti,B,eK,eG,eB]),tO=(0,n.useMemo)(()=>"string"==typeof e?[tF(e,0)]:e.map(tF),[tF,e]),tL=(0,n.useMemo)(()=>!1===T?[]:(0,E.PW)(l.groups,ty),[ty,l.groups,T]),tD=(0,n.useMemo)(()=>(0,ed.T)(tL),[tL]),tP=(0,n.useCallback)(n=>{let r=S(n,{parameterType:t.type,skipMacro:(0,E.nK)(n)}).id;return"string"==typeof e?a(t,[e,r]):a(t,[...e,r])},[S,a,t,e]),tR=(0,n.useCallback)(e=>{if("string"==typeof e.value){if((0,ev.A)(e.value))return n.createElement(_.A,{channelId:e.value,showTeamForLocalChannels:!0});if((0,ek.A)(e.value))return n.createElement(em.A,{id:e.value,showAvatar:!0});if((0,eS.A)(e.value))return n.createElement(eb.A,{id:e.value,showDescription:!1});if((0,u.Ay)(e.value))return n.createElement(ep.e,{id:e.value});if((0,eE.A)(e.value))return n.createElement(InputArrayFileEntity,{fileId:e.value,isAiAnswerStepCanvasOrListInput:ts,arrayItemType:eG})}return tm?n.createElement("div",{id:"string"==typeof e.label?e.label:"",className:"display_flex align_items_center"},e.svgIcon&&n.createElement(h.Ah,{name:e.svgIcon.name}),e.label):e.data&&e.data.label?n.createElement(x.R,{data:e.data}):e.label},[tm,eG,ts]),tB=(0,n.useCallback)((e,t)=>{let a=[],n=(0,g.A)(tD,t);if(tm&&""===t)return a.push(...tm),c.S.resolve(a);if(n.length>0&&!tm&&a.push(...n),e.length>0)if(ts){let t=e.map(e=>"string"==typeof e.value&&(0,eE.A)(e.value)&&U(N({fileId:e.value}))?{...e,isDisabled:!0}:e);a.push(...t)}else a.push(...e);return c.S.resolve(a)},[tm,tD,ts,U]),tW=(0,n.useCallback)(e=>{if(!tm)return c.S.resolve([]);let t=(0,ew.A)(e);return c.S.resolve(tm.filter(e=>(0,s.A)(t)||(0,ew.A)(String(e.label)).includes(t)).map((e,t)=>tF(e.value,t)))},[tm,tF]),tV=(0,n.useMemo)(()=>t.hint?[{id:`${Q}-hint`,message:t.hint,className:"margin_bottom_0"}]:void 0,[Q,t.hint]),tq=(0,n.useCallback)((e,t)=>n.createElement(ey.x,{selectId:Q,width:"100%",placeholderText:e,hints:tV,search:tW,renderOption:tR,selectedOptions:tO,onSelectedItemsChange:t,processOptions:tB,expandOnFocus:!0,disableSearchOnMount:!1,onBlur:tE,isInvalid:tk&&tx.length>0,isDisabled:tu}),[Q,tV,tW,tR,tO,tB,tE,tk,tx.length,tu]),tH=(0,n.useCallback)((e,t)=>a=>{t(a?.target?.checked?[...tO,e]:tO.filter(t=>t.value!==e.value))},[tO]),tU=(0,n.useCallback)(e=>tm?n.createElement("div",null,tm.map(t=>{let a=tO.some(e=>e.value===t.value),r=`${Q}-${t.value}`;return n.createElement("div",{key:r,className:"display_block margin_bottom_50"},n.createElement(b.A,{htmlFor:r,text:t.label,type:"inline"},n.createElement(p.A,{id:r,checked:a,onChange:tH(t,e),disabled:tu})))})):null,[tm,tO,Q,tu,tH]),tz=(0,n.useCallback)((a,r,l,i)=>{let s=[O.TE.Boolean,O.TE.String,O.TE.Integer,O.TE.Number,O.TE.SlackTypesTimestamp,O.TE.SlackTypesDynamicPair];return(0,ex.X)(s,t.items.type)?n.createElement(SlackFunctionTokenizedArray,{elementId:Q,value:e,onChange:tT,makeOption:tF,splitQuery:i,parameter:t,placeholderText:l,validatorErrorMessage:a,validator:r,isDisabled:tu,onBlur:tE,isTokenEditable:ti,isErrorVisible:tC,shouldAutoFocus:W,onSetAddTokenFunction:ti?tc:void 0,showEmojiButton:tA,onEmojiSelected:to,enableEmojiAutocomplete:H,disableIdParsing:ti}):null},[Q,e,tT,tF,tE,t,tu,ti,tC,W,tc,tA,to,H]),tj=(0,n.useMemo)(()=>{switch(A){case O.oW.AiAnswer:return tl?(0,ee.AR)({privateChannelAccess:eL,privateChannelTeamIds:eD}):ee.L6;case O.Uk.MessagePosted:return(0,ee.Ut)({privateChannelAccess:eI,privateChannelTeamIds:eM});default:return ee.L6}},[tl,A,eI,eM,eL,eD]),t$=(0,n.useMemo)(()=>A===O.oW.AiAnswer?ee.dS:ee.jO,[A]),tG=(0,n.useMemo)(()=>{let e=[O.TE.SlackTypesChannelId,O.TE.SlackTypesUserId,O.TE.SlackTypesUsergroupId,O.TE.SlackTypesTeamId,O.TE.SlackTypesCanvasId,O.TE.SlackTypesListId,O.TE.SlackTypesFileId];if(!(0,ex.X)(e,t.items.type))return;let a={[O.TE.SlackTypesChannelId]:tj,[O.TE.SlackTypesUserId]:ee.R_,[O.TE.SlackTypesUsergroupId]:ee.C3,[O.TE.SlackTypesTeamId]:ee.QX,[O.TE.SlackTypesCanvasId]:t$,[O.TE.SlackTypesListId]:ee.vU,[O.TE.SlackTypesFileId]:ee.Fq}[t.items.type],n=w?{...a,entities:(0,y.d7)(a.entities,w)}:a;if(tf||tg)return th;let r="filter"in n?n.filter:void 0;return{...n,filter:e=>(!r||!1!==r(e))&&(tm?tm.map(e=>e.value).includes(e.id):t.items.type===O.TE.SlackTypesTeamId?!(0,u.JV)(e.id)&&(0,eg.nO)(z,e.id):t.items.type!==O.TE.SlackTypesFileId||!(0,C.DQ)(e)&&!(0,C.l7)(e))}},[t.items.type,tj,t$,w,tf,tg,th,tm,z]),tK=(0,n.useMemo)(()=>{switch(eG){case O.TE.SlackTypesUserId:case O.TE.SlackTypesChannelId:case O.TE.SlackTypesUsergroupId:case O.TE.SlackTypesTeamId:case O.TE.SlackTypesCanvasId:case O.TE.SlackTypesListId:case O.TE.SlackTypesFileId:return n.createElement(ef.h,{key:`${Q}-${eL}-${eD?.join(",")}`,id:Q,onSelectedItemsChange:tI,placeholderText:tb(eG),hints:tV,renderOption:tR,searcherOptions:tG,selectedOptions:tO,selectId:Q,width:"100%",className:i()(eN().entity,eN().placeholder_text),isInvalid:tk&&tx.length>0,isDisabled:tu,focusOnMount:W&&0===tO.length,processOptions:tB,errors:tS,selectDataQa:k,expandOnFocus:!W,onBlur:tE,allowFileToken:tr,invalidSelectedTokenIndexes:tv});case O.TE.String:if(tm){if("checkboxes"===eH)return tU(tI);return tq(tb(eG),tI)}if("email"===eK)return tz(eO.t("This is not a valid email address."),ee.V2,e6,ee.Db);if("url"===eK)return tz(eO.t("This is not a valid URL."),ee.U6,e3,ee.Ci);return tz(eO.t("This is not a valid string."),ee.r,tb(eG),ee.r0);case O.TE.SlackTypesTimestamp:if(tm)return tq(tb(eG),tN);return tz(eO.t("This is not a valid timestamp."),ee.ak,tb(eG));case O.TE.Integer:if(tm)return tq(tb(eG),tN);return tz(eO.t("This is not a valid integer."),ee.o6,tb(eG));case O.TE.Number:if(tm)return tq(tb(eG),tN);return tz(eO.t("This is not a valid number."),ee.Fr,tb(eG));case O.TE.Boolean:return tq(tb(eG),tM);default:return n.createElement(n.Fragment,null,n.createElement(X.b,{parameter:t,functionId:d}),tz(eO.t("This type is not currently supported."),()=>!1))}},[eG,Q,tI,tb,tV,tR,tG,tO,tk,tx,tS,tu,W,tB,k,tE,tr,tm,eK,tz,tq,tU,tM,t,d,e6,e3,tN,eH,tv,eL,eD]);if(t_&&!Y||t_&&w)return null;let renderComponent=()=>n.createElement(n.Fragment,null,n.createElement("div",{className:"display_flex","data-qa":"array-input"},n.createElement("div",{className:i()(eF().inline_width,{[eN().entity]:M})},tK),tp&&n.createElement(v.jx,{onSelect:tP,data:l.groups,customDataFilter:ty,renderIconInline:!0,onMenuTriggerClick:J,className:eF().dynamicDataMenuButton})),!tu&&n.createElement("div",{className:"display_flex justify_content_between"},n.createElement("div",null,!eQ&&tk&&tx?.map(e=>n.createElement(f.A,{key:e.id},e.message)))));return renderComponent.displayName="renderComponent",n.createElement(q.z,{elementId:Q,parameter:t,hideLabel:M,isParameterSyncedWithForm:P,subtext:td,callbackId:A},tw&&tw.map(e=>n.createElement("div",{className:"margin_bottom_75",key:e.id},n.createElement(m.Ay,{level:m.A_.warning},e.message))),renderComponent())};SlackFunctionArrayInput.displayName="SlackFunctionArrayInput"},0xa224974e:(e,t,a)=>{"use strict";a.d(t,{h:()=>SlackFunctionBlocksInput});var n=a(0xbad225b5),r=a(0x16cf1da63),l=a(0x21f3c49e8),i=a(0x1d24ec95f),s=a(0x1407c6c2c),o=a(0x20b4dda68),c=a(0x20482ad21),d=a(0x207b33662),u=a(0x1576dac7),m=a(0x13f7d86f3),p=a(0x344bb842),b=a(0x2501a2cee),f=a(0x668181b3),g=a(0x1d62f3e69),h=a(0x1842d80dc),_=a(0x16b446ebc),y=a(0x8b49ee82);function addItemToArrayConcatMacroString(e,t){if(!e||0===e.length)return t;let a=(0,_.D)(e);if(0===a.length){let a=buildConcatMacro(e,t);return isArrayConcatMacroValid((0,_.q)(a))?a:t}return a.every(isArrayConcatMacroValid)?(a.push(buildArrayConcat("$$",t)),toMacroString(a)):t}function getItemsFromArrayConcatMacroString(e){if(!e||0===e.length)return[];let t=(0,_.D)(e);return 0===t.length?[e]:t.every(isArrayConcatMacroValid)?t.reduce((e,t)=>{for(let a of t.namedInputs)"$$"!==a.value&&e.push(a.value);return e},[]):[]}function constructArrayConcatMacroStringFromItems(e){if(0===e.length)return null;if(1===e.length)return e[0];if(2===e.length)return buildConcatMacro(e[0],e[1]);let t=[buildConcatMacro(e[0],e[1])];for(let a of e.slice(2))t.push(buildConcatMacro("$$",a));return t.join(h.u6)}function isArrayConcatMacroValid(e){return!(null===e||"array"!==e.namespace||"concat"!==e.macroCallbackId||2!==e.namedInputs.length||"collection_one"!==e.namedInputs[0].parameter||"collection_two"!==e.namedInputs[1].parameter||e.namedInputs[0].value.includes("array.concat")||e.namedInputs[1].value.includes("array.concat"))}function buildArrayConcat(e,t){return{namespace:y.J.ARRAY,macroCallbackId:"concat",namedInputs:[{parameter:"collection_one",value:e},{parameter:"collection_two",value:t}],templateValue:buildConcatMacro(e,t)}}function buildConcatMacro(e,t){return`{array.concat(collection_one=${e}, collection_two=${t})}`}function toMacroString(e){return e.map(e=>e.templateValue).join(h.u6)}var x=a(0x1897055b4),v=a.n(x);let E={name:"trash"},k=new c.Ay("workflow_builder"),Files=({value:e,parameter:t,variables:a,onChange:r})=>{let l=(0,n.useMemo)(()=>{if(!e)return[];let t=getItemsFromArrayConcatMacroString(e);return 0===t.length?[e]:t},[e]),[i,s]=(0,n.useMemo)(()=>{let e=[],t=[];for(let n of l){let r=a?(0,f.x)(a.list,n):void 0,l=r?.type==="slack#/types/file_id",i=r?.type==="array"&&r?.items?.type==="slack#/types/file_id";r&&(l||i)?e.push(r):t.push(n)}return[e,t]},[l,a]),o=(0,n.useCallback)(e=>{r(t,constructArrayConcatMacroStringFromItems(l.filter(t=>t!==e)))},[l,r,t]),c=(0,n.useCallback)(e=>n.createElement("div",{className:v().sendMessageFile,key:e.id},n.createElement("span",{className:v().sendMessageAttachmentIcon},n.createElement(b.Ah,{name:"attachment"})),n.createElement("div",{key:e.id,className:"c-texty_input_unstyled"},n.createElement("span",{className:"c-texty_workflow_token"},n.createElement("span",{className:g.Dc},n.createElement("i",{className:`${g.tF} c-icon`}),n.createElement("span",{className:g.dc},e.defaultLabel)))),n.createElement(p.A,{"aria-label":k.t("remove"),onClick:()=>o(e.id),svgIconProps:E})),[o]),d=(0,n.useCallback)(e=>n.createElement("div",{className:v().sendMessageFileError,key:e},n.createElement("span",{className:v().sendMessageAttachmentIcon},n.createElement(b.Ah,{name:"warning"})),n.createElement("div",{key:e,className:"c-texty_input_unstyled"},n.createElement("span",{className:"c-texty_workflow_token"},n.createElement("span",{className:g.Dc},n.createElement("span",{className:g.dc},k.t("Missing variable reference"))))),n.createElement(p.A,{"aria-label":k.t("remove"),onClick:()=>o(e),svgIconProps:E})),[o]);return i?.length||s?.length?n.createElement("div",{className:v().sendMessageFilesWrapper},i.map(c),s.map(d)):null};Files.displayName="Files";var S=a(0x223beeef),w=a(0x1db69cda),C=a(0x1795d8821),A=a(0x1d3dd4cbe),T=a(0x1242da2eb);function checkForPlaceholderVariablesInDelta(e){return!!e&&!!e.ops&&e.ops.some(e=>(0,T.Pd)(e))}var I=a(0x1b05cc3ce),N=a(0x207fb9b92),M=a(0x2001af3ac),F=a(0x24429189c);let O=new c.Ay("workflow_builder"),SlackFunctionBlocksInput=({value:e,callbackId:t,parameter:a,variables:c,onChange:p,formatVariableBeforeInsert:b,parameters:f,configuredParameters:g,required:h,allowVariables:_,hideLabel:y,subtext:x,labelClassName:v,isParameterSyncedWithForm:E,sendAsUserValue:k=!1,experimentUserAuthoredWorkflowPostsFeGroupOn:T=!1,experimentWfbAiAnswerStepGroupOn:L=!1,wfbAiPromptButtons:D,excludePrivateChannelAutocomplete:P,privateChannelTeamIds:R})=>{let{title:B,isParameterFormWrappable:W,type:V}=a,q=(0,s.A)(),[H,U]=(0,n.useState)(!1),[z,j]=(0,n.useState)(!1),$=(0,r.wA)(),{viewOnly:G,onVariableMenuOpen:K,aiStepPrivateChannelAccess:Y,aiStepPrivateChannelTeamIds:Q}=(0,A.e)(),Z=(0,n.useMemo)(()=>H||z||!!(h||(0,I.L$)(a))&&!W&&(0,l.A)(e),[e,H,z,h,a,W]),J=(0,n.useMemo)(()=>H?O.t("Message is too long."):z?L?O.t("Please replace all placeholder variables with defined variables."):"Please replace all placeholder variables with defined variables.":O.t("This field is required."),[H,z,L]),{errorText:X,onBlur:ee}=(0,N.K)({errorMessage:J,isErrored:Z,shouldErrorPreventSave:z}),et=(0,n.useCallback)(({blocks:e})=>{if(e){let t=$((0,F.f)({blocks:e}));U((0,M.A)(t)>o.nb),j(checkForPlaceholderVariablesInDelta(t))}p(a,e&&e.length>0?[(e=>{let t=(0,w.A)(e),a={...e,elements:[]};for(;t.elements.length;){let e=t.elements.shift();if(!e)continue;if("rich_text_section"!==e.type){a.elements.push(e);continue}let n=[];for(;e.elements.length;){let t=e.elements.shift();if(t){if("workflowtoken"!==t.type||t.data_type!==C.TE.SlackTypesRichText&&t.data_type!==C.TE.SlackTypesExpandedRichText){n.push(t);continue}n.length&&a.elements.push({...e,elements:n}),a.elements.push(t),n=[]}}n.length&&a.elements.push({...e,elements:n})}return a})(e[0])]:e??[])},[$,p,a]),ea=(0,n.useMemo)(()=>f?.find(({name:e})=>"files"===e),[f]),en=(0,n.useMemo)(()=>g?.files?.value??void 0,[g]),er=(0,n.useCallback)(()=>ea?n.createElement(Files,{value:en,parameter:ea,variables:c,onChange:p}):null,[ea,en,p,c]),el=(0,n.useCallback)(e=>{let[t,a]=(0,i.A)(e,e=>e.type===C.TE.Array&&e.items?.type===C.TE.SlackTypesFileId&&ea);if(t.length>0){let e=getItemsFromArrayConcatMacroString(en),a=en;for(let n of t)e.includes(n.id)||(a=addItemToArrayConcatMacroString(a,n.id));p(ea,a)}return a},[ea,en,p]),ei=(0,n.useCallback)(({activeTokenElement:e,activeTokenData:a,activeTokenVariableData:r,hideCustomizeDataPopover:l,updateDynamicData:i})=>(0,m.L4)(r)?n.createElement(u.I,{tetherElement:e,tokenData:a,variableData:r,callbackId:t,onClose:l,updateDynamicData:i,fromRichText:!0}):null,[t]),es=(0,n.useMemo)(()=>"string"==typeof e?[]:e,[e]);return n.createElement(S.z,{elementId:q,parameter:a,hideLabel:y,className:v,subtext:x,isParameterSyncedWithForm:E},n.createElement(d.c,{id:"message",initialText:"string"==typeof e?e:"",initialBlocks:es,data:c,enableDynamicData:_,placeholder:a?.description??O.t("Ex: Hello!"),ariaLabel:B??O.t("Set the step message text"),hint:a.hint,onTextChange:et,onBlur:ee,callbackId:t,errorText:X||null,maxLength:o.nb,useBlocks:!0,enableEmoji:!0,shouldAddNewLineOnEnter:!0,onEnter:null,focusOnMount:!1,isDisabled:G||E,formatVariableBeforeInsert:b,canInsertAllVariablesByGroup:!0,interceptVariablesInsertion:el,renderFiles:er,getVariableCustomizeMenu:ei,onVariableMenuOpen:K,useExpandedRichText:V===C.TE.SlackTypesExpandedRichText,sendAsUserValue:k,experimentUserAuthoredWorkflowPostsFeGroupOn:T,wfbAiPromptButtons:D,excludePrivateChannelAutocomplete:P??!1===Y,privateChannelTeamIds:R??Q}))};SlackFunctionBlocksInput.displayName="SlackFunctionBlocksInput"},0x19f0ddaf7:(e,t,a)=>{"use strict";a.d(t,{B:()=>SlackFunctionBooleanInput});var n=a(0xbad225b5),r=a(0x120c268ad),l=a.n(r),i=a(0x1407c6c2c),s=a(0x20482ad21),o=a(0x11a296110),c=a(0x45bd075),d=a(0x677a139e),u=a(0x2501a2cee),m=a(0x235d78b7c),p=a(0x223beeef),b=a(0x1ba35eb3b),f=a(0x1d3dd4cbe),g=a(0x668181b3),h=a(0x2772625d),_=a(0x1282104f7),y=a(0x19935b6b1),x=a.n(y);let v=new s.Ay("workflow_builder"),E={type:"inline"},k={name:"css"},SlackFunctionBooleanInput=({value:e,parameter:t,variables:a,onChange:r,formatVariableBeforeInsert:s,allowVariables:y,hideLabel:S,isParameterSyncedWithForm:w})=>{let C=(0,i.A)(),{viewOnly:A,onVariableMenuOpen:T}=(0,f.e)();(0,n.useEffect)(()=>{(""===e||void 0===e)&&r(t,String(t.default??!1))},[r,t,e]);let I=(0,n.useCallback)(e=>{r(t,String(e?.target?.checked??!1))},[r,t]),N=(0,n.useCallback)(e=>{let a=s(e,{parameterType:t.type}).id;return r(t,a)},[s,r,t]),M=(0,n.useCallback)(()=>r(t,""),[t,r]),F=(0,n.useMemo)(()=>{if((0,h.cn)(e))return(0,g.x)(a.list,e)},[e,a.list]),O=(0,n.useCallback)(()=>n.createElement(o.Nm,{onClick:M,"aria-label":v.t("Remove variable from {label}",{label:t.title??t.name??t.description}),disabled:A},n.createElement(u.Ah,{name:"close","data-qa":"token_remove_icon"})),[M,t,A]),L=A||w,D=y&&!F&&!w;return n.createElement("div",{className:l()(x().outerContainer)},n.createElement("div",{className:l()(x().innerContainer,{[x().variableReference]:F})},n.createElement(p.z,{elementId:C,parameter:t,labelProps:E,hideLabel:S,isParameterSyncedWithForm:w},n.createElement(c.A,{"data-qa":"checkbox",id:C,onChange:I,checked:"true"===e,disabled:!!F||L})),F&&n.createElement(_.A,{svgIcon:k,className:x().token,entityId:F.id,label:F.label,renderIcon:O,isDisabled:L}),D&&n.createElement(m.jx,{onSelect:N,data:a.groups,customDataFilter:b.XZ,renderIconInline:!0,isDisabled:L,onMenuTriggerClick:T})),t.hint&&!F&&n.createElement(d.A,{className:"margin_bottom_0 padding_left_150"},t.hint))};SlackFunctionBooleanInput.displayName="SlackFunctionBooleanInput"},0x1fe708dbe:(e,t,a)=>{"use strict";a.d(t,{e:()=>DateTimeInput});var n=a(0xbad225b5),r=a(0x1b63e435a),l=a.n(r),i=a(0x1407c6c2c),s=a(0x4bdf0df6),o=a(0x20482ad21),c=a(0x2503b7c1),d=a(0x677a139e),u=a(0x1e586fbba),m=a(0x9154b87c),p=a(0x1f90df740),b=a(0x1d3dd4cbe),f=a(0x124d99cb0),g=a(0x1d1437423),h=a(0x1b9d5cc0c),_=a(0x226892387),y=a(0x19c76d181),x=a(0xe684f705),v=a(0x1358509bc),E=a.n(v);let k=new o.Ay("workflow_builder"),DateTimeInput=({value:e,timezone:t,parameter:a,required:r,onChange:o,dateAriaLabel:v,timeAriaLabel:S,shouldValidate:w=!0,isParameterSyncedWithForm:C})=>{let{viewOnly:A}=(0,b.e)(),T=(0,_.d4)(y.WR),I=(0,_.d4)(e=>(0,x.nv)(e,T,{preferNonExistentToNull:!1})),N=(0,h.et)(I)??s.vp,M=t||N,F=(0,n.useMemo)(()=>l().tz(M),[M]),{valueMoment:O,valueDate:L,valueTime:D}=(0,n.useMemo)(()=>{let t=(0,f.lP)(e,M);return t?.isValid()?{valueMoment:t,valueDate:t.format("YYYY-MM-DD"),valueTime:t.format("HH:mm")}:{}},[M,e]),P=L===F.format("YYYY-MM-DD"),R=!!O?.isBefore(F),B=(0,n.useMemo)(()=>w&&!P&&R,[R,P,w]),W=(0,n.useMemo)(()=>w&&R,[R,w]),V=A||C,q=(0,n.useCallback)((e,t)=>{o(a,(0,f.lP)(`${e} ${t}`,M).toISOString())},[o,a,M]),{onChange:H,errorText:U}=(0,g.x)({errorMessage:k.t("Scheduled to start in the past. Select a time today or on a future date."),isErrored:B||W,shouldErrorPreventSave:!0});(0,n.useEffect)(()=>H(),[]);let z=(0,n.useCallback)(e=>{L&&D&&(q(e,((e,t,a,n)=>{let r=t,i=(0,f.lP)(`${e} ${t}`,a);if(n.format("YYYY-MM-DD")===e&&i.isBefore(n)){let e=n.hours()>=22,t=l()(n);e?t.endOf("day"):t.add(2,"hours").startOf("hour"),r=t.format("HH:mm")}return r})(e,D,M,l().tz(M))),H())},[L,q,D,H,M]),j=(0,n.useCallback)(e=>{e&&D&&L&&(q(L,e),H())},[D,L,q,H]),$=(0,i.A)();return n.createElement(p.b,{parameter:a,className:E().container},n.createElement("div",{className:E().form_inputs},n.createElement("div",{className:"flex_one"},n.createElement(c.b,{id:"date-picker-select",selectedDate:L,dateFormat:"YYYY-MM-DD",displayFormat:"MMMM D, YYYY",disableDatesBefore:F.format("YYYY-MM-DD"),"aria-label":v??k.t("Select a date"),onDateChange:z,isInvalid:B,datePickerDisabled:V,required:r,datePlaceholder:a?.description})),n.createElement("span",{className:"margin_left_50 margin_right_50","aria-hidden":!0},k.t("at")),n.createElement("div",{className:"flex_one"},n.createElement(m.Ay,{selectId:$,onChange:j,width:"100%",value:D,ariaLabel:S??k.t("Select a time"),optionsHourIncrement:"quarter",isInvalid:W,isRequired:r,allowCustomInput:!0,showTimeZone:!1,isDisabled:V}))),a.hint&&n.createElement(d.A,{className:"margin_bottom_0"},a.hint),U&&n.createElement(u.A,null,U))};DateTimeInput.displayName="DateTimeInput"},0x11fa58239:(e,t,a)=>{"use strict";a.d(t,{z:()=>useCustomFunctionProps});var n=a(0x1df96de4c),r=a(0xbad225b5),l=a(0x1db69cda),i=a(0x128d54e52),s=a(0xd2c5015d),o=a(0x242822dfb),c=a(0x1c7660480),d=a(0x62a17882),u=a(0x8c8bafa3),m=a(0xbf8832f0),p=a(0x20482ad21),b=a(0x59698e4);let addOpenFormSelectOptions=({steps:e,createText:t,wrappedCallbackId:a})=>{let n=e.filter(e=>!(a&&e.wrappedFunction&&e.wrappedFunction.callback_id===a)).map(({title:e,id:t})=>({label:e,value:(0,b.k)(t)}));return n.length?[{label:t,options:n,value:null}]:[]};var f=a(0x11e7de8ad),g=a(0x6cc5eee0);let h=new p.Ay("workflow_builder"),getListSelectProps=({parameter:e,openFormSteps:t,value:a,callbackId:n,isFunctionFormWrapped:l})=>{let i=(0,m.oI)(),s=(0,d.y3)()?`slack://list?id=${a}&team=${i}`:`https://app.${(0,u.Xk)()}/client/${i}/lists/${a}`,p=h.t("<{listUrl}|Open in Slack lists>",{listUrl:s,fallbackHash:"7a10b850695b39e3c427cb5bb0704d674b8e8858",fallbackHashNs:"files"}),b=h.t("When you save this step, we will create a new slack list for you."),_=a?[{id:"list-link",message:r.createElement(g.A,{text:p})}]:void 0,y=h.t("Create a list from a form");if(e.name===c.lh&&"string"==typeof a){let r,i;return{hints:(0,f.B)(a)?[{id:"open-form-create-list-hint",message:b}]:_,processOptions:()=>e.name===c.lh&&t.length&&!l?addOpenFormSelectOptions({steps:t,createText:y,wrappedCallbackId:n}):[],...(0,f.B)(a)?{selectedOption:(r=(0,o.uP)(a),i=t.find(e=>e.id===r),{label:i?.title,value:a})}:{}}}return{processOptions:()=>e.name===c.lh&&t.length?addOpenFormSelectOptions({steps:t,createText:y,wrappedCallbackId:n}):[]}};getListSelectProps.displayName="getListSelectProps";var _=a(0x1d3dd4cbe),y=a(0x408bdeff),x=a(0x1795d8821),v=a(0xa985ed31),E=a(0xb11cfed4),k=a.n(E);let useListsFunctionProps=({parameter:e,callbackId:t,value:a,onChange:d,isFunctionFormWrapped:u})=>{let{openFormSteps:m,updateRequiredContext:p}=(0,_.e)(),b=(0,r.useCallback)(e=>{if((0,f.B)(e.value)){let t=(0,o.uP)(e.value),a=m.filter(({id:e})=>e===t)[0].title;return r.createElement(i.Ay,{text:a,size:"small"})}return(0,v.A)(e.value)?r.createElement(y.A,{id:e.value,textClassName:k().fileEntityText}):null},[m]),g=(0,r.useCallback)((e,t,a)=>t.name===c.lh,[]),h=(0,r.useCallback)((e,t,a)=>{let n=(0,l.A)(e),r="string"==typeof a&&(0,o.De)(a,m);if((0,f.B)(a)&&r)return n.config.inputs={...n.config.inputs,...(0,o.a0)(a,r)},n.config.isFunctionFormWrappable=!1,n.config.isFunctionFormWrapped=!1,p("{{event_timestamp}}"),n;let i=!!n.config.slackFunction&&(0,s.R)({stepFunction:n.config.slackFunction});return n.config.isFunctionFormWrappable=i,n},[m,p]);return(0,r.useMemo)(()=>x.oW.AddListRecord===t&&e.type===x.TE.SlackTypesListId?{onValueChange:t=>{d(e,t,void 0,{shouldSetSegmentState:g,setSegmentState:h})},selectProps:getListSelectProps({parameter:e,openFormSteps:m,value:a,callbackId:t,isFunctionFormWrapped:u}),renderSelectedOption:b}:n.t0,[t,e,m,a,u,b,d,g,h])};useListsFunctionProps.displayName="useListsFunctionProps";let useCustomFunctionProps=({parameter:e,value:t,callbackId:a,variables:r,onChange:l,isFunctionFormWrapped:i})=>(a===x.oW.AddListRecord?useListsFunctionProps:()=>n.t0)({parameter:e,value:t,callbackId:a,variables:r,onChange:l,isFunctionFormWrapped:i})},0x2241106d2:(e,t,a)=>{"use strict";a.d(t,{N:()=>useSummarizeBuiltinSearcherOptions});var n=a(0xbad225b5),r=a(0x9e671ad),l=a(0x20b4dda68),i=a(0x7f5a02e8),s=a(0x189779d5a),o=a(0x1d3dd4cbe),c=a(0x1ec69ee01),d=a(0x12185e091),u=a(0x143fb6398),m=a(0xa1832ae4),p=a(0x1edb6b65f),b=a(0x2498088b6),f=a(0x1795d8821),g=a(0x226892387),h=a(0x1ee439e69);function useSummarizeBuiltinSearcherOptions({callbackId:e,parameterType:t,externalWorkspaceId:a}){let{workflowSummaryStepPrecedes:_}=(0,o.e)(),y=(0,g.d4)(b.so),x=(0,g.d4)(e=>(0,p.B)(e,a)),v=(0,g.d4)(h.H7),E=(0,m.ZT)(v),k=(0,n.useMemo)(()=>[l.uh,l.kp],[]),S=(0,n.useCallback)(e=>{if(!(0,d.jq)(e))return!1;let t=(0,u.ju)(e);return!!(k.some(e=>e===E)&&(0,r.A)(((0,c.gs)(e)||[]).slice().sort(),k.sort()))||!t},[E,k]),w=(0,n.useCallback)(e=>!!(0,d.jq)(e)&&!(0,u.ju)(e),[]);return(0,n.useMemo)(()=>{let n,r,l=(0,s.k)(t,e,_),o=e===f.oW.AddAgentToChannel&&t===f.TE.SlackTypesChannelId;return t===f.TE.SlackTypesChannelId&&(n=o?w:S),l&&(r=(0,i.Zq)(l,{isInfoBarriersEnabled:y,filter:n,externalWorkspaceToSearchOn:x?a:void 0})),r},[w,e,a,x,y,t,S,_])}},0x10b93423f:(e,t,a)=>{"use strict";a.d(t,{O:()=>SlackFunctionEntitiesInput});var n=a(0xbad225b5),r=a(0x1407c6c2c),l=a(0x1df96de4c),i=a(0x20482ad21),s=a(0x2b7f0bcc),o=a(0x200c38ed8),c=a(0x11fa58239),d=a(0x2241106d2),u=a(0x1795d8821),m=a(0x189779d5a),p=a(0x223beeef),b=a(0xf33a4f91),f=a(0x1ba35eb3b),g=a(0x194fe1f5f),h=a(0x1d3dd4cbe),_=a(0x668181b3),y=a(0x2772625d),x=a(0x1b05cc3ce),v=a(0x24f66aeb6),E=a(0x2a037c8a),k=a(0x12185e091),S=a(0x70de3606),w=a(0x143fb6398),C=a(0xa1832ae4),A=a(0xb8504a42),T=a(0x2a3fb7ec),I=a(0x16ed1b0dc),N=a(0x226892387),M=a(0x217553e42),F=a(0x1ee439e69);let O=new i.Ay("workflow_builder"),L=["canvas_update_content","canvas_create","channel_canvas_create"],SlackFunctionEntitiesInput=({value:e,variables:t,allowVariables:a,onChange:i,parameter:D,elementId:P,callbackId:R,externalWorkspaceId:B,dynamicInput:W,hasLabel:V=!0,renderOption:q=null,className:H,isValidEmptyObject:U,hideLabel:z,isFunctionFormWrapped:j})=>{let{externalTriggerSalesforceOrgId:$,triggerType:G,viewOnly:K,workflowSummaryStepPrecedes:Y,messagePostedTriggerPrivateChannelAccess:Q,aiStepPrivateChannelAccess:Z,aiStepPrivateChannelTeamIds:J}=(0,h.e)(),X=(0,N.d4)(F.H7),ee=(0,r.A)(),et=(0,r.A)(),ea=(0,C.ZT)(X),en=(0,A.kA)(X),er=!!W,el=er?W.type:D.type,ei=D.type===u.TE.SlackTypesTeamId,es=(0,N.d4)(S.Fh),eo=(0,N.d4)(t=>(0,M.OL)(t,e)),ec=(0,w.ju)(eo),ed=G===E.M.Shortcut&&""===e,{searcherOptions:eu,isFetchingPrefs:em}=(0,o.qI)($),ep=(0,d.N)({callbackId:R,parameterType:el,externalWorkspaceId:B}),eb=$&&!em?et:ee,ef=G===E.M.External&&R===u.oW.SendMessage&&D.type===u.TE.SlackTypesChannelId,eg=R===u.oW.AskAgentforce,eh=R===u.oW.SummarizeChannel,e_=(0,T.X)([u.oW.SendDm,u.oW.SendMessage,u.oW.SendEphemeralMessage,u.oW.ShareCanvas,u.oW.CreateCanvas,u.oW.UpdateCanvasContent,u.oW.UpdateCanvasContentV2,u.oW.CreateChannelCanvas],R)&&Y,ey=R===u.oW.CreateCanvas&&el===u.TE.SlackTypesUserId,ex=eh||e_,ev=[u.oW.CreateChannel,u.oW.CreateUsergroup],{isParameterFormWrappable:eE,is_required:ek}=D,eS=(!!ek||(0,x.L$)(D))&&!eE,ew=!!W?.is_required&&!eE,eC=ei&&!!R&&ev.includes(R),eA=eS&&!er||!U&&ew||eC;(0,n.useEffect)(()=>{eC&&(en||B||e===ea?B&&e!==B&&i(D,B):i(D,ea))},[i,eC,D,e,B,en,ea]),(0,n.useEffect)(()=>{if(ed&&R===u.oW.SendMessage&&D.type===u.TE.SlackTypesChannelId){let e=t.list.find(e=>"Channel where the workflow was used"===e.label);void 0!==e&&i(D,e.id)}},[R,i,D,ed,e,t]),(0,n.useEffect)(()=>{if(ed&&R===u.oW.SendDm&&D.type===u.TE.SlackTypesUserId){let e=t.list.find(e=>"Person who used this workflow"===e.label);void 0!==e&&i(D,e.id)}},[R,i,D,ed,e,t]);let eT=(0,n.useCallback)(e=>{let{id:t}=e;i(D,t)},[i,D]),eI=O.t("This field is required."),eN=O.t("This variable is not supported in this input field."),eM=O.t("This variable is missing."),eF=O.t("This variable is not available."),eO=O.t("The selected channel can\u2019t be used due to Sales Home administrative channel restrictions."),eL=O.t("Channel does not exist in this Slack organization."),eD=O.t("Channel does not exist in this Slack workspace."),eP=(0,n.useMemo)(()=>{if(ef&&!em){let t=eu.entities.channels;if((0,k.jq)(eo)){if("object"==typeof t&&(!(t.includePrivate??!0)&&(0,k.Zp)(eo)||!(t.includePublic??!0)&&(0,k.rW)(eo)))return!0}else if(e&&(0,y.cn)(e)&&"object"==typeof t&&!(t.includePrivate??!0)&&!(t.includePublic??!0))return!0}return!1},[e,eo,em,eu.entities.channels,ef]),eR=(0,n.useMemo)(()=>{let e=[];return D.hint&&e.push({id:"hint_from_parameter",message:D.hint}),e},[D.hint]),eB=(0,n.useMemo)(()=>{let a=[];if(!e&&eA)return[{id:"is_required",message:eI}];if(e&&eP)a.push({id:"channel_selection_restricted",message:eO});else if(e&&(0,y.cn)(e)){let n=(0,_.x)(t.list,e);if(!n||n.isTombstone)return a.push({id:"variable_missing",message:eM}),a;(0,f.Lm)({variable:n,parameter:D})||(0,f.RT)(n,W,void 0)||a.push({id:"invalid_variable_for_input",message:eN}),n.isAvailable||a.push({id:"variable_unavailable",message:eF})}return(0,I.A)(e)&&((0,k.t8)(eo)||(0,k.QR)(eo))&&a.push({id:"invalid_channel",message:en?eL:eD}),a},[e,eA,eI,t.list,D,W,eM,eN,eF,eP,eO,eo,eL,eD,en]),{allowUsers:eW,allowChannels:eV,allowUserGroups:eq,allowMessageContext:eH,allowTeams:eU}=(0,n.useMemo)(()=>(e=>{let t={allowUsers:!1,allowChannels:!1,allowMessageContext:!1,allowUserGroups:!1,allowTeams:!1};switch(e){case u.TE.SlackTypesUserEmail:case u.TE.SlackTypesUserId:return{...t,allowUsers:!0};case u.TE.SlackTypesChannelId:return{...t,allowChannels:!0};case u.TE.SlackTypesUsergroupId:return{...t,allowUserGroups:!0};case u.TE.SlackTypesMessageContext:return{...t,allowMessageContext:!0};case u.TE.SlackTypesTeamId:return{...t,allowTeams:!0};case u.TE.SlackTypesListId:case u.TE.SlackTypesCanvasId:case u.TE.SlackTypesChannelCanvasId:case u.TE.SlackTypesCanvasTemplateId:default:return t}})(el),[el]),ez=(0,m.k)(el,R,Y,Q,Z),ej=(0,n.useMemo)(()=>ef?eu:ex||eg?ep:ey?b.R_:R===u.oW.AiAnswer&&el===u.TE.SlackTypesChannelId&&J&&J.length>0?(0,b.AR)({privateChannelAccess:Z,privateChannelTeamIds:J}):void 0,[eg,ey,eu,ef,ex,ep,R,el,Z,J]),e$=(0,c.z)({parameter:D,value:e,callbackId:R,variables:t,onChange:i,isFunctionFormWrapped:j}),eG=es?e$:l.t0;if(eC&&!en||eC&&B)return null;let eK=!!(eC||R&&L.includes(R)),eY=ec&&(0,I.A)(e),renderComponent=()=>n.createElement("div",{className:"full_width"},n.createElement(g.s,{elementId:P,placeholder:D.description||"",data:t,allowVariables:a,value:e,onChange:eT,isDisabled:K,isRequired:eA,hints:eR,errors:eB,workspaceFilterTeamId:B,allowUsers:eW,allowChannels:eV,allowUserGroups:eq,allowMessageContext:eH,allowTeams:eU,queryType:ez,searcherOptions:ej,renderOption:q,selectKey:eb,callbackId:R,className:H,...eG}),eY&&n.createElement(s.Ay,{level:s.A_.warning,className:"margin_bottom_50"},n.createElement(v.A,{channel:eo,showOnlyConnectedTeamsCount:!1})));return(renderComponent.displayName="renderComponent",V)?n.createElement(p.z,{elementId:P,parameter:D,isAlwaysRequired:eK,hideLabel:z},renderComponent()):renderComponent()};SlackFunctionEntitiesInput.displayName="SlackFunctionEntitiesInput"},0x189779d5a:(e,t,a)=>{"use strict";a.d(t,{k:()=>deriveQueryType});var n=a(0x253c586a2),r=a(0x1795d8821),l=a(0x2a3fb7ec);let deriveQueryType=(e,t,a=!1,i,s)=>{let o=(0,l.X)([r.oW.SendDm,r.oW.SendMessage,r.oW.SendEphemeralMessage,r.oW.ShareCanvas,r.oW.CreateCanvas,r.oW.UpdateCanvasContent,r.oW.UpdateCanvasContentV2,r.oW.CreateChannelCanvas],t),c=t===r.oW.SummarizeChannel,d=t===r.oW.AskAgentforce,u=t===r.Uk.MessagePosted,m=t===r.oW.AiAnswer;switch(e){case r.TE.SlackTypesUserEmail:case r.TE.SlackTypesUserId:if(o&&a)return n.Df;return n.vP;case r.TE.SlackTypesChannelId:if(u)return!1!==i?n.m5:n.XI;if(m)return!1===s?n.XI:n.m5;if(c)return n.kY;if(d)return n.Kh;return n.m5;case r.TE.SlackTypesUsergroupId:return n.MW;case r.TE.SlackTypesListId:return n.xR;case r.TE.SlackTypesCanvasId:return n.Qg;case r.TE.SlackTypesChannelCanvasId:return n.u5;case r.TE.SlackTypesCanvasTemplateId:return n.JM;case r.TE.SlackTypesTeamId:return n.W6;case r.TE.SlackTypesMessageContext:return n.vK;default:return}}},0xb64e73ea:(e,t,a)=>{"use strict";a.d(t,{_:()=>OAuthAccountDelegationRadioField});var n=a(0xbad225b5),r=a(0x120c268ad),l=a.n(r),i=a(0x1407c6c2c),s=a(0x139c79d16),o=a(0x810a3ce9),c=a.n(o);function OAuthAccountDelegationRadioField({label:e,checked:t,onChange:a,children:r,disabled:o}){let d=(0,i.A)();return n.createElement("div",{className:l()(c().radioField,{[c().radioButtonDisabled]:o})},n.createElement("label",{htmlFor:d,className:c().radioButtonLabel},n.createElement(s.A,{className:c().radioButtonBase,id:d,checked:t,onChange:a,disabled:o}),e),r&&n.createElement("div",{className:"align_self_center margin_left_auto"},r))}OAuthAccountDelegationRadioField.displayName="OAuthAccountDelegationRadioField"},0x32784134:(e,t,a)=>{"use strict";a.d(t,{C:()=>SlackFunctionTextInput});var n=a(0xbad225b5),r=a(0x120c268ad),l=a.n(r),i=a(0x1407c6c2c),s=a(0x20482ad21),o=a(0x223beeef),c=a(0x242c34757),d=a(0xaec6c584),u=a(0x162b19a86),m=a(0x1ba35eb3b),p=a(0x1d3dd4cbe),b=a(0x1b05cc3ce),f=a(0x207fb9b92),g=a(0x2310bfb55),h=a.n(g);let _=new s.Ay("workflow_builder"),SlackFunctionTextInput=({variables:e,value:t,parameter:a,onChange:r,formatVariableBeforeInsert:s,required:g,callbackId:y,showInline:x,allowVariables:v,hideLabel:E,isParameterSyncedWithForm:k})=>{let{description:S,title:w,maxLength:C,isParameterFormWrappable:A,hint:T}=a,I=(0,i.A)(),{viewOnly:N,onVariableMenuOpen:M,hasValidAppPinBuiltInMessage:F}=(0,p.e)(),{error:O,runAsyncTextValidation:L}=(0,d.m)(y,a),D=N||k,P=T;C&&!T&&(P=w?_.t("Heads up\u2014the {title} may cause the workflow to fail if variables put it over the {maxLength}-character limit.",{title:w.toLowerCase(),maxLength:C}):_.t("Heads up\u2014the text may cause the workflow to fail if variables put it over the {maxLength}-character limit.",{maxLength:C}));let{message:R,isErrored:B}=(0,n.useMemo)(()=>{let e=(0,u.Lk)(t);switch(!0){case!!((g||(0,b.L$)(a))&&!t&&!A):return{message:_.t("This field is required."),isErrored:!0};case!!C&&e.length>C:return{message:_.t("You can\u2019t enter more than {maxLength} characters.",{maxLength:C}),isErrored:!0};case[null,!1].includes(F):return{message:_.t("This is not a valid message URL or timestamp.",{fallbackHash:"ab90d9d736f9e0909b62d0922e0482e4b827449f"}),isErrored:!0};default:return{message:void 0,isErrored:!1}}},[F,A,C,a,g,t]),{errorText:W,onBlur:V}=(0,f.K)({errorMessage:R,isErrored:B}),q=O?.errorText??W,H=(0,n.useCallback)(async({text:e})=>{let t=(0,u.cY)(e);r(a,t),L&&await L(t)},[L,r,a]),U=(0,n.useCallback)(e=>(0,m.qO)(e)||(0,m.xY)({variable:e,parameter:a}),[a]);return n.createElement(o.z,{elementId:I,parameter:a,className:"c-label--has_footer",inline:x,hideLabel:E,isParameterSyncedWithForm:k},n.createElement(c.A,{textyClassName:l()({[h().parameter_long]:a.long}),id:I,initialText:t,variables:e,allowVariables:v,ariaLabel:w,shouldAddNewLineOnEnter:a.long,onTextChange:H,formatVariableBeforeInsert:s,errorText:q,onBlur:V,placeholder:S,hint:P,renderDataMenuLocation:"inline",customDataFilter:U,callbackId:y,isDisabled:D,maxLength:C,isWorkflowInputText:!0,onVariableMenuOpen:M}))};SlackFunctionTextInput.displayName="SlackFunctionTextInput"},0x1f0569040:(e,t,a)=>{"use strict";a.d(t,{I:()=>TimezoneInput});var n=a(0xbad225b5),r=a(0x1e2051844),l=a(0x1407c6c2c),i=a(0x10a23ba39),s=a(0x20482ad21),o=a(0x15014e268),c=a(0x223beeef),d=a(0x1d3dd4cbe),u=a(0x21c50a68b);let m=new s.Ay("workflow_builder"),TimezoneInput=({value:e,parameter:t,onChange:a,required:p=!1,isParameterSyncedWithForm:b})=>{let{viewOnly:f}=(0,d.e)(),g=(0,l.A)(),h=f||b,_=(0,u.JK)(),y=t.title??m.t("Time zone",{ns:"prefs"}),x=(0,i.Ay)(_),v=(0,n.useMemo)(()=>x?.map(e=>({label:e[0],value:e[1]}))||[],[x]),E=(0,n.useMemo)(()=>(0,r.A)(v,["value",e])||(0,r.A)(v,["value",s.Ay.DEFAULT_TZ]),[v,e]),k=(0,n.useCallback)(e=>{a(t,e.value)},[a,t]);return n.createElement(c.z,{elementId:g,parameter:t,isParameterSyncedWithForm:b},n.createElement(o.Ay,{selectDataQa:"timezone",selectId:g,selectedOption:E,onOptionSelected:k,options:v,size:"medium",width:"100%",ariaLabel:y,isRequired:p,isDisabled:h}))};TimezoneInput.displayName="TimezoneInput"},0x204ee6449:(e,t,a)=>{"use strict";a.d(t,{F:()=>SlackFunctionVariableSelectInput});var n=a(0xbad225b5),r=a(0x21f3c49e8),l=a(0x1407c6c2c),i=a(0x20482ad21),s=a(0x12edaa96a),o=a(0x235d78b7c),c=a(0x242822dfb),d=a(0x223beeef),u=a(0x1ba35eb3b),m=a(0x194fe1f5f),p=a(0x1d3dd4cbe),b=a(0x1b05cc3ce),f=a(0x1795d8821);let g=new i.Ay("workflow_builder"),h={entities:{members:!1,userGroups:!1,channels:!1,teams:!1},allowEmptyQuery:!1},SlackFunctionVariableSelectInput=({value:e,parameter:t,onChange:a,variables:i,formatVariableBeforeInsert:_,hideLabel:y})=>{let x=(0,l.A)(),{onVariableMenuOpen:v}=(0,p.e)(),{hint:E,isParameterFormWrappable:k,name:S,title:w,description:C}=t,[A,T]=(0,n.useState)(x),I=(0,n.useCallback)(()=>T((0,s.A)()),[]),N=!!(t.is_required||(0,b.L$)(t)),M=(0,n.useMemo)(()=>t.type===f.TE.SlackTypesSalesforceRecordId,[t.type]),F=(0,n.useMemo)(()=>{if(E)return[{id:`${S}_hint`,message:E}]},[E,S]),O=(0,n.useMemo)(()=>N&&!k&&(0,r.A)(e)?[{id:`${S}_is_required`,message:g.t("This field is required.")}]:[],[k,N,S,e]),L=(0,n.useCallback)(e=>{let{id:n}=e;n?a(t,(0,c.r2)(i.list,n)?.value):a(t,void 0),I()},[I,a,t,i.list]),D=(0,n.useCallback)(e=>{let n=_?.(e,{})??e,r=(0,c.r2)(i.list,n.id);r&&a(t,r.value),I()},[I,_,a,t,i.list]),P=(0,n.useCallback)(e=>!!t&&((0,u.Lm)({variable:e,parameter:t})||(0,u.xY)({variable:e,parameter:t})),[t]),R=(0,n.useMemo)(()=>({enable:!0}),[]);return n.createElement(d.z,{elementId:x,parameter:t,hideLabel:y},n.createElement("div",{className:"display_flex"},n.createElement(m.s,{key:A,value:e,data:i,allowVariables:!0,onChange:L,allowUsers:!1,allowChannels:!1,allowVariablesByType:t.type,className:"full_width no_margin",hints:F,errors:O,isInvalid:O.length>0,isRequired:N,searcherOptions:h,placeholder:C||g.t("Select option\u2026"),ariaLabel:w,enforceStrictVariableTypeMatch:M}),n.createElement(o.jx,{value:e,onSelect:D,data:i.groups,customDataFilter:P,renderIconInline:!0,onMenuTriggerClick:v,className:"margin_left_50 margin_top_50 display_flex align_items_start",inputType:t.type,suggestedVariableConfig:R})))};SlackFunctionVariableSelectInput.displayName="SlackFunctionVariableSelectInput"},0x223beeef:(e,t,a)=>{"use strict";a.d(t,{z:()=>SlackFunctionLabel});var n=a(0xbad225b5),r=a(0x120c268ad),l=a.n(r),i=a(0x1407c6c2c),s=a(0x20482ad21),o=a(0x1d2cd7755),c=a(0x2501a2cee),d=a(0x1d3dd4cbe),u=a(0x1b05cc3ce),m=a(0x1b3ecb90f),p=a(0x15a4ffb05),b=a(0x1789e94fa),f=a(0x5b1935a6);let g=n.lazy(()=>Promise.resolve().then(a.bind(a,0x7733abee)).then(e=>({default:e.MessagePostedPrivateChannelAccessBadge}))),h={spaceName:f.xu.WORKFLOW_BUILDER_MESSAGE_POSTED_TRIGGER_MODAL,notifications:{[f.ze.HERMES_WORKFLOWS_MESSAGE_POSTED_TRIGGER_PRIVATE_CHANNEL_ACCESS_BADGE]:{component:g}}};var _=a(0x145d46a61),y=a(0x1795d8821),x=a(0x226892387),v=a(0x17abac04c),E=a.n(v);let k=new s.Ay("workflow_builder"),SlackFunctionLabel=({elementId:e,parameter:t,children:a,className:r,inline:s,noMarginBottom:f,labelProps:g={},isAlwaysRequired:v,isAlwaysOptional:S,isBold:w=!0,forceLabel:C,hideLabel:A,isParameterSyncedWithForm:T,subtext:I,callbackId:N})=>{let M=(0,i.A)(),{title:F,name:O,description:L}=t,D=C||F||O||L,P=!S&&(t.type===y.TE.Boolean||t.is_required||v||(0,u.L$)(t))?"":` ${k.t("(optional)")}`,R=(0,x.d4)(_.$T),B=(0,x.d4)(_.sQ),{messagePostedTriggerPrivateChannelAccess:W}=(0,d.e)(),V=N===y.Uk.MessagePosted&&"channelIds"===O&&B&&!0===W,q=R&&T,H=(0,n.useMemo)(()=>n.createElement(n.Fragment,null,n.createElement(p.A,{text:D+P,emojiSize:m.lw.SMALL}),V&&n.createElement(b.A,h),q?n.createElement("span",{className:E().syncedWithFormLabel},n.createElement(c.Ah,{name:"refresh","aria-hidden":!0}),k.t("Included in form")):null),[q,V,P,D]);return A?n.createElement(n.Fragment,null,a):n.createElement(o.A,{htmlFor:e??M,text:H,...g,"data-qa-segment-parameter":O,"data-qa":"slack-function-label",className:l()(r,{bold:w,margin_bottom_150:!f,[E().inlineLabel]:s,[E().messagePostedTriggerLabel]:N===y.Uk.MessagePosted}),subtext:I},a)};SlackFunctionLabel.displayName="SlackFunctionLabel"},0x242c34757:(e,t,a)=>{"use strict";a.d(t,{A:()=>S});var n=a(0xbad225b5),r=a(0x120c268ad),l=a.n(r),i=a(0x2286acf6c),s=a(0x20482ad21),o=a(0x677a139e),c=a(0x1e586fbba),d=a(0x1576dac7),u=a(0x235d78b7c),m=a(0x88881d67),p=a(0x1ba35eb3b),b=a(0x668181b3),f=a(0x10a716a94),g=a(0x1b77d8ef3),h=a(0x10bd0ba09),_=a(0x1cd3157a9),y=a(0x13f30d329),x=a(0x2310bfb55),v=a.n(x);let E=new s.Ay("workflow_builder"),k=(0,i.A)((e,t)=>{e.current&&t&&t({text:e.current.value()})},150,{leading:!0}),PlainTextBuilderTexty=({id:e,errorText:t=null,initialText:a="",onEnter:r,onTextChange:i,formatVariableBeforeInsert:s,shouldAddNewLineOnEnter:x=!0,isDisabled:S=!1,focusOnMount:w=!1,variables:C,maxLength:A,onBlur:T,ariaLabel:I,placeholder:N,hint:M,renderDataMenuLocation:F="default",className:O,textyClassName:L,callbackId:D,customDataFilter:P=p.qO,onSetTextyRef:R,replaceValueOnVariableChange:B,onVariableMenuOpen:W,inputType:V,allowVariables:q,isWorkflowInputText:H})=>{let U="inline"===F&&!S,z="inside"===F&&!S,j="default"===F&&!S,$=(0,n.useRef)(),G=(0,n.useMemo)(()=>C||{list:[],groups:[]},[C]),K=(0,n.useMemo)(()=>(0,y.A)(a,C?.list||[]),[C?.list,a]),Y=(0,n.useCallback)(()=>k($,i),[i]),Q=(0,n.useCallback)((e={})=>!0!==e.metaKey&&(!!x||!0===e.shiftKey||(k($,r),!1)),[r,x]),Z=(0,n.useCallback)(e=>{null!==e&&!$.current&&($.current=e,Y(),R&&R($.current))},[R,Y]),J=(0,n.useCallback)(()=>n.createElement("div",null,n.createElement(c.A,null,E.t("Something went wrong"))),[]),X=t&&t.length>0,ee=(0,n.useCallback)(e=>{if(!$.current)return;let{quill:t}=$.current?.instance,{index:a,length:n}=t.getSelection(!0);n>0&&t.deleteText(a,n,"user");let r=(0,m.Jq)(s?.(e,{})??e),l={id:r.id,type:(0,_.Z)(r.id,r.type),label:r.label,sourceLabel:r.sourceLabel,isAvailable:r.isAvailable};B?(t.setText(""),t.insertEmbed(0,"workflowtoken",{...l,variableData:r},"user"),t.setSelection(1)):(t.insertEmbed(a,"workflowtoken",{...l,variableData:r},"user"),t.setSelection(a+1))},[s,B]),[{activeTokenIndex:et,activeTokenElement:ea,activeTokenData:en,activeTokenVariableData:er},el]=(0,n.useState)({activeTokenIndex:null,activeTokenData:null,activeTokenVariableData:null,activeTokenElement:null}),ei=(0,n.useCallback)(()=>{el({activeTokenIndex:null,activeTokenData:null,activeTokenVariableData:null,activeTokenElement:null})},[el]),es=(0,n.useCallback)(e=>{let{token:t,element:a,index:n}=e,r=(0,b.x)(G.list,t.id);r&&el({activeTokenIndex:n,activeTokenData:t,activeTokenVariableData:(0,m.Jq)(r),activeTokenElement:a})},[G.list]),eo=(0,n.useCallback)(({dataItem:e})=>{let t=$.current,{quill:a}=t.instance,n={id:e.id,type:e.type};a.deleteText(et,1),a.insertEmbed(et,"workflowtoken",{...n,variableData:e}),null!==et&&t.instance.setSelection(et+1,0,"silent"),i({text:t.value()}),ei()},[et,ei,i]);return n.createElement(f.A,{subtype:"builder_texty",renderError:J},n.createElement("div",{"data-qa":"plain-text",className:l()(O,{display_flex:U})},n.createElement("div",{className:U?v().inline_width:""},n.createElement(g.A,{className:"normal",isDisabled:S,isInvalid:!!X},n.createElement(h.A,{id:e,"data-qa":e,maxLength:A,onBlur:T,ariaLabel:I,focusOnMount:w,maxLines:8,initialText:K,useWorkflowTokens:!0,workflowTokens:G.list,onTextChange:Y,isDisabled:S,onEnter:Q,useWysiwyg:!1,workflowTokenClick:es,ref:Z,placeholder:N,className:L,isWorkflowInputText:H}),q&&z?n.createElement(u.jx,{onSelect:ee,data:G.groups,customDataFilter:P,renderIconInside:!0,onMenuTriggerClick:W}):null,!S&&null!==ea&&null!==en&&null!==er&&n.createElement(d.I,{tetherElement:ea,tokenData:en,variableData:er,onClose:ei,updateDynamicData:eo,callbackId:D}))),q&&U?n.createElement("div",{className:"margin_left_50 display_flex"},n.createElement(u.jx,{onSelect:ee,data:G.groups,customDataFilter:P,renderIconInline:!0,onMenuTriggerClick:W,inputType:V,allowEmptyState:!!V})):null),M&&n.createElement(o.A,{className:l()("margin_bottom_0",{[v().hint_text_width]:U})},M),n.createElement("div",{className:"display_flex justify_content_between"},n.createElement("div",null,X&&n.createElement(c.A,null,t)),q&&j?n.createElement("div",{className:"margin_top_50"},n.createElement(u.jx,{onSelect:ee,data:G.groups,customDataFilter:P,onMenuTriggerClick:W})):null))};PlainTextBuilderTexty.displayName="PlainTextBuilderTexty";let S=PlainTextBuilderTexty},0x1a740dbac:(e,t,a)=>{"use strict";a.d(t,{b:()=>UnsupportedInputParameter});var n=a(0xbad225b5),r=a(0x40c0d834),l=a(0x3711e82d);let UnsupportedInputParameter=({parameter:e,functionId:t})=>{let a="items"in e?e.items.type:void 0;return n.createElement(r.A,{uiComponentName:l.UiComponentName.WORKFLOW_UNSUPPORTED_PARAMETER,clogImpression:!0,uiComponentVariant:e.type,elementName:a,displayName:t},n.createElement("span",null))};UnsupportedInputParameter.displayName="UnsupportedInputParameter"},0xfd04a21a:(e,t,a)=>{"use strict";a.d(t,{A:()=>p});var n=a(0xbad225b5),r=a(0x2264e6ea3),l=a(0x15bd59d31),i=a(0xf159cb74),s=a(0x73d7ee71),o=a(0x18b8a1e5b),c=a(0xb8504a42),d=a(0x226892387),u=a(0x217553e42),m=a(0x1ee439e69);let ChannelSelectListEntity=({channelId:e,showTeamForLocalChannels:t})=>{let a=(0,d.d4)(m.H7),p=(0,d.d4)(t=>(0,u.OL)(t,e)),b=(0,i.c)(p),f=(0,d.d4)(e=>(0,s.R)(e,p))?.length;return n.createElement(l.A,{channelId:e,"data-qa":"channel-select-list-entity",showTeamForLocalChannel:t&&(0,c.kA)(a)&&!(0,o.O)(p)&&!(0,r.JV)(b)&&1===f})};ChannelSelectListEntity.displayName="ChannelSelectListEntity";let p=ChannelSelectListEntity},0xf33a4f91:(e,t,a)=>{"use strict";a.d(t,{AR:()=>getAiStepChannelSearchOptions,C3:()=>k,Ci:()=>itemStringUrlSplitQuery,Db:()=>itemStringEmailSplitQuery,Fq:()=>E,Fr:()=>itemNumberValidator,L6:()=>b,QX:()=>S,R_:()=>_,U6:()=>itemStringUrlValidator,Ut:()=>getMessagePostedTriggerChannelSearchOptions,V2:()=>itemStringEmailValidator,ak:()=>itemTimestampValidator,dS:()=>x,gY:()=>w,jO:()=>y,o6:()=>itemIntegerValidator,r:()=>itemStringValidator,r0:()=>itemStringSplitQuery,vU:()=>v,x1:()=>isArrayVariableReference});var n=a(0xb77a689a),r=a(0x668181b3),l=a(0xbbd2a32d),i=a(0x2772625d),s=a(0x1ec69ee01),o=a(0x12185e091),c=a(0xf159cb74),d=a(0x1795d8821),u=a(0x143aeed3e),m=a(0xa5d8361b);let p={entities:{channels:{includeArchived:!1,includePrivate:!0,includeMpims:!1,onlyIfMember:!0}},sort:{frecency:!0},allowEmptyQuery:!0},b={...p,entities:{channels:{...p.entities.channels,includeFromAnotherTeam:!0}}},f={...b,entities:{channels:{...b.entities.channels,includePrivate:!1,includeOnlyExternallyShared:!1}}},g={...b,entities:{channels:{...b.entities.channels,includeRecordChannels:!1,includeOnlyExternallyShared:!1}}},h={...f,entities:{channels:{...f.entities.channels,includeRecordChannels:!1,includeOnlyExternallyShared:!1}}},getAiStepChannelSearchOptions=({privateChannelAccess:e,privateChannelTeamIds:t})=>!1===e?h:t&&t.length>0?{...g,filter:e=>{if(!(0,o.Zp)(e))return!0;let a=(0,c.c)(e);return((0,s.Si)(e)||(a?[a]:[])).some(e=>e&&t.includes(e))}}:g,getMessagePostedTriggerChannelSearchOptions=({privateChannelAccess:e,privateChannelTeamIds:t})=>e?t&&t.length>0?{...b,entities:{channels:{...b.entities.channels,includeOnlyExternallyShared:!1}},filter:e=>{if(!(0,o.Zp)(e))return!0;let a=(0,c.c)(e);return((0,s.Si)(e)||(a?[a]:[])).some(e=>e&&t.includes(e))}}:{...b,entities:{channels:{...b.entities.channels,includeOnlyExternallyShared:!1}}}:f,_={entities:{members:{includeSelf:!0,includeSlackbot:!1,includeBots:!1,onlyLocalTeam:!0,includeGuests:!1}},sort:{frecency:!0},allowEmptyQuery:!0},y={allowEmptyQuery:!0,tiered:!0,entities:{files:{onlyCanvases:!0}},returnMetadata:!0,sort:{frecency:!0}},x={...y,entities:{...y.entities,files:{...y.entities.files,excludeTemplateCanvases:!0}}},v={allowEmptyQuery:!0,tiered:!0,entities:{files:{onlyLists:!0}},returnMetadata:!0,sort:{frecency:!0}},E={allowEmptyQuery:!1,entities:{files:{}},returnMetadata:!0,sort:{frecency:!0}},k={entities:{userGroups:{includeFromAnotherTeam:!0,excludeOrgLevel:!0}},sort:{frecency:!0},allowEmptyQuery:!0},S={entities:{teams:{includeCurrentTeam:!0,onlyCurrentOrg:!1}},sort:{frecency:!0},allowEmptyQuery:!0},isArrayVariableReference=(e,t)=>{if(!(0,i.cn)(t))return!1;let a=(0,r.x)(e.list,t);return a?.type===d.TE.Array},itemNumberValidator=e=>(0,l.gf)(Number(e)),itemIntegerValidator=e=>(0,l.zh)(Number(e)),itemStringValidator=e=>(0,n.A)(e),itemStringEmailValidator=e=>{let t=(0,n.A)(e),a=t?(0,u.Ay)(e):{isValid:!1};return t&&a.isValid},itemStringUrlValidator=e=>(0,n.A)(e)&&(0,m.A)(e),itemTimestampValidator=e=>(0,n.A)(e)&&Number(e)>0,itemStringSplitQuery=e=>e.split(",").filter(Boolean),itemStringEmailSplitQuery=e=>e.split(/[\s,]+/).filter(Boolean),itemStringUrlSplitQuery=e=>e.split(/[\s,]+/).filter(Boolean),w=[d.TE.SlackTypesUserId,d.TE.SlackTypesChannelId,d.TE.SlackTypesUserEmail,d.TE.SlackTypesUsergroupId,d.TE.SlackTypesTimestamp,d.TE.String,d.TE.Integer,d.TE.Number,d.TE.Boolean,d.TE.SlackTypesTeamId,d.TE.SlackTypesCanvasId,d.TE.SlackTypesListId,d.TE.SlackTypesFileId]},0xaec6c584:(e,t,a)=>{"use strict";a.d(t,{m:()=>useAsyncTextValidation});var n=a(0xbad225b5),r=a(0x16cf1da63),l=a(0x21f3c49e8),i=a(0x162afc153),s=a(0x162b19a86),o=a(0x1d3dd4cbe),c=a(0x1ebe91b72),d=a(0xb94670f8),u=a(0x1795d8821),m=a(0x1c8f352ff),p=a(0x1ec68d6a3),b=a(0x8ba4f2d8),f=a(0x33830eed),g=a(0x15e263568);let useAsyncTextValidation=(e,t)=>{let[a,h]=(0,n.useState)(void 0),{validateAsyncValue:_}=(0,o.e)(),y=(0,r.wA)(),x=(0,n.useCallback)(async e=>{if((0,l.A)(e))return;let t=(0,m.zU)();try{let a=await y((0,b.A)({channelName:e}));if(!a)return;return(0,m.Zo)(a,{maxChannelNameLength:t})}catch(e){(0,p.default)({label:"WORKFLOW-BUILDER"}).error("Unable to fetch channel name validation",e);return}},[y]),v=(0,n.useCallback)(async e=>{if(!(0,l.A)(e))try{let t=await y((0,g.Ay)({name:e,reason:"workflow-builder-builtin-create-user-group"}));if(!t)return;return t}catch(e){(0,p.default)({label:"WORKFLOW-BUILDER"}).error("Unable to fetch usergroup name validation",e);return}},[y]),E=(0,n.useCallback)(async e=>{if(!(0,l.A)(e))try{let t=await y((0,f.Ay)({handle:e,reason:"workflow-builder-builtin-create-user-group",targetTeam:""}));if(!t)return;return t}catch(e){(0,p.default)({label:"WORKFLOW-BUILDER"}).error("Unable to fetch usergroup handle validation",e);return}},[y]),k=(0,n.useMemo)(()=>e===u.oW.CreateChannel?async t=>{if((0,c.cL)().test(t)){h(void 0),_({isValidChannelName:!0});return}let a=await x(t);if(!a){h(void 0),_({isValidChannelName:!0});return}h({errorType:e,errorText:a}),_({isValidChannelName:!1})}:e===u.oW.CreateUsergroup&&t?.name==="usergroup_handle"?async t=>{if((0,c.cL)().test(t)){h(void 0),_({isValidUserGroupHandle:!0});return}let a=await E(t);if(!a){h(void 0),_({isValidUserGroupHandle:!0});return}h({errorType:e,errorText:a}),_({isValidUserGroupHandle:!1})}:u.oW.CreateUsergroup&&t?.name==="usergroup_name"?async t=>{if((0,c.cL)().test(t)){h(void 0),_({isValidUserGroupName:!0});return}let a=await v(t);if(!a){h(void 0),_({isValidUserGroupName:!0});return}h({errorType:e,errorText:a}),_({isValidUserGroupName:!1})}:e===u.oW.UpdateChannelTopic&&t?.name==="topic"?async t=>{if((0,s.Lk)(t).length>d.QS){h({errorType:e,errorText:(0,d.Bw)(d.FA)}),_({isValidChannelTopic:!1});return}h(void 0),_({isValidChannelTopic:!0})}:void 0,[e,x,E,v,t?.name,_]);return{error:a,runAsyncTextValidation:k?(0,i.A)(k,500,{leading:!0}):void 0}}},0x1011848bf:(e,t,a)=>{"use strict";a.d(t,{L:()=>n.L});var n=a(0x1efcf3032)},0x1c4a1a163:(e,t,a)=>{"use strict";a.d(t,{v:()=>InputRenderingEngine});var n=a(0xbad225b5),r=a(0x1df96de4c),l=a(0x88881d67),i=a(0x1f5430624),s=a(0xa4a4f43b),o=a(0x242822dfb),c=a(0x2151a9a6),d=a(0xa224974e),u=a(0x19f0ddaf7),m=a(0x1407c6c2c),p=a(0x20482ad21),b=a(0x2503b7c1),f=a(0x677a139e),g=a(0x235d78b7c),h=a(0x380ee7b0),_=a(0x223beeef),y=a(0x1ba35eb3b),x=a(0x1d3dd4cbe),v=a(0x170cd7c4b),E=a.n(v);let k=new p.Ay("workflow_builder"),SlackFunctionDateInput=({value:e,parameter:t,onChange:a,required:r,variables:l,formatVariableBeforeInsert:i,allowVariables:s,hideLabel:c,isParameterSyncedWithForm:d})=>{let{viewOnly:u,onVariableMenuOpen:p}=(0,x.e)(),v=(0,m.A)(),S=u||d,w=(0,n.useCallback)(e=>{let n=i(e,{parameterType:t.type}).id;return a(t,n)},[i,a,t]),C=(0,n.useMemo)(()=>(0,o.r2)(l.list,e),[e,l.list]),A=(0,n.useCallback)(e=>{a(t,e)},[a,t]),T=(0,n.useCallback)(e=>(0,y.JF)(e,void 0)||(0,y.xY)({variable:e,parameter:t}),[t]);return n.createElement(_.z,{elementId:v,parameter:t,hideLabel:c,isParameterSyncedWithForm:d},C?n.createElement(h.P,{onChange:A,value:e,variables:l,customDataFilter:T,label:t.title??t.description??t.name,isDisabled:S,formatVariableBeforeInsert:i,parameterType:t.type}):n.createElement(n.Fragment,null,n.createElement("div",{className:E().dateWrapper},n.createElement(b.b,{onDateChange:A,inputClassName:"margin_bottom_100",dateFormat:"YYYY-MM-DD",displayFormat:"YYYY-MM-DD",selectedDate:e,required:r,id:v,datePlaceholder:t?.description??k.t("Select a date"),datePickerDisabled:S}),s&&!d&&n.createElement(g.jx,{onSelect:w,data:l.groups,customDataFilter:T,renderIconInline:!0,isDisabled:S,onMenuTriggerClick:p})),t.hint&&n.createElement(f.A,{className:"margin_bottom_0"},t.hint)))};SlackFunctionDateInput.displayName="SlackFunctionDateInput";var S=a(0x1fe708dbe),w=a(0x11a296110),C=a(0x1b3ecb90f),A=a(0x1faaed399);let SlackFunctionEmojiInput=({value:e,parameter:t,onChange:a,hideLabel:r})=>{let l=(0,m.A)(),{viewOnly:i}=(0,x.e)(),s=(0,n.useCallback)((e,n)=>{a(t,n)},[a,t]);return n.createElement(_.z,{elementId:l,parameter:t,hideLabel:r},n.createElement(A.A,{onEmojiSelected:s},n.createElement(w.Ay,{id:"channel-section-emoji",name:"channel-section-emoji","data-qa":"channel-section-emoji-picker",disabled:i,type:"outline","aria-label":e?"Change Emoji":"Select Emoji"},e?n.createElement(C.Ay,{emojiSize:C.lw.MEDIUM,text:e}):"Select Emoji")))};SlackFunctionEmojiInput.displayName="SlackFunctionEmojiInput";var T=a(0x10b93423f),I=a(0x120c268ad),N=a.n(I),M=a(0x21f3c49e8),F=a(0x12edaa96a),O=a(0x15dd8a31),L=a(0x2772625d),D=a(0x1b05cc3ce),P=a(0x15a4ffb05),R=a(0x185eec583),B=a(0x1e361565a),W=a(0x20a6d1776),V=a(0x207fb9b92),q=a(0x1282104f7),H=a(0x1840248cf),U=a(0xe0cde178),z=a.n(U);let j=new p.Ay("workflow_builder"),SlackFunctionEnumInput=({variables:e,value:t,parameter:a,formatVariableBeforeInsert:r,onChange:l,allowVariables:i,hideLabel:s,isParameterSyncedWithForm:o})=>{let c=(0,m.A)(),d=a.type,{viewOnly:u,onVariableMenuOpen:p}=(0,x.e)(),[b,h]=(0,n.useState)(c),[v,E]=(0,n.useState)(!1),[k,S]=(0,n.useState)(),w=(0,n.useMemo)(()=>Object.fromEntries(e.list.map(e=>[e.id,e])),[e]),A=(a.is_required||(0,D.L$)(a))&&!a.isParameterFormWrappable,T=u||o,I=(0,n.useMemo)(()=>{let e="number"==typeof t?Number.isNaN(t):(0,M.A)(t),a=[];return A&&e&&a.push({id:"is_empty_and_is_required",message:j.t("This field is required.")}),a},[A,t]),{onBlur:U,okayToDisplay:$}=(0,V.K)({errorMessage:void 0,isErrored:I.length>0}),G=(0,n.useCallback)(e=>{switch(d){case W.V.String:return(0,y.qO)(e);case R.I.Integer:return(0,y.DU)(e);case B.n.Number:return(0,y.If)(e);default:return!0}},[d]),K=(0,n.useCallback)(e=>{if(t!==e.value){let t=a?.choices?a.choices.find(t=>t.value===e.value)?.title:void 0;l(a,e.value,t?{[e.value]:t}:void 0),h((0,F.A)()),""===e.value&&E(!0),k&&S(void 0)}},[a,l,t,k]),Y=(0,n.useCallback)(e=>(0,L.cn)(e.value)&&k?n.createElement(q.A,{className:N()("align_items_start flex_direction_column margin_top_0",{[z().has_errors]:!k.label?.length}),svgIcon:{name:"css"},entityId:k.id,label:k.label?.length?k.label:j.t("Missing Data")}):n.createElement(P.A,{text:e.label,emojiSize:C.lw.SMALL}),[k]),Q=(0,n.useCallback)(e=>{let t=r?.(e,{})??e;S(t),l(a,t.id),h((0,F.A)())},[r,l,a]),Z=t;!a.default||Z||v||(Z=a.default,setTimeout(()=>{a.default&&l(a,a.default)}));let J=j.t("Please select an option"),X=(0,n.useMemo)(()=>{let e={label:j.t("Clear selection",{ns:"channel_sidebar"}),value:""},t=Array.isArray(a.choices)?a.choices.filter(e=>!0!==e.is_hidden).map(({title:e,value:t})=>({label:e,value:String(t)})):(a.enum||[]).map(String).map(e=>({label:e,value:e}));if("string"==typeof Z&&(0,L.cn)(Z)){let e={...w[(0,H.z)(Z)],id:Z};t.push({label:e.label||"",value:Z}),k?.id!==e.id&&S(e)}return!a.is_required&&Z&&(t.find(e=>""===e.value)||t.unshift(e)),t},[a,w,Z,k?.id]),ee=(0,n.useMemo)(()=>Z?X.find(e=>e.value===String(Z)):null,[X,Z]);return n.createElement(_.z,{elementId:c,parameter:a,hideLabel:s,isParameterSyncedWithForm:o},n.createElement("div",{className:"display_flex"},n.createElement("div",{className:"full_width display_flex"},n.createElement(O.A,{className:"flex_one no_min_width",key:b,width:"100%",options:X,selectedOption:ee,onOptionSelected:K,ariaLabel:J,selectDataQa:"slack-function-enum-input",placeholderText:a.description||J,renderOption:Y,renderSelectedOption:Y,isDisabled:T,onBlur:U,errors:$?I:void 0,isInvalid:$&&!!I.length}),i&&!o&&n.createElement(g.jx,{onSelect:Q,data:e.groups,customDataFilter:G,renderIconInline:!0,isDisabled:T,onMenuTriggerClick:p,className:"margin_left_50 margin_top_50 display_flex align_items_start"}))),a.hint&&n.createElement(f.A,{className:"margin_bottom_0"},a.hint))};SlackFunctionEnumInput.displayName="SlackFunctionEnumInput";let InteractivityInput=({onChange:e,parameter:t,value:a})=>((0,n.useEffect)(()=>{a&&0!==a.length||e(t,"init")},[e,t,a]),null);var $=a(0x16cf1da63),G=a(0x207b33662),K=a(0x1576dac7),Y=a(0x13f7d86f3),Q=a(0x2001af3ac),Z=a(0x24429189c);let J=new p.Ay("workflow_builder"),SlackFunctionLimitedBlocksInput=({value:e,callbackId:t,parameter:a,variables:r,onChange:l,formatVariableBeforeInsert:i,required:s,hideLabel:o,isParameterSyncedWithForm:c,sendAsUserValue:d=!1,experimentUserAuthoredWorkflowPostsFeGroupOn:u=!1})=>{let{title:p,isParameterFormWrappable:b}=a,f=(0,m.A)(),[g,h]=(0,n.useState)(!1),y=(0,$.wA)(),{viewOnly:v,onVariableMenuOpen:E}=(0,x.e)(),k=(0,n.useMemo)(()=>g||!!(s||(0,D.L$)(a))&&!b&&(0,M.A)(e),[e,g,s,a,b]),S=(0,n.useMemo)(()=>g?J.t("Message is too long."):J.t("This field is required."),[g]),{errorText:w,onBlur:C}=(0,V.K)({errorMessage:S,isErrored:k}),A=(0,n.useCallback)(({blocks:e})=>{if(e){let t=y((0,Z.f)({blocks:e}));h((0,Q.A)(t)>75)}l(a,e??[])},[y,l,a]),T=(0,n.useCallback)(({activeTokenElement:e,activeTokenData:a,activeTokenVariableData:r,hideCustomizeDataPopover:l,updateDynamicData:i})=>(0,Y.L4)(r)?n.createElement(K.I,{tetherElement:e,tokenData:a,variableData:r,callbackId:t,onClose:l,updateDynamicData:i,fromRichText:!0}):null,[t]),I=(0,n.useMemo)(()=>"string"==typeof e?[]:e,[e]);return n.createElement(_.z,{elementId:f,parameter:a,hideLabel:o,isParameterSyncedWithForm:c},n.createElement(G.c,{id:"message",initialText:"string"==typeof e?e:"",initialBlocks:I,data:r,placeholder:a?.description??J.t("Ex: Hello!"),ariaLabel:p??J.t("Set the step message text"),hint:a.hint,onTextChange:A,onBlur:C,callbackId:t,errorText:w||null,maxLength:75,isSingleLine:!0,useLimitedBlocks:!0,enableEmoji:!0,shouldAddNewLineOnEnter:!0,onEnter:null,focusOnMount:!1,isDisabled:v||c,formatVariableBeforeInsert:i,canInsertAllVariablesByGroup:!0,getVariableCustomizeMenu:T,onVariableMenuOpen:E,sendAsUserValue:d,experimentUserAuthoredWorkflowPostsFeGroupOn:u}))};SlackFunctionLimitedBlocksInput.displayName="SlackFunctionLimitedBlocksInput";var X=a(0x118cdcdea),ee=a.n(X),et=a(0x242c34757),ea=a(0xbbd2a32d),en=a(0x1795d8821);let er=new p.Ay("workflow_builder"),SlackFunctionNumberInput=({variables:e,value:t,parameter:a,onChange:r,formatVariableBeforeInsert:l,allowVariables:i,hideLabel:s,isParameterSyncedWithForm:o})=>{let{title:c,description:d,is_required:u=!1,isParameterFormWrappable:p}=a,b=(u||(0,D.L$)(a))&&!p,f=(0,m.A)(),{viewOnly:g,onVariableMenuOpen:h}=(0,x.e)(),v=(0,n.useRef)(),E=a.type===en.HN.Integer,k=g||o,S=""===t?NaN:Number(t),w=E?(0,ea.zh)(S):(0,ea.gf)(S),C=S>ea.Ig||a.maximum&&S>a.maximum,A=S<ea.kj||a.minimum&&S<a.minimum,T=(0,L.cn)(String(t))||w&&!C&&!A,I=(0,n.useMemo)(()=>b&&""===t?er.t("This field is required."):C?er.t("This number is too large."):A?er.t("This number is too small."):E?er.t("This is not a valid integer."):er.t("This is not a valid number."),[E,b,C,A,t]),N=(0,n.useMemo)(()=>b?!T:""!==t&&!T,[T,b,t]),{errorText:M,onBlur:F}=(0,V.K)({errorMessage:I,isErrored:N}),O=(0,n.useCallback)(({text:e})=>{r(a,e.replace(/{{(.*?)}}/g,"$1"))},[r,a]),P=(0,n.useCallback)(e=>{v.current=e},[]),R=(0,n.useCallback)(()=>{if(w&&v.current){let e=String(Number(t)),a=new(ee())().insert(e);v.current?.setContents({contents:a.ops})}F()},[w,F,t]),B=(0,n.useCallback)(e=>(E?(0,y.DU)(e):(0,y.If)(e))||(0,y.xY)({variable:e,parameter:a}),[E,a]);return n.createElement(_.z,{elementId:f,parameter:a,hideLabel:s,isParameterSyncedWithForm:o},n.createElement(et.A,{id:f,initialText:String(t),variables:e,allowVariables:i,ariaLabel:c,shouldAddNewLineOnEnter:!1,onTextChange:O,onBlur:R,formatVariableBeforeInsert:l,errorText:M,placeholder:d,hint:a.hint,renderDataMenuLocation:"inline",customDataFilter:B,onSetTextyRef:P,isDisabled:k,onVariableMenuOpen:h}))};SlackFunctionNumberInput.displayName="SlackFunctionNumberInput";var el=a(0x1d2cd7755),ei=a(0x139c79d16),es=a(0xa5dbe09b),eo=a(0x226892387),ec=a(0x14149c126),ed=a(0x19935b6b1),eu=a.n(ed);let em=new p.Ay("workflow_builder"),SlackFunctionRadioInput=({value:e,parameter:t,onChange:a})=>{let r=(0,eo.d4)(e=>"on"===(0,ec._Z)(e,"user_authored_workflow_posts_fe")),l=r?em.t("Send message as:"):"Send message as:",i=(0,m.A)(),{viewOnly:s,formStepPrecedesCurrentStep:o}=(0,x.e)();(0,n.useEffect)(()=>{void 0===e&&a(t,!1),o||a(t,!1)},[e,o]);let c=(0,n.useCallback)(e=>{a(t,"true"===e.target.value)},[a,t]);return r?n.createElement("div",{className:N()(eu().outerContainer)},n.createElement("div",{className:N()(eu().innerContainer)},n.createElement(es.A,{legendText:l},n.createElement(el.A,{text:r?em.t("Workflow"):"Workflow",type:"inline"},n.createElement(ei.A,{"data-qa":"radio",id:`${i}-false`,value:"false",onChange:c,checked:!1===e,disabled:s||!o})),n.createElement(el.A,{text:em.t("Person who submitted the form"),type:"inline"},n.createElement(ei.A,{"data-qa":"radio",id:`${i}-true`,value:"true",onChange:c,checked:!0===e,disabled:s||!o}))))):null};SlackFunctionRadioInput.displayName="SlackFunctionRadioInput";var ep=a(0x2501a2cee),eb=a(0x11c82607b),ef=a(0x9b971e7e),eg=a(0x1e4ae349d);let eh=(0,eb.Ay)("gets the canonical emoji name",(e,t,{emojiName:a})=>{let n=t(),r=(0,ef.ZT)(n);return(0,eg.I9)(n,{text:a,teamId:r})});eh.meta={name:"getCanonicalEmojiNameThunk",key:"createThunkGetCanonicalEmojiNameThunk",description:"gets the canonical emoji name"};var e_=a(0x10b4dd7c2),ey=a.n(e_);let ex=new p.Ay("workflow_builder"),AddReaction=({onAdd:e,reactions:t,maxEmojis:a})=>{let r=(0,$.wA)(),{viewOnly:l}=(0,x.e)(),i=(0,n.useCallback)((t,a)=>{let n=r(eh({emojiName:a}));n&&e(n)},[e,r]);return n.createElement(A.A,{onEmojiSelected:i,showHandyReactions:!0},n.createElement(w.Ay,{disabled:l||t.length>=a,type:"outline",size:"small","data-qa":"add-reaction__button",className:ey().addReaction__button},n.createElement(ep.Ah,{inline:!0,name:"add-reaction",size:"18"}),n.createElement("span",null,ex.t("Add Emoji"))))};AddReaction.displayName="AddReaction";var ev=a(0x344bb842),eE=a(0xe9c32bb),ek=a(0x1ccef1c6f),eS=a(0x1266f1359),ew=a(0x1c9a3f62b),eC=a(0x3bb53a1e),eA=a.n(eC);let eT=new p.Ay("workflow_builder"),ReactionItem=({reaction:e,disabled:t,onRemove:a})=>{let r=(0,eo.d4)(ef.ZT),l=(0,eS.$D)(r),i=(0,ek.ty)(l,"preferred_skin_tone"),s=(0,eg.Fm)(l,{text:e,teamId:r??""}),o=(0,n.useMemo)(()=>(0,ew.QV)(e),[e]),c=(0,n.useMemo)(()=>s||e.includes("skin-tone"),[s,e]),d=(0,n.useMemo)(()=>c?`:${o}: (${eT.t("All skin tones")})`:`:${e}:`,[c,e,o]),u=(0,n.useMemo)(()=>i?.length&&"1"!==i?n.createElement(C.Ay,{text:`${o}::skin-tone-${i}`,emojiSize:"medium"}):n.createElement(C.Ay,{text:o,emojiSize:"medium"}),[i,o]),m=(0,n.useCallback)(()=>{a(e)},[a,e]),p=(0,n.useMemo)(()=>({name:"trash"}),[]);return n.createElement("li",null,n.createElement("div",{className:eA().reaction_info},n.createElement("div",null,u),n.createElement(eE.nB,null,d)),n.createElement(ev.A,{className:eA().delete_button,disabled:t,onClick:m,svgIconProps:p,size:"small","aria-label":eT.t("Delete {emojiName} emoji",{emojiName:e,fallbackHash:"f6fdbe48dc54dd86f63097a03bd24094dedd713a"})}))};ReactionItem.displayName="ReactionItem";let ReactionsList=({reactions:e,onDelete:t})=>{let{viewOnly:a}=(0,x.e)(),r=(0,n.useCallback)(e=>{t(e)},[t]);return n.createElement(n.Fragment,null,e.length>0&&n.createElement("ul",{className:eA().container},e.map(e=>n.createElement(ReactionItem,{key:e,reaction:e,disabled:a,onRemove:r}))))};ReactionsList.displayName="ReactionsList";let InputReaction=({value:e,parameter:t,onChange:a,maxEmojis:r=10})=>{let l=(0,n.useMemo)(()=>e?new Set(e.map(e=>(0,ew.QV)(e))):new Set,[e]),i=(0,n.useCallback)(n=>{l.has((0,ew.QV)(n))||a(t,[...e,n])},[l,a,t,e]),s=(0,n.useCallback)(n=>{a(t,e.filter(e=>e!==n))},[a,t,e]),o=(0,m.A)();return n.createElement(_.z,{elementId:o,parameter:t},n.createElement(ReactionsList,{reactions:e,onDelete:s}),n.createElement(AddReaction,{reactions:e,onAdd:i,maxEmojis:r}))};InputReaction.displayName="InputReaction";var eI=a(0x32784134),eN=a(0x1b1820b2c),eM=a(0xec70cbf1),eF=a.n(eM);let SlackFunctionTimestampInput=({value:e,parameter:t,onChange:a,required:r,variables:l,formatVariableBeforeInsert:i,allowVariables:s,hideLabel:c,isParameterSyncedWithForm:d})=>{let u=(0,m.A)(),{viewOnly:p,onVariableMenuOpen:b}=(0,x.e)(),v=p||d,E=(0,n.useCallback)(e=>{let n=i(e,{parameterType:t.type}).id;return a(t,n)},[i,a,t]),k=(0,n.useMemo)(()=>(0,o.r2)(l.list,e),[e,l.list]),S=(0,n.useCallback)(e=>{a(t,e)},[a,t]),w=(0,n.useCallback)(e=>(0,y.p0)(e)||(0,y.xY)({variable:e,parameter:t}),[t]),C=t.title??t.description??t.name;return n.createElement(_.z,{elementId:u,parameter:t,hideLabel:c,isParameterSyncedWithForm:d},k?n.createElement(h.P,{onChange:S,value:e,variables:l,customDataFilter:w,label:C,isDisabled:v,formatVariableBeforeInsert:i,parameterType:t.type}):n.createElement(n.Fragment,null,n.createElement("div",{className:eF().timestampWrapper},n.createElement(eN.A,{id:u,className:eF().timestampInlineDateTimePicker,onChange:S,valueFormat:"X",value:e,"aria-label":C,isRequired:r,showTimeZone:!1,disabled:v}),s&&!d&&n.createElement(g.jx,{onSelect:E,data:l.groups,customDataFilter:w,renderIconInline:!0,isDisabled:v,onMenuTriggerClick:b})),t.hint&&n.createElement(f.A,{className:"margin_bottom_0"},t.hint)))};SlackFunctionTimestampInput.displayName="SlackFunctionTimestampInput";var eO=a(0x1f0569040);let UserContextInput=({onChange:e,parameter:t,value:a})=>((0,n.useEffect)(()=>{a||e(t,"init")},[e,t,a]),null);var eL=a(0x204ee6449),eD=a(0x1a740dbac),eP=a(0x136ad1993),eR=a(0x1d922a37e),eB=a(0x1c09d8c36);let eW=[eB.Eq,eB.V0,eB.a5];var eV=a(0x218fd5440),eq=a(0xa21d3b1e),eH=a(0x17c7b6bbb),eU=a(0x1846f5916),ez=a(0xf5bbd10a);let InputRenderingEngine=({functionId:e,variables:t,configuredParameters:a={},onChange:m,formatVariableBeforeInsert:p,callbackId:b,applySpecialTreatment:f,showInline:g=!1,renderOAuth2InputParameter:h,stepId:_,isExistingStep:v,stepErrorCode:E,workflowId:k,workflowExternalWorkspaceId:w,serviceTriggerType:C,triggerId:A,isTriggerSegment:I,functionVariables:N,isOAuthTokenInvalid:M,isFunctionFormWrapped:F,onlyRenderParentInputs:O,onlyRenderChildInputs:L,shouldAlwaysDisplayVariableSelector:P,parameter:R,keyValueParameters:B,oAuthParameter:W,inputParameters:V,hideLabel:q,onLoadingStateChange:H,hasOnlyKeyValueParameter:U,allowVariables:z=!0,invalidKeyword:j,shouldAutoFocus:$,enableEmojiAutocomplete:G,enableRichTextDropdowns:K=!1,enableStringFallback:Y=!1})=>{let{formStepPrecedesCurrentStep:Q,previousStepId:Z}=(0,x.e)(),J=(0,ez.A)(),X=(0,eo.d4)(e=>"on"===(0,ec._Z)(e,"user_authored_workflow_posts_fe")),ee=a[R.name]?.value,et=a[R.name]?.label,ea=R.name.split(".").pop(),er=!!a?.send_as_user?.value,el=(0,n.useMemo)(()=>{if(!t)return;if(!(Q&&er&&b&&"send_message"===b))return t;let{list:e,groups:a}=t,n=[Z,_].filter(e=>void 0!==e);return{list:e.map(e=>n.includes(e.source_id)||"trigger"===e.source?e:{...e,isAvailable:!1,isHidden:!0}),groups:a.filter(e=>n.includes(e.id)||(0,eH.Af)(e.type))}},[t,b,Q,Z,er,_]),{type:ei}=R,es=!!R.is_required,ed=f?.(R,ee,a),eu=z&&!I&&(0,eP.z)({callbackId:b,parameter:R}),em=t;X&&em&&(em=el),em&&(em=(0,eq.z)({parameterName:R.name,functionVariables:N,variables:em,isFunctionFormWrapped:F,stepId:_}));let formatVariableBeforeInsert=(e,t)=>{let a=(0,eR.F)({variable:e,parameterName:R.name,functionVariables:N});return p?p(a,t):a},ep=(0,n.useMemo)(()=>(0,l.uU)(em??eU.Gs,e=>(0,y.VH)(e)),[em]),eb=L&&R.isParameterFormWrapped,ef=M&&!(0,eV.t)(R);if(R.is_hidden||(0,D.M$)(R,a)||ef)return null;if(ed)return n.createElement(n.Fragment,null,ed);if((0,o.qt)(R)&&e&&k){let t="childInputs"in R&&Array.isArray(R.childInputs)&&B.length>0&&R.childInputs.some(t=>B.some(a=>a.name===t&&(a.is_required||eW.includes(e))));return n.createElement(i.r,{variables:em,parameter:R,value:ee,label:et,values:a,onChange:m,formatVariableBeforeInsert:formatVariableBeforeInsert,callbackId:b,functionId:e,workflowId:k,oAuthParameter:W,stepId:_,stepErrorCode:E,isExistingStep:v,serviceTriggerType:C,triggerId:A,isTriggerSegment:I,allowVariables:eu,hasDependentField:t,functionVariables:N,isFunctionFormWrapped:F,onlyRenderParentInputs:O,onlyRenderChildInputs:L,isParameterSyncedWithForm:eb,hideLabel:q,onLoadingStateChange:H,hasOnlyKeyValueParameter:U})}if(eb)return n.createElement(s.C,{value:ee,parameter:R,variables:em});switch(ei){case en.HN.SlackTypesMessageContext:case en.HN.SlackTypesUserId:case en.HN.SlackTypesChannelId:case en.HN.SlackTypesUsergroupId:case en.HN.SlackTypesListId:case en.HN.SlackTypesCanvasId:case en.HN.SlackTypesChannelCanvasId:case en.HN.SlackTypesCanvasTemplateId:case en.HN.SlackTypesTeamId:return n.createElement(T.O,{variables:em||eU.Gs,allowVariables:eu,parameter:R,value:ee||"",onChange:m,callbackId:b,externalWorkspaceId:w,hideLabel:q,isFunctionFormWrapped:F});case en.HN.Integer:case en.HN.Number:if(Array.isArray(R.enum)||Array.isArray(R.choices))return n.createElement(SlackFunctionEnumInput,{variables:em||eU.Gs,parameter:R,value:"string"==typeof ee||"number"==typeof ee?ee:"",onChange:m,formatVariableBeforeInsert:formatVariableBeforeInsert,allowVariables:eu,hideLabel:q,isParameterSyncedWithForm:eb});return n.createElement(SlackFunctionNumberInput,{variables:em||eU.Gs,parameter:R,value:"string"==typeof ee||"number"==typeof ee?ee:"",onChange:m,formatVariableBeforeInsert:formatVariableBeforeInsert,allowVariables:eu,hideLabel:q,isParameterSyncedWithForm:eb});case en.HN.Boolean:if("send_as_user"===ea)return n.createElement(SlackFunctionRadioInput,{parameter:R,value:ee??void 0,onChange:m});return n.createElement(u.B,{parameter:R,value:ee||"",onChange:m,variables:em||eU.Gs,formatVariableBeforeInsert:formatVariableBeforeInsert,allowVariables:eu,hideLabel:q,isParameterSyncedWithForm:eb});case en.HN.String:if("emoji"===ea)return n.createElement(SlackFunctionEmojiInput,{parameter:R,value:ee||"",onChange:m,hideLabel:q});if(Array.isArray(R.enum)||Array.isArray(R.choices))return n.createElement(SlackFunctionEnumInput,{variables:em||eU.Gs,parameter:R,value:ee||"",onChange:m,formatVariableBeforeInsert:formatVariableBeforeInsert,allowVariables:eu,hideLabel:q,isParameterSyncedWithForm:eb});return n.createElement(eI.C,{variables:em||eU.Gs,parameter:R,value:ee||"",required:es,onChange:m,formatVariableBeforeInsert:formatVariableBeforeInsert,callbackId:b,showInline:g,allowVariables:eu,hideLabel:q,isParameterSyncedWithForm:eb});case en.HN.SlackUserPermission:return null;case en.HN.Array:return n.createElement(c.m,{parameter:R,value:"string"==typeof ee||Array.isArray(ee)?ee:void 0,onChange:m,variables:em??eU.Gs,formatVariableBeforeInsert:formatVariableBeforeInsert,externalWorkspaceId:w,callbackId:b,functionId:e,allowVariables:eu,hideLabel:q,isParameterSyncedWithForm:eb,shouldAlwaysDisplayVariableSelector:P,invalidKeyword:j,shouldAutoFocus:$,enableEmojiAutocomplete:G});case en.HN.SlackTypesTimestamp:return n.createElement(SlackFunctionTimestampInput,{parameter:R,value:ee||"",required:es,onChange:m,variables:em||eU.Gs,formatVariableBeforeInsert:formatVariableBeforeInsert,allowVariables:eu,hideLabel:q,isParameterSyncedWithForm:eb});case en.HN.SlackTypesRichText:case en.HN.SlackTypesExpandedRichText:case en.HN.SlackTypesBlocks:if(ei===en.HN.SlackTypesRichText&&R.contains_ai_generated_content)return n.createElement(eL.F,{value:ee||"",parameter:R,onChange:m,variables:ep,formatVariableBeforeInsert:formatVariableBeforeInsert,hideLabel:q});return n.createElement(d.h,{callbackId:b,variables:em||eU.Gs,parameter:R,value:ee||r.Ml,required:es,onChange:m,formatVariableBeforeInsert:formatVariableBeforeInsert,parameters:V,configuredParameters:a,allowVariables:eu,hideLabel:q,sendAsUserValue:er,experimentUserAuthoredWorkflowPostsFeGroupOn:X});case en.HN.SlackTypesLimitedRichText:if(K&&(Array.isArray(R.enum)||Array.isArray(R.choices)))return n.createElement(SlackFunctionEnumInput,{variables:em||eU.Gs,parameter:R,value:ee||"",onChange:m,formatVariableBeforeInsert:formatVariableBeforeInsert,allowVariables:eu,hideLabel:q,isParameterSyncedWithForm:eb});return n.createElement(SlackFunctionLimitedBlocksInput,{callbackId:b,variables:em||eU.Gs,parameter:R,value:ee||r.Ml,required:es,onChange:m,formatVariableBeforeInsert:formatVariableBeforeInsert,parameters:V,configuredParameters:a,allowVariables:eu,hideLabel:q,sendAsUserValue:er,experimentUserAuthoredWorkflowPostsFeGroupOn:X});case en.HN.SlackTypesSalesforceRecordId:return n.createElement(eL.F,{value:ee||"",parameter:R,onChange:m,variables:em??eU.Gs,formatVariableBeforeInsert:formatVariableBeforeInsert,hideLabel:q});case en.HN.SlackTypesDate:return n.createElement(SlackFunctionDateInput,{parameter:R,value:ee||"",required:es,onChange:m,variables:em||eU.Gs,formatVariableBeforeInsert:formatVariableBeforeInsert,allowVariables:eu,hideLabel:q});case en.HN.DateTime:return n.createElement(S.e,{parameter:R,value:ee||"",required:es,onChange:m,isParameterSyncedWithForm:eb});case en.HN.Reaction:return n.createElement(InputReaction,{onChange:m,parameter:R,value:ee??r.Ml});case en.HN.SlackTypesCredentialOauth2:if(h)return n.createElement(n.Fragment,null,h(R,ee??void 0));return J.error("Unable to render OAuth2InputParameter"),null;case en.HN.Timezone:return n.createElement(eO.I,{parameter:R,required:es,value:ee||"",onChange:m,isParameterSyncedWithForm:eb});case en.HN.SlackTypesUserContext:return n.createElement(UserContextInput,{parameter:R,onChange:m,value:ee});case en.HN.SlackTypesInteractivity:return n.createElement(InteractivityInput,{parameter:R,onChange:m,value:ee});default:if(Y)return n.createElement(eI.C,{variables:em||eU.Gs,parameter:R,value:ee||"",required:es,onChange:m,formatVariableBeforeInsert:formatVariableBeforeInsert,callbackId:b,showInline:g,allowVariables:eu,hideLabel:q,isParameterSyncedWithForm:eb});return n.createElement(eD.b,{parameter:R,functionId:e})}};InputRenderingEngine.displayName="InputRenderingEngine"},0x1efcf3032:(e,t,a)=>{"use strict";a.d(t,{L:()=>SharedClientWorkflowBuilderRenderingEngine});var n=a(0xbad225b5),r=a(0x242822dfb),l=a(0x1c4a1a163),i=a(0x1d3dd4cbe),s=a(0x145d46a61),o=a(0x1795d8821),c=a(0x226892387);let sortInputParametersOAuthToFront=e=>e.type===o.HN.SlackTypesCredentialOauth2?-1:0,SharedClientWorkflowBuilderRenderingEngine=({functionId:e,inputParameters:t,oAuthParameter:a,variables:o,configuredParameters:d,onChange:u,formatVariableBeforeInsert:m,callbackId:p,applySpecialTreatment:b,showInline:f=!1,renderOAuth2InputParameter:g,stepId:h,isExistingStep:_,stepErrorCode:y,workflowRendererContexts:x,workflowId:v,workflowExternalWorkspaceId:E,serviceTriggerType:k,triggerId:S,isTriggerSegment:w,functionVariables:C,isOAuthTokenInvalid:A,isFunctionFormWrapped:T,onlyRenderParentInputs:I,onlyRenderChildInputs:N,shouldAlwaysDisplayVariableSelector:M,onLoadingStateChange:F,hideLabel:O,invalidKeyword:L,shouldAutoFocus:D,enableEmojiAutocomplete:P,allowVariables:R})=>{let B=(0,c.d4)(s.$T),W=(0,n.useMemo)(()=>t.sort(sortInputParametersOAuthToFront),[t]),V=(0,n.useMemo)(()=>(0,r.xn)(W),[W]),q=(0,n.useMemo)(()=>!!B&&!!t.length&&N&&t.every(e=>(0,r.qt)(e)&&(0,r.sg)(e)),[B,t,N]);return t.length?n.createElement(i.B.Provider,{value:x},W.map((t,r)=>{let i=h?`${t.name}-${h}`:t.name;return n.createElement(l.v,{key:i,functionId:e,variables:o,configuredParameters:d,onChange:u,formatVariableBeforeInsert:m,callbackId:p,applySpecialTreatment:b,showInline:f,renderOAuth2InputParameter:g,stepId:h,isExistingStep:_,stepErrorCode:y,workflowId:v,workflowExternalWorkspaceId:E,serviceTriggerType:k,triggerId:S,isTriggerSegment:w,functionVariables:C,isOAuthTokenInvalid:A,isFunctionFormWrapped:T,onlyRenderParentInputs:I,parameter:t,inputParameters:W,keyValueParameters:V,oAuthParameter:a,onlyRenderChildInputs:N,shouldAlwaysDisplayVariableSelector:M,onLoadingStateChange:F,hasOnlyKeyValueParameter:q,hideLabel:O,invalidKeyword:L,shouldAutoFocus:D&&0===r,enableEmojiAutocomplete:P,allowVariables:R})})):null};SharedClientWorkflowBuilderRenderingEngine.displayName="SharedClientWorkflowBuilderRenderingEngine"},0x136ad1993:(e,t,a)=>{"use strict";a.d(t,{z:()=>allowVariablesForParameter});var n=a(0x1340d624e),r=a(0x1795d8821);let l={[r.oW.SendToSalesHome]:[n.XD.NOTIFY_MANAGERS,n.XD.ROLES_TYPE,n.XD.ROLES,n.XD.ROLE_CONTAINS,n.XD.ROLE_DOES_NOT_CONTAIN],[r.oW.SendSummaryToMySalesHome]:[n.bI.MESSAGE],[r.oW.SendSummaryToSalesHome]:[n.bI.MESSAGE],[r.oW.AddAgentToChannel]:[n.zc.AGENT_IDS],[r.oW.SummarizeChannel]:[n.XZ.DAYS],[r.oW.UpdateCanvasContent]:[n.kJ.SECTION_ID],[r.oW.UpdateCanvasContentV2]:[n.ED.SECTION_ID],[r.oW.UpdateCanvasVariables]:[n.x4.PLACEHOLDER_VALUES]},i={[r.oW.UpdateCanvasContent]:[n.kJ.SECTION_ID,n.ED.CHANNEL_ID,n.ED.CANVAS_TAB_SECTION_ID,n.ED.CANVAS_TAB],[r.oW.UpdateCanvasContentV2]:[n.ED.SECTION_ID,n.ED.CHANNEL_ID,n.ED.CANVAS_TAB_SECTION_ID,n.ED.CANVAS_TAB]},allowVariablesForParameter=({parameter:e,callbackId:t})=>!(t&&t in i&&i[t].includes(e.name))&&(!t||!(t in l)||!l[t].includes(e.name))},0x1d922a37e:(e,t,a)=>{"use strict";a.d(t,{F:()=>applyCurrentValueVariableLabel,y:()=>formatCurrentValueVariableLabel});var n=a(0x20482ad21),r=a(0x1862f5064);let l=new n.Ay("workflow_builder"),formatCurrentValueVariableLabel=e=>l.t("Current value: {variableLabel}",{variableLabel:e,fallbackHash:"ed2757f1ed21915706134a6d00c283c0961a392e"}),applyCurrentValueVariableLabel=({variable:e,parameterName:t,isKeyValueParameter:a,dynamicOptionKey:n,functionVariables:l})=>{let i=(0,r.Q)({parameterName:t,isKeyValueParameter:a,dynamicOptionKey:n,functionVariables:l});return i?.mapping.template===e.id?{...e,label:formatCurrentValueVariableLabel(e.label)}:e}},0x118f04a01:(e,t,a)=>{"use strict";a.d(t,{Ps:()=>hasAnyPrivateChannelAccessError,Se:()=>computeChannelPermissionErrorIndexes});var n=a(0x12185e091),r=a(0xf159cb74),l=a(0x73d7ee71),i=a(0x1795d8821);let hasPrivateChannelAccessError=(e,t,a)=>{if(!e||!(0,n.Zp)(e))return!1;if(!1===t)return!0;if(a&&a.length>0){let t=(0,l.S)(e);if(t.length>0)return!t.some(e=>a.includes(e));let n=(0,r.c)(e);return!n||!a.includes(n)}return!1},hasAnyPrivateChannelAccessError=(e,t,a)=>e.some(e=>hasPrivateChannelAccessError(e,t,a)),computeChannelPermissionErrorIndexes=(e,t)=>{if(!t||!t.experimentMessagePostedTriggerInPrivateChannelsGroupOn)return[];let{callbackId:a,arrayItemType:n,allChannels:r,privateChannelAccess:l,privateChannelTeamIds:s}=t;if(a!==i.Uk.MessagePosted||n!==i.TE.SlackTypesChannelId||!Array.isArray(e)||!0===l&&(!s||0===s.length))return[];let o=[];return e.forEach((e,t)=>{"string"==typeof e&&hasPrivateChannelAccessError(r[e],l,s)&&o.push(t)}),o}},0xcb24a23b:(e,t,a)=>{"use strict";a.d(t,{g:()=>deriveMultiSelectInputErrors});var n=a(0x21f3c49e8),r=a(0x20482ad21),l=a(0xf33a4f91),i=a(0x1ba35eb3b),s=a(0x668181b3),o=a(0x2772625d),c=a(0xbd3de346),d=a(0x1795d8821),u=a(0xa985ed31);let m=new r.Ay("workflow_builder"),deriveMultiSelectInputErrors=({variables:e,id:t,value:a,isValidEmptyObject:r,isRequired:p,parameter:b,arrayItemType:f,allFiles:g})=>{let h=[],{isParameterFormWrappable:_}=b,y="items"in b&&"string"===b.items.type?b.items.minLength:void 0,x="items"in b&&"string"===b.items.type?b.items.maxLength:void 0;if(!r&&p&&!_&&(0,n.A)(a)&&h.push({id:`${t}_is_required`,message:m.t("This field is required.")}),"string"==typeof a){if((0,o.cn)(a)){let n=(0,s.x)(e.list,a);if(!n||n.isTombstone)return h.push({id:`${t}_is_missing_variables`,message:m.t("This value contains missing variables.")}),[h,[0]];n.isAvailable||h.push({id:`${t}_is_unavailable_variables`,message:m.t("This value contains unavailable variables.")}),b&&"items"in b&&!(0,i.yH)(n,b)&&h.push({id:`${t}_is_invalid_variables`,message:m.t("This variable is not supported as an item in this field")})}return h.length>0?[h,[0]]:[h,[]]}if(!a)return[h,[]];let v=!1,E=!1,k=!1,S=!1,w=a&&a.length>1,C=a&&"string"!=typeof a&&a.some(t=>(0,l.x1)(e,String(t))),A="can_flatten"in b&&b.can_flatten;w&&C&&!A&&h.push({id:`${t}_is_mixed_with_array_variables`,message:m.t("Variables containing multiple items must be alone",{fallbackHash:"02605f6dabeee59a9b76627b21f072b71011da74"})});let T=f===d.TE.SlackTypesCanvasId||f===d.TE.SlackTypesListId,I=[];for(let t=0;t<a.length;t++){let n=String(a[t]);if((0,o.cn)(n)){let a=(0,s.x)(e.list,n);a?(v=!!(b&&"items"in b&&!(0,i.yH)(a,b)),E=!a.isAvailable):k=!0,(!a||v||E)&&I.push(t)}else if(T&&(0,u.A)(n)&&g){let e=g?.[n];(!e||e.isNonExistent||(0,c.uO)(e))&&(S=!0,I.push(t))}}if(v&&h.push({id:`${t}_is_invalid_variables`,message:m.t("This variable is not supported as an item in this field")}),E&&h.push({id:`${t}_is_unavailable_variables`,message:m.t("This value contains unavailable variables.")}),k&&h.push({id:`${t}_is_missing_variables`,message:m.t("This value contains missing variables.")}),S&&h.push({id:`${t}_is_deleted_file`,message:m.t("This value contains deleted items.",{fallbackHash:"b573f994259c0f2c0906cdd9c83ec7c7f64dd929"})}),b&&"minItems"in b&&b.minItems&&a.length<b.minItems&&!(0,n.A)(a)&&h.push({id:`${t}_is_less_than_min`,message:m.t("You must provide at least {numItems, plural, =1 {# item} other {# items}}",{numItems:b.minItems})}),b&&"maxItems"in b&&b.maxItems&&a.length>b.maxItems&&h.push({id:`${t}_is_greater_than_max`,message:m.t("You must provide at most {numItems, plural, =1 {# item} other {# items}}",{numItems:b.maxItems})}),a.some(e=>y&&"string"==typeof e&&e.length<y&&!(0,n.A)(a))&&h.push({id:`${t}_is_items_less_than_min_char_length`,message:m.t("Entries must include at least {numItems, plural, =1 {# character} other {# characters}}",{numItems:y})}),a.some(e=>x&&"string"==typeof e&&e.length>x&&!(0,n.A)(a))&&h.push({id:`${t}_is_items_less_than_max_char_length`,message:m.t("Entries must not exceed {numItems, plural, =1 {# character} other {# characters}}",{numItems:x})}),b&&"items"in b&&"string"===b.items.type&&"format"in b.items&&"string"!=typeof a&&Array.isArray(a)){let{format:e}=b.items;if(a.some(t=>{if("string"==typeof t&&!(0,o.cn)(t)){if("email"===e)return!(0,l.V2)(t);if("url"===e)return!(0,l.U6)(t)}return!1})){let e="email"===b.items.format?m.t("This is not a valid email address."):m.t("This is not a valid URL.");h.push({id:`${t}_is_invalid_format`,message:e})}}return[h,I]}},0x152e7cb26:(e,t,a)=>{"use strict";a.d(t,{Y:()=>getEmptyStateMessage});var n=a(0x20482ad21),r=a(0x1806ce928);let l=new n.Ay("workflow_builder"),getEmptyStateMessage=({value:e,typeahead:t,minQueryLength:a,errorCode:n})=>{if(t){if(!e)return l.t("Type to search\u2026");if(a&&e.length<a)return l.t("Keep typing\u2026");if(e&&n===r.n.TooManyOptions)return l.t("Too many results. Please add more keywords.")}return l.t("No items")}},0xa21d3b1e:(e,t,a)=>{"use strict";a.d(t,{z:()=>updateFunctionVariables});var n=a(0x18af67efb),r=a(0x20482ad21),l=a(0x1d922a37e),i=a(0x1862f5064);let s=new r.Ay("workflow_builder"),updateFunctionVariables=({parameterName:e,isKeyValueParameter:t,dynamicOptionKey:a,variables:r,functionVariables:o,isFunctionFormWrapped:c,stepId:d})=>{if(!d||!o)return r;let u=r.groups.find(e=>e.id===d&&e.data.some(({source:e})=>"variables"===e)),m=r.groups.filter(({id:e})=>e!==u?.id),p=(0,i.Q)({parameterName:e,isKeyValueParameter:t,dynamicOptionKey:a,functionVariables:o}),b=[...r.list];if(o.variables?.list&&b.unshift(...o.variables.list),p){let e={...p.variable,label:(0,l.y)(p.variable.label)};if(c){let t=u?{...u,data:[p.variable]}:{id:d,type:p.variable.source_type,data:[p.variable],label:s.t("Current value",{fallbackHash:"8dce170de238b1feda2ecd9674ea3ca0d068fbcb"})};return b.unshift(e),{list:(0,n.A)(b,"id"),groups:[t,...m]}}b.unshift({...e,isAvailable:!1})}return{list:(0,n.A)(b,"id"),groups:m}}},0x4b32db5f:(e,t,a)=>{"use strict";a.d(t,{T:()=>variableGroupsAsOptions});var n=a(0x1795d8821);let transformDataToOption=e=>({value:e.id,label:e.label,data:e}),variableGroupsAsOptions=e=>{let optionsReducer=(e,t)=>{if(t.type===n.TE.Object&&t.objectProperties){let a=t.objectProperties.reduce((e,t)=>(e.push(transformDataToOption(t)),e),[]);return e.push(...a),e}return e.push(transformDataToOption(t)),e};return e.reduce((e,t)=>{let a=t.data.reduce(optionsReducer,[]);if(0===a.length)return e;let n=t.label;return t.stepIndex&&(n=`${t.stepIndex}. ${n}`),e.push({label:n,options:a}),e},[])}},0x409e023f:(e,t,a)=>{"use strict";a.d(t,{u:()=>n.u});var n=a(0x1f7facc5c)},0x1f7facc5c:(e,t,a)=>{"use strict";a.d(t,{u:()=>RequestAppModal});var n=a(0xbad225b5),r=a(0x16cf1da63),l=a(0x1cbdfeceb),i=a(0x20482ad21),s=a(0x2b7f0bcc),o=a(0x11a296110),c=a(0x1d2cd7755),d=a(0x126f22530),u=a(0x6e87d4ec),m=a(0xb1ea448c),p=a(0x120c268ad),b=a.n(p),f=a(0x1e4ad58a2),g=a(0x1ee57b3a0),h=a(0xe9c32bb),_=a(0xac500276),y=a.n(_);let StepItemBase=({title:e,description:t,icon:a,className:r})=>n.createElement(f.A,{className:b()(y().step,r)},n.createElement(g.A,{className:y().stepContainer},n.createElement("div",{className:y().stepInfo},n.createElement("div",{className:y().stepIcon},a),n.createElement("div",{className:y().stepText},n.createElement(h.nB,{element:"h2"},e),t))));StepItemBase.displayName="StepItemBase";var x=a(0x1d9a37519),v=a(0x22146d01c),E=a.n(v);function renderDescription(e){return n.createElement(h.Zn,{element:"p",className:"margin_bottom_0",color:"foreground_max_solid"},e)}function RequestAppModalSubsectionList({appId:e,isLoading:t,listItems:a,expandListPane:r,error:l=!1}){if(!r||l)return null;if(t)return n.createElement(m.A,{size:"large",className:E().stepListLoader});if(a&&a.length>0){let t=n.createElement(x.z,{"data-qa":"app-icon",appId:e,alt:"",size:24,imageClassName:E().stepIcon});return n.createElement("ul",{className:E().stepList},a.map(e=>n.createElement("li",{key:e.id,className:"margin_bottom_50"},n.createElement(StepItemBase,{icon:t,title:e.title,description:renderDescription(e.description)}))))}return null}renderDescription.displayName="renderDescription",RequestAppModalSubsectionList.displayName="RequestAppModalSubsectionList";var k=a(0xa6f3163b),S=a(0x410829f8),w=a(0x2501a2cee);function RequestAppModalSubsectionTitle({expand:e,onExpand:t,count:a,showIconButtonAndBadge:r,label:l}){return 0===a?null:n.createElement("div",{className:E().stepListTitle},r&&n.createElement(k.A,{onClick:t,"data-qa":l},n.createElement(w.Ah,{name:e?"caret-down-filled":"caret-right-filled"})),n.createElement("div",{className:E().stepListTitleHeaderAndBadge},n.createElement(h.nB,{weight:"bold",element:"h2"},l),r&&n.createElement(S.Ay,{style:S.rY.minGray,count:a,maxCount:99})))}RequestAppModalSubsectionTitle.displayName="RequestAppModalSubsectionTitle";var C=a(0x6258badf),A=a(0xe747dd27),T=a(0x22a29f141),I=a(0x1ec68d6a3);let N=(0,a(0x1dfdeb1c8).A)("apps.approvals.requests.create fetcher",async(e,t,a)=>{try{let t=(0,C.A)(a,["reason"]),n=(0,A.VA)(t);return await e((0,T.apiCall)({method:"apps.approvals.requests.create",args:{...n,reason:a.note},reason:a.reason}))}catch(e){throw(0,I.default)({getState:t}).error(`API call to apps.approvals.requests.create
				with reason ${a.reason} failed, initiated by fetcher`),e}});N.meta={name:"appsApprovalsRequestsCreateFetcher",key:"createFetcherAppsApprovalsRequestsCreateFetcher",description:"apps.approvals.requests.create fetcher"};var M=a(0xd193e9b8),F=a(0xe374a1b1),O=a(0xcefdd6a2),L=a(0x243c0f3a9),D=a(0x19b809e18),P=a(0x207fb9b92),R=a(0x1c2358c11),B=a(0xf5bbd10a),W=a(0xbe2be077),V=a(0x20e80190e),q=a(0x9b971e7e),H=a(0x226892387),U=a(0x110d7b067),z=a(0x19561ce96),j=a(0x1fcbb004d),$=a(0x16ffed5ab);let G=new i.Ay("workflow_builder"),isStepFunction=e=>!!e,renderSlackAppIcon=(e,t)=>n.createElement(n.Fragment,null,t&&t(),n.createElement(x.z,{"data-qa":"app-icon",appId:e,alt:""})),RequestAppModal=({appId:e,appName:t,onCloseModal:a,backButtonRenderer:i,inline:m=!1})=>{let p=(0,B.A)({label:"step-library/request-app-modal"}),b=(0,H.d4)(q.JY),f=(0,H.d4)(W.k),g=a||l.A,_=(0,r.wA)(),y=!!i,x=(0,H.d4)(a=>t??(0,z.dJ)(a,e)?.app?.profile?.name)??"connector",v=(0,H.d4)(z.g0),[E,k]=(0,n.useState)(!1),[S,w]=(0,n.useState)(!1),[C,A]=(0,n.useState)(!1),[T,I]=(0,n.useState)(!1),[K,Y]=(0,n.useState)(!0),[Q,Z]=(0,n.useState)(!0),[J,X]=(0,n.useState)(""),{data:ee,loading:et,error:ea}=(0,R.L)({fetcher:D._,args:{reason:"step-library/request-app-modal",appId:e}}),en=ee?.functions??[],{triggerTypesWithAvailability:er,isLoading:el,isError:ei}=(0,M.c)({appId:e}),es=er.map(e=>{let t=e.isAvailable?e.triggerType.serviceConfig?.function:void 0;return t?{...t,title:e.triggerType.label,id:e.triggerType.id}:t}).filter(isStepFunction),{onBlur:eo,errorText:ec}=(0,P.K)({errorMessage:G.t("Please enter a reason"),isErrored:0===J.length}),ed=(0,n.useCallback)(e=>{X(e)},[]),eu=(0,n.useCallback)(()=>{m||_((0,j.O)()),g()},[_,g,m]),em=(0,n.useCallback)(()=>Y(!K),[K]),ep=(0,n.useCallback)(()=>Z(!Q),[Q]),eb=(0,n.useCallback)(e=>{_((0,$.M)({element:n.createElement(u.A,null,e)}))},[_]),ef=(0,n.useCallback)(async()=>{try{if(A(!0),I(!1),(await _((0,L.d)({appId:e,teamId:f?void 0:b,enterpriseId:f?b:void 0,reason:"step-library/request-app-modal"}))).ok)_((0,U.zE)({appId:e,resolution:"denied"})),eb(G.t("{appName} was successfully denied",{appName:x})),A(!1),eu();else throw Error()}catch{p.error(Error(`failed to deny request for app: ${e}`),{appId:e}),I(!0)}},[_,e,f,b,eb,x,eu,p]),eg=(0,n.useCallback)(async()=>{try{if(w(!0),I(!1),(await _((0,O.i)({appId:e,teamId:f?void 0:b,enterpriseId:f?b:void 0,reason:"step-library/request-app-modal"}))).ok)_((0,U.zE)({appId:e,resolution:"approved"})),eb(G.t("{appName} was successfully approved",{appName:x})),w(!1),eu();else throw Error()}catch{p.error(Error(`failed to approve request for app: ${e}`),{appId:e}),I(!0)}},[x,_,e,f,b,eb,eu,p]),eh=(0,n.useCallback)(async()=>{try{if(k(!0),I(!1),(await _(N({app:e,note:J,reason:"step-library/request-app-modal"}))).ok)_((0,U.p4)({appId:e})),eb(G.t("Request submitted successfully")),k(!1),eu();else throw Error()}catch{p.error(Error(`failed to submit request for app: ${e}`),{appId:e}),I(!0)}},[_,e,J,eb,eu,p]),e_=G.t("Request {appName} steps",{appName:x}),ey=G.t("You need approval to use {appName} steps. Slackbot will send you a direct message when your request is processed.",{appName:x});es.length>0&&en.length>0&&(e_=G.t("Request {appName} access",{appName:x}),ey=G.t("You need approval to use {appName}. Slackbot will send you a direct message when your request is processed.",{appName:x})),es.length>0&&0===en.length&&(e_=G.t("Request {appName} triggers",{appName:x}),ey=G.t("You need approval to use {appName} triggers. Slackbot will send you a direct message when your request is processed.",{appName:x})),v&&(e_=G.t("Approve or Deny {appName} access",{appName:x}),ey=G.t("You need to approve or deny {appName}. Approving {appName} will allow you and other users on your team to use the {appName}. Denying {appName} will prevent you and other users on your team from using {appName}",{appName:x}));let ex=y?renderSlackAppIcon(e,i):renderSlackAppIcon(e);return n.createElement(F.v,{contentLabel:e,maxWidth:x.length>=24?"fit-content":void 0,onClose:g,shouldCloseOnOverlayClick:!0},n.createElement(V.rQ,null,n.createElement(V.Rc,{title:e_,icon:ex})),n.createElement(V.$m,null,n.createElement(V.qf,null,n.createElement(h.nB,null,ey),v?null:n.createElement(c.A,{text:G.t("Reason for the request"),htmlFor:"request-app-modal-reason"},n.createElement(d.A,{id:"request-app-modal-reason",type:"text",name:"name",value:J,onChange:ed,onBlur:eo,errorText:ec,placeholder:G.t("Add a short business justification"),autoComplete:"off",focusOnMount:!0,"data-qa":"request-app-modal-reason__input",useInlineAlert:!0})),n.createElement(n.Fragment,null,n.createElement(RequestAppModalSubsectionTitle,{expand:K,onExpand:em,count:es.length,showIconButtonAndBadge:en.length>0,label:G.t("Triggers")}),n.createElement(RequestAppModalSubsectionList,{appId:e,isLoading:el,listItems:es,error:ei,expandListPane:K})),n.createElement(RequestAppModalSubsectionTitle,{expand:Q,onExpand:ep,count:en.length,showIconButtonAndBadge:es.length>0,label:G.t("Steps")}),n.createElement(RequestAppModalSubsectionList,{appId:e,isLoading:et,listItems:en,error:!!ea,expandListPane:Q}),T&&n.createElement(s.Ay,{level:"warning",icon:"warning",align:"left",className:"margin_top_100"},G.t("Sorry, something went wrong. Try again in a moment.")))),n.createElement(V.jl,null,n.createElement(V.ox,null,n.createElement(o.Ay,{type:"outline",onClick:eu,"data-qa":"request-app-modal-cancel__button"},G.t("Cancel")),v?n.createElement(n.Fragment,null,n.createElement(o.lV,{type:"danger",loading:C,onClick:ef,"data-qa":"request-app-modal-deny__button","aria-label":G.t("Deny")},G.t("Deny")),n.createElement(o.lV,{loading:S,onClick:eg,"data-qa":"request-app-modal-approve__button","aria-label":G.t("Approve")},G.t("Approve"))):n.createElement(o.lV,{loading:E,onClick:eh,disabled:0===J.length,"data-qa":"request-app-modal-submit__button","aria-label":G.t("Submit")},G.t("Submit")))))};RequestAppModal.displayName="RequestAppModal"},0x10045b129:(e,t,a)=>{"use strict";a.d(t,{Ah:()=>f,O$:()=>hasAAAStatus,Wd:()=>useTemplateAdminApprovedAppsCheck,eN:()=>needsToInstallApps,eW:()=>isPendingAdminRequest,mM:()=>useInstallAppsForTemplate,mh:()=>isDeniedOrPendingAppApproval,st:()=>isPendingAppApproval});var n,r=a(0xbad225b5),l=a(0x16cf1da63),i=a(0xe874a88a),s=a(0x95583610),o=a(0x145d46a61),c=a(0xdf55e8f3),d=a(0x226892387),u=a(0x19561ce96),m=a(0x65561a6f),p=a(0x184767f39);let b=(0,c.eI)((e,{action:t,connectedAppIds:a})=>a.filter(a=>(0,u.Ez)(e,a)===t));var f=((n={}).NEED_ADMIN_REQUEST="Need To Request Access",n.PENDING_ADMIN_APPROVAL="Have Pending Admin Approval",n.NEED_TO_INSTALL_APPS="Install apps for user",n.HAS_DENIED_APPS="Has Denied Apps",n);let hasAAAStatus=e=>!!e,isPendingAdminRequest=e=>!!(e&&"Need To Request Access"===e.status),isPendingAppApproval=e=>!!(e&&"Have Pending Admin Approval"===e.status),isDeniedOrPendingAppApproval=e=>!!(e&&["Has Denied Apps","Have Pending Admin Approval"].includes(e.status)),needsToInstallApps=e=>!!(e&&"Install apps for user"===e.status),useTemplateAdminApprovedAppsCheck=e=>{let t=(0,l.wA)();(0,r.useEffect)(()=>{t((0,m.o)(void 0))},[t]);let a=e||[],n=(0,d.d4)(u.Nr),i=(0,d.d4)(o.NV),s=(0,d.d4)(e=>b(e,{connectedAppIds:a,action:p.pY.INIT_APP_REQUEST_FLOW})),c=(0,d.d4)(e=>b(e,{connectedAppIds:a,action:p.pY.APP_REQUEST_IS_PENDING})),f=(0,d.d4)(e=>b(e,{connectedAppIds:a,action:p.pY.INSTALL_SHOW_STEP_FUNCTION})),g=(0,d.d4)(e=>b(e,{connectedAppIds:a,action:p.pY.APP_DENIED}));return i?n&&g.length?{status:"Has Denied Apps",appIds:g}:n&&c.length?{status:"Have Pending Admin Approval",appIds:c}:n&&s.length?{status:"Need To Request Access",appIds:s}:f.length?{status:"Install apps for user",appIds:f}:null:null},useInstallAppsForTemplate=()=>{let e=(0,l.wA)();function installApp(t){return e((0,s.y)({appId:t,reason:"template-builder/install-connector-app"}))}return function(t){let a=i.S.allSettled(t.map(installApp));return e((0,m.o)({appIds:t})),a}}},0x9beb8542:(e,t,a)=>{"use strict";a.d(t,{EV:()=>getSelectedTemplate,iN:()=>hasRestrictedApps,sC:()=>isSalesforceEvent,sM:()=>getConnectedAppIdsForTemplate});var n=a(0x20482ad21);a(0x2dd1b881),new n.Ay("workflow_builder");let hasRestrictedApps=({selectedTemplateId:e,templateList:t})=>{let a=t.find(t=>t.id===e);return!!(a&&a.hasRestrictedApps)},getConnectedAppIdsForTemplate=({selectedTemplateId:e,templateList:t})=>{let a=t.find(t=>t.id===e);return a&&a.connectedAppIds||[]},getSelectedTemplate=({routeTemplateId:e,templateIds:t})=>{let a=t.find(t=>t===e),n=t[0];return a||n},isSalesforceEvent=e=>"salesforce_event"===e},0x4a312a6e:(e,t,a)=>{"use strict";a.d(t,{Jx:()=>WorkflowActionIcon});var n=a(0xbad225b5),r=a(0x20482ad21),l=a(0x2501a2cee),i=a(0x210b99e76),s=a(0xe1644a69),o=a(0x1d9a37519),c=a(0x2a037c8a),d=a(0xa7a4ed65),u=a(0x1e9a6d1d),m=a(0x20cfa1dc2),p=a(0x210501b8f);let b=new r.Ay("workflow_builder"),SalesforceIcon=({iconSize:e,alt:t})=>n.createElement("img",{alt:t??b.t("Salesforce Icon",{ns:"data_sources"}),width:e||"100%",height:"auto",src:p}),WorkflowActionIcon=({name:e,type:t,iconSize:a,className:r,alt:i})=>{if(!e)return null;let s=a||void 0;return"slack"===e?n.createElement(l.Ah,{"data-qa":"slack-icon",name:"slack-logo-color",inline:!0,size:s}):"installed_apps_categories"===e?n.createElement(l.Ah,{"data-qa":"wrench-icon",name:"wrench",inline:!0,size:s}):t===c.M.External?n.createElement(SalesforceIcon,{iconSize:s,alt:i}):t===u.A.BuiltIn||t===u.A.Utility?getBuiltinIcon(e,s):t===d.Dd?n.createElement(l.Ah,{inline:!0,"data-qa":"discover-icon",name:"map",size:s}):t===c.M.Service||t===u.A.App||t===m._3.CONNECTOR||t===m._3.CUSTOM?n.createElement(o.z,{"data-qa":"app-icon",size:72,appId:e,imageClassName:r,width:a?Number(a):void 0,height:a?Number(a):void 0,alt:i}):n.createElement(l.Ah,{"data-qa":`${e}-icon`,name:e,inline:!0,size:s})};function getBuiltinIcon(e,t){let a=(0,i.m)(e);if(a&&"slack-logo"!==a)return n.createElement(l.Ah,{"data-qa":`${a}-icon`,name:a,inline:!0,size:t});let r=e.startsWith("builtins_")?e:`builtins_${e}`,o=(e=>{switch(e){case"builtins_channels":return"channel";case"builtins_forms":return"form";case"builtins_messages":return"message";case"builtins_users":return"user";case"builtins_canvas":return"canvas";case"builtins_list":case"builtins_lists":return"lists";case"builtins_sales_elevate":return"sales";case"builtins_salesforce":case"builtins_salesforce_channels":return"sf-record";case"builtins_slack_ai":return"einstein-filled";case"builtins_utilities":return"wrench";case"builtins_agentforce":return"agentforce";default:return"slack-logo"}})(r);return"builtins_slack_ai"===r?n.createElement(s.o,{inline:!0,"data-qa":"slack-ai-icon",type:"sparkles",useFilledIcon:!0,size:t}):"builtins_agentforce"===r?n.createElement(l.Ah,{inline:!0,"data-qa":"agentforce-icon",name:"agentforce-filled",size:t}):"builtins_ai_answer"===r?n.createElement(s.o,{inline:!0,"data-qa":"slack-ai-icon-unfilled",type:"sparkles",size:t}):n.createElement(l.Ah,{inline:!0,"data-qa":`${o}-icon`,name:o,size:t})}WorkflowActionIcon.displayName="WorkflowActionIcon",getBuiltinIcon.displayName="getBuiltinIcon"},0x194fe1f5f:(e,t,a)=>{"use strict";a.d(t,{s:()=>WorkflowDestinationSelect});var n=a(0xbad225b5),r=a(0x1407c6c2c),l=a(0x20482ad21),i=a(0x1e864b930),s=a(0x2264e6ea3),o=a(0x1d2cd7755),c=a(0x1ad596f5f),d=a(0x253c586a2),u=a(0x1ba35eb3b),m=a(0x668181b3),p=a(0x2772625d),b=a(0x1d62f3e69),f=a(0x1795d8821),g=a(0x2196ed249),h=a(0x16ed1b0dc),_=a(0xa985ed31),y=a(0x4f725d55),x=a(0xd2fa49d0);let v=new l.Ay("workflow_builder");function transformDataToOption(e){return{value:e.id,label:e.label,data:e}}function buildDefaultDestinationsLabel(e){let t={channels:v.t("channels",{ns:"enterprise_dashboard"}),threads:v.t("threads"),userGroups:v.t("user groups"),canvases:v.t("canvases"),lists:v.t("lists"),users:v.t("people",{ns:"emoji_keywords"}),teams:v.t("teams")},a=Object.keys(t).map(a=>e[a]?t[a]:void 0).filter(e=>void 0!==e);return v.t("Recent {destinations}",{destinations:(0,i.A)(a).join("")})}let WorkflowDestinationSelect=({elementId:e,className:t,label:a,value:l,hints:i,errors:E,placeholder:k,data:S,allowVariables:w,isDisabled:C=!1,isInvalid:A=!1,isRequired:T=!0,allowThreads:I=!1,allowUsers:N=!0,allowChannels:M=!0,allowUserGroups:F=!1,allowMessageContext:O=!1,allowTeams:L=!1,queryType:D=d.vK,searcherOptions:P,onChange:R,optionsLabel:B,workspaceFilterTeamId:W,selectKey:V,selectProps:q,onValueChange:H,renderSelectedOption:U,renderOption:z,processOptions:j,allowVariablesByType:$,ariaLabel:G,enforceStrictVariableTypeMatch:K,callbackId:Y})=>{let Q=(0,r.A)(),Z=(0,n.useMemo)(()=>{let e=[];return N&&(e.push(g.sD),e.push(f.TE.SlackTypesUserId),e.push(f.TE.SlackTypesUserEmail)),M&&(e.push(g.aL),e.push(f.TE.SlackTypesChannelId)),I&&e.push(g.Bp),F&&(e.push(g.MP),e.push(f.TE.SlackTypesUsergroupId)),O&&e.push(f.TE.SlackTypesMessageContext),L&&e.push(f.TE.SlackTypesTeamId),"canvas"===D&&e.push(f.TE.SlackTypesCanvasId),"lists"===D&&e.push(f.TE.SlackTypesListId),e},[N,M,I,F,O,L,D]),J=(0,n.useMemo)(()=>{let optionsReducer=(e,t)=>{if((Z.includes(t.type)&&!t.isHidden||$&&(0,u.Lm)({variable:t,parameter:{type:$},enforceStrictMatch:K}))&&e.push(transformDataToOption(t)),t.type===f.TE.Object&&t.objectProperties){let a=t.objectProperties.reduce(optionsReducer,[]);e.push(...a)}return e};return S.groups.reduce((e,t)=>{let a=t.data.reduce(optionsReducer,[]);if(0===a.length)return e;let n=t.label;return t.stepIndex&&(n=`${t.stepIndex}. ${n}`),e.push({label:n,options:a}),e},[])},[$,S.groups,Z,K]),X=(0,n.useMemo)(()=>{if(q?.selectedOption)return l;let e="string"==typeof l?(0,m.x)(S.list,l):void 0;return!e&&"string"==typeof l&&(0,p.cn)(l)&&(e=(0,b.x7)(l,f.TE.SlackTypesUserId)),e?transformDataToOption(e):l},[S.list,l,q]),ee=(0,n.useCallback)((e,t)=>{let a=[];if(w){let e=(0,c.A)(J,t,{fuzzyJumpLimit:20});e.length>0&&a.push(...e)}if(q){let e=q.processOptions();a.push(...e)}if(e.length>0&&!O){let t=buildDefaultDestinationsLabel({channels:M,threads:I,userGroups:F,users:N,canvases:"canvas"===D,teams:L,lists:"lists"===D});a.push({label:B||t,options:e})}return Promise.resolve(a)},[J,w,q,O,M,I,F,N,D,L,B]),et=(0,n.useCallback)((e,t)=>{if(!e)return void R({});let a=!!t.data,n=null;a?n=t.data?.type:(0,h.A)(e)?n=g.aL:(0,y.A)(e)?n=g.sD:(0,x.A)(e)?n=g.MP:(0,_.A)(e)?n=g.BA:(0,s.Ay)(e)&&(n=f.TE.SlackTypesTeamId),H&&H(e),n&&R({id:e,type:n,isDynamic:a})},[R,H]),ea=(0,n.useMemo)(()=>[...i||[],...q?.hints||[]],[i,q?.hints]),en=n.createElement(d.NV,{className:t,id:e||Q,queryType:D,searcherOptions:P,ariaLabel:G||v.t("channel or member dropdown menu"),onChange:et,value:X,placeholder:k,hints:ea,errors:E,isDisabled:C,isInvalid:A,isRequired:T,processOptions:j??ee,selectDataQa:"workflow-destination__select",selectKey:V,workspaceFilterTeamId:W,renderSelectedOption:U,renderOption:z,callbackId:Y});return a?n.createElement(o.A,{htmlFor:Q,text:a},en):en};WorkflowDestinationSelect.displayName="WorkflowDestinationSelect"},0x1d3dd4cbe:(e,t,a)=>{"use strict";a.d(t,{B:()=>l,e:()=>useWorkflowBuilderRendererContext});var n=a(0xbad225b5),r=a(0x1cbdfeceb);let l=(0,n.createContext)({updateRequiredContext:r.A,viewOnly:!1,updateParameterValue:r.A,onVariableMenuOpen:r.A,openFormSteps:[],triggerType:void 0,externalTriggerSalesforceOrgId:void 0,validateAsyncValue:r.A,hasValidAppPinBuiltInMessage:!0,workflowSummaryStepPrecedes:!1,formStepPrecedesCurrentStep:!1,previousStepId:"",messagePostedTriggerPrivateChannelAccess:void 0,messagePostedTriggerPrivateChannelTeamIds:void 0,aiStepPrivateChannelAccess:void 0,aiStepPrivateChannelTeamIds:void 0}),useWorkflowBuilderRendererContext=()=>{let e=(0,n.useContext)(l);if(void 0===e)throw Error("useWorkflowBuilderRendererContext must be used within WorkflowBuilderRendererContext");return e}},0x1d1a513a:(e,t,a)=>{"use strict";a.d(t,{u:()=>useSlackConnectPrefsWorkflows});var n=a(0xbad225b5),r=a(0x12cc25ec2),l=a(0x20adb28cd),i=a(0x358bddfc),s=a(0x197981788),o=a(0x226892387),c=a(0x1887ed0ea);let useSlackConnectPrefsWorkflows=(e,t,a)=>{let d=(0,o.d4)(a=>t||(0,l.NN)(a,e)),u=d?.hermes_triggers_trippable_by_slack_connected_teams,m=(0,o.d4)(c.M7),p=(0,o.d4)(t=>void 0!==a?a.is_restricted:(0,l.lW)(t,e)),b=(0,o.d4)(t=>void 0!==a?a.restricted_by_connector_steps_only:(0,l.Yn)(t,e)),f=(0,n.useMemo)(()=>(0,s.Ul)(p??!1,b??!1),[p,b]);return{isTeamValidSCWorkflowTarget:(0,n.useCallback)(e=>{if(!d)return!0;if(m){if(f===i.U.FULL_RESTRICTED)return!1;if(f===i.U.RESTRICTED_BY_ONLY_CONNECTORS)switch(d.hermes_triggers_trippable_by_slack_connected_teams_mcp){case r.HF.NONE:case r.HF.SAFE:return d.allowed_teams_with_3p_connectors?.includes(e);case r.HF.SAFE_AND_3P:return!d.allowed_teams?.includes(e)&&!d.restricted_teams?.includes(e);default:return!0}switch(d?.hermes_triggers_trippable_by_slack_connected_teams_mcp){case r.HF.NONE:return d.allowed_teams.includes(e)||d.allowed_teams_with_3p_connectors?.includes(e);case r.HF.SAFE:case r.HF.SAFE_AND_3P:return!d.restricted_teams.includes(e);default:return!0}}return d.hermes_triggers_trippable_by_slack_connected_teams?!d.restricted_teams.includes(e):d.allowed_teams.includes(e)||(d.allowed_teams_with_3p_connectors?.includes(e)??!1)},[m,d,f]),workflowRestrictedStatus:f,isTrippableByAnySlackConnectedTeamByPrefs:(0,n.useMemo)(()=>m?!!d?.hermes_triggers_trippable_by_slack_connected_teams_mcp&&d?.hermes_triggers_trippable_by_slack_connected_teams_mcp!==r.HF.NONE||(d?.allowed_teams?.length??0)+(d?.allowed_teams_with_3p_connectors?.length??0)>0:!!u||(d?.allowed_teams?.length??0)+(d?.allowed_teams_with_3p_connectors?.length??0)>0,[m,u,d?.allowed_teams?.length,d?.allowed_teams_with_3p_connectors?.length,d?.hermes_triggers_trippable_by_slack_connected_teams_mcp])}}},0xd193e9b8:(e,t,a)=>{"use strict";a.d(t,{c:()=>n.c});var n=a(0x1887f3464)},0x1887f3464:(e,t,a)=>{"use strict";a.d(t,{c:()=>useTriggerTypeList});var n=a(0xbad225b5),r=a(0x51915942),l=a(0x1c2358c11),i=a(0x1c7cb6e50);let useTriggerTypeList=({appId:e,skip:t=!1}={})=>{let{data:a,loading:s,error:o}=(0,l.L)({fetcher:r.G,args:{reason:"fetching-workflow-trigger-types-list-wfb",appId:e},skip:t});return{triggerTypesWithAvailability:(0,n.useMemo)(()=>a?.trigger_types?.map(({trigger_type:e,is_available_to_user:t,private_channel_access:a,private_channel_message:n,private_channel_team_ids:r})=>({triggerType:(0,i.t)(e,0),isAvailable:(0,i.t)(t),privateChannelAccess:a,privateChannelMessage:n,privateChannelTeamIds:r}))??[],[a?.trigger_types]),isLoading:s,isError:!!o}}},0xe374a1b1:(e,t,a)=>{"use strict";a.d(t,{v:()=>WorkflowBuilderModalWrapper});var n=a(0xbad225b5),r=a(0x120c268ad),l=a.n(r),i=a(0x145d46a61),s=a(0x20e80190e),o=a(0x226892387),c=a(0x1f1e5460f),d=a.n(c);let WorkflowBuilderModalWrapper=({children:e,contentLabel:t,describedby:a,maxWidth:r,modalClassName:c,onAfterClose:u,onClose:m,shouldCloseOnOverlayClick:p,overlayClassName:b,...f})=>{let g=(0,o.d4)(i.tQ);return n.createElement(s.aF,{className:c,centered:!g,contentLabel:t,dataQa:"workflow-builder-modal-wrapper",describedby:a,maxWidth:r,onAfterClose:u,onClose:m,overlayClassName:l()({[d().modalOverlay]:g,...b?{[b]:!0}:{}}),shouldCloseOnOverlayClick:p,...f},e)};WorkflowBuilderModalWrapper.displayName="WorkflowBuilderModalWrapper"},0xbe3df8c1:(e,t,a)=>{"use strict";a.d(t,{J:()=>i});var n=a(0x157c40d29),r=a(0x11c82607b),l=a(0x212b4c697);let i=(0,r.Ay)("Get Function OAuth",async(e,t,{appId:a,workflowId:r,functionId:i,step:s,trigger:o})=>{let c=await e((0,n.H)({appId:a,workflowId:r,step:s,trigger:o,reason:"workflow_builder/workflows_get_function_auth"}));if(!c.ok)throw Error("Response from appsExternalGetFunctionAuthFetcher not ok");let d=Object.values(c.providers).map(({provider_name:e="",provider_key:t="",valid_tokens:n=[]})=>({appId:a,functionId:i,providerKey:t,providerName:e,validTokens:n.map(({user_id:e="",external_user_id:t="",external_token_id:a="",is_default:n})=>({userId:e,externalUserId:t,externalTokenId:a,isDefault:n}))}));e((0,l.BX)({auths:d}))});i.meta={name:"getFunctionAuth",key:"createThunkGetFunctionAuth",description:"Get Function OAuth"}},0x24129bf7:(e,t,a)=>{"use strict";a.d(t,{V:()=>FormPreview});var n=a(0xbad225b5),r=a(0x20482ad21),l=a(0x11a296110),i=a(0x1dde3f5ab),s=a(0x113cdbbd7),o=a(0x944e06df),c=a(0x20e80190e),d=a(0x221574985),u=a.n(d);let m=new r.Ay("workflow_builder"),FormPreview=({formTitle:e,formQuestions:t,toggleShowFullPreview:a,onClose:r,formBackButtonLabel:d})=>{let p=(0,n.useCallback)(()=>{a(),r()},[r,a]);return n.createElement(c.dW,{closeModal:p},n.createElement(c.rQ,null,n.createElement(c.Rc,{title:e})),n.createElement(c.$m,null,n.createElement(c.qf,null,n.createElement(o.A,{blocks:(0,i.Jf)(t),blocksContainerContext:s.pi.wfb_preview,container:s.pi.wfb_preview,remountOnUpdate:!0,className:u().blocksRenderer}))),n.createElement(c.jl,null,n.createElement("div",{className:u().footerText},m.t("This is just a preview")),n.createElement(c.ox,null,n.createElement(l.Ay,{type:"outline",onClick:a},d||m.t("Back to Editing")))))};FormPreview.displayName="FormPreview"},0x52038dd0:(e,t,a)=>{"use strict";a.d(t,{z:()=>useOAuthInputParameterRenderer});var n=a(0xbad225b5),r=a(0x16cf1da63),l=a(0x1cbdfeceb),i=a(0x120c268ad),s=a.n(i),o=a(0x6affae29),c=a(0x20482ad21),d=a(0x2b7f0bcc),u=a(0x11a296110),m=a(0x1d2cd7755),p=a(0xa5dbe09b),b=a(0xb64e73ea),f=a(0x145d46a61),g=a(0x1795d8821),h=a(0x226892387),_=a(0x810a3ce9),y=a.n(_);let{BUILDER:x,END_USER:v}=g.x,{LAST_INTERACTOR:E}=g.gx,k=new c.Ay("workflow_builder");function OAuthAccountDelegationRadioGroup({providerName:e,userId:t,credentialSource:a,userContextSource:r,legendText:l,onUpdateCredentials:i,isFunctionFormWrapped:o,hasDynamicInputs:c,showDeprecatedAuthOption:d}){let u=(0,h.d4)(f.$T),m=u?k.t("Person who last interacted with the workflow"):k.t("The person who last interacted with the workflow"),_=u?k.t("The workflow will use the accounts of people using the workflow to connect to {providerName}. They\u2019ll have to connect their account when they use the workflow, if they haven\u2019t already.",{providerName:e}):k.t("The workflow connects to {providerName} using the accounts of people using the workflow. They\u2019ll have to connect their account, if they haven\u2019t already.",{providerName:e}),S=u?k.t("The workflow will use the accounts of people using the workflow. They\u2019ll have to connect their account when they use the workflow, if they haven\u2019t already."):k.t("The workflow uses the accounts of people using the workflow. They\u2019ll have to connect their account, if they haven\u2019t already."),w=e?_:S,C=(0,n.useMemo)(()=>n.createElement(n.Fragment,null,n.createElement("div",{className:"bold"},m),n.createElement("div",{className:s()(y().smallText,"sk_foreground_max")},w)),[m,w]),A=k.t("The person using the workflow"),T=k.t("Individuals will need the right permissions in {providerName}",{providerName:e}),I=(0,n.useMemo)(()=>n.createElement(n.Fragment,null,n.createElement("div",{className:y().callerAuthLabelText},A,d&&n.createElement("span",{className:s()("c-app_badge",y().deprecatedBadge)},"DEPRECATED")),n.createElement("div",{className:s()(y().smallText,"sk_foreground_max")},T)),[A,d,T]),N=!!t,M=e?k.t("Connect your {providerName} account",{providerName:e}):k.t("Connect your account"),F=k.t("You\u2019ll be directed to {providerName} to authenticate",{providerName:e}),O=e?F:k.t("You\u2019ll be directed to the company to authenticate"),L=u?k.t("The workflow will use this account to connect to {providerName} every time, no matter who uses the workflow.",{providerName:e}):k.t("Workflow connects to {providerName} using this account every time, no matter who interacts with the workflow.",{providerName:e}),D=(0,n.useMemo)(()=>n.createElement(n.Fragment,null,n.createElement("div",{className:"bold display_flex align_items_center no_min_width"},N?n.createElement("span",{className:y().userId},t):n.createElement("span",null,M)),n.createElement("div",{className:s()(y().smallText,"sk_foreground_max")},N?L:O)),[N,t,M,L,O]),P=(0,n.useCallback)(({credentialSource:e,userContextSource:t})=>()=>{i({credentialSource:e,userContextSource:t??r})},[i,r]);(0,n.useEffect)(()=>{d&&i({credentialSource:a,userContextSource:g.gx.LAST_INTERACTOR})},[d,a,i]);let R=o||c;return n.createElement(p.A,{legendText:l,className:"no_margin",legendClassNames:"no_margin"},n.createElement("div",{className:y().oauthGroupBorder},n.createElement(b._,{label:C,checked:a===v&&r===E||!!R,onChange:P({credentialSource:v,userContextSource:E}),disabled:R}),d&&n.createElement(b._,{label:I,checked:a===v&&!r,disabled:!0,onChange:P({credentialSource:v})}),!R&&n.createElement(b._,{label:D,disabled:!N,checked:a===x,onChange:P({credentialSource:x})})))}OAuthAccountDelegationRadioGroup.displayName="OAuthAccountDelegationRadioGroup";var S=a(0x1f2e22823),w=a(0x6e0e2fb2),C=a(0x20e80190e);let{BUILDER:A,END_USER:T}=g.x,I=new c.Ay("workflow_builder");function OAuthAccountDelegationModal({providerName:e,userId:t,credentialSource:a,userContextSource:r,requiredCredentialSource:l,onClose:i,onUpdateCredentials:c,onUpdateOAuth:p,onAddOAuth:b,isFunctionFormWrapped:g,hasDynamicInputs:_,showDeprecatedAuthOption:x,isFunctionForKnowledgeSource:v}){let E=(0,h.d4)(f.$T),k=(0,h.d4)(f.oI),[N,M]=(0,n.useState)({credentialSource:a,userContextSource:r}),[F,O]=(0,n.useState)(null),[L,D]=(0,n.useState)(w.r.FINISHED),P=E?I.t("Account for workflow use"):I.t("{providerName} account for workflow use",{providerName:e}),R=e?I.t("{providerName} account for workflow building",{providerName:e}):I.t("Account for workflow building"),B=(0,n.useMemo)(()=>n.createElement("span",{className:"bold"},E?I.t("Account for workflow building"):R),[R,E]),W=(0,n.useMemo)(()=>n.createElement("span",{className:"bold"},k?I.t("Account for workflow building and workflow use"):"Account for workflow building and workflow use"),[k]),V=(0,n.useMemo)(()=>k?I.t("This account lets Slack connect to the external service while you\u2019re building and using the workflow."):"This account lets Slack connect to the external service while you\u2019re building and using the workflow.",[k]),q=E?I.t("This account lets Slack connect to {providerName} while you\u2019re building, so you can use {providerName} steps in the workflow.",{providerName:e}):I.t("This account lets Slack connect to {providerName}, so you can use {providerName} steps in the workflow.",{providerName:e}),H=E?I.t("This account lets Slack connect to the external service while you\u2019re building, so you can use their steps in the workflow."):I.t("This account lets Slack connect to the company, so you can use their steps in the workflow."),U=e?q:H,z=(0,n.useCallback)(()=>{c(N)},[c,N]),j=(0,n.useMemo)(()=>n.createElement(m.A,{text:P}),[P]),$=I.t("Please update this step to use the person who last interacted with the workflow."),G=I.t("Please update this step to use your account, not the person who last interacted with the workflow."),K=e?I.t("Could not connect to {providerName}. Please try again.",{providerName:e,fallbackHashNs:"oauth_account_picker"}):I.t("Could not connect. Please try again.",{fallbackHashNs:"oauth_account_picker"}),Y=(0,n.useMemo)(()=>{if(F)return K;if(!l||N.credentialSource===l)return null;switch(N.credentialSource){case A:return $;case T:return G;default:(0,o.Kh)(N.credentialSource)}},[F,K,$,G,l,N.credentialSource]),Q=!!t,Z=(0,n.useCallback)(e=>n.createElement(u.Ay,{...e,type:Q?"outline":"primary"}),[Q]),J=(0,n.useCallback)(async()=>{try{O(null),D(w.r.IN_FLIGHT),await b()}catch(e){O(e)}finally{D(w.r.FINISHED)}},[b]),X=e?I.t("{providerName} accounts",{providerName:e}):I.t("Accounts");return n.createElement(C.dW,{centered:!0,closeModal:i},n.createElement(C.rQ,null,n.createElement(C.Rc,{title:X})),n.createElement(C.$m,null,Y&&n.createElement(C.qf,{className:"margin_bottom_100"},n.createElement(d.Ay,{type:"boxed",level:"error"},Y)),n.createElement(C.qf,null,v?n.createElement(m.A,{text:W,subtext:V}):n.createElement(m.A,{text:B,subtext:U}),n.createElement("div",{className:s()(y().oauthGroupBorder,"margin_bottom_125 padding_75",{margin_top_100:v})},n.createElement(S.v,{onUpdateOAuth:Q?p:J,providerName:e,renderButton:Z,loadingStatus:L,userId:t,hasValidOAuth:Q}))),!v&&n.createElement(C.qf,null,n.createElement(OAuthAccountDelegationRadioGroup,{providerName:e,userId:t,credentialSource:N.credentialSource,userContextSource:N?.userContextSource,legendText:j,onUpdateCredentials:M,showDeprecatedAuthOption:x,isFunctionFormWrapped:g,hasDynamicInputs:_}))),n.createElement(C.jl,null,n.createElement(C.ox,null,n.createElement(u.Ay,{"data-qa":"oauth-account-delegation-modal-cancel",type:"outline",onClick:i},I.t("Cancel")),n.createElement(u.Ay,{"data-qa":"oauth-account-delegation-modal-save",type:"primary",disabled:!!Y,onClick:z},I.t("Save")))))}OAuthAccountDelegationModal.displayName="OAuthAccountDelegationModal";var N=a(0x1853f0e7c),M=a(0x2501a2cee),F=a(0x17c322a5b),O=a.n(F);let L=new c.Ay("workflow_builder");function OAuthAccountSelect({providerName:e,userId:t,credentialSource:a,userContextSource:r,loadingStatus:l,hasValidOAuth:i,isReadOnly:s=!1,onUpdateOAuth:o,isTriggerSegment:c,showDeprecatedAuthOption:d,isFunctionFormWrapped:u,isFunctionForKnowledgeSource:m}){return l===w.r.FINISHED&&(i||a===g.x.END_USER)?n.createElement(ConnectedOAuthAccountSelect,{userId:t,providerName:e,loadingStatus:l,credentialSource:a,userContextSource:r,hasValidOAuth:i,isReadOnly:s,onUpdateOAuth:o,isTriggerSegment:c,showDeprecatedAuthOption:d,isFunctionFormWrapped:u,isFunctionForKnowledgeSource:m}):n.createElement(S.v,{loadingStatus:l,providerName:e,onUpdateOAuth:o})}function ConnectedOAuthAccountSelect({userId:e,providerName:t,credentialSource:a,userContextSource:r,isReadOnly:l,onUpdateOAuth:i,isTriggerSegment:o,showDeprecatedAuthOption:c,isFunctionFormWrapped:d,isFunctionForKnowledgeSource:m}){let p=L.t("{providerName} account used for this step",{providerName:t}),b=L.t("Account used for this step");o&&(p=L.t("{providerName} account used",{providerName:t}),b=L.t("Account used"));let f=t?p:b,h=(0,n.useMemo)(()=>r?L.t("The person who last interacted with the workflow"):L.t("The person using the workflow"),[r]),_=(0,n.useMemo)(()=>a===g.x.END_USER||d?n.createElement("div",{className:!c||r||m?void 0:O().labelWithError},n.createElement("span",{className:O().subLabel},h)):n.createElement("div",null,n.createElement("span",{className:O().subLabel},e),n.createElement("span",{className:O().checkIcon},n.createElement(M.Ah,{name:"check-circle-filled",color:(0,N.HK)("DT_COLOR_CONTENT_HGL_2"),size:"inherit"}))),[a,d,e,c,r,m,h]);return n.createElement("div",{className:s()(O().oauthAccountContainer)},n.createElement("div",{className:"display_flex flex_direction_column justify_content_between"},n.createElement("div",{className:"bold"},f),_),!l&&n.createElement(u.Ay,{size:"small",type:"outline",onClick:i},L.t("Edit")))}OAuthAccountSelect.displayName="OAuthAccountSelect",ConnectedOAuthAccountSelect.displayName="ConnectedOAuthAccountSelect";var D=a(0x1729ca3b1),P=a(0x135b7b386),R=a(0x157b4a886),B=a(0x1fcbb004d),W=a(0x46dbff89);let{BUILDER:V,END_USER:q}=g.x,H=[P.wo,P.Id,P.Nn];function SlackFunctionOAuthInput({appId:e,oAuthDetails:t,value:a,parameter:r,loadingStatus:i,workflowAuthStrategy:s,hasDynamicInputs:o,onAddOAuth:c,onSelectOAuth:d,onChange:u,isTriggerSegment:m,isFunctionFormWrapped:p,isFunctionForKnowledgeSource:b,isOAuthTokenInvalid:f}){let{providerName:g="",validTokens:h}=t??{},[_,y]=(0,n.useState)(!1),x=(0,n.useCallback)(()=>{c(),y(!0)},[c]);if(i!==w.r.FINISHED)return n.createElement("div",{className:"margin_bottom_150"},n.createElement(S.v,{loadingStatus:i,providerName:g,onUpdateOAuth:l.A}));let v=!h?.length&&a&&!!a.external_token_id;return!h?.length&&o||v?n.createElement("div",{className:"margin_bottom_50"},n.createElement(S.v,{loadingStatus:i,providerName:g,onUpdateOAuth:x,isOAuthTokenInvalid:f,appId:e})):n.createElement(SlackFunctionOAuthInputInternal,{appId:e,oAuthDetails:t,value:a,parameter:r,loadingStatus:i,workflowAuthStrategy:s,hasDynamicInputs:o,onAddOAuth:c,onSelectOAuth:d,onChange:u,isTriggerSegment:m,isFirstConnection:_,isFunctionFormWrapped:p,isFunctionForKnowledgeSource:b})}function SlackFunctionOAuthInputInternal({appId:e,oAuthDetails:t,value:a,parameter:l,loadingStatus:i,hasDynamicInputs:s,workflowAuthStrategy:o,onAddOAuth:c,onSelectOAuth:d,onChange:u,isTriggerSegment:m,isFirstConnection:p,isFunctionFormWrapped:b,isFunctionForKnowledgeSource:f}){let h=(0,r.wA)(),{functionId:_,providerKey:y,providerName:x="",validTokens:v=[]}=t??{},E=!!a?.external_token_id,{externalTokenId:k,externalUserId:S}=(0,n.useMemo)(()=>v.find(e=>e.isDefault)||v.find(e=>e.externalTokenId&&e.externalTokenId===a?.external_token_id)||v[0]||{},[v,a?.external_token_id]),w=(0,n.useMemo)(()=>"end_user_only"===o||!!l?.require_end_user_auth,[o,l?.require_end_user_auth]),C=(0,n.useMemo)(()=>w?q:m?V:void 0,[w,m]),A=(0,n.useMemo)(()=>a?.credential_source?a.credential_source:C?C:H.includes(e)?V:q,[a?.credential_source,C,e]),T=(0,n.useMemo)(()=>A===V&&!!w||A===q&&!!m,[A,w,m]),I=(0,n.useMemo)(()=>!!v.length||A===q,[v,A]),N=a&&!a?.user_context_source,M=(0,n.useRef)(N),F=(0,n.useMemo)(()=>{if(!N&&!f)return a?.user_context_source??g.gx.LAST_INTERACTOR},[N,f,a?.user_context_source]),O=(0,n.useMemo)(()=>!!s||!!T||!!M.current||!w,[T,s,M,w]),L=(0,n.useMemo)(()=>!N&&!T&&s&&w,[T,s,w,N]),D=(0,n.useCallback)(e=>{if(a?.external_token_id===e?.external_token_id)return!1;let t=v.find(e=>e.externalTokenId===a?.external_token_id),n=v.find(t=>t.externalTokenId===e?.external_token_id);return!(!t||t?.externalUserId&&n?.externalUserId&&t.externalUserId===n.externalUserId)},[v,a?.external_token_id]),P=(0,n.useCallback)(e=>{e.external_token_id&&d(e.external_token_id);let t={shouldInvalidateDependentInputs:D(e)};(e.credential_source!==a?.credential_source||e?.external_token_id!==a?.external_token_id||e?.user_context_source!==a?.user_context_source)&&u(l,e,void 0,t)},[D,d,u,l,a]),R=(0,n.useCallback)(()=>{h((0,W.q)({element:n.createElement(ConnectedOAuthAccountDelegationModal,{functionId:_,providerKey:y,providerName:x,credentialSource:A,userContextSource:F,requiredCredentialSource:C,showDynamicInputsOnlyModal:L,onSave:P,onAddOAuth:c,isTriggerSegment:m,showDeprecatedAuthOption:M.current,isFunctionFormWrapped:b,isFunctionForKnowledgeSource:f}),name:"oauth-account-delegation-modal",isStackable:!0}))},[h,_,y,x,A,F,C,L,P,c,m,b,f]),B=(0,n.useMemo)(()=>!a||!a.external_token_id&&!!k||!!k&&!v.some(({externalTokenId:e})=>e===a?.external_token_id),[k,v,a]);return(0,n.useEffect)(()=>{if((!E||p)&&B&&I){let e={external_token_id:k,credential_source:A,user_context_source:F},t={shouldInvalidateDependentInputs:D(e)};u(l,e,void 0,t)}},[A,F,k,I,p,B,E,w,u,l,D]),n.createElement("div",{className:"margin_bottom_150"},n.createElement(OAuthAccountSelect,{hasValidOAuth:I,providerName:x,userId:S,credentialSource:A,userContextSource:F,loadingStatus:i,isReadOnly:!O,onUpdateOAuth:R,isTriggerSegment:m,showDeprecatedAuthOption:M.current,isFunctionFormWrapped:b,isFunctionForKnowledgeSource:f}))}function ConnectedOAuthAccountDelegationModal({functionId:e,providerKey:t,providerName:a,credentialSource:l,userContextSource:i,showDynamicInputsOnlyModal:s,requiredCredentialSource:o,onAddOAuth:c,onSave:d,isTriggerSegment:u,showDeprecatedAuthOption:m,isFunctionFormWrapped:p,isFunctionForKnowledgeSource:b}){let f=(0,r.wA)(),g=useOAuthTokenStateHook({functionId:e,providerKey:t}),h=g(),_=(0,n.useCallback)(()=>{f((0,B.O)())},[f]),[y,x]=(0,n.useState)(()=>{let e=h.find(({isDefault:e})=>e);return(e||h[0])?.externalTokenId}),v=!!y;(0,n.useEffect)(()=>{!v&&h.length&&x(h[0]?.externalTokenId)},[v,h]);let E=(0,n.useMemo)(()=>h.find(e=>e.externalTokenId===y),[h,y]),k=(0,n.useCallback)(e=>t=>Promise.resolve().then(()=>e(t)),[]),S=(0,n.useCallback)(()=>{f((0,W.q)({element:n.createElement(D.W,{selectedAuth:E,providerName:a,onClose:_,onAddOAuth:c,onSelectOAuth:k(x),useOAuthTokenState:g}),name:"oauth-account-select-modal",isStackable:!0}))},[f,E,a,_,c,k,g,x]),w=(0,n.useCallback)(e=>{d(e),u||_()},[d,_,u]),C=(0,n.useCallback)(e=>{w({credential_source:e.credentialSource,external_token_id:y,user_context_source:e?.userContextSource})},[w,y]),A=(0,n.useCallback)(()=>{w({credential_source:l,external_token_id:y,user_context_source:i})},[w,l,i,y]);return((0,n.useEffect)(()=>{u&&null!==y&&A()},[u,y,A]),u)?n.createElement(D.W,{providerName:a,onClose:_,onAddOAuth:c,onSelectOAuth:k(x),useOAuthTokenState:g}):n.createElement(OAuthAccountDelegationModal,{providerName:a,userId:E?.externalUserId,credentialSource:l,userContextSource:i,requiredCredentialSource:o,onUpdateCredentials:C,onClose:_,onUpdateOAuth:S,showDeprecatedAuthOption:m,onAddOAuth:c,isFunctionFormWrapped:p,hasDynamicInputs:s,isFunctionForKnowledgeSource:b})}function useOAuthTokenStateHook({functionId:e,providerKey:t}){return(0,n.useMemo)(()=>function(){return(0,h.d4)(a=>e&&t&&(0,R.JG)(a,{functionId:e,providerKey:t})?.validTokens||[])},[e,t])}SlackFunctionOAuthInput.displayName="SlackFunctionOAuthInput",SlackFunctionOAuthInputInternal.displayName="SlackFunctionOAuthInputInternal",ConnectedOAuthAccountDelegationModal.displayName="ConnectedOAuthAccountDelegationModal";var U=a(0xf5bbd10a),z=a(0x212b4c697),j=a(0x1a7c0453a);function OAuth2InputParameterRenderer({oAuthDetails:e,parameter:t,value:a,providerKey:l,appId:i,functionId:s,workflowId:o,loadingStatus:c,hasDynamicInputs:d,workflowAuthStrategy:u,onChange:m,isTriggerSegment:p,isFunctionFormWrapped:b,isFunctionForKnowledgeSource:f,isOAuthTokenInvalid:g}){let h=(0,r.wA)(),_=(0,U.A)(),y=(0,n.useCallback)(async()=>{if(!l)throw _.error("Missing provider key"),Error("Missing provider key");await h((0,j.N)({appId:i,providerKey:l,functionId:s,workflowId:o,reason:"workflow_builder/workflows_update_function_oauth"}))},[h,_,i,l,s,o]),x=(0,n.useCallback)(e=>Promise.resolve().then(()=>{l?h((0,z.RV)({functionId:s,providerKey:l,externalTokenId:e})):_.error("Missing provider key")}),[h,_,s,l]);return n.createElement(SlackFunctionOAuthInput,{key:t.name,parameter:t,value:a,loadingStatus:c,hasDynamicInputs:d,oAuthDetails:e,onChange:m,onAddOAuth:y,onSelectOAuth:x,appId:i,workflowAuthStrategy:u,isTriggerSegment:p,isFunctionFormWrapped:b,isFunctionForKnowledgeSource:f,isOAuthTokenInvalid:g})}function useOAuthInputParameterRenderer({appId:e,workflowId:t,functionId:a,functionAuths:r,loadingStatus:l,hasDynamicInputs:i,workflowAuthStrategy:s,onChange:o,isTriggerSegment:c,isFunctionFormWrapped:d,isFunctionForKnowledgeSource:u,isOAuthTokenInvalid:m}){return(p,b)=>{let f=p.oauth2_provider_key,g=f?r.find(e=>e.providerKey===f):void 0;return n.createElement(OAuth2InputParameterRenderer,{appId:e,functionId:a,workflowId:t,parameter:p,providerKey:f,value:b,loadingStatus:l,hasDynamicInputs:i,oAuthDetails:g,workflowAuthStrategy:s,onChange:o,isTriggerSegment:c,isFunctionFormWrapped:d,isFunctionForKnowledgeSource:u,isOAuthTokenInvalid:m})}}OAuth2InputParameterRenderer.displayName="OAuth2InputParameterRenderer",useOAuthInputParameterRenderer.displayName="useOAuthInputParameterRenderer"},0x4fbb276b:(e,t,a)=>{"use strict";a.d(t,{v:()=>useSlackFunctionFormOAuth});var n=a(0xbad225b5),r=a(0x16cf1da63),l=a(0x6e0e2fb2),i=a(0xbe3df8c1),s=a(0x226892387),o=a(0x212b4c697),c=a(0x157b4a886);let d=[];function useFunctionAuths(e,t,a,u,m){let p=(0,r.wA)(),[b,f]=(0,n.useState)(l.r.NOT_STARTED);return(0,n.useEffect)(()=>(m(()=>{f(l.r.IN_FLIGHT),p((0,i.J)({appId:e,workflowId:t,functionId:a,step:u})).then(()=>{f(l.r.FINISHED)}).catch(()=>{f(l.r.ERROR)})})||f(l.r.FINISHED),()=>{p((0,o.RZ)()),f(l.r.NOT_STARTED)}),[]),{functionAuths:(0,s.d4)(t=>{if(b===l.r.FINISHED){let n=(0,c.rl)(t,{appId:e,functionId:a});if(n.length)return n}return d}),loadingStatus:b}}var u=a(0x52038dd0),m=a(0x1795d8821),p=a(0x19561ce96);function useSlackFunctionFormOAuth({stepId:e,appId:t,functionId:a,inputParameters:r=[],configuredInputs:l,workflowId:i,onChange:o,isFunctionFormWrapped:c,isOAuthTokenInvalid:d,isFunctionForKnowledgeSource:b}){let f=(0,s.d4)(e=>(0,p.TI)(e,t)),g=(0,n.useMemo)(()=>f?.workflowAuthStrategy,[f]),h=(0,n.useMemo)(()=>({id:e,functionId:a,inputs:l,type:"function"}),[e,a,l]),_=r.filter(({type:e})=>e===m.HN.SlackTypesCredentialOauth2),y=(0,n.useMemo)(()=>r.some(e=>"dynamic_options"in e&&void 0!==e.dynamic_options),[r]),{functionAuths:x,loadingStatus:v}=useFunctionAuths(t,i,a,h,(0,n.useCallback)(e=>{if(_.length)return e(),!0},[_]));return{renderOAuth2InputParameter:(0,u.z)({appId:t,workflowId:i,functionId:a,functionAuths:x,loadingStatus:v,onChange:o,hasDynamicInputs:y,workflowAuthStrategy:g,isFunctionFormWrapped:c,isFunctionForKnowledgeSource:b,isOAuthTokenInvalid:d}),functionAuths:x,loadingStatus:v}}},0x210b99e76:(e,t,a)=>{"use strict";a.d(t,{m:()=>getStepIcon});let n=new Map([["open_form","form"],["send_message","message"],["reply_in_thread","threads"],["send_ephemeral_message","message"],["update_channel_topic","channel"],["create_channel","channel"],["invite_user_to_channel","channel"],["channel start message","channel"],["delay","hourglass"],["archive_channel","channel"],["unarchive_channel","channel"],["create_usergroup","user-groups"],["add_user_to_usergroup","user-groups"],["add_pin","channel"],["remove_pin","channel"],["remove_user_from_usergroup","user-groups"],["send_dm","message"],["create_channel_section","channel"],["add_channel_to_channel_section","channel"],["find_channels_by_keywords","channel"],["add_channel_list_to_section","channel"],["select_channels","channel"],["add_bookmark","bookmark"],["add_channel_manager","channel"],["create_list","lists"],["lists_fetch_columns","lists"],["list_add_record","lists"],["add_list_record","lists"],["share_list_users","lists"],["share_list_channels","lists"],["share_list","lists"],["read_list_record","lists"],["delete_list_record","lists"],["update_list_record","lists"],["copy_list","lists"],["lists_activity_feed","lists"],["send_task_list_alert","lists"],["create_items_due_summary","lists"],["canvas_create","canvas"],["canvas_update_content","canvas"],["canvas_update_content_v2","canvas"],["channel_canvas_create","canvas"],["add_canvas_to_channel_tab","canvas"],["share_canvas","canvas"],["share_canvas_in_thread","canvas"],["find_dm_or_mpdm_channel_canvas","canvas"],["canvas_copy","canvas"],["canvas_fetch_variables","canvas"],["canvas_update_variables","canvas"],["canvas_fetch_header_sections","canvas"],["send_to_sales_home","sales"],["send_to_my_sales_home","sales"],["send_summary_to_sales_home","sales"],["send_summary_to_my_sales_home","sales"],["send_to_record_channel","sales"],["create_record_channel","sales"],["lookup_record_channel","sales"],["lookup_channel_record","sales"],["send_to_salesforce_app","notifications"],["send_to_my_salesforce_app","notifications"],["add_reaction","emoji"],["remove_reaction","emoji"],["summarize_channel","ai-summary"],["search_summary","ai-summary"],["read_message","message"],["share_message","share-message"],["switch_step","branch"],["case_step","add-branch"],["loop_step","refresh"],["ask_agentforce","agentforce-filled"],["add_agent_to_channel","agentforce-filled"],["ai_answer","ai-sparkle"],["lookup_entities","search"],["lookup_from_list","search-files"]]),r=new Set(["send_to_record_channel","create_record_channel","lookup_record_channel","lookup_channel_record"]);function getStepIcon(e){let t=e?n.get(e):void 0;return e&&r.has(e)?"sf-record":t??"slack-logo"}},0x2370b4942:(e,t,a)=>{"use strict";a.r(t),a.d(t,{DropdownMentionSupportBadge:()=>DropdownMentionSupportBadge});var n=a(0xbad225b5),r=a(0x16cf1da63),l=a(0x40c0d834),i=a(0x20482ad21),s=a(0x1fd3f6e20),o=a(0x218842a12),c=a(0x3711e82d),d=a(0xf3c65e54),u=a(0x5b1935a6);let m=new i.Ay("workflow_builder");o.g.HERMES_WORKFLOWS_DROPDOWN_MENTION_SUPPORT_BADGE;let DropdownMentionSupportBadge=()=>{let e=(0,r.wA)();return(0,n.useEffect)(()=>{e((0,d.A)({notificationName:u.ze.HERMES_WORKFLOWS_DROPDOWN_MENTION_SUPPORT_BADGE,action:u.hw.IMPRESSION}))},[e]),n.createElement(l.A,{clogImpression:!0,uiComponentName:c.UiComponentName.HERMES_WORKFLOWS_DROPDOWN_MENTION_SUPPORT_BADGE},n.createElement(s.v,{dataQa:"dropdown-mention-support-badge",isMicro:!0,style:s.u.Informative},m.t("Now with @mentions")))};DropdownMentionSupportBadge.displayName="DropdownMentionSupportBadge"},0x1a3026429:(e,t,a)=>{"use strict";a.d(t,{u:()=>hasValidDynamicInputValues});var n=a(0x242822dfb),r=a(0x7019ae94);let hasValidDynamicInputValues=(e,t)=>{if(!e.dynamic_options)return!0;let a="object"==typeof t&&!Array.isArray(t)&&Object.values(t||{}).some(e=>Number.isNaN(e)),l=!0;if((0,n.sg)(e)&&e.properties){let a=e.properties;l=Object.keys(a).every(e=>{let n=a[e],l=t&&"object"==typeof t&&!Array.isArray(t)?t[e]:void 0;return"isParameterFormWrapped"in n&&!!n.isParameterFormWrapped||!n.is_required||!(0,r.$)(l)})}return l&&!a}},0x1312f060e:(e,t,a)=>{"use strict";a.d(t,{B:()=>isRichTextSectionElement});let isRichTextSectionElement=e=>!!(e&&"object"==typeof e&&"type"in e&&"rich_text_section"===e.type)},0x1e1fc678:(e,t,a)=>{"use strict";a.d(t,{T:()=>getTriggerLabel,k:()=>isExtendedTriggerType});var n=a(0x20482ad21),r=a(0x61c95b1b),l=a(0x2a037c8a);let i=new n.Ay("workflow_builder"),s={[l.M.Shortcut]:()=>i.t("From a link in Slack"),hermes_webhook:()=>i.t("From a webhook"),hermes_scheduled:()=>i.t("On a schedule"),[l.M.Webhook]:()=>i.t("From a webhook"),[l.M.Scheduled]:()=>i.t("On a schedule"),[l.M.Event]:{[r.$.ReactionAdded]:()=>i.t("When an emoji reaction is used"),[r.$.UserJoinedChannel]:()=>i.t("When a person joins a channel"),[r.$.ChannelCreated]:()=>i.t("When a channel is created"),[r.$.ListRecordUpdated]:()=>i.t("When a list item is updated"),[r.$.MessagePosted]:()=>i.t("When a message is posted with keywords",{fallbackHash:"67c9a95ef9a34aa542df04020d7543b46c247d2e"})},[l.M.External]:()=>i.t("From a Salesforce event")};function isExtendedTriggerType(e){return[...Object.values(l.M),"hermes_webhook","hermes_scheduled"].includes(e)}let getTriggerLabel=(e,t,a)=>{if(!isExtendedTriggerType(e))return"";if(e===l.M.Service)return t??"";let n=s[e];return"function"==typeof n?n():n[a]?.()}},0x7733abee:(e,t,a)=>{"use strict";a.r(t),a.d(t,{MessagePostedPrivateChannelAccessBadge:()=>MessagePostedPrivateChannelAccessBadge});var n=a(0xbad225b5),r=a(0x20482ad21),l=a(0x11a296110),i=a(0x1fd3f6e20),s=a(0x4c96e5d9),o=a(0x218842a12),c=a(0x145d46a61),d=a(0x226892387),u=a(0x1de368064),m=a.n(u);let p=new r.Ay("workflow_builder");o.g.HERMES_WORKFLOWS_MESSAGE_POSTED_TRIGGER_PRIVATE_CHANNEL_ACCESS_BADGE;let MessagePostedPrivateChannelAccessBadge=({recordNotificationEventImpression:e})=>{let t=(0,d.d4)(c.sQ);(0,n.useEffect)(()=>{e()},[e]);let a=t?p.t("Private channel access: You can now select private channels when setting up this trigger."):"Private channel access: You can now select private channels when setting up this trigger.";return n.createElement(s.Ay,{tip:a},n.createElement(l.Nm,{"data-qa":"private-channel-access-badge",className:m().badge,"aria-label":a},n.createElement(i.v,{isMicro:!0,style:i.u.Informative},p.t("NEW"))))};MessagePostedPrivateChannelAccessBadge.displayName="MessagePostedPrivateChannelAccessBadge"},0x1340d624e:(e,t,a)=>{"use strict";a.d(t,{ED:()=>c,XD:()=>n,XZ:()=>s,bI:()=>l,kJ:()=>o,qG:()=>r,x4:()=>d,zc:()=>i});let n={USER_ID:"user_id",NOTIFY_MANAGERS:"notify_managers",ROLES_TYPE:"roles_type",ROLES:"roles",ROLE_CONTAINS:"role_contains",ROLE_DOES_NOT_CONTAIN:"role_does_not_contain",USER_FILTER:"user_filter",MESSAGE:"message",INTERACTIVE_BLOCKS:"interactive_blocks"},r={USER_ID:"user_id",INTERACTIVE_BLOCKS:"interactive_blocks"},l={USER_ID:"user_id",MESSAGE:"message",NOTIFICATION_DISPLAY_TABLE_HEADER:"notification_display_table_header",NOTIFICATION_DISPLAY_TABLE_EXTRA_COLUMN_FIELD_ID:"notification_display_table_extra_column_field_id",INTERACTIVE_BLOCKS:"interactive_blocks"},i={AGENT_IDS:"agent_ids"},s={CHANNEL_ID:"channel_id",CHANNEL_IDS:"channel_ids",DAYS:"days"},o={CANVAS_UPDATE_TYPE:"canvas_update_type",CHANNEL_ID:"channel_id",CANVAS_ID:"canvas_id",SECTION_ID:"section_id",ACTION:"action",CONTENT:"content"},c={CANVAS_UPDATE_TYPE:"canvas_update_type",CHANNEL_ID:"channel_id",CANVAS_ID:"canvas_id",SECTION_ID:"section_id",ACTION:"action",CONTENT:"content",CANVAS_TAB_SECTION_ID:"canvas_tab_section_id",CANVAS_TAB:"canvas_tab"},d={CANVAS_UPDATE_TYPE:"canvas_update_type",CHANNEL_ID:"channel_id",CANVAS_ID:"canvas_id",PLACEHOLDER_VALUES:"placeholder_values"}},0x12321ecbc:(e,t,a)=>{"use strict";a.d(t,{E:()=>getChannelLabel,k:()=>getUserLabel});var n=a(0xbad225b5),r=a(0x20482ad21),l=a(0x2501a2cee),i=a(0x1e74dc307),s=a(0x668181b3),o=a(0x2772625d),c=a(0x247cf31a2),d=a(0xf4097f62),u=a(0x1461e71d1),m=a.n(u);let p=new r.Ay("workflow_builder"),DynamicItemLabel=({label:e})=>n.createElement("span",{className:m().variable_container},n.createElement(l.Ah,{inline:!0,size:"inherit",name:"css"})," ",e??p.t("Missing Data"));DynamicItemLabel.displayName="DynamicItemLabel";let getUserLabel=(e,t)=>{if(e.length>1)return p.t("{qty} people",{qty:e.length,fallbackHash:"b37554f695b15005fd23907b9488e0a8ad4bca5f"});let a=e[0];return(0,o.cn)(a)?n.createElement(DynamicItemLabel,{label:(0,s.x)(t,a)?.label}):p.rt("@{user}",{user:n.createElement(d.A,{id:a,truncate:!0}),fallbackHash:"457d64a8b6c031bbf97653abb1689cab35c6261c"})};getUserLabel.displayName="getUserLabel";let getChannelLabel=(e,t)=>{if(e.length>1)return p.t("{qty} channels",{qty:e.length,fallbackHash:"18e03e2a37ba37df713f9665ef752fb8b40fc1e8"});let a=e[0];return(0,o.cn)(a)?n.createElement(DynamicItemLabel,{label:(0,s.x)(t,a)?.label}):n.createElement(i.A,{channelId:a},n.createElement(c.A,{channelId:a,truncate:!0}))};getChannelLabel.displayName="getChannelLabel"},0x24430233d:(e,t,a)=>{"use strict";a.d(t,{o:()=>getScheduleFrequencySummary});var n=a(0x20482ad21),r=a(0x1e864b930),l=a(0x124d99cb0),i=a(0x118af79e8);let s=new n.Ay("workflow_builder"),getScheduleFrequencySummary=e=>{let t,a=(0,l.lP)(e.startTime,e.timezone),n=(0,i.k)(e),o=a.isoWeekday();switch(n){case"daily":t=s.t("and repeats daily");break;case"weekdays":t=s.t("and repeats every weekday");break;case"weekly_same_day":t=s.t("and repeats weekly on {dayOfWeek}",{dayOfWeek:(0,l.au)(o,!0)});break;case"monthly_nth_day":t=(0,l.U7)((0,l.nA)(a,!0))(o);break;case"monthly":case"yearly":case"custom":t=(e=>{let t;if(!e.frequency)return"";let a=(0,l.lP)(e.startTime,e.timezone),{type:n,repeatsEvery:i=1,onDays:o,onWeekNum:c}=e.frequency,d=a.format("YYYY-MM-DD"),u=(0,l.Bz)(d),m=c??u,p=m?(0,l.fd)(m)?.(!0):(0,l.nA)(a,!0),b=(0,l.au)(a.isoWeekday(),!1),f=o?.map(e=>(0,l.U6)(e,!1));switch(n){case"hourly":t=1===i?s.t("and repeats hourly"):s.t("and repeats every {repeatsEvery, plural, =1 {hour} other {# hours}}",{repeatsEvery:i});break;case"daily":t=1===i?s.t("and repeats daily"):s.t("and repeats every {repeatsEvery, plural, =1 {day} other {# days}}",{repeatsEvery:i});break;case"weekly":t=f?s.t("and repeats every {repeatsEvery, plural, =1 {week} other {# weeks}} on {daysOfWeekList}",{repeatsEvery:i,daysOfWeekList:(0,r.A)(f).join("")}):s.t("and repeats on a custom schedule");break;case"monthly":t=o||c?s.t("and repeats every {repeatsEvery, plural, =1 {month} other {# months}} on the {dayOfWeekOrdinal} {dayOfWeek}",{repeatsEvery:i,dayOfWeekOrdinal:p,dayOfWeek:b}):1===i?s.t("and repeats monthly"):s.t("and repeats every {repeatsEvery, plural, =1 {month} other {# months}}",{repeatsEvery:i});break;case"yearly":t=1===i?s.t("and repeats annually"):s.t("and repeats every {repeatsEvery, plural, =1 {year} other {# years}}",{repeatsEvery:i});break;default:t=s.t("and repeats on a custom schedule")}return t})(e);break;default:t=""}return t}},0xdfa9cb32:(e,t,a)=>{"use strict";a.d(t,{M:()=>getScheduleSummary});var n=a(0x20482ad21),r=a(0x124d99cb0),l=a(0x24430233d),i=a(0x6960d8b9);let s=new n.Ay("workflow_builder"),getScheduleSummary=(e,t={})=>{let{do24hrTime:a}=t,n=(0,r.lP)(e.startTime,e.timezone),o=(0,i.Od)(n,{excludeYear:!0,uncapitalizedRelativeDay:!0}),c=(0,i.xe)(n,{do24hrTime:a}),d=(0,l.o)(e);return s.t("Starts {humanReadableDate} at {humanReadableTime}{repeat}",{humanReadableDate:o,humanReadableTime:c,repeat:d?` ${d}`:d,fallbackHash:"457f9c0427f3b60305b95dc44d845dc00aa06724"})}},0xab1e931b:(e,t,a)=>{"use strict";a.d(t,{Al:()=>c,I4:()=>isOptionLabelTooLong,N8:()=>titleIsValid,Ot:()=>optionIsValid,aA:()=>s,au:()=>o,fD:()=>questionIsValid,kg:()=>isOptionLabelTooShort,l4:()=>isTheSecondDuplicate,ud:()=>i});var n=a(0x18af67efb),r=a(0x1dde3f5ab),l=a(0xe53aa0);let i=24,s=125,o=125,c=75,isOptionLabelTooLong=e=>e.label?.length>c,isOptionLabelTooShort=e=>e.label?.trim?.()?.length===0,optionIsValid=e=>e.label?.trim?.()?.length>0&&e.label?.length<=c,titleIsValid=({dialogTitle:e,maxLength:t})=>e?.trim()?.length>0&&e?.length<=t;function findIndices(e,t=[]){let a=[],n=t.indexOf(e);for(;-1!==n;)a.push(n),n=t.indexOf(e,n+1);return a}function isTheSecondDuplicate(e,t,a){let n=findIndices(t,e.map(e=>(0,l.X)(e)?e.label:e.value));return!(n.length<=1)&&n.some(e=>e<a)}let questionIsValid=e=>{if(e.label?.trim()?.length===0||e.label?.length>s||e.description?.length>o)return!1;if((0,r.OW)(e.questionType)||(0,r.EI)(e.questionType)){let t;return!!e.options&&(!e.options.length||e.options.every(e=>optionIsValid(e))&&(t=e.options,(0,n.A)(t,e=>(0,l.X)(e)?e.label:e.value).length===t.length))}return!0}},0x146e4ebc8:(e,t,a)=>{"use strict";a.d(t,{V:()=>ActionBarForward});var n=a(0xbad225b5),r=a(0x16cf1da63),l=a(0x8601851c),i=a(0x40c0d834),s=a(0x20482ad21),o=a(0x344bb842),c=a(0x2501a2cee),d=a(0x4c96e5d9),u=a(0x11036d95f),m=a(0xe874a88a),p=a(0x22a29f141),b=a(0x1dfdeb1c8),f=a(0x1ec68d6a3),g=a(0xe747dd27);let h=(0,b.A)("salesHome.notifications.formatShare generated fetcher",(e,t,a)=>new m.S((n,r)=>{let{abortSignal:l,reason:i,...s}=a,o=(0,g.VA)(s);e((0,p.apiCall)({method:"salesHome.notifications.formatShare",args:o,abortSignal:l,reason:i})).then(e=>{n(e)}).catch(e=>{(0,f.default)({getState:t}).error(`API call to salesHome.notifications.formatShare
						with reason ${i} failed, initiated by generated fetcher`),r(e)})}));h.meta={name:"salesHomeNotificationsFormatShareFetcher",key:"createFetcherSalesHomeNotificationsFormatShareFetcher",description:"salesHome.notifications.formatShare generated fetcher"};var _=a(0x3711e82d),y=a(0x32d3ef3d),x=a(0xcea4a81c),v=a(0x113cdbbd7),E=a(0x1608420cc),k=a(0x103f48cb9),S=a(0x1506d547b),w=a(0xf7a922a4),C=a(0x181fc1a60);let A=(0,b.A)("salesHome.notifications.share generated fetcher",(e,t,a)=>new m.S((n,r)=>{let{abortSignal:l,reason:i,...s}=a,o=(0,g.VA)(s);e((0,p.apiCall)({method:"salesHome.notifications.share",args:o,abortSignal:l,reason:i})).then(e=>{n(e)}).catch(e=>{(0,f.default)({getState:t}).error(`API call to salesHome.notifications.share
						with reason ${i} failed, initiated by generated fetcher`),r(e)})}));A.meta={name:"salesHomeNotificationsShareFetcher",key:"createFetcherSalesHomeNotificationsShareFetcher",description:"salesHome.notifications.share generated fetcher"};var T=a(0x1d600678),I=a(0xa6b90d4b),N=a(0x24cf1145d),M=a(0x226892387);let F=new s.Ay("modernselling"),ForwardNotificationModal=e=>{let{createdTs:t,notificationType:a,isAdminCreated:l,msgOps:s,selectedChannelId:o,opportunityId:c,attachmentBlocks:d,salesforceRecord:u}=e,m=(0,r.wA)(),p="forward-sales-notification-dialog",b=F.t("Forward this notification");c&&(b=F.t("Forward this record update"));let f=F.t("Forward"),g=(0,n.useCallback)(()=>m((0,N.I)({channelOrMemberId:o,reason:p})).then(e=>{let a=m((0,I.A)({msgOps:s,channelId:e}))||[];return m(A({createdTs:t,channelId:e,...a.length&&{shareBlocks:a},reason:"sales-home-forward-notification",opportunityId:c}))}),[m,o,s,t,c]),h=(0,n.useMemo)(()=>({onClick:{enableClogAction:!0},elementName:"forward_notification_modal_btn",elementValue:t}),[t]),w=(0,n.useMemo)(()=>d&&n.createElement("div",{className:"c-message_attachment_v2"},n.createElement(k.A,{version2:!0}),n.createElement("div",null,n.createElement(E.A,{blocks:d,service:void 0,channelId:o,blocksContainerContext:v.pi.share_dialog}),u&&n.createElement("div",{className:"margin_top_100"},n.createElement(x.a,{entityState:y.w.enabled,size:y.S.expanded,record:u,showActionsBar:!1,isInteractive:!1})))),[d,u,o]),O=(0,M.d4)(e=>(0,T.x)(e,"salesforce_forwarding")?.default==="speedbump");return n.createElement(i.A,{eventId:_.EventId.LOB_SALES_HOME,uiComponentName:_.UiComponentName.LOB_NOTIFICATION_FORWARD_MODAL,channelId:o,lobNotificationType:a,isLobNotificationWorkflowAdmin:l},n.createElement(S.A,{...e,title:b,goButtonText:f,goButtonAutoClogProps:h,goHandler:g,dialogType:C.hs.NOTIFICATION,shareReason:p,notificationType:a,attachment:w,forwardingSpeedbumpEnabled:O}))};ForwardNotificationModal.displayName="ForwardNotificationModal";let O=(0,w.A)(ForwardNotificationModal);var L=a(0x11c82607b),D=a(0x46dbff89);let P=(0,L.Ay)("Opens the Forward Notification Modal",(e,t,a)=>{e((0,D.q)({element:n.createElement(O,a)}))});P.meta={name:"openForwardNotificationModal",key:"createThunkOpenForwardNotificationModal",description:"Opens the Forward Notification Modal"};let R=new s.Ay("modernselling"),ActionBarForward=({hasFocus:e,createdTs:t,notificationType:a,isAdminCreated:s,opportunityId:m})=>{let p=(0,r.wA)(),{maybeClosePeek:b}=(0,n.useContext)(u.Z),f=R.t("Forward notification");m&&(f=R.t("Forward record update"));let g=(0,n.useCallback)(()=>!e,[e]),y=(0,n.useCallback)(async e=>{e.stopPropagation();let n=await p(h({createdTs:t,opportunityId:m,reason:"sales-home-get-notification-blocks"}));if(n&&n.ok){let{content_blocks:e,attachment_blocks:r,salesforce_record:l}=n;p(P({createdTs:t,notificationType:a,isAdminCreated:s,contentBlocks:e,attachmentBlocks:r,salesforceRecord:l,opportunityId:m}))}b()},[p,t,m,b,a,s]),x=(0,n.useCallback)(()=>({onClick:{enableClogAction:!0},elementName:"forward_notification_action_bar",elementValue:t}),[t]);return(0,n.useEffect)(()=>{let e=new l.A;return e.bindAll([{keys:["f"],handler:y,filter:g,action:"keyup"}]),()=>e.reset()},[g,y]),n.createElement(i.A,{eventId:_.EventId.LOB_SALES_HOME,uiComponentName:_.UiComponentName.LOB_NOTIFICATION_ACTIONS_BAR,lobNotificationType:a,isLobNotificationWorkflowAdmin:s},n.createElement(d.Ay,{tip:f,position:"top"},n.createElement(o.A,{"aria-label":f,onClick:y,className:"c-message_actions__button",size:"small",autoClogProps:x()},n.createElement(c.Ah,{name:"share-message"}))))};ActionBarForward.displayName="ActionBarForward"},0x1090ee536:(e,t,a)=>{"use strict";a.d(t,{H:()=>ActionBarMore});var n=a(0xbad225b5),r=a(0x20482ad21),l=a(0x344bb842),i=a(0x99233ecb),s=a(0x4c96e5d9);let o=new r.Ay("modernselling"),ActionBarMore=({children:e,onMenuOpen:t,onMenuClose:a})=>{let r=(0,n.useCallback)(t=>n.createElement(i.Ay,t,e),[e]);return n.createElement(i.cQ,{onOpen:t,onClose:a,renderMenu:r,position:"left-bottom"},n.createElement(s.Ay,{tip:o.t("More actions"),position:"top"},n.createElement(l.A,{"aria-label":o.t("More actions"),className:"c-message_actions__button",size:"small",svgIconProps:{name:"ellipsis-vertical-filled"}})))};ActionBarMore.displayName="ActionBarMore"},0x21b980720:(e,t,a)=>{"use strict";a.d(t,{E:()=>ActionBar});var n=a(0xbad225b5),r=a(0x120c268ad),l=a.n(r);let ActionBar=({children:e,isVisible:t})=>n.createElement("div",{className:l()("p-sales_feed__action_bar",t&&"p-sales_feed__action_bar--visible")},n.createElement("div",{className:"c-message_actions__container"},n.createElement("div",{className:"c-message_actions__group",role:"group"},e)));ActionBar.displayName="ActionBar"},0x139d2f9a8:(e,t,a)=>{"use strict";a.d(t,{_:()=>useMenuItemCreator});var n=a(0xbad225b5),r=a(0x16cf1da63),l=a(0x20482ad21),i=a(0xf4097f62),s=a(0x13638bd77);let o=new l.Ay("modernselling"),useMenuItemCreator=e=>{let t=(0,r.wA)(),a=(0,n.useCallback)(()=>{t((0,s.b)({memberId:e}))},[t,e]);return{label:o.rt("Notification created by {admin}",{admin:n.createElement(i.A,{id:e})}),onSelect:a}};useMenuItemCreator.displayName="useMenuItemCreator"},0xcdc086ce:(e,t,a)=>{"use strict";a.d(t,{e:()=>useMenuItemEdit});var n=a(0xbad225b5),r=a(0x16cf1da63),l=a(0x20482ad21),i=a(0x156eec78a),s=a(0x139aa1a7),o=a(0xcefedbca);let c=new l.Ay("modernselling"),useMenuItemEdit=(e,t=!1)=>{let a=(0,i.Q)(),l=(0,r.wA)(),d=(0,n.useCallback)(()=>{e&&(a({viewType:t?s.D.SalesAdministration:s.D.SalesNotifications}),l((0,o.A)({workflowId:e,isAdmin:t})))},[e,a,l,t]),u=(0,n.useMemo)(()=>({onClick:{enableClogAction:!0},elementName:"lob_notifications_edit",workflowId:e,isLobNotificationWorkflowAdmin:t}),[t,e]);return{label:c.t("Edit notification conditions"),onSelect:d,autoClogProps:u}}},0xc77a8bc3:(e,t,a)=>{"use strict";a.d(t,{z:()=>useMenuItemMute});var n=a(0xbad225b5),r=a(0x20482ad21),l=a(0x10490d62c);let i=new r.Ay("modernselling"),useMenuItemMute=(e,t)=>{let a=(0,l.A)(),[r,s]=(0,n.useState)(t),o=(0,n.useCallback)(()=>{e&&a(e,!r).then(()=>{s(!r)})},[a,r,e]),c=i.t("Mute notification"),d=i.t("Unmute notification");return{label:r?d:c,onSelect:o}}},0x23b93d6d0:(e,t,a)=>{"use strict";a.d(t,{Z:()=>FeedItemScheduled});var n=a(0xbad225b5),r=a(0x20482ad21),l=a(0xb90d5858),i=a(0x2501a2cee),s=a(0x21b980720),o=a(0x1090ee536),c=a(0x139d2f9a8),d=a(0xcdc086ce),u=a(0xc77a8bc3),m=a(0x1e5093c5a),p=a(0xfca33088),b=a(0xbf61ff25);let f=new r.Ay("modernselling"),FeedItemScheduled=({notification:e,isWorkflowPreview:t,isStepPreview:a,...r})=>{let{is_acn:g,is_workflow_deleted:h,is_workflow_editable:_,is_workflow_muted:y,notification_display_columns:x,notification_display_type:v,payload:{opportunities:E,generic_records:k,workflow:S},workflow_created_by:w,workflow_id:C,salesforce_org_id:A,created_ts:T}=e,I=(0,u.z)(C,y),N=(0,d.e)(C,g),M=(0,c._)(w),F=(0,n.useMemo)(()=>n.createElement(i.Ah,{name:"calendar"}),[]),O=(0,n.useCallback)(({isVisible:e,onMenuOpen:t,onMenuClose:a})=>{let r=g&&!!C&&!h,i=_&&!h;return r||i||g?n.createElement(s.E,{isVisible:e},n.createElement(o.H,{onMenuOpen:t,onMenuClose:a},r&&n.createElement(l.A,{onSelected:I.onSelect},I.label),i&&n.createElement(l.A,{onSelected:N.onSelect,autoClogProps:N.autoClogProps},N.label),g&&n.createElement(l.A,{className:"padding_top_75",description:M.label,onSelected:M.onSelect}))):null},[g,C,I,N,M,_,h]),L=(0,n.useCallback)(()=>{let e=k?.length?k:E;return x?.length&&e?.length&&S?.subtitle?n.createElement(p.N,{columns:x,displayType:v,records:e,title:S.subtitle,workflowId:C,salesforceOrgId:A,notificationCreatedTs:T,isWorkflowPreview:t,isStepPreview:a}):null},[k,E,x,S.subtitle,v,C,A,T,t,a]);return n.createElement(m.G,{...r,headerIcon:F,headerText:f.t("Scheduled"),iconFallbackUrl:b,notification:e,renderActionBar:O,renderMore:L,isWorkflowPreview:t,isStepPreview:a})};FeedItemScheduled.displayName="FeedItemScheduled"},0x1e5093c5a:(e,t,a)=>{"use strict";a.d(t,{G:()=>FeedItem});var n=a(0xbad225b5),r=a(0x16cf1da63),l=a(0x120c268ad),i=a.n(l),s=a(0x14fad6485),o=a(0x40c0d834),c=a(0x1faa3f1ac),d=a(0x113cdbbd7),u=a(0x944e06df),m=a(0x754ea859),p=a(0x184825275),b=a(0x6960d8b9),f=a(0xc0b7c558);let FeedItem=({hasFocus:e,headerIcon:t,headerText:a,headerLinkUrl:l,iconFallbackUrl:g,isFirst:h,notification:_,renderActionBar:y,renderInlineActions:x,renderMore:v,withHeaderWrapper:E,isWorkflowPreview:k,isStepPreview:S})=>{let{body:w,workflow_id:C,created_ts:A,icon_url:T,is_unread:I,salesforce_org_id:N,payload:{workflow:{title:M,service_id:F,service_team_id:O},opportunities:L=[],records:D=[]}}=_,{windowRef:P}=(0,n.useContext)(s._0),R=(0,n.useRef)(null),[B,W]=(0,n.useState)(!1),[V,q]=(0,n.useState)(!1),H=e||B||V,U=(0,r.wA)(),z=(0,n.useCallback)(()=>{W(!0)},[]),j=(0,n.useCallback)(()=>{W(!1)},[]),$=(0,n.useCallback)(()=>{q(!0)},[]),G=(0,n.useCallback)(()=>{q(!1),P.deref()?.requestAnimationFrame(()=>{W(R.current?.matches(":hover")===!0)})},[P]),K=(0,n.useCallback)(()=>{let e=L.length?L[0]?.slack_record_id:(0,f.j)(N,D[0].record_identifier);e&&U((0,m.c)({recordId:e}))},[U,L,D,N]),Y=(0,n.useMemo)(()=>{let e=n.createElement("div",{className:i()("display_flex align_items_center",{sk_foreground_max:!I,sk_primary_foreground:I,bold:I})},t,n.createElement("div",{className:"caption margin_left_25 margin_right_25"},a));if(l){let t=L.length||D.length&&N;e=n.createElement(c.A,{className:"p-sales_feed__item__header__link",href:t?"":l,target:"_blank",onClick:t?K:void 0},e)}return E&&(e=E(e)),e},[I,t,a,l,E,K,L,D,N]),Q=(0,n.useMemo)(()=>({hasFocus:e,isVisible:H,onMenuOpen:$,onMenuClose:G}),[G,$,e,H]),Z=(0,n.useCallback)(e=>{let t={serviceId:F,serviceTeamId:O,container:{type:d.pi.lob_notification,notificationTs:A},actions:[e]};return U((0,p.W)(t))},[F,O,A,U]);return n.createElement(o.A,{clogImpression:!0,elementName:"lob_sales_notification_item",elementValue:A,workflowId:C},n.createElement("div",{ref:R,onPointerOver:z,onPointerLeave:j,className:i()("p-sales_feed__item",{"p-sales_feed__item--first":h,"p-sales_feed__item--preview":k,"p-sales_feed__item--no-border":k&&!S})},n.createElement("div",{className:i()("p-sales_feed__item__inner",{"p-sales_feed__item__inner--preview":k})},!k&&n.createElement("div",{className:"display_flex justify_content_between align_items_center"},Y,n.createElement("div",{className:"display_flex align_items_center"},n.createElement("div",{className:i()("caption",{bold:I})},(0,b.Yq)(A,"{status_expiration}")),I&&n.createElement("div",{className:"p-sales_feed__item__unread_dot"}))),n.createElement("div",{className:i()("display_flex",{margin_top_50:!k})},n.createElement("img",{className:"p-sales_feed__item__icon",src:T||g,alt:M}),n.createElement("div",{className:"flex_one display_flex"},n.createElement("div",{className:"flex_one"},n.createElement("div",{className:"sk_primary_foreground black"},M),n.createElement(u.A,{blocks:w,blocksContainerContext:d.pi.sales_home_notification,onAction:Z}),v?.()),x&&n.createElement("div",{className:"flex_shrink_none"},x()))),y?.(Q))))};FeedItem.displayName="FeedItem"},0x129529b49:(e,t,a)=>{"use strict";a.d(t,{E:()=>OpportunityHoverCardTrigger});var n=a(0xbad225b5),r=a(0x1cbdfeceb),l=a(0x217f0c263),i=a(0x14fad6485),s=a(0x1f3598f80),o=a(0xc745739a),c=a(0x20482ad21),d=a(0x2b7f0bcc),u=a(0x102edf836),m=a(0x11a296110),p=a(0x1ee57b3a0),b=a(0x1fa67866c),f=a(0xb1ea448c),g=a(0x128d54e52),h=a(0x1535e80f3),_=a(0x15fb82076),y=a(0x2501a2cee),x=a(0x4c96e5d9),v=a(0x12b6a33fc),E=a(0x16cf1da63),k=a(0xe874a88a),S=a(0x22a29f141),w=a(0x1dfdeb1c8),C=a(0x1ec68d6a3),A=a(0xe747dd27);let T=(0,w.A)("sfdc.getOpportunity generated fetcher",(e,t,a)=>new k.S((n,r)=>{let{abortSignal:l,reason:i,...s}=a,o=(0,A.VA)(s);e((0,S.apiCall)({method:"sfdc.getOpportunity",args:o,abortSignal:l,reason:i})).then(e=>{n(e)}).catch(e=>{(0,C.default)({getState:t}).error(`API call to sfdc.getOpportunity
						with reason ${i} failed, initiated by generated fetcher`),r(e)})}));function useFetchOpportunityInfo(){let e=(0,E.wA)();return(0,n.useCallback)((t,a)=>e(T({id:t,reason:"sales-home-get-opportunity-info",salesforceOrgId:a})),[e])}T.meta={name:"sfdcGetOpportunityFetcher",key:"createFetcherSfdcGetOpportunityFetcher",description:"sfdc.getOpportunity generated fetcher"};var I=a(0x1c659cbb1),N=a(0x110b4f809),M=a(0xe38b5635),F=a(0x1ed767a16),O=a(0x6960d8b9),L=a(0x226892387),D=a(0x1c8beab7f);let P=a.p+"crown-f27246b.svg",R=new c.Ay("modernselling"),B={elementName:"open_in_salesforce",onClick:{enableClogAction:!0}},W={elementName:"copy_opportunity_link",onClick:{enableClogAction:!0}},V=new RegExp(/\bhttps?:\/\/[^\s]+\b/g),OpportunityNextStep=({nextStep:e})=>{let t=e.split(V),a=e.match(V)||[],r=t.reduce((e,t,r)=>{if(e.push(t),r<a.length){let t=a[r];e.push(n.createElement(_.A,{key:r+t,href:t}))}return e},[]);return n.createElement(n.Fragment,null,r)};OpportunityNextStep.displayName="OpportunityNextStep";let OpportunityHoverCard=({opportunity:e,record:t,salesforceOrgId:a})=>{let r,l=e?.id??t?.record_identifier,i=e?.record_link??t?.record_link,s=useFetchOpportunityInfo(),o=(0,L.d4)(D.cc),[c,_]=(0,n.useState)(),[E,k]=(0,n.useState)(!0),[S,w]=(0,n.useState)(!1),[C,A]=(0,N.A)(!1,2e3);(0,n.useEffect)(()=>{l&&s(l,a).then(e=>{_(e)}).catch(()=>{w(!0)}).finally(()=>{k(!1)})},[s,l,a]);let T=(0,n.useCallback)(()=>n.createElement(I.f1,{className:"p-sales_feed__opp_hover_card_avatar",size:36,imageUrl:P,isInteractive:!1}),[]),V=(0,n.useCallback)(()=>n.createElement(I.Ay,{className:"c-base_entity__avatar",size:h.RG.small,userId:e?.owner.slack_user_id,isInteractive:!1,tabIndex:-1,ariaHidden:!0}),[e]),q=(0,n.useCallback)(()=>{(0,F.x3)(i),A(!0)},[i,A]),H=o.length>1?o.find(e=>e.salesforce_org_id===a)?.name:void 0;return r=c?H?c.account?.name?R.rt("Opportunity in {account_name}, <b>{salesforceOrgName}</b>",{account_name:c.account.name,salesforceOrgName:H}):R.rt("Opportunity in <b>{salesforceOrgName}</b>",{salesforceOrgName:H}):c.account?.name?R.t("Opportunity in {account_name}",{account_name:c.account.name}):R.t("Opportunity"):H?R.rt("Opportunity in <b>{salesforceOrgName}</b>",{salesforceOrgName:H}):"Opportunity",n.createElement(M.A,{elevation:4,size:"medium",className:"p-sales_feed__opp_hover_card"},E&&n.createElement(b.A,{className:"margin_top_200"},n.createElement(f.A,{size:"jumbo"})),S&&n.createElement(b.A,null,n.createElement(d.Ay,{type:"boxed",level:"error",className:"margin_bottom_150"},R.rt("Oops\u2026 we had trouble fetching opportunity info"))),c&&n.createElement(n.Fragment,null,n.createElement(p.A,null,n.createElement(g.Ay,{size:"medium",avatar:T,text:n.createElement(g.CG,{className:"black",withTruncationTooltip:!0},c.name),subtext:n.createElement(g.sT,{className:"caption p-sales_feed__opp_hover_card_header_subtext"},r)})),n.createElement(b.A,null,n.createElement("div",{className:"p-sales_feed__opp_hover_card_details_container"},n.createElement("div",{className:"p-sales_feed__opp_hover_card_stage_details"},n.createElement("div",{className:"p-sales_feed__opp_hover_card_details_label"},R.t("Stage")),n.createElement("div",{className:"p-sales_feed__opp_hover_card_stage_details_pill"},c.stage)),n.createElement("div",{className:"p-sales_feed__opp_hover_card_details"},n.createElement("div",{className:"p-sales_feed__opp_hover_card_details_label"},R.t("Close date")),(0,O.Yq)((0,O.$4)(c.close_date,{parseFormat:"YYYY-MM-DD",returnMoment:!0}),"{date_slash}")),n.createElement("div",{className:"p-sales_feed__opp_hover_card_details"},n.createElement("div",{className:"p-sales_feed__opp_hover_card_details_label"},R.t("Amount")),c.amount.display_value),n.createElement("div",{className:"p-sales_feed__opp_hover_card_owner_details"},n.createElement("div",{className:"p-sales_feed__opp_hover_card_details_label"},R.t("Owner")),n.createElement(g.Ay,{avatar:V,className:"c-member c-member--small",text:n.createElement("span",{className:"c-member__primary_content"},n.createElement(g.CG,{className:"c-member_name"},c.owner.name)),size:"small"}))),""!==c.next_step?n.createElement("div",{className:"p-sales_feed__opp_hover_card_next_steps_details"},n.createElement("div",{className:"p-sales_feed__opp_hover_card_details_label"},R.t("Next Step")),n.createElement(OpportunityNextStep,{nextStep:c.next_step})):null,n.createElement("div",{className:"p-sales_feed__opp_hover_card_actions"},n.createElement(u.z9,{className:"p-sales_feed__opp_hover_card_linkbutton",size:"medium",type:"outline",href:i,autoClogProps:B},n.createElement("span",{className:"p-sales_feed__opp_hover_card_linkbutton_text"},R.t("Open in Salesforce")),n.createElement(y.Ah,{inline:!0,name:"new-window"})),n.createElement(x.Ay,{tip:C?R.t("Copied!"):R.t("Copy link"),status:C?v.YU.Success:v.YU.Info},n.createElement(m.Ay,{className:"p-sales_feed__opp_hover_card_copybutton",size:"medium",type:"outline",onClick:q,autoClogProps:W,"aria-label":C?R.t("Copied"):R.t("Copy Salesforce Url")},n.createElement(y.Ah,{name:"files"})))))))};OpportunityHoverCard.displayName="OpportunityHoverCard";let OpportunityHoverCardTrigger=({children:e,opportunity:t,record:a,salesforceOrgId:c})=>{let{windowRef:d}=(0,n.useContext)(i._0),[u,m]=(0,n.useState)(null),p=(0,n.useRef)(null),b=(0,n.useCallback)(()=>{let e=(e=>{let{pageYOffset:t,innerWidth:a,innerHeight:n}=e.deref()||{pageYOffset:0,innerWidth:0,innerHeight:0};return{top:(0,o.ci)(t+10),right:a-16,bottom:t+n-10,left:16}})(d),t=p.current.getBoundingClientRect(),a={top:void 0,bottom:void 0,right:void 0,left:void 0},n=t.right+345>e.right,r=t.bottom+250>e.bottom,l=t.top-250<e.top;if(n){let n=e.right-(t.left+345)<0;r&&l?(a.top=t.bottom+12,a.right=e.right-t.left+25):(r?a.bottom=e.bottom-t.y+12:l?a.top=t.bottom+12:a.bottom=e.bottom-t.y+25,a.left=t.left),n&&(a.right=12,a.left="auto")}else l&&r?(a.top=t.top-100,a.left=t.right+12):r?(a.left=t.left,a.bottom=e.bottom-t.y+25):l?(a.top=t.bottom+12,a.left=t.left):(a.left=t.right+12,a.top=t.top);return a},[d]),f=(0,n.useCallback)(()=>{m(null)},[]),g=(0,n.useCallback)(()=>{let e=b();m(n.createElement(l.A,{isOpen:!0,className:"opportunity-hover-modal",overlayClassName:"p-sales_feed__opportunity_hover_card__modal",shouldFocusAfterRender:!0,shouldCloseOnEsc:!0,onRequestClose:f},n.createElement("div",{className:"p-sales_feed__opportunity_hover_card__popover",style:e},n.createElement(OpportunityHoverCard,{record:a,opportunity:t,salesforceOrgId:c}))))},[b,a,t,f,c]),[h,_]=(0,s.i)(g),[y,x]=(0,s.i)(f),v=(0,n.useCallback)(()=>(x(),u)?void _():h(350),[x,h,_,u]),E=(0,n.useCallback)(()=>(_(),u)?y(250):void x(),[_,y,x,u]);return n.createElement("span",{className:"p-sales_feed__opportunity_hover_card",onMouseOver:v,onMouseLeave:E,onClick:v,role:"presentation",onFocus:r.A,ref:p},e,u)};OpportunityHoverCardTrigger.displayName="OpportunityHoverCardTrigger"},0xfca33088:(e,t,a)=>{"use strict";a.d(t,{N:()=>R});var n=a(0xbad225b5),r=a(0x120c268ad),l=a.n(r),i=a(0x11a296110),s=a(0x2501a2cee),o=a(0x1fdec3e16),c=a(0x16cf1da63),d=a(0x77727995),u=a(0x130d89881),m=a(0x1a043bf26),p=a(0x20482ad21),b=a(0x1d104c491),f=a(0x2493ba930),g=a.n(f);let h=new p.Ay("workflow_builder");function getColumnSortField(e){return e.sort_payload_field??e.payload_field}let getGenericRecordValue=(e,t)=>{let a=(0,d.A)(e.record_fields,t.key);return a.record_field_sort_value??a.record_field_rendered_value},isGenericRecord=e=>"record_identifier"in e&&void 0!==e.record_identifier;function getRecordKey(e){return isGenericRecord(e)?e.record_identifier:e.id}function getRecordName(e){return isGenericRecord(e)?e.record_name??h.t("Missing Data"):e.name}function getObjectType(e){return isGenericRecord(e)?e.object_identifier:b.Dj.Opportunity}function getRecordField(e,t){return isGenericRecord(e)?getGenericRecordField(e,t)??h.t("Missing Data"):e[t]}function getGenericRecordField(e,t){return e.record_fields[t]?.record_field_rendered_value}function getInitialSortByValue(e){let t=e.find(e=>e.primary_sort)||e[0],a=t?.primary_sort?.toLowerCase();return{key:getColumnSortField(t),dir:"desc"===a||"descending"===a?"desc":"asc"}}function getDisplayTypeClassNames(e){return{text:g()[`${e}_text`]||g().standard_text,border:g()[`${e}_border`]||g().standard_border,borderDark:g()[`${e}_border_dark`]||g().standard_border_dark,lightText:g()[`${e}_light_text`]||g().standard_light_text,background:g()[`${e}_background`]||g().standard_background}}function RecordsListTableHeader({column:e,displayType:t,isSortAsc:a,isSortKey:r,onClick:c}){let d=getDisplayTypeClassNames(t);return n.createElement(i.Nm,{onClick:c,className:l()(g().records_list_table_cell,g().records_list_table_cell_header,d.text)},n.createElement(o.A,{withTooltip:!0,lines:1},e.name),r&&n.createElement(s.Ah,{name:a?"arrow-up":"arrow-down",size:"16"}))}RecordsListTableHeader.displayName="RecordsListTableHeader";let _=new p.Ay("modernselling");function RecordsListTablePagination({pageRange:[e,t],totalItems:a,autoClogProps:r,onNextClick:l,onPrevClick:o}){return n.createElement("div",{className:g().records_list_table_pagination},n.createElement(i.Nm,{"aria-label":_.t("Previous page"),autoClogProps:r,disabled:!o,onClick:o},n.createElement(s.Ah,{name:"caret-left",size:"16"})),n.createElement("span",null,_.t("Showing {start}-{end} of {totalItems}",{start:e+1,end:t,totalItems:a})),n.createElement(i.Nm,{"aria-label":_.t("Next page"),autoClogProps:r,disabled:!l,onClick:l},n.createElement(s.Ah,{name:"caret-right",size:"16"})))}RecordsListTablePagination.displayName="RecordsListTablePagination";var y=a(0x4c96e5d9),x=a(0x146e4ebc8),v=a(0x174bb7323),E=a(0x1faa3f1ac),k=a(0x1feb18f19),S=a(0x129529b49),w=a(0x11928a844),C=a.n(w);let Stage=e=>n.createElement("div",{className:l()(C().stage,{[C().previous]:"previous"===e.type,[C().current]:"current"===e.type})},n.createElement(o.A,{lines:1,withTooltip:!0},e.children));Stage.displayName="Stage";var A=a(0x113cdbbd7),T=a(0x944e06df),I=a(0x81d6854c),N=a(0xf01a9d50);let M=new p.Ay("modernselling");function MaybeHoverCard({record:e,children:t,shouldHide:a,salesforceOrgId:r}){return a||isGenericRecord(e)?n.createElement(n.Fragment,null,t):n.createElement(S.E,{opportunity:e,salesforceOrgId:r},t)}function MaybeLink({record:e,children:t,shouldHide:a}){return a?n.createElement(n.Fragment,null,t):n.createElement(E.A,{href:e.record_link},t)}MaybeHoverCard.displayName="MaybeHoverCard",MaybeLink.displayName="MaybeLink";let renderRecordDeltaValue=e=>{if(isGenericRecord(e)||!e.amount_change||!e.amount_change_raw)return null;let t=e.amount_raw?.amount||0,a=e.amount_change_raw.amount,r=e.amount_change_raw.percent,l=!t&&100===r,i=`${l?"-":""}${r}%`;return 0x7fffffff===r&&(i=M.t("New")),n.createElement("div",{className:l||a<0?g().amount_change_negative:g().amount_change_positive},n.createElement(o.A,{lines:1,withTooltip:!0},n.createElement("span",{className:"bold"},e.amount_change),n.createElement("span",null," (",i,")")))};renderRecordDeltaValue.displayName="renderRecordDeltaValue";let renderRecordNameValue=(e,t,{isPreview:a,showHoverCard:r},l)=>n.createElement(MaybeHoverCard,{record:e,shouldHide:a||!r,salesforceOrgId:l},n.createElement(MaybeLink,{record:e,shouldHide:!r},n.createElement(E.A,null,n.createElement(o.A,{lines:1},n.createElement(s.Ah,{inline:!0,...(0,N.C)(getObjectType(e))}),n.createElement("span",{className:"margin_left_25 bold"},getRecordName(e)))))),renderOpportunityRecordStageChangeValue=e=>n.createElement(k.c,{space:"75"},n.createElement(Stage,{type:"previous"},e.prev_stage),n.createElement(s.Ah,{name:"arrow-right"}),n.createElement(Stage,{type:"current"},e.stage));renderOpportunityRecordStageChangeValue.displayName="renderOpportunityRecordStageChangeValue";let renderOpportunityRecordRichTextValue=(e,t)=>"close_date_change"===t.payload_field?n.createElement(T.A,{blocks:e.close_date_change?.blocks,blocksContainerContext:A.pi.sales_home_notification}):n.createElement(k.c,{space:"75"},n.createElement(I.A,null));renderOpportunityRecordRichTextValue.displayName="renderOpportunityRecordRichTextValue";let renderOpportunityRecordStageValue=e=>n.createElement(Stage,{type:"current"},e.stage);renderOpportunityRecordStageValue.displayName="renderOpportunityRecordStageValue";let renderRecordValueAsString=(e,t)=>n.createElement(o.A,{lines:1,withTooltip:!0},n.createElement("span",{className:t.primary_sort?"bold":void 0},(0,v.A)(getRecordField(e,t.payload_field))));function renderRecordValue(e,t,a,n){return isGenericRecord(e)?renderGenericRecordValue(e,t,a):renderOpportunityRecordValue(e,t,a,n)}function renderOpportunityRecordValue(e,t,a,n){switch(t.type){case"name":return renderRecordNameValue(e,t,a,n);case"stage":return renderOpportunityRecordStageValue(e);case"stage_change":return renderOpportunityRecordStageChangeValue(e);case"rich_text":return renderOpportunityRecordRichTextValue(e,t);case"delta":return renderRecordDeltaValue(e,t,a);default:return renderRecordValueAsString(e,t,a)}}function renderGenericRecordValue(e,t,a,n){return"name"===t.type?renderRecordNameValue(e,t,a,n):renderRecordValueAsString(e,t,a)}let F=new p.Ay("modernselling");function RecordsListTableRow({columns:e,isFocused:t,isPreview:a,record:r,salesforceOrgId:i,notificationCreatedTs:s,isLastRow:o,isWorkflowPreview:c}){let[d,u]=(0,n.useState)(!1),m=(0,n.useMemo)(()=>{if(a)return[];let e=getRecordKey(r);return[{key:"opportunity-share-button",enabled:!!s,render:()=>e&&s&&n.createElement(x.V,{hasFocus:!!t,createdTs:s,notificationType:"record",isAdminCreated:!0,opportunityId:e})}].filter(({enabled:e=!0})=>e)},[a,r,s,t]),p=!a&&m.length>0,b=(0,n.useCallback)(()=>u(!0),[]),f=(0,n.useCallback)(()=>u(!1),[]),h=!a,_=n.createElement("div",{onPointerOver:b,onPointerLeave:f,className:l()(g().records_list_table_row,g().records_list_table_row_body,{[g().records_list_table_row_border]:!o}),style:h?{cursor:"pointer"}:void 0},e.map(t=>c?n.createElement("div",{key:t.name,className:l()(g().records_list_table_cell,g().preview_table_cell,getDisplayTypeClassNames("standard").background)}):n.createElement("div",{key:t.name,className:l()(g().records_list_table_cell,{[g().records_list_table_cell_2_col]:2===e.length})},renderRecordValue(r,t,{isPreview:a,showHoverCard:!1},i))),p&&n.createElement("div",{className:l()(g().records_list_action_bar_container,p&&(t||d)&&g().records_list_action_bar_container_visible)},m.map(({key:e,render:t})=>n.createElement(n.Fragment,{key:e},t()))));return h?n.createElement(y.Ay,{tip:F.t("Open Record"),position:"top"},_):_}RecordsListTableRow.displayName="RecordsListTableRow";var O=a(0x106809bc6);function getPageRange(e,t,a){return[(0,O.A)(e,0,a-1),(0,O.A)(e+t,t,a)]}function usePagination(e,{pageSize:t}){let[a,r]=(0,n.useState)(0);(0,n.useEffect)(()=>r(0),[t]);let l=e.length,i=Math.ceil(l/t),s=a>=t,o=a<l-t,c=(0,n.useCallback)(()=>r(0),[]),d=(0,n.useCallback)(()=>r(e=>e-t),[t]),u=(0,n.useCallback)(()=>r(e=>e+t),[t]),m=(0,n.useMemo)(()=>getPageRange(a,t,l),[a,t,l]);return{page:(0,n.useMemo)(()=>e.slice(...m),[e,m]),prev:s?d:void 0,next:o?u:void 0,range:m,reset:c,totalPages:i}}var L=a(0x754ea859),D=a(0xc0b7c558);function RecordsListTable({columns:e,displayType:t,isPreview:a,records:r,paginationAutoClogProps:i,salesforceOrgId:s,notificationCreatedTs:o,isWorkflowPreview:p,isStepPreview:b}){let[f,h]=(0,n.useState)(!1),[_,y]=(0,n.useState)(()=>getInitialSortByValue(e)),x=getDisplayTypeClassNames(t),{page:v,reset:E,...k}=usePagination((0,n.useMemo)(()=>p?[...r]:[...r].sort((e,t)=>{let a="asc"===_.dir,n=isGenericRecord(e)?getGenericRecordValue(e,_):(0,d.A)(e,_.key),r=isGenericRecord(t)?getGenericRecordValue(t,_):(0,d.A)(t,_.key);return("string"==typeof n&&"string"==typeof r&&(n=n.toLocaleUpperCase(),r=r.toLocaleUpperCase()),void 0===n)?1:void 0===r?-1:n<r?a?-1:1:n>r?a?1:-1:0}),[p,r,_]),{pageSize:5}),S=(0,n.useCallback)(e=>()=>{E(),y(({key:t,dir:a})=>({key:e,dir:e===t&&"asc"===a?"desc":"asc"}))},[E]),w=(0,n.useCallback)(e=>{let a=getColumnSortField(e);return n.createElement(RecordsListTableHeader,{key:e.name,column:e,displayType:t,isSortAsc:"asc"===_.dir,isSortKey:!p&&a===_.key,onClick:S(a)})},[_,S,t,p]),C=(0,n.useCallback)((r,{hasFocus:l,hasFocusWithin:i})=>n.createElement(RecordsListTableRow,{key:getRecordKey(v[r]),columns:e,displayType:t,isFocused:l||i,isPreview:a,record:v[r],salesforceOrgId:s,notificationCreatedTs:o,isLastRow:r===v.length-1,isWorkflowPreview:p}),[v,e,t,a,s,o,p]),A=(0,n.useCallback)(()=>h(!0),[]),T=(0,n.useCallback)(()=>h(!1),[]),I=(0,c.wA)(),N=(0,n.useCallback)(e=>{I((0,L.c)({recordId:v[e.id].slack_record_id??(0,D.j)(s,getRecordKey(v[e.id]))}))},[I,v,s]);return n.createElement("div",{onPointerOver:A,onPointerLeave:T,className:l()(x.background,g().records_list_table,{[g().records_list_table_workflow_preview]:p,[g().records_list_table_workflow_step_preview]:b})},n.createElement("div",{className:g().records_list_table_row},e.map(w)),n.createElement(u.A,{disableHeight:!0},({width:e})=>n.createElement(m.A,{keys:Object.keys(v),width:e,height:51*v.length,rowRenderer:C,onItemClick:a?void 0:N,containerClassName:l()(g().records_list_table_rows_container,f&&!p?x.borderDark:x.border)})),k.totalPages>1&&n.createElement(RecordsListTablePagination,{pageRange:k.range,totalItems:r.length,autoClogProps:i,onNextClick:k.next,onPrevClick:k.prev}))}RecordsListTable.displayName="RecordsListTable";var P=a(0x3711e82d);let R=n.memo(({columns:e,displayType:t="standard",isWorkflowPreview:a,isExpandedByDefault:r=a,isPreview:c,isStepPreview:d,records:u,title:m,workflowId:p,salesforceOrgId:b,notificationCreatedTs:f})=>{let[h,_]=(0,n.useState)(r),y=(0,n.useCallback)(()=>_(e=>!e),[]),x=getDisplayTypeClassNames(t),v=(0,n.useCallback)(e=>{if(!c)return{onClick:{enableClogAction:!0},eventId:P.EventId.LOB_NOTIFICATIONS,elementName:e,workflowId:p}},[p,c]);return n.createElement("div",{className:l()(g().records_list_container,{[g().preview_not_expanded]:a&&!h})},n.createElement(i.Nm,{autoClogProps:v("expand_notification"),className:l()(x.text,x.background,g().records_list_toggle,h&&g().records_list_toggle_expanded),onClick:y},n.createElement(s.Ah,{name:h?"caret-down-filled":"caret-right-filled",size:"20"}),a?n.createElement(o.A,{withTooltip:!0,lines:1},n.createElement("span",{className:g().records_list_title},m)):n.createElement(n.Fragment,null,n.createElement("span",{className:g().records_list_title},m),n.createElement("span",{className:x.text},u.length))),h&&n.createElement(RecordsListTable,{columns:e,displayType:t,isPreview:c,records:u,paginationAutoClogProps:v("show_more"),salesforceOrgId:b,notificationCreatedTs:f,isWorkflowPreview:a,isStepPreview:d}))})},0x1c2513fa3:(e,t,a)=>{"use strict";a.d(t,{y:()=>BaseActionLibraryModal});var n,r=a(0xbad225b5),l=a(0x16cf1da63),i=a(0x120c268ad),s=a.n(i),o=a(0x14fad6485),c=a(0x20482ad21),d=a(0x189615fa),u=a(0x2b7f0bcc),m=a(0x15fb82076),p=a(0x1b88224f9),b=a(0xe874a88a),f=a(0x22a29f141),g=a(0x1dfdeb1c8),h=a(0x1ec68d6a3),_=a(0xe747dd27);let y=(0,g.A)("platform.requests.create generated fetcher",(e,t,a)=>new b.S((n,r)=>{let{abortSignal:l,reason:i,...s}=a,o=(0,_.VA)(s);e((0,f.apiCall)({method:"platform.requests.create",args:o,abortSignal:l,reason:i})).then(e=>{n(e)}).catch(e=>{(0,h.default)({getState:t}).error(`API call to platform.requests.create
						with reason ${i} failed, initiated by generated fetcher`),r(e)})}));y.meta={name:"platformRequestsCreateFetcher",key:"createFetcherPlatformRequestsCreateFetcher",description:"platform.requests.create generated fetcher"};var x=a(0x226892387),v=a(0x110d7b067),E=a(0x19561ce96),k=a(0x184767f39);let S=new c.Ay("workflow_builder"),{READY:w,CONFIGURATION_MISSING:C,CONFIGURATION_REQUESTED:A}=k.aW;function StepConfigurationRequiredBanner({id:e,appName:t,is3pTrigger:a=!1,displaySimpleAlert:n,className:i="",icon:s}){let o,c=(0,l.wA)(),[d,b]=(0,r.useState)(!1),[f,g]=(0,r.useState)(!1),h=e??"",[_,k]=(0,r.useState)(!1),[T,I]=(0,r.useState)(!1),N=(0,r.useCallback)(()=>I(!0),[I]),M=(0,r.useCallback)(async()=>{let e;try{g(!0),e=await c(y({requestType:"connector_config_request",entityId:h,reason:"request-step-configuration-within-workflow-builder"})).finally(()=>{g(!1)})}catch(e){b(!0)}e||b(!0),k(!0),c((0,v.yu)({appId:h})),I(!1)},[h,c]),F=(0,r.useCallback)(()=>I(!1),[I]),O=(0,x.d4)(e=>(0,E.$E)(e,h));if(O===w)return null;switch(_?A:O){case C:o=S.rt("{category} {type} require configuration. <button>Request help from an admin</button>",{category:t,type:a?"events":"steps"},({tag:e,text:t})=>"button"===e?r.createElement(m.A,{onClick:N},t):null);break;case A:o=S.rt("{category} {type} require configuration. Your Admin has already been notified.",{category:t,type:a?"events":"steps",fallbackHash:"084c0ae4b9cb4eaf927e434b8166b6ea80efd100"});break;default:o=""}let L=S.rt("There was an error while requesting a configuration. Please try again or let us know if this happens again.");return n?r.createElement(u.Ay,{icon:s,type:s?u.QE.boxed:u.QE.inline,level:u.A_.warning,align:u.AO.left,className:i},r.createElement("span",null,S.rt("{category} {type} require admin configuration.",{category:t,type:a?"events":"steps",fallbackHash:"17a07273a9e2d38955d32bf2e9d7bb6571b8caae"}))):r.createElement("div",null,r.createElement(u.Ay,{icon:s,type:s?u.QE.boxed:u.QE.inline,level:d?u.A_.error:u.A_.warning,align:u.AO.left,className:`${i} margin_top_100 margin_bottom_100 margin_right_50`},r.createElement("span",null,d?L:o)),T&&r.createElement(p.A,{title:S.rt("Request {category} configuration help",{category:t}),onSubmit:M,submitButtonIsLoading:f,onCancel:F,onClose:F,submitButtonText:S.t("Submit")},S.rt("Slackbot will send you a direct message when your request is processed.")))}StepConfigurationRequiredBanner.displayName="StepConfigurationRequiredBanner";var T=a(0x219fde2f3),I=a.n(T);let{INSTALL_SHOW_STEP_FUNCTION:N,SHOW_STEP_FUNCTION:M}=k.pY,{READY:F}=k.aW,AppConfigurationBanner=({id:e="",name:t})=>{let{getState:a}=(0,l.Pj)(),n=a(),i=(0,E.Ez)(n,e??""),s=(0,E.$E)(n,e??"");return(i===M||i===N)&&s!==F?r.createElement(StepConfigurationRequiredBanner,{id:e,appName:t,className:I().appConfigBanner,icon:"warning",displaySimpleAlert:!0}):null};AppConfigurationBanner.displayName="AppConfigurationBanner";var O=a(0x236ed4d73),L=a(0xba7d6f5f),D=a(0x20aa03c9b),P=a(0x10da1e25d),R=a(0x66c6b26d),B=a(0x126492ec6),W=a(0x20adb28cd);function useActionLibraryNavigation(e,t){let{dispatch:a,getState:n}=(0,l.Pj)(),r=(0,x.d4)((0,R.sx)(t,W.wl)),i=e===P.uB.STEPS?{panelId:"discover",panelType:"category",libraryType:e}:{panelId:"slack",panelType:"category",libraryType:e};return r.length||a((0,B.il)({workflowId:t,type:e,initialState:i})),{navigate:e=>{a((0,B.M2)({workflowId:t,navigationState:e}))},navigateBack:()=>(a((0,B.iy)({workflowId:t})),(0,W.Jn)(n(),t))}}var V=a(0x21343fa5a),q=a(0x18ee7321c),H=a(0x11243fb75),U=a(0x4a312a6e);let CardSection=({section:e,autoFocus:t})=>{let a=(0,r.useCallback)(t=>a=>{e.onItemSelect(t)},[e]),n=(0,r.useRef)(null);(0,V.A)(()=>{t&&n.current&&n.current.focus()});let l=(0,r.useCallback)(e=>{let t=e.id??"";return r.createElement(H.A,{onClick:a(t),className:I().cardSectionListcard,id:t,"aria-label":t},r.createElement("div",{className:`${I().cardButtonIcon} ${e.type}-icon`},r.createElement(U.Jx,{alt:"",name:t,type:e.type})),r.createElement("div",{className:I().cardButtonTitle},e.name))},[a]);return r.createElement(q.A,{ref:n,className:I().cardSectionList,renderItem:l,items:e.items,"aria-label":e.ariaLabel||"list"})};CardSection.displayName="CardSection";var z=a(0x2172ff7ff),j=a(0x1846f5916),$=((n={}).BuiltIn="builtin",n.App="app",n.Workflow="workflow",n.Utility="utility",n),G=a(0xe4a3aa1b),K=a(0x3b8174d2);let CollectionCard=({collection:e})=>{let t=(0,x.d4)(K.Jk),a=e.categories.filter(e=>t[e]).sort((e,a)=>{let n=t[e],r=t[a];return n.type!==$.BuiltIn?r.type!==$.BuiltIn?(0,z.Ay)(n.name,r.name):-1:r.type!==$.BuiltIn?1:(0,z.Ay)(n.name,r.name)}),n=a?.length;if(n<j.$x)return null;let l=[a[0],a[1]];t[l[1]].type===$.BuiltIn&&t[l[0]].type!==$.BuiltIn&&l.reverse();let i=l.map(e=>({type:t[e].type,iconSize:t[e].type===$.BuiltIn?void 0:28,name:e}));return r.createElement("div",{className:s()(I().cardSectionButton,I().collectionCard),"data-qa":"collection-card"},r.createElement("div",{className:I().cardIcons},r.createElement("div",{"data-qa":`${i[0].type}-icon`,className:s()(I().cardButtonIcon,`${i[0].type}-icon`)},r.createElement(U.Jx,{alt:"",iconSize:i[0].iconSize,name:i[0].name,type:i[0].type})),n>1?r.createElement("div",{"data-qa":`${i[1].type}-icon`,className:s()(I().cardButtonIcon,`${i[1].type}-icon`)},r.createElement(U.Jx,{alt:"",iconSize:i[1].iconSize,name:i[1].name,type:i[1].type})):null),r.createElement("div",{className:I().cardButtonTitle},(0,G.oH)(e.id)))};CollectionCard.displayName="CollectionCard";var Y=a(0x23a4b0853),Q=a(0x238b287cf),Z=a(0x3711e82d);let J=new c.Ay("workflow_builder"),SectionContainer=({section:e,onSeeAll:t,children:a})=>{let{data:{totalItemCount:n=0,context:l}={totalItemCount:0},items:i,headerNode:s,displayType:o}=e,c=(0,Q.A)(),d=L.XU.includes(o),[u,m]=(0,r.useState)(!1),p=e.items.length>L.GB,b=(0,r.useCallback)(()=>{d&&m(!0)},[d]),f=(0,r.useCallback)(()=>{t&&t(e.id,l)},[t,l,e.id]),g=d&&p&&!u,h=t&&n>=i.length,_=g?b:h?f:null,y=(0,r.useCallback)(()=>{let e=g?Y.KC.WorkflowActionLibraryCollectionsExpandSectionBtn:Y.KC.WorkflowActionLibraryCollectionsSeeAllBtn;(0,Y.ES)({clogger:c,uiArgs:{step:Z.UiStep.WORKFLOW_EDITOR,action:Z.UiAction.CLICK},uiProperties:{element_name:e,element_type:Z.ElementType.LINK},wbArgs:{is_hermes:!0}}),_?.()},[c,_,g]);return r.createElement("section",{"aria-label":e.ariaLabel,className:e.displayType},r.createElement("div",{className:I().sectionHeading},s),(_||u)&&r.isValidElement(a)&&r.cloneElement(a,{isExpanded:u,headerAction:y||void 0})||a)};SectionContainer.displayName="SectionContainer";let SectionContainerHeaderButton=({section:e})=>{let{data:{totalItemCount:t=0}={totalItemCount:0},items:a,displayType:n}=e,l=L.XU.includes(n),i=e.items.length>L.GB,s=J.t("See more"),o=J.t("See all");return l&&i?r.createElement(m.A,{id:`header-button-${e.id}`,tabIndex:-1,"data-qa":"expand-section-btn"},s):t>=a.length?r.createElement(m.A,{id:`header-button-${e.id}`,tabIndex:-1,"data-qa":"see-all-btn"},o):null};SectionContainerHeaderButton.displayName="SectionContainerHeaderButton";let CollectionCardSection=({section:e,isExpanded:t,headerAction:a,autoFocus:n})=>{let l=(0,r.useMemo)(()=>{let n=a?L.GB+1:L.GB;return e.items.slice(0,t?e.items.length:n)},[a,t,e.items]),i=(0,r.useRef)(null);(0,V.A)(()=>{n&&i.current&&i.current.focus()});let o=e.items.length>L.GB,c=!t&&o?l[l.length-1].id:"",d=(0,r.useCallback)(t=>a=>{e.onItemSelect(t)},[e]),u=(0,r.useCallback)(t=>{if(t.id===c)return r.createElement(H.A,{id:t.id,className:I().headerButton,onClick:a,"aria-labelledby":`header-button-${e.id}`},r.createElement(SectionContainerHeaderButton,{section:e}));let n=(0,G.oH)(t.id);return r.createElement(H.A,{onClick:d(t.id),className:I().cardSectionListItem,id:t.id,"aria-label":n},r.createElement(CollectionCard,{key:t.id,collection:t}))},[a,c,d,e]);return l.length?r.createElement(q.A,{ref:i,className:s()(I().cardSectionList,I().collections),renderItem:u,items:l,initialActiveItem:t?e.items[L.GB].id:l[0].id,"aria-label":e.ariaLabel||"list"}):null};CollectionCardSection.displayName="CollectionCardSection";var X=a(0x1c371dd8b),ee=a(0x2173e1832),et=a(0x4c96e5d9),ea=a(0xa6f3163b),en=a(0x1ba239227),er=a(0x1ece86d01),el=a(0xd08839a1);let ActionItem=({action:e,selectedActionId:t,processingActionId:a,renderedInListVariant:n,onClick:l})=>{let{getInteractState:i}=(0,D.I)(),o=(0,en.VZ)(e),c=o?e.appId:e.app_id,d="product_level_availability"in e?e?.product_level_availability:void 0,u=d?.is_available,m=o?e.type:void 0,p=i({actionId:e?.id,selectedActionId:t,processingActionId:a,appId:c,isAvailable:u,triggerType:m}),b=(0,r.useMemo)(()=>o?(0,en.y6)(e.type,e.subtype??"",e.serviceConfig):e.callback_id,[e,o]),f=!(0,el.Ew)(p);return r.createElement(ea.A,{tabIndex:-1,"data-qa":o?`main_view_${b}_trigger_action_button`:`main_view_${b}_step_action_button`,className:s()(I().actionButtonWrapper,{[I().isDisabled]:f}),"aria-disabled":f},o?r.createElement(er.w,{triggerType:e,interactState:p,displayAppName:!1,renderedInListVariant:n,onClick:l}):r.createElement(er.w,{functionId:e.id,interactState:p,displayAppName:!1,renderedInListVariant:n,onClick:l}))};ActionItem.displayName="ActionItem";var ei=a(0xdbc82d6d);let TooltipWrapper=({tooltipContent:e,children:t})=>e?r.createElement(et.Ay,{tip:e,zIndex:ee.m.FullScreen},t):r.createElement(r.Fragment,null,t);TooltipWrapper.displayName="TooltipWrapper";let ListSection=({section:e,selectedActionId:t,processingActionId:a,headerAction:n,autoFocus:l})=>{let{getInteractState:i,getTooltip:s}=(0,D.I)(),{data:{totalItemCount:o=0,limit:c=e.items.length,context:d}={totalItemCount:0}}=e,u=(0,r.useRef)(null);(0,V.A)(()=>{l&&u.current&&u.current.focus()});let m=n&&o>c?e.items[e.items.length-1].id:"",p=(0,r.useCallback)(n=>r=>{let l=(0,en.VZ)(n),s=i({actionId:n.id,selectedActionId:t,processingActionId:a,isAvailable:!("product_level_availability"in n)||n?.product_level_availability?.is_available,triggerType:l?n.type:void 0});s!==ei.V.inactive&&s!==ei.V.selected&&s!==ei.V.processing&&e.onItemSelect(n.id,d)},[d,i,a,e,t]),b=(0,r.useCallback)(l=>{let i=(0,en.VZ)(l),o=i?l.label:l.title||"",c=i?l.type:void 0,d=s(l?.id,l&&"title"in l?l?.title:o,l&&"product_level_availability"in l?l?.product_level_availability:void 0,c);if(l.id===m)return r.createElement(H.A,{id:l.id,className:I().headerButton,onClick:n,"aria-labelledby":`header-button-${e.id}`},r.createElement(SectionContainerHeaderButton,{section:e}));let u=l&&"product_level_availability"in l?l?.product_level_availability:void 0,b=(0,L.HB)(Z.UiAction.CLICK),f=(0,L.qB)(l,e.id,{uiStep:`${Y.KC.WorkflowActionLibraryActions}_${l.id}`,enableClogAction:u?.is_available===!1,elementName:`${Y.KC.WorkflowActionLibraryActions}_${l.id}_${u?.is_available?"upgrade_not_required":"upgrade_required"}`,elementValue:"quick-steps"===e.id?Y.it.ActionLibraryContextQuickSteps:Y.it.ActionLibraryContextUtilities});return r.createElement(TooltipWrapper,{tooltipContent:d},r.createElement(H.A,{onClick:p(l),className:I().actionListItem,id:l.id,"aria-label":o},r.createElement(X.A,{actionProps:b,autoClogProps:f},r.createElement(ActionItem,{action:l,renderedInListVariant:"single",selectedActionId:t,processingActionId:a,onClick:p(l)}))))},[s,n,m,p,a,e,t]);return e.items.length?r.createElement(q.A,{ref:u,renderItem:b,items:e.items,initialActiveItem:e.items?.[0].id,"aria-label":e.ariaLabel||"list"}):null};ListSection.displayName="ListSection";var es=a(0xe9c32bb),eo=a(0x2307c0383),ec=a.n(eo);let ed=new c.Ay("workflow_builder"),MainErrorView=({actionType:e})=>{let t=e===P.uB.TRIGGERS?ed.t("Triggers"):ed.t("Steps"),a=ed.t("Something went wrong loading workflow {actionTypeText}",{actionTypeText:t.toLowerCase()}),n=ed.t("Please try again in a bit");return r.createElement("div",{className:ec().errorContainer,"data-qa":"action-library-error-state"},r.createElement("div",{className:ec().errorSvg}),r.createElement(es.Pd,{className:ec().categoryName},a),r.createElement(es.nB,null,n))};MainErrorView.displayName="MainErrorView";var eu=a(0x32d3ef3d),em=a(0xfa28400d),ep=a(0x4df01f17),eb=a(0x7729d35b),ef=a(0x10bc07ca1),eg=a.n(ef);let PopularCategorySkeleton=()=>{let e=eu.w.loading,t=eu.S.compact;return r.createElement(em.Ay,{entityState:e,isFullWidth:!0,isAutoHeight:!0,isRemovable:!1,size:t},r.createElement("div",{className:eg().popularCategoryContent},r.createElement(eb.A,{entityState:e,suppressDefaultColors:!0}),r.createElement(ep.A,{width:104,height:12,borderRadius:8})))};function PopularCategorySkeletonList({count:e,subtitle:t}){return r.createElement(r.Fragment,null,t&&r.createElement("div",{className:eg().popularCategorySubtitle},t),r.createElement("div",{className:eg().popularCategoryList},Array.from({length:e},(e,t)=>r.createElement(PopularCategorySkeleton,{key:t}))))}PopularCategorySkeleton.displayName="PopularCategorySkeleton",PopularCategorySkeletonList.displayName="PopularCategorySkeletonList";var eh=a(0x9798b7f);let PopularStepSkeleton=()=>{let e=eu.w.loading,t=eu.S.compact;return r.createElement(em.Ay,{entityState:e,isFullWidth:!0,isAutoHeight:!0,isRemovable:!1,size:t},r.createElement("div",{className:eg().popularStepContent},r.createElement(eb.A,{entityState:e,suppressDefaultColors:!0}),r.createElement(eh.A,{entityState:e,size:t})))};function PopularStepSkeletonList({count:e,subtitle:t}){return r.createElement(r.Fragment,null,t&&r.createElement("div",{className:eg().popularStepSubtitle},t),Array.from({length:e},(e,t)=>r.createElement(PopularStepSkeleton,{key:t})))}function PopularContentSkeleton({popularCategoriesSubtitle:e,popularStepsSubtitle:t}){return r.createElement("div",{className:eg().skeletonView,"data-qa":"popular-content-skeleton"},r.createElement(PopularCategorySkeletonList,{count:2,subtitle:e}),r.createElement(PopularStepSkeletonList,{count:5,subtitle:t}))}function TriggerContentSkeleton(){return r.createElement("div",{className:eg().skeletonView,"data-qa":"trigger-content-skeleton"},r.createElement(PopularStepSkeletonList,{count:6}))}PopularStepSkeleton.displayName="PopularStepSkeleton",PopularStepSkeletonList.displayName="PopularStepSkeletonList",PopularContentSkeleton.displayName="PopularContentSkeleton",TriggerContentSkeleton.displayName="TriggerContentSkeleton";let e_=new c.Ay("workflow_builder");function SkeletonContent({actionType:e}){let t=e===P.uB.TRIGGERS,a=e_.t("Discover workflow triggers"),n=e_.t("Popular categories"),l=e_.t("Quick steps");return r.createElement(r.Fragment,null,r.createElement(O.A,{name:t?a:""}),t?r.createElement(TriggerContentSkeleton,null):r.createElement(PopularContentSkeleton,{popularCategoriesSubtitle:n,popularStepsSubtitle:l}))}SkeletonContent.displayName="SkeletonContent";let MainView=({sections:e,headerNode:t,actionType:a,isLoading:n,hasError:l,navigationMethods:i,selectedActionId:s,processingActionId:o,autoFocusContent:c})=>{let d=(0,r.useCallback)((e,t)=>{let a=c&&0===t;switch(e.displayType){case P.FO.List:return r.createElement(ListSection,{key:e.id,autoFocus:a,section:e,processingActionId:o,selectedActionId:s});case P.FO.Card:return r.createElement(CardSection,{key:e.id,autoFocus:a,section:e});case P.FO.CollectionCards:return r.createElement(CollectionCardSection,{key:e.id,autoFocus:a,section:e});default:return null}},[c,o,s]);return l?r.createElement(MainErrorView,{actionType:a}):r.createElement("div",{className:I().main},n?r.createElement(SkeletonContent,{actionType:a}):r.createElement(r.Fragment,null,t,e.map((e,t)=>r.createElement(SectionContainer,{key:e.id,section:e,onSeeAll:i.setCategoryId},d(e,t)))))};MainView.displayName="MainView";var ey=a(0x1a7251dad),ex=a(0x2501a2cee),ev=a(0x17a5d3eab);let SidebarItemSkeleton=()=>r.createElement("div",{className:eg().skeletonSidebarItem,"data-qa":"sidebar-item-skeleton"},r.createElement(ep.A,{width:20,height:20,borderRadius:4}),r.createElement(ep.A,{width:144,height:8,borderRadius:8}));function SidebarItemSkeletonList({count:e}){return r.createElement(r.Fragment,null,Array.from({length:e},(e,t)=>r.createElement(SidebarItemSkeleton,{key:t})))}SidebarItemSkeleton.displayName="SidebarItemSkeleton",SidebarItemSkeletonList.displayName="SidebarItemSkeletonList";var eE=a(0x1f35a0f5),ek=a(0xa7a4ed65),eS=a(208233e3),ew=a.n(eS);let eC=new c.Ay("workflow_builder"),Sidebar=({setSelectedCategoryId:e,selectedCategoryId:t,categories:a,staticCategoryIds:n,shouldFocusSearchButton:l,toggleSearchMode:i,actionType:o,isLoading:c=!1,hasError:d=!1})=>{let u=(0,r.useRef)(null),m=(0,r.useRef)(null),p=c||d,b=o===P.uB.STEPS?"step":"trigger",f=eC.t("Select {actionTypeLabel} categories",{actionTypeLabel:b,fallbackHash:"8b5f827237793a74978d5d3e15298abe2fc91f7d"}),g=(0,r.useMemo)(()=>({id:ek.Dd,name:eC.t("Discover"),functions:[],type:ek.Dd}),[]),h=(0,r.useMemo)(()=>{let e=Object.values(a).sort(en.Xl);return n.length>0?[g,...e]:e},[a,g,n.length]),_=(0,r.useMemo)(()=>({placeHolderTriggers:eC.t("Search triggers\u2026"),placeHolderSteps:eC.t("Search steps\u2026"),triggersButtonLabel:eC.t("Search triggers"),stepsButtonLabel:eC.t("Search steps")}),[]),y=o===P.uB.TRIGGERS?_.placeHolderTriggers:_.placeHolderSteps,x=o===P.uB.TRIGGERS?_.triggersButtonLabel:_.stepsButtonLabel,v=(0,r.useCallback)(()=>{i(!0)},[i]),E=(0,r.useCallback)(a=>n=>{a.id!==t&&e(a.id,Y.it.ActionLibraryContextSidebar)},[t,e]),k=(0,r.useCallback)((e,a,n)=>{let l=e.id,i=t===l,o=e.name,c=n[a-1]&&(0,en.fU)(n[a-1])!==(0,en.fU)(e);return r.createElement(H.A,{className:s()(ew().sidebarCategory,{[ew().sidebarCategorySelected]:i,[ew().firstOfType]:c}),"aria-label":eC.t("{categoryName}",{categoryName:o}),onClick:E(e),"data-qa":"sidebar_category_wrapper",key:l,id:l},r.createElement("div",{className:ew().sidebarCategoryListItem,"data-qa":`sidebar_${l}_category_button`},r.createElement(U.Jx,{name:l,type:e.type,iconSize:"20",className:ew().categoryIcon}),r.createElement("span",{className:ew().categoryText,"data-qa":`${l}_sidebar_category_title`},o)))},[E,t]);(0,r.useEffect)(()=>{l&&u.current&&u.current.focus()},[u,l]);let S=(0,r.useMemo)(()=>({uiStep:Z.UiStep.WORKFLOW_EDITOR,action:Z.UiAction.CLICK,elementName:Y.KC.WorkflowActionLibrarySearchBtn,elementType:Z.ElementType.BUTTON,onClick:{enableClogAction:!0}}),[]);return r.createElement(r.Fragment,null,r.createElement("div",{className:ew().sidebarSearchbar},r.createElement(ea.A,{ref:u,autoFocus:l,className:s()(ew().sidebarSearchbarInput,{[ew().isSkeleton]:p}),onClick:v,"data-qa":"action-library-typeahead-input-button","aria-label":x,autoClogProps:S},r.createElement("div",{className:ew().sidebarSearchbarInputTextContainer},r.createElement("div",{className:ew().sidebarSearchbarInputTextPrimary},r.createElement(ex.Ah,{name:"search",size:"20",inline:!0}),y),r.createElement(ev.A,{isSidebar:!0})))),r.createElement("div",{className:ew().sidebarDivider},r.createElement(eE.A,null)),r.createElement("div",{className:ew().sidebarList},p?r.createElement(SidebarItemSkeletonList,{count:16}):r.createElement(q.A,{ref:m,renderItem:k,items:h,initialActiveItem:t,"aria-label":f})))};Sidebar.displayName="Sidebar";var eA=a(0x543a781e),eT=a(0x12edaa96a),eI=a(0x14abc22b0),eN=a(0x35514c28),eM=a(0x13b0ddf54),eF=a(0x11a296110),eO=a(0xcdec51d),eL=a.n(eO);let eD=new c.Ay("workflow_builder"),TypeaheadEmptyResult=({clearSearch:e,query:t})=>{let a=eD.rt("No matches found for <b>{queryString}</b>.",{ns:"enterprise_dashboard",queryString:t}),n=eD.t("No matches found.",{ns:"workspace_apps_manage"}),l=eD.t("Clear Search");return r.createElement("div",{id:"empty-state-box",role:"menu","aria-label":n,"data-qa":"action-library-typeahead-empty-result",className:eL().emptyResult},r.createElement(es.nB,null,a),r.createElement(eF.Ay,{type:"outline",onClick:e},l))};TypeaheadEmptyResult.displayName="TypeaheadEmptyResult";var eP=a(0xb1ea448c),eR=a(0x11113d520),eB=a(0x2a037c8a),eW=a(0xa1832ae4),eV=a(0x9509dfce),eq=a(0x5dd1c0f2),eH=a(0x1e9a6d1d),eU=a(0x1ee439e69);let ez=new c.Ay("workflow_builder"),TypeaheadSuggestion=({id:e,itemIndex:t,itemRef:a,suggestion:n,isFocused:l,onSelect:i,onFocus:o,selectedActionId:c,processingActionId:d,actionType:u})=>{let m=(0,x.d4)(e=>(0,eq.sO)(e,n.appId)),{getInteractState:p,getTooltip:b}=(0,D.I)(),f=u===P.uB.TRIGGERS?n.type:void 0,g=p({actionId:n.id,selectedActionId:c,processingActionId:d,appId:n.appId,isAvailable:n.productLevelAvailability?.isAvailable,triggerType:f}),h=!(0,el.Ew)(g),y=b(n.id,n.title,n.productLevelAvailability?(0,eV.nf)(n.productLevelAvailability):void 0,f),v=ez.t("Category"),E=(0,r.useCallback)(e=>{h||(e.preventDefault(),e.stopPropagation(),0!==e.button||e.ctrlKey||i(n))},[i,n,h]),k=(0,r.useCallback)(()=>{l||o(t,!1)},[l,t,o]),S=n?.icon||n?.appId||"",w="salesforce"===n.appId?eB.M.External:n.type||n.appId&&eB.M.Service||"",C=(0,r.useMemo)(()=>w===eH.A.App||w===eB.M.Service?g===ei.V.requestable?`${ez.t("Request")} ${m?.name}`:g===ei.V.requested?`${ez.t("Requested")} ${m?.name}`:m?.name:n?.categoryLabel,[m?.name,n.categoryLabel,w,g]),A=g===ei.V.selected,T=g===ei.V.processing,I=(0,r.useMemo)(()=>{if(!n.isCategory){if(A)return r.createElement("div",{className:eL().selectedIcon},r.createElement(ex.Ah,{name:"check-filled",size:"16"}));if(T)return r.createElement("div",{className:eL().processing},r.createElement(eP.A,{color:"blue",size:"medium"}))}return r.createElement("span",{className:eL().category},C)},[C,T,A,n.isCategory]),N=(0,x.d4)(eU.H7),M=(0,eW.lk)(N),F=(0,el.EH)(e,n.productLevelAvailability?(0,_.VA)(n.productLevelAvailability):void 0,M);return r.createElement("li",{role:"option",key:e,id:`suggestion-${e}`,ref:a,tabIndex:-1,"aria-selected":l,"aria-label":`${n?.title}, ${!n.isCategory?C:v}`,className:s()({[eL().inFocus]:l&&!(A||T),[eL().selectedFocus]:l&&(A||T),[eL().selectedTypeaheadSuggestion]:A||T}),onMouseDown:E,onMouseMove:k,"aria-disabled":h},r.createElement("div",{className:eL().leftContent},r.createElement(U.Jx,{name:S,type:w,iconSize:"20",alt:""}),r.createElement("span",{className:eL().title},r.createElement("span",null,n?.title),!!y&&r.createElement("span",{className:eL().description},y))),r.createElement("div",{className:eL().rightContent},F.badgeText&&r.createElement(eR.E,{badgeText:F.badgeText,badgeStyle:F.badgeStyle}),I))};TypeaheadSuggestion.displayName="TypeaheadSuggestion";var ej=a(0xb3cd55e4);let e$=new c.Ay("workflow_builder"),SearchTypeahead=({onActionSearch:e,onActionSelected:t,setSelectedCategoryId:a,toggleSearchMode:n,actionType:l,isLoading:i,popularActions:s,selectedActionId:o,processingActionId:c})=>{let d=(0,r.useRef)(null),u=(0,r.useRef)(null),m=(0,r.useMemo)(()=>({}),[]),{sendMessageToAnnouncerAPI:p}=(0,r.useContext)(eI.A),[b,f]=(0,r.useState)([]),[g,h]=(0,r.useState)(s),[_,y]=(0,r.useState)(void 0),[x,v]=(0,r.useState)(""),[E,k]=(0,r.useState)(!1),[S,w]=(0,r.useState)(!1),{getInteractState:C}=(0,D.I)(),A=(0,r.useCallback)(e=>{e.preventDefault(),d?.current?.focus()},[]),T=l===P.uB.TRIGGERS?e$.t("Search workflow triggers"):e$.t("Search workflow steps"),I=e$.t("Instantly search steps from anywhere with"),N=(0,r.useCallback)(()=>{f([]),y(0)},[]),M=(0,r.useCallback)(()=>{N(),v("")},[N]),F=(0,r.useCallback)(async e=>{let r=C({actionId:e.id,selectedActionId:o,processingActionId:c,appId:e.appId,triggerType:l===P.uB.TRIGGERS?e.type:void 0});(0,el.Ew)(r)&&(e.isCategory?a(e.appId||"discover",Y.it.ActionLibraryContextSearch):await t(e.id,Y.it.ActionLibraryContextSearch),M(),n(!1))},[l,C,o,c,M,n,a,t]),O=(0,r.useCallback)(e=>{e>=0&&e<g.length&&d?.current?.setAttribute("aria-activedescendant",`suggestion-${g[e].id}`)},[g]),L=e$.t("Quick steps"),R=e$.t("Popular starting actions"),B=l===P.uB.STEPS?L:R,W=(0,r.useMemo)(()=>{let e=B;return b.length&&(e=e$.t("{count, plural, =1 {# filtered result} other {# filtered results}}",{count:b.length,ns:"enterprise_dashboard"})),e},[B,b.length]),V=(0,eA.A)(W,500);(0,r.useEffect)(()=>{p({message:V,uuid:(0,eT.A)()})},[V,p]),(0,r.useEffect)(()=>{if(!b.length)return x?(y(-1),d?.current?.removeAttribute("aria-activedescendant"),w(!0)):(h(s),void w(!1));h(b),w(!1)},[s,x,b]),(0,r.useEffect)(()=>{g.length&&void 0!==_&&O(_)},[_,g,O]);let q=(0,r.useCallback)(e=>(m[e]||(m[e]=r.createRef()),m[e]),[m]),H=(0,r.useCallback)(e=>{if(!u||!u.current||!m[e]||!m[e].current)return;let t=u.current,a=m[e].current,n=a.offsetTop-t.offsetTop,r=n+a.offsetHeight;n<t.scrollTop&&(t.scrollTop=n),r>t.scrollTop+t.clientHeight&&(t.scrollTop=r-t.clientHeight)},[u,m]),U=(0,r.useCallback)((e,t=!0)=>{y(e),t&&H(e)},[H]),z=(0,r.useCallback)(e=>{if("ArrowDown"===e.key)e.preventDefault(),void 0===_?U(0):_<g.length-1&&U(_+1);else if("ArrowUp"===e.key)e.preventDefault(),void 0!==_&&_>0&&U(_-1);else if("Enter"===e.key){if(e.preventDefault(),-1===_||void 0===_)return void M();F(g[_])}else"Escape"===e.key&&(e.preventDefault(),M(),n(!1))},[_,g,U,F,M,n]),j=(0,r.useCallback)(async t=>{let{actions:a,categories:n}=await e(t);f([...a,...n.map(e=>({...e,isCategory:!0}))])},[e]),$=(0,r.useCallback)(async e=>{let t=e?.currentTarget?.value??null;t?.length?(v(t),i)?k(!0):j(t):M()},[i,j,M]);(0,r.useEffect)(()=>{E&&!i&&x&&(j(x),k(!1))},[i,j,E,x]);let G=(0,r.useCallback)(()=>{M(),n(!1)},[M,n]),K=(0,r.useCallback)(()=>{M(),d?.current?.focus()},[M]),Q=(0,r.useRef)(null);return(0,ej.A)(Q,G),r.createElement(eN.A,{hasKeyboardFocusWithin:!0},r.createElement("div",{role:"dialog","aria-label":T,className:eL().typeaheadWrapper,"aria-modal":!0,ref:Q},r.createElement("div",{className:eL().searchBarIcon},r.createElement(ex.Ah,{name:"search-filled",size:"20"})),r.createElement("input",{className:eL().searchBarInput,id:"typeaheadInputId",autoComplete:"off","aria-controls":S?"empty-state-box":"suggestion-box","aria-haspopup":S?"menu":"listbox","aria-autocomplete":"list",role:"combobox","aria-expanded":g.length>0,autoFocus:!0,"data-qa":"action-library-typeahead-input",ref:d,value:x,onChange:$,onKeyDown:z,placeholder:T,maxLength:70}),r.createElement(ea.A,{className:eL().cancelSearch,onClick:G,"data-qa":"cancel-search-mode","aria-label":e$.t("Close search",{ns:"search"})},e$.t("Cancel")),r.createElement("div",{className:eL().typeaheadResults,onFocus:A},b.length||!g.length||S?"":r.createElement("span",{"aria-hidden":!0,className:eL().sectionHeader},B),S&&r.createElement(TypeaheadEmptyResult,{clearSearch:K,query:x}),!S&&r.createElement("ol",{ref:u,id:"suggestion-box",role:"listbox","aria-label":e$.t("Search")},g.map((e,t)=>{let a=g[t-1],n=a&&!a.isCategory&&e.isCategory;return r.createElement("div",{key:e.id},n&&r.createElement(r.Fragment,null,r.createElement(eE.A,null),r.createElement("header",{className:eL().category},e$.t("Categories",{ns:"developer_app_settings"}))),r.createElement(TypeaheadSuggestion,{id:e.id,itemIndex:t,itemRef:q(t),isFocused:t===_,onSelect:F,onFocus:U,suggestion:e,selectedActionId:o,processingActionId:c,actionType:l}))})),g.length?r.createElement("div",{className:eL().overlayFooter,onFocus:A},r.createElement("span",null,I),r.createElement(eM.zG,{slim:!0,label:"CmdOrCtrl"}),r.createElement(eM.zG,{slim:!0,label:"F"})):null)))};SearchTypeahead.displayName="SearchTypeahead";var eG=a(0x1dbeaaa0b),eK=a(0x20570d71a),eY=a(0x1ee062b2e),eQ=a(0x145d46a61),eZ=a(0x1fb2d2a87),eJ=a(0x1fcbb004d),eX=a(0x21d77138c),e0=a.n(eX);let e1=new c.Ay("workflow_builder"),BaseActionLibraryModal=({actionData:e,onActionSearch:t,onActionSelected:a,selectedActionId:n,getStaticPanels:i,type:c,focusSearch:u=!1})=>{let[m,p]=(0,r.useState)(u),[b,f]=(0,r.useState)(!u),{categories:g,collections:h,actions:_}=e,y=(0,eK.Y)(),v=(0,Q.A)(),{getInteractState:E}=(0,D.I)(),{navigate:k,navigateBack:S}=useActionLibraryNavigation(c,y),w=(0,x.d4)((0,R.sx)(y,W.Jn)),C=(0,r.useMemo)(()=>{let e=Object.keys(g);return e.length>0?e[0]:void 0},[g]),{windowRef:A}=(0,r.useContext)(o._0),T=(0,x.d4)(eZ.to),I=(0,r.useRef)(null),N=(0,r.useRef)(null),M=(0,x.d4)(eQ.tQ),F=e1.t("Ways to start"),V=e1.t("Actions"),q=c===P.uB.STEPS?V:F,H=(0,r.useMemo)(()=>{let e=E({actionId:ek.Ez.case_step})===ei.V.inactive;return(0,en.uZ)(c,_,!e)},[_,E,c]),[U,z]=(0,r.useState)(void 0),[j,$]=(0,r.useState)(void 0),[K,J]=(0,r.useState)(!1),[X,ee]=(0,r.useState)(""),et=(0,r.useCallback)(()=>{I.current?.scrollTo(0,0)},[]),ea=(0,r.useCallback)(e=>{z(e),$(void 0),et(),N.current?.querySelector(`#${e}`)?.focus(),J(!0)},[et]),er=(0,r.useCallback)(e=>{$(e),et(),J(!0)},[et]),el=(0,r.useCallback)((e,t)=>{k({panelId:e,panelType:"category",libraryType:c}),(0,Y.E7)({clogger:v,uiArgs:{step:Z.UiStep.WORKFLOW_EDITOR},uiProperties:{element_name:`${Y.KC.WorkflowActionLibraryCategories}_${e}`,element_value:t},wbArgs:{is_hermes:!0}}),ea(e)},[v,k,ea,c]),es=(0,r.useCallback)(e=>{k({panelId:e,panelType:"collection",libraryType:c}),(0,Y.E7)({clogger:v,uiArgs:{step:Z.UiStep.WORKFLOW_EDITOR},uiProperties:{element_name:Y.KC.WorkflowActionLibraryCollections,element_value:e},wbArgs:{is_hermes:!0}}),er(e)},[v,k,er,c]),eo=(0,r.useCallback)(async(e,t)=>{let n=_[e],r=(0,en.VZ)(n);ee(e),k({panelId:n.id,panelType:n.type||"category",libraryType:c}),(0,Y.E7)({clogger:v,uiArgs:{step:Z.UiStep.WORKFLOW_EDITOR},uiProperties:{element_name:`${Y.KC.WorkflowActionLibraryActions}_${e}`,element_value:t},wbArgs:{is_hermes:!0,trigger_type:r?n.type:void 0,trigger_subtype:r&&n.subtype?(0,eY.y)(n.subtype):void 0}}),await a(_[e]),ee("")},[v,_,k,c,a]),ec=(0,r.useCallback)(()=>{let e=S();"category"===e.panelType?ea(e.panelId):"collection"===e.panelType?er(e.panelId):a(_[e.panelId])},[_,S,a,ea,er]),ed=(0,r.useMemo)(()=>({setCollectionId:es,setCategoryId:el,scrollPanelToTop:et,onNavigateBack:ec,navigate:k}),[et,el,es,ec,k]),eu=(0,r.useMemo)(()=>i?i(ed):{},[i,ed]),em=(0,r.useMemo)(()=>Object.keys(eu),[eu]);(0,r.useEffect)(()=>{if(!e.isLoading&&!U){let e=em.length>0?em[0]:C,t="category"===w.panelType?w.panelId:void 0;"collection"===w.panelType&&er(w.panelId),z(t||e)}},[e.isLoading,w.panelType,w.panelId,C,U,er,em]);let ep=(0,l.wA)(),eb=(0,r.useCallback)(()=>{ep((0,eJ.O)()),ep((0,B.br)({workflowId:y}))},[ep,y]),ef=(0,r.useCallback)(e=>{p(e),f(!e)},[]);(0,r.useEffect)(()=>{let handleOnFindKeyPress=e=>{!m&&(0,eG.I)(e)&&(e.preventDefault(),ef(!0))};return A.deref()?.document.addEventListener("keydown",handleOnFindKeyPress),()=>{A.deref()?.document.removeEventListener("keydown",handleOnFindKeyPress)}},[m,A,ef]);let eg=U?g[U]:null,eh=j?h[j]:null,e_=eg?.name,ex=e1.t("Select {categoryName} {actionType}",{categoryName:e_,actionType:c}),ev=(0,r.useMemo)(()=>{if(!j&&U&&em.includes(U))return eu[U];if(eh){let e=(0,G.oH)(eh.id);return{headerNode:r.createElement(O.A,{id:eh.id||"",name:e},r.createElement(ey.E,{workflowId:y,onNavigateBack:ec})),sections:(0,L.hL)({collection:eh,categories:g,actions:_,ariaLabel:eh.displayName,onItemSelect:eo,sortItems:!0})}}return eg?{headerNode:r.createElement(O.A,{id:eg.id||"",type:eg.type,name:eg.name},r.createElement(ey.E,{workflowId:y,onNavigateBack:ec})),sections:[(0,L.w_)({headerNode:r.createElement(AppConfigurationBanner,{id:eg.id,name:eg.name}),category:eg,actions:_,onItemSelect:eo,ariaLabel:ex,sortItems:!0,context:Y.it.ActionLibraryContextCategorySection})]}:{sections:[]}},[j,U,em,eh,eg,eu,y,ec,g,_,eo,ex]);return r.createElement(d.A,{className:e0().WFBActionLibrary,maxWidth:"800px",onClose:eb,contentLabel:q,centered:!M,overlayClassName:s()({[e0().modalOverlay]:M})},r.createElement(r.Fragment,null,m&&r.createElement("div",{className:s()(e0().search,{[e0().hasOverlay]:m,[e0().hasDarkOverlay]:m&&"dark"===T})},r.createElement(SearchTypeahead,{onActionSearch:t,onActionSelected:eo,setSelectedCategoryId:el,toggleSearchMode:ef,popularActions:H,actionType:c,isLoading:e.isLoading,selectedActionId:n,processingActionId:X})),r.createElement("div",{className:e0().shell},r.createElement("div",{className:e0().left,ref:N},r.createElement(Sidebar,{setSelectedCategoryId:el,selectedCategoryId:U,categories:g,staticCategoryIds:em,shouldFocusSearchButton:b,toggleSearchMode:ef,actionType:c,isLoading:e.isLoading,hasError:!!e.error})),r.createElement("div",{className:e0().right,ref:I},r.createElement(MainView,{sections:ev.sections,headerNode:ev.headerNode,actionType:c,isLoading:e.isLoading,hasError:!!e.error,navigationMethods:ed,selectedActionId:n,processingActionId:X,autoFocusContent:K})))))};BaseActionLibraryModal.displayName="BaseActionLibraryModal"},0x236ed4d73:(e,t,a)=>{"use strict";a.d(t,{A:()=>CategoryHeader});var n=a(0xbad225b5),r=a(0x120c268ad),l=a.n(r),i=a(0x20482ad21),s=a(0x4a312a6e),o=a(0x1bb241cc1),c=a(0x2a037c8a);function valueIsInObject(e,t){return Object.values(t).includes(e)}var d=a(0x219fde2f3),u=a.n(d);let m=new i.Ay("workflow_builder"),CategoryHeader=({id:e="",type:t,name:a,children:r})=>{let i=t&&valueIsInObject(t,c.w)?m.t("Events in {name}",{name:a}):a,d=(0,o.S)(u().isPinned);return n.createElement("div",{ref:d,className:l()({[u().hasIcon]:t},u().categoryHeader)},r,t&&n.createElement("div",{key:e,className:`${u().iconWrapper} ${t}-icon`},n.createElement(s.Jx,{name:e||"",type:t})),n.createElement("h2",{className:u().categoryName,"data-qa":"header_category-name"},i))};CategoryHeader.displayName="CategoryHeader"},0xba7d6f5f:(e,t,a)=>{"use strict";a.d(t,{EL:()=>buildCollectionCardSection,GB:()=>m,HB:()=>generateActionClogProps,XU:()=>p,hL:()=>buildCollectionSections,qB:()=>generateAutoClogProps,w_:()=>buildListSection});var n=a(0x19b3ba9fd),r=a(0x20482ad21),l=a(0x2172ff7ff),i=a(0x10da1e25d),s=a(0x1ba239227),o=a(0x23a4b0853),c=a(0x3711e82d),d=a(0x1e9a6d1d);let u=new r.Ay("workflow_builder"),m=3,p=[i.FO.CollectionCards],sortActionsAlphabetical=(e,t)=>{let a=((0,s.VZ)(e)?e.label:e.title)||"",n=((0,s.VZ)(t)?t.label:t.title)||"";return(0,l.Ay)(a,n)},sortSectionsAlphabetical=(e,t)=>e.type===d.A.BuiltIn?t.type===d.A.BuiltIn?(0,l.Ay)(e.name,t.name):1:(0,l.Ay)(e.name,t.name),buildListSection=({id:e,category:t,actions:a,onItemSelect:r,headerNode:l=null,ariaLabel:s,sortItems:o,limit:c,context:d})=>{if(!t)return{id:e||"empty-section",headerNode:l,displayType:i.FO.List,onItemSelect:r,items:[],data:{context:d}};let u=t.functions?.map(e=>a[e]).filter(n.b)||[];o&&(u=u.sort(sortActionsAlphabetical));let m=u.length;return void 0!==c&&(u=u.slice(0,c+1)),{id:e||`${t.name}-section`,headerNode:l,ariaLabel:s,displayType:i.FO.List,onItemSelect:r,items:u,data:{totalItemCount:m,limit:c,context:d}}},buildCollectionCardSection=({id:e,items:t,onItemSelect:a,headerNode:n=null,ariaLabel:r})=>({id:e,headerNode:n,ariaLabel:r,displayType:i.FO.CollectionCards,onItemSelect:a,items:t}),buildCollectionSections=e=>{let{collection:t,categories:a,actions:n,onItemSelect:r,ariaLabel:l,sortItems:s}=e;return t.categories.map(e=>a[e]).filter(e=>e.functions.length).sort(s?sortSectionsAlphabetical:()=>0).map(e=>{let t=u.t("Select {categoryName} {actionType}",{categoryName:e.name,actionType:i.uB.STEPS});return buildListSection({id:e.id,headerNode:e.name,category:e,actions:n,onItemSelect:r,ariaLabel:t||l,sortItems:!0,limit:3,context:o.it.ActionLibraryContextCollections})})};function generateActionClogProps(e){return{onClick:{action:e}}}function generateAutoClogProps(e,t,a={uiStep:`${o.KC.WorkflowActionLibraryActions}_${e.id}`,elementName:`${o.KC.WorkflowActionLibraryActions}_${e.id}`,elementValue:"quick-steps"===t?o.it.ActionLibraryContextQuickSteps:o.it.ActionLibraryContextUtilities,enableClogAction:!0}){let{uiStep:n,elementName:r,elementValue:l,enableClogAction:i}=a;return{eventId:c.EventId.WORKFLOW_BUILDER,uiStep:n,action:c.UiAction.CLICK,elementName:r,elementValue:l,elementType:c.ElementType.BUTTON,appId:e.id,onClick:{enableClogAction:i}}}},0x1b0788a0d:(e,t,a)=>{"use strict";a.d(t,{s:()=>l,xr:()=>s,T8:()=>i});var n=a(0x10da1e25d),r=a(0xa7a4ed65);let l=3,i=[r.Ez.ai_answer,r.Ez.send_message,r.Ez.open_form,r.Ez.case_step,r.Ez.send_dm];r.sV.forms,r.eS.GOOGLE_SHEETS,r.eS.JIRA_CLOUD;let s={[n.uB.STEPS]:i,[n.uB.TRIGGERS]:["Ftt0101","Ftt0104","Ftt0103"]}},0x1c3f9c13e:(e,t,a)=>{"use strict";a.d(t,{I:()=>M,p:()=>ActionCompatibilityProvider});var n,r=a(0xbad225b5),l=a(0x20482ad21),i=a(0x17c7b6bbb),s=a(0xc5f25803),o=a(0x1a5ac3a0c),c=a(0x154dd8295),d=a(0x1795d8821),u=a(0x20cfa1dc2);let m=["builtins_salesforce","builtins_sales_elevate","builtins_salesforce_channels"];var p=((n={}).GENERATIVE_AI="generative_ai",n.THIRD_PARTY="third_party",n.CUSTOM="custom",n.SALESFORCE="salesforce",n);function getWorkflowStepClassifications(e){let t=new Set;if(!e)return t;for(let a of(0,s.a)(e.workflow)){a.function?.callback_id===d.oW.AiAnswer&&t.add("generative_ai"),a.type===u._3.CONNECTOR&&t.add("third_party"),a.type===u._3.CUSTOM&&t.add("custom");let e=a.function?.category_id;e&&m.includes(e)&&t.add("salesforce")}return t}var b=a(0xa7a4ed65);let f=new l.Ay("workflow_builder"),isAiIncompatibleTriggerType=(e,t)=>{let a=[i.vh.Service,i.vh.External];return!1===t&&a.push(i.vh.Webhook,i.vh.HermesWebhook),a.includes(e)},g=[{isBlocked:e=>e.actionId===b.Ez.case_step&&!e.canAddAtCurrentPosition,getBlockedMessage:()=>f.t("You can\u2019t add a branch here")},{isBlocked:e=>!!e.trigger&&e.actionId===b.Ez.ai_answer&&isAiIncompatibleTriggerType(e.trigger.type,e.experiments.wfbAiEnableWebhookTriggersEnabled),getBlockedMessage:e=>e.experiments.experimentWfbAiStepTranslationsGroupOn?f.t("You can\u2019t add this step with this starting action."):"You can\u2019t add this step with this starting action."},{isBlocked:e=>e.actionId===b.Ez.ai_answer&&(e.workflowClassifications.has(p.THIRD_PARTY)||e.workflowClassifications.has(p.CUSTOM)||e.workflowClassifications.has(p.SALESFORCE)),getBlockedMessage:e=>{let{experimentWfbAiStepTranslationsGroupOn:t}=e.experiments;return t?f.t("This step cannot be added to workflows with third-party or Salesforce steps."):"This step cannot be added to workflows with third-party or Salesforce steps."}},{isBlocked:e=>{let t,a;return t=e.categoryId,((a=e.stepType)===u._3.CONNECTOR||a===u._3.CUSTOM||a===u._3.CERTIFIED||void 0!==t&&m.includes(t)||!1)&&e.workflowClassifications.has(p.GENERATIVE_AI)},getBlockedMessage:e=>{let{experimentWfbAiStepTranslationsGroupOn:t}=e.experiments;return t?f.t("This step cannot be added to workflows with AI Generate steps."):"This step cannot be added to workflows with AI Generate steps."}}];function getBlockingRule(e){for(let t of g)if(t.isBlocked(e))return t;return null}let h=[{isBlocked:e=>!!e.workflowClassifications.has(p.GENERATIVE_AI)&&isAiIncompatibleTriggerType(e.triggerType,e.experiments.wfbAiEnableWebhookTriggersEnabled),getBlockedMessage:e=>{let{experimentWfbAiStepTranslationsGroupOn:t}=e.experiments;return t?f.t("This starting action can\u2019t be used with workflows that have AI Generate steps."):"This starting action can\u2019t be used with workflows that have AI Generate steps."}}];function getBlockingTriggerRule(e){for(let t of h)if(t.isBlocked(e))return t;return null}var _=a(0xdbc82d6d),y=a(0xd08839a1),x=a(0x85a83465);let ActionCompatibilityEvaluator=class ActionCompatibilityEvaluator{context;actionRuleCache=new Map;triggerRuleCache=new Map;workflowClassifications;canAddAtCurrentPosition;constructor(e){this.context=e,this.workflowClassifications=getWorkflowStepClassifications(e.hermesWorkflow),this.canAddAtCurrentPosition=((e,t,a)=>{if(!t)return!1;let n=t?.workflow?.steps??[],r=n?.find(c.Z1);if(!a){let t=n.length&&!e||e&&n.findIndex(t=>t.id===e)!==n.length-1;return!!(!r&&!t)}if((0,o.W0)(e,t))return!1;let l=e?(0,o.Dv)(e,t?.workflow):void 0,i=e||(n?.[0]?.id??"");l&&(0,c.Zv)(l)&&(i=l?.steps?.[0]?.id??"");let s=(0,o.o)(i,t?.workflow);return!s.find(c.Z1)&&!(!e&&n&&n.length||s.findIndex(t=>t.id===e)!==s.length-1||s.length&&!s.find(t=>t.id===e))})(e.afterStepId,e.hermesWorkflow,!0)}get currentProductLevel(){return this.context.currentProductLevel}getFunctionMetadata(e){let t=this.context.functionsById[e];return{categoryId:t?.category_id,stepType:t?.stepType}}buildActionRuleContext(e){let{categoryId:t,stepType:a}=this.getFunctionMetadata(e);return{actionId:e,categoryId:t,stepType:a,workflowClassifications:this.workflowClassifications,trigger:this.context.hermesWorkflow?.trigger,canAddAtCurrentPosition:this.canAddAtCurrentPosition,experiments:this.context.experiments}}buildTriggerRuleContext(e){return{triggerType:e,workflowClassifications:this.workflowClassifications,experiments:this.context.experiments}}getBlockingRule(e){let t=this.actionRuleCache.get(e);if(t)return t;let a=getBlockingRule(this.buildActionRuleContext(e));return this.actionRuleCache.set(e,a),a}isActionBlocked(e){return null!==this.getBlockingRule(e)}getActionBlockedMessage(e){let t=this.getBlockingRule(e);if(!t)return null;let a=this.buildActionRuleContext(e);return t.getBlockedMessage(a)}getBlockingTriggerRule(e){let t=this.triggerRuleCache.get(e);if(t)return t;let a=getBlockingTriggerRule(this.buildTriggerRuleContext(e));return this.triggerRuleCache.set(e,a),a}isTriggerBlocked(e){return null!==this.getBlockingTriggerRule(e)}getTriggerBlockedMessage(e){let t=this.getBlockingTriggerRule(e);if(!t)return null;let a=this.buildTriggerRuleContext(e);return t.getBlockedMessage(a)}getDistributionStatus(e){let{connectorAppsInfo:t,wfbDefaultConnectorVisibility:a}=this.context,n=t?.data?.apps?.[e];return n?(0,x.m)({isAppInstalled:n.isInstalled??!1,aaaIsEnabled:t?.data?.isAaaEnabled??!1,appResolution:n.appResolution,isRequestPending:n.isRequestPending??!1,wfbDefaultConnectorVisibility:a}):null}getConfigurationStatus(e){let{connectorAppsInfo:t}=this.context,a=t?.data?.apps?.[e];return(0,x.N)({requiresConfig:a?.requiresConfig,missingRequiredConfig:a?.missingRequiredConfig,isConfigRequestPending:a?.isConfigRequestPending})}getAppInteractState(e){let t=this.getDistributionStatus(e),a=this.getConfigurationStatus(e);return t?(0,y.rG)(t,a):_.V.addable}};var v=a(0x20570d71a),E=a(0x145d46a61),k=a(0xa1832ae4),S=a(0xb1f0729f),w=a(0x66c6b26d),C=a(0x20adb28cd),A=a(0x226892387),T=a(0x19561ce96),I=a(0x3b8174d2),N=a(0x1ee439e69);let M=(0,r.createContext)(null);function ActionCompatibilityProvider({afterStepId:e,children:t}){let a=(0,v.Y)(),n=(0,A.d4)((0,w.sx)(a,C.RG)),l=(0,A.d4)(E.nw),i=(0,A.d4)(E.yH),s=(0,A.d4)(I.cq),o=(0,A.d4)(T.W2),c=(0,A.d4)(S.IN),d=(0,A.d4)(N.H7),u=(0,k.lk)(d),m=(0,r.useMemo)(()=>new ActionCompatibilityEvaluator({hermesWorkflow:n,afterStepId:e,experiments:{experimentWfbAiStepTranslationsGroupOn:l,wfbAiEnableWebhookTriggersEnabled:i},functionsById:s,connectorAppsInfo:o,wfbDefaultConnectorVisibility:c,currentProductLevel:u}),[n,e,l,i,s,o,c,u]);return r.createElement(M.Provider,{value:m},t)}ActionCompatibilityProvider.displayName="ActionCompatibilityProvider"},0x20aa03c9b:(e,t,a)=>{"use strict";a.d(t,{I:()=>useActionItemState});var n=a(0xbad225b5),r=a(0x20482ad21),l=a(0x1c3f9c13e);function useActionCompatibilityEvaluator(){let e=(0,n.useContext)(l.I);if(!e)throw Error("useActionCompatibilityEvaluator must be used within an ActionCompatibilityProvider. Wrap your component tree with <ActionCompatibilityProvider afterStepId={...}>.");return e}var i=a(0xdbc82d6d);let s=new r.Ay("workflow_builder");function useActionItemState(){let e=useActionCompatibilityEvaluator();return{getInteractState:(0,n.useCallback)(({actionId:t,selectedActionId:a,appId:n,processingActionId:r,isAvailable:l=!0,triggerType:s})=>t&&l?t===a?i.V.selected:t===r?i.V.processing:s&&e.isTriggerBlocked(s)||e.isActionBlocked(t)?i.V.inactive:e.getAppInteractState(n??""):i.V.inactive,[e]),getTooltip:(0,n.useCallback)((t,a,n,r)=>n&&!n?.is_available?e.currentProductLevel===n?.available_to?s.t("This feature is available upon renewal."):s.t("This feature is available with an upgrade."):t&&a?r?e.getTriggerBlockedMessage(r):e.getActionBlockedMessage(t):null,[e])}}},0x17a5d3eab:(e,t,a)=>{"use strict";a.d(t,{A:()=>p});var n=a(0xbad225b5),r=a(0x16cf1da63),l=a(0x20482ad21),i=a(0x1fd3f6e20),s=a(0x3989021c),o=a(0x218842a12),c=a(0x21c50a68b),d=a(0xf3c65e54),u=a(0x5b1935a6);let m=new l.Ay("workflow_builder");o.g.HERMES_WORKFLOW_BUILDER_COACHMARKS_ERGO_BUILDER_EDU_NEW_BADGES;let ErgoBuilderNewBadge=({isSidebar:e})=>{let t=(0,r.wA)(),a=(0,c.JK)(),{isOpen:l}=(0,s.A)(u.ze.HERMES_WORKFLOW_BUILDER_COACHMARKS_ERGO_BUILDER_EDU_NEW_BADGES,u.xu.WORKFLOW_BUILDER_ACTION_LIBRARY_BADGES),o=(0,n.useMemo)(()=>e&&"fr-FR"===a,[e,a]),p=(0,n.useMemo)(()=>l&&!o,[l,o]),b=(0,n.useCallback)(()=>{l&&t((0,d.A)({notificationName:u.ze.HERMES_WORKFLOW_BUILDER_COACHMARKS_ERGO_BUILDER_EDU_NEW_BADGES,action:u.hw.IMPRESSION}))},[t,l]);return(0,n.useEffect)(()=>{b()},[b]),n.createElement(n.Fragment,null,p&&n.createElement(i.v,{isMicro:!0,style:i.u.Informative},m.t("NEW")))};ErgoBuilderNewBadge.displayName="ErgoBuilderNewBadge";let p=ErgoBuilderNewBadge},0x1a7251dad:(e,t,a)=>{"use strict";a.d(t,{E:()=>NavigationBackButton});var n=a(0xbad225b5),r=a(0x120c268ad),l=a.n(r),i=a(0x20482ad21),s=a(0x344bb842),o=a(0x66c6b26d),c=a(0x20adb28cd),d=a(0x226892387),u=a(0x21d77138c),m=a.n(u);let p=new i.Ay("workflow_builder"),b={name:"caret-left-full",size:"20"},NavigationBackButton=({workflowId:e,onNavigateBack:t,isSegmentModal:a=!1,isRequestAppModal:r=!1})=>{let i=(0,d.d4)((0,o.sx)(e,c.wl)).length>1;return n.createElement(n.Fragment,null,i?n.createElement(s.A,{onClick:t,"aria-label":p.t("Back"),svgIconProps:b,className:l()(m().backButton,{[m().isSegmentModal]:a,[m().isRequestAppModal]:r}),"data-qa":"back-button-category-header"}):null)};NavigationBackButton.displayName="NavigationBackButton"},0x1ee6256b0:(e,t,a)=>{"use strict";a.d(t,{G:()=>TriggersLibraryModal});var n=a(0xbad225b5),r=a(0x16cf1da63),l=a(0x1f7facc5c),i=a(0x1c2513fa3),s=a(0x1c3f9c13e),o=a(0x20aa03c9b),c=a(0x10da1e25d),d=a(0xd08839a1),u=a(0x2a037c8a),m=a(0x1fffc0b54),p=a(0xa4606544),b=a(0x66c6b26d),f=a(0x126492ec6),g=a(0x24fc5dd2c),h=a(0x20adb28cd),_=a(0x226892387),y=a(0x95c66692),x=a(0x22f6a086f);let v=(0,a(0x11c82607b).Ay)("search triggers and categories for a given query string",async(e,t,a)=>{let n=t();return{matchingTriggers:(0,x.Wk)(n,a),matchingCategories:(0,x.pk)(n,a)}});v.meta={name:"searchTriggersAndCategories",key:"createThunkSearchTriggersAndCategories",description:"search triggers and categories for a given query string"};var E=a(0x46dbff89);let TriggersLibraryModalContent=({focusSearch:e=!1,workflowId:t})=>{let a=(0,r.wA)(),s=(0,_.d4)(x.cw),k=(0,_.d4)(x.Fv),S=(0,_.d4)(m.YS),w=(0,_.d4)(m._u),C=(0,_.d4)((0,b.sx)(t,h.RX)),{getInteractState:A}=(0,o.I)(),T=(0,n.useCallback)(()=>{a((0,f.iy)({workflowId:t})),a((0,E.q)({element:n.createElement(TriggersLibraryModal,{workflowId:t})}))},[a,t]),I=(0,n.useCallback)((e,n)=>a((0,p.q)({appId:n,workflowId:t,type:e.type,subtype:e.subtype,serviceConfig:e.serviceConfig,onNavigateBack:T})),[a,T,t]),N=(0,n.useCallback)(e=>a((0,E.q)({element:n.createElement(l.u,{appId:e})})),[a]),M=(0,n.useMemo)(()=>{let e=s.find(e=>(0,g.k)(e.type)===C?.type&&e.subtype===C.subtype);return e?.id},[s,C]),F=(0,n.useMemo)(()=>({categories:k,collections:{},actions:s.reduce((e,t)=>(e[t.id]=t,e),{}),isLoading:S,error:w??void 0}),[S,w,k,s]),O=(0,n.useCallback)(async e=>{let t=e.serviceConfig?.function?.app_id||"",n=A({actionId:e.id,selectedActionId:M,appId:t,triggerType:e.type});if((0,d.Ew)(n)){if(e.type===u.w.Service)return void a((0,y.u)({appId:t,onOpenModal:()=>I(e,t),onRequestAppModal:()=>N(t)}));I(e,t)}},[a,A,N,I,M]),L=(0,n.useCallback)(async e=>{let{matchingTriggers:t,matchingCategories:n}=await a(v(e));return{actions:t,categories:n}},[a]);return n.createElement(i.y,{type:c.uB.TRIGGERS,onActionSelected:O,onActionSearch:L,actionData:F,selectedActionId:M,focusSearch:e})};function TriggersLibraryModal({focusSearch:e=!1,workflowId:t}){return n.createElement(s.p,{afterStepId:void 0},n.createElement(TriggersLibraryModalContent,{focusSearch:e,workflowId:t}))}TriggersLibraryModalContent.displayName="TriggersLibraryModalContent",TriggersLibraryModal.displayName="TriggersLibraryModal"},0x10da1e25d:(e,t,a)=>{"use strict";a.d(t,{FO:()=>i,uB:()=>l});var n,r,l=((n={}).STEPS="steps",n.TRIGGERS="triggers",n),i=((r={}).Card="card",r.CollectionCards="collection-cards",r.List="list",r)},0x1ba239227:(e,t,a)=>{"use strict";a.d(t,{VZ:()=>isTriggerTypeApiAction,Xl:()=>sortCategories,fU:()=>getItemGroup,uZ:()=>getDefaultSearchResults,y6:()=>deriveHumanReadableTriggerId});var n=a(0x35d46650),r=a(0x2172ff7ff),l=a(0x61c95b1b),i=a(0x1b0788a0d),s=a(0x10da1e25d),o=a(0x126af815a),c=a(0x2a037c8a),d=a(0x24fc5dd2c),u=a(0xa7a4ed65),m=a(0x1e9a6d1d),p=a(0x20cfa1dc2);let b="third_party_category",isTriggerTypeApiAction=e=>"icon"in e&&"group"in e;function getItemGroup(e){if(!e||!("functions"in e))return"";let t=[m.A.App,p._3.CERTIFIED,p._3.CONNECTOR,p._3.CUSTOM],a=e.type===c.w.External?c.w.Service:e.type;return t.includes(e.type)?b:a}let getDefaultSearchResults=(e,t,a=!0)=>(e===s.uB.TRIGGERS?i.xr[e].map(e=>t[e]?{id:e,title:t[e].label,icon:t[e].icon,type:t[e].type,appId:t[e].appId,categoryLabel:"internal"===t[e].group?"Slack":"",isCategory:!1}:null):i.xr[e].map(e=>t[e]?{id:e,title:t[e].title||"",type:t[e].type,appId:t[e].app_id||t[e].callback_id,categoryLabel:t[e].category_label,isCategory:!1,productLevelAvailability:{isAvailable:t[e].product_level_availability?.is_available??!0,availableTo:t[e].product_level_availability?.available_to}}:null)).filter(e=>{if(e?.id===u.Ez.case_step)return a;let n=t[e?.id||""];return!n||!("is_hidden"in n)||!n.is_hidden}).filter(n.b).slice(0,i.s),f=[m.A.BuiltIn,b,c.w.Event,c.w.Shortcut,c.w.Scheduled,c.w.Webhook,c.w.External,c.w.Service].reduce((e,t,a)=>(e[t]=a,e),{}),sortCategories=(e,t)=>{let a=f[getItemGroup(e)],n=f[getItemGroup(t)];return a!==n?a>n?1:-1:(0,r.Ay)(e.name,t.name)},g={[o.zW]:"from_a_link",[o.LO]:"on_a_schedule",[`${o.kr}${l.$.UserJoinedChannel}`]:"member_joins_channel",[`${o.kr}${l.$.ReactionAdded}`]:"emoji_reaction",[`${o.kr}${l.$.ListRecordUpdated}`]:"list_record_updated",[o.bX]:"from_webhook",[o.SJ]:"salesforce_event"},deriveHumanReadableTriggerId=(e,t,a)=>{let n=(0,d.k)(e),r=g[`${n}${t}`];if(r)return r;if(n===c.w.Service){let e=(a?.function.app?.name??"").replace(/\s/g,"").toLowerCase(),n=t.split("/").pop();return`${e}__${n}`}return t??n}},0x1ca293e13:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var n=a(0xbad225b5),r=a(0x11ad04567),l=a.n(r);let AvatarPaneContent=({children:e})=>n.createElement("div",{className:l().modal_main_content},e);AvatarPaneContent.displayName="AvatarPaneContent";let i=AvatarPaneContent},0x2440854b3:(e,t,a)=>{"use strict";a.d(t,{DV:()=>d,P1:()=>o,Vt:()=>l,Yh:()=>n,dW:()=>s,fw:()=>c,g_:()=>r,i_:()=>u,w3:()=>i});let n=128,r=2e3,l=460,i=2097152,s="too_small",o="too_large",c="max_size",d="invalid_type",u=["image/gif","image/png","image/jpeg"]},0x15ab42d61:(e,t,a)=>{"use strict";a.d(t,{_:()=>AvatarCropPane});var n=a(0xbad225b5),r=a(0x16cf1da63),l=a(0x20482ad21),i=a(0x11a296110),s=a(0x1e586fbba),o=a(0x127218dbe),c=a(0x1ca293e13),d=a(0x2440854b3),u=a(0x11ad11f0e),m=a(0x339b339c),p=a(0x113a45767),b=a(0x170214077),f=a(0x6792c5b4),g=a(0x1c9784a36),h=a.n(g);let _=new l.Ay("edit_profile"),AvatarCropPreview=({crop:e,minSize:t,maxSize:a,image:r,workflowName:l,workflowDescription:i})=>{let s=(0,n.useMemo)(()=>n.createElement(p.$,{crop:e,image:r,imageDisplaySize:a,previewDisplaySize:t}),[e,r,a,t]),o=(0,n.useMemo)(()=>({type:"message",ts:(0,u.A)(Date.now()),channel:"C12345678",text:"\xa1Hola Mundo!",user:"W1W832GG1"}),[]);return n.createElement("div",{className:h().crop_preview_image_container},n.createElement("div",{className:h().crop_preview_image_label},_.t("Preview")),n.createElement(f.A,{compact:s,light:s},n.createElement("strong",null,l),"\xa0\xa0",n.createElement(b.A,{msg:o}),n.createElement("br",null),n.createElement(n.Fragment,null,i||n.createElement(m.A,{size:"large"}))))};AvatarCropPreview.displayName="AvatarCropPreview";var y=a(0x24de3d958),x=a(0x20e80190e),v=a(0x1ed79bf71),E=a(0x6dbb4c86),k=a.n(E);let S=new l.Ay("workflow_builder"),AvatarCropPane=({onClose:e,setOnCropImagePane:t,switchPane:a,prevPane:l,avatarUrl:u="",workflowName:m,imageId:b="",workflowDescription:f,nextPane:g,showPreview:h=!0,setIconUrl:_})=>{let[E,w]=(0,n.useState)(!1),[C,A]=(0,n.useState)(!1),[T,I]=(0,n.useState)({height:36,width:36,x:0,y:0}),{cropData:N,imageData:M}=(0,y.K)(u,T),F=(0,r.wA)(),O=(0,n.useMemo)(()=>({width:M.width||36,height:M.height||36,src:M.src}),[M]),L=(0,n.useCallback)(()=>{t&&t(!1),a(l)},[l,t,a]),D=(0,n.useCallback)(()=>{w(!0),A(!1),F((0,v.z_)({x:N.fullCropX,y:N.fullCropY,width:N.fullCropSize,id:b})).then(({url:n=""})=>{_(n),g?(t&&t(!1),a(g)):e()}).catch(()=>{A(!0),w(!1)})},[F,N.fullCropX,N.fullCropY,N.fullCropSize,b,_,g,t,a,e]);return n.createElement(n.Fragment,null,n.createElement(x.rQ,null,n.createElement(o.A,{"data-qa":"avatar_crop_pane_back_button",onClick:L}),n.createElement(x.Rc,{"data-qa":"avatar_crop_pane_header",title:S.t("Crop your photo")})),n.createElement(x.$m,null,n.createElement(x.qf,{className:"center_content"},C&&n.createElement(s.A,null,S.t("Sorry! Something went wrong. Please try again.")),n.createElement("div",null,n.createElement(c.A,null,n.createElement(p.A,{className:k().cropper,imageSrc:u,maxSize:d.g_,minSize:d.Yh,onChange:I})),h&&n.createElement("div",{className:"center_content"},n.createElement(AvatarCropPreview,{crop:T,image:O,workflowName:m,workflowDescription:f,minSize:36,maxSize:d.Vt,avatarUrl:u}))))),n.createElement(x.jl,null,n.createElement(x.ox,null,n.createElement(i.Ay,{"data-qa":"avatar_crop_cancel_button",onClick:L,type:"outline"},S.t("Cancel")),n.createElement(i.lV,{"data-qa":"avatar_crop_save_button",loading:E,onClick:D,autoFocus:!0,"aria-label":S.t("Save")},S.t("Save")))))};AvatarCropPane.displayName="AvatarCropPane"},0xdac250:(e,t,a)=>{"use strict";a.d(t,{Z:()=>AvatarUploadPane});var n=a(0xbad225b5),r=a(0x20482ad21),l=a(0x11a296110),i=a(0xb1ea448c),s=a(0x127218dbe),o=a(0x1ca293e13),c=a(0x2440854b3),d=a(0x2395e748b),u=a(0x20f6327e1),m=a(0x1b3ecb90f),p=a(0x20e80190e),b=a(0xb1a6818e),f=a.n(b);let g=new r.Ay("workflow_builder");function AvatarUploadPane({file:e,prevPane:t,nextPane:a,switchPane:r,onClose:b,setOnCropImagePane:h}){let{status:_,avatarUrl:y,imageId:x,error:v}=(0,u.V)(e),E=(0,n.useCallback)(()=>r(t),[t,r]);(0,n.useEffect)(()=>{_===u.A.SUCCESS&&x&&y&&(a===d.n.CROP_IMAGE&&h&&h(!0),r(a,{imageId:x,avatarUrl:y}))},[y,x,a,h,_,r]);let k=g.t("Uploading your photo\u2026"),S=n.createElement(i.A,{size:"jumbo"});if(_===u.A.ERROR){let{errorEmoji:e,errorText:t,errorTitle:a}=(({error:e})=>e===c.fw?{errorTitle:g.t("Dang"),errorEmoji:":worried:",errorText:g.t("That\u2019s a very nice photo, but it\u2019s a bit too big. Try one that\u2019s smaller than 2 MB.")}:e===c.DV?{errorTitle:g.t("Dang"),errorEmoji:":worried:",errorText:g.t("Profile photos must be GIFs, JPGs or PNGs.")}:e===c.dW?{errorTitle:g.t("Dang"),errorEmoji:":worried:",errorText:g.t("That\u2019s a very nice photo, but it\u2019s a bit too small. Try one that\u2019s larger than 128x128.")}:e===c.P1?{errorTitle:g.t("Dang"),errorEmoji:":worried:",errorText:g.t("That\u2019s a very nice photo, but it\u2019s a bit too big. Try one that\u2019s smaller than 2000x2000.")}:{errorTitle:g.t("Eek"),errorEmoji:":frowning:",errorText:g.t("Sorry! Something went wrong. Please try again.")})({error:v});k=a,S=n.createElement("div",{className:f().error_container},n.createElement(m.Ay,{emojiSize:m.lw.LARGE,forceDisplay:!0,text:e}),n.createElement("br",null),n.createElement("strong",{className:f().error_text,"data-qa":"avatar_upload_error_text"},t))}return n.createElement(n.Fragment,null,n.createElement(p.rQ,null,n.createElement(s.A,{"data-qa":"avatar_upload_back_button",onClick:E}),n.createElement(p.Rc,{"data-qa":"avatar_upload__title-bar",title:k})),n.createElement(p.$m,null,n.createElement(p.qf,{className:"center_content"},n.createElement(o.A,null,S))),n.createElement(p.jl,null,n.createElement(p.ox,null,n.createElement(p.s_,{type:"outline",autoFocus:!v,onClick:b,"aria-label":g.t("Cancel")},g.t("Cancel")),_===u.A.ERROR&&n.createElement(l.Ay,{"data-qa":"avatar_upload_retry_button",onClick:E},g.t("Try a Different Image")))))}AvatarUploadPane.displayName="AvatarUploadPane"},0x1bcdab91d:(e,t,a)=>{"use strict";a.d(t,{a:()=>CollapsibleListItemError});var n=a(0xbad225b5),r=a(0x12edaa96a),l=a(0x9f7220f0),i=a(0x15f8e452a),s=a(0x131edc88b),o=a.n(s);let CollapsibleListItemError=({message:e})=>n.createElement("div",{className:o().container},n.createElement(i.A,{inline:!0,type:"info-circle",size:"inherit"}),n.createElement(l.z,{assertive:!0,uuid:(0,r.A)()},n.createElement("span",null,e)));CollapsibleListItemError.displayName="CollapsibleListItemError"},0x98b4cc3b:(e,t,a)=>{"use strict";a.d(t,{k:()=>h});var n=a(0xbad225b5),r=a(0x120c268ad),l=a.n(r),i=a(0x1cbdfeceb),s=a(0x20482ad21),o=a(0x11a296110),c=a(0x2501a2cee),d=a(0xe9c32bb),u=a(0x1bcdab91d);let m=new s.Ay("workflow_builder"),p=(0,n.memo)(({direction:e,disabled:t,onClick:a=i.A,...r})=>n.createElement(o.Ay,{...r,disabled:t,onClick:a,type:"outline",size:"large",icon:`arrow-large-${e}`,"aria-label":"up"===e?m.t("Move Up"):m.t("Move Down")}));var b=a(0x18fa00e62),f=a.n(b);let g=new s.Ay("workflow_builder"),h=(0,n.memo)(({canCollapse:e=!0,canEdit:t=!0,canMoveDown:a=!1,canMoveUp:r=!1,canRemove:s=!1,children:m=null,iconType:b="css",isExpanded:h=!1,errorMessage:_=null,label:y="",onCollapse:x=i.A,onEdit:v=i.A,onMoveDown:E=i.A,onMoveUp:k=i.A,onRemove:S=i.A,showEditButton:w=!0,showEditorFooter:C=!0,showMoveButtons:A=!1,removeButtonAriaLabel:T,editButtonAriaLabel:I,collapseButtonAriaLabel:N,forceNoBorder:M=!1,previewInfo:F,collapsedListItemClassName:O,expandedListItemClassName:L,shouldAlignTop:D=!1,filledEditButton:P=!1})=>{let R=(0,n.useCallback)(e=>{e.preventDefault(),x(e)},[x]);return h?n.createElement("li",{className:l()(f().container_form,L),"data-qa":"collapsible-list-item--expanded"},n.createElement("form",{onSubmit:R},m,C&&n.createElement("div",{className:f().footer},n.createElement(o.Ay,{type:"danger",size:"small",disabled:!s,onClick:S,"aria-label":T,"data-qa":"collapsible-list-item__delete"},g.t("Delete")),n.createElement(o.Ay,{htmlType:"submit",type:"outline",size:"small",disabled:!e,"aria-label":N,"data-qa":"collapsible-list-item__done"},g.t("Done"))))):n.createElement("li",{className:l()(f().container,O,{[f().add_top_border]:!M,[f().align_top]:D}),"data-qa":"collapsible-list-item--collapsed"},n.createElement("div",null,F??n.createElement("div",{className:f().info},n.createElement(d.HL,null,n.createElement("span",{className:f().icon},n.createElement(c.Ah,{inline:!0,name:b,size:"inherit"}))),y&&n.createElement("span",{className:f().label},y),_&&n.createElement(u.a,{message:_})),n.createElement("div",{className:f().actions},A&&n.createElement("div",null,n.createElement(p,{direction:"up",disabled:!r,onClick:k,"data-qa":"collapsible-list-item__move-up"}),n.createElement(p,{className:"margin_left_25",direction:"down",disabled:!a,onClick:E,"data-qa":"collapsible-list-item__move-down"})),w&&n.createElement("div",{className:l()({[f().filledEditButton]:P})},n.createElement(o.Ay,{"aria-label":I??g.t("Edit"),icon:"pencil",disabled:!t,onClick:v,size:"large",type:"outline","data-qa":"collapsible-list-item__edit"})))))})},0x1c244e721:(e,t,a)=>{"use strict";a.d(t,{W:()=>onVariableMenuOpenClog});var n=a(0x23a4b0853);function onVariableMenuOpenClog(e,t){let{uiArgs:a,uiProperties:r,wbArgs:l}=t;(0,n.K$)({clogger:e,uiArgs:a,uiProperties:r,wbArgs:l})}},0x16e99b359:(e,t,a)=>{"use strict";a.d(t,{l:()=>Select});var n=a(0xbad225b5),r=a(0x120c268ad),l=a.n(r),i=a(0x1cbdfeceb),s=a(0x12edaa96a),o=a(0x1e586fbba),c=a(0x1d1911997),d=a(0xe53aa0),u=a(0x1312f060e),m=a(0x93f78b39),p=a(0x1b3ecb90f),b=a(0x15a4ffb05),f=a(0x207fb9b92),g=a(0x77627b71),h=a.n(g);let Select=({className:e,options:t,value:a,id:r,placeholder:g,required:_=!1,errorText:y,isInvalid:x=!1,onChange:v,dataQa:E,...k})=>{let S=(0,n.useMemo)(()=>`${(0,s.A)()}-${t.length}`,[t]),w=(0,n.useMemo)(()=>{let e=null;return t.some(t=>!!(Array.isArray(t.options)&&(e=t.options.find(e=>e.value===a)))||(!!(0,d.X)(t)&&t.id===a||t.value===a)&&(e=t,!0)),e||null},[t,a]),C=(0,n.useCallback)((e={})=>(0,d.X)(e)?v(e.id,e):v(e.value,e),[v]),{onBlur:A,errorText:T}=(0,f.K)({errorMessage:y,isErrored:x}),I=(0,n.useCallback)(e=>(0,d.X)(e)?null:n.isValidElement(e.label)?e.label:n.createElement("div",{className:l()(h().plainTextSelectOptions,"p-block-kit-select_options")},n.createElement(b.A,{text:e.label,emojiSize:p.lw.MEDIUM})),[]),N=(0,n.useCallback)(e=>{let t=e.value?.[0]?.elements?.[0];if(!(0,u.B)(t)||!t.elements)return null;let a=e.value[0].type;return n.createElement("div",{className:"p-block-kit-select_options"},n.createElement(m.A,{type:a,elements:t.elements,disableHighlights:!1,inline:!0,clogLinkClick:i.A,noInlineLinks:!0,alwaysDisplayMentionsAsLinks:!0,disableJumboEmoji:!0}))},[]),M=(0,n.useMemo)(()=>(0,d.X)(t[0]),[t]);return n.createElement("div",{className:l()(h().container,e,{[h().invalid]:!!T})},n.createElement(c.Ay,{key:S,options:t,width:"100%",selectId:r,selectedOption:w,onOptionSelected:C,placeholderText:g,isRequired:_,onBlur:A,isInvalid:!!T,selectDataQa:E,renderSelectedOption:M?N:I,renderOption:M?N:I,...k}),!!T&&n.createElement(o.A,null,T))};Select.displayName="Select"},0x1d898b34c:(e,t,a)=>{"use strict";a.d(t,{v:()=>HermesWorkflowMetadataDialog});var n=a(0xbad225b5),r=a(0x20482ad21),l=a(0x11a296110),i=a(0x1d2cd7755),s=a(0x126f22530),o=a(0x1e586fbba),c=a(0x1b7f0cd57),d=a(0xa3743afa),u=a(0x16cf1da63),m=a(0x16475a65c),p=a(0x72b537b5),b=a(0xe874a88a),f=a(0x205f4fb61),g=a(0x16ac9b089),h=a(0x2264e6ea3),_=a(0x1faa3f1ac),y=a(0x143f89715),x=a(0x253c586a2),v=a(0x7f5a02e8),E=a(0xe9c32bb),k=a(0x1d1a513a),S=a(0x16e99b359),w=a(0xf4030543),C=a(0x220757cb0),A=a(0x20570d71a),T=a(0x13c8b082e),I=a(0x23a4b0853),N=a(0x10d53599f),M=a(0x19dc73101),F=a(0x23198a843),O=a(0x238b287cf),L=a(0x1bb9b9e21),D=a(0xa1832ae4),P=a(0xb8504a42),R=a(0x3711e82d),B=a(0x16ed1b0dc),W=a(0x4f725d55),V=a(0x66c6b26d),q=a(0x20adb28cd),H=a(0x4e250925),U=a(0x226892387),z=a(0x1ee439e69),j=a(0x1b1df7714),$=a.n(j);let G=new r.Ay("workflow_builder"),renderMemberOption=e=>n.createElement(N.A,{id:e.value}),PermissionsSettingsModalSection=({onPermissionsErrorChange:e,showMore:t=!1},a)=>{let r=(0,p.U)(),l=(0,O.A)(),s=(0,u.wA)(),o=(0,A.Y)(),c=(0,U.d4)(z.H7),d=(0,D.ZT)(c),N=(0,D.F1)(c),j=(0,P.kA)(c),K=(0,U.d4)((0,V.sx)(o,q.u6)),Y=(0,U.d4)((0,V.sx)(o,q.Ds)),Q=(0,U.d4)((0,V.sx)(o,q.Sg)),Z=(0,U.d4)((0,V.sx)(o,q.Zx)),J=(0,U.d4)((0,V.sx)(o,q.uY)),[X,ee]=(0,n.useState)(t),et=G.t("Permissions"),ea=(0,U.d4)(e=>(0,L.X)(e,J)),en=(0,U.d4)(e=>{let t=(0,z._J)(e,ea);if(t)return(0,D.F1)(t)}),er=(0,U.d4)((0,V.sx)(o,q.gT)),el=en||N,[ei,es]=(0,n.useState)(er),[eo,ec]=(0,n.useState)(Z),[ed,eu]=(0,n.useState)(K||"everyone"),em=(0,U.Z2)(e=>{let[t]=(0,q.e5)(e,eo);return t}),{isTeamValidSCWorkflowTarget:ep}=(0,k.u)(o),eb=(0,n.useMemo)(()=>em.some(e=>!ep(e)),[ep,em]),[ef,eg]=(0,n.useState)(Y?.slice()||[]),eh=(0,n.useMemo)(()=>ef.map(e=>({label:e,value:e})),[ef]),e_=G.t("Everyone in {teamName}",{teamName:(0,g.Ay)(el)}),ey=G.t("Workflow managers only"),ex=(0,n.useMemo)(()=>[{value:"everyone",label:e_},{value:"collaborators",label:ey}],[ey,e_]),ev=G.t("No selection"),eE=(0,n.useMemo)(()=>{let e=ex.find(e=>e.value===ed);return e?e.label:ev},[ex,ev,ed]),ek=0===ef.length,eS=0===eo.length,ew=eo.length>w.y,eC=G.t("You must provide at least 1 workflow manager"),eA=G.t("You must select users, channels, or workspaces"),eT=G.t("Workflow access is limited to a total of {entitiesLimit} users, channels, or workspaces. Remove {amountToRemove} to save.",{entitiesLimit:(0,f.ZV)(w.y),amountToRemove:(0,f.ZV)(eo.length-w.y)}),eI=(0,n.useMemo)(()=>{let e=[];return ek&&e.push({id:"empty_collaborators",message:eC}),e},[eC,ek]),eN=(0,n.useMemo)(()=>{let e=[];return ei===T.PW.named_entities&&eS&&e.push({id:"empty_entities_with_run_access",message:eA}),ew&&e.push({id:F.S.TooManyNamedEntities,message:eT}),e},[eA,ew,eS,ei,eT]),eM=(0,n.useCallback)(e=>{let t=e.map(({value:e})=>e);eg(t),ei===T.PW.named_entities&&ec([...new Set([...t,...eo])])},[eo,ei,eg]),eF=(0,n.useCallback)(e=>{("everyone"===e||"collaborators"===e)&&eu(e)},[]),eO=(0,n.useCallback)(async()=>{let e=(0,m.A)(Y,ef),t=(0,m.A)(ef,Y);t.length>0&&await s((0,H.gP)({workflowId:o,collaborators:t})),e.length>0&&await s((0,H.i9)({workflowId:o,collaborators:e}))},[o,Y,s,ef]),eL=(0,n.useCallback)(({userIds:e,channelIds:t,teamIds:a,orgIds:n})=>{let{userIds:r=[],channelIds:l=[],teamIds:i=[],orgIds:s=[]}=Q??{},o=(0,m.A)(e,r).length>0||(0,m.A)(t,l).length>0||(0,m.A)(a,i).length>0||(0,m.A)(n,s).length>0,c=(0,m.A)(r,e).length>0||(0,m.A)(l,t).length>0||(0,m.A)(i,a).length>0||(0,m.A)(s,n).length>0;return o||c},[Q]),eD=(0,n.useCallback)(async()=>{let e=[],t=[],a=[],n=[];eo.forEach(r=>{(0,W.A)(r)&&e.push(r),(0,B.A)(r)&&t.push(r),(0,h.Ay)(r)&&a.push(r),(0,h.JV)(r)&&n.push(r)});let r=e.length>0?e:void 0,l=t.length>0?t:void 0,i=a.length>0?a:void 0,c=n.length>0?n:void 0,u=[];if(ei!==Q?.permissionType||eL({userIds:e,channelIds:t,teamIds:a,orgIds:n})){let e=ei,t={};ei===T.PW.everyone&&(i||c)?(e=T.PW.named_entities,t={teamIds:j?i:[d].concat(i||[]),orgIds:j?[d].concat(c||[]):c}):ei===T.PW.named_entities&&(t={userIds:r,channelIds:l,teamIds:i,orgIds:c}),u.push(s((0,H.$N)({workflowId:o,permissionType:e,...t})))}return b.S.all(u)},[eL,d,s,j,eo,ei,Q,o]),eP=(0,n.useCallback)(async()=>{if(ed!==K)return s((0,H.ZU)({workflowId:o,permissionType:ed}))},[K,s,ed,o]);(0,n.useEffect)(()=>{(0,I.Vb)({clogger:l,uiArgs:{step:R.UiStep.WORKFLOW_PERMISSIONS},wbArgs:{workflow_id:o,is_hermes:!0}})},[l,o]),(0,n.useEffect)(()=>{e&&e(eb||(0,y.A)(eI,r)||(0,y.A)(eN,r))},[eI,eN,eb,e,r]),(0,n.useImperativeHandle)(a,()=>({updateCollaborators:eO,updateTriggerRunPermissions:eD,updateCopyPermissions:eP}),[eO,eP,eD]);let eR=(0,n.useCallback)(()=>{ee(!0)},[]);return n.createElement("div",{className:"padding_top_50 padding_bottom_125"},n.createElement(E.Pd,{element:"h1",className:"margin_bottom_150",weight:"bold"},et),n.createElement(C.B,{currentTeamId:d,teamName:el,selectedRunAccessOption:ei,setRunAccessOption:es,selectedEntitiesWithRunAccess:eo,setSelectedEntitiesWithRunAccess:ec,entitiesWithRunAccessErrors:eN,selectedCollaborators:ef,selectedExternalEntities:em,hasExternalEntititesDriftedFromSCPrefs:eb}),X?n.createElement(n.Fragment,null,n.createElement(i.A,{htmlFor:"copy-access-select",text:G.t("Who can copy this workflow?")},n.createElement(S.l,{id:"copy-access-select",value:ed||"",options:ex,placeholder:eE,ariaLabel:G.t("Default selection"),onChange:eF,required:!0,errorText:"","data-qa":"copy-access-select"})),n.createElement(i.A,{htmlFor:"collaborators-multi-select",text:G.t("Workflow managers")},n.createElement(M.h,{width:"100%",className:"margin_bottom_50",selectDataQa:"collaborators-multi-select",selectId:"collaborators-multi-select",isInvalid:eI.length>0,errors:eI,renderOption:renderMemberOption,searcherOptions:(0,v.Zq)(x.Df,{externalWorkspaceToSearchOn:ea}),selectedOptions:eh,onSelectedItemsChange:eM,focusOnMount:!0}),n.createElement("span",{className:$().helpText},G.t("Can edit, publish, and delete this workflow")))):n.createElement("div",null,n.createElement(_.A,{onClick:eR,"data-qa":"show-more-permissions-link"},G.t("Show more permissions"))))};PermissionsSettingsModalSection.displayName="PermissionsSettingsModalSection";let K=(0,n.forwardRef)(PermissionsSettingsModalSection);var Y=a(0x1e813d5b2),Q=a(0x1a5ac3a0c),Z=a(0x126af815a),J=a(0x937a43ca),X=a(0x1d1437423),ee=a(0x19178121a),et=a.n(ee);let ea=new r.Ay("workflow_builder"),HermesWorkflowMetadataDialog=({switchPane:e,workflowName:t,workflowId:a,workflowDescription:r,workflowIconUrl:u,setWorkflowDescription:m,setWorkflowName:p,hasSaveError:b,paneType:f,nameIsInvalid:g,selectedWorkflow:h,onPermissionsErrorChange:_,permissionSettingsHandlersRef:y})=>{let x=(0,n.useRef)(null),v=(0,n.useRef)(null),E=(0,U.d4)((0,V.sx)(a,q.RG)),k=h||E,S=(0,n.useRef)(null),w=(0,n.useMemo)(()=>k?.trigger?(0,Q.eG)(k.trigger,k?.coachmarkData):void 0,[k]),C=w?.type,A=Z.zW===C,T=(0,n.useCallback)(()=>S?.current?.click(),[]),I=(0,n.useCallback)(t=>{let a=(t.target.files||[])[0];a&&e(f,{file:a})},[f,e]),N=(0,n.useMemo)(()=>(0,J.yA)(t),[t]),M=(0,n.useMemo)(()=>new Set((0,J.QM)(t)),[t]),F=(0,n.useMemo)(()=>(0,J.Zb)(t),[t]),O=(0,n.useMemo)(()=>(0,J.L8)(t),[t]),L=(0,n.useMemo)(()=>t===ea.t("Untitled Workflow"),[t]),D=(0,n.useMemo)(()=>r===ea.t("A brand new workflow"),[r]),P=(0,n.useMemo)(()=>N?ea.t("Whoops! That name is reserved."):M.size?ea.rt("Choose a name without these special characters: <b>{characters}</b> ",{characters:[...M].join(" ")}):F?ea.t("Workflow names can\u2019t support special characters (i.e. !#$%&)."):O?ea.t("Whoops! Workflow names cannot have emojis."):t.length>d.p?ea.t("You can\u2019t enter more than {maxLength} characters.",{maxLength:d.p}):ea.t("This field is required."),[M,F,N,O,t.length]),{onChange:R,errorText:B}=(0,X.x)({errorMessage:P,isErrored:g}),W=(0,n.useCallback)(e=>{p(e),R()},[R,p]),H=(0,n.useCallback)(()=>{x.current&&L&&x.current?.select()},[L]),z=(0,n.useCallback)(()=>{v.current&&D&&v.current?.select()},[D]);(0,n.useEffect)(()=>{W(t)},[]);let j=ea.t("Something short and descriptive"),$=ea.t("What is this workflow for?"),G=(0,n.useMemo)(()=>{if(k)return{...k,workflow:{...k.workflow,title:t,description:r,icons:{image_192:u,image_96:u}}}},[k,t,r,u]);return n.createElement(n.Fragment,null,n.createElement("div",{className:et().workflow_metadata_section},n.createElement("div",{className:et().workflow_avatar_upload},n.createElement(c.R,{className:et().workflow_avatar_icon_improvement,iconSrcUrl:u,altText:t,size:"large"}),n.createElement("input",{className:et().file_input,type:"file",accept:"image/jpeg,image/gif,image/png",onChange:I,ref:S,"aria-hidden":"true",tabIndex:-1,hidden:!0}),n.createElement(l.Ay,{type:"outline",size:"small",onClick:T,className:et().choose_file_icon,"data-qa":"workflow-details-modal-icon-button","aria-label":ea.t("Upload workflow avatar image")},ea.t("Upload"))),n.createElement("div",{className:et().workflow_metadata_form},n.createElement(i.A,{className:et().workflow_name_form,text:ea.t("Name")},n.createElement(s.A,{id:"workflow-details-modal_name",type:"text",maxCharacterLimit:d.p,name:"name",value:t,onChange:W,placeholder:j,errorText:B,autoComplete:"off",focusOnMount:!0,inputRef:x,onFocus:H,className:"margin_bottom_50","data-qa":"workflow-details-modal-name__input",useInlineAlert:!0,hintId:"workflow_naming_hint"}),n.createElement("span",{className:et().workflow_naming_help_text,id:"workflow_naming_hint"},ea.t('Workflow names can\u2019t use punctuation marks and certain special characters, for example: ! ? @ # % + & $ * : " , / [ ]'))),n.createElement(i.A,{text:ea.t("Description")},n.createElement(s.A,{id:"workflow-details-modal_description",type:"text",maxCharacterLimit:d.p,minCharacterLimit:d.H,name:"description",value:r,onChange:m,placeholder:$,inputRef:v,onFocus:z,"data-qa":"workflow-details-modal-description__input",useInlineAlert:!0,isRequired:!0})))),_&&y&&n.createElement(K,{onPermissionsErrorChange:_,ref:y}),G&&A&&n.createElement(Y.Q,{workflow:G.workflow,trigger:G.trigger,workflowName:t,workflowDescription:r}),b&&n.createElement(o.A,{"data-qa":"workflow-details-modal-description-error"},ea.t("There was an error updating your workflow.")))};HermesWorkflowMetadataDialog.displayName="HermesWorkflowMetadataDialog"},0xa3743afa:(e,t,a)=>{"use strict";a.d(t,{H:()=>n,p:()=>r});let n=1,r=80},0x2395e748b:(e,t,a)=>{"use strict";a.d(t,{n:()=>n});let n={WORKFLOW_DETAILS:"workflow_details",UPLOAD_IMAGE:"upload_image",CROP_IMAGE:"crop_image"}},0x3c5a1598:(e,t,a)=>{"use strict";a.d(t,{R:()=>R});var n=a(0xbad225b5),r=a(0x16cf1da63),l=a(0x120c268ad),i=a.n(l),s=a(0x20482ad21),o=a(0xf3c40abe),c=a(0x11a296110),d=a(0x4c96e5d9),u=a(0x1b7f0cd57),m=a(0xe9c32bb),p=a(0x24546e7f2),b=a(0x15ab42d61),f=a(0xdac250),g=a(0x2395e748b),h=a(0x1d898b34c),_=a(0xa3743afa),y=a(0x937a43ca),x=a(0x20e80190e),v=a(0x4e250925);let E=new s.Ay("workflow_builder"),WorkflowDetailsModalPane=({onClose:e,switchPane:t,workflowName:a,workflowId:l,workflowDescription:i,workflowIconUrl:s,setWorkflowDescription:o,setWorkflowName:d,updateWorkflowMetaDataCallback:u,selectedWorkflow:m})=>{let p=(0,r.wA)(),[b,f]=(0,n.useState)(!1),[k,S]=(0,n.useState)(!1),w=(0,y.nM)(_.p,a),C=(0,y.Qe)(_.p,i),A=w||k||C,T=(0,n.useCallback)(async()=>{try{S(!0),f(!1);let t=await p((0,v.QC)({name:a,description:i,iconUrl:s,selectedWorkflow:m,workflowId:l}));t&&u&&u(t),e()}catch{S(!1),f(!0)}},[p,a,i,s,m,l,u,e]);return n.createElement(n.Fragment,null,n.createElement(x.rQ,null,n.createElement(x.Rc,{title:E.t("Workflow Details")})),n.createElement(x.$m,null,n.createElement(x.qf,null,n.createElement(h.v,{switchPane:t,workflowName:a,workflowId:l,workflowDescription:i,workflowIconUrl:s,setWorkflowDescription:o,setWorkflowName:d,hasSaveError:b,paneType:g.n.UPLOAD_IMAGE,nameIsInvalid:w,selectedWorkflow:m}))),n.createElement(x.jl,null,n.createElement(x.ox,null,n.createElement(x.s_,{onClick:e,type:"outline","aria-label":E.t("Cancel")},E.t("Cancel")),n.createElement(c.lV,{type:"primary",onClick:T,disabled:A,loading:k,"data-qa":"first_publish-next__button","aria-label":E.t("Save")},E.t("Save")))))};WorkflowDetailsModalPane.displayName="WorkflowDetailsModalPane";var k=a(0x20570d71a),S=a(0x1a5ac3a0c),w=a(0x145d46a61),C=a(0x66c6b26d),A=a(0x20adb28cd),T=a(0x226892387),I=a(0x1fcbb004d),N=a(0x17f19ec0c),M=a.n(N);let F=new s.Ay("workflow_builder"),HermesWorkflowMetadataModal=({selectedWorkflow:e,updateWorkflowMetaDataCallback:t})=>{let a=(0,r.wA)(),l=(0,T.d4)(w.tQ),s=(0,k.Y)(),o=(0,T.d4)((0,C.sx)(s,A.RG)),c=e||o,d=(0,S.BQ)(c),u=c?(0,S.yL)(c):"",m=(0,S.DU)(c),[h,_]=(0,n.useState)(!1),[y,x]=(0,n.useState)((u||"").replace(/[()]/g,"")),[v,E]=(0,n.useState)((d||"").replace(/[()]/g,"")),[N,O]=(0,n.useState)(m||""),L=(0,n.useCallback)(()=>{a((0,I.O)()),_(!1)},[a]),D=F.t("Workflow Details"),P=F.t("Edit Avatar Upload"),R=F.t("Edit Avatar Crop"),B=(0,n.useMemo)(()=>({[g.n.WORKFLOW_DETAILS]:{render:e=>n.createElement(WorkflowDetailsModalPane,{onClose:L,workflowName:v,workflowId:s,workflowDescription:y,workflowIconUrl:N,setWorkflowDescription:x,setWorkflowName:E,updateWorkflowMetaDataCallback:t,selectedWorkflow:c,...e}),modalProps:{contentLabel:D}},[g.n.UPLOAD_IMAGE]:{render:e=>n.createElement(f.Z,{onClose:L,nextPane:g.n.CROP_IMAGE,prevPane:g.n.WORKFLOW_DETAILS,setOnCropImagePane:_,...e}),modalProps:{contentLabel:P}},[g.n.CROP_IMAGE]:{render:e=>n.createElement(b._,{workflowName:v,workflowDescription:u,onClose:L,nextPane:g.n.WORKFLOW_DETAILS,prevPane:g.n.WORKFLOW_DETAILS,showPreview:!1,setOnCropImagePane:_,setIconUrl:O,...e}),modalProps:{contentLabel:R}}}),[D,P,R,L,v,y,N,t,c,s,u]);return n.createElement(p.A,{centered:!l,closeModal:L,dataQa:"workflow_builder_metadata_edit_modal",defaultPane:g.n.WORKFLOW_DETAILS,overlayClassName:i()({[M().modalOverlay]:l}),panes:B,showCloseButton:!h})};HermesWorkflowMetadataModal.displayName="HermesWorkflowMetadataModal";var O=a(0x46dbff89),L=a(0x12cdb23b0),D=a.n(L);let P=new s.Ay("workflow_builder"),PrimitiveHermesWorkflowMetadata=({name:e,icon:t,description:a,badgeText:l,canEdit:s=!1,hasKeyboardFocus:o,onEditClick:p,isClientBuilder:b=!1})=>{let f=P.t("Edit workflow title, description, or avatar"),g=P.t("Edit details",{fallbackHash:"0a49b64a50b81012b504c1a11b676ee14f396601"}),h=(0,r.wA)(),_=(0,n.useCallback)(()=>{if(s){if(p)return void p();h((0,O.q)({element:n.createElement(HermesWorkflowMetadataModal,null)}))}},[s,p,h]);return s?n.createElement(d.Ay,{position:"right",tip:g},n.createElement(c.Nm,{className:i()(D().container,{[D().can_edit]:s,[D().isClientBuilder]:b}),onClick:_,autoFocus:o,"data-qa":"edit-workflow-metadata","aria-label":f},n.createElement(u.R,{size:b?"small":"medium",iconSrcUrl:t,altText:e,className:D().headerAvatar}),n.createElement("div",{className:D().nameContainer},n.createElement("div",{className:D().name},n.createElement(m.Pd,{element:"h1"},e),l&&n.createElement("span",{className:D().badge},l)),n.createElement(m.nB,{className:D().description},a)))):n.createElement("span",{className:i()(D().container,{[D().isClientBuilder]:b}),"data-qa":"no-edit-workflow-metadata",role:"heading","aria-level":1},n.createElement(u.R,{iconSrcUrl:t,altText:e,className:D().headerAvatar}),n.createElement("div",null,n.createElement("div",{className:D().name},n.createElement(m.Pd,{element:"h1"},e),l&&n.createElement("span",{className:D().badge},l)),n.createElement(m.nB,{className:D().description},a)))};PrimitiveHermesWorkflowMetadata.displayName="PrimitiveHermesWorkflowMetadata";let R=(0,o.A)(PrimitiveHermesWorkflowMetadata)},0xf4030543:(e,t,a)=>{"use strict";a.d(t,{y:()=>n});let n=100},0x220757cb0:(e,t,a)=>{"use strict";a.d(t,{B:()=>TriggerRunSettings});var n,r=a(0xbad225b5),l=a(0x120c268ad),i=a.n(l),s=a(0x16475a65c),o=a(0xf2e7528e),c=a(0x1d24ec95f),d=a(0x72b537b5),u=a(0x20b4dda68),m=a(0x20482ad21),p=a(0x16ac9b089),b=a(0x45bd075),f=a(0x1d2cd7755),g=a(0x143f89715),h=a(0x4c96e5d9),_=a(0x7f5a02e8),y=a(0x1d1a513a),x=a(0x16e99b359),v=a(0x124d99cb0),E=a(0x24430233d),k=a(0x6960d8b9),S=a(0x1ccef1c6f),w=a(0x226892387);let C=new m.Ay("workflow_builder"),ScheduledTriggerRunAccessHelpText=({className:e,trigger:t})=>{let a=(0,w.d4)(e=>(0,S.ty)(e,"time24")),{schedule:n}=t.config,l=(0,v.lP)(n.startTime,n.timezone),i=(0,k.Od)(l,{excludeYear:!0,uncapitalizedRelativeDay:!0}),s=l.format(a?"HH:mm":"h:mm A"),o=(0,E.o)(n);return r.createElement("span",{className:e},C.rt("This is a scheduled workflow. Next run {humanReadableDate} at {humanReadableTime}{humanReadableRepeat}.",{humanReadableDate:i,humanReadableTime:s,humanReadableRepeat:""===o?o:` ${o}`}))};ScheduledTriggerRunAccessHelpText.displayName="ScheduledTriggerRunAccessHelpText";var A=a(0x126af815a),T=a(0x13c8b082e),I=a(0x1f66b5878),N=a(0x1887ed0ea),M=a(0x1b1df7714),F=a.n(M);let O=new m.Ay("workflow_builder"),TriggerRunAccessHelpText=({workflowId:e,isAllowExternalOrgsChecked:t=!1,permissionType:a,trigger:n})=>{let l=(0,w.d4)(e=>(0,I.p$)(e,"hermes_triggers_trippable_by_slack_connected_teams")),i=(0,w.d4)(N.M7),{isTrippableByAnySlackConnectedTeamByPrefs:s}=(0,y.u)(e),o=n.type===A.LO,c=n.type===A.zW;return o?r.createElement(ScheduledTriggerRunAccessHelpText,{className:F().helpText,trigger:n}):a===T.PW.app_collaborators?r.createElement("span",{className:F().helpText},O.t("Only workflow managers can find and use this workflow",{fallbackHash:"45866bc2093eb04b2e05464a6d10af2a7d575c0d"})):a===T.PW.named_entities?r.createElement("span",{className:F().helpText},c?O.t("Only people in this list can find and use this workflow."):O.t("Only people in this list can find this workflow.")):(!i&&l||i&&s)&&a===T.PW.everyone&&t?r.createElement("span",{className:F().helpText},O.t("All new connected external orgs will need to be manually added.")):null};TriggerRunAccessHelpText.displayName="TriggerRunAccessHelpText";var L=a(0x2264e6ea3),D=a(0x15bd59d31),P=a(0x10d53599f),R=a(0x1de80d519),B=a(0x16ed1b0dc),W=a(0x4f725d55);let TriggerRunSettingsListEntity=({option:e})=>{let t=e.value,a=null;return(0,W.A)(t)?a=r.createElement(P.A,{id:t,"data-qa":"trigger-run-settings-list-entity-member"}):(0,B.A)(t)?a=r.createElement(D.A,{channelId:t,"data-qa":"trigger-run-settings-list-entity-channel"}):((0,L.Ay)(t)||(0,L.JV)(t))&&(a=r.createElement(R.e,{id:t,"data-qa":"trigger-run-settings-list-entity-team"})),a};TriggerRunSettingsListEntity.displayName="TriggerRunSettingsListEntity";var V=a(0x20570d71a),q=a(0x1a5ac3a0c),H=a(0x19dc73101),U=a(0x12cc25ec2),z=a(0x23198a843),j=a(0xf09fa16e),$=a(0x9b971e7e),G=a(0x66c6b26d),K=a(0x20adb28cd),Y=a(0x358bddfc),Q=a(0x14149c126),Z=a(0x1cbba0fb),J=a(0x8b08ad98),X=a.n(J);let ee=new m.Ay("workflow_builder");var et=((n=et||{}).IS_WORKFLOW_RESTRICTED="is_workflow_restricted",n.IS_EXTERNAL_TEAM_INVALID="is_external_team_invalid",n.GENERIC_DRIFT_ERROR="is_invalid_existing_external_target",n);let TriggerRunSettings=({currentTeamId:e,teamName:t,selectedRunAccessOption:a,setRunAccessOption:n,selectedEntitiesWithRunAccess:l,setSelectedEntitiesWithRunAccess:m,entitiesWithRunAccessErrors:v,selectedCollaborators:E,selectedExternalEntities:k,hasExternalEntititesDriftedFromSCPrefs:S,overrideTrigger:C,overrideWorkflowConnectionsPrefs:M,overrideWorkflowRetrictions:F,overridePermissions:O})=>{let L=(0,d.U)(),D=(0,j.A)(),P=(0,V.Y)(),R=(0,w.d4)(e=>(0,Z.yz)(e,"available")),B=(0,w.d4)((0,G.sx)(P,K.RG)),W=(0,w.d4)(N.M7),J=(0,w.d4)(e=>"on"===(0,Q._Z)(e,"wfb_acl_translation")),et=(0,w.d4)(e=>M||(0,K.NN)(e,P)),ea=(0,r.useMemo)(()=>B?.trigger?(0,q.eG)(B.trigger,B.coachmarkData):void 0,[B]),en=C??ea,er=(0,w.d4)(e=>(0,I.p$)(e,"hermes_triggers_trippable_by_slack_connected_teams")),{isTrippableByAnySlackConnectedTeamByPrefs:el,isTeamValidSCWorkflowTarget:ei,workflowRestrictedStatus:es}=(0,y.u)(P,M,F),eo=(0,w.d4)(e=>F?F.is_restricted:(0,K.lW)(e,P)),ec=(0,w.d4)($.Kc),ed=(0,w.d4)(e=>(0,K.kS)(e,P,k,O)),[eu,em]=(0,r.useState)(k.length>0),ep=k.length>0||el&&a!==T.PW.app_collaborators,eb=ee.t("Everyone internal in {teamName}",{teamName:(0,p.Ay)(t)}),ef=J?ee.t("Workflow managers, plus specific people, channels, and workspaces"):"Workflow managers, plus specific people, channels, and workspaces",eg=ee.t("Workflow managers only"),eh=(0,r.useMemo)(()=>[{label:eb,value:T.PW.everyone},{label:ef,value:T.PW.named_entities},{label:eg,value:T.PW.app_collaborators}],[eg,eb,ef]),e_=ee.t("No selection"),ey=(0,r.useMemo)(()=>{let e=eh.find(e=>e.value===a);return e?e.label:e_},[eh,a,e_]),ex=(0,r.useCallback)(e=>{e!==a&&(e===T.PW.named_entities&&m([...E,...k]),e===T.PW.everyone&&m(eu?R.slice(0,99):[]),e===T.PW.app_collaborators&&(m([]),em(!1))),n(e)},[R,eu,E,a,k,n,m]),ev=(0,r.useCallback)(e=>{let t=e.map(({value:e})=>e);m(e=>{let a=e.filter(e=>!k.includes(e)),n=(0,s.A)(t,a),r=(0,s.A)(a,t);return(0,o.A)(e,a,n).filter(e=>!r.includes(e))})},[k,m]),eE=(0,r.useCallback)(e=>{let t=e.map(({value:e})=>e);m(e=>{let a=e.filter(e=>k.includes(e)),n=(0,s.A)(t,a),r=(0,s.A)(a,t);return(0,o.A)(e,a,n).filter(e=>!r.includes(e))})},[k,m]),ek=(0,r.useCallback)(t=>{t.target.checked||m(t=>t.filter(t=>!(a===T.PW.everyone&&t===e||k.includes(t)))),em(e=>!e)},[a,m,e,k]),eS=(0,r.useCallback)(e=>r.createElement(TriggerRunSettingsListEntity,{option:e}),[]),[ew,eC]=(0,r.useMemo)(()=>(0,c.A)(v,e=>!eu||e.id!==z.S.TooManyNamedEntities),[v,eu]),eA=(0,r.useMemo)(()=>(0,g.A)(ew,L)||v.some(({id:e})=>e===z.S.TooManyNamedEntities),[v,ew,L]),eT=(0,r.useMemo)(()=>{if(a!==T.PW.named_entities)return null;let e=null;e=!W&&er||W&&el?(0,_.Zq)(_.Dm):(0,_.Zq)(_.aQ);let t=l.filter(e=>!k.includes(e)).map(e=>({label:e,value:e}));return r.createElement(H.h,{width:"100%",isInvalid:eA,errors:ew,renderOption:eS,searcherOptions:e,selectedOptions:t,onSelectedItemsChange:ev,selectDataQa:"run-trigger-permissions-internal-entities-multi-select",selectId:"run-trigger-permissions-internal-entities-multi-select",className:"margin_bottom_50"})},[a,W,er,el,l,eA,ew,eS,ev,k]),eI=ee.t("Your workflow includes third-party steps or restricted Slack built-ins, so it cannot be shared with external teams."),eN=(0,r.useMemo)(()=>(eo&&!ed&&eC.push({id:"is_workflow_restricted",message:eI}),eC.length>0?eC:[]),[eC,eo,ed,eI]),eM=(0,r.useMemo)(()=>(0,g.A)(eN,L)||v.some(({id:e})=>e===z.S.TooManyNamedEntities),[v,eN,L]),eF=(0,r.useCallback)(({id:e})=>(!eo||!!W)&&(!et||ei(e)),[W,ei,eo,et]),eO=(0,r.useMemo)(()=>{if(!ep||!eu)return null;let e=(0,_.Zq)(_.TE,{filter:eF}),a=k.map(e=>{let t=!ei(e);return{label:e,value:e,isTeamError:t}}),n=[];return W?S&&(n=[{id:"is_invalid_existing_external_target",message:ee.t("Some organizations are not allowed to use this workflow.")}]):n=eN.concat(S?{id:"is_external_team_invalid",message:ee.t("Some organizations don\u2019t have permissions to use workflows created by {teamName}",{teamName:t})}:[]),r.createElement(H.h,{width:"100%",renderOption:eS,searcherOptions:e,selectedOptions:a,onSelectedItemsChange:eE,selectDataQa:"run-trigger-permissions-external-teams-multi-select",selectId:"run-trigger-permissions-external-teams-multi-select",className:"margin_bottom_50",errors:n,isInvalid:!W&&eM||S})},[ep,eu,eF,k,S,eS,eE,eM,ei,W,t,eN]),eL=(0,r.useMemo)(()=>{if(!ep)return null;let e=ee.t("Also include connected, external organizations to find and run"),t=!1,a=null;W&&(es===Y.U.FULL_RESTRICTED&&(a=ee.t("External organizations are not allowed to use this workflow."),t=!0),es===Y.U.RESTRICTED_BY_ONLY_CONNECTORS&&(et?.allowed_teams_with_3p_connectors?.length??0)===0&&et?.hermes_triggers_trippable_by_slack_connected_teams_mcp!==U.HF.SAFE_AND_3P&&(a=ee.t("External organizations are not allowed to use this workflow because it contains third party steps."),t=!0));let n=(ec===u.uh||ec===u.kp)&&ed,l=!W&&eo&&!eu&&0===k.length&&!n,s=r.createElement(f.A,{className:i()({[X().disabledCheckboxLabel]:W&&t}),text:e,subtext:a,type:"inline",cursor:"pointer","data-qa":"allow-external-orgs-checkbox-label",isDisabled:!W&&l||t},r.createElement(b.A,{id:"allow-external-orgs",name:"allow-external-orgs",value:String(eu),checked:eu,onChange:ek,"data-qa":"allow-external-orgs-checkbox","aria-disabled":!W&&l||t}));return!W&&l?r.createElement(h.Ay,{"data-qa":"allow-external-orgs-checkbox-tooltip",tip:eI},s):s},[ep,W,ec,ed,eo,eu,k.length,ek,eI,es,et?.allowed_teams_with_3p_connectors?.length,et?.hermes_triggers_trippable_by_slack_connected_teams_mcp]);if((0,r.useEffect)(()=>{k.length>0&&D.current&&em(!0)},[D,k.length]),!en)return null;let eD=ee.t("Who can find and use this workflow?",{fallbackHash:"7d5e45c9df7cc48c632e106be22861700e67214b"}),eP=ee.t("Who can find this workflow?",{fallbackHash:"c49daccad9eba5c019308fe7556b8494fcb19f7a"});return r.createElement("div",{className:"margin_bottom_150"},r.createElement(f.A,{htmlFor:"run-trigger-permissions-select",text:en.type===A.zW?eD:eP},r.createElement(x.l,{id:"run-trigger-permissions-select",value:a,options:eh,placeholder:ey,ariaLabel:ee.t("Default selection"),onChange:ex,required:!0,errorText:"",className:"margin_bottom_50"})),eT,eL,eO,eA||eM?null:r.createElement(TriggerRunAccessHelpText,{workflowId:P,isAllowExternalOrgsChecked:eu,permissionType:a,trigger:en}))};TriggerRunSettings.displayName="TriggerRunSettings"},0x1e813d5b2:(e,t,a)=>{"use strict";a.d(t,{Q:()=>WorkflowPreview});var n=a(0xbad225b5),r=a(0x20482ad21),l=a(0x1d2cd7755),i=a(0x12cef2078),s=a(0xe9c32bb),o=a(0x126af815a),c=a(0x239cd8d69),d=a(0x1dc84ebc7),u=a(0x21e6a881a),m=a(0xa25cde92),p=a(0xe38b5635),b=a(0x33f2430),f=a.n(b);let g=new r.Ay("workflow_builder"),h={[o.LO]:o.Oy,[o.bX]:o.UE};function mapHermesTriggerTypeToShared(e){let t=e&&h[e];return t||e}let WorkflowPreview=({workflow:e,trigger:t,workflowName:a,workflowDescription:r,shouldAllowAutomatedTriggerPreview:b=!1})=>{let h=t?.type,_=o.zW===h,y=(0,d.j)({trigger:{...t,type:mapHermesTriggerTypeToShared(h)},workflow:{...e,steps:e.steps}});a&&(y.title=a),r&&(y.description=r);let x=y?.description,v=e?.icons?.image_192,E=g.t("This is how the workflow will appear in Slack messages and canvases");return n.createElement(n.Fragment,null,e&&y&&n.createElement(n.Fragment,null,_||b?n.createElement("div",{className:f().workflow_preview},n.createElement(l.A,{text:g.t("Preview"),htmlFor:"",className:f().preview_subtitle,"data-qa":"workflow-details-modal-preview"},n.createElement(s.nB,null,E),_?n.createElement(m.j,{shortcutInfo:y,showActions:!1,showByline:!1,isWorkflowBuilderPreview:!0,iconUrl:v}):n.createElement(i.X,null,n.createElement(p.A,{className:"p-workflow_card",elevation:2,size:"medium"},n.createElement(u.A,{shortcutInfo:y,iconUrl:v}),n.createElement("div",{className:"p-workflow_card__body"},x&&n.createElement("div",{className:"p-workflow_card__body__description"},x),n.createElement(c.x,{owningTeamId:y.owningTeamId,className:"margin_top_75"})))))):n.createElement("div",{"data-qa":"workflow-preview-non-link",className:f().non_link_trigger})))};WorkflowPreview.displayName="WorkflowPreview"},0xcb036ba:(e,t,a)=>{"use strict";a.d(t,{Z:()=>SegmentErrorText,_:()=>eP});var n=a(0xbad225b5),r=a(0x20482ad21),l=a(0xf7ab484f),i=a(0x1a5ac3a0c),s=a(0x6cc5eee0),o=a(0x1b3ecb90f),c=a(0x1806ce928),d=a(0x12d850a65),u=a(0x145d46a61),m=a(0xa1832ae4),p=a(0x1795d8821),b=a(0x158cf1cb),f=a(0x226892387),g=a(0x14149c126),h=a(0x20cfa1dc2),_=a(0x1ee439e69);let y=new r.Ay("workflow_builder"),{EXTERNAL_TRIGGER_DISALLOWED_STEP_SENDDM:x,EXTERNAL_TRIGGER_DISALLOWED_STEP_MULTI_RECORD:v,EXTERNAL_TRIGGER_DISALLOWED_STEP_SINGLE_RECORD:E,DIGEST_TRIGGER_DISALLOWED_STEP:k,INVALID_MULTI_RECORD_TRIGGER_EXTRA_STEPS:S,INVALID_MULTI_RECORD_TRIGGER_INVALID_FIRST_STEP:w,INVALID_MY_MULTI_RECORD_TRIGGER_INVALID_FIRST_STEP:C,INVALID_MULTI_RECORD_TRIGGER_INVALID_STEP:A,INVALID_MULTI_RECORD_TRIGGER_INVALID_SALESFORCE_APP_STEP:T,EXTERNAL_TRIGGER_REQUIRED:I,INTERACTIVE_TRIGGER_REQUIRED:N,INTERACTIVE_TRIGGER_OR_STEP_REQUIRED:M,INTERACTIVE_TRIGGER_OR_STEP_OR_BUILDER_AUTH_REQUIRED:F,INVALID_CANVAS_STEPS:O,INVALID_EMOJI:L,INVALID_EXTERNAL_STEPS:D,INVALID_EXTERNAL_TOKEN_IDS:P,INVALID_INTERACTIVITY_POINTER:R,INVALID_SEND_TO_SALES_HOME_STEPS:B,INVALID_SEND_TO_SALES_HOME_BRANCH:W,INVALID_SEND_TO_SALESFORCE_APP_BRANCH:V,INVALID_SEND_TO_SALESFORCE_APP_RECIPIENT:q,INVALID_SEND_TO_SALESFORCE_APP_STEPS:H,INVALID_STEP_POSITION:U,INVALID_MULTIPLE_SF_CHANNELS_INVALID_STEP:z,INVALID_CANNOT_CREATE_SAME_SF_CHANNEL_TWICE_STEP:j,INVALID_STEP_WITH_SF_INSTANT_TRIGGER:$,INVALID_STEP_WITH_SF_SCHEDULED_TRIGGER:G,INVALID_STEP_WITH_SF_EXTERNAL_TRIGGER:K,INVALID_TEMPLATE_MACRO_INPUTS:Y,INVALID_TEMPLATE_VALUES:Q,INVALID_WORKFLOW_AUTH_STRATEGY:Z,MISSING_ONE_OF_OPTIONAL_INPUTS:J,MISSING_INPUTS:X,USER_CANNOT_USE_FUNCTION:ee,FUNCTION_STEP_UNKNOWN_REFERENCE:et,UNDEFINED_FUNCTION_PARAM:ea,INVALID_EXTERNAL_CHANNEL_SUMMARIZE_CHANNEL:en,INVALID_EXTERNAL_CHANNEL_SUMMARIZE_CHANNEL_CANVAS:er,INVALID_EXTERNAL_USER_CHANNEL_SUMMARIZE_CHANNEL_SHARE_CANVAS:el,INVALID_EXTERNAL_USER_SUMMARIZE_CHANNEL:ei,INVALID_EXTERNAL_USER_SUMMARIZE_CHANNEL_CREATE_CANVAS:es,INVALID_USER_CONTEXT:eo,INVALID_FIELD_FOR_LIST_TRIGGER:ec,USER_NOT_LOGGED_INTO_SALES_HOME:ed,USER_NOT_LOGGED_INTO_SALESFORCE_APP:eu,INVALID_INTERACTIVITY_CONFIGURATION_INPUT_PARAMETER:em,INVALID_SERVICE_TRIGGER_EXTERNAL_TOKEN_IDS:ep,INVALID_TEMPLATE_VALUES_SERVICE_TRIGGER:eb,STEP_REQUIRES_TEAM_AI_ACCESS:ef,USERGROUPS_NOT_AVAILABLE:eg,CUSTOM_STEPS_NOT_AVAILABLE:eh,INVALID_EMOJI_REACTION_EVENT_TRIGGER:e_,INVALID_EXTERNAL_CHANNEL_ASK_AGENTFORCE:ey,INVALID_EXTERNAL_CHANNEL_ASK_AGENTFORCE_CANVAS:ex,INVALID_EXTERNAL_USER_ASK_AGENTFORCE:ev,INVALID_EXTERNAL_USER_ASK_AGENTFORCE_CREATE_CANVAS:eE,INVALID_EXTERNAL_USER_CHANNEL_ASK_AGENTFORCE_SHARE_CANVAS:ek,INVALID_PRIVATE_CHANNEL_ASK_AGENTFORCE:eS,INVALID_PRIVATE_CHANNEL_SUMMARIZE_CHANNEL:ew,MESSAGE_CONTEXT_REQUIRED_ASK_AGENTFORCE:eC,TRIGGER_TYPE_NOT_SUPPORTED_ASK_AGENTFORCE:eA,USER_LACKS_STEP_ACCESS:eT,INVALID_RICH_TEXT_ELEMENT_TYPE:eI,CHANNEL_EXCLUDED_FROM_SLACK_AI:eN,CHANNELS_EXCLUDED_FROM_SLACK_AI:eM,WORKFLOW_CANVAS_NOT_FOUND:eF,WORKFLOW_LIST_NOT_FOUND:eO,FILE_SIZE_TOO_LARGE:eL,TRIGGER_CHANNEL_INSUFFICIENT_POSTING_PERMISSIONS:eD}=h.oh,eP={PREVIEW:"preview",MODAL:"modal"},SegmentErrorText=({errorCode:e,errorMessage:t,slackFunction:a,viewContext:r=eP.PREVIEW})=>{let h=(0,f.d4)(u.Ry),Q=(0,f.d4)(u.Mw),eb=(0,f.d4)(u.cA),eR=(0,f.d4)(u.dI),eB=(0,f.d4)(u.sQ),eW=(0,f.d4)(u.EY),eV=y.rt("<strong>Needs attention.</strong> This step requires some additional info."),eq=(0,f.d4)(e=>"on"===(0,g._Z)(e,"ask_agentforce_step")),eH=(0,f.d4)(e=>"on"===(0,g._Z)(e,"ask_agentforce_trigger_validations")),eU=(0,f.d4)(e=>"on"===(0,g._Z)(e,"ask_agentforce_i18n")),ez=(0,f.d4)(e=>"on"===(0,g._Z)(e,"ai_channel_exclusions")),ej=(0,f.d4)(_.H7),renderErrorMessage=()=>t&&"string"==typeof t?n.createElement(s.A,{text:t,className:"break_all",emojiSize:o.lw.SMALL,noLinking:!0,noHighlights:!0,noCode:!0,noQuotes:!0,noSpecials:!0}):null;switch(renderErrorMessage.displayName="renderErrorMessage",e){case ec:return eV;case l.m0:return y.rt("Restricted: you cannot publish or edit this step but the workflow will continue to run.");case l.Hx:case l.nH:case X:return y.rt("<strong>Needs attention.</strong> You\u2019ll need to pick a channel or person.");case l.t3:case l.Lj:return y.rt("<strong>Needs attention.</strong> You\u2019ll need to pick a channel.");case l.T8:return y.rt("<strong>Needs attention.</strong> Choose a workspace for this channel.");case l.EW:return y.rt("<strong>Needs attention.</strong> You\u2019ll need to pick an emoji.");case e_:{let e=(0,m.F1)(ej);return y.rt("The selected emoji doesn\u2019t exist in {workspaceName}. Choose a different emoji to continue.",{workspaceName:e})}case l.U3:return y.rt("Your workflow is scheduled to start in the past. Select a future time or date to continue.");case l.Jx:return eB?y.rt("<strong>Permission required.</strong> Private channels are disabled for this trigger."):"<strong>Permission required.</strong> Private channels are disabled for this trigger.";case l.qP:return eW?y.rt("<strong>Permission required.</strong> Private channels are disabled for this step."):"<strong>Permission required.</strong> Private channels are disabled for this step.";case l.yF:return eB?y.rt("<strong>Variable not available.</strong> The <strong>Text of the message</strong> variable can\u2019t be used in private channels."):"<strong>Variable not available.</strong> The <strong>Text of the message</strong> variable can\u2019t be used in private channels.";case l.aU:return y.rt("<strong>Needs attention.</strong> You\u2019ll need to pick another channel.");case P:return y.rt("Connect your external account to fix this step");case ep:return y.rt("Connect your external account to fix this trigger");case N:return y.rt("To use this step, your workflow needs to start from a link in Slack.");case M:return y.rt("To use this step, you\u2019ll need to add a message step with a button or your workflow needs to start from a link in Slack.");case F:return y.rt("To use this step, change the account used for this step to be yours, or add a message step with a button before this step.");case I:return y.rt("To use this step, the workflow must start with the Salesforce \u201CWhen a record changes\u201D action.");case x:return y.rt("External triggers cannot be sent as a Direct Message.");case v:return y.rt("External triggers with a single record cannot be sent using a multiple record step.");case E:return y.rt("External triggers with multiple records cannot be sent using a single record step.");case k:return Q?y.rt("This step can\u2019t be used when starting the workflow with <strong>On a schedule: Summarize record changes</strong>. Use <strong>Send Summary to Sales Home</strong> instead."):"This step can\u2019t be used when starting the workflow with On a schedule: Summarize record changes. Use Send Summary to Sales Home instead.";case S:return y.rt("Workflows starting with a multi-record trigger can only have a single step (must be a Send Summary to Sales Home step)");case A:return y.rt("Workflows starting with a multi-record trigger can only use one Send Summary to Sales Home step");case T:return eb?y.rt("Workflows starting with a multi-record trigger cannot use this step. Remove this step to continue."):eV;case w:return Q?y.rt("Workflows starting with a multi-record trigger must have the <strong>Send Summary to Sales Home</strong> or <strong>Send Summary to My Sales Home</strong> step before all other steps."):y.rt("Workflows starting with a multi-record trigger must have the Send Summary to Sales Home step before all other steps");case C:return Q?y.rt("Workflows starting with a multi-record trigger must have the <strong>Send Summary to My Sales Home</strong> step before all other steps."):y.rt("Workflows starting with a multi-record trigger must have the Send Summary to Sales Home step before all other steps");case B:return y.rt("Workflows only support a single Send to Sales Home step.");case W:return y.rt("Workflows do not support Send to Sales Home steps in branches.");case V:return eb?y.rt("Workflows do not support the <strong>Send to Salesforce App</strong> step in branches. Remove this step to continue."):eV;case q:return eb?y.rt("All <strong>Send to Salesforce App</strong> and <strong>Send to Sales Home</strong> steps in this workflow must have the same recipient."):eV;case H:return eb?y.rt("Workflows cannot have both <strong>Send To Salesforce App</strong> and <strong>Send To My Salesforce App</strong> steps. Remove one to continue."):eV;case z:return y.rt("To send a message to the Salesforce channel created in a previous step, use the Send a message to a channel step instead.");case j:return y.rt("A Salesforce channel for this record is already being created in an earlier step. Remove this step to continue.");case $:return y.rt("A Slack admin has restricted who can use this step when starting the workflow <strong>When a record changes</strong>. Choose another way to start the workflow.");case G:return y.rt("A Slack admin has restricted who can use this step when starting the workflow <strong>On a schedule</strong>. Choose another way to start the workflow.");case K:return y.rt("A Slack admin has restricted who can use this step. Choose another way to start the workflow.");case l.o1:case D:return t??eV;case L:return y.rt("You can\u2019t use the same emoji to both start the workflow and in this step. Choose a different emoji to continue.");case O:return y.rt("The Update a canvas step cannot follow Summarize Channel step.");case R:if(a&&a.callback_id===p.oW.OpenForm)return y.rt('Add a message step with a "Continue Workflow" button before this one so you can send this form to people.');return y.rt('Add a message step with a "Continue Workflow" button before this interactive step in order to use it.');case eo:return y.rt("Add a message step with a button before this one so it can be aware of a user.");case U:return y.rt("To use this step, it has to be the first step in the workflow.");case Z:return y.rt("Your account can\u2019t be used to set up this workflow. Try switching account options.");case ee:return y.rt("Your admin has restricted use of this step. To request access to edit this step or publish this workflow, contact your admin.");case i.TK:return y.rt("This step is from an app that is no longer installed. Remove step.");case J:return y.rt("You\u2019ll need to pick a person or a user group.");case Y:return y.rt("Heads up \u2014 changes made earlier in your workflow have affected this step. Update your variables to continue.");case ew:return eq?y.rt("The summarize channel step cannot be used with private channels. Please choose public channels to proceed."):eV;case eN:return ez?y.rt("An admin has restricted this channel for use with AI steps. Choose a different channel."):eV;case eM:return ez?y.rt("An admin has restricted one or more of the selected channels for use with AI steps. Remove restricted channels."):eV;case en:return y.rt("The summarize channel step cannot be used with channels outside your organization. Please choose channels within your organization to proceed.");case ei:return y.rt("The summarize channel step cannot be used with users from outside your organization. Please choose someone within your organization to proceed.");case er:return y.rt("The selected canvas is shared externally and cannot be updated after a summarize channel step. To continue, select a canvas in your organization.");case es:return y.rt("The create a canvas step cannot be placed after the summarize channel step if the canvas is owned by someone outside your organization.");case el:return y.rt("The selected canvas is shared externally and cannot be shared after a summarize channel step. To continue, select a canvas in your organization.");case et:case ea:return y.rt("This step requires an update to fix errors with info from another step.");case ef:return y.rt("Needs attention. Your access to AI workflow steps has ended. Slack AI is available with a paid plan add on. Remove this step to continue using this workflow.");case ed:return y.rt("Connect to Salesforce in Sales Home to use this step and publish this workflow.");case eu:return eb?y.rt("Sign in to Salesforce in the Salesforce App to publish a workflow using this step."):eV;case d.e.ListNotFound:if(r===eP.MODAL)return y.rt("The list has been deleted, or you no longer have permission to use it. Select another list to continue.");return y.rt("Update selected list.");case l.GA:case l.Ty:case l.Ag:case l.ny:case l.AE:case l.FD:case c.n.FunctionExecutionError:return renderErrorMessage()??eV;case em:return y.rt("This step requires an update to fix errors within button configuration.");case l.OJ:if(a?.id===b.gy)return y.rt("Your list schema has changed. Open and save this step to update your form.");return y.rt("Your schema has changed. Open and save this step to update your form.");case eg:return y.rt("User groups are only available with specific paid plans. To continue using this step, upgrade your plan.");case eh:return y.rt("Custom steps are only available with specific paid plans. To continue using this step, upgrade your plan.");case l.GR:return h?y.rt("All Salesforce steps must use an account in the same Salesforce organization."):eV;case ey:return eq?y.rt("The ask agentforce step cannot be used with channels outside your organization. Please choose channels within your organization to proceed."):eV;case ev:return eq?y.rt("The ask agentforce step cannot be used with users from outside your organization. Please choose someone within your organization to proceed."):eV;case ex:return eq?y.rt("The selected canvas is shared externally and cannot be updated after a ask agentforce step. To continue, select a canvas in your organization."):eV;case eE:return eq?y.rt("The create a canvas step cannot be placed after the ask agentforce step if the canvas is owned by someone outside your organization."):eV;case ek:return eq?y.rt("The selected canvas is shared externally and cannot be shared after a ask agentforce step. To continue, select a canvas in your organization."):eV;case eS:return eq?y.rt("The agentforce step cannot be used with a private channel. Please choose a public channel to proceed."):eV;case eC:return eq?y.rt("Message context is required to send a message as the agent."):eV;case eA:return eH?y.rt("To use this step, you\u2019ll need to start the workflow from a link in Slack."):eV;case eT:return eU?y.rt("This is no longer available in Workflow Builder. Remove it to continue."):eV;case eI:return y.rt("To use this step, remove the unsupported rich text content.");case l.y6:return n.createElement(n.Fragment,null,n.createElement("strong",null,"Cannot access source.")," There is an issue accessing a knowledge source.");case l.CC:return eR?y.rt("Canvas variables from triggers are not allowed in this step. Please remove them to continue."):"Canvas variables from triggers are not allowed in this step. Please remove them to continue.";case l.nT:return eR?y.rt("Channel variables from triggers are not allowed in this step. Please remove them to continue."):"Channel variables from triggers are not allowed in this step. Please remove them to continue.";case l.hc:return eR?y.rt("Salesforce channels cannot be used with this step."):"Salesforce channels cannot be used with this step.";case l.oi:return eR?y.rt("External channels cannot be used with this step."):"External channels cannot be used with this step.";case eF:return eR?y.rt("One or more selected canvases were not found. Choose a different canvas to continue."):"One or more selected canvases were not found. Choose a different canvas to continue.";case eO:return eR?y.rt("One or more selected lists were not found. Choose a different list to continue."):"One or more selected lists were not found. Choose a different list to continue.";case eL:return eR?y.rt("<strong>Needs attention.</strong> {errorMessage}",{errorMessage:t}):`Needs attention. ${t}`;case eD:return t;case l.Js:return y.t("This step cannot be used with this starting action. Remove this step, or select a different starting action.");default:return eV}};SegmentErrorText.displayName="SegmentErrorText"},0x126eb9491:(e,t,a)=>{"use strict";a.d(t,{G:()=>MultiPaneSegmentFormModal});var n,r=a(0xbad225b5),l=a(0x16cf1da63),i=a(0x120c268ad),s=a.n(i),o=a(0x40c0d834),c=a(0x20482ad21),d=a(0x134e233cc),u=a(0x2b7f0bcc),m=a(0x24546e7f2),p=a(0x2501a2cee),b=a(0x6e87d4ec),f=a(0xbe0b63ff),g=a(0x1df96de4c),h=a(0x11a296110),_=a(0x45bd075),y=a(0x1d2cd7755),x=a(0x344bb842),v=a(0x4c96e5d9),E=a(0x1407c6c2c),k=a(0x12edaa96a),S=a(0x1d1911997),w=a(0x210b99e76),C=a(0x88dc61ea),A=a(0xa231133b),T=a(0x1d9a37519),I=a(0x207fb9b92),N=a(0x145d46a61),M=a(0x226892387),F=a(0x10ab7504),O=a.n(F);let L=new c.Ay("workflow_builder"),D=(0,r.memo)(({formWrappableParameters:e,questionName:t,appId:a,functionCallbackId:n})=>{let l=(0,E.A)(),[i,s]=(0,r.useState)(l),o=(0,r.useCallback)(()=>s((0,k.A)()),[]),c=(0,C.rC)(),d=(0,M.d4)(N.$T),u=(0,r.useMemo)(()=>(0,w.m)(n),[n]),m=(0,r.useCallback)(a=>{a.value===t&&o();let n=e?.find(e=>e.name===a.value);c((0,A.Qj)({questionName:t,parameter:n}))},[c,o,e,t]),b=(0,r.useMemo)(()=>e?.map(e=>({value:e.name,label:e.title}))??[],[e]),f=(0,r.useMemo)(()=>b.find(e=>e.value===t),[b,t]),{onBlur:g,errorText:h}=(0,I.K)({errorMessage:L.t("This field is required."),isErrored:!f}),_=(0,r.useMemo)(()=>h?[{id:"is_required",message:h}]:[],[h]),x=(0,r.useCallback)(e=>r.createElement("div",{className:"display_flex align_items_center"},a?r.createElement(T.z,{appId:a,size:20,imageClassName:O().appIcon}):r.createElement(p.Ah,{name:u,size:"20"}),r.createElement("span",{className:"margin_left_25"},e.label)),[a,u]);if(!d)return null;let v=L.t("Field type");return r.createElement(y.A,{text:v,className:"margin_bottom_125"},r.createElement(S.Ay,{key:i,selectId:l,selectedOption:f,onOptionSelected:m,options:b,ariaLabel:v,placeholderText:L.t("Select a field\u2026"),width:"100%",isRequired:!0,errors:_,renderOption:x,renderSelectedOption:x,onBlur:g,focusOnMount:!f}))});var P=a(0x118cdcdea),R=a.n(P),B=a(0xec9d0658),W=a(0x852588ab),V=a(0x1ae9b422e);let q=/:skin-tone-[2-6]:/g;function convertOptionStringToDelta(e,t,a){if(!e)return Promise.resolve(new(R())().insert(""));let n=[...e.match((0,B.A)())??[]].map(e=>e.replace(q,"").replace(/:/g,"")),r=Promise.resolve();return n.length&&(r=(0,V.uY)(t,n)),r.then(()=>{let t=new(R())().insert(e),{processedDelta:n}=a((0,W.n)({delta:t,useChannelTagging:!1,useColonEmojiConversion:!0}));return n})}var H=a(0x14fad6485),U=a(0x1d01572a2),z=a(0x66d73753),j=a(0x99233ecb),$=a(0x38bda683),G=a(0xe53aa0),K=a(0x820cbf6d),Y=a(0xab1e931b),Q=a(0x1b77d8ef3),Z=a(0x15bc54ead),J=a(0x2c5a5afa),X=a(0x59bcdfd6),ee=a(0x9b971e7e),et=a(0x24429189c),ea=a(0xb9604b6),en=a(0x5b1935a6),er=a(0x1db9fc363),el=a.n(er);let ei=new c.Ay("workflow_builder"),es={name:"ellipsis-horizontal-filled"},eo=(0,r.memo)(({questionName:e,questionIndex:t,optionIndex:a,options:n,onAddOption:i,onLabelUpdate:s,questionType:o})=>{let c=n[a],d=(0,C.rC)(),u=(0,l.wA)(),[m,p]=(0,r.useState)(),b=(0,M.d4)(ee.ZT)??"",f=(0,r.useRef)(null),{windowRef:g}=(0,r.useContext)(H._0),h=(0,M.d4)(e=>(0,ea.Hp)(e,en.xu.WORKFLOW_BUILDER_QUESTION_OPTION_INPUT)),_=o===$.xi.Dropdown,y=_&&(0,G.X)(c);(0,U.A)(()=>{_&&"string"==typeof c.value&&convertOptionStringToDelta(c.value,b,u).then(e=>{p(e)})});let v=(0,r.useMemo)(()=>{if(_&&y){let e=u((0,et.f)({blocks:c.value})),{processedDelta:t}=u((0,W.n)({delta:e,useChannelTagging:!1}));return{contents:t}}},[u,c,_,y]),E=(0,r.useMemo)(()=>{if(y){let e=u((0,et.f)({blocks:c.value}));return(0,X.f)({contents:e.ops})}return c.label},[u,c,y]),k=(0,r.useMemo)(()=>y?v:m?{contents:m.ops}:E,[y,m,v,E]),S=(0,Y.I4)(c),w=(0,Y.kg)(c),T=(0,Y.l4)(n,c.label,a),N=(0,Y.Ot)(c),F="";T?F=ei.t("Dropdown options must be unique."):S?F=ei.t("The option label can\u2019t have more than {maxCharacterLimit, plural, =1 {# character} other {# characters}}.",{maxCharacterLimit:Y.Al}):w&&(F=ei.t("An option label is required."));let{onBlur:O,errorText:L}=(0,I.K)({errorMessage:F,isErrored:!N||T}),D=L?[{id:c.id,message:L}]:void 0,P=(0,r.useCallback)(()=>{let t,a=f?.current?.value();if(_){let e=new(R())(f?.current?.getContents().contents),{blocks:n}=u((0,et.y)({delta:e}));t=n,a=(0,X.f)({contents:e.ops})}if(void 0!==a){let n=_?t??[]:a;d((0,A.ly)({questionName:e,optionId:c.id,value:n,label:a}))}s?.(c.id)},[_,s,c,u,d,e]),B=(0,K.DQ)(a,n.length),V=(0,r.useCallback)(()=>{d((0,A.Zy)({questionIndex:t,questionOptionIndex:a,newQuestionOptionIndex:a-1}))},[d,t,a]),q=(0,r.useCallback)(()=>{d((0,A.Zy)({questionIndex:t,questionOptionIndex:a,newQuestionOptionIndex:a+1}))},[d,t,a]),er=(0,r.useCallback)(()=>d((0,A.JB)({questionName:e,optionId:c.id})),[d,c.id,e]),eo=(0,r.useCallback)(e=>r.createElement(j.Ay,e,B.up&&r.createElement(j.Dr,{label:ei.t("Move above"),onSelected:V}),B.down&&r.createElement(j.Dr,{label:ei.t("Move below"),onSelected:q}),(B.up||B.down)&&r.createElement(j.bX,null),r.createElement(j.Dr,{label:ei.t("Delete"),onSelected:er,danger:!0})),[B.up,B.down,V,q,er]),ec=(0,r.useMemo)(()=>_&&"string"==typeof c.value&&void 0===m?null:r.createElement(J.A,{ariaLabel:E,completeOnEmoji:!0,completeOnMembers:_,enableBroadcastKeywords:!1,focusOnMount:!0,id:`${c.id}_input_label`,initialText:k,isSingleLine:!0,isWorkflowQuestionOption:!0,onBlur:O,onEnter:i,onTextChange:P,placeholder:ei.t("List item {itemNumber}",{itemNumber:a+1}),position:"bottom",ref:f,windowRef:g}),[i,O,P,c,a,_,E,g,k,m]);return r.createElement("div",{className:el().container},r.createElement("div",{className:el().inputContainer},_?r.createElement(z.A,{currentCount:c.label.length,maxCharacterLimit:Y.Al,counterMinimumCharacters:0},r.createElement(Z.A,{className:"normal padding_right_300",enableEmojiButton:!0,enableMentionButton:!0,errors:D,forceToolbarDisabled:!0,isInvalid:!!D,numMaxLines:1,numMinLines:1,showWorkflowOptionItemMentionTip:h===en.ze.HERMES_WORKFLOWS_OPTION_ITEM_MENTION_TIP&&0===a,withWorkflowTokens:!0,withBasicContainerBorder:!0},ec)):r.createElement(Q.A,{errors:D,isInvalid:!!D,numMaxLines:1,numMinLines:1},ec)),r.createElement("div",null,r.createElement(j.cQ,{renderMenu:eo,position:"bottom-right",offsetX:0},r.createElement(x.A,{"aria-label":ei.t("More actions"),outline:!0,svgIconProps:es}))))});var ec=a(0x9f477e8a),ed=a(0x5475ff55),eu=a(0xea61e449),em=a.n(eu);let ep=new c.Ay("workflow_builder"),eb=(0,r.memo)(({questionName:e,options:t=[],questionIndex:a,questionType:n,questionHermesType:i})=>{let s=(0,C.rC)(),o=(0,l.wA)(),c=(0,M.d4)(ee.ZT)??"",d="slack#/types/rich_text"===i,u=(0,r.useMemo)(()=>t?.every(e=>"object"==typeof e.value&&e.value[0]?.type==="rich_text"?e.label.length:e.value.length),[t]),m=(0,ec.aA)(n,t)&&u,b=(0,r.useCallback)(()=>{m&&s((0,A.bd)({questionType:n,questionName:e}))},[m,e,n,s]),f=(0,r.useCallback)(a=>{for(let r of t){if(r.id===a)continue;let{label:t,value:l}=r;n===$.xi.Dropdown&&("string"==typeof l||d)&&"string"==typeof l&&void 0!==t?convertOptionStringToDelta(l,c,o).then(a=>{let n=o((0,et.y)({delta:a}));"blocks"in n&&s((0,A.ly)({questionName:e,optionId:r.id,value:n.blocks,label:t}))}):d&&s((0,A.ly)({questionName:e,optionId:r.id,value:l,label:t}))}},[o,s,d,t,e,n,c]),[g,_]=(0,r.useState)(null),y=(0,r.useCallback)(e=>()=>_(e),[]),x=(0,r.useCallback)(()=>{_(null)},[]),v=(0,r.useMemo)(()=>t.map(({id:l},i)=>r.createElement(ed.lO,{draggableId:l,key:l,index:i,disableInteractiveElementBlocking:g!==l},s=>r.createElement("div",{ref:s.innerRef,...s.draggableProps,...s.dragHandleProps,className:em().drag_handle,onFocus:y(l),onBlur:x,"data-qa":l},r.createElement("div",{className:em().drag_icon},r.createElement(p.Ah,{inline:!0,name:"reorder"})),r.createElement(eo,{questionName:e,onAddOption:b,onLabelUpdate:f,questionIndex:a,optionIndex:i,options:t,questionType:n})))),[t,g,y,x,e,b,f,a,n]),E=(0,r.useCallback)(({destination:e,source:t})=>{e&&s((0,A.Zy)({questionIndex:a,questionOptionIndex:t.index,newQuestionOptionIndex:e.index}))},[a,s]),k=(0,r.useCallback)((l,i,s)=>r.createElement("div",{...l.draggableProps,...l.dragHandleProps,ref:l.innerRef},r.createElement(eo,{questionName:e,onAddOption:b,questionIndex:a,optionIndex:s.source.index,options:t,questionType:n})),[b,t,a,e,n]);return r.createElement("div",{className:em().container},r.createElement("div",{className:em().label},(e=>{switch(e){case $.xi.StaticMultiSelect:return ep.t("Multiple choice options");case $.xi.Dropdown:return ep.t("Dropdown options");case $.xi.StaticMultiSelectWithCheckboxes:return ep.t("Checkbox options");default:return ep.t("Options")}})(n)),r.createElement(ed.MR,{onDragEnd:E},r.createElement(ed.zv,{droppableId:"options-list",renderClone:k},e=>r.createElement("div",{ref:e.innerRef,...e.droppableProps},v,e.placeholder))),r.createElement(h.Ay,{onClick:b,disabled:!m,type:"outline",className:em().add_option_button},r.createElement(p.Ah,{name:"plus",size:"20"}),r.createElement("span",null,ep.t("Add Option"))))});var ef=a(0x15014e268),eg=a(0x1c0b91ebb),eh=a(0x1789e94fa);let e_=r.lazy(()=>Promise.resolve().then(a.bind(a,0x2370b4942)).then(e=>({default:e.DropdownMentionSupportBadge}))),ey={spaceName:en.xu.WORKFLOW_BUILDER_FORM_QUESTION_TYPE_SELECT,notifications:{[en.ze.HERMES_WORKFLOWS_DROPDOWN_MENTION_SUPPORT_BADGE]:{component:e_}}},{ShortText:ex,LongText:ev,RichText:eE,Dropdown:ek,StaticMultiSelect:eS,StaticMultiSelectWithCheckboxes:ew,File:eC,SelectPerson:eA,UserMultiSelect:eT,SelectChannel:eI,ChannelMultiSelect:eN,Date:eM,DateTime:eF,Number:eO,Boolean:eL}=$.xi,eD=new c.Ay("workflow_builder"),createSelectOptionFromQuestionType=(e,t)=>"divider"===e?{type:"divider"}:{value:e,label:r.createElement(r.Fragment,null,r.createElement(p.Ah,{name:(0,eg.v)(e).icon,inline:!0}),r.createElement("span",{className:"margin_left_25 inline_flex gap_75 align_items_center"},(0,eg.v)(e).label,t?r.createElement(eh.A,ey):null))};createSelectOptionFromQuestionType.displayName="createSelectOptionFromQuestionType";let eP=(0,r.memo)(({questionType:e,questionName:t,isSegmentFormWrapped:a=!1,onUpdateQuestionType:n})=>{let l=(0,C.rC)(),i=(0,r.useCallback)(e=>{l((0,A.eY)({questionName:t,questionType:e.value})),n?.(e.value)},[l,n,t]),s=(0,r.useMemo)(()=>[ex,ev,eE,"divider",ek,eS,ew,"divider",eC,"divider",eA,eT,eI,eN,"divider",eM,eF,eO].map(e=>createSelectOptionFromQuestionType(e,e===ek)),[]),o=(0,r.useMemo)(()=>e===ek?createSelectOptionFromQuestionType(ek,!1):e===eL?createSelectOptionFromQuestionType(eL,!1):s.find(t=>t.value===e),[s,e]),c=(0,r.useMemo)(()=>{let e=[{id:"question-type-select-hint",message:eD.t("Question type is set to match the Field type, so people can submit info in the right format.")}];return a?e:void 0},[a]),d=(0,E.A)();return r.createElement(y.A,{text:eD.t("Question type")},r.createElement(ef.Ay,{selectId:d,selectedOption:o,onOptionSelected:i,options:s,ariaLabel:eD.t("Question type"),placeholderText:eD.t("None selected"),width:"100%",isRequired:!0,isDisabled:a,hints:c}))});var eR=a(0x4df01f17),eB=a(0xc5824c14),eW=a.n(eB);let LoadingSkeleton=()=>r.createElement("div",{className:eW().loading_container},r.createElement("div",{className:eW().loading_skeleton},r.createElement("div",{className:eW().label},r.createElement(eR.A,{width:"25%",height:22,borderRadius:4})),r.createElement(eR.A,{width:"100%",height:36,borderRadius:4}),r.createElement("div",{className:eW().label},r.createElement(eR.A,{width:"25%",height:22,borderRadius:4})),r.createElement(eR.A,{width:"100%",height:36,borderRadius:4}),r.createElement("div",{className:eW().label},r.createElement(eR.A,{width:"25%",height:22,borderRadius:4})),r.createElement(eR.A,{width:"100%",height:36,borderRadius:4}),r.createElement("div",{className:eW().required_checkbox},r.createElement(eR.A,{width:"40%",height:22,borderRadius:4}))));LoadingSkeleton.displayName="LoadingSkeleton";var eV=a(0x16e99b359);let eq=new c.Ay("workflow_builder"),eH=(0,r.memo)(({options:e,questionName:t,maxItems:a})=>{let n=(0,C.rC)(),l=(0,r.useCallback)(e=>n((0,A.d4)({questionName:t,maxItems:e})),[n,t]),i=eq.t("Max selectable items"),s=eq.t("Max selectable items selector"),o=(e||[]).slice(1).map((e,t)=>({label:eq.t("{maxSelectedItemQty} items",{maxSelectedItemQty:t+2,fallbackHash:"5859a572f1fe5a6f80d544931f79283ea6bf095a"}),value:t+2})),c=1===a?(o[o.length-1]||{}).value:a;return r.createElement(y.A,{htmlFor:`${t}_multi_select_max_selected_items`,text:i},r.createElement(eV.l,{id:`${t}_multi_select_max_selected_items`,value:c,options:o,ariaLabel:s,onChange:l,errorText:"",required:!0}))});var eU=a(0x818fd090),ez=a(0x1c09d8c36),ej=a(0x85c4d21),e$=a(0x242822dfb),eG=a(0x8e309e4d),eK=a(0x1c4a1a163),eY=a(0x136ad1993),eQ=a(0x218fd5440),eZ=a(0xa21d3b1e),eJ=a(0x9d5bcdc6),eX=a(0x668181b3),e0=a(0x2772625d),e1=a(0x1b05cc3ce),e2=a(0x96aa1794),e8=a(0x20a2a54fa),e4=a(0x1a5ac3a0c),e5=a(0x252b4df6e),e6=a(0x1795d8821),e3=a(0x25054cb9f);let e7=new c.Ay("workflow_builder"),createChoice=(e,t)=>({value:e,title:("string"==typeof e||"number"==typeof e)&&t?t?.[e]:"",description:""}),QuestionDefaultValue=({segment:e,parameter:t,configuredParameters:a,question:n,wrappedFunction:l})=>{let i=(0,k.A)(),s=(0,C.rC)(),o=(0,e8.EM)(e),c=(0,e5.Dp)(e),d=(0,e2.j)(),u=(0,e4.DY)(d),m=(0,e5.am)(e),p=(0,e5.mV)(e),b=d?.trigger?.id,f=(0,M.d4)(N.$T),g=n.name,h=l.id,_=l.input_parameters.map(eU.w),x=(0,r.useMemo)(()=>(0,eQ.K)(_),[_]),v=(0,r.useMemo)(()=>(0,e$.xn)(_),[_]),E=v.length>0?v[0]:void 0,S=(0,r.useMemo)(()=>!_.some(({name:e})=>e===t.name),[_,t.name]),w=S&&!!E,T=(0,r.useMemo)(()=>(0,eZ.z)({functionVariables:m,variables:o,isFunctionFormWrapped:p,stepId:e.id,isKeyValueParameter:w,parameterName:w?E.name:t.name,dynamicOptionKey:w?t.name:void 0}),[m,p,w,E?.name,t.name,e.id,o]),I=(0,r.useCallback)((e,t)=>{let{source:a,sourceReference:n}=e;return("trigger"===a&&n&&s((0,A.aI)({value:n})),t?.skipMacro)?e:(0,e3.Xq)(e,{fromRichText:t?.isRichText,appId:l?.app_id,parameterType:t?.parameterType,stepId:l?.id,callbackId:l?.callback_id})},[s,l?.app_id,l?.id,l?.callback_id]),F=(0,e$.qt)(t),O=(0,r.useCallback)(e=>(Array.isArray(e)?e:[e]).reduce((e,t)=>{if("string"!=typeof t)return e;let a=(0,eX.x)(T.list,t);return a?.source==="trigger"&&a.sourceReference&&e.push(a.sourceReference),e},[]),[T.list]),L=(0,r.useCallback)(({value:e,label:a,filterQueries:r})=>{if(s((0,A.aI)({value:O(e)})),"choices"in t||F){let l=n?.choices;if(F)if(Array.isArray(e)){let t=l?.reduce((e,t)=>(e[t.value]=t.title,e),{})??{};l=e.reduce((e,n)=>{if("string"==typeof n&&(0,e0.bs)(n))return e;let r={...t,...a};return e.push(createChoice(n,r)),e},[])}else"string"==typeof e&&(0,e0.bs)(e)?"string"==typeof e&&(0,e0.bs)(e)&&(l=void 0):l=[createChoice(e,a)];else"choices"in t&&Array.isArray(t.choices)&&(l=t.choices.map(e=>({...e,description:""})));s((0,A.nX)({value:e,questionName:g,choices:l?.length?l:void 0,filterQueries:r}))}else s((0,A.aL)({value:e,questionName:g}))},[O,s,t,F,n?.choices,g]),D=(0,r.useCallback)((e,t,a,n)=>{L({value:t,label:a,filterQueries:a?.[ez.x3]})},[L]),P=(0,r.useCallback)(e=>{let{value:t}=e;L({value:t,label:"valueLabel"in e?e.valueLabel:void 0,filterQueries:"filterQueries"in e?e.filterQueries:void 0})},[L]),R=(0,r.useMemo)(()=>{let e=(0,e1.WG)(t)?{...t.render_condition,is_required:!1}:void 0;return(0,eU.w)({...t,is_required:!1,render_condition:e})},[t]),B=(0,r.useMemo)(()=>({...(0,eG.c)(t),is_required:!1}),[t]),W=(0,r.useMemo)(()=>(0,eY.z)({callbackId:c,parameter:t}),[c,t]),V=(0,r.useMemo)(()=>{if(!(S&&B.type?(0,eJ.K)(B.type):(0,eJ.K)(t.type===e6.TE.Array?t.items.type:t.type)))return null;if(w){let e=a?.[E.name]?.value,n=(0,e$.wK)(e,E)?e[t.name]:void 0;return r.createElement(ej.J,{parameter:E,dynamicInput:B,value:n??"",values:a,onChange:P,functionId:h,workflowId:u,callbackId:c,variables:T,allowVariables:W,formatVariableBeforeInsert:I,functionVariables:m,isFunctionFormWrapped:p,elementId:i,shouldRenderRichTextInput:!0})}return r.createElement(eK.v,{functionId:h,variables:T,configuredParameters:a,onChange:D,formatVariableBeforeInsert:I,callbackId:c,workflowId:u,triggerId:b,functionVariables:m,isFunctionFormWrapped:p,parameter:R,keyValueParameters:v,oAuthParameter:x,inputParameters:_,hideLabel:!0})},[S,B,t,w,h,T,a,D,I,c,u,b,m,p,R,v,x,_,E,P,W,i]);return f?r.createElement(r.Fragment,null,V&&r.createElement(r.Fragment,null,r.createElement(y.A,{text:e7.t("Default value (optional)"),htmlFor:i,className:"margin_bottom_50",subtext:e7.t("The question input will be prefilled with this for users.")}),r.createElement("div",{className:"margin_bottom_125","data-qa":"question-default-value-input"},V))):null};QuestionDefaultValue.displayName="QuestionDefaultValue";var e9=a(0x139d8d26e);let te=new c.Ay("workflow_builder"),QuestionFileDetails=({questionName:e,maxItems:t=e9.$,allowedFileTypesGroup:a=$.vy.ALL})=>{let n=(0,C.rC)(),l=te.t("How many files should they upload?"),i=te.t("Single"),s=te.t("Multiple"),o=(0,r.useCallback)(t=>n((0,A.d4)({questionName:e,maxItems:t})),[n,e]),c=(0,r.useMemo)(()=>[{label:i,value:1},{label:s,value:e9.$}],[s,i]),d=te.t("Any file type"),u=te.t("Images (JPG, PNG, SVG, etc) only"),m=te.t("What file types should they upload?"),p=(0,r.useMemo)(()=>[{label:d,value:$.vy.ALL},{label:u,value:$.vy.IMAGES_ONLY}],[d,u]),b=(0,r.useCallback)(t=>n((0,A.y_)({questionName:e,allowedFileTypesGroup:t})),[n,e]);return r.createElement(r.Fragment,null,r.createElement(y.A,{htmlFor:`${e}_file_how_many`,text:l},r.createElement(eV.l,{id:`${e}_file_how_many`,value:t,options:c,onChange:o,errorText:"",required:!0})),r.createElement(y.A,{htmlFor:`${e}_file_images_only`,text:m},r.createElement(eV.l,{id:`${e}_file_images_only`,value:a,options:p,onChange:b,errorText:"",required:!0})))};QuestionFileDetails.displayName="QuestionFileDetails";var tt=a(0x126f22530),ta=a(0x1dde3f5ab),tn=a(0x14149c126);let tr=new c.Ay("workflow_builder"),tl=(0,r.memo)(({description:e,questionName:t,questionType:a,maxItems:n})=>{let l="on"===(0,M.d4)(e=>(0,tn._Z)(e,"third_party_user_form_parity")),i=(0,C.rC)(),s=(0,ta.vn)(n)[a],o=(0,r.useCallback)(e=>i((0,A.ud)({questionName:t,description:e})),[i,t]);return r.createElement(y.A,{htmlFor:`${e}_input_label`,text:l?tr.t("Hint (optional)"):tr.t("Description (optional)")},r.createElement(tt.A,{id:`${e}_input_label`,value:e,onChange:o,name:"description",maxCharacterLimit:Y.au,placeholder:s,autoComplete:"off",useInlineAlert:!0,spellCheck:!0,"data-qa":"dialog-question-description__input",hintText:l?tr.t("Hint text will appear below the question, just like this text."):tr.t("Description will appear below the question, just like this text.")}))}),ti=new c.Ay("workflow_builder"),ts=(0,r.memo)(({label:e,questionName:t,shouldFocusQuestion:a=!1})=>{let n=(0,C.rC)(),l=ti.t("A question is required."),{onBlur:i,errorText:s}=(0,I.K)({errorMessage:l,isErrored:!(0,Y.fD)({label:e})}),o=(0,r.useCallback)(e=>n((0,A.qt)({questionName:t,label:e})),[n,t]);return r.createElement(y.A,{htmlFor:`${e}_input_label`,text:ti.t("Your question")},r.createElement(tt.A,{id:`${e}_input_label`,value:e,onChange:o,name:"label",maxCharacterLimit:Y.aA,isRequired:!0,focusOnMount:a,onBlur:i,errorText:s,autoComplete:"off",useInlineAlert:!0,spellCheck:!0,"data-qa":"dialog-question-label__input"}))});var to=a(0x1cbdfeceb),tc=a(0xa7ec93c2),td=a(0x1efcf3032),tu=a(0x22e98208d),tm=a.n(tu);let tp=new c.Ay("workflow_builder"),QuestionSelectDefaultValue=({dataSource:e,options:t=[],questionName:a,selectedOptionId:n="",dataQa:l,questionType:i,defaultValue:s})=>{let o=(0,C.rC)(),[c,d]=(0,r.useState)((0,k.A)()),u=(0,r.useCallback)(e=>o((0,A.aL)({optionId:e,questionName:a})),[o,a]),m=(0,r.useCallback)(e=>{o((0,A.aL)({value:e.map(({label:e})=>e),questionName:a}))},[o,a]),p=(0,r.useCallback)((e,t,n)=>{o((0,A.aL)({value:t,questionName:a}))},[o,a]),b=(0,E.A)(),f=(0,G.w)(t),g=(0,r.useMemo)(()=>t.map(e=>({label:e.label,value:e.id})),[t]),h=tp.t("None selected"),_=tp.t("Default option"),x=(0,r.useMemo)(()=>g.filter(e=>s?.includes(e.label)),[g,s]),v=i&&(0,ta.Em)(i),S=v&&(0,ta.kd)(i),w=v&&(0,ta.fo)(i),T=v&&(0,ta.TD)(i),I=[$.g7.Conversations,$.g7.Channels].includes(e),N="users"===e,M=w||T||I||N,F=!w&&!T&&!I&&!N,O=(0,r.useCallback)(()=>d((0,k.A)()),[]);(0,r.useEffect)(()=>{t.length>0&&O()},[O,t]);let L="users"===e?$.xi.SelectPerson:i,D=(0,r.useMemo)(()=>M&&L?(0,ta.OR)(L,s):null,[s,M,L]),P=(0,r.useMemo)(()=>M&&null!==D?[{...(0,ta.FA)(D)[0],is_required:!1,title:_}]:[],[_,D,M]),R=(0,r.useMemo)(()=>M&&null!==D?(0,ta.Fn)(D):null,[D,M]),B=(0,r.useMemo)(()=>({updateRequiredContext:to.A,viewOnly:!1,updateParameterValue:to.A,onVariableMenuOpen:to.A,openFormSteps:[],triggerType:void 0,externalTriggerSalesforceOrgId:void 0,validateAsyncValue:to.A,hasValidAppPinBuiltInMessage:!1,workflowSummaryStepPrecedes:!1,formStepPrecedesCurrentStep:!1,previousStepId:""}),[]),W=F||N&&null===R||I&&null===R?_:"";return r.createElement(y.A,{htmlFor:b,text:W},e===$.g7.Static&&!v&&r.createElement(eV.l,{id:b,value:n??"",options:f?t:g,placeholder:h,ariaLabel:_,onChange:u,dataQa:l,required:!1,errorText:""}),N&&null!==R&&r.createElement("div",{className:tm().container},r.createElement(td.L,{inputParameters:P,onChange:p,configuredParameters:R,workflowRendererContexts:B,oAuthParameter:void 0,callbackId:void 0})),I&&null!==R&&r.createElement("div",{className:tm().container},r.createElement(td.L,{inputParameters:P,onChange:p,configuredParameters:R,workflowRendererContexts:B,oAuthParameter:void 0,callbackId:void 0})),S&&r.createElement("div",{className:tm().container},r.createElement(tc.Ay,{key:c,options:g,selectDataQa:`${a}-multiSelectDefault`,ariaLabel:_,width:"100%",selectId:b,placeholderText:tp.t("Search for a value\u2026"),expandOnFocus:!0,selectedOptions:x,onSelectedItemsChange:m})),w&&null!==R&&r.createElement("div",{className:tm().container},r.createElement(td.L,{inputParameters:P,onChange:p,configuredParameters:R,workflowRendererContexts:B,oAuthParameter:void 0,callbackId:void 0})),T&&null!==R&&r.createElement("div",{className:tm().container},r.createElement(td.L,{inputParameters:P,onChange:p,configuredParameters:R,workflowRendererContexts:B,oAuthParameter:void 0,callbackId:void 0})))};QuestionSelectDefaultValue.displayName="QuestionSelectDefaultValue";var tb=a(0x1db887024),tf=a(0x228ea2b2a),tg=a(0x22c41b907),th=a(0x1bffa495d),t_=a(0xd0fb5338),ty=a(0xaaa6bbd0),tx=a(0x1bb29da6),tv=a(0x1f35a0f5),tE=a(0x1e22e34a7),tk=a(0xb2c476ed),tS=a(0x2120d7f64),tw=a(0x20e80190e),tC=a(0x46947d88),tA=a(0x537adc79),tT=a.n(tA);let tI=new c.Ay("workflow_builder"),tN={name:"caret-left-full",size:"20"},QuestionEditModal=({questionIndex:e=-1,switchPane:t,segment:a})=>{let n=(0,C.rC)(),{canAddQuestion:l}=(0,C.Qk)(),[i,s]=(0,r.useState)(e),[o,c]=(0,r.useState)(!1),d=(0,M.d4)(N.$T),u=(0,M.d4)(e=>(0,th.MZ)(e,a)),m=u?.input_parameters,p=d&&(0,ty.Pv)(a),b=(0,ty.q2)(a)&&(0,f.uz)(u)?(0,ty.Jl)(a,u,!1):void 0,E=d?(0,tx.N)(m,b):g.Ml,k=(0,t_.yS)(a),S=k[i],w=p&&k.length!==tb.Rj?tI.t("All available fields have been added"):tI.t("Each form can have a maximum of {maxQuestionCount} questions",{maxQuestionCount:tb.Rj}),{questionType:T,optional:I,name:F,options:O,data_source:L,selectedOptionId:P,maxItems:R,default:B}=S,W=(0,r.useMemo)(()=>E?.find(({name:e})=>e===F),[E,F]),V=(0,r.useMemo)(()=>{if(!p||!E.length)return;let{value:e}=a.config.inputs.fields,t=new Set((Array.isArray(e)?e:e.elements||[]).map(({name:e})=>e));return E.filter(e=>F===e.name||!t.has(e.name))},[E,p,a.config.inputs.fields,F]),q=(0,r.useCallback)(()=>{p?t(tg.k.THIRD_PARTY_USER_FORM_CONFIG):t(tg.k.DEFAULT)},[p,t]),H=(0,r.useCallback)(()=>{c(!0),n((0,A.Af)({})),n((0,A.c5)({questionIndex:k.length,newQuestionIndex:i+1})),s(i+1),setTimeout(()=>{c(!1)},300)},[k.length,i,n]),U=(0,r.useCallback)(e=>{let t=!e.target.checked;n((0,A.qc)({questionName:F,optional:t}))},[F,n]),z=(0,r.useCallback)(()=>{n((0,A.V0)({questionName:F})),q()},[F,n,q]),j=((0,ta.OW)(T)||(0,ta.EI)(T))&&!p,G=T===$.xi.File&&!p,K=(0,ta.kd)(T)&&!p,Q=(0,ta.kd)(T)||(0,ta.fo)(T)||(0,ta.TD)(T),Z=([$.xi.SelectPerson,$.xi.SelectChannel,$.xi.Dropdown].includes(T)||Q)&&!p,J=j||G||K||Z,X=(0,r.useMemo)(()=>r.createElement(r.Fragment,null,r.createElement("span",null,tI.t("Question {questionNumber}",{questionNumber:i+1})),I&&r.createElement("span",{className:tT().optional_label},tI.t("(optional)"))),[I,i]),{speedBumpState:ee,closeSpeedBump:et,openSpeedBump:ea}=(0,tS.v)(),en=(0,r.useCallback)(e=>{for(let t of O??[])if(e===$.xi.Dropdown&&"string"==typeof t.value&&void 0!==t.label){let e=(0,tE.l)(t.value);n((0,A.ly)({questionName:F,optionId:t.id,value:e,label:t.label}))}},[O,F,n]),er=(0,r.useCallback)(()=>{let e=!p||p&&W;(0,Y.fD)(S)&&e?q():ea()},[W,p,ea,S,q]),el=(0,r.useMemo)(()=>r.createElement(x.A,{onClick:er,"aria-label":tI.t("Back"),svgIconProps:tN}),[er]);return(0,tk.M)("keyup",e=>{e.key===tC.D.ESCAPE&&er()}),r.createElement(r.Fragment,null,r.createElement(tw.rQ,null,r.createElement(tw.Rc,{title:X,icon:el})),r.createElement(tw.$m,null,r.createElement(tw.qf,null,o&&r.createElement(LoadingSkeleton,null),r.createElement("div",{className:o?tT().hidden:""},p&&(0,f.uz)(u)&&r.createElement(D,{key:`${F}_field_type`,formWrappableParameters:V,questionName:F,appId:u.app_id,functionCallbackId:u.callback_id}),r.createElement(ts,{label:(0,ta.DM)(S),questionName:F,key:`${F}_label`,shouldFocusQuestion:!p}),p&&W&&(0,f.uz)(u)&&r.createElement(QuestionDefaultValue,{segment:a,parameter:W,configuredParameters:b,question:S,wrappedFunction:u}),r.createElement(eP,{questionType:T,questionName:F,isSegmentFormWrapped:p,onUpdateQuestionType:en}),r.createElement("div",{className:"margin_top_125"},r.createElement(tl,{description:S.description,questionName:F,questionType:T,maxItems:R})),r.createElement(y.A,{text:tI.t("Make this required"),type:"inline",className:"margin_bottom_125"},r.createElement(_.A,{id:"question_optional_input",checked:!I,onChange:U,disabled:W&&(!!W.is_required||(0,tf.L)(W))})),J&&r.createElement(tv.A,null),j&&r.createElement(eb,{options:O,questionName:F,questionIndex:i,questionType:T,questionHermesType:S.type}),G&&r.createElement(QuestionFileDetails,{questionName:F,maxItems:R,allowedFileTypesGroup:S?.items?.allowed_filetypes_group}),K&&r.createElement(eH,{options:O,questionName:F,maxItems:R}),Z&&r.createElement(QuestionSelectDefaultValue,{options:O,questionName:F,dataSource:L??$.g7.Static,defaultValue:B,selectedOptionId:P,questionType:T})))),ee.isVisible?r.createElement(tw.ty,{heading:tI.t("Keep this question?"),description:tI.t("To keep the question, resolve all errors. Or, you can delete it."),continueButtonType:"danger",continueButtonLabel:tI.t("Delete"),onContinue:z,onCancel:et}):r.createElement(tw.jl,null,l?r.createElement(h.Ay,{type:"outline",onClick:H,disabled:!(0,Y.fD)(S)},tI.t("Add Another Question")):r.createElement(v.Ay,{position:"top",tip:w},r.createElement("div",{className:tT().pointer},r.createElement(h.Ay,{type:"outline",disabled:!0},tI.t("Add Another Question")))),r.createElement(tw.ox,null,r.createElement(h.Ay,{type:"primary",onClick:er},tI.t("Done")))))};QuestionEditModal.displayName="QuestionEditModal";var tM=a(0x140c59582),tF=a(0xabcf9c80),tO=a(0xb1ea448c),tL=a(0x2370cecef),tD=a.n(tL);let tP=new c.Ay("workflow_builder"),FormLoadingScreen=({switchPane:e,heading:t,subheadings:a,redirectPane:n})=>{(0,r.useEffect)(()=>{let t=setTimeout(()=>{n&&e(n)},1e3);return()=>clearTimeout(t)});let l=(0,r.useMemo)(()=>a?(0,tF.A)(a):(0,tF.A)([tP.t("Computering in the dataspace\u2026"),tP.t("Tubing fields\u2026"),tP.t("Finding the good stuff\u2026"),tP.t("Reticulating splines\u2026")]),[a]);return r.createElement(tw.dW,{centered:!0,showCloseButton:!1},r.createElement(tw.$m,{className:"margin_top_600 margin_bottom_600"},r.createElement(tw.qf,{className:"margin_top_300 margin_bottom_300"},r.createElement("div",{className:tD().wrapper},r.createElement(tO.A,{size:"jumbo"}),r.createElement("div",{className:tD().textContainer},r.createElement("span",{className:tD().formType},t),r.createElement("span",{className:tD().subheading},l))))))};FormLoadingScreen.displayName="FormLoadingScreen";var tR=a(0x21343fa5a),tB=a(0x1e586fbba),tW=a(0x13262fc8e),tV=a(0x17ee9cd72),tq=a(0x1e864b930),tH=a(0x1faa3f1ac),tU=a(0x1903d373d);let tz=new c.Ay("workflow_builder"),UnwrappableParametersAlert=({inputParameters:e})=>{let[t,a]=(0,r.useState)(!0),n=(0,r.useCallback)(()=>{a(!1)},[a]),l=(0,r.useMemo)(()=>e?.reduce((e,t)=>{let a=(0,eU.w)(t),n=a.title??a.name;if(a.is_hidden||a.type===e6.TE.SlackTypesCredentialOauth2)return e;if((0,e$.sg)(a)){let t=a.properties??{};Object.keys(t).forEach(a=>{let n=t[a],r=n.title??n.name;(0,tU.AL)(n)||e.push(r)})}else(0,tU.AL)(a)||e.push(n);return e},[]),[e]),i=(0,r.useMemo)(()=>{if(!t||!l?.length)return null;let e=l.length-2;if(e<1)return null;let a=tz.rt("{remaining} more",{remaining:e});return r.createElement(tH.A,{"data-qa":"show-param-names",onClick:n,"aria-label":tz.t("Show all input names")},a)},[t,n,l]),s=(0,r.useMemo)(()=>{if(!l)return"";let e=(0,tq.A)(l,{react:!0,strong:!0});if(1===l.length)return r.createElement("span",{"data-qa":"single-item-warning-text"},tz.rt("{fieldList} is an unsupported question type and can\u2019t be added to the form.",{fieldList:e}));if(l.length>3&&t&&i){let t=l.slice(0,2);e=(0,tq.A)(t.concat(i),{react:!0,strong:!0})}return tz.rt("{fieldList} are unsupported question types and can\u2019t be added to the form.",{fieldList:e})},[l,t,i]);return l?.length?r.createElement(u.Ay,{"data-qa":"unsupported-field-alert",id:"unsupported-field-alert",level:u.A_.info,align:u.AO.left,className:"margin_bottom_100"},s):null};UnwrappableParametersAlert.displayName="UnwrappableParametersAlert";var tj=a(0xf6b2f43b),t$=a(0x1e271947d),tG=a(0x171a52b74),tK=a(0x3711e82d),tY=a(0x127a944f7),tQ=a.n(tY);let tZ=new c.Ay("workflow_builder"),FormWrappedInputsModal=({title:e,icon:t,saving:a,onSave:n,onClose:l,saveError:i,renderSaveError:s,submitLabel:o,cancelLabel:c,isExistingSegment:d=!1,isSegmentModified:u=!1,segment:m,speedBumpContext:p,segmentReducer:b,baseAutoClogProps:f,switchPane:g})=>{let _=(0,tj.u)(),y=(0,tG.GS)(m),x=!!y&&(0,e5.mV)(m),v=(0,e8.EM)(m),E=y?(0,e5.Dl)(m):void 0,k=y?(0,e5.Iw)(m):void 0,S=y?(0,e5.ln)(m):void 0,w=y&&(0,t_.F$)(m),C=y?(0,e5.am)(m):void 0,[A,T]=b,{speedBumpState:I}=p,N=A.computed?.isValid&&!a&&(u||!d),M=(0,r.useMemo)(()=>({...f,action:tK.UiAction.SAVE,onClick:{enableClogAction:N}}),[f,N]),F=(0,r.useCallback)(()=>{g(tg.k.DEFAULT)},[g]),O=(0,r.useCallback)(e=>{T((0,t$.R)({isFunctionFormWrapped:x,...e}))},[T,x]),L=(0,r.useCallback)(()=>{A.computed?.isValid&&!a&&n()},[n,a,A.computed]),D=(0,r.useCallback)(e=>{T((0,t$.Ox)({title:e}))},[T]);return(0,tR.A)(()=>{w&&D(w)},!!w),r.createElement(r.Fragment,null,r.createElement(tw.rQ,null,r.createElement(tw.Rc,{title:e,icon:t})),r.createElement(tw.$m,null,i&&s&&r.createElement(tw.qf,{className:"c-segment_modal--save_error"},r.createElement(tB.A,null,s(i))),r.createElement(tw.qf,null,r.createElement("h2",{className:tQ().content_title},tZ.t("Please select the questions to show to the user")),r.createElement("p",{className:"sk_foreground_max margin_bottom_100"},tZ.t("We\u2019ll open a form to collect these answers using the account of the person who runs the workflow. Make sure they have permission to edit these fields.")),y&&r.createElement(r.Fragment,null,r.createElement(tW.D,{segment:m,onChange:D}),r.createElement(UnwrappableParametersAlert,{inputParameters:S}),r.createElement(tV.a,{variables:v,slackFunction:E,inputValues:k,functionVariables:C,stepId:m.id,isFunctionFormWrapped:x,onChange:O})))),I.isVisible?r.createElement(tw.ty,{heading:I.heading,cancelButtonLabel:I.cancelButtonLabel,continueButtonLabel:I.continueButtonLabel,continueButtonIsDisabled:I.continueButtonIsDisabled,continueButtonIsLoading:a,continueButtonType:I.continueButtonType,onCancel:I.onCancel,onContinue:I.onContinue,description:I.message}):r.createElement(tw.jl,null,r.createElement(h.Ay,{type:"outline",onClick:F,disabled:a,"data-qa":"form-wrapped-inputs-back__button"},tZ.t("Back")),r.createElement(tw.ox,null,r.createElement(h.Ay,{type:"outline",onClick:l,disabled:a,"data-qa":"form-wrapped-inputs-cancel__button"},c||tZ.t("Cancel")),!_&&r.createElement(h.lV,{loading:a,onClick:L,disabled:!N,"data-qa":"form-wrapped-inputs-submit__button",autoClogProps:M,"aria-label":o||tZ.t("Save")},o||tZ.t("Save")))))};FormWrappedInputsModal.displayName="FormWrappedInputsModal";var tJ=a(0xa5dbe09b),tX=a(0xf77002c6),t0=a(0xe374a1b1),t1=a(0xfe5aa224),t2=a(0x139c79d16),t8=a(0xcc8bbdff),t4=a.n(t8);let FormWrappedSelectionRadio=({label:e,checked:t,onChange:a,disabled:n,className:l,image:i,name:o,value:c})=>{let d=(0,E.A)(),u=(0,r.useContext)(t1.A),[m,p]=(0,r.useState)(!1),b=(0,r.useCallback)(e=>{p(u&&"focus"===e.type)},[u]);return r.createElement("div",{className:s()(t4().radioInputContainer,{[t4().radioInputContainerChecked]:t,[t4().radioInputFocused]:m})},r.createElement("label",{htmlFor:d,className:l},i,r.createElement(t2.A,{className:t4().radioInput,name:o,value:c,id:d,checked:t,onChange:a,disabled:n,autoFocus:t,onFocus:b,onBlur:b}),e))};FormWrappedSelectionRadio.displayName="FormWrappedSelectionRadio";var t5=a(0x3b8174d2);let useSegmentPaneNavigation=({segment:e,switchPane:t,activePane:a})=>{let n=(0,C.rC)(),l=(0,M.d4)(N.$T),i=(0,tG.GS)(e)?e:void 0,s=!!i&&(0,e5.mV)(i),o=(0,r.useMemo)(()=>!!i&&(0,ty.q2)(i),[i]),c=(0,r.useMemo)(()=>l&&!!i?.config.isDataFetching,[l,i]),d=(0,M.d4)(e=>i?.config.isFunctionFormWrappable?(0,t5.hj)(e,tb.QF):void 0),u=(0,r.useCallback)(()=>{(0,f.uz)(d)&&!c&&(n((0,t$.JB)({openFormSlackFunction:d})),t(tg.k.THIRD_PARTY_USER_FORM_CONFIG))},[n,c,d,t]),m=(0,r.useCallback)(()=>{i&&(0,ty.q2)(i)&&i.config.wrappedSlackFunction&&n((0,t$.nk)({wrappedFunction:i.config.wrappedSlackFunction})),t(tg.k.PARENT_INPUTS)},[n,i,t]),p=(0,r.useMemo)(()=>l&&a===tg.k.PARENT_INPUTS,[l,a]),b=(0,r.useMemo)(()=>l&&a===tg.k.CHILD_INPUTS,[l,a]);return{navigateToFormConfiguration:u,navigateToParentInputsModal:m,is3PUFConfigModal:(0,r.useMemo)(()=>l&&a===tg.k.THIRD_PARTY_USER_FORM_CONFIG&&o&&s,[a,l,s,o]),isChildModal:b,isParentModal:p}},t6=new c.Ay("workflow_builder"),FormWrappedSelectionLabel=({label:e,subLabel:t})=>r.createElement("div",{className:t4().radioInputLabel},r.createElement("div",{className:"bold"},e),r.createElement("div",{className:t4().radioInputSubLabel},t));FormWrappedSelectionLabel.displayName="FormWrappedSelectionLabel";let FormWrappedSelectionModal=({title:e,icon:t,onClose:a,switchPane:n,appId:l,segment:i,activePane:s})=>{let o=(0,tG.GS)(i)?i:void 0,c=o?(0,e5.ln)(o):[],{navigateToFormConfiguration:d}=useSegmentPaneNavigation({segment:i,switchPane:n,activePane:s}),u=c?.some(e=>(0,tX.oO)(e)),m=(0,C.rC)(),[b,f]=(0,r.useState)(!0),g=(0,r.useCallback)(e=>{f(e.target?.value==="true")},[]),_=(0,r.useCallback)(()=>{m((0,A.TI)({isFunctionFormWrapped:b})),u?n(tg.k.PARENT_INPUTS):b?d():n(tg.k.CHILD_INPUTS)},[b,d,m,u,n]),y=(0,r.useMemo)(()=>r.createElement(FormWrappedSelectionLabel,{label:t6.t("Add the step with a form"),subLabel:t6.t("Let people using the workflow fill out a form to update the step\u2019s information.")}),[]),x=(0,r.useMemo)(()=>r.createElement(FormWrappedSelectionLabel,{label:t6.t("Add just the step"),subLabel:i?t6.t("You can still build a form manually and connect it to this step later."):t6.t("You can still build a form manually connect it to this step later.")}),[i]),v=(0,r.useMemo)(()=>l?r.createElement(T.z,{appId:l,imageClassName:t4().radioInputImageAppIcon}):r.createElement(r.Fragment,null,t),[l,t]),E=(0,r.useMemo)(()=>r.createElement("div",{className:t4().radioInputImage},r.createElement(p.Ah,{inline:!0,"data-qa":"form",name:"form",size:"24"}),r.createElement("span",{className:t4().radioInputImageArrow},r.createElement(p.Ah,{inline:!0,"data-qa":"arrow-right",name:"arrow-right",size:"20"})),v),[v]),k=(0,r.useMemo)(()=>r.createElement("div",{className:t4().radioInputImage},v),[v]);return r.createElement(t0.v,{onClose:a},r.createElement(tw.rQ,null,r.createElement(tw.Rc,{title:e,icon:t})),r.createElement(tw.$m,null,r.createElement(tw.qf,null,r.createElement(tJ.A,{className:t4().radioGroup,legendClassNames:"no_margin"},r.createElement(FormWrappedSelectionRadio,{label:y,checked:b,onChange:g,image:E,name:"choose_form_wrapped",value:"true"}),r.createElement(FormWrappedSelectionRadio,{label:x,checked:!b,onChange:g,image:k,name:"choose_form_wrapped",value:"false"})))),r.createElement(tw.jl,null,r.createElement(tw.ox,null,r.createElement(tw.s_,{"data-qa":"oauth-account-select-modal-cancel",type:"outline","aria-label":"Cancel",onClick:a},t6.t("Cancel")),r.createElement(h.Ay,{type:"primary",onClick:_},t6.t("Set Up")))))};FormWrappedSelectionModal.displayName="FormWrappedSelectionModal";var t3=a(0xb77a689a),t7=a(0x102edf836),t9=a(0x15fb82076),ae=a(0x780e190c),at=a(0xa03b6325),aa=a(0x18e09ba96),an=a(0x24129bf7),ar=a(0x61c95b1b),al=a(0x7019ae94),ai=a(0x1a7251dad),as=a(0x208f8a00d),ao=a(0x67839580),ac=a(0xcb036ba),ad=a(0xf7ab484f),au=a(0x210cf696f),am=a(0x1ee6256b0),ap=a(0x46dbff89);let ab=new c.Ay("workflow_builder"),ChangeTriggerButton=({disabled:e})=>{let t=(0,l.wA)(),a=(0,tj.u)(),n=(0,e2.j)(),i=(0,e4.DY)(n),s=(0,r.useCallback)(()=>t((0,ap.q)({element:r.createElement(am.G,{workflowId:i})})),[t,i]),o=ab.t("Change Trigger"),c=e||a||(0,e4.a6)(n),d=ab.t("How the workflow starts can\u2019t be changed after it\u2019s been published");return n&&!(0,e4.a6)(n)&&(d=ab.t("You can change how the workflow starts now, but not after publishing")),a&&(d=ab.t("You can\u2019t change how the workflow starts in view-only mode")),r.createElement(v.Ay,{tip:d,position:"top"},r.createElement("div",null,r.createElement(au.A,{onClick:s,disabled:c,"data-qa":"form-wrapped-inputs-change_trigger__button"},o)))};ChangeTriggerButton.displayName="ChangeTriggerButton";var af=a(0x21f3c49e8),ag=a(0x20bafd237),ah=a(0x211a99e2f),a_=a(0x1fdec3e16),ay=a(0x18f070aac),ax=a.n(ay);let av=new c.Ay("workflow_builder"),SegmentPaneNavigationLink=({title:e,onClick:t,description:a,linkAutoClogProps:n,dataQa:l,hasError:i})=>{let o=i?av.t("Resolve"):av.t("Edit");return r.createElement("div",{className:s()("padding_bottom_50","padding_top_50",ax().navigation_container),"data-qa":l},r.createElement("div",{className:s()("bold",ax().navigation_title)},e),r.createElement("div",{className:s()(ax().navigation_description,{[ax().error_content]:!!i})},i&&r.createElement(p.Ah,{name:"warning"}),r.createElement(a_.A,{lines:1},r.createElement("span",null,a))),r.createElement("div",{className:ax().navigation_link_change},r.createElement(tH.A,{onClick:t,autoClogProps:n},o)))};SegmentPaneNavigationLink.displayName="SegmentPaneNavigationLink";var aE=a(0x23a4b0853),ak=a(0x339b339c),aS=a(0x4e1a3b33),aw=a(0xa985ed31),aC=a(0x14ea3ce99);let aA=new c.Ay("workflow_builder"),SegmentPaneDataNavigationLabel=({value:e,label:t,parameterType:a,variables:n})=>{let l=(0,M.d4)(t=>{if("string"==typeof e&&(0,aw.A)(e))return(0,aC.Lp)(t,e)});return"string"==typeof e&&(0,e0.cn)(e)&&a?r.createElement(ah.l,{text:e,variables:n,parameterType:a}):l&&(0,f.mX)(l)?r.createElement(ak.A,{size:"medium"}):(0,f.uz)(l)?r.createElement(aS.A,{file:l,disableTooltip:!0,useLeadingEmojiAsIcon:!0,hideRichTextEmojiTooltips:!0,shouldShowHighlight:!1}):r.createElement(r.Fragment,null,e&&t&&("string"==typeof e||"number"==typeof e)&&"string"==typeof t?.[e]?t[e]:String(e))};SegmentPaneDataNavigationLabel.displayName="SegmentPaneDataNavigationLabel";let SegmentPaneDataNavigation=({segment:e,inputParameters:t=[],switchPane:a,baseAutoClogProps:n,hasValidParentInputValues:l,activePane:i})=>{let s=(0,e8.EM)(e),o=(0,e5.P)(e),c=(0,r.useMemo)(()=>(0,e$.ny)(t),[t]),d=t.some(e=>(0,tX.oO)(e)),{navigateToParentInputsModal:u}=useSegmentPaneNavigation({segment:e,switchPane:a,activePane:i}),m=(0,r.useMemo)(()=>{let a=(0,f.uz)(o)&&(0,ty.q2)(e)?(0,ty.Jl)(e,o,!1):(0,e5.Iw)(e),n=t.find(e=>(0,eQ.t)(e)),l=t.filter(e=>(0,tX.oO)(e)&&!(0,eQ.t)(e)&&!(0,e1.M$)(e,a));if((0,af.A)(l)&&n)return o?.category_label;if((0,af.A)(l))return;let i=(c&&"parentInputs"in c&&Array.isArray(c.parentInputs)?c.parentInputs.find(e=>!!l.some(({name:t})=>t===e)):void 0)??(0,ag.A)(l)?.name??"",d=(0,ty.q2)(e)?(0,ty.WC)(e,i):(0,e5.RE)(e,i),u=t.map(eU.w).find(({name:e})=>e===i),m="object"!=typeof d?.value?r.createElement(SegmentPaneDataNavigationLabel,{value:d?.value,label:d?.label,variables:s,parameterType:u?.type}):null;if(u)return d?.value!==void 0&&null!==d.value&&m?aA.rt("{title}: {label}",{title:u.title,label:m}):u.title},[o,e,t,c,s]),p=(0,r.useMemo)(()=>({...n,action:tK.UiAction.CLICK,elementName:aE.KC.NavigateToDataPane,onClick:{enableClogAction:!0}}),[n]);return d?r.createElement(SegmentPaneNavigationLink,{title:aA.t("Connection"),onClick:u,description:m,linkAutoClogProps:p,dataQa:"segment-pane-data-navigation",hasError:!1===l}):null};SegmentPaneDataNavigation.displayName="SegmentPaneDataNavigation";let aT=new c.Ay("workflow_builder"),SegmentPaneFormNavigation=({segment:e,switchPane:t,baseAutoClogProps:a,activePane:n})=>{let{navigateToFormConfiguration:l}=useSegmentPaneNavigation({segment:e,switchPane:t,activePane:n}),i=(0,r.useMemo)(()=>{let t=(0,e5.B8)(e)?.fields?.value,a=(0,e5.UX)(e),n=Array.isArray(t)?t:t?.elements;if(!(!n||(0,af.A)(n)))return aT.t("{length} {serviceName} {length, plural, =1 {field} other {fields}} included",{length:n.length,serviceName:a?.category_label})},[e]),s=(0,r.useMemo)(()=>({...a,action:tK.UiAction.CLICK,elementName:aE.KC.NavigateToFormConfigPane,onClick:{enableClogAction:!0}}),[a]);return r.createElement(SegmentPaneNavigationLink,{title:aT.t("Form"),onClick:l,description:i,linkAutoClogProps:s,dataQa:"segment-pane-form-navigation"})};SegmentPaneFormNavigation.displayName="SegmentPaneFormNavigation";var aI=a(0x152c6b9a8);let SegmentPaneNavigation=({switchPane:e,inputParameters:t,segment:a,baseAutoClogProps:n,hasValidParentInputValues:l,activePane:i})=>{let s=(0,M.d4)(N.$T),o=!!a&&(0,e5.mV)(a),c=(0,r.useMemo)(()=>(0,aI.q)(a),[a]),{is3PUFConfigModal:d,isChildModal:u}=useSegmentPaneNavigation({segment:a,switchPane:e,activePane:i}),m=u||d,p=u&&!c&&o;return s?r.createElement(r.Fragment,null,m&&r.createElement(SegmentPaneDataNavigation,{segment:a,inputParameters:t,switchPane:e,baseAutoClogProps:n,hasValidParentInputValues:l,activePane:i}),p&&r.createElement(SegmentPaneFormNavigation,{segment:a,switchPane:e,baseAutoClogProps:n,activePane:i})):null};SegmentPaneNavigation.displayName="SegmentPaneNavigation";let aN=(0,r.lazy)(()=>a.e("workflow-builder-segment-form-loop").then(a.bind(a,0x1e83cca9c)));var aM=a(0x91728dda),aF=a(0xe9c32bb),aO=a(0x4fbb276b),aL=a(0x161478d06),aD=a(0x20570d71a),aP=a(0x202470d56),aR=a(0x2362a0a7b),aB=a(0x1ec68d6a3),aW=a(0xcf8edac8);function useFunctionDynamicInputs({slackFunction:e,isOpenFormSegment:t,segmentId:a,callbackId:n,workflowId:i,configuredParameters:s,dynamicInputs:o,isExistingStep:c}){let d=(0,l.wA)(),u=(0,C.rC)(),m=(0,aB.default)({label:aW.y}),p=(0,r.useMemo)(()=>e?.input_parameters&&(0,e$.xn)(e.input_parameters),[e?.input_parameters]),b=(0,r.useCallback)(async t=>{try{u((0,t$.T)({[t.name]:{loading:!0,error:void 0}}));let r=await d((0,aR.T)({parameter:t,segmentId:a,stepFunctionId:e?.id??"",workflowId:i,callbackId:n,configuredInputs:s}));u((0,t$.T)({[t.name]:{loading:!1,options:r?.options,error:void 0}})),u((0,t$.aR)({parameter:t,options:r?.options})),u((0,A.zo)({options:r?.options,inputParameters:e?.input_parameters}))}catch(r){let e=r?.data?.error_code||r?.data?.error,n=r?.data?.error_message;u((0,t$.T)({[t.name]:{loading:!1,error:{code:e,message:n,pointer:"",source_id:a}}})),m.error(Error(`Failed to fetch dynamic options for ${t.name} parameter: ${r}`))}},[n,s,d,m,u,a,e?.id,i,e?.input_parameters]),f=!!(t&&p?.length&&c);(0,tR.A)(()=>{p?.forEach(e=>{(0,aP.A)(o?.[e.name]?.options)&&b(e)})},f)}var aV=a(0x1b3b89b97),aq=a(0x1c52575e2),aH=a(0x848ef3c),aU=a(0x6def043b),az=a(0x3c4a564b);function useFunctionVariables({functionId:e,workflowId:t,callbackId:a,functionVariables:n,slackFunctionVariablesSchema:i,configuredParameters:s,segmentId:o,isFunctionFormWrapped:c}){let d=(0,l.wA)(),u=(0,C.rC)(),m=(0,aB.default)({label:aW.y}),p=(0,r.useCallback)(async a=>{try{u((0,t$.zb)({isLoading:!0}));let r=await d((0,aH.O)({functionId:e,workflowId:t,inputs:a,reason:"workflow_builder/fetch_variables"}));if(r?.available_data){let e=Object.entries(r.available_data).reduce((e,[t,a])=>((0,aU.Kw)(a)&&(e[t]=a),e),{}),t=(0,aq.d)({availableData:{...e,...n?.formAvailableData},segmentId:o});u((0,t$.zb)({isLoading:!1,mapping:r.mapping,availableData:e,variables:{list:t,groups:[]}}))}}catch(e){u((0,t$.zb)({isLoading:!1})),m.error(Error(`Failed to fetch function variables: ${e}`))}},[d,e,n?.formAvailableData,m,u,o,t]),b=!!i&&!i.error_code&&(0,aP.A)(n?.mapping),f=(0,az.s)(s,i?.build_time_dependencies),g=(0,aV.O)(f);(0,r.useEffect)(()=>{c&&b&&g&&!(0,e$._Y)({parsedParameterValues:g,callbackId:a})&&p(g)},[a,b,p,c,g])}var aj=a(0xf9f06c3b);let a$=(0,r.lazy)(()=>a.e("workflow-builder-segment-form-slack-function-form").then(a.bind(a,0x1dbcc5a72)));var aG=a(0x677a139e),aK=a(0x1f5430624),aY=a(0x19f0ddaf7),aQ=a(0x10b93423f),aZ=a(0x32784134),aJ=a(0x1d922a37e),aX=a(0x1846f5916),a0=a(0x24eaf48aa),a1=a(0x1bb9b9e21),a2=a(0xb46cd264),a8=a.n(a2);let a4=new c.Ay("workflow_builder"),AskAgentforceStep=({inputParameters:e,variables:t,configuredParameters:a={},onChange:n,formatVariableBeforeInsert:l,callbackId:i,showInline:s=!1,stepId:o,functionId:c,isTriggerSegment:d,isFunctionFormWrapped:u,isExistingStep:m,serviceTriggerType:p,functionVariables:b,oAuthParameter:f,onLoadingStateChange:g,allowVariables:h=!0,segment:_})=>{let y,x=(0,e2.j)(),v=(0,e4.DY)(x),E=(0,M.d4)(e=>(0,a1.X)(e,x)),k=(0,M.d4)(N.dq),S=(0,M.d4)(e=>"on"===(0,tn._Z)(e,"ask_agentforce_step_send_as_agent")),w=(0,M.d4)(N.$T),C=x.trigger?.id,A=k?a4.t("Send additional information to agent"):"Send additional information to agent",T=k?a4.t("Select a message and channel with content you want the agent to reference when generating its response."):"Select a message and channel with content you want the agent to reference when generating its response.",I=(0,r.useMemo)(()=>!!w&&!!e.length&&e.every(e=>(0,e$.qt)(e)&&(0,e$.sg)(e)),[w,e]),F=(0,r.useMemo)(()=>{let e=o;if(!e)if(!d||!C)return;else e=C;let t=(0,e4.rM)(x,e);return(0,a0.jS)(t)},[o,x,C,d]);if(!e.length)return null;let O="padding_left_175 padding_right_175",L=e.find(e=>"dynamic_options"in e),D=e.find(e=>e.type===e6.HN.String&&!("dynamic_options"in e)),P=e.find(e=>e.type===e6.HN.SlackTypesMessageContext),R=e.find(e=>e.type===e6.HN.SlackTypesChannelId),B=e.find(e=>e.type===e6.HN.Boolean),getConfiguredValue=e=>a[e]?.value,formatVariableBeforeInsertWrapper=e=>(t,a)=>{let n=(0,aJ.F)({variable:t,parameterName:e,functionVariables:b});return l?l(n,a):n};return L&&D&&P&&R&&c?r.createElement(aL.$,{noSubmit:!0,noPadding:!0,segment:_},r.createElement("div",{className:O},r.createElement(aK.r,{variables:t,parameter:L,value:getConfiguredValue(L.name),label:(y=L.name,a[y]?.label),values:a,onChange:n,formatVariableBeforeInsert:formatVariableBeforeInsertWrapper(L.name),callbackId:i,functionId:c,workflowId:v,oAuthParameter:f,stepId:o,stepErrorCode:F,isExistingStep:m,serviceTriggerType:p,triggerId:C,isTriggerSegment:d,allowVariables:!1,functionVariables:b,isFunctionFormWrapped:u,onLoadingStateChange:g,hasOnlyKeyValueParameter:I})),r.createElement("div",{className:O},r.createElement(aZ.C,{variables:t||aX.Gs,parameter:D,value:getConfiguredValue(D.name)||"",required:!!D.is_required,onChange:n,formatVariableBeforeInsert:formatVariableBeforeInsertWrapper(D.name),callbackId:i,showInline:s,allowVariables:h&&!d})),r.createElement("hr",null),r.createElement("div",{className:O},r.createElement("h4",{className:"bold "},A),r.createElement(aG.A,{className:a8().hint_text_width},T),r.createElement(aQ.O,{variables:t||aX.Gs,allowVariables:h&&!d,parameter:P,value:getConfiguredValue(P.name)||"",onChange:n,callbackId:i,externalWorkspaceId:E,isFunctionFormWrapped:u}),r.createElement(aQ.O,{variables:t||aX.Gs,allowVariables:h&&!d,parameter:R,value:getConfiguredValue(R.name)||"",onChange:n,callbackId:i,externalWorkspaceId:E,isFunctionFormWrapped:u})),B&&S&&r.createElement("div",{className:O},r.createElement(aY.B,{variables:t||aX.Gs,allowVariables:h&&!d,formatVariableBeforeInsert:formatVariableBeforeInsertWrapper(B.name),parameter:B,value:getConfiguredValue(B.name)||"",onChange:n,isParameterSyncedWithForm:u}))):null};AskAgentforceStep.displayName="AskAgentforceStep";var a5=a(0x1525f79d3),a6=a(0xbdb24cfa),a3=a(0x18de2ae18),a7=a(0x162b2271e);function useWorkflowExternalWorkspaceId(){let e=(0,e2.j)();return(0,M.d4)(t=>(0,a1.X)(t,e))}function ConnectedUpdateCanvasVariablesTreatment({value:e,parameter:t,variables:a,configuredParameters:n,required:r,onChange:l,isReference:i,viewOnly:s,callbackId:o,otherParameterValues:c,dynamicParameter:d}){let u=useWorkflowExternalWorkspaceId();return(0,a7.T)({value:e,parameter:t,variables:a,configuredParameters:n,required:r,onChange:l,isReference:i,viewOnly:s,callbackId:o,otherParameterValues:c,dynamicParameter:d,workflowExternalWorkspaceId:u})}function ConnectedCreateCanvasTreatment({value:e,parameter:t,variables:a,configuredParameters:n,required:r,onChange:l,isReference:i,viewOnly:s,callbackId:o,otherParameterValues:c}){let d=useWorkflowExternalWorkspaceId();return(0,a5.T)({value:e,parameter:t,variables:a,configuredParameters:n,required:r,onChange:l,isReference:i,viewOnly:s,callbackId:o,otherParameterValues:c,workflowExternalWorkspaceId:d})}function ConnectedUpdateCanvasTreatment({value:e,parameter:t,variables:a,configuredParameters:n,required:r,onChange:l,isReference:i,viewOnly:s,callbackId:o,otherParameterValues:c,dynamicParameter:d}){let u=useWorkflowExternalWorkspaceId();return(0,a6.W)({value:e,parameter:t,variables:a,configuredParameters:n,required:r,onChange:l,isReference:i,viewOnly:s,callbackId:o,otherParameterValues:c,dynamicParameter:d,workflowExternalWorkspaceId:u})}function ConnectedUpdateCanvasTreatmentV2({value:e,parameter:t,variables:a,configuredParameters:n,required:r,onChange:l,isReference:i,viewOnly:s,callbackId:o,otherParameterValues:c,dynamicParameter:d}){let u=useWorkflowExternalWorkspaceId();return(0,a3.G)({value:e,parameter:t,variables:a,configuredParameters:n,required:r,onChange:l,isReference:i,viewOnly:s,callbackId:o,otherParameterValues:c,dynamicParameter:d,workflowExternalWorkspaceId:u})}var a9=a(0x55098bc0),ne=a(0x223beeef),nt=a(0x1d3dd4cbe),na=a(0xbbd2a32d),nn=a(0x1d1437423);let nr=new c.Ay("workflow_builder"),SlackFunctionDelayInputWithFormTextInput=({value:e,parameter:t,onChange:a})=>{let{title:n,maximum:l,minimum:i}=t,{viewOnly:s}=(0,nt.e)(),o=(0,E.A)(),c=Number(e),d=(0,r.useMemo)(()=>[{label:nr.t("Minutes"),value:"minutes",minutesMultiplier:1},{label:nr.t("Hours"),value:"hours",minutesMultiplier:60},{label:nr.t("Days"),value:"days",minutesMultiplier:1440}],[]),[u,m]=(0,r.useState)((0,a9.A)(d,e=>c%e.minutesMultiplier==0)||d[0]),[p,b]=(0,r.useState)(+String(c/u.minutesMultiplier)>0?String(c/u.minutesMultiplier):"1"),f=(0,r.useCallback)(e=>{let t=Number(e),a=(0,na.zh)(t)&&""!==e,n=t*u.minutesMultiplier,r=n>na.Ig||void 0!==l&&n>l,s=n<na.kj||void 0!==i&&n<i||n<1;return{isHermesVariable:(0,e0.cn)(String(e)),isValidNumberValue:a,isValueTooLarge:r,isValueTooSmall:s}},[l,i,u.minutesMultiplier]),g=(0,r.useCallback)(e=>{let{isHermesVariable:t,isValidNumberValue:a,isValueTooLarge:n,isValueTooSmall:r}=f(e);return t||a&&!n&&!r},[f]),h=(0,r.useMemo)(()=>g(p),[p,g]),_=(0,r.useMemo)(()=>{let{isHermesVariable:e,isValidNumberValue:t,isValueTooLarge:a,isValueTooSmall:n}=f(p);if(e)return null;if(!t)return nr.t("Delay must be a valid number.");if(a){let e=Number((l??na.Ig)/u.minutesMultiplier).toLocaleString();switch(u.value){case"hours":return nr.t("Delay must be shorter than 7 days (that\u2019s {maxUpperBoundString} hours).",{maxUpperBoundString:e});case"minutes":return nr.t("Delay must be shorter than 7 days (that\u2019s {maxUpperBoundString} minutes).",{maxUpperBoundString:e});default:return nr.t("Delay must be shorter than 7 days.")}}return n?nr.t("Delay must be at least 1 minute."):null},[f,p,l,u.minutesMultiplier,u.value]);(0,r.useEffect)(()=>{e||(a(t,"1"),m(d[0]))},[a,e,t,d]);let{onChange:y}=(0,nn.x)({errorMessage:"",isErrored:!h,shouldErrorPreventSave:!0}),x=(0,r.useCallback)(e=>{b(e),g(e)&&+e>0&&a(t,String(Number(e)*u.minutesMultiplier)),y()},[g,a,t,u.minutesMultiplier,y]),v=(0,r.useCallback)(e=>{let n=d.find(t=>t.value===e.value);n&&(m(n),a(t,String(Number(p)*n.minutesMultiplier)),y())},[d,p,y,a,t]);return r.createElement(ne.z,{elementId:o,parameter:t},r.createElement("div",{className:"display_flex justify_content_between"},r.createElement(tt.A,{name:"composer-link-modal-text",id:"delayValue","data-qa":"delayValue-input",onChange:x,size:"medium",width:120,value:p,"aria-label":`${n} value`,isRequired:!0,isDisabled:s,isInvalid:!h}),r.createElement(ef.Ay,{className:"flex_one margin_left_50",selectDataQa:"delayScale",selectId:`${o}-scale`,selectedOption:u,onOptionSelected:v,options:d,width:"100%",ariaLabel:`${n} scale`,isRequired:!0,isDisabled:s,isInvalid:!h})),_&&r.createElement(tB.A,{id:`${o}-form-text-input-delay-error-text`,className:"margin_bottom_100","data-qa":"form-text-input-delay-error-text"},_))};SlackFunctionDelayInputWithFormTextInput.displayName="SlackFunctionDelayInputWithFormTextInput";let DelayTreatment=({parameter:e,...t})=>{switch(e.type){case e6.TE.Integer:case e6.TE.Number:if("minutes_to_delay"===e.name)return r.createElement(SlackFunctionDelayInputWithFormTextInput,{parameter:e,...t});return null;default:return null}};DelayTreatment.displayName="DelayTreatment";var nl=a(0x6258badf),ni=a(0xd2bf4d47),ns=a(0x1d57b7d4c),no=a(0x1fd3f6e20),nc=a(0x12cef2078),nd=a(0x1817ab90d),nu=a(0x154dd8295),nm=a(0x205de9db),np=a(0x21c71bcdd),nb=a(0x1991a9b6d),nf=a(0x66c6b26d),ng=a(0x20adb28cd),nh=a(0xefdd8b60),n_=a.n(nh);let ny=new c.Ay("workflow_builder"),ButtonsListItem=({button:e,buttonIndex:t,buttonsLength:a,onDelete:n,switchPane:l,formatVariableBeforeInsert:i,onChange:o,experimentWfbBackToBasicsEclairReleaseGroupOn:c,onMoveUp:d,onMoveDown:u})=>{let m=(0,aD.Y)(),b=(0,M.d4)((0,nf.sx)(m,ng.Pb)),[f,g]=(0,r.useState)(!1),[h,_]=(0,r.useState)(!1),y=(0,r.useCallback)(()=>{g(!0)},[]),x=(0,r.useCallback)(()=>{_(!0)},[]),v=(0,r.useCallback)(()=>{_(!1)},[]),E=(0,r.useCallback)(()=>{_(!1),g(!1)},[]),k=(0,r.useCallback)(()=>{E(),l&&l(tg.k.INTERACTIVE_BLOCKS_ADD_EDIT,{buttonIndex:t,operation:"edit",formatVariableBeforeInsert:i,onChange:o})},[l,t,i,o,E]),S=(0,r.useCallback)(()=>{n(t)},[n,t]),w=(0,r.useCallback)(()=>{E(),d(e,t)},[e,t,E,d]),C=(0,r.useCallback)(()=>{E(),u(e,t)},[e,t,E,u]),A=(0,r.useCallback)(e=>r.createElement(j.Ay,{...e,onUnmount:E},0!==t&&r.createElement(j.Dr,{"data-qa":"more_actions_move_up_menu_item",label:ny.t("Move above"),onSelected:w}),t!==a-1&&r.createElement(j.Dr,{"data-qa":"more_actions_move_down_menu_item",label:ny.t("Move below"),onSelected:C}),a>1&&r.createElement(j.bX,null),r.createElement(j.Dr,{"data-qa":"more_actions_delete_menu_item",label:ny.t("Delete"),onSelected:S,danger:!0})),[t,a,E,S,w,C]),T=(0,r.useMemo)(()=>b.reduce((e,t)=>{if(!(0,nu.Zv)(t)||!(0,nm.zc)(t.expression?.root?.statement?.target??""))return e;let a=t?.expression?.root?.statement?.target?.split(".")?.pop()?.replace("}}","");return a&&(e[a]=t.id),e},{}),[b]),I=(0,r.useMemo)(()=>{let t=c?n_().actionsMenuItem:"",a={tooltip:ny.t("Edit"),onClick:k,ariaLabel:ny.t("Edit {buttonName} button",{buttonName:e.text.text}),className:t};return c?(0,nd.j1)({edit:a,moreActions:{tooltip:ny.t("More actions"),ariaLabel:c?ny.t("More actions for {buttonName} button",{buttonName:e.text.text}):ny.t("More actions"),className:t,menuProps:{renderMenu:A,closeOnSelect:!0,children:null}}}):(0,nd.j1)({edit:a,remove:{tooltip:ny.t("Delete"),onClick:S,ariaLabel:ny.t("Delete {buttonName} button",{buttonName:e.text.text})}})},[e.text.text,S,k,c,A]),N=(0,r.useMemo)(()=>{if("url"in e)return r.createElement("div",{className:n_().buttonBehavior},r.createElement("div",{className:"margin_right_25"},r.createElement(p.Ah,{name:"new-window"})),ny.t("Open link"));if("workflow_button"===e.type)return r.createElement("div",{className:n_().buttonBehavior,"aria-hidden":!0},r.createElement("div",{className:"margin_right_25"},r.createElement(p.Ah,{name:"play"})),ny.t("Run workflow"));if(e.action_id&&e.action_id in T){let t=T[e.action_id],a=b.find(e=>e.id===t),n=a?.name;return r.createElement("div",{className:n_().buttonBehavior,"aria-hidden":!0},r.createElement("div",{className:"margin_right_25"},r.createElement(p.Ah,{name:"branch"})),ny.rt('Proceeds to branch "{buttonName}"',{buttonName:n??e.text.text,fallbackHash:"24520bc1d4c7aac5c8d790e9f9c06fc89e11c45b"}))}return r.createElement("div",{className:n_().buttonBehavior,"aria-hidden":!0},r.createElement("div",{className:"margin_right_25"},r.createElement(p.Ah,{name:"play"})),ny.t("Proceed to next step"))},[e,T,b]);return r.createElement("div",{className:s()(n_().buttonsListItem,{[n_().buttonsListItemActive]:c&&f})},r.createElement("div",{className:n_().previewContainer,onFocus:y,onBlur:E,onMouseEnter:x,onMouseLeave:v},r.createElement(nc.X,{noPointerEvents:!0,isInert:!0},r.createElement("div",{className:n_().buttonPreviewWrapper},r.createElement(nb.A,{inline:!0,msg:(0,nd.$_)(e)}),r.createElement("span",null,N))),r.createElement("div",{className:n_().actionButtonsWrapper},r.createElement(np.A,{className:s()({[n_().actionsMenu]:c}),items:I,isFocused:f,showOnlyOnHover:!h}))))};ButtonsListItem.displayName="ButtonsListItem";var nx=a(0x189a28b3e),nv=a(0x15daa558a),nE=a(0x740142bc),nk=a.n(nE);let nS=new c.Ay("workflow_builder"),MutuallyExclusiveButtonConfig=({updateInteractivityConfiguration:e,interactivityConfiguration:t,segment:a})=>{let n=(0,e5.RE)(a,nv.z.INTERACTIVE_BLOCKS)?.value??[],l=(n[0]?.elements??[]).reduce((e,t)=>((0,nd.O0)(t)&&t?.action_id&&e.push(t.action_id),e),[]),i=l.length>1,s=t?.actions&&l.some(e=>t.actions[e]?.is_mutually_exclusive),o=(0,r.useCallback)(()=>{let a=Object.keys(t.actions).reduce((e,a)=>(e[a]=t.actions[a],l.includes(a)&&(e[a].is_mutually_exclusive=!s,s||(e[a].is_button_multi_click=!1)),e),{});e({...t,actions:a})},[t,e,l,s]);if(!i)return null;let c=nS.t("Mutually Exclusive"),d=r.createElement("span",{"aria-hidden":!0},nS.t("Continue buttons are single click, and when one is clicked, all continue buttons disappear")),u=r.createElement("span",{className:"offscreen",id:"button_mutual-description"},nS.t("Continue buttons are single click, and when one is clicked, all continue buttons disappear"));return r.createElement("div",{className:"margin_top_50 margin_bottom_100"},r.createElement("hr",null),r.createElement(y.A,{htmlFor:"button_click_type_label",className:nk().switch_container,type:"inline",text:c,subtext:d},u,r.createElement(nx.A,{isToggled:s,onChange:o,ariaLabel:c,ariaDescribedBy:"button_mutual-description"})))};MutuallyExclusiveButtonConfig.displayName="MutuallyExclusiveButtonConfig";var nw=a(0x2339a0d72),nC=a(0x173b0d383),nA=a.n(nC);let nT=new c.Ay("workflow_builder"),InteractiveBlocksButtons=({onChange:e,parameter:t,value:a=[],switchPane:n,formatVariableBeforeInsert:l,segment:i,callbackId:o})=>{let c=(0,M.d4)(N.tQ),d=a.find(e=>"actions"===e.type),u=(0,r.useMemo)(()=>d?.elements||[],[d?.elements]),m=(0,r.useMemo)(()=>(0,e5.RE)(i,nv.z.INTERACTIVITY_CONFIGURATION)?.value||{},[i]),b=(0,e5.iL)(i,nv.z.INTERACTIVITY_CONFIGURATION),f=Object.values(m?.actions??{}).some(e=>e?.is_mutually_exclusive),g=(0,r.useCallback)(t=>{b&&e(b,(0,nd.A6)(t.action_id,o,m,f))},[b,e,o,f,m]),_=(0,r.useCallback)(t=>{b&&e(b,(0,af.A)(t.actions)?{}:t)},[e,b]),y=(0,r.useCallback)(a=>{e(t,a.length?[(0,nw.AR)(a)]:[])},[e,t]),x=(0,r.useCallback)((e,t)=>{y(e),_(t)},[y,_]),v=(0,r.useCallback)(e=>{let t=u.filter((t,a)=>a!==e),a={actions:(0,nl.A)(m.actions,u[e].action_id)},n=t.filter(nd.O0);1===n.length&&n[0]?.action_id&&a?.actions?.[n[0].action_id]?.is_mutually_exclusive&&delete a.actions[n[0].action_id].is_mutually_exclusive,y(t),_(a)},[u,m.actions,y,_]),E=(0,r.useCallback)((e,t,a)=>{let n=[...u];n.splice(t,1),n.splice(a,0,e),y(n)},[u,y]),k=(0,r.useCallback)((e,t)=>{e&&E(e,t,t-1)},[E]),S=(0,r.useCallback)((e,t)=>{e&&E(e,t,t+1)},[E]),w=(0,r.useCallback)(()=>{let a=u.length?u[u.length-1]:void 0,r=(0,nd.AI)(u)?"":nT.t("Continue"),i="primary";switch(a&&a.style){case"primary":i="danger";break;case"danger":i=void 0}let s=(0,nw.OK)(!1,r,i);e(t,[(0,nw.AR)([...u,s])]),g(s),n&&n(tg.k.INTERACTIVE_BLOCKS_ADD_EDIT,{buttonIndex:u.length,formatVariableBeforeInsert:l,onChange:x})},[e,t,n,u,l,x,g]),C=(0,r.useCallback)(e=>{let{source:t,destination:a,draggableId:n}=e;if(!a||t.droppableId===a.droppableId&&t.index===a.index)return;let r=u.find(e=>e.action_id===n);if(!r)return;let l=[...u];l.splice(t.index,1),l.splice(a.index,0,r),y(l)},[u,y]),A=(0,r.useCallback)((e,t,a)=>r.createElement(ButtonsListItem,{button:e,buttonIndex:t,buttonsLength:u.length,experimentWfbBackToBasicsEclairReleaseGroupOn:c,formatVariableBeforeInsert:l,key:a,onChange:x,onDelete:v,onMoveUp:k,onMoveDown:S,switchPane:n}),[u,c,l,x,v,k,S,n]),T=(0,r.useCallback)((e,t,a)=>{let n=a.source.index;return r.createElement("div",{...e.draggableProps,...e.dragHandleProps,className:nA().dragClone,ref:e.innerRef},A(u[n],n,a.draggableId))},[u,A]),I=c&&u.length>1,F=(0,r.useMemo)(()=>u.map((e,t)=>{let a=e.action_id||`${e.type}_${t}_${e.text}`,n=A(e,t,a);return I?r.createElement(ed.lO,{draggableId:a,index:t,key:a},e=>r.createElement("div",{...e.draggableProps,...e.dragHandleProps,className:nA().dragHandle,"data-qa":a,ref:e.innerRef},r.createElement("div",{className:nA().dragIcon},r.createElement(p.Ah,{inline:!0,name:"reorder"})),n)):n}),[u,A,I]),O=nT.rt("Interactive buttons {newBadge}",{newBadge:r.createElement(no.v,{style:no.u.Informative,isMicro:!0},nT.t("New",{fallbackHash:"66aabd91fc41cc4635aad94dc77d93a0e2eac67b"})),fallbackHash:"503d46db37b0db45db898aabed77244252918ca2"}),L=nT.t("Create dynamic workflows. Buttons let users continue the flow, branch to specific steps, or open links.",{fallbackHash:"12794b7e85dcea25a5fc307ba269768891424cb6"});return r.createElement(ni.A,{className:nA().buttonConfigWrap},r.createElement(ns.A,{className:"margin_bottom_100"},r.createElement(aF.nB,{weight:"bold",element:"h2"},O),r.createElement("span",{className:"normal"},L)),I&&r.createElement(ed.MR,{onDragEnd:C},r.createElement(ed.zv,{droppableId:"buttons-list",renderClone:T},e=>r.createElement("ul",{className:nA().buttonsList},r.createElement("div",{ref:e.innerRef,...e.droppableProps},F,e.placeholder)))),!I&&u.length>0&&r.createElement("ul",{className:s()(nA().buttonsList,{[nA().onlyChildButton]:c})},F),r.createElement(h.Ay,{"data-qa":"add-button",onClick:w,className:nA().addInteractiveButton,disabled:5===u.length,size:"small",type:"outline"},nT.t("Add Interactive Button",{fallbackHash:"3d7db431b9155e6d75c4fbbcd640b667f2a8c9ea"})),r.createElement(MutuallyExclusiveButtonConfig,{updateInteractivityConfiguration:_,interactivityConfiguration:m,segment:i}))};InteractiveBlocksButtons.displayName="InteractiveBlocksButtons";let InteractiveBlocksTreatment=({value:e,parameter:t,variables:a,required:n,onChange:l,formatVariableBeforeInsert:i,isReference:s,viewOnly:o,callbackId:c,switchPane:d,segment:u})=>r.createElement(InteractiveBlocksButtons,{value:e,parameter:t,variables:a,required:n,onChange:l,formatVariableBeforeInsert:i,isReference:s,viewOnly:o,callbackId:c,switchPane:d,segment:u});InteractiveBlocksTreatment.displayName="InteractiveBlocksTreatment";let InteractiveBlocksTreatmentWrapper=({value:e,parameter:t,variables:a,required:n,onChange:l,formatVariableBeforeInsert:i,isReference:s,viewOnly:o,callbackId:c,switchPane:d,segment:u})=>t.type!==e6.TE.SlackTypesBlocks?null:t.name===nv.z.INTERACTIVE_BLOCKS?r.createElement(InteractiveBlocksTreatment,{value:e,parameter:t,variables:a,required:n,onChange:l,formatVariableBeforeInsert:i,isReference:s,viewOnly:o,callbackId:c,switchPane:d,segment:u}):null;InteractiveBlocksTreatmentWrapper.displayName="InteractiveBlocksTreatmentWrapper";var nI=a(0x1340d624e),nN=a(0x98b4cc3b),nM=a(0x1535cb779),nF=a.n(nM);let nO=new c.Ay("workflow_builder"),ButtonColorOptionLabel=({label:e,buttonStyle:t})=>r.createElement("span",{className:nF().optionLabel},r.createElement("span",{"aria-hidden":!0,className:s()(nF().optionLabelColor,nF()[`optionLabelColor__${t}`])}),e);ButtonColorOptionLabel.displayName="ButtonColorOptionLabel";let ButtonColor=({buttonStyle:e,handleChange:t})=>{let a=(0,r.useMemo)(()=>[{label:r.createElement(ButtonColorOptionLabel,{label:nO.t("Outline"),buttonStyle:"outline"}),value:"outline"},{label:r.createElement(ButtonColorOptionLabel,{label:nO.t("Lilypad green"),buttonStyle:"primary"}),value:"primary"},{label:r.createElement(ButtonColorOptionLabel,{label:nO.t("Raspberry red"),buttonStyle:"danger"}),value:"danger"}],[]),n=(0,r.useMemo)(()=>a.find(t=>t.value===(e??"outline")),[e,a]),l=(0,r.useCallback)(({value:e})=>{t("outline"===e?void 0:e)},[t]);return r.createElement(y.A,{"data-qa":"send-message-button-color",htmlFor:"send-message-button-color",text:nO.t("Color",{fallbackHash:"1d0c8304baedcf8e3a78982c2e7c0b04622bf2a0",fallbackHashNs:"lists"}),className:"margin_bottom_125"},r.createElement(ef.Ay,{options:a,width:"100",onOptionSelected:l,selectedOption:n}))};ButtonColor.displayName="ButtonColor";var nL=a(0x242c34757),nD=a(0x162b19a86),nP=a(0x1c244e721),nR=a(0x238b287cf),nB=a(0xa5d8361b);let nW=new c.Ay("workflow_builder"),LinkButtonConfiguration=({button:e,handleChange:t,formatVariableBeforeInsert:a,variables:n})=>{let l=(0,nR.A)(),i=(0,aD.Y)(),s=(0,r.useCallback)(({text:e})=>{t({url:(0,nD.cY)(e)})},[t]),{onBlur:o,errorText:c}=(0,I.K)({errorMessage:nW.t("Please enter a valid URL"),isErrored:!(0,nB.A)(e.url)&&!(0,e0.cn)(e?.url??"")}),d=(0,r.useCallback)(()=>{(0,nP.W)(l,{wbArgs:{workflow_id:i,is_hermes:!0}})},[l,i]);return r.createElement("div",{className:"margin_top_75"},r.createElement(nL.A,{id:"link-button-url_label",initialText:e.url??"",variables:n,allowVariables:!0,ariaLabel:nW.t("Enter a URL"),placeholder:nW.t("http://www.example.com"),shouldAddNewLineOnEnter:!1,onTextChange:s,formatVariableBeforeInsert:a,errorText:c,onBlur:o,onVariableMenuOpen:d,renderDataMenuLocation:"inline"}))};LinkButtonConfiguration.displayName="LinkButtonConfiguration";var nV=a(0x162afc153);let nq=(0,a(0x870b34a7).W)("validate input parameters with async calls");var nH=a(0x197981788),nU=a(0x143698f47),nz=a.n(nU);let nj=new c.Ay("workflow_builder"),CustomizableInputs=({trigger:e,variables:t,handleChange:a,formatVariableBeforeInsert:n,button:l})=>{let i=(0,C.rC)(),s=e.inputs,o=(0,r.useMemo)(()=>l.workflow.trigger.customizable_input_parameters??[],[l.workflow.trigger.customizable_input_parameters]),c=e.workflow.input_parameters.filter(t=>(0,nH.p5)(e?.available_data,t.name)).map(e=>({...e,is_required:!1})),d=(0,r.useMemo)(()=>(0,eQ.K)(c),[c]),m=(0,r.useMemo)(()=>c&&0!==c.length&&0!==o.length?c.reduce((e,t)=>{e[t.name]=s[t.name];let a=o.find(e=>e.name===t.name);return a&&(e[t.name].value=a.value),e},{}):{},[c,o,s]),p=(0,r.useMemo)(()=>!o.every(e=>m[e.name]),[o,m]),b=(0,r.useCallback)((e,t)=>{let n=[...o.filter(t=>t.name!==e.name)];t&&n.push({name:e.name,value:t}),i((0,t$.qq)({parameter:e,value:t})),a({workflow:{trigger:{...l.workflow.trigger,customizable_input_parameters:n}}})},[a,i,o,l.workflow.trigger]);return p?r.createElement(u.Ay,{level:"error"},nj.t("This workflow button refers to a custom input that no longer exists. Please try re-configuring this button.")):0===Object.keys(c).length?null:r.createElement("div",{className:nz().workflowButtonConfig},r.createElement(ni.A,null,r.createElement(ns.A,{className:nz().inputLegend},nj.t("Custom inputs (optional)",{fallbackHash:"ac018db1f7b00972061adff843d37497d8ee153c"})),r.createElement(aF.nB,null,nj.t("These are defined in the {triggerName} workflow trigger. You can map variables from the parent workflow to these inputs.",{triggerName:e.name})),r.createElement(aj.v,{functionId:e.id,inputParameters:c,formatVariableBeforeInsert:n,variables:t,configuredParameters:m,onChange:b,callbackId:"callbackId",oAuthParameter:d})))};CustomizableInputs.displayName="CustomizableInputs";var n$=a(0x78a9d64e),nG=a(0x239e2ae8e),nK=a(0x98b79679),nY=a(0xe41988fb),nQ=a(0xa9a7442),nZ=a(0x7db59a01);let nJ=new c.Ay("workflow_builder"),nX=(0,nV.A)(e=>e((0,nG.SA)({reason:"search-precache-workflow-button-search-select"})),6e4),WorkflowButtonConfiguration=({button:e,handleChange:t,formatVariableBeforeInsert:a,variables:n})=>{let i=(0,r.useRef)(null),s=(0,l.wA)(),o=(0,C.rC)(),c=(0,e2.j)(),[d,u]=(0,r.useState)(!1),[m,p]=(0,r.useState)(!1),[b,f]=(0,r.useState)(void 0),g=!!("workflow_button"===e.type&&e.workflow?.trigger?.url),h=(0,nZ.F)(e.workflow?.trigger?.url??"");(0,r.useEffect)(()=>{(async()=>{if(h)try{let{trigger:e}=await s((0,nY.B)({triggerId:h,reason:"workflow-builder/send-message/workflow-button"}));f(e)}catch{p(!0)}})()},[h,s]);let _=g&&d&&!b,y=(0,r.useMemo)(()=>{if(h&&e.action_id&&g&&!_)return{value:h,label:e.action_id,extras:b}},[g,h,_,b,e.action_id]),x=(0,r.useMemo)(()=>{let e=[];return m&&e.push({id:"1",message:"An error occured. Please try again later."}),_&&e.push({id:"1",message:nJ.t("Workflow missing. It may have been renamed or deleted.")}),e},[_,m]);(0,r.useEffect)(()=>{o(nq({isValidInteractiveBlockWorkflowButton:!x.length}))},[o,x,h]);let v=(0,r.useCallback)(({label:e,extras:a})=>{let n=(a?.name??e).substring(0,n$.c$);t({type:"workflow_button",action_id:(0,k.A)(),text:{text:n},workflow:{trigger:{url:a?.shortcut_url}}}),f(a)},[t]),E=(0,r.useCallback)(({label:e,extras:t})=>r.createElement(WorkflowButtonOption,{title:t?.name??e,description:t?.description,icon:t?.workflow?.app?.icons.image_32}),[]),S=(0,r.useCallback)(async e=>{try{return await nX(s),(await s((0,nK.v)({query:e,reason:"workflow-builder/send-message-builtin/button-action-run-workflow"}))).triggers.map(e=>({value:e.id,label:e.name,extras:e}))}catch{return p(!0),[]}finally{u(!0)}},[s]),w=(0,r.useCallback)((e,t)=>Promise.resolve(c?e.filter(e=>e.value!==c.trigger?.id):e),[c]);return r.createElement(r.Fragment,null,r.createElement("div",{className:nz().workflowSelect},r.createElement(nQ.m,{selectId:"send-message-button-action-trigger-select",search:S,placeholderText:nJ.t("Select a workflow",{fallbackHash:"16a41552a20953509d63fd3263aa58349b3d382e"}),ariaLabel:nJ.t("Select a workflow to run",{fallbackHash:"16a41552a20953509d63fd3263aa58349b3d382e"}),width:"100",inputRef:i,onOptionSelected:v,processOptions:w,selectedOption:y,renderOption:E,renderSelectedOption:E,isInvalid:x.length>0,errors:x})),y?.extras&&r.createElement(CustomizableInputs,{trigger:y.extras,variables:n,handleChange:t,formatVariableBeforeInsert:a,button:e}))};function WorkflowButtonOption({icon:e,title:t,description:a}){return r.createElement("div",{className:nz().workflowOptionWrapper},e?r.createElement("img",{"data-qa":"workflow-option-image",src:e,alt:""}):r.createElement("span",{className:nz().fallbackImage}),r.createElement("strong",null,t),a&&r.createElement(r.Fragment,null,r.createElement("span",null," \xb7 "),r.createElement("span",{className:nz().workflowOptionDescription},a)))}WorkflowButtonConfiguration.displayName="WorkflowButtonConfiguration",WorkflowButtonOption.displayName="WorkflowButtonOption";let n0=new c.Ay("workflow_builder"),ButtonConfiguration=({button:e,handleChange:t,handleTypeChange:a,formatVariableBeforeInsert:n,variables:l,multipleContinueButtonsExist:i,isNestedStep:s})=>{let o=(0,M.d4)(N.s3),c=(0,r.useMemo)(()=>s?n0.t("Continue workflow"):n0.t("Continue or branch workflow"),[s]),d=(0,r.useMemo)(()=>{let e=[{value:"button",label:c},{value:"workflow_button",label:n0.t("Run another workflow")},{value:"link",label:n0.t("Open link")}];return o||(e=e.filter(e=>"workflow_button"!==e.value)),e},[c,o]),u=(0,r.useMemo)(()=>d.find(t=>e&&"url"in e?"link"===t.value:t.value===e?.type),[d,e]),m=(0,r.useCallback)(({value:e})=>{a(e)},[a]),p=(0,r.useCallback)(()=>e?.type==="workflow_button"?r.createElement(WorkflowButtonConfiguration,{button:e,handleChange:t,variables:l,formatVariableBeforeInsert:n}):e&&"url"in e?r.createElement(LinkButtonConfiguration,{button:e,handleChange:t,variables:l,formatVariableBeforeInsert:n}):null,[t,n,e,l]),b=(0,r.useMemo)(()=>{if(s)return;let e=n0.t("Moves the workflow forward\u2014each button, up to five, can route to a different branch."),t=n0.t("With conditional branching, two or more buttons can be mapped to perform specific steps.");return[{id:"conditional-branching-hint",message:i?t:e}]},[s,i]);return r.createElement(r.Fragment,null,r.createElement(y.A,{"data-qa":"send-message-button-action",htmlFor:"send-message-button-action",text:n0.t("Behavior"),"aria-label":n0.t("Button Behavior")},r.createElement(ef.Ay,{options:d,width:"100",onOptionSelected:m,selectedOption:u,selectId:"send-message-button-action",hints:b})),p())};function createPreviewBlock(e){return{__meta__:{lastUpdatedTs:""},channel:"preview",type:"message",ts:"0",subtype:"",blocks:[{block_id:"workflow-builder-preview-button",elements:["workflow_button"===e.type?{...e,action_id:(0,k.A)(),workflow:{trigger:{url:"https://example.com",customizable_input_parameters:[]}}}:e],type:"actions"}]}}ButtonConfiguration.displayName="ButtonConfiguration";var n1=a(0x1a69ac39f),n2=a.n(n1);let n8=new c.Ay("workflow_builder"),ButtonPreview=({button:e})=>{let t=(0,r.useMemo)(()=>"url"in e?n8.t("Open link",{fallbackHash:"d2de1a2831e7fee28d6c8d214b66da0d1bed30c8",fallbackHashNs:"composer"}):"workflow_button"===e.type?n8.t("Run workflow",{fallbackHash:"b1b392607deaf29a7e81453e069b7c07a32a6b18",fallbackHashNs:"slack_functions"}):n8.t("Continue workflow"),[e]);return r.createElement(nc.X,{noPointerEvents:!0},r.createElement("div",{className:n2().buttonPreviewWrapper,"aria-hidden":!0},r.createElement(nb.A,{inline:!0,msg:createPreviewBlock(e)}),r.createElement("span",{className:n2().buttonBehavior},t)),r.createElement("span",{className:n2().buttonBehaviorScreenReaderView},n8.t("{buttonLabel} \u2014 {buttonBehavior}",{buttonLabel:e.text.text,buttonBehavior:t})))};ButtonPreview.displayName="ButtonPreview";var n4=a(0x1e4549e93),n5=a.n(n4);let n6=new c.Ay("workflow_builder"),ButtonEdit=({button:e,variables:t,provided:a,isExpanded:n,buttonIndex:l,onEdit:i,onDelete:o,onChange:c,onTypeChange:d,formatVariableBeforeInsert:u,canEdit:m=!1,isDragDisabled:b=!1,viewOnly:f=!1,hasDuplicateContinueLabel:g=!1})=>{let h=(0,r.useCallback)(()=>{i(l)},[i,l]),_=(0,r.useCallback)(()=>{i()},[i]),x=(0,r.useCallback)(()=>{o(l),_()},[o,_,l]),v=(0,r.useCallback)(t=>{c({text:{...e.text,text:t}},l)},[c,e,l]),E=(0,r.useCallback)(e=>c(e,l),[c,l]),k=(0,r.useCallback)(e=>d(e,l),[d,l]),S=(0,r.useCallback)(e=>c({style:e},l),[c,l]),w=(0,r.useMemo)(()=>g?n6.t("Please choose a different label, this one already exists."):"",[g]),C=(0,r.useMemo)(()=>{let t=w||e.text.text.length>n$.c$||e.text.text.length<n$.CL,a="url"in e&&!(0,nB.A)(e.url),n="workflow_button"===e.type&&!e.workflow?.trigger?.url;return t||n||a},[e,w]),A=(0,r.useMemo)(()=>r.createElement("div",{className:n5().previewInfo,ref:a.innerRef,...a.draggableProps},r.createElement("div",{...a.dragHandleProps,role:a.dragHandleProps?.role,tabIndex:a.dragHandleProps?.tabIndex,"aria-describedby":a.dragHandleProps?.["aria-describedby"],"aria-label":`Re-order ${e.text.text}`,className:s()({[n5().dragDisabled]:b})},r.createElement(p.Ah,{name:"apps"})),r.createElement(ButtonPreview,{button:e})),[e,b,a.dragHandleProps,a.draggableProps,a.innerRef]);return r.createElement(nN.k,{label:e.text.text,isExpanded:n,onEdit:h,onCollapse:_,onRemove:x,canEdit:m,canCollapse:!C,canRemove:!0,removeButtonAriaLabel:n6.t("Delete {label}",{label:e.text.text,fallbackHash:"9a8d74ce655d76751b0f8ac36ee59c5d8fbfdd79"}),editButtonAriaLabel:n6.t("Edit {label}",{label:e.text.text,fallbackHash:"24d4e0d073df8f371a8b57819503767677a33b04"}),forceNoBorder:!0,previewInfo:A},r.createElement("div",{className:"padding_bottom_100",ref:a.innerRef,...a.draggableProps,...a.dragHandleProps,draggable:!1},r.createElement(y.A,{htmlFor:"message_button_label",text:n6.t("Text")},r.createElement(tt.A,{autoFocus:!0,"data-qa":"send-message-button-text",isRequired:!0,name:"message_button_label",id:"message_button_label",value:e.text.text,placeholder:e.text.text,"aria-label":n6.t("Set the button label"),onChange:v,isDisabled:f,maxCharacterLimit:n$.c$,minCharacterLimit:n$.CL,errorText:w,autoComplete:"off",useInlineAlert:!0})),r.createElement(ButtonColor,{handleChange:S,buttonStyle:e.style}),r.createElement(ButtonConfiguration,{handleChange:E,handleTypeChange:k,button:e,variables:t,formatVariableBeforeInsert:u})))};ButtonEdit.displayName="ButtonEdit";var n3=a(0x614331cf),n7=a.n(n3);let n9=new c.Ay("workflow_builder"),SalesHomeInteractiveBlocksButtons=({onChange:e,formatVariableBeforeInsert:t,parameter:a,viewOnly:n,value:l=[],variables:i})=>{let[s,o]=(0,r.useState)(),c=l.find(e=>"actions"===e.type),d=(0,r.useMemo)(()=>c?.elements||[],[c?.elements]),u=(0,r.useCallback)(e=>{o(e)},[o]),m=(0,r.useCallback)(()=>{e(a,[(0,nw.AR)([...d,(0,nw.OK)(!1,n9.t("Continue")+(d.length||""),"primary")])])},[e,a,d]),p=(0,r.useCallback)(t=>{let n=d.filter((e,a)=>a!==t);n.length?e(a,[(0,nw.AR)(n)]):e(a,[])},[e,a,d]),b=(0,r.useCallback)((t,n)=>{let r={...d[n]};switch(t){case"workflow_button":r.type=t,delete r.style,"value"in r&&delete r.value,"url"in r&&delete r.url;break;case"link":r.type="button",r.url="",delete r.workflow,"value"in r&&delete r.value;break;default:r.type=t,r.style="primary",r.value="button",delete r.workflow,"url"in r&&delete r.url}let l=d.map((e,t)=>n===t?r:e);e(a,[(0,nw.AR)(l)])},[d,e,a]),f=(0,r.useCallback)((t,n)=>{let r=d[n],l={...r,...t,text:{...r.text,...t.text}},i=d.map((e,t)=>n===t?l:e);e(a,[(0,nw.AR)(i)])},[e,a,d]),g=(0,r.useCallback)(t=>{let{source:n,destination:r,draggableId:l}=t;if(!r||n.droppableId===r.droppableId&&n.index===r.index)return;let i=d.find(e=>e.action_id===l);if(!i)return;let s=[...d];s.splice(n.index,1),s.splice(r.index,0,i),e(a,[(0,nw.AR)([...s])])},[d,e,a]),_=(0,r.useMemo)(()=>(0,nw.P6)(d),[d]),y=(0,r.useCallback)((e,t,a)=>{let{draggableId:n}=a,l=d.find(e=>e.action_id===n);return l?r.createElement(ButtonEdit,{button:l,variables:i,provided:e,isExpanded:!1,onEdit:to.A,onDelete:to.A,onChange:to.A,onTypeChange:to.A,buttonIndex:0}):r.createElement("div",null)},[d,i]);return r.createElement(ed.MR,{onDragEnd:g},r.createElement("div",{className:n7().buttonConfigWrap},r.createElement("div",{className:"margin_bottom_100"},r.createElement(aF.nB,{weight:"bold",element:"h2"},n9.t("Buttons")),r.createElement("span",null,n9.t("Use buttons to initiate actions in the steps that follow",{fallbackHash:"a8173d06df5ef07a104854ec462136bff7f446f2"}))),d.length>0&&r.createElement(ed.zv,{droppableId:"button-config-section",renderClone:y},(e,a)=>r.createElement("ul",{...e.droppableProps,ref:e.innerRef,className:n7().buttonListDroppable},d?.map((e,a)=>{let l=s===a,o=!!(void 0===s||s&&s===a);return r.createElement(ed.lO,{key:e.action_id,draggableId:e.action_id||"",index:a,isDragDisabled:!!s},(c,m)=>r.createElement(ButtonEdit,{key:e.action_id,button:e,provided:c,isExpanded:l,canEdit:o,isDragDisabled:!!(s||1===d.length),onEdit:u,onDelete:p,onChange:f,formatVariableBeforeInsert:t,onTypeChange:b,buttonIndex:a,viewOnly:n,variables:i,hasDuplicateContinueLabel:_}))}),e.placeholder)),r.createElement(h.Ay,{"data-qa":"add-button",onClick:m,className:n7().addButton,disabled:5===d.length,size:"small",type:"outline"},n9.t("Add Button"))))};SalesHomeInteractiveBlocksButtons.displayName="SalesHomeInteractiveBlocksButtons";let SalesHomeInteractiveBlocksTreatment=({value:e,parameter:t,variables:a,required:n,onChange:l,formatVariableBeforeInsert:i,isReference:s,viewOnly:o,callbackId:c})=>t.type===e6.TE.SlackTypesBlocks&&t.name===nv.z.INTERACTIVE_BLOCKS?r.createElement(SalesHomeInteractiveBlocksButtons,{value:e,parameter:t,variables:a,required:n,onChange:l,formatVariableBeforeInsert:i,isReference:s,viewOnly:o,callbackId:c}):null;SalesHomeInteractiveBlocksTreatment.displayName="SalesHomeInteractiveBlocksTreatment";var re=a(0x72b537b5),rt=a(0x2172ff7ff),ra=a(0x143f89715),rn=a(0xc3116e8),rr=a(0x2a61c7f6),rl=a.n(rr);let ri=new c.Ay("workflow_builder"),SlackFunctionSalesforceColumnInput=({onChange:e,value:t,label:a,parameter:n,variables:l,showInline:i})=>{let o=(0,E.A)(),c=(0,re.U)(),d=(0,r.useCallback)(t=>{e(n,t.value,a)},[e,n,a]),u=(0,r.useMemo)(()=>({value:0,label:ri.t("Missing Data"),isError:!0}),[]),m=(0,r.useMemo)(()=>{let e=(l?(0,rn.Km)(l):[]).map(e=>({label:e.label,value:e.id})).sort((e,t)=>(0,rt.Ay)(e.label,t.label)),a=e.filter(e=>!t||t!==e?.value),n=e.filter(e=>!!t&&t===e?.value),r=t&&0===n.length?[u]:n;return(0,af.A)(r)?[...a]:[...r,{type:"divider",value:1/0,label:"-"},...a]},[t,u,l]),p=(0,r.useMemo)(()=>{let e=m.find(e=>e.value===t);return t&&!e?u:e},[m,u,t]),b=(0,r.useMemo)(()=>m.map(({value:e})=>e).join("_"),[m]),f=ri.t("This variable is missing."),g=(0,r.useMemo)(()=>{let e=[];return t&&p?.value===u.value&&e.push({id:"variable_missing",message:f}),e},[t,p,u,f]),h=(0,ra.A)(g,c),{onBlur:_,okayToDisplay:y}=(0,I.K)({errorMessage:"",isErrored:h,shouldErrorPreventSave:!0,shouldErrorShowImmediately:h}),x=(0,r.useCallback)(e=>r.createElement("span",{className:s()({[rl().hasErrors]:p&&p.value===u.value})},e.label),[p,u]);return r.createElement(ne.z,{elementId:o,parameter:n,className:"c-label--has_footer",inline:i},r.createElement("div",null,r.createElement(S.Ay,{key:b,isLoading:!1,selectId:"SchemaField",options:m,placeholderText:ri.t("Select field\u2026"),ariaLabel:ri.t("Field"),width:"100%",onOptionSelected:d,selectedOption:p,renderSelectedOption:x,isInvalid:y&&h,onBlur:_,errors:g,showDropdownIcon:!0})))};SlackFunctionSalesforceColumnInput.displayName="SlackFunctionSalesforceColumnInput";let SlackFunctionSalesforceRecipientInput=({value:e,variables:t,onChange:a,parameter:n,label:l})=>{let i=(0,r.useCallback)((e,t)=>{a(n,t??null,l)},[a,n,l]),s=(0,r.useMemo)(()=>(0,rn.Ji)(t,e=>({...e,isHidden:!1})),[t]);return r.createElement(aQ.O,{value:e,variables:s,onChange:i,parameter:n,allowVariables:!0})};SlackFunctionSalesforceRecipientInput.displayName="SlackFunctionSalesforceRecipientInput";var rs=a(0x56e1c8ae),ro=a(0x126af815a);let SendSummaryToSalesHomeTreatment=({variables:e,value:t,parameter:a,onChange:n,callbackId:l,workflowId:i,formatVariableBeforeInsert:s,required:o,isReference:c,viewOnly:d,segment:u})=>{let m=(0,M.d4)((0,nf.sx)(i,ng.RG)),p=(0,e4.eR)(m);if(p?.type!==ro.SJ||(0,rs.Fe)(p.config)||(0,rs.SZ)(p.config))return r.createElement(r.Fragment,null);let b=p.config.notificationHeader,f={...a,description:b};switch(a.type){case e6.TE.SlackTypesUserId:if(a.name===nI.bI.USER_ID)return r.createElement(SlackFunctionSalesforceRecipientInput,{value:t||"",variables:e,parameter:a,onChange:n,callbackId:l});return null;case e6.TE.Integer:if(a.name===nI.bI.NOTIFICATION_DISPLAY_TABLE_EXTRA_COLUMN_FIELD_ID&&(0,rn.Xw)(p))return r.createElement(SlackFunctionSalesforceColumnInput,{onChange:n,value:t,parameter:a,variables:e});return r.createElement(r.Fragment,null);case e6.TE.String:if(a.name===nI.bI.NOTIFICATION_DISPLAY_TABLE_HEADER)return r.createElement("div",{"data-qa":"send-summary-treatment__table-header-input"},r.createElement(aZ.C,{value:(0,al.$)(t)?b:t,parameter:f,variables:e,onChange:n,callbackId:l,required:a.is_required,allowVariables:!1,formatVariableBeforeInsert:s}));return null;case e6.TE.SlackTypesBlocks:if(a.name===nI.bI.INTERACTIVE_BLOCKS)return r.createElement(SalesHomeInteractiveBlocksTreatment,{value:t,parameter:a,variables:e,required:o,onChange:n,formatVariableBeforeInsert:s,isReference:c,viewOnly:d,callbackId:l,segment:u});return null;default:return null}};SendSummaryToSalesHomeTreatment.displayName="SendSummaryToSalesHomeTreatment";var rc=a(0xa224974e),rd=a(0x1d67ca27f);let ru=[],ChildFieldMessage=({value:e,variables:t,onChange:a,formatVariableBeforeInsert:n,parameter:l,configuredParameters:i,label:s,callbackId:o,required:c})=>{let d=(0,r.useCallback)((e,t)=>{a(l,t??null,s)},[a,l,s]),u=(0,r.useMemo)(()=>(0,rd.Wt)(i.user_id,t,!0),[t,i.user_id]),m=(0,r.useMemo)(()=>{let e=`${i.user_id?.value}`.match(rd.g9);return e?`${e[1]}_${e[3]}`:"-1"},[i.user_id]);return r.createElement(rc.h,{key:m,callbackId:o,variables:u,parameter:l,value:e,required:c,onChange:d,formatVariableBeforeInsert:n,parameters:ru,configuredParameters:i,allowVariables:!0})};ChildFieldMessage.displayName="ChildFieldMessage";let ChildRecipientSelection=({value:e,variables:t,onChange:a,parameter:n,label:l})=>{let i=(0,r.useCallback)((e,t)=>{a(n,t??null,l)},[a,n,l]),s=(0,r.useMemo)(()=>(0,rd.r3)(t,e=>({...e,isHidden:!1})),[t]),o=(0,r.useMemo)(()=>(0,rd._V)(s),[s]);return r.createElement(aQ.O,{value:e,variables:o,onChange:i,parameter:n,allowVariables:!0})};ChildRecipientSelection.displayName="ChildRecipientSelection";var rm=a(0x9e671ad),rp=a(0x18a03595d),rb=a(0x1952a5c50),rf=a(0x4a120eb2),rg=a(0x2fd935d8);let rh=new c.Ay("workflow_builder"),RoleSelection=({value:e,parameter:t,required:a,label:n,onChange:i})=>{let s=(0,l.wA)(),o=(0,E.A)(),c=(0,e2.j)(),d=(0,e4.PM)(c),[u,m]=(0,r.useState)([]),{title:p,description:b,hint:f,name:g}=t,h=(0,r.useMemo)(()=>{if(f)return[{id:`${o}-hint-id`,message:f}]},[o,f]),_=(0,r.useMemo)(()=>{let n=[];return(a||t.is_required)&&(0,af.A)(e)&&n.push({id:"ITEMS_REQUIRED",message:rh.t("This field is required.")}),n},[t.is_required,a,e]),{onBlur:y}=(0,I.K)({errorMessage:void 0,isErrored:_.length>0,shouldErrorPreventSave:!0}),x=(0,r.useCallback)(e=>(0,rb.u)(e)?rh.t("No items"):rh.t("Type at least 3 characters to search roles"),[]),v=(0,r.useCallback)(async e=>{if(!(0,rb.u)(e))return[];let{records:t}=await s((0,rg.R)({sobjects:[{sobjectApiName:"UserRole",fields:["Name"]}],asIntegrationUser:!0,query:e,...d&&{salesforceOrgId:d},reason:"workflow_builder_user_role_search"}));return m(t),t},[s,d]),k=(0,r.useCallback)(e=>e?.reduce((e,t)=>(e[t.value]=t.label,e),{}),[]),S=(0,r.useCallback)(e=>{i(t,e.map(e=>e.value),k(e))},[k,i,t]),w=(0,r.useMemo)(()=>(0,af.A)(e)||!Array.isArray(e)?[]:e.reduce((e,t)=>{let a=u.find(e=>(0,rm.A)(e.value,t));return a?e.push({label:a.label,value:a.value}):"string"==typeof t?e.push({label:n?.[t]||"",value:t}):t&&e.push({label:String(t),value:String(t)}),e},[]),[n,u,e]);return r.createElement(ne.z,{elementId:g,parameter:t,isAlwaysRequired:a},r.createElement(rf.x,{ariaLabel:p,hints:h,selectId:o,search:v,placeholderText:b,onSelectedItemsChange:S,width:"100%",debounceWaitPeriod:rp.Vp,selectedOptions:w,className:"margin_bottom_50",errors:_,isInvalid:_.length>0,onBlur:y,selectDataQa:`roleselection-${g}`,onScrollablePage:!0,emptyStateMessage:x,expandOnClick:!0,expandOnFocus:!0}))};RoleSelection.displayName="RoleSelection";var r_=a(0x77727995),ry=a(0xf3dd4cf5),rx=a(0x1e94f3cf);let rv=new c.Ay("workflow_builder");function isFilterCondition(e){return!(!e||"object"!=typeof e||Array.isArray(e))&&"id"in e&&!!e.id}let rE=(0,rx.y)(ry.Q),UserFilters=({value:e,label:t,parameter:a,configuredParameters:n,required:l,onChange:i})=>{let s=(0,E.A)(),o=(0,e2.j)(),[c,d]=(0,r.useState)(void 0),u=(0,r.useMemo)(()=>isFilterCondition(e)?e:{...(0,rs.jz)()},[e]),m=(0,r.useCallback)(e=>{i(a,{...e},t)},[a,t,i]);(0,r.useEffect)(()=>{let e=`${n.user_id?.value??n.user_ids?.value}`.match(/Ft[A-Z0-9]*?__[0-9]+?_[0-9]+?_([0-9]+?)_([0-9]+?_)*?child/),t=(e&&Number.parseInt(e[1],10))??void 0;t&&c!==t&&d(t)},[c,n]);let{hint:p,name:b}=a,f=(0,r.useMemo)(()=>{if(p)return[{id:`${s}-hint-id`,message:p}]},[s,p]),g=(e=>{let t=(0,e4.eR)(e);if(t&&"datasourceId"in t.config)return(0,r_.A)(t,"config.datasourceId")})(o),h=(0,r.useMemo)(()=>({hasValidConditionGroups:!0,hasValidDataSourceObjectId:!(0,af.A)(g),hasValidSchemaObjectId:!!(c&&c>0),isValid:!0}),[g,c]),_=(0,r.useCallback)(()=>{i(a,{...rs.jz})},[i,a]);return r.createElement(r.Fragment,null,r.createElement(ne.z,{elementId:b,parameter:a,isAlwaysRequired:l,noMarginBottom:!0,className:"display_flex align_items_center justify_content_between full_width margin_bottom_25"},r.createElement(tH.A,{onClick:_},rv.t("Clear Filter",{fallbackHash:"719ea396ad92e01b4757ec2b93bb1e5f270f771d"}))),r.createElement(C.cR.Provider,{value:h},r.createElement(rE,{datasourceId:g,schemaObjectId:c,condition:u,conditionIndex:0,onChange:m,isWrapped:!0})),f&&f.map(({id:e,message:t})=>r.createElement(aG.A,{key:e,id:e},t)))};UserFilters.displayName="UserFilters";let SendToSalesHomeTreatment=({parameter:e,configuredParameters:t,value:a,label:n,variables:l,required:i=!!e.is_required,onChange:s,formatVariableBeforeInsert:o,isReference:c,viewOnly:d,callbackId:u,segment:m})=>{switch(e.type){case e6.TE.Array:if(e.name===nI.XD.ROLES)return r.createElement(RoleSelection,{value:a,label:n,parameter:e,required:i,onChange:s});return null;case e6.TE.SlackTypesUserId:if(e.name===nI.XD.USER_ID)return r.createElement(ChildRecipientSelection,{callbackId:u,value:a||"",label:n,parameter:e,onChange:s,variables:l});return null;case e6.TE.SlackTypesBlocks:if(e.name===nI.XD.INTERACTIVE_BLOCKS)return r.createElement(SalesHomeInteractiveBlocksTreatment,{value:a,parameter:e,variables:l,required:i,onChange:s,formatVariableBeforeInsert:o,isReference:c,viewOnly:d,callbackId:u,segment:m});return null;case e6.TE.Object:if(e.name===nI.XD.USER_FILTER)return r.createElement(UserFilters,{value:a,label:n,parameter:e,configuredParameters:t,required:i,onChange:s});return null;case e6.TE.SlackTypesRichText:if(e.name===nI.XD.MESSAGE)return r.createElement(ChildFieldMessage,{callbackId:u,value:a||g.Ml,label:n,parameter:e,configuredParameters:t,onChange:s,formatVariableBeforeInsert:o,variables:l,required:i});return null;default:return null}};SendToSalesHomeTreatment.displayName="SendToSalesHomeTreatment";let SendToSalesforceAppTreatment=({parameter:e,value:t,label:a,variables:n,required:l,onChange:i,formatVariableBeforeInsert:s,isReference:o,viewOnly:c,callbackId:d,workflowId:u,segment:m})=>{let p=(0,M.d4)((0,nf.sx)(u,ng.RG));switch((0,r.useEffect)(()=>{if(e.name===nI.qG.USER_ID&&(0,al.$)(t)&&p&&m.id){let t=(e=>{if(!e?.workflow)return null;let t=(0,e4.gi)(e.workflow).find(e=>(0,tG.Zk)(e)&&e.function?.callback_id===e6.oW.SendToSalesforceApp&&e.inputs.user_id?.value&&"string"==typeof e.inputs.user_id.value&&!(0,al.$)(e.inputs.user_id.value));return t?.inputs.user_id?.value??null})(p);t&&i(e,t,a)}},[e,t,p,m.id,i,a]),e.type){case e6.TE.SlackTypesUserId:if(e.name===nI.qG.USER_ID)return r.createElement(SlackFunctionSalesforceRecipientInput,{value:t||"",variables:n,parameter:e,onChange:i,callbackId:d});return null;case e6.TE.SlackTypesBlocks:if(e.name===nI.qG.INTERACTIVE_BLOCKS)return r.createElement(SalesHomeInteractiveBlocksTreatment,{value:t,parameter:e,variables:n,required:l,onChange:i,formatVariableBeforeInsert:s,isReference:o,viewOnly:c,callbackId:d,segment:m});return null;default:return null}};SendToSalesforceAppTreatment.displayName="SendToSalesforceAppTreatment";var rk=a(0x1c2ea7265),rS=a(0xc5f25803),rw=a(0x12321ecbc);let rC=new c.Ay("workflow_builder"),ChannelSummaryHint=({segment:e})=>{let t=(0,l.wA)(),a=(0,e2.j)(),n=(0,a0.XS)(a,e),i=(0,e5.Dp)(e),s=[e6.oW.ShareCanvas,e6.oW.CreateCanvas,e6.oW.UpdateCanvasContent,e6.oW.UpdateCanvasContentV2,e6.oW.CreateChannelCanvas].some(e=>e===i),o=(0,e8.EM)(e),c=(0,r.useMemo)(()=>(0,rS.a)(a?.workflow),[a]),d=(0,r.useCallback)(e=>t((0,et.f)(e)),[t]),m=(0,e5.Iw)(e),p=m?.message?.value||m?.content?.value||"",b=(0,r.useMemo)(()=>c.map((e,t)=>({...e,stepIndex:t})).filter(e=>e?.function?.callback_id===e6.oW.SummarizeChannel).map(e=>({id:e.id,stepIndex:e.stepIndex,channelIds:e.inputs?.channel_ids?.value||[e.inputs?.channel_id?.value]})),[c]),f=m.user_id?.value,g=m.channel_id?.value;if(!p||(0,t3.A)(p)||n)return null;let h=(0,rk.Q)(p,o.list,d),_=b.filter(e=>h.includes(e.id)),y=_.flatMap(e=>e.channelIds),x=y.filter((e,t)=>y.indexOf(e)===t&&void 0!==e);return _.length>0?r.createElement(u.Ay,{level:u.A_.info,className:"margin_bottom_50"},(()=>{if(!f&&!g&&!s)return x.length>=4?rC.rt("This step shares the AI-generated summary from {stepNumber} previous steps with \u2026",{stepNumber:x.length+1}):rC.rt("This step shares the AI-generated summary from steps {stepNumber} with \u2026",{stepNumber:(0,tq.A)(_.map(e=>(e.stepIndex+1).toString()),{conj:"and",keyPrefix:"stepNumber"})});let e=r.createElement(r.Fragment,null,rC.t("Missing Data"));return(g&&(e=r.createElement(r.Fragment,null,(0,rw.E)([g],o.list))),f&&(e=r.createElement(r.Fragment,null,(0,rw.k)([f],o.list))),s&&(e=r.createElement(r.Fragment,null,rC.t("a canvas"))),x.length>2)?rC.rt("This step shares the AI-generated summary from {channelOne}, {channelTwo} and {channelNumber} more with {entity}.",{entity:e,channelOne:(0,rw.E)([x[0]],o.list),channelTwo:(0,rw.E)([x[1]],o.list),channelNumber:x.length-2}):rC.rt("This step shares the AI-generated summary from {channels} with {entity}.",{entity:e,channels:(0,tq.A)(x.map(e=>(0,rw.E)([e],o.list)),{conj:"and",keyPrefix:"channel"})})})()):null};ChannelSummaryHint.displayName="ChannelSummaryHint";var rA=a(0x15dd8a31),rT=a(0x250295787),rI=a(0xbf22577d),rN=a(0xf6cfcca),rM=a(0x22d3b4662),rF=a(0x1fccea22),rO=a.n(rF);let rL=new c.Ay("workflow_builder"),ConvertBlocksToPlainTextHelper=e=>(0,M.d4)(t=>(0,rM.A)(t,e)),ChannelOptionLabel=({channelId:e,label:t})=>t?r.createElement(r.Fragment,null,r.createElement("span",{className:"margin_right_50"},r.createElement(p.Ah,{name:"css",inline:!0})),r.createElement("span",null,t)):r.createElement(rT.A,{channelId:e,showTeamForLocalChannels:!0});ChannelOptionLabel.displayName="ChannelOptionLabel";let PinMessageFormStep=({segmentVariables:e,configuredParameters:t,inputParameters:a,onChange:n})=>{let{channel_id:l,message:i}=t,s=(0,aD.Y)(),o=l.value,c=i.value,[d,u]=(0,r.useState)(o),[m,p]=(0,r.useState)(c),b=(0,r.useCallback)(({channelId:e,messageLink:t})=>{let r=a.find(e=>"channel_id"===e.name),l=a.find(e=>"message"===e.name);r&&l&&e&&t&&(n(r,e),n(l,t))},[a,n]),f=(0,M.d4)((0,nf.sx)(s,ng.RG)),g=(0,r.useMemo)(()=>{let t={};for(let a of e.list){if(!a||"message_link"!==a.name||"function"!==a.source_type||!f)continue;let e=a.id,n=(0,e4.kn)(f,a.source_id);"send_message"===(0,e5.Dp)(n)&&(t[e]=n)}return t},[e.list,f]),h=(0,r.useMemo)(()=>{let e={};for(let[t,a]of Object.entries(g)){let{channel_id:n}=(0,e5.Iw)(a),r=n.value;e[r]=[...e[r]||[],t]}return e},[g]),_=(0,r.useMemo)(()=>{let t={};for(let a of e.list)a&&a.label&&("channel_id"===a.name||a.type===rN.Z.SlackTypesChannelId)&&(t[a.id]=a.label);return t},[e.list]),x=(0,r.useCallback)(e=>{let t=e.value;if(t===d)return;let a=h[t],n=1===a.length,r=a[0],l=n?r:void 0;u(t),p(l),b({channelId:t,messageLink:l})},[d,b,h]),v=(0,r.useCallback)(e=>{let t=e.value;t!==m&&(p(t),b({channelId:d,messageLink:t}))},[d,m,b]),E=(0,r.useMemo)(()=>d?{label:r.createElement(ChannelOptionLabel,{channelId:d,label:_[d]}),value:d}:void 0,[_,d]),k=(0,r.useMemo)(()=>Object.keys(h).map(e=>({label:r.createElement(ChannelOptionLabel,{channelId:e,label:_[e]}),value:e})),[h,_]),S={};for(let[e,t]of Object.entries(g)){let{message:a}=(0,e5.Iw)(t),n=a.value;S[e]=ConvertBlocksToPlainTextHelper(n)}let w=m?{label:S[m],value:m}:void 0,C=d&&Object.entries(S).length>0?h[d].map(e=>({label:S[e],value:e})):[];return r.createElement("div",{className:rO().pinMessage},r.createElement(y.A,{text:rL.t("Select a channel"),className:"margin_bottom_150"},r.createElement(rA.A,{options:k,ariaLabel:rL.t("Select a channel"),selectId:"channel_select",width:"100%",onOptionSelected:x,selectedOption:E,isRequired:!0})),d&&r.createElement(y.A,{text:rL.t("Select a message",{fallbackHash:"16a41552a20953509d63fd3263aa58349b3d382e"}),className:"margin_bottom_150"},r.createElement(rA.A,{options:C,ariaLabel:rL.t("Select a message",{fallbackHash:"16a41552a20953509d63fd3263aa58349b3d382e"}),selectId:"message_select",width:"100%",onOptionSelected:v,selectedOption:w,key:d,isRequired:!0})),m&&g[m]&&r.createElement("div",{className:rO().previewLabelWrapper},r.createElement(aF.nB,{className:rO().previewLabel,weight:"bold"},rL.t("Preview")),r.createElement("div",{className:rO().preview_message_container},(0,rI.n)(s,g[m],e,{isPinned:!0,isEditor:!0}))))};PinMessageFormStep.displayName="PinMessageFormStep";var rD=a(0xead28e26),rP=a(0xb8ff08bd);let rR=new c.Ay("workflow_builder"),StepPrivateChannelMessageAlert=({workflow:e,segment:t})=>{let a=(0,M.d4)(N.sQ),n=(0,rP.f)({workflow:e,segment:t,isTrigger:!1});if(!a||n!==ad.yF)return null;let l=a?rR.t("Variable not available. The Text of the message variable can\u2019t be used in private channels."):"Variable not available. The Text of the message variable can\u2019t be used in private channels.";return r.createElement(u.Ay,{level:u.A_.error,type:"boxed",className:"margin_bottom_50"},l)};StepPrivateChannelMessageAlert.displayName="StepPrivateChannelMessageAlert";let rB=new c.Ay("workflow_builder"),SlackFunctionSegmentForm=({state:e,afterStepId:t,isExistingStep:a,switchPane:n,isOAuthTokenInvalid:l,activePane:i,noFormPadding:s,allowVariables:o,isFunctionForKnowledgeSource:c})=>{let d=(0,C.rC)(),{segment:m}=e,p=(0,e5.ln)(m),b=(0,e8.EM)(m),f=(0,e5.Dp)(m),g=(0,e2.j)(),h=(0,aD.Y)(),_=(0,e5.am)(m),y=(0,e5.mV)(m),x=(0,e5.P)(m),v=x?.id??(0,e5.g$)(m),E=(0,e5.E)(m),k=(0,e5.h)(m),S=(0,M.d4)(aM.R5),w=(0,M.d4)(N.$T),T=(0,M.d4)(N.dq),I=(0,M.d4)(N.cA),F=(0,r.useMemo)(()=>{let e={};return(0,ty.q2)(m)?x?(0,ty.Jl)(m,x,w):e:(p&&0!==p.length&&p.forEach(t=>{let a=(0,e5.RE)(m,t.name);a&&(e[t.name]=a)}),e)},[w,p,m,x]);useFunctionDynamicInputs({workflowId:h,callbackId:f,segmentId:m.id,slackFunction:x,isOpenFormSegment:(0,ty.q2)(m),configuredParameters:F,dynamicInputs:E,isExistingStep:a});let O=(0,r.useCallback)(e=>{let t=[],fillRequiredContextRecursively=(e,a,n=0)=>{n>=a||(e&&"object"==typeof e?Object.values(e):[e]).forEach(e=>{if("string"==typeof e&&(0,e0.cn)(e)){let a=(0,eX.x)(b.list,e);if(!a)return;"trigger"===a.source&&a.sourceReference&&t.push(a.sourceReference)}null!==e&&"object"==typeof e&&fillRequiredContextRecursively(e,a,n+1)})};fillRequiredContextRecursively(e,10),d((0,A.aI)({value:t}))},[d,b.list]),L=(0,r.useCallback)((e,t,a,n)=>{O(t),n?.dynamicInputState&&d((0,t$.T)({[e.name]:n.dynamicInputState})),d((0,t$.qq)({parameter:e,value:t,label:a,options:n,experimentThirdPartyUserFormParityGroupOn:w}))},[d,w,O]),D=(0,r.useCallback)(e=>{d((0,t$.m0)({isDataFetching:e}))},[d]),P=(0,r.useMemo)(()=>p?(0,eQ.K)(p):void 0,[p]),{renderOAuth2InputParameter:R}=(0,aO.v)({stepId:m.id,appId:(0,e5.Zy)(m),functionId:v,inputParameters:p,configuredInputs:(0,e5.Iw)(m),workflowId:h,onChange:L,isFunctionFormWrapped:y,isOAuthTokenInvalid:l,isFunctionForKnowledgeSource:c}),{isParentModal:B,isChildModal:W}=useSegmentPaneNavigation({segment:m,switchPane:n,activePane:i}),V=(0,r.useMemo)(()=>p?.map(e=>(0,eU.w)(e))?.filter(e=>{let t=(0,tX.oO)(e);return B&&!(0,e$.sg)(e)?t:W?!t:"thread_ts"!==e.name})||[],[p,B,W]),q=(0,r.useCallback)((e,t)=>{let{source:a,sourceReference:n}=e;return("trigger"===a&&n&&d((0,A.aI)({value:n})),t?.skipMacro)?e:(0,e3.Xq)(e,{fromRichText:t?.isRichText,appId:x?.app_id,parameterType:t?.parameterType,stepId:x?.id,callbackId:x?.callback_id},S)},[x?.app_id,x?.id,x?.callback_id,d,S]);useFunctionVariables({functionId:v,workflowId:h,callbackId:f,segmentId:m.id,functionVariables:_,slackFunctionVariablesSchema:k,isFunctionFormWrapped:y,configuredParameters:F});let H=(0,r.useCallback)((e,t,a)=>{let r=(e=>{switch(e){case e6.oW.ReplyInThread:case e6.oW.SendDm:case e6.oW.SendMessage:case e6.oW.SendToRecordChannel:return InteractiveBlocksTreatmentWrapper;case e6.oW.CreateCanvas:case e6.oW.CreateChannelCanvas:return ConnectedCreateCanvasTreatment;case e6.oW.UpdateCanvasContent:return ConnectedUpdateCanvasTreatment;case e6.oW.UpdateCanvasContentV2:return ConnectedUpdateCanvasTreatmentV2;case e6.oW.UpdateCanvasVariables:return ConnectedUpdateCanvasVariablesTreatment;case e6.oW.Delay:return DelayTreatment;case e6.oW.SendToMySalesHome:case e6.oW.SendToSalesHome:return SendToSalesHomeTreatment;case e6.oW.SendToMySalesforceApp:case e6.oW.SendToSalesforceApp:return SendToSalesforceAppTreatment;case e6.oW.SendSummaryToMySalesHome:case e6.oW.SendSummaryToSalesHome:return SendSummaryToSalesHomeTreatment;default:return to.A}})(f),l=F?.[e.name]?.label;return r({parameter:e,variables:b,configuredParameters:F,onChange:L,formatVariableBeforeInsert:q,callbackId:f,workflowId:h,value:t,otherParameterValues:a,label:l,switchPane:n,segment:m})},[f,h,b,F,L,q,n,m]),U=x?.category_label,renderStepHint=()=>{if(W&&y)return r.createElement(aF.Pd,{weight:"bold",className:"margin_bottom_125"},rB.t("Additional fields"),r.createElement(aF.nB,{weight:"regular"},rB.t("Add any other fields you want updated in {serviceName}. These fields won\u2019t be in the form.",{serviceName:U})));if(B&&!l)return r.createElement(aF.Pd,{weight:"bold",className:"margin_bottom_125","data-qa":"step-parent-modal-hint"},rB.t("{serviceName} connection",{serviceName:U}),r.createElement(aF.nB,{weight:"regular"},y?rB.t("Choose where we get info from {serviceName} to create form fields.",{serviceName:U}):rB.t("Choose where we get info from {serviceName} to create step fields.",{serviceName:U})));switch(f){case e6.oW.RemoveReaction:return r.createElement(u.Ay,{level:u.A_.info,className:"margin_bottom_50"},rB.t("You can remove reactions only added by this workflow."));case e6.oW.AddUserToUsergroup:case e6.oW.RemoveUserFromUserGroup:return r.createElement(u.Ay,{level:u.A_.info,className:"margin_bottom_50"},rB.t("You might need additional permissions to add people to the user group you select."));case e6.oW.ShareCanvas:case e6.oW.CreateCanvas:case e6.oW.UpdateCanvasContent:case e6.oW.UpdateCanvasContentV2:case e6.oW.CreateChannelCanvas:case e6.oW.SendDm:case e6.oW.SendMessage:return r.createElement(ChannelSummaryHint,{segment:m});case e6.oW.SendEphemeralMessage:return r.createElement(r.Fragment,null,r.createElement(ChannelSummaryHint,{segment:m}),r.createElement(u.Ay,{level:u.A_.default,className:"margin_bottom_150"},r.createElement("span",null,rB.t("This message is only visible to a specific person in the channel. A few notes about \u201Conly visible to you\u201D messages:")),r.createElement("ul",{className:"margin_bottom_0 margin_top_75"},r.createElement("li",null,rB.t("They can\u2019t be sent in DMs")),r.createElement("li",null,rB.t("They can\u2019t post in private channels if their recipient doesn\u2019t have access")),r.createElement("li",null,rB.t("They have a different appearance than a standard message")))));case e6.oW.AddPin:return r.createElement(u.Ay,{level:u.A_.info,className:"margin_bottom_50"},rB.t('To use this step, the workflow must contain a "Send a message to a channel" step.'));case e6.oW.FindRecordChannel:case e6.oW.CreateRecordChannel:case e6.oW.SendToRecordChannel:return r.createElement(u.Ay,{level:u.A_.info,className:"margin_bottom_50"},rB.t("To use this step, the workflow must start with the Salesforce \u201CWhen a record changes\u201D action."));case e6.oW.SendSummaryToMySalesHome:case e6.oW.SendSummaryToSalesHome:return r.createElement(u.Ay,{level:u.A_.info,className:"margin_bottom_50"},rB.t("To use this step, the workflow must start with one of the Salesforce \u201COn a schedule\u201D triggers."));case e6.oW.SendToSalesforceApp:return r.createElement(u.Ay,{level:u.A_.info,className:"margin_bottom_50"},I?rB.t("All Send to Salesforce App and Send to Sales Home steps in this workflow must have the same recipient."):"All Send to Salesforce App and Send to Sales Home steps in this workflow must have the same recipient.");default:return null}};renderStepHint.displayName="renderStepHint";let renderFormInputs=()=>{let{AddPin:e}=e6.oW;return f===e?r.createElement(PinMessageFormStep,{inputParameters:V,configuredParameters:F,segmentVariables:b,onChange:L}):r.createElement(aj.v,{functionId:v,inputParameters:V,oAuthParameter:P,variables:b,configuredParameters:F,onChange:L,formatVariableBeforeInsert:q,callbackId:f,applySpecialTreatment:H,renderOAuth2InputParameter:R,stepId:m.id,isExistingStep:a,functionVariables:_,isOAuthTokenInvalid:l,isFunctionFormWrapped:y,onlyRenderParentInputs:B,onlyRenderChildInputs:W,onLoadingStateChange:D,allowVariables:o})};renderFormInputs.displayName="renderFormInputs";let renderMore=()=>{let{SendSummaryToSalesHome:e,SendSummaryToMySalesHome:t}=e6.oW;switch(f){case t:case e:return r.createElement(rD.P,{configuredParameters:F,workflowId:h,isStepPreview:!0});default:return null}};renderMore.displayName="renderMore";let maybeRenderPrivateChannelAlert=()=>g&&g.trigger?.subtype===ar.$.MessagePosted?r.createElement(StepPrivateChannelMessageAlert,{workflow:g,segment:m}):null;return(maybeRenderPrivateChannelAlert.displayName="maybeRenderPrivateChannelAlert",f===e6.oW.OpenForm)?r.createElement(a$,{afterStepId:t,segmentVariables:b,state:e,switchPane:n,isExistingStep:a,activePane:i}):T&&f===e6.oW.AskAgentforce?r.createElement(AskAgentforceStep,{functionId:v,inputParameters:V,variables:b,configuredParameters:F,oAuthParameter:P,onChange:L,formatVariableBeforeInsert:q,callbackId:f,stepId:m.id,isExistingStep:a,functionVariables:_,isFunctionFormWrapped:y,onLoadingStateChange:D,segment:m,allowVariables:!0}):r.createElement(aL.$,{noSubmit:!0,segment:m,noPadding:s},maybeRenderPrivateChannelAlert(),renderStepHint(),renderFormInputs(),renderMore())};SlackFunctionSegmentForm.displayName="SlackFunctionSegmentForm";let rW=(0,r.lazy)(()=>a.e("workflow-builder-segment-form-switch").then(a.bind(a,0x17e17a79)));var rV=a(0x36e8c71e);let rq=(0,r.lazy)(()=>a.e("workflow-builder-segment-form-third-party-event").then(a.bind(a,0x95fbf008))),rH=(0,r.lazy)(()=>a.e("workflow-builder-segment-form-hermes-scheduled").then(a.bind(a,0x11fdd0746))),rU=(0,r.lazy)(()=>a.e("workflow-builder-segment-form-hermes-webhook").then(a.bind(a,0x1b368318d))),rz=(0,r.lazy)(()=>a.e("workflow-builder-segment-form-hermes-webhook").then(a.bind(a,0x1b3e4b87c))),rj=(0,r.lazy)(()=>a.e("workflow-builder-segment-form-shortcut").then(a.bind(a,0x5b41ec0e))),r$=(0,r.lazy)(()=>a.e("workflow-builder-segment-form-slack-event").then(a.bind(a,0x23f302479)));function getSegmentForm({state:e,switchPane:t,afterStepId:a,isExistingSegment:n,isOAuthTokenInvalid:l,activePane:i=tg.k.DEFAULT}){let s=e?.segment;switch(s?.type){case ro.SJ:return r.createElement(rq,{state:e});case ro.kr:return r.createElement(r$,{state:e});case ro.zW:return r.createElement(rj,{state:e});case ro.bX:return r.createElement(rU,{state:e});case ro.LO:return r.createElement(rH,{state:e});case ro.YV:return r.createElement(rz,{state:e,isOAuthTokenInvalid:l});case rV.SLACK_FUNCTION:return r.createElement(SlackFunctionSegmentForm,{state:e,afterStepId:a,isExistingStep:n,switchPane:t,isOAuthTokenInvalid:l,activePane:i});case rV.SWITCH:return r.createElement(rW,{state:e,isExistingStep:!!n,afterStepId:a});case rV.LOOP:return r.createElement(aN,{state:e,isExistingStep:!!n,afterStepId:a});default:return null}}getSegmentForm.displayName="getSegmentForm";var rG=a(0x177a179f2),rK=a(0x52fc4a0c),rY=a(0x24e22e0a6),rQ=a(0x136bd1488),rZ=a(0x15f4f83cf),rJ=a(0x2a3fb7ec),rX=a(0x16ed1b0dc),r0=a(0x4363d33f),r1=a(0x17c7b6bbb);let isTriggerPreviewSegment=e=>"TRIGGER_ID_PLACE_HOLDER"===e.id&&Object.values(r1.vh).some(t=>t===e.type);var r2=a(0x126492ec6),r8=a(0x157b4a886),r4=a(0x20cfa1dc2),r5=a(0x14e3cd22c),r6=a.n(r5);let r3=new c.Ay("workflow_builder"),SegmentFormModal=({title:e,icon:t,onSave:a,onClose:n,saving:i,saveError:c,renderSaveError:d,segment:m,submitLabel:p=null,cancelLabel:b=null,afterStepId:f="",isExistingSegment:g=!1,isAuthTokenModified:_=!1,isSegmentModified:y=!1,isTrigger:x=!1,currentSegmentState:v,segmentReducer:E,speedBumpContext:k,baseAutoClogProps:S,switchPane:w,activePane:T,onNavigateBack:F})=>{let O=(0,nR.A)(),L=(0,e2.j)(),{showSpeedBump:D}=(0,ae.k)(),P=(0,l.wA)(),R=(0,e4.DY)(L),B=m?.type,W=(0,tj.u)(),V=(0,tG.GS)(m),q=V?(0,e5.Dl)(m):void 0,H=(0,tG.GS)(v)?(0,e5.UX)(v):void 0,U=(0,tG.GS)(v)?(0,e5.B8)(v):void 0,z=(0,tG.GS)(v)?(0,e5.am)(v):void 0,j=(0,tG.GS)(v)?(0,e5.ln)(v):void 0,$=x&&(0,rY.Z)(m),G=$?(0,rK.ln)(m):void 0,K=(j||G)?.find(e=>(0,eQ.t)(e)),Y="on"===(0,M.d4)(e=>(0,tn._Z)(e,"wfb_open_form_ui_improvements")),Q=(0,M.d4)(N.$T),Z=Q&&(0,tG.GS)(v)&&v.config.isDataFetching,J=(0,r.useMemo)(()=>(0,tG.YN)({segment:v}),[v]),X=(0,e4.zF)(m),ee=!!L&&(0,e4.a6)(L),et=(0,r.useMemo)(()=>{if(L)return(0,e4.eR)(L)},[L]),ea=x&&!!et,en=x&&(0,rQ.s)(m)&&m.config.event?.eventType===ar.$.MessagePosted,er=x&&B===ro.SJ,el=!!L?.workflow&&(0,aa.T0)(L.workflow),ei=(0,r.useMemo)(()=>(0,ty.q2)(v),[v]),es=!!V&&m.config.is_pristine,eo=(0,M.d4)(e=>(0,ng.tx)(e,m)),ec=(0,M.d4)(ng.N),{priorityErrorCode:ed,priorityErrorMessage:eu,errorCodeCount:em}=(0,r.useMemo)(()=>{if(isTriggerPreviewSegment(m)&&(0,rQ.s)(m)&&m.config.event?.eventType===ar.$.ReactionAdded&&!(m.config.event?.channelIds&&m.config.event?.channelIds.length>0&&m.config.event?.channelIds.every(rX.A)))return{priorityErrorCode:ad.Lj};if(eo)return{priorityErrorCode:ad.aU};let e=(0,e4.rM)(L,m.id),t=(0,a0.jS)(e),a=(0,a0.nh)(L,m,t),n=e.filter(e=>e.code===t).length;return{priorityErrorCode:t,priorityErrorMessage:a,errorCodeCount:n}},[eo,m,L]),ep=!!ed,eb=(0,rY.Z)(v)&&x?v.config.service:void 0,{isFunctionFormWrappable:ef=!1,isFunctionFormWrapped:eg=!1,inputs:eh,function_id:e_="",selectedSlackFunction:ey,isAddOrRemoveFormStep:ex=!1}=(0,tG.GS)(v)&&v.config||{},ev=(0,M.d4)(e=>ef?(0,t5.hj)(e,tb.QF):void 0),eE=(0,tG.GS)(m)?m.config?.slackFunction?.callback_id:e,ek=(0,r.useMemo)(()=>(ed===r4.oh.INVALID_EXTERNAL_TOKEN_IDS||ed===r4.oh.INVALID_SERVICE_TRIGGER_EXTERNAL_TOKEN_IDS)&&_,[_,ed]),eS=!es&&!ek,ew=(0,rJ.X)(r4.Qr,ed)?u.A_.warning:u.A_.error;el&&es?(eS=ep,ew=u.A_.info):isTriggerPreviewSegment(m)&&(0,rQ.s)(m)&&(eS=ep,ew=u.A_.info);let[eC,eA]=E,{speedBumpState:eT,closeSpeedBump:eI,openSpeedBump:eN}=k;(0,r.useEffect)(()=>{D(eT.isVisible??!1)},[eT.isVisible,D]);let[eM,eF]=(0,r.useState)(!1),[,eO]=(0,r.useState)("0"),{onSubmit:eL,shouldEnableSaveForInitialSubmit:eD,hasBlockingError:eP}=(0,I.b)(eO),{isValid:eR=!1,hasValidValues:eB=!1,questionsAreValid:eW,hasValidParentInputValues:eV}=eC.computed,eq=r3.t("Are you sure you want to change how this workflow starts? These changes will go live immediately."),eH=(0,r.useCallback)(()=>{(0,aE.ft)({clogger:O,wbArgs:{workflow_id:R,is_hermes:!0}}),a()},[O,a,R]),eU=(0,r.useCallback)(()=>{!eR||eD||i||(x&&ee?eN({message:"",onCancel:eI,onContinue:()=>eH(),cancelButtonLabel:r3.t("Cancel"),continueButtonLabel:r3.t("Save Changes",{ns:"developer_app_settings"}),heading:r.createElement("div",{className:"padding_bottom_125"},eq)}):a()),eD&&eL(),P((0,r2.br)({workflowId:R}))},[eR,eD,i,P,R,x,ee,eN,eI,eq,eH,a,eL]),ez=(0,r.useCallback)(e=>{e.preventDefault(),eU()},[eU]),ej=m?.type===ro.SJ,e$=(0,r.useMemo)(()=>r.createElement("div",{className:s()(r6().segment_form_fallback,{[r6().trigger_fallback]:x})},r.createElement(ao.O,null,r.createElement(as.o,null))),[x]),eG=(0,n$.fx)({segment:eC.segment},{},P),eK=(0,n$.r)({segment:eC.segment,isExcludesFromSpecificUsersFilterChecked:ec},{},P),eY=B===rV.SLACK_FUNCTION&&(0,e4.uG)(L,m.config?.slackFunction?.app_id??""),eZ=y||!g,eJ=!i&&!eY&&!eP&&!eG,{navigateToParentInputsModal:eX,navigateToFormConfiguration:e0,is3PUFConfigModal:e1,isParentModal:e8,isChildModal:e6}=useSegmentPaneNavigation({segment:v,switchPane:w,activePane:T}),e3=ei&&H?H.input_parameters:j,e7=e3?.some(e=>(0,tX.oO)(e)),e9=ei&&eg&&T===tg.k.DEFAULT,te=!!ey,tt=eJ&&(eB||e1&&eW||e8&&eV)||e9&&te,ta=e9?tt:eD||tt,tr=eJ&&eZ&&eR,tl=(!en||eK)&&(!er||eR)&&(eD||tr),ti=!i,ts=!i,to=K?.oauth2_provider_key&&(0,t3.A)(K.oauth2_provider_key)?K.oauth2_provider_key:"",tc=(0,M.d4)(e=>{let t=$?eb?.function.id:e_;if(t)return(0,r8.JG)(e,{functionId:t,providerKey:to})}),td=tc&&tc?.validTokens,tu=((0,tG.GS)(v)?(0,rG.FE)(v):void 0)??eh,tm=(0,r.useMemo)(()=>{let e={};return K?tu&&tu[K.name]?tu[K.name].value:$&&eb?.inputs&&eb.inputs[K.name]?eb.inputs[K.name]?.value:e:e},[$,K,tu,eb]),tp=(0,r.useMemo)(()=>{if(!K)return!1;let e=!!td?.length,t=(0,at.L)(tm)&&!(0,al.$)(tm),a=ed===r4.oh.INVALID_EXTERNAL_TOKEN_IDS||ed===r4.oh.INVALID_SERVICE_TRIGGER_EXTERNAL_TOKEN_IDS;return!t||a&&!e},[tm,K,td?.length,ed]),tf=Q?e8||e1||e9:ef&&eg&&!ei,th=e6||e1,tx=!!F,tv=(0,r.useMemo)(()=>(!e6||!!eg||!!e7)&&(!e1||!!e7)&&th,[th,e1,e6,eg,e7]),tE=(0,r.useCallback)(()=>{(eD&&!e9&&eL(),!Q&&tt)?w(tg.k.FORM_WRAPPED_INPUTS):Q&&tt&&(e1?H&&(eA((0,t$.nk)({wrappedFunction:H,experimentThirdPartyUserFormParityGroupOn:Q})),w(tg.k.CHILD_INPUTS)):eg&&(!Q||e8)?(0,rZ.GU)(ev)||(eA((0,t$.JB)({openFormSlackFunction:ev})),w(tg.k.THIRD_PARTY_USER_FORM_CONFIG)):e9?ey&&P((0,r0.k)({stepType:{type:rV.SLACK_FUNCTION,subtype:ey.id},workflow:L,afterStepId:f,slackFunction:ey,isFormWrapped:!0})):Q&&(U&&(eA((0,t$.ix)({})),eA((0,t$.XZ)({}))),w(tg.k.CHILD_INPUTS)))},[eD,e9,Q,tt,eL,w,e1,eg,e8,H,eA,ev,ey,P,L,f,U]),tk=(0,r.useMemo)(()=>q&&g&&e6&&ef&&!eg&&!Z&&!ex,[q,g,e6,ef,eg,Z,ex]),tS=(0,r.useMemo)(()=>q&&g&&e6&&eg&&!Z&&!ex,[q,g,e6,eg,Z,ex]),tC=(0,r.useCallback)(()=>eF(!eM),[eM,eF]),tA=(0,r.useMemo)(()=>e9?r3.t("Set Up"):r3.t("Next"),[e9]),tT=(0,r.useMemo)(()=>({...S,action:tK.UiAction.SAVE,onClick:{enableClogAction:tr}}),[S,tr]),tI=(0,r.useMemo)(()=>({...S,action:tK.UiAction.NEXT,onClick:{enableClogAction:tr}}),[S,tr]),tN=(0,r.useMemo)(()=>({...S,action:tK.UiAction.CLICK,elementName:aE.KC.Back,onClick:{enableClogAction:ti}}),[S,ti]),tM=(0,r.useMemo)(()=>({...S,action:tK.UiAction.CLICK,elementName:aE.KC.Cancel,onClick:{enableClogAction:ts}}),[S,ts]),tF="",tO=[];(0,ty.q2)(v)&&(tF=v.config.inputs.title.value,tO=(0,t_.yS)(v));let tL=!tF||0===tO.length,tD=(0,r.useCallback)(()=>{e6&&eg?e0():eX()},[e6,eg,e0,eX]),tP=(0,r.useCallback)(()=>tv?tD():F?.(),[tD,F,tv]),tR=(0,r.useCallback)(()=>{D(!1),eT.onCancel()},[D,eT]),tW=(0,r.useCallback)(()=>{n(),D(!0)},[n,D]),tV=(0,r.useCallback)(()=>{(0,rZ.GU)(ev)||(eA((0,A.TI)({isFunctionFormWrapped:!0,experimentThirdPartyUserFormParityGroupOn:Q})),eA((0,t$.JB)({openFormSlackFunction:ev})),eA((0,A.ST)({isAddOrRemoveFormStep:!0})),eI(),w(tg.k.FORM_LOADING_SCREEN,{heading:r3.t("Create form"),redirectPane:tg.k.THIRD_PARTY_USER_FORM_CONFIG}))},[eI,eA,Q,ev,w]),tq=(0,r.useCallback)(()=>{eN({heading:r3.t("Add a form for this step?"),message:r3.t("We\u2019ll create a form for this step using the info you\u2019ve already set up."),continueButtonLabel:r3.t("Add Form"),continueButtonType:t7.QE.primary,cancelButtonLabel:r3.t("Cancel"),onContinue:tV,onCancel:eI})},[eI,tV,eN]),tH=(0,r.useCallback)(()=>{H&&(eA((0,A.TI)({isFunctionFormWrapped:!1,experimentThirdPartyUserFormParityGroupOn:Q})),eA((0,t$.nk)({wrappedFunction:H})),eA((0,A.ST)({isAddOrRemoveFormStep:!0})),eA((0,t$.ix)({})),eA((0,t$.XZ)({})),eI(),w(tg.k.FORM_LOADING_SCREEN,{heading:r3.t("Remove form"),redirectPane:tg.k.CHILD_INPUTS}))},[eI,eA,Q,w,H]),tU=(0,r.useCallback)(()=>{eN({heading:r3.t("Are you sure you want to remove this form?"),message:r3.rt("The form will be removed from this step. Your {appName} step will remain.",{appName:H?.title}),continueButtonLabel:r3.t("Remove Form"),continueButtonType:t7.QE.danger,cancelButtonLabel:r3.t("Cancel"),onContinue:tH,onCancel:eI})},[eI,tH,eN,H?.title]),tz=(0,r.useCallback)(()=>r.createElement(tw.ty,{heading:eT.heading,cancelButtonLabel:eT.cancelButtonLabel,continueButtonLabel:eT.continueButtonLabel,continueButtonIsDisabled:eT.continueButtonIsDisabled,continueButtonIsLoading:i,continueButtonType:eT.continueButtonType,onCancel:tR,onContinue:eT.onContinue,description:eT.message}),[tR,i,eT.cancelButtonLabel,eT.continueButtonIsDisabled,eT.continueButtonLabel,eT.continueButtonType,eT.heading,eT.message,eT.onContinue]);if(eM)return r.createElement(an.V,{formTitle:tF,formQuestions:tO,toggleShowFullPreview:tC,onClose:n});let tY=Q&&tv,tQ=th||tf,renderModal=()=>r.createElement(r.Fragment,null,r.createElement(tw.rQ,null,tx&&r.createElement(ai.E,{workflowId:R,onNavigateBack:tP,isSegmentModal:!0}),r.createElement(tw.Rc,{"data-qa":"segment-form-header",title:e,icon:t})),r.createElement(tw.$m,{className:s()({[r6().modal_content_height]:e8})},r.createElement(C.N6.Provider,{value:ez},c&&d&&r.createElement(tw.qf,{className:r6().error_banner},r.createElement(tB.A,{className:r6().topIconAlert},d(c))),tY&&(0,tG.GS)(v)&&r.createElement(tw.qf,{className:r6().navigation_border},r.createElement(SegmentPaneNavigation,{inputParameters:e3,segment:v,switchPane:w,baseAutoClogProps:S,hasValidParentInputValues:eV,activePane:T})),eS&&ep?r.createElement(tw.qf,{className:r6().error_banner},r.createElement(u.Ay,{"data-qa":"segment-form-modal-alert-api-error",type:u.QE.inline,level:ew,align:u.AO.left},r.createElement("span",null,r.createElement(ac.Z,{errorCode:ed,errorMessage:eu,errorCount:em,slackFunction:q,viewContext:ac._.MODAL})))):null,r.createElement(r.Suspense,{fallback:e$},getSegmentForm({state:eC,afterStepId:f,isExistingSegment:g,switchPane:w,isOAuthTokenInvalid:tp,activePane:T})))),r.createElement(tw.jl,{className:s()({[r6().formV2Footer]:ej,padding_top_100:tk||tS}),isAdaptive:tk||tS,renderSpeedBump:tz},ei&&(!Q||!eg)&&(Y?r.createElement(t9.A,{onClick:tC,disabled:tL},r3.t("Preview form")):r.createElement(h.Ay,{type:"outline",onClick:tC},r3.t("Preview Form"))),r.createElement(tw.ox,{className:s()({full_width:tk||tQ||tS,[r6().modal_footer_form_generator]:tk||tS,[r6().modal_footer_actions]:ea})},tk&&r.createElement("div",{className:"margin_bottom_150 margin_right_0 padding_0"},r.createElement(u.Ay,{level:u.A_.info,align:u.AO.left,type:u.QE.boxed,isIconVisible:!1},r.createElement("div",{className:"display_flex align_items_center gap_100"},r.createElement("div",null,r.createElement("strong",null,r3.t("Add a form for this step")),r.createElement("div",null,r3.t("Skip the manual form set up \u2014 let us create a form using this step\u2019s data for you."))),r.createElement(h.Ay,{type:"outline",size:"small",className:"padding_left_150 padding_right_150",onClick:tq},r3.t("Add Form"))))),tS&&r.createElement("div",{className:"margin_bottom_150 margin_right_0 padding_0"},r.createElement(u.Ay,{level:u.A_.default,align:u.AO.left,type:u.QE.boxed,isIconVisible:!1},r.createElement("div",{className:"display_flex align_items_center gap_100"},r.createElement("div",null,r.createElement("strong",null,r3.t("Remove form from step")),r.createElement("div",null,r3.t("We\u2019ll remove this form, and you can set one up manually if needed."))),r.createElement(h.Ay,{type:"outline",size:"small",className:"padding_left_150 padding_right_150",onClick:tU},r3.t("Remove Form"))))),ea&&r.createElement(ChangeTriggerButton,{disabled:i}),r.createElement("div",{className:"display_flex justify_content_end gap_75"},r.createElement(h.Ay,{type:"outline",onClick:tW,disabled:!ts,"data-qa":"segment-form-modal-cancel__button",autoClogProps:tM,className:s()({margin_right_auto:tQ})},b??r3.t("Cancel")),tv&&r.createElement(h.Ay,{type:"outline",onClick:tD,disabled:!ti,"data-qa":"form-wrapped-inputs-back__button",autoClogProps:tN},r3.t("Back")),tf?r.createElement(h.lV,{loading:Z||J||z?.isLoading||i,onClick:tE,disabled:!ta,"data-qa":"segment-form-modal-next__button",autoClogProps:tI,"aria-label":tA},tA):!W&&r.createElement(h.lV,{loading:i,onClick:eU,disabled:!tl,"data-qa":"segment-form-modal-submit__button",autoClogProps:tT,"aria-label":p||r3.t("Save")},p||r3.t("Save"))))));return X&&ep?r.createElement(o.A,{eventId:tK.EventId.WORKFLOW_CONNECTOR_STEPS_ERROR,clogImpression:!0,uiStep:tK.UiStep.WORKFLOW_EDITOR,elementName:aE.KC.EditStep,displayName:eE,workflowBuilderWorkflowId:(0,e4.DY)(L)},renderModal()):renderModal()};SegmentFormModal.displayName="SegmentFormModal";var r7=a(0x3793f9af),r9=a(0xd2ef9f49),le=a(0x23a9df45f),lt=a(0x11c82607b);let la=(0,lt.Ay)("Fetch and upsert members using user IDs in rich text blocks",async(e,t,{blocks:a})=>{let n=[];a.forEach(e=>{e.elements.forEach(e=>{(0,r9.B)(e)&&e.elements.forEach(e=>{(0,le.H1)(e)&&n.push(e.user_id)})})}),n.length>0&&await e((0,r7.Y)({ids:n}))});la.meta={name:"fetchAndUpsertMembersFromRichTextBlocks",key:"createThunkFetchAndUpsertMembersFromRichTextBlocks",description:"Fetch and upsert members using user IDs in rich text blocks"};var ln=a(0x11e2b5969),lr=a(0x80759cc4);let ll=(0,lt.Ay)("Fetch and upsert user groups using user group IDs in rich text blocks",async(e,t,{blocks:a})=>{let n=[];a.forEach(e=>{e.elements.forEach(e=>{(0,r9.B)(e)&&e.elements.forEach(e=>{(0,lr.GH)(e)&&n.push(e.usergroup_id)})})}),n.length>0&&await e((0,ln.WU)({ids:n,reason:"fetchAndUpsertUserGroupsFromRichTextBlocks"}))});function useSegmentFormInitializer({isOpenForm:e,segment:t}){let a=(0,l.wA)();(0,U.A)(()=>{e&&(0,tG.GS)(t)&&(0,t_.yS)(t).forEach(e=>{let{options:t,questionType:n}=e;(0,ta.OW)(n)&&t&&t.length>0&&t.forEach(e=>{if((0,G.X)(e)){let t=Object.values(e.value);a(la({blocks:t})),a(ll({blocks:t}))}})})})}ll.meta={name:"fetchAndUpsertUserGroupsFromRichTextBlocks",key:"createThunkFetchAndUpsertUserGroupsFromRichTextBlocks",description:"Fetch and upsert user groups using user group IDs in rich text blocks"};let excludeFieldsForComparison=e=>{let{slackFunction:t,isFunctionFormWrapped:a}=e.config;return a?e:{...e,config:{...e.config,slackFunction:{...t,input_parameters:t?.input_parameters?.map(e=>{let{properties:t,...a}=e;return a})??[]}}}};var li=a(0x21453d73b),ls=a(0x1fbc3c543),lo=a(0x30d8960c),lc=a(0x4a312a6e),ld=a(0x1d95c2b6f),lu=a(0x22f6a086f);let lm="20",useTriggerDisplayContent=()=>{let e=(0,M.d4)(lu.cw);return(0,r.useCallback)((t,a={iconSize:lm})=>{let n;if(!t||t.type===rV.SLACK_FUNCTION)return{label:"",icon:""};let l=a.iconSize,i={...t,type:(0,ld.IE)(t.type)};switch(i.type){case r1.vh.Event:n=e.find(e=>e.type===i.type&&e.subtype===i.config.event?.eventType);break;case r1.vh.Service:n=e.find(e=>e.type===i.type&&e.subtype===i.config.service?.trigger_type_ref),l="40";break;case r1.vh.External:n=e.find(e=>e.type===i.type&&e.subtype===i.config.subtype),l="40";break;default:n=e.find(e=>e.type===i.type)}return{label:n?.label||"",icon:"string"==typeof n?.icon?r.createElement(lc.Jx,{name:n.icon||n.appId,iconSize:l,type:n.type}):n?.icon||""}},[e])};useTriggerDisplayContent.displayName="useTriggerDisplayContent";var lp=a(0x1c27a9e4a),lb=a(0xfcd3ead1),lf=a(0x18608b0ec),lg=a(0x1f265cc5b),lh=a(0x3fe57881),l_=a(0xa6e1b10c),ly=a(0x44c1a824),lx=a(0x38e951e5),lv=a(0xf48b1168);function getSegmentReducer(e,t,a){switch(e.type){case ro.zW:return lx.bg;case ro.SJ:return lg.g6;case ro.bX:return l_.iI;case ro.LO:return lh.en;case ro.kr:return lv.rL;case ro.YV:return ly.O;case rV.SLACK_FUNCTION:return a!==e6.oW.OpenForm||(0,ty.Pv)(e)?t$.Qx:(0,A.$m)(t);case rV.SWITCH:return lf.gA;case rV.LOOP:return lb.Jw;default:throw Error("No Reducer Found - get-segment-reducer.ts")}}var lE=a(0x8fb98cae);let useSegmentReducer=(e,t)=>(0,r.useReducer)(e,t,e.initialize),ValidationProvider=({children:e,computed:t})=>{let a=!!t&&(0,r.useMemo)(()=>t,[...Object.values(t)])||{};return r.createElement(C.cR.Provider,{value:a},e)};ValidationProvider.displayName="ValidationProvider";var lk=a(0x130d89881);let lS={width:"100%"},FillParentContainer=({children:e,className:t="",...a})=>r.createElement(lk.A,{style:lS},({height:n,width:l})=>r.createElement("div",{...a,className:t,style:{width:l?`${l}px`:"100%",height:n?`${n}px`:"100%","--container-content-height":`${n}px`,"--container-content-width":`${l}px`}},e));FillParentContainer.displayName="FillParentContainer";var lw=a(0x647f4f35),lC=a(0x203b19061);let CustomPromptInput=e=>{let{variables:t,callbackId:a}=e,n=(0,lC.A)({variables:t,callbackId:a,isTriggerSegment:!1})??t,l=(0,M.d4)(N.EY),{aiStepPrivateChannelAccess:i,aiStepPrivateChannelTeamIds:s}=(0,lw.k)({callbackId:a});return r.createElement(rc.h,{value:e.value,callbackId:a,stepId:e.stepId,parameter:e.parameter,variables:n,allowVariables:e.allowVariables,required:e.required,onChange:e.onChange,formatVariableBeforeInsert:e.formatVariableBeforeInsert,parameters:e.parameters,configuredParameters:e.configuredParameters,hideLabel:e.hideLabel,subtext:e.subtext,labelClassName:e.labelClassName,isParameterSyncedWithForm:e.isParameterSyncedWithForm,sendAsUserValue:e.sendAsUserValue,experimentUserAuthoredWorkflowPostsFeGroupOn:e.experimentUserAuthoredWorkflowPostsFeGroupOn,experimentWfbAiAnswerStepGroupOn:e.experimentWfbAiAnswerStepGroupOn,wfbAiPromptButtons:e.wfbAiPromptButtons,excludePrivateChannelAutocomplete:l?!1===i:void 0,privateChannelTeamIds:l?s:void 0})};CustomPromptInput.displayName="CustomPromptInput";var lA=a(0x2281fc25),lT=a(0x1fcbb004d),lI=a(0x186093629),lN=a.n(lI);let lM=new c.Ay("workflow_builder"),AiPromptEditorModal=e=>{let{parameter:t,onChange:a,variables:n,formatVariableBeforeInsert:i,parameters:s,configuredParameters:o,callbackId:c,experimentWfbAiAnswerStepGroupOn:d,onClose:u,workflowId:m,segment:p}=e,b=(0,l.wA)(),f=(0,nR.A)(),[h,_]=(0,r.useState)(o?.[lA.c.PROMPT]?.value||g.Ml),y=(0,r.useCallback)(()=>{(0,aE.ft)({clogger:f,uiArgs:{step:tK.UiStep.WORKFLOWS_AI_STEP_PROMPT_EDITOR_MODAL},wbArgs:{workflow_id:m,is_hermes:!0}}),b((0,lT.O)())},[b,f,m]),x=(0,r.useCallback)(()=>{u?.(),y()},[y,u]),v=(0,r.useCallback)((e,t)=>{_(t),a(e,t)},[a]),E=(0,r.useMemo)(()=>d?lM.t("Custom Prompt"):"Custom Prompt",[d]),k=(0,r.useMemo)(()=>({segment:p,onExpandCollapsePromptClick:x,isPromptExpanded:!0,insertVariableButton:null,enablePromptToolsButton:!0}),[p,x]);return r.createElement(t0.v,{contentLabel:E,modalClassName:lN().promptEditorModal,centered:!0,shouldCloseOnOverlayClick:!0,maxWidth:1e3,fullscreen:!0,onClose:u,overlayClassName:lN().promptEditorModalOverlay},r.createElement(tw.rQ,null,r.createElement(tw.Rc,{title:E})),r.createElement("div",{className:lN().promptEditorModalContent},r.createElement("div",{className:lN().textyInputContainer},r.createElement(CustomPromptInput,{parameter:t,value:h,onChange:v,variables:n,formatVariableBeforeInsert:i,labelClassName:lN().promptLabel,parameters:s,configuredParameters:o,callbackId:c,allowVariables:!0,experimentWfbAiAnswerStepGroupOn:d,hideLabel:!0,wfbAiPromptButtons:k}))),r.createElement(tw.jl,null,r.createElement(tw.ox,null,r.createElement(tw.s_,{onClick:x,type:"outline","aria-label":lM.t("Close")},lM.t("Close")))))};AiPromptEditorModal.displayName="AiPromptEditorModal";var lF=a(0x20b4dda68),lO=a(0x62a17882),lL=a(0x133dc8e0d),lD=a.n(lL);let AiStepLoadingAnimation=({lineCount:e=3,className:t})=>r.createElement("div",{className:`${lD().response_loading} ${t}`},Array.from({length:e}).map((e,t)=>r.createElement("div",{className:lD().loader_container,key:t},r.createElement(eR.A,{width:"100%",height:12,borderRadius:16}))));AiStepLoadingAnimation.displayName="AiStepLoadingAnimation";var lP=a(0xe874a88a),lR=a(0x22a29f141),lB=a(0x1dfdeb1c8),lW=a(0xe747dd27);let lV=(0,lB.A)("functions.workflows.steps.aiFilePrecheck generated fetcher",(e,t,a)=>new lP.S((n,r)=>{let{abortSignal:l,reason:i,...s}=a,o=(0,lW.VA)(s);e((0,lR.apiCall)({method:"functions.workflows.steps.aiFilePrecheck",args:o,abortSignal:l,reason:i})).then(e=>{n(e)}).catch(e=>{(0,aB.default)({getState:t}).error(`API call to functions.workflows.steps.aiFilePrecheck
						with reason ${i} failed, initiated by generated fetcher`),r(e)})}));lV.meta={name:"functionsWorkflowsStepsAiFilePrecheckFetcher",key:"createFetcherFunctionsWorkflowsStepsAiFilePrecheckFetcher",description:"functions.workflows.steps.aiFilePrecheck generated fetcher"};let lq=new c.Ay("workflow_builder"),lH=(0,aB.default)({label:aW.y}),checkAiFileUploadPermitted=async(e,t,a)=>{try{let n=await e(lV({mimetype:t.type,fileSize:t.size,reason:"ai-step-file-upload-pre-check"}));if(!n.ok||n.is_permitted)return null;if(!n.is_mimetype_supported)return{id:`unsupported_type_${t.name}`,message:a?lq.t('The file type "{filetype}" is not supported. Supported types: {supportedTypes}',{filetype:t.type||"unknown",supportedTypes:n.supported_mimetypes.join(", ")}):`The file type "${t.type||"unknown"}" is not supported. Supported types: ${n.supported_mimetypes.join(", ")}`};let r=Math.round(n.size_limit/1048576);return{id:`too_large_${t.name}`,message:a?lq.t('The file "{filename}" exceeds the {sizeLimitMB} MB size limit for its file type.',{filename:t.name,sizeLimitMB:String(r)}):`The file "${t.name}" exceeds the ${r} MB size limit for its file type.`}}catch(e){return lH.error(Error(`AI file upload pre-check failed: ${e}`)),null}};var lU=a(0x11cab3cb4),lz=a(0x18785321b),lj=a(0x1a2b0bc8d),l$=a(0xddc78dc5),lG=a(0x2278818de),lK=a(0x22809c249),lY=a(0x1c2e38de1),lQ=a(0x3143105f),lZ=a(0x113ec6ce5);let lJ=new c.Ay("workflow_builder"),TestFileUpload=({value:e,parameter:t,callbackId:a,onChange:n})=>{let i=(0,l.wA)(),s=(0,r.useRef)(null),o=(0,M.d4)(N.dI),c="maxItems"in t&&t.maxItems||e9.$,d=e9.e,u=(0,M.d4)(lY.p),m=u===lY.v.DISABLE_ALL,p=u===lY.v.IMAGES_ONLY,[b,f]=(0,r.useState)([]),[g,_]=(0,r.useState)([]),[y,x]=(0,r.useState)(m?[{id:"disable_all_error",message:o?lJ.t("File uploads to this workspace have been disabled at the request of your administrator."):"File uploads to this workspace have been disabled at the request of your administrator."}]:[]),[v,E]=(0,r.useState)(!1),k=(0,M.d4)(lj.$),S=(0,r.useMemo)(()=>{let e=[...b,...g];return k.filter(t=>e.includes(t.id))},[k,b,g]),w=(0,r.useCallback)(e=>{_(t=>[...t,e.id])},[]),C=(0,r.useCallback)(a=>{_(e=>e.filter(e=>e!==a.id)),f(r=>{let l=[...r,a.id],i=[];e&&(i=Array.isArray(e)?e:[e]);let s=[...new Set([...i,...l])];return n(t,1===c?s[0]:s),l})},[n,t,e,c]),A=(0,r.useCallback)(a=>{f(r=>{let l=r.filter(e=>e!==a.id),i=[];e&&(i=Array.isArray(e)?e:[e]);let s=[...new Set([...i,...l])].filter(e=>e!==a.id);return n(t,1===c?s[0]||void 0:s),l})},[n,t,e,c]),T=(0,r.useCallback)(e=>{_(t=>t.filter(t=>t!==e.id))},[]),I=(0,r.useCallback)(e=>{let t={id:e.id,message:o?lJ.t("There was a problem uploading the file {filename}. Please try again in a few minutes.",{filename:e.name}):`There was a problem uploading the file ${e.name}. Please try again in a few minutes.`};x(e=>[t,...e])},[o]),F=(0,r.useCallback)(async e=>{x([]);let t=(0,lG.l)({filesToUpload:e,existingFiles:S,maxFiles:c,maxFileSizeBytes:d});if(t)return void x([t]);if(o&&a===e6.oW.AiAnswer){E(!0);try{let t=(await Promise.all(e.map(e=>checkAiFileUploadPermitted(i,e,o)))).filter(e=>null!==e);if(t.length>0)return void x(t)}finally{E(!1)}}i((0,lZ.Z)({filesToUpload:e,onFilePending:w,onFileUploaded:C,onPendingFileRemoved:T,onUploadError:I}))},[a,i,o,S,c,d,w,C,T,I]),O=(0,r.useCallback)(e=>{e.length>0&&F(e)},[F]),L=(0,r.useCallback)(()=>{s.current&&s.current.click()},[]),D=(0,r.useCallback)((e,t)=>{1===S.length&&x([]),i((0,lQ.n)({file:t,onFileRemoved:A,onPendingFileRemoved:T}))},[i,S.length,A,T]),P=o?lJ.t("Add another file"):"Add another file",R=o?lJ.t("Upload file"):"Upload file",B=o?lJ.t("Checking file\u2026"):"Checking file...",W=(0,r.useMemo)(()=>v?B:S.length>0?P:R,[v,B,S.length,P,R]);return r.createElement("div",null,S.length>0&&r.createElement(lU.F,{files:S,onRemoveFile:D}),r.createElement(lz.M,{errors:y}),r.createElement(h.Ay,{onClick:L,disabled:m||v,type:"outline"},W),r.createElement(lK.A,{ref:s,multiple:c>1,onFilesSelectedHandler:O,...(0,l$.y)({filetypes:void 0,isUploadImageOnly:p,isUploadDisabled:m})}))};function isFormFieldDropdown(e){return"slack#/types/limited_rich_text"===e.type&&"choices"in e&&Array.isArray(e.choices)&&e.choices.length>0}function normalizeDropdownParameter(e){return isFormFieldDropdown(e)?{...e,choices:e.choices.map(e=>({...e,value:e.id}))}:e}function normalizeDropdownValue(e,t){if(!isFormFieldDropdown(e)||!Array.isArray(t))return t;try{let a=JSON.stringify(t),n=e.choices.find(e=>{try{return JSON.stringify(e.value)===a}catch{return!1}});return n?.id||t}catch{return t}}function initializeAndNormalizeInputVariables(e,t){let a={...e},n=new Map;return t.forEach(e=>{let t=e.metadata,r=t.name;if(isFormFieldDropdown(t)&&n.set(r,t.choices),a[r]?.value||void 0===t.default||(a[r]={value:t.default,hidden:!1,locked:!1}),isFormFieldDropdown(t)&&a[r]?.value){let e=normalizeDropdownValue(t,a[r].value);a[r]={...a[r],value:e}}}),{inputVariables:a,originalChoicesMap:n}}function createDropdownAwareChangeHandler(e,t){return(a,n,r,l)=>{let i=e.get(a.name);if(i&&i&&"string"==typeof n){let e=i.find(e=>e.id===n);if(e&&Array.isArray(e.value))return void t(a,e.value,r,l)}t(a,n,r,l)}}function normalizeInputVariablesForDropdowns(e,t){let a={...e};return t.forEach(e=>{let t=e.metadata;if(isFormFieldDropdown(t)&&a[t.name]?.value){let e=normalizeDropdownValue(t,a[t.name].value);a[t.name]={...a[t.name],value:e}}}),a}TestFileUpload.displayName="TestFileUpload";var lX=a(0x3264c4f4),l0=a(0x1840248cf);function wrapWithWorkflowTokenDelimiters(e){return`{{${e}}}`}function processChunkElement(e,t){if((0,lX.ed)(e)){let a=(0,l0.z)(e.id);if(a&&t(a))return{...e,id:a}}if("elements"in e&&Array.isArray(e.elements)){let a=e.elements.map(e=>processChunkElement(e,t));return{...e,elements:a}}return e}function processTopLevelElement(e,t){if(!("elements"in e)||!Array.isArray(e.elements))return e;if("rich_text_list"===e.type){let a=e.elements.map(e=>processTopLevelElement(e,t));return{...e,elements:a}}let a=e.elements.map(e=>processChunkElement(e,t));return{...e,elements:a}}function extractMacroVariablesFromRichText(e,t){let a;if(!Array.isArray(e))return e;if(t)if("function"==typeof t)a=t;else{let e=new Set(t.filter(e=>{let t=e.metadata.type;return t&&!isParameterTypeSupportedInInputRenderingEngine(t)}).map(e=>wrapWithWorkflowTokenDelimiters(e.name)));a=t=>e.has(t)}else a=()=>!0;return e.map(e=>e?.type==="rich_text"&&Array.isArray(e.elements)?{...e,elements:e.elements.map(e=>processTopLevelElement(e,a))}:e)}function isParameterTypeSupportedInInputRenderingEngine(e){return[e6.HN.SlackTypesMessageContext,e6.HN.SlackTypesUserId,e6.HN.SlackTypesChannelId,e6.HN.SlackTypesUsergroupId,e6.HN.SlackTypesListId,e6.HN.SlackTypesCanvasId,e6.HN.SlackTypesChannelCanvasId,e6.HN.SlackTypesCanvasTemplateId,e6.HN.SlackTypesTeamId,e6.HN.Integer,e6.HN.Number,e6.HN.Boolean,e6.HN.String,e6.HN.SlackUserPermission,e6.HN.Array,e6.HN.SlackTypesTimestamp,e6.HN.SlackTypesRichText,e6.HN.SlackTypesExpandedRichText,e6.HN.SlackTypesBlocks,e6.HN.SlackTypesLimitedRichText,e6.HN.SlackTypesSalesforceRecordId,e6.HN.SlackTypesDate,e6.HN.DateTime,e6.HN.Reaction,e6.HN.SlackTypesCredentialOauth2,e6.HN.Timezone,e6.HN.SlackTypesUserContext,e6.HN.SlackTypesInteractivity].includes(e)}let l1=new c.Ay("workflow_builder"),l2=[],l8=[],StepTestModalContent=({closeButtonText:e,saveButtonText:t,segment:a,workflow:n,requiredVariables:l,isLoading:i,onCloseButtonClick:s,onSave:o})=>{let c=(0,M.d4)(N.dI),d=(0,e5.Dp)(a),u=(0,r.useMemo)(()=>r.createElement("div",{className:lD().titleContainer},a.config.slackFunction?.title||"",r.createElement(no.v,{style:no.u.Jade},c?l1.t("Test run"):"Test run")),[c,a.config.slackFunction?.title]),m=(0,nR.A)(),p=(0,e8.EM)(a),b=(0,r.useMemo)(()=>{let e={};for(let t of l.referencedVariables)e[t.metadata.name]=t.name;return e},[l.referencedVariables]),f=(0,r.useMemo)(()=>a.config.slackFunction?.input_parameters.map(e=>e.name)??[],[a.config.slackFunction?.input_parameters]),g=(0,r.useCallback)(()=>{(0,aE.ft)({clogger:m,uiArgs:{step:tK.UiStep.WORKFLOWS_TEST_RUN_VARIABLES_MODAL},wbArgs:{workflow_id:n.workflow.id,is_hermes:!0}}),s()},[m,s,n.workflow.id]),{inputVariables:_,originalChoicesMap:x}=(0,r.useMemo)(()=>initializeAndNormalizeInputVariables(a.config.inputs,l.referencedVariables),[a.config.inputs,l.referencedVariables]),[v,E]=(0,r.useState)(_),k=(0,r.useMemo)(()=>{let e={};for(let t of l.referencedVariables){let a=t.metadata.name;if(!f.includes(a)&&void 0!==t.metadata.default){let n=b[a];n&&(e[n]=t.metadata.default)}}return e},[l.referencedVariables,f,b]),[S,w]=(0,r.useState)(k),C=(0,r.useCallback)((e,t,a,n)=>{if(E(a=>({...a,[e.name]:{...a[e.name]||{},value:t}})),!f.includes(e.name)){let a=b[e.name];w(e=>({...e,[a]:t}))}},[f,b]),A=(0,r.useMemo)(()=>l.referencedVariables.filter(e=>!!e.metadata.is_required&&!e.metadata.isOptional&&!v[e.metadata.name]?.value),[l.referencedVariables,v]),T=(0,r.useCallback)(e=>{var t,a;let n;o({stepInputs:(t=Object.fromEntries(Object.entries(v).filter(([e])=>f.includes(e))),a=l.referencedVariables,n={},Object.entries(t).forEach(([e,t])=>{if(t?.value&&Array.isArray(t.value)){let r=extractMacroVariablesFromRichText(t.value,a);n[e]={...t,value:r}}else n[e]=t}),n),stepExecutionData:S})},[o,v,S,f,l]);(0,r.useEffect)(()=>{(0,aE.Vb)({clogger:m,uiArgs:{step:tK.UiStep.WORKFLOWS_AI_STEP_DEFAULT_MODAL},wbArgs:{workflow_id:n.workflow.id,is_hermes:!0}})},[m,n.workflow.id]);let I=(0,r.useMemo)(()=>createDropdownAwareChangeHandler(x,C),[C,x]),F=(0,r.useMemo)(()=>normalizeInputVariablesForDropdowns(v,l.referencedVariables),[v,l.referencedVariables]);return r.createElement(r.Fragment,null,r.createElement(tw.rQ,null,r.createElement(tw.Rc,{title:u})),r.createElement(tw.$m,null,r.createElement(tw.qf,{className:"padding_top_50 padding_bottom_50"},r.createElement("div",null,l.referencedVariables.length>0&&r.createElement("div",null,r.createElement("p",null,c?l1.t("Provide the below inputs to test run this step"):"Provide the below inputs to test run this step"),l.referencedVariables.map(e=>{let t=normalizeDropdownParameter(e.metadata);return t.type===e6.TE.Array&&t.items?.type===e6.TE.SlackTypesFileId?r.createElement(y.A,{key:e.metadata.name,text:e.metadata.title,className:"margin_bottom_100"},r.createElement(TestFileUpload,{value:"",parameter:t,callbackId:d,onChange:I})):r.createElement(eK.v,{key:e.name,functionId:a.config.function_id,configuredParameters:F,onChange:I,variables:p,allowVariables:!1,callbackId:d,parameter:t,oAuthParameter:void 0,inputParameters:l2,keyValueParameters:l8,enableRichTextDropdowns:!0,enableStringFallback:!0})}))))),r.createElement(tw.jl,null,r.createElement(tw.ox,null,r.createElement(tw.s_,{onClick:g,type:"outline","aria-label":e},e),r.createElement(h.lV,{"data-qa":"step-test-modal__save-button",ariaLoadingMessage:c?l1.t("Running"):"Running",disabled:A.length>0,loading:i,onClick:T,"aria-label":t},t))))};function stripVariablePrefix(e){if(e.startsWith("inputs.")){let t=e.split("__");if(2===t.length)return t[1]}return e}function extractSegmentVariables(e,t,a){let{availableData:n,trigger:r}=t,l=new Map,i=new Map,s=new Map,o={get undefinedVariables(){return Array.from(l.values())},get hiddenVariables(){return Array.from(i.values())},get referencedVariables(){return Array.from(s.values())}},c=/\{\{([^}]+?)\}\}/g,handleVariable=(a,o)=>{let c=`{{${a}}}`,d=stripVariablePrefix(a),u=`{{data.${d}}}`,m=n[c]||r?.outputs[u]||r?.outputs[`{{${d}}}`];if(m){let e,n=(e=>{let a=e.match(/^steps\.([^.]+?)\.fields\.([^.]+?)$/);if(!a)return;let[,n,r]=a,l=t.workflow?.steps?.find(e=>e.id===n);if(!l||l.function?.callback_id!=="open_form")return;let i=l.inputs?.fields?.value;if(Array.isArray(i))return i.find(e=>e.name===r)})(a);n&&(m={...m,...n,title:m.title||n.title,description:m.description||n.description,name:m.name}),e=!(!o.startsWith("inputs[")||n?.optional)||(n&&"optional"in n?!n.optional:"object"==typeof m&&"is_required"in m&&!!m.is_required);let r={...m,name:`${m.source_id?`${m.source_id}.`:""}${m.name}`||a,is_required:e};("slack#/types/message_context"===r.type||r.is_hidden?i:s).set(a,{name:a,location:o,metadata:r})}else e.config.slackFunction?.input_parameters.some(e=>e.name===a&&e.is_required)||l.set(a,{name:a,location:o})},checkForVariables=(e,t)=>{if("string"==typeof e)for(let a of e.matchAll(c))handleVariable(a[1],t);else Array.isArray(e)?e.forEach((e,a)=>{checkForVariables(e,`${t}[${a}]`)}):e&&"object"==typeof e&&Object.entries(e).forEach(([e,a])=>{checkForVariables(a,`${t}.${e}`)})},d=new Set;return Object.entries(e.config.inputs).forEach(([e,t])=>{if("string"==typeof t.value){let e=t.value.match(c);e&&e.forEach(e=>{let t=e.slice(2,-2);d.add(t)})}d.add(`inputs.${e}`),checkForVariables(t.value,`inputs[${e}]`)}),e.config.slackFunction?.input_parameters.forEach(e=>{if(e.is_required){let t=e.name;d.has(t)||n[`{{${t}}}`]||n[`{{inputs.${r?.id}__${t}}}`]||r?.outputs[`{{data.${t}}}`]||o.undefinedVariables.push({name:t,location:`input_parameters.${e.name}`})}}),a?.includeInputs&&e.config.slackFunction?.input_parameters.forEach(t=>{let a=t.name,n=e.config.inputs?.[t.name]?.value;if(!("string"==typeof n&&c.test(n))&&!s.has(a)&&!i.has(a)){let e={type:t.type,title:t.title,name:t.name,is_required:t.is_required,description:t.description};"array"===t.type&&t.items&&(e.items=t.items),void 0!==n&&(e.value=n),s.set(a,{name:a,location:`input_parameters.${t.name}`,metadata:e})}}),o}StepTestModalContent.displayName="StepTestModalContent";let l4=new c.Ay("workflow_builder"),StepTestModal=({segment:e,workflow:t,onTestRun:a,autoRun:n=!1})=>{let i=(0,l.wA)(),s=(0,M.d4)(N.dI),[o,c]=(0,r.useState)(!1),d=(0,r.useCallback)(()=>{c(!1),i((0,lT.O)())},[i]),u=(0,r.useMemo)(()=>extractSegmentVariables(e,t),[e,t]),m=(0,r.useCallback)(({stepInputs:e,stepExecutionData:t})=>{c(!0),a&&a(e,t,d)},[a,d]),p=(0,r.useMemo)(()=>u&&0===u.referencedVariables.length&&n,[u,n]);(0,r.useEffect)(()=>{p&&m({stepInputs:e.config.inputs,stepExecutionData:{}})},[p,m,e.config.inputs]);let b=(0,r.useCallback)(()=>{d()},[d]),f=s?l4.t("Test {stepName}",{stepName:e.config.slackFunction?.title}):`Test ${e.config.slackFunction?.title}`;return p?null:r.createElement(t0.v,{contentLabel:f,modalClassName:lD().step_test_modal,centered:!0,shouldCloseOnOverlayClick:!0},r.createElement(StepTestModalContent,{segment:e,workflow:t,requiredVariables:u,closeButtonText:l4.t("Cancel"),saveButtonText:s?l4.t("Run"):"Run",onCloseButtonClick:b,onSave:m,isLoading:o}))};StepTestModal.displayName="StepTestModal";var l5=a(0xc3cbf6b1);let l6=new c.Ay("workflow_builder"),AiStreamingError=({containerRef:e,showScrollButton:t,error:a})=>{let n=(0,M.d4)(N.dI),l=((e,t,a={})=>{let n=r.useRef(null);return(0,r.useEffect)(()=>{let{current:r}=n;if(!r||!window.IntersectionObserver)return;let l=a.threshold||1,i=new IntersectionObserver(([t])=>{e(t.intersectionRatio<l)},{threshold:l,root:t?.current??void 0,...a});return i.observe(r),()=>{i.unobserve(r),i.disconnect()}},[n,a,e,t]),n})(t,e,{threshold:1}),i={permission_denied:n?l6.t("This result may be incomplete because the user doesn\u2019t have permission to access the given context"):"This result may be incomplete because the user doesn\u2019t have permission to access the given context",max_tokens_reached:n?l6.t("This result may be incomplete because the AI reached its limit."):"This result may be incomplete because the AI reached its limit.",request_limit_exceeded:n?l6.t("This result may be incomplete because the request loop limit was exceeded."):"This result may be incomplete because the request loop limit was exceeded.",ai_answer_failed:n?l6.t("This result may be incomplete because the AI answering failed"):"This result may be incomplete because the AI answering failed",ai_answer_blocked:n?l6.t("This result may be incomplete because the AI answer is blocked by guardrails"):"This result may be incomplete because the AI answer is blocked by guardrails",llm_permanent_error:n?l6.t("This result may be incomplete because the AI had a problem fulfilling the request"):"This result may be incomplete because the AI had a problem fulfilling the request",llm_input_too_long_error:n?l6.t("This result may be incomplete because the input was too large. Try reducing the number or size of files, or shortening your prompt"):"This result may be incomplete because the input was too large. Try reducing the number or size of files, or shortening your prompt"};return r.createElement("div",{ref:l,className:lN().testPromptPanelStreamingError},r.createElement(u.Ay,{type:"boxed",level:"error",align:"left"},r.createElement("span",null,i[a])))};AiStreamingError.displayName="AiStreamingError";let SparkleWithGradientSVG=()=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},r.createElement("path",{d:"M12.6123 10.8047C12.6718 10.6857 12.8417 10.6858 12.8984 10.8047L13.3125 11.6289C13.4372 11.8753 13.6355 12.0793 13.8848 12.2012L14.71 12.6143C14.8289 12.6737 14.8288 12.8436 14.71 12.9004L13.8848 13.3145C13.6383 13.4391 13.4343 13.6375 13.3125 13.8867L12.8984 14.7109C12.8389 14.8298 12.669 14.8299 12.6123 14.7109L12.1982 13.8867C12.0735 13.6403 11.8754 13.4362 11.626 13.3145L10.8018 12.9004C10.6827 12.8409 10.6827 12.6709 10.8018 12.6143L11.626 12.2012C11.8725 12.0766 12.0764 11.8781 12.1982 11.6289L12.6123 10.8047ZM5.62598 3.4541C5.76203 3.17933 6.15594 3.17933 6.29199 3.4541L7.25293 5.37695C7.54204 5.95483 8.00968 6.422 8.58789 6.71094L10.5127 7.67188C10.787 7.80798 10.787 8.20078 10.5127 8.33691L8.58789 9.29785C8.0097 9.58678 7.54204 10.054 7.25293 10.6318L6.29199 12.5557C6.15588 12.83 5.76217 12.8299 5.62598 12.5557L4.66504 10.6318C4.37597 10.054 3.9082 9.5868 3.33008 9.29785L1.40527 8.33691C1.13068 8.20086 1.13066 7.80791 1.40527 7.67188L3.33008 6.71094C3.90818 6.42199 4.37597 5.95475 4.66504 5.37695L5.62598 3.4541ZM12.6123 1.28906C12.6719 1.17044 12.8416 1.17059 12.8984 1.28906L13.3125 2.11328C13.4371 2.35958 13.6356 2.56371 13.8848 2.68555L14.71 3.09961C14.829 3.15912 14.829 3.32909 14.71 3.38574L13.8848 3.79883C13.6383 3.92343 13.4344 4.12197 13.3125 4.37109L12.8984 5.19531C12.8389 5.31429 12.669 5.31429 12.6123 5.19531L12.1982 4.37109C12.0735 4.12485 11.8752 3.92056 11.626 3.79883L10.8018 3.38574C10.6827 3.32625 10.6827 3.15626 10.8018 3.09961L11.626 2.68555C11.8726 2.56091 12.0764 2.36255 12.1982 2.11328L12.6123 1.28906Z",fill:"url(#paint0_linear_481_30170)"}),r.createElement("defs",null,r.createElement("linearGradient",{id:"paint0_linear_481_30170",x1:"14.7992",y1:"8.0002",x2:"1.19922",y2:"8.0002",gradientUnits:"userSpaceOnUse"},r.createElement("stop",{stopColor:"#83388A"}),r.createElement("stop",{offset:"1",stopColor:"#EABDFB"}))));var l3=a(0x24e7004c6);let l7=new c.Ay("workflow_builder"),ViewErrorButton=({onClick:e})=>{let t=(0,M.d4)(N.dI)?l7.t("View Error"):"View Error";return r.createElement(h.Nm,{className:lN().viewErrorButton,onClick:e,"aria-label":t},r.createElement("span",{className:lN().jumpIcon},r.createElement(p.Ah,{inline:!0,name:"arrow-up"})),t)};ViewErrorButton.displayName="ViewErrorButton";var l9=a(0x113cdbbd7),ie=a(0x1b3ecb90f),it=a(0x146369fa8),ia=a(0x4e250925);let ir=new c.Ay("workflow_builder"),extractRichText=e=>{let t=[];return e&&Array.isArray(e)&&e.forEach(e=>{e.type===lF.WP.rich_text&&t.push(e)}),t},TestPromptPanel=({segment:e,workflow:t,disabled:a,testKey:n})=>{let i=(0,M.d4)(N.dI),o=(0,r.useRef)(null),c=(0,r.useRef)(null),d=(0,l.wA)(),u=(0,nR.A)(),[m,b]=(0,r.useState)(!1),[f,g]=(0,r.useState)(!1),[_,y]=(0,r.useState)(!1),[x,v]=(0,r.useState)(!1),[E,k]=(0,r.useState)(void 0),S=(0,r.useRef)(null),[w,C]=(0,r.useState)(n),[A,T]=(0,r.useState)(void 0),I=(0,r.useCallback)(e=>{g(!1),T({blocks:extractRichText(e)})},[]),F=(0,r.useCallback)((e,a)=>{d((0,ia.VL)({referenceId:a,appId:t.workflow.app_id})).then(e=>{e?.ok&&e.response.answer&&T({ai_context:{result_status:aX.uX.COMPLETE},blocks:extractRichText(e.response.answer)})})},[d,t.workflow.app_id,T]),O=(0,r.useCallback)((e,t)=>{g(!1),t?k(e):y(!0)},[]),{handleSubmit:L}=(0,l3.M)({workflowId:t.workflow.id,onStreamedResponse:I,onComplete:F,onError:O}),D=(0,r.useCallback)(async(t,a,n)=>{T(void 0),g(!0),b(!0),k(void 0),y(!1),L({segment:e,stepInputs:t,stepExecutionData:a}).then(e=>{e?.ok?y(!1):(g(!1),y(!0))}).catch(()=>{g(!1),y(!0)}).finally(()=>{n()})},[L,e,b,g,y,k]),P=(0,r.useCallback)(()=>{d((0,ap.q)({element:r.createElement(StepTestModal,{segment:e,workflow:t,onTestRun:D,autoRun:!0}),isStackable:!0}))},[d,e,t,D]),R=(0,r.useCallback)(()=>{(0,aE.K$)({clogger:u,uiArgs:{step:tK.UiStep.WORKFLOWS_AI_STEP_DEFAULT_MODAL},uiProperties:{element_name:aE.KC.AiStepTestRun}}),P()},[u,P]);(0,r.useEffect)(()=>{n!==w&&(C(n),f||P())},[n,w,P,f]);let B=(0,r.useCallback)(e=>{let t=(0,lO.cX)()?e.metaKey:e.ctrlKey;e.target instanceof HTMLAnchorElement&&"button"in e&&0===e.button&&!t&&(e.preventDefault(),e.stopPropagation())},[]),W=(0,r.useCallback)(()=>{c.current?.scrollIntoView({behavior:"smooth"})},[]);(0,r.useEffect)(()=>{A&&S.current?.querySelectorAll("a").forEach(e=>{e.onclick=B})},[A,B]);let V=(0,r.useCallback)(()=>_?r.createElement(l5.y,{onRetry:P,disabled:a??!1}):A?r.createElement("div",{ref:S,className:lN().testPromptPanelResultContent},r.createElement(it.o,{msg:A,blocksContainerContext:l9.pi.ai_app,inline:!0}),_&&r.createElement(l5.y,{onRetry:P,disabled:a??!1})):null,[A,_,P,a]);return r.createElement("div",{className:lN().testPromptPanelOuterContainer,ref:o},E&&x?r.createElement(ViewErrorButton,{onClick:W}):null,r.createElement(tw.$m,{"aria-labelledby":"simulate-prompt-output-header-text",id:"simulate-prompt-output-content"},r.createElement("div",{ref:c,className:lN().testPromptPanelContainer},r.createElement("div",{className:s()(lN().testPromptPanel,{[lN().testPromptPanelShowResult]:m||f,[lN().testPromptShowResponse]:m&&!f&&!_,[lN().testPromptPanelStreamingError]:E})},r.createElement("div",{className:lN().testContentModalContentSection},m||f?r.createElement(r.Fragment,null,E&&"string"==typeof E.cause?r.createElement(AiStreamingError,{containerRef:o,error:E.cause,showScrollButton:v}):null,A&&r.createElement("div",{className:lN().generatedContentContainer},r.createElement(SparkleWithGradientSVG,null),i?ir.t("Generated content"):"Generated content"),r.createElement("div",{className:lN().testPromptPanelResult},f?r.createElement(AiStepLoadingAnimation,{lineCount:6,className:lN().testPromptPanelResultLoading}):V())):r.createElement("div",{className:lN().testPromptPanelEmptyState},r.createElement("div",{className:lN().testPromptPanelEmptyStateContent},r.createElement("div",null,r.createElement(ie.Ay,{text:":test_tube:",emojiSize:ie.lw.MEDIUM})),r.createElement("h2",{className:lN().testPromptPanelEmptyStateTitle},i?ir.t("Test your prompt"):"Test your prompt"),r.createElement("div",null,i?ir.t("If you choose to test the efficacy of your prompt, you will be guided to provide the required inputs for execution."):"If you choose to test the efficacy of your prompt, you will be guided to provide the required inputs for execution."),r.createElement(h.$n,{type:"outline",className:lN().testPromptButton,disabled:a,onClick:R},i?ir.t("Test Prompt"):"Test Prompt",r.createElement(p.Ah,{name:"play",size:"18"})))))),r.createElement("div",{className:s()(lN().testPromptPanelFooter,{[lN().resultLoading]:f})},i?ir.t("This tool uses AI to generate responses, so some information may be inaccurate."):"This tool uses AI to generate responses, so some information may be inaccurate."))))};TestPromptPanel.displayName="TestPromptPanel";var il=a(0x133aaa7da),ii=a(0x1a043bf26),is=a(0x409e023f),io=a(0x32d3ef3d),ic=a(0xfa28400d),id=a(0x9798b7f),iu=a(0x7729d35b),im=a(0x135b7b386),ip=a(0x184767f39);let ib="knowledge-source-form-modal",ig="knowledge-source-alert",ih={[im.wo]:"select_sheet",[im.y]:"select_document"},i_={[im.wo]:"sheet_id",[im.y]:"document_id"},iy=Object.keys(ih),ix="requestable",iv="requested",iE="addable",ik="inactive",iS="connected",iw={[ip.pY.INIT_APP_REQUEST_FLOW]:ix,[ip.pY.SHOW_STEP_FUNCTION]:iE,[ip.pY.INSTALL_SHOW_STEP_FUNCTION]:iE,[ip.pY.APP_DENIED]:ik,[ip.pY.APP_REQUEST_IS_PENDING]:iv,[ip.pY.APP_HIDDEN]:ik};var iC=((n={}).Single="single",n.First="first",n.Middle="middle",n.Last="last",n);let getKnowledgeSourceUrl=(e,t)=>{if(!t?.app_id)return;let a=i_[t.app_id];if(!a)return;let n=e.inputs[a];if(!n?.value)return;let r="string"==typeof n.value?n.value:String(n.value);switch(t.app_id){case im.wo:return`https://docs.google.com/spreadsheets/d/${r}`;case im.y:return`https://docs.google.com/document/d/${r}`;default:return}};var iA=a(0x5dd1c0f2),iT=a(0x216c59e11),iI=a.n(iT);let iN={name:"trash"},iM=new c.Ay("workflow_builder"),KnowledgeSourceEntity=({knowledgeSource:e,stepId:t,onRemove:a,renderedInListVariant:n,hasFocus:l})=>{let i=(0,M.d4)(t=>(0,t5.hj)(t,e.function_id)),o=(0,M.d4)(N.kZ),c=(({knowledgeSource:e,workflowId:t,stepId:a})=>{let n=(0,M.d4)(e=>t?(0,ng.W_)(e,t):void 0),l=(0,r.useMemo)(()=>{if(a&&e.id&&n)return n[a]?.[e.id]},[n,a,e.id]);return(0,r.useMemo)(()=>l?.loading?io.w.loading:l?.error?io.w.error:(l?.options,io.w.enabled),[l])})({knowledgeSource:e,workflowId:(0,aD.Y)(),stepId:t}),d=(0,r.useMemo)(()=>getKnowledgeSourceUrl(e,i),[e,i]),u=(0,M.d4)(e=>i?.app_id?(0,iA.jH)(e,i.app_id):""),m=c===io.w.error,p=(0,r.useCallback)(e=>{e.stopPropagation(),a?.()},[a]),b=(0,r.useMemo)(()=>r.createElement(v.Ay,{tip:o?iM.t("Remove variable"):"Remove variable"},r.createElement(x.A,{"aria-label":o?iM.t("Remove variable"):"Remove variable",svgIconProps:iN,onClick:p})),[p,o]),f=(0,r.useMemo)(()=>{if(!i?.app_id)return i?.title||i?.description||"";let t=i_[i.app_id];if(t){let a=e.inputs[t],n=a?.value,r=a?.label;return("object"==typeof r&&r?r[n]:void 0)??""}return i.description},[i,e.inputs]),g=(0,r.useMemo)(()=>m?r.createElement("span",{className:s()(iI().secondaryLabel,iI().errorLabel)},o?iM.t("Cannot access file"):"Cannot access file"):d?l?r.createElement("span",{className:iI().secondaryLabel},o?iM.t("Open resource"):"Open resource"):r.createElement("span",{className:iI().secondaryLabel},r.createElement("span",{className:iI().hoverText},o?iM.t("Open resource"):"Open resource"),r.createElement("span",{className:iI().baseText},u)):u,[m,d,u,l,o]),h=(0,r.useMemo)(()=>r.createElement("div",{className:iI().knowledgeSourceEntityContent},r.createElement(iu.A,{entityState:c,suppressDefaultColors:!0},r.createElement(T.z,{appId:i?.app_id})),r.createElement("div",{className:iI().labelWrap},r.createElement(id.A,{entityState:c,size:io.S.compact,primaryLabel:f,secondaryLabel:g}))),[c,i?.app_id,f,g]);return r.createElement(ic.Ay,{size:io.S.compact,entityState:c,isRemovable:!1,isInteractive:!0,isFullWidth:!0,isFullHeight:!0,customMaxWidth:"100%",actionsBar:b,forceShowActionsBar:!0,shouldShrinkUnderDefaultWidth:!0,renderedInListVariant:n},h)};KnowledgeSourceEntity.displayName="KnowledgeSourceEntity";var iF=a(0x1eac8b1c1),iO=a.n(iF);let ConnectorSourceRow=({knowledgeSource:e,stepId:t,variant:a,params:n,externalResourcesArray:l,inputParameters:i,onChange:s})=>{let o=(0,r.useCallback)(()=>{let t=l.filter(t=>t.id!==e.id),a=i.find(e=>e.name===lA.c.EXTERNAL_RESOURCES);a&&s(a,t)},[l,e.id,i,s]);return r.createElement("div",{className:iO().knowledgeSourceRow,style:{height:"62px"}},r.createElement(KnowledgeSourceEntity,{key:e.id,knowledgeSource:e,stepId:t,onRemove:o,renderedInListVariant:a,hasFocus:n.hasFocus||n.hasFocusWithin}))};ConnectorSourceRow.displayName="ConnectorSourceRow";let iL="connector",iD="canvas",iP="list",iR="file",iB="upload_file";var iW=a(0x22f5cc45d);let iV={name:"trash"},iq=new c.Ay("workflow_builder"),FileSourceRow=({item:e,itemValue:t,variant:a,params:n,configuredParameters:l,inputParameters:i,onChange:o})=>{let c=(0,r.useMemo)(()=>{let t;t=e.type===iD?lA.c.CANVAS_IDS:e.type===iP?lA.c.LIST_IDS:lA.c.FILE_IDS;let a=l[t]?.value??[];return Array.isArray(a)?a:[]},[l,e.type]),d=(0,r.useCallback)(t=>{let a;t.stopPropagation(),a=e.type===iD?lA.c.CANVAS_IDS:e.type===iP?lA.c.LIST_IDS:lA.c.FILE_IDS;let n=c.filter(t=>t!==e.id),r=i.find(e=>e.name===a);r&&o(r,n)},[c,e.id,e.type,i,o]),u=(0,r.useMemo)(()=>r.createElement(v.Ay,{tip:iq.t("Remove")},r.createElement(x.A,{"aria-label":iq.t("Remove"),svgIconProps:iV,onClick:d})),[d]);return r.createElement(iW.A,{key:e.id,fileId:t,className:s()("p-explorer_result--list",{"p-explorer_result--list--first":a===iC.First||a===iC.Single,"p-explorer_result--list--last":a===iC.Last||a===iC.Single}),showActions:!1,forceClickStyles:!0,secondaryContent:u,containerHasFocus:n.hasFocus,useListStyling:!0,forceHoverVisible:n.hasFocus})};FileSourceRow.displayName="FileSourceRow";let iH={name:"trash",size:"16"},iU=new c.Ay("workflow_builder"),VariableEntity=({primaryLabel:e,onRemove:t,isMissing:a=!1,renderedInListVariant:n,sourceLabel:l})=>{let i=(0,M.d4)(N.kZ),s=io.w.enabled,o=(0,r.useMemo)(()=>a?r.createElement("span",{className:iI().missingLabel},e):e,[a,e]),c=(0,r.useMemo)(()=>{let e=iU.t("Variable"),t=l?`${e} \xb7 ${l}`:e;return a?r.createElement("span",{className:iI().missingLabel},t):t},[a,l]),d=(0,r.useMemo)(()=>r.createElement("div",{className:iI().knowledgeSourceEntityContent},r.createElement(iu.A,{entityState:s,suppressDefaultColors:!0},r.createElement("div",{className:`${iI().variableIconContainer} ${a?iI().missing:""}`},r.createElement(p.Ah,{name:"css",size:"20"}))),r.createElement("div",{className:iI().labelWrap},r.createElement(id.A,{entityState:s,size:io.S.compact,primaryLabel:o,secondaryLabel:c}))),[s,o,c,a,"css"]),u=(0,r.useMemo)(()=>t?e=>{e.preventDefault(),e.stopPropagation(),t()}:void 0,[t]),m=(0,r.useMemo)(()=>r.createElement(v.Ay,{tip:i?iU.t("Remove variable"):"Remove variable"},r.createElement(x.A,{"aria-label":i?iU.t("Remove variable"):"Remove variable",svgIconProps:iH,onClick:u})),[u,i]);return r.createElement(ic.Ay,{size:io.S.compact,entityState:s,isRemovable:!1,isInteractive:!1,isFullWidth:!0,isFullHeight:!0,customMaxWidth:"100%",actionsBar:m,forceShowActionsBar:!0,shouldShrinkUnderDefaultWidth:!0,renderedInListVariant:n},d)};VariableEntity.displayName="VariableEntity";var iz=a(0x1e1fc678);let getSourceLabelForVariable=(e,t)=>{let a=t.groups.find(t=>t.id===e.source_id);if(a)return a.stepIndex?`Step ${a.stepIndex}`:(0,iz.T)(a.type,a.label,a.subtype)},ij=new c.Ay("workflow_builder"),VariableSourceRow=({item:e,itemValue:t,variant:a,variables:n,configuredParameters:l,inputParameters:i,onChange:o})=>{let c=(0,eX.x)(n.list,t),d=c&&!c.isTombstone?c.label:ij.t("Missing Data"),u=!c||c.isTombstone,m=c?getSourceLabelForVariable(c,n):void 0,p={[iD]:lA.c.CANVAS_IDS,[iP]:lA.c.LIST_IDS,[iR]:lA.c.FILE_IDS}[e.type],b=(0,r.useMemo)(()=>{let e=l[p]?.value??[];return Array.isArray(e)?e:[]},[l,p]),f=(0,r.useCallback)(()=>{let t=b.filter(t=>t!==e.id),a=i.find(e=>e.name===p);a&&o(a,t)},[b,i,e.id,p,o]);return r.createElement("div",{className:s()(iO().knowledgeSourceRow),style:{height:"62px"}},r.createElement(VariableEntity,{key:e.id,primaryLabel:d,onRemove:f,isMissing:u,renderedInListVariant:a,sourceLabel:m}))};VariableSourceRow.displayName="VariableSourceRow";let KnowledgeSourceRow=({item:e,variant:t,stepId:a,variables:n,params:l,externalResourcesArray:i,configuredParameters:s,inputParameters:o,onChange:c})=>{if(e.type===iL)return r.createElement(ConnectorSourceRow,{knowledgeSource:e.data,stepId:a,params:l,variant:t,externalResourcesArray:i,inputParameters:o,onChange:c});let d=e.data;return"string"==typeof d&&(0,e0.bs)(d)?r.createElement(VariableSourceRow,{item:e,itemValue:d,variant:t,variables:n,configuredParameters:s,inputParameters:o,onChange:c}):r.createElement(FileSourceRow,{item:e,itemValue:d,variant:t,params:l,configuredParameters:s,inputParameters:o,onChange:c})};KnowledgeSourceRow.displayName="KnowledgeSourceRow";var i$=a(0xcb24a23b),iG=a(0xbd3de346);let iK=new c.Ay("workflow_builder"),isFileUnavailable=e=>!e||e.isNonExistent||(0,iG.c4)(e)||(0,iG.uO)(e),useKnowledgeSourceAlerts=({segment:e,workflow:t,configuredParameters:a,variables:n})=>{let l=(0,e4.DY)(t),i=(0,M.d4)(N.kZ),s=(0,M.d4)(aC.Pz),o=(0,a0.XS)(t,e),c=(0,a0.nh)(t,e,o),d=(0,M.d4)(e=>(0,ng.W_)(e,l)),u=(0,r.useMemo)(()=>{let t=d?.[e.id];return!!t&&Object.values(t).some(e=>e.error)},[d,e.id]),m=(0,r.useMemo)(()=>{let e=a[lA.c.CANVAS_IDS]?.value??[];return Array.isArray(e)?e:[]},[a]),p=(0,r.useMemo)(()=>{let e=a[lA.c.LIST_IDS]?.value??[];return Array.isArray(e)?e:[]},[a]),b=(0,r.useMemo)(()=>{let e=a[lA.c.FILE_IDS]?.value??[];return Array.isArray(e)?e:[]},[a]),f=m.length>0||p.length>0||b.length>0,g=(0,M.d4)(e=>(0,aC.bO)(e,[...m,...p,...b])),h=(0,r.useMemo)(()=>{let t=e.config.slackFunction?.input_parameters;return t?{canvasParameter:t.find(e=>e.name===lA.c.CANVAS_IDS),listParameter:t.find(e=>e.name===lA.c.LIST_IDS),fileParameter:t.find(e=>e.name===lA.c.FILE_IDS)}:{}},[e.config.slackFunction?.input_parameters]),_=(0,r.useMemo)(()=>b.some(e=>{let t=s?s[e]:void 0;return!(0,e0.cn)(e)&&isFileUnavailable(t)}),[b,s]),y=(0,r.useMemo)(()=>m.some(e=>{let t=s?s[e]:void 0;return!(0,e0.cn)(e)&&isFileUnavailable(t)}),[m,s]),x=(0,r.useMemo)(()=>p.some(e=>{let t=s?s[e]:void 0;return!(0,e0.cn)(e)&&isFileUnavailable(t)}),[p,s]),v=(0,r.useMemo)(()=>(({canvasArray:e,listArray:t,fileArray:a},{canvasParameter:n,listParameter:r,fileParameter:l},i,s)=>{let o=new Map;if(n){let[t]=(0,i$.g)({variables:i,id:lA.c.CANVAS_IDS,value:e,isValidEmptyObject:!0,isRequired:n.is_required??!1,parameter:n,arrayItemType:n.items?.type,allFiles:s});o.set(lA.c.CANVAS_IDS,t)}if(r){let[e]=(0,i$.g)({variables:i,id:lA.c.LIST_IDS,value:t,isValidEmptyObject:!0,isRequired:r.is_required??!1,parameter:r,arrayItemType:r.items?.type,allFiles:s});o.set(lA.c.LIST_IDS,e)}if(l){let[e]=(0,i$.g)({variables:i,id:lA.c.FILE_IDS,value:a,isValidEmptyObject:!0,isRequired:l.is_required??!1,parameter:l,arrayItemType:l.items?.type,allFiles:s});o.set(lA.c.FILE_IDS,e)}return o})({canvasArray:m,listArray:p,fileArray:b},h,n,s),[m,p,b,h,n,s]),E=[...v.values()].flat(),k=(0,r.useMemo)(()=>{if(u)return{text:i?iK.t("There is an issue accessing a connected data source."):"There is an issue accessing a connected data source.",level:"error"};if(_&&E.some(e=>e.id.endsWith("_is_deleted_file"))||y&&o?.includes("workflow_canvas_not_found")||x&&o?.includes("workflow_list_not_found"))return{text:i?iK.t("One or more selected files were not found. Choose a different file to continue."):"One or more selected files were not found. Choose a different file to continue.",level:"error"};if(c&&o===r4.oh.FILE_SIZE_TOO_LARGE){let e=g.find(e=>!!e?.name&&c.includes(e?.name))?.id;if(e&&b.includes(e))return{text:c,level:"error"}}let e=v.get(lA.c.CANVAS_IDS)??[],t=v.get(lA.c.LIST_IDS)??[],a=v.get(lA.c.FILE_IDS)??[];return e.some(e=>e.id.endsWith("_is_greater_than_max"))?{text:i?iK.t("You can have a maximum of 10 {entityName}.",{entityName:iK.t("Canvases",{fallbackHash:"e2d397a06197e996f48faa9c0abfd3a2a80d15de",fallbackHashNs:"files"})}):`You can have a maximum of 10 ${iK.t("Canvases",{fallbackHash:"e2d397a06197e996f48faa9c0abfd3a2a80d15de",fallbackHashNs:"files"})}.`,level:"error"}:t.some(e=>e.id.endsWith("_is_greater_than_max"))?{text:i?iK.t("You can have a maximum of 10 {entityName}.",{entityName:iK.t("Lists",{fallbackHash:"57c9502a7d7d48fd4a86b45fefb2b163491c3ae1",fallbackHashNs:"files"})}):`You can have a maximum of 10 ${iK.t("Lists",{fallbackHash:"57c9502a7d7d48fd4a86b45fefb2b163491c3ae1",fallbackHashNs:"files"})}.`,level:"error"}:a.some(e=>e.id.endsWith("_is_greater_than_max"))?{text:i?iK.t("You can have a maximum of 10 {entityName}.",{entityName:iK.t("Files")}):`You can have a maximum of 10 ${iK.t("Files")}.`,level:"error"}:E.some(e=>e.id.endsWith("_is_missing_variables"))?{text:i?iK.t("Knowledge sources contain a missing variable.",{fallbackHash:"8224d4b6336ff8635e6cccf713f44fb694e92c70"}):"Knowledge sources contain a missing variable.",level:"error"}:E.some(e=>e.id.endsWith("_is_unavailable_variables"))?{text:i?iK.t("Knowledge sources contain an unavailable variable.",{fallbackHash:"02605f6dabeee59a9b76627b21f072b71011da74"}):"Knowledge sources contain an unavailable variable.",level:"error"}:E.some(e=>e.id.endsWith("_mixed_with_array_variables"))?{text:iK.t("Variables containing multiple items must not be mixed wih other items of the same type",{fallbackHash:"02605f6dabeee59a9b76627b21f072b71011da74"}),level:"error"}:i&&f?{text:iK.t("The contents of any Canvas, List, or File used with this step can be shared via the AI response and become visible to workflow users. Make sure you\u2019re ok with sharing this content before continuing."),level:"warning"}:null},[u,_,E,y,o,x,c,v,i,f,g,b]),S=k?.level==="error";return{alert:k,hasError:S}};var iY=a(0xc6a2c86f),iQ=a(0x6e0e2fb2),iZ=a(0xbe3df8c1),iJ=a(0x19561ce96),iX=a(0x212b4c697),i0=a(0x45cdfa9c),i1=a(0x16af7d0de);let i2=new c.Ay("workflow_builder"),KnowledgeSourceForm=({hermesFunction:e,functionCallbackId:t,onConfiguredParametersChange:a,onValidationChange:n,knowledgeSource:l,type:i,inputParameter:s,existingParameters:o,stepId:c})=>{let d=(0,M.d4)(N.kZ),m=(0,aD.Y)(),p=(0,r.useMemo)(()=>{let t=i===iL?e.input_parameters??[]:[s],a=(0,i0.k)(t);return{...e,input_parameters:a}},[e,i,s]),b=(0,r.useMemo)(()=>{let e;return e=i===iL?l?.inputs??{}:{[s.name]:{value:o}},{id:l?.id??c??`temp_third_party_${t}`,type:rV.SLACK_FUNCTION,config:{function_id:l?.id??p.id,inputs:e,slackFunction:p,workflow_id:m}}},[i,l?.id,l?.inputs,t,p,m,s.name,o,c]),[f,g]=useSegmentReducer((0,r.useMemo)(()=>getSegmentReducer(b,{},t),[b,t]),b),h=f.segment;(0,r.useEffect)(()=>{a(h.config.inputs||{})},[h,a]),(0,r.useEffect)(()=>{n(f.computed?.isValid??!1)},[f.computed?.isValid,n]);let _=(0,r.useCallback)(()=>{},[]),y=(0,r.useMemo)(()=>{let e=h.config.inputs?.[s.name]?.value;return Array.isArray(e)?e.filter(e=>"string"==typeof e):[]},[h,s.name]),x=(0,r.useCallback)((e,t)=>{let n=Array.isArray(t)?t:[t];a({...h.config.inputs||{},[s.name]:{value:n}})},[h,s,a]);return i===iB?r.createElement("div",null,y.length>0&&r.createElement("div",{className:"margin_bottom_100"},r.createElement(u.Ay,{level:u.A_.warning},d?i2.t("The contents of any {fileType} used with this step can be shared via the AI response and become visible to workflow users. Make sure you\u2019re ok with sharing this content before continuing.",{fileType:i2.t("File",{fallbackHashNs:"files"})}):"The contents of any file used with this step can be shared via the AI response and become visible to workflow users. Make sure you\u2019re ok with sharing this content before continuing")),r.createElement("label",{htmlFor:"upload-file-input",className:"c-label"},s.title||i2.t("File",{fallbackHashNs:"files"})),r.createElement(TestFileUpload,{value:y,parameter:s,callbackId:t,onChange:x})):r.createElement(C.ZH.Provider,{value:g},r.createElement(SlackFunctionSegmentForm,{state:f,isExistingStep:!1,switchPane:_,activePane:tg.k.DEFAULT,noFormPadding:!0,allowVariables:i!==iL,isFunctionForKnowledgeSource:!0}))};KnowledgeSourceForm.displayName="KnowledgeSourceForm";let KnowledgeSourceFormModal=({onSave:e,appId:t,inputParameter:a,existingParameters:n,type:i,id:s,stepId:o})=>{let c=(0,l.wA)(),[d,m]=(0,r.useState)({}),[p,b]=(0,r.useState)(!1),f=(0,aD.Y)(),g=(0,M.d4)(N.kZ),_=(0,r.useMemo)(()=>{if(t)return ih[t]},[t]),y=(0,r.useMemo)(()=>{if(i===iL)return(Array.isArray(n)?n:[]).find(e=>"object"==typeof e&&e&&"id"in e&&e?.id===s)},[i,n,s]),x=(0,M.d4)(e=>{if(_)return(0,t5.sw)(e,[_])?.[0]}),v=(0,M.d4)(e=>(0,t5.hj)(e,i1.Ez.ai_answer,!0)),E=x??v,S=(0,r.useCallback)(e=>{m(e)},[]),w=(0,r.useCallback)(e=>{b(e)},[]),C=(0,r.useMemo)(()=>{if(i!==iL||0===Object.keys(d).length)return!1;let e=Array.isArray(n)?n:[];return s?e.filter(e=>e.id!==s).some(e=>(0,rm.A)(e.inputs,d)):e.some(e=>{if(!t)return!1;let a=i_[t];return!!e.inputs[a]&&!!d[a]&&(0,rm.A)(e.inputs[a],d[a])})},[i,t,n,s,d]),A=(0,r.useCallback)(()=>{e(i===iL?{inputParameter:a,configuredParameters:{id:s??(0,k.A)(),function_id:E.id,inputs:d,workflow_id:f}}:{inputParameter:a,configuredParameters:d}),c((0,lT.O)({closeNamed:[ib]}))},[i,a,s,E,d,e,c,f]),T=(0,r.useCallback)(()=>{c((0,lT.O)({closeNamed:[ib]}))},[c]),I=(0,r.useMemo)(()=>{if(i===iL)return!!E?.input_parameters?.length&&E.input_parameters.every(e=>{if(!e.is_required)return!0;let t=d[e.name]?.value;return null!=t&&""!==t});let e=d[a.name]?.value;return Array.isArray(e)&&e.length>0||"string"==typeof e&&(0,e0.cn)(e)},[i,E,d,a]),F=(0,r.useMemo)(()=>p&&I,[p,I]);return r.createElement(tw.aF,{onClose:T,contentLabel:g?i2.t("Add Knowledge Source"):"Add Knowledge Source",shouldCloseOnOverlayClick:!1},r.createElement(tw.$m,null,r.createElement(tw.rQ,null,r.createElement(tw.Rc,{title:g?i2.t("Add Knowledge Source"):"Add Knowledge Source"})),r.createElement(tw.qf,null,C&&r.createElement(u.Ay,{level:u.A_.error},g?i2.t("This knowledge source has already been selected. Please choose a different one."):"This knowledge source has already been selected. Please choose a different one."),E&&!(0,rZ.GU)(E)&&r.createElement("div",{className:"margin_top_100 margin_bottom_100"},r.createElement(KnowledgeSourceForm,{key:`form-${E.id}-${_}-${i}`,hermesFunction:E,functionCallbackId:_??"unknown",onConfiguredParametersChange:S,onValidationChange:w,knowledgeSource:y,type:i,inputParameter:a,existingParameters:n,stepId:o})))),r.createElement(tw.jl,null,r.createElement(tw.ox,null,r.createElement(h.Ay,{type:"outline",onClick:T,"aria-label":i2.t("Cancel")},i2.t("Cancel")),r.createElement(h.lV,{type:"primary",disabled:!F||i===iL&&(!t||C),onClick:A,"aria-label":g?i2.t("Add Data Source"):"Add Data Source"},g?i2.t("Add Data Source"):"Add Data Source"))))};KnowledgeSourceFormModal.displayName="KnowledgeSourceFormModal";let i8=new c.Ay("workflow_builder"),KnowledgeSourceMenuItemLabel=({provider:e,status:t})=>{let a=(0,M.d4)(t=>(0,iJ.dJ)(t,e)),n=(0,M.d4)(N.kZ),l=a?.app?.profile?.name,i=(0,r.useMemo)(()=>t===iS?n?i8.t("Connected"):"Connected":t===ix?n?i8.t("Request access"):"Request access":t===iv?n?i8.t("Pending approval"):"Pending approval":"loading"===t?i8.t("Loading"):i8.t("Connect"),[t,n]);return r.createElement("span",{className:iO().knowledgeSourceMenuItemLabel},r.createElement("span",{className:iO().knowledgeSourceMenuItemLeft},a?.app?.profile?.icons?.image32?r.createElement("img",{className:iO().knowledgeSourceMenuItemIcon,src:a?.app?.profile?.icons?.image32,alt:"","data-qa":"knowledge-source-menu-item-icon"}):null,l),r.createElement("span",{className:iO().knowledgeSourceMenuItemRight},i,t===iS&&r.createElement(p.Ah,{name:"check-circle",size:"18"})))};KnowledgeSourceMenuItemLabel.displayName="KnowledgeSourceMenuItemLabel";var i4=a(0x1a02c72b5),i5=a(0xd6a16321),i6=a(0xc4548bcd),i3=a(0x1d600678);let i7=a.p+"ai-step-external-resources-icons-2ccf34e.png",i9=new c.Ay("workflow_builder"),MenuItemLabel=({icon:e,label:t,sourceLabel:a})=>r.createElement("span",{className:iO().knowledgeSourceMenuItemTitleWrap},r.createElement("span",{className:iO().knowledgeSourceMenuItemLeft},r.createElement(p.Ah,{name:e,size:"18"})),r.createElement(a_.A,{lines:1},t),a&&r.createElement("span",{className:iO().knowledgeSourceMenuItemStepIndex},r.createElement(a_.A,{lines:1},a)));MenuItemLabel.displayName="MenuItemLabel";let KnowledgeSourcesCard=({segment:e,workflow:t,onChange:a,configuredParameters:n,inputParameters:i,variables:s})=>{let o=(0,l.wA)(),{openSpeedBump:c,closeSpeedBump:d}=(0,C.qE)(),m=(0,M.d4)(N.kZ),b=(0,M.d4)(N.oI),f=(0,M.d4)(e=>"allow_all"===(0,i3.x)(e,"disable_file_uploads")),g=(0,M.d4)(e=>(0,i3.x)(e,"slack_ai_files_search_opt_out")),_=g?.all_file_opt_out??!1,x=(0,lC.A)({variables:s,callbackId:(0,e5.Dp)(e),isTriggerSegment:!1})??s,{alert:v}=useKnowledgeSourceAlerts({segment:e,workflow:t,configuredParameters:n,variables:x}),E=(0,r.useMemo)(()=>x.list.filter(e=>{let t=e.type===e6.TE.Array?e.items?.type:e.type;return t&&(t===e6.TE.SlackTypesCanvasId||t===e6.TE.SlackTypesListId||t===e6.TE.SlackTypesFileId)&&!e.isDisabled}),[x]),k=i.find(e=>e.name===lA.c.EXTERNAL_RESOURCES),S=i.find(e=>e.name===lA.c.CANVAS_IDS),w=i.find(e=>e.name===lA.c.LIST_IDS),A=(0,r.useMemo)(()=>{let e=i.find(e=>e.name===lA.c.FILE_IDS);if(e)return{...e,is_hidden:!1}},[i]),T=(0,r.useMemo)(()=>n[lA.c.EXTERNAL_RESOURCES]?.value??[],[n]),I=(0,r.useMemo)(()=>{let e=n[lA.c.CANVAS_IDS]?.value??[];return Array.isArray(e)?e:[]},[n]),F=(0,r.useMemo)(()=>{let e=n[lA.c.LIST_IDS]?.value??[];return Array.isArray(e)?e:[]},[n]),O=(0,r.useMemo)(()=>{let e=n[lA.c.FILE_IDS]?.value??[];return"string"==typeof e&&(0,e0.cn)(e)?[e]:Array.isArray(e)?e:[]},[n]),L=(({stepId:e,fetchFunctionAuths:t})=>{let a=(0,aD.Y)(),n=(0,e2.j)(),i=n&&"workflow"in n?(0,e4.Dv)(e,n.workflow):void 0,s=(0,l.wA)(),[o,c]=(0,r.useState)(iQ.r.NOT_STARTED),d=(0,M.d4)(e=>(0,t5.sw)(e,Object.values(ih))),u=(0,r.useMemo)(()=>d.map(e=>e?.id),[d]),m=(0,M.d4)(r8.mh),p=(0,r.useMemo)(()=>Object.values(m).flatMap(e=>e.validTokens).join("-"),[m]),b=(0,iY.A)(p)!==p;(0,r.useEffect)(()=>{let fetchFunctionAuth=async()=>{c(iQ.r.IN_FLIGHT);try{u.forEach(async(t,n)=>{if(t){let r={functionId:t,id:e,inputs:i?.inputs??{}};await s((0,iZ.J)({appId:iy[n],functionId:t,workflowId:a,step:r}))}})}catch{c(iQ.r.ERROR)}finally{c(iQ.r.FINISHED)}};(b||t)&&fetchFunctionAuth()},[u,s,i,a,b,t,e]),(0,r.useEffect)(()=>()=>{s((0,iX.RZ)()),c(iQ.r.NOT_STARTED)},[]);let f=(0,r.useMemo)(()=>e=>(0,iJ.Rp)(e,iy),[]),g=(0,M.d4)(f),h=(0,M.d4)(e=>(0,iA.Aw)(e,iy)),_=(0,r.useMemo)(()=>iy.reduce((e,t)=>{let a=g[t]?.distributionStatus,n=g[t]?.configurationStatus;if(h[t])if(a){let r;e[t]=(r=iw[a])===iE&&n!==ip.aW.READY?iv:r}else e[t]=iE;else e[t]=ik;return e},{}),[g,h]);return(0,r.useMemo)(()=>iy.reduce((e,t)=>{let a=(Object.values(m).find(e=>e.appId===t)?.validTokens??[]).length>0;return o===iQ.r.IN_FLIGHT?e[t]="loading":_[t]===iE?e[t]=a?"connected":"connect":e[t]=_[t],e},{}),[m,_,o])})({stepId:e.id,fetchFunctionAuths:0===T.length}),D=(0,r.useCallback)(e=>{if(e.inputParameter.name===lA.c.EXTERNAL_RESOURCES){let t=i.find(e=>e.name===lA.c.EXTERNAL_RESOURCES);t&&"inputs"in e.configuredParameters&&"function_id"in e.configuredParameters&&"id"in e.configuredParameters&&a(t,[...T.filter(t=>t.id!==e.configuredParameters.id),e.configuredParameters])}else{if("inputs"in e.configuredParameters)return;a(e.inputParameter,e.configuredParameters[e.inputParameter.name]?.value)}},[T,i,a]),P=(0,r.useCallback)(({type:t,appId:a,sourceId:n})=>{let l,i;t===iD?(l=S,i=I):t===iP?(l=w,i=F):t===iR||t===iB?(l=A,i=O):(l=k,i=T),l&&(a&&t===iL&&L[a]===ix?o((0,ap.q)({name:ib,isStackable:!0,element:r.createElement(is.u,{appId:a})})):o((0,ap.q)({name:ib,isStackable:!0,element:r.createElement(KnowledgeSourceFormModal,{inputParameter:l,existingParameters:i,type:t,onSave:D,appId:a,id:n,stepId:e.id})})))},[L,S,I,w,F,A,O,k,T,o,D,e.id]),R=(0,r.useCallback)(e=>()=>{P(e)},[P]),B=(0,r.useCallback)(e=>r.createElement(KnowledgeSourceMenuItemLabel,{provider:e,status:L[e]}),[L]),W=(0,r.useCallback)(e=>{let t=e.type===e6.TE.Array?e.items?.type:e.type;return t===e6.TE.SlackTypesCanvasId?I.some(t=>void 0!==(0,eX.x)([e],t)):t===e6.TE.SlackTypesListId?F.some(t=>void 0!==(0,eX.x)([e],t)):t===e6.TE.SlackTypesFileId&&O.some(t=>void 0!==(0,eX.x)([e],t))},[I,F,O]),V=(0,r.useCallback)(e=>{let t,n,r=e.type===e6.TE.Array?e.items?.type:e.type;if(r===e6.TE.SlackTypesCanvasId)t=S,n=I;else if(r===e6.TE.SlackTypesListId)t=w,n=F;else{if(r!==e6.TE.SlackTypesFileId)return;t=A,n=O}t&&(n.includes(e.id)?a(t,n.filter(t=>t!==e.id)):a(t,[...n,e.id]))},[S,I,w,F,A,O,a]),q=(0,r.useCallback)(e=>()=>{V(e)},[V]),H=(0,r.useCallback)(e=>{let t=b?Object.keys(ih).map(e=>{if(L[e]===ik)return null;let t=L[e]===iv||"config_required"===L[e];return r.createElement(j.Dr,{key:`${e}-${L[e]}`,label:B(e),onSelected:R({type:iL,appId:e}),disabled:t})}):[],a=m?[r.createElement(j.Dr,{key:"canvas-entity",label:r.createElement(MenuItemLabel,{icon:"canvas-content",label:i9.t("Canvas")}),onSelected:R({type:iD}),disabled:!1}),r.createElement(j.Dr,{key:"list-entity",label:r.createElement(MenuItemLabel,{icon:"lists",label:i9.t("List")}),onSelected:R({type:iP}),disabled:!1})]:[];m&&!_&&a.push(r.createElement(j.Dr,{key:"select-file-entity",label:r.createElement(MenuItemLabel,{icon:"file-browser",label:i9.t("Files")}),onSelected:R({type:iR}),disabled:!1})),f&&m&&!_&&a.push(r.createElement(j.Dr,{key:"file-entity",label:r.createElement(MenuItemLabel,{icon:"file-upload",label:m?i9.t("Upload a File"):"Upload a File"}),onSelected:R({type:iB}),disabled:!1}));let n=E.map(e=>r.createElement(j.Dr,{key:`var-${e.id}`,type:il.A.checkbox,checked:W(e),label:r.createElement(MenuItemLabel,{icon:"css",label:e.label,sourceLabel:getSourceLabelForVariable(e,s)}),onSelected:q(e)})),l=n.length>0&&(t.length>0||a.length>0),i=t.length>0&&(n.length>0||a.length>0);return r.createElement(j.Ay,{...e,width:340},a,l&&r.createElement(j.bX,null),n.length>0&&n,i&&r.createElement(j.bX,null),t)},[b,m,R,f,_,E,L,B,W,q,s]),U=(0,r.useMemo)(()=>m?[...I.map(e=>({type:iD,id:e,data:e})),...F.map(e=>({type:iP,id:e,data:e})),...O.map(e=>({type:iR,id:e,data:e})),...T.map(e=>({type:iL,id:e.id,data:e}))]:T.map(e=>({type:iL,id:e.id,data:e})),[m,I,F,O,T]),z=(0,r.useMemo)(()=>T.map(e=>e.function_id),[T]),$=(0,M.d4)(e=>(0,t5.gL)(e,{ids:z})),G=(0,r.useMemo)(()=>{let e={};return T.forEach((t,a)=>{let n=$[a],r=getKnowledgeSourceUrl(t,n);e[t.id]={url:r,appId:n?.app_id??"",functionId:t.function_id}}),e},[T,$]),K=(0,r.useMemo)(()=>U.map(e=>e.id),[U]),Y=(0,r.useCallback)(e=>{c({heading:m?i9.t("Discard changes and open resource?"):"Discard changes and open resource?",message:i9.rt("Your work will not be saved."),onCancel:d,onContinue:()=>{d(),e()},continueButtonLabel:m?i9.t("Discard & Open"):"Discard & Open"})},[c,m,d]),Q=(0,r.useCallback)(e=>{let t=U.find(t=>t.id===e.id);if(t&&!("string"==typeof t.id&&(0,e0.bs)(t.id))){if(t.type===iL){let e=t.data,a=G[e.id];a?.url?(0,i6.A)(a.url):P({type:iL,appId:a?.appId??"",sourceId:e.id});return}t.type===iD&&Y(()=>{o((0,i4.o)((0,i5.mo)({id:t.data}))),o((0,lT.O)())}),t.type===iP&&Y(()=>{o((0,i4.o)((0,i5.st)({listId:t.data}))),o((0,lT.O)())}),t.type===iR&&Y(()=>{o((0,i4.o)((0,i5.EJ)(t.data))),o((0,lT.O)())})}},[U,G,o,P,Y]),Z=(0,r.useCallback)(e=>{let t=U.length;return 1===t?iC.Single:0===e?iC.First:e===t-1?iC.Last:iC.Middle},[U.length]),J=(0,r.useCallback)((t,l)=>{let o=U[t];if(!o)return null;let c=Z(t);return r.createElement(KnowledgeSourceRow,{item:o,variant:c,stepId:e.id,variables:s,params:l,externalResourcesArray:T,configuredParameters:n,inputParameters:i,onChange:a})},[U,Z,e.id,s,T,n,i,a]);return(b||m)&&(!b||m||0!==Object.keys(L).length)?r.createElement("div",{className:"margin_top_100 margin_bottom_100"},r.createElement("div",{className:iO().knowledgeSourcesHeader},r.createElement(y.A,{text:m?i9.t("Files & external sources"):"Files & external sources"}),r.createElement(j.cQ,{renderMenu:H,position:"bottom-right",closeOnSelect:!0},r.createElement(h.$n,{type:"ghost",size:"small","aria-label":m?i9.t("Add a Source"):"Add a Source"},r.createElement("span",{className:"margin_right_25"},r.createElement(p.Ah,{name:"plus"})),m?i9.t("Add a Source"):"Add a Source"))),v&&r.createElement(u.Ay,{id:ig,level:"error"===v.level?u.A_.error:u.A_.warning,className:"margin_bottom_100"},v.text),0===U.length?r.createElement("div",{className:iO().emptyStateContainer},r.createElement("p",{className:iO().emptyStateText},r.createElement("strong",null,m?i9.t("Add files, canvases, lists, or connected sources (Google Drive, Confluence, etc.) the AI can reference"):"Add files, canvases, lists, or connected sources (Google Drive, Confluence, etc.) the AI can reference")),r.createElement("img",{src:i7,className:iO().emptyStateImage,alt:""})):r.createElement("div",{className:iO().knowledgeSourcesList},r.createElement(lk.A,{disableHeight:!0},({width:e})=>r.createElement(ii.A,{width:e,height:62*U.length,keys:K,onItemClick:Q,rowRenderer:J})))):null};KnowledgeSourcesCard.displayName="KnowledgeSourcesCard";let se=new c.Ay("workflow_builder"),AiStepRightPanel=({segment:e,workflow:t,testDisabled:a,configuredParameters:n,nonPromptSlackFunctionParameters:l,onChange:i,variables:o,formatVariableBeforeInsert:c,callbackId:d})=>{let m=(0,M.d4)(N.kZ),b=(0,M.d4)(N.dI),f=(0,nR.A)(),[g,_]=(0,r.useState)(!0),[y,x]=(0,r.useState)(!1),[v,E]=(0,r.useState)(k.A),S=(0,r.useCallback)((e,t)=>{let a=t??!y;x(a),a&&_(!1)},[y,_]),w=(0,r.useMemo)(()=>m?l.filter(e=>e.name!==lA.c.EXTERNAL_RESOURCES&&e.name!==lA.c.CANVAS_IDS&&e.name!==lA.c.LIST_IDS&&e.name!==lA.c.FILE_IDS):l,[m,l]),C=(0,r.useCallback)((e,t)=>{let a=t??!g;_(a),a&&S(void 0,!1)},[g,S]),A=(0,r.useMemo)(()=>({...e,config:{...e.config,inputs:n}}),[e,n]),T=(0,r.useCallback)(e=>{e.stopPropagation(),(0,aE.K$)({clogger:f,uiArgs:{step:tK.UiStep.WORKFLOWS_AI_STEP_DEFAULT_MODAL},uiProperties:{element_name:aE.KC.AiStepTestRun}}),S(void 0,!0),E((0,k.A)())},[f,S,E]);return r.createElement("div",{className:lN().aiStepRightPanel},r.createElement("div",{className:s()(lN().sectionContainer,lN().contentSourcesContainer,{[lN().expanded]:g})},r.createElement("div",{className:lN().sectionHeader},r.createElement(h.Nm,{onClick:C,className:lN().sectionHeaderContent,"aria-expanded":g,"aria-controls":"context-sources-content"},r.createElement(p.Ah,{name:g?"caret-down-full":"caret-up-full"}),r.createElement("div",{id:"context-sources-header-text",className:lN().sectionHeaderText},b?se.t("Context sources"):"Context sources"))),r.createElement(tw.$m,{"aria-labelledby":"context-sources-header-text",id:"context-sources-content"},r.createElement("div",{className:lN().contentSourcesContent},w&&w.length>0&&r.createElement(aj.v,{inputParameters:w,configuredParameters:n,onChange:i,variables:o,formatVariableBeforeInsert:c,callbackId:d,stepId:e.id,oAuthParameter:void 0}),r.createElement(KnowledgeSourcesCard,{segment:e,workflow:t,onChange:i,configuredParameters:n,inputParameters:l,variables:o}),r.createElement(u.Ay,{level:u.A_.info},b?se.t("Links included in the prompt or additional context will not be crawled or used to generate responses."):"Links included in the prompt or additional context will not be crawled or used to generate responses.")))),r.createElement("div",{className:s()(lN().sectionContainer,lN().testPromptContainer,{[lN().expanded]:y})},r.createElement("div",{className:lN().sectionHeader},r.createElement(h.Nm,{onClick:S,className:lN().sectionHeaderContent,"aria-expanded":y,"aria-controls":"simulate-prompt-output-content"},r.createElement(p.Ah,{name:y?"caret-down-full":"caret-up-full"}),r.createElement("div",{id:"simulate-prompt-output-header-text",className:lN().sectionHeaderText},b?se.t("Simulate prompt output"):"Simulate prompt output")),r.createElement(t7.Ay,{className:lN().sectionHeaderButton,onClick:T,disabled:a,type:"outline",size:"small"},r.createElement(p.Ah,{name:"ai-sparkle"}),se.t("Run"))),r.createElement(TestPromptPanel,{segment:A,workflow:t,disabled:a,testKey:v})))};AiStepRightPanel.displayName="AiStepRightPanel";let st=new c.Ay("workflow_builder"),AiStepDefaultModal=({title:e,onClose:t,icon:a,segment:n,onSave:i,workflow:o,speedBumpContext:c,saving:d=!1,saveError:u=null,renderSaveError:m,isExistingSegment:p=!1,isSegmentModified:b=!1,onNavigateBack:f})=>{let _=(0,M.d4)(N.dI),y=(0,e8.EM)(n),x=(0,e5.Dp)(n),v=(0,l.wA)(),{showSpeedBump:E}=(0,ae.k)(),{speedBumpState:S}=c,[w,T]=(0,r.useState)(k.A),F=(0,r.useCallback)(()=>{T((0,k.A)())},[]),{isValid:O=!1}=(0,C.Qk)(),[,L]=(0,r.useState)("0"),{onSubmit:D,shouldEnableSaveForInitialSubmit:P,hasBlockingError:R}=(0,I.b)(L),B=(0,e5.ln)(n),W=(0,r.useMemo)(()=>B?.map(e=>(0,eU.w)(e))||[],[B]),V=W?.find(e=>e.name===lA.c.PROMPT),q=W?.filter(e=>e.name!==lA.c.PROMPT),{configuredParameters:H,formatVariableBeforeInsert:U,onChange:z}=(({segment:e,variables:t,inputParameters:a,slackFunction:n})=>{let l=(0,C.rC)(),i=(0,M.d4)(N.$T),s=(0,r.useMemo)(()=>{let t={};return(0,ty.q2)(e)?n?(0,ty.Jl)(e,n,i):t:(a&&0!==a.length&&a.forEach(a=>{let n=(0,e5.RE)(e,a.name);n&&(t[a.name]=n)}),t)},[i,a,e,n]),o=(0,r.useCallback)((e,t)=>{let{source:a,sourceReference:r}=e;return("trigger"===a&&r&&l((0,A.aI)({value:r})),t?.skipMacro)?e:(0,e3.Xq)(e,{fromRichText:t?.isRichText,appId:n?.app_id,parameterType:t?.parameterType,stepId:n?.id,callbackId:n?.callback_id})},[n?.app_id,n?.id,n?.callback_id,l]),c=(0,r.useCallback)(e=>{let a=[],fillRequiredContextRecursively=(e,n,r=0)=>{r>=n||(e&&"object"==typeof e?Object.values(e):[e]).forEach(e=>{if("string"==typeof e&&(0,e0.cn)(e)){let n=(0,eX.x)(t.list,e);if(!n)return;"trigger"===n.source&&n.sourceReference&&a.push(n.sourceReference)}null!==e&&"object"==typeof e&&fillRequiredContextRecursively(e,n,r+1)})};fillRequiredContextRecursively(e,10),l((0,A.aI)({value:a}))},[l,t.list]);return{configuredParameters:s,formatVariableBeforeInsert:o,onChange:(0,r.useCallback)((e,t,a,n)=>{c(t),n?.dynamicInputState&&l((0,t$.T)({[e.name]:n.dynamicInputState})),l((0,t$.qq)({parameter:e,value:t,label:a,options:n,experimentThirdPartyUserFormParityGroupOn:i}))},[l,i,c])}})({segment:n,variables:y,inputParameters:B,slackFunction:(0,e5.P)(n)}),{hasError:j}=useKnowledgeSourceAlerts({segment:n,workflow:o,configuredParameters:H,variables:y}),$=(0,r.useMemo)(()=>{let e=b||!p,t=!d&&!R&&e&&O;return P||t},[d,R,O,p,b,P]),G=(0,r.useCallback)(()=>{!j&&(!O||P||d||i(),P&&D())},[j,O,P,d,i,D]);(0,r.useEffect)(()=>{E(S.isVisible??!1)},[S.isVisible,E]);let K=(0,r.useCallback)(()=>r.createElement(tw.ty,{heading:S.heading,cancelButtonLabel:S.cancelButtonLabel,continueButtonLabel:S.continueButtonLabel,continueButtonIsDisabled:S.continueButtonIsDisabled,continueButtonIsLoading:d,continueButtonType:S.continueButtonType,onCancel:S.onCancel,onContinue:S.onContinue,description:S.message}),[S.cancelButtonLabel,S.continueButtonIsDisabled,S.continueButtonLabel,S.continueButtonType,S.heading,S.message,S.onCancel,S.onContinue,d]),Y=(0,r.useMemo)(()=>V?.type===e6.HN.SlackTypesRichText?V:void 0,[V]),Q=(0,r.useMemo)(()=>r.createElement(AiPromptEditorModal,{parameter:Y,value:H[lA.c.PROMPT]?.value||g.Ml,onChange:z,variables:y,formatVariableBeforeInsert:U,parameters:W,configuredParameters:H,callbackId:x,experimentWfbAiAnswerStepGroupOn:_,onClose:F,allowVariables:!0,workflowId:o.workflow.id,segment:n}),[Y,H,z,y,U,W,x,_,F,o.workflow.id,n]),Z=(0,r.useCallback)(()=>{V&&Y&&v((0,ap.q)({element:Q,isStackable:!0}))},[V,Y,v,Q]),J=(0,r.useCallback)(()=>{f?.()},[f]),X=(0,r.useMemo)(()=>({segment:n,enableExpandCollapsePromptButton:!0,onExpandCollapsePromptClick:Z,onCollapsePromptClick:F,enablePromptToolsButton:!0,isPromptExpanded:!1}),[n,Z,F]);return r.createElement(r.Fragment,null,r.createElement(tw.rQ,null,f&&r.createElement(ai.E,{workflowId:o.workflow.id,onNavigateBack:J,isSegmentModal:!0}),r.createElement(tw.Rc,null,r.createElement("div",{className:s()(lN().modalTitleBarContentContainer,{[lN().hasNoBackButton]:!f})},r.createElement("div",{className:lN().modalTitleBarContentLeft},a,r.createElement("h1",{className:lN().modalTitleText},e))))),r.createElement("div",{className:lN().modalContent},r.createElement(FillParentContainer,null,r.createElement("div",{className:lN().inputParametersWrapper},r.createElement("div",{className:lN().promptInputWrapper},V&&Y&&r.createElement(CustomPromptInput,{key:w,labelClassName:lN().promptLabel,parameter:Y,value:H[lA.c.PROMPT]?.value||g.Ml,onChange:z,variables:y,formatVariableBeforeInsert:U,parameters:W,configuredParameters:H,callbackId:x,allowVariables:!0,required:Y.is_required,experimentWfbAiAnswerStepGroupOn:_,wfbAiPromptButtons:X}),u&&m&&r.createElement(tB.A,null,m(u))),r.createElement(AiStepRightPanel,{segment:n,workflow:o,testDisabled:d||R||!O||j,configuredParameters:H,nonPromptSlackFunctionParameters:q,onChange:z,variables:y,formatVariableBeforeInsert:U,callbackId:x})))),r.createElement(tw.jl,{renderSpeedBump:K},r.createElement(tw.ox,null,r.createElement(h.Ay,{type:"outline",onClick:t,disabled:d,"aria-label":st.t("Cancel")},st.t("Cancel")),r.createElement(h.lV,{type:"primary",loading:d,disabled:j||!$,"aria-describedby":j?ig:void 0,onClick:G,"aria-label":st.t("Save")},st.t("Save")))))};AiStepDefaultModal.displayName="AiStepDefaultModal";var sa=a(0x1f355b555),sn=a(0x62eaf10),sr=a.n(sn);let loading_skeleton_LoadingSkeleton=()=>r.createElement(tw.qf,null,r.createElement("div",{"data-qa":"button-add-edit-modal-loading-skeleton",className:sr().loadingSkeleton},r.createElement("div",{className:sr().loadingContainer},r.createElement(eR.A,{width:"100%",height:140,borderRadius:4}),r.createElement("div",{className:sr().label},r.createElement(eR.A,{width:"25%",height:22,borderRadius:4})),r.createElement("div",{className:"display_flex flex_direction_row gap_50"},r.createElement(eR.A,{width:"75%",height:36,borderRadius:4}),r.createElement(eR.A,{width:"25%",height:36,borderRadius:4})),r.createElement("div",{className:sr().label},r.createElement(eR.A,{width:"25%",height:22,borderRadius:4})),r.createElement(eR.A,{width:"100%",height:36,borderRadius:4}),r.createElement("div",{className:sr().label},r.createElement("div",{className:sr().checkbox},r.createElement(eR.A,{width:"25%",height:36,borderRadius:4}),r.createElement(eR.A,{width:"25%",height:36,borderRadius:4}))),r.createElement("div",{className:sr().label},r.createElement(eR.A,{width:"100%",height:6,borderRadius:4})))));loading_skeleton_LoadingSkeleton.displayName="LoadingSkeleton";var sl=a(0xc70ec6a6),si=a.n(sl);let ss=new c.Ay("workflow_builder"),button_color_ButtonColorOptionLabel=({buttonStyle:e})=>r.createElement("div",{className:s()(si().optionLabelColor,si()[`optionLabelColor__${e}`])},r.createElement("span",{className:"offscreen"},{primary:ss.t("Primary (green)",{fallbackHash:"ba144ea01fa9962c0dbe1fe6c4c113d0063fa55f"}),outline:ss.t("Outline"),danger:ss.t("Danger (red)",{fallbackHash:"f99914a1464040a7af118f93747699cf8566efa3"})}[e]),r.createElement(p.Ah,{name:"formatting"}));button_color_ButtonColorOptionLabel.displayName="ButtonColorOptionLabel";let button_color_ButtonColor=({buttonStyle:e,handleChange:t})=>{let a=(0,r.useMemo)(()=>[{label:r.createElement(button_color_ButtonColorOptionLabel,{buttonStyle:"outline"}),value:"outline"},{label:r.createElement(button_color_ButtonColorOptionLabel,{buttonStyle:"primary"}),value:"primary"},{label:r.createElement(button_color_ButtonColorOptionLabel,{buttonStyle:"danger"}),value:"danger"}],[]),n=(0,r.useMemo)(()=>a.find(t=>t.value===(e??"outline")),[e,a]),l=(0,r.useCallback)(({value:e})=>{t("outline"===e?void 0:e)},[t]);return r.createElement(y.A,{"data-qa":"send-message-button-color",htmlFor:"send-message-button-color",text:ss.t("Color"),"aria-label":ss.t("Button Color",{fallbackHash:"1d0c8304baedcf8e3a78982c2e7c0b04622bf2a0",fallbackHashNs:"lists"}),className:""},r.createElement(ef.Ay,{options:a,width:"100",onOptionSelected:l,selectedOption:n}))};button_color_ButtonColor.displayName="ButtonColor";var so=a(0x234aee340),sc=a.n(so);let sd=new c.Ay("workflow_builder"),ButtonConfigurations=({button:e,variables:t,onChange:a,onTypeChange:n,onBehaviourChange:l,formatVariableBeforeInsert:i,multipleContinueButtonsExist:s,continueButtonExists:o,hasDuplicateContinueLabel:c,isNestedStep:d})=>{let u=(0,r.useCallback)(t=>{a({text:{...e.text,text:t}})},[a,e]),m=(0,r.useCallback)(e=>l(e),[l]),p=(0,r.useCallback)(e=>n(e),[n]),b=(0,r.useCallback)(e=>a({style:e}),[a]),f=(0,r.useMemo)(()=>c?sd.t("Please choose a different label, this one already exists."):"",[c]),g=sd.t("Example: Continue");return r.createElement("div",{className:"padding_bottom_100"},r.createElement("div",{className:sc().buttonDisplayContainer},r.createElement("div",{className:sc().buttonLabel},r.createElement(y.A,{htmlFor:"message_button_label_input",text:sd.t("Button label"),id:"message_button_label_label"}),r.createElement(tt.A,{autoFocus:!0,"data-qa":"send-message-button-text",isRequired:!0,name:"message_button_label_input",id:"message_button_label_input","aria-labelledby":"message_button_label_label",value:e?.text.text,placeholder:e?.text.text||g,onChange:u,maxCharacterLimit:n$.c$,minCharacterLimit:n$.CL,errorText:f,autoComplete:"off",useInlineAlert:!0})),r.createElement(button_color_ButtonColor,{handleChange:b,buttonStyle:e?.style})),r.createElement(ButtonConfiguration,{handleChange:m,handleTypeChange:p,button:e,variables:t,formatVariableBeforeInsert:i,continueButtonExists:o,multipleContinueButtonsExist:s,isNestedStep:d}))};ButtonConfigurations.displayName="ButtonConfigurations";var su=a(0x93d35cfe),sm=a(0x19a0423f0),sp=a.n(sm);let sb=new c.Ay("workflow_builder"),ButtonsPreview=({variables:e,buttons:t})=>{let a=sb.t("This is a preview of how your button looks in a message!"),n=(0,r.useMemo)(()=>(0,nd.hH)(t,a),[t,a]),l=(0,e2.j)(),i=(0,r.useMemo)(()=>(0,e4.BQ)(l),[l]),s=(0,r.useMemo)(()=>(0,e4.DU)(l),[l]),o=(0,r.useMemo)(()=>(0,e4.DY)(l),[l]);return r.createElement("div",{className:sp().previewContainer},r.createElement(nc.X,{noPointerEvents:!0,isInert:!0},r.createElement(su.Y,{blocks:n,dataList:e.list,workflowName:i,workflowIcon:s,workflowId:o})))};ButtonsPreview.displayName="ButtonsPreview";var sf=a(0x1ad596f5f),sg=a(0x6b359530),sh=a(0x235d78b7c),s_=a(0x88881d67),sy=a(0xf33a4f91),sx=a(0x1ba35eb3b),sv=a(0x4b32db5f),sE=a(0x10d53599f),sk=a(0x213c0555e),sS=a(0x19dc73101),sw=a(0x4f725d55),sC=a(0xd2fa49d0),sA=a(0xdcfa8f6a),sT=a.n(sA),sI=a(0x2310bfb55),sN=a.n(sI);let sM=new c.Ay("workflow_builder"),AllowedEntitiesConfigurationInput=({value:e,onChange:t,variables:a,formatVariableBeforeInsert:n})=>{let l=(0,E.A)(),[i,o]=(0,r.useState)(!!e),c=(0,r.useCallback)(()=>{t(i?void 0:{member_ids:[]}),o(!i)},[i,t]),d=sM.t("Select users"),{onVariableMenuOpen:u}=(0,nt.e)(),m=(0,r.useMemo)(()=>(0,af.A)(e?.member_ids)?[{id:"member_ids_is_required",message:sM.t("This field is required.")}]:[],[e]),{onBlur:p,okayToDisplay:b}=(0,I.K)({errorMessage:void 0,isErrored:m.length>0}),f=(0,r.useMemo)(()=>"string"==typeof e?.member_ids?[e?.member_ids]:e?.member_ids,[e?.member_ids]),[g,h]=(0,r.useState)(f),_=(0,r.useCallback)(e=>(p(),t({member_ids:e})),[p,t]),x=(0,r.useCallback)(e=>{if((0,e0.cn)(e)){let t=(0,eX.x)(a.list,e);return!!t&&t.isAvailable&&!t.isTombstone&&t.type===e6.TE.Array}return!1},[a]),v=(0,r.useCallback)(e=>{let t=e.map(e=>e.value),a=t;return h(t),t.some(e=>x(e))&&(a=1===t.length?t[0]:t.filter(e=>!(0,e0.cn)(e)||!x(e))),_(a)},[_,x]),k=(0,r.useCallback)((e,t)=>{let n=`${t}-${e}`,r=!1,l="string"==typeof e?e:String(e);if("string"==typeof e&&(0,e0.cn)(e)){let t=(0,eX.x)(a.list,e);if(!t)return{key:n,label:sM.t("Missing Data"),isError:!1,svgIcon:{name:"css"},value:e};if(l=t.label||l,r=!t.isAvailable||t.isTombstone,t.type===e6.TE.Array){let e=!!g&&g.length>1;l=sM.t("{selectedDataLabel} (multiple)",{selectedDataLabel:t.label}),r=r||e}return{key:n,label:l,svgIcon:{name:"css"},value:t.id,isError:r}}return{key:n,label:l,value:e,isError:r}},[a.list,g]),S=(0,r.useMemo)(()=>"object"==typeof g?g?.map(k):"string"==typeof e?.member_ids?[k(e?.member_ids,0)]:e?.member_ids.map(k),[k,e?.member_ids,g]),w=(0,r.useCallback)(e=>"array"===e.type?!e.items||"slack#/types/mixed"===e.items.type||(0,sx.WL)(e.items)||(0,sx.kv)(e.items):(0,sx.WL)(e)||(0,sx.kv)(e),[]),C=(0,r.useMemo)(()=>(0,s_.PW)(a.groups,w),[w,a.groups]),A=(0,r.useMemo)(()=>(0,sv.T)(C),[C]),T=(0,r.useCallback)(a=>{let r=n?.(a,{}).id??"",l=Array.from(e?.member_ids||[]),i=[...l,r];return l=Array.from(g||[]),i=a.type===e6.TE.Array?r:i,h([...l,r]),t({member_ids:i})},[n,e?.member_ids,t,g]),N=(0,r.useCallback)(e=>"string"==typeof e.value&&(0,sw.A)(e.value)?r.createElement(sE.A,{id:e.value,showAvatar:!0}):"string"==typeof e.value&&(0,sC.A)(e.value)?r.createElement(sk.A,{id:e.value,showDescription:!1}):e.data&&e.data.label?r.createElement(sg.R,{data:e.data}):e.label,[]),M=(0,r.useCallback)((e,t)=>{let a=[],n=(0,sf.A)(A,t);return n.length>0&&a.push(...n),e.length>0&&a.push(...e),lP.S.resolve(a)},[A]),F=(0,r.useMemo)(()=>{let e=sy.R_;return{...{...e,entities:{...e.entities,userGroups:{includeFromAnotherTeam:!0}}},filter:()=>!0}},[]),O=(0,r.useMemo)(()=>r.createElement(sS.h,{id:l,onSelectedItemsChange:v,placeholderText:d,renderOption:N,searcherOptions:F,selectedOptions:S,selectId:l,width:"100%",className:s()(sT().entity),isInvalid:b&&m.length>0,processOptions:M,errors:b?m:void 0,allowVariables:!0,expandOnFocus:!0,onBlur:p,isRequired:!0}),[l,m,b,p,v,M,N,F,S,d]),L=sM.t("Restrict to specific users"),D=r.createElement("span",{"aria-hidden":!0},sM.t("Only certain users can click the button")),P=r.createElement("span",{className:"offscreen",id:"button_user_acl-description"},sM.t("Only certain users can click the button"));return r.createElement("div",{className:"margin_bottom_100"},r.createElement(y.A,{htmlFor:"button_user_acl_label",className:nk().switch_container,type:"inline",text:L,subtext:D},P,r.createElement(nx.A,{isToggled:i,onChange:c,ariaLabel:L,ariaDescribedBy:"button_user_acl-description"})),i&&r.createElement("div",{className:"display_flex","data-qa":"array-input"},r.createElement("div",{className:sN().inline_width},O),r.createElement(sh.jx,{onSelect:T,data:a.groups,customDataFilter:w,renderIconInline:!0,onMenuTriggerClick:u,className:sN().dynamicDataMenuButton})))};AllowedEntitiesConfigurationInput.displayName="AllowedEntitiesConfigurationInput";var sF=a(0x1b1820b2c),sO=a(0x380ee7b0);let sL="RELATIVE",sD="FIXED",sP=new c.Ay("workflow_builder"),ButtonExpiryTimestampInput=({value:e,onChange:t,variables:a,isButtonExpired:n,formatVariableBeforeInsert:l})=>{let i=(0,E.A)(),s=(0,E.A)(),{viewOnly:o,onVariableMenuOpen:c}=(0,nt.e)(),[d,u]=(0,r.useState)(!!e),m=(0,r.useMemo)(()=>e&&(0,e$.r2)(a.list,String(e.timestamp)),[e,a.list]),p=a.list.find(e=>"event_timestamp"===e.name),b=(0,r.useCallback)(()=>{!0===d?t(void 0):t({type:sL,timestamp:p?.id||(0,sa.Ay)().unix(),after_days:30}),u(!d)},[d,t,p]),f=(0,r.useCallback)(({target:a})=>{let{value:n}=a,r=p&&n===sL?p.id:(0,sa.Ay)().unix();e&&t({...e,timestamp:r,type:n,after_days:n===sL?e.after_days??30:void 0})},[e,t,p]),g=(0,r.useCallback)(a=>{let n=l?.(a,{isRichText:!1,skipMacro:!0}).id??a.id;if(e)return t({...e,timestamp:n})},[l,e,t]),h=(0,r.useCallback)(a=>{if(e)return t({...e,timestamp:parseInt(a,10)||(0,sa.Ay)().unix()})},[t,e]),_=(0,r.useCallback)(e=>(0,sx.p0)(e),[]),x=(0,r.useCallback)(a=>{if(e)return t({...e,after_days:e?.type===sL?Number(a):void 0})},[t,e]),renderDatetimeInput=()=>r.createElement(r.Fragment,null,m?r.createElement("div",{className:nk().variableContainer},r.createElement(sO.P,{onChange:h,value:String(e?.timestamp??""),variables:a,customDataFilter:_,label:"button-expiry-timestamp",isDisabled:o,formatVariableBeforeInsert:l,parameterType:e6.TE.SlackTypesTimestamp})):r.createElement("div",{className:nk().timestampWrapper},r.createElement(sF.A,{id:i,className:nk().timestampInlineDateTimePicker,onChange:h,valueFormat:"X",value:String(e?.timestamp??""),"aria-label":"button-expiry-timestamp",isRequired:!0,showTimeZone:!1,disabled:o,isInvalid:n}),r.createElement(sh.jx,{onSelect:g,data:a.groups,customDataFilter:_,renderIconInline:!0,isDisabled:o,onMenuTriggerClick:c}))),v=sP.t("Expires"),k=r.createElement("span",{"aria-hidden":!0},sP.t("Disable button on a certain date")),S=r.createElement("span",{className:"offscreen",id:"button_expires-description"},sP.t("Disable button on a certain date"));return r.createElement(r.Fragment,null,r.createElement(y.A,{htmlFor:"button_expires_label",className:nk().switch_container,type:"inline",text:v,subtext:k},S,r.createElement(nx.A,{isToggled:d,onChange:b,ariaLabel:v,ariaDescribedBy:"button_expires-description"})),d&&r.createElement(tJ.A,{className:"margin_bottom_100","data-qa":""},r.createElement(y.A,{className:"margin_top_25",text:sP.t("Days after a certain date"),type:"inline",cursor:"pointer"},r.createElement(t2.A,{checked:e?.type===sL,onChange:f,"data-qa":"button-expiry-relative",value:sL})),e?.type===sL&&r.createElement("div",{className:nk().relativeExpiryContainer},r.createElement("div",{className:nk().afterDaysContainer},r.createElement(tt.A,{id:s,min:1,max:365,name:"after_days",value:e?.after_days??1,onChange:x,type:"number",placeholder:"Days",className:nk().afterDays,suffix:e?.after_days===1?"day":"days"}),r.createElement("span",{className:"margin_left_50"},sP.t("after"))),renderDatetimeInput()),r.createElement(y.A,{text:sP.t("On a certain date"),type:"inline",cursor:"pointer"},r.createElement(t2.A,{checked:e?.type===sD,onChange:f,"data-qa":"button-expiry-fixed",value:sD})),e?.type===sD&&renderDatetimeInput()))};ButtonExpiryTimestampInput.displayName="ButtonExpiryTimestampInput";let InteractivityConfiguration=({interactivityConfig:e={is_button_multi_click:!1,expiry:void 0,allowed_entities:void 0},onChange:t,variables:a,formatVariableBeforeInsert:n,isButtonExpired:l})=>{let i=e?.allowed_entities,s=e?.expiry,o=(0,r.useCallback)(a=>t({...e,allowed_entities:a}),[t,e]),c=(0,r.useCallback)(a=>t({...e,expiry:a?{...e.expiry,...a}:void 0}),[t,e]);return r.createElement(r.Fragment,null,r.createElement(AllowedEntitiesConfigurationInput,{value:i,onChange:o,variables:a,formatVariableBeforeInsert:n}),r.createElement(ButtonExpiryTimestampInput,{value:s,onChange:c,variables:a,formatVariableBeforeInsert:n,isButtonExpired:l}))};InteractivityConfiguration.displayName="InteractivityConfiguration";let sR=new c.Ay("workflow_builder"),ButtonClickTypeConfiguration=({isMultiClick:e,isMutuallyExclusive:t,onChange:a})=>{let n=(0,r.useCallback)(()=>a({is_button_multi_click:!e}),[a,e]),l=sR.t("Single-click"),i=r.createElement("span",{"aria-hidden":!0},sR.t("Button can only be clicked once")),s=r.createElement("span",{className:"offscreen",id:"button_click_type-description"},sR.t("Button can only be clicked once"));return r.createElement("div",{className:"margin_top_50 margin_bottom_100"},r.createElement(y.A,{htmlFor:"button_click_type_label",className:nk().switch_container,type:"inline",text:sR.t("Single-click"),subtext:i},s,r.createElement(nx.A,{isToggled:!e,onChange:n,ariaLabel:l,isDisabled:t,ariaDescribedBy:"button_click_type-description"})))};ButtonClickTypeConfiguration.displayName="ButtonClickTypeConfiguration";let sB=new c.Ay("workflow_builder"),ButtonsAddEditModal=({buttonIndex:e=-1,operation:t,segment:a,switchPane:n,formatVariableBeforeInsert:l,onChange:i,afterStepId:s,isExistingSegment:o})=>{let[c,d]=(0,r.useState)(!1),u=(0,e8.EM)(a),m=((0,e5.RE)(a,nv.z.INTERACTIVE_BLOCKS)?.value??[]).find(e=>"actions"===e.type),b=(0,r.useMemo)(()=>m?.elements||[],[m?.elements]),f=(0,r.useMemo)(()=>(0,e5.RE)(a,nv.z.INTERACTIVITY_CONFIGURATION)?.value||{},[a]),g=(0,e2.j)(),_=(0,e4.W0)(o?a.id:s,g),y=b[e],v=f?.actions?.[y?.action_id],[E,k]=(0,r.useState)(y),[S,w]=(0,r.useState)(v),C=b.map((t,a)=>e===a?E:t),A=S?.is_button_multi_click??!1,T=S?.is_mutually_exclusive??!1,{speedBumpState:I,closeSpeedBump:N,openSpeedBump:M}=(0,tS.v)(),[F,O]=(0,r.useState)("edit"===t),L=(0,r.useCallback)(()=>{n&&n(tg.k.DEFAULT)},[n]),D=!(E&&"url"in E||E?.type==="workflow_button"),P=(0,r.useCallback)(()=>{if(!D){let e={actions:{...f.actions,[E?.action_id]:{is_button_multi_click:!0}}};i&&i(C,e)}O(!F)},[F,O,D,E,f,i,C]),R=(0,r.useCallback)(()=>{let e={actions:{...f.actions,[E?.action_id]:S}};i&&i(C,e)},[E,i,C,S,f]),B=(0,r.useCallback)(()=>{let t=b.filter((t,a)=>a!==e),a={actions:(0,nl.A)(f.actions,E?.action_id)};i&&i(t,a)},[f,E,i,b,e]),W=(0,r.useCallback)(e=>{k({...E,...e,text:{...E?.text,...e?.text}})},[E,k]),V=(0,r.useCallback)(e=>{let t={...E};switch(e){case"workflow_button":t.type=e,"value"in t&&delete t.value,"url"in t&&delete t.url;break;case"link":t.type="button",t.url="",delete t.workflow,"value"in t&&delete t.value;break;default:t.type=e,t.value="button","url"in t&&delete t.url}k(t);let a={...S,is_mutually_exclusive:T,is_button_multi_click:A};if((0,nd.O0)(t)&&!(0,nd.O0)(E)){let e=Object.values(f.actions||{}).some(e=>e.is_mutually_exclusive);a.is_mutually_exclusive=e,a.is_button_multi_click=!e&&A}w(a)},[E,k,f,A,T,S]),q=(0,r.useCallback)(e=>{w({...S,...e})},[S,w]),H=(0,r.useMemo)(()=>{let e=S?.expiry;if("number"!=typeof e?.timestamp)return!1;if(e?.type===sD)return e?.timestamp<(0,sa.Ay)().unix();let t=e?.after_days??1;return(e?.timestamp??0)+24*t*3600<(0,sa.Ay)().unix()},[S]),U=(0,r.useMemo)(()=>(0,nw.P6)(C),[C]),z=(0,r.useMemo)(()=>{let e=E?.text.text.length>n$.c$||E?.text.text.length<n$.CL,t=!!E&&"url"in E&&!(0,nB.A)(E.url),a=E?.type==="workflow_button"&&!E.workflow?.trigger?.url,n=!!S?.allowed_entities&&(0,af.A)(S?.allowed_entities?.member_ids),r=!!S?.expiry&&!S?.expiry?.timestamp;return e||a||t||n||r||H||U},[E,S,H,U]),j=(0,r.useCallback)(()=>{(0,rm.A)(y,E)&&(0,rm.A)(v,S)&&!z&&"add"!==t?L():M()},[y,E,v,S,M,L,t,z]),$=(0,r.useCallback)(()=>{(0,rm.A)(y,E)&&(0,rm.A)(v,S)||R(),L()},[y,E,v,S,R,L]),G=(0,r.useCallback)(()=>{let e="primary";switch(y&&y.style){case"primary":e="danger";break;case"danger":e=void 0}let t=(0,nw.OK)(!1,"",e),a=(0,nd.A6)(t.action_id,"callbackId",{actions:{...f.actions,[y.action_id]:S}},T);i?.([...C,t],a),t&&t?.action_id&&(k(t),w(a.actions[t?.action_id]),O(!1)),d(!0),n?.(tg.k.INTERACTIVE_BLOCKS_ADD_EDIT,{buttonIndex:b.length,formatVariableBeforeInsert:l,onChange:i}),setTimeout(()=>{d(!1)},300)},[y,S,C,f.actions,T,i,n,b.length,l]),K=(0,r.useCallback)(()=>{N()},[N]),Y=(0,r.useCallback)(()=>{"add"===t&&B(),L()},[B,t,L]),Q=(0,r.useMemo)(()=>r.createElement(x.A,{onClick:j,"aria-label":sB.t("Back")},r.createElement(p.Ah,{name:"caret-left-full",size:"20"})),[j]);(0,tk.M)("keyup",e=>{e.key===tC.D.ESCAPE&&j()});let Z=sB.t("Hide advanced options"),J=sB.t("Advanced options"),X=sB.t("Edit button"),ee=sB.t("Add button"),et="edit"===t?X:ee,ea=(0,nd.AI)(b),en=(0,nd.fd)(b);return r.createElement(r.Fragment,null,r.createElement(tw.rQ,null,r.createElement(tw.Rc,{title:et,icon:Q})),r.createElement(tw.$m,{className:"c-buttons-add-edit-modal__content"},c?r.createElement(loading_skeleton_LoadingSkeleton,null):r.createElement(r.Fragment,null,r.createElement(ButtonsPreview,{variables:u,buttons:C}),r.createElement(tw.qf,null,r.createElement(ButtonConfigurations,{button:E,variables:u,onChange:W,onTypeChange:V,onBehaviourChange:W,formatVariableBeforeInsert:l,multipleContinueButtonsExist:en,continueButtonExists:ea,hasDuplicateContinueLabel:U,isNestedStep:_}),D&&r.createElement(ButtonClickTypeConfiguration,{isMultiClick:A,isMutuallyExclusive:T,onChange:q})),D&&r.createElement(tw.qf,null,r.createElement(h.Nm,{"data-qa":"advanced-options",onClick:P,className:sr().advancedOptions,id:"advanced-options-disclosure-control","aria-label":J,"aria-expanded":F},r.createElement("span",{className:sr().advancedOptionsLabel},F?Z:J),r.createElement("hr",{"aria-hidden":!0,className:sr().hr})),F&&r.createElement("div",{role:"group","aria-labelledby":"advanced-options-disclosure-control",hidden:!F},r.createElement(InteractivityConfiguration,{interactivityConfig:S,onChange:q,variables:u,isButtonExpired:H,formatVariableBeforeInsert:l}))))),I.isVisible?r.createElement(tw.ty,{heading:sB.t("Discard changes?"),description:sB.t("Your changes will not be saved."),cancelButtonLabel:sB.t("Keep Editing"),continueButtonLabel:sB.t("Close and Discard"),onCancel:K,onContinue:Y}):r.createElement(tw.jl,null,r.createElement(h.Ay,{type:"outline",onClick:G,disabled:z||b.length>=5},sB.t("Add Another Button")),r.createElement(tw.ox,null,r.createElement(h.Ay,{type:"primary",onClick:$,disabled:z},sB.t("Done")))))};ButtonsAddEditModal.displayName="ButtonsAddEditModal";var sW=a(0x1ee062b2e),sV=a(0x242503693),sq=a(0x16349a51f),sH=a(0x16ffed5ab),sU=a(0xf8631f1b),sz=a.n(sU);let sj=new c.Ay("workflow_builder"),MultiPaneSegmentFormModal=({onCancel:e,onSave:t,renderSaveError:a,segment:n,submitLabel:i,cancelLabel:c,afterStepId:f,isExistingSegment:g,isTrigger:h=!1,defaultPane:_=tg.k.DEFAULT,onNavigateBack:y})=>{let x=(0,nR.A)(),v=(0,l.wA)(),E=(0,e2.j)(),k=(0,e4.DY)(E),S=(0,M.d4)(N.Lh),{transitionFocusTo:A}=(0,r.useContext)(d.Ay),I=!!E&&(0,tM.I)(E.workflow.steps||[]).length>0,F=n?.type,O=(0,lp.E)(n),L=(0,tG.GS)(n),D=L?(0,e5.Dp)(n):void 0,P=L?(0,e5.P)(n):void 0,R=!!E&&(0,e4.a6)(E),B=(0,M.d4)(N.tQ),W=useTriggerDisplayContent()(n),V=(0,M.d4)(e=>P?.title??(0,th.Kb)(e,{type:n.type,subtype:O})??""),q=V;h&&!R&&(q=W.label||sj.t("Change how this workflow starts"));let H=(0,r.useMemo)(()=>I,[I]),U=useSegmentReducer(getSegmentReducer(n,{},D),n),[z,j]=U,$=(0,r.useRef)(z.segment),G=(0,r.useRef)(z);G.current=z;let K=(0,ty.q2)(G.current.segment),Y=(0,ty.RK)(G.current.segment);useSegmentFormInitializer({isOpenForm:K,segment:G.current.segment});let Q=(0,tS.v)(),{closeSpeedBump:Z,openSpeedBump:J}=Q,[X,ee]=(0,r.useState)(!1),[et,ea]=(0,r.useState)(null),en=((e,t,a,n)=>{if(n)return!!a&&a.trigger?.type!==t.type||!(0,rm.A)({...t.config,url:void 0},{...e.config,url:void 0});let r=excludeFieldsForComparison(e),l=(e=>{let{type:t,id:a,derived:n,config:r,coachmarkText:l,...i}=e;return{type:t,id:a,config:r,..."coachmarkText"in e&&{coachmarkText:l},..."derived"in e&&{derived:n},..."stepType"in i&&{stepType:i.stepType},..."subtype"in i&&{subtype:i.subtype}}})(excludeFieldsForComparison((e=>{if(!(0,tG.GS)(e))return e;let t={...e.config.inputs};return e.config.slackFunction?.input_parameters.forEach(e=>{var a;(e.type===e6.TE.SlackTypesRichText||e.type===e6.TE.SlackTypesExpandedRichText||e.type===e6.TE.SlackTypesBlocks)&&t[e.name]&&(t[e.name]={...t[e.name],value:Array.isArray(a=t[e.name].value)&&0===a.length?null:a})}),{...e,config:{...e.config,inputs:t}}})(t)));return!(0,rm.A)(r,l)})($.current,G.current.segment,E,h),er=((e,t)=>{if((0,rY.Z)(t)&&(0,rY.Z)(e)){let a=(0,rK.ln)(e)?.find(({type:e})=>e===e6.TE.SlackTypesCredentialOauth2);if(!a)return!1;let n=(0,rK.RE)(e,a.name)?.value,r=(0,rK.RE)(t,a.name)?.value;return n?.external_token_id!==r?.external_token_id}if((0,tG.GS)(t)&&(0,tG.GS)(e)){let a=(0,e5.ln)(e)?.find(({type:e})=>e===e6.TE.SlackTypesCredentialOauth2);if(!a)return!1;let n=(0,e5.RE)(e,a.name)?.value,r=(0,e5.RE)(t,a.name)?.value;return n?.external_token_id!==r?.external_token_id}return!1})($.current,G.current.segment),el=(0,r.useMemo)(()=>{let e=g?aE.KC.EditStep:aE.KC.AddStep,t=h&&n.config&&"event"in n.config?n.config.event?.eventType:void 0;return{elementName:h?aE.KC.EditTrigger:e,workflowBuilderStepType:h?F:D,workflowBuilderTriggerSubtype:t?(0,sW.y)(t):void 0,workflowBuilderWorkflowId:k}},[g,h,F,D,n.config,k]),ei=(0,r.useCallback)(()=>{(0,lE.tv)({workflowId:k||"",segmentId:h?ls.m.TRIGGER:n.id,level:u.A_.success})},[h,n.id,k]),es=(0,r.useCallback)(()=>{let e;if(h||(e=sj.rt('"{segmentTitle}" step added',{segmentTitle:V})),g&&(e=h?sj.t("Workflow start has been updated"):sj.rt('"{segmentTitle}" step updated',{segmentTitle:V})),e)return v((0,sH.M)({element:r.createElement(b.A,null,e)}))},[v,g,h,V]),eo=(0,r.useCallback)(()=>{ea(null),ee(!0);let e=(0,tG.GS)(G.current.segment)&&(0,e5.mV)(G.current.segment)&&!(0,ty.q2)(G.current.segment)&&(0,tG.GS)(G.current.segment)?(0,ty.$c)(G.current.segment):G.current.segment;t(e).then(()=>v((0,lT.O)())).then(ei).then(()=>ee(!1)).then(()=>es()).then(()=>{h||A({focusKey:sV.Ay.PAGE_CONTENT_WORKFLOW_EDITOR_STEP_PREVIEW,focusMetadata:{id:e.id}})}).catch(e=>{ea({...e,name:e.name}),ee(!1),Z()})},[t,ei,v,es,A,h,Z]),ec=(0,r.useCallback)(()=>{let t=h&&n.config&&"event"in n.config?n.config.event?.eventType:void 0;(0,aE.ft)({clogger:x,wbArgs:{workflow_id:k,is_hermes:!0,...h&&t&&{trigger_subtype:(0,sW.y)(t)}}}),e&&e(),v((0,lT.O)()),v((0,sq.dV)($.current.id)),v((0,r2.br)({workflowId:k||""}))},[x,k,e,v,h,n.config]),ed=(0,r.useCallback)(()=>{en?J({heading:sj.t("Discard changes?"),message:sj.rt("Your work will not be saved."),onCancel:Z,onContinue:()=>{if(ec(),!g){let e=h?lo.hf:f||lo.kr;A({focusKey:sV.Ay.PAGE_CONTENT_WORKFLOW_EDITOR_STEP_PREVIEW,focusMetadata:{id:e}})}}}):ec()},[en,ec,J,Z,h,g,A,f]),eu=n?.type===ro.SJ,em=P?.app_id,ep=(0,r.useMemo)(()=>{if(W.icon)return W.icon;if(em)return r.createElement("span",{className:sz().title_icon},r.createElement(T.z,{appId:em}));let e=P?.callback_id??"";(0,nu.Ag)(n)&&(e=li.ad);let t=(0,w.m)(e);return e?r.createElement("span",{className:sz().title_icon},r.createElement(p.Ah,{"data-qa":"svg-icon",name:t,size:"20"})):null},[W.icon,em,P?.callback_id,n]),eb=(0,r.useCallback)(({activePane:e,switchPane:t})=>r.createElement(SegmentFormModal,{title:q,icon:ep,onSave:eo,onClose:ed,saving:X,saveError:et,renderSaveError:a,segment:n,submitLabel:i,cancelLabel:c,afterStepId:f,currentSegmentState:G.current.segment,segmentReducer:U,speedBumpContext:Q,isTrigger:h,isExistingSegment:g,isAuthTokenModified:er,isSegmentModified:en,baseAutoClogProps:el,switchPane:t,activePane:e,onNavigateBack:y}),[q,ep,eo,ed,X,et,a,n,i,c,f,U,Q,h,g,er,en,el,y]),ef=(0,r.useMemo)(()=>({[tg.k.DEFAULT]:{render:({switchPane:e})=>eb({switchPane:e,activePane:tg.k.DEFAULT}),modalProps:{contentLabel:V}},[tg.k.THIRD_PARTY_USER_FORM_CONFIG]:{render:({switchPane:e})=>eb({switchPane:e,activePane:tg.k.THIRD_PARTY_USER_FORM_CONFIG}),modalProps:{contentLabel:V}},[tg.k.FORM_WRAPPED_SELECTION]:{render:({switchPane:e})=>r.createElement(FormWrappedSelectionModal,{title:q,icon:ep,onClose:ed,switchPane:e,appId:em,segment:n,activePane:tg.k.FORM_WRAPPED_SELECTION}),modalProps:{contentLabel:V}},[tg.k.PARENT_INPUTS]:{render:({switchPane:e})=>eb({switchPane:e,activePane:tg.k.PARENT_INPUTS}),modalProps:{contentLabel:V}},[tg.k.CHILD_INPUTS]:{render:({switchPane:e})=>eb({switchPane:e,activePane:tg.k.CHILD_INPUTS}),modalProps:{contentLabel:V}},[tg.k.FORM_WRAPPED_INPUTS]:{render:({switchPane:e})=>r.createElement(FormWrappedInputsModal,{title:q,icon:ep,onSave:eo,onClose:ed,saving:X,saveError:et,renderSaveError:a,segment:G.current.segment,submitLabel:i,cancelLabel:c,segmentReducer:U,speedBumpContext:Q,isExistingSegment:g,isSegmentModified:en,baseAutoClogProps:el,switchPane:e}),modalProps:{contentLabel:V}},[tg.k.OPEN_FORM_QUESTION_EDIT]:{render:({switchPane:e,questionIndex:t})=>K&&(0,tG.GS)(G.current.segment)?r.createElement(QuestionEditModal,{questionIndex:t,switchPane:e,segment:G.current.segment}):null,modalProps:{contentLabel:V,showCloseButton:!1,shouldCloseOnOverlayClick:!1,closeModal:()=>{}}},[tg.k.INTERACTIVE_BLOCKS_ADD_EDIT]:{render:({switchPane:e,buttonIndex:t,operation:a,formatVariableBeforeInsert:n,onChange:l})=>Y&&(0,tG.GS)(G.current.segment)?r.createElement(ButtonsAddEditModal,{buttonIndex:t,switchPane:e,operation:a??"add",segment:G.current.segment,formatVariableBeforeInsert:n,onChange:l,afterStepId:f,isExistingSegment:g}):null,modalProps:{contentLabel:V,showCloseButton:!1,shouldCloseOnOverlayClick:!1,closeModal:()=>{}}},[tg.k.FORM_LOADING_SCREEN]:{render:({switchPane:e,heading:t,redirectPane:a})=>r.createElement(FormLoadingScreen,{switchPane:e,heading:t,redirectPane:a??tg.k.DEFAULT}),modalProps:{contentLabel:V,showCloseButton:!1,shouldCloseOnOverlayClick:!1,closeModal:()=>{}}},[tg.k.AI_STEP_DEFAULT]:{render:({switchPane:e})=>(0,tG.GS)(G.current.segment)?r.createElement(AiStepDefaultModal,{title:V,icon:ep,switchPane:e,onClose:ed,onSave:eo,segment:G.current.segment,workflow:E,speedBumpContext:Q,saving:X,saveError:et,renderSaveError:a,isExistingSegment:g,isSegmentModified:en,onNavigateBack:y}):null,modalProps:{contentLabel:V,showCloseButton:!0,shouldCloseOnOverlayClick:!0,fullscreen:!0,maxWidth:1024}}}),[V,eb,q,ep,ed,em,n,eo,X,et,a,i,c,U,Q,g,en,el,K,Y,f,E,y]),eg=(0,r.useMemo)(()=>r.createElement(m.A,{panes:ef,defaultPane:_,onClose:ed,forceSpeedBumpEnabled:!0,shouldCloseOnOverlayClick:!X,maxWidth:eu?1200:void 0,className:"c-segment_modal--hermes_workflow",dataQa:h?"trigger-modal":"step-modal",centered:!B,overlayClassName:s()({[sz().modal_overlay]:B})}),[_,B,eu,h,X,ed,ef]);return r.createElement(o.A,{eventId:tK.EventId.WORKFLOW_BUILDER,uiStep:tK.UiStep.WORKFLOW_EDITOR,...el},r.createElement(C.us.Provider,{value:Q},r.createElement(ValidationProvider,{computed:z.computed},r.createElement(C.ZH.Provider,{value:j},S&&r.createElement(e2.X.Provider,{value:E},r.createElement(tj.U.Provider,{value:H},eg)),!S&&eg))))};MultiPaneSegmentFormModal.displayName="MultiPaneSegmentFormModal"},0x426feba4:(e,t,a)=>{"use strict";a.d(t,{l:()=>UpdateTriggerErrorMessage,y:()=>SaveNewWorkflowErrorMessage});var n=a(0xbad225b5);let r=new(a(0x20482ad21)).Ay("workflow_builder"),SaveNewWorkflowErrorMessage=({error:e})=>{let t="default";return(e||{}).name,t=r.t("Sorry, there was a problem trying to save your workflow."),n.createElement("span",null,t)};SaveNewWorkflowErrorMessage.displayName="SaveNewWorkflowErrorMessage";let UpdateTriggerErrorMessage=({error:e})=>{let t="";return t="insufficient_posting_permissions"===(e||{}).name?r.t("You don\u2019t have posting permissions for one or more channels in this trigger.",{fallbackHash:"c2fdb696683556283da97a9f3184ad82dcf1f622",fallbackHashNs:"workflow_builder"}):r.t("Sorry, there was a problem trying to update your trigger."),n.createElement("span",null,t)};UpdateTriggerErrorMessage.displayName="UpdateTriggerErrorMessage"},0x22c41b907:(e,t,a)=>{"use strict";a.d(t,{k:()=>n});let n={DEFAULT:"default",PARENT_INPUTS:"parent-inputs",CHILD_INPUTS:"child-inputs",OPEN_FORM_QUESTION_EDIT:"open-form-question-edit",FORM_WRAPPED_INPUTS:"form-wrapped-inputs",INTERACTIVE_BLOCKS_ADD_EDIT:"interactive-blocks-add-edit",FORM_WRAPPED_SELECTION:"form-wrapped-selection",THIRD_PARTY_USER_FORM_CONFIG:"third-party-user-form-config",FORM_LOADING_SCREEN:"form-loading-screen",AI_STEP_DEFAULT:"ai-step-default"}},0x161478d06:(e,t,a)=>{"use strict";a.d(t,{$:()=>SegmentFormWrapper});var n=a(0xbad225b5),r=a(0x120c268ad),l=a.n(r),i=a(0x1407c6c2c),s=a(0x20482ad21),o=a(0x1d2cd7755),c=a(0x10598eeca),d=a(0x88dc61ea),u=a(0x106f35107),m=a(0x63978f20),p=a.n(m);let b=new s.Ay("workflow_builder"),f={display:"none"};(function CoachmarkEditField({coachmarkText:e,onUpdateCoachmarkText:t}){let a=(0,i.A)();return n.createElement(o.A,{htmlFor:a,text:"Edit Coachmark"},n.createElement(c.A,{id:a,value:e,onChange:t}))}).displayName="CoachmarkEditField";let SegmentFormWrapper=({children:e,noSubmit:t=!1,noPadding:a=!1,className:r,segment:i})=>{let s=(0,d.Hj)(),o=(0,d.rC)(),c=(i?.coachmarkText,(0,n.useCallback)(e=>{o((0,u.RJ)({coachmarkData:e}))},[o]),n.createElement(n.Fragment,null,e,!1));return n.createElement("div",{"data-qa":"segment-form-wrapper",className:l()({[p().withPadding]:!a},r)},t?c:n.createElement("form",{onSubmit:s},c,n.createElement("button",{style:f,type:"submit"},b.t("Submit"))))};SegmentFormWrapper.displayName="SegmentFormWrapper"},0x6713bca9:(e,t,a)=>{"use strict";a.d(t,{J:()=>SegmentIcon});var n=a(0xbad225b5),r=a(0x120c268ad),l=a.n(r),i=a(0x344bb842),s=a(0x2501a2cee),o=a(0x4c96e5d9),c=a(0x12cef2078),d=a(0x1f495452e),u=a.n(d);let SegmentIcon=({icon:e,isFocusedOrHovering:t})=>{if(e&&"object"==typeof e&&"onClick"in e&&void 0!==e?.onClick){let{label:a,onClick:r,svgIconProps:s,svgIconPropsOnHover:d}=e,m=l()(u().outline_container,u().with_background,{[u().show_outline]:t}),p=d&&t?d:s,b={"aria-controls":e["aria-controls"],"aria-expanded":e["aria-expanded"]};return n.createElement(c.X,{preventDefault:!0,stopPropagation:!1},n.createElement("div",{className:m},n.createElement(o.Ay,{tip:a,delay:o.PK},n.createElement(i.A,{svgIconProps:p,"aria-label":a,onClick:r,className:u().icon_button,ref:"ref"in e?e.ref:void 0,...b}))))}return(0,n.isValidElement)(e)?e:n.createElement("div",{className:u().container,"data-qa":"segment-icon"},n.createElement(s.Ah,{name:e,size:"20"}))};SegmentIcon.displayName="SegmentIcon"},0x5542b9f7:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>eY});var n=a(0xbad225b5),r=a(0x16cf1da63),l=a(0x120c268ad),i=a.n(l),s=a(0x9beb8542),o=a(0x2dd1b881),c=a(0x20482ad21),d=a(0xc6b3c013),u=a(0xbada0518),m=a(0x40c0d834),p=a(0x8c8bafa3),b=a(0x2b7f0bcc),f=a(0x11a296110),g=a(0x1faa3f1ac),h=a(0x1fc68d76),_=a(0x409e023f),y=a(0x1795d8821);let x="trigger_setup",v=new c.Ay("workflow_builder"),getRequiredInputsList=e=>e&&e.trigger.required_inputs?e.trigger.required_inputs.map(e=>({name:"string"==typeof e.name?e.name:"",title:e.title||"",type:y.CD.find(t=>t===e.type)||"string",items:e.items,is_required:!0})):[];var E=a(0xe874a88a),k=a(0x22a29f141),S=a(0x1dfdeb1c8),w=a(0x1ec68d6a3),C=a(0xe747dd27);let A=(0,S.A)("workflows.templates.getBuiltinTemplate generated fetcher",(e,t,a)=>new E.S((n,r)=>{let{abortSignal:l,reason:i,...s}=a,o=(0,C.VA)(s);e((0,k.apiCall)({method:"workflows.templates.getBuiltinTemplate",args:o,abortSignal:l,reason:i})).then(e=>{n(e)}).catch(e=>{(0,w.default)({getState:t}).error(`API call to workflows.templates.getBuiltinTemplate
						with reason ${i} failed, initiated by generated fetcher`),r(e)})}));A.meta={name:"workflowsTemplatesGetBuiltinTemplateFetcher",key:"createFetcherWorkflowsTemplatesGetBuiltinTemplateFetcher",description:"workflows.templates.getBuiltinTemplate generated fetcher"};var T=a(0x114c5f44f),I=a(0x10045b129),N=a(0x24546e7f2),M=a(0x1cbdfeceb),F=a(0x21f3c49e8),O=a(0x1db69cda),L=a(0xb1ea448c),D=a(0x2501a2cee),P=a(0x1efcf3032),R=a(0x218fd5440),B=a(0xef503114),W=a(0x1b0fc7140),V=a(0x202470d56),q=a(0x2264e6ea3),H=a(0x11e7de8ad),U=a(0xbbd2a32d),z=a(0x16ed1b0dc),j=a(0xa985ed31),$=a(0x4f725d55),G=a(0xd2fa49d0);let isInputValueEmpty=e=>{switch(typeof e){case"string":return!e;case"object":return(0,F.A)(e);case"number":return!(0,B.A)(e)&&!(0,W.A)(e);default:return(0,V.A)(e)}},hasValidInputParameterValue=(e,t)=>{if(!e.is_required&&isInputValueEmpty(t))return!0;switch(e.type){case y.TE.String:if(!e.maxLength)return!isInputValueEmpty(t);return!isInputValueEmpty(t)&&"string"==typeof t&&t.length<=e.maxLength;case y.TE.Boolean:case y.TE.Object:case y.TE.SlackTypesBlocks:case y.TE.SlackTypesRichText:case y.TE.SlackTypesExpandedRichText:case y.TE.SlackTypesTimestamp:case y.TE.SlackTypesDate:case y.TE.SlackUserPermission:return!isInputValueEmpty(t);case y.TE.SlackTypesMessageContext:return!1;case y.TE.Number:return(0,U.gf)(Number(t));case y.TE.Integer:return(0,U.zh)(Number(t));case y.TE.SlackTypesChannelId:return"string"==typeof t&&(0,z.A)(t);case y.TE.SlackTypesUserId:return"string"==typeof t&&(0,$.A)(t);case y.TE.SlackTypesUsergroupId:return"string"==typeof t&&(0,G.A)(t);case y.TE.SlackTypesCanvasId:case y.TE.SlackTypesChannelCanvasId:case y.TE.SlackTypesCanvasTemplateId:return"string"==typeof t&&(0,j.A)(t);case y.TE.SlackTypesTeamId:return"string"==typeof t&&(0,q.Ay)(t);case y.TE.SlackTypesListId:if("string"!=typeof t)return!1;return(0,j.A)(t)||(0,H.B)(t);case y.TE.Array:{if(!Array.isArray(t)||!e.items)return!1;let{type:a}=e.items;if("slack#/types/dynamic_pair"===a||"slack#/types/mixed"===a)return!0;if(isInputValueEmpty(t))return!1;let n={type:a,maxLength:"string"===a?e.items.maxLength:void 0};return t.every(e=>("string"==typeof e||"number"==typeof e||"boolean"==typeof e)&&hasValidInputParameterValue(n,e))}case y.TE.SlackTypesCredentialOauth2:{let e=t?.credential_source,a=t?.external_token_id;return!!e&&Object.values(y.x).includes(e)&&(!!a||e===y.x.END_USER)}case y.TE.SlackTypesDynamicPair:return!isInputValueEmpty(t.value);default:return!1}};var K=a(0x20e80190e),Y=a(0x1e2b0328c),Q=a.n(Y);let Z=new c.Ay("workflow_builder"),TemplateTriggerSetup=({onNext:e,onClose:t,templateData:a,isNextLoading:r,isInfoLoading:l,setInputsValue:i,requiredInputsValue:s,requiredInputsList:c})=>{let d,u=a?.title,m=a?.image,[p,b]=(0,n.useState)(!0),g=(0,n.useMemo)(()=>({updateRequiredContext:M.A,viewOnly:!1,updateParameterValue:M.A,onVariableMenuOpen:M.A,openFormSteps:[],triggerType:void 0,externalTriggerSalesforceOrgId:void 0,validateAsyncValue:M.A,hasValidAppPinBuiltInMessage:!1,workflowSummaryStepPrecedes:!1,formStepPrecedesCurrentStep:!1,previousStepId:""}),[]),h=(e=>{switch(e){case"slack#/events/reaction_added":return"emoji";case"slack#/events/user_joined_channel":return"user-add";default:return""}})(a?.trigger.type),_=(e=>{switch(e){case o.Z.SEND_KUDOS:return v.t("Starts when someone reacts with \u{1F389}");case o.Z.REACTION_NOTIFICATION:return v.t("Starts when someone reacts with \u2705");case o.Z.WELCOME_NEW_MEMBER:return v.t("Starts when someone joins a channel");default:return""}})((d=a?.title||"",o.H[d])),y=(0,n.useMemo)(()=>{if(!c||!p)return!0;let e=Object.fromEntries(Object.entries(s).map(([e,{value:t}])=>[e,{value:t||null}]));return!c.every(t=>{let a=e[t.name];return!!a&&!!a.value&&hasValidInputParameterValue(t,a.value)})},[p,c,s]),x=c||[],E=(0,n.useMemo)(()=>(0,R.K)(c??[]),[c]),k=(0,n.useCallback)((e,t)=>{(0,F.A)(t)&&e.is_required?b(!1):b(!0);let a=(0,O.A)(s);a[e.name]={value:t},i(a)},[s,i]);return l?n.createElement(K.$m,null,n.createElement(L.A,{color:"white"})):n.createElement(n.Fragment,null,n.createElement(K.rQ,null,n.createElement("div",{className:Q().template_buttons_container},n.createElement("img",{src:m,alt:""}),n.createElement(K.Rc,{className:Q().modal_title,title:u}))),n.createElement(K.$m,null,n.createElement(K.qf,{"data-qa":"trigger-setup-content"},n.createElement(P.L,{inputParameters:x,onChange:k,configuredParameters:s,workflowRendererContexts:g,callbackId:a?.template_id,oAuthParameter:E}))),n.createElement(K.jl,{className:Q().modal_footer},n.createElement("div",{className:Q().template_footer},h&&n.createElement(D.Ah,{name:h}),n.createElement("div",{className:Q().template_footer_summary},_)),n.createElement(K.ox,null,n.createElement(f.Ay,{type:"outline",onClick:t},Z.t("Cancel")),n.createElement(f.lV,{loading:r,onClick:e,disabled:y,"aria-label":Z.t("Next")},Z.t("Next")))))};TemplateTriggerSetup.displayName="TemplateTriggerSetup";var J=a(0x1c2358c11),X=a(0x1fcbb004d);let TemplatesCreateModals=({templateId:e,setIsLoading:t,onNext:a,isLoading:l})=>{let i=(0,r.wA)(),[s,o]=(0,n.useState)(!1),{data:c,loading:d,error:u}=(0,J.L)({fetcher:A,args:{reason:"step-library/category-step-fetch",templateId:e}}),m=d||null===c||u||l,p=(0,n.useMemo)(()=>getRequiredInputsList(c),[c]),b=(0,n.useMemo)(()=>p?Object.fromEntries(p.map(e=>[e.name,{value:void 0}])):{},[p]),[f,g]=(0,n.useState)(b),h=(0,n.useCallback)(async()=>{o(!0);try{let t=Object.keys(f).reduce((e,t)=>(e[t]=f[t].value,e),{});await a(e,t)}finally{o(!1),i((0,X.O)())}},[i,f,o,a,e]),_=(0,n.useCallback)(()=>{i((0,X.O)()),t(!1),o(!1)},[i,o,t]),y=(0,n.useMemo)(()=>({[x]:{render:()=>n.createElement(TemplateTriggerSetup,{onClose:_,onNext:h,templateData:c,isNextLoading:s,isInfoLoading:!!m,requiredInputsValue:f,setInputsValue:g,requiredInputsList:p}),modalProps:{contentLabel:"workflow setup"}}}),[_,h,c,s,m,f,p]);return n.createElement(N.A,{closeModal:_,defaultPane:x,panes:y,dataQa:"templates-create-modals"})};TemplatesCreateModals.displayName="TemplatesCreateModals";var ee=a(0xe9c32bb),et=a(0x3c5a1598),ea=a(0x1e4ad58a2),en=a(0x1ee57b3a0),er=a(0x1fa67866c),el=a(0x210b99e76),ei=a(0x6713bca9),es=a(0x162e18dce),eo=a(0x20a2a54fa),ec=a(0x22ae7a8bf),ed=a(0x1bffa495d),eu=a(0x1c27a9e4a),em=a(0xee12becf),ep=a(0x252b4df6e),eb=a(0xbf22577d),ef=a(0x20d4168fd),eg=a(0x154dd8295),eh=a(0x75b1e64d),e_=a(0x1d9a37519),ey=a(0x16af7d0de),ex=a(0x1e9a6d1d),ev=a(0x17862b902),eE=a.n(ev);let StepPreview=({workflow:e,availableData:t,expressionData:a,trigger:r,step:l,renderBaseTemplatePreviewStepListNested:s})=>{let o=l.function?.id===ey.Ez.case_step?(0,ef.N1)(l):(0,ep.lq)(l,l?.coachmark),c=(0,ec.S)(t,r,e),d=(0,eo.sM)(c,o.id),u=(0,es.E)(o),m=(0,n.useMemo)(()=>{if("slackFunction"in o.config){if(u?.app_id)return n.createElement(e_.z,{appId:u?.app_id,size:24});let{slackFunction:e}=o.config;if(e?.type===ex.A.BuiltIn||e?.type===ex.A.Utility)return(0,el.m)(e?.callback_id);if(e?.app_id)return n.createElement(e_.z,{appId:e.app_id,size:24})}let e=(0,eu.E)(o);return(0,ed.pA)({type:o?.type,subtype:e})},[o,u?.app_id]),p=(0,n.useMemo)(()=>(0,eg.Ag)(o)?n.createElement(eh.B,{segment:o,templateExpressionData:a}):(0,em.S)(o),[a,o]),b=(0,n.useMemo)(()=>(0,eb.n)("template",o,d,{staticWorkflow:e}),[o,d,e]);return n.createElement("div",null,n.createElement("div",{className:eE().divider},n.createElement("div",{className:eE().dot}),n.createElement("div",{className:eE().spacer})),n.createElement(ea.A,{className:eE().cardContainer},n.createElement(en.A,{className:i()(eE().cardHeader,{[eE().headerNoBorderBottom]:!b})},n.createElement("div",{className:eE().headerInfo},n.createElement(ei.J,{icon:m}),n.createElement("div",{className:eE().headerText},n.createElement(ee.nB,{element:"h2",weight:"bold",className:eE().title},p)))),!!b&&n.createElement(er.A,{className:eE().cardSection},b),n.createElement("div",{className:eE().nestedList},!!(l?.steps&&s)&&s?.({workflow:e,availableData:t,expressionData:a,trigger:r,steps:l.steps}))))};StepPreview.displayName="StepPreview";var ek=a(0x1a5ac3a0c),eS=a(0x24e22e0a6);let TriggerPreview=({trigger:e})=>{let t=(0,ek.eG)(e),a=(0,n.useMemo)(()=>{if((0,eS.Z)(t)){let e=t.config.service.function;if(e?.app_id)return n.createElement(e_.z,{appId:e.app_id,size:20})}let e=(0,eu.E)(t);return(0,ed.pA)({type:t.type,subtype:e})},[t]),r=(0,em.S)(t);return n.createElement(ea.A,{className:eE().cardContainer,"data-qa":"trigger-preview"},n.createElement("div",{className:eE().cardHeader},n.createElement("div",{className:eE().headerInfo},a&&n.createElement(ei.J,{icon:a}),n.createElement("div",{className:eE().headerText},n.createElement(ee.nB,{element:"h2",weight:"bold",className:eE().title},r)))))};TriggerPreview.displayName="TriggerPreview";var ew=a(0x23a4b0853),eC=a(0xf5bbd10a),eA=a(0x3711e82d),eT=a(0x9b971e7e),eI=a(0x1451d329d),eN=a(0x226892387),eM=a(0x58fa6f7f),eF=a(0x46dbff89);let eO=new c.Ay("workflow_builder"),eL={onClick:{enableClogAction:!0},elementValue:"use_template"},getHelpLink=(e,t)=>n.createElement(g.A,{href:`http://my.${e}/help/requests/new`},t);getHelpLink.displayName="getHelpLink";let ApiErrorComponent=()=>{let e=eO.t("Something went wrong, and we can't load the preview right now.",{fallbackHash:"d353e58279ce2bdd58b63c6521f5a2bdcac0f5b0"}),t=eO.t("The template still works, though, so click the button if you want to use it!",{fallbackHash:"d353e58279ce2bdd58b63c6521f5a2bdcac0f5b0"});return n.createElement("div",{className:eE().api_error_msg},n.createElement("div",{className:eE().image}),n.createElement(ee.hE,{"aria-label":e},e),n.createElement(ee.nB,{"aria-label":t},t))};ApiErrorComponent.displayName="ApiErrorComponent";let BaseTemplatePreviewStepList=({steps:e,workflow:t,trigger:a,availableData:r,expressionData:l})=>{let i=(0,n.useCallback)(e=>n.createElement(BaseTemplatePreviewStepList,e),[]);return e.map((e,s)=>n.createElement(StepPreview,{key:`${e.id}_${s+1}`,workflow:t,trigger:a,availableData:r,step:e,expressionData:l,renderBaseTemplatePreviewStepListNested:i}))};BaseTemplatePreviewStepList.displayName="BaseTemplatePreviewStepList";let BaseTemplatePreview=({dataQa:e,templateId:t,workflow:a,trigger:l,availableData:i,expressionData:s,steps:o,fetchError:c,hasRestrictedApps:d,connectedAppIds:u})=>{let g,y,x=(0,eN.d4)(eT.ZT),v=(0,I.Wd)(u),{isRequiredInputNeededForTemplate:E}=(g=(0,r.wA)(),y=(0,n.useRef)({}),{isRequiredInputNeededForTemplate:async function(e){if(!(0,T.A)(e))return!1;if(void 0!==y.current[e])return y.current[e];let t=!!getRequiredInputsList(await g(A({reason:"step-library/category-step-fetch",templateId:e}))).length;return y.current[e]=t,t}}),k=(0,I.mM)(),S=(0,r.wA)(),[w,C]=(0,n.useState)(!1),[N,M]=(0,n.useState)(!1),F=(0,eC.A)(),O=(0,n.useMemo)(()=>(0,ek.BQ)(a),[a]),L=(0,n.useMemo)(()=>(0,ek.DU)(a),[a]),D=(0,n.useMemo)(()=>(0,ek.yL)(a),[a]),P=(0,n.useMemo)(()=>d?eO.t("This template is unavailable because it uses a service or app restricted by your admin.",{fallbackHash:"7715422f97571b05d7fa09a7644b1d4b10c5e1f1"}):eO.t("Add your details to use this template as is. Or, add more steps to customize it.",{fallbackHash:"7715422f97571b05d7fa09a7644b1d4b10c5e1f1"}),[d]),R=eO.t("Use Template",{ns:"slack-docs"}),B=(0,n.useMemo)(()=>n.createElement(b.Ay,{level:b.A_.error},eO.rt("Oh no, your template failed to open. Try selecting it again. If the issue continues <a>please report a bug.</a>",{"<a>":({text:e})=>getHelpLink((0,p.qF)(),e),fallbackHash:"70f1bdb85b141a43379a97e17ce8c7429df4151f",fallbackHashNs:"hermes_template_gallery"})),[]),W=eO.t("Use Template: {workflowName}",{workflowName:O,fallbackHash:"66e659531c60aca9a6bdeca42ee0572d2581e945"}),V=(0,n.useCallback)(async(e,t)=>{try{await S((0,eI.L)({payload:{templateId:e,templatePayload:t}}))}catch(t){F.error(`Something went wrong when trying to create a workflow with templateId: ${e}`,t),C(!0)}},[S,F]),q=(0,n.useCallback)(async(e,t)=>{t>=e.length?M(!1):S((0,eF.q)({element:n.createElement(_.u,{appId:e[t],onCloseModal:()=>{q(e,t+1)}})}))},[S]),H=(0,n.useCallback)(async()=>{if(M(!0),await E(t))S((0,eF.q)({element:n.createElement(TemplatesCreateModals,{templateId:t,setIsLoading:M,onNext:V,isLoading:N})}));else if((0,I.eW)(v)){let{appIds:e}=v;q(e,0)}else if((0,I.eN)(v)){let{appIds:e}=v;await k(e),(0,eM.J)().markObjectsAsStale(x??"",(0,h._)(a.steps)),await V(t),M(!1)}else await V(t),M(!1)},[S,E,t,v,V,N,q,k,x,a.steps]),U=d||N||!!c||(0,I.mh)(v);return n.createElement(m.A,{eventId:eA.EventId.WORKFLOW_BUILDER,uiStep:eA.UiStep.WORKFLOW_CREATOR,elementName:ew.KC.TemplatePreview},n.createElement("div",{className:eE().base_template_preview,"data-qa":e},n.createElement("div",{className:eE().main},c?n.createElement(ApiErrorComponent,null):n.createElement(n.Fragment,null,n.createElement("div",{className:eE().header},n.createElement("div",{className:eE().headerTitle},n.createElement(et.R,{name:O,icon:L,description:D,canEdit:!1})),n.createElement("div",{className:eE().preview},n.createElement("span",null,eO.t("Preview")))),n.createElement("div",{className:eE().cardSection},n.createElement(TriggerPreview,{trigger:l}),n.createElement(BaseTemplatePreviewStepList,{workflow:a,trigger:l,availableData:i,expressionData:s,steps:o})))),w?B:null,n.createElement("div",{className:eE().footer},n.createElement(ee.nB,{id:"template-preview-button-body"},P),n.createElement(f.lV,{className:eE().useTemplateBtn,"data-qa":"create_workflow_from_template",disabled:U,loading:N,onClick:H,"aria-describedby":"template-preview-button-body","aria-label":W,autoClogProps:eL},R))))};BaseTemplatePreview.displayName="BaseTemplatePreview";var eD=a(0x17bf2891);let eP=new c.Ay("workflow_builder"),StartFromScratch=({isWithinSidebar:e,subtitleOverride:t})=>{let a=eP.t("Start from scratch"),r=t??eP.t("First things first! Choose how your workflow begins.");return n.createElement(m.A,{eventId:eA.EventId.WORKFLOW_BUILDER,uiStep:eA.UiStep.WORKFLOW_CREATOR,elementName:ew.KC.WorkflowTemplateCreateScratch},n.createElement("div",{className:i()(eE().start_from_scratch,{[eE().start_from_scratch_primary_pane]:!e}),"data-qa":"template-selection-preview-start-from-scratch"},n.createElement("div",null,n.createElement("div",{className:eE().header},!e&&n.createElement(ee.$j,{"aria-label":a},a),n.createElement(ee.nB,{"aria-label":r},r)),n.createElement(eD.j,null))))};StartFromScratch.displayName="StartFromScratch";var eR=a(0xa263fbfd),eB=a(0x14b92995e),eW=a(0x16e94c2bd),eV=a(0x24fc5dd2c),eq=a(0xceecbebe),eH=a.n(eq);let eU=new c.Ay("workflow_builder"),TemplatePreview=({selectedTemplate:e,hasRestrictedApps:t,connectedAppIds:a})=>{let l=(0,n.useRef)({}),s=(0,r.wA)(),[c,m]=(0,n.useState)(!e),[p,b]=(0,n.useState)(null),[f,g]=(0,n.useState)(),[h,_]=(0,n.useState)(),[y,x]=(0,n.useState)(void 0),[v,E]=(0,n.useState)({}),[k,S]=(0,n.useState)([]),w=(0,eC.A)(),C=(0,eN.d4)(d.O),A=(0,n.useCallback)(async()=>{if(e&&!l.current[e])try{m(!0);let{trigger:t,workflow:a,available_data:n,expression_data:r}=await s((0,eB.l)({templateId:e,reason:"load-template-get-as-decorated-workflow"})),i={trigger:{...t,type:(0,eV.k)(t.type)},workflow:(0,eW.l_)(a),availableData:n,expressionData:r};l.current[e]=i,g(i.workflow),_(i.trigger),x(i.availableData),E(i?.expressionData??{})}catch(t){w.error(`Something went wrong when trying to fetch a workflow with templateId: ${e}`,t),b(eU.t("Something went wrong while previewing this template. Please try again or contact support.",{fallbackHash:"48faa2ac6ac6d273cd7dacbe15a5b6f7e1822087"}))}finally{m(!1)}},[s,w,e]);if((0,n.useEffect)(()=>{e!==o.Z.START_FROM_SCRATCH?A():m(!1)},[e,A]),(0,n.useEffect)(()=>{let t=(void 0!==e&&l.current[e])??void 0;t&&(g(t.workflow),_(t.trigger),x(t.availableData),E(t.expressionData),S(t&&(0,ek.gi)(t.workflow)||[]))},[f,l,e]),!e)return null;let renderSelectedTemplate=r=>f&&h&&y&&r!==o.Z.START_FROM_SCRATCH?n.createElement(eR.Z.Provider,{value:l.current[e]},n.createElement(BaseTemplatePreview,{dataQa:`template_selection_preview_${r.toLowerCase()}`,templateId:r,workflow:f,trigger:h,availableData:y,expressionData:v,steps:k,fetchError:p,hasRestrictedApps:t,connectedAppIds:a})):n.createElement(StartFromScratch,null);return renderSelectedTemplate.displayName="renderSelectedTemplate",n.createElement("div",{className:i()(eH().preview,{[eH().builderLiteBackground]:C&&e===o.Z.START_FROM_SCRATCH}),"data-qa":"template-selection-preview"},c?n.createElement(u.W,null):renderSelectedTemplate(e))};TemplatePreview.displayName="TemplatePreview";var ez=a(0x25136cc80),ej=a(0xad14d02e),e$=a(0x1c8cd6703),eG=a(0x303eaaff),eK=a(0x1b04bac5);let TemplateSelection=e=>{let[t,a]=(0,n.useState)([]),l=(0,eC.A)(),c=(0,r.wA)(),[d,u]=(0,n.useState)(""),m=(0,n.useCallback)(async()=>{try{let e=await c((0,e$.v)({reason:"fetch-template-list",categories:"default,advanced"}));if(!e.templates)throw Error("No templates found");let t=e.templates.filter(e=>!e.has_restricted_apps&&!e.has_restricted_trigger_types).map(({id:e,description:t,localization:a,name:n,small_icon_url:r,external_app_ids:l})=>({coverImage:r,id:e,summary:a?.description||t,title:a?.name||n,hasRestrictedApps:!1,connectedAppIds:l}));a(t)}catch(e){l.error("Something went wrong when trying to fetch the template list.",e)}},[c,l]);return(0,n.useEffect)(()=>{if(t.length){let a=t.map(e=>e.id);u((0,s.EV)({routeTemplateId:e.workflowTemplateId,templateIds:[o.Z.START_FROM_SCRATCH,...a]}))}},[e.workflowTemplateId,t]),(0,n.useEffect)(()=>{m()},[c,m]),n.createElement("div",{className:i()(eH().container,"dt-w-full"),"data-qa":"template-selection-container"},n.createElement(eG.A,{id:"WFBTemplatePreviewPrimary",index:eK.A.TEMPLATE_PREVIEW_PRIMARY,enableSectionNavigation:!0,tabCountToShowContextualHelp:ez.l.WFB_TEMPLATE_PREVIEW},n.createElement(TemplatePreview,{selectedTemplate:d,isFullScreen:!0,hasRestrictedApps:(0,s.iN)({selectedTemplateId:d,templateList:t}),connectedAppIds:(0,s.sM)({selectedTemplateId:d,templateList:t})})),n.createElement(ej.A,null))};TemplateSelection.displayName="TemplateSelection";let eY=TemplateSelection},0x17bf2891:(e,t,a)=>{"use strict";a.d(t,{j:()=>TriggerOptionsList});var n=a(0xbad225b5),r=a(0x20482ad21),l=a(0x2b7f0bcc),i=a(0xb1ea448c),s=a(0xd193e9b8),o=a(0x16cf1da63),c=a(0xa6f3163b),d=a(0x2501a2cee),u=a(0x9beb8542),m=a(0x61c95b1b),p=a(0x20570d71a),b=a(0x126af815a),f=a(0x3711e82d),g=a(0x1123a239c),h=a(0x24fc5dd2c),_=a(0x210501b8f),y=a(0x223000f76),x=a.n(y);let v=new r.Ay("workflow_builder"),E={elementType:f.ElementType.MENU_ITEM,onClick:{enableClogAction:!0}},k={[b.zW]:"from_a_link",[b.LO]:"on_a_schedule",[`${b.kr}${m.$.UserJoinedChannel}`]:"member_joins_channel",[`${b.kr}${m.$.ReactionAdded}`]:"emoji_reaction",[b.bX]:"from_webhook",[b.SJ]:"salesforce_event"},TriggerOption=({label:e,icon:t,type:a,subtype:r,serviceConfig:l})=>{let i=(0,o.wA)(),s=(0,n.useMemo)(()=>k[`${a}${r}`]??r??a,[r,a]),m=(0,p.Y)(),b=(0,n.useCallback)(()=>{i((0,g.k)({triggerType:(0,h.k)(a),subtype:r,submitLabel:v.t("Continue"),workflowId:m,hasExistingWorkflow:!!m,serviceConfig:l}))},[i,a,r,m,l]),f=(0,n.useMemo)(()=>({...E,elementValue:s}),[s]),y=v.t("Salesforce Icon",{ns:"data_sources"}),S=v.t("App icon"),w=(0,n.useMemo)(()=>(0,u.sC)(s)?n.createElement("img",{alt:y,className:"c-icon",src:_}):l?n.createElement("img",{alt:S,className:"c-icon",src:l.function.app?.icons?.image_32??""}):"string"==typeof t?n.createElement(d.Ah,{name:t,inline:!0,size:"20"}):t,[S,t,s,y,l]);return n.createElement(c.A,{onClick:b,"data-qa":`scratch-start-trigger-${s}-button`,className:x().triggerOptionBtn,autoClogProps:f},w,e)};TriggerOption.displayName="TriggerOption";let S=new r.Ay("workflow_builder"),TriggerOptionsList=()=>{let{triggerTypesWithAvailability:e,isLoading:t,isError:a}=(0,s.c)(),r=(0,n.useMemo)(()=>t?n.createElement(i.A,{color:"white"}):a?n.createElement(l.Ay,{level:l.A_.error},S.t("We\u2019re having some issues loading the ways you can start a workflow. Try refreshing or contact us if the issue persists.")):e.filter(e=>e.isAvailable).map(({triggerType:e})=>n.createElement(TriggerOption,{key:`${e.type}-${e.subtype??""}`,icon:e.icon,label:e.label,type:e.type,subtype:e.subtype??"",serviceConfig:e.serviceConfig})),[a,t,e]);return n.createElement("div",null,r)};TriggerOptionsList.displayName="TriggerOptionsList"},0x1cb9794d5:(e,t,a)=>{"use strict";a.d(t,{d:()=>n.d});var n=a(0x6a40f0b8)},0x6a40f0b8:(e,t,a)=>{"use strict";a.d(t,{d:()=>TokenizedArray,m:()=>g});var n,r=a(0xbad225b5),l=a(0x21f3c49e8),i=a(0x1407c6c2c),s=a(0x20482ad21),o=a(0x1d2cd7755),c=a(0xf33a4f91),d=a(0xbbd2a32d),u=a(0xb214261e),m=a(0x207fb9b92),p=a(0xab53bfe6),b=a.n(p);let f=new s.Ay("workflow_builder");var g=((n={})[n.Number=0]="Number",n[n.Integer=1]="Integer",n);let TokenizedArray=({value:e,ariaLabel:t,onChange:a,placeholderText:n,required:s,elementId:p,validation:g,className:h,disableIdParsing:_=!1,splitOnWhitespace:y=!0,isDisabled:x=!1})=>{let v=(0,i.A)(),E=p||v,k=s?t:` ${f.t("{ariaLabel} (optional)",{ariaLabel:t,fallbackHashNs:"app_dialog",fallbackHash:"b16c7ac6faff07d7e255da685e52bd66d3bf1575"})}`,[S,w]=(0,r.useState)(""),C=s&&(0,l.A)(e),{errorText:A,onBlur:T}=(0,m.K)({errorMessage:f.t("This field is required."),isErrored:C,shouldErrorPreventSave:!0}),I=(0,r.useCallback)(e=>{switch(g){case 0:return(0,d.gf)(Number(e));case 1:return(0,d.gf)(Number(e))&&(0,d.zh)(Number(e));default:return!0}},[g]),N=(0,r.useCallback)((e,t)=>{a(e,!e.every(I)),w(t)},[a,I]),M=f.t("This is not a valid number."),F=f.t("This is not a valid integer."),O=(0,r.useCallback)(e=>{if(!I(e))switch(g){case 0:return M;case 1:return F;default:return}},[I,g,M,F]),L=(0,r.useCallback)((e,t)=>{let a=O(e);return{key:`${t}-${e}`,label:e,value:e,isError:null!=a,hoverText:a}},[O]);return r.createElement(o.A,{htmlFor:E,text:k,"data-qa-segment-parameter":"tokenized-array-input-label",className:b().inlineLabel},r.createElement(u.G,{ariaLabel:E,className:h,tokenizedItems:e,untokenizedText:S,makeOption:L,onChange:N,isInvalid:!!A,errorMessage:A,onBlur:T,splitQuery:y?void 0:c.r0,placeholderText:n,ariaLabelledBy:E,focusOnMount:!0,disableIdParsing:_,isDisabled:x}))};TokenizedArray.displayName="TokenizedArray"},0x1dbeaaa0b:(e,t,a)=>{"use strict";a.d(t,{I:()=>isActionLibrarySearchShortcut});var n=a(0x62a17882);let isActionLibrarySearchShortcut=e=>!!("f"===e.key&&!e.shiftKey&&!e.altKey&&((0,n.cX)()&&e.metaKey&&!e.ctrlKey||!(0,n.cX)()&&e.ctrlKey))||!1},0x21453d73b:(e,t,a)=>{"use strict";a.d(t,{A0:()=>o,Dx:()=>d,G6:()=>w,IO:()=>A,Jh:()=>b,RP:()=>u,SY:()=>s,Th:()=>y,To:()=>I,U5:()=>m,VK:()=>f,W2:()=>p,WE:()=>E,aM:()=>n,ad:()=>F,cE:()=>h,dN:()=>c,fH:()=>r,h7:()=>T,hU:()=>v,jn:()=>k,nK:()=>M,nw:()=>S,qn:()=>i,sm:()=>g,tM:()=>l,tS:()=>_,uT:()=>N,wK:()=>C,wh:()=>x}),(0,a(0x18dac2b8e).Cu)();let n="invite_user_to_channel",r="send_message",l="send_dm",i="open_form",s="ai_answer",o="add_spreadsheet_row",c="Google Sheets",d="list_add_record",u="share_canvas",m="add_canvas_to_channel_tab",p="channel_canvas_create",b="canvas_update_content_v2",f=["canvas_create","channel_canvas_create","canvas_copy","canvas_create_from_template"],g="Send a message to a channel",h="Send a message to a person",_="Add to spreadsheet",y="Open a Form",x="builtin",v="builtin",E="builtin",k="app",S="send_summary_to_sales_home",w="builtin",C="Send Summary To Sales Home",A="send_summary_to_my_sales_home",T="builtin",I="Send Summary To My Sales Home",N="lookup_record_channel",M="create_record_channel",F="case_step"},0x1fbc3c543:(e,t,a)=>{"use strict";a.d(t,{m:()=>r});var n,r=((n={}).SEND_DM_TO_REQUESTER="send_dm_to_requester",n.OPEN_FORM="open_form",n.SEND_MESSAGE_TO_CHANNEL="send_message_to_channel",n.SEND_COLLECT_CHECKIN_MESSAGE_TO_CHANNEL="send_collect_checkin_message_to_channel",n.SEND_TOPICS_REMINDER_TO_CHANNEL="send_topics_reminder_to_channel",n.SEND_TOPICS_MESSAGE_TO_CHANNEL="send_topics_message_to_channel",n.OPEN_TOPICS_FORM="open_topics_form",n.SEND_DM_TO_MANAGER="send_dm_to_manager",n.OPEN_PTO_FORM="open_pto_form",n.OPEN_APPROVAL_FORM="open_approval_form",n.SEND_INITAL_KUDOS_DM_TO_REQUESTER="send_inital_kudos_dm_to_requester",n.OPEN_KUDOS_FORM="open_kudos_form",n.SEND_KUDOS_DM="send_kudos_dm",n.SEND_AMA_REMINDER_TO_CHANNEL="send_ama_reminder_to_channel",n.SEND_AMA_MESSAGE_TO_CHANNEL="send_ama_message_to_channel",n.SEND_AMA_CONCLUSION_TO_CHANNEL="send_ama_conclusion_to_channel",n.TRIGGER="trigger",n.SEND_MESSAGE="send_message",n.INVITE_USER="invite_user",n.CREATE_CHANNEL="create_channel",n.ADD_SPREADSHEET_ROW="add_spreadsheet_row",n.JOIN_CHANNELS="join_channels",n.CREATE_JIRA_ISSUE="create_jira_issue",n)},0x30d8960c:(e,t,a)=>{"use strict";a.d(t,{I6:()=>n,hf:()=>r,kr:()=>l});let n="start-workflow-subtitle-id",r="missing-segment-button",l="add-hermes-workflow-step-button"},0xf6b2f43b:(e,t,a)=>{"use strict";a.d(t,{U:()=>r,u:()=>useWorkflowViewOnly});var n=a(0xbad225b5);let r=(0,n.createContext)(!1),useWorkflowViewOnly=()=>!!(0,n.useContext)(r)},0x647f4f35:(e,t,a)=>{"use strict";a.d(t,{k:()=>useAiStepPrivateChannelAccess});var n=a(0xbe0b63ff),r=a(0x1795d8821),l=a(0x226892387),i=a(0x16af7d0de),s=a(0x3b8174d2);let useAiStepPrivateChannelAccess=({callbackId:e})=>{let t=e===r.oW.AiAnswer,a=(0,l.d4)(e=>t?(0,s.hj)(e,i.Ez.ai_answer,!1):null);if(!t||!a||(0,n.mX)(a)||(0,n.lv)(a))return{aiStepPrivateChannelAccess:void 0,aiStepPrivateChannelTeamIds:void 0};let o=a.product_level_availability,c=o?.private_channel_access;return{aiStepPrivateChannelAccess:void 0===c?void 0:c!==r.Pj.NoOne,aiStepPrivateChannelTeamIds:c===r.Pj.NamedEntities?o?.private_channel_team_ids:void 0}}},0x24de3d958:(e,t,a)=>{"use strict";a.d(t,{K:()=>useAvatarCropState});var n=a(0xbad225b5),r=a(0x2440854b3),l=a(0x8ed4913f),i=a(0x44240292);let useAvatarCropState=(e,t)=>{let[a,s]=(0,n.useState)({}),o=(0,n.useMemo)(()=>({width:a?.width,height:a?.height,src:e}),[e,a?.height,a?.width]),c=(0,n.useMemo)(()=>(({crop:e,imageWidth:t,imageHeight:a})=>{let{displayWidth:n,displayHeight:i}=(0,l.A)({width:t,height:a,maxSize:r.Vt}),s=Math.max(1,a/i),o=Math.max(1,t/n),c=e.x*o;return{fullCropX:c,fullCropY:e.y*s,fullCropSize:e.width*o}})({crop:t,imageWidth:a.width||0,imageHeight:a.height||0}),[t,a.height,a.width]);return(0,n.useEffect)(()=>{(0,i.A)(e).then(({width:e,height:t})=>s({width:e,height:t}))},[e]),{cropData:c,imageData:o}}},0x20f6327e1:(e,t,a)=>{"use strict";a.d(t,{A:()=>d,V:()=>useAvatarUploadState});var n,r=a(0xbad225b5),l=a(0x16cf1da63),i=a(0x2440854b3),s=a(0xe874a88a),o=a(0x44240292);function validateImage(e,t){return new s.S((a,n)=>{if(!i.i_.includes(e.type))return void n(Error(i.DV));if(e.size>i.w3)return void n(Error(i.fw));let r=new window.FileReader;r.onload=e=>{let l=e?.target?.result;r.onload=null,(0,o.A)(l).then(({width:e,height:r})=>{e>i.g_||r>i.g_?n(Error(i.P1)):e<t||r<t?n(Error(i.dW)):a({dataUrl:l})}).catch(e=>n(e))},r.readAsDataURL(e)})}var c=a(0x1ed79bf71),d=((n={}).UPLOADING="uploading",n.ERROR="error",n.SUCCESS="success",n);let useAvatarUploadState=e=>{let t=(0,l.wA)(),[a,n]=(0,r.useState)({status:"uploading",avatarUrl:null,imageId:null,error:null});return(0,r.useEffect)(()=>{e&&(n({status:"uploading"}),validateImage(e,i.Yh).then(()=>t((0,c.W8)({file:e}))).then(({url:e,id:t})=>n({status:"success",imageId:t,avatarUrl:e})).catch(e=>n({status:"error",error:e.message})))},[e,t]),a}},0x13cd04b48:(e,t,a)=>{"use strict";a.d(t,{DJ:()=>getLabelFromExpressionData,Ox:()=>useExpressionData,SD:()=>buildExpressionDataSourceMap,w:()=>getVarNameFromExpressionReference});var n=a(0x20482ad21),r=a(0x20570d71a),l=a(0x66c6b26d),i=a(0x20adb28cd),s=a(0x226892387);let o=new n.Ay("workflow_builder"),{BUTTON:c,DROPDOWN:d,EMOJI:u}={BUTTON:"button",DROPDOWN:"dropdown",EMOJI:"emoji"};function useExpressionData(){let e=(0,r.Y)(),t=(0,s.d4)((0,l.sx)(e,i.RG));return t?.expressionData}let getLabelFromExpressionData=({expressionDataObject:e,returnOnlyVariableText:t,isUnsupportedRichTextDropdownType:a})=>{let{type:n,content:r}=e;if(!r)return"";let l="";if(n===c&&"string"!=typeof r){let e=r.text.text??"";l=o.t("User clicked button: {buttonName}",{buttonName:e}),t&&(l=e)}if(n===d&&"string"!=typeof r)if(a)l=o.t("Update your Form step dropdown options to use them here.");else{let e=r.title;l=o.t("User picked option: {dropdownOptionTitle}",{dropdownOptionTitle:e})}if(n===u){let e=`:${r}:`;l=o.t("User reacted with: {emojiName}",{emojiName:e}),t&&(l=e)}return l},buildExpressionDataSourceMap=e=>{if(!e)return;let t={};for(let a of Object.values(e)){let{sourceStep:e}=a;if(!e)continue;let n=t[e]||[];n.push(a),t[e]=n}return t},getVarNameFromExpressionReference=e=>{let t=".fields.";if(!e||-1===e.indexOf(t))return"";let a=e.indexOf(t)+t.length,n=e.slice(a),r=n.indexOf(".");return n.slice(0,r)}},0x172b62bb9:(e,t,a)=>{"use strict";a.d(t,{O9:()=>useFilteredVariablesForPrivateChannels,VQ:()=>hasPrivateChannel});var n=a(0xbad225b5),r=a(0x20482ad21),l=a(0x61c95b1b),i=a(0x96aa1794),s=a(0x21eb6624c),o=a(0x159b87895),c=a(0x12185e091),d=a(0x145d46a61),u=a(0x226892387);let m=new r.Ay("workflow-builder"),hasPrivateChannel=e=>!!e&&0!==e.length&&e.some(e=>(0,c.Zp)(e)),isTextVariable=e=>"trigger"===e.source&&"{{data.blocks}}"===e.sourceReference,useFilteredVariablesForPrivateChannels=({variables:e,callbackId:t,isTriggerSegment:a=!1})=>{let r=(0,i.j)(),c=(0,u.d4)(d.sQ),{privateChannelMessage:p}=(0,o.U)({workflow:r,isLatestWorkflowData:!0,callbackId:t,isTriggerSegment:a}),b=(0,n.useMemo)(()=>r?.trigger&&r.trigger.channel_ids||[],[r]),f=(0,u.d4)(e=>e.channels),g=(0,n.useMemo)(()=>b.map(e=>f?.[e]),[b,f]),h=c?m.t("permission required"):"permission required";return(0,n.useMemo)(()=>(({variables:e,triggerSubtype:t,triggerChannels:a,privateChannelMessage:n,disabledReason:r})=>{if(!e)return e;let i=t===l.$.MessagePosted,o=hasPrivateChannel(a);return i&&o&&!1===n?(0,s.Z)(e,isTextVariable,r):e})({variables:e,triggerSubtype:r?.trigger?.subtype,triggerChannels:g,privateChannelMessage:p,disabledReason:h}),[e,r?.trigger?.subtype,g,p,h])}},0x203b19061:(e,t,a)=>{"use strict";a.d(t,{A:()=>useFilteredVariables});var n=a(0x20482ad21),r=a(0x21eb6624c),l=a(0x145d46a61),i=a(0x1795d8821),s=a(0x1d600678),o=a(0x226892387);let c=new n.Ay("workflow-builder");var d=a(0x172b62bb9);let useFilteredVariables=({variables:e,callbackId:t,isTriggerSegment:a})=>(({variables:e,callbackId:t,isTriggerSegment:a=!1})=>{let n=(0,o.d4)(l.dI),d=(0,o.d4)(l.EI),u=(0,o.d4)(e=>(0,s.x)(e,"slack_ai_files_search_opt_out")),m=u?.all_file_opt_out??!1,p=n?c.t("disabled for step"):"disabled for step",b=n?c.t("Files are disabled by your admin"):"Files are disabled by your admin";if(!e||t!==i.oW.AiAnswer||a)return e;let f=e;return d&&(f=(({variables:e,disabledReason:t})=>(0,r.Z)(e,e=>"trigger"===e.source&&e.type===i.TE.SlackTypesCanvasId,t))({variables:(({variables:e,disabledReason:t})=>(0,r.Z)(e,e=>"trigger"===e.source&&e.type===i.TE.SlackTypesChannelId,t))({variables:f,disabledReason:p}),disabledReason:p})),m&&(f=(({variables:e,disabledReason:t})=>(0,r.Z)(e,e=>(e.type===i.TE.Array?e.items?.type:e.type)===i.TE.SlackTypesFileId,t))({variables:f,disabledReason:b})),f})({variables:(0,d.O9)({variables:e,callbackId:t,isTriggerSegment:a}),callbackId:t,isTriggerSegment:a})},0x21eb6624c:(e,t,a)=>{"use strict";a.d(t,{Z:()=>updateVariablesWithFilter});let updateVariablesWithFilter=(e,t,a)=>{let disableVariablesWithFilter=e=>t(e)?{...e,isDisabled:!0,isAvailable:!1,disabledReason:a}:e,n=e.list.map(disableVariablesWithFilter),r=e.groups.map(e=>({...e,data:e.data.map(disableVariablesWithFilter)}));return{...e,list:n,groups:r}}},0x159b87895:(e,t,a)=>{"use strict";let n;a.d(t,{U:()=>useMessagePostedPrivateChannelAccess});var r=a(0xbad225b5),l=a(0x1887f3464),i=a(0x145d46a61),s=a(0x1795d8821),o=a(0x226892387);let c=!1,useMessagePostedPrivateChannelAccess=({workflow:e,isLatestWorkflowData:t,callbackId:a,isTriggerSegment:d})=>{let u=(0,o.d4)(i.sQ),{triggerTypesWithAvailability:m}=(0,l.c)({appId:void 0,skip:c||!u||!t});return(0,r.useMemo)(()=>{let r,l,i;if(c&&n)return n;if(!t||!u||0===m.length||!e)return{privateChannelAccess:void 0,privateChannelMessage:void 0,privateChannelTeamIds:void 0};if(e.trigger){let t=e.trigger;r=t.type,l=t.subtype||t.event?.event_type}else{if(!d||"message_posted"!==a)return{privateChannelAccess:void 0,privateChannelMessage:void 0,privateChannelTeamIds:void 0};r="event",l="slack#/events/message_posted"}let o=m.find(({triggerType:e})=>e.type===r&&(e.subtype&&l?e.subtype===l:!e.subtype&&!l)),p=o?.privateChannelAccess;"boolean"==typeof p?i=p:"string"==typeof p&&(i=p===s.Pj.Everyone||p===s.Pj.NamedEntities);let b=p===s.Pj.NamedEntities?o?.privateChannelTeamIds:void 0,f={privateChannelAccess:i,privateChannelMessage:o?.privateChannelMessage,privateChannelTeamIds:b};return o&&(n=f,c=!0),f},[t,e,u,m,a,d])}},0xb8ff08bd:(e,t,a)=>{"use strict";a.d(t,{f:()=>useSegmentPermissionErrorCode});var n=a(0xbad225b5),r=a(0x118f04a01),l=a(0x61c95b1b),i=a(0xf7ab484f),s=a(0x172b62bb9),o=a(0x159b87895),c=a(0x136bd1488),d=a(0x145d46a61),u=a(0x226892387);let m=/__blocks\}\}/,useSegmentPermissionErrorCode=({workflow:e,segment:t,isTrigger:a})=>(({workflow:e,segment:t,isTrigger:a})=>{let p=(0,u.d4)(d.sQ),b=e?.trigger?.subtype===l.$.MessagePosted,{privateChannelAccess:f,privateChannelTeamIds:g,privateChannelMessage:h}=(0,o.U)({workflow:e,isLatestWorkflowData:!0,callbackId:void 0,isTriggerSegment:!0}),_=(0,n.useMemo)(()=>t&&(0,c.s)(t)&&t.config.event?t.config.event.channelIds||[]:e?.trigger&&e.trigger.channel_ids||[],[t,e]),y=(0,u.d4)(e=>e.channels),x=(0,n.useMemo)(()=>_.map(e=>y?.[e]),[_,y]),v=(0,s.VQ)(x),E=(0,n.useMemo)(()=>!!p&&!!b&&!!v&&(0,r.Ps)(x,f,g),[p,b,v,f,g,x]),k=(0,n.useMemo)(()=>{if(!p||!b||!v||!1!==h)return[];let t=e?.workflow?.steps||[],a=[];return t.forEach(e=>{(e=>{if(!e)return!1;try{return m.test(JSON.stringify(e))}catch{return!1}})(e.inputs)&&a.push(e.id)}),a},[e,p,b,v,h]);if(p){if(a&&E)return i.Jx;if(!a&&k.includes(t.id))return i.yF}})({workflow:e,segment:t,isTrigger:a})},0x162e18dce:(e,t,a)=>{"use strict";a.d(t,{E:()=>useSegmentWrappedFunctionDetails});var n=a(0x1bffa495d),r=a(0x226892387);let useSegmentWrappedFunctionDetails=e=>(0,r.d4)(t=>(0,n.MZ)(t,e))},0x1bb241cc1:(e,t,a)=>{"use strict";a.d(t,{S:()=>useStickyHeaderClass});var n=a(0xbad225b5);let useStickyHeaderClass=(e,t={})=>{let a=n.useRef(null);return(0,n.useEffect)(()=>{let{current:n}=a;if(!n||!window.IntersectionObserver)return;let r=t.threshold||(e=>{let t=Math.abs(Number(window.getComputedStyle(e).top.replace("px",""))),{height:a}=e.getBoundingClientRect();return Math.ceil((1-t/a)*100)/100})(n),l=new IntersectionObserver(([t])=>{t.target.classList.toggle(e,t.intersectionRatio<r)},{threshold:r,...t});return l.observe(n),()=>{l.unobserve(n),l.disconnect()}},[a,t,e]),a}},0xa4606544:(e,t,a)=>{"use strict";a.d(t,{q:()=>f});var n=a(0xbad225b5),r=a(0x20482ad21),l=a(0x409e023f),i=a(0x1a5ac3a0c),s=a(0x11c82607b),o=a(0x1123a239c),c=a(0x24fc5dd2c),d=a(0x20adb28cd),u=a(0x19561ce96),m=a(0x95c66692),p=a(0x46dbff89);let b=new r.Ay("workflow_builder"),f=(0,s.Ay)("Open modal to configure a trigger",async(e,t,{appId:a,type:r,subtype:s,serviceConfig:f,workflowId:g,onNavigateBack:h})=>{let _=t(),y=(0,u.n_)(_,a),x=(0,d.RG)(_,g),v=(0,i.eR)(x),onRequestAppModal=async()=>{e((0,p.q)({element:n.createElement(l.u,{appId:a})}))};onRequestAppModal.displayName="onRequestAppModal";let openTriggerModal=()=>{r&&e((0,o.k)({triggerType:(0,c.k)(r),subtype:s,submitLabel:b.t("Continue"),hasExistingWorkflow:!0,existingTrigger:v,workflowId:g,serviceConfig:f,onNavigateBack:h}))};y?e((0,m.u)({appId:f?.function?.app_id,appName:f?.function?.app?.name,onOpenModal:openTriggerModal,onRequestAppModal,reason:"trigger-events-sidebar/install-connector-app"})):openTriggerModal()});f.meta={name:"openTriggerConfigurationModal",key:"createThunkOpenTriggerConfigurationModal",description:"Open modal to configure a trigger"}},0x135b7b386:(e,t,a)=>{"use strict";a.d(t,{EG:()=>l,Id:()=>o,Nn:()=>c,YE:()=>r,wo:()=>i,y:()=>s});var n=a(0x18dac2b8e);let r="A014GBNBJ59",l="A04MG80N5CY",i=(0,n.Cu)()?r:l,s=(0,n.Cu)()?"A0150E985M0":"A05P4475DFY",o=(0,n.Cu)()?"A014LHD2ATV":"A050C90PUF5",c=(0,n.Cu)()?"A0154SFF675":"A05UG04QC4X"},0x4363d33f:(e,t,a)=>{"use strict";a.d(t,{k:()=>M});var n=a(0xbad225b5),r=a(0xbe0b63ff),l=a(0xd2c5015d),i=a(0xf77002c6),s=a(0xe6eaaf8c),o=a(0x1db887024),c=a(0x127c49a8d),d=a(0x126eb9491);let u=new(a(0x20482ad21)).Ay("workflow_builder"),SaveNewStepErrorMessage=({error:e})=>{let t="";switch((e||{}).name){case"invalid_primary_column":t=u.t("This list couldn\u2019t be created because it requires the first field to be text.",{fallbackHash:"97511c5bbd44082acfbd7098ef04040167986c51"});break;case"insufficient_posting_permissions":t=u.t("This workflow can\u2019t post to this channel because you don\u2019t have permission to post there. Ask a channel manager for help.",{fallbackHash:"97511c5bbd44082acfbd7098ef04040167986c51"});break;default:t=u.t("Sorry, there was a problem trying to add your step.")}return n.createElement("span",null,t)};SaveNewStepErrorMessage.displayName="SaveNewStepErrorMessage";let UpdateStepErrorMessage=({error:e})=>{let t="";return t="invalid_primary_column"===(e||{}).name?u.t("This list couldn\u2019t be created because it requires the first field to be text.",{fallbackHash:"73e5ac81cdcc64e62bf01743450574b23f84a56b"}):u.t("Sorry, there was a problem trying to update your step."),n.createElement("span",null,t)};UpdateStepErrorMessage.displayName="UpdateStepErrorMessage";var m=a(0x22c41b907),p=a(0x1a5ac3a0c),b=a(0x241a08725),f=a(0x1bffa495d),g=a(0xaaa6bbd0),h=a(0x252b4df6e),_=a(0x171a52b74),y=a(0x36e8c71e),x=a(0x145d46a61),v=a(0x1795d8821),E=a(0x11c82607b),k=a(0x4a9c61a9),S=a(0x1c09d8c36),w=a(0x135b7b386);let hasCustomSave=e=>{let t=[w.YE,w.EG],a=[S.rr];return!!(e.config.slackFunction?.type==="builtin"&&a.includes(e.config.slackFunction.id)||"string"==typeof e.config.slackFunction?.app_id&&t.includes(e.config.slackFunction.app_id))},C=[v.oW.CreateCanvas,v.oW.CreateChannelCanvas,v.oW.UpdateCanvasContent,v.oW.UpdateCanvasVariables,v.oW.SendToSalesHome];var A=a(0x4e250925),T=a(0x3b8174d2),I=a(0xe684f705),N=a(0x46dbff89);let M=(0,E.Ay)("Open the segment form modal for a workflow step",async(e,t,{stepType:a,existingStep:u,workflow:E,afterStepId:S,slackFunction:w,inputs:M,isFormWrapped:F,onCancel:O,onNavigateBack:L})=>{let D=(0,p.DY)(E),P=t(),R=(0,x.$T)(P),B=(0,I.cA)(P);u||e((0,k.YE)(S));let W=u?t=>(0,_.GS)(t)&&hasCustomSave(t)?e((0,A.xL)({workflow:E,segment:t,afterStepId:S,isEdit:!!u})):e((0,A.nv)({workflowId:D,segment:t})):t=>(0,_.GS)(t)&&hasCustomSave(t)?e((0,A.xL)({workflow:E,segment:t,afterStepId:S,isEdit:!!u})):e((0,A.zJ)({workflowId:D,afterStepId:S,segment:t,stepType:a?.subtype})),V=u?void 0:(0,p.TT)(E,S),q=u?e=>n.createElement(UpdateStepErrorMessage,{error:e}):e=>n.createElement(SaveNewStepErrorMessage,{error:e}),H=u||(0,b.e)(a?.type,{derivedData:V,featureFlags:{},member:B,subtype:a?.subtype,inputs:M,teamId:void 0}),U=m.k.DEFAULT;if(H.type===y.SLACK_FUNCTION){let e=w??(0,h.Dl)(H),t=(0,g.lK)(H),a=(0,f.MZ)(P,H);if(R?((0,g.Pv)(H)?u?(H.config.isFunctionFormWrappable=!0,H.config.isFunctionFormWrapped=!0,H=(0,h.Xh)(H,e)):(0,r.uz)(a)&&(H=(0,g.Dq)(H,a,R)):(H.config.isFunctionFormWrappable=!!e&&(0,l.R)({stepFunction:e}),H=(0,h.we)(H,e)),!u&&F&&(H.config.isFunctionFormWrapped=H.config.isFunctionFormWrappable,H=(0,c.i)(H,void 0,R))):((0,g.Pv)(H)&&t&&(0,r.uz)(a)&&(e=(H=(0,g.Dq)(H,a,R)).config.slackFunction),(H=(0,h.we)(H,e)).config.isFunctionFormWrappable=!!e&&(0,l.R)({stepFunction:e})),R){let e=(0,g.Pv)(H),t=(0,h.Dp)(H),n=(0,p.Dv)(S||"",E.workflow),l=S&&n&&(0,s.Z)(n)&&n.function.callback_id===v.oW.OpenForm,c=t&&!C.includes(t),d=e?a?.input_parameters:(0,h.ln)(H),b=d?.some(e=>(0,i.oO)(e));if(c&&(b||H.config.isFunctionFormWrappable)){if(u)U=e?m.k.THIRD_PARTY_USER_FORM_CONFIG:m.k.CHILD_INPUTS;else if(U=H.config.isFunctionFormWrappable&&!F?m.k.FORM_WRAPPED_SELECTION:m.k.PARENT_INPUTS,l&&t===v.oW.AddListRecord&&(U=m.k.PARENT_INPUTS),!b&&F){let e=(0,T.hj)(P,o.QF);(0,r.GU)(e)||(H=(0,g.$c)(H,e),U=m.k.THIRD_PARTY_USER_FORM_CONFIG)}}}(0,h.Dp)(H)===v.oW.AiAnswer&&(U=m.k.AI_STEP_DEFAULT)}e((0,N.q)({element:n.createElement(d.G,{segment:H,onSave:W,renderSaveError:q,afterStepId:S,isExistingSegment:!!u,isTrigger:!1,onCancel:O,defaultPane:U,onNavigateBack:L})}))});M.meta={name:"openStepFormModal",key:"createThunkOpenStepFormModal",description:"Open the segment form modal for a workflow step"}},0x1123a239c:(e,t,a)=>{"use strict";a.d(t,{k:()=>f});var n=a(0xbad225b5),r=a(0x1db69cda),l=a(0x126eb9491),i=a(0x426feba4),s=a(0x241a08725),o=a(0x52fc4a0c),c=a(0x126af815a),d=a(0x11c82607b),u=a(0x16e94c2bd),m=a(0x4e250925),p=a(0xe684f705),b=a(0x46dbff89);let renderSaveError=e=>n.createElement(i.y,{error:e}),f=(0,d.Ay)("Open the trigger options modal when creating a new `Start from scratch` workflow or creating a ways to start trigger from the sidebar",(e,t,{triggerType:a,channelId:i,subtype:d,submitLabel:f,serviceConfig:g,hasExistingWorkflow:h,existingTrigger:_,workflowId:y,onNavigateBack:x}={})=>{var v;let E,k=t(),S=(0,p.cA)(k),w=(v=(0,s.e)(a,{channelId:i,member:S,featureFlags:{},subtype:d,serviceConfig:g}),(E=(0,r.A)(v)).config={...E.config},E);if(w.type===c.YV){let e=w.config.service.function;w=(0,o.$v)(w,e)}let onSave=async t=>{if(_&&y){let a=t.coachmarkText,n=(0,u.yO)(t,y);n.name=_.config.name,e((0,m._v)({workflowId:y,triggerUpdate:n,coachmarkText:a}))}else e((0,m.Kb)({existingWorkflowId:h?y:void 0,trigger:t}))};e((0,b.q)({element:n.createElement(l.G,{segment:w,onSave:onSave,renderSaveError:renderSaveError,submitLabel:f,isExistingSegment:!1,isTrigger:!0,onNavigateBack:x})}))});f.meta={name:"openTriggerOptionsModal",key:"createThunkOpenTriggerOptionsModal",description:"Open the trigger options modal when creating a new `Start from scratch` workflow or creating a ways to start trigger from the sidebar"}},0x1451d329d:(e,t,a)=>{"use strict";a.d(t,{L:()=>d});var n=a(0x1e4b6e4e6),r=a(0xcaea2334),l=a(0x8fb98cae),i=a(0x11571542c),s=a(0x1ec68d6a3),o=a(0x11c82607b),c=a(0xdb0578c7);let d=(0,o.Ay)("Create a hermes workflow from a template and display it for editing in the workflow builder",async(e,t,{payload:a})=>{if(!(0,r.I)(t()))return;let{templateId:o,templatePayload:d}=a;try{let t=(await e((0,i.k)({templateId:o,payload:d,creationSourceType:"advanced_template",reason:"create-template"}))).workflow_id;(0,l.Aj)({workflowId:t,templateId:o}),e((0,c.A)({source:"preview-template",route:{routeTo:n.E9.EDIT_WORKFLOW,workflowId:t}}))}catch(e){throw(0,s.default)({getState:t}).error("WORKFLOW_BUILDER","Error showing a new Hermes workflow:",e),e}});d.meta={name:"showCreateHermesWorkflowFromTemplate",key:"createThunkShowCreateHermesWorkflowFromTemplate",description:"Create a hermes workflow from a template and display it for editing in the workflow builder"}},0x22678e203:(e,t,a)=>{"use strict";a.d(t,{eF:()=>i,ig:()=>r,rI:()=>o,vX:()=>selectDatasources});var n=a(0xc9c97240);let r=(0,n.Mz)([e=>e?.workflowBuilder?.workflowEditor?.schemaObjects??{},(e,t)=>t],(e,t)=>e?.[t]),l={},i=(0,n.Mz)([e=>e?.workflowBuilder?.workflowEditor?.schemaObjects??{},(e,t)=>t],(e,t)=>(t.forEach(t=>{let a=e?.[t];a&&(l[t]=a)}),l)),selectDatasources=e=>e?.workflowBuilder?.workflowEditor?.datasources,s={},o=(0,n.Mz)([e=>e?.workflowBuilder?.workflowEditor?.schemaObjects??{},(e,t)=>t],(e,t)=>0===t.length?s:t.filter(t=>e[t]).reduce((t,a)=>(t[a]={label:e[a].label,identifier:e[a].identifier},t),{}))},0x99e2bdae:(e,t,a)=>{"use strict";a.d(t,{Bh:()=>f,Fh:()=>x,Jc:()=>y,sv:()=>h});var n=a(0xa72c61bb),r=a(0x28d59ea1),l=a(0xbdbf0a38),i=a(0x1318fdf2a),s=a(0x1fd440889),o=a(0x1c7cb6e50),c=a(0x11c82607b),d=a(0x126492ec6),u=a(0x22678e203),m=a(0x1a7f6fce4),p=a(0x1f8f05a48);let b=(0,n.I)(),f=(0,c.Ay)("Fetch the datasources",async(e,t)=>{let a=await e((0,s.z)({appId:b,reason:"trigger_fetch_data_sources"})),n=a?.datasources??[];return e((0,d.gU)({datasources:n})),n});f.meta={name:"fetchDatasources",key:"createThunkFetchDatasources",description:"Fetch the datasources"};let g=(0,c.Ay)("Fetch the objects for the selected datasource",async(e,t,{datasourceId:a})=>{let n=(0,o.t)(await e((0,i.i)({datasourceId:a,reason:"trigger_fetch_data_source_objects"})));return e((0,d.Vh)({schemaObjects:n.objects})),n});g.meta={name:"innerFetchSchemaObjects",key:"createThunkInnerFetchSchemaObjects",description:"Fetch the objects for the selected datasource"};let h=(0,p.Ay)(g,3e3),_=(0,c.Ay)("Fetch the schema objects for the selected datasource and object",async(e,t,{datasourceId:a,schemaObjectId:n})=>{let r=t(),i=(0,u.ig)(r,n);if(i&&m._.isSchemaObjectWithFields(i)&&m._.isSchemaObjectWithChildren(i))return i;let{id:s,identifier:c,label:p,isUserObject:b,isActive:f,isTriggerSupported:g,isTokenAccessible:h,fields:_,childRelationships:y}=(0,o.t)(await e((0,l.O)({datasourceId:a,schemaObjectId:n,reason:"trigger_fetch_data_source_object_schema"}))),x={id:s,identifier:c,label:p,isUserObject:b,isActive:f,isTriggerSupported:g,isTokenAccessible:h,fields:_.map(e=>{let t=e?.relationships?.map(e=>(0,o.t)(e)),a=e?.options?.map(e=>(0,o.t)(e));return{...e,relationships:t,options:a}}),childRelationships:y};return e((0,d.Vh)({schemaObjects:[x]})),x});_.meta={name:"innerFetchDatasourceObjectsSchema",key:"createThunkInnerFetchDatasourceObjectsSchema",description:"Fetch the schema objects for the selected datasource and object"};let y=(0,p.Ay)(_,3e3),x=(0,c.Ay)("Fetch field references",async(e,t,{datasourceId:a,field:n,schemaObjectId:l,query:i})=>{let s=await e((0,r.J)({datasourceId:a,fieldId:n,schemaObjectId:l,query:i,reason:"trigger_fetch_field_references"}));return(0,o.t)(s)});x.meta={name:"fetchFieldReferences",key:"createThunkFetchFieldReferences",description:"Fetch field references"}},0x1ed79bf71:(e,t,a)=>{"use strict";a.d(t,{MS:()=>d,W8:()=>o,Zq:()=>c,z_:()=>s});var n=a(0x292cc606),r=a(0x21f32a55),l=a(0xcf658893),i=a(0x11c82607b);let s=(0,i.Ay)("Crop Workflow Avatar",(e,t,{id:a,x:r,y:l,width:i})=>e((0,n.s)({reason:"workflows_crop_workflow_avatar",avatar:a,cropbox:`${Math.round(r)},${Math.round(l)},${Math.round(i)}`})));s.meta={name:"cropWorkflowAvatar",key:"createThunkCropWorkflowAvatar",description:"Crop Workflow Avatar"};let o=(0,i.Ay)("Upload Workflow Avatar",(e,t,{file:a})=>e((0,r.Z)({reason:"workflows_upload_workflow_avatar",image:a})));o.meta={name:"uploadWorkflowAvatar",key:"createThunkUploadWorkflowAvatar",description:"Upload Workflow Avatar"};let c=(0,l.Ay)("Sets the teamId to use for missions.workflows requests");c.meta={name:"setWorkflowsPageMetadataTeamId",key:"createActionSetWorkflowsPageMetadataTeamId",description:"Sets the teamId to use for missions.workflows requests"};let d=(0,l.Ay)("Sets the teamId to use for admin missions requests");d.meta={name:"setTeamWorkflowsPageMetadataTeamId",key:"createActionSetTeamWorkflowsPageMetadataTeamId",description:"Sets the teamId to use for admin missions requests"}},0x1bffa495d:(e,t,a)=>{"use strict";a.d(t,{pA:()=>getSegmentIcon,Kb:()=>I,mV:()=>T,MZ:()=>M});var n=a(0x20482ad21),r=a(0x14149c126);let l=new n.Ay("workflow_builder"),i={getTitle:e=>"on"===(0,r._Z)(e,"wfb_repeaters_lookups")?l.t("Repeat a step"):"",getDescription:e=>"on"===(0,r._Z)(e,"wfb_repeaters_lookups")?l.t("Repeats steps for each item in a collection"):"",getIsEnabled:()=>!1,getIcon:()=>"refresh"};var s=a(0xaaa6bbd0);let o={getTitle:()=>"",getDescription:()=>"",getIsEnabled:()=>!1,getAppName:()=>"",getFunctionType:()=>""};a(0x171a52b74);let c=new n.Ay("workflow_builder"),d={getTitle:()=>c.t("Add a branch",{fallbackHash:"61cc55aa0453184734c3fa0b621eda6fa874bd83"}),getDescription:()=>"",getIsEnabled:()=>!1,getIcon:()=>"branch"};var u=a(0x36e8c71e),m=a(0xbad225b5),p=a(0x210501b8f);let b=new n.Ay("workflow_builder"),f={getTitle:()=>b.t("Customize how to start the workflow",{fallbackHash:"5695013e040ce5cadf7d7deb2e87ac2471bb0650"}),getDescription:()=>"Third party event trigger",getIsEnabled:()=>!1,getIcon:()=>m.createElement("img",{alt:b.t("Salesforce Icon",{ns:"data_sources"}),className:"c-icon",src:p})},g=new n.Ay("workflow_builder"),h={getTitle:()=>g.t("On a schedule"),getDescription:()=>"Template trigger description",getIsEnabled:()=>!1,getIcon:()=>"clock"},_=new n.Ay("workflow_builder"),y={getTitle:()=>_.t("From a webhook"),getDescription:()=>"Hermes webhook trigger",getIsEnabled:()=>!1,getIcon:()=>"webhook"},x=new n.Ay("workflow_builder"),v={getTitle:()=>x.t("Choose how to start the workflow"),getDescription:()=>"Service trigger",getIsEnabled:()=>!0,getIcon:()=>"code"},E=new n.Ay("workflow_builder"),k={getTitle:()=>E.t("From a link in Slack"),getDescription:()=>"Someone clicks a shortcut",getIsEnabled:()=>!1,getIcon:()=>"link"};var S=a(0x2385f51a9),w=a(0x126af815a),C=a(0x1cf0d97e1),A=a(0x3b8174d2);function getSegmentInfo(e){switch(e){case w.SJ:return f;case w.bX:return y;case w.LO:return h;case w.kr:return S.f;case w.zW:return k;case w.YV:return v;case u.SLACK_FUNCTION:return o;case u.SWITCH:return d;case u.LOOP:return i;default:return null}}let T=(0,C.Ay)((e,t)=>{let{type:a}=t;return!getSegmentInfo(a)});T.meta={name:"getSegmentTypeIsUnknown",key:"createSelectorGetSegmentTypeIsUnknown",description:(e,t)=>{let{type:a}=t;return!getSegmentInfo(a)}};let I=(0,C.Ay)((e,t)=>{let a=getSegmentInfo(t.type);return a?.getTitle?.(e,t.subtype)});I.meta={name:"getSegmentTitle",key:"createSelectorGetSegmentTitle",description:(e,t)=>{let a=getSegmentInfo(t.type);return a?.getTitle?.(e,t.subtype)}},(0,C.Ay)((e,t)=>{let a=getSegmentInfo(t.type);return a?.getDescription?.(e,t.subtype)??null}).meta={name:"getSegmentDescription",key:"createSelectorGetSegmentDescription",description:(e,t)=>{let a=getSegmentInfo(t.type);return a?.getDescription?.(e,t.subtype)??null}},(0,C.Ay)((e,t)=>{let a=getSegmentInfo(t.type);return a?.getAppName?.(e,t.subtype)??null}).meta={name:"getSegmentAppName",key:"createSelectorGetSegmentAppName",description:(e,t)=>{let a=getSegmentInfo(t.type);return a?.getAppName?.(e,t.subtype)??null}};let getSegmentIcon=(e,t)=>{let a=getSegmentInfo(e.type);return a&&a.getIcon?"event"===e.type?a.getIcon(e.subtype,t):a.getIcon(e.type,t):null},N=(0,C.Ay)((e,t,a)=>{let n=getSegmentInfo(t.type);return n?.getIsEnabled?.(e,t.subtype,a)??!1});N.meta={name:"getSegmentIsEnabled",key:"createSelectorGetSegmentIsEnabled",description:(e,t,a)=>{let n=getSegmentInfo(t.type);return n?.getIsEnabled?.(e,t.subtype,a)??!1}},(0,C.Ay)((e,t)=>{let a=getSegmentInfo(t.type);return a?.getIsAdvanced?.(e,t.subtype)??!1}).meta={name:"getSegmentIsAdvanced",key:"createSelectorGetSegmentIsAdvanced",description:(e,t)=>{let a=getSegmentInfo(t.type);return a?.getIsAdvanced?.(e,t.subtype)??!1}},(0,C.Ay)((e,t)=>{let a=getSegmentInfo(t.type);return a?.getFunctionType?.(e,t.subtype)||""}).meta={name:"getSegmentFunctionCallbackId",key:"createSelectorGetSegmentFunctionCallbackId",description:(e,t)=>{let a=getSegmentInfo(t.type);return a?.getFunctionType?.(e,t.subtype)||""}},(0,C.Ay)(e=>Object.values(u).reduce((t,a)=>N(e,{type:a})?[...t,a]:t,[])).meta={name:"selectEnabledStepTypes",key:"createSelectorSelectEnabledStepTypes",description:e=>Object.values(u).reduce((t,a)=>N(e,{type:a})?[...t,a]:t,[])};let M=(0,C.Ay)((e,t)=>{let a=(0,s.Pv)(t)&&(0,s.lK)(t);return a?t.config.wrappedSlackFunction??(0,A.hj)(e,a):void 0});M.meta={name:"selectWrappedFunctionDetails",key:"createSelectorSelectWrappedFunctionDetails",description:(e,t)=>{let a=(0,s.Pv)(t)&&(0,s.lK)(t);return a?t.config.wrappedSlackFunction??(0,A.hj)(e,a):void 0}}},0x1c27a9e4a:(e,t,a)=>{"use strict";a.d(t,{E:()=>getSegmentSubtype});var n=a(0x252b4df6e),r=a(0x36e8c71e),l=a(0x112dbb8f3),i=a(0x126af815a);let getSegmentSubtype=e=>{switch(e?.type){case r.SLACK_FUNCTION:return(0,n.g$)(e);case i.kr:return(0,l.vd)(e);default:return}}},0xee12becf:(e,t,a)=>{"use strict";a.d(t,{S:()=>getSegmentSummary});var n=a(0xbad225b5),r=a(0x20482ad21),l=a(0x1b3ecb90f),i=a(0x15a4ffb05),s=a(0x226892387),o=a(0x14149c126);let c=new r.Ay("workflow_builder"),LoopSummary=()=>{let e=(0,s.d4)(e=>"on"===(0,o._Z)(e,"wfb_repeaters_lookups"));return n.createElement("span",null,n.createElement(i.A,{text:e?c.t("Loop Function"):"Loop Function",emojiSize:l.lw.SMALL}))};LoopSummary.displayName="LoopSummary";var d=a(0xbe0b63ff),u=a(0x162e18dce),m=a(0x252b4df6e);let p=new r.Ay("workflow_builder");function DelaySummary({segment:e}){let t,a=(0,m.Iw)(e),r=a.minutes_to_delay?.value;if(r){let e=parseInt(r,10);if(e%1440==0){let a=e/1440;t=p.rt("Delay: {delayDisplay} {delayNumber, plural, =1 {day} other {days}}",{delayDisplay:String(a),delayNumber:a})}else if(e%60==0){let a=e/60;t=p.rt("Delay: {delayDisplay} {delayNumber, plural, =1 {hour} other {hours}}",{delayDisplay:String(a),delayNumber:a})}else t=p.rt("Delay: {delayDisplay} {delayNumber, plural, =1 {minute} other {minutes}}",{delayDisplay:r,delayNumber:e})}return n.createElement("span",null,r?t:"")}DelaySummary.displayName="DelaySummary";var b=a(0x15fb82076),f=a(0x2501a2cee),g=a(0x1c09d8c36),h=a(0x1795d8821),_=a(0xc4548bcd),y=a(0x159917868),x=a.n(y);let v=new r.Ay("workflow_builder");function GoogleSheetsSummary({segment:e}){let t=(0,m.Dl)(e),a=(0,m.Dp)(e),r=(0,m.Iw)(e),l=r.spreadsheet_id.value,i=`${g.BF}/${l}`,s=r.spreadsheet_id.label,o=(0,n.useCallback)(e=>{e.stopPropagation(),(0,_.A)(i)},[i]);if(!i||!s||"string"!=typeof l)return n.createElement("span",null,t?.title);let c=s[l],getSummaryLabel=()=>{switch(a){case h.Zk.AddSpreadsheetRow:return v.t("Add to");case h.Zk.SelectSpreadsheetRow:return v.t("Select from");case h.Zk.UpdateSpreadsheetRow:return v.t("Update");case h.Zk.DeleteSpreadsheetRow:return v.t("Delete from");default:return n.createElement("span",null,t?.title)}};return getSummaryLabel.displayName="getSummaryLabel",n.createElement("span",null,n.createElement("span",{className:x().title},getSummaryLabel()),n.createElement(b.A,{onClick:o},n.createElement("span",null,c),n.createElement("span",{className:x().icon},n.createElement(f.Ah,{name:"new-window",inline:!0,size:"20"}))))}GoogleSheetsSummary.displayName="GoogleSheetsSummary";var E=a(0x1e74dc307),k=a(0x668181b3),S=a(0x2772625d),w=a(0x20a2a54fa),C=a(0x247cf31a2),A=a(0xf4097f62),T=a(0x2dcb2e34),I=a.n(T);let N=new r.Ay("workflow_builder"),DynamicItemLabel=({label:e,variableSvgIcon:t})=>n.createElement("span",{className:I().variable_container},n.createElement(f.Ah,{inline:!0,size:"inherit",...t})," ",e??N.t("Missing Data")),getUserLabel=(e,t,a)=>{if(e.length>1)return N.t("{qty} people",{qty:e.length,fallbackHash:"b37554f695b15005fd23907b9488e0a8ad4bca5f"});let r=e[0];return(0,S.cn)(r)?n.createElement(DynamicItemLabel,{label:(0,k.x)(t.list,r)?.label,variableSvgIcon:a}):N.rt("@{user}",{user:n.createElement(A.A,{id:r,truncate:!0}),fallbackHash:"457d64a8b6c031bbf97653abb1689cab35c6261c"})};getUserLabel.displayName="getUserLabel";let getChannelLabel=(e,t,a)=>{if(e.length>1)return N.t("{qty} channels",{qty:e.length,fallbackHash:"18e03e2a37ba37df713f9665ef752fb8b40fc1e8"});let r=e[0];return(0,S.cn)(r)?n.createElement(DynamicItemLabel,{label:(0,k.x)(t.list,r)?.label,variableSvgIcon:a}):n.createElement(E.A,{channelId:r},n.createElement(C.A,{channelId:r,truncate:!0}))};function InviteToChannelSummary({segment:e}){let t=(0,m.Iw)(e),a=(0,w.EM)(e),r={name:"css"};if(!t.user_ids?.value||!t.channel_ids?.value)return n.createElement("span",null,N.rt("Invite to channel",{fallbackHash:"9a409d1a0f27bcc7944c5c19495e584fb26964d3",fallbackHashNs:"huddles"}));let l=[t.channel_ids?.value].flat(),i=getUserLabel([t.user_ids?.value].flat(),a,r),s=getChannelLabel(l,a,r);return n.createElement("span",null,N.rt("Invite {userLabel} to {channelLabel}",{userLabel:i,channelLabel:s,fallbackHash:"9a409d1a0f27bcc7944c5c19495e584fb26964d3",fallbackHashNs:"huddles"}))}getChannelLabel.displayName="getChannelLabel",InviteToChannelSummary.displayName="InviteToChannelSummary";let M=new r.Ay("workflow_builder");function SendEphemeralMessageSummary({segment:e}){let t=(0,m.Iw)(e),a=(0,w.EM)(e),r=t.channel_id?.value,l=t.user_id?.value,i=(0,m.Dl)(e),s={name:"css"};if("string"==typeof r&&"string"==typeof l){let e=(0,S.cn)(r),t=(0,S.cn)(l),i=e?(0,k.x)(a.list,r):null,o=t?(0,k.x)(a.list,l):null,c=i&&!i.isTombstone?i.label:M.t("Missing Data"),d=o&&!o.isTombstone?o.label:M.t("Missing Data"),u=t?n.createElement("span",{className:I().variable_container},n.createElement(f.Ah,{inline:!0,size:"inherit",...s})," ",d):n.createElement(A.A,{id:l}),m=e?n.createElement("span",{className:I().variable_container},n.createElement(f.Ah,{inline:!0,size:"inherit",...s})," ",c):n.createElement(E.A,{channelId:r},n.createElement(C.A,{channelId:r}));return n.createElement("span",null,M.rt('Send an "only visible to you" message to {user} in {channel}',{user:u,channel:m,fallbackHash:"2826a04933908bf2bc4143809f09f387840708b8"}))}return n.createElement("span",null,i?.title)}SendEphemeralMessageSummary.displayName="SendEphemeralMessageSummary";var F=a(0x16cf1da63),O=a(0x11a296110),L=a(0x125de1ee5),D=a(0x1e5781b84),P=a(0xcaee4748),R=a(0x238ee6f5d),B=a(0x154933c60),W=a(0xd6a16321),V=a(0xd843ab47),q=a(0x145d46a61),H=a(0x1ec68d6a3),U=a(0x21bfacd01),z=a(0x217553e42);let j=new r.Ay("workflow_builder");function SendMessageSummary({segment:e,hasErrors:t}){let a=(0,m.Iw)(e),r=(0,w.EM)(e),l=a.channel_id?.value,i=a.user_id?.value,o=(0,m.Dl)(e),c=(0,s.d4)(e=>(0,z.Pu)(e,i)),d=(0,s.d4)(U.V),u=(0,s.d4)(q.b2),{isChildWindow:p}=(0,n.useContext)(V.A),b=!d&&u&&!p,g=(0,F.wA)(),h=(0,n.useCallback)((e,t)=>{b&&(e.stopPropagation(),e.preventDefault(),g((0,L.p)({navProps:(0,W.pr)(t)})))},[g,b]),_=(0,n.useCallback)(async e=>{if(c)return void h(e,c.id);try{let t=await g((0,B.jP)({memberIds:[i],reason:"workflow_builder_send_message_summary"}));t?.channel?.id&&h(e,t.channel.id)}catch(e){(0,H.default)({label:"WORKFLOW-BUILDER"}).error("Failed to open DM in send message summary",e)}},[c,h,g,i]),y={name:"css"};if(l){if((0,S.cn)(l)){let e=(0,k.x)(r.list,l),t=e&&!e.isTombstone?e.label:j.t("Missing Data");return e&&t?n.createElement("span",null,j.rt("Send a message to <span>{dynamic_channel_label}</span>",{dynamic_channel_label:t},({text:e})=>n.createElement("span",{className:I().variable_container},n.createElement(f.Ah,{inline:!0,size:"inherit",...y})," ",e))):n.createElement("span",null,j.t("Sends a message to a channel"))}return n.createElement("span",null,j.rt("Send a message to {channel}",{channel:n.createElement(E.A,{openInClient:h,channelId:l},n.createElement(C.A,{channelId:l}),b?n.createElement("span",{className:I().splitViewIcon},n.createElement(f.Ah,{inline:!0,size:"inherit",name:"move-to-split-view"})):null)}))}if(i){if((0,S.cn)(i)){let e=(0,k.x)(r.list,i),t=e&&!e.isTombstone?e.label:j.t("Missing Data");return e&&t?n.createElement("span",null,j.rt("Send a message to <span>{dynamic_user_label}</span>",{dynamic_user_label:t},({text:e})=>n.createElement("span",{className:I().variable_container},n.createElement(f.Ah,{inline:!0,size:"inherit",...y})," ",e))):n.createElement("span",null,j.t("Sends a message to a user"))}return b?n.createElement("span",null,j.rt("Send a message to {user}",{user:n.createElement(O.Nm,{className:"c-member_slug--link",onClick:_},n.createElement(P.A,{noLinking:!0,id:i}),n.createElement("span",{className:I().splitViewIcon},n.createElement(f.Ah,{inline:!0,size:"inherit",name:"move-to-split-view"})))})):n.createElement("span",null,j.rt("Send a message to @{user}",{user:n.createElement(D.A,{id:i})}))}return t?n.createElement("span",null,j.rt("Send a message to {error}",{error:n.createElement(R.A,{type:"unknown"})})):n.createElement("span",null,o?.title)}SendMessageSummary.displayName="SendMessageSummary";let $=new r.Ay("workflow_builder"),SendToSalesHomeSummary=({segment:e,hasErrors:t=!1,isUserRequired:a=!1})=>{let r=(0,m.Iw)(e),l=(0,w.EM)(e),i=r.user_id?.value,s=r.notify_managers?.value,o=(0,m.Dl)(e),c={name:"css"};if("string"==typeof i){if((0,S.cn)(i)){let e=(0,k.x)(l.list,i),t=e&&!e.isTombstone?e.label:$.t("Missing Data");return e&&t?"string"==typeof s&&"true"===s.toLowerCase()||!0===s?n.createElement("span",null,$.rt("Send a notification to <span>{dynamic_user_label}</span> and their Managers or Leaders",{dynamic_user_label:t},({text:e})=>n.createElement("span",{className:I().variable_container},n.createElement(f.Ah,{inline:!0,...c})," ",e))):n.createElement("span",null,$.rt("Send a notification to <span>{dynamic_user_label}</span>",{dynamic_user_label:t},({text:e})=>n.createElement("span",{className:I().variable_container},n.createElement(f.Ah,{inline:!0,...c})," ",e))):n.createElement("span",null,$.t("Sends a notification to a user"))}return n.createElement("span",null,$.rt("Send a notification to @{user}",{user:n.createElement(D.A,{id:i})}))}return t&&a?n.createElement("span",null,$.rt("Send a notification to {error}",{error:n.createElement(R.A,{type:"unknown"})})):n.createElement("span",null,o?.title)};SendToSalesHomeSummary.displayName="SendToSalesHomeSummary";let G=new r.Ay("workflow_builder"),ChannelLabel=({channelId:e,variables:t})=>{if(!e)return null;if((0,S.cn)(e)){let a=(0,k.x)(t,e),r=a?.label;return n.createElement("span",{className:I().variable_container},n.createElement(f.Ah,{inline:!0,name:"css",size:"inherit"})," ",r)}return n.createElement(E.A,{channelId:e},n.createElement(C.A,{channelId:e,truncate:!0}))};function SummarizeChannelSummary({segment:e}){let t=(0,m.Iw)(e),a=(0,w.EM)(e),r=t.channel_ids?.value,l=t.days?.value,i=Array.isArray(r)?r[0]:r;return Array.isArray(r)&&r.length>1?n.createElement("span",null,G.rt("Summarize channels",{fallbackHash:"1b8962f14007d162f0dc43de8d265d059787b34a",fallbackHashNs:"assistant"})):"string"!=typeof i||"string"!=typeof l&&"number"!=typeof l||"string"==typeof l&&(0,S.cn)(l)?n.createElement("span",null,G.rt("Summarize channel")):n.createElement("span",null,G.rt("Summarize the last {dayCount} {dayCount, plural, =1 {day} other {days}} of {channelLabel}",{channelLabel:n.createElement(ChannelLabel,{channelId:i,variables:a.list}),dayCount:Number(l)}))}ChannelLabel.displayName="ChannelLabel",SummarizeChannelSummary.displayName="SummarizeChannelSummary";var K=a(0x339b339c),Y=a(0x135b7b386);let SlackFunctionSummary=({segment:e,hasErrors:t})=>{let a=(0,u.E)(e),r=(0,m.Dp)(e),l=a??(0,m.Dl)(e),i=(0,m.Zy)(e);if(a&&(0,d.GU)(a))return n.createElement(K.A,{size:"large"});if(i===Y.wo)return GoogleSheetsSummary({segment:e});if(r!==h.oW.SendMessage&&r!==h.oW.SendToMySalesHome&&r!==h.oW.SendToSalesHome&&r!==h.oW.SendToMySalesforceApp&&r!==h.oW.SendToSalesforceApp&&r!==h.oW.SendSummaryToMySalesHome&&r!==h.oW.SendSummaryToSalesHome&&r!==h.oW.SendEphemeralMessage&&r!==h.oW.SendDm&&r!==h.oW.ReplyInThread&&r!==h.oW.InviteUserToChannel&&r!==h.oW.Delay&&r!==h.oW.SummarizeChannel)return n.createElement("span",null,l?.title);switch(r){case h.oW.SendDm:case h.oW.SendMessage:case h.oW.ReplyInThread:return n.createElement(SendMessageSummary,{segment:e,hasErrors:t});case h.oW.SendEphemeralMessage:return n.createElement(SendEphemeralMessageSummary,{segment:e});case h.oW.Delay:return n.createElement(DelaySummary,{segment:e});case h.oW.InviteUserToChannel:return n.createElement(InviteToChannelSummary,{segment:e});case h.oW.SummarizeChannel:return n.createElement(SummarizeChannelSummary,{segment:e});case h.oW.SendToMySalesHome:case h.oW.SendToMySalesforceApp:return n.createElement(SendToSalesHomeSummary,{segment:e,hasErrors:t});case h.oW.SendToSalesHome:case h.oW.SendToSalesforceApp:return n.createElement(SendToSalesHomeSummary,{segment:e,hasErrors:t,isUserRequired:!0});default:return n.createElement("span",null,l?.title)}};SlackFunctionSummary.displayName="SlackFunctionSummary";var Q=a(0x75b1e64d),Z=a(0x36e8c71e),J=a(0xdfa9cb32),X=a(0x17178b190),ee=a(0x56e1c8ae);let et=new r.Ay("workflow_builder"),ExternalTriggerSummary=({trigger:e})=>{if((0,ee.kp)(e.config)||(0,ee.EP)(e.config)||(0,ee.S)(e.config)){let{startTime:t,frequency:a}=e.config,r={startTime:t,frequency:{type:a.type,onDays:a.on_days,repeatsEvery:a.repeats_every},timezone:X.GI};return n.createElement("span",{className:"name"},(0,J.M)(r))}return(0,ee.SZ)(e.config)?n.createElement("span",{className:"name"},et.t("Starts when a Salesforce channel is created",{fallbackHash:"16195f4e05b6d8dbd288fb741705a87c3e6e3682",fallbackHashNs:"hermes_shortcuts"})):n.createElement("span",{className:"name"},et.t("Starts with a Salesforce event"))};ExternalTriggerSummary.displayName="ExternalTriggerSummary";var ea=a(0x1ccef1c6f);let HermesScheduledTriggerSummary=({trigger:e})=>{let t=(0,s.d4)(e=>(0,ea.ty)(e,"time24")),{schedule:a}=e.config;return n.createElement("span",null,(0,J.M)(a,{do24hrTime:t}))};HermesScheduledTriggerSummary.displayName="HermesScheduledTriggerSummary";let en=new r.Ay("workflow_builder"),HermesWebhookTriggerSummary=()=>n.createElement("span",null,en.t("Starts with a webhook"));HermesWebhookTriggerSummary.displayName="HermesWebhookTriggerSummary";let ServiceTriggerSummary=({trigger:e})=>n.createElement("span",null,e.config.summary);ServiceTriggerSummary.displayName="ServiceTriggerSummary";var er=a(0x1f48c8a62),el=a.n(er);let ei=new r.Ay("workflow_builder"),ShortcutSummary=()=>n.createElement("div",{className:el().shortcut_summary_header},ei.t("Starts from a link in Slack"));ShortcutSummary.displayName="ShortcutSummary";var es=a(0x61c95b1b),eo=a(0x112dbb8f3);let ec=new r.Ay("workflow_builder"),ChannelCreatedSummary=({trigger:e})=>{let t=(0,s.d4)(q.EA),a=(0,eo.kv)(e.config.event);return a?n.createElement(n.Fragment,null,t?ec.rt('Starts when a channel containing "{channelSubstring}" is created',{channelSubstring:a}):`Starts when a channel containing "${a}" is created`):n.createElement(n.Fragment,null,t?ec.t("Starts when a channel is created"):"Starts when a channel is created")};var ed=a(0x408bdeff),eu=a(0x3796a18c),em=a(0x37ad6380),ep=a.n(em);let eb=new r.Ay("workflow_builder"),ListRecordCreatedSummary=({trigger:e})=>{let t=(0,eo.I2)(e);return t?n.createElement("span",{className:ep().inline__title},eb.rt("Starts when an item is created in {list}",{list:n.createElement(ed.A,{id:t,detailType:eu.s.NONE,className:ep().inline__file_entity}),fallbackHash:"8bddb4cc8b3a58cca34cd47fcd074c0330af08d3"})):n.createElement(n.Fragment,null,eb.t("Starts when a list item is created",{fallbackHash:"8bddb4cc8b3a58cca34cd47fcd074c0330af08d3"}))};ListRecordCreatedSummary.displayName="ListRecordCreatedSummary";let ef=new r.Ay("workflow_builder"),ListRecordUpdatedSummary=({trigger:e})=>{let t=(0,eo.I2)(e);return t?n.createElement("span",{className:ep().inline__title},ef.rt("Starts when an item is updated in {list}",{list:n.createElement(ed.A,{id:t,detailType:eu.s.NONE,className:ep().inline__file_entity}),fallbackHash:"8bddb4cc8b3a58cca34cd47fcd074c0330af08d3"})):n.createElement(n.Fragment,null,ef.t("Starts when a list item is updated",{fallbackHash:"8bddb4cc8b3a58cca34cd47fcd074c0330af08d3"}))};ListRecordUpdatedSummary.displayName="ListRecordUpdatedSummary";var eg=a(0x22f6c772a),eh=a(0x51e1a82c);let e_=new r.Ay("workflow_builder"),MessagePostedSummary=({trigger:e})=>{let{channelIds:t,filter:a}=e.config.event,r=(0,s.d4)(q.Lh);return a&&t?n.createElement("span",null,(0,eh.H)({channelIds:t,filter:a,inClient:r,messagePostedSummaryContext:eg.Q.EDITOR})):e_.t("Starts when a message is posted with keywords")};MessagePostedSummary.displayName="MessagePostedSummary";var ey=a(0x1e864b930),ex=a(0x9b971e7e),ev=a(0x1266f1359),eE=a(0x1e4ae349d);let ek=new r.Ay("workflow_builder"),ReactionAddedSummary=({trigger:e})=>{let t=(0,eo.zP)(e.config.event),a=(0,eo.Jp)(e),r=(0,s.d4)(e=>(0,ea.ty)(e,"preferred_skin_tone")),i=(0,s.d4)(ex.ZT),o=(0,ev.$D)(i),c=(0,n.useCallback)(e=>(0,eE.Fm)(o,{text:e,teamId:i??""})&&"1"!==r?`${e}::skin-tone-${r}`:e,[r,o,i]);return t.length&&a.length?n.createElement(n.Fragment,null,ek.rt("Starts when someone reacts with {emoji} in {channel}",{emoji:(0,ey.A)(t.map(e=>{let t=c(e);return n.createElement(l.Ay,{key:`emoji-${t}`,text:t,emojiSize:"small"})}),{conj:"or",keyPrefix:"emoji"}),channel:(0,ey.A)(a.map(e=>n.createElement(E.A,{channelId:e,key:`channel-${e}`},n.createElement(C.A,{channelId:e}))),{conj:"or",keyPrefix:"channel"})})):n.createElement(n.Fragment,null,ek.t("Starts when an emoji reaction is used"))};ReactionAddedSummary.displayName="ReactionAddedSummary";let eS=new r.Ay("workflow_builder"),UserJoinedChannelSummary=({trigger:e})=>{let t=(0,eo.Jp)(e);return t.length?n.createElement(n.Fragment,null,eS.rt("Starts when a person joins {channel}",{channel:(0,ey.A)(t.map(e=>n.createElement(E.A,{channelId:e,key:`channel-${e}`},n.createElement(C.A,{channelId:e}))),{conj:"or",keyPrefix:"channel"})})):n.createElement(n.Fragment,null,eS.t("Starts when a person joins a channel"))};UserJoinedChannelSummary.displayName="UserJoinedChannelSummary";let SlackEventTriggerSummary=({trigger:e})=>{let t=(0,eo.IM)(e);switch((0,eo.vd)(e)){case es.$.ReactionAdded:return n.createElement(ReactionAddedSummary,{trigger:e});case es.$.UserJoinedChannel:return n.createElement(UserJoinedChannelSummary,{trigger:e});case es.$.ListRecordCreated:return n.createElement(ListRecordCreatedSummary,{trigger:e});case es.$.ListRecordUpdated:return n.createElement(ListRecordUpdatedSummary,{trigger:e});case es.$.ChannelCreated:return n.createElement(ChannelCreatedSummary,{trigger:e});case es.$.MessagePosted:return n.createElement(MessagePostedSummary,{trigger:e});default:return n.createElement("span",null,t)}};SlackEventTriggerSummary.displayName="SlackEventTriggerSummary";var ew=a(0x126af815a);function getSegmentSummary(e,t){switch(e?.type){case ew.SJ:return n.createElement(ExternalTriggerSummary,{trigger:e});case ew.kr:return n.createElement(SlackEventTriggerSummary,{trigger:e});case ew.zW:return n.createElement(ShortcutSummary,null);case ew.bX:return n.createElement(HermesWebhookTriggerSummary,null);case ew.LO:return n.createElement(HermesScheduledTriggerSummary,{trigger:e});case ew.YV:return n.createElement(ServiceTriggerSummary,{trigger:e});case Z.SLACK_FUNCTION:return n.createElement(SlackFunctionSummary,{segment:e,hasErrors:t});case Z.SWITCH:return n.createElement(Q.B,{segment:e});case Z.LOOP:return n.createElement(LoopSummary,null);default:return null}}getSegmentSummary.displayName="getSegmentSummary"},0x88dc61ea:(e,t,a)=>{"use strict";a.d(t,{Hj:()=>useSegmentSubmit,N6:()=>o,Qk:()=>useSegmentValidation,ZH:()=>l,cR:()=>i,qE:()=>useSegmentSpeedBump,rC:()=>useSegmentDispatch,us:()=>s});var n=a(0xbad225b5),r=a(0x1cbdfeceb);let l=(0,n.createContext)(r.A),useSegmentDispatch=()=>(0,n.useContext)(l),i=(0,n.createContext)({});(0,n.createContext)({});let useSegmentValidation=()=>(0,n.useContext)(i),s=(0,n.createContext)({openSpeedBump:r.A,closeSpeedBump:r.A}),useSegmentSpeedBump=()=>(0,n.useContext)(s),o=(0,n.createContext)(r.A),useSegmentSubmit=()=>(0,n.useContext)(o)},0x870b34a7:(e,t,a)=>{"use strict";a.d(t,{W:()=>createSegmentAction});let createSegmentAction=e=>{let creator=t=>({type:e,payload:t});return creator.type=e,creator}},0x106f35107:(e,t,a)=>{"use strict";a.d(t,{GX:()=>createSegmentReducer,RJ:()=>s});var n=a(0x20c2aafd7),r=a(0x18dac2b8e),l=a(0x870b34a7);let i={type:"__SEGMENT__REDUCER__INITIALIZE__",payload:{}},s=(0,l.W)("update coachmark (template mode only)"),createSegmentReducer=(e=[],t=e=>({segment:e}))=>{let a={},reducer=(t,l)=>{let s=a[l.type];if(s||l.type===i.type){let a=s?s(t,l.payload):t,i=e.reduce((e,t)=>((0,r.Cu)()&&t.key in e&&(0,n.z3)(`Duplicate validator key ${t.key}. All validator keys must be unique.`),{...e,[t.key]:t(a,e)}),{});return{...a,computed:i}}return t};return reducer.initialize=((e,t=e=>({segment:e}))=>a=>{let l=e(t(a),i);if((0,r.Cu)()){let e=typeof l?.computed?.isValid;"boolean"!==e&&(0,n.z3)(`Segment state computed value "isValid" is incorrect type: ${e}.`)}return l})(reducer,t),reducer.on=(e,t)=>(a[e.type]=t,reducer),reducer.on(s,(e,{coachmarkData:t})=>{let{segment:a}=e;return{...e,segment:{...a,coachmarkText:t}}}),reducer}},0x139a1172d:(e,t,a)=>{"use strict";a.d(t,{g:()=>createSegmentValidator});let createSegmentValidator=(e,t)=>{let validator=(e,a={},n)=>n?t(e,a,n):t(e,a);return validator.key=e,validator}},0xf9f06c3b:(e,t,a)=>{"use strict";a.d(t,{v:()=>RenderingEngine});var n=a(0xbad225b5),r=a(0x1011848bf),l=a(0x17c7b6bbb),i=a(0x1c244e721),s=a(0x96aa1794),o=a(0xf6b2f43b),c=a(0x647f4f35),d=a(0x203b19061),u=a(0x159b87895),m=a(0x1a5ac3a0c),p=a(0x88dc61ea),b=a(0x24213b628),f=a(0xa231133b),g=a(0x1e271947d),h=a(0x24eaf48aa),_=a(0x238b287cf),y=a(0x1bb9b9e21),x=a(0x145d46a61),v=a(0x1795d8821),E=a(0x1fffc0b54),k=a(0x226892387),S=a(0x14149c126),w=a(0x16af7d0de);let RenderingEngine=({functionId:e,inputParameters:t,oAuthParameter:a,variables:C,configuredParameters:A,onChange:T,formatVariableBeforeInsert:I,callbackId:N,applySpecialTreatment:M,showInline:F=!1,renderOAuth2InputParameter:O,stepId:L,isExistingStep:D,serviceTriggerType:P,isTriggerSegment:R,functionVariables:B,isOAuthTokenInvalid:W,isFunctionFormWrapped:V,onlyRenderParentInputs:q,onlyRenderChildInputs:H,shouldAlwaysDisplayVariableSelector:U,onLoadingStateChange:z,hideLabel:j,invalidKeyword:$,shouldAutoFocus:G,enableEmojiAutocomplete:K,allowVariables:Y})=>{let Q,Z=(0,k.d4)(e=>"on"===(0,S._Z)(e,"user_authored_workflow_posts_fe")),J=(0,k.d4)(x.EY),X=(0,s.j)(),ee=(0,m.DY)(X),et=(0,p.rC)(),ea=(0,o.u)(),en=(0,_.A)(),er=X.trigger?.type,el=X.trigger&&(0,l.A4)(X.trigger)?X.trigger.external.salesforce_org_id:void 0,ei=X.trigger?.id,{privateChannelAccess:es,privateChannelTeamIds:eo}=(0,u.U)({workflow:X,isLatestWorkflowData:!0,callbackId:N,isTriggerSegment:R}),{aiStepPrivateChannelAccess:ec,aiStepPrivateChannelTeamIds:ed}=(0,c.k)({callbackId:N}),eu=(0,d.A)({variables:C,callbackId:N,isTriggerSegment:R}),{hasValidAppPinBuiltInMessage:em}=(0,p.Qk)(),ep=(0,k.d4)(E.Zs),eb=(0,b.N)(X,ep??void 0),ef=(0,n.useMemo)(()=>{let e=L;if(!e)if(!R||!ei)return;else e=ei;let t=(0,m.rM)(X,e);return(0,h.jS)(t)},[L,X,ei,R]),eg=(0,m.R5)(X,L,ep),eh=eg&&eg.some(e=>e?.function?.callback_id===v.oW.SummarizeChannel);D&&eg&&(Q=eg[eg.length-2]),!D&&eg&&(Q=eg[eg.length-1]);let e_=Q?.id??"",ey=Z&&eg&&Q?.function?.callback_id===v.oW.OpenForm&&Q?.function?.id===w.Ez.open_form,ex=(0,k.d4)(e=>(0,y.X)(e,X)),ev=(0,n.useCallback)(()=>{(0,i.W)(en,{wbArgs:{workflow_id:ee,is_hermes:!0}})},[en,ee]),eE=(0,n.useCallback)(e=>et((0,f.aI)({value:e})),[et]),ek=(0,n.useCallback)(e=>et((0,g.KR)(e)),[et]),eS=(0,n.useCallback)(({parameter:e,value:t,label:a})=>et((0,g.qq)({parameter:e,value:t,label:a})),[et]),ew=(0,n.useMemo)(()=>({updateRequiredContext:eE,viewOnly:ea,updateParameterValue:eS,onVariableMenuOpen:ev,openFormSteps:eb,triggerType:er,externalTriggerSalesforceOrgId:el,validateAsyncValue:ek,hasValidAppPinBuiltInMessage:em,workflowSummaryStepPrecedes:eh,formStepPrecedesCurrentStep:ey,previousStepId:e_,messagePostedTriggerPrivateChannelAccess:es,messagePostedTriggerPrivateChannelTeamIds:eo,aiStepPrivateChannelAccess:J?ec:void 0,aiStepPrivateChannelTeamIds:J?ed:void 0}),[eE,ea,eS,ev,eb,er,el,ek,em,eh,ey,e_,es,eo,J,ec,ed]);return n.createElement(r.L,{functionId:e,inputParameters:t,oAuthParameter:a,variables:eu,onChange:T,configuredParameters:A,formatVariableBeforeInsert:I,applySpecialTreatment:M,renderOAuth2InputParameter:O,isExistingStep:D,workflowRendererContexts:ew,stepId:L,stepErrorCode:ef,showInline:F,callbackId:N,workflowId:ee,workflowExternalWorkspaceId:ex,serviceTriggerType:P,triggerId:ei,isTriggerSegment:R,functionVariables:B,isOAuthTokenInvalid:W,isFunctionFormWrapped:V,onlyRenderParentInputs:q,onlyRenderChildInputs:H,shouldAlwaysDisplayVariableSelector:U,onLoadingStateChange:z,hideLabel:j,invalidKeyword:$,shouldAutoFocus:G,enableEmojiAutocomplete:K,allowVariables:Y})};RenderingEngine.displayName="RenderingEngine"},0xfcd3ead1:(e,t,a)=>{"use strict";a.d(t,{Jw:()=>c,_$:()=>s,Xp:()=>o});var n=a(0x870b34a7),r=a(0x106f35107);let l=(0,a(0x139a1172d).g)("isValid",e=>!!e.segment),i=(0,n.W)("initiate loop step"),s=(0,n.W)("update loop collection"),o=(0,n.W)("update loop item type"),c=(0,r.GX)([l]).on(i,e=>{let{segment:t}=e;return{...e,segment:{...t,loopConfig:{collection:[],parallel_execution:!1,item_type:void 0}}}}).on(s,(e,{collection:t})=>{let{segment:a}=e;return{...e,segment:{...a,loopConfig:{parallel_execution:a.loopConfig?.parallel_execution??!0,collection:t,item_type:a.loopConfig?.item_type}}}}).on(o,(e,{item_type:t})=>{let{segment:a}=e;return{...e,segment:{...a,loopConfig:{...a.loopConfig,item_type:t}}}})},0xa231133b:(e,t,a)=>{"use strict";a.d(t,{Af:()=>N,bd:()=>U,GZ:()=>applySlackFunctionFormStepReducerActions,JB:()=>j,$m:()=>getSlackFunctionFormStepReducer,c5:()=>L,Zy:()=>$,V0:()=>O,zo:()=>Y,Gz:()=>K,Qj:()=>Z,EV:()=>G,ST:()=>et,TI:()=>X,aL:()=>V,nX:()=>J,ud:()=>P,y_:()=>H,qt:()=>D,d4:()=>q,ly:()=>z,qc:()=>B,eY:()=>R,aI:()=>Q,FL:()=>ee});var n=a(0x1db69cda),r=a(0xe0376d2),l=a(0x12edaa96a),i=a(0x61fd76c),s=a(0x12b3420f4),o=a(0x1862f5064),c=a(0x1dde3f5ab),d=a(0x38bda683),u=a(0x23465d793),m=a(0x1db887024),p=a(0x127c49a8d),b=a(0x9d5bcdc6),f=a(0x1bbb44431),g=a(0xe53aa0),h=a(0x542936b0),_=a(0x9f477e8a),y=a(0x870b34a7),x=a(0x106f35107),v=a(0xd0fb5338),E=a(0x177a179f2),k=a(0x828e2524),S=a(0xa03b6325);let getValueTemplateFromOnSubmitConfigInputs=(e,t)=>{if(!(t in e))return Object.values(e).find(({value:e})=>!(!(0,k.w)(e)||(0,S.L)(e))&&t in e);return e[t]};var w=a(0x4cecf0f9),C=a(0xabd92c55),A=a(0x252b4df6e);let move_array_element=function(e,t,a){if(e<0||e>=a.length)throw Error(`start index ${e} is out-of-bounds for array of length ${a.length}`);if(t<0||t>=a.length)throw Error(`end index ${t} is out-of-bounds for array of length ${a.length}`);if(e===t)return a;let n=[...a],r=n.splice(e,1);return n.splice(t,0,...r),n};var T=a(0x1795d8821),I=a(0x1ec68d6a3);let N=(0,y.W)("add question"),M=(0,y.W)("open question"),F=(0,y.W)("close question"),O=(0,y.W)("remove question"),L=(0,y.W)("move question"),D=(0,y.W)("update question label"),P=(0,y.W)("update question description"),R=(0,y.W)("update question type"),B=(0,y.W)("update question optional"),W=(0,y.W)("update question data source"),V=(0,y.W)("update question default value"),q=(0,y.W)("update question multi-select max selected items"),H=(0,y.W)("update allowed_filetypes property for questions of type file_id"),U=(0,y.W)("add question option"),z=(0,y.W)("update question option label"),j=(0,y.W)("delete question option"),$=(0,y.W)("move question option"),G=(0,y.W)("update interactivity pointer"),K=(0,y.W)("update dialog title"),Y=(0,y.W)("syncs form fields based on nested response"),Q=(0,y.W)("update required context needed by step configuration"),Z=(0,y.W)("update field type"),J=(0,y.W)("update question default value and choices"),X=(0,y.W)("update form wrapped configuration"),ee=(0,y.W)("update selected slack function"),et=(0,y.W)("sets whether the form can be added or removed from a step"),initializeSlackFunctionFormSegmentState=e=>{let t=(0,v.yS)(e);return{segment:(0,v.uG)(t.map(e=>{let t=(0,u.l)(e)??d.xi.ShortText,a=(0,c.EI)(t)?(0,_.YP)(e?.items?.enum||[]):e.options,n={...e,options:a,questionType:t};if(n.options){let e,a=n.options.map(e=>e.id?e:{...e,id:(0,l.A)()});if(t===d.xi.Dropdown&&(0,g.w)(a))try{let t=JSON.stringify(n.value);e=a.find(e=>JSON.stringify(e.value)===t)}catch(e){(0,I.getGenericLogger)().warn("WORKFLOW_BUILDER",e)}else e=a.find(e=>e.value===n.value);return{...n,selectedOptionId:e?.id??null,options:a}}return n}),e),openQuestionName:(0,v.UW)(t),shouldFocusQuestion:!1}},applySlackFunctionFormStepReducerActions=e=>e.on(N,e=>{let{segment:t}=e,a=(0,v.yS)(t),n=(0,v.hG)({questionType:d.xi.ShortText});if(a.length<m.Rj){let r=a.concat(n);return{...e,segment:(0,v.uG)(r,t),openQuestionName:n.name,shouldFocusQuestion:!0}}return e}).on(L,(e,t)=>{let{segment:a}=e,{questionIndex:n,newQuestionIndex:r}=t,l=(0,v.yS)(a);if(r>=0&&r<l.length){let t=move_array_element(n,r,l);return{...e,segment:(0,v.uG)(t,a)}}return e}).on(O,(e,t)=>{let{segment:a}=e,{questionName:n}=t,r=(0,v.yS)(a).filter(e=>e.name!==n);return{...e,segment:(0,v.dH)(n,null,(0,v.uG)(r,a))}}).on(M,(e,t)=>{let{questionName:a}=t;return{...e,openQuestionName:a,shouldFocusQuestion:!0}}).on(F,e=>({...e,openQuestionName:null})).on(D,(e,t)=>{let{segment:a}=e,{questionName:n,label:r}=t,l=(0,v.HQ)(n,a,e=>({...e,label:r,title:r}));return{...e,segment:l}}).on(P,(e,t)=>{let{segment:a}=e,{questionName:n,description:r}=t,l=(0,v.HQ)(n,a,e=>({...e,description:r}));return{...e,segment:l}}).on(R,(e,t)=>{let{segment:a}=e,{questionName:n,questionType:r}=t,l=(0,v.HQ)(n,a,e=>(0,v.hG)({questionType:r,label:e.label,optional:e.optional,name:e.name,title:e.title,description:e.description,previousOptions:e.options||[(0,_.Kq)()]}));return{...e,segment:l}}).on(Z,(e,t)=>{let{segment:a}=e,{questionName:r,parameter:l}=t,c=(0,A.UX)(a),d=(0,E.FE)(a),u=c&&(0,s.ny)(c.input_parameters);if(!l||!d||!c)return e;let m=c?.id,p=!(l.name in d)&&!!u,g=getValueTemplateFromOnSubmitConfigInputs(d,l.name)??{value:null},_=(0,f.d)({functionId:m,input:l,valueTemplate:p?(0,h.E)(g,l.name):g,parentInput:p?u:void 0});if(!_)return e;let y=(0,v.yS)(a).find(({name:e})=>e===r),x=(0,n.A)(a);y&&getValueTemplateFromOnSubmitConfigInputs(d,r)&&(x=(0,v.dH)(r,null,x)),x=(0,v.dH)(l.name,(0,i.n)(l.name),x);let k=(0,b.K)(l.type===T.TE.Array?l.items.type:l.type);return x=(0,v.HQ)(r,x,e=>{let t=(0,w.G)(_,l.is_required);if(k&&!t.default&&!t.value){let e=(0,o.Q)({isKeyValueParameter:p,parameterName:p?u.name:l.name,dynamicOptionKey:p?l.name:void 0,functionVariables:(0,A.am)(a)});if(e?.mapping)return{...t,value:e.mapping.template,default:e.mapping.template}}return t}),{...e,segment:x}}).on(B,(e,t)=>{let{segment:a}=e,{questionName:n,optional:r}=t,l=(0,v.HQ)(n,a,e=>({...e,optional:r,is_required:!r}));return{...e,segment:l}}).on(W,(e,t)=>{let{segment:a}=e,{questionName:n,dataSource:r}=t,l=(0,v.HQ)(n,a,e=>({...e,data_source:r,value:"",default:""}));return{...e,segment:l}}).on(V,(e,t)=>{let{segment:a}=e,{questionName:n,value:r,optionId:l}=t,i=(0,v.HQ)(n,a,e=>({...e,value:0===r?0:r||(0,_.Nr)(e,l),default:0===r?0:r||(0,_.Nr)(e,l),selectedOptionId:l}));return{...e,segment:i}}).on(J,(e,t)=>{let{segment:a}=e,{questionName:n,value:r,choices:l,filterQueries:i}=t,s=Array.isArray(r)?{items:{choices:l}}:{choices:l},o=(0,v.HQ)(n,a,e=>({...e,...s,filterQueries:i,value:r,default:r}));return{...e,segment:o}}).on(q,(e,t)=>{let{segment:a}=e,{questionName:n,maxItems:r}=t,l=(0,v.HQ)(n,a,e=>({...e,maxItems:r}));return{...e,segment:l}}).on(H,(e,t)=>{let{segment:a}=e,{questionName:n,allowedFileTypesGroup:r}=t,l=(0,v.HQ)(n,a,e=>({...e,items:{...e.items,allowed_filetypes_group:r}}));return{...e,segment:l}}).on(U,(e,t)=>{let{segment:a}=e,{questionName:n}=t,r=(0,v.HQ)(n,a,e=>{let{options:t,questionType:a,items:n,maxItems:r}=e,l=r===(0,_.sx)(t||[]).length;if((0,_.aA)(a,t)){let i=t.concat((0,_.Kq)()),s=l?(0,_.sx)(i).length:r,o=(0,c.OW)(a);return(0,c.EI)(a)?{...e,options:i,items:{...n,enum:(0,_.sx)(i)},...(0,c.kd)(a)?{maxItems:s}:{}}:{...e,options:i,choices:o?(0,_.mv)(i):(0,_.L3)(i),enum:o?(0,_.fY)(i):(0,_.sx)(i)}}return e});return{...e,segment:r}}).on(j,(e,t)=>{let{segment:a}=e,{questionName:n,optionId:r}=t,l=(0,v.HQ)(n,a,e=>{let{options:t,questionType:a,items:n,maxItems:l}=e,i=e.selectedOptionId===r?null:e.selectedOptionId,s=e.selectedOptionId===r?"":e.value,o=t?.filter(e=>e.id!==r)??[],d=l&&l>(0,_.sx)(o).length?(0,_.sx)(o).length:l,u=(0,c.OW)(a);return(0,c.EI)(a)?{...e,options:o,items:{...n,enum:(0,_.sx)(o)},...(0,c.kd)(a)?{maxItems:d}:{}}:{...e,options:o,choices:u?(0,_.mv)(o):(0,_.L3)(o),enum:u?(0,_.fY)(o):(0,_.sx)(o),selectedOptionId:i,value:s,default:s}});return{...e,segment:l}}).on($,(e,t)=>{let a=(0,n.A)(e.segment),{questionIndex:r,questionOptionIndex:l,newQuestionOptionIndex:i}=t,s=(0,v.yS)(a),o=s[r].options;if(o&&i>=0&&i<o.length){let t=move_array_element(l,i,o),d=(0,u.l)(s[r]);s[r].options=t;let m=!!d&&(0,c.OW)(d);return d&&(0,c.EI)(d)?s[r].items={type:s[r].items.type,enum:(0,_.sx)(t)}:(s[r].choices=m?(0,_.mv)(t):(0,_.L3)(t),s[r].enum=m?(0,_.fY)(t):(0,_.sx)(t)),{...e,segment:(0,v.uG)((0,n.A)(s),a)}}return e}).on(z,(e,t)=>{let{segment:a}=e,{questionName:n,optionId:r,label:l,value:i}=t,s=(0,v.HQ)(n,a,e=>({...(0,_.X7)(r,e,e=>({...e,label:l,value:i})),value:e.selectedOptionId===r?i:e.value,default:e.selectedOptionId===r?i:e.value}));return{...e,segment:s}}).on(K,(e,t)=>{let{segment:a}=e,{dialogTitle:n}=t,r=(0,v.D0)(a,n);return{...e,segment:r}}).on(G,(e,t)=>{let{segment:a}=e,{reference:n=[]}=t,r=(0,v.P)(a,n);return{...e,segment:r}}).on(Q,(e,{value:t})=>{let{segment:a}=e;return{...e,segment:{...a,requiredContext:(0,r.A)([...a.requiredContext||[],..."string"==typeof t?[t]:t])}}}).on(Y,(e,{inputParameters:t,options:a})=>{let{segment:n}=e,r=(0,v.yS)(n).filter(e=>!!t?.find(({name:t})=>t===e.name)||!!a?.find(({key:t})=>t===e.name));return{...e,segment:(0,v.uG)(r,n)}}).on(X,(e,{isFunctionFormWrapped:t,experimentThirdPartyUserFormParityGroupOn:a})=>{let{segment:n}=e;return{...e,segment:(0,p.i)({...n,config:{...n.config,isFunctionFormWrapped:t}},void 0,a)}}).on(ee,(e,{selectedFunction:t})=>{let{segment:a}=e,n={...a,config:{...a.config,selectedSlackFunction:t}};return{...e,segment:n}}).on(et,(e,{isAddOrRemoveFormStep:t})=>{let{segment:a}=e,n={...a,config:{...a.config,isAddOrRemoveFormStep:t}};return{...e,segment:n}}),getSlackFunctionFormStepReducer=e=>applySlackFunctionFormStepReducerActions((0,x.GX)(C.y$,initializeSlackFunctionFormSegmentState))},0x2362a0a7b:(e,t,a)=>{"use strict";a.d(t,{T:()=>i});var n=a(0x242822dfb),r=a(0x1b05cc3ce),l=a(0x1806ce928);let i=(0,a(0x11c82607b).Ay)("Fetch dynamic options for input parameter",async(e,t,{parameter:a,segmentId:i,stepFunctionId:s,workflowId:o,callbackId:c,configuredInputs:d,triggerType:u})=>{let m=(0,n.hv)(a);if(!m||a.is_hidden||(0,r.M$)(a,d))return Promise.resolve();let p=(0,n.Bp)(m.inputs,d);return(0,n._Y)({parsedParameterValues:p,callbackId:c})?Promise.resolve():e((0,l.O)({function:m.function,stepFunctionId:s,workflowStepId:i,workflowId:o,hierarchicalParameterName:[a.name],inputs:p,triggerType:u,reason:"workflow_builder/get_dynamic_options"}))});i.meta={name:"fetchParameterDynamicOptions",key:"createThunkFetchParameterDynamicOptions",description:"Fetch dynamic options for input parameter"}},0xabd92c55:(e,t,a)=>{"use strict";a.d(t,{N8:()=>titleIsValid,c$:()=>f,cy:()=>b,y$:()=>g});var n=a(0x19e69f3e),r=a.n(n),l=a(0xbe0b63ff),i=a(0xec9d0658),s=a(0x1db887024),o=a(0xab1e931b),c=a(0x139a1172d),d=a(0xd0fb5338),u=a(0xaaa6bbd0),m=a(0x1bb29da6);let titleIsValid=({dialogTitle:e,maxLength:t})=>{let a=e.replace((0,i.A)(),"E").replace(r()(),"E").trim().length;return a>0&&a<=t};(0,c.g)("hasValidTitle",({segment:e})=>{let t=(0,d.F$)(e),a=(0,d.$o)(e);return(0,o.N8)({dialogTitle:t,maxLength:a})});let p=(0,c.g)("canDeleteQuestion",({segment:e})=>(0,d.yS)(e).length>1),b=(0,c.g)("canAddQuestion",({segment:e})=>{let t=(0,l.uz)(e.config.wrappedSlackFunction)?e.config.wrappedSlackFunction:void 0,a=(0,u.q2)(e)&&t?(0,u.Jl)(e,t,!1):void 0,n=(0,m.N)(e.config.wrappedSlackFunction?.input_parameters,a),r=n.length?Math.min(n.length,s.Rj):s.Rj;return(0,d.yS)(e).length<r}),f=(0,c.g)("questionsAreValid",({segment:e})=>{let t=(0,d.Gy)(e),a=(0,m.N)(e.config.wrappedSlackFunction?.input_parameters,void 0),n=(0,d.yS)(e).every(e=>(!a.length||!!a.find(({name:t})=>t===e.name))&&(0,o.fD)(e));return t>0&&t<=s.Rj&&n});(0,c.g)("isValid",(e,{hasValidTitle:t,questionsAreValid:a})=>t&&a);let g=[f,p,b,(0,c.g)("isValid",(e,{questionsAreValid:t})=>t)]},0x1817ab90d:(e,t,a)=>{"use strict";a.d(t,{$_:()=>createMultiClickPreviewBlock,A6:()=>createInteractivityConfiguration,AI:()=>isContinueButtonAdded,O0:()=>isContinueButton,fd:()=>areMultipleContinueButtonsAdded,hH:()=>getPreviewBlocks,j1:()=>getMenuButtons});var n=a(0x12edaa96a),r=a(0x1795d8821);function createMultiClickPreviewBlock(e){return{__meta__:{lastUpdatedTs:""},channel:"preview",type:"message",ts:"0",subtype:"",blocks:[{block_id:"workflow-builder-preview-button",elements:["workflow_button"===e.type?{...e,action_id:(0,n.A)(),workflow:{trigger:{url:"https://example.com",customizable_input_parameters:[]}}}:e],type:"actions"}]}}let getMenuButtons=({edit:e,remove:t,moreActions:a})=>{let n=[];if(t){let e="action_delete_btn";n.push({key:e,tooltip:t.tooltip,onClick:t.onClick,ariaLabel:t.ariaLabel,dataQa:e,dataId:e,svgIconProps:{name:"trash",size:"20"},className:t.className})}if(e){let t="action_edit_btn";n.push({key:t,tooltip:e.tooltip,onClick:e.onClick,ariaLabel:e.ariaLabel,dataQa:t,dataId:t,svgIconProps:{name:"edit",size:"20"},className:e.className})}if(a){let e="action_more_actions_btn";n.push({key:e,tooltip:a.tooltip,ariaLabel:a.ariaLabel,dataQa:e,dataId:e,svgIconProps:{name:"ellipsis-horizontal-filled",size:"20"},className:a.className,menuProps:a.menuProps})}return n},getPreviewBlocks=(e,t)=>{let a=[{type:"rich_text",block_id:"blockId-0",elements:[{type:"rich_text_section",elements:[{type:"text",text:t}]}]}];return a.push({type:"actions",block_id:"blockId-1",elements:e.map(e=>({type:"button",action_id:e?.action_id??(0,n.A)(),text:{type:"plain_text",text:e?.text?.text??"",emoji:!0},style:e?.style||"outline"}))}),a},createInteractivityConfiguration=(e,t,a,l)=>({actions:{[e||(0,n.A)()]:{is_button_multi_click:!l&&t!==r.oW.SendDm,is_mutually_exclusive:l},...a?.actions}}),isContinueButton=e=>!("url"in e||"workflow"in e),isContinueButtonAdded=e=>e.filter(isContinueButton).length>0,areMultipleContinueButtonsAdded=e=>e.filter(isContinueButton).length>1},0x2339a0d72:(e,t,a)=>{"use strict";a.d(t,{AR:()=>createBlockKitAction,OK:()=>createBlockKitActionButton,P6:()=>buttonsHaveDuplicateContinueLabels});var n=a(0x20482ad21),r=a(0x12edaa96a);let l=new n.Ay("workflow_builder"),createBlockKitAction=e=>({type:"actions",elements:e}),createBlockKitActionButton=(e,t,a)=>{let n={type:"button",text:{type:"plain_text",text:t??l.t("Continue"),emoji:!0},value:"button",action_id:(0,r.A)(),style:a??(e?void 0:"primary"),url:e?"":void 0};return void 0===n.url&&delete n.url,(void 0===n.style||void 0===a)&&delete n.style,n},buttonsHaveDuplicateContinueLabels=e=>e.some((t,a)=>e.slice(a+1).some(e=>t.type===e.type&&!("url"in t)&&!("url"in e)&&t.text.text===e.text.text))},0xc3116e8:(e,t,a)=>{"use strict";a.d(t,{Ji:()=>modifyObjectVariables,Km:()=>convertVariablesToPrimaryObjectFields,Xw:()=>doesTriggerConfigAllowExtraColumnInput,ZT:()=>convertParametersV2ToPrimaryObjectFields,dg:()=>stripObjectFromPrimaryObjectFieldLabel});var n=a(0x56e1c8ae);let r=/^([^>]*?)\s>\s([^>]*?)$/,l=/^([0-9]+?)_([0-9]+?)$/;function notEmpty(e){return null!=e}let convertVariablesToPrimaryObjectFields=e=>e.list.flatMap(e=>e.objectProperties?e.objectProperties.flatMap(e=>{let t;return t=`${e.name}`.match(l),t?.length===3?{id:+t[2],schemaObjectId:+t[1],label:e.label,type:e.type}:null}).filter(notEmpty):[]),convertParametersV2ToPrimaryObjectFields=e=>Object.values(e).flatMap(e=>e?Object.values(e.properties??[]).map(e=>{let t;return t=`${e.name}`.match(l),t?.length===3?{id:+t[2],schemaObjectId:+t[1],label:e.title??"No Label Found",type:e.type}:null}).filter(notEmpty)??[]:[])??[],stripObjectFromPrimaryObjectFieldLabel=e=>{let t=`${e}`.match(r);return t?.length===3?t[2]:e},i=/^[0-9]+?_[0-9]+?$/,s=/^[0-9]+?_[0-9]+?_[0-9]+?_[0-9]+?$/,modifyMatchingObjectPropertyVariables=(e,t)=>a=>{let n=a.objectProperties?.flatMap(a=>{if(a.isHidden&&e.some(e=>e.test(a.name))){let e=t(a);return e?[e]:[]}return a});return n?{...a,objectProperties:n}:a},modifyObjectVariables=(e,t)=>{let a=e.groups.map(e=>{let a=e.data.map(modifyMatchingObjectPropertyVariables([i,s],t));return{...e,data:a}});return{list:e.list.map(modifyMatchingObjectPropertyVariables([i,s],t)),groups:a}},doesTriggerConfigAllowExtraColumnInput=e=>(0,n.EP)(e.config)},0x1d67ca27f:(e,t,a)=>{"use strict";a.d(t,{Wt:()=>processExternalTriggerSegmentVariablesForStep,_V:()=>sortChildRecipientsForUI,g9:()=>o,r3:()=>modifyChildObjectVariables});var n=a(0x20482ad21),r=a(0x2172ff7ff);let l=/[0-9]+?_([0-9]+?)_([0-9]+?)_([0-9]+?)_([0-9]+?)_child$/,i=/[0-9]+?_([0-9]+?)_([0-9]+?_){3}child_multi$/,s=/[0-9]+?_([0-9]+?)_([0-9]+?_){5}child_multi$/,o=/Ft[A-Z0-9]*?__[0-9]+?_([0-9]+?)_([0-9]+?)_([0-9]+?)_([0-9]+?)_child/,c=new n.Ay("workflow_builder"),modifyChildObjectPropertyVariables=e=>t=>{let a=t.objectProperties?.flatMap(t=>{if(t.isHidden&&l.test(t.name)){let a=e(t);return a?[a]:[]}if(i.test(t.name)||s.test(t.name)){let e=c.t("{selectedDataLabel} (multiple)",{selectedDataLabel:t.label}).replaceAll("&gt;",">");return[{...t,label:e}]}return t});return a?{...t,objectProperties:a}:t},modifyChildObjectVariables=(e,t)=>{let a=e.groups.map(e=>{let a=e.data.map(modifyChildObjectPropertyVariables(t));return{...e,data:a}});return{list:e.list.map(modifyChildObjectPropertyVariables(t)),groups:a}},processExternalTriggerSegmentVariablesForStep=(e,t,a=!1)=>{let n=`${e?.value}`.match(o);return n?a?modifyChildObjectVariables(t,e=>{let t=e.name.match(l);return n[1]===t?.[1]&&n[3]===t?.[3]?{...e,isHidden:!1}:null}):modifyChildObjectVariables(t,e=>{let t=e.name.match(l);return n[1]===t?.[1]&&n[3]===t?.[3]?e:null}):modifyChildObjectVariables(t,e=>null)},labelPrefix=e=>{let t=e.label.indexOf(" >");return t>0?e.label.substring(0,t):e.label},sortByFirstPropLabel=(e,t)=>{let a=e.objectProperties&&e.objectProperties[0]?labelPrefix(e.objectProperties[0]):e.label,n=t.objectProperties&&t.objectProperties[0]?labelPrefix(t.objectProperties[0]):t.label;return(0,r.Ay)(a,n)},sortChildRecipientsForUI=e=>{let buildResult=t=>{let a={...e.groups[0]};a.data=t;let n=e.groups.slice(1);return n.unshift(a),{list:e.list,groups:n}};if(e.groups[0]){let t=e.groups[0].data,a=t.findIndex(e=>!e.name.includes("_")&&"metadata"!==e.name);if(a>=0){let e=t[a],n=t.slice(0,a).concat(t.slice(a+1));return n.sort(sortByFirstPropLabel).unshift(e),buildResult(n)}let n=[...t];return n.sort(sortByFirstPropLabel),buildResult(n)}return e}},0xead28e26:(e,t,a)=>{"use strict";a.d(t,{P:()=>SendSummaryToSalesHomeInputPreview});var n=a(0xbad225b5),r=a(0x120c268ad),l=a.n(r),i=a(0x1f355b555),s=a(0x20482ad21),o=a(0x1d2cd7755),c=a(0x12cef2078),d=a(0xe9c32bb),u=a(0x23b93d6d0),m=a(0x1a5ac3a0c),p=a(0xc3116e8),b=a(0x6c06317c),f=a(0x56e1c8ae),g=a(0x126af815a),h=a(0x66c6b26d),_=a(0x20adb28cd),y=a(0x226892387),x=a(0x38c797fc),v=a.n(x);let E=new s.Ay("workflow_builder"),SendSummaryToSalesHomeInputPreview=({configuredParameters:e,isStepPreview:t,workflowId:a})=>{let r=((e,t)=>{let a;if(!t)return null;let n=(0,m.DU)(t),r=(0,m.BQ)(t),l=(0,m.eR)(t);if(l?.type!==g.SJ||(0,f.Fe)(l.config)||(0,f.SZ)(l.config))return null;let s=(0,b.h)(e),o=(0,i.Ay)(l.config.startTime),c=o.subtract(o.utcOffset(),"minute").unix().toString(),d=e?.notification_display_table_header?.value,u="string"==typeof d&&d?d:l.config.notificationHeader,h=t.trigger?.available_data,_=h?(0,p.ZT)(h):[],y=e?.notification_display_table_extra_column_field_id?.value,x=y?_.find(e=>e.id===y):null,v=x?{payload_field:`${x.id}`,name:(0,p.dg)(x.label),type:x.type,label:x.label}:null,E=v?[...l.config.columns,v]:l.config.columns;return{payload:{workflow:{title:r,icon_url:n,subtitle:u},generic_records:(a={},E.forEach(e=>{a[e.payload_field]={record_field_identifier:e.payload_field,record_field_label:e.label||e.name,record_field_rendered_value:""}}),[{object_identifier:"Object1",record_identifier:"Record1",record_link:"https://example.com/record1",record_name:"",record_fields:a},{object_identifier:"Object2",record_identifier:"Record2",record_link:"https://example.com/record2",record_name:"",record_fields:a}]),notification_type:"scheduled"},notification_type:"scheduled",created_ts:c,is_unread:!0,icon_url:n,body:s,is_acn:!1,notification_display_columns:E}})(e,(0,y.d4)((0,h.sx)(a,_.RG)));if(!r)return null;let s=E.t("This is how your notification will appear in Sales Home"),x=n.createElement(c.X,{noPointerEvents:!0},n.createElement(u.Z,{notification:r,hasFocus:!0,isFirst:!0,isWorkflowPreview:!0,isStepPreview:t}));return n.createElement("div",{className:l()({[v().input_preview]:t})},t?n.createElement(o.A,{text:E.t("Preview")},n.createElement(d.nB,null,s),x):x)};SendSummaryToSalesHomeInputPreview.displayName="SendSummaryToSalesHomeInputPreview"},0x1e271947d:(e,t,a)=>{"use strict";a.d(t,{nk:()=>N,JB:()=>I,ix:()=>M,XZ:()=>O,Qx:()=>P,qq:()=>S,Ox:()=>A,zb:()=>T,m0:()=>F,R:()=>C,aR:()=>D,T:()=>L,KR:()=>w});var n=a(0xe0376d2),r=a(0x1db69cda),l=a(0x125763ad),i=a(0xf77002c6),s=a(0x173d265bf),o=a(0x818fd090),c=a(0x1795b5c1b),d=a(0x242822dfb),u=a(0xb3a43d1e),m=a(0x1b05cc3ce),p=a(0x1ebe91b72),b=a(0x870b34a7),f=a(0x106f35107),g=a(0xa231133b),h=a(0xaaa6bbd0);let applyFormWrappedSchemaByName=({slackFunction:e,isFunctionFormWrapped:t,parameterName:a,propertyKey:n,checked:r})=>e?{...e,input_parameters:e.input_parameters?.map(e=>{if(a===e.name){if(!n)return{...e,isParameterFormWrapped:t&&r};if((0,d.sg)(e)&&e.properties){let a=e.properties;Object.keys(a).forEach(e=>{if(n===e){let n=(0,o.w)(a[e]);n.isParameterFormWrapped=t&&r,a[e]=n}})}return{...e,isParameterFormWrapped:t}}return e})}:e;var _=a(0x4cecf0f9),y=a(0x113e7abc2),x=a(0x252b4df6e),v=a(0x202470d56),E=a(0x7019ae94);let removeRegexMatchingTextFromValue=({value:e,regex:t})=>"string"==typeof e?e.replace(t,""):Array.isArray(e)?e.map(e=>removeRegexMatchingTextFromValue({value:e,regex:t})).filter(e=>!(0,E.$)(e)):"object"!=typeof e||(0,v.A)(e)?e:Object.entries(e).reduce((e,[a,n])=>("object"==typeof e&&"string"==typeof a&&(e[a]=removeRegexMatchingTextFromValue({value:n,regex:t})),e),{});var k=a(0x78a9d64e);let S=(0,b.W)("update configured parameter value"),w=(0,b.W)("validate input parameters with async calls"),C=(0,b.W)("update form wrapped configuration for parameter and key-value input by name"),A=(0,b.W)("update form configuration title"),T=(0,b.W)("update function variables"),I=(0,b.W)("converts the segment to be a form segment"),N=(0,b.W)("converts the form segment to be a segment"),M=(0,b.W)("returns the same segment without any form field references"),F=(0,b.W)("sets whether or not nested data is fetching"),O=(0,b.W)("Reset 3PUF step field references"),L=(0,b.W)("update segment dynamic inputs state"),D=(0,b.W)("update key-value parameter properties"),P=(0,g.GZ)((0,f.GX)(k.y$).on(S,(e,{parameter:t,value:a,label:n,options:r,experimentThirdPartyUserFormParityGroupOn:l})=>{let s,{segment:c}=e;return(s=null!==a||t.is_required?(0,x.bG)(c,t,a,n,r,l):(0,x.Xt)(c,t)).config.isFunctionFormWrapped&&(0,i.yw)(t)&&t.conditionalChildInputs?.forEach(e=>{let t=(0,x.iL)(s,e),a=!!t&&!(0,m.M$)((0,o.w)(t),(0,x.Iw)(s));s.config.slackFunction=applyFormWrappedSchemaByName({parameterName:e,slackFunction:s.config.slackFunction,checked:a,isFunctionFormWrapped:!0})}),{...e,segment:s}}).on(g.aI,(e,{value:t})=>{let{segment:a}=e;return{...e,segment:{...a,requiredContext:(0,n.A)([...a.requiredContext||[],..."string"==typeof t?[t]:t])}}}).on(w,(e,t)=>({...e,asyncValidation:{...e.asyncValidation,...t}})).on(C,(e,t)=>{let{segment:a}=e;return{...e,segment:{...a,config:{...a.config,slackFunction:applyFormWrappedSchemaByName({slackFunction:a.config.slackFunction,...t})}}}}).on(T,(e,t)=>{let{segment:a}=e;return{...e,segment:{...a,config:{...a.config,functionVariables:{...a.config.functionVariables,...t}}}}}).on(A,(e,{title:t})=>{let{segment:a}=e;return{...e,segment:{...a,config:{...a.config,formConfiguration:{...a.config.formConfiguration,title:{value:t}}}}}}).on(I,(e,{openFormSlackFunction:t})=>{let{segment:a}=e,n=(0,y.$)(a,t);return{...e,segment:n}}).on(N,(e,{wrappedFunction:t,experimentThirdPartyUserFormParityGroupOn:a})=>{let{segment:n}=e;if(!(0,h.q2)(n))return e;let r=(0,h.Dq)(n,t,a);return{...e,segment:r}}).on(M,e=>{let{segment:t}=e,a=(0,x.Iw)(t),n=(0,x.ln)(t),l=(0,d.ny)(n??[]),i=(0,x.B8)(t),o=Array.isArray(i?.fields?.value)?i.fields.value:i?.fields?.value.elements,c=o?.reduce((e,t)=>(e[t.name]=(0,_.G)(t),e),{}),u=Object.keys(a).reduce((e,t)=>{let n=(0,r.A)(a[t]);if((0,s.H)(n.value)){let{value:e,default:a}=c?.[t]??{};n.value=a??e??null}else if(l?.name===t&&(0,d.wK)(n.value,l)){let e=n.value;Object.keys(e).forEach(t=>{if((0,s.H)(e[t])){let{value:a,default:n}=c?.[t]??{};e[t]=n??a??null}})}return e[t]=n,e},{});return{...e,segment:{...t,config:{...t.config,inputs:u}}}}).on(F,(e,{isDataFetching:t})=>{let{segment:a}=e;return{...e,segment:{...a,config:{...a.config,isDataFetching:t}}}}).on(O,e=>{let{segment:t}=e,a=t.config.functionVariables?.formAvailableData?{...t.config.functionVariables,formAvailableData:void 0,variables:{list:t.config.functionVariables.variables?.list.filter(({id:e})=>!(0,s.H)(e))??[],groups:t.config.functionVariables.variables?.groups??[]}}:t.config.functionVariables,n=(0,x.Iw)(t),l=Object.keys(n).reduce((e,t)=>{let a=(0,r.A)(n[t]);return a.value=removeRegexMatchingTextFromValue({value:a.value,regex:(0,p.wm)()}),e[t]=a,e},{});return{...e,segment:{...t,config:{...t.config,inputs:l,functionVariables:a}}}}).on(L,(e,t)=>{let{segment:a}=e,n=(0,l.A)({},a.config.dynamicInputs,t);return{...e,segment:{...a,config:{...a.config,dynamicInputs:n}}}}).on(D,(e,{parameter:t,options:a=[]})=>{let{segment:n}=e,r=(0,c.g)(n,t,a.map(u.G));return{...e,segment:r}}))},0x1bb29da6:(e,t,a)=>{"use strict";a.d(t,{N:()=>getFormWrappableParameters});var n=a(0x1903d373d),r=a(0x818fd090),l=a(0x242822dfb),i=a(0x45cdfa9c);let getFormWrappableParameters=(e,t)=>e?(0,i.k)(e).reduce((e,a)=>{let i=(0,r.w)(a);if(!(0,n.AL)(i,t))return e;if((0,l.sg)(i)){let t=i.properties??{};return Object.keys(t).forEach(a=>{let l=(0,r.w)(t[a]);(0,n.AL)(l)&&e.push(l)}),e}return"object"!==i.type&&e.push(i),e},[]):[]},0x78a9d64e:(e,t,a)=>{"use strict";a.d(t,{CL:()=>V,Pl:()=>hasValidInputParameterValue,c$:()=>W,fx:()=>U,r:()=>z,y$:()=>et});var n=a(0x20b4dda68),r=a(0x2264e6ea3),l=a(0x1d5f57074),i=a(0xf77002c6),s=a(0x818fd090),o=a(0x23416a0b6),c=a(0x85ec090),d=a(0x476b122),u=a(0x242822dfb),m=a(0x11e7de8ad),p=a(0x1a3026429),b=a(0x1340d624e),f=a(0x7019ae94),g=a(0xbbd2a32d),h=a(0x2772625d),_=a(0x1b05cc3ce),y=a(0x1ebe91b72),x=a(0x139a1172d),v=a(0xd0fb5338),E=a(0xaaa6bbd0),k=a(0xabd92c55),S=a(0x2281fc25),w=a(0x2339a0d72),C=a(0x252b4df6e),A=a(0xb4375e8a),T=a(0x1de72b3d8),I=a(0x6e20c837),N=a(0x1795d8821),M=a(0x16ed1b0dc),F=a(0xa985ed31),O=a(0x4f725d55),L=a(0x50279ca3),D=a(0xd2fa49d0),P=a(0x2001af3ac),R=a(0xa5d8361b),B=a(0x24429189c);let W=30,V=1,hasValidInputParameterValue=(e,t)=>{if((!e.is_required||e.isParameterFormWrappable)&&(0,f.$)(t)||"string"==typeof t&&(0,h.cn)(t))return!0;switch(e.type){case N.TE.String:if((0,f.$)(t)||"string"!=typeof t)return!1;return(!e.minLength||t.length>=e.minLength)&&(!e.maxLength||t.length<=e.maxLength);case N.TE.Boolean:case N.TE.Object:case N.TE.SlackTypesBlocks:case N.TE.SlackTypesRichText:case N.TE.SlackTypesLimitedRichText:case N.TE.SlackTypesExpandedRichText:case N.TE.SlackTypesTimestamp:case N.TE.SlackTypesDate:case N.TE.SlackUserPermission:case N.TE.SlackTypesMessageContext:case N.TE.SlackTypesUserContext:case N.TE.SlackTypesInteractivity:case N.TE.SlackTypesSalesforceRecordId:return!(0,f.$)(t);case N.TE.Number:return(0,g.gf)(Number(t));case N.TE.Integer:return(0,g.zh)(Number(t));case N.TE.SlackTypesChannelId:return"string"==typeof t&&(0,M.A)(t);case N.TE.SlackTypesUserId:return"string"==typeof t&&(0,O.A)(t);case N.TE.SlackTypesUsergroupId:return"string"==typeof t&&(0,D.A)(t);case N.TE.SlackTypesCanvasId:case N.TE.SlackTypesChannelCanvasId:case N.TE.SlackTypesCanvasTemplateId:return"string"==typeof t&&(0,F.A)(t);case N.TE.SlackTypesTeamId:return"string"==typeof t&&(0,r.Ay)(t);case N.TE.SlackTypesFileId:return"string"==typeof t&&(0,F.A)(t);case N.TE.SlackTypesListId:if("string"!=typeof t)return!1;return(0,F.A)(t)||(0,m.B)(t);case N.TE.Array:{if(!Array.isArray(t)||!e.items)return!1;let a=e.items.type;if("slack#/types/dynamic_pair"===a||"slack#/types/mixed"===a)return!0;if((0,f.$)(t)||e.minItems&&t.length<e.minItems||e.maxItems&&t.length>e.maxItems)return!1;if(e.name===S.c.EXTERNAL_RESOURCES)return!0;let n={type:a,maxLength:"string"===a?e.items.maxLength:void 0,minLength:"string"===a?e.items.minLength:void 0};return t.every(e=>("string"==typeof e||"number"==typeof e||"boolean"==typeof e)&&hasValidInputParameterValue(n,e))}case N.TE.SlackTypesCredentialOauth2:{let e=t?.credential_source,a=t?.external_token_id;return!!e&&Object.values(N.x).includes(e)&&(!!a||e===N.x.END_USER)}case N.TE.SlackTypesDynamicPair:return!(0,f.$)(t.value);default:return!1}},hasRequiredValue=(e,t,a)=>{let n=t[e.name]?.value,r=[N.oW.CreateChannel,N.oW.CreateUsergroup];return e.type===N.TE.SlackTypesTeamId&&a&&r.includes(a)?!(0,f.$)(n):!!e.isParameterFormWrapped||((0,_.L$)(e)&&!(0,_.M$)(e,t)?!(0,f.$)(n):!e.is_required||!(0,f.$)(n))},q=(0,x.g)("hasRequiredValues",({segment:e})=>{let t=(0,C.Dl)(e),a=t?.input_parameters||[],n=t?.callback_id,r=(0,C.Iw)(e);return a.every(e=>hasRequiredValue((0,s.w)(e),r,n))}),H=(0,x.g)("hasValidInputValues",({segment:e})=>{let t=(0,C.Dl)(e),a=t?.input_parameters||[],n=(0,C.Iw)(e);return a.every(e=>{let t=n[e.name]?.value;return hasValidInputParameterValue(e,t)})}),U=(0,x.g)("hasMessageWithTooManyCharacters",({segment:e},t,a)=>{if(!a||!(0,o.G)(e))return!1;let r=(0,C.Dl)(e),l=r?.input_parameters||[],i=(0,C.Iw)(e);return l.some(e=>{if(e.type!==N.TE.SlackTypesRichText)return!1;let t=i[e.name]?.value;if(!Array.isArray(t))return!1;let r=a((0,B.f)({blocks:t}));return(0,P.A)(r)>n.nb})}),z=(0,x.g)("hasValidMessagePostedTrigger",({segment:e,isExcludesFromSpecificUsersFilterChecked:t})=>(0,T.IL)(e,t)),j=(0,x.g)("hasValidAppPinBuiltInMessage",({segment:e})=>{let t=(0,C.Dl)(e);if(t?.callback_id!==N.oW.AddPin&&t?.callback_id!==N.oW.RemovePin)return!0;let{message:{value:a}}=(0,C.Iw)(e);return"string"!=typeof a||!!(0,y.cL)().test(a)||(e=>{if((0,L.A)(e))return!0;if(!(0,R.A)(e))return!1;let{pathname:t}=(0,l.jY)(e);return!!t&&(0,I.Wm)(t.split("/")[1])===I.im.MESSAGE})(a)}),$=(0,x.g)("hasValidButtonConfiguration",({segment:e})=>{let t=(0,C.Dl)(e);if(t?.callback_id!==N.oW.SendMessage&&t?.callback_id!==N.oW.SendDm&&t?.callback_id!==N.oW.SendToMySalesHome&&t?.callback_id!==N.oW.SendToSalesHome&&t?.callback_id!==N.oW.SendToMySalesforceApp&&t?.callback_id!==N.oW.SendToSalesforceApp)return!0;let{interactive_blocks:{value:a=[]}={}}=(0,C.Iw)(e),n=a?.find(e=>"actions"===e.type),r=n?.elements||[];return 0===r.length||!(0,w.P6)(r)&&r.every(e=>{let t=e.text.text,a="string"==typeof t&&t.length>=V&&t.length<=W;return"url"in e?!!(a&&((0,R.A)(e.url)||(0,h.cn)(e?.url??""))):"workflow_button"===e.type?!!(a&&e?.workflow?.trigger?.url):a})}),G=(0,x.g)("hasValidCanvasSelected",({segment:e})=>{let t=(0,C.Dl)(e);if(t?.callback_id!==N.oW.UpdateCanvasContent&&t?.callback_id!==N.oW.UpdateCanvasContentV2&&t?.callback_id!==N.oW.UpdateCanvasVariables&&t?.callback_id!==N.oW.CreateCanvas&&t?.callback_id!==N.oW.CreateChannelCanvas&&t?.callback_id!==N.oW.ShareCanvas)return!0;let a=(0,C.Iw)(e);if([N.oW.UpdateCanvasContent,N.oW.UpdateCanvasContentV2,N.oW.UpdateCanvasVariables].includes(t?.callback_id)){let e=a.canvas_update_type?.value||d.s.Standalone;if(e===d.s.Standalone&&!a.canvas_id?.value||(e===d.s.ChannelCanvas||e===d.s.ChannelTab)&&!a.channel_id?.value||t?.callback_id===N.oW.UpdateCanvasContentV2&&e===d.s.ChannelTab&&a.channel_id?.value&&!a.canvas_tab?.value)return!1}else if([N.oW.CreateCanvas,N.oW.CreateChannelCanvas].includes(t?.callback_id)){if((a.canvas_create_type?.value||c.M.Blank)===c.M.Template&&!a.canvas_template_id?.value)return!1}else if([N.oW.ShareCanvas].includes(t?.callback_id)){let e=a.user_ids?.value,t=a.channel_ids?.value;if(!e?.length&&!t?.length)return!1}return!0}),K=(0,x.g)("hasValidAsyncChecks",({asyncValidation:e})=>Object.values(e??{}).every(Boolean)),Y=(0,x.g)("hasValidDynamicInputs",({segment:e})=>{let t=(0,C.Dl)(e),a=t?.input_parameters||[],n=(0,C.Iw)(e);return a.every(e=>{let t=(0,s.w)(e),a=n[t.name]?.value;return(0,p.u)(t,a)})}),Q=(0,x.g)("hasValidFormWrappedInputs",({segment:e})=>{if(!e.config.isFunctionFormWrapped)return!0;if(!(0,C.B8)(e))return!1;let t=(0,C.Dl)(e),a=t?.input_parameters||[],n=(0,v.F$)(e);return!!(0,k.N8)({dialogTitle:n,maxLength:(0,v.$o)(e)})&&a.some(e=>{if((0,u.sg)(e)){let t=e.properties;return!!t&&Object.keys(t).some(e=>{let a=t[e];return"isParameterFormWrapped"in a&&a.isParameterFormWrapped})}return e.isParameterFormWrapped})}),Z=(0,x.g)("hasValidParentInputValues",({segment:e})=>{let t=(0,E.Pv)(e),a=(0,C.P)(e),n=a?.callback_id,r=a?.input_parameters.filter(e=>(0,i.oO)(e)).map(s.w)??[],l=t&&a?(0,E.Jl)(e,a,!0):(0,C.Iw)(e);return r.every(e=>{let t=l[e.name]?.value;return!("string"==typeof t&&(0,h.MR)(t))&&hasRequiredValue(e,l,n)&&hasValidInputParameterValue(e,t)})}),J=(0,x.g)("hasValidUserFilter",({segment:e})=>{let t=(0,C.Dl)(e);if(t?.callback_id!==N.oW.SendToSalesHome)return!0;let a=(0,C.Iw)(e),n=a[b.XD.USER_FILTER]?.value;return!!(!n||"object"!=typeof n||Array.isArray(n))||!n.schema_field_id&&!n.type||(0,A.Un)(n)}),X=(0,x.g)("hasValidValues",(e,{hasValidInputValues:t,hasValidAppPinBuiltInMessage:a,hasValidButtonConfiguration:n,hasValidAsyncChecks:r,hasValidCanvasSelected:l,hasValidParentInputValues:i,hasValidUserFilter:s})=>t&&a&&n&&r&&l&&i&&s),ee=(0,x.g)("isValid",(e,{hasValidValues:t,hasRequiredValues:a,hasValidDynamicInputs:n,hasValidFormWrappedInputs:r})=>t&&a&&n&&r),et=[q,H,$,j,K,Y,G,Q,Z,J,k.cy,k.c$,X,ee]},0xbf22577d:(e,t,a)=>{"use strict";a.d(t,{n:()=>getSlackFunctionStepPreview});var n=a(0xbad225b5),r=a(0x93d35cfe),l=a(0x12cef2078),i=a(0x16bebefd8),s=a(0x96aa1794),o=a(0x1a5ac3a0c),c=a(0x68e1de73),d=a(0xd0fb5338);let SlackFunctionFormStepPreview=({segment:e})=>n.createElement(c.B,{dialogTitle:(0,d.F$)(e),questions:(0,d.yS)(e),showTitle:!0});SlackFunctionFormStepPreview.displayName="SlackFunctionFormStepPreview";var u=a(0x1d67ca27f),m=a(0xead28e26),p=a(0x252b4df6e),b=a(0x6c06317c),f=a(0x1795d8821);let BuiltInMessageStepPreview=({segment:e,data:t,previewOptions:a={}})=>{let{staticWorkflow:c,isPinned:d,isEditor:m}=a,g=(0,p.Iw)(e),h=(0,p.Dp)(e),_=(0,n.useMemo)(()=>h!==f.oW.SendToSalesHome&&h!==f.oW.SendToSalesforceApp?t.list:(0,u.Wt)(g.user_id,t).list,[h,g.user_id,t]),y=(0,s.j)(),x=c||y,v=(0,o.BQ)(x),E=(0,o.DU)(x),k=(0,i.Sp)(x)?"":(0,o.DY)(x),S=(0,b.h)(g);return n.createElement(l.X,{noPointerEvents:!0,isInert:!0},n.createElement(r.Y,{blocks:S,dataList:_,isThread:f.oW.ReplyInThread===h,isPinned:d,workflowName:v,workflowIcon:E,workflowId:k,isEditor:m}))};BuiltInMessageStepPreview.displayName="BuiltInMessageStepPreview";let getSlackFunctionStepPreview=(e,t,a,r)=>{let l=(0,p.Dp)(t),i=(0,p.Iw)(t);switch(l){case f.oW.ReplyInThread:case f.oW.SendDm:case f.oW.SendMessage:case f.oW.SendToMySalesHome:case f.oW.SendToSalesHome:case f.oW.SendToMySalesforceApp:case f.oW.SendToSalesforceApp:case f.oW.SendToRecordChannel:case f.oW.SendEphemeralMessage:return n.createElement(BuiltInMessageStepPreview,{segment:t,data:a,previewOptions:r});case f.oW.OpenForm:return n.createElement(SlackFunctionFormStepPreview,{segment:t});case f.oW.SendSummaryToMySalesHome:case f.oW.SendSummaryToSalesHome:return n.createElement(m.P,{workflowId:e,configuredParameters:i});default:return null}};getSlackFunctionStepPreview.displayName="getSlackFunctionStepPreview"},0x6c06317c:(e,t,a)=>{"use strict";a.d(t,{h:()=>getPreviewBlocks});var n=a(0x21f3c49e8),r=a(0x1db69cda);let l=new(a(0x20482ad21)).Ay("workflow_builder"),getPreviewBlocks=e=>{let t=e.message?.value,a=(0,n.A)(t)?[{type:"rich_text",elements:[{type:"rich_text_section",elements:[{type:"text",text:l.t("Hello!")}]}]}]:(0,r.A)(t),i=e.interactive_blocks?.value,s=i?.find(e=>"actions"===e.type);if(s){let e={...s};e.block_id="workflow-builder-preview-actionblock",e.elements=e.elements.map(e=>"workflow_button"===e.type?{...e,action_id:"test",workflow:{trigger:{url:"https://example.com",customizable_input_parameters:[]}}}:{...e}),a.push(e)}return a}},0x21c792378:(e,t,a)=>{"use strict";a.d(t,{Bl:()=>getOperatorLabel,Qq:()=>buildVarNameToPrependLabelMap,ie:()=>buildTargetSelectOptions,tB:()=>getOperatorsForVariableType,yw:()=>valueOrValueArrayIsEligible});var n=a(0x20482ad21),r=a(0x13cd04b48),l=a(0x210eb9aa7),i=a(0x1795d8821),s=a(0x2a3fb7ec);let o=new n.Ay("workflow_builder"),c=[i.TE.SlackTypesDate,i.TE.SlackTypesTimestamp];function variableIsEligible(e,t){return!!e.isAvailable&&[i.TE.Array,i.TE.Boolean,i.TE.Integer,i.TE.Number,i.TE.String,i.TE.SlackTypesCanvasId,i.TE.SlackTypesChannelId,i.TE.SlackTypesDate,i.TE.SlackTypesLimitedRichText,i.TE.SlackTypesListId,i.TE.SlackTypesMessageContext,i.TE.SlackTypesRichText,i.TE.SlackTypesTimestamp,i.TE.SlackTypesUserId,i.TE.SlackTypesUsergroupId,...t?[i.TE.SlackTypesCanvasTemplateId,i.TE.SlackTypesTeamId]:[]].includes(e.type)}function valueOrValueArrayIsEligible(e){return Array.isArray(e)?e.every(valueIsEligible):valueIsEligible(e)}function valueIsEligible(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||"object"==typeof e&&!!e&&!Array.isArray(e)&&"type"in e&&"rich_text"===e.type||null==e}function getOperatorLabel(e,t){switch(e){case l.UT:return o.t("equals");case l.vz:if((0,s.X)(c,t))return o.t("is after");return o.t("is greater than");case l.iH:if((0,s.X)(c,t))return o.t("is before");return o.t("is less than");case l.k1:if((0,s.X)(c,t))return o.t("is on or after");return o.t("is greater than or equal to");case l.V_:if((0,s.X)(c,t))return o.t("is on or before");return o.t("is less than or equal to");case l.sz:case l.Lr:return o.t("contains");case l.Hh:case l.m:return o.t("does not contain");case l.mh:return o.t("is not equal to");case l.zG:return o.t("is empty");case l.tC:return o.t("is not empty");case l.io:return o.t("contains all of");case l.$:return o.t("contains any of");case l.Rh:return o.t("contains only");case l.aQ:return o.t("does not contain any of");default:return""}}let getOperatorsForVariableType=(e,t)=>{if(e){if(e===i.TE.Array&&t===i.TE.SlackTypesFileId)return l.bK;let a=l.fG[e];if(a)return a}return[]},buildVarNameToPrependLabelMap=e=>{let t={};for(let a of e)t[a.name]=a.prependLabel||"";return t},buildTargetSelectOptions=({stepData:e,expressionData:t,experimentWfbConditionalBranchingNewTypesGroupOn:a})=>{let n=(0,r.SD)(t),l=[],s=e.groups.reduce((e,t)=>{let s,{id:o,data:c,label:d,stepIndex:u}=t,m=(s=(e,t)=>{if(!t.isHidden&&variableIsEligible(t,a)&&e.push({label:t.label,value:t.id,key:`${t.id}`,extras:{data:t}}),t.type===i.TE.Object&&t.objectProperties){let a=t.objectProperties.reduce(s,[]);e.push(...a)}return e},c.reduce(s,[])),p=n&&n[o],b=u?`${u}. ${d}`:d;if(p){let e=((e,t,a)=>{let n=[],l="";for(let s of e){let{id:e,reference:o}=s;if(!e||!o)continue;let c=(0,r.w)(o);l!==c&&n.push({label:t[c],value:"",isDisabled:!0,nonInteractive:!0}),l=c;let d=o.replace(/\.\d+?\.block_id}}$/,"}}"),u=a.find(e=>e.id===d)?.type===i.TE.SlackTypesRichText,m=(0,r.DJ)({expressionDataObject:s,isUnsupportedRichTextDropdownType:u});n.push({label:m,value:e,key:e,extras:{data:{...s,label:m}},isDisabled:u})}return n})(p,buildVarNameToPrependLabelMap(c),c);l.push({label:b,value:"",nonInteractive:!0,isDisabled:!0}),l.push(...e)}return 0!==m.length&&e.push({label:b,options:m,value:o}),e},[]);return[...0!==l.length?[{label:o.t("Recommended"),value:"",options:l}]:[],...s]}},0x18608b0ec:(e,t,a)=>{"use strict";a.d(t,{Iv:()=>u,Mz:()=>b,Oy:()=>g,VO:()=>m,Wf:()=>x,_d:()=>p,aI:()=>f,gA:()=>v,hx:()=>_,sn:()=>h,uI:()=>d,xq:()=>y});var n=a(0xe0376d2),r=a(0x1ebe91b72),l=a(0x870b34a7),i=a(0x106f35107),s=a(0x210eb9aa7),o=a(0x20d4168fd),c=a(0x205de9db);let d=(0,l.W)("initiate expression"),u=(0,l.W)("update selected target"),m=(0,l.W)("update selected operator"),p=(0,l.W)("update selected value"),b=(0,l.W)("update additional context with list info, this is needed on the BE for 3puf list variables to parse option IDs"),f=(0,l.W)("update required context needed by step configuration"),g=(0,l.W)("set fallback is selected"),h=(0,l.W)("set branch name"),_=(0,l.W)("validate input parameters with async calls"),y=(0,l.W)("set the target variable's type for segment validation"),x=(0,l.W)("set branch color"),v=(0,i.GX)(c.y$).on(d,e=>{let{segment:t}=e;return{...e,segment:{...t,config:{...t.config,isFallback:!1},displayConfig:{...t.displayConfig,color:s.fQ}}}}).on(u,(e,{selectedTarget:t,selectedTargetVariable:a})=>{let{segment:n}=e,l=(0,o.C9)(n),i=(0,r.h0)().test(t),s={...l,target:t},c=a?{target:{value:a.id}}:void 0;return i&&(delete s.operator,delete s.value),{...e,segment:{...n,config:{...n.config,isFallback:!1,expression:{version:1,root:{statement:s}}},targetVariable:a,inputs:c}}}).on(m,(e,{selectedOperator:t})=>{let{segment:a}=e,n=(0,o.C9)(a);return{...e,segment:{...a,config:{...a.config,isFallback:!1,expression:{version:1,root:{statement:{...n,operator:t}}}}}}}).on(p,(e,{selectedValue:t,selectedLabel:a})=>{let{segment:n}=e,r={...(0,o.C9)(n),value:t,label:a};return(null==t||""===t)&&(delete r.label,delete r.value),void 0===a&&delete r.label,{...e,segment:{...n,config:{...n.config,isFallback:!1,expression:{version:1,root:{statement:r}}}}}}).on(b,(e,{listId:t,columnId:a})=>{let{segment:n}=e,r={...(0,o.C9)(n)},l={};return t&&(l.list_id=t),a&&(l.column_id=a),r.additional_context=l,t||a||delete r.additional_context,{...e,segment:{...n,config:{...n.config,isFallback:!1,expression:{version:1,root:{statement:r}}}}}}).on(f,(e,{value:t})=>{let{segment:a}=e;return{...e,segment:{...a,requiredContext:(0,n.A)([...a.requiredContext||[],..."string"==typeof t?[t]:t])}}}).on(g,(e,{isFallback:t})=>{let{segment:a}=e;return{...e,segment:{...a,config:{...a.config,isFallback:t,expression:t?void 0:a.config.expression}}}}).on(h,(e,{name:t})=>{let{segment:a}=e;return{...e,segment:{...a,config:{...a.config,name:t}}}}).on(_,(e,t)=>{let{segment:a}=e;return{...e,segment:{...a,asyncValidation:{...e.asyncValidation,...t}}}}).on(y,(e,{targetVariable:t})=>{let{segment:a}=e;return{...e,segment:{...a,targetVariable:t}}}).on(x,(e,{color:t})=>{let{segment:a}=e;return{...e,segment:{...a,displayConfig:{...a.displayConfig,color:t}}}})},0x205de9db:(e,t,a)=>{"use strict";a.d(t,{CX:()=>isStandAloneOperator,y$:()=>c,zc:()=>isStandAloneTarget});var n=a(0xec9d0658),r=a(0x1ebe91b72),l=a(0x139a1172d),i=a(0x78a9d64e),s=a(0x210eb9aa7),o=a(0x20d4168fd);let isStandAloneTarget=e=>(0,r.h0)().test(e),isStandAloneOperator=e=>s.EF.has(e),c=[(0,l.g)("hasValidValues",({segment:e})=>{let t=(0,o.C9)(e),{targetVariable:a}=e,{hasValidTarget:n}=e.asyncValidation||{},{isFallback:r}=e.config,{target:l,operator:s,value:c}=t||{},d=a&&void 0!==c&&(0,i.Pl)({type:a.type,items:{type:a.items?.type},is_required:!0},c),u=l&&s&&d,m=l&&isStandAloneTarget(l),p=l&&s&&isStandAloneOperator(s);return!!(r||n&&(u||m||p))}),(0,l.g)("hasValidBranchName",({segment:e})=>{let{name:t}=e.config;return!t||!t.length||t.replace((0,n.A)(),"1").length<=100}),(0,l.g)("isValid",(e,{hasValidValues:t,hasValidBranchName:a})=>t&&a)]},0x75b1e64d:(e,t,a)=>{"use strict";a.d(t,{B:()=>SwitchSummary});var n=a(0xbad225b5),r=a(0x120c268ad),l=a.n(r),i=a(0x5359476e),s=a(0x1cbdfeceb),o=a(0x20482ad21),c=a(0x1fd3f6e20),d=a(0x1fdec3e16),u=a(0x222a04717),m=a(0x1312f060e),p=a(0x668181b3),b=a(0x2772625d),f=a(0x96aa1794),g=a(0x13cd04b48),h=a(0x20a2a54fa),_=a(0x1a5ac3a0c),y=a(0x21c792378),x=a(0x20d4168fd),v=a(0x154dd8295),E=a(0x247cf31a2),k=a(0x1346d4ed0),S=a(0xf4097f62),w=a(0x213c0555e),C=a(0x93f78b39),A=a(0x1b3ecb90f),T=a(0x15a4ffb05),I=a(0x42654967),N=a(0x1795d8821),M=a(0x6960d8b9),F=a(0x254e93e7),O=a.n(F);let L=new o.Ay("workflow_builder"),SwitchSummary=({segment:e,templateExpressionData:t})=>{let{list:a}=(0,h.EM)(e),r=(0,g.Ox)()??t,i=(0,f.j)(),s=(0,n.useMemo)(()=>i?.workflow.steps??[],[i]),o=(0,v.Yc)(e),m=(0,x.C9)(e),b=(0,x.At)(e),E=(0,_.W0)(e.id,i),k=m?.target?(0,p.x)(a,m.target):void 0,S=r&&m?.target&&r[m.target],w=!k&&!S,C=(0,n.useMemo)(()=>{let e,t=L.t("Missing Data"),r="";m?.target&&(k&&(t=k?.label,e=k.type),S)&&(r=(0,y.Qq)(a)[(0,g.w)(S?.reference)],t=(0,g.DJ)({expressionDataObject:S}),e=S.type);let l=n.createElement("span",{className:w?O().missing_data:""},n.createElement(u._,{type:e}),t&&n.createElement(T.A,{text:t})),i=n.createElement("span",null,r);return r?L.rt("{targetLabelElement} from {referenceLabelElement}",{targetLabelElement:l,referenceLabelElement:i}):l},[m?.target,S,w,a,k]),I=(0,n.useMemo)(()=>m?.operator?n.createElement("span",null,(0,y.Bl)(m.operator,k?.type)):"",[m?.operator,k?.type]),N=(0,n.useMemo)(()=>deriveValueToDisplay(m,a,k)??"",[m,a,k]),M=(0,n.useMemo)(()=>{let t=(0,_.B5)(e.id,s),a=convertBranchColorToTagStyle((0,x.K1)(e),E);return n.createElement("div",null,n.createElement("div",{className:O().branch_header},n.createElement(c.v,{style:a,isMicro:!0},n.createElement(d.A,{lines:1,withTooltip:!0},!!t&&n.createElement("span",{className:"margin_right_25"},L.t("Branch {index}.",{index:t,fallbackHash:"234c28ea605029faff767aa5c00d652776a209f4"})),n.createElement(T.A,{text:b,emojiSize:A.lw.SMALL}))),m?n.createElement("span",{className:l()(O().branch_expression,O().statement_container)},L.rt("If {target} {operator} {value}",{target:C,operator:I,value:N})):L.t("FALLBACK")))},[b,m,E,I,e,C,N,s]);return o?n.createElement("span",null,n.createElement(T.A,{text:L.t("Branch workflow"),emojiSize:A.lw.SMALL}),n.createElement("span",{className:O().switch_caption},L.t("(first matching branch will run)",{fallbackHash:"0d35d89f29fe5c2d2c521a719e4ac92002831468"}))):M};function convertBranchColorToTagStyle(e,t){if(!e||"gray"===e)return t?void 0:c.u.Gray;switch(e){case"gray":default:return c.u.Gray;case"tomato":case"paprika":return c.u.Flamingo;case"sunflower":return c.u.Honeycomb;case"jade":return c.u.Jade;case"indigo":return c.u.Indigo;case"lagoon":return c.u.Lagoon}}function deriveValueToDisplay(e,t,a){return e?.value?Array.isArray(e?.value)?n.createElement(n.Fragment,null,(0,i.A)(e?.value,(e,t,a)=>a.length-1!==t?[e,L.t(", ")]:e).map((n,r)=>deriveSingleValueToDisplay(n,e?.label,t,a,r)??"")):n.createElement(n.Fragment,null,deriveSingleValueToDisplay(e?.value,e?.label,t,a)??""):null}function deriveSingleValueToDisplay(e,t,a,r,l){if(!e)return null;let i=void 0!==l,o=r?.type===N.TE.SlackTypesLimitedRichText||r?.type===N.TE.SlackTypesRichText,c=i&&!o?r?.items?.type:r?.type,d=l??0;if("string"==typeof e&&(0,b.cn)(e)){let t=(0,p.x)(a,e),r=t?.label??L.t("Missing Data");return n.createElement("span",{key:`${d}-${t?.id??"missing-data"}`},n.createElement(u._,{type:c})," ",r)}if(!(i&&l%2==1)){if(r&&c===N.TE.SlackTypesChannelId&&"string"==typeof e)return n.createElement(E.A,{channelId:e,key:`${d}-${e}`});if(r&&c===N.TE.SlackTypesUserId&&"string"==typeof e)return n.createElement(S.A,{id:e,key:`${d}-${e}`});if(r&&c===N.TE.SlackTypesUsergroupId&&"string"==typeof e)return n.createElement("span",{className:O().inline,key:`${d}-${e}`},n.createElement(w.A,{id:e}));if(r&&c===N.TE.SlackTypesTimestamp&&"string"==typeof e)return n.createElement("span",{className:O().inline,key:`${d}-${e}`},(0,M.Yq)(e,"{date_pretty}"),(0,M.Yq)(e," {time}"));if(r&&c===N.TE.SlackTypesDate&&"string"==typeof e)return n.createElement("span",{className:O().inline,key:`${d}-${e}`},(0,M.Yq)((0,I.cU)(e),"{date_pretty}"));if(r&&(c===N.TE.SlackTypesCanvasId||c===N.TE.SlackTypesListId)&&"string"==typeof e)return n.createElement("span",{className:O().inline,key:`${d}-${e}`},n.createElement(k.A,{id:e,shouldShowHighlight:!1,shouldShowDetailText:!1}));if(r&&(c===N.TE.SlackTypesLimitedRichText||c===N.TE.SlackTypesRichText)&&"object"==typeof e){let t=e?.elements?.[0];if(!(0,m.B)(t)||!t.elements)return null;let a=e.type;return n.createElement("div",{className:"p-block-kit-select_options",key:`${a}-${d}`},n.createElement(C.A,{type:a,elements:t.elements,disableHighlights:!1,inline:!0,clogLinkClick:s.A,noInlineLinks:!0,alwaysDisplayMentionsAsLinks:!0,disableJumboEmoji:!0}))}}let f="";return f="string"==typeof e?n.createElement(T.A,{key:`${d}-${e}`,text:e}):"object"==typeof e?"":"boolean"==typeof e?e?L.t("Yes"):L.t("No"):e,t??f}SwitchSummary.displayName="SwitchSummary",deriveSingleValueToDisplay.displayName="deriveSingleValueToDisplay"},0xf3dd4cf5:(e,t,a)=>{"use strict";a.d(t,{Q:()=>TriggerFilterCondition});var n=a(0xbad225b5),r=a(0x20482ad21),l=a(0x2b7f0bcc),i=a(0x2172ff7ff),s=a(0x1d1911997),o=a(0xaf63c01f),c=a(0x17178b190),d=a(0x145d46a61),u=a(0x226892387),m=a(0x1595c7430),p=a.n(m);let b=new r.Ay("workflow_builder"),FilterConditionField=({handleChangeField:e,condition:t,fields:a,fieldsLoading:r,isWrapped:l,disabled:m=!1})=>{let{schema_field_id:f}=t,g=(0,n.useRef)(null),h=(0,u.d4)(d._1),_=(0,o.h)({fields:a,selectedFieldId:f}),y=(0,n.useCallback)(({value:t})=>{t!==f&&e(t)},[f,e]),x=(0,n.useMemo)(()=>a.filter(e=>e.isActive).map(e=>{if(e.type===c.kY.ReferenceSchemaField){let t=e.relationships?.find(e=>e.isActive);return{label:t?.relationshipLabel??t?.relationshipName??e.label,value:e.id}}return{label:e.label,value:e.id}}).sort((e,t)=>(0,i.Ay)(e.label,t.label)),[a]),v=h?_:x,E=(0,n.useMemo)(()=>v.find(e=>e.value===f),[v,f]),k=(0,n.useMemo)(()=>v.map(({value:e})=>e).join("_"),[v]);return n.createElement("div",{className:l?p().conditionContainer__fieldWrap:p().conditionContainer__field},n.createElement(s.Ay,{key:E?.value??k,isLoading:r,isDisabled:m,selectId:"conditionField",options:v,placeholderText:b.t("Select field\u2026"),ariaLabel:b.t("Field"),width:"100%",onOptionSelected:y,selectedOption:E,showDropdownIcon:!0,inputRef:g,shouldAllowUnselectInSingleSelectMode:!1}))};FilterConditionField.displayName="FilterConditionField";var f=a(0x15dd8a31);let g=new r.Ay("workflow_builder"),FilterConditionOperator=({operators:e,handleChangeOperator:t,selectedOperator:a,disabled:r,fieldId:l,isWrapped:s})=>{let o=g.t("And"),d=g.t("Or"),u=g.t("contains"),m=g.t("is"),b=g.t("is later than"),h=g.t("is earlier than"),_=g.t("does not contain"),y=g.t("does not equal"),x=g.t("ends with"),v=g.t("is equal to"),E=g.t("is greater than"),k=g.t("is empty"),S=g.t("is not empty"),w=g.t("is less than"),C=g.t("is exactly all of"),A=g.t("is not exactly all of"),T=g.t("starts with"),I=(0,n.useMemo)(()=>({[c.lt.AndFilterCondition]:o,[c.lt.OrFilterCondition]:d,[c.lt.ContainsFilterCondition]:u,[c.lt.DateOffsetEqualsFilterCondition]:m,[c.lt.DateOffsetGreaterThanFilterCondition]:b,[c.lt.DateOffsetLessThanFilterCondition]:h,[c.lt.DoesNotContainFilterCondition]:_,[c.lt.DoesNotEqualFilterCondition]:y,[c.lt.EndsWithFilterCondition]:x,[c.lt.EqualsFilterCondition]:v,[c.lt.GreaterThanFilterCondition]:E,[c.lt.IsEmptyFilterCondition]:k,[c.lt.IsNotEmptyFilterCondition]:S,[c.lt.LessThanFilterCondition]:w,[c.lt.SetEqualsFilterCondition]:C,[c.lt.SetNotEqualsFilterCondition]:A,[c.lt.StartsWithFilterCondition]:T}),[o,d,u,m,b,h,_,y,x,v,E,k,S,w,C,A,T]),N=(0,n.useCallback)(({value:e})=>{t(e)},[t]),[M,F]=(0,n.useMemo)(()=>[e.map(e=>({value:e,label:I[e]})).sort((e,t)=>(0,i.Ay)(e.label,t.label)),e.join("-")+l],[I,e,l]),O=(0,n.useMemo)(()=>M.find(({value:e})=>e===a),[a,M]);return n.createElement("div",{className:s?p().conditionContainer__operatorWrap:p().conditionContainer__operator},n.createElement(f.A,{key:F,isDisabled:r,options:M,selectId:"conditionOperator",onOptionSelected:N,placeholderText:g.t("Select operator\u2026"),selectedOption:O,width:"100%",ariaLabel:g.t("Operator")}))};FilterConditionOperator.displayName="FilterConditionOperator";var h=a(0x56e1c8ae);let FilterConditionTargetValue=({field:e,handleChangeRhs:t,condition:a,InputComponent:r,isWrapped:l,maxItems:i,isDisabled:s=!1})=>{let{type:o}=a,d=(0,n.useCallback)((a,n)=>{t((Array.isArray(a)?a:[a]).map(t=>{let a=(0,h.Kr)(e?.type);if(n)return{value:t,type:a,isError:n};switch(a){case"DoubleNumber":case"LongInt":return{value:Number(t),type:a,isError:n};case"BooleanValue":return{value:"false"!==t&&!!t,type:a,isError:n};default:return{value:String(t),type:a,isError:n}}}))},[e?.type,t]),u=(0,n.useCallback)(e=>{let a=!!(i&&e.length>i);t(e.map(e=>({...e,type:c.Yf.ReferenceValue,isError:a})))},[t,i]),m=(0,n.useCallback)(e=>{t(e)},[t]);return!e||!o||(0,h.jF)(o)?null:n.createElement(r,{condition:a,field:e,handleChangeValue:d,handleChangeReferenceValue:u,handleChangeDateOffsetValue:m,isWrapped:l,maxItems:i,isDisabled:s})};FilterConditionTargetValue.displayName="FilterConditionTargetValue";var _=a(0x1cb9794d5),y=a(0x6a40f0b8),x=a(0x126f22530),v=a(0x15014e268);let E={type:"divider",value:void 0,label:void 0},k="TODAY",S="StartOf",w="EndOf",C=new r.Ay("workflow_builder"),getTodayOption=e=>({value:k,label:e?C.t("today"):"today"}),getBeforeOption=e=>({value:c.ZH.Before,label:e?C.t("day(s) before"):"day(s) before"}),getAfterOption=e=>({value:c.ZH.After,label:e?C.t("day(s) after"):"day(s) after"}),getStartOfOption=e=>({value:S,label:e?C.t("start of"):"start of"}),getEndOfOption=e=>({value:w,label:e?C.t("end of"):"end of"}),A=new r.Ay("workflow_builder"),getTodayTimePeriodOption=e=>({label:e?A.t("Today"):"Today",value:k}),getTimePeriodOptions=e=>[getTodayTimePeriodOption(e),E,{label:e?A.t("Previous Month"):"Previous Month",value:[c.yO.Previous,c.Wq.Month]},{label:e?A.t("This Month"):"This Month",value:[c.yO.Current,c.Wq.Month]},{label:e?A.t("Next Month"):"Next Month",value:[c.yO.Next,c.Wq.Month]},E,{label:e?A.t("Previous Quarter"):"Previous Quarter",value:[c.yO.Previous,c.Wq.FiscalQuarter]},{label:e?A.t("This Quarter"):"This Quarter",value:[c.yO.Current,c.Wq.FiscalQuarter]},{label:e?A.t("Next Quarter"):"Next Quarter",value:[c.yO.Next,c.Wq.FiscalQuarter]},E,{label:e?A.t("Previous Fiscal Year"):"Previous Fiscal Year",value:[c.yO.Previous,c.Wq.FiscalYear]},{label:e?A.t("This Fiscal Year"):"This Fiscal Year",value:[c.yO.Current,c.Wq.FiscalYear]},{label:e?A.t("Next Fiscal Year"):"Next Fiscal Year",value:[c.yO.Next,c.Wq.FiscalYear]}],isCompositeValueTimePeriodOption=e=>Array.isArray(e.value);var T=a(0x4e697bfb),I=a(0x207fb9b92),N=a(0x8b7c8ca6),M=a.n(N);let F=new r.Ay("workflow_builder"),O="TODAY",L="DAYS_BEFORE",D="DAYS_AFTER",FilterConditionDateOffsetTargetValueInputOld=({value:e,label:t,onChange:a,required:r})=>{let l=(0,n.useMemo)(()=>[{value:O,label:F.t("today")},{value:L,label:F.t("day(s) before today")},{value:D,label:F.t("day(s) after today")}],[]),i=(0,n.useMemo)(()=>void 0===e?null:Math.abs(e),[e]),s=(0,n.useMemo)(()=>void 0===e?null:Math.sign(e),[e]),o=(0,n.useMemo)(()=>{let e=(e=>{switch(e){case 0:return O;case -1:return L;case 1:return D;default:return null}})(s);return l.find(t=>t.value===e)},[l,s]),c=(0,n.useCallback)(e=>a((s||0)*(Number(e)||1)),[a,s]),d=(0,n.useCallback)(e=>{a((e=>{switch(e){case O:return 0;case L:return -1;case D:return 1;default:return 0}})(e.value)*(i||1))},[a,i]),{errorText:u,onBlur:m}=(0,I.K)({errorMessage:"error",isErrored:!!r&&!o,shouldErrorPreventSave:!0}),b=(0,n.useMemo)(()=>{let e=[];return u&&e.push({id:"ITEMS_REQUIRED",message:F.t("This field is required.")}),e},[u]);return n.createElement("div",{className:p().filterConditionDateOffsetTargetValue},s?n.createElement(x.A,{"aria-label":t,value:i,onChange:c,placeholder:F.t("Enter a value\u2026"),type:"number",min:1,max:1/0,id:"filter-condition-form-date-offset-magnitude__input",name:"filter-condition-form-date-offset-magnitude__input"}):null,n.createElement(v.Ay,{options:l,selectedOption:o??null,onOptionSelected:d,placeholderText:F.t("Select a date range\u2026"),isRequired:r,errors:b,onBlur:m,selectDataQa:"filter-condition-form-date-offset__input"}))};FilterConditionDateOffsetTargetValueInputOld.displayName="FilterConditionDateOffsetTargetValueInputOld";let FilterConditionDateOffsetTargetValueInput=({rhs:e,label:t,onChange:a,onChangeRhs:r,required:l,experimentTroopsTimePeriodFilterConditionsGroupOn:i,isDisabled:s=!1})=>{let o,d,u,m,p=e?.value===void 0?1:Math.abs(Number(e.value)),[b,f]=(0,n.useState)(p),g=(o=e?.time_period?.position?.type,d=Number(e?.value),o||0!==d?0===d&&o===c.ZH.Before?getStartOfOption(i):0===d&&o===c.ZH.After?getEndOfOption(i):d<0||o===c.ZH.Before?getBeforeOption(i):d>0||o===c.ZH.After?getAfterOption(i):void 0:getTodayOption(i)),[h,_]=(0,n.useState)(g),y=(u=e?.time_period?.period_reference?.type,m=e?.time_period?.period_type?.type,getTimePeriodOptions(i).filter(isCompositeValueTimePeriodOption).find(e=>e.value[0]===u&&e.value[1]===m)||getTodayTimePeriodOption(i)),[x,C]=(0,n.useState)(y),A=(0,n.useCallback)(({nextMagnitude:e,nextPosition:t,nextTimePeriod:n})=>{let l=e??b,i=t?.value||h?.value,s=n||x;if(!i)return;if(i===k)return void a(0);let o=i===c.ZH.Before?-l:i===c.ZH.After?l:i===S||i===w?0:l;if(s.value===k)return void a(o);if(!isCompositeValueTimePeriodOption(s))return;let[d,u]=s.value;r([{type:c.Yf.TimePeriodOffset,isError:!1,value:o,time_period:{period_type:{type:u},period_reference:{type:d,...d!==c.yO.Current&&{periods:1}},position:{type:i===S?c.ZH.Before:i===w?c.ZH.After:i}}}])},[b,h?.value,x,r,a]),N=(0,n.useCallback)(e=>{e<1||e>999||(f(e),A({nextMagnitude:e}))},[A]),O=(0,n.useCallback)(e=>{e.value&&(_(e),0===b?(f(1),A({nextPosition:e,nextMagnitude:1})):A({nextPosition:e}))},[A,b]),L=(0,n.useCallback)(e=>{(isCompositeValueTimePeriodOption(e)||e.value===k)&&(C(e),A({nextTimePeriod:e}))},[A]),{errorText:D,onBlur:P}=(0,I.K)({errorMessage:"error",isErrored:!!l&&void 0===h,shouldErrorPreventSave:!0}),R=(0,n.useMemo)(()=>{let e=[];return D&&e.push({id:"ITEMS_REQUIRED",message:F.t("This field is required.")}),e},[D]),B=getTimePeriodOptions(i),W=[getTodayOption(i),E,getBeforeOption(i),getAfterOption(i),E,getStartOfOption(i),getEndOfOption(i)],V=h?.value===c.ZH.Before||h?.value===c.ZH.After,q=h?.value===S||h?.value===w;return n.createElement("div",{className:M().container},V&&n.createElement("div",{className:M().magnitudeContainer},n.createElement(T.o,{label:t,value:b,onChange:N,min:1,max:999,isDisabled:s})),n.createElement("div",{className:M().dateRangeContainer},n.createElement(v.Ay,{ariaLabel:F.t("Select a date range\u2026"),width:"100%",options:W,selectedOption:h,onOptionSelected:O,placeholderText:F.t("Select a date range\u2026"),isRequired:l,errors:R,onBlur:P,isDisabled:s})),(V||q)&&n.createElement("div",{className:M().timePeriodContainer},n.createElement(v.Ay,{ariaLabel:i?F.t("Select period\u2026"):"Select period\u2026",width:"100%",options:B,selectedOption:x,onOptionSelected:L,placeholderText:i?F.t("Select period\u2026"):"Select period\u2026",isDisabled:s})))};FilterConditionDateOffsetTargetValueInput.displayName="FilterConditionDateOffsetTargetValueInput";var P=a(0x13245bc52);let R=new r.Ay("workflow_builder"),B=[],FilterConditionTargetValueInput=({field:e,handleChangeValue:t,handleChangeReferenceValue:a,handleChangeDateOffsetValue:r,condition:l,isWrapped:i,maxItems:s,isDisabled:o=!1})=>{let m=(0,u.d4)(d.Xz),{rhs:b,type:f}=l,g=(0,n.useMemo)(()=>Array.isArray(b)?b:b?[b]:b,[b]),x=(0,h.Y3)(g),v=(0,n.useMemo)(()=>x.map(e=>String(e)),[x]),E=(0,h.kR)(g),k=(0,n.useCallback)(e=>t(e,!1),[t]),S=R.t("Value"),w=(0,n.useCallback)(()=>{let l={label:S,onChange:k,isDisabled:o};switch(e.type){case c.kY.StringSchemaField:switch(f){case c.lt.EqualsFilterCondition:case c.lt.DoesNotEqualFilterCondition:case c.lt.ContainsFilterCondition:case c.lt.DoesNotContainFilterCondition:case c.lt.EndsWithFilterCondition:case c.lt.StartsWithFilterCondition:return n.createElement(_.d,{value:v,onChange:t,required:!0,placeholderText:R.t("Enter a value\u2026"),ariaLabel:l.label,className:"margin_bottom_0",disableIdParsing:!0,splitOnWhitespace:!1,isDisabled:o});default:return null}case c.kY.URLSchemaField:case c.kY.EmailSchemaField:switch(f){case c.lt.EqualsFilterCondition:case c.lt.DoesNotEqualFilterCondition:case c.lt.ContainsFilterCondition:case c.lt.DoesNotContainFilterCondition:case c.lt.EndsWithFilterCondition:case c.lt.StartsWithFilterCondition:return n.createElement(_.d,{value:v,onChange:t,required:!0,placeholderText:R.t("Enter a value\u2026"),ariaLabel:l.label,className:"margin_bottom_0",disableIdParsing:!0,isDisabled:o});default:return null}case c.kY.BooleanSchemaField:switch(f){case c.lt.EqualsFilterCondition:case c.lt.DoesNotEqualFilterCondition:return n.createElement(P.$f,{...l,value:x[0],required:!0});default:return null}case c.kY.DoubleSchemaField:case c.kY.CurrencySchemaField:switch(f){case c.lt.EqualsFilterCondition:case c.lt.DoesNotEqualFilterCondition:return n.createElement(_.d,{value:v,onChange:t,required:!0,placeholderText:R.t("Enter a number\u2026"),ariaLabel:l.label,validation:y.m.Number,className:"margin_bottom_0",disableIdParsing:!0,isDisabled:o});case c.lt.GreaterThanFilterCondition:case c.lt.LessThanFilterCondition:return n.createElement(P.oz,{...l,value:x[0]});default:return null}case c.kY.LongSchemaField:switch(f){case c.lt.EqualsFilterCondition:case c.lt.DoesNotEqualFilterCondition:return n.createElement(_.d,{value:v,onChange:t,required:!0,placeholderText:R.t("Enter a number\u2026"),ariaLabel:l.label,validation:y.m.Integer,className:"margin_bottom_0",disableIdParsing:!0,isDisabled:o});case c.lt.GreaterThanFilterCondition:case c.lt.LessThanFilterCondition:return n.createElement(P.oz,{...l,value:x[0]});default:return null}case c.kY.SelectSchemaField:switch(f){case c.lt.EqualsFilterCondition:case c.lt.DoesNotEqualFilterCondition:case c.lt.SetEqualsFilterCondition:case c.lt.SetNotEqualsFilterCondition:return n.createElement(P.zM,{...l,value:x??[],options:e.options||B,required:!0});case c.lt.EndsWithFilterCondition:case c.lt.StartsWithFilterCondition:case c.lt.ContainsFilterCondition:case c.lt.DoesNotContainFilterCondition:return n.createElement(_.d,{value:v,onChange:t,required:!0,placeholderText:R.t("Enter a value\u2026"),ariaLabel:l.label,className:"margin_bottom_0",disableIdParsing:!0,isDisabled:o});default:return null}case c.kY.ReferenceSchemaField:switch(f){case c.lt.EqualsFilterCondition:case c.lt.DoesNotEqualFilterCondition:return n.createElement(P.Gj,{...l,identifiers:E,onChange:a,fieldId:e.id,required:!0,maxItems:s});default:return null}case c.kY.DateSchemaField:case c.kY.DateTimeSchemaField:switch(f){case c.lt.DateOffsetEqualsFilterCondition:case c.lt.DateOffsetGreaterThanFilterCondition:case c.lt.DateOffsetLessThanFilterCondition:return m?n.createElement(FilterConditionDateOffsetTargetValueInput,{required:!0,rhs:g?.[0],label:S,onChange:k,onChangeRhs:r,experimentTroopsTimePeriodFilterConditionsGroupOn:m,isDisabled:o}):n.createElement(FilterConditionDateOffsetTargetValueInputOld,{...l,value:x[0],required:!0});default:return null}default:return null}},[t,k,a,r,e.type,e.options,e.id,f,x,v,E,S,s,g,m,o]);return!f||(0,h.jF)(f)?null:n.createElement("div",{"data-qa":"condition-value__wrapper",className:i?p().conditionContainer__valueWrap:p().conditionContainer__value},w())};FilterConditionTargetValueInput.displayName="FilterConditionTargetValueInput";var W=a(0x702be429),V=a(0x24f77b0a),q=a(0x1fe613d6e);let H=new r.Ay("workflow_builder"),TriggerFilterCondition=({condition:e,conditionIndex:t,onChange:a,isWrapped:r,subtype:i,groupIndex:s=0,isDisabled:o=!1})=>{let{fields:m,fieldsLoading:b,isObjectAccessible:f}=(0,V.T)(),g=(0,u.d4)(d.Mp),_=(0,u.d4)(d._1),y=(0,u.d4)(q.K),x=_&&y,{type:v,schema_field_id:E}=e,k=(0,n.useCallback)((t,n=!1)=>{a(n?t:{...e,...t})},[e,a]),S=(0,n.useMemo)(()=>m.find(e=>e.id===E),[m,E]);(0,W.Lq)(e,a,S);let w=(0,W.AW)(b,E,S),C=!!(S&&x&&!S.isTokenAccessible),A=(0,W.Mc)(S),T=w&&_&&!0===f,I=C&&_&&!0===f,N=(0,n.useCallback)(t=>{k({...e,type:void 0,rhs:void 0,schema_field_id:t})},[e,k]),M=(0,n.useCallback)(t=>{let a=(0,h.FJ)(S?.type,e.type)===(0,h.FJ)(S?.type,t)?e.rhs:[{type:(0,h.Kr)(S?.type),isError:!0}];k({...e,type:t,rhs:(0,h.jF)(t)?void 0:a})},[e,k,S?.type]),F=(0,n.useCallback)(t=>{switch(e.type){case c.lt.GreaterThanFilterCondition:case c.lt.LessThanFilterCondition:case c.lt.DateOffsetLessThanFilterCondition:case c.lt.DateOffsetGreaterThanFilterCondition:case c.lt.DateOffsetEqualsFilterCondition:case c.lt.ContainsFilterCondition:case c.lt.DoesNotContainFilterCondition:case c.lt.StartsWithFilterCondition:case c.lt.EndsWithFilterCondition:a({...e,rhs:t[0]});break;default:a({...e,rhs:t})}},[e,a]),O=(0,n.useMemo)(()=>(0,h.RM)(S),[S]),L=(0,n.useMemo)(()=>{let a=0===s&&0===t;return g&&!y&&a&&e?.isAutoSelected===!0&&i===c.GW.lookback},[g,y,e,t,s,i]);(0,n.useEffect)(()=>{let a=0===s&&0===t,n=E&&m.length>0&&!m.some(e=>e.id===E);if(g&&!y&&a&&i===c.GW.lookback&&n)k({id:e.id},!0);else if(g&&!y&&a&&i===c.GW.lookback&&!E&&!v&&m.length>0&&!b){let t=m.find(e=>"OwnerId"===e.identifier&&e.type===c.kY.ReferenceSchemaField&&e.isActive);t&&k({...e,schema_field_id:t.id,isAutoSelected:!0,type:c.lt.EqualsFilterCondition,rhs:[{type:(0,h.Kr)(t.type),isError:!0}]})}},[s,t,i,g,y,E,v,m,b,e,k]);let D=_&&S?H.t("This condition uses a field that is no longer available: {fieldLabel}",{fieldLabel:A}):H.t("This condition has missing fields."),P=_?H.t("You do not have access to this field: {fieldLabel}. This workflow will not start if the recipient also does not have access.",{fieldLabel:A}):`You do not have access to this field: ${A}. This workflow will not start if the recipient also does not have access.`,R=_?H.t("You do not have access to this field. This workflow will not start if the recipient also does not have access."):"You do not have access to this field. This workflow will not start if the recipient also does not have access.",B=S?P:R;return n.createElement("div",{"data-qa":"trigger-filter-condition",role:"group","aria-label":H.t("Condition {index}",{index:t+1})},T&&n.createElement(l.Ay,{level:"error",align:"left",icon:"warning",className:p().conditionContainer__alert},D),I&&n.createElement(l.Ay,{level:"warning",align:"left",icon:"warning",className:p().conditionContainer__alert},B),n.createElement("div",{"data-qa":"trigger-condition",className:r?p().filterConditionWrap:p().filterCondition},n.createElement(FilterConditionField,{handleChangeField:N,condition:e,fields:m,fieldsLoading:b,isWrapped:r,disabled:L||o}),n.createElement(FilterConditionOperator,{fieldId:E,handleChangeOperator:M,selectedOperator:v,operators:O,disabled:!S||L||w||o,isWrapped:r}),n.createElement(FilterConditionTargetValue,{field:S,condition:e,handleChangeRhs:F,InputComponent:FilterConditionTargetValueInput,isWrapped:r,maxItems:L?100:void 0,isDisabled:w||o})))};TriggerFilterCondition.displayName="TriggerFilterCondition"},0xaf63c01f:(e,t,a)=>{"use strict";a.d(t,{h:()=>useAccessibleFields});var n=a(0xbad225b5),r=a(0x2172ff7ff),l=a(0x17178b190),i=a(0x145d46a61),s=a(0x1fe613d6e),o=a(0x226892387);let useAccessibleFields=({fields:e,selectedFieldId:t,additionalFilter:a,sort:c=!0})=>{let d=(0,o.d4)(s.K),u=(0,o.d4)(i._1);return(0,n.useMemo)(()=>{let n=e.filter(e=>e.id===t||!!(e.isActive&&(d||!u||!0===e.isTokenAccessible))&&(!a||a(e))).map(e=>{let t=e.label;if(e.type===l.kY.ReferenceSchemaField){let a=e.relationships?.find(e=>e.isActive);t=a?.relationshipLabel??a?.relationshipName??e.label}return{label:t,value:e.id}});return c?n.sort((e,t)=>(0,r.Ay)(e.label,t.label)):n},[e,t,d,u,a,c])}},0x702be429:(e,t,a)=>{"use strict";a.d(t,{AW:()=>useHasFieldError,Lq:()=>useHydrateFieldValidity,Mc:()=>useFieldLabel});var n=a(0xbad225b5),r=a(0x6258badf),l=a(0xaf63c01f),i=a(0x145d46a61),s=a(0x1fe613d6e),o=a(0x226892387);function useFieldIsValid(e){let t=(0,o.d4)(i._1),a=(0,o.d4)(s.K);return!e||!t||(a?e.isActive:e.isActive&&(e.isTokenAccessible??!0))}function useHasFieldError(e,t,a){let n=(0,o.d4)(i._1),r=(0,o.d4)(s.K),l=a&&!a.isActive,c=a&&n&&!r&&!a.isTokenAccessible,d=t&&!a&&!e;return!!(l||c||d)}function useFieldLabel(e){let t=(0,n.useMemo)(()=>e?[e]:[],[e]),[a]=(0,l.h)({fields:t,selectedFieldId:e?.id,sort:!1});return a?.label??e?.label??""}function useHydrateFieldValidity(e,t,a){let l=useFieldIsValid(a);(0,n.useEffect)(()=>{void 0!==e.isFieldValid&&a&&l&&t((0,r.A)(e,"isFieldValid")),!1!==e.isFieldValid&&a&&!l&&t({...e,isFieldValid:!1})},[e,a,l,t])}},0x13245bc52:(e,t,a)=>{"use strict";a.d(t,{$f:()=>BooleanField,oz:()=>r.o,zM:()=>SelectField,Gj:()=>TypeaheadField});var n=a(0xbad225b5);a(0x126f22530);var r=a(0x4e697bfb),l=a(0x21f3c49e8),i=a(0x20482ad21),s=a(0xa7ec93c2),o=a(0x207fb9b92);let c=new i.Ay("workflow_builder"),SelectField=({value:e=[],onChange:t,label:a,options:r,required:i=!1,isDisabled:d=!1})=>{let u=(0,n.useMemo)(()=>r.sort((e,t)=>(e?.position??0)-(t?.position??0)).reduce((e,t)=>(t.isActive&&e.push({value:t.identifier,label:t.label??t.identifier}),e),[]),[r]),m=(0,n.useMemo)(()=>u.filter(t=>e.includes(t.value)),[e,u]),p=(0,n.useCallback)(e=>t(e.map(({value:e})=>e)),[t]),{errorText:b,onBlur:f}=(0,o.K)({errorMessage:"error",isErrored:i&&(0,l.A)(e),shouldErrorPreventSave:!0}),g=(0,n.useMemo)(()=>{let e=[];return b&&e.push({id:"ITEMS_REQUIRED",message:c.t("This field is required.")}),e},[b]);return n.createElement(s.Ay,{key:JSON.stringify(r),options:u,ariaLabel:a,onSelectedItemsChange:p,placeholderText:c.t("Select a value\u2026"),selectId:"condition-form-select",selectedOptions:m,width:"100%",expandOnFocus:!0,disableIdParsing:!0,errors:g,onBlur:f,isDisabled:d})};SelectField.displayName="SelectField";var d=a(0x15014e268);let u=new i.Ay("workflow_builder"),BooleanField=({value:e,onChange:t,label:a,required:r,isDisabled:l=!1})=>{let i=(0,n.useMemo)(()=>[{value:String(!0),label:u.t("True")},{value:String(!1),label:u.t("False")}],[]),s=(0,n.useCallback)(({value:e})=>{t("true"===e)},[t]),c=i.find(t=>String(e)===t.value),{errorText:m,onBlur:p}=(0,o.K)({errorMessage:"error",isErrored:!!r&&void 0===e,shouldErrorPreventSave:!0}),b=(0,n.useMemo)(()=>{let e=[];return m&&e.push({id:"ITEMS_REQUIRED",message:u.t("This field is required.")}),e},[m]);return n.createElement(d.Ay,{selectDataQa:"condition-form-boolean__input",ariaLabel:a,width:"100%",options:i,selectId:"conditionField",selectedOption:c,onOptionSelected:s,placeholderText:u.t("Select a value\u2026"),onBlur:p,errors:b,isDisabled:l})};BooleanField.displayName="BooleanField";var m=a(0x16cf1da63),p=a(0xe874a88a),b=a(0x2172ff7ff),f=a(0x24f77b0a),g=a(0x145d46a61),h=a(0x4a120eb2),_=a(0x99e2bdae),y=a(0x226892387);let x=new i.Ay("workflow_builder"),TypeaheadField=({identifiers:e,onChange:t,label:a,fieldId:r,required:l,maxItems:i,isDisabled:s=!1})=>{let c=(0,m.wA)(),d=(0,y.d4)(g.Mp),{datasourceId:u,schemaObjectId:v}=(0,f.T)(),E=(0,n.useMemo)(()=>e?e.map((e,t)=>({label:s?e.label??e.identifier:e.label,value:e.identifier,isError:!!i&&t>=i})):[],[e,i,s]),k=(0,n.useCallback)(e=>e&&e.length<3?x.t("Keep typing to see results\u2026"):x.t("No items"),[]),S=(0,n.useCallback)(e=>e&&!(e.length<3)&&u&&v?c((0,_.Fh)({datasourceId:u,schemaObjectId:v,query:e,field:r})).then(({results:e})=>e.flatMap(e=>({value:e.schemaObjectLabel,id:e.schemaObjectId,label:e.schemaObjectLabel,options:e.records.map(e=>({label:e.name,value:e.identifier})).sort((e,t)=>(0,b.Ay)(e.label,t.label))})).sort((e,t)=>(0,b.Ay)(e.label,t.label))):p.S.resolve([]),[u,c,v,r]),w=(0,n.useCallback)(e=>{t(e.map(e=>({identifier:e.value,label:e.label})))},[t]),C=!!l&&E.length<1,A=!!i&&E.length>i,{errorText:T,onBlur:I}=(0,o.K)({errorMessage:"error",isErrored:C||A,shouldErrorPreventSave:!0}),N=(0,n.useMemo)(()=>{let e=[];return T&&(C&&e.push({id:"ITEMS_REQUIRED",message:x.t("This field is required.")}),A&&e.push({id:"MAX_ITEMS_EXCEEDED",message:d?x.t("{maxItems}-value limit exceeded.",{maxItems:i}):`${i}-value limit exceeded.`})),e},[T,C,A,i,d]),M=(0,n.useMemo)(()=>{let e=[];return i&&0===N.length&&e.push({id:"MAX_ITEMS_HINT",message:d?x.t("Add up to {maxItems} values.",{maxItems:i}):`Add up to ${i} values.`}),e},[i,N,d]);return n.createElement(h.x,{ariaLabel:a,width:"100%",selectId:"condition-form-typeahead__input",search:S,placeholderText:x.t("Search for a value\u2026"),emptyStateMessage:k,selectedOptions:E,onSelectedItemsChange:w,debounceWaitPeriod:300,onBlur:I,errors:N,hints:M,isInvalid:N.length>0,isDisabled:s})};TypeaheadField.displayName="TypeaheadField"},0x4e697bfb:(e,t,a)=>{"use strict";a.d(t,{o:()=>NumberField});var n=a(0xbad225b5),r=a(0x18f2150ea),l=a(0x20482ad21),i=a(0x126f22530),s=a(0xbbd2a32d),o=a(0x207fb9b92);let c=new l.Ay("workflow_builder"),NumberField=({value:e,label:t,onChange:a,min:l,max:d,className:u,isDisabled:m=!1})=>{let p=(0,n.useCallback)(e=>{a(Number(e))},[a]),b=null===e?NaN:Number(e),f=b>(d??s.Ig),g=b<(l??s.kj),h=(0,n.useMemo)(()=>(0,r.A)(e)?f?c.t("This number is too large."):g?c.t("This number is too small."):void 0:c.t("This field is required."),[f,g,e]),_=!(0,r.A)(e)||f||g,{errorText:y,onBlur:x}=(0,o.K)({errorMessage:h,isErrored:_,shouldErrorPreventSave:!0}),v=(0,n.useMemo)(()=>`${e}_condition-form-number__input`,[e]);return n.createElement(i.A,{"data-qa":"condition-form-number__input",id:v,name:"condition-form-number__input","aria-label":t,value:e,onChange:p,placeholder:c.t("Enter a value\u2026"),type:"number",min:l??1/0,max:d??1/0,onBlur:x,errorText:y,useInlineAlert:!0,className:u,isDisabled:m})};NumberField.displayName="NumberField"},0x24f77b0a:(e,t,a)=>{"use strict";a.d(t,{T:()=>useFieldSearchContext,u:()=>r});var n=a(0xbad225b5);let r=(0,n.createContext)({datasourceId:void 0,schemaObjectId:void 0,fieldsLoading:!1,fieldsInvalid:!1,schemaObjectLabel:void 0,isObjectAccessible:void 0,fields:[],sortedChildRelationships:[]}),useFieldSearchContext=()=>{let e=(0,n.useContext)(r);if(!e)throw Error("useFieldSearchContext must be used within a FieldSearchContext provider");return e}},0x1e94f3cf:(e,t,a)=>{"use strict";a.d(t,{y:()=>WithFieldSearchContext});var n=a(0xbad225b5),r=a(0x16cf1da63),l=a(0x2172ff7ff),i=a(0x88dc61ea),s=a(0x24f77b0a),o=a(0x22678e203),c=a(0x99e2bdae),d=a(0x1a7f6fce4),u=a(0x226892387);function WithFieldSearchContext(e){return function({datasourceId:t,schemaObjectId:a,...m}){let[p,b]=(0,n.useState)(void 0),[f,g]=(0,n.useState)([]),[h,_]=(0,n.useState)([]),[y,x]=(0,n.useState)([]),[v,E]=(0,n.useState)(!1),[k,S]=(0,n.useState)(!1),w=(0,r.wA)(),{hasValidDataSourceObjectId:C,hasValidSchemaObjectId:A}=(0,i.Qk)();(0,n.useEffect)(()=>{let fetchData=async()=>{if(t&&a)try{E(!0);let e=await w((0,c.Jc)({datasourceId:t,schemaObjectId:a}));b(e),g(e.fields),d._.isSchemaObjectWithChildren(e)&&(x(e.childRelationships),_(e.childRelationships.map(e=>e.schemaObjectId)))}catch{S(!0)}finally{E(!1)}};C&&A&&fetchData()},[C,A,t,a,w]);let T=(0,u.d4)(e=>(0,o.eF)(e,h)),I=(0,n.useMemo)(()=>y.sort((e,t)=>{let a=T[e.schemaObjectId]?.label??e.relationshipName,n=T[t.schemaObjectId]?.label??t.relationshipName;return(0,l.Ay)(a,n)}),[T,y]),N=p?.label,M=(0,n.useMemo)(()=>({datasourceId:t,schemaObjectId:a,fieldsLoading:v,fieldsInvalid:k,schemaObjectLabel:N,isObjectAccessible:p?.isTokenAccessible,fields:f,sortedChildRelationships:I}),[t,a,k,v,N,p?.isTokenAccessible,f,I]);return n.createElement(s.u.Provider,{value:M},n.createElement(e,m))}}WithFieldSearchContext.displayName="WithFieldSearchContext"},0x1f265cc5b:(e,t,a)=>{"use strict";a.d(t,{Fg:()=>o,Ow:()=>h,aZ:()=>b,g6:()=>_,hs:()=>g,lu:()=>c,ny:()=>d,r$:()=>p,ul:()=>f,vm:()=>u,yb:()=>m});var n=a(0x870b34a7),r=a(0x106f35107),l=a(0x17178b190),i=a(0x56e1c8ae),s=a(0xb4375e8a);let o=(0,n.W)("update condition groups"),c=(0,n.W)("update change condition"),d=(0,n.W)("update static conditions"),u=(0,n.W)("update filters"),m=(0,n.W)("update team member filters"),p=(0,n.W)("update condition datasource"),b=(0,n.W)("update condition datasource object"),f=(0,n.W)("update frequency"),g=(0,n.W)("update startTime"),h=(0,n.W)("update sort config select picker"),_=(0,r.GX)(s.y$).on(o,(e,t)=>{let{segment:a}=e,{triggerConditions:n}=t,r=a.config.conditions;return(0,i.kp)(a.config)?{...e,segment:{...a,config:{...a.config,conditions:(0,i.i$)(r,n),baseConditions:n}}}:{...e,segment:{...a,config:{...a.config,conditions:n}}}}).on(c,(e,t)=>{let{segment:a}=e,{triggerChangeCondition:n}=t,r=a.config.conditions;return(0,i.kp)(a.config)?{...e,segment:{...a,config:{...a.config,conditions:(0,i.lG)(r,n),changeCondition:n}}}:{...e}}).on(d,(e,t)=>{let{segment:a}=e,{staticCondition:n,schemaObjectFields:r}=t;return(0,i.EP)(a.config)||(0,i.S)(a.config)?{...e,segment:{...a,config:{...a.config,conditions:r?(0,i.Ly)(n,r):n,unpreparedConditions:n}}}:{...e}}).on(u,(e,t)=>{let{segment:a}=e,{triggerFilters:n}=t;return{...e,segment:{...a,config:{...a.config,filters:n}}}}).on(m,(e,t)=>{let{segment:a}=e,{triggerTeamMembers:n}=t;return{...e,segment:{...a,config:{...a.config,teamMemberFilters:n}}}}).on(p,(e,t)=>{let{segment:a}=e,{datasourceId:n}=t,r=(0,i.MF)(),l=(0,i.CB)();return(0,i.kp)(a.config)?{...e,segment:{...a,config:{...a.config,datasourceId:n,schemaObjectId:void 0,conditions:(0,i.S1)(r,l),baseConditions:r,changeCondition:l,filters:[]}}}:(0,i.EP)(a.config)?{...e,segment:{...a,config:{...a.config,datasourceId:n,schemaObjectId:void 0,conditions:(0,i.zN)(),unpreparedConditions:(0,i.zN)(),filters:[]}}}:(0,i.S)(a.config)?{...e,segment:{...a,config:{...a.config,datasourceId:n,schemaObjectId:void 0,conditions:(0,i.Hj)(),unpreparedConditions:(0,i.Hj)(),filters:[]}}}:(0,i.Fe)(a.config)||(0,i.SZ)(a.config)?{...e,segment:{...a,config:{...a.config,datasourceId:n,schemaObjectId:void 0,conditions:(0,i.MF)(),filters:[],teamMemberFilters:[]}}}:{...e,segment:{...a}}}).on(b,(e,t)=>{let{segment:a}=e,{schemaObjectId:n}=t,r=(0,i.MF)(),l=(0,i.CB)();return(0,i.kp)(a.config)?{...e,segment:{...a,config:{...a.config,schemaObjectId:n,conditions:(0,i.S1)(r,l),baseConditions:r,changeCondition:l,filters:[],sortConfigPicker:{...a.config.sortConfigPicker,schema_field_id:void 0,limit:void 0,direction:void 0,value:void 0}}}}:(0,i.EP)(a.config)?{...e,segment:{...a,config:{...a.config,schemaObjectId:n,conditions:(0,i.zN)(),unpreparedConditions:(0,i.zN)(),filters:[],sortConfigPicker:{...a.config.sortConfigPicker,schema_field_id:void 0,limit:void 0,direction:void 0,value:void 0}}}}:(0,i.S)(a.config)?{...e,segment:{...a,config:{...a.config,schemaObjectId:n,conditions:(0,i.Hj)(),unpreparedConditions:(0,i.Hj)(),filters:[],sortConfigPicker:{...a.config.sortConfigPicker,schema_field_id:void 0,limit:void 0,direction:void 0,value:void 0}}}}:(0,i.Fe)(a.config)||(0,i.SZ)(a.config)?{...e,segment:{...a,config:{...a.config,schemaObjectId:n,conditions:(0,i.MF)(),filters:[],teamMemberFilters:[]}}}:{...e,segment:{...a}}}).on(f,(e,t)=>{let{segment:a}=e,{triggerFrequency:n}=t;if((0,i.Fe)(a.config)||(0,i.SZ)(a.config))return{...e};let r=(0,i.Ic)(n,a.config.startTime);return{...e,segment:{...a,config:{...a.config,frequency:r,displayFrequency:{type:n,on_days:r.on_days}}}}}).on(g,(e,t)=>{let{segment:a}=e,{triggerStartTime:n}=t;if((0,i.Fe)(a.config)||(0,i.SZ)(a.config))return{...e};let r=a.config.displayFrequency?.type===l.vH.weekly||a.config.displayFrequency?.type===l.vH.monthly||a.config.displayFrequency?.type===l.vH.quarterly?(0,i.Ic)(a.config.displayFrequency?.type,n):a.config.frequency;return{...e,segment:{...a,config:{...a.config,startTime:n,frequency:r}}}}).on(h,(e,t)=>{let{segment:a}=e,{triggerSortConfigPicker:n}=t;return(0,i.Fe)(a.config)||(0,i.SZ)(a.config)?{...e}:{...e,segment:{...a,config:{...a.config,sortConfigPicker:n}}}})},0xb4375e8a:(e,t,a)=>{"use strict";a.d(t,{Un:()=>isValidFilterCondition,y$:()=>m});var n=a(0xbbd2a32d),r=a(0xe08dc76c),l=a(0x139a1172d),i=a(0x17178b190),s=a(0x56e1c8ae);let isValidRhs=({type:e,value:t,identifier:a,isError:l,quantity:s,period:o,direction:c,operator:d},u)=>{if(l)return!1;if(e===i.Yf.BooleanValue&&"boolean"==typeof t)return!0;if(e===i.Yf.LongInt)return"number"==typeof t&&(0,n.gf)(t)&&(0,n.zh)(t);if(e===i.Yf.DoubleNumber)return"number"==typeof t&&(0,n.gf)(t);if(e===i.Yf.RelativeChange)return"number"==typeof s&&(0,n.gf)(s);if(e===i.Yf.TimePeriodChange&&u){if("number"==typeof o?.num&&(0,n.gf)(o?.num))switch(u){case i.hu.TimePeriodBeforeTriggerCondition:if(d?.type===r.Kr.AT_LEAST&&c?.type===r.ig.EARLIER)return o?.num===2||o?.num===1;if(d?.type===r.Kr.AT_MOST&&c?.type===r.ig.LATER)return o?.num===0;break;case i.hu.TimePeriodAfterTriggerCondition:if(d?.type===r.Kr.AT_LEAST&&c?.type===r.ig.LATER)return o?.num===2||o?.num===1||o?.num===0;break;case i.hu.TimePeriodCurrentTriggerCondition:if(d?.type===r.Kr.EXACT){if(c?.type===r.ig.EARLIER||c?.type===r.ig.LATER)return o?.num===1;if(c?.type===r.ig.ANY)return o?.num===0}break;default:return!0}return!1}return e===i.Yf.TimePeriodOffset?"number"==typeof t&&(0,n.zh)(t):!!(t||a)},o=(0,l.g)("hasValidConditionGroups",({segment:e})=>{if((0,s.EP)(e.config)||(0,s.S)(e.config))return!0;let t=(0,s.Gy)(e);return!!t&&t.every(e=>e.conditions.every(e=>(e=>{let{schema_field_id:t,rhs:a,type:n,isFieldValid:r}=e;return!1!==r&&(!!(0,s.Ev)(n)||!!t&&!!n&&(!!((0,s.L8)(n)||(0,s.cP)(n)&&!a)||!!a?.[0]?.type&&a.every(e=>isValidRhs(e,n))))})(e)))}),filterConditionIsArrayRhs=e=>{switch(e){case i.lt.GreaterThanFilterCondition:case i.lt.LessThanFilterCondition:case i.lt.DateOffsetLessThanFilterCondition:case i.lt.DateOffsetGreaterThanFilterCondition:case i.lt.DateOffsetEqualsFilterCondition:case i.lt.ContainsFilterCondition:case i.lt.DoesNotContainFilterCondition:case i.lt.StartsWithFilterCondition:case i.lt.EndsWithFilterCondition:return!1;default:return!0}},isValidFilterCondition=e=>{let{schema_field_id:t,rhs:a,type:n,isFieldValid:r}=e;return!1!==r&&!!t&&!!n&&(!!(0,s.jF)(n)||!!a&&(Array.isArray(a)?!!filterConditionIsArrayRhs(n)&&a?.[0]?.type&&a.every(e=>isValidRhs(e)):!filterConditionIsArrayRhs(n)&&isValidRhs(a)))},c=(0,l.g)("hasValidFilters",({segment:e})=>{let t=(0,s.gA)(e);return!t||t.every(e=>e.reference_field_id&&e.conditions.conditions.every(e=>e.conditions.every(isValidFilterCondition)))}),d=(0,l.g)("hasValidTeamMemberFilters",({segment:e})=>{let t=(0,s.Bv)(e);return!t||t.every(e=>!!e.childSchemaObjectId&&!!e.childToParentSchemaFieldId&&(!e.filter||e.filter.conditions.every(e=>e.conditions.every(isValidFilterCondition))))}),u=(0,l.g)("hasValidStaticCondition",({segment:e})=>{let t=(0,s.Sr)(e);return!t||(0,s.S)(e.config)&&(0,s.KV)(t)||t.conditions.every(e=>e.conditions.every(isValidFilterCondition))}),m=[o,c,d,(0,l.g)("hasValidDataSourceObjectId",({segment:e})=>{let t=(0,s.u8)(e);return!!(t&&""!==t)}),(0,l.g)("hasValidSchemaObjectId",({segment:e})=>{let t=(0,s.Ov)(e);return!!(t&&t>0)}),u,(0,l.g)("isValid",(e,{hasValidConditionGroups:t,hasValidFilters:a,hasValidTeamMemberFilters:n,hasValidDataSourceObjectId:r,hasValidSchemaObjectId:l,hasValidStaticCondition:i})=>t&&a&&n&&r&&l&&i)]},0x8731d017:(e,t,a)=>{"use strict";a.d(t,{Sw:()=>i,iI:()=>getSegmentParameters});var n=a(0x20482ad21),r=a(0x1795d8821);let l=new n.Ay("workflow_builder"),i={hourly:"hours",daily:"days",weekly:"weeks",monthly:"months",yearly:"years"},getSegmentParameters=()=>({startTime:{type:r.HN.DateTime,name:"startTime",title:l.t("Starts on"),is_required:!0},timezone:{type:r.HN.Timezone,name:"timezone",title:l.t("Time zone",{ns:"prefs"}),is_required:!0},occurrenceCount:{type:r.HN.Integer,name:"occurrenceCount",title:l.t("After a set number of occurrences"),is_required:!0},endTime:{type:r.HN.DateTime,name:"endTime",title:l.t("Ends"),is_required:!0},frequency:{type:r.HN.Object,name:"frequency",title:l.t("Frequency"),is_required:!0,required:["type"],properties:{type:{type:r.HN.String,name:"type",is_required:!0,title:l.t("Repeat every"),enum:["daily","weekly","monthly","yearly"]},onDays:{type:r.HN.Array,name:"onDays",is_required:!0,title:l.t("Repeat on"),items:{type:r.HN.String,enum:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],minItems:1}},repeatsEvery:{type:r.HN.Integer,name:"repeatsEvery",title:l.t("Repeat every")},onWeekNum:{type:r.HN.Integer,name:"onWeekNum",enum:[1,2,3,4,-1]}}}})},0x3fe57881:(e,t,a)=>{"use strict";a.d(t,{en:()=>k,qq:()=>v,qC:()=>E});var n=a(0x1db69cda),r=a(0xd4e00a1e),l=a(0x1bcd0917),i=a(0x124d99cb0),s=a(0x870b34a7),o=a(0x106f35107),c=a(0xe65b36eb),d=a(0x1075d3a9c),u=a.n(d),m=a(0x4bdf0df6),p=a(0x139a1172d),b=a(0x8731d017);let f=(0,p.g)("hasValidStartTime",({segment:e})=>{let{startTime:t,timezone:a=m.vp,frequency:n}=e.config?.schedule||{};if(!t)return!1;if(!n){let e=(0,i.lP)(t,a),n=u().tz(a);return e.isSameOrAfter(n)}return!0}),g=(0,p.g)("hasValidEndTime",({segment:e})=>{let{startTime:t,timezone:a,endTime:n,frequency:r}=e.config?.schedule||{};if(!n)return!0;if(!r)return!1;let{repeatsEvery:l=1,type:s}=r;if("once"===s)return!0;let o=(0,i.lP)(t,a).add(l,b.Sw[s]);return(0,i.lP)(n,a).isSameOrAfter(o)}),h=(0,p.g)("hasValidOccurrenceCount",({segment:e})=>{let{occurrenceCount:t,frequency:a}=e.config?.schedule||{};return!t||!!a&&t>0}),_=(0,p.g)("hasValidRepeatsEvery",({segment:e})=>{let{frequency:t}=e.config?.schedule||{};if(!t)return!0;let{repeatsEvery:a}=t;return void 0===a||a>0}),y=(0,p.g)("hasValidFrequency",({segment:e})=>{let{frequency:t}=e.config?.schedule||{};if(!t)return!0;let{type:a,onDays:n,onWeekNum:r}=t;if("daily"===a||"hourly"===a)return!n&&!r;if("weekly"===a)return!r&&void 0!==n&&0!==n.length&&n.every(e=>i.BP.includes(e));if("monthly"===a)return n?!!r&&n.length>0&&n.every(e=>i.BP.includes(e)):!r||!!n&&[1,2,3,4,-1].includes(r);return"yearly"!==a||!n&&!r}),x=(0,p.g)("isValid",(e,{hasValidFrequency:t,hasValidStartTime:a,hasValidEndTime:n,hasValidOccurrenceCount:r,hasValidRepeatsEvery:l})=>a&&t&&n&&r&&l),v=(0,s.W)("update schedule based on segment parameter changed"),E=(0,s.W)("update schedule frequency based on a pre-configured menu option"),k=(0,o.GX)([f,g,h,y,_,x]).on(v,(e,{parameter:t,value:a})=>{let{segment:r}=e,l=(0,n.A)(r.config.schedule);switch(t.name){case"startTime":l=(0,c.Fx)(l,a);break;case"timezone":l=(0,c.X7)(l,a);break;case"endTime":l=(0,c.EM)(l,a);break;case"occurrenceCount":{let e=parseInt(a,10);Number.isNaN(e)||(l=(0,c.MO)(l,e));break}case"type":l=(0,c.Uf)(l,a);break;case"repeatsEvery":{let e=parseInt(a,10);Number.isNaN(e)||(l=(0,c.NR)(l,e));break}case"onDays":l=(0,c.I6)(l,a);break;case"onWeekNum":l=(0,c.j0)(l,a)}return{...e,segment:{...r,config:{...r.config,schedule:l}}}}).on(E,(e,{frequencyMenuOption:t})=>{let{segment:a}=e,{startTime:n,frequency:s,timezone:o}=a.config.schedule,c=(0,r.A)(a.config.schedule,["startTime","timezone","frequency"]),d=(0,i.hN)(n,o),u=d.format("dddd"),m=(0,i.Bz)(d.format("YYYY-MM-DD"))??1;switch(t){case l.w.Daily:c.frequency={type:"daily"};break;case l.w.WeeklySameDay:c.frequency={type:"weekly",onDays:[u]};break;case l.w.Weekdays:c.frequency={type:"weekly",onDays:["Monday","Tuesday","Wednesday","Thursday","Friday"]};break;case l.w.MonthlyNthDay:c.frequency={type:"monthly",onDays:[u],onWeekNum:m};break;case l.w.Yearly:c.frequency={type:"yearly"};break;case l.w.Custom:s||(c.frequency={type:"daily"});break;default:delete c.frequency}return{...e,segment:{...a,config:{...a.config,selectedFrequencyMenuOption:t,schedule:c}}}})},0xa6e1b10c:(e,t,a)=>{"use strict";a.d(t,{R4:()=>o,iI:()=>d,r$:()=>c,s8:()=>s});var n=a(0x870b34a7),r=a(0x106f35107),l=a(0x1e53c059d),i=a(0xf8a1cf7b);let s=(0,n.W)("Update webhook schema entry"),o=(0,n.W)("Remove webhook schema entry"),c=(0,n.W)("Regenerate webhook url"),d=(0,r.GX)(i.y$).on(c,(e,t)=>{let{segment:a}=e,{url:n}=t;return{...e,segment:{...a,config:{...a.config,url:n}}}}).on(s,(e,t)=>{let{segment:a}=e,{schema:n}=t,r=(0,l.iF)(a,n);return{...e,segment:r}}).on(o,(e,t)=>{let{segment:a}=e,{name:n}=t,r=(0,l.Zt)(a,n);return{...e,segment:r}})},0xf8a1cf7b:(e,t,a)=>{"use strict";a.d(t,{L:()=>hasValidTitleCharacters,lk:()=>i,y$:()=>o});var n=a(0x139a1172d),r=a(0x1e53c059d),l=a(0xf2193715);let i=20,s=/^[a-zA-Z0-9-_]+$/,hasValidTitleCharacters=e=>s.test(e),o=[(0,n.g)("validTitleCharacters",({segment:e})=>((0,r.iE)(e)||[]).every(({title:e})=>hasValidTitleCharacters(e))),(0,n.g)("validTitleLength",({segment:e})=>((0,r.iE)(e)||[]).every(({title:e})=>e.length>0&&e.length<=l.tu)),(0,n.g)("hasUniqueTitles",({segment:e})=>{let t=((0,r.iE)(e)||[]).map(({title:e})=>e);return new Set(t).size===t.length}),(0,n.g)("canAddSchema",({segment:e})=>((0,r.iE)(e)||[]).length<i),(0,n.g)("hasValidSchemaCount",({segment:e})=>((0,r.iE)(e)||[]).length<=i),(0,n.g)("isValid",(e,{validTitleCharacters:t,validTitleLength:a,hasUniqueTitles:n,hasValidSchemaCount:r})=>t&&a&&n&&r)]},0x44c1a824:(e,t,a)=>{"use strict";a.d(t,{O:()=>b,q:()=>p});var n=a(0x870b34a7),r=a(0x106f35107),l=a(0x52fc4a0c),i=a(0x818fd090),s=a(0x1a3026429),o=a(0x139a1172d),c=a(0x78a9d64e);let d=(0,o.g)("hasValidInputValues",({segment:e})=>{let t=(0,l.ln)(e),a=(0,l.bn)(e),n=(0,l.Iw)(e);return t.every(e=>{if(e.name in a)return!0;let t=n[e.name]?.value;return(0,c.Pl)(e,t)})}),u=(0,o.g)("hasValidDynamicInputs",({segment:e})=>{let t=(0,l.ln)(e),a=(0,l.Iw)(e);return t.every(e=>{let t=(0,i.w)(e),n=a[t.name]?.value;return(0,s.u)(t,n)})}),m=(0,o.g)("isValid",(e,{hasValidInputValues:t,hasValidDynamicInputs:a})=>t&&a),p=(0,n.W)("update configured parameter value"),b=(0,r.GX)([d,u,m]).on(p,(e,{parameter:t,value:a,label:n,options:r})=>{let i,{segment:s}=e;return i=null!==a||t.is_required?(0,l.bG)(s,t,a,n,r):(0,l.oR)(s,t),{...e,segment:i}})},0x24e22e0a6:(e,t,a)=>{"use strict";a.d(t,{Z:()=>isServiceTriggerSegment});var n=a(0x126af815a);let isServiceTriggerSegment=e=>{let t="config"in e?e.config:void 0;return!!t&&e.type===n.YV&&"service"in t}},0x38e951e5:(e,t,a)=>{"use strict";a.d(t,{GE:()=>b,bg:()=>f,He:()=>p});var n=a(0x870b34a7),r=a(0x106f35107),l=a(0x139a1172d),i=a(0xaed466e2);let s=(0,l.g)("noEmptyTitles",({segment:e})=>((0,i.lK)(e)||[]).every(e=>e.title&&e.title.length>0&&e.name&&e.name.length>0)),o=(0,l.g)("duplicateTitles",({segment:e})=>{let t=(0,i.lK)(e);if(!t)return!1;let a={},n=!1;return t.every(({title:e})=>a[e]?(n=!0,!1):(a[e]=(a[e]||0)+1,!0)),n}),c=(0,l.g)("canAddSchema",({segment:e})=>((0,i.lK)(e)||[]).length<i.Mu),d=(0,l.g)("schemaCountIsValid",({segment:e})=>{let t=(0,i.lK)(e)||[];return Array.isArray(t)&&t.length<=i.Mu}),u=(0,l.g)("isValid",(e,{noEmptyTitles:t,duplicateTitles:a,schemaCountIsValid:n})=>t&&!a&&n);var m=a(0x32fdcd88);let p=(0,n.W)("Upsert shortcut custom input"),b=(0,n.W)("Remove shortcut custom input"),f=(0,r.GX)([s,o,c,d,u]).on(p,(e,t)=>{let{segment:a}=e,{item:n}=t,r=a.config.shortcut.schema.findIndex(e=>e.name===n.name),l={...n},i=r>-1?(0,m.A)(r,l,a.config.shortcut.schema):[...a.config.shortcut.schema,l],s={...a,config:{...a.config,shortcut:{schema:i}}};return{...e,segment:s}}).on(b,(e,t)=>{let{segment:a}=e,{name:n}=t,r={...a,config:{...a.config,shortcut:{schema:[...a.config.shortcut.schema.filter(e=>e.name!==n)]}}};return{...e,segment:r}})},0x1de72b3d8:(e,t,a)=>{"use strict";a.d(t,{$x:()=>getWarningForAtSymbolKeywords,IL:()=>getIsValidMessagePostedTriggerSegment,c0:()=>getErrorForKeywords,sS:()=>getErrorForDuplicateAcrossGroups});var n=a(0x20482ad21),r=a(0xe2e5f9b1),l=a(0x76c6bbbe),i=a(0x1e9747fe7),s=a(0x136bd1488);let o=new n.Ay("workflow_builder"),c=/(?:^|\s)@\w/,getMessagePostedErrorMessages=()=>({duplicateKeywords:o.t("Keywords must be unique. Remove any duplicate keywords to continue."),minimumCharacters:o.t("Keywords must be at least 2 characters. Update the keyword to continue."),maximumCharacters:o.t("Keywords cannot exceed 3,000 characters. Update the keyword to continue."),duplicateAcrossGroups:o.t("Keywords can\u2019t be both included and excluded. Remove any duplicate keywords."),prohibitedSpecialCharacter:o.t("Keywords cannot contain the # character. Update the keyword to continue.")}),getErrorForKeywords=({keywords:e})=>{let t=getMessagePostedErrorMessages();for(let[a,n]of e.entries()){if(!(0,r.A)(n)&&n.length<2)return{errorMessage:t.minimumCharacters,invalidKeyword:n};if(n.includes("#"))return{errorMessage:getMessagePostedErrorMessages().prohibitedSpecialCharacter,invalidKeyword:n};if(n.length>3e3)return{errorMessage:t.maximumCharacters,invalidKeyword:n};let l=n.toLowerCase(),i=e.map(e=>e.toLowerCase());if(i.splice(a,1),i.includes(l))return{errorMessage:t.duplicateKeywords,invalidKeyword:l}}return{errorMessage:null,invalidKeyword:""}},getErrorForDuplicateAcrossGroups=(e,t)=>{let a={errorMessage:null,invalidKeyword:""};if(0===e.length||0===t.length)return a;let n=new Set(t.map(e=>e.toLowerCase()));for(let t of e){let e=t.toLowerCase();if(n.has(e))return{errorMessage:getMessagePostedErrorMessages().duplicateAcrossGroups,invalidKeyword:e}}return a},getWarningForAtSymbolKeywords=({includeKeywords:e,excludeKeywords:t})=>{for(let a of[...e,...t])if(c.test(a))return o.rt("<b>Heads up:</b> For privacy reasons, keywords that are @ mentions of users won\u2019t start this workflow.");return null},getIsValidMessagePostedTriggerSegment=(e,t)=>{if(!(0,s.s)(e))return!1;let a=e.config.event;if(!a)return!1;let{keywordGroups:n,additionalFilters:r,excludedUserIds:o}=(0,i.vu)(a,"keyword_groups");return!(n?.length===0||a.channelIds?.length===0||!a.filter||r.includes(l.rK)&&o.length>20)&&(!t||0!==o.length)&&n.every(({includeKeywords:e,excludeKeywords:t=[]})=>e?.length!==0&&null===getErrorForKeywords({keywords:e}).errorMessage&&(t?.length===0||null===getErrorForKeywords({keywords:t}).errorMessage&&null===getErrorForDuplicateAcrossGroups(e,t).errorMessage))}},0xf48b1168:(e,t,a)=>{"use strict";a.d(t,{rL:()=>g,qq:()=>b});var n=a(0x870b34a7),r=a(0x106f35107),l=a(0x112dbb8f3),i=a(0x21f3c49e8),s=a(0x61c95b1b),o=a(0x139a1172d),c=a(0x78a9d64e),d=a(0x1795d8821);let u=(0,o.g)("hasValidInputValues",({segment:e})=>{let t=e.config?.inputParameters??[],a=e.config?.event;return t.every(e=>{if(!a)return!1;let t=null;if(e.isFilter)if(a.eventType===s.$.ListRecordUpdated){if(t=(0,l.QS)(a,e.name)?.length||null,!e.is_required||t)return!0}else t=(0,l.QS)(a,e.name);else("channelIds"===e.name||"teamIds"===e.name||"metadataEventType"===e.name||"listId"===e.name)&&(t=a[e.name]||null);switch(e.type){case d.HN.Reaction:return!(0,i.A)(t);case d.HN.Array:{let a=e?.maxItems;if(Array.isArray(t)&&a&&t.length>a)return!1}}return(0,c.Pl)(e,t)})}),m=(0,o.g)("isValid",(e,{hasValidInputValues:t})=>t),p=(0,n.W)("update data"),b=(0,n.W)("update configured parameter value"),f=(0,n.W)("update top level filter operator value"),g=(0,r.GX)([u,m]).on(p,(e,t)=>{let{segment:a}=e,{name:n}=t;return{...e,segment:{...a,config:{...a.config,name:n}}}}).on(b,(e,{parameter:t,value:a,currentUserId:n})=>{let{segment:r}=e,i=(0,l.bG)(r,t,a,n);return{...e,segment:i}}).on(f,(e,{operator:t})=>{let a,{segment:n}=e;return n.config.event.filter?.root?"statement"in n.config.event.filter.root?a={operator:t,inputs:[n.config.event.filter?.root]}:"inputs"in n.config.event.filter.root&&(a={operator:t,inputs:n.config.event.filter.root.inputs}):a={operator:t,inputs:[]},{...e,segment:{...n,config:{...n.config,event:{...n.config.event,filter:a?{version:1,root:a}:void 0}}}}})},0x1ee062b2e:(e,t,a)=>{"use strict";a.d(t,{y:()=>getEventName});let getEventName=e=>e.replace("slack#/events/","")},0x136bd1488:(e,t,a)=>{"use strict";a.d(t,{s:()=>isSlackEventTriggerSegment});let isSlackEventTriggerSegment=e=>"event"===e.type&&"config"in e},0x25136cc80:(e,t,a)=>{"use strict";a.d(t,{l:()=>n});let n={WFB_TEMPLATE_PREVIEW:2,WFB_EDITOR:2}},0x24eaf48aa:(e,t,a)=>{"use strict";a.d(t,{XS:()=>getSegmentErrorCode,jS:()=>getPrioritySegmentErrorCode,nh:()=>getSegmentErrorMessage});var n=a(0xf7ab484f),r=a(0x1a5ac3a0c);let{INVALID_INTERACTIVITY_POINTER:l,MISSING_FUNCTION_PARAM:i,MISSING_INPUTS:s,INVALID_USER_CONTEXT:o}=a(0x20cfa1dc2).oh,c=[`${n.hc}_`,`${n.oi}_`],getPrioritySegmentErrorCode=e=>{if(0===e.length)return;let t=e.find(e=>e.code===l||e.code===o)||e[0];if(t.code===s&&t.message.includes("channel_id"))return n.Lj;if(t.code===i&&t.message.includes("team_id"))return n.T8;let{baseCode:a}=(e=>{for(let t of c)if(e.startsWith(t))return{baseCode:t.slice(0,-1),channelId:e.slice(t.length)};return{baseCode:e}})(t.code);return a},getSegmentErrorMessage=(e,t,a)=>{if(!e||!t||!a)return;let n=(0,r.rM)(e,t.id).find(e=>e.code===a);return n?.message},getSegmentErrorCode=(e,t)=>{if(e&&t)return getPrioritySegmentErrorCode((0,r.rM)(e,t.id))}},0xf2193715:(e,t,a)=>{"use strict";a.d(t,{tu:()=>n});let n=100},0x35d46650:(e,t,a)=>{"use strict";function nonNil(e){return null!=e}a.d(t,{b:()=>nonNil})},0x85512121:(e,t,a)=>{"use strict";e.exports=a.p+"workflows_192-0e70beb.png"},0xbf61ff25:(e,t,a)=>{"use strict";e.exports=a.p+"reminder-02bb3e2.svg"}}]);
//# sourceMappingURL=https://slack.com/source-maps/bv1-13/gantry-v2-async-workflow-builder-template-selection-workflow.989c88741278b014cf0d.min.js.mapØA
—Eoúô