.A)("apps.auth.external.list generated fetcher",(e,t,a)=>new n.S((n,l)=>{let{abortSignal:s,reason:c,...d}=a,u=(0,o.VA)(d);e((0,i.apiCall)({method:"apps.auth.external.list",args:u,abortSignal:s,reason:c})).then(e=>{n(e)}).catch(e=>{(0,r.Ay)({getState:t}).error(`API call to apps.auth.external.list with reason ${c} failed, initiated by generated fetcher`),l(e)})}));s.meta={name:"appsAuthExternalListFetcher",key:"createFetcherAppsAuthExternalListFetcher",description:"apps.auth.external.list generated fetcher"}},0x28d59ea1:(e,t,a)=>{"use strict";a.d(t,{J:()=>s});var n=a(0xe874a88a),i=a(0x22a29f141),l=a(0x1dfdeb1c8),r=a(0x1ec68d6a3),o=a(0xe747dd27);let s=(0,l.A)("apps.datasources.external.fieldreferences.list generated fetcher",(e,t,a)=>new n.S((n,l)=>{let{abortSignal:s,reason:c,...d}=a,u=(0,o.VA)(d);e((0,i.apiCall)({method:"apps.datasources.external.fieldreferences.list",args:u,abortSignal:s,reason:c})).then(e=>{n(e)}).catch(e=>{(0,r.Ay)({getState:t}).error(`API call to apps.datasources.external.fieldreferences.list with reason ${c} failed, initiated by generated fetcher`),l(e)})}));s.meta={name:"appsDatasourcesExternalFieldreferencesListFetcher",key:"createFetcherAppsDatasourcesExternalFieldreferencesListFetcher",description:"apps.datasources.external.fieldreferences.list generated fetcher"}},0xbdbf0a38:(e,t,a)=>{"use strict";a.d(t,{O:()=>s});var n=a(0xe874a88a),i=a(0x22a29f141),l=a(0x1dfdeb1c8),r=a(0x1ec68d6a3),o=a(0xe747dd27);let s=(0,l.A)("apps.datasources.external.schema.objects.list generated fetcher",(e,t,a)=>new n.S((n,l)=>{let{abortSignal:s,reason:c,...d}=a,u=(0,o.VA)(d);e((0,i.apiCall)({method:"apps.datasources.external.schema.objects.list",args:u,abortSignal:s,reason:c})).then(e=>{n(e)}).catch(e=>{(0,r.Ay)({getState:t}).error(`API call to apps.datasources.external.schema.objects.list with reason ${c} failed, initiated by generated fetcher`),l(e)})}));s.meta={name:"appsDatasourcesExternalSchemaObjectsListFetcher",key:"createFetcherAppsDatasourcesExternalSchemaObjectsListFetcher",description:"apps.datasources.external.schema.objects.list generated fetcher"}},0x1318fdf2a:(e,t,a)=>{"use strict";a.d(t,{i:()=>s});var n=a(0xe874a88a),i=a(0x22a29f141),l=a(0x1dfdeb1c8),r=a(0x1ec68d6a3),o=a(0xe747dd27);let s=(0,l.A)("apps.datasources.external.schema.info generated fetcher",(e,t,a)=>new n.S((n,l)=>{let{abortSignal:s,reason:c,...d}=a,u=(0,o.VA)(d);e((0,i.apiCall)({method:"apps.datasources.external.schema.info",args:u,abortSignal:s,reason:c})).then(e=>{n(e)}).catch(e=>{(0,r.Ay)({getState:t}).error(`API call to apps.datasources.external.schema.info with reason ${c} failed, initiated by generated fetcher`),l(e)})}));s.meta={name:"appsDatasourcesExternalSchemaInfoFetcher",key:"createFetcherAppsDatasourcesExternalSchemaInfoFetcher",description:"apps.datasources.external.schema.info generated fetcher"}},0x15cf285c:(e,t,a)=>{"use strict";a.d(t,{y:()=>s});var n=a(0xe874a88a),i=a(0x22a29f141),l=a(0x1dfdeb1c8),r=a(0x1ec68d6a3),o=a(0xe747dd27);let s=(0,l.A)("apps.datasources.external.schema.resync generated fetcher",(e,t,a)=>new n.S((n,l)=>{let{abortSignal:s,reason:c,...d}=a,u=(0,o.VA)(d);e((0,i.apiCall)({method:"apps.datasources.external.schema.resync",args:u,abortSignal:s,reason:c})).then(e=>{n(e)}).catch(e=>{(0,r.Ay)({getState:t}).error(`API call to apps.datasources.external.schema.resync with reason ${c} failed, initiated by generated fetcher`),l(e)})}));s.meta={name:"appsDatasourcesExternalSchemaResyncFetcher",key:"createFetcherAppsDatasourcesExternalSchemaResyncFetcher",description:"apps.datasources.external.schema.resync generated fetcher"}},0x4872ed8e:(e,t,a)=>{"use strict";a.d(t,{K:()=>s});var n=a(0xe874a88a),i=a(0x22a29f141),l=a(0x1dfdeb1c8),r=a(0x1ec68d6a3),o=a(0xe747dd27);let s=(0,l.A)("apps.datasources.external.delete generated fetcher",(e,t,a)=>new n.S((n,l)=>{let{abortSignal:s,reason:c,...d}=a,u=(0,o.VA)(d);e((0,i.apiCall)({method:"apps.datasources.external.delete",args:u,abortSignal:s,reason:c})).then(e=>{n(e)}).catch(e=>{(0,r.Ay)({getState:t}).error(`API call to apps.datasources.external.delete with reason ${c} failed, initiated by generated fetcher`),l(e)})}));s.meta={name:"appsDatasourcesExternalDeleteFetcher",key:"createFetcherAppsDatasourcesExternalDeleteFetcher",description:"apps.datasources.external.delete generated fetcher"}},0xa58468ed:(e,t,a)=>{"use strict";a.d(t,{H:()=>s});var n=a(0xe874a88a),i=a(0x22a29f141),l=a(0x1dfdeb1c8),r=a(0x1ec68d6a3),o=a(0xe747dd27);let s=(0,l.A)("apps.datasources.external.info generated fetcher",(e,t,a)=>new n.S((n,l)=>{let{abortSignal:s,reason:c,...d}=a,u=(0,o.VA)(d);e((0,i.apiCall)({method:"apps.datasources.external.info",args:u,abortSignal:s,reason:c})).then(e=>{n(e)}).catch(e=>{(0,r.Ay)({getState:t}).error(`API call to apps.datasources.external.info with reason ${c} failed, initiated by generated fetcher`),l(e)})}));s.meta={name:"appsDatasourcesExternalInfoFetcher",key:"createFetcherAppsDatasourcesExternalInfoFetcher",description:"apps.datasources.external.info generated fetcher"}},0x20937584:(e,t,a)=>{"use strict";a.d(t,{H:()=>s,o:()=>c});var n=a(0xe874a88a),i=a(0x22a29f141),l=a(0x1dfdeb1c8),r=a(0x1ec68d6a3),o=a(0xe747dd27);let s={UnknownMethod:"unknown_method",AccessDenied:"access_denied",InvalidInput:"invalid_input",InternalError:"internal_error",AuthenticationFailure:"authentication_failure",TokenNotFound:"token_not_found",DatasourceNotFound:"datasource_not_found",PermissionsFailedToUpdate:"permissions_failed_to_update",StatusUpdateNotValid:"status_update_not_valid",FailedToEnsureSalesforceOrgConfig:"failed_to_ensure_salesforce_org_config",CannotChangeSalesforceOrganization:"cannot_change_salesforce_organization",RestrictedAction:"restricted_action"},c=(0,l.A)("apps.datasources.external.update generated fetcher",(e,t,a)=>new n.S((n,l)=>{let{abortSignal:s,reason:c,...d}=a,u=(0,o.VA)(d);e((0,i.apiCall)({method:"apps.datasources.external.update",args:u,abortSignal:s,reason:c})).then(e=>{n(e)}).catch(e=>{(0,r.Ay)({getState:t}).error(`API call to apps.datasources.external.update with reason ${c} failed, initiated by generated fetcher`),l(e)})}));c.meta={name:"appsDatasourcesExternalUpdateFetcher",key:"createFetcherAppsDatasourcesExternalUpdateFetcher",description:"apps.datasources.external.update generated fetcher"}},0x6a5b3b61:(e,t,a)=>{"use strict";a.d(t,{r:()=>s});var n=a(0xe874a88a),i=a(0x22a29f141),l=a(0x1dfdeb1c8),r=a(0x1ec68d6a3),o=a(0xe747dd27);let s=(0,l.A)("apps.team.variables.delete generated fetcher",(e,t,a)=>new n.S((n,l)=>{let{abortSignal:s,reason:c,...d}=a,u=(0,o.VA)(d);e((0,i.apiCall)({method:"apps.team.variables.delete",args:u,abortSignal:s,reason:c})).then(e=>{n(e)}).catch(e=>{(0,r.Ay)({getState:t}).error(`API call to apps.team.variables.delete with reason ${c} failed, initiated by generated fetcher`),l(e)})}));s.meta={name:"appsTeamVariablesDeleteFetcher",key:"createFetcherAppsTeamVariablesDeleteFetcher",description:"apps.team.variables.delete generated fetcher"}},0x6ebb4c7a:(e,t,a)=>{"use strict";a.d(t,{Y:()=>s});var n=a(0xe874a88a),i=a(0x22a29f141),l=a(0x1dfdeb1c8),r=a(0x1ec68d6a3),o=a(0xe747dd27);let s=(0,l.A)("apps.team.variables.set generated fetcher",(e,t,a)=>new n.S((n,l)=>{let{abortSignal:s,reason:c,...d}=a,u=(0,o.VA)(d);e((0,i.apiCall)({method:"apps.team.variables.set",args:u,abortSignal:s,reason:c})).then(e=>{n(e)}).catch(e=>{(0,r.Ay)({getState:t}).error(`API call to apps.team.variables.set with reason ${c} failed, initiated by generated fetcher`),l(e)})}));s.meta={name:"appsTeamVariablesSetFetcher",key:"createFetcherAppsTeamVariablesSetFetcher",description:"apps.team.variables.set generated fetcher"}},0x24169e055:(e,t,a)=>{"use strict";a.d(t,{O:()=>s});var n=a(0xe874a88a),i=a(0x22a29f141),l=a(0x1dfdeb1c8),r=a(0x1ec68d6a3),o=a(0xe747dd27);let s=(0,l.A)("salesHome.admin.disconnectOrg generated fetcher",(e,t,a)=>new n.S((n,l)=>{let{abortSignal:s,reason:c,...d}=a,u=(0,o.VA)(d);e((0,i.apiCall)({method:"salesHome.admin.disconnectOrg",args:u,abortSignal:s,reason:c})).then(e=>{n(e)}).catch(e=>{(0,r.Ay)({getState:t}).error(`API call to salesHome.admin.disconnectOrg with reason ${c} failed, initiated by generated fetcher`),l(e)})}));s.meta={name:"salesHomeAdminDisconnectOrgFetcher",key:"createFetcherSalesHomeAdminDisconnectOrgFetcher",description:"salesHome.admin.disconnectOrg generated fetcher"}},0x1ec57b131:(e,t,a)=>{"use strict";a.d(t,{O:()=>s});var n=a(0xe874a88a),i=a(0x22a29f141),l=a(0x1dfdeb1c8),r=a(0x1ec68d6a3),o=a(0xe747dd27);let s=(0,l.A)("salesHome.admin.setConfig generated fetcher",(e,t,a)=>new n.S((n,l)=>{let{abortSignal:s,reason:c,...d}=a,u=(0,o.VA)(d);e((0,i.apiCall)({method:"salesHome.admin.setConfig",args:u,abortSignal:s,reason:c})).then(e=>{n(e)}).catch(e=>{(0,r.Ay)({getState:t}).error(`API call to salesHome.admin.setConfig with reason ${c} failed, initiated by generated fetcher`),l(e)})}));s.meta={name:"salesHomeAdminSetConfigFetcher",key:"createFetcherSalesHomeAdminSetConfigFetcher",description:"salesHome.admin.setConfig generated fetcher"}},0xe4dce26f:(e,t,a)=>{"use strict";a.d(t,{N:()=>s});var n=a(0xe874a88a),i=a(0x22a29f141),l=a(0x1dfdeb1c8),r=a(0x1ec68d6a3),o=a(0xe747dd27);let s=(0,l.A)("salesHome.workflows.list generated fetcher",(e,t,a)=>new n.S((n,l)=>{let{abortSignal:s,reason:c,...d}=a,u=(0,o.VA)(d);e((0,i.apiCall)({method:"salesHome.workflows.list",args:u,abortSignal:s,reason:c})).then(e=>{n(e)}).catch(e=>{(0,r.Ay)({getState:t}).error(`API call to salesHome.workflows.list with reason ${c} failed, initiated by generated fetcher`),l(e)})}));s.meta={name:"salesHomeWorkflowsListFetcher",key:"createFetcherSalesHomeWorkflowsListFetcher",description:"salesHome.workflows.list generated fetcher"}},0x75bda81e:(e,t,a)=>{"use strict";a.d(t,{m:()=>s});var n=a(0xe874a88a),i=a(0x22a29f141),l=a(0x1dfdeb1c8),r=a(0x1ec68d6a3),o=a(0xe747dd27);let s=(0,l.A)("salesHome.workflows.update generated fetcher",(e,t,a)=>new n.S((n,l)=>{let{abortSignal:s,reason:c,...d}=a,u=(0,o.VA)(d);e((0,i.apiCall)({method:"salesHome.workflows.update",args:u,abortSignal:s,reason:c})).then(e=>{n(e)}).catch(e=>{(0,r.Ay)({getState:t}).error(`API call to salesHome.workflows.update with reason ${c} failed, initiated by generated fetcher`),l(e)})}));s.meta={name:"salesHomeWorkflowsUpdateFetcher",key:"createFetcherSalesHomeWorkflowsUpdateFetcher",description:"salesHome.workflows.update generated fetcher"}},0x10eeedd1:(e,t,a)=>{"use strict";a.d(t,{XS:()=>l,p7:()=>paginationReducer,ti:()=>i});var n,i=((n={}).FETCH_MORE="fetchMore",n.ADD_DATA="addData",n.CLEAR_RESULTS="clearResults",n);let l=Object.freeze({isFirstFetch:!0,isDone:!1}),paginationReducer=(e,t)=>{switch(t.type){case"addData":return{...e,isFirstFetch:!1,nextCursor:t?.nextCursor,isDone:!t?.nextCursor};case"fetchMore":return{...e,cursor:e?.nextCursor};case"clearResults":return{...l};default:return e}}},0x5b1a0d1b:(e,t,a)=>{"use strict";a.d(t,{g:()=>usePaginatedFetcher});var n=a(0xbad225b5),i=a(0x10eeedd1),l=a(0x1c2358c11);function usePaginatedFetcher({fetcher:e,args:t,skip:a}){let r=t&&(0,l.c)(t),[{cursor:o,isDone:s,isFirstFetch:c},d]=(0,n.useReducer)(i.p7,i.XS),{data:u,loading:m,error:p,refetch:g}=(0,l.L)({fetcher:e,args:{...t,cursor:o},...a?{skip:a}:{}}),f=(0,n.useCallback)(()=>{m||d({type:i.ti.FETCH_MORE})},[m]),_=(0,n.useCallback)(()=>{d({type:i.ti.CLEAR_RESULTS}),g()},[d,g]);return(0,n.useEffect)(()=>{if(u){let e=u?.next_cursor||u?.nextCursor||u?.response_metadata?.next_cursor||u?.responseMetadata?.next_cursor||u?.responseMetadata?.nextCursor;d({type:i.ti.ADD_DATA,...e?{nextCursor:e}:{}})}},[u]),(0,n.useEffect)(()=>{c||d({type:i.ti.CLEAR_RESULTS})},[r]),{data:u,error:p,fetchMoreData:f,loading:m,isDone:s||!!p,isFirstFetch:c,refetchData:_}}},0x1c36bfb24:(e,t,a)=>{"use strict";a.d(t,{FH:()=>i,eo:()=>l,iD:()=>o,uC:()=>s,zc:()=>r});var n=a(0xcf658893);let i=(0,n.Ay)("Sets the connectors");i.meta={name:"setConnectors",key:"createActionSetConnectors",description:"Sets the connectors"};let l=(0,n.Ay)("Sets the custom connectors");l.meta={name:"setCustomConnectors",key:"createActionSetCustomConnectors",description:"Sets the custom connectors"};let r=(0,n.Ay)("Updates a connector");r.meta={name:"updateConnector",key:"createActionUpdateConnector",description:"Updates a connector"};let o=(0,n.Ay)("Updates a custom connector");o.meta={name:"updateCustomConnector",key:"createActionUpdateCustomConnector",description:"Updates a custom connector"};let s=(0,n.Ay)("Sets the isEnterpriseV2");s.meta={name:"setIsEnterpriseV2",key:"createActionSetIsEnterpriseV2",description:"Sets the isEnterpriseV2"}},0x1fd1646fe:(e,t,a)=>{"use strict";a.d(t,{BJ:()=>k,DQ:()=>F,J1:()=>T,MR:()=>M,NF:()=>I,WR:()=>N,pL:()=>O});var n=a(0x220a941b7),i=a(0xe874a88a),l=a(0x1805097c),r=a(0x1cbd9cf82),o=a(0x766d71f),s=a(0x229c7d410),c=a(0x1da23af39),d=a(0x1dae64d6f),u=a(0x15cf285c),m=a(0x34ecbfe7),p=a(0x4872ed8e),g=a(0x20937584),f=a(0x6a5b3b61),_=a(0x6ebb4c7a),h=a(0xaf5a1707),b=a(0x1c7cb6e50),y=a(0x1ec68d6a3),A=a(0x11c82607b),E=a(0x9b971e7e),S=a(0x1c36bfb24),C=a(0xe6bb445e),v=a(0x14c785814),x=a(0x1d37834d3),w=a(0x177986c74);let O=(0,A.Ay)("Call API to fetch list of OAuth providers",async(e,t,{appIds:a})=>{try{e((0,C.Rg)({status:w.G.FETCHING})),await Promise.all(a.map(async t=>{let{authorizations:a}=await e((0,d.N)({appId:t,reason:"get-auth-providers"})),n=(0,b.t)(a);e((0,C.wP)({appId:t,appProviders:n}))})),e((0,C.Rg)({status:w.G.COMPLETE}))}catch(a){(0,y.Ay)({getState:t}).error("Error fetching OAuth Providers",a),e((0,C.Rg)({status:w.G.ERROR}))}});O.meta={name:"fetchAndUpsertProviders",key:"createThunkFetchAndUpsertProviders",description:"Call API to fetch list of OAuth providers"};let k=(0,A.Ay)("Call API to save new data source",async(e,t,{name:a,thirdPartyOauth2TokenId:n,dataSourceAccessPermission:i,userIds:l,creationSource:r})=>{try{let s=(0,E.ZT)(t()),{datasource:c}=await e((0,o.m)({name:a,third_party_oauth2_token_id:n,data_source_access_permission:i,user_ids:l,creation_source:r}));if(c)e((0,C.Nz)({dataSourceItem:(0,b.t)(c)})),s&&(0,v.D1)(s);else throw Error("Datasource response is undefined")}catch(e){throw(0,y.Ay)({getState:t}).error("Error saving new data source",e),e}});k.meta={name:"addNewDataSource",key:"createThunkAddNewDataSource",description:"Call API to save new data source"};let N=(0,A.Ay)("Call API to delete existing data source",(e,t,a)=>e((0,p.K)({reason:"delete-data-source",datasourceId:a.id})).then(()=>{e((0,C.VF)(a))}));N.meta={name:"deleteExistingDataSource",key:"createThunkDeleteExistingDataSource",description:"Call API to delete existing data source"};let T=(0,A.Ay)("Call API to disconnect existing data source",(e,t,a)=>{let n=(0,E.ZT)(t()),i={datasourceId:a.dataSourceId,status:m.VW.Disconnected,reason:"disconnect-data-source"};return e((0,g.o)(i)).then(()=>{e((0,C.Nz)({dataSourceItem:i})),n&&(0,v.D1)(n)})});T.meta={name:"disconnectExistingDataSource",key:"createThunkDisconnectExistingDataSource",description:"Call API to disconnect existing data source"};let I=(0,A.Ay)("Call API to resync existing data source",(e,t,a)=>{let n=(0,E.ZT)(t()),i=a.dataSourceId;return e((0,u.y)({datasourceId:i,reason:"resync-data-source"})).then(t=>{if(t)e((0,C.Nz)({dataSourceItem:{id:i,status:t.datasource.status}})),n&&(0,v.D1)(n);else throw Error("Datasource Schema re-sync response is undefined")})});I.meta={name:"resyncExistingDataSource",key:"createThunkResyncExistingDataSource",description:"Call API to resync existing data source"};let F=(0,A.Ay)("Call API to save new environment variables",async(e,t,{variables:a,envConfig:o,appId:s})=>{try{let d=t(),u=(0,E.JY)(d);if(!u)return;let m=[];if(s){let n=a[0]?.name||"",i=a[0]?.value||"",r=u??(0,E.ZT)(t()),o=(0,l.hf)(r);m.push(e((0,c.w)({token:o,name:n,configValue:i,appId:s,reason:"admin-set-config"})))}else{let t=a.filter(({value:e})=>!!e);(0,h.E)(t)&&m.push(e((0,_.Y)({reason:"set-env-vars",team:u,variables:t})));let i=a.filter(({name:e,value:t})=>!!o.variables[(0,n.A)(e)]?.value&&!t).map(({name:e})=>e);(0,h.E)(i)&&m.push(e((0,f.r)({reason:"delete-empty-env-config-vars",team:u,names:i})))}if(await i.S.all(m).catch(e=>{throw Error(e)}),m.length){let t=a.reduce((e,t)=>{let{isSecret:a,value:i}=t,l=(0,n.A)(t.name),s=o.variables[l];return e[l]={...s,...t,value:a?r.Tz:i},e},{});e((0,C.Ho)({envConfig:{...o,variables:t}})),u&&(0,v.D1)(u),s&&e((0,S.zc)({appId:s,isValid:!0}))}}catch(e){throw(0,y.Ay)({getState:t}).error("Error saving env variables",e),e}});F.meta={name:"setEnvVariables",key:"createThunkSetEnvVariables",description:"Call API to save new environment variables"};let M=(0,A.Ay)("Call API to delete existing env config",(e,t,{id:a,appId:n})=>{try{let i,r=t(),o=(0,E.JY)(r);if(!o)throw Error("No team is set in `deleteExistingEnvConfig` thunk");let c=(0,x.rg)(r,a);if(!c||!("variables"in c))throw Error("Could not find valid environment config based on id passed to `deleteExistingEnvConfig` thunk");let d=Object.values(c.variables).map(({name:e})=>e);if(!(0,h.E)(d))throw Error("No variables are set in the config passed to `deleteExistingEnvConfig` thunk");if(n){let a=o??(0,E.ZT)(t()),r=d[0]||"",c=(0,l.hf)(a);i=e((0,s.N)({reason:"delete-env-config-vars",token:c,name:r,appId:n}))}else i=e((0,f.r)({reason:"delete-env-config-vars",team:o,names:d}));return i.then(()=>{e((0,C.VF)({id:a}))})}catch(e){throw(0,y.Ay)({getState:t}).error("Error deleting environment config",e),e}});M.meta={name:"deleteExistingEnvConfig",key:"createThunkDeleteExistingEnvConfig",description:"Call API to delete existing env config"}},0x10d5ee185:(e,t,a)=>{"use strict";a.d(t,{_:()=>l});var n=a(0x1d14b4538),i=a(0x11571542c);let l=(0,a(0x11c82607b).Ay)("Create workflow template and publish it",async(e,t,a)=>{let{reason:l}=a,{workflow_id:r}=await e((0,i.k)(a));return e((0,n.Y)({workflowId:r,reason:l}))});l.meta={name:"createWorkflowTemplate",key:"createThunkCreateWorkflowTemplate",description:"Create workflow template and publish it"}},0x783a2e96:(e,t,a)=>{"use strict";a.d(t,{_:()=>c});var n=a(0xd896af8a),i=a(0x1f9d49863),l=a(0xe2e863bc),r=a(0x11c82607b),o=a(0x16b708a7f),s=a(0x1c8beab7f);let c=(0,r.Ay)("Fetches a list of Salesforce orgs available to the user",async(e,t)=>{try{e((0,o.IL)());let a=await e((0,l.n)({reason:"sales-elevate-multi-org"}));if(!a.ok)throw Error(n.B.FetchAdminOrgList);if(e((0,o.Jj)(a.salesforce_orgs)),!(0,s.Ey)(t())){let t=a.salesforce_orgs.find(i.W);t&&e((0,o.Ox)(t))}return a}catch{e((0,o.mr)(n.B.FetchAdminOrgList))}return null});c.meta={name:"fetchAdminOrgList",key:"createThunkFetchAdminOrgList",description:"Fetches a list of Salesforce orgs available to the user"}},0x2037c754f:(e,t,a)=>{"use strict";a.d(t,{E:()=>s});var n=a(0x34ecbfe7),i=a(0xa58468ed),l=a(0x11c82607b),r=a(0x16b708a7f),o=a(0x1d104c491);let s=(0,l.Ay)("Fetches datasource info",async(e,t,{datasourceId:a=""})=>{let{datasource:l}=await e((0,i.H)({datasourceId:a,reason:"modern-selling"})),s=l?{...l,isSandbox:l.third_party_oauth2_provider?.provider_key===o.rI.Sandbox,isConnected:l.status===n.VW.Connected,isSynced:l.status===n.VW.Synced,isDisconnected:l.status===n.VW.Disconnected,isDeleted:l.status===n.VW.Deleted,isProblem:l.status===n.VW.Problem}:null;return e((0,r.MU)(s)),s});s.meta={name:"fetchDatasourceInfo",key:"createThunkFetchDatasourceInfo",description:"Fetches datasource info"}},0x1216bc813:(e,t,a)=>{"use strict";a.d(t,{g:()=>r});var n=a(0xbdbf0a38),i=a(0x11c82607b),l=a(0x1c8beab7f);let r=(0,i.Ay)("Fetches datasource object with fields",async(e,t,{objectId:a,datasourceId:i,salesforceOrgId:r=""})=>{let o=t(),s=(0,l.uS)(o,r),c=s?.datasource_id,d=i??c;if(!d||!a)return null;let{id:u,identifier:m,label:p,is_user_object:g,is_active:f,is_trigger_supported:_,fields:h}=await e((0,n.O)({reason:"modern-selling",datasourceId:d,schemaObjectId:a}));return{id:u,identifier:m,label:p,is_user_object:g,is_active:f,is_trigger_supported:_,fields:h}});r.meta={name:"fetchDatasourceObjectWithFields",key:"createThunkFetchDatasourceObjectWithFields",description:"Fetches datasource object with fields"}},0x91c8f270:(e,t,a)=>{"use strict";a.d(t,{S:()=>r});var n=a(0x1318fdf2a),i=a(0x11c82607b),l=a(0x1c8beab7f);let r=(0,i.Ay)("Fetches list of available objects for the current datasource",async(e,t,{datasourceId:a,salesforceOrgId:i=""})=>{let r=t(),o=(0,l.uS)(r,i),s=o?.datasource_id,c=a??s;if(!c)return null;let{objects:d}=await e((0,n.i)({datasourceId:c,reason:"modern-selling"}));return d});r.meta={name:"fetchDatasourceObjectsList",key:"createThunkFetchDatasourceObjectsList",description:"Fetches list of available objects for the current datasource"}},0x52b05cae:(e,t,a)=>{"use strict";a.d(t,{b:()=>r});var n=a(0x1dc39a002),i=a(0x11c82607b),l=a(0x16b708a7f);let r=(0,i.Ay)("Fetches notification prefs for given salesforce org id",async(e,t,{salesforceOrgId:a})=>{if(!a)return null;let i=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(!i.ok||!i.org_configs||!i.org_configs.length)return null;let{datasource_id:r,allow_channel_workspaces:o,allow_slack_connect_channels:s,send_notification_to_channel_permission:c,allow_admins_to_send_to_all_channel_types:d}=i.org_configs[0],u={salesforce_org_id:a,datasource_id:r,allowed_channel_workspaces:o,allow_slack_connect_channels:s,send_notification_to_channel_permission:c,allow_admins_to_send_to_all_channel_types:d};return e((0,l.iQ)({[a]:u})),u});r.meta={name:"fetchNotificationPrefsBySalesforceOrgId",key:"createThunkFetchNotificationPrefsBySalesforceOrgId",description:"Fetches notification prefs for given salesforce org id"}},0x77e385ed:(e,t,a)=>{"use strict";a.d(t,{N:()=>p});var n=a(0xbad225b5),i=a(0x16cf1da63),l=a(0x20482ad21),r=a(0x1ec19bc0c),o=a(0x226892387),s=a(0x16b708a7f),c=a(0x1c8beab7f);let d=new l.Ay("modernselling"),ConnectNewUserOrgModal=({onOrgConnected:e})=>{let t=(0,i.wA)(),a=(0,o.d4)(c.lC),l=(0,n.useCallback)(()=>{t((0,s.Ko)())},[t]);return n.createElement(r.y,{title:d.t("Log in to connect a Salesforce org"),mainText:d.t("Which Salesforce org would you like to connect with the account?"),additionalText:d.t("To connect to orgs not listed, contact your Sales admin."),userOrgsToConnect:a,handleClose:l,onOrgConnected:e})};ConnectNewUserOrgModal.displayName="ConnectNewUserOrgModal";var u=a(0x11c82607b),m=a(0x46dbff89);let p=(0,u.Ay)("Opens Connect New User Org Modal",(e,t,{onOrgConnected:a}={})=>{e((0,m.q)({element:n.createElement(ConnectNewUserOrgModal,{onOrgConnected:a})}))});p.meta={name:"openConnectNewUserOrgModal",key:"createThunkOpenConnectNewUserOrgModal",description:"Opens Connect New User Org Modal"}},0x192df3d34:(e,t,a)=>{"use strict";a.d(t,{A:()=>y});var n=a(0xbad225b5),i=a(0x16cf1da63),l=a(0x20482ad21),r=a(0x11a296110),o=a(0x13eedc190),s=a(0x23b496ae9),c=a(0xf225ecf2),d=a(0x1c7997c1),u=a(0x96920791),m=a(0x16d221c7f),p=a(0x142775427),g=a(0x1f803375e),f=a(0x1fcbb004d);let _=new l.Ay("modernselling"),DisconnectOrgModal=({disconnectOrgId:e,isDisconnecting:t,handleDisconnect:a,children:l})=>{let h=(0,i.wA)(),b=(0,n.useCallback)(()=>{h((0,f.O)())},[h]),y=(0,n.useCallback)(async()=>{await a(e),h((0,f.O)())},[e,h,a]);return n.createElement(o.A,{centered:!0,role:"alertdialog",onClose:b},n.createElement(p.A,null,n.createElement(g.A,{title:_.t("Disconnect this org from Sales?")})),n.createElement(c.A,null,n.createElement(d.A,null,l)),n.createElement(u.A,null,n.createElement(m.A,null,n.createElement(s.A,{onClick:b,type:"outline","aria-label":_.t("Cancel")},_.t("Cancel")),n.createElement(r.lV,{type:"danger",loading:t,onClick:y,"aria-label":_.t("Disconnect")},_.t("Disconnect")))))};DisconnectOrgModal.displayName="DisconnectOrgModal";var h=a(0x11c82607b),b=a(0x46dbff89);let y=(0,h.Ay)("Opens Disconnect Org Modal",(e,t,a)=>{e((0,b.q)({element:n.createElement(DisconnectOrgModal,a)}))});y.meta={name:"openDisconnectOrgModal",key:"createThunkOpenDisconnectOrgModal",description:"Opens Disconnect Org Modal"}},0xcefedbca:(e,t,a)=>{"use strict";a.d(t,{A:()=>_});var n=a(0xe874a88a),i=a(0x22a29f141),l=a(0x1dfdeb1c8),r=a(0x1ec68d6a3),o=a(0xe747dd27);let s=(0,l.A)("salesHome.workflows.get generated fetcher",(e,t,a)=>new n.S((n,l)=>{let{abortSignal:s,reason:c,...d}=a,u=(0,o.VA)(d);e((0,i.apiCall)({method:"salesHome.workflows.get",args:u,abortSignal:s,reason:c})).then(e=>{n(e)}).catch(e=>{(0,r.Ay)({getState:t}).error(`API call to salesHome.workflows.get with reason ${c} failed, initiated by generated fetcher`),l(e)})}));s.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},g={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:i="modern-selling"})=>(n?e((0,d.MB)(!0)):e((0,d.gG)(!0)),e(s({workflowId:a,reason:i})).then(({template_id:t,payload:a,salesforce_org_id:i})=>{let l=a.acn?.account?.id||a.condition?.account?.id,r=a.acn?.opportunity?.id||a.condition?.opportunity?.id;if(l||r){let o;return e((0,u.R)({sobjects:[{sobjectApiName:l?"Account":"Opportunity",fields:["Name"]}],asIntegrationUser:n,query:(o=l||r||"",`https://fake.com/sobjects/?record_id=${o}`),...i&&{salesforceOrgId:i},reason:"edit_workflow"})).then(({records:e})=>{let[o]=e,s={...a};return o&&(n&&l?s.acn.account.name=o.label:n&&r?s.acn.opportunity.name=o.label:!n&&l?s.condition.account.name=o.label:s.condition.opportunity.name=o.label),{templateId:t,payload:s,salesforceOrgId:i}})}return{templateId:t,payload:a,salesforceOrgId:i}}).then(({templateId:t,payload:i,salesforceOrgId:l})=>{if(n){let n=p[t];e((0,d.kC)({workflowView:n,workflowId:a,payload:i,salesforceOrgId:l}))}else{let n=g[t];e((0,d.yK)({workflowView:n,workflowId:a,payload:i,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 _=f},0xf5805007:(e,t,a)=>{"use strict";a.d(t,{a:()=>s});var n=a(0x1ec57b131),i=a(0x1ec68d6a3),l=a(0x11c82607b),r=a(0x16b708a7f),o=a(0x1c8beab7f);let s=(0,l.Ay)("Update notification send to channel permissions",async(e,t,{sendNotificationToChannelPermission:a,allowSlackConnectChannels:l,allowAdminsToSendToAllChannelTypes:s,salesforceOrgId:c})=>{let d=(0,i.Ay)({label:"SALES-HOME-ADMIN"});if(c)try{await e((0,n.O)({reason:"sales-home-set-send-notification-to-channel-permission",sendNotificationToChannelPermission:a,allowSlackConnectChannels:l,allowAdminsToSendToAllChannelTypes:s,salesforceOrgId:c}));let i=(0,o.uS)(t(),c);i&&e((0,r.iQ)({[c]:{...i,send_notification_to_channel_permission:a,allow_slack_connect_channels:l,allow_admins_to_send_to_all_channel_types:s}}))}catch(e){throw d.error("Failed to set sendNotificationToChannelPermission",e),e}});s.meta={name:"updateNotificationToChannelPermissionsBySalesforceOrgId",key:"createThunkUpdateNotificationToChannelPermissionsBySalesforceOrgId",description:"Update notification send to channel permissions"}},0x11d9e4b2f:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});var n=a(0x3ebf4390),i=a(0x91728dda),l=a(0x11c82607b),r=a(0x16b708a7f),o=a(0x1c8beab7f);let s=(0,l.Ay)("Validates a Sales Home notifications workflow view form",(e,t,{workflowView:a})=>{let l=t(),s=(0,o.C1)(l,a),c=(0,n.cB)(a,s,{experimentLobOrg62UnrestrictedGroupOn:(0,i.Jx)(l),experimentLobChannelAcnTokenGroupOn:(0,i.V$)(l)});return e((0,r.a2)({workflowView:a,errors:c.errors})),c});s.meta={name:"validateWorkflowForm",key:"createThunkValidateWorkflowForm",description:"Validates a Sales Home notifications workflow view form"};let c=s},0xed64115e:(e,t,a)=>{"use strict";a.d(t,{Cb:()=>c,DF:()=>E,EK:()=>_,Ep:()=>r,Hj:()=>m,Jr:()=>C,Lw:()=>f,O0:()=>o,Qr:()=>S,TJ:()=>d,XZ:()=>u,Zc:()=>b,_i:()=>h,gr:()=>s,mv:()=>A,mw:()=>g,xI:()=>y});var n=a(0x1df96de4c),i=a(0x1cf0d97e1),l=a(0xdf55e8f3);let r=(0,l.eI)(e=>e.adminRoles.roles||n.t0),o=(0,i.Ay)(e=>Object.values(e.adminRoles.roles||{}).sort((e,t)=>e.name.localeCompare(t.name)));o.meta={name:"getRoles",key:"createSelectorGetRoles",description:e=>Object.values(e.adminRoles.roles||{}).sort((e,t)=>e.name.localeCompare(t.name))};let s=(0,l.eI)(e=>Object.values(e.adminRoles.roles||n.t0).sort((e,t)=>e.name.localeCompare(t.name))),c=(0,i.Ay)(e=>e.adminRoles.isLoadingRoles);c.meta={name:"getIsLoadingRoles",key:"createSelectorGetIsLoadingRoles",description:e=>e.adminRoles.isLoadingRoles};let d=(0,i.Ay)(e=>e.adminRoles.roleTypeFilter);d.meta={name:"getRoleTypeFilter",key:"createSelectorGetRoleTypeFilter",description:e=>e.adminRoles.roleTypeFilter};let u=(0,l.eI)(e=>{let t=s(e),a=d(e);return a?t.filter(e=>e.type?.toLowerCase()===a?.toLowerCase()):t}),m=(0,l.eI)(e=>s(e).filter(e=>"custom"===e.type.toLowerCase())),p=(0,l.eI)(e=>{let t=s(e).filter(e=>"legacy"===e.type.toLowerCase());return 0===t.length?n.Ml:t}),g=(0,l.eI)((e,t)=>{let{permission:a}=t,n=p(e);if(0!==n.length)return n.find(e=>e.permissions[0]===a)}),f=(0,i.Ay)((e,t)=>{let{adminRoles:a}=e,{roleId:n}=t;if(n)return(a.roles||{})[n]});f.meta={name:"getRole",key:"createSelectorGetRole",description:(e,t)=>{let{adminRoles:a}=e,{roleId:n}=t;if(n)return(a.roles||{})[n]}},(0,i.Ay)((e,t)=>{let{adminRoles:a}=e,{roleId:n}=t;return n&&(a.permissions||{})[n]||[]}).meta={name:"getPermissions",key:"createSelectorGetPermissions",description:(e,t)=>{let{adminRoles:a}=e,{roleId:n}=t;return n&&(a.permissions||{})[n]||[]}};let _=(0,i.Ay)((e,{roleId:t})=>{let a=f(e,{roleId:t});return a&&a.num_users_assigned||0});_.meta={name:"getNumberOfMembers",key:"createSelectorGetNumberOfMembers",description:(e,{roleId:t})=>{let a=f(e,{roleId:t});return a&&a.num_users_assigned||0}};let h=(0,i.Ay)((e,{roleId:t})=>{let a=f(e,{roleId:t});return a&&a.num_usergroups_assigned||0});h.meta={name:"getNumberOfUserGroups",key:"createSelectorGetNumberOfUserGroups",description:(e,{roleId:t})=>{let a=f(e,{roleId:t});return a&&a.num_usergroups_assigned||0}};let b=(0,i.Ay)((e,{roleId:t})=>{if(!t)return{};let{adminRoles:a}=e;return(a.members||{})[t]||{}});b.meta={name:"getRoleMembersObject",key:"createSelectorGetRoleMembersObject",description:(e,{roleId:t})=>{if(!t)return{};let{adminRoles:a}=e;return(a.members||{})[t]||{}}},(0,i.Ay)((e,{roleId:t})=>t?Object.values(b(e,{roleId:t})):[]).meta={name:"getRoleMembers",key:"createSelectorGetRoleMembers",description:(e,{roleId:t})=>t?Object.values(b(e,{roleId:t})):[]};let y=(0,i.Ay)((e,{roleId:t,memberId:a})=>{if(t&&a)return e?.adminRoles?.members?.[t]?.[a]});y.meta={name:"getRoleMember",key:"createSelectorGetRoleMember",description:(e,{roleId:t,memberId:a})=>{if(t&&a)return e?.adminRoles?.members?.[t]?.[a]}};let A=(0,i.Ay)((e,{memberId:t,filterValue:a})=>{if(!t)return{};let n=e?.adminRoles?.members,i={};return Object.keys(n).forEach(l=>{let r=n[l];if(r[t])if(a){let n=f(e,{roleId:l}),o=n?.name.toLowerCase(),s=a.toLowerCase();o?.includes(s)&&(i[l]=r[t])}else i[l]=r[t]}),i});A.meta={name:"getMemberRoles",key:"createSelectorGetMemberRoles",description:(e,{memberId:t,filterValue:a})=>{if(!t)return{};let n=e?.adminRoles?.members,i={};return Object.keys(n).forEach(l=>{let r=n[l];if(r[t])if(a){let n=f(e,{roleId:l}),o=n?.name.toLowerCase(),s=a.toLowerCase();o?.includes(s)&&(i[l]=r[t])}else i[l]=r[t]}),i}};let E=(0,i.Ay)((e,{memberId:t})=>t?Object.keys(A(e,{memberId:t})).length:0);E.meta={name:"getNumberOfRolesForMember",key:"createSelectorGetNumberOfRolesForMember",description:(e,{memberId:t})=>t?Object.keys(A(e,{memberId:t})).length:0};let S=(0,i.Ay)((e,{roleId:t})=>t&&e?.adminRoles?.userGroups?.[t]||[]);S.meta={name:"getRoleUserGroups",key:"createSelectorGetRoleUserGroups",description:(e,{roleId:t})=>t&&e?.adminRoles?.userGroups?.[t]||[]};let C=(0,i.Ay)(e=>e?.adminRoles?.hasFetchedRoles||!1);C.meta={name:"getHasFetchedRoles",key:"createSelectorGetHasFetchedRoles",description:e=>e?.adminRoles?.hasFetchedRoles||!1},(0,l.eI)((e,{permission:t})=>s(e).filter(e=>e.permissions.includes(t)))},0x12836eac0:(e,t,a)=>{"use strict";a.d(t,{JK:()=>b,Jk:()=>h,KU:()=>y,PV:()=>d,UK:()=>A,WJ:()=>_,Xh:()=>c,gU:()=>E,jJ:()=>u,mG:()=>f,vu:()=>p,xo:()=>g,z8:()=>m});var n=a(0x1df96de4c),i=a(0x84f62144),l=a(0x1cf0d97e1),r=a(0xdf55e8f3),o=a(0x100313bb4),s=a(0xed64115e);let c=(0,l.Ay)(e=>e.rolesMgmt.memberPagination);c.meta={name:"getMemberPagination",key:"createSelectorGetMemberPagination",description:e=>e.rolesMgmt.memberPagination};let d=(0,r.eI)((e,{roleId:t})=>{let a=c(e);if(!a)return(0,n.B4)();let i=(0,s.Zc)(e,{roleId:t}),{currentPage:l,memberSet:r}=a;return(r[l]||[]).map(e=>i[e]||{}).filter(e=>{let{team_ids:t,enterprise_ids:a}=e;return(t||[]).length>0||(a||[]).length>0})}),u=(0,l.Ay)(e=>{let t=c(e);if(!t)return!0;let{memberSet:a}=t,n=a[0];return!n||n.length<25});u.meta={name:"isPaginationDisabled",key:"createSelectorIsPaginationDisabled",description:e=>{let t=c(e);if(!t)return!0;let{memberSet:a}=t,n=a[0];return!n||n.length<25}};let m=(0,l.Ay)(e=>{let t=c(e);if(!t||u(e))return!1;let{currentPage:a,limit:n,memberSet:i,cursor:l}=t,r=i[i.length-1];return a{let t=c(e);if(!t||u(e))return!1;let{currentPage:a,limit:n,memberSet:i,cursor:l}=t,r=i[i.length-1];return a{let t=c(e);if(!t||u(e))return!1;let{currentPage:a}=t;return a>0});p.meta={name:"isThereAPreviousSet",key:"createSelectorIsThereAPreviousSet",description:e=>{let t=c(e);if(!t||u(e))return!1;let{currentPage:a}=t;return a>0}};let g=(0,l.Ay)(e=>e.rolesMgmt.memberSortOptions);g.meta={name:"getMemberSortOptions",key:"createSelectorGetMemberSortOptions",description:e=>e.rolesMgmt.memberSortOptions};let f=(0,l.Ay)(e=>e.rolesMgmt.memberSearchOptions.isLoading);f.meta={name:"isMemberPageLoading",key:"createSelectorIsMemberPageLoading",description:e=>e.rolesMgmt.memberSearchOptions.isLoading};let _=(0,l.Ay)(e=>e.rolesMgmt.userGroupsOptions.orgHasUserGroups);_.meta={name:"getOrgHasUserGroups",key:"createSelectorGetOrgHasUserGroups",description:e=>e.rolesMgmt.userGroupsOptions.orgHasUserGroups};let h=(0,l.Ay)(e=>e.rolesMgmt.userGroupsOptions.sortBy);h.meta={name:"getUserGroupsSortBy",key:"createSelectorGetUserGroupsSortBy",description:e=>e.rolesMgmt.userGroupsOptions.sortBy};let b=(0,l.Ay)(e=>e.rolesMgmt.userGroupsOptions.sortDirection);b.meta={name:"getUserGroupsSortDirection",key:"createSelectorGetUserGroupsSortDirection",description:e=>e.rolesMgmt.userGroupsOptions.sortDirection};let y=(0,l.Ay)(e=>e?.rolesMgmt?.userGroupsOptions?.isLoading||!1);y.meta={name:"getUserGroupsLoading",key:"createSelectorGetUserGroupsLoading",description:e=>e?.rolesMgmt?.userGroupsOptions?.isLoading||!1};let A=(0,l.Ay)(e=>e?.rolesMgmt?.userGroupsOptions?.hasApiError||!1);A.meta={name:"getUserGroupsHasApiError",key:"createSelectorGetUserGroupsHasApiError",description:e=>e?.rolesMgmt?.userGroupsOptions?.hasApiError||!1};let E=(0,l.Ay)(e=>(0,o.RE)(e)?(0,i.IF)(e):(0,i.AD)(e));E.meta={name:"canUserAccessRolesPage",key:"createSelectorCanUserAccessRolesPage",description:e=>(0,o.RE)(e)?(0,i.IF)(e):(0,i.AD)(e)}},0x1134434e0:(e,t,a)=>{"use strict";a.d(t,{Cl:()=>g,Ds:()=>m,Is:()=>f,Jt:()=>s,Nd:()=>n,QF:()=>p,Rj:()=>r,aE:()=>i,aW:()=>u,cX:()=>_,eo:()=>h,qB:()=>o,qC:()=>c,ty:()=>l,vN:()=>d});let n=100,i="whitelistApps",l="app_whitelist_enabled",r="app_management_apps",o="has_compliance_export",s="app_dir_only",c="magic_unfurls_enabled",d="commands_only_regular",u="app_whitelist_requests_enabled",m="app_whitelist_requests_require_comment_enabled",p="sign_in_with_slack_disabled",g="who_can_manage_integrations",f=50,_="ai_apps_settings",h="work_object_unfurl_visibility"},0x283db413:(e,t,a)=>{"use strict";a.d(t,{FB:()=>u,FY:()=>d,lm:()=>requireTopLevelAppApproval,xF:()=>g});var n=a(0xbe2be077),i=a(0xb8504a42),l=a(0x1cf0d97e1),r=a(0xb1f0729f),o=a(0x1d600678),s=a(0x1134434e0),c=a(0x1ee439e69);let d=(0,l.Ay)(e=>e.adminAppsManage?.manageAccessList??!1);d.meta={name:"userCanManageAccessList",key:"createSelectorUserCanManageAccessList",description:e=>e.adminAppsManage?.manageAccessList??!1};let u=(0,l.Ay)(e=>e.adminAppsManage?.isAppmin??!1);function requireTopLevelAppApproval(e){let t=(0,c.Yc)(e);return(0,i.kA)(t)||(0,i.tz)(t)||((0,o.x)(e,"requireAppApproval")??!1)}u.meta={name:"isUserAppmin",key:"createSelectorIsUserAppmin",description:e=>e.adminAppsManage?.isAppmin??!1};let m=(0,l.Ay)(e=>!!(0,r.fl)(e)[s.ty]);m.meta={name:"isAAAOnForOrg",key:"createSelectorIsAAAOnForOrg",description:e=>!!(0,r.fl)(e)[s.ty]};let p=(0,l.Ay)(e=>!!(0,o.x)(e,s.ty));p.meta={name:"isAAAOnForWorkspace",key:"createSelectorIsAAAOnForWorkspace",description:e=>!!(0,o.x)(e,s.ty)};let g=(0,l.Ay)(e=>(0,n.k)(e)?m(e):p(e));g.meta={name:"isAAAOn",key:"createSelectorIsAAAOn",description:e=>(0,n.k)(e)?m(e):p(e)}},0x2209fd06a:(e,t,a)=>{"use strict";a.d(t,{A7:()=>canUserOpenOrgDashboard,Ak:()=>canUserManageSalesforceConnectionsInTeamSite,B9:()=>canUserAccessAnalyticsInOrgDash,Db:()=>canUserAccessWorkspacesAppsInOrgDash,EC:()=>canUserAccessWorkflowAnalyticsInOrgDash,Hm:()=>canUserAccessLimitedWorkspacesInOrgDash,KL:()=>canUserAccessAdminSearchInOrgDash,L6:()=>canUserAccessOrgWideChannelAnalyticsInOrgDash,Lm:()=>canUserOpenAdminDashboard,Nx:()=>canActorForgetEnterpriseUser,VG:()=>canUserAccessWorkspacesInOrgDash,Wb:()=>canUserAccessWorkspaceAnalyticsInOrgDash,Wt:()=>canUserAccessListsAnalyticsInOrgDash,Z4:()=>canUserAccessAiAnalyticsInOrgDash,ZZ:()=>canUserManagePermissions,Zu:()=>canUserAccessAnalyticsInTeamSite,_e:()=>canUserAccessMigrationsInOrgDash,bC:()=>canUserAccessGroupsInOrgDash,bJ:()=>canUserAccessClipAnalyticsInOrgDash,bh:()=>canUserEditIdpGroups,dg:()=>canUserAccessMemberAnalyticsInOrgDash,e_:()=>canUserManageAgentforceInTeamSite,kP:()=>canUserAccessAppAnalyticsInOrgDash,k_:()=>canUserAccessComplianceExports,lN:()=>canUserAccessCanvasAnalyticsInOrgDash,oM:()=>canUserManageSalesforceConnectionsInOrgDash,p4:()=>canUserAccessNativeDLP,tF:()=>canUserAccessHuddleAnalyticsInOrgDash,w5:()=>canUserManageAgentforceInOrgDash,wF:()=>canUserAccessOverviewAnalyticsInOrgDash,xk:()=>canUserAccessSecurityAdmin,zd:()=>canUserAccessLegalHolds,zi:()=>canUserAccessFlaggedContent});var n=a(0x21b0fd259),i=a(0xf2964a91),l=a(0x153b1ae5d),r=a(0x23255e234),o=a(0xb8504a42),s=a(0x16c7f7638),c=a(0x3b505904),d=a(0x23154eb4a),u=a(0x17d384961),m=a(0x1283bc1e3),p=a(0xc76a926f),g=a(0xba427404),f=a(0x2162f3428),_=a(0x25059a1c2),h=a(0x159a0d582),b=a(0xd84d0b08),y=a(0x10b952946),A=a(0x190a9df19),E=a(0x250d19cb7),S=a(0x84f62144),C=a(0xe8015073),v=a(0xb1f0729f),x=a(0x1d600678),w=a(0x1e3eb45fd),O=a(0x14149c126),k=a(0xe684f705),N=a(0xd0eb5473),T=a(0xe4af74fc),I=a(0x1ee439e69);let canUserAccessMigrationsInOrgDash=e=>{let t="on"===(0,O._Z)(e,"grid_migration_portal"),a=(0,T.tA)(e,{permission:C.p.SEND_GRID_MIGRATION_INVITE}),n=(0,T.tA)(e,{permission:C.p.APPROVE_GRID_MIGRATION_INVITE}),i=(0,N.Jr)(a),l=(0,N.Jr)(n);return t&&(i||l)},canActorForgetEnterpriseUser=(e,t)=>{let a=(0,k.cA)(e),r=(0,l.d)(t)&&(0,i.o)(t);return"on"===(0,O._Z)(e,"profile_deletion_delegation_permission")?r&&((0,n.nA)(a)||(0,p.y)(e)):(0,n.nA)(a)&&r},canUserAccessLegalHolds=e=>{let t=(0,T.tA)(e,{permission:C.p.READ_LEGAL_HOLDS}),a=(0,T.tA)(e,{permission:C.p.WRITE_LEGAL_HOLDS}),n=(0,N.Jr)(t),i=(0,N.Jr)(a);return n||i},canUserAccessNativeDLP=e=>{let t=(0,T.tA)(e,{permission:C.p.READ_NATIVE_DLP}),a=(0,T.tA)(e,{permission:C.p.WRITE_NATIVE_DLP}),n=(0,N.Jr)(t),i=(0,N.Jr)(a);return n||i},canUserAccessFlaggedContent=e=>{let t=(0,T.tA)(e,{permission:C.p.REVIEW_FLAGGED_CONTENT}),a=(0,A.V7)(e)||(0,A.hu)(e)||(0,N.Jr)(t),n=!!(0,v.SI)(e,"content_review_enabled");return a&&n},canUserAccessComplianceExports=e=>{let t=(0,T.tA)(e,{permission:C.p.VIEW_COMPLIANCE_EXPORT}),a=(0,T.tA)(e,{permission:C.p.RUN_COMPLIANCE_EXPORT}),n=(0,T.tA)(e,{permission:C.p.DOWNLOAD_COMPLIANCE_EXPORT}),i=(0,T.tA)(e,{permission:C.p.MANAGE_COMPLIANCE_EXPORT_TOKEN});return!!((0,v.wc)(e,"enterprise_has_corporate_exports")&&((0,N.Jr)(t)||(0,N.Jr)(a)||(0,N.Jr)(n)||(0,N.Jr)(i)))},canUserAccessSecurityAdmin=e=>{let t=(0,T.tA)(e,{permission:C.p.VIEW_SECURITY_SETTINGS}),a=(0,T.tA)(e,{permission:C.p.VIEW_SSO_SETTINGS});return(0,N.Jr)(t)||(0,N.Jr)(a)},canUserAccessWorkspacesInOrgDash=e=>(0,m.O)(e)||(0,g.q)(e)||(0,f.Y)(e),canUserAccessAdminSearchInOrgDash=e=>{let t="on"===(0,O._Z)(e,"gantry_manage_non_grid_access"),a=(0,I.Yc)(e);return(!t||(0,o.kA)(a))&&((0,u.c)(e)||(0,c.h)(e)||canUserAccessWorkspacesInOrgDash(e))},canUserAccessLimitedWorkspacesInOrgDash=(e,t)=>!1,canUserAccessGroupsInOrgDash=e=>{if("on"!==(0,O._Z)(e,"admin_groups_m2_client_visibility"))return(0,m.O)(e)||(0,f.Y)(e);let t=(0,T.tA)(e,{permission:C.p.CREATE_AND_EDIT_ORG_USER_GROUPS}),a=(0,T.tA)(e,{permission:C.p.EDIT_ORG_USER_GROUPS}),n=(0,T.tA)(e,{permission:C.p.DELETE_ORG_USER_GROUPS}),i=(0,N.Jr)(t),l=(0,N.Jr)(a),r=(0,N.Jr)(n);return i||l||r},canUserAccessTeamSiteAnalyticsWithoutRoles=e=>{let t=(0,k.cA)(e),a=(0,r.Ez)(t),n=(0,x.x)(e,"stats_only_admins");return(0,h.c)(e)||!n&&!a},canUserAccessAnalyticsInTeamSite=e=>{let t,a,n,i,l,s,c,d,u,m,p,g,f,_,b,y,A,E,S,w;return!!canUserAccessTeamSiteAnalyticsWithoutRoles(e)||(t=canUserAccessTeamSiteAnalyticsWithoutRoles(e),a=(0,I.H7)(e),n=(0,o.r7)(a),i=(0,T.yI)(e,{permission:C.p.VIEW_OVERVIEW_ANALYTICS}),t||n&&(0,N.Jr)(i)||(l=(0,k.cA)(e),s=(0,r.Ez)(l),c=(0,I.H7)(e),d=(0,o.r7)(c),u=(0,x.x)(e,"stats_only_admins"),m=!(0,v.SI)(e,"member_analytics_disabled"),p=(0,T.yI)(e,{permission:C.p.VIEW_MEMBER_ANALYTICS}),g=(0,N.Jr)(p),(0,h.c)(e)&&m||!u&&!s&&m||d&&g)||(f=(0,I.H7)(e),_=(0,o.r7)(f),b=canUserAccessTeamSiteAnalyticsWithoutRoles(e),y=(0,T.yI)(e,{permission:C.p.VIEW_APP_ANALYTICS}),b||_&&(0,N.Jr)(y))||(A=(0,I.H7)(e),E=(0,o.r7)(A),S=canUserAccessTeamSiteAnalyticsWithoutRoles(e),w=(0,T.yI)(e,{permission:C.p.VIEW_CHANNEL_ANALYTICS}),S||E&&(0,N.Jr)(w)))},canUserAccessOverviewAnalyticsInOrgDash=e=>{let t=(0,T.tA)(e,{permission:C.p.VIEW_OVERVIEW_ANALYTICS});return(0,h.W)(e)||(0,N.Jr)(t)},canUserAccessHuddleAnalyticsInOrgDash=e=>{let t=(0,T.tA)(e,{permission:C.p.VIEW_HUDDLE_ANALYTICS});return(0,h.W)(e)||(0,N.Jr)(t)},canUserAccessClipAnalyticsInOrgDash=e=>{let t=(0,T.tA)(e,{permission:C.p.VIEW_CLIP_ANALYTICS});return(0,h.W)(e)||(0,N.Jr)(t)},canUserAccessOrgWideChannelAnalyticsInOrgDash=e=>{let t=(0,T.tA)(e,{permission:C.p.VIEW_ORG_WIDE_CHANNEL_ANALYTICS});return(0,h.W)(e)||(0,N.Jr)(t)},canUserAccessAiAnalyticsInOrgDash=e=>{let t="on"===(0,O._Z)(e,"einst_4598_ai_analytics"),a="active"===(0,O._Z)(e,"einst_4567_ai_pilot_customer_list"),n=(0,T.tA)(e,{permission:C.p.VIEW_AI_ANALYTICS});return!!t&&((0,h.W)(e)&&(0,w.AV)(e)||a||(0,N.Jr)(n))},canUserAccessMemberAnalyticsInOrgDash=e=>{let t=!(0,v.SI)(e,"member_analytics_disabled"),a=(0,T.tA)(e,{permission:C.p.VIEW_MEMBER_ANALYTICS});return(0,h.W)(e)&&t||(0,N.Jr)(a)},canUserAccessWorkspaceAnalyticsInOrgDash=e=>{let t=(0,T.tA)(e,{permission:C.p.VIEW_WORKSPACE_ANALYTICS});return(0,h.W)(e)||(0,N.Jr)(t)},canUserAccessAppAnalyticsInOrgDash=e=>{let t=(0,T.tA)(e,{permission:C.p.VIEW_APP_ANALYTICS});return(0,h.W)(e)||(0,N.Jr)(t)},canUserAccessCanvasAnalyticsInOrgDash=e=>{let t=(0,T.tA)(e,{permission:C.p.VIEW_CANVAS_ANALYTICS});return(0,h.W)(e)||(0,N.Jr)(t)},canUserAccessWorkflowAnalyticsInOrgDash=e=>{let t=(0,T.tA)(e,{permission:C.p.VIEW_WORKFLOW_ANALYTICS});return(0,h.W)(e)||(0,N.Jr)(t)},canUserAccessListsAnalyticsInOrgDash=e=>{let t=(0,T.tA)(e,{permission:C.p.VIEW_LIST_ANALYTICS});return(0,h.W)(e)||(0,N.Jr)(t)},canUserAccessAnalyticsInOrgDash=e=>canUserAccessOverviewAnalyticsInOrgDash(e)||canUserAccessWorkspaceAnalyticsInOrgDash(e)||canUserAccessMemberAnalyticsInOrgDash(e)||canUserAccessOrgWideChannelAnalyticsInOrgDash(e)||canUserAccessHuddleAnalyticsInOrgDash(e)||canUserAccessClipAnalyticsInOrgDash(e)||canUserAccessAppAnalyticsInOrgDash(e)||canUserAccessCanvasAnalyticsInOrgDash(e)||canUserAccessWorkflowAnalyticsInOrgDash(e)||canUserAccessListsAnalyticsInOrgDash(e),canUserManageSalesforceConnectionsInOrgDash=e=>{let t=(0,T.tA)(e,{permission:C.p.MANAGE_SALESFORCE_CONNECTIONS});return(0,h.W)(e)||(0,N.Jr)(t)},canUserManageSalesforceConnectionsInTeamSite=e=>{let t=(0,I.H7)(e);if((0,o.r7)(t))return!1;let a=(0,T.yI)(e,{permission:C.p.MANAGE_SALESFORCE_CONNECTIONS});return(0,h.c)(e)||(0,N.Jr)(a)},canUserManageAgentforceInOrgDash=e=>(0,h.W)(e),canUserManageAgentforceInTeamSite=e=>{let t=(0,I.H7)(e);return!(0,o.r7)(t)&&(0,h.c)(e)},canUserManagePermissions=e=>{let t=(0,T.tA)(e,{permission:C.p.MANAGE_PERMISSIONS});return(0,N.Jr)(t)},canUserOpenOrgDashboard=e=>{let t=(0,E.B)(e),a="on"===(0,O._Z)(e,"gantry_manage_non_grid_access");return!t&&((0,h.W)(e)||a&&(0,h.c)(e)||(0,S.AD)(e)||canUserAccessWorkspacesInOrgDash(e)||canUserAccessMigrationsInOrgDash(e)||(0,u.c)(e)||canUserAccessGroupsInOrgDash(e)||canUserAccessLegalHolds(e)||(0,s.S)(e)||(0,d.y)(e)||canUserAccessNativeDLP(e)||canUserAccessComplianceExports(e)||canUserAccessAnalyticsInOrgDash(e)||(0,y.Lf)(e)||canUserAccessSecurityAdmin(e)||canUserAccessFlaggedContent(e)||canUserManageSalesforceConnectionsInOrgDash(e)||canUserManageAgentforceInOrgDash(e)||(0,b.M)(e)||(0,c.h)(e)||canUserManagePermissions(e)||(0,_.B)(e))},canUserOpenAdminDashboard=e=>canUserOpenOrgDashboard(e);function canUserAccessWorkspacesAppsInOrgDash(e){return(0,h.W)(e)}function canUserEditIdpGroups(e){return(0,h.W)(e)}},0x16c7f7638:(e,t,a)=>{"use strict";a.d(t,{S:()=>canUserAccessAuditLogs});var n=a(0xbe2be077),i=a(0x190a9df19),l=a(0xe8015073),r=a(0x147fb8c90),o=a(0xd0eb5473),s=a(0xe4af74fc);let canUserAccessAuditLogs=e=>{let t=(0,r.G2)(e,"audit_log__access"),a=(0,r.G2)(e,"audit_log_addon__access");if(!t&&!a)return!1;if((0,n.k)(e)){let t=(0,s.tA)(e,{permission:l.p.READ_AUDIT_LOGS});return(0,i.hu)(e)||(0,o.Jr)(t)}return(0,i.p2)(e)}},0x23154eb4a:(e,t,a)=>{"use strict";a.d(t,{y:()=>canUserAccessDataMonitoring});var n=a(0xbe2be077),i=a(0x190a9df19),l=a(0xe8015073),r=a(0x147fb8c90),o=a(0xd0eb5473),s=a(0xe4af74fc);let canUserAccessDataMonitoring=e=>{let t=(0,r.G2)(e,"audit_log__access"),a=(0,r.G2)(e,"audit_log_addon__access");if(!t&&!a)return!1;if((0,n.k)(e)){let t=(0,s.tA)(e,{permission:l.p.READ_AUDIT_LOGS});return(0,i.hu)(e)||(0,o.Jr)(t)}return(0,i.p2)(e)}},0x17d384961:(e,t,a)=>{"use strict";a.d(t,{c:()=>canUserAccessMembersInOrgDash});var n=a(0x1283bc1e3),i=a(0x159a0d582),l=a(0xe8015073),r=a(0xd0eb5473),o=a(0xe4af74fc),s=a(0xc76a926f),c=a(0xba427404),d=a(0x2162f3428);let canUserAccessMembersInOrgDash=e=>(0,n.O)(e)||(0,d.Y)(e)||(0,c.q)(e)||(e=>{if((0,i.W)(e))return!0;let t=(0,o.tA)(e,{permission:l.p.DEACTIVATE_FULL_USER});return(0,r.Jr)(t)})(e)||(e=>{if((0,i.W)(e))return!0;let t=(0,o.tA)(e,{permission:l.p.DEACTIVATE_GUEST_USER});return(0,r.Jr)(t)})(e)||(0,s.y)(e)},0x1283bc1e3:(e,t,a)=>{"use strict";a.d(t,{O:()=>canUserAddMembersAtOrgLevelInOrgDash});var n=a(0x159a0d582),i=a(0xe8015073),l=a(0x19c76d181),r=a(0xd0eb5473),o=a(0xe4af74fc);let canUserAddMembersAtOrgLevelInOrgDash=e=>{let t=(0,o.tA)(e,{permission:i.p.ADD_FULL_USER_TO_WORKSPACE});return(0,l.u8)(e)&&((0,n.W)(e)||(0,r.Jr)(t))}},0xc76a926f:(e,t,a)=>{"use strict";a.d(t,{y:()=>canUserForgetMembers});var n=a(0xe8015073),i=a(0xd0eb5473),l=a(0xe4af74fc);let canUserForgetMembers=e=>{let t=(0,l.tA)(e,{permission:n.p.DELETE_USER_PROFILE});return(0,i.Jr)(t)}},0xba427404:(e,t,a)=>{"use strict";a.d(t,{q:()=>canUserRemoveGuestsInOrgDash});var n=a(0x159a0d582),i=a(0xe8015073),l=a(0xe684f705),r=a(0xd0eb5473),o=a(0xe4af74fc);let canUserRemoveGuestsInOrgDash=e=>{if((0,n.W)(e))return!0;let t=(0,l.cA)(e),a=(0,o.tA)(e,{permission:i.p.REMOVE_GUEST_USER_FROM_WORKSPACE,memberId:t?.id});return(0,r.Jr)(a)}},0x2162f3428:(e,t,a)=>{"use strict";a.d(t,{Y:()=>canUserRemoveMembersInOrgDash});var n=a(0x159a0d582),i=a(0xe8015073),l=a(0xd0eb5473),r=a(0xe4af74fc);let canUserRemoveMembersInOrgDash=e=>{if((0,n.W)(e))return!0;let t=(0,r.tA)(e,{permission:i.p.REMOVE_FULL_USER_FROM_WORKSPACE});return(0,l.Jr)(t)}},0x25059a1c2:(e,t,a)=>{"use strict";a.d(t,{B:()=>canUserSignMembersOutForTopLevelTeam});var n=a(0xe8015073);a(0x14149c126);var i=a(0xd0eb5473),l=a(0xe4af74fc);function canUserSignMembersOutForTopLevelTeam(e){let t=(0,l.tA)(e,{permission:n.p.SIGN_OUT_USER});return(0,i.Jr)(t)}},0xd84d0b08:(e,t,a)=>{"use strict";a.d(t,{M:()=>canUserAccessIntegrationsInOrgDash});var n=a(0x159a0d582),i=a(0xe8015073),l=a(0xd0eb5473),r=a(0xe4af74fc);let o=[i.p.VIEW_APP_REQUESTS,i.p.MANAGE_AAA_AUTOMATION_RULES,i.p.MANAGE_SCOPE_RATINGS,i.p.VIEW_INSTALLED_APPS,i.p.MANAGE_ORG_LEVEL_APP_APPROVAL,i.p.VIEW_APPROVED_APPS,i.p.VIEW_RESTRICTED_APPS,i.p.ADD_ORG_APPS_TO_WORKSPACES,i.p.REMOVE_ORG_APPS_FROM_WORKSPACES,i.p.VIEW_DEPRECATIONS,i.p.MANAGE_WORKFLOW_CONNECTORS,i.p.MANAGE_WORKFLOW_TRIGGERS];function canUserAccessIntegrationsInOrgDash(e){return!!(0,n.W)(e)||o.some(t=>(0,l.Jr)((0,r.tA)(e,{permission:t})))}},0x10b952946:(e,t,a)=>{"use strict";a.d(t,{EM:()=>canUserAccessPublishedWorkflowsOnWorkspace,Lf:()=>canUserAccessPublishedWorkflowsOnOrgDash,_:()=>canUserAccessPublishedWorkflows,u9:()=>canUserAccessWorkflowStepsAndTriggersOnWorkspace});var n=a(0xb8504a42),i=a(0xf038462c),l=a(0x159a0d582),r=a(0xe8015073),o=a(0x147fb8c90),s=a(0x100313bb4),c=a(0xd0eb5473),d=a(0xe4af74fc),u=a(0x283db413),m=a(0x1ee439e69);function canUserAccessPublishedWorkflows(e){let t=(0,d.yI)(e,{permission:r.p.VIEW_TOP_LEVEL_WORKFLOWS});return(0,c.Jr)(t)||(0,i.EC)(e)||(0,u.FB)(e)}function canUserAccessPublishedWorkflowsOnWorkspace(e){let t=(0,m.H7)(e);return!(0,n.tz)(t)&&canUserAccessPublishedWorkflows(e)}function canUserAccessWorkflowStepsAndTriggersOnWorkspace(e){return!!(0,o.G2)(e,"hermes__write")&&canUserAccessPublishedWorkflowsOnWorkspace(e)}function canUserAccessPublishedWorkflowsOnOrgDash(e){if((0,s.s$)(e)){if((0,l.W)(e))return!0;let t=(0,d.tA)(e,{permission:r.p.VIEW_TOP_LEVEL_WORKFLOWS});return(0,c.Jr)(t)}return!1}},0x250d19cb7:(e,t,a)=>{"use strict";a.d(t,{B:()=>isCurrentUserMobileOnly});var n=a(0x1b9d5cc0c),i=a(0x14149c126),l=a(0xe684f705);let isCurrentUserMobileOnly=e=>{if("on"!==(0,i._Z)(e,"enable_mobile_only_users"))return!1;let t=(0,l.cA)(e);return(0,n.tJ)(t)}},0x84f62144:(e,t,a)=>{"use strict";a.d(t,{AD:()=>canUserAccessRolesInOrgDash,CJ:()=>canUserManageRoles,H5:()=>canUserManageRole,IF:()=>canUserAccessRolesInTeamSite,dD:()=>canUserManageCustomRoles,jY:()=>canUserAssignRoleAdmins});var n=a(0xbe2be077),i=a(0xa1832ae4),l=a(0x159a0d582),r=a(0x190a9df19),o=a(0xe8015073),s=a(0x100313bb4),c=a(0xed64115e),d=a(0x527543d1),u=a(0xd0eb5473),m=a(0xe4af74fc),p=a(0x1ee439e69);let canUserAssignRoleAdmins=e=>{let t=(0,p.H7)(e);return!(0,i.tc)(t)&&(0,r.$G)(e)},canUserManageRoles=e=>{let t=(0,p.H7)(e);if((0,i.tc)(t))return!1;if(!(0,n.k)(e)&&(0,r.p2)(e)&&(0,s.RE)(e))return!0;let a=(0,m.tA)(e,{permission:o.p.MANAGE_ROLES});return(0,r.$G)(e)||(0,u.Jr)(a)},canUserManageRole=(e,t)=>{let a=(0,c.Lw)(e,{roleId:t});return!!a&&(a.id===d.Tl.RolesAdmin?canUserAssignRoleAdmins(e):canUserManageRoles(e))},canUserManageCustomRoles=e=>{let t=(0,m.tA)(e,{permission:o.p.MANAGE_CUSTOM_ROLES});return(0,u.Jr)(t)},canUserAccessRolesInTeamSite=e=>{let t=(0,p.H7)(e);return!(0,i.tc)(t)&&!((0,c.gr)(e).length<=0)&&((0,l.c)(e)||canUserAssignRoleAdmins(e)||canUserManageRoles(e))},canUserAccessRolesInOrgDash=e=>(0,l.W)(e)||canUserAssignRoleAdmins(e)||canUserManageRoles(e)||canUserManageCustomRoles(e)},0x23c71cb9b:(e,t,a)=>{"use strict";a.r(t),a.d(t,{AdministrationPage:()=>lY,BaseAdministrationPage:()=>BaseAdministrationPage});var n,i,l,r,o,s,c=a(0xbad225b5),d=a(0x16cf1da63),u=a(0x1d01572a2),m=a(0x40c0d834),p=a(0x20482ad21),g=a(0x24573b3ff),f=a(0x16caa8075),_=a(0xcf06bcff),h=a(0x1ea519746),b=a(0x23cb9e36f),y=a(0x348940af),A=a(0x1d104c491);let E=new p.Ay("modernselling"),ClosingSoonFlowHeader=()=>{let e=A.YB.adminClosingSoonAlert,t=(0,b.A)(e,"ADMIN_SALES_HOME_OPPORTUNITY_CLOSING_SOON"),a=(0,h.Y)(e),n=(0,c.useCallback)(async()=>t({reason:"closing-soon"}),[t]);return c.createElement(y.A,{isAdmin:!0,title:E.t("Check upcoming close dates"),imageUrl:a,onSave:n,description:E.t("Sent when the close date is approaching on an opportunity")})};ClosingSoonFlowHeader.displayName="ClosingSoonFlowHeader";var S=a(0x404d43c5),C=a(0xd0e3a30d);let v=new p.Ay("modernselling"),MissingFieldsFlowHeader=()=>{let e=A.Lb.adminMissingFields,t=(0,b.A)(e,"ADMIN_SALES_HOME_MISSING_FIELD"),a=(0,h.Y)(e),n=(0,c.useCallback)(async()=>t({reason:"missing-fields"}),[t]);return c.createElement(y.A,{isAdmin:!0,imageUrl:a,title:v.t("Add missing details"),onSave:n,description:v.t("Sent when a field is empty on an opportunity")})};MissingFieldsFlowHeader.displayName="MissingFieldsFlowHeader";var x=a(0x212a2c2d5),w=a(0x86226b0b);let O=new p.Ay("modernselling"),OutdatedFieldsFlowHeader=()=>{let e=(0,b.A)(A.YB.adminOutdatedFields,"ADMIN_SALES_HOME_OUTDATED_FIELD"),t=(0,c.useCallback)(()=>e({reason:"outdated-fields"}),[e]);return c.createElement(y.A,{isAdmin:!0,imageUrl:w,title:O.t("Review opportunities with out-of-date info"),onSave:t,description:O.rt("Sent when a field is overdue on an opportunity")})};OutdatedFieldsFlowHeader.displayName="OutdatedFieldsFlowHeader";let k=new p.Ay("modernselling"),PastCloseDateFlowHeader=()=>{let e=A.YB.adminPastCloseDateAlert,t=(0,b.A)(e,"ADMIN_SALES_HOME_OPPORTUNITY_PAST_CLOSE_DATE"),a=(0,h.Y)(e),n=(0,c.useCallback)(async()=>t({reason:"past-close-date"}),[t]);return c.createElement(y.A,{isAdmin:!0,title:k.t("Review opportunities with past close dates"),imageUrl:a,onSave:n,description:k.t("Sent when the close date is passed on an opportunity")})};PastCloseDateFlowHeader.displayName="PastCloseDateFlowHeader";var N=a(0x10b410a4d),T=a(0x1ce916d0b),I=a(0x226892387),F=a(0x1c8beab7f);let WorkflowBuilderHeader=()=>{let e=(0,I.d4)(F.uJ);return e?e===A.Lb.adminSelectNotificationType?c.createElement(T.A,{isAdmin:!0}):e===A.Lb.adminAmountChanged?c.createElement(f.A,{isAdmin:!0}):e===A.Lb.adminCloseDateChanged?c.createElement(_.A,{isAdmin:!0}):e===A.Lb.adminDealWon?c.createElement(S.A,{isAdmin:!0}):e===A.Lb.adminForecastReminder?c.createElement(C.A,{isAdmin:!0}):e===A.Lb.adminNewOpportunityAlert?c.createElement(x.A,{isAdmin:!0}):e===A.Lb.adminStageChanged?c.createElement(N.A,{isAdmin:!0}):e===A.Lb.adminMissingFields?c.createElement(MissingFieldsFlowHeader,null):e===A.Lb.adminOutdatedFields?c.createElement(OutdatedFieldsFlowHeader,null):e===A.Lb.adminClosingSoonAlert?c.createElement(ClosingSoonFlowHeader,null):e===A.Lb.adminPastCloseDateAlert?c.createElement(PastCloseDateFlowHeader,null):null:null};WorkflowBuilderHeader.displayName="WorkflowBuilderHeader";var M=a(0x4c8d8a39);let D=new p.Ay("modernselling"),AdministrationHeader=()=>(0,I.d4)(F.uJ)?c.createElement(WorkflowBuilderHeader,null):c.createElement(M.j,{className:"p-view_header",title:D.t("Sales settings"),largeTitle:!0,showDropdownMenu:!1});AdministrationHeader.displayName="AdministrationHeader";var R=a(0x11a296110),P=a(0xb1ea448c),L=a(0x99233ecb),U=a(0xb90d5858),B=a(0x2501a2cee),H=a(0x1b955e8fc),V=a(0xd896af8a),W=a(0x16b708a7f),j=a(0x52b05cae),G=a(0xa49ba833),q=a(0xa9be5cdc),Y=a.n(q);let z=new p.Ay("modernselling"),AdministrationOrgSwitcher=()=>{let e=(0,H.A)(),t=(0,d.wA)(),a=(0,I.d4)(F.Gq),n=(0,I.d4)(F.gr),i=(0,I.d4)(F.Ey),l=(0,I.d4)(F.e$),r=(0,I.d4)(F.rg),o=(0,c.useCallback)(async()=>{if(r)try{await t((0,j.b)({salesforceOrgId:r}))}catch(e){}},[t,r]);(0,c.useEffect)(()=>{o()},[o]),(0,c.useEffect)(()=>{r&&t((0,G.Y)({salesforceOrgId:r})).then(e=>{l&&t((0,W.Zz)(e))}).catch(()=>{})},[t,r,l]);let s=(0,c.useCallback)(a=>()=>{a?.salesforce_org_id?t((0,W.Ox)(a)):e(V.b.SelectSalesforceOrg)},[e,t]);return c.createElement(L.cQ,{renderMenu:(({connectedOrgs:e,handleOnSelect:t,selectedSalesforceOrgId:a})=>n=>c.createElement(L.Ay,n,e.map(e=>c.createElement(U.A,{key:e.salesforce_org_id,checked:e.salesforce_org_id===a,type:"radio",label:e.name,onSelected:t(e)})),c.createElement(c.Fragment,null,c.createElement(L.bX,null),c.createElement(U.A,{label:z.t("Add Salesforce org"),onSelected:t()}))))({connectedOrgs:n,selectedSalesforceOrgId:i?.salesforce_org_id,handleOnSelect:s}),position:"left-bottom"},c.createElement(R.Nm,{className:Y().trigger},"fetching"===a&&c.createElement(P.A,{size:"medium"}),"fetching"!==a&&c.createElement("span",{className:Y().triggerContent},c.createElement("span",{className:"overflow_ellipsis"},i?.name),c.createElement(B.Ah,{name:"caret-down",size:"20"}))))};AdministrationOrgSwitcher.displayName="AdministrationOrgSwitcher";var $=a(0x120c268ad),Q=a.n($),J=a(0x16998c9bf),K=a(0x2b7f0bcc),Z=a(0x189a28b3e);let X=new p.Ay("modernselling"),PanelHeader=({actions:e,children:t,onBack:a,className:n})=>c.createElement("div",{className:Q()(n,"display_flex justify_content_between margin_bottom_150"),"data-qa":"panel_header"},c.createElement("div",{className:"display_flex align_items_center"},a&&c.createElement(R.jV,{"aria-label":X.t("Back"),className:"margin_right_100",onClick:a},c.createElement(B.Ah,{name:"caret-left-full"})),c.createElement("h2",null,t)),e);PanelHeader.displayName="PanelHeader";let PanelSectionsContainer=({children:e,className:t,isFilled:a})=>c.createElement("div",{className:Q()(t,"p-sales_admin__panel_sections_container",{"p-sales_admin__panel_sections_container--filled":a})},e);PanelSectionsContainer.displayName="PanelSectionsContainer";let PanelSection=({className:e,isLoading:t,title:a,children:n,actions:i})=>c.createElement("div",{className:Q()("p-sales_admin__panel_section",e)},c.createElement("div",{className:"p-sales_admin__panel_section__title"},a),t?c.createElement(P.A,{className:"align_self_center margin_left_auto margin_right_auto"}):c.createElement(c.Fragment,null,c.createElement("div",{className:"p-sales_admin__panel_section__details"},n),i&&c.createElement("div",{className:"p-sales_admin__panel_section__actions"},c.createElement("div",{className:"p-sales_admin__panel_section__actions_inner"},i))));PanelSection.displayName="PanelSection";let PanelSectionPlain=({className:e,children:t,isLoading:a=!1,hasTable:n=!1})=>c.createElement("div",{className:Q()(e,n&&"p-sales_admin__panel_section--with_table","p-sales_admin__panel_section")},a?c.createElement(P.A,{className:"align_self_center margin_auto"}):t);PanelSectionPlain.displayName="PanelSectionPlain";var ee=a(0x4bdf0df6),et=a(0x205f4fb61),ea=a(0x1faa3f1ac),en=a(0x1595bdd0),ei=a(0x1407c6c2c),el=a(0x15014e268),er=a(0x1d1911997),eo=a(0x9a7ccd79),es=a(0x405dcae6),ec=a(0x1122238d8);let ed=new p.Ay("modernselling"),CelebrationConfigAdvancedOptionsField=({id:e,errors:t,fieldOptions:a,fieldSchema:n,focusOnMount:i,isAllowedOperator:l,isRemovable:r,labelText:o,onBlur:s,onChange:d,onRemove:u,value:m,isAdmin:p})=>{let g=m.semantics?.current_or_previous==="previous",f=!r,_=(0,ei.A)(),h=(0,ei.A)(),b=(0,c.useMemo)(()=>n&&es._h[n.type]?.(n,{isSemanticPrevious:g}),[n,g]),[y,A]=(0,eo.Lb)(n?.type,b,l,g),E=(0,c.useMemo)(()=>a.find(e=>{let{fieldId:t,isPrevious:a}=e.extras;return g===a&&t===m.schema_field_id}),[a,g,m.schema_field_id]),S=(0,ec.FT)(A).find(e=>e.value===m.type),C=S&&b?.[S.value],v=(0,c.useCallback)(()=>u(e),[e,u]),x=(0,c.useCallback)(()=>s(e,"field"),[e,s]),w=(0,c.useCallback)(()=>s(e,"operator"),[e,s]),O=(0,c.useCallback)(()=>s(e,"value"),[e,s]),k=(0,c.useCallback)(t=>{let{fieldId:a,isPrevious:n}=t.extras;d({id:e,schema_field_id:a,semantics:n?{type:"basic",current_or_previous:"previous",condition_or_filter:"filter"}:void 0})},[e,d]),N=(0,c.useCallback)(e=>{d({...m,type:e.value})},[d,m]),T=(0,c.useCallback)(e=>d({...m,rhs:e}),[d,m]),I=(0,c.useMemo)(()=>t?.find(e=>"value"===e.location),[t]),F=(0,c.useMemo)(()=>t?.filter(e=>"field"===e.location),[t]),M=(0,c.useMemo)(()=>t?.filter(e=>"operator"===e.location),[t]);return c.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field"},c.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field__row"},c.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field__label"},o),c.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field__controls"},c.createElement(R.Nm,{"aria-disabled":f,"aria-label":ed.t("Remove condition"),disabled:f,onClick:v},c.createElement("span",{className:f?"sk_soft_gray cursor_default":void 0},c.createElement(B.Ah,{name:"trash",size:"20"}))))),c.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field__row"},c.createElement(er.Ay,{ariaLabel:ed.t("Select an opportunity field"),errors:F,isInvalid:!!F?.length,isRequired:!0,minOptionsListWidth:200,onOptionsListClose:x,onOptionSelected:k,options:a,placeholderText:ed.t("Select field\u2026"),selectedOption:E,selectId:_,focusOnMount:i,expandOnFocus:!1,width:"auto",className:"flex_one"}),c.createElement(el.Ay,{key:`${E?.value}-${y}`,ariaLabel:ed.t("Select operator"),errors:E&&M,isRequired:!0,isDisabled:!E,onOptionsListClose:w,onOptionSelected:N,options:A,placeholderText:ed.t("Select operator\u2026"),selectedOption:S,selectId:h,width:"auto",className:"flex_one"})),n&&S&&C&&c.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field__row margin_top_25"},c.createElement(C,{id:e,error:I,operator:S.value,fieldSchema:n,onBlur:O,onChange:T,value:m,isAdmin:p})))};CelebrationConfigAdvancedOptionsField.displayName="CelebrationConfigAdvancedOptionsField";var eu=a(0x237e57f1d),em=a(0x98161168),ep=a(0x1655dc9c9);let eg=new p.Ay("modernselling"),CelebrationConfigAdvancedOptionsFields=({errors:e,hasFocusOnMount:t=!1,onChange:a,setErrors:n,advancedOptions:i,opportunitySchema:l,maxAllowedConditions:r=7})=>{let o=(0,c.useRef)(i),s=(0,c.useRef)(e||null),{fieldOptions:d,fieldSchemaById:u,defaultCondition:m}=(0,eu.K)({opportunitySchema:l,shouldDefaultToBlankOptions:!0});(0,c.useEffect)(()=>{o.current=i,s.current=e||null});let p=(0,c.useCallback)(e=>{let t=s.current?.filter(t=>t.id!==e)||null;t?.length!==s.current?.length&&(s.current=t,n(s.current))},[n]),g=(0,c.useCallback)(e=>{a({...o.current,[e]:null}),p(e)},[a,p]),f=(0,c.useCallback)((e,t)=>{let a=o.current?.[e];if(!a)return;let i=s.current||[],l=(0,es.K5)(a,[t])||[],r=i.filter(a=>a.id!==e||a.id===e&&a.location!==t);if(l.length||r.length!==i.length){let e=[...r,...l];s.current=e.length?e:null,n(s.current)}},[n]),_=(0,c.useCallback)(e=>{let{id:t}=e;if(!o.current?.[t])return;let n=e.schema_field_id,i=n?u[n]:null,l=(0,em.kp)(i,e);o.current={...o.current,[t]:l},a(o.current),p(t)},[a,p,u]),h=(0,c.useMemo)(()=>(0,en.A)(Object.values(i||{})),[i]),b=(0,c.useCallback)((e,t,n=!1)=>{let i=t||[(0,em.Gv)()],l={...o.current};i.forEach(e=>{l[e.id]=e}),a(l,n)},[a]);(0,c.useEffect)(()=>{h.length||b(null,m,!0)},[h.length,m,b]);let y=h.length?h:m;return c.createElement(ep.v,{isWrapping:!0},y.map((a,n)=>{let{schema_field_id:i}=a;return c.createElement(CelebrationConfigAdvancedOptionsField,{id:a.id,key:a.id,errors:e?.filter(e=>e.id===a.id),fieldOptions:d,fieldSchema:null!=i?u[i]:void 0,focusOnMount:t&&n===y.length-1,isRemovable:y.length>1||!!y[0].schema_field_id,labelText:eg.t("And"),onBlur:f,onChange:_,onRemove:g,value:a,isAdmin:!0})}),c.createElement(R.Ay,{size:"small",type:"outline",disabled:y.length>=r,onClick:b},eg.t("Add Condition")))};CelebrationConfigAdvancedOptionsFields.displayName="CelebrationConfigAdvancedOptionsFields";let ef=new p.Ay("modernselling"),CelebrationConfigAdvancedOptions=({errors:e,onChange:t,setErrors:a,isLoading:n,hasFocusOnMount:i,advancedOptions:l,opportunitySchema:r})=>c.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options"},c.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__header"},c.createElement("div",{className:"bold"},ef.t("Advanced conditions"))),c.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__content"},n&&c.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__spinner"},c.createElement(P.A,null)),!n&&r&&c.createElement(CelebrationConfigAdvancedOptionsFields,{hasFocusOnMount:i,onChange:t,setErrors:a,advancedOptions:l,opportunitySchema:r,errors:e})));CelebrationConfigAdvancedOptions.displayName="CelebrationConfigAdvancedOptions";let e_=new p.Ay("modernselling"),CelebrationConfigAdvancedConditions=({advancedOptions:e,advancedOptionsErrors:t,advancedOptionsLoadError:a,className:n,isAdvancedOptionsOpenOnMount:i=!1,isLoading:l,onAdvancedOptionsChange:r,opportunitySchema:o,refetchOpportunitySchema:s,setAdvancedOptionsFieldErrors:d})=>{let[u,m]=(0,c.useState)(i),[p,g]=(0,c.useState)(!1);(0,c.useEffect)(()=>{p||(i||r(null),m(i))},[i,p,r]);let f=(0,c.useCallback)(()=>{m(!0),g(!0)},[]),_=(0,c.useCallback)((e,t)=>{r(e),t||g(!0)},[r]);return u?!a&&(l||o)?c.createElement(CelebrationConfigAdvancedOptions,{errors:t,advancedOptions:e,isLoading:l,onChange:_,opportunitySchema:o,setErrors:d,hasFocusOnMount:!i}):c.createElement("div",{className:n},c.createElement(K.Ay,{type:"boxed",level:"warning"},e_.t("There was a problem loading advanced conditions.")," ",c.createElement(R.jV,{onClick:s},e_.t("Try again?")))):c.createElement("div",{className:n},c.createElement(ea.A,{className:"p-sales_notifications__workflow__form__field",onClick:f},c.createElement(B.Ah,{size:"18",name:"settings",inline:!0}),c.createElement("span",{className:"margin_left_25"},e_.t("Use advanced conditions"))))};CelebrationConfigAdvancedConditions.displayName="CelebrationConfigAdvancedConditions";var eh=a(0x45bd075),eb=a(0x1d2cd7755);let CelebrationConfigCheckbox=({name:e,label:t,classname:a,isChecked:n,onChange:i})=>{let l=(0,c.useCallback)(e=>{i(e.target.checked)},[i]);return c.createElement(eb.A,{text:t,className:a,type:"inline",cursor:"pointer"},c.createElement(eh.A,{name:e,checked:n,onChange:l}))};CelebrationConfigCheckbox.displayName="CelebrationConfigCheckbox";let ey=new p.Ay("modernselling");var eA=((n=eA||{}).ACOUNT_NAME="displayOpportunityAccountName",n.AMOUNT="displayOpportunityAmount",n.CLOSE_DATE="displayOpportunityCloseDate",n);let eE={displayOpportunityAccountName:!1,displayOpportunityAmount:!1,displayOpportunityCloseDate:!1},CelebrationConfigFormInclude=({values:e,handleChange:t})=>{let a=(0,c.useCallback)(a=>n=>{let i={...e||eE};i[a]=!!n,t("dealWinCelebrationMessageFields")(i)},[t,e]);return c.createElement(c.Fragment,null,c.createElement(CelebrationConfigCheckbox,{label:ey.t("Account name"),isChecked:e?.displayOpportunityAccountName,classname:"margin_bottom_75",name:"accountName",onChange:a("displayOpportunityAccountName")}),c.createElement(CelebrationConfigCheckbox,{label:ey.t("Deal amount"),isChecked:e?.displayOpportunityAmount,classname:"margin_bottom_75",name:"dealAmount",onChange:a("displayOpportunityAmount")}),c.createElement(CelebrationConfigCheckbox,{label:ey.t("Close date"),isChecked:e?.displayOpportunityCloseDate,classname:"margin_bottom_75",name:"closeDate",onChange:a("displayOpportunityCloseDate")}))};CelebrationConfigFormInclude.displayName="CelebrationConfigFormInclude";var eS=a(0x1e217163d),eC=a(0x3b556df0),ev=a(0x2b3a07cf),ex=a(0x15038689e),ew=a(0x1c3fd5e76),eO=a(0x124d99cb0),ek=a(0x1b9d5cc0c),eN=a(0xe684f705);let eT=new p.Ay("modernselling"),CelebrationConfigForm=({isLoading:e,sectionClassname:t,opportunitySchema:a,refetchOpportunitySchema:n,opportunitySchemaLoadError:i})=>{let l=A.YB.adminDealWinCelebration,r=(0,I.d4)(eN.cA),o=(0,c.useMemo)(()=>{let e=(0,eO.rJ)(r,"iso"),t=(0,ek.et)(r)??ee.vp;return{isRecurring:!1,frequency:A.Ns.weekly,startTime:e,timezone:t}},[r]),s=(0,I.d4)(F.Tt),d=(0,c.useMemo)(()=>s?(0,eC.AN)(s,!0,o):{...{account:null,advancedOptions:null,amount:(0,et.ZV)(0),channelId:null,opportunity:null,scope:A.QO.All,sendTo:A.Oz.Profile,stage:null,title:"Deal Win Celebration",stageChangedStages:null,canvasTemplateId:null,includeMessageAddOn:!1,buttonText:"",isMutingDisabled:!1,dealWinCelebrationMessageFields:eE},...o,type:A.g$.AdminOpportunityChanged,recipientType:A._Y.Owner,recipientRoles:null,recipientUsers:null},[s,o]),{values:u,errors:m,handleBlur:p,handleChange:g,setFieldErrors:f}=(0,ev.A)({workflowView:l,initialValues:d}),_=!!(s?.condition?.advanced_conditions?.length||s?.acn?.advanced_conditions?.length),h=eT.t("Visible to everyone in your organization, including guests, but not to Slack Connect users."),b=(0,I.d4)(e=>(0,F.C1)(e,l));return b?.dealWinCelebrationMessageFields?c.createElement(c.Fragment,null,c.createElement("div",{className:t},c.createElement(eS.B,{grow:"1",space:"50"},c.createElement("span",{className:"bold margin_bottom_75"},eT.t("Include")),c.createElement(CelebrationConfigFormInclude,{values:u.dealWinCelebrationMessageFields,handleChange:g}),c.createElement("span",{className:"caption sk_foreground_max"},h))),c.createElement("div",{className:t},c.createElement(eS.B,{grow:"1",space:"0"},c.createElement("span",{className:"bold margin_bottom_75"},eT.t("Apply to")),c.createElement(ew.A,{className:"margin_bottom_75",value:u.stage,errors:m.stage,isLoading:e,onBlur:p("stage"),onChange:g("stage"),opportunitySchema:a,isAdmin:!0}),c.createElement(ex.A,{className:"margin_bottom_75",value:u.amount,onChange:g("amount"),onBlur:p("amount")}),c.createElement(CelebrationConfigAdvancedConditions,{advancedOptions:u.advancedOptions,advancedOptionsErrors:m.advancedOptions,advancedOptionsLoadError:i,isLoading:e,onAdvancedOptionsChange:g("advancedOptions",!1),opportunitySchema:a,refetchOpportunitySchema:n,setAdvancedOptionsFieldErrors:f("advancedOptions"),isAdvancedOptionsOpenOnMount:_})))):null};CelebrationConfigForm.displayName="CelebrationConfigForm";var eI=a(0x344bb842),eF=a(0x1fdec3e16),eM=a(0x36d9f560),eD=a(0x1282104f7);let eR=a.p+"celebration-profile-preview-avatar-db8e48d.png",eP=new p.Ay("modernselling"),CelebrationProfilePreview=({shouldDisplayAccountName:e,shouldDisplayAmount:t,shouldDisplayCloseDate:a})=>{let n=(0,et.ZV)(6500),i=[e?eP.t("Acme Inc."):null,t?eP.t("$ {amount} USD",{amount:n}):null,a?eP.t("Jun 4"):null].filter(Boolean).join(", "),l=eP.t("Profile photo for {memberName}",{memberName:"Zoe Maxwell",__react:!0}),r=eP.t("Deal Won");return c.createElement(c.Fragment,null,c.createElement("span",{className:"caption bold padding_top_50 padding_bottom_50 padding_left_100 padding_right_100"},eP.t("Profile preview")),c.createElement("div",{className:"p-r_member_profile__avatar__celebration_wrapper"},c.createElement("div",{className:"p-r_member_profile__avatar__sales_container"},c.createElement("div",{className:"p-r_member_profile__avatar__celebration_text_content p-r_member_profile__avatar__celebration_text_content__sales"},c.createElement("div",{className:"p-r_member_profile__avatar__celebration_title padding_top_100"},c.createElement(eF.A,{lines:1,withTooltip:!0},eP.t("Gong! Another win."))),c.createElement("div",{className:"p-r_member_profile__avatar__anniversary_subtitle"},i)),c.createElement("div",null,c.createElement("div",null,c.createElement("div",{className:"p-r_member_profile__avatar_content"},c.createElement("div",{className:"p-r_member_profile__avatar__img_container"},c.createElement("img",{src:eR,alt:l,className:"p-r_member_profile__avatar__img"}))))))),c.createElement("div",{className:Q()("p-r_member_profile_section","p-r_member_profile_section__sales_preview")},c.createElement("div",{className:"p-r_member_profile_section_content"},c.createElement("div",{className:"p-r_member_profile__name margin_top_100"},c.createElement("span",{className:"p-r_member_profile__name__text"},"Zoe Maxwell"),c.createElement("div",{className:"margin_left_25"},c.createElement(eI.A,{"aria-label":"",disabled:!0,"aria-disabled":!0,svgIconProps:{name:"sound-medium"}}))),c.createElement("div",{className:"p-r_member_profile__subtitle"},eP.t("Account Executive")),c.createElement("div",{className:"margin_top_50 margin_bottom_50"},c.createElement("div",{className:"display_flex"},c.createElement(eD.A,{size:"small",label:`${r} \u{1F4B0}`,className:Q()("p-user_profile_tags_element_token"),contentInnerClassName:"cursor_default"}))),c.createElement("div",{className:"margin_bottom_50"},c.createElement(eM.Ay,{isActive:!0,inline:!0,userType:"member",isDnd:!1,isSlackbot:!1,isSelf:!1,showText:!0})),c.createElement("div",{className:"margin_bottom_50"},c.createElement("span",{className:"display_flex align_items_center"},c.createElement("span",{className:"margin_right_50"},c.createElement(B.Ah,{name:"emoji-travel",size:"20"})),c.createElement("span",null,eP.t("Traveling this week in Asia")))),c.createElement("div",{className:"margin_bottom_50"},c.createElement("span",{className:"display_flex align_items_center"},c.createElement("span",{className:"margin_right_50"},c.createElement(B.Ah,{name:"clock",size:"20"})),c.createElement("span",null,eP.t("11:23 AM (tomorrow) local time")))))))};CelebrationProfilePreview.displayName="CelebrationProfilePreview";var eL=a(0x173712bc0),eU=a(0x3711e82d);let eB={elementName:"toggle",onChange:{enableClogAction:!0,setElementValueOnAction:!0}};function useCelebrationClogProps(){let e=A.YB.adminDealWinCelebration,t=(0,I.d4)(t=>(0,F.C1)(t,e)),a=(0,I.d4)(e=>(0,F.DY)(e,!0)),n=(0,eL.A)(!0);return(0,c.useMemo)(()=>{let e={workflowId:a||void 0,dealWinStage:t?.stage?.label||void 0,dealWinHasAdvancedConditions:!!t?.advancedOptions,dealWinAccountNameIncluded:!!t?.dealWinCelebrationMessageFields?.displayOpportunityAccountName,dealWinDealAmountIncluded:!!t?.dealWinCelebrationMessageFields?.displayOpportunityAmount,dealWinCloseDateIncluded:!!t?.dealWinCelebrationMessageFields?.displayOpportunityCloseDate},i=a?e:{};return{saveButtonAutoClogProps:{elementName:"save",action:n?eU.UiAction.UPDATE:eU.UiAction.ADD,onClick:{enableClogAction:!0},...e},toggleAutoClogProps:{...eB,...i}}},[n,a,t?.advancedOptions,t?.dealWinCelebrationMessageFields?.displayOpportunityAccountName,t?.dealWinCelebrationMessageFields?.displayOpportunityAmount,t?.dealWinCelebrationMessageFields?.displayOpportunityCloseDate,t?.stage?.label])}var eH=a(0x6e87d4ec),eV=a(0x16ffed5ab);let eW=new p.Ay("modernselling");var ej=((i={}).Success="success",i.Error="error",i);function useDisplayCelebrationStatusToast(){let e=(0,d.wA)(),t=(0,c.useMemo)(()=>({success:eW.t("Celebration setting saved."),error:eW.t("Something went wrong saving your changes. Please try again.")}),[]);return(0,c.useCallback)(a=>{e((0,eV.M)({element:c.createElement(eH.A,null,t[a])}))},[e,t])}useDisplayCelebrationStatusToast.displayName="useDisplayCelebrationStatusToast";var eG=a(0xd2ed875e);function useDeleteCelebration(){let e=(0,d.wA)(),t=(0,I.d4)(e=>(0,F.DY)(e,!0)),a=(0,I.d4)(F.rg),n=useDisplayCelebrationStatusToast(),i=(0,I.d4)(F.Ik);return(0,c.useCallback)(async()=>{if(i||t)try{if(!a)throw Error("Unable to fetch Salesforce org ID");let i=null;if(t&&(i=await e((0,eG.a)({workflowId:t,reason:"delete-celebration-function"}))),!i?.ok)throw Error("Unable to delete workflow");n(ej.Success),e((0,W.kC)(null)),e((0,W.a2)({workflowView:A.YB.adminDealWinCelebration,values:null,errors:null,formSubmitError:null}))}catch{throw n(ej.Error),Error("Unable to delete workflow")}},[i,t,a,e,n])}var eq=a(0x4dfa0edd),eY=a(0x62accd6b),ez=a(0x75bda81e),e$=a(0x10d5ee185);let eQ=A.YB.adminDealWinCelebration;function useSaveCelebration(){let e=(0,d.wA)(),t=(0,eY.Ht)(eQ),a=(0,eq.Ay)(eQ,t,!0),n=(0,I.d4)(e=>(0,F.DY)(e,!0)),i=(0,I.d4)(F.rg),l=useDisplayCelebrationStatusToast();return(0,c.useCallback)(async()=>{try{if(!i)throw Error("Unable to fetch Salesforce org ID");e((0,W.a2)({workflowView:A.YB.adminDealWinCelebration,formSubmitError:null}));let t=a();if(!t)throw Error("Invalid workflow type. Missing payload.");n?await e((0,ez.m)({workflowId:n,reason:"save-celebration",payload:t})):await e((0,e$._)({templateId:"ADMIN_SALES_HOME_DEAL_WIN_CELEBRATION",reason:"save-celebration",payload:t,salesforceOrgId:i})),l(ej.Success)}catch{throw l(ej.Error),Error("Unable to save or update workflow")}},[i,e,a,n,l])}var eJ=a(0x3ebf4390),eK=a(0x91728dda),eZ=a(0xe874a88a),eX=a(0x22a29f141),e0=a(0x1dfdeb1c8),e1=a(0x1ec68d6a3),e2=a(0xe747dd27);let e4=(0,e0.A)("salesHome.dealWinCelebrations.get generated fetcher",(e,t,a)=>new eZ.S((n,i)=>{let{abortSignal:l,reason:r,...o}=a,s=(0,e2.VA)(o);e((0,eX.apiCall)({method:"salesHome.dealWinCelebrations.get",args:s,abortSignal:l,reason:r})).then(e=>{n(e)}).catch(e=>{(0,e1.Ay)({getState:t}).error(`API call to salesHome.dealWinCelebrations.get with reason ${r} failed, initiated by generated fetcher`),i(e)})}));e4.meta={name:"salesHomeDealWinCelebrationsGetFetcher",key:"createFetcherSalesHomeDealWinCelebrationsGetFetcher",description:"salesHome.dealWinCelebrations.get generated fetcher"};var e5=a(0x11c82607b);let e8=(0,e5.Ay)("Fetches data for existing celebration workflow",async(e,t,{reason:a="modern-selling-celebration-config",salesforceOrgId:n})=>{if(!n)return;let{has_deal_win_celebration_enabled:i,workflow_id:l,is_field_mapping_updated:r,payload:o}=await e(e4({salesforceOrgId:n,reason:a}));e((0,W.OU)(i||!1)),e((0,W.Q6)(r||!1)),e(i&&l&&o?(0,W.Zy)({workflowId:l,payload:o,salesforceOrgId:n}):(0,W.Zy)(null))});e8.meta={name:"openEditCelebrationConfig",key:"createThunkOpenEditCelebrationConfig",description:"Fetches data for existing celebration workflow"};var e7=a(0x11d9e4b2f);function useCelebrationConfigFormState(){let e=(0,d.wA)(),t=(0,I.d4)(eK.Jx),a=(0,I.d4)(eK.V$),n=A.YB.adminDealWinCelebration,i=(0,I.d4)(e=>(0,F.C1)(e,n)),l=(0,I.d4)(F.Ey),[r,o]=(0,c.useState)(!0),[s,u]=(0,c.useState)(!1),m=(0,I.d4)(F.Ik),[p,g]=(0,c.useState)(!1),[f,_]=(0,c.useState)(!1),h=useSaveCelebration(),b=useDeleteCelebration();(0,c.useEffect)(()=>{e((0,W.JH)()),o(!0),e(e8({salesforceOrgId:l?.salesforce_org_id})).finally(()=>{o(!1)})},[e,l?.salesforce_org_id]),(0,c.useEffect)(()=>{g(m),_(!m)},[m]),(0,c.useEffect)(()=>{f&&(0,eJ.cB)(n,i,{experimentLobOrg62UnrestrictedGroupOn:t,experimentLobChannelAcnTokenGroupOn:a}).ok&&_(!1)},[f,n,i,t,a]);let y=(0,c.useCallback)(async()=>{if(p){let{ok:t}=e((0,e7.A)({workflowView:n}));if(!t)return void _(!0);u(!0);try{await h(),e(e8({salesforceOrgId:l?.salesforce_org_id}))}catch(e){}u(!1)}},[e,p,h,l?.salesforce_org_id,n]),E=(0,c.useCallback)(async()=>{let e=!p;if(g(e),e)_(!1);else{u(!0);try{await b(),_(!0)}catch(t){g(!e),_(!1)}u(!1)}},[b,p]);return(0,c.useMemo)(()=>({isConfigLoading:r,isSubmitting:s,isToggleOn:p,isSaveDisabled:f,saveHandler:y,toggleHandler:E,dealWinFields:i?.dealWinCelebrationMessageFields}),[r,f,s,p,y,E,i?.dealWinCelebrationMessageFields])}var e6=a(0x3bf6c48),e3=a(0x5f3ea964),e9=a.n(e3);let te=new p.Ay("modernselling"),CelebrationPanel=()=>{let e=(0,e6.E)({isAdmin:!0}),[t,a]=(0,c.useState)(null),[n,i]=(0,c.useState)(null),[l,r]=(0,c.useState)(!0),o=(0,I.d4)(F.c),{isConfigLoading:s,isSubmitting:d,isToggleOn:u,isSaveDisabled:p,saveHandler:g,toggleHandler:f,dealWinFields:_}=useCelebrationConfigFormState(),{saveButtonAutoClogProps:h,toggleAutoClogProps:b}=useCelebrationClogProps(),y=(0,c.useCallback)(async()=>{r(!0),a(null),i(null);try{let t=await e();i(t)}catch(e){a((0,J.iT)(e))}finally{r(!1)}},[e,r]);(0,c.useEffect)(()=>{y()},[y]);let A=(0,c.useMemo)(()=>c.createElement(R.lV,{autoClogProps:h,type:"primary",size:"medium",loading:d,onClick:g,disabled:p,"aria-label":te.t("Save")},te.t("Save")),[p,d,h,g]),E=te.t("Show deal won celebration"),S=te.t("Show a celebratory message to user profiles when they close an opportunity and it is a win.");return c.createElement(m.A,{clogImpression:!0,eventId:eU.EventId.LOB_SALES_HOME,uiComponentName:eU.UiComponentName.DEAL_WIN_CELEBRATION},c.createElement(PanelHeader,{actions:A},te.t("Celebration")),o&&c.createElement("div",{className:"margin_bottom_75"},c.createElement(K.Ay,{type:"boxed",level:"warning"},te.t("Opportunity field mapping updated. Please reconfigure the deal won celebration."))),c.createElement(PanelSectionsContainer,{className:Q()(e9().panelSectionContainer)},l||s?c.createElement(P.A,{className:"align_self_center margin_left_auto margin_right_auto margin_top_250 margin_bottom_250"}):c.createElement("div",{className:"display_flex flex_direction_row flex_one"},c.createElement("div",{className:e9().panelContent},c.createElement("div",{className:e9().panelSection},c.createElement(eS.B,{grow:"1",space:"0"},c.createElement("div",{className:e9().toggleContainer},c.createElement("span",{className:"bold"},E),c.createElement(Z.A,{ariaLabel:u?te.t("On"):te.t("Off"),id:"enable_sales_elevate_admin_slack_connect_channels_toggle",isDisabled:l||s,isToggled:u,onChange:f,autoClogProps:b})),c.createElement("span",{className:"caption sk_foreground_max margin_right_400"},S))),u?c.createElement(CelebrationConfigForm,{isLoading:l,opportunitySchema:n,sectionClassname:e9().panelSection,refetchOpportunitySchema:y,opportunitySchemaLoadError:t}):null),c.createElement("div",{className:Q()("display_flex","flex_direction_column",e9().profilePreviewContainer)},c.createElement(CelebrationProfilePreview,{shouldDisplayAccountName:!!_?.displayOpportunityAccountName,shouldDisplayAmount:!!_?.displayOpportunityAmount,shouldDisplayCloseDate:!!_?.displayOpportunityCloseDate})))))};CelebrationPanel.displayName="CelebrationPanel";var tt=a(0x214e51545),ta=a(0x2037c754f);function usePollDatasourceSynced(){let e=(0,d.wA)(),t=(0,c.useRef)({datasourceId:null,timerId:null}),[a,n]=(0,c.useState)(!1),i=(0,c.useCallback)(async a=>{t.current.timerId=setTimeout(async()=>{if(a===t.current.datasourceId)try{let t=await e((0,ta.E)({datasourceId:a}));t?.isConnected&&i(a)}catch{t.current.datasourceId=null,t.current.timerId=null,n(!0)}},5e3)},[e]),l=(0,c.useCallback)(()=>{null!==t.current.timerId&&clearTimeout(t.current.timerId),t.current.datasourceId=null,t.current.timerId=null},[]),r=(0,c.useCallback)(e=>{l(),n(!1),t.current.datasourceId=e,i(e)},[i,l]);return(0,c.useEffect)(()=>()=>l(),[l]),{hasPollError:a,startPoll:r,stopPoll:l}}var tn=a(0x660eec6f),ti=a(0x46dbff89),tl=a(0x20fb5e2f6);let tr=new p.Ay("modernselling"),ConnectSection=({canDisconnectOrg:e,datasourceInfo:t,isLoading:a,shouldShowLegacyControls:n,startPollingDatasourceInfo:i})=>{let{isConnected:l,isSynced:r,isDisconnected:o,isDeleted:s,isProblem:u,isSandbox:m,external_user_id:p,id:g}=t||{},f=(0,H.A)(),_=(0,d.wA)(),h=(0,c.useCallback)(()=>{f(V.b.WarnSwitchSource)},[f]),b=(0,c.useCallback)(()=>{_((0,tl.A)())},[_]),y=(0,c.useCallback)(e=>c.createElement(L.Ay,e,c.createElement(U.A,{onSelected:b,showLinkIndicatorIcon:!0},tr.t("Manage integrations")),c.createElement(U.A,{onSelected:h,danger:!0},tr.t("Switch integrations"))),[b,h]),A=(0,c.useCallback)(e=>()=>{i(e)},[i]),E=(0,c.useCallback)(e=>()=>{_((0,ti.q)({element:c.createElement(tn.p,{dataSourceId:e,onSuccess:A(e)})}))},[_,A]);return c.createElement(PanelSection,{isLoading:a,title:tr.t("Integration"),actions:c.createElement(c.Fragment,null,e&&u&&c.createElement(R.Ay,{onClick:b,size:"small"},tr.t("Manage Integrations"),c.createElement("span",{className:"margin_left_50"},c.createElement(B.Ah,{name:"new-window",size:"20"}))),e&&c.createElement(L.cQ,{position:"bottom-right",renderMenu:y},c.createElement(eI.A,{"aria-label":tr.t("Actions"),svgIconProps:{name:"ellipsis-vertical-filled"}})),!n&&g&&(r||u)&&c.createElement(R.Ay,{onClick:E(g),size:"small",type:"outline"},tr.t("Sync")))},c.createElement("div",{className:Q()("p-sales_admin__connect_section__status",{"p-sales_admin__connect_section__status--connected":l,"p-sales_admin__connect_section__status--synced":r,"p-sales_admin__connect_section__status--error":o||s||u})},l&&tr.t("Sync in progress"),r&&tr.t("Connected"),o&&tr.t("Disconnected"),s&&tr.t("Deleted"),u&&tr.t("Error")),l&&c.createElement(K.Ay,{level:"info",className:"margin_top_25 margin_bottom_25"},tr.t("Check back in a few minutes when the sync is complete to continue setup.")),c.createElement("div",{className:"p-sales_admin__connect_section__name"},m?tr.t("Salesforce Sandbox"):tr.t("Salesforce Production")),!n&&p&&c.createElement("div",{className:"p-sales_admin__opportunity_section__details"},p))};ConnectSection.displayName="ConnectSection";var to=a(0x1aa0ab2cd),ts=a(0x12e380801),tc=a(0x200c38ed8),td=a(0xe4dce26f);let tu=new p.Ay("modernselling"),OpportunitySection=({datasourceInfo:e,isLoading:t,setError:a})=>{let n=(0,d.wA)(),i=(0,tc.aV)(),l=(0,H.A)(),[r,o]=(0,c.useState)(!1),s=(0,I.d4)(F.e$),u=(0,ts.d)(),m=(0,to.i)(),p=(0,c.useCallback)(()=>{l(V.b.MapFields,{selectedSalesforceOrgDatasourceId:s})},[l,s]),g=(0,c.useCallback)(()=>{o(!0),a(null),n((0,td.N)({reason:"modern-selling"})).then(({workflows:e})=>{e.length>0?l(V.b.WarnRemapFields,{numWorkflows:e.length,selectedSalesforceOrgDatasourceId:s}):l(V.b.MapFields,{selectedSalesforceOrgDatasourceId:s})}).catch(()=>{a(V.B.OpenFieldMappings)}).finally(()=>{o(!1)})},[l,n,a,s]),f=i?.source,_=f?.sfdc_object_label||f?.sfdc_object_identifier,h=i?.field_mappings,{isConnected:b,isSynced:y}=e||{},A=(h?.length||0)>0;return c.createElement(PanelSection,{isLoading:t,title:tu.t("Opportunity object"),actions:c.createElement(c.Fragment,null,b&&c.createElement(R.Ay,{size:"small",disabled:!0},tu.t("Sync In Progress")),y&&!A&&c.createElement(R.Ay,{size:"small",type:"primary",onClick:p},tu.t("Map Fields")),y&&A&&c.createElement(R.lV,{loading:r,size:"small",type:"outline",onClick:g,"aria-label":tu.t("Edit")},tu.t("Edit")))},c.createElement("div",{className:"p-sales_admin__opportunity_section__name"},y&&A?_:tu.t("Not mapped")),c.createElement("div",{className:"p-sales_admin__opportunity_section__details"},b&&tu.t("Waiting for datasource sync to complete"),y&&!A&&tu.t("Ready to map your opportunity fields"),y&&A&&tu.t("{count, plural, =1 {# field} other {# fields}} mapped",{count:h?.length})),y&&u&&c.createElement("div",{className:"p-sales_admin__opportunity_section__setup_prompt"},c.createElement(K.Ay,{type:"boxed",level:"warning",align:"left"},c.createElement("span",null,tu.rt("Additional stage value required to enable new notifications Set up",void 0,({text:e})=>c.createElement(ea.A,{onClick:m},e))))))};OpportunitySection.displayName="OpportunitySection";var tm=a(0xd6ba6894);function getUrlDomain(e){let t=tm.J.document.createElement("a");return t.setAttribute("href",e),t.hostname}var tp=a(0x24169e055),tg=a(0x783a2e96),tf=a(0x609b6779),t_=a(0x24beb32cf),th=a(0x1cfd855a2),tb=a(0x23b952b9a);let ty=(0,e5.Ay)("Sends a request to disconnect a Salesforce organisation",async(e,t,a)=>{try{if(e((0,W.hz)("fetching")),!(await e((0,tp.O)({salesforceOrgId:a,reason:"modern-selling"}))).ok)throw Error(V.B.DisconnectOrg);await Promise.all([e((0,tg._)()),e((0,tf.S)({forceFetch:!0,reason:"disconnect-admin-org"}))]),e((0,t_.Hg)(a)),e((0,tb._)(a)),e((0,th.GQ)(a));let n=(0,F.gr)(t()),i=0===n.length;e(i?(0,W.bD)():(0,W.Ox)(n[0])),e((0,W.hz)("success"))}catch{e((0,W.fv)(V.B.DisconnectOrg))}return null});ty.meta={name:"disconnectOrg",key:"createThunkDisconnectOrg",description:"Sends a request to disconnect a Salesforce organisation"};var tA=a(0x192df3d34);let tE=new p.Ay("modernselling"),OrganizationSection=({isLoading:e,shouldShowLegacyControls:t,canDisconnectOrg:a})=>{let n=(0,d.wA)(),i=(0,I.d4)(F.Ey),l=(0,I.d4)(F.Lz),r=(0,c.useCallback)(async e=>{e&&await n(ty(e))},[n]),o=getUrlDomain(i?.instance_url||""),s=i?.name,u=tE.t("Disconnect {orgName} from Sales",{orgName:s||""}),m=tE.t("Actions"),p=(0,c.useCallback)(()=>{let e=c.createElement(c.Fragment,null,c.createElement("p",null,tE.rt("Everyone using the Sales tab will be disconnected from {orgName} and all notifications based on that org will stop.",{orgName:s})),c.createElement("p",null,tE.t("If you reconnect this Salesforce organization, a Sales Admin will need to re-map the opportunity object and everyone will need to recreate notifications.")));n((0,tA.A)({disconnectOrgId:i?.salesforce_org_id||"",isDisconnecting:"fetching"===l,handleDisconnect:r,children:e}))},[l,n,r,s,i?.salesforce_org_id]),g=(0,c.useCallback)(e=>c.createElement(L.Ay,e,c.createElement(U.A,{danger:!0,onSelected:p},u)),[u,p]);return c.createElement(PanelSection,{isLoading:e,title:tE.t("Salesforce organization"),actions:c.createElement(c.Fragment,null,a&&c.createElement(L.cQ,{position:"bottom-right",renderMenu:g},c.createElement(eI.A,{"aria-label":m,svgIconProps:{name:"ellipsis-vertical-filled"}})))},c.createElement("div",{className:"p-sales_admin__organization_section__name"},s),c.createElement("div",{className:"p-sales_admin__organization_section__domain"},o),t&&c.createElement("div",{className:"p-sales_admin__organization_section__info"},tE.t("People will need to individually log in to this organization from Slack.")))};OrganizationSection.displayName="OrganizationSection";var tS=a(0x2209fd06a),tC=a(0x1fcbb004d);let tv=new p.Ay("modernselling"),ConnectionPanel=()=>{let e=(0,d.wA)(),{hasPollError:t,startPoll:a,stopPoll:n}=usePollDatasourceSynced(),i=(0,I.wz)(F.Lm),[l,r]=(0,c.useState)(!1),[o,s]=(0,c.useState)(null),u=o===V.B.FetchDatasourceInfo,m=(0,I.d4)(F.P_),p=(0,I.d4)(F.Ey),g=p?.datasource_id,f=(0,c.useCallback)(t=>{n(),s(null),r(!0),e((0,ta.E)({datasourceId:t})).then(e=>{e?.isConnected&&a(t)}).catch(()=>{s(V.B.FetchDatasourceInfo)}).finally(()=>{r(!1)})},[e,a,n]);(0,c.useEffect)(()=>{g&&f(g)},[g,f]),(0,c.useEffect)(()=>{t&&(s(V.B.FetchDatasourceInfo),e((0,tC.O)()))},[t,e]),(0,c.useEffect)(()=>{i?.isProblem?s(V.B.DatasourceStatusProblem):s(null)},[i?.isProblem]);let _=(0,c.useMemo)(()=>({datasourceInfo:i,isLoading:l,setError:s}),[i,l]),h=(0,I.d4)(tS.oM),b=(0,I.d4)(tS.Ak),y=o||m,A=!!p?.is_legacy_elevate_org,E=A&&(h||b);return c.createElement(c.Fragment,null,c.createElement(PanelHeader,null,tv.t("Salesforce")),y&&c.createElement(tt.F,{className:"margin_bottom_150",errorType:y}),!u&&c.createElement(PanelSectionsContainer,null,c.createElement(OrganizationSection,{isLoading:_.isLoading,shouldShowLegacyControls:A,canDisconnectOrg:E}),c.createElement(ConnectSection,{canDisconnectOrg:E,datasourceInfo:_.datasourceInfo,isLoading:_.isLoading,shouldShowLegacyControls:A,startPollingDatasourceInfo:f}),c.createElement(OpportunitySection,{datasourceInfo:_.datasourceInfo,isLoading:_.isLoading,setError:_.setError})))};ConnectionPanel.displayName="ConnectionPanel";var tx=a(0x20e77676b);let tw=a.p+"sf-connect-2b8d73b.svg",tO=new p.Ay("modernselling"),getLearnMoreLink=({text:e})=>c.createElement(tx.A,{articleId:0x10f257451013},e);getLearnMoreLink.displayName="getLearnMoreLink";let NoConnection=()=>{let e=(0,I.d4)(F.Om),t=(0,H.A)(),a=(0,c.useCallback)(()=>{t(V.b.SelectSalesforceOrg)},[t]);return c.createElement("div",{className:"p-sales_admin__no_connection"},c.createElement(eS.B,{space:"150"},c.createElement("img",{alt:tO.t("Connect to Salesforce"),src:tw}),c.createElement(eS.B,{space:"100"},c.createElement("h2",{className:"p-sales_admin__no_connection__header"},tO.t("Bring Salesforce data into Slack")),c.createElement("p",{className:Q()("p-sales_admin__no_connection__body-text","align_center")},tO.t("Connect to Salesforce so your team can view, edit and get notified about Salesforce opportunities \u2014 right in Slack. To get started, add a Salesforce Org.")),e.length>0&&c.createElement(R.Ay,{size:"large",onClick:a},tO.t("Add Salesforce Org")),tO.rt("Learn more",{"":getLearnMoreLink}))))};NoConnection.displayName="NoConnection";var tk=a(0x30d0b075),tN=a(0x18a03595d),tT=a(0x4a120eb2);let tI=(0,e0.A)("sfdc.activities.getActivityTrackedObjects generated fetcher",(e,t,a)=>new eZ.S((n,i)=>{let{abortSignal:l,reason:r,...o}=a,s=(0,e2.VA)(o);e((0,eX.apiCall)({method:"sfdc.activities.getActivityTrackedObjects",args:s,abortSignal:l,reason:r})).then(e=>{n(e)}).catch(e=>{(0,e1.Ay)({getState:t}).error(`API call to sfdc.activities.getActivityTrackedObjects with reason ${r} failed, initiated by generated fetcher`),i(e)})}));tI.meta={name:"sfdcActivitiesGetActivityTrackedObjectsFetcher",key:"createFetcherSfdcActivitiesGetActivityTrackedObjectsFetcher",description:"sfdc.activities.getActivityTrackedObjects generated fetcher"};let tF=(0,e5.Ay)("Fetch Salesforce Log Activity tracked object options",async(e,t,a)=>e(tI(a)).then(e=>e.objects));tF.meta={name:"fetchActivityTrackedObjects",key:"createThunkFetchActivityTrackedObjects",description:"Fetch Salesforce Log Activity tracked object options"};let tM=new p.Ay("modernselling"),AllowedRelatedObjectsSection=({values:e,setValue:t})=>{let a=(0,d.wA)(),n=(0,I.d4)(F.rg),i=(0,c.useMemo)(()=>e?.map(e=>({label:e,value:e})),[e]),[l,r]=(0,c.useState)(!0),[o,s]=(0,c.useState)([]),[u,m]=(0,c.useState)(i||[]);(0,c.useEffect)(()=>{a(tF({asIntegrationUser:!0,reason:"log-activity-admin-allowed-related-objects",salesforceOrgId:n})).then(e=>{s(e.map(e=>({label:e,value:e})))}).finally(()=>{r(!1)})},[a,n]);let p=(0,c.useCallback)(async e=>o.filter(t=>t.value.toLowerCase().includes(e)),[o]),g=(0,c.useCallback)(e=>{let a=e.map(e=>e.value);m(e),t(a)},[t]),f=(0,c.useMemo)(()=>u.length>tN.eR?[{id:"too-many-options",message:tM.t("No more than {max, plural, =1 {# object} other {# objects}} can be selected",{max:tN.eR})}]:0===u.length?[{id:"not-enough-options",message:tM.t("You must select at least {min, plural, =1 {# object} other {# objects}}",{min:tN.yE})}]:void 0,[u.length]);return c.createElement(PanelSection,{title:tM.t("Allowed related objects"),isLoading:l},c.createElement("div",{className:"sk_primary_foreground margin_bottom_50"},tM.t("Select Salesforce objects as related items for new activities. Only objects enabled for activity logging can be selected.")),c.createElement(tT.x,{selectId:"allowed-related-objects-multi-select",search:p,selectedOptions:u,onSelectedItemsChange:g,width:"100%",placeholderText:tM.t("Search for objects"),shouldAllowUnselectInMultiSelectMode:!0,isInvalid:!!f,errors:f}),!f&&c.createElement("div",{className:"caption sk_foreground_max margin_top_50"},tM.rt("{numSelected}/{max} selected",{numSelected:u.length,max:tN.eR})))};AllowedRelatedObjectsSection.displayName="AllowedRelatedObjectsSection";var tD=a(0x15dd8a31);let tR=(0,e0.A)("sfdc.getGlobalActions generated fetcher",(e,t,a)=>new eZ.S((n,i)=>{let{abortSignal:l,reason:r,...o}=a,s=(0,e2.VA)(o);e((0,eX.apiCall)({method:"sfdc.getGlobalActions",args:s,abortSignal:l,reason:r})).then(e=>{n(e)}).catch(e=>{(0,e1.Ay)({getState:t}).error(`API call to sfdc.getGlobalActions with reason ${r} failed, initiated by generated fetcher`),i(e)})}));tR.meta={name:"sfdcGetGlobalActionsFetcher",key:"createFetcherSfdcGetGlobalActionsFetcher",description:"sfdc.getGlobalActions generated fetcher"};let tP=(0,e5.Ay)("Fetch Salesforce Log Activity global action options",async(e,t,a)=>e(tR(a)).then(e=>e.global_actions));tP.meta={name:"fetchGlobalActions",key:"createThunkFetchGlobalActions",description:"Fetch Salesforce Log Activity global action options"};let tL=new p.Ay("modernselling"),LogActivityGlobalActionSection=({initialValue:e,onChange:t})=>{let a=(0,d.wA)(),n=(0,I.d4)(F.rg),i=(0,c.useMemo)(()=>e&&e.label&&e.name?{id:e.id,label:e.name,value:e.name}:void 0,[e]),[l,r]=(0,c.useState)(!0),[o,s]=(0,c.useState)([]),[u,m]=(0,c.useState)(i);(0,c.useEffect)(()=>{a(tP({asIntegrationUser:!1,reason:"log-activity-admin-global-actions",salesforceOrgId:n})).then(e=>{s(e.map(e=>({id:e.id,label:e.name,value:e.name,extras:e.label})))}).finally(()=>{r(!1)})},[a,n]);let p=(0,c.useCallback)(e=>{null===e.value||e.value===u?.value?(t(null),m(void 0)):(t({id:e.id,label:e.extras,name:e.value}),m(e))},[t,u?.value]);return c.createElement(PanelSection,{title:tL.t("Log activity global action"),isLoading:l},c.createElement("div",{className:"sk_primary_foreground margin_bottom_50"},tL.rt("Select a global action to be used for new activities. Global actions from Salesforce must have the \u201Clog a call\u201D type.",{"":({text:e})=>c.createElement(ea.A,{href:"https://help.salesforce.com/s/articleView?id=sf.actions_overview_global.htm&type=5",target:"_blank"},e)})),c.createElement(tD.A,{ariaLabel:tL.t("Select a global action"),selectId:"global-action-select",options:o,selectedOption:u,onOptionSelected:p,width:"100%",isRequired:!1,key:u?.value}),c.createElement("div",{className:"caption sk_foreground_max margin_top_50"},tL.t("This will apply to all users")))};LogActivityGlobalActionSection.displayName="LogActivityGlobalActionSection";var tU=a(0x1ec57b131);let tB=/(^_+|_+$|[^\w])/g,tH=/_+(\w)/g;function camelCase(e){return e?e.toLowerCase().replace(tB,"").replace(tH,(e,t)=>t.toUpperCase()):""}let tV=(0,e0.A)("salesHome.admin.getConfig generated fetcher",(e,t,a)=>new eZ.S((n,i)=>{let{abortSignal:l,reason:r,...o}=a,s=(0,e2.VA)(o);e((0,eX.apiCall)({method:"salesHome.admin.getConfig",args:s,abortSignal:l,reason:r})).then(e=>{n(e)}).catch(e=>{(0,e1.Ay)({getState:t}).error(`API call to salesHome.admin.getConfig with reason ${r} failed, initiated by generated fetcher`),i(e)})}));tV.meta={name:"salesHomeAdminGetConfigFetcher",key:"createFetcherSalesHomeAdminGetConfigFetcher",description:"salesHome.admin.getConfig generated fetcher"};let tW=(0,e5.Ay)("Fetch Salesforce Log Activity config",async(e,t,a)=>e(tV(a)).then(e=>{let t=a.keys,n={};for(let[a,i]of Object.entries(e))t.includes(a)&&(n[`${camelCase(a)}`]=i);return n}));tW.meta={name:"fetchLogActivityConfig",key:"createThunkFetchLogActivityConfig",description:"Fetch Salesforce Log Activity config"};let tj=new p.Ay("modernselling"),tG={onClick:{enableClogAction:!0},elementName:"save"},LogActivityPanel=()=>{let e=(0,d.wA)(),t=(0,I.d4)(F.rg),[a,n]=(0,c.useState)(!0),[i,l]=(0,c.useState)(!1),[r,o]=(0,c.useState)(),[s,u]=(0,c.useState)(),[p,g]=(0,c.useState)();(0,c.useEffect)(()=>{n(!0),e(tW({reason:"log-activity-config",keys:["activity_global_action","activity_tracked_objects"],salesforceOrgId:t})).then(e=>{u(e.activityGlobalAction),g(e.activityTrackedObjects??[])}).finally(()=>{n(!1)})},[e,t]);let f=(0,c.useCallback)(()=>{e((0,eV.M)({element:c.createElement("div",{style:{position:"fixed",bottom:0,right:0}},c.createElement(eH.A,{svgIconProps:{name:"check-circle"}},tj.t("Settings updated")))}))},[e]),_=(0,c.useCallback)(async()=>(l(!0),o(void 0),t)?e((0,tU.O)({activityGlobalAction:(0,tk.Zf)(s),activityTrackedObjects:p,reason:"sales-home-set-log-activity-config",salesforceOrgId:t})).then(()=>{f()}).catch(()=>{o(tj.t("There was a problem saving"))}).finally(()=>{l(!1)}):void o(tj.t("There was a problem loading.")),[t,e,s,p,f]),h=!!p&&(0===p.length||p.length>tN.eR);return c.createElement(m.A,{clogImpression:!0,eventId:eU.EventId.LOB_SALES_HOME,uiComponentName:eU.UiComponentName.LOG_ACTIVITY_SETTINGS_PANEL},c.createElement(PanelHeader,null,tj.t("Log activity")),c.createElement(PanelSectionsContainer,null,a?c.createElement(P.A,{className:"align_self_center margin_left_auto margin_right_auto margin_top_250 margin_bottom_250"}):c.createElement(c.Fragment,null,c.createElement(LogActivityGlobalActionSection,{initialValue:s,onChange:u}),c.createElement(AllowedRelatedObjectsSection,{values:p,setValue:g}))),r&&c.createElement(K.Ay,{className:"margin_top_100",level:"error"},c.createElement("span",null,r)),c.createElement("div",{className:"margin_top_100 align_right"},c.createElement(R.lV,{autoClogProps:tG,type:"primary",size:"medium",loading:i,onClick:_,disabled:h||a,"aria-label":tj.t("Save")},tj.t("Save"))))};LogActivityPanel.displayName="LogActivityPanel";var tq=a(0xe1870af4),tY=a(0xb1c0d55),tz=a(0x1df96de4c),t$=a(0x102edf836),tQ=a(0xf3b0bc58),tJ=a(0x178788799),tK=a(0x12f409c9c),tZ=a(0x22cb87770),tX=a(0xe1a09d7a),t0=a(0xb0ca8936);let t1=new p.Ay("modernselling"),MigrationCompleteAlert=()=>{let e=(0,I.d4)(F.Ey),t=(0,tX.c)(e?.instance_url);return c.createElement(K.Ay,{level:"warning",className:"margin_bottom_50"},c.createElement(eS.B,{space:"100"},c.createElement(eS.B,{space:"75"},c.createElement(t0.EY,null,t1.rt("Sales Elevate users have been migrated to the Salesforce permission set. To manage users, use the \u2018Slack Sales Home User\u2019 permission set or contact a Salesforce admin.",{"":t,fallbackHash:"d0d1d51e235a7e33b0639f9b6d586162598df37b"})))))};MigrationCompleteAlert.displayName="MigrationCompleteAlert";var t2=a(0x24546e7f2),t4=a(0xce378727),t5=a(0xf225ecf2),t8=a(0x96920791),t7=a(0x16d221c7f),t6=a(0x142775427),t3=a(0x1f803375e);let checkIfHasDataErrorProperty=e=>null!=e&&"object"==typeof e&&"data"in e&&null!=e.data&&"object"==typeof e.data&&"error"in e.data,t9=(0,e0.A)("sfdc.integration.elevateMigration.start generated fetcher",(e,t,a)=>new eZ.S((n,i)=>{let{abortSignal:l,reason:r,...o}=a,s=(0,e2.VA)(o);e((0,eX.apiCall)({method:"sfdc.integration.elevateMigration.start",args:s,abortSignal:l,reason:r})).then(e=>{n(e)}).catch(e=>{(0,e1.Ay)({getState:t}).error(`API call to sfdc.integration.elevateMigration.start with reason ${r} failed, initiated by generated fetcher`),i(e)})}));t9.meta={name:"sfdcIntegrationElevateMigrationStartFetcher",key:"createFetcherSfdcIntegrationElevateMigrationStartFetcher",description:"sfdc.integration.elevateMigration.start generated fetcher"};var ae=a(0x1feb18f19),at=a(0x200936397),aa=a(0x998e188d),an=a(0x18bdae73b);let ai=new p.Ay("modernselling"),MigrateUsers=({title:e,salesforceOrg:t,setNextStep:a,renderPermissionSetLink:n})=>{let[i,l,r,o]=(()=>{let e=(0,d.wA)(),[t,a]=(0,c.useState)("initial"),[n,i]=(0,c.useState)();return["updating"===t,"error"===t,(0,c.useCallback)(async(t,n)=>{try{if(!t)throw Error("Salesforce org is missing");a("updating");let l=await e(t9({salesforceOrgId:t.salesforce_org_id,reason:"migrate-sales-elevate-users"}));if(!l.ok)throw l;e((0,W.Ox)({...t,migration_status:"in_progress",is_legacy_elevate_org:!1})),a("success"),i(void 0),n()}catch(e){checkIfHasDataErrorProperty(e)&&i(e.data.error),a("error")}},[e]),n]})(),s=(0,c.useCallback)(()=>{r(t,a)},[r,t,a]);return t?c.createElement(c.Fragment,null,c.createElement(t6.A,null,c.createElement(t3.A,{title:e})),c.createElement(t5.A,null,c.createElement(at.a,{paddingInline:"150"},c.createElement(eS.B,{space:"125"},l&&c.createElement(K.Ay,{type:"boxed",level:"error",heading:ai.t("There was a problem starting your migration")},o&&({invalid_migration_status:ai.t("A migration is already in progress or completed for this org."),org_not_supported:ai.t("The Salesforce org could not be found or is not in a connected state."),dispatch_failed:ai.t("Unable to start the migration.")})[o]||(0,tt.Q)()),c.createElement(eS.B,{space:"100"},ai.t("How it works:"),c.createElement(aa.O,null,c.createElement(ae.c,{space:"50"},c.createElement(an.b,null,c.createElement(B.Ah,{name:"user-add",size:"20"})),c.createElement(t0.EY,{as:"p"},ai.rt("Users with mapped Slack and Salesforce accounts will be added to the \u2018Slack Sales Home User\u2019 permission set. Their access to Sales Elevate won\u2019t be disrupted.",{"":n,fallbackHash:"3d908fad841b9872d5fbbc559fcf37c1ef09a898"})))),c.createElement(aa.O,null,c.createElement(ae.c,{space:"50"},c.createElement(an.b,null,c.createElement(B.Ah,{name:"user-add",size:"20"})),c.createElement(t0.EY,{as:"p"},ai.t("Users who don\u2019t have mapped Slack and Salesforce user accounts will temporarily lose access to the Sales tab in Slack. We\u2019ll help you quickly restore their access."))))),c.createElement(t0.EY,null,ai.rt("Once the migration is complete, you\u2019ll manage users using the Salesforce permission set. The People page in Sales settings will be view-only."))))),c.createElement(t8.A,null,c.createElement(t7.A,null,c.createElement(t4.A,{loading:i,onClick:s,type:"primary","aria-label":ai.t("Start Migration")},ai.t("Start Migration"))))):null};MigrateUsers.displayName="MigrateUsers";let al=new p.Ay("modernselling"),MigrationInProgress=({title:e,closeDialog:t})=>c.createElement(c.Fragment,null,c.createElement(t6.A,null,c.createElement(t3.A,{title:e})),c.createElement(t5.A,null,c.createElement(at.a,{paddingInline:"150"},al.t("The migration process can take time. You\u2019ll receive a notification from Slack when the migration is complete."))),c.createElement(t8.A,null,c.createElement(t7.A,null,c.createElement(t$.Ay,{onClick:t,type:"primary","aria-label":al.t("OK")},al.t("OK")))));MigrationInProgress.displayName="MigrationInProgress";var ar=a(0x15fb82076);let ao=(0,e0.A)("sfdc.integration.elevateMigration.complete generated fetcher",(e,t,a)=>new eZ.S((n,i)=>{let{abortSignal:l,reason:r,...o}=a,s=(0,e2.VA)(o);e((0,eX.apiCall)({method:"sfdc.integration.elevateMigration.complete",args:s,abortSignal:l,reason:r})).then(e=>{n(e)}).catch(e=>{(0,e1.Ay)({getState:t}).error(`API call to sfdc.integration.elevateMigration.complete with reason ${r} failed, initiated by generated fetcher`),i(e)})}));ao.meta={name:"sfdcIntegrationElevateMigrationCompleteFetcher",key:"createFetcherSfdcIntegrationElevateMigrationCompleteFetcher",description:"sfdc.integration.elevateMigration.complete generated fetcher"};let as=(0,e0.A)("sfdc.integration.elevateMigration.exportFailedUsers generated fetcher",(e,t,a)=>new eZ.S((n,i)=>{let{abortSignal:l,reason:r,...o}=a,s=(0,e2.VA)(o);e((0,eX.apiCall)({method:"sfdc.integration.elevateMigration.exportFailedUsers",args:s,abortSignal:l,reason:r})).then(e=>{n(e)}).catch(e=>{(0,e1.Ay)({getState:t}).error(`API call to sfdc.integration.elevateMigration.exportFailedUsers with reason ${r} failed, initiated by generated fetcher`),i(e)})}));as.meta={name:"sfdcIntegrationElevateMigrationExportFailedUsersFetcher",key:"createFetcherSfdcIntegrationElevateMigrationExportFailedUsersFetcher",description:"sfdc.integration.elevateMigration.exportFailedUsers generated fetcher"};let ac=new p.Ay("modernselling"),ad={name:"download"},useStartCSVExport=e=>{let t=(0,d.wA)(),a=(0,c.useRef)(),[n,i]=(0,c.useState)("idle");return(0,c.useEffect)(()=>()=>{a.current&&clearTimeout(a.current)},[]),[n,(0,c.useCallback)(async()=>{try{if(!e)throw Error("salesforceOrgId is missing");if(i("exporting"),!(await t(as({salesforceOrgId:e,reason:"migrate-users-partial-success"}))).ok)throw Error("Could not export failed users");i("cooldown"),a.current=setTimeout(()=>{i("idle")},5e3),t((0,eV.M)({element:c.createElement(eH.A,{svgIconProps:ad},ac.rt("Generating CSV. It will be sent to you in Slack when it\u2019s ready."))}))}catch{i("error")}},[t,e])]};useStartCSVExport.displayName="useStartCSVExport";var au=a(0x1602b12ef);let am=new p.Ay("modernselling"),MigrationPartialSuccess=({title:e,salesforceOrg:t,closeDialog:a,refetchUsers:n,renderPermissionSetLink:i})=>{let[l,r,o,s]=(()=>{let e=(0,d.wA)(),[t,a]=(0,c.useState)("initial"),[n,i]=(0,c.useState)();return["updating"===t,"error"===t,(0,c.useCallback)(async(t,n)=>{try{if(!t)throw Error("Salesforce org is missing");a("updating");let l=await e(ao({salesforceOrgId:t.salesforce_org_id,reason:"migrate-sales-elevate-users"}));if(!l.ok)throw l;e((0,W.Ox)({...t,migration_status:"complete"})),a("success"),i(void 0),n()}catch(e){checkIfHasDataErrorProperty(e)&&i(e.data.error),a("error")}},[e]),n]})(),[u,m]=useStartCSVExport(t?.salesforce_org_id),p=(0,c.useCallback)(()=>{n?.(),a()},[n,a]),g=(0,c.useCallback)(()=>{o(t,p)},[o,t,p]);if(!t)return null;let f=t?.total_failed_migration_users,_=t?.total_users;return c.createElement(c.Fragment,null,c.createElement(t6.A,null,c.createElement(t3.A,{title:e})),c.createElement(t5.A,null,c.createElement(at.a,{paddingInline:"150"},c.createElement(eS.B,{space:"100"},"error"===u&&c.createElement(K.Ay,{type:"boxed",level:"error"},am.t("Unable to export your CSV. Please wait a minute and try again.")),r&&c.createElement(K.Ay,{type:"boxed",level:"error",heading:am.t("There was a problem completing your migration")},s&&({invalid_migration_status:am.t("A migration is not in progress for this org."),org_not_supported:am.t("The Salesforce org could not be found or is not in a connected state.")})[s]||(0,tt.Q)()),c.createElement(K.Ay,{level:"error"},am.t("{totalFailed} out of {totalUsers} users weren\u2019t migrated.",{totalFailed:f,totalUsers:_})),c.createElement(t0.EY,null,am.t("Take these steps to restore access for the users who weren\u2019t migrated.")),c.createElement(eS.B,{space:"150",as:"ul"},c.createElement(au.b,null,c.createElement(ae.c,{space:"50"},c.createElement(an.b,null,c.createElement(B.Ah,{name:"file-download",size:"20"})),c.createElement(eS.B,{space:"125"},c.createElement(t0.EY,{as:"p"},am.t("Determine which users need to have their access restored.")),c.createElement(t0.EY,{as:"p"},am.t("Slackbot has sent the admin who started the migration a CSV file containing all un-migrated users you could use as a starting point.")))),c.createElement(au.W,null)),c.createElement(au.b,null,c.createElement(ae.c,{space:"50"},c.createElement(an.b,null,c.createElement(B.Ah,{name:"sales",size:"20"})),c.createElement(t0.EY,null,am.rt("Add users to the \u2018Slack Sales Home User\u2019 Salesforce permission set.",{"":i,fallbackHash:"08ee3712490812c51f227d0fd6d61d92498d74d7"}))),c.createElement(au.W,null)),c.createElement(au.b,null,c.createElement(ae.c,{space:"50"},c.createElement(an.b,null,c.createElement(B.Ah,{name:"check",size:"20"})),c.createElement(t0.EY,null,am.t("Users sign in to Salesforce from Slack to restore access.")))))))),c.createElement(t8.A,null,"cooldown"===u&&c.createElement(t0.EY,null,am.t("Please wait for five seconds to export again")),"cooldown"!==u&&c.createElement(ar.A,{"aria-label":am.t("Export un-migrated users list"),disabled:"exporting"===u,onClick:m},c.createElement(ae.c,{space:"25"},c.createElement(B.Ah,{name:"file-download"}),am.t("Export un-migrated users list"),"exporting"===u&&c.createElement(P.A,{inline:!0,size:"medium"}))),c.createElement(t7.A,null,c.createElement(t4.A,{type:"primary",loading:l,onClick:g,"aria-label":am.t("Complete Migration")},am.t("Complete Migration")))))};MigrationPartialSuccess.displayName="MigrationPartialSuccess";let ap=new p.Ay("modernselling"),ag="migration-in-progress",MigrateUsersDialog=({refetchUsers:e})=>{let t=(0,I.d4)(F.Ey),a=(0,d.wA)(),n=(0,c.useCallback)(()=>{a((0,tC.O)())},[a]),i=t?.migration_status==="needs_attention"?"migration-partial-success":"migrate-users",l=(0,c.useMemo)(()=>{let a=ap.t("Migrate Sales Elevate users"),i=ap.t("Migration in progress\u2026"),l=ap.t("Migration results"),r=(0,tX.c)(t?.instance_url);return{"migrate-users":{render:({switchPane:e})=>c.createElement(MigrateUsers,{title:a,salesforceOrg:t,setNextStep:()=>e(ag),renderPermissionSetLink:r}),modalProps:{centered:!0,contentLabel:a}},[ag]:{render:()=>c.createElement(MigrationInProgress,{title:i,closeDialog:n}),modalProps:{centered:!0,contentLabel:i}},"migration-partial-success":{render:()=>c.createElement(MigrationPartialSuccess,{title:l,salesforceOrg:t,closeDialog:n,refetchUsers:e,renderPermissionSetLink:r}),modalProps:{centered:!0,contentLabel:l}}}},[n,e,t]);return c.createElement(t2.A,{defaultPane:i,panes:l,closeModal:n})};MigrateUsersDialog.displayName="MigrateUsersDialog";let useOpenMigrateUsersDialog=e=>{let t=(0,d.wA)();return(0,c.useCallback)(()=>{t((0,ti.q)({element:c.createElement(MigrateUsersDialog,{refetchUsers:e?.refetchUsers})}))},[t,e?.refetchUsers])};useOpenMigrateUsersDialog.displayName="useOpenMigrateUsersDialog";let af=new p.Ay("modernselling"),MigrationPartialSuccessAlert=({refetchUsers:e})=>{let t=useOpenMigrateUsersDialog({refetchUsers:e});return c.createElement(K.Ay,{level:"warning",className:"margin_bottom_50"},c.createElement(eS.B,{space:"100"},c.createElement(eS.B,{space:"75"},c.createElement(t0.EY,{weight:"bold",as:"strong"},af.t("Migration Results: Attention Required")),c.createElement(t0.EY,{as:"p"},af.t("Sales Elevate users have been migrated to the Salesforce permission set, but not all users were migrated and some need attention."))),c.createElement(ae.c,{space:"75"},c.createElement(t$.Ay,{type:"primary",onClick:t},af.t("Review and Complete")))))};MigrationPartialSuccessAlert.displayName="MigrationPartialSuccessAlert";let a_=new p.Ay("modernselling"),StartMigrationAlert=()=>{let e=useOpenMigrateUsersDialog();return c.createElement(K.Ay,{level:"warning",isIconVisible:!1},c.createElement(eS.B,{space:"100"},c.createElement(eS.B,{space:"75"},c.createElement(t0.EY,{weight:"bold",as:"strong"},a_.t("Add Sales Elevate users to a Salesforce permission set")),c.createElement(t0.EY,{as:"p"},a_.t("Use a Salesforce permission set to manage permissions more efficiently. Start by migrating your existing Sales Elevate users to the permission set.")),c.createElement(t0.EY,{as:"p"},a_.rt("Important note: We can migrate users for you automatically, or you can migrate users manually. If you prefer to do a manual migration, please reach out to your account team or email us at feedback@slack.com for assistance."))),c.createElement(ae.c,{space:"75"},c.createElement(t$.Ay,{type:"primary",onClick:e},a_.t("Migrate Automatically")))))};StartMigrationAlert.displayName="StartMigrationAlert";var ah=a(0x76d8f545),ab=a(0x71c724c8),ay=a(0xc541ec71),aA=a(0x124bd04f),aE=a(0x182a26028);let aS=(0,e0.A)("salesHome.admin.exportMembers generated fetcher",(e,t,a)=>new eZ.S((n,i)=>{let{abortSignal:l,reason:r,...o}=a,s=(0,e2.VA)(o);e((0,eX.apiCall)({method:"salesHome.admin.exportMembers",args:s,abortSignal:l,reason:r})).then(e=>{n(e)}).catch(e=>{(0,e1.Ay)({getState:t}).error(`API call to salesHome.admin.exportMembers with reason ${r} failed, initiated by generated fetcher`),i(e)})}));aS.meta={name:"salesHomeAdminExportMembersFetcher",key:"createFetcherSalesHomeAdminExportMembersFetcher",description:"salesHome.admin.exportMembers generated fetcher"};let aC=(0,e0.A)("salesHome.admin.listMembers generated fetcher",(e,t,a)=>new eZ.S((n,i)=>{let{abortSignal:l,reason:r,...o}=a,s=(0,e2.VA)(o);e((0,eX.apiCall)({method:"salesHome.admin.listMembers",args:s,abortSignal:l,reason:r})).then(e=>{n(e)}).catch(e=>{(0,e1.Ay)({getState:t}).error(`API call to salesHome.admin.listMembers with reason ${r} failed, initiated by generated fetcher`),i(e)})}));aC.meta={name:"salesHomeAdminListMembersFetcher",key:"createFetcherSalesHomeAdminListMembersFetcher",description:"salesHome.admin.listMembers generated fetcher"};var av=a(0x5b1a0d1b),ax=a(0x13638bd77),aw=a(0x21f3c49e8);let aO=new p.Ay("modernselling"),CsvFileState=({selectedFileName:e,stateText:t,isErrorState:a=!1})=>c.createElement(c.Fragment,null,a&&c.createElement(K.Ay,{type:"boxed",level:"error",align:"left",className:"p-members_csv_file_state_error_alert"},c.createElement("span",null,aO.t("There was a problem uploading this file. Give it another try."))),c.createElement("div",{className:"p-members_csv_file_state_container"},c.createElement("div",{className:"p-members_csv_file_state_icon"},a&&c.createElement(B.Ah,{name:"warning"}),!a&&c.createElement(P.A,{size:"medium",color:"blue",inline:!0})),c.createElement("div",null,c.createElement("p",{className:"p-members_csv_file_state_file_name"},e),c.createElement("p",{className:"p-members_csv_file_state_text"},t))));CsvFileState.displayName="CsvFileState";var ak=a(0x1e864b930);let MemberInModal=({memberId:e,className:t=""})=>{let a=(0,I.d4)(t=>(0,eN.nv)(t,e)),n=(0,ek.zY)(a);return a&&a.id?c.createElement(ab.Ay,{className:t,member:a,showPresence:!1,secondaryContent:n,showStatus:!1,showSubtext:!1,useShortMode:!0}):null};MemberInModal.displayName="MemberInModal";let aN=new p.Ay("modernselling"),FileNameHeader=({fileName:e,totalEmails:t})=>c.createElement("div",{className:"p-members_csv_result__header"},c.createElement("div",{className:"p-members_csv_result__header_icon"},c.createElement(B.Ah,{name:"user-groups",size:"20"})),c.createElement("div",{className:"p-members_csv_result__header_content"},c.createElement("p",{className:"p-members_csv_result__header_file_name"},e),c.createElement("p",{className:"p-members_csv_result__header_total_emails"},t)));FileNameHeader.displayName="FileNameHeader";let CsvResult=({fileName:e,validUserIds:t,invalidEmails:a})=>{let n=t.length,i=a.length,l=n+i,r=aN.t("Eligible {numValidUsers, plural, one {person} other {people}} ({numValidUsers})",{numValidUsers:n}),o=aN.t("Can\u2019t grant access ({numInvalidEmails})",{numInvalidEmails:i}),s=aN.t("{numTotalEmails} email {numTotalEmails, plural, one {address} other {addresses}}",{numTotalEmails:l}),d=aN.t("{numInvalidEmails} {numInvalidEmails, plural, one {email won\u2019t get access. It might be formatted incorrectly or the person associated with the email isn\u2019t a member of your organization.} other {emails won\u2019t get access. They might be formatted incorrectly or the people associated with the emails aren\u2019t members of your organization.}}",{numInvalidEmails:i}),renderMembers=e=>c.createElement("div",{className:"p-members_csv_result_members_container"},e.map(e=>c.createElement(MemberInModal,{className:"p-members_csv_result_member_item",key:e,memberId:e})));renderMembers.displayName="renderMembers";let renderUnknownEmails=e=>{let t=(0,ak.A)(e,{noConj:!0});return c.createElement("div",{className:"p-members_csv_result_unknown_emails_container"},c.createElement("p",{className:"p-members_csv_result_unknown_emails_note"},d),c.createElement("p",{className:"p-members_csv_result_unknown_emails_list"},t))};renderUnknownEmails.displayName="renderUnknownEmails";let u=[];return n>0&&u.push({title:r,id:"members",content:renderMembers(t),className:"p-members_csv_result__tab--members"}),i>0&&u.push({title:o,id:"unknown",content:renderUnknownEmails(a),className:"p-members_csv_result__tab--unknown"}),c.createElement("div",{className:"p-members_csv_result__container"},c.createElement(FileNameHeader,{fileName:e,totalEmails:s}),c.createElement(g.A,{tabMenuClassnames:"p-members_csv_result__tabs",tabs:u}))};CsvResult.displayName="CsvResult";var aT=a(0x22809c249),aI=a(0x20e80190e),aF=a(0x1fb2d2a87);let aM=(0,e0.A)("salesHome.admin.addValidatedMembers generated fetcher",(e,t,a)=>new eZ.S((n,i)=>{let{abortSignal:l,reason:r,...o}=a,s=(0,e2.VA)(o);e((0,eX.apiCall)({method:"salesHome.admin.addValidatedMembers",args:s,abortSignal:l,reason:r})).then(e=>{n(e)}).catch(e=>{(0,e1.Ay)({getState:t}).error(`API call to salesHome.admin.addValidatedMembers with reason ${r} failed, initiated by generated fetcher`),i(e)})}));aM.meta={name:"salesHomeAdminAddValidatedMembersFetcher",key:"createFetcherSalesHomeAdminAddValidatedMembersFetcher",description:"salesHome.admin.addValidatedMembers generated fetcher"};let aD=(0,e5.Ay)("Gives validated members access to Sales Home",async(e,t,{salesforceOrgId:a})=>{let n=await e(aM({reason:"modern-selling-admin-add-uploaded-members",salesforceOrgId:a}));if(n&&n.ok){let{added_user_ids:e,not_added_user_ids:t}=n;return eZ.S.resolve({addedUserIds:e,notAddedUserIds:t})}return eZ.S.reject(Error("salesHomeAddValidatedEmails API failed"))});aD.meta={name:"addMembersToSalesHome",key:"createThunkAddMembersToSalesHome",description:"Gives validated members access to Sales Home"};let aR=(0,e0.A)("salesHome.admin.validateEmails generated fetcher",(e,t,a)=>new eZ.S((n,i)=>{let{abortSignal:l,reason:r,...o}=a,s=(0,e2.VA)(o);e((0,eX.apiCall)({method:"salesHome.admin.validateEmails",args:s,abortSignal:l,reason:r})).then(e=>{n(e)}).catch(e=>{(0,e1.Ay)({getState:t}).error(`API call to salesHome.admin.validateEmails with reason ${r} failed, initiated by generated fetcher`),i(e)})}));aR.meta={name:"salesHomeAdminValidateEmailsFetcher",key:"createFetcherSalesHomeAdminValidateEmailsFetcher",description:"salesHome.admin.validateEmails generated fetcher"};let aP=(0,e5.Ay)("Kicks off a CSV file upload for importing Sales Home users",async(e,t,{file:a})=>{if(!a)return;let n=await e(aR({reason:"modern-selling-admin-upload-csv",file:a}));if(n&&n.ok){let{valid_user_ids:e,invalid_emails:t}=n;return eZ.S.resolve({validUserIds:e,invalidEmails:t})}return eZ.S.reject(Error("salesHomeValidateEmails API failed"))});aP.meta={name:"uploadCSVFile",key:"createThunkUploadCSVFile",description:"Kicks off a CSV file upload for importing Sales Home users"};let aL=a.p+"admin-conf-image-dark-02f5de7.svg",aU=a.p+"admin-conf-image-light-13b3bde.svg",aB=new p.Ay("modernselling"),aH={validUserIds:[],invalidEmails:[]},aV={addedUserIds:[],notAddedUserIds:[]};var aW=((l=aW||{}).NONE="none",l.UPLOADING="uploading",l.PROCESSING="processing",l.SUCCESSFUL="successful",l.ERROR="error",l);let AddByCSVModal=()=>{let e=(0,d.wA)(),t=(0,I.d4)(aF.to),a=(0,I.d4)(F.rg),n=(0,I.d4)(F._N),i=(0,I.d4)(F.C6),l=(0,c.useRef)(null),[r,o]=(0,c.useState)(null),[s,u]=(0,c.useState)([]),[m,p]=(0,c.useState)([]),[g,f]=(0,c.useState)(1),[_,h]=(0,c.useState)("none"),b=(0,c.useCallback)(()=>{o(null),u([]),p([]),f(1),h("none")},[]),y=(0,c.useCallback)(()=>{e((0,tC.O)())},[e]),A=(0,c.useCallback)(()=>{l?.current?.click()},[l]),E=(0,c.useCallback)(e=>{e&&e[0]&&o(e[0])},[]),S=(0,c.useCallback)(()=>{r&&(async()=>{h("uploading"),e(aP({file:r})).then(({validUserIds:e,invalidEmails:t}=aH)=>{h("processing"),u(e),p(t),(0,aw.A)(e)&&(0,aw.A)(t)?f(3):f(2),h("successful")}).catch(e=>{console.log(e),h("error")})})()},[e,r]),C=(0,c.useCallback)(()=>{a&&r&&s.length>0&&(async()=>{e(aD({salesforceOrgId:a})).then(({addedUserIds:t}=aV)=>{(0,aw.A)(t)||(e((0,W.oU)([...new Set([...n,...t])])),e((0,W.gT)(i+t.length))),f(3)}).catch(e=>{console.log(e)})})()},[r,s.length,e,a,n,i]),v="successful"===_,x=r?r?.name:"",w=aB.t("Add people by CSV file"),O=(0,c.useCallback)(()=>{switch(g){case 1:switch(_){case"none":return c.createElement(t$.Ay,{type:"primary",onClick:S,disabled:!r},aB.t("Upload"));case"uploading":case"processing":return c.createElement(t$.Ay,{type:"primary",onClick:S,disabled:!0},aB.t("Add People"));case"error":return c.createElement(t$.Ay,{type:"primary",onClick:b},aB.t("Try Again"));default:return null}case 2:return c.createElement(t$.Ay,{type:"primary",onClick:C,disabled:0===s.length},aB.t("Grant Access to {numValidatedUsers} {numValidatedUsers, plural, one {Person} other {People}}",{numValidatedUsers:s.length}));case 3:return c.createElement(t$.Ay,{type:"primary",onClick:y},aB.t("Done"));default:return null}},[_,s.length,C,y,S,b,g,r]),k=(0,c.useCallback)(()=>{switch(g){case 1:switch(_){case"none":return c.createElement(c.Fragment,null,c.createElement("p",null,aB.t("Select a CSV file from your computer to upload.")),c.createElement("p",null,aB.t("It should contain only emails for each person to be added, separated by commas.")),c.createElement("p",null,aB.t("Next, you\u2019ll review the list of people before they\u2019re granted access.")),c.createElement(aT.A,{ref:l,multiple:!1,accept:".xlsx, .xls, .csv",onFilesSelectedHandler:E}),c.createElement("div",{className:"p-members_add_by_csv__file_upload_container"},c.createElement(t$.Ay,{type:"outline",onClick:A},c.createElement(B.Ah,{name:"laptop",size:"20",inline:!0}),c.createElement("span",{className:"p-members_add_by_csv__select_file"},aB.t("Select File"))),r&&c.createElement("p",{className:"p-members_add_by_csv__file_pill"},x)));case"uploading":return c.createElement(CsvFileState,{selectedFileName:x,stateText:aB.t("Uploading file")});case"processing":return c.createElement(CsvFileState,{selectedFileName:x,stateText:aB.t("Processing")});case"error":return c.createElement(CsvFileState,{selectedFileName:x,stateText:aB.t("Error loading file"),isErrorState:!0});default:return null}case 2:if(v&&(s.length>0||m.length>0))return c.createElement(CsvResult,{fileName:x,validUserIds:s,invalidEmails:m});return null;case 3:return c.createElement(c.Fragment,null,c.createElement("p",{className:"p-members_add_by_csv__confirmation-header"},aB.t("All Set!")),c.createElement("div",{className:"p-members_add_by_csv__confirmation-body"},c.createElement("p",null,aB.t("Nice work setting up your sales team for success.")),c.createElement("p",null,aB.t("You can come back to your sales settings to make changes for your team any time."))));default:return null}},[_,E,v,s,A,r,x,g,m]);return c.createElement(aI.dW,{centered:!0,closeModal:y},g<3&&c.createElement(aI.rQ,null,c.createElement(aI.Rc,{title:w})),c.createElement(aI.$m,{className:"margin_bottom_150"},3===g&&c.createElement(aI.hR,{height:150,src:"dark"===t?aL:aU,alt:"confirmation notice"}),c.createElement(aI.qf,null,k())),c.createElement(aI.jl,null,g<3&&c.createElement("p",{className:"p-members_add_by_csv__footer_steps"},aB.t("Step {step} of {totalSteps}",{step:g,totalSteps:2})),c.createElement(aI.ox,null,g<3&&c.createElement(t$.Ay,{type:"outline",onClick:y},aB.t("Cancel")),O())))};AddByCSVModal.displayName="AddByCSVModal";let aj=(0,e5.Ay)("Opens Add by CSV Modal",(e,t)=>{e((0,ti.q)({element:c.createElement(AddByCSVModal,null)}))});aj.meta={name:"openAddByCSVModal",key:"createThunkOpenAddByCSVModal",description:"Opens Add by CSV Modal"};var aG=a(0x10d53599f),aq=a(0x19dc73101);let aY=(0,e0.A)("salesHome.admin.addMembers generated fetcher",(e,t,a)=>new eZ.S((n,i)=>{let{abortSignal:l,reason:r,...o}=a,s=(0,e2.VA)(o);e((0,eX.apiCall)({method:"salesHome.admin.addMembers",args:s,abortSignal:l,reason:r})).then(e=>{n(e)}).catch(e=>{(0,e1.Ay)({getState:t}).error(`API call to salesHome.admin.addMembers with reason ${r} failed, initiated by generated fetcher`),i(e)})}));aY.meta={name:"salesHomeAdminAddMembersFetcher",key:"createFetcherSalesHomeAdminAddMembersFetcher",description:"salesHome.admin.addMembers generated fetcher"};let az=(0,e5.Ay)("Gives a set of members access to Sales Home",async(e,t,{users:a,salesforceOrgId:n})=>{if(!a)return;let i=await e(aY({reason:"sales-home-admin-add-members",users:a,salesforceOrgId:n}));if(i&&i.ok){let{added_user_ids:e}=i;return eZ.S.resolve({addedUserIds:e})}return eZ.S.reject(Error("salesHomeRolesAddMembers API failed"))});az.meta={name:"addIndividualMembersToSalesHome",key:"createThunkAddIndividualMembersToSalesHome",description:"Gives a set of members access to Sales Home"};let a$=(0,e0.A)("salesHome.admin.getAccessInfo generated fetcher",(e,t,a)=>new eZ.S((n,i)=>{let{abortSignal:l,reason:r,...o}=a,s=(0,e2.VA)(o);e((0,eX.apiCall)({method:"salesHome.admin.getAccessInfo",args:s,abortSignal:l,reason:r})).then(e=>{n(e)}).catch(e=>{(0,e1.Ay)({getState:t}).error(`API call to salesHome.admin.getAccessInfo with reason ${r} failed, initiated by generated fetcher`),i(e)})}));a$.meta={name:"salesHomeAdminGetAccessInfoFetcher",key:"createFetcherSalesHomeAdminGetAccessInfoFetcher",description:"salesHome.admin.getAccessInfo generated fetcher"};let aQ=(0,e5.Ay)("Fetch whether or not the user has access to the given Salesforce org in Elevate",async(e,t,a)=>e(a$(a)).then(e=>({hasAccess:e.has_access,isSalesAdmin:e.is_sales_admin})));aQ.meta={name:"fetchMembersAccessInfo",key:"createThunkFetchMembersAccessInfo",description:"Fetch whether or not the user has access to the given Salesforce org in Elevate"};let aJ=new p.Ay("modernselling"),aK={addedUserIds:[]},AddIndividualModal=()=>{let e=(0,d.wA)(),[t,a]=(0,c.useState)([]),n=(0,I.d4)(F.rg),i=(0,I.d4)(F._N),l=(0,I.d4)(F.C6),r=aJ.t("Already has access"),o=(0,c.useCallback)(()=>t.length>0?aJ.t("Grant Access to {numUsers} {numUsers, plural, one {Person} other {People}}",{numUsers:t.length}):aJ.t("Grant Access"),[t.length]),s=(0,c.useCallback)(()=>{e((0,tC.O)())},[e]),u=(0,c.useMemo)(()=>({entities:{members:{includeSelf:!1,includeExternal:!1,includeAllExternal:!1,includeSlackbot:!1,includeBots:!1,includeDeleted:!1,includeGuests:!1,includeProfileOnlyUsers:!1,matchEmailField:!0}},allowEmptyQuery:!0,sort:{source:"modernselling-add-individual",frecency:!0},limit:7,filter:e=>!e.is_invited_user}),[]),m=(0,c.useCallback)(t=>e(aQ({reason:"modern-selling",userId:t.entity.id,salesforceOrgId:n??""})).then(e=>{let a=e.hasAccess?r:"";return{...t,isDisabled:e.hasAccess,inviteExceptionReason:a}}),[e,n,r]),p=(0,c.useCallback)(e=>{let t=e.map(e=>m(e));return eZ.S.all(t).then(e=>eZ.S.resolve(e))},[m]),g=(0,c.useCallback)(e=>c.createElement(aG.A,{id:e.value,member:e.entity,secondaryContent:e.inviteExceptionReason}),[]),f=(0,c.useCallback)(e=>{a(e.map(e=>e.entity.id))},[]),_=(0,c.useCallback)(()=>!t.length,[t.length]),h=(0,c.useCallback)(()=>{t.length>0&&n&&(async()=>{e(az({users:t,salesforceOrgId:n})).then(({addedUserIds:t}=aK)=>{(0,aw.A)(t)||(e((0,W.oU)([...new Set([...i,...t])])),e((0,W.gT)(l+t.length)),e((0,eV.M)({element:c.createElement(eH.A,{svgIconProps:{name:"check-circle"},duration:3e3,position:"bottom-right"},aJ.t("Access added for {numAddedUsers} {numAddedUsers, plural, one {Person} other {People}}",{numAddedUsers:t.length}))})))}).catch(e=>{console.log(e)}),s()})()},[t,e,n,s,i,l]);return c.createElement(aI.dW,{centered:!0,closeModal:s},c.createElement(aI.rQ,null,c.createElement(aI.Rc,{title:aJ.t("Add people individually")})),c.createElement(aI.$m,{className:"margin_150 p-members_add_individual__modal_content"},c.createElement(aq.h,{focusOnMount:!0,selectId:"modernselling-add-individual",width:"100%",maxHeight:230,className:"margin_25",expandOnFocus:_(),dynamicHeight:!0,placeholderText:aJ.t("Search by name"),searcherOptions:u,onSelectedItemsChange:f,processOptions:p,renderOption:g})),c.createElement(aI.jl,null,c.createElement(aI.ox,null,c.createElement(t$.Ay,{type:"outline",onClick:s},aJ.t("Cancel")),c.createElement(t$.Ay,{type:"primary",onClick:h,disabled:!t.length},o()))))};AddIndividualModal.displayName="AddIndividualModal";let aZ=(0,e5.Ay)("Opens Add Individual Modal",e=>{e((0,ti.q)({element:c.createElement(AddIndividualModal,null)}))});aZ.meta={name:"openAddIndividualModal",key:"createThunkOpenAddIndividualModal",description:"Opens Add Individual Modal"};var aX=a(0xc8b3fd9b),a0=a(0x1db69cda);let a1=(0,e0.A)("salesHome.admin.removeMembers generated fetcher",(e,t,a)=>new eZ.S((n,i)=>{let{abortSignal:l,reason:r,...o}=a,s=(0,e2.VA)(o);e((0,eX.apiCall)({method:"salesHome.admin.removeMembers",args:s,abortSignal:l,reason:r})).then(e=>{n(e)}).catch(e=>{(0,e1.Ay)({getState:t}).error(`API call to salesHome.admin.removeMembers with reason ${r} failed, initiated by generated fetcher`),i(e)})}));a1.meta={name:"salesHomeAdminRemoveMembersFetcher",key:"createFetcherSalesHomeAdminRemoveMembersFetcher",description:"salesHome.admin.removeMembers generated fetcher"};let a2=(0,e5.Ay)("Revokes Sales Home access for users and removes them from paginated Sales Home members list",async(e,t,{users:a,salesforceOrgId:n})=>{if(!n)return;let i=(0,F._N)(t()),l=(0,F.C6)(t()),{removed_user_ids:r,not_removed_user_ids:o,ok:s}=await e(a1({users:a,salesforceOrgId:n,reason:"sales-home-remove-members"}));return r?.length&&((0,aX.A)(i,e=>r.includes(e)),e((0,W.oU)((0,a0.A)(i))),e((0,W.gT)(l-r.length))),{notRemovedIds:o,ok:s}});a2.meta={name:"removeMembersBySalesforceOrgId",key:"createThunkRemoveMembersBySalesforceOrgId",description:"Revokes Sales Home access for users and removes them from paginated Sales Home members list"};let a4=new p.Ay("modernselling"),RemoveAccessModal=({onRemoveErrorHandler:e,removeAdminsText:t})=>{let a=(0,d.wA)(),n=(0,I.d4)(F.rg),[i,l]=(0,c.useState)([]),r=(0,c.useMemo)(()=>i.length>0?a4.rt("Remove access from {numUsers, plural, one {# Person} other {# People}}",{numUsers:i.length}):a4.rt("Remove access"),[i.length]),o=(0,c.useCallback)(()=>{a((0,tC.O)())},[a]),s=(0,c.useMemo)(()=>({entities:{members:{includeSelf:!1,includeExternal:!1,includeAllExternal:!1,includeSlackbot:!1,includeBots:!1,includeDeleted:!1,includeGuests:!1,includeProfileOnlyUsers:!1,matchEmailField:!0}},allowEmptyQuery:!0,sort:{source:"sales-home-remove-access",frecency:!0},limit:7,filter:e=>!e.is_invited_user}),[]),u=(0,c.useCallback)(e=>a(aQ({reason:"sales-home-get-members-access-info",userId:e.entity.id,salesforceOrgId:n??""})).then(t=>{let a="";return t.hasAccess||(a=a4.t("Does not have access")),t.isSalesAdmin&&(a=a4.t("Sales admin")),{...e,isDisabled:!t.hasAccess||t.isSalesAdmin,inviteExceptionReason:a}}),[a,n]),m=(0,c.useCallback)(e=>{let t=e.map(e=>u(e));return eZ.S.all(t).then(e=>eZ.S.resolve(e))},[u]),p=(0,c.useCallback)(e=>c.createElement(aG.A,{id:e.value,member:e.entity,secondaryContent:e.inviteExceptionReason}),[]),g=(0,c.useCallback)(e=>{l(e.map(e=>e.entity.id))},[]),f=(0,c.useCallback)(()=>!i.length,[i.length]),_=(0,c.useCallback)(()=>{a(a2({salesforceOrgId:n,users:i})).then(t=>{t?.notRemovedIds.length&&e(aE.o.FailedForSomeUsers,t?.notRemovedIds?.length,i.length-t?.notRemovedIds.length),a((0,eV.M)({element:c.createElement(eH.A,{svgIconProps:{name:"check-circle"},duration:3e3,position:"bottom-right"},a4.t("Access removed for {numRemovedMembers, plural, one {# Person} other {# People}}",{numRemovedMembers:i.length}))}))}).finally(()=>{o()})},[a,o,e,i,n]);return c.createElement(aI.dW,{centered:!0,closeModal:o},c.createElement(aI.rQ,null,c.createElement(aI.Rc,{title:a4.t("Remove access")})),c.createElement(aI.$m,{className:"p-member_table__remove_access_modal"},c.createElement("p",{className:"margin_bottom_125 padding_left_25"},t),c.createElement(aq.h,{focusOnMount:!0,selectId:"sales-home-remove-access",width:"100%",maxHeight:230,className:"margin_25",expandOnFocus:f(),dynamicHeight:!0,placeholderText:a4.t("Search by name"),searcherOptions:s,onSelectedItemsChange:g,processOptions:m,renderOption:p})),c.createElement(aI.jl,null,c.createElement(aI.ox,null,c.createElement(t$.Ay,{type:"outline",onClick:o},a4.t("Cancel")),c.createElement(t$.Ay,{type:"danger",onClick:_,disabled:!i.length},r))))};RemoveAccessModal.displayName="RemoveAccessModal";let a5=(0,e5.Ay)("Opens remove members modal",(e,t,{onRemoveErrorHandler:a,removeAdminsText:n})=>{e((0,ti.q)({element:c.createElement(RemoveAccessModal,{onRemoveErrorHandler:a,removeAdminsText:n})}))});a5.meta={name:"openRemoveAccessModal",key:"createThunkOpenRemoveAccessModal",description:"Opens remove members modal"};let a8=new p.Ay("modernselling"),RemoveMembersModal=({membersToRemove:e,onRemoveErrorHandler:t,setSelectedMembers:a})=>{let n=(0,d.wA)(),i=(0,c.useCallback)(()=>{n((0,tC.O)())},[n]),l=(0,I.d4)(F.rg),r=(0,I.d4)(F.Ey),o=a8.t("Remove {count, plural, one {this person} other {# people}}?",{count:e.length}),s=e[0]?.real_name||e[0]?.name,u=a8.t("{count, plural, one {Access removed from {name}.} other {Access removed from # people.}}",{count:e?.length,name:e?.length&&s}),m=e.map(e=>e.id),p=(0,c.useCallback)(async()=>{try{let e=await n(a2({salesforceOrgId:l,users:m}));e?.notRemovedIds?.length&&t(aE.o.FailedForSomeUsers,e?.notRemovedIds?.length,m.length-e?.notRemovedIds?.length),e?.ok&&(a([]),n((0,eV.M)({element:c.createElement(eH.A,{svgIconProps:{name:"check-circle"},duration:3e3,position:"bottom-right"},u)})))}catch(a){let e=a.data;switch(e.error){case aE.o.FailedForSomeUsers:t(aE.o.FailedForSomeUsers,e.invalid_user_ids.length,m.length-e.invalid_user_ids.length);break;case aE.o.NoValidUsers:t(aE.o.NoValidUsers,m.length);break;default:t(e.error)}}n((0,tC.O)())},[n,l,m,t,a,u]),g=r?a8.rt("{count, plural, one {{name}} other {They}} will no longer have access to view the Sales tab using {orgName} in Slack. However, they won\u2019t be removed from any channels.",{count:e.length,name:s,orgName:r.name}):a8.rt("{count, plural, one {{name}} other {They}} won\u2019t be able to view the Sales tab in Slack. They won\u2019t be removed from any channels.",{count:e.length,name:s});return c.createElement(aI.dW,{centered:!0,closeModal:i},c.createElement(aI.rQ,null,c.createElement(aI.Rc,{title:o})),c.createElement(aI.$m,null,c.createElement(aI.qf,null,c.createElement("p",null,g)),c.createElement(aI.jl,null,c.createElement(aI.ox,null,c.createElement(aI.s_,{type:"outline","aria-label":a8.t("Cancel")},a8.t("Cancel")),c.createElement(R.Ay,{type:"danger",onClick:p,"aria-label":a8.t("Remove")},a8.t("Remove"))))))};RemoveMembersModal.displayName="RemoveMembersModal";let a7=(0,e5.Ay)("Opens remove members modal",(e,t,a)=>{e((0,ti.q)({element:c.createElement(RemoveMembersModal,a)}))});a7.meta={name:"openRemoveMembersModal",key:"createThunkOpenRemoveMembersModal",description:"Opens remove members modal"};let a6=(0,e0.A)("sfdc.integration.elevateMigration.startManual generated fetcher",(e,t,a)=>new eZ.S((n,i)=>{let{abortSignal:l,reason:r,...o}=a,s=(0,e2.VA)(o);e((0,eX.apiCall)({method:"sfdc.integration.elevateMigration.startManual",args:s,abortSignal:l,reason:r})).then(e=>{n(e)}).catch(e=>{(0,e1.Ay)({getState:t}).error(`API call to sfdc.integration.elevateMigration.startManual with reason ${r} failed, initiated by generated fetcher`),i(e)})}));a6.meta={name:"sfdcIntegrationElevateMigrationStartManualFetcher",key:"createFetcherSfdcIntegrationElevateMigrationStartManualFetcher",description:"sfdc.integration.elevateMigration.startManual generated fetcher"};let a3=(0,e5.Ay)("Sales admin action to start a manual migration for elevate changing perm management from Slack to Salesforce. Only relevant to orgs that upgraded to seamless auth",async(e,t,{selectedSalesforceOrg:a})=>{await e(a6({reason:"starting-manual-migration",salesforceOrgId:a.salesforce_org_id})),e((0,tg._)()),e((0,W.Ox)({...a,migration_status:"in_progress",is_legacy_elevate_org:!1}))});a3.meta={name:"startManualElevateMigration",key:"createThunkStartManualElevateMigration",description:"Sales admin action to start a manual migration for elevate changing perm management from Slack to Salesforce. Only relevant to orgs that upgraded to seamless auth"};var a9=a(0x12836eac0);let ne=new p.Ay("modernselling"),MemberManagementPanel=()=>{let e=(0,I.d4)(eK.FP),t=(0,d.wA)(),[a,n]=(0,c.useState)([]),[i,l]=(0,c.useState)(!1),[r,o]=(0,c.useState)(!1),[s,u]=(0,c.useState)(!1),p=(0,c.useRef)(),g=(0,c.useRef)(),[f,_]=(0,c.useState)(0),[h,b]=(0,c.useState)(0),[y,A]=(0,c.useState)(),[E,S]=(0,c.useState)({}),[C,v]=(0,c.useState)(tK.Pg.DESC),x=(0,I.d4)(F._N),w=(0,I.d4)(F.lW),O=(0,I.d4)(a9.xo),k=(0,I.d4)(F.C6),N=(0,I.Z2)(e=>{let t=(0,eN.gA)(e,x).slice(0);return t.forEach(e=>{e.date_create=E[e.id]}),(0,tq.A)(t,"date_create",C)}),T=(0,I.d4)(F.rg),M=(0,I.d4)(F.Ey),D=M?.migration_status==="not_started",R=M?.migration_status==="complete"||M?.migration_status==="needs_attention",P=!!M?.is_legacy_elevate_org,H=M?.migration_status==="needs_attention",V=e&&P&&D,j=!V&&P&&D,G=(0,c.useCallback)(e=>N?N.filter(t=>e.includes(t.id)):[],[N]),q=(0,c.useCallback)(e=>e.id,[]),Y=a.map(e=>q(e)),{data:z,loading:$,isFirstFetch:Q,fetchMoreData:J,refetchData:Z}=(0,av.g)({fetcher:aC,args:{reason:"fetching-selected-org-members",salesforceOrgId:T??"",limit:tN.ZJ,sortDir:C}}),X=k>0&&k===x.length;(0,c.useEffect)(()=>{if(!$&&z){t((0,W.gT)(z.total_count));let e=new Set,a=new Set,n={};z.users.forEach(t=>{e.add(t.user_id),t.is_sales_admin&&a.add(t.user_id),n[t.user_id]=t.date_create}),S(e=>({...e,...n})),t((0,W.oU)([...x,...e])),t((0,W.ZQ)([...w,...a]))}},[z,t,$]),(0,c.useEffect)(()=>{Q&&(t((0,W.gT)(0)),S({}),t((0,W.oU)([])),t((0,W.ZQ)([])),n([]))},[Q,t]);let ee=$&&!Q&&!X,et=$&&Q,ea=(0,c.useCallback)((e,t,a)=>{A(e),t&&_(t),a&&b(a)},[]),en=(0,c.useCallback)(({text:e})=>c.createElement(tx.A,{articleId:0x15d3f36a6e5,hash:"modify-system-roles",forceOpenInBrowser:!0},e),[]),ei=ne.rt("Sales admins have access to all orgs. To remove their access, an Org Owner will need to hop over to Slack admin permissions to remove their Sales Admin Role.",{"":en,fallbackHash:"d3e7c75072e979a8b0f3ed9a4e417fd2b1885891"}),el=(0,c.useCallback)(()=>t(aj()),[t]),er=(0,c.useCallback)(()=>t(aZ()),[t]),eo=(0,c.useCallback)(()=>t(a5({onRemoveErrorHandler:ea,removeAdminsText:ei})),[t,ea,ei]),es=(0,c.useCallback)(()=>{null!==M&&t(a3({selectedSalesforceOrg:M}))},[t,M]),ec=(0,c.useCallback)(e=>c.createElement(tJ.Ay,{width:"auto",...e},c.createElement(U.A,{label:ne.t("Add individually",{fallbackHash:"98f50f5e8eeb5622c7312e21f3a2b28048b21a45"}),onSelected:er}),c.createElement(U.A,{label:ne.t("Add by CSV"),onSelected:el})),[er,el]),ed=(0,c.useMemo)(()=>P?c.createElement("div",{className:"display_flex"},c.createElement(L.cQ,{position:"bottom-right",renderMenu:ec,offsetY:8},c.createElement(t$.Ay,{size:"medium",type:"outline",className:"margin_right_75"},c.createElement("span",{className:"margin_right_25"},ne.t("Add People")),c.createElement(B.Ah,{name:"caret-down"}))),c.createElement(t$.Ay,{size:"medium",type:"outline",onClick:eo},ne.t("Remove Access"))):void 0,[P,eo,ec]),eu=(0,c.useCallback)(async()=>{l(!0),o(!1),t(aS({reason:"exporting-sales-members-to-csv",salesforceOrgId:T??""})).then(()=>{u(!0),p.current=setTimeout(()=>{u(!1)},5e3),t((0,eV.M)({element:c.createElement(eH.A,{svgIconProps:{name:"download"}},ne.rt("Generating CSV. It will be sent to you in Slack when it\u2019s ready."))}))}).catch(()=>{o(!0)}).finally(()=>{l(!1)})},[t,T]),em=(0,c.useCallback)(({selectedRows:e})=>{n(G(e))},[G]),ep=(0,c.useCallback)(()=>{n([])},[n]),eg=(0,c.useCallback)(()=>{let e=g.current;e&&t((0,ax.b)({memberId:q(e)}))},[t,q]),ef=(0,c.useCallback)(e=>{let i=g.current,l=[];"multiple"===e&&a.length?l=[...a]:i&&(l=[i]),t(a7({membersToRemove:l,onRemoveErrorHandler:ea,setSelectedMembers:n}))},[a,t,ea]),e_=(0,c.useCallback)((e,t)=>c.createElement(tJ.Ay,{...e,width:350},c.createElement(U.A,{label:ne.t("View profile"),onSelected:eg}),!t&&c.createElement(U.A,{label:ne.t("Remove access"),danger:!0,onSelected:ef})),[eg,ef]),eh=(0,c.useMemo)(()=>a.length?[{text:ne.t("Remove access"),onClick:()=>{ef("multiple")},dataQaPrefix:"remove-access"}]:et?tz.Ml:[{text:s?ne.t("Export started\u2026",{fallbackHash:"5755f9ac0aa1684e2f9b3ec6aaede10380d0607b",fallbackHashNs:"enterprise_dashboard"}):ne.t("Export full member list"),onClick:eu,isDisabled:i||s,shouldShowSpinner:s,dataQaPrefix:"sales-admin-members_csv",tooltipProps:{position:"bottom",tip:ne.t("Your CSV may take time to generate. Once it\u2019s ready, it\u2019ll be sent to you in Slack.",{fallbackHash:"3dde283301a4c9ec3cad8dbfa0116de856079a68",fallbackHashNs:"enterprise_dashboard"})}}],[s,i,et,ef,a.length,eu]),eb=(0,c.useCallback)(({rowData:e})=>c.createElement(ab.Ay,{className:"p-member_table__member_entity",id:q(e),showStatus:!1,showPresence:!1}),[q]),ey=(0,c.useCallback)(({rowData:e})=>c.createElement("p",{className:"p-member_table__date-added"},ne.t("Added {formattedDate}",{formattedDate:(0,tY.A)(e.date_create,{shortenMonth:!0,shortenDay:!0})})),[]),eA=(0,c.useCallback)(({rowData:e})=>{let t=w.includes(e.id);return c.createElement(L.cQ,{renderMenu:a=>(g.current=e,e_(a,t)),position:"bottom-left"},c.createElement(eI.A,{"aria-label":ne.t("Member actions")},c.createElement(B.Ah,{size:"16",name:"ellipsis-horizontal-filled",inline:!0})))},[e_,w]),eE=(0,c.useCallback)(({rowData:e})=>w.includes(e.id),[w]),eS=(0,c.useCallback)(({rowData:e})=>(0,ek.zY)(e),[]),eC=(0,c.useCallback)(({rowData:e})=>{if(w.includes(e.id))return c.createElement("div",{className:"p-member_table__sales_admin_indication"},ne.t("Sales admin"))},[w]),ev=(0,c.useCallback)(({sortDirection:e})=>v(e),[v]),ex=ne.rt("Couldn\u2019t remove access from {count} {count, plural, one {person} other {people}}",{count:f}),ew=ne.rt("Access removed from {membersRemovedCount} {membersRemovedCount, plural, one {person} other {people}}, but couldn\u2019t be removed from {membersNotRemovedCount} {membersNotRemovedCount, plural, one {person} other {people}}.",{membersRemovedCount:h,membersNotRemovedCount:f}),eO=(0,c.useCallback)(()=>{A(void 0),_(0),b(0)},[]),eT=(0,c.useMemo)(()=>ne.t("{count} {count, plural, =1 {person} other {people}}",{count:k}),[k]),eF=!et&&!f&&0===N.length,eM=!et&&N.length>0;return c.createElement(m.A,{uiComponentName:eU.UiComponentName.LOB_MEMBER_TABLE},c.createElement(PanelHeader,{actions:ed},ne.t("People")),y&&f&&c.createElement(aA.A,{className:"p-member_table__alert margin_bottom_75 ",onDismiss:eO,iconType:"info-circle",useRoundedCorners:!1,theme:ay.B.ERROR},y===aE.o.FailedForSomeUsers?ew:ex),P&&!D&&c.createElement(c.Fragment,null,c.createElement("p",{className:"margin_bottom_0"},ne.rt("People on this list can view and manage Salesforce {currentOrg} data on Slack\u2019s Sales tab.",{currentOrg:M?.name})),c.createElement("p",{className:"margin_bottom_100"},ei)),!P&&!R&&c.createElement(K.Ay,{level:"info"},ne.t("To manage Sales Elevate users, use the Salesforce permission set or contact a Salesforce admin.")),V&&c.createElement(K.Ay,{level:"info"},e?ne.t("Starting a manual migration will sync all user permissions, so make sure you\u2019ve set permissions for selected Salesforce users before starting. After starting, reach out to your Slack partner to monitor and complete the migration progress."):"Starting a manual migration will sync all user permissions, so make sure you\u2019ve set permissions for selected Salesforce users before starting. After starting, reach out to your Slack partner to monitor and complete the migration progress.",c.createElement("div",null,c.createElement(t$.Ay,{size:"medium",type:"outline",className:"margin_top_25",onClick:es},e?ne.t("Begin Manual Migration"):"Begin Manual Migration"))),j&&c.createElement(StartMigrationAlert,null),!V&&H&&c.createElement(MigrationPartialSuccessAlert,{refetchUsers:Z}),R&&c.createElement(MigrationCompleteAlert,null),r&&c.createElement(K.Ay,{className:"margin_top_50 margin_bottom_100",level:K.A_.error},ne.t("Unable to export your CSV. Please wait a minute and try again.",{fallbackHash:"827a493fe3b4b57ac434617bddfa73f967d76277",fallbackHashNs:"admin"})),c.createElement("div",{className:"p-member_table__header"},c.createElement(ah.A,{onClearSelected:ep,selectedObjectsCount:a.length,className:"p-member_table__header-custom",hideCount:et,totalCountLabel:eT,actions:eh,hideShowSelected:!0})),c.createElement(PanelSectionsContainer,{className:"flex_one p-member_table__panel_container"},c.createElement(PanelSectionPlain,{hasTable:!0,isLoading:et,className:"p-member_table__panel_section"},eF&&c.createElement(tQ.A,{title:ne.t("Set up members for your team"),description:ne.t("Add team members to help your sales team stay in the know with less effort."),isExtended:!0}),eM&&N&&c.createElement(tZ._,{showHeader:!0,showSelectAll:!1,data:N,ariaLabel:ne.t("Sales Elevate Users Table"),selectedRows:Y,onRowSelect:em,rowIdKey:"id",checkboxAriaLabel:ne.t("Select member"),isLoading:et,onSort:ev,sortBy:O.sortBy,sortDirection:C,isFetchingMoreRows:ee,fetchMoreRows:X?null:J,checkboxDisabled:eE,renderTableSelectColumn:P},c.createElement(tK.Ve,{label:ne.t("User"),headerAriaLabel:ne.t("User"),dataKey:"name",width:370,flexGrow:2,getCellData:eb}),c.createElement(tK.Ve,{label:ne.t("Email"),headerAriaLabel:ne.t("Email"),dataKey:"email",getCellData:eS,width:350,flexGrow:2}),c.createElement(tK.Ve,{label:ne.t("Role"),headerAriaLabel:ne.t("Role"),dataKey:"role",width:175,flexGrow:1,getCellData:eC}),c.createElement(tK.Ve,{sortable:!0,label:ne.t("Date Added"),headerAriaLabel:ne.t("Date Added"),dataKey:"date_created",width:220,flexGrow:1,getCellData:ey}),P&&c.createElement(tK.Ve,{label:ne.t("Actions"),headerAriaLabel:ne.t("Actions"),dataKey:"menu",width:80,flexGrow:1,getCellData:eA})))))};MemberManagementPanel.displayName="MemberManagementPanel";var nt=a(0xb9dbe72d),na=a(0x16f1d7d2b),nn=a(0x126f22530),ni=a(0x1f58f3ef3),nl=a(0x1233d3890),nr=a.n(nl);let AdvancedFilterOperatorWrapper=({children:e})=>c.createElement("div",{className:nr().advancedFilterOperatorWrapper},e);AdvancedFilterOperatorWrapper.displayName="AdvancedFilterOperatorWrapper";let no=new p.Ay("modernselling"),ns="closing-soon-within-the-next-days",nc={default:"50","advanced-conditions":"25"},getDayOption=e=>({label:no.t("{closingInValue, plural, one {Day} other {Days}}",{closingInValue:e}),value:"day"}),ClosingSoonWithinLabel=()=>c.createElement(eb.A,{htmlFor:ns,text:no.t("Closing within the next \u2026")});ClosingSoonWithinLabel.displayName="ClosingSoonWithinLabel";let ClosingSoonWithinField=({appearance:e,value:t,onChange:a,onBlur:n,errors:i})=>c.createElement(ae.c,{space:nc[e],alignY:"baseline"},c.createElement("div",{className:"flex_one"},c.createElement(nn.A,{useInlineAlert:!0,isRequired:!0,id:ns,errorText:i?i[0]?.message:null,"aria-label":no.t("is within how many days the opportunity is closing"),"aria-invalid":i&&i.length?"true":"false",className:"no_bottom_margin",name:"closing-soon-within-the-next-days-name",type:"number",min:0,max:9999,value:t,onChange:a,onBlur:n})),"default"===e&&c.createElement("div",{className:"flex_one","aria-hidden":!0},getDayOption(t).label?.toString().toLocaleLowerCase()),"advanced-conditions"===e&&c.createElement(AdvancedFilterOperatorWrapper,null,c.createElement("span",{"aria-hidden":!0},c.createElement(el.Ay,{isDisabled:!0,options:ni.a4,selectedOption:getDayOption(t),width:"auto"}))));ClosingSoonWithinField.displayName="ClosingSoonWithinField";let ClosingSoonWithin=({appearance:e,value:t,onChange:a,onBlur:n,errors:i})=>c.createElement(eS.B,{space:"0"},c.createElement(ClosingSoonWithinLabel,null),c.createElement(ClosingSoonWithinField,{appearance:e,value:t,errors:i,onChange:a,onBlur:n}));ClosingSoonWithin.displayName="ClosingSoonWithin";let nd=new p.Ay("modernselling");function renderClosingSoonFieldPrimaryCondition({handleBlur:e,handleChange:t,errors:a,values:n}){let i=nd.t("is within"),l=nd.t("Close date"),r=[{value:null,label:i}],o=[{value:null,label:l}];return i=>c.createElement(c.Fragment,null,!i&&c.createElement(ClosingSoonWithin,{appearance:"default",value:n.closingIn,errors:a.closingIn,onChange:t("closingIn"),onBlur:e("closingIn")}),i&&c.createElement(eS.B,{space:"25"},c.createElement(ae.c,{space:"25",alignY:"start"},c.createElement(el.Ay,{isDisabled:!0,ariaLabel:nd.t("Close date is within"),options:o,selectedOption:o[0],width:"100%",className:"flex_one"}),c.createElement(AdvancedFilterOperatorWrapper,null,c.createElement("div",{"aria-hidden":!0},c.createElement(el.Ay,{isDisabled:!0,options:r,selectedOption:r[0],width:"auto"})))),c.createElement(ClosingSoonWithinField,{appearance:"advanced-conditions",value:n.closingIn,errors:a.closingIn,onChange:t("closingIn"),onBlur:e("closingIn")})))}renderClosingSoonFieldPrimaryCondition.displayName="renderClosingSoonFieldPrimaryCondition";var nu=a(0x1be40479b),nm=a(0x5a5c86cb),np=a(0x155f83bf4),ng=a(0x2080006ef),nf=a(0x200abc41e),n_=a(0x423b2bde),nh=a(0x1e586fbba),nb=a(0x6f20b262);let ny=new p.Ay("modernselling"),StringSchemaInput=({error:e,fieldSchema:t,onBlur:a,onChange:n,value:i})=>{let l=(0,c.useCallback)(e=>n([{type:nb.Yf.StringValue,value:e}]),[n]);return c.createElement("div",{className:"full_width"},c.createElement(nn.A,{id:i.id,name:i.id,"aria-label":ny.t("Value for {name}",{name:t.label}),isInvalid:!!e,onBlur:a,onChange:l,value:`${i.rhs?.[0]?.value??""}`,placeholder:ny.t("Enter a value\u2026")}),e&&c.createElement(nh.A,null,e.message))};StringSchemaInput.displayName="StringSchemaInput";var nA=a(0x1450587d7);let Null=()=>null;function filterUnsupportedOperators(e,t){return(0,nm.A)(t,(t,a)=>!e.unsupported_filter_conditions?.includes(a))}let nE={},nS={[nb.hu.IsEmptyFilterCondition]:Null,[nb.hu.IsNotEmptyFilterCondition]:Null},nC={[nb.hu.EqualsFilterCondition]:nA.sq,[nb.hu.DoesNotEqualFilterCondition]:nA.sq,[nb.hu.ContainsFilterCondition]:StringSchemaInput,[nb.hu.DoesNotContainFilterCondition]:StringSchemaInput,[nb.hu.StartsWithFilterCondition]:StringSchemaInput,[nb.hu.EndsWithFilterCondition]:StringSchemaInput},nv={[nb.hu.EqualsFilterCondition]:nA.IW,[nb.hu.DoesNotEqualFilterCondition]:nA.IW,[nb.hu.GreaterThanFilterCondition]:ng.v,[nb.hu.LessThanFilterCondition]:ng.v},nx={[nb.hu.EqualsFilterCondition]:nA.jq,[nb.hu.DoesNotEqualFilterCondition]:nA.jq,[nb.hu.GreaterThanFilterCondition]:ng.W,[nb.hu.LessThanFilterCondition]:ng.W},nw={[nb.hu.SetEqualsFilterCondition]:n_.j,[nb.hu.SetNotEqualsFilterCondition]:n_.j};function getBaseComponents(e){return{...e.is_nullable?nS:{}}}function getSelectFieldSetOperators(e){return e.is_multi_select?nw:{[nb.hu.EqualsFilterCondition]:n_.j,[nb.hu.DoesNotEqualFilterCondition]:n_.a}}let nO={[A.gI.DateSchemaField]:e=>filterUnsupportedOperators(e,{...nE}),[A.gI.DateTimeSchemaField]:e=>filterUnsupportedOperators(e,{...nE}),[A.gI.BooleanSchemaField]:e=>filterUnsupportedOperators(e,{[nb.hu.EqualsFilterCondition]:np.m,[nb.hu.DoesNotEqualFilterCondition]:np.m,...getBaseComponents(e)}),[A.gI.ReferenceSchemaField]:e=>filterUnsupportedOperators(e,{[nb.hu.EqualsFilterCondition]:nf._,[nb.hu.DoesNotEqualFilterCondition]:nf._,...getBaseComponents(e)}),[A.gI.CurrencySchemaField]:e=>filterUnsupportedOperators(e,{...nv,...getBaseComponents(e)}),[A.gI.DoubleSchemaField]:e=>filterUnsupportedOperators(e,{...nv,...getBaseComponents(e)}),[A.gI.LongSchemaField]:e=>filterUnsupportedOperators(e,{...nx,...getBaseComponents(e)}),[A.gI.StringSchemaField]:e=>filterUnsupportedOperators(e,{...nC,...getBaseComponents(e)}),[A.gI.EmailSchemaField]:e=>filterUnsupportedOperators(e,{...nC,...getBaseComponents(e)}),[A.gI.URLSchemaField]:e=>filterUnsupportedOperators(e,{...nC,...getBaseComponents(e)}),[A.gI.SelectSchemaField]:e=>filterUnsupportedOperators(e,{...getSelectFieldSetOperators(e),...getBaseComponents(e)})},nk=new p.Ay("modernselling");function getTimePeriodOperatorList(e){return[{label:nk.t("Value"),value:"",options:[{key:nb.hu.IsEmptyFilterCondition,value:nb.hu.IsEmptyFilterCondition,label:e[nb.hu.IsEmptyFilterCondition]},{key:nb.hu.IsNotEmptyFilterCondition,value:nb.hu.IsNotEmptyFilterCondition,label:e[nb.hu.IsNotEmptyFilterCondition]}]}]}function getAmountOperatorList(e){return[{label:nk.t("Value"),value:"",options:[{key:nb.hu.GreaterThanFilterCondition,value:nb.hu.GreaterThanFilterCondition,label:e[nb.hu.GreaterThanFilterCondition]},{key:nb.hu.LessThanFilterCondition,value:nb.hu.LessThanFilterCondition,label:e[nb.hu.LessThanFilterCondition]},{key:nb.hu.EqualsFilterCondition,value:nb.hu.EqualsFilterCondition,label:e[nb.hu.EqualsFilterCondition]},{key:nb.hu.DoesNotEqualFilterCondition,value:nb.hu.DoesNotEqualFilterCondition,label:e[nb.hu.DoesNotEqualFilterCondition]},{key:nb.hu.IsEmptyFilterCondition,value:nb.hu.IsEmptyFilterCondition,label:e[nb.hu.IsEmptyFilterCondition]},{key:nb.hu.IsNotEmptyFilterCondition,value:nb.hu.IsNotEmptyFilterCondition,label:e[nb.hu.IsNotEmptyFilterCondition]}]}]}function useAdvancedFilterOptionsOperators(e,t){let a=(0,c.useMemo)(()=>Object.keys(t||{}),[t]),n=(0,c.useMemo)(()=>(0,eo.Cj)(),[]);return(0,c.useMemo)(()=>{if(e===A.gI.DateSchemaField){let e=getTimePeriodOperatorList(n);return[a.join("-"),e]}if(e===A.gI.CurrencySchemaField)return[a.join("-"),getAmountOperatorList(n)];let t=(0,en.A)(a.map(e=>{let t=n[e];return t?{key:e,value:e,label:t}:null}));return[a.join("-"),t.sort(ec.JC)]},[e,a,n])}let nN=new p.Ay("modernselling"),AdvancedFilterOptionsField=({id:e,errors:t,fieldOptions:a,fieldSchema:n,focusOnMount:i,isRemovable:l,labelText:r,onBlur:o,onChange:s,onRemove:d,value:u})=>{let m=!l,p=(0,ei.A)(),g=(0,ei.A)(),f=(0,c.useMemo)(()=>n&&nO[n.type]?.(n,{}),[n]),[_,h]=useAdvancedFilterOptionsOperators(n?.type,f),b=(0,c.useMemo)(()=>a.find(e=>{let{fieldId:t}=e.extras;return t===u.schema_field_id}),[a,u.schema_field_id]),y=(0,ec.FT)(h).find(e=>e.value===u.type),A=y&&f?.[y.value],E=(0,c.useCallback)(()=>d(e),[e,d]),S=(0,c.useCallback)(()=>o(e,"field"),[e,o]),C=(0,c.useCallback)(()=>o(e,"operator"),[e,o]),v=(0,c.useCallback)(()=>o(e,"value"),[e,o]),x=(0,c.useCallback)(t=>{let{fieldId:a}=t.extras;s({id:e,schema_field_id:a})},[e,s]),w=(0,c.useCallback)(e=>{s({...u,type:e.value})},[s,u]),O=(0,c.useCallback)(e=>s({...u,rhs:e}),[s,u]),k=(0,c.useMemo)(()=>t?.find(e=>"value"===e.location),[t]),N=(0,c.useMemo)(()=>t?.filter(e=>"field"===e.location),[t]),T=(0,c.useMemo)(()=>t?.filter(e=>"operator"===e.location),[t]);return c.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_filter_options__field"},c.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field__row"},c.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field__label"},r),c.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field__controls"},c.createElement(R.Nm,{"aria-disabled":m,"aria-label":nN.t("Remove condition"),disabled:m,onClick:E},c.createElement("span",{className:m?"sk_soft_gray cursor_default":void 0},c.createElement(B.Ah,{name:"trash",size:"20"}))))),c.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field__row"},c.createElement(er.Ay,{ariaLabel:nN.t("Select an opportunity field"),errors:N,isInvalid:!!N?.length,isRequired:!0,minOptionsListWidth:200,onOptionsListClose:S,onOptionSelected:x,options:a,placeholderText:nN.t("Select field\u2026"),selectedOption:b,selectId:p,focusOnMount:i,expandOnFocus:!1,className:"flex_one"}),c.createElement(AdvancedFilterOperatorWrapper,null,c.createElement(el.Ay,{key:`${b?.value}-${_}`,ariaLabel:nN.t("Select operator"),errors:b&&T,isRequired:!0,isDisabled:!b,onOptionsListClose:C,onOptionSelected:w,options:h,placeholderText:nN.t("Select operator\u2026"),selectedOption:y,selectId:g,width:"auto"}))),n&&y&&A&&c.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field__row"},c.createElement(A,{id:e,error:k,operator:y.value,fieldSchema:n,onBlur:v,onChange:O,value:u,isAdmin:!0})))};AdvancedFilterOptionsField.displayName="AdvancedFilterOptionsField";var nT=a(0x1aa941557);function useAdvancedFilterOptionsFieldData({opportunitySchema:e}){let t=(0,c.useMemo)(()=>(e?.fields||[]).filter(({is_active:e,type:t})=>!1!==e&&!!nO[t]),[e]),a=(0,c.useMemo)(()=>(0,nT.A)(t,"id"),[t]);return{fieldOptions:(0,c.useMemo)(()=>(0,em.D0)(t),[t]),fieldSchemaById:a,defaultCondition:(0,c.useMemo)(()=>[(0,em.Gv)()],[])}}let nI=new p.Ay("modernselling"),AdvancedFilterOptionsFields=({errors:e,hasFocusOnMount:t=!1,onChange:a,setErrors:n,advancedOptions:i,opportunitySchema:l,maxAllowedConditions:r=7,renderPrimaryCondition:o})=>{let s=(0,c.useRef)(i),d=(0,c.useRef)(e||null),{fieldOptions:u,fieldSchemaById:m}=useAdvancedFilterOptionsFieldData({opportunitySchema:l});(0,c.useEffect)(()=>{s.current=i,d.current=e||null});let p=(0,c.useCallback)(e=>{let t=d.current?.filter(t=>t.id!==e)||null;t?.length!==d.current?.length&&(d.current=t,n(d.current))},[n]),g=(0,c.useCallback)(e=>{a({...s.current,[e]:null}),p(e)},[a,p]),f=(0,c.useCallback)((e,t)=>{let a=s.current?.[e];if(!a)return;let i=d.current||[],l=(0,es.K5)(a,[t])||[],r=i.filter(a=>a.id!==e||a.id===e&&a.location!==t);if(l.length||r.length!==i.length){let e=[...r,...l];d.current=e.length?e:null,n(d.current)}},[n]),_=(0,c.useCallback)(e=>{let{id:t}=e;if(!s.current?.[t])return;let n=e.schema_field_id,i=n?m[n]:null,l=(0,em.kp)(i,e);s.current={...s.current,[t]:l},a(s.current),p(t)},[m,a,p]),h=(0,c.useMemo)(()=>(0,en.A)(Object.values(i||{})),[i]),b=(0,c.useCallback)((e,t,n=!1)=>{let i=t||[(0,em.Gv)()],l={...s.current};i.forEach(e=>{l[e.id]=e}),a(l,n)},[a]);return c.createElement(ep.v,{isWrapping:!0},c.createElement(eS.B,{space:"125",grow:"1"},c.createElement(eS.B,{space:"50"},c.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field__label"},nI.t("When")),o(!0)),h.map((a,n)=>{let{schema_field_id:i}=a;return c.createElement(AdvancedFilterOptionsField,{id:a.id,key:a.id,errors:e?.filter(e=>e.id===a.id),fieldOptions:u,fieldSchema:null!=i?m[i]:void 0,focusOnMount:t&&n===h.length-1,isRemovable:!0,labelText:nI.t("And"),onBlur:f,onChange:_,onRemove:g,value:a})}),c.createElement(R.Ay,{size:"small",type:"outline",disabled:h.length>=r,onClick:b,className:"p-sales_notifications__workflow__form__advanced_options__add_condition__width"},nI.t("Add Condition"))))};AdvancedFilterOptionsFields.displayName="AdvancedFilterOptionsFields";let nF=new p.Ay("modernselling"),AdvancedFilterOptions=({errors:e,onChange:t,setErrors:a,isLoading:n,hasFocusOnMount:i,advancedOptions:l,opportunitySchema:r,renderPrimaryCondition:o})=>c.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options"},c.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__header"},c.createElement("div",{className:"bold"},nF.t("Advanced conditions"))),c.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__content"},n&&c.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__spinner"},c.createElement(P.A,null)),!n&&r&&c.createElement(AdvancedFilterOptionsFields,{hasFocusOnMount:i,onChange:t,setErrors:a,advancedOptions:l,opportunitySchema:r,renderPrimaryCondition:o,errors:e})));AdvancedFilterOptions.displayName="AdvancedFilterOptions";let nM=new p.Ay("modernselling"),ConditionalInputsWithAdvancedFilterOptions=({advancedOptions:e,advancedOptionsErrors:t,advancedOptionsLoadError:a,isAdvancedOptionsOpenOnMount:n=!1,isLoading:i,onAdvancedOptionsChange:l,opportunitySchema:r,refetchOpportunitySchema:o,setAdvancedOptionsFieldErrors:s,renderPrimaryCondition:d})=>{let[u,m]=(0,c.useState)(n),[p,g]=(0,c.useState)(!1);(0,c.useEffect)(()=>{p||(n||l(null),m(n))},[n,p,l]);let f=(0,c.useCallback)(()=>{m(!0),g(!0)},[]),_=(0,c.useCallback)((e,t)=>{l(e),t||g(!0)},[l]);return u?!a&&(i||r)?c.createElement("div",{className:Q()("full_width margin_bottom_125")},c.createElement(AdvancedFilterOptions,{errors:t,advancedOptions:e,isLoading:i,onChange:_,opportunitySchema:r,setErrors:s,hasFocusOnMount:!n,renderPrimaryCondition:d})):c.createElement(K.Ay,{type:"boxed",level:"warning"},nM.t("There was a problem loading advanced conditions.")," ",c.createElement(R.jV,{onClick:o},nM.t("Try again?"))):c.createElement(eS.B,{space:"125"},d(!1),c.createElement(ea.A,{onClick:f},c.createElement(ae.c,{space:"25"},c.createElement(B.Ah,{size:"18",name:"settings",inline:!0}),c.createElement("span",null,nM.t("Use advanced conditions")))))};ConditionalInputsWithAdvancedFilterOptions.displayName="ConditionalInputsWithAdvancedFilterOptions";var nD=a(0x2c625329),nR=a(0xe1721148),nP=a(0x1c24ff2dd),nL=a(0x4cdd4e70),nU=a(0xc2d5849d),nB=a(0x199da57a4);let nH=new p.Ay("modernselling"),nV=[A.QO.SpecificOpportunity],ClosingSoonForm=()=>{let e=nH.t("Check upcoming close dates"),[t,a]=(0,c.useState)(!0),n=(0,e6.E)({isAdmin:!0}),[i,l]=(0,c.useState)(!1),[r,o]=(0,c.useState)(null),s=(0,I.d4)(F.Tt),d=(0,I.d4)(eN.cA),u=(0,c.useMemo)(()=>{let e=(0,eO.rJ)(d,"iso"),t=(0,ek.et)(d)??ee.vp;return{startTime:e,frequency:A.Ns.weekly,timezone:t}},[d]),m=A.YB.adminClosingSoonAlert,p=(0,c.useMemo)(()=>s?(0,eC.Ni)(s,u):{...u,title:e,account:null,advancedFilterOptions:null,channelId:null,tokenUserId:null,scope:null,closingIn:"7",sendTo:A.Oz.SalesHome,type:A.g$.AdminClosingSoon,recipientType:null,recipientRoles:null,recipientUsers:null,canvasTemplateId:null,buttonText:(0,nu.L)(m),isMutingDisabled:!1},[s,u,e,m]),{values:g,errors:f,handleBlur:_,handleChange:h,setFieldErrors:b}=(0,ev.A)({workflowView:m,initialValues:p}),y=(0,c.useCallback)(e=>{h("sendTo")(e)},[h]),E=(0,c.useCallback)(e=>()=>{_(e)()},[_]),S=(0,c.useCallback)(e=>_(e)(),[_]),C=(0,c.useCallback)((e,t)=>h(e)(t),[h]),v=(0,c.useCallback)(async()=>{a(!0),l(!1),o(null);try{let e=await n();o(e)}catch(e){l(!0)}finally{a(!1)}},[n]);(0,c.useEffect)(()=>{v()},[v]);let x=!!s?.acn?.advanced_filter_conditions?.length;return c.createElement(c.Fragment,null,c.createElement(eS.B,{space:"125"},c.createElement("div",{className:"p-sales_notifications__workflow__section"},c.createElement("div",{className:"p-sales_notifications__workflow__subtitle"},nH.t("Notification details")),c.createElement(nR.A,{errors:f.title,onBlur:_("title"),onChange:h("title"),value:g.title}),c.createElement(eS.B,{space:"125"},c.createElement(nB.Y,{frequency:g.frequency,onFrequencyChange:h("frequency"),onStartTimeBlur:_("startTime"),onStartTimeChange:h("startTime"),startTime:g.startTime,startTimeErrors:f.startTime}),c.createElement(nU.A,{isAdmin:!0,channelId:g.channelId,tokenUserId:g.tokenUserId,destination:g.sendTo,errors:f,isRecurring:!0,isEditNotification:!!s,onChannelSelectBlur:_("channelId"),onChannelSelected:h("channelId"),onTokenSelectBlur:_("tokenUserId"),onTokenSelected:h("tokenUserId"),onSendToSelected:y})),c.createElement("hr",{className:"p-sales_notifications__workflow__form__divider"}),c.createElement("div",{className:"p-sales_notifications__workflow__subtitle"},nH.t("Apply to")),c.createElement(nL.A,{isAdmin:!0,errors:f,account:g.account,ignoreScopes:nV,onScopeTypeBlur:_("scope"),onScopeTypeChange:h("scope"),onScopeValueBlur:S,onScopeValueChange:C,opportunity:null,scope:g.scope,criteria:null}),c.createElement(ConditionalInputsWithAdvancedFilterOptions,{values:g,errors:f,handleBlur:_,handleChange:h,advancedOptions:g.advancedFilterOptions||null,advancedOptionsErrors:f.advancedFilterOptions,advancedOptionsLoadError:i,isLoading:t,onAdvancedOptionsChange:h("advancedFilterOptions",!1),opportunitySchema:r,refetchOpportunitySchema:v,setAdvancedOptionsFieldErrors:b("advancedFilterOptions"),workflowView:m,isAdvancedOptionsOpenOnMount:x,renderPrimaryCondition:renderClosingSoonFieldPrimaryCondition({handleBlur:E,handleChange:h,errors:f,values:g})})),c.createElement("hr",{className:"p-sales_notifications__workflow__form__divider"})),c.createElement("div",{className:"p-sales_notifications__workflow__section"},c.createElement("div",{className:"p-sales_notifications__workflow__subtitle"},nH.t("Recipients")),c.createElement(nP.$,{hasFrontLineManagerOptions:!0,errors:f,onRecipientTypeBlur:_("recipientType"),onRecipientTypeChange:h("recipientType"),onRecipientRolesBlur:_("recipientRoles"),onRecipientRolesChange:h("recipientRoles"),onRecipientUsersBlur:_("recipientUsers"),onRecipientUsersChange:h("recipientUsers"),recipientType:g.recipientType,recipientRoles:g.recipientRoles,recipientUsers:g.recipientUsers,setRecipientRolesFieldsErrors:b("recipientRoles"),setRecipientUsersFieldsErrors:b("recipientUsers")})),c.createElement("div",{className:"p-sales_notifications__workflow__section"},c.createElement(nD.M,{isMutingDisabled:g.isMutingDisabled,onChange:h("isMutingDisabled")})))};ClosingSoonForm.displayName="ClosingSoonForm";var nW=a(0xe976659c),nj=a(0x13fb6986a),nG=a(0xfca33088),nq=a(0xc5a3e186);let nY=new p.Ay("modernselling"),nz=(0,nW.E)({amountDirection:A.Us.Increase}),n$=[nW.f.opportunity(),nW.f.closeDate("desc")];function ClosingSoonNotificationPreview(){return c.createElement(nj.A,{body:nY.rt("Here are your opportunities closing within the next 7 days"),title:nY.t("Check upcoming close dates"),imageUrl:nq},c.createElement(nG.N,{displayType:"needs_attention",columns:n$,records:nz,title:nY.t("Opportunities closing soon"),isExpandedByDefault:!0,isPreview:!0}))}ClosingSoonNotificationPreview.displayName="ClosingSoonNotificationPreview";var nQ=a(0x16ac9b089),nJ=a(0x1853b39ce),nK=a(0x1bc8d2ce4);let nZ=new p.Ay("modernselling"),getAdminPreviewDestination=(e,t,a,n)=>t&&(0,eJ.cB)(e,t,n).ok?(0,nK.x4)({channelId:t.channelId,recipientUsers:t.recipientUsers,recipientType:t.recipientType,destinationStr:a()}):null;var nX=a(0x2253dfab8),n0=a(0xd2e7c536),n1=a(0x107cfc47d);let ClosingSoonFlowPage=()=>{let e={experimentLobOrg62UnrestrictedGroupOn:(0,I.d4)(eK.Jx),experimentLobChannelAcnTokenGroupOn:(0,I.d4)(eK.V$)},t=A.YB.adminClosingSoonAlert,a=(0,I.d4)(e=>(0,F.C1)(e,t)),n=(0,I.d4)(F.Ey),i=a?((e,t,a)=>{let{ok:n}=(0,eJ.cB)(A.YB.adminClosingSoonAlert,e,a);if(!n)return"";let i=(0,nJ.a)(e),{time:l,schedule:r}=(e=>{if(!e)return{time:"",schedule:""};let{timeStr:t,scheduleStr:a}=(0,nK.eq)(e);return{time:t,schedule:a}})(e);return(({schedule:e,time:t,conditions:a,salesforceOrgName:n})=>nZ.t("Scheduled {schedule} at {time} for opportunities that meet these conditions: {conditions} in {salesforceOrgName}",{schedule:(0,nQ.Ay)(e),time:(0,nQ.Ay)(t),conditions:(0,nQ.Ay)(a),salesforceOrgName:(0,nQ.Ay)(n)}))({salesforceOrgName:t,conditions:i,time:l,schedule:r})})(a,n?.name||"",e):"",l=(0,nK.pk)(t,a),r=getAdminPreviewDestination(t,a,l,e);return c.createElement(n1.IS,null,c.createElement(n1.cp,{isAdmin:!0},c.createElement(ClosingSoonForm,null)),c.createElement(n1.OC,null,c.createElement(nX.A,{title:i}),c.createElement(ClosingSoonNotificationPreview,null),c.createElement(n0.A,{title:r})))};ClosingSoonFlowPage.displayName="ClosingSoonFlowPage";var n2=a(0xd171ec55),n4=a(0x24c2c2673),n5=a(0x1b88285e4);let n8=new p.Ay("modernselling"),n7=[],getSelectOptionsFromOpportunityFields=e=>e?e.reduce((e,t)=>(t.is_active&&e.push({label:t.label,value:t.id}),e),[]):n7,n6=new p.Ay("modernselling"),n3=[A.QO.SpecificOpportunity],n9=[nb.hu.IsEmptyFilterCondition],MissingFieldsForm=()=>{let e=n6.t("Add missing details"),t=(0,e6.E)({isAdmin:!0}),[a,n]=(0,c.useState)(!0),[i,l]=(0,c.useState)(!1),[r,o]=(0,c.useState)(null),s=getSelectOptionsFromOpportunityFields(r?.fields),d=(0,I.d4)(F.Tt),u=(0,I.d4)(eN.cA),m=(0,c.useMemo)(()=>{let e=(0,eO.rJ)(u,"iso"),t=(0,ek.et)(u)??ee.vp;return{startTime:e,frequency:A.Ns.weekly,timezone:t}},[u]),p=A.YB.adminMissingFields,g=(0,c.useMemo)(()=>d?(0,eC.MP)(d,m):{...m,title:e,missingField:null,account:null,advancedFilterOptions:null,channelId:null,tokenUserId:null,scope:null,sendTo:A.Oz.SalesHome,type:A.g$.AdminMissingFields,recipientType:null,recipientRoles:null,recipientUsers:null,canvasTemplateId:null,buttonText:(0,nu.L)(p),isMutingDisabled:!1},[d,m,e,p]),{values:f,errors:_,handleBlur:h,handleChange:b,setFieldErrors:y}=(0,ev.A)({workflowView:p,initialValues:g}),E=(0,c.useCallback)(e=>{b("sendTo")(e)},[b]),S=(0,c.useCallback)(e=>()=>{h(e)()},[h]),C=(0,c.useCallback)(e=>h(e)(),[h]),v=(0,c.useCallback)((e,t)=>b(e)(t),[b]),x=(0,c.useCallback)(async()=>{n(!0),l(!1),o(null);try{let e,a=await t();if(!a)return;let n=(e=a.fields,e?.filter(e=>!e.unsupported_filter_conditions?.some(e=>n9?.includes(e))));o({...a,fields:n})}catch(e){l(!0)}finally{n(!1)}},[t]);(0,c.useEffect)(()=>{x()},[x]);let w=!!d?.acn?.advanced_filter_conditions?.length;return c.createElement(c.Fragment,null,c.createElement(eS.B,{space:"125"},i&&c.createElement(K.Ay,{type:"boxed",level:"warning"},n6.t("There was a problem loading opportunity fields.")," ",c.createElement(n5.A,{onClick:x},n6.t("Try again?",{fallbackHash:"15ba5c6e7230f78387f72aac597a80fc61e797f4"}))),c.createElement("div",{className:"p-sales_notifications__workflow__section"},c.createElement("div",{className:"p-sales_notifications__workflow__subtitle"},n6.t("Notification details")),c.createElement(nR.A,{errors:_.title,onBlur:h("title"),onChange:b("title"),value:f.title}),c.createElement(eS.B,{space:"125"},c.createElement(nB.Y,{frequency:f.frequency,onFrequencyChange:b("frequency"),onStartTimeBlur:h("startTime"),onStartTimeChange:b("startTime"),startTime:f.startTime,startTimeErrors:_.startTime}),c.createElement(nU.A,{isAdmin:!0,channelId:f.channelId,tokenUserId:f.tokenUserId,destination:f.sendTo,errors:_,isRecurring:!0,isEditNotification:!!d,onChannelSelectBlur:h("channelId"),onChannelSelected:b("channelId"),onTokenSelectBlur:h("tokenUserId"),onTokenSelected:b("tokenUserId"),onSendToSelected:E})),c.createElement("hr",{className:"p-sales_notifications__workflow__form__divider"}),c.createElement("div",{className:"p-sales_notifications__workflow__subtitle"},n6.t("Apply to")),c.createElement(nL.A,{isAdmin:!0,errors:_,account:f.account,ignoreScopes:n3,onScopeTypeBlur:h("scope"),onScopeTypeChange:b("scope"),onScopeValueBlur:C,onScopeValueChange:v,opportunity:null,scope:f.scope,criteria:null}),c.createElement(ConditionalInputsWithAdvancedFilterOptions,{values:f,errors:_,isLoading:a,workflowView:p,opportunitySchema:r,advancedOptions:f.advancedFilterOptions,advancedOptionsLoadError:i,advancedOptionsErrors:_.advancedFilterOptions,isAdvancedOptionsOpenOnMount:w,handleBlur:h,handleChange:b,refetchOpportunitySchema:x,onAdvancedOptionsChange:b("advancedFilterOptions",!1),setAdvancedOptionsFieldErrors:y("advancedFilterOptions"),renderPrimaryCondition:(({isLoadingOpportunitySchema:e,missingFieldOptions:t,values:a,errors:n,onBlur:i,onChange:l})=>r=>{let o=[{value:null,label:n8.t("is a missing field")}];return c.createElement(c.Fragment,null,!r&&c.createElement(eb.A,{text:n8.t("Missing field")},c.createElement(er.Ay,{isRequired:!0,isLoading:e,isInvalid:!!n?.length,key:t.length,errors:n,options:t,selectedOption:t.find(e=>e.value===a.missingField?.value),onOptionSelected:l,onBlur:i,width:"100%"})),r&&c.createElement(ae.c,{space:"25",alignY:"start"},c.createElement(er.Ay,{isRequired:!0,isLoading:e,isInvalid:!!n?.length,key:t.length,ariaLabel:n8.t("Missing field"),errors:n,options:t,selectedOption:t.find(e=>e.value===a.missingField?.value),onOptionSelected:l,onBlur:i,width:"100%",className:"flex_one"}),c.createElement(AdvancedFilterOperatorWrapper,null,c.createElement("div",{"aria-hidden":!0},c.createElement(tD.A,{isDisabled:!0,options:o,selectedOption:o[0],width:"auto"})))))})({isLoadingOpportunitySchema:a,missingFieldOptions:s,values:f,errors:_.missingField,onBlur:S("missingField"),onChange:b("missingField")})})),c.createElement("hr",{className:"p-sales_notifications__workflow__form__divider"})),c.createElement("div",{className:"p-sales_notifications__workflow__section"},c.createElement("div",{className:"p-sales_notifications__workflow__subtitle"},n6.t("Recipients")),c.createElement(nP.$,{hasFrontLineManagerOptions:!0,errors:_,onRecipientTypeBlur:h("recipientType"),onRecipientTypeChange:b("recipientType"),onRecipientRolesBlur:h("recipientRoles"),onRecipientRolesChange:b("recipientRoles"),onRecipientUsersBlur:h("recipientUsers"),onRecipientUsersChange:b("recipientUsers"),recipientType:f.recipientType,recipientRoles:f.recipientRoles,recipientUsers:f.recipientUsers,setRecipientRolesFieldsErrors:y("recipientRoles"),setRecipientUsersFieldsErrors:y("recipientUsers")})),c.createElement("div",{className:"p-sales_notifications__workflow__section"},c.createElement(nD.M,{isMutingDisabled:f.isMutingDisabled,onChange:b("isMutingDisabled")})))};MissingFieldsForm.displayName="MissingFieldsForm";var ie=a(0x10398ed1f);let it=new p.Ay("modernselling"),ia=(0,nW.E)({amountDirection:A.Us.Increase}),ii=[nW.f.opportunity(),nW.f.amount("desc")];function MissingFieldsNotificationPreview(){let e=it.t("Add missing details");return c.createElement(nj.A,{body:it.t("Next steps on those opportunities are empty. Time to get them filled out!"),title:e,imageUrl:ie},c.createElement(nG.N,{displayType:"trend_negative",columns:ii,records:ia,title:it.t("Missing next steps"),isExpandedByDefault:!0,isPreview:!0}))}MissingFieldsNotificationPreview.displayName="MissingFieldsNotificationPreview";var il=a(0x1d0dc57a0);let ir=new p.Ay("modernselling"),MissingFieldsFlowPage=()=>{let e={experimentLobOrg62UnrestrictedGroupOn:(0,I.d4)(eK.Jx),experimentLobChannelAcnTokenGroupOn:(0,I.d4)(eK.V$)},t=A.Lb.adminMissingFields,a=(0,I.d4)(e=>(0,F.C1)(e,A.YB.adminMissingFields)),n=(0,I.d4)(F.Ey),i=a?((e,t,a)=>{let{ok:n}=(0,eJ.cB)(A.YB.adminMissingFields,e,a);if(!n)return"";let i=(0,il.v)(e),{time:l,schedule:r}=(e=>{if(!e)return{time:"",schedule:""};let{timeStr:t,scheduleStr:a}=(0,nK.eq)(e);return{time:t,schedule:a}})(e);return(({schedule:e,time:t,conditions:a,salesforceOrgName:n})=>ir.t("Scheduled {schedule} at {time} for opportunities that meet these conditions: {conditions} in {salesforceOrgName}",{schedule:(0,nQ.Ay)(e),time:(0,nQ.Ay)(t),conditions:(0,nQ.Ay)(a),salesforceOrgName:(0,nQ.Ay)(n)}))({salesforceOrgName:t,conditions:i,time:l,schedule:r})})(a,n?.name||"",e):"",l=(0,nK.pk)(t,a),r=getAdminPreviewDestination(t,a,l,e);return c.createElement(n1.IS,null,c.createElement(n1.cp,{isAdmin:!0},c.createElement(MissingFieldsForm,null)),c.createElement(n1.OC,null,c.createElement(nX.A,{title:i}),c.createElement(MissingFieldsNotificationPreview,null),c.createElement(n0.A,{title:r})))};MissingFieldsFlowPage.displayName="MissingFieldsFlowPage";var io=a(0x1ee39de0b);let is=new p.Ay("modernselling"),ic="outdated-fields-field-has-not-changed-for-value",iu={default:"50","advanced-conditions":"25"},OutdatedFieldHasNotChangedForLabel=()=>c.createElement(eb.A,{htmlFor:ic,text:is.t("Field has not changed for\u2026")});OutdatedFieldHasNotChangedForLabel.displayName="OutdatedFieldHasNotChangedForLabel";let OutdatedFieldHasNotChangedForField=({appearance:e,outdatedFieldPeriodValue:t,outdatedFieldPeriod:a,handlePeriodValueChange:n,handlePeriodChange:i,handlePeriodValueBlur:l,errors:r})=>c.createElement(ae.c,{space:iu[e],alignY:"start"},c.createElement("div",{className:"flex_one"},c.createElement(nn.A,{useInlineAlert:!0,isRequired:!0,id:ic,errorText:r?r[0]?.message:null,"aria-invalid":r&&r.length?"true":"false","aria-label":is.t("Enter the number of days or months for which the field has not changed"),className:"no_bottom_margin flex-one",name:"field-has-not-changed-for-value",type:"number",min:1,max:9999,value:t,onChange:n,onBlur:l})),"default"===e&&c.createElement("div",{className:"flex_one"},c.createElement(el.Ay,{isRequired:!0,ariaLabel:is.t("Select the period during which the field has not changed"),options:ni.a4,selectedOption:ni.a4.find(e=>e.value===a.value),onOptionSelected:i,width:"auto"})),"advanced-conditions"===e&&c.createElement(AdvancedFilterOperatorWrapper,null,c.createElement(el.Ay,{isRequired:!0,ariaLabel:is.t("Select the period during which the field has not changed"),options:ni.a4,selectedOption:ni.a4.find(e=>e.value===a.value),onOptionSelected:i,width:"auto"})));OutdatedFieldHasNotChangedForField.displayName="OutdatedFieldHasNotChangedForField";let OutdatedFieldHasNotChangedFor=({appearance:e,outdatedFieldPeriodValue:t,outdatedFieldPeriod:a,handlePeriodValueChange:n,handlePeriodChange:i,handlePeriodValueBlur:l,errors:r})=>c.createElement(eS.B,{space:"0"},c.createElement(OutdatedFieldHasNotChangedForLabel,null),c.createElement(OutdatedFieldHasNotChangedForField,{appearance:e,outdatedFieldPeriod:a,outdatedFieldPeriodValue:t,handlePeriodValueChange:n,handlePeriodValueBlur:l,handlePeriodChange:i,errors:r}));OutdatedFieldHasNotChangedFor.displayName="OutdatedFieldHasNotChangedFor";let im=new p.Ay("modernselling");function renderOutdatedFieldPrimaryCondition({isLoading:e,handleBlur:t,handleChange:a,errors:n,values:i,outdatedFieldOptions:l}){return r=>{let o=[{value:null,label:im.t("has not changed for")}];return c.createElement(c.Fragment,null,!r&&c.createElement(eS.B,{space:"125"},c.createElement(eb.A,{text:im.t("Outdated field")},c.createElement(er.Ay,{isRequired:!0,isLoading:e,isInvalid:!!n?.outdatedFieldValue?.length,key:l.length,errors:n?.outdatedFieldValue,options:l,selectedOption:l.find(e=>e.value===i.outdatedFieldValue?.value),onOptionSelected:a("outdatedFieldValue"),onBlur:t("outdatedFieldValue"),width:"100%"})),c.createElement(OutdatedFieldHasNotChangedFor,{appearance:"default",outdatedFieldPeriod:i.outdatedFieldPeriod,outdatedFieldPeriodValue:i.outdatedFieldPeriodValue,handlePeriodValueChange:a("outdatedFieldPeriodValue"),handlePeriodValueBlur:t("outdatedFieldPeriodValue"),handlePeriodChange:a("outdatedFieldPeriod"),errors:n.outdatedFieldPeriodValue})),r&&c.createElement(eS.B,{space:"25"},c.createElement(ae.c,{space:"25",alignY:"start"},c.createElement(er.Ay,{isRequired:!0,isLoading:e,isInvalid:!!n?.outdatedFieldValue?.length,ariaLabel:im.t("Outdated field has not changed for"),key:l.length,errors:n?.outdatedFieldValue,options:l,selectedOption:l.find(e=>e.value===i.outdatedFieldValue?.value),onOptionSelected:a("outdatedFieldValue"),onBlur:t("outdatedFieldValue"),width:"100%",className:"flex_one"}),c.createElement(AdvancedFilterOperatorWrapper,null,c.createElement("div",{"aria-hidden":!0},c.createElement(el.Ay,{isDisabled:!0,options:o,selectedOption:o[0],width:"auto"})))),c.createElement(OutdatedFieldHasNotChangedForField,{appearance:"advanced-conditions",outdatedFieldPeriod:i.outdatedFieldPeriod,outdatedFieldPeriodValue:i.outdatedFieldPeriodValue,handlePeriodValueChange:a("outdatedFieldPeriodValue"),handlePeriodValueBlur:t("outdatedFieldPeriodValue"),handlePeriodChange:a("outdatedFieldPeriod"),errors:n.outdatedFieldPeriodValue})))}}renderOutdatedFieldPrimaryCondition.displayName="renderOutdatedFieldPrimaryCondition";let ip=new p.Ay("modernselling"),ig=[A.QO.SpecificOpportunity],OutdatedFieldsForm=()=>{let e=ip.t("Review opportunities with out-of-date info"),t=(0,e6.E)({isAdmin:!0}),[a,n]=(0,c.useState)(!0),[i,l]=(0,c.useState)(!1),[r,o]=(0,c.useState)(null),s=getSelectOptionsFromOpportunityFields(r?.fields),d=(0,I.d4)(F.Tt),u=(0,I.d4)(eN.cA),m=(0,c.useMemo)(()=>{let e=(0,eO.rJ)(u,"iso"),t=(0,ek.et)(u)??ee.vp;return{startTime:e,frequency:A.Ns.weekly,timezone:t}},[u]),p=A.YB.adminOutdatedFields,g=(0,c.useMemo)(()=>d?(0,eC.S1)(d,m):{...m,title:e,outdatedFieldValue:null,outdatedFieldPeriod:ni.Sm,outdatedFieldPeriodValue:"30",account:null,advancedFilterOptions:null,channelId:null,tokenUserId:null,scope:null,sendTo:A.Oz.SalesHome,type:A.g$.AdminOutdatedFields,recipientType:null,recipientRoles:null,recipientUsers:null,canvasTemplateId:null,buttonText:(0,nu.L)(p),isMutingDisabled:!1},[d,m,e,p]),{values:f,errors:_,handleBlur:h,handleChange:b,setFieldErrors:y}=(0,ev.A)({workflowView:p,initialValues:g}),E=(0,c.useCallback)(e=>{b("sendTo")(e)},[b]),S=(0,c.useCallback)(e=>()=>{h(e)()},[h]),C=(0,c.useCallback)(e=>h(e)(),[h]),v=(0,c.useCallback)((e,t)=>b(e)(t),[b]),x=(0,c.useCallback)(async()=>{n(!0),l(!1),o(null);try{let e=await t();o(e)}catch(e){l(!0)}finally{n(!1)}},[t]);(0,c.useEffect)(()=>{x()},[x]);let w=!!d?.acn?.advanced_filter_conditions?.length;return c.createElement(c.Fragment,null,c.createElement(eS.B,{space:"125"},i&&c.createElement(K.Ay,{type:"boxed",level:"warning"},ip.t("There was a problem loading opportunity fields.")," ",c.createElement(n5.A,{onClick:x},ip.t("Try again?",{fallbackHash:"15ba5c6e7230f78387f72aac597a80fc61e797f4"}))),c.createElement("div",{className:"p-sales_notifications__workflow__section"},c.createElement("div",{className:"p-sales_notifications__workflow__subtitle"},ip.t("Notification details")),c.createElement(nR.A,{errors:_.title,onBlur:h("title"),onChange:b("title"),value:f.title}),c.createElement(eS.B,{space:"125"},c.createElement(nB.Y,{frequency:f.frequency,onFrequencyChange:b("frequency"),onStartTimeBlur:h("startTime"),onStartTimeChange:b("startTime"),startTime:f.startTime,startTimeErrors:_.startTime}),c.createElement(nU.A,{isAdmin:!0,channelId:f.channelId,tokenUserId:f.tokenUserId,destination:f.sendTo,errors:_,isRecurring:!0,isEditNotification:!!d,onChannelSelectBlur:h("channelId"),onChannelSelected:b("channelId"),onTokenSelectBlur:h("tokenUserId"),onTokenSelected:b("tokenUserId"),onSendToSelected:E})),c.createElement("hr",{className:"p-sales_notifications__workflow__form__divider"}),c.createElement("div",{className:"p-sales_notifications__workflow__subtitle"},ip.t("Apply to")),c.createElement(nL.A,{isAdmin:!0,errors:_,account:f.account,ignoreScopes:ig,onScopeTypeBlur:h("scope"),onScopeTypeChange:b("scope"),onScopeValueBlur:C,onScopeValueChange:v,opportunity:null,scope:f.scope,criteria:null}),c.createElement(ConditionalInputsWithAdvancedFilterOptions,{values:f,errors:_,handleBlur:h,handleChange:b,advancedOptions:f.advancedFilterOptions||null,advancedOptionsErrors:_.advancedFilterOptions,advancedOptionsLoadError:i,isLoading:a,onAdvancedOptionsChange:b("advancedFilterOptions",!1),opportunitySchema:r,refetchOpportunitySchema:x,setAdvancedOptionsFieldErrors:y("advancedFilterOptions"),workflowView:A.Lb.adminOutdatedFields,isAdvancedOptionsOpenOnMount:w,renderPrimaryCondition:renderOutdatedFieldPrimaryCondition({isLoading:a,handleBlur:S,handleChange:b,errors:_,values:f,outdatedFieldOptions:s})})),c.createElement("hr",{className:"p-sales_notifications__workflow__form__divider"})),c.createElement("div",{className:"p-sales_notifications__workflow__section"},c.createElement("div",{className:"p-sales_notifications__workflow__subtitle"},ip.t("Recipients")),c.createElement(nP.$,{hasFrontLineManagerOptions:!0,errors:_,onRecipientTypeBlur:h("recipientType"),onRecipientTypeChange:b("recipientType"),onRecipientRolesBlur:h("recipientRoles"),onRecipientRolesChange:b("recipientRoles"),onRecipientUsersBlur:h("recipientUsers"),onRecipientUsersChange:b("recipientUsers"),recipientType:f.recipientType,recipientRoles:f.recipientRoles,recipientUsers:f.recipientUsers,setRecipientRolesFieldsErrors:y("recipientRoles"),setRecipientUsersFieldsErrors:y("recipientUsers")})),c.createElement("div",{className:"p-sales_notifications__workflow__section"},c.createElement(nD.M,{isMutingDisabled:f.isMutingDisabled,onChange:b("isMutingDisabled")})))};OutdatedFieldsForm.displayName="OutdatedFieldsForm";let i_=new p.Ay("modernselling"),ih=(0,nW.E)({amountDirection:A.Us.Increase}),ib=[nW.f.opportunity(),nW.f.nextStepLastUpdate("desc")],OutdatedFieldsNotificationPreview=()=>c.createElement(nj.A,{title:i_.t("Review opportunities with out-of-date info"),body:i_.rt("Next step on those opportunities have not been updated for more than 30 days. Time to get them updated!"),imageUrl:w},c.createElement(nG.N,{displayType:"trend_negative",columns:ib,records:ih,title:i_.t("Next step outdated"),isExpandedByDefault:!0,isPreview:!0}));OutdatedFieldsNotificationPreview.displayName="OutdatedFieldsNotificationPreview";var iy=a(0x7629109d);let iA=new p.Ay("modernselling"),OutdatedFieldsFlowPage=()=>{let e={experimentLobOrg62UnrestrictedGroupOn:(0,I.d4)(eK.Jx),experimentLobChannelAcnTokenGroupOn:(0,I.d4)(eK.V$)},t=A.YB.adminOutdatedFields,a=(0,I.d4)(e=>(0,F.C1)(e,A.YB.adminOutdatedFields)),n=(0,I.d4)(F.Ey),i=a?((e,t,a)=>{let{ok:n}=(0,eJ.cB)(A.YB.adminOutdatedFields,e,a);if(!n)return"";let i=(0,iy.A)(e),{time:l,schedule:r}=(e=>{if(!e)return{time:"",schedule:""};let{timeStr:t,scheduleStr:a}=(0,nK.eq)(e);return{time:t,schedule:a}})(e);return(({schedule:e,time:t,conditions:a,salesforceOrgName:n})=>iA.t("Scheduled {schedule} at {time} for opportunities that meet these conditions: {conditions} in {salesforceOrgName}",{schedule:(0,nQ.Ay)(e),time:(0,nQ.Ay)(t),conditions:(0,nQ.Ay)(a),salesforceOrgName:(0,nQ.Ay)(n)}))({salesforceOrgName:t,conditions:i,time:l,schedule:r})})(a,n?.name||"",e):"",l=(0,nK.pk)(t,a),r=getAdminPreviewDestination(t,a,l,e);return c.createElement(n1.IS,null,c.createElement(n1.cp,{isAdmin:!0},c.createElement(OutdatedFieldsForm,null)),c.createElement(n1.OC,null,c.createElement(nX.A,{title:i}),c.createElement(OutdatedFieldsNotificationPreview,null),c.createElement(n0.A,{title:r})))};OutdatedFieldsFlowPage.displayName="OutdatedFieldsFlowPage";let iE=new p.Ay("modernselling"),iS=new p.Ay("modernselling"),iC=[A.QO.SpecificOpportunity],PastCloseDateForm=()=>{let e=iS.t("Review opportunities with past close dates"),[t,a]=(0,c.useState)(!0),n=(0,e6.E)({isAdmin:!0}),[i,l]=(0,c.useState)(!1),[r,o]=(0,c.useState)(null),s=(0,I.d4)(F.Tt),d=(0,I.d4)(eN.cA),u=(0,c.useMemo)(()=>{let e=(0,eO.rJ)(d,"iso"),t=(0,ek.et)(d)??ee.vp;return{startTime:e,frequency:A.Ns.weekly,timezone:t}},[d]),m=A.YB.adminPastCloseDateAlert,p=(0,c.useMemo)(()=>s?(0,eC.DT)(s,u):{...u,title:e,account:null,advancedFilterOptions:null,channelId:null,tokenUserId:null,scope:null,sendTo:A.Oz.SalesHome,type:A.g$.AdminPastCloseDate,recipientType:null,recipientRoles:null,recipientUsers:null,canvasTemplateId:null,buttonText:(0,nu.L)(m),isMutingDisabled:!1},[s,u,e,m]),{values:g,errors:f,handleBlur:_,handleChange:h,setFieldErrors:b}=(0,ev.A)({workflowView:m,initialValues:p}),y=(0,c.useCallback)(e=>{h("sendTo")(e)},[h]),E=(0,c.useCallback)(e=>_(e)(),[_]),S=(0,c.useCallback)((e,t)=>h(e)(t),[h]),C=(0,c.useCallback)(async()=>{a(!0),l(!1),o(null);try{let e=await n();o(e)}catch(e){l(!0)}finally{a(!1)}},[n]);(0,c.useEffect)(()=>{C()},[C]);let v=!!s?.acn?.advanced_filter_conditions?.length;return c.createElement(c.Fragment,null,c.createElement(eS.B,{space:"125"},c.createElement("div",{className:"p-sales_notifications__workflow__section"},c.createElement("div",{className:"p-sales_notifications__workflow__subtitle"},iS.t("Notification details")),c.createElement(nR.A,{errors:f.title,onBlur:_("title"),onChange:h("title"),value:g.title}),c.createElement(eS.B,{space:"125"},c.createElement(nB.Y,{frequency:g.frequency,onFrequencyChange:h("frequency"),onStartTimeBlur:_("startTime"),onStartTimeChange:h("startTime"),startTime:g.startTime,startTimeErrors:f.startTime}),c.createElement(nU.A,{isAdmin:!0,channelId:g.channelId,tokenUserId:g.tokenUserId,destination:g.sendTo,errors:f,isRecurring:!0,isEditNotification:!!s,onChannelSelectBlur:_("channelId"),onChannelSelected:h("channelId"),onTokenSelectBlur:_("tokenUserId"),onTokenSelected:h("tokenUserId"),onSendToSelected:y})),c.createElement("hr",{className:"p-sales_notifications__workflow__form__divider"}),c.createElement("div",{className:"p-sales_notifications__workflow__subtitle"},iS.t("Apply to")),c.createElement(nL.A,{isAdmin:!0,errors:f,account:g.account,ignoreScopes:iC,onScopeTypeBlur:_("scope"),onScopeTypeChange:h("scope"),onScopeValueBlur:E,onScopeValueChange:S,opportunity:null,scope:g.scope,criteria:null}),c.createElement(ConditionalInputsWithAdvancedFilterOptions,{values:g,errors:f,isLoading:t,workflowView:m,opportunitySchema:r,advancedOptions:g.advancedFilterOptions,advancedOptionsLoadError:i,advancedOptionsErrors:f.advancedFilterOptions,isAdvancedOptionsOpenOnMount:v,handleBlur:_,handleChange:h,refetchOpportunitySchema:C,onAdvancedOptionsChange:h("advancedFilterOptions",!1),setAdvancedOptionsFieldErrors:b("advancedFilterOptions"),renderPrimaryCondition:e=>{if(!e)return null;let t=[{value:null,label:iE.t("Close date")}],a=[{value:null,label:iE.t("has passed")}];return c.createElement(ae.c,{space:"25",alignY:"start"},c.createElement(el.Ay,{isDisabled:!0,ariaLabel:iE.t("Close date has passed"),options:t,selectedOption:t[0],width:"100%",className:"flex_one"}),c.createElement(AdvancedFilterOperatorWrapper,null,c.createElement("div",{"aria-hidden":!0},c.createElement(el.Ay,{isDisabled:!0,options:a,selectedOption:a[0],width:"auto"}))))}})),c.createElement("hr",{className:"p-sales_notifications__workflow__form__divider"})),c.createElement("div",{className:"p-sales_notifications__workflow__section"},c.createElement("div",{className:"p-sales_notifications__workflow__subtitle"},iS.t("Recipients")),c.createElement(nP.$,{hasFrontLineManagerOptions:!0,errors:f,onRecipientTypeBlur:_("recipientType"),onRecipientTypeChange:h("recipientType"),onRecipientRolesBlur:_("recipientRoles"),onRecipientRolesChange:h("recipientRoles"),onRecipientUsersBlur:_("recipientUsers"),onRecipientUsersChange:h("recipientUsers"),recipientType:g.recipientType,recipientRoles:g.recipientRoles,recipientUsers:g.recipientUsers,setRecipientRolesFieldsErrors:b("recipientRoles"),setRecipientUsersFieldsErrors:b("recipientUsers")})),c.createElement("div",{className:"p-sales_notifications__workflow__section"},c.createElement(nD.M,{isMutingDisabled:g.isMutingDisabled,onChange:h("isMutingDisabled")})))};PastCloseDateForm.displayName="PastCloseDateForm";var iv=a(0x11a940e89);let ix=new p.Ay("modernselling"),iw=(0,nW.E)({amountDirection:A.Us.Increase}),iO=[nW.f.opportunity(),nW.f.closeDate("desc")];function PastCloseDateNotificationPreview(){return c.createElement(nj.A,{body:ix.rt("Here are your opportunities that have passed their close dates"),title:ix.t("Review opportunities with past close dates"),imageUrl:iv},c.createElement(nG.N,{displayType:"trend_negative",columns:iO,records:iw,title:ix.t("Opportunities passed closed date"),isExpandedByDefault:!0,isPreview:!0}))}PastCloseDateNotificationPreview.displayName="PastCloseDateNotificationPreview";var ik=a(0xb0222280);let iN=new p.Ay("modernselling"),PastCloseDateFlowPage=()=>{let e={experimentLobOrg62UnrestrictedGroupOn:(0,I.d4)(eK.Jx),experimentLobChannelAcnTokenGroupOn:(0,I.d4)(eK.V$)},t=A.YB.adminPastCloseDateAlert,a=(0,I.d4)(e=>(0,F.C1)(e,t)),n=(0,I.d4)(F.Ey),i=a?((e,t,a)=>{let{ok:n}=(0,eJ.cB)(A.YB.adminClosingSoonAlert,e,a);if(!n)return"";let i=(0,ik.s)(e),{time:l,schedule:r}=(e=>{if(!e)return{time:"",schedule:""};let{timeStr:t,scheduleStr:a}=(0,nK.eq)(e);return{time:t,schedule:a}})(e);return(({schedule:e,time:t,conditions:a,salesforceOrgName:n})=>iN.t("Scheduled {schedule} at {time} for opportunities that meet these conditions: {conditions} in {salesforceOrgName}",{schedule:(0,nQ.Ay)(e),time:(0,nQ.Ay)(t),conditions:(0,nQ.Ay)(a),salesforceOrgName:(0,nQ.Ay)(n)}))({salesforceOrgName:t,conditions:i,time:l,schedule:r})})(a,n?.name||"",e):"",l=(0,nK.pk)(t,a),r=getAdminPreviewDestination(t,a,l,e);return c.createElement(n1.IS,null,c.createElement(n1.cp,{isAdmin:!0},c.createElement(PastCloseDateForm,null)),c.createElement(n1.OC,null,c.createElement(nX.A,{title:i}),c.createElement(PastCloseDateNotificationPreview,null),c.createElement(n0.A,{title:r})))};PastCloseDateFlowPage.displayName="PastCloseDateFlowPage";var iT=a(0x18ee6860e),iI=a(0x198f5e201),iF=a(0x92e81718),iM=a(0x5e07c725);let iD=new p.Ay("modernselling");function withDocumentTitle(e,t){return c.createElement(c.Fragment,null,c.createElement(iM.A,{title:e}),t)}withDocumentTitle.displayName="withDocumentTitle";let WorkflowBuilderPage=()=>{let e=(0,I.d4)(F.uJ),t=(0,I.d4)(F.qA);if(!e)return null;let a=iD.t("Sales settings - Admin-created notifications");return t?withDocumentTitle(a,c.createElement(iF.A,null)):e===A.Lb.adminSelectNotificationType?withDocumentTitle(a,c.createElement(iI.A,{isAdmin:!0})):e===A.Lb.adminAmountChanged?withDocumentTitle(a,c.createElement(nt.A,{isAdmin:!0})):e===A.Lb.adminCloseDateChanged?withDocumentTitle(a,c.createElement(na.A,{isAdmin:!0})):e===A.Lb.adminDealWon?withDocumentTitle(a,c.createElement(n2.A,{isAdmin:!0})):e===A.Lb.adminForecastReminder?withDocumentTitle(a,c.createElement(n4.A,{isAdmin:!0})):e===A.Lb.adminNewOpportunityAlert?withDocumentTitle(a,c.createElement(io.A,{isAdmin:!0})):e===A.Lb.adminStageChanged?withDocumentTitle(a,c.createElement(iT.A,{isAdmin:!0})):e===A.Lb.adminMissingFields?withDocumentTitle(a,c.createElement(MissingFieldsFlowPage,null)):e===A.Lb.adminOutdatedFields?withDocumentTitle(a,c.createElement(OutdatedFieldsFlowPage,null)):e===A.Lb.adminClosingSoonAlert?withDocumentTitle(a,c.createElement(ClosingSoonFlowPage,null)):e===A.Lb.adminPastCloseDateAlert?withDocumentTitle(a,c.createElement(PastCloseDateFlowPage,null)):null};WorkflowBuilderPage.displayName="WorkflowBuilderPage";var iR=a(0xca924ee1),iP=a(0x14fad6485),iL=a(0x1f49c20b0),iU=a(0x1e85f5284),iB=a(0xb656f820),iH=a(0x247cf31a2),iV=a(0xc34fd270),iW=a(0x1ed767a16),ij=a(0xcefedbca);let iG=new p.Ay("modernselling");var iq=((r=iq||{}).Actions="actions",r.DestinationChannel="destination_channel",r.LastUpdatedByName="last_updated_by_name",r.MuteCount="mute_count",r.Title="title",r);let iY=(0,iR.A)((e,t)=>e.map(e=>({...e,last_updated_by_name:(0,eN._7)(t,e.last_updated_by)}))),AdminCreatedNotificationsView=({error:e,isLoading:t,workflows:a,onBack:n,onRefetchWorkflows:i})=>{let{windowRef:l}=(0,c.useContext)(iP._0),r=(0,d.wA)(),o=(0,iU.A)(),[s,p]=(0,c.useState)([]),[g,f]=(0,c.useState)(null),[_,h]=(0,c.useState)(!1);(0,c.useEffect)(()=>{t&&h(!0)},[t]);let b=(0,I.d4)(e=>iY(a,e)),y=(0,c.useCallback)(()=>{r((0,W.kC)({workflowView:A.Lb.adminSelectNotificationType}))},[r]),E=(0,c.useMemo)(()=>c.createElement(R.Ay,{onClick:y},iG.t("Create Notification")),[y]);(0,u.A)(()=>{i()}),(0,c.useEffect)(()=>{g?p((0,tq.A)(b,g.sortBy,g.sortDirection)):p(b)},[b,g]);let S=(0,c.useCallback)(e=>{f(e)},[]),C=(0,c.useCallback)(({rowData:e})=>c.createElement(iL.A,{workflow:e,size:"small",showDescription:!1}),[]),v=(0,c.useCallback)(({rowData:e})=>e.destination_channel?c.createElement(iH.A,{channelId:e.destination_channel}):iG.t("Sales dashboard"),[]),x=(0,c.useCallback)(({rowData:e})=>e.mute_count,[]),w=(0,c.useCallback)(({rowData:e})=>c.createElement(iV.Ay,{id:e.last_updated_by,forceRealName:!0,neverBold:!0,showStatus:!1,showPresence:!1,useShortMode:!0}),[]),O=(0,c.useCallback)(e=>({onClick:{enableClogAction:!0},elementName:"lob_notifications_edit",workflowId:e,isLobNotificationWorkflowAdmin:!0}),[]),k=(0,c.useCallback)(e=>({onClick:{enableClogAction:!0},elementName:"lob_notifications_copy_notification_id",workflowId:e,isLobNotificationWorkflowAdmin:!0}),[]),N=(0,c.useCallback)((e,{rowData:t})=>{let a=(0,iR.A)(()=>{r((0,ij.A)({workflowId:t.id,isAdmin:!0}))}),n=(0,iR.A)(()=>{o(t,i)}),s=(0,iR.A)(()=>{(0,iW.x3)(t.id,l.deref()),r((0,eV.M)({element:c.createElement(eH.A,null,iG.t("Notification ID copied to clipboard."))}))});return c.createElement(tJ.Ay,{...e,width:200},t.is_field_mappings_updated?null:c.createElement(U.A,{onSelected:a,ariaLabel:iG.t("Edit {title}",{title:t.title}),autoClogProps:O(t.id)},iG.t("Edit")),c.createElement(U.A,{danger:!0,onSelected:n,ariaLabel:iG.t("Delete {title}",{title:t.title})},iG.t("Delete")),c.createElement(U.A,{ariaLabel:iG.t("Copy notification ID"),autoClogProps:k(t.id),onSelected:s},iG.t("Copy notification ID")))},[O,k,r,o,i,l]),T=(0,c.useCallback)(({rowData:e})=>iG.t("Actions for {title}",{title:e.title}),[]),F=(0,c.useMemo)(()=>iG.t("{count, plural, =1 {# notification} other {# notifications}}",{count:s.length}),[s]),M=!t&&e,D=!t&&!e&&0===s.length,P=!t&&!e&&s.length>0;return c.createElement(m.A,{eventId:eU.EventId.LOB_SALES_HOME,uiComponentName:eU.UiComponentName.LOB_NOTIFICATIONS_LIST},c.createElement(PanelHeader,{actions:E,onBack:n},iG.t("Admin-created notifications")),c.createElement("div",{className:"p-sales_admin__notifications__acn__table_header"},P&&c.createElement(iB.A,{className:"p-sales_admin__notifications__acn__table_header__custom",totalCountLabel:F})),c.createElement(PanelSectionsContainer,{className:"flex_one"},c.createElement(PanelSectionPlain,{hasTable:!0,isLoading:t||!_},M&&c.createElement(tQ.A,{title:iG.t("There was an error loading notifications"),description:iG.t("Please try refreshing your browser and let us know if this problem continues."),isExtended:!0}),D&&c.createElement(tQ.A,{title:iG.t("Set up notifications for your team"),description:iG.t("Admin-created notifications help your sales team stay in the know with less effort."),primaryActionText:iG.t("Create Notification"),onClickPrimaryAction:y,isExtended:!0}),P&&c.createElement(tK.bQ,{...g,onSort:S,data:s,rowHeight:tK.FL.medium,width:tK.Qk,ariaLabel:iG.t("Admin-created notifications")},c.createElement(tK.Ve,{label:iG.t("Name"),dataKey:"title",getCellData:C,width:275,flexGrow:1,sortable:!0}),c.createElement(tK.Uk,{renderMenu:N,buttonAriaLabel:T,dataKey:"actions",width:48}),c.createElement(tK.Ve,{label:iG.t("Destination"),dataKey:"destination_channel",getCellData:v,width:200,flexGrow:1,sortable:!0}),c.createElement(tK.Ve,{label:iG.t("People who muted"),dataKey:"mute_count",getCellData:x,width:150,align:tK.nk.right,sortable:!0}),c.createElement(tK.Ve,{className:"margin_left_100",label:iG.t("Last updated by"),dataKey:"last_updated_by_name",getCellData:w,width:200,flexGrow:1,sortable:!0})))))};AdminCreatedNotificationsView.displayName="AdminCreatedNotificationsView";let iz=new p.Ay("modernselling"),AdminCreatedNotificationsSection=({isLoading:e,countWorkflows:t,onClickManage:a})=>{let n=(0,c.useMemo)(()=>c.createElement(R.Ay,{size:"small",type:"outline",onClick:a},iz.t("Manage")),[a]);return c.createElement(PanelSection,{isLoading:e,title:iz.t("Admin-created notifications"),actions:n},c.createElement("div",{className:"bold"},iz.rt("{count, plural, =0 {None} other {#}} active",{count:t})),c.createElement("div",{className:"sk_foreground_max"},0===t?iz.t("Default notifications are sent to recipients\u2019 dashboards. They can manage which they\u2019d like to continue receiving."):iz.t("Notifications admins create on behalf of the team. People can manage which they\u2019d like to continue receiving.")))};AdminCreatedNotificationsSection.displayName="AdminCreatedNotificationsSection";var i$=a(0x139c79d16),iQ=a(0xa5dbe09b),iJ=a(0x12c0d9ca0);let iK=new p.Ay("modernselling"),SelectChannelPermissionSpeedBump=({isSubmitting:e,onCancel:t,onSubmit:a})=>{let n=iK.t("Disable for existing channels?"),i=iK.t("Existing sales notifications will stop sending to those channels. The people who created the notifications won\u2019t be notified.");return c.createElement(aI.ty,{heading:n,description:i,onCancel:t,onContinue:a,continueButtonType:"danger",continueButtonLabel:iK.t("Disable"),cancelButtonLabel:iK.t("Cancel"),continueButtonIsLoading:e})};SelectChannelPermissionSpeedBump.displayName="SelectChannelPermissionSpeedBump";var iZ=a(0xf5805007);let iX=new p.Ay("modernselling"),ChannelPermissionsModal=({hasWorkflows:e,channelPermission:t,allowSlackConnectChannels:a,allowAdminsToSendToAllChannelTypes:n})=>{let i=(0,d.wA)(),l=(0,I.d4)(F.rg)??"",[r,o]=(0,c.useState)(!1),[s,u]=(0,c.useState)(!1),[m,p]=(0,c.useState)(t),[g,f]=(0,c.useState)(a),[_,h]=(0,c.useState)(n),b=(0,c.useCallback)(async()=>{r||(o(!0),await i((0,iZ.a)({sendNotificationToChannelPermission:m,allowSlackConnectChannels:g,allowAdminsToSendToAllChannelTypes:_,salesforceOrgId:l})).catch(()=>{p(t),f(a),h(n)}).finally(()=>{o(!1)}),o(!1),i((0,tC.O)()))},[r,i,m,g,_,l,t,a,n]),y=(0,c.useCallback)(()=>{i((0,tC.O)())},[i]),E=(0,c.useCallback)(()=>{let i,l=(i={[A.$4.ALL_CHANNELS]:0,[A.$4.PRIVATE_CHANNELS_ONLY]:1,[A.$4.NO_CHANNELS]:2})[m]>i[t],r=!!(a&&!g),o=!!(n&&!_);e&&(l||r||o)?u(!0):b()},[t,m,a,g,n,_,e,b]),S=(0,c.useCallback)(e=>{p(e.target.value),e.target.value===A.$4.NO_CHANNELS&&f(!1)},[]),C=(0,c.useCallback)(()=>{f(!g)},[g]),v=(0,c.useCallback)(()=>{h(!_)},[_]),x=(0,c.useCallback)(()=>{u(!1)},[]),w=(0,c.useMemo)(()=>c.createElement(SelectChannelPermissionSpeedBump,{isSubmitting:r,onCancel:x,onSubmit:b}),[r,x,b]);return c.createElement(aI.dW,{className:"p-sales_admin__notifications__modal",closeModal:y,maxWidth:640},c.createElement(iJ.A,{title:iX.t("Channel restrictions"),hideFooter:!1,onCancel:y,onSubmit:E,showCancel:!0,submitText:iX.t("Save"),submitIsDisabled:m===t&&g===a&&_===n,submitIsLoading:r,showSpeedBump:s,speedBump:w},c.createElement("p",null,iX.t("People can send sales notifications to:")),c.createElement(iQ.A,null,c.createElement(eb.A,{type:"inline",text:iX.t("All channels")},c.createElement(i$.A,{name:"allChannelsSelector",id:"allChannels",value:A.$4.ALL_CHANNELS,checked:m===A.$4.ALL_CHANNELS,onChange:S})),c.createElement(eb.A,{type:"inline",text:iX.t("Private channels only")},c.createElement(i$.A,{name:"privateChannelsOnlySelector",id:"privateChannelsOnly",value:A.$4.PRIVATE_CHANNELS_ONLY,checked:m===A.$4.PRIVATE_CHANNELS_ONLY,onChange:S})),c.createElement(eb.A,{type:"inline",text:iX.t("No channels")},c.createElement(i$.A,{name:"noChannelsSelector",id:"noChannels",value:A.$4.NO_CHANNELS,checked:m===A.$4.NO_CHANNELS,onChange:S})),c.createElement(eb.A,{className:"margin_left_150",type:"inline",text:iX.t("Sales home is the only place to receive sales notifications")})),m!==A.$4.NO_CHANNELS?c.createElement(eb.A,{text:iX.t("Include Slack Connect external channels"),type:"inline",cursor:"pointer"},c.createElement(eh.A,{name:"slackConnectExternalChannel",checked:g,onChange:C})):null,c.createElement(eb.A,{text:iX.t("Allow Slack Admins to send notifications to public, private channels or Slack Connect channels"),type:"inline",cursor:"pointer"},c.createElement(eh.A,{name:"allowAdminsToSendToAllChannelTypes",checked:_,onChange:v}))))};ChannelPermissionsModal.displayName="ChannelPermissionsModal";let i0=new p.Ay("modernselling"),ChannelPermissionsSection=({isLoading:e,hasWorkflows:t})=>{let a,n,i=(0,d.wA)(),l=(0,I.d4)(F.rg)??"",r=(0,I.d4)(e=>(0,F.uS)(e,l)),o=r?.send_notification_to_channel_permission,s=r?.allow_slack_connect_channels??!1,u=r?.allow_admins_to_send_to_all_channel_types??!1,m=i0.t("Admins can set sales notifications to send to all channels, including Slack Connect channels.");switch(o){case A.$4.PRIVATE_CHANNELS_ONLY:i0.t("Enabled for private channels only"),n=s?i0.t("People can set sales notifications to send to private channels, including Slack Connect external channels."):i0.t("People can set sales notifications to send to private channels, except Slack Connect external channels.");break;case A.$4.NO_CHANNELS:a=i0.t("Disabled"),n=i0.t("People can not set sales notifications to send to any channel.");break;case A.$4.ALL_CHANNELS:default:a=i0.t("Enabled for all channels"),n=s?i0.t("People can set sales notifications to send to public channels, including Slack Connect external channels."):i0.t("People can set sales notifications to send to public channels, except Slack Connect external channels.")}let p=(0,c.useCallback)(()=>{i((0,ti.q)({element:c.createElement(ChannelPermissionsModal,{hasWorkflows:t,channelPermission:o,allowSlackConnectChannels:s,allowAdminsToSendToAllChannelTypes:u})}))},[i,t,o,s,u]),g=(0,c.useMemo)(()=>c.createElement(R.Ay,{disabled:e,size:"small",type:"outline",onClick:p},i0.t("Edit")),[p,e]);return c.createElement(PanelSection,{title:i0.t("Channel restrictions"),actions:g},c.createElement("div",{className:"bold"},a),c.createElement("div",{className:"sk_foreground_max"},n),c.createElement("div",{className:"sk_foreground_max"},u?m:null))};ChannelPermissionsSection.displayName="ChannelPermissionsSection";let i1=new p.Ay("modernselling"),SelectWorkspacesSpeedBump=({isSubmitting:e,onCancel:t,onSubmit:a,selectedWorkspacesCount:n})=>{let i=i1.rt("Limit notifications to {selectedWorkspacesCount} workspaces?",{selectedWorkspacesCount:n}),l=i1.t("Existing sales notifications will stop sending to channels not in those workspaces. The people who created the notifications won\u2019t be notified.");return c.createElement(aI.ty,{heading:i,description:l,onCancel:t,onContinue:a,continueButtonType:"danger",continueButtonLabel:i1.t("Save"),cancelButtonLabel:i1.t("Cancel"),continueButtonIsLoading:e})};SelectWorkspacesSpeedBump.displayName="SelectWorkspacesSpeedBump";var i2=a(0x18ee032cf),i4=a(0x25e72627);let i5=(0,e5.Ay)("Update notifications pref allowed workspace ids",async(e,t,{workspaceIds:a,salesforceOrgId:n})=>{let i=(0,e1.Ay)({label:"SALES-HOME-ADMIN"});try{await e((0,tU.O)({reason:"sales-home-set-allowed-workspaces",allowChannelWorkspaces:a,salesforceOrgId:n}));let i=(0,F.uS)(t(),n);i&&e((0,W.iQ)({[n]:{...i,allowed_channel_workspaces:a}}))}catch{i.error("Failed to set allowChannelWorkspaces")}});i5.meta={name:"updateNotificationsAllowedWorkspacesBySalesforceOrgId",key:"createThunkUpdateNotificationsAllowedWorkspacesBySalesforceOrgId",description:"Update notifications pref allowed workspace ids"};var i8=a(0x1ee439e69);let i7=new p.Ay("modernselling"),i6="SPECIFIC",WorkspaceRestrictionsModal=({hasWorkflows:e})=>{let t=(0,d.wA)(),a=(0,I.d4)(i8.H2),n=(0,I.d4)(F.rg)??"",i=(0,I.d4)(e=>(0,F.uS)(e,n)),l=i?.allowed_channel_workspaces,[r,o]=(0,c.useState)(!!l?.length),[s,u]=(0,c.useState)(l||[]),[m,p]=(0,c.useState)(!1),[g,f]=(0,c.useState)(!1),[_,h]=(0,c.useState)(!1),b=(0,c.useMemo)(()=>s.map(e=>({id:e})),[s]),y=(0,c.useCallback)(async()=>{f(!0);let e=r&&s.length>0;await t(i5({workspaceIds:e?s:[],salesforceOrgId:n})),f(!1),t((0,tC.O)())},[t,r,s,n]),A=(0,c.useCallback)(()=>{t((0,tC.O)())},[t]),E=(0,c.useCallback)(()=>{r&&e?h(!0):y()},[r,y,e]),S=(0,c.useCallback)(e=>{o(e.target.value===i6)},[]),C=(0,c.useCallback)(e=>{p(e===i2.nE.Add)},[]),v=(0,c.useCallback)(e=>{u(e.map(({id:e})=>e))},[]),x=(0,c.useCallback)(()=>{h(!1)},[]),w=(0,c.useMemo)(()=>c.createElement(SelectWorkspacesSpeedBump,{isSubmitting:g,onCancel:x,onSubmit:y,selectedWorkspacesCount:s.length}),[g,x,y,s]);return c.createElement(aI.dW,{className:"p-sales_admin__notifications__modal",closeModal:A,maxWidth:640},c.createElement(iJ.A,{title:i7.t("Workspace restrictions"),hideFooter:r&&m,onCancel:A,onSubmit:E,showCancel:!0,submitText:r&&e?i7.t("Continue"):i7.t("Save"),submitIsDisabled:r&&0===s.length,submitIsLoading:g,showSpeedBump:_,speedBump:w},c.createElement("p",null,i7.t("Allow sales notifications to channels in these workspaces:")),c.createElement(iQ.A,null,c.createElement(eb.A,{type:"inline",text:i7.rt("All workspaces in {orgName}",{orgName:a})},c.createElement(i$.A,{name:"allWorkspaceSelector",id:"allWorkspaces",value:"ALL",checked:!r,onChange:S})),c.createElement(eb.A,{type:"inline",text:i7.t("Specific workspaces only")},c.createElement(i$.A,{name:"selectWorkspaceSelector",id:"selectWorkspaces",value:i6,checked:r,onChange:S}))),r&&c.createElement(i4.A,{selectedWorkspaces:b,onSelectedWorkspacesChange:v,onModeChange:C})))};WorkspaceRestrictionsModal.displayName="WorkspaceRestrictionsModal";let i3=new p.Ay("modernselling"),WorkspaceRestrictionsSection=({isLoading:e,hasWorkflows:t})=>{let a=(0,d.wA)(),n=(0,I.d4)(F.rg)??"",i=(0,I.d4)(e=>(0,F.uS)(e,n)),l=i?.allowed_channel_workspaces,r=!!l?.length,o=(0,c.useCallback)(()=>{a((0,ti.q)({element:c.createElement(WorkspaceRestrictionsModal,{hasWorkflows:t})}))},[a,t]),s=(0,c.useMemo)(()=>c.createElement(R.Ay,{disabled:e,size:"small",type:"outline",onClick:o},i3.t("Edit")),[o,e]);return c.createElement(PanelSection,{title:i3.t("Workspace restrictions"),actions:s},c.createElement("div",{className:"bold"},r?c.createElement(c.Fragment,null,i3.t("Specific workspaces only")):c.createElement(c.Fragment,null,i3.t("Enabled for all workspaces"))),c.createElement("div",{className:"sk_foreground_max"},r?c.createElement(c.Fragment,null,i3.t("People can set up sales notifications to send to channels in {selectedWorkspacesCount} workspaces in your organization.",{selectedWorkspacesCount:l?.length||0})):c.createElement(c.Fragment,null,i3.t("People can set up sales notifications to send to channels in any workspaces in your organization."))))};WorkspaceRestrictionsSection.displayName="WorkspaceRestrictionsSection";var i9=a(0x1c2358c11),le=a(0x91c8f270);let lt=new p.Ay("modernselling"),la=[];var ln=((o={}).default="default",o.adminCreatedNotifs="adminCreatedNotifs",o);let NotificationsPanel=({onChangeView:e,view:t})=>{let a=(0,I.d4)(F.rg),n=(e=>{let t=(0,d.wA)(),a=(0,I.d4)(F.e$),{data:n,error:i,loading:l}=(0,i9.L)({fetcher:le.S,args:{datasourceId:a,salesforceOrgId:e}});return(0,c.useEffect)(()=>{n&&t((0,W.EG)(n))},[n,t]),{error:i,loading:l}})(a),{data:i,error:l,loading:r,refetch:o}=(0,i9.L)({fetcher:td.N,args:{reason:"modern-selling",isAcn:!0,salesforceOrgId:a}}),s=(0,c.useCallback)(()=>{e("adminCreatedNotifs")},[e]),u=(0,c.useCallback)(()=>{e("default")},[e]),m=i?.workflows,p=!!m&&m.length>0;return"adminCreatedNotifs"===t?c.createElement(AdminCreatedNotificationsView,{error:l||n.error,isLoading:r||n.loading,workflows:m||la,onBack:u,onRefetchWorkflows:o}):c.createElement(c.Fragment,null,c.createElement(PanelHeader,null,lt.t("Notifications")),l&&c.createElement(K.Ay,{level:"error",heading:lt.t("There was an error loading notifications")},lt.t("Please try refreshing your browser and let us know if this problem continues.")),!l&&c.createElement(PanelSectionsContainer,null,c.createElement(WorkspaceRestrictionsSection,{isLoading:r,hasWorkflows:p}),c.createElement(ChannelPermissionsSection,{isLoading:r,hasWorkflows:p}),c.createElement(AdminCreatedNotificationsSection,{isLoading:r,countWorkflows:m?.length,onClickManage:s})))};NotificationsPanel.displayName="NotificationsPanel";var li=a(0x1d24ec95f),ll=a(0x4c96e5d9),lr=a(0x7d48dd65),lo=a(0x128d54e52),ls=a(0x24f1e08bb),lc=a(0x1535e80f3),ld=a(0xcc2c1a16);let lu=new p.Ay("modernselling"),lm={UnsupportedObject:"unsupported_object"},lp={NonPublicListView:"not_public"},lg={...lm,...lp},getErrorMessage=({errorCode:e})=>{switch(e){case lm.UnsupportedObject:return lu.t("This object isn\u2019t available for Salesforce lists in Slack. Remove or select another object to continue.");case lp.NonPublicListView:return lu.t("Some of the list views you\u2019ve added aren\u2019t shared with all users in your Salesforce environment.",{fallbackHash:"14c3a748ae5cfa0ea313274983c357ca41216e18"});default:return lu.t("Sorry, something went wrong. Try again in a moment.")}},getOptionError=e=>e.extras?.error,getOptionLabel=e=>e.extras?.stringLabel||"";var lf=a(0x20ef3966f),l_=a(0x1e2051844);let getErrorCodeForOptionById=({errors:e,id:t})=>e&&(0,l_.A)(e,({id:e})=>e===(t||""))?.code,makeDecoratedOption=({option:e,errorCode:t})=>t?{...e,isError:!0,isDisabled:!0,extras:{...e?.extras||{},error:{id:t,message:getErrorMessage({errorCode:t})}}}:e,makeDecoratedSelections=({selections:e,errors:t})=>(0,lf.A)(e,({objectOption:e,listViewOptions:a})=>({objectOption:makeDecoratedOption({option:e,errorCode:getErrorCodeForOptionById({errors:t,id:e?.value})}),listViewOptions:(0,lf.A)(a,e=>makeDecoratedOption({option:e,errorCode:getErrorCodeForOptionById({errors:t,id:e.value})}))}));var lh=a(0x658a411c),lb=a(0x9e671ad),ly=a(0x20baf703f);let lodash_es_isEqualWith=function(e,t,a){var n=(a="function"==typeof a?a:void 0)?a(e,t):void 0;return void 0===n?(0,ly.A)(e,t,void 0,a):!!n};var lA=a(0x1952a5c50),lE=a(0x14f0aa281),lS=a(0x2fd935d8),lC=a(0xf73bb335),lv=a.n(lC);let lx=new p.Ay("modernselling"),lw={elementName:"remove_object",onClick:{enableClogAction:!0}},Field=({title:e,children:t,actions:a})=>c.createElement("div",{className:lv().fieldContainer},c.createElement("div",{className:lv().fieldHeader},c.createElement("div",{className:"bold"},e),a&&c.createElement("div",{className:"p-sales_admin__panel_section__actions"},c.createElement("div",{className:"p-sales_admin__panel_section__actions_inner"},a))),t);Field.displayName="Field";let AllowedObjectSection=({objectOptions:e,selectedObject:t,selectedListViews:a,updateSelections:n,currentObjectSelections:i,updateOptionErrors:l,index:r,isSaving:o})=>{let s=(0,d.wA)(),u=(0,I.d4)(F.rg),m=a.length>25,p=(0,c.useCallback)(e=>c.createElement(lo.CG,{withTruncationTooltip:!0},e.label),[]),g=(0,c.useCallback)(e=>{let t=p(e);return c.createElement(ls.A,{size:"small",key:e.value,style:e.isDisabled?lc.pI.dim:void 0,primaryContent:t,secondaryContent:e.secondaryContent})},[p]),f=(0,c.useMemo)(()=>{if(!t)return t;let e=getOptionError(t);return e&&[e]},[t]),_=(0,c.useMemo)(()=>{let e=[];return a.forEach(t=>{let a=getOptionError(t);a&&e.push(a)}),e},[a]),h=!!_?.length,b=(0,c.useMemo)(()=>e?e.map(e=>{if(e?.isError)return{...e,isDisabled:!0,secondaryContent:lx.t("Not available in Slack")};let a=!!i.filter(e=>e?.value!==t?.value).find(t=>t?.value===e.value);return{...e,isDisabled:a,secondaryContent:a&&lx.t("Already configured object")}}):[],[i,e,t?.value]),y=(0,c.useCallback)(async(e,t)=>{if((0,aw.A)(e)&&t.length<3){let e=lx.t("Enter at least 3 characters to search for a list in Salesforce");return Promise.resolve([{label:e,value:e,isDisabled:!0,overrides:{className:Q()(lv().option,lv().disabled)}}])}return Promise.resolve(e)},[]),A=(0,c.useCallback)(async e=>{if((0,lA.u)(e)&&t){let{records:a}=await s((0,lS.R)({sobjects:[{sobjectApiName:"ListView",fields:["Name"]}],listviewObjectScopes:[t.value],asIntegrationUser:!0,query:e,salesforceOrgId:u,reason:"admin_settings_salesforce_lists"}));return Promise.resolve(a)}return Promise.resolve([])},[t,s,u]),E=(0,c.useCallback)(async e=>{try{let{supported:t}=await s((0,lE.e)({sobjectApiName:e.value,salesforceOrgId:u||"",reason:"allowed_object_section"}));n(a=>{let n=[...a];return n[r]={...n[r],objectOption:t?e:makeDecoratedOption({option:e,errorCode:lm.UnsupportedObject})},n}),t||l(t=>t.concat([{code:lm.UnsupportedObject,id:e.value}]))}catch{}},[s,r,u,l,n]),S=(0,c.useCallback)(e=>{n(t=>{let a=[...t];return a[r]={...a[r],listViewOptions:e},a})},[r,n]),C=(0,c.useCallback)(()=>{S(a.slice(0,25))},[S,a]),v=(0,c.useCallback)(()=>{n(e=>(0,lr.A)(e,(e,t)=>t!==r))},[r,n]),x=i.length>1,w=(0,c.useCallback)(e=>c.createElement(L.Ay,{...e,menuClassNames:lv().menu},c.createElement(U.A,{autoClogProps:lw,danger:!0,onSelected:v,disabled:!x,classNameListItem:Q()(lv().menuItem,lv().danger,{[lv().disabled]:!x})},lx.t("Remove object")),!x&&c.createElement(c.Fragment,null,c.createElement(L.bX,null),c.createElement("div",{className:lv().menuItemSubtext},lx.t("You must have at least one allowed Salesforce object")))),[v,x]),O=(0,c.useMemo)(()=>c.createElement(L.cQ,{position:"bottom-right",renderMenu:w},c.createElement(eI.A,{"aria-label":lx.t("Actions"),size:"x-small",svgIconProps:{name:"ellipsis-horizontal-filled"}})),[w]);return c.createElement(PanelSectionsContainer,{className:lv().sectionContainer},c.createElement("div",{className:lv().section,"data-qa":"allowed_object_section"},c.createElement(Field,{title:lx.t("Salesforce object"),actions:O},c.createElement(er.Ay,{shouldAllowUnselectInSingleSelectMode:!1,isDisabled:!!a.length||o,selectId:`${t?.value||"new"}-object-select`,selectedOption:t,onOptionSelected:E,width:"100%",placeholderText:lx.t("Select a Salesforce object"),options:b,renderOption:g,focusOnMount:!t,expandOnFocus:!1,isInvalid:t?.isError,errors:f,isRequired:!0})),c.createElement(Field,{title:lx.t("Suggested Salesforce lists (optional)")},c.createElement(tT.x,{isDisabled:!t||o||t?.isError,selectId:`${t?.value||"new"}-listviews-select`,search:A,selectedOptions:a,onSelectedItemsChange:S,width:"100%",placeholderText:lx.t("Select Salesforce lists"),debounceWaitPeriod:100,processOptions:y,renderOption:g,selectDataQa:"list_views_select",isInvalid:h,errors:_}),m&&c.createElement("div",{className:"margin_top_25 nudge_top_2"},c.createElement(ld.A,{errorCopy:lx.t("{listsCount}/{maximumListsCount} total lists selected",{listsCount:a.length,maximumListsCount:25}),ctaCopy:lx.t("Remove the last {excessListViewsCount}",{excessListViewsCount:a.length-25}),onCtaClick:C})))))};AllowedObjectSection.displayName="AllowedObjectSection",AllowedObjectSection.displayName="AllowedObjectSection";var lO=a(0x1aba66b56);let sortObjectOptions=e=>{let t=e.sort((e,t)=>`${getOptionLabel(e).trim()}${e.value}`.localeCompare(`${getOptionLabel(t).trim()}${t.value}`)),[a,n]=(0,li.A)(t,e=>!(getOptionLabel(e)?.includes("__MISSING LABEL__ PropertyFile")||(0,lO.A)(Object.values(lg),getOptionError(e)?.id)));return{invalidOptions:n,sortedOptions:[...a,...n]}};var lk=a(0xe3ac081e),lN=a(0x1c1c45c18);let lT=(0,e0.A)("salesHome.admin.getSuggestedListViews generated fetcher",(e,t,a)=>new eZ.S((n,i)=>{let{abortSignal:l,reason:r,...o}=a,s=(0,e2.VA)(o);e((0,eX.apiCall)({method:"salesHome.admin.getSuggestedListViews",args:s,abortSignal:l,reason:r})).then(e=>{n(e)}).catch(e=>{(0,e1.Ay)({getState:t}).error(`API call to salesHome.admin.getSuggestedListViews with reason ${r} failed, initiated by generated fetcher`),i(e)})}));lT.meta={name:"salesHomeAdminGetSuggestedListViewsFetcher",key:"createFetcherSalesHomeAdminGetSuggestedListViewsFetcher",description:"salesHome.admin.getSuggestedListViews generated fetcher"};let lI={Default:"___default___"},getSuggestionsByProfileId=({suggestions:e,profileId:t=lI.Default})=>Array.isArray(e)?e.filter(e=>e.profile_id===t):e?.[t]||[],prepareFetchedSuggestionsForSearchSelect=({suggestions:e,profileId:t=lI.Default})=>{let a=getSuggestionsByProfileId({suggestions:Array.isArray(e)?e.reduce((e,t)=>{let{profile_id:a,sobject_api_name:n,list_views:i}=t;return"profile_id"in t&&(e[a]={[n]:i.map(e=>({label:"",...e}))}),e},{}):e,profileId:t});return a?{ok:!0,list_views:Object.keys(a).reduce((e,t)=>{let n=a[t].map(e=>({label:e.label,value:e.id}));return e.push({objectOption:{label:t,value:t},listViewOptions:n}),e},[]).sort((e,t)=>(e.objectOption?.value||"").localeCompare(t.objectOption?.value||""))}:{ok:!1,list_views:[]}},lF=(0,e5.Ay)("Fetch admin suggested list views and return a set of sorted list views as options",async(e,t)=>{let a=t(),n=(0,F.rg)(a);try{if(n){let t=await e(lT({reason:"fetch-admin-suggested-list-viewws",salesforceOrgId:n}));return prepareFetchedSuggestionsForSearchSelect({suggestions:t.suggestions})}return{ok:!1,list_views:[]}}catch{return{ok:!1,list_views:[]}}});lF.meta={name:"fetchAdminSuggestedListViews",key:"createThunkFetchAdminSuggestedListViews",description:"Fetch admin suggested list views and return a set of sorted list views as options"};let lM=(0,e0.A)("salesHome.admin.setSuggestedListViews generated fetcher",(e,t,a)=>new eZ.S((n,i)=>{let{abortSignal:l,reason:r,...o}=a,s=(0,e2.VA)(o);e((0,eX.apiCall)({method:"salesHome.admin.setSuggestedListViews",args:s,abortSignal:l,reason:r})).then(e=>{n(e)}).catch(e=>{(0,e1.Ay)({getState:t}).error(`API call to salesHome.admin.setSuggestedListViews with reason ${r} failed, initiated by generated fetcher`),i(e)})}));lM.meta={name:"salesHomeAdminSetSuggestedListViewsFetcher",key:"createFetcherSalesHomeAdminSetSuggestedListViewsFetcher",description:"salesHome.admin.setSuggestedListViews generated fetcher"};let lD=(0,e5.Ay)("Update admin suggested list views",async(e,t,{suggestions:a,profileId:n=lI.Default,reason:i="update-admin-suggested-list-views"})=>{let l=t(),r=(0,F.rg)(l);try{if(r){let t=await e(lM({suggestions:a.map(({objectOption:e,listViewOptions:t})=>({profileId:n||lI.Default,sobjectApiName:e?.value||"",listViews:t.map(e=>({id:e.value}))})),reason:i,salesforceOrgId:r})),l=prepareFetchedSuggestionsForSearchSelect({suggestions:t.suggestions,profileId:n}).list_views,o=getSuggestionsByProfileId({suggestions:t.suggestions,profileId:n}),s=a.map(e=>{let{objectOption:t,listViewOptions:a}=e,n=t.value,i=(0,l_.A)(o,{profile_id:lI,sobject_api_name:n}),l=i?.list_views||[],r=a.map(e=>{let t=e.value,a=(0,l_.A)(l,{id:t});return{...e,label:a?.label||e.label}});return{objectOption:t,listViewOptions:r}});return{ok:!0,list_views:s,saved_list_views:l,errors:t.errors||[]}}return{ok:!1,list_views:[]}}catch(e){return e}});lD.meta={name:"updateAdminSuggestedListViews",key:"createThunkUpdateAdminSuggestedListViews",description:"Update admin suggested list views"};let lR=new p.Ay("modernselling"),lP={elementName:"add_object_header",onClick:{enableClogAction:!0}},lL={elementName:"add_object_footer",onClick:{enableClogAction:!0}},lU={elementName:"cancel",onClick:{enableClogAction:!0}},lB={elementName:"save",onClick:{enableClogAction:!0}},PinListViewsPanel=()=>{let e=(0,d.wA)(),t=(0,I.d4)(F.e$),a=(0,I.d4)(F.rg),n=(0,c.useRef)([]),[i,l]=(0,c.useState)([]),[r,o]=(0,lk.V)(()=>e(lF()).then(({list_views:e})=>(n.current=e,l(e),e))),[s,u]=(0,c.useState)(),[p,g]=(0,c.useState)([]),[f,_]=(0,lk.V)((t,a)=>e((0,le.S)({datasourceId:t,salesforceOrgId:a})).then(e=>{if(e){let{invalidOptions:t,sortedOptions:a}=sortObjectOptions(e.map(e=>({label:e.label,value:e.identifier,extras:{stringLabel:e.label}}))),n=t.map(e=>({id:e.value,code:getOptionError(e)?.id}));return g(e=>e.concat(...n)),a.map(e=>makeDecoratedOption({option:e,errorCode:getOptionError(e)?.code}))}return e})),h=(0,c.useMemo)(()=>{let e=f.payload??void 0;return p.length&&e?sortObjectOptions(e.map(e=>makeDecoratedOption({option:e,errorCode:getErrorCodeForOptionById({errors:p,id:e.value})}))).sortedOptions:e},[f.payload,p]);(0,c.useEffect)(()=>{let e=o(),n=_(t,a);return()=>{e.cancel(),n.cancel()}},[t,_,o,a]);let{currentObjectSelections:b,hasEmptyObjectSelections:y,hasModifiedSelections:A,hasMaxObjects:E,hasAnyListViewsLimitExceeded:S,hasAnyInvalidObjectSelections:C,hasAnyInvalidListViewSelections:v}=(({currentSelections:e,savedSelections:t})=>{let a=(0,c.useMemo)(()=>e.map(e=>e.objectOption),[e]),n=(0,lh.A)(e,e=>e.listViewOptions.length>25),i=(0,lh.A)(a,e=>!e),l=(0,lh.A)(a,e=>e?.isError),r=(0,lh.A)(e,e=>(0,lh.A)(e.listViewOptions,e=>e?.isError));return{currentObjectSelections:a,hasEmptyObjectSelections:i,hasModifiedSelections:!lodash_es_isEqualWith(e,t,(e,t)=>!(0,lh.A)(e,(e,a)=>{let n=t[a];if(e?.objectOption?.value!==n?.objectOption?.value)return!0;let i=e?.listViewOptions?.map(e=>e.value).sort(),l=n?.listViewOptions?.map(e=>e.value).sort();return!(0,lb.A)(i,l)})),hasMaxObjects:25===e.length,hasAnyListViewsLimitExceeded:n,hasAnyInvalidObjectSelections:l,hasAnyInvalidListViewSelections:r}})({currentSelections:i,savedSelections:n.current}),x=(0,c.useCallback)(()=>{e((0,eV.M)({element:c.createElement("div",{style:{position:"fixed",bottom:0,right:0}},c.createElement(eH.A,{svgIconProps:{name:"check-circle"}},lR.t("Settings updated")))}))},[e]),[{isLoading:w},O]=(0,lk.V)(async()=>(u(void 0),g([]),e(lD({suggestions:i,reason:"pin-list-views-panel"})).then(t=>{let[a,i]=(0,li.A)(t.errors,e=>e.code===lg.NonPublicListView);i.length||x(),a.length&&u(lg.NonPublicListView),i.length&&g(i);let r=makeDecoratedSelections({selections:t.list_views,errors:i}),o=makeDecoratedSelections({selections:t.saved_list_views,errors:i});return l(r),n.current=o,e((0,lN.KL)()),t}))),k=E||S||v||C||y||!a,N=r.isLoading||f.isLoading,T=N||w||k,M=N||w||!A,D=M||k,L=(0,c.useCallback)(()=>{o()},[o]),U=(0,c.useCallback)(()=>{l([...i,{objectOption:void 0,listViewOptions:[]}])},[i,l]),H=(0,c.useMemo)(()=>lR.t("{objectSectionsCount}/{maxObjectsCount} objects added",{objectSectionsCount:i.length,maxObjectsCount:25}),[i.length]),V=(0,c.useMemo)(()=>{let e=c.createElement(R.lV,{autoClogProps:lP,size:"medium",type:"outline",onClick:U,disabled:T,autoFocus:!0,"aria-label":lR.t("Add Object")},c.createElement(B.Ah,{name:"plus",size:"18"}),c.createElement("span",{className:"padding_left_25"},lR.t("Add Object")));return c.createElement("div",{className:"display_flex"},E&&c.createElement(ll.Ay,{tip:H,position:"bottom"},c.createElement("span",null,e)),!E&&e)},[U,E,T,H]);return c.createElement(m.A,{clogImpression:!0,uiComponentName:eU.UiComponentName.SALESFORCE_LISTS_SETTINGS_PANEL},c.createElement(PanelHeader,{actions:V,className:"margin_bottom_75"},lR.t("Salesforce lists")),c.createElement("h3",{className:"margin_top_125"},lR.t("Choose approved objects for Salesforce lists")),c.createElement("p",{className:"margin_top_150 margin_bottom_150"},lR.t("With Salesforce lists, sales teams can easily update Salesforce objects in Slack. By default, teams can see lists for accounts, opportunities, leads, contacts and cases. Add other Salesforce objects and remove the default objects if they aren\u2019t useful for your team. If you like, suggest some lists for each object to get them started.")),c.createElement("div",{className:"display_flex flex_direction_column flex_one"},N?c.createElement(P.A,{color:"blue",size:"jumbo"}):c.createElement(c.Fragment,null,i.map(({objectOption:e,listViewOptions:t},a)=>c.createElement(AllowedObjectSection,{key:e?.value||`new-allowed-object-section-${a}`,objectOptions:h,selectedObject:e,selectedListViews:t,updateSelections:l,currentObjectSelections:b,updateOptionErrors:g,index:a,isSaving:w})),s&&c.createElement(K.Ay,{level:K.A_.warning,className:"margin_bottom_100","data-qa":"page_level_warning"},getErrorMessage({errorCode:s})),c.createElement("div",{className:"display_flex"},c.createElement(R.lV,{autoClogProps:lL,isUnstyled:!0,onClick:U,disabled:T,className:Q()("display_flex align_items_center padding_top_50 padding_bottom_50",{sk_highlight:!T,sk_foreground_max_solid:T,cursor_default:T,cursor_pointer:!T}),"aria-label":E?H:lR.t("Add an object")},!E&&c.createElement(c.Fragment,null,c.createElement(B.Ah,{name:"plus",size:"18"}),c.createElement("span",{className:"padding_left_25"},lR.t("Add an object"))),E&&c.createElement("span",null,H)),c.createElement("div",{className:"flex_one","aria-hidden":"true"}))),c.createElement("div",{className:"flex_one","aria-hidden":"true"}),c.createElement("div",{className:"margin_top_100 margin_bottom_150 display_flex justify_content_end"},c.createElement(R.lV,{autoClogProps:lU,type:"outline",size:"medium",onClick:L,disabled:M,"aria-label":lR.t("Cancel")},lR.t("Cancel")),c.createElement(R.lV,{autoClogProps:lB,className:"margin_left_100",type:"primary",size:"medium",onClick:O,disabled:D,loading:w,disableWhenLoading:!0,"aria-label":lR.t("Save")},lR.t("Save")))))};function useSalesHomeAvailable(){let e=(0,I.d4)(F.e$),t=(0,tc.aV)(),a=!!t&&t.field_mappings?.length>0;return!!e&&a}PinListViewsPanel.displayName="PinListViewsPanel",PinListViewsPanel.displayName="PinListViewsPanel";var lH=a(0x2243365ec),lV=a(0xf01a9d50),lW=a(0x182c9b0b0),lj=a(0x1fe613d6e);let lG=new p.Ay("modernselling");var lq=((s=lq||{}).connection="connection",s.opportunities="opportunities",s.notifications="notifications",s.members="members",s.record_channels="record_channels",s.log_activity="log_activity",s.celebration="celebration",s);let BaseAdministrationPage=({view:e})=>{let t,a,n=(0,d.wA)(),i=(0,I.d4)(F.gr),l=(a=e?.params,a?.[lH.m]),r=useOpenMigrateUsersDialog(),[o,s]=(0,c.useState)(l?"members":"connection"),[p,f]=(0,c.useState)(ln.default),_=(0,I.d4)(F.uJ),h=(0,I.d4)(F.qA),b=(0,I.d4)(lj.K),y=useSalesHomeAvailable(),A=(0,I.d4)(F.rg),E=(0,I.d4)(F.e$),S=(0,I.d4)(F.sS);(0,u.A)(()=>{n((0,W.bD)()),n((0,tg._)()),n((0,W.kC)(null)),n((0,W.JH)())}),(0,c.useEffect)(()=>{A&&n((0,G.Y)({salesforceOrgId:A})).then(e=>{E&&n((0,W.Zz)(e))})},[n,A,E]),(0,c.useEffect)(()=>{(async()=>{if(A)try{await n((0,j.b)({salesforceOrgId:A}))}catch{}})()},[n,A]),(0,c.useEffect)(()=>{if(!l)return;let e=i.find(e=>e.salesforce_org_id===l);e&&(n((0,W.Ox)(e)),r())},[r,l,i,n]);let C=(0,c.useMemo)(()=>[{id:"connection",svgIcon:{name:"sf-cloud"},title:lG.t("Salesforce"),content:c.createElement(ConnectionPanel,null),autoClogProps:{elementName:"salesforce_connect",onClick:{enableClogAction:!0}},renderWrapper:e=>c.createElement(c.Fragment,null,c.createElement(AdministrationOrgSwitcher,null),e)},{id:"opportunities",svgIcon:(0,lV.C)("ListView"),title:lG.t("Salesforce lists"),content:c.createElement(PinListViewsPanel,null),autoClogProps:{elementName:"salesforce_lists",onClick:{enableClogAction:!0}},isDisabled:!y,className:y?"":"c-tabs__tab--disabled"},{id:"notifications",svgIcon:{name:"notifications"},title:lG.t("Notifications"),content:c.createElement(NotificationsPanel,{onChangeView:f,view:p}),autoClogProps:{elementName:"notifications",onClick:{enableClogAction:!0}},isDisabled:!y,className:y?"":"c-tabs__tab--disabled"},{id:"members",svgIcon:{name:"user-groups"},title:lG.t("People"),content:c.createElement(MemberManagementPanel,null),autoClogProps:{elementName:"people",onClick:{enableClogAction:!0}},isDisabled:!y,className:y?"":"c-tabs__tab--disabled"},{id:"log_activity",svgIcon:{name:"user-directory-add"},title:lG.t("Log activity"),content:c.createElement(LogActivityPanel,null),autoClogProps:{elementName:"log_activity",onClick:{enableClogAction:!0}},isDisabled:!y,className:y?"":"c-tabs__tab--disabled"},{id:"celebration",svgIcon:{name:"sparkles"},title:lG.t("Celebration"),content:c.createElement(CelebrationPanel,null),autoClogProps:{elementName:"deal_win_celebration",onClick:{enableClogAction:!0}},isDisabled:!y,className:y?"":"c-tabs__tab--disabled"}].filter(e=>null!==e),[y,p]),v=(0,c.useCallback)(e=>{s(e),f(ln.default)},[]);return t=b?_||h?c.createElement(WorkflowBuilderPage,null):E||S?c.createElement(m.A,{eventId:eU.EventId.LOB_SALES_HOME,clogImpression:!0,uiPage:eU.UiPage.SALES_ADMIN_SETTINGS},c.createElement(iM.A,{title:lG.t("Sales settings")}),c.createElement("div",{className:"p-sales_admin_page"},c.createElement(g.A,{className:"flex",tabs:C,currentTabId:o,onTabChange:v,orientation:"vertical",iconPosition:"left",tabMenuClassnames:"p-sales_admin__menu",tabPanelClassnames:"p-sales_admin__panel"}))):c.createElement(NoConnection,null):null,c.createElement(c.Fragment,null,c.createElement(AdministrationHeader,null),t)};BaseAdministrationPage.displayName="BaseAdministrationPage";let lY=c.memo((0,lW.A)(BaseAdministrationPage))},0x12c0d9ca0:(e,t,a)=>{"use strict";a.d(t,{A:()=>u});var n=a(0xbad225b5),i=a(0x20482ad21),l=a(0x102edf836),r=a(0x11a296110),o=a(0xb1ea448c),s=a(0x2501a2cee),c=a(0x20e80190e);let d=new i.Ay("modernselling"),ModalUtil=({alternateFooterAction:e,backText:t,children:a,contentLoading:i,hideFooter:u=!1,onBack:m,onCancel:p,onSubmit:g,preContent:f,showBack:_,showCancel:h,showSpeedBump:b,speedBump:y,submitIsDisabled:A,submitIsExternalLink:E,submitIsLoading:S,submitText:C,submitType:v=l.QE.primary,title:x})=>n.createElement(n.Fragment,null,n.createElement(c.rQ,null,n.createElement(c.Rc,{title:x})),n.createElement(c.$m,null,f&&n.createElement(c.qf,null,f),n.createElement(c.qf,null,i?n.createElement(o.A,{className:"margin_top_200 margin_bottom_200 margin_left_auto margin_right_auto"}):a)),!u&&n.createElement(c.jl,null,e??null,n.createElement(c.ox,null,_&&n.createElement(c.s_,{type:"outline",onClick:m,"aria-label":void 0},t||d.t("Back")),h&&n.createElement(c.s_,{type:"outline",onClick:p,"aria-label":d.t("Cancel")},d.t("Cancel")),n.createElement(r.lV,{loading:S,disabled:A,onClick:g,type:v,"aria-label":void 0},C,E&&n.createElement("span",{className:"margin_left_50"},n.createElement(s.Ah,{name:"new-window",size:"20"})))),b&&y));ModalUtil.displayName="ModalUtil";let u=ModalUtil},0x1b955e8fc:(e,t,a)=>{"use strict";a.d(t,{A:()=>useOpenConnectModal});var n=a(0xbad225b5),i=a(0x16cf1da63),l=a(0x214e51545),r=a(0x1229d92d),o=a(0x20482ad21),s=a(0x12c0d9ca0),c=a(0xd896af8a),d=a(0x266be29c),u=a(0xa72c61bb),m=a(0x226892387),p=a(0x16b708a7f),g=a(0x1c8beab7f),f=a(0x100003af0),_=a(0x766d71f),h=a(0x34ecbfe7),b=a(0x11c82607b),y=a(0x4872ed8e);let A=(0,b.Ay)("Deletes a Sales Elevate data source",async(e,t,{datasourceId:a,onError:n})=>{try{let{ok:t}=await e((0,y.K)({reason:"delete-sales-elevate-data-source",datasourceId:a}));if(!t)throw Error("Datasource deletion failed")}catch{n?.()}return null});A.meta={name:"deleteDatasource",key:"createThunkDeleteDatasource",description:"Deletes a Sales Elevate data source"};var E=a(0x783a2e96),S=a(0xe874a88a),C=a(0x22a29f141),v=a(0x1dfdeb1c8),x=a(0x1ec68d6a3),w=a(0xe747dd27);let O=(0,v.A)("salesHome.admin.setDatasourceId generated fetcher",(e,t,a)=>new S.S((n,i)=>{let{abortSignal:l,reason:r,...o}=a,s=(0,w.VA)(o);e((0,C.apiCall)({method:"salesHome.admin.setDatasourceId",args:s,abortSignal:l,reason:r})).then(e=>{n(e)}).catch(e=>{(0,x.Ay)({getState:t}).error(`API call to salesHome.admin.setDatasourceId with reason ${r} failed, initiated by generated fetcher`),i(e)})}));O.meta={name:"salesHomeAdminSetDatasourceIdFetcher",key:"createFetcherSalesHomeAdminSetDatasourceIdFetcher",description:"salesHome.admin.setDatasourceId generated fetcher"};var k=a(0x2037c754f);let N=(0,b.Ay)("Sets selected datasource to an org",async(e,t,{datasourceId:a,selectedSalesforceOrg:n,onSuccess:i,onError:l})=>{try{e((0,p.fL)("updating"));let t=n.salesforce_org_id,{ok:l}=await e(O({datasourceId:a,salesforceOrgId:t,reason:"modern-selling"}));if(!l)throw Error(c.B.SelectDatasource);e((0,p.Ox)({...n,datasource_id:a}));let r=await e((0,k.E)({datasourceId:a}));i(r),e((0,E._)()),e((0,p.Zz)({})),e((0,p.fL)("success"))}catch{e((0,p.iA)(c.B.SelectDatasource)),l()}});N.meta={name:"setDatasource",key:"createThunkSetDatasource",description:"Sets selected datasource to an org"};let T=(0,b.Ay)("Adds a new datasource datasource and sets as connected",async(e,t,{thirdPartyOauth2TokenId:a,onSuccess:n,onError:i})=>{let l,handleError=(t,a)=>{e((0,p.DN)("error")),t&&e(A({datasourceId:t})),i(a)};try{e((0,p.DN)("fetching"));let{datasource:t}=await e((0,_.m)({third_party_oauth2_token_id:a,data_source_access_permission:h.Jw.Public,creation_source:h.$f.SalesElevate,name:"Datasource"}));if(!t)throw Error(c.B.AddDatasourceError);l=t.id;let{salesforce_orgs:i}=await e((0,E._)())??{},r=i&&(0,f.z)([t],i);if(!r)throw Error(c.B.AddDatasourceError);await e(N({datasourceId:l,onSuccess:t=>{n(t),t&&e((0,p.m4)({salesforceOrgId:r.salesforce_org_id,datasourceId:t.id})),e((0,p.DN)("success"))},onError:()=>{handleError(l,c.B.DuplicateOrgError)},selectedSalesforceOrg:r}))}catch{handleError(l,c.B.AddDatasourceError)}return null});T.meta={name:"addNewConnectedDatasource",key:"createThunkAddNewConnectedDatasource",description:"Adds a new datasource datasource and sets as connected"};let I=new o.Ay("modernselling"),AddSourceStep=({onDone:e,setError:t,windowRef:a,...l})=>{let r=(0,u.I)(),o=(0,i.wA)(),f=(0,m.d4)(g.O7),_=(0,m.d4)(g.T8),h=(0,m.d4)(g.bi),b=(0,m.d4)(g.oG),y="fetching"===h,A="fetching"===b,E=y||A,S=(0,d.s)({providerKey:f,appId:r}),C=(0,n.useCallback)(()=>{o((0,p.O_)("fetching")),S()},[o,S]);return(0,n.useEffect)(()=>{!_||y||o(T({thirdPartyOauth2TokenId:_.thirdPartyOauth2TokenId,onSuccess:t=>{e({closeModal:!0}),o((0,p.aB)())},onError:e=>{t(e??c.B.AddDatasourceError),o((0,p.Fi)())}}))},[o,y,_,e,t]),(0,n.useEffect)(()=>{let handleRefocus=async()=>{a.deref()?.removeEventListener("focus",handleRefocus),A&&(t(c.B.AddDatasourceError),o((0,p.O_)("error")))};return a.deref()?.addEventListener("focus",handleRefocus),()=>{a.deref()?.removeEventListener("focus",handleRefocus)}},[_,t,b,a,A,o]),n.createElement(s.A,{...l,title:I.t("Add a Salesforce org"),submitText:I.t("Login to Add"),submitIsExternalLink:!0,onSubmit:C,submitIsLoading:E},n.createElement("div",{className:"margin_top_100 margin_bottom_100"},n.createElement("p",null,I.rt("Sign in with a system user account.")),n.createElement("p",null,I.t("Slack will stay signed as the system user so the Sales team can set up notifications for opportunities in the Salesforce org."))))};AddSourceStep.displayName="AddSourceStep";let F=(0,r.A)(AddSourceStep);var M=a(0xca924ee1),D=a(0x2b7f0bcc),R=a(0x1d2cd7755),P=a(0x139c79d16),L=a(0xa5dbe09b),U=a(0x1faa3f1ac),B=a(0x1d104c491);let H=new o.Ay("modernselling"),ChooseEnvironmentStep=({onDone:e,windowRef:t,...a})=>{let l=(0,i.wA)(),r=(0,m.d4)(g.O7),o=(0,n.useMemo)(()=>({production:{value:B.rI.Production,label:H.t("Production")},sandbox:{value:B.rI.Sandbox,label:H.t("Sandbox")}}),[]),d=(0,n.useCallback)(()=>{e({goToStep:c.b.AddSource})},[e]),u=(0,n.useCallback)(e=>{l((0,p.M5)(e))},[l]),f=(0,n.useMemo)(()=>r===B.rI.Sandbox,[r]),_=(0,n.useMemo)(()=>{let e=H.t("What\u2019s the difference?");return n.createElement(U.A,{"aria-label":e,href:"https://help.salesforce.com/s/articleView?id=sf.deploy_sandboxes_intro.htm&type=5",target:"_blank"},e)},[]);return n.createElement(s.A,{...a,title:H.t("Add a Salesforce org"),submitText:H.t("Continue"),onSubmit:d,alternateFooterAction:_},n.createElement(L.A,{legendText:H.t("Select an environment"),className:"margin_top_100 margin_bottom_100"},Object.values(o).map(e=>{let t=(0,M.A)(()=>u(e.value));return n.createElement(R.A,{key:e.value,type:"inline",cursor:"pointer",text:e.label},n.createElement(P.A,{checked:e.value===r,onChange:t}))})),f&&n.createElement(D.Ay,{level:"warning",className:"margin_top_125 margin_bottom_100",heading:H.t("This Salesforce org will be deleted when the sandbox environment is refreshed")},H.t("If this happens, you\u2019ll need to add this org again and recreate any Sales notifications you set up.")))};ChooseEnvironmentStep.displayName="ChooseEnvironmentStep";let V=(0,r.A)(ChooseEnvironmentStep);var W=a(0x1fd440889);let j=(0,b.Ay)("Checks if user created a new datasource after being redirect to integrations builder",async(e,t)=>{try{let a=t(),n=(0,g.KY)(a),i=await e((0,W.z)({creationSource:h.N$.SalesElevate,reason:"modern-selling"}));if(!i.ok)throw Error(c.B.CreateDatasourceError);if(i.datasources.some(({id:e})=>!n.some(({id:t})=>e===t)))return await e((0,E._)()),e((0,p.Kg)("success")),!0;return!1}catch{return e((0,p.qO)(c.B.CreateDatasourceError)),!1}});j.meta={name:"getIsNewDatasourceCreated",key:"createThunkGetIsNewDatasourceCreated",description:"Checks if user created a new datasource after being redirect to integrations builder"};var G=a(0x20fb5e2f6);let q=(0,b.Ay)("Opens WFB integrations manager page in new app window or browser tab",async e=>{try{e((0,p.Kg)("fetching"));let t=await e((0,W.z)({creationSource:h.N$.SalesElevate,reason:"modern-selling"}));if(!t.ok)throw Error(c.B.CreateDatasourceError);e((0,p._f)(t.datasources)),e((0,G.A)())}catch{e((0,p.qO)(c.B.CreateDatasourceError))}});q.meta={name:"startCreateNewDatasource",key:"createThunkStartCreateNewDatasource",description:"Opens WFB integrations manager page in new app window or browser tab"};let Y=new o.Ay("modernselling"),CreateSourceStep=({onDone:e,windowRef:t,...a})=>{let r=(0,i.wA)(),o=(0,m.d4)(g.yj),d=(0,m.d4)(g.k),u=(0,n.useCallback)(()=>{r(q())},[r]);return(0,n.useEffect)(()=>{if("fetching"!==o)return;let handleRefocus=async()=>{await r(j())&&(t.deref()?.removeEventListener("focus",handleRefocus),e({goToStep:c.b.SelectSalesforceOrg}))};return t.deref()?.addEventListener("focus",handleRefocus),()=>{t.deref()?.removeEventListener("focus",handleRefocus),r((0,p.Kg)("initial"))}},[r,e,o,t]),n.createElement(s.A,{...a,title:Y.t("Add a new integration"),submitText:Y.t("Manage Integrations"),submitIsExternalLink:!0,submitIsLoading:"fetching"===o,onSubmit:u},"error"===o&&d&&n.createElement(l.F,{className:"margin_bottom_150",errorType:d}),n.createElement("p",null,Y.rt("To use a new integration, you can add one in Workflow Builder. When you\u2019re done, come back here to Sales settings.")),n.createElement(D.Ay,{level:"info",className:"margin_top_25 margin_bottom_25",heading:Y.t("When prompted, sign in to Salesforce")},Y.t("Be sure to sign in using the account you want to use for the new integration. Slack will stay signed in using that account, and allow your team to set up notifications based on changes to that data.")))};CreateSourceStep.displayName="CreateSourceStep";let z=(0,r.A)(CreateSourceStep);var $=a(0x120c268ad),Q=a.n($),J=a(0x17294c72a),K=a(0x1595bdd0),Z=a(0x13815c0d1),X=a(0x1d01572a2),ee=a(0x1407c6c2c),et=a(0x15014e268),ea=a(0x1d1911997),en=a(0x6e87d4ec);let buildObjectMappingField=(e,t,a)=>{let n=e.fields?.find(e=>e.identifier===t),i={sfdc_field_identifier:n.identifier,sfdc_field_label:n.label,troops_schema_field_id:n.id,type:n.type,related_schema_object_id:n.relationships?.[0].related_schema_object_id,relationship_name:n.relationships?.[0].relationship_name};return a&&(i.values=a.values.reduce((e,t)=>(e[t.key]=t.values,e),{})),i};function buildObjectMappingSchema(e,t,a){let n={};return Object.entries(t||{}).forEach(([t,i])=>{let l=a?.find(e=>e.target===t);l?n[t]=buildObjectMappingField(e,i,l):n[t]=buildObjectMappingField(e,i)}),{troops_schema_object_id:e.id,sfdc_object_identifier:e.identifier,sfdc_object_label:e.label,fields:n}}var ei=a(0x20e80190e);let el=new o.Ay("modernselling"),MapFieldsChangeOpportunitySpeedBump=({onCancel:e,onSubmit:t})=>n.createElement(ei.ty,{heading:el.t("Change opportunity object?"),description:el.t("The opportunity field selections you\u2019ve made will be cleared."),onCancel:e,onContinue:t,continueButtonType:"danger",continueButtonLabel:el.t("Continue"),cancelButtonLabel:el.t("Cancel")});MapFieldsChangeOpportunitySpeedBump.displayName="MapFieldsChangeOpportunitySpeedBump";let er=new o.Ay("modernselling"),MapFieldsSubmitSpeedBump=({isSubmitting:e,onCancel:t,onSubmit:a})=>n.createElement(ei.ty,{heading:er.t("Confirm opportunity mapping update"),description:er.t("Everyone will need to re-authenticate, recreate existing notifications, and admins will need to reconfigure the deal won celebration."),onCancel:t,onContinue:a,continueButtonType:"danger",continueButtonLabel:er.t("Update"),cancelButtonLabel:er.t("Cancel"),continueButtonIsLoading:e});MapFieldsSubmitSpeedBump.displayName="MapFieldsSubmitSpeedBump";var eo=a(0xb77a689a),es=a(0xa7ec93c2),ec=a(0x1122238d8),ed=a(0x4a120eb2);let eu=new o.Ay("modernselling"),em=[],StageMultiSelect=({id:e,isLoading:t,onChange:a,stagesForClosed:i,stageField:l})=>{let r=(0,n.useMemo)(()=>l?(0,ec.I_)(l):[],[l]),o=(0,n.useMemo)(()=>r.filter(e=>i?.includes(e.value)),[i,r]),s=(0,n.useCallback)(async e=>e?r.filter(t=>((0,eo.A)(t.label)?t.label:t.value).toLowerCase().includes(e.toLowerCase())):r,[r]),c=eu.t("Select\u2026");return n.createElement(n.Fragment,null,t&&n.createElement(es.Ay,{className:"normal full_width",isLoading:t,isRequired:!0,options:em,placeholderText:c,selectId:e,selectedOptions:void 0,width:"100%"}),!t&&n.createElement(ed.x,{key:l?.id,className:"normal full_width",expandOnFocus:!0,debounceWaitPeriod:0,onSelectedItemsChange:a,placeholderText:c,search:s,selectedOptions:o??void 0,selectId:e,shouldAllowUnselectInMultiSelectMode:!0,width:"100%"}))};StageMultiSelect.displayName="StageMultiSelect";var ep=a(0x200c38ed8),eg=a(0x1216bc813),ef=a(0x91c8f270),e_=a(0x609b6779),eh=a(0x6258badf);let eb=(0,v.A)("salesHome.admin.setObjectMappings fetcher with capitalized keys",async(e,t,a)=>{try{let t,n=(0,eh.A)(a,["reason"]),i=(0,w.VA)(n);return t=i.object_mappings,i.object_mappings=Object.keys(t).reduce((e,a)=>(e[(0,Z.A)(a)]=t[a],e),{}),await e((0,C.apiCall)({method:"salesHome.admin.setObjectMappings",args:i,reason:a.reason}))}catch(e){throw(0,x.Ay)({getState:t}).error(`API call to salesHome.admin.setObjectMappings with reason ${a.reason} failed`),e}});eb.meta={name:"setObjectMappingsWithCapitalizedKeys",key:"createFetcherSetObjectMappingsWithCapitalizedKeys",description:"salesHome.admin.setObjectMappings fetcher with capitalized keys"};let ey=(0,b.Ay)("Update notifications pref datasource object field mappings",async(e,t,{objectMappings:a,salesforceOrgId:n})=>{let i=(0,x.Ay)({label:"SALES-HOME-ADMIN"}),l=(0,g.J3)(t());l&&Object.keys(l).forEach(e=>{a[e]||(a[e]=l[e])});try{await e(eb({reason:"modern-selling",objectMappings:a,salesforceOrgId:n})),e((0,p.Zz)(a))}catch(e){throw i.error("failed to set object mapping",e),e}});ey.meta={name:"updateNotificationsDatasourceMappingsBySalesforceOrgId",key:"createThunkUpdateNotificationsDatasourceMappingsBySalesforceOrgId",description:"Update notifications pref datasource object field mappings"};var eA=a(0x16ffed5ab),eE=a(0x5a1d0c42),eS=a.n(eE);let eC=new o.Ay("modernselling"),ev=[],ex="Opportunity",ew={[B.Ix.AccountId]:"Account ID",[B.Ix.Amount]:"Amount",[B.Ix.CloseDate]:"Close Date",[B.Ix.NextSteps]:"Next Step",[B.Ix.Stage]:"Stage"},eO=[B.Ix.AccountId,B.Ix.Amount,B.Ix.CloseDate,B.Ix.NextSteps,B.Ix.Stage],ek={[B.Ix.Name]:"Name",[B.Ix.OwnerId]:"OwnerId"};function usePrefMappingsByTarget(){let e=(0,ep.aV)();return(0,n.useMemo)(()=>e?.field_mappings.reduce((e,t)=>(e[t.target]=t.source.sfdc_field_identifier,e),{}),[e])}let OpportunityObjectSelect=({onChange:e,salesforceObjects:t,selectedOppObjIdentifier:a})=>{let i=(0,ee.A)(),[l,r]=(0,n.useState)(0),o=(0,n.useMemo)(()=>{let e=t?.filter(e=>e.is_active&&(e.identifier.endsWith("__c")||e.identifier===ex));return(0,J.A)(e,"label").map(e=>({label:e.label,value:e.identifier}))},[t]),s=(0,n.useMemo)(()=>a?o.find(e=>e.value===a):void 0,[o,a]),c=(0,n.useCallback)(e=>{""===e.target.value&&s&&r(e=>e+1)},[s]);return(0,n.useEffect)(()=>{r(e=>e+1)},[s]),n.createElement(R.A,{text:eC.t("Opportunity object"),className:"margin_bottom_125"},n.createElement(ea.Ay,{key:`${i}_${l}`,selectId:i,selectedOption:s,options:o||ev,onOptionSelected:e,onBlur:c,width:"100%"}))};OpportunityObjectSelect.displayName="OpportunityObjectSelect";let FieldSelect=({type:e,label:t,schemaIdentifier:a,allFields:i,selectedField:l,selectId:r,onChange:o,isLoading:s,withoutLabel:c})=>{let d=(0,n.useMemo)(()=>{let t=i?.filter(t=>t.is_active&&t.type===e);return(0,J.A)(t,"label").map(e=>({label:e.label,value:e.identifier}))},[i,e]),u=(0,n.useMemo)(()=>l?d.find(e=>e.value===l):null,[d,l]),m=(0,n.useMemo)(()=>s||0!==d.length?[]:[{id:r,message:eC.t("There are no options compatible with this field.")}],[s,d.length,r]),p=eC.t("Loading options\u2026");return c?n.createElement(et.Ay,{key:a,isDisabled:s||0===d.length,placeholderText:s?p:void 0,selectId:r,onOptionSelected:o,options:d||ev,selectedOption:u,errors:m,width:"100%"}):n.createElement(R.A,{text:t,className:"margin_bottom_125 normal"},n.createElement(et.Ay,{key:a,isDisabled:s||0===d.length,placeholderText:s?p:void 0,selectId:r,onOptionSelected:o,options:d||ev,selectedOption:u,errors:m,width:"100%"}))};FieldSelect.displayName="FieldSelect";let MapFieldsStep=({onDone:e,setError:t,data:a,...l})=>{let r=(0,i.wA)(),o=a?.selectedSalesforceOrgDatasourceId,d=(0,m.d4)(g.e$),u=o??d,p=(0,m.d4)(g.rg),f=usePrefMappingsByTarget(),_=(0,m.d4)(g.CE),[h,b]=(0,n.useState)(_||null),y=(0,ep.aV)(),[A,E]=(0,n.useState)(!0),[S,C]=(0,n.useState)(!0),[v,x]=(0,n.useState)(!1),[w,O]=(0,n.useState)(!1),[k,N]=(0,n.useState)(!1),[T,I]=(0,n.useState)(!1),[F,P]=(0,n.useState)(null),[L,U]=(0,n.useState)(null),[H,V]=(0,n.useState)(!1),[W,j]=(0,n.useState)(!1),[G,q]=(0,n.useState)(null),[Y,z]=(0,n.useState)(null),[$,J]=(0,n.useState)(f||null),[ee,et]=(0,n.useState)(null);(0,X.A)(()=>{r((0,ef.S)({datasourceId:u,salesforceOrgId:p})).then(e=>{if(P(e),e){let t=y?.source.sfdc_object_identifier||ex;e.some(e=>e.identifier===t)&&q(t||null)}}).catch(()=>{t(c.B.FetchDatasourceInfo)}).finally(()=>{E(!1)})}),(0,n.useEffect)(()=>{if(U(null),J(null),G&&F){C(!0);let e=F.find(e=>e.identifier===G)?.id;if(!e){t(c.B.FetchDatasourceInfo),C(!1);return}u&&r((0,eg.g)({objectId:e,datasourceId:u,salesforceOrgId:p})).then(t=>{if(U(t),V(t?.identifier!=="Opportunity"),f&&y?.source.troops_schema_object_id===e){j("StageName"!==f.stage),J(f);return}t?.fields&&J(()=>Object.entries(ew).reduce((e,[a,n])=>{let i=t?.fields?.find(e=>e.is_active&&e.label===n);return i&&(e[a]=i.identifier),e},{}))}).catch(()=>{t(c.B.FetchDatasourceInfo)}).finally(()=>{C(!1)})}},[r,f,y,G,t,F,u,p]);let ea=(0,n.useCallback)(e=>{e&&Object.keys($||{}).length>0?(z(e.value),O(!0)):(x(!0),q(e?e.value:null))},[$]),ei=(0,n.useMemo)(()=>(0,M.A)(e=>t=>{x(!0),J(a=>({...a,[e]:t.value})),"stage"===e&&(b(null),et(null),j("StageName"!==t.value))}),[]),el=(0,n.useCallback)((e,t,a)=>{let n={target:e,values:[{key:t,values:(0,K.A)(a?.map(e=>e.value))}]};et(e=>e?e?.find(e=>e.target===n.target)?e?.map(e=>e.target===n.target?n:e):[...e,n]:[n])},[]),er=(0,n.useCallback)(e=>{el("stage","stage_closed",e),x(!0)},[el]),eo=(0,n.useCallback)(()=>{if(!L||!$||!G)return;t(null),I(!0);let a={};ee?a[(0,Z.A)(B.hd.Opportunity)]=buildObjectMappingSchema(L,$,ee):a[(0,Z.A)(B.hd.Opportunity)]=buildObjectMappingSchema(L,$),new Promise((e,t)=>{let a=$?.[B.Ix.AccountId],n=L.fields?.find(e=>e.identifier===a),i=n?.relationships?.[0].related_schema_object_id;i?e(i):t(Error("No related account object ID"))}).then(e=>r((0,eg.g)({objectId:e,datasourceId:u,salesforceOrgId:p}))).then(e=>e?(a[(0,Z.A)(B.hd.Account)]=buildObjectMappingSchema(e,ek),r(ey({salesforceOrgId:p??"",objectMappings:a}))):Promise.reject(Error("No related account object"))).then(()=>{r((0,eA.M)({element:n.createElement(en.A,{svgIconProps:{name:"check-circle"}},eC.t("Mapping saved."))})),r((0,e_.S)({forceFetch:!0,reason:"map-fields-step"})),e({closeModal:!0})}).catch(()=>{t(f?c.B.UpdateFieldMappings:c.B.CreateFieldMappings),I(!1),N(!1)})},[L,$,G,t,ee,r,u,p,e,f]),es=(0,n.useCallback)(()=>{O(!1),z(null)},[]),ec=(0,n.useCallback)(()=>{O(!1),x(!0),q(Y),z(null),b(null),et(null)},[Y]),ed=(0,n.useMemo)(()=>n.createElement(MapFieldsChangeOpportunitySpeedBump,{onCancel:es,onSubmit:ec}),[ec,es]),eu=(0,n.useCallback)(()=>{N(!1)},[]),em=(0,n.useCallback)(()=>{N(!0)},[]),eh=(0,n.useMemo)(()=>n.createElement(MapFieldsSubmitSpeedBump,{isSubmitting:T,onCancel:eu,onSubmit:eo}),[eu,eo,T]),eb=(0,n.useMemo)(()=>{let e=ee?.find(e=>"stage"===e.target)?.values.find(e=>"stage_closed"===e.key);return(!H&&!W||!!e&&0!==e.values.length)&&!!($&&eO.every(e=>$?.[e]))},[$,ee,H,W]),eE=G||A||S,ev=!eb||!v&&!!f,eN=(0,n.useMemo)(()=>[{selectId:"amount",type:B.gI.CurrencySchemaField,label:eC.t("Amount"),selectedField:$?.[B.Ix.Amount],onChange:ei(B.Ix.Amount)},{selectId:"close_date",type:B.gI.DateSchemaField,label:eC.t("Close date"),selectedField:$?.[B.Ix.CloseDate],onChange:ei(B.Ix.CloseDate)},{selectId:"next_steps",type:B.gI.StringSchemaField,label:eC.t("Next steps"),selectedField:$?.[B.Ix.NextSteps],onChange:ei(B.Ix.NextSteps)},{selectId:"account",type:B.gI.ReferenceSchemaField,label:eC.t("Account"),selectedField:$?.[B.Ix.AccountId],onChange:ei(B.Ix.AccountId)},{selectId:"stage",type:B.gI.SelectSchemaField,label:eC.t("Stage"),selectedField:$?.[B.Ix.Stage],onChange:ei(B.Ix.Stage)}],[ei,$]),eT=(0,n.useMemo)(()=>{let e=eN.find(e=>"stage"===e.selectId)?.selectedField;return L?.fields?.find(t=>t.identifier===e)},[eN,L]);return n.createElement(s.A,{...l,title:eC.t("Map opportunity fields"),contentLoading:A&&S,submitText:eC.t("Save"),submitIsDisabled:ev,submitIsLoading:T,speedBump:w?ed:eh,showSpeedBump:w||k,onSubmit:em},n.createElement("p",null,eC.t("Now that you have an integration, you can map your opportunity fields.")),n.createElement("p",null,eC.t("If your team uses a custom opportunity object or custom opportunity fields, you can select them here. This ensures notifications will send when you expect them to.")),n.createElement(n.Fragment,null,n.createElement(OpportunityObjectSelect,{salesforceObjects:F,selectedOppObjIdentifier:Y??G,onChange:ea}),n.createElement("div",{className:"border_bottom margin_top_100 margin_bottom_100"})),eE?n.createElement(n.Fragment,null,n.createElement("table",{className:eS().opportunity_mapping_table},n.createElement("thead",null,n.createElement("tr",null,n.createElement("th",{className:Q()(eS().header,eS().field_label_header)},n.createElement("div",{className:"bold"},eC.t("Field"))),n.createElement("th",{className:Q()(eS().header,eS().field_input_header)},n.createElement("div",{className:"bold"},eC.t("Maps to\u2026"))))),n.createElement("tbody",null,eN.map(e=>n.createElement("tr",{key:e.selectId},n.createElement("td",{className:Q()(eS().cell,eS().field_label_cell)},n.createElement(R.A,{type:"inline",text:e.label,htmlFor:`${e.selectId}_button`})),n.createElement("td",{className:Q()(eS().cell,eS().field_input_cell)},n.createElement(FieldSelect,{selectId:e.selectId,schemaIdentifier:L?.identifier,type:e.type,label:e.label,allFields:L?.fields,selectedField:e.selectedField,onChange:e.onChange,isLoading:S,withoutLabel:!0})))),(H||W)&&n.createElement("tr",null,n.createElement("td",{colSpan:2},n.createElement("div",{className:eS().stage_multi_select_container},n.createElement(R.A,{className:eS().stage_multi_select_label,text:eC.t('Stage for "closed"'),htmlFor:"stage_for_closed_button"}),n.createElement("div",{className:eS().stage_multi_select},n.createElement(StageMultiSelect,{stagesForClosed:h,isLoading:S,onChange:er,id:"stage_for_closed_button",stageField:eT}))))))),n.createElement("div",null,eC.t("For more fields, you\u2019ll be able to use them in advanced options or in Workflow Builder when configuring notifications."))):null,!eE&&n.createElement(D.Ay,null,eC.t("Select an opportunity object first to start mapping opportunity fields.")))};MapFieldsStep.displayName="MapFieldsStep";let eN=(0,v.A)("salesHome.admin.addOrg generated fetcher",(e,t,a)=>new S.S((n,i)=>{let{abortSignal:l,reason:r,...o}=a,s=(0,w.VA)(o);e((0,C.apiCall)({method:"salesHome.admin.addOrg",args:s,abortSignal:l,reason:r})).then(e=>{n(e)}).catch(e=>{(0,x.Ay)({getState:t}).error(`API call to salesHome.admin.addOrg with reason ${r} failed, initiated by generated fetcher`),i(e)})}));eN.meta={name:"salesHomeAdminAddOrgFetcher",key:"createFetcherSalesHomeAdminAddOrgFetcher",description:"salesHome.admin.addOrg generated fetcher"};let eT=(0,b.Ay)("Sales admin action to add an org to the list of user orgs available to connect",async(e,t,{selectedSalesforceOrg:a})=>{await e(eN({reason:"sales-elevate",salesforceOrgId:a.salesforce_org_id})),e((0,p.Ox)(a)),e((0,p.Zz)({})),e((0,E._)())});eT.meta={name:"addAdminOrg",key:"createThunkAddAdminOrg",description:"Sales admin action to add an org to the list of user orgs available to connect"};var eI=a(0x1e217163d),eF=a(0x20158cb6);let eM=(0,b.Ay)("Prepares data for Select Source step",async(e,t,{selectedOrg:a,onSuccess:n,onError:i})=>{try{let t=a.salesforce_org_id;e((0,p.wO)());let{datasources:i}=await e((0,W.z)({creationSource:h.N$.SalesElevate,reason:"modern-selling"})),l=i.filter(({salesforce_org_id:e})=>e===t);e((0,p.Xb)(l)),n()}catch{e((0,p.iA)(c.B.FetchDatasourceInfo)),i(c.B.FetchDatasourceInfo)}});eM.meta={name:"getSelectSourceStep",key:"createThunkGetSelectSourceStep",description:"Prepares data for Select Source step"};var eD=a(0x24304a692),eR=a.n(eD);let eP=new o.Ay("modernselling"),eL="select-salesforce-org-radiogroup-label",eU="select-salesforce-org-radiogroup-label",SelectSalesforceOrgStep=({onDone:e,setError:t})=>{let a=(0,i.wA)(),[r,o]=(0,n.useState)(""),d=(0,m.d4)(g.Gq),u=(0,m.d4)(g.Ss),f=(0,m.d4)(g.Om),_=f.length,[h,b,y]=(()=>{let e=(0,i.wA)(),[t,a]=(0,n.useState)("initial");return["updating"===t,"error"===t,async(t,n)=>{try{a("updating"),await e(eT({selectedSalesforceOrg:t}));let i=await e((0,k.E)({datasourceId:t.datasource_id}));a("success"),n(i?.isConnected?{goToStep:c.b.Syncing}:i?.isSynced?{goToStep:c.b.MapFields}:{closeModal:!0})}catch{a("error")}}]})();return((0,n.useEffect)(()=>(a((0,E._)()),()=>{a((0,p.Un)())}),[a]),"initial"===d)?null:n.createElement(s.A,{showCancel:!0,contentLoading:"fetching"===d,title:eP.t("Add a Salesforce org"),onSubmit:()=>{let n=f.find(({salesforce_org_id:e})=>e===r);if(n){if(n.is_legacy_elevate_org)return void a(eM({selectedOrg:n,onSuccess:()=>{e({goToStep:c.b.ChooseSource})},onError:t}));y(n,e)}},submitText:eP.t("Connect"),submitIsDisabled:0===_,submitIsLoading:h},0===_&&n.createElement(n.Fragment,null,n.createElement("h2",{className:eR().header},eP.t("No available salesforce orgs.")),n.createElement("p",{className:eR().text},eP.t("To add more orgs, please contact your admin."))),_>0&&n.createElement(eI.B,{space:"125",as:"section"},u&&n.createElement(l.F,{errorType:c.B.FetchAdminOrgList}),b&&n.createElement(l.F,{errorType:c.B.AddAdminOrg}),n.createElement(eI.B,{space:"50"},n.createElement("h2",{id:eL,className:eR().header},eP.t("Choose an org that\u2019s already connected with Slack")),n.createElement("p",{id:eU,className:eR().text},eP.rt("Based on existing orgs from admin org dashboard."))),n.createElement(eF.v,{orgs:f,onOrgSelect:o,"aria-labelledby":eL,"aria-describedby":eU}),n.createElement("p",{className:eR().text},eP.rt("To add more orgs, please contact your admin."))))};function filterConnectedDatasources(e,t){return e?.filter(e=>e.status===h.VW.Connected||e.status===h.VW.Synced||t===e.id)}SelectSalesforceOrgStep.displayName="SelectSalesforceOrgStep";var eB=a(0xa1832ae4),eH=a(0x1ee439e69);let eV=new o.Ay("modernselling"),SelectSourceSpeedBump=({isSubmitting:e,onCancel:t,onSubmit:a})=>{let i=(0,m.d4)(eH.H7),l=(0,n.useCallback)(()=>{(0,eB.gC)(i,"/help/requests/new")},[i]),r=eV.rt("Make sure switching to a new integration is necessary before continuing, or {contactUs} if you have any concerns.",{contactUs:n.createElement(U.A,{onClick:l},eV.t("contact us"))});return n.createElement(ei.ty,{heading:eV.t("Confirm integration switch"),description:r,onCancel:t,onContinue:a,continueButtonType:"danger",continueButtonLabel:eV.t("Switch Now"),cancelButtonLabel:eV.t("Cancel"),continueButtonIsLoading:e})};SelectSourceSpeedBump.displayName="SelectSourceSpeedBump";var eW=a(0x24169e055);let ej=(0,b.Ay)("Sets selected datasource to an org",async(e,t,{datasourceId:a,selectedSalesforceOrg:n,onSuccess:i,onError:l})=>{try{e((0,p.fL)("updating"));let t=n.salesforce_org_id;if(!(await e((0,eW.O)({salesforceOrgId:t,reason:"modern-selling"}))).ok||!(await e(O({datasourceId:a,salesforceOrgId:t,reason:"modern-selling"}))).ok)throw Error(c.B.SwitchDatasource);e((0,p.Ox)({...n,datasource_id:a})),e((0,p.m4)({salesforceOrgId:t,datasourceId:a}));let l=await e((0,k.E)({datasourceId:a}));i(l),e((0,p.Zz)({})),e((0,p.fL)("success"))}catch{e((0,p.iA)(c.B.SwitchDatasource)),l()}});ej.meta={name:"switchDatasource",key:"createThunkSwitchDatasource",description:"Sets selected datasource to an org"};let eG=new o.Ay("modernselling"),SelectSourceStep=({onDone:e,setError:t,...a})=>{let l=(0,i.wA)(),r=(0,m.d4)(g.Ey),o=(0,m.d4)(g.C_),d=(0,m.d4)(g.fY),u=(0,m.d4)(g.aV),p=u?.name||"",f=(0,m.d4)(g.e$),_=(0,n.useMemo)(()=>filterConnectedDatasources(o,f),[o,f]),[h,b]=(0,n.useState)(f),[y,A]=(0,n.useState)(!1),E=r?.salesforce_org_id===u?.salesforce_org_id,S=!!r?.datasource_id,C=r?.datasource_id!==h,v=E&&!!h&&S&&C,x="updating"===d,w=(0,n.useCallback)(t=>{e(t?.isConnected?{goToStep:c.b.Syncing}:t?.isSynced?{goToStep:c.b.MapFields}:{closeModal:!0})},[e]),O=(0,n.useCallback)(e=>{A(!1),t(e?c.B.SwitchDatasource:c.B.SelectDatasource)},[t]),k=(0,n.useCallback)(()=>{h&&u&&l((v?ej:N)({datasourceId:h,selectedSalesforceOrg:u,onSuccess:w,onError:()=>O(v)}))},[l,v,h,u,w,O]),T=(0,n.useCallback)(e=>{let{value:t}=e.target;t!==f&&b(t)},[f]),I=(0,n.useCallback)(()=>{v?A(!0):k()},[v,k]),F=(0,n.useCallback)(()=>{A(!1)},[]),M=(0,n.useMemo)(()=>n.createElement(SelectSourceSpeedBump,{isSubmitting:x,onCancel:F,onSubmit:k}),[x,F,k]),D=v?eG.t("Switch"):eG.t("Connect");return n.createElement(s.A,{...a,title:eG.t("Salesforce org"),onSubmit:I,submitType:v?"danger":"primary",submitText:D,submitIsDisabled:!C,submitIsLoading:x,speedBump:M,showSpeedBump:y,showBack:!0},n.createElement(L.A,{legendText:eG.rt("Select an integration for {orgName}",{orgName:p})},_?.map(e=>{let t=f===e.id,a=t?eG.rt("{name} (Current)",{name:e.name}):e.name;return n.createElement(R.A,{key:e.id,htmlFor:e.id,type:"inline",text:a,subtext:e.third_party_oauth2_instance_url,isDisabled:t},n.createElement(P.A,{name:"selectDatasource",id:e.id,value:e.id,disabled:t,checked:h===e.id,onChange:T}))})))};SelectSourceStep.displayName="SelectSourceStep";let eq=new o.Ay("modernselling"),SyncingStep=({onDone:e,...t})=>{let a=(0,m.wz)(g.Lm),i=(0,n.useCallback)(()=>{e({closeModal:!0})},[e]);return(0,n.useEffect)(()=>{a?.isConnected||e({closeModal:!0})},[a,e]),n.createElement(s.A,{...t,title:eq.t("Sync in progress"),showBack:!1,backText:void 0,submitText:eq.t("Ok"),onSubmit:i},n.createElement("p",null,eq.t("You\u2019re on your way! You can continue setup as soon as the connection sync completes. This typically only takes a few minutes, but could take up to 30.")),n.createElement("p",null,eq.t("You\u2019ll receive a message when it\u2019s time to come back and finish setup.")))};SyncingStep.displayName="SyncingStep";let eY=new o.Ay("modernselling"),WarnRemapFieldsStep=({data:e,onDone:t,...a})=>{let i=(0,n.useCallback)(async()=>{t({goToStep:c.b.MapFields})},[t]);return n.createElement(s.A,{...a,title:eY.t("Update opportunity field map?"),onSubmit:i,submitText:eY.t("Next")},n.createElement(D.Ay,{className:"margin_bottom_100",level:"warning"},eY.t("{numWorkflows, plural, =1 {# existing notification uses} >999 {1K or more existing notifications use} other {# existing notifications use}} the existing mapping.",{numWorkflows:e.numWorkflows})),n.createElement("p",null,eY.t("Here\u2019s what will happen when you update the mapping:")),n.createElement("ul",null,n.createElement("li",null,eY.t("All new sales notifications created will use the updated mapping to determine when they should send.")),n.createElement("li",null,eY.t("Everyone who has notifications that reference a re-mapped field will need to delete and recreate those notifications.")),n.createElement("li",null,eY.t("People with affected notifications won\u2019t be notified \u2014 please reach out to your team about these changes.")),n.createElement("li",null,eY.t("If you update the opportunity object, existing admin-suggested opportunity lists will be cleared and you\u2019ll need to set up new ones.")),n.createElement("li",null,eY.t("Celebrations will stop showing on user profiles and need to be reconfigured."))))};WarnRemapFieldsStep.displayName="WarnRemapFieldsStep";let ez=new o.Ay("modernselling"),WarnSwitchSourceStep=({onDone:e,...t})=>{let a=(0,i.wA)(),l=(0,m.d4)(g.Ey),r=(0,m.d4)(g.fY),o=(0,n.useCallback)(()=>{e({goToStep:c.b.ChooseSource})},[e]),d=(0,n.useCallback)(()=>{l&&a(eM({selectedOrg:l,onSuccess:o,onError:t.setError}))},[t.setError,l,a,o]);return n.createElement(s.A,{...t,title:ez.t("Switch integration?"),onSubmit:d,submitType:"danger",submitText:ez.t("Next"),submitIsLoading:"fetching"===r},n.createElement(D.Ay,{className:"margin_bottom_100",level:"warning"},ez.t("Switching integrations could be disruptive for your team.")),n.createElement("p",null,ez.t("Here\u2019s what will happen when you switch integrations:")),n.createElement("ul",null,n.createElement("li",null,ez.t("All notifications created by anyone will be deleted immediately.")),n.createElement("li",null,ez.t("You\u2019ll need to re-map opportunity object fields for the new integration.")),n.createElement("li",null,ez.t("Everyone will need to recreate their custom notifications from scratch.")),n.createElement("li",null,ez.t("Everyone will need to re-authenticate."))))};WarnSwitchSourceStep.displayName="WarnSwitchSourceStep";var e$=a(0x1fcbb004d);let eQ={[c.b.SelectSalesforceOrg]:SelectSalesforceOrgStep,[c.b.ChooseSource]:SelectSourceStep,[c.b.ChooseEnvironment]:V,[c.b.AddSource]:F,[c.b.CreateSource]:z,[c.b.MapFields]:MapFieldsStep,[c.b.Syncing]:SyncingStep,[c.b.WarnRemapFields]:WarnRemapFieldsStep,[c.b.WarnSwitchSource]:WarnSwitchSourceStep},ConnectionModal=({startStep:e=c.b.ChooseSource,data:t})=>{let a=(0,i.wA)(),[r,o]=(0,n.useState)(null),[s,d]=(0,n.useState)([e]),u=s[s.length-1];(0,n.useEffect)(()=>{o(null)},[u]);let m=(0,n.useCallback)(()=>{a((0,e$.O)())},[a]),p=(0,n.useCallback)(()=>{d(e=>e.slice(0,e.length-1))},[]),g=(0,n.useCallback)(({closeModal:e,goToStep:t})=>{e?m():t&&d([...s,t])},[m,s]),f=(0,n.useMemo)(()=>r?n.createElement(l.F,{className:"margin_bottom_100",errorType:r}):null,[r]),_=eQ[u];return n.createElement(ei.dW,{closeModal:m},n.createElement(_,{onBack:p,onCancel:m,onDone:g,preContent:f,setError:o,showBack:s.length>1,showCancel:1===s.length,data:t}))};ConnectionModal.displayName="ConnectionModal";var eJ=a(0x46dbff89);function useOpenConnectModal(){let e=(0,i.wA)();return(t,a)=>{e((0,eJ.q)({element:n.createElement(ConnectionModal,{startStep:t,data:a})}))}}useOpenConnectModal.displayName="useOpenConnectModal"},0x30e98603:(e,t,a)=>{"use strict";a.d(t,{Ay:()=>__WEBPACK_DEFAULT_EXPORT__,n9:()=>s,or:()=>c});var n,i,l=a(0xbad225b5),r=a(0x120c268ad),o=a.n(r),s=((n={}).ORANGE="orange",n.BLUE="blue",n.WHITE="white",n),c=((i={})[i.SMALL=12]="SMALL",i[i.MEDIUM=16]="MEDIUM",i[i.LARGE=20]="LARGE",i);let __WEBPACK_DEFAULT_EXPORT__=({className:e,fillColor:t,size:a=16})=>l.createElement("svg",{width:a,height:a,viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:o()(e,`p-crown_icon--${t}`)},l.createElement("path",{d:"M14.1047 13.7426H2.89531C2.62969 13.7426 2.39062 13.9931 2.39062 14.2713V14.2992C2.39062 15.2175 3.10781 15.9688 3.98438 15.9688H13.0156C13.8922 15.9688 14.6094 15.2175 14.6094 14.2992V14.2713C14.6094 13.9931 14.3703 13.7426 14.1047 13.7426Z"}),l.createElement("path",{d:"M15.4063 2.3334C14.5297 2.3334 13.8125 3.08474 13.8125 4.00304C13.8125 4.50394 14.025 4.977 14.3703 5.2831C13.9187 6.36837 12.8828 7.11971 11.6609 7.06405C10.2531 6.98057 9.11094 5.78399 9.03125 4.30914C9.03125 4.0587 9.03125 3.83608 9.08438 3.61346C9.66875 3.36301 10.0938 2.77864 10.0938 2.05513C10.0938 1.13682 9.37656 0.385483 8.5 0.385483C7.62344 0.385483 6.90625 1.13682 6.90625 2.05513C6.90625 2.75081 7.33125 3.36301 7.91562 3.61346C7.96875 3.83608 7.96875 4.0587 7.96875 4.30914C7.88906 5.78399 6.74687 6.98057 5.33906 7.06405C4.11719 7.14754 3.05469 6.36837 2.62969 5.2831C2.975 4.977 3.1875 4.50394 3.1875 4.00304C3.1875 3.08474 2.47031 2.3334 1.59375 2.3334C0.717187 2.3334 0 3.08474 0 4.00304C0 4.92135 0.717187 5.67269 1.59375 5.67269L2.3375 11.6277C2.36406 11.8782 2.57656 12.073 2.84219 12.073H14.1578C14.3969 12.073 14.6094 11.8782 14.6625 11.6277L15.4063 5.67269C16.2828 5.67269 17 4.92135 17 4.00304C17 3.08474 16.2828 2.3334 15.4063 2.3334Z"}))},0x4c8d8a39:(e,t,a)=>{"use strict";a.d(t,{j:()=>SalesHomeHeader});var n=a(0xbad225b5),i=a(0x120c268ad),l=a.n(i),r=a(0x20482ad21),o=a(0x1feb18f19),s=a(0x344bb842),c=a(0x156eec78a),d=a(0x139aa1a7),u=a(0x1fe613d6e),m=a(0x226892387);let p=new r.Ay("modernselling"),OpenAdminPageButton=({iconClassName:e})=>{let t=(0,c.Q)(),a=(0,m.d4)(u.K),i=(0,n.useMemo)(()=>({name:"settings"}),[]),l=(0,n.useCallback)(()=>{t({viewType:d.D.SalesAdministration})},[t]);return a?n.createElement(s.A,{className:e,"aria-label":p.t("Open admin page",{fallbackHash:"15ae7c51e4b1c1ccd27edcee37a115fb6f35b3b8"}),svgIconProps:i,onClick:l}):null};OpenAdminPageButton.displayName="OpenAdminPageButton";var g=a(0x16cf1da63),f=a(0xb90de824),_=a(0x13953efe6),h=a(0x23c27866b),b=a(0x1472af90a),y=a(0xf052d367),A=a(0x18632f75a);let E=new r.Ay("modernselling"),OnboardingMultiOrgNewOrgAvailableCoachmark=()=>{let e=(0,g.wA)(),t=b.G7.SalesHomeMultiOrgNewOrgAvailableCoachmark,a="sales-home-multi-org-new-org-available-seen",i=(0,h.A)(t,a),l=(0,m.d4)(e=>(0,y.kI)(e,t,b.X8.Click)),r=(0,m.d4)(e=>(0,y.h$)(e,t));(0,n.useEffect)(()=>{(async()=>{await i()})()},[i]);let o=(0,n.useCallback)(()=>{e((0,A.z)({component:t,type:b.X8.Click,reason:a}))},[e,a,t]),s=(0,n.useMemo)(()=>n.createElement(f.Ay,{title:E.t("New org available"),bodyText:E.t("Easily add multiple Salesforce orgs to keep track of your deals in one place."),closeCoachmark:o,isOpen:!r,offsetY:5,offsetX:-62,width:420,arrowPosition:10}),[o,r]);return!l||r?null:n.createElement(_.Ay,{coachmarkElement:s,orientation:"bottom-right"})};OnboardingMultiOrgNewOrgAvailableCoachmark.displayName="OnboardingMultiOrgNewOrgAvailableCoachmark";var S=a(0x99233ecb),C=a(0xb90d5858),v=a(0x1a3c2e1af),x=a(0x94b8b4bd),w=a(0x2501a2cee),O=a(0x4c96e5d9),k=a(0x1fdec3e16),N=a(0xab4abe34),T=a.n(N);let I=new r.Ay("modernselling"),ConnectionStatus=({status:e,errors:t,total:a})=>{let i=(({errors:e,total:t})=>({connected:I.t("Connected \u{1F44D}"),"all-errors":I.t("Connection error"),"some-errors":I.t("{errors} out of {total} connection errors",{errors:e,total:t})}))({errors:t,total:a}),l=(0,n.useRef)(a),r=(0,n.useRef)(t),[o,s]=(0,n.useState)(l.current<=a&&"connected"===e?"":i[e]);return(0,n.useEffect)(()=>{r.current>t&&"connected"===e&&s(i[e]),r.current>t&&"some-errors"===e&&s(i[e]),r.current!==t&&(r.current=t)},[i,e,t]),(0,n.useEffect)(()=>{l.current{if(o!==i.connected)return;let e=setTimeout(()=>s(""),5e3);return()=>{clearTimeout(e)}},[o,i.connected]),n.createElement(k.A,{lines:1,withTooltip:!0},n.createElement("span",{className:T().status},o))};ConnectionStatus.displayName="ConnectionStatus";let F=new r.Ay("modernselling"),getTooltipText=(e,t,a)=>({connected:F.t("Connected to {total, select, 1 {{firstOrgName}} other {{firstOrgName} and {remained} other {remained, plural, one {org} other {orgs} }}}",{firstOrgName:t,total:a,remained:a-1}),error:F.t("Could not connect to {total, select, 1 {{firstOrgName}} other {{firstOrgName} and {remained} other {remained, plural, one {org} other {orgs} }}}",{firstOrgName:t,total:a,remained:a-1})})[e];var M=a(0x1be37a18e),D=a(0x95c69c7),R=a(0x1006f8a2b),P=a(0x1c8beab7f),L=a(0x77e385ed),U=a(0x192df3d34),B=a(0x1ec19bc0c),H=a(0x16b708a7f);let V=new r.Ay("modernselling"),RefreshConnectionModal=({refreshConnectionOrgId:e})=>{let t=(0,g.wA)(),a=(0,m.d4)(t=>(0,P.iy)(t,e)),i=(0,n.useCallback)(()=>{t((0,H.Ko)())},[t]);return n.createElement(B.y,{title:V.t("Log in to refresh connection"),mainText:V.t("Refresh the connection with this Salesforce org by logging in with your account."),defaultSelectedOrgId:e,userOrgsToConnect:a,handleClose:i})};RefreshConnectionModal.displayName="RefreshConnectionModal";var W=a(0x11c82607b),j=a(0x46dbff89);let G=(0,W.Ay)("Opens Refresh Connection Modal",(e,t,a)=>{e((0,j.q)({element:n.createElement(RefreshConnectionModal,a)}))});G.meta={name:"openRefreshConnectionModal",key:"createThunkOpenRefreshConnectionModal",description:"Opens Refresh Connection Modal"};var q=a(0x8ed8ca46),Y=a(0x3aa3d802),z=a(0x15b7e3c51),$=a.n(z);let Q=new r.Ay("modernselling"),J={maskImage:"radial-gradient(circle 16px at 80% 80%, transparent 50%, black 51%)"},UserOrgMenu=({iconClassName:e})=>{let t,a,i=(0,g.wA)(),r=(0,m.d4)(q.mO),c=(0,m.d4)(P.lC).length,d=(0,m.d4)(P.Lz),u=!!(0,D._)({view:"sidebar"}),{status:p,errors:f,total:_}=(t=r.length,0===(a=r.reduce((e,{auth:t})=>("error"===t&&(e+=1),e),0))?{status:"connected",errors:0,total:t}:a===r.length?{status:"all-errors",errors:t,total:t}:{status:"some-errors",errors:a,total:r.length}),h="connected"===p,b="all-errors"===p||"some-errors"===p,y=((e,t)=>{if("connected"===e)return getTooltipText("connected",t[0]?.name,t.length);if("all-errors"===e)return getTooltipText("error",t[0]?.name,t.length);if("some-errors"===e){let e=t.filter(({auth:e})=>"error"===e);return getTooltipText("error",e[0]?.name,e.length)}return""})(p,r),A=Q.t("Manage all Salesforce orgs"),E=(0,n.useCallback)(()=>{i((0,L.N)())},[i]),k=(0,n.useCallback)(()=>{i((0,R.A)({activeSection:M._.salesforce}))},[i]),N=(0,n.useCallback)(e=>{i(G({refreshConnectionOrgId:e}))},[i]),T=(0,n.useCallback)(async e=>{e&&await i((0,Y.h)({reason:"modern-selling-disconnect-user-org",salesforceOrgId:e}))},[i]),I=(0,n.useCallback)(e=>{let t=r.find(({salesforce_org_id:t})=>e===t)?.name||"",a=n.createElement("p",null,Q.t("You won\u2019t be able to view or update {orgName} opportunities and any notifications based on information from {orgName} will stop.",{orgName:t}));i((0,U.A)({disconnectOrgId:e,isDisconnecting:"fetching"===d,handleDisconnect:T,children:a}))},[r,d,i,T]),F=(0,n.useCallback)(({orgName:e,orgUrl:t,orgId:a})=>i=>n.createElement(S.Ay,i,b&&n.createElement(C.A,{label:Q.t("Refresh connection"),onSelected:()=>N(a)}),n.createElement(C.A,{danger:!0,onSelected:()=>I(a)},Q.t("Disconnect {orgName}",{orgName:e})),n.createElement(S.bX,null),n.createElement("div",{className:$().url},t.split("https://")[1])),[I,b,N]),B=(0,n.useCallback)((e,t)=>n.createElement(n.Fragment,null,"ok"===e&&n.createElement("div",{className:l()($().connected,{[$().highlighted]:t})},n.createElement(w.Ah,{size:"20",name:"check-circle-filled"})),"error"===e&&n.createElement("div",{className:l()($().error,{[$().highlighted]:t})},n.createElement(w.Ah,{size:"20",name:"warning-filled"}))),[]),H=(0,n.useCallback)(({userOrgs:e,isDisplayingConnectAnotherOrg:t,showManageOrgs:a})=>i=>n.createElement(S.Ay,i,e.map(({name:e,salesforce_org_id:t,auth:a,instance_url:i,is_legacy:l})=>{if(!l)return n.createElement("div",{className:"c-menu_item__li",key:t},n.createElement("div",{className:$().orgListItem},n.createElement("div",{className:"c-menu_item__icon"},B(a,!1)),n.createElement("div",{className:"c-menu_item__label c-menu_item__label--with_description"},e,n.createElement("div",{className:"c-menu_item__description"},"error"===a?Q.t("Connection error"):Q.t("Connected")))));let r=(0,x.A)(l=>n.createElement(v.A,{...l,renderSubmenu:F({orgName:e,orgUrl:i,orgId:t,isError:"error"===a}),label:e,description:"error"===a?Q.t("Connection error"):Q.t("Connected"),icon:B(a,l.highlighted)}));return n.createElement(r,{key:t})}),a&&n.createElement(n.Fragment,null,n.createElement(S.bX,null),n.createElement(C.A,{onSelected:k},A)),t&&n.createElement(n.Fragment,null,n.createElement(S.bX,null),n.createElement(C.A,{onSelected:E},n.createElement(o.c,{space:"75"},n.createElement(w.Ah,{size:"20",name:"plus"}),Q.t("Connect another org"))))),[A,k,E,B,F]);return n.createElement(o.c,{space:"25"},n.createElement(S.cQ,{renderMenu:H({userOrgs:r,isDisplayingConnectAnotherOrg:c>0,showManageOrgs:void 0!==r.find(e=>!e.is_legacy)}),position:"left-bottom"},n.createElement(O.Ay,{position:"bottom",tip:y},n.createElement(s.A,{className:e,"aria-label":Q.t("Open Salesforce organizations menu")},h&&n.createElement(n.Fragment,null,n.createElement(w.Ah,{size:"20",name:"sf-cloud",style:J}),n.createElement(w.Ah,{size:"16",name:"check-circle-filled",style:{color:u?"var(--dt_color-content-inv-hgl-2)":"var(--dt_color-content-hgl-2)",position:"absolute",left:"16px",top:"16px"}})),b&&n.createElement(n.Fragment,null,n.createElement(w.Ah,{size:"20",name:"sf-cloud",style:J}),n.createElement(w.Ah,{size:"16",name:"warning-filled",style:{color:u?"var(--dt_color-content-inv-imp)":"var(--dt_color-content-imp)",position:"absolute",left:"16px",top:"16px"}}))))),n.createElement(ConnectionStatus,{status:p,errors:f,total:_}))};UserOrgMenu.displayName="UserOrgMenu";var K=a(0x1e84d332f);let Z=new r.Ay("modernselling"),SalesHomeHeader=({actions:e,className:t,title:a,showDropdownMenu:i=!0,showConnectedToSalesforce:r=!1,showHeaderTitle:s=!0,largeTitle:c=!1})=>{let d=(0,m.d4)(q.mO),u=(0,m.d4)(P.lC),p=(0,K.K)(d),g=`${t}_icon`;return n.createElement("div",{className:l()(t,"p-sales_home_header")},s&&n.createElement("div",{className:l()("p-sales_home_header__title",{"p-sales_home_header__title--large":c})},a||Z.t("Sales")),r&&d.length>0&&p&&n.createElement(n.Fragment,null,n.createElement(UserOrgMenu,{iconClassName:g}),u.length>0&&n.createElement(OnboardingMultiOrgNewOrgAvailableCoachmark,null)),n.createElement(o.c,{space:"75"},e,i&&n.createElement(OpenAdminPageButton,{iconClassName:g})))};SalesHomeHeader.displayName="SalesHomeHeader"},0x16caa8075:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var n=a(0xbad225b5),i=a(0x20482ad21),l=a(0x1ea519746),r=a(0x23cb9e36f),o=a(0x348940af),s=a(0x1d104c491);let c=new i.Ay("modernselling"),AmountChangedFlowHeader=({isAdmin:e=!1})=>{let t=e?s.Lb.adminAmountChanged:s.Lb.userAmountChanged,a=(0,r.A)(t,e?"ADMIN_SALES_HOME_OPPORTUNITY_AMOUNT_CHANGED":"SALES_HOME_OPPORTUNITY_AMOUNT_CHANGED"),i=(0,l.Y)(t),d=(0,n.useCallback)(async()=>a({reason:"amount-changed"}),[a]);return n.createElement(o.A,{isAdmin:e,title:c.t("Amount changed"),imageUrl:i,onSave:d,description:c.t("Sent when opportunity amounts change")})};AmountChangedFlowHeader.displayName="AmountChangedFlowHeader";let d=AmountChangedFlowHeader},0xb9dbe72d:(e,t,a)=>{"use strict";a.d(t,{A:()=>A});var n=a(0xbad225b5),i=a(0x20482ad21),l=a(0xe976659c),r=a(0x13fb6986a),o=a(0xfca33088),s=a(0x1d104c491);let c=new i.Ay("modernselling"),d=[l.f.opportunity(),l.f.amountChange("desc"),l.f.amount()];function getAmountAnyChangeProps(){return{body:c.rt("Here are your biggest movers from last week."),columns:d,displayType:"standard",records:(0,l.E)({amountDirection:s.Us.Any}),title:c.t("Biggest movers")}}function getAmountIncreaseProps(){return{body:c.rt("Here are your increased top deals from last week."),columns:d,displayType:"trend_positive",records:(0,l.E)({amountDirection:s.Us.Increase}),title:c.t("Top increased opportunities")}}function getAmountDecreaseProps(){return{body:c.rt("Here are your decreased top deals from last week."),columns:d,displayType:"trend_negative",records:(0,l.E)({amountDirection:s.Us.Decrease}),title:c.t("Top decreased opportunities")}}let ScheduledNotificationPreview=({imageUrl:e,title:t,values:a})=>{let i=a.amountDirection,{body:l,columns:c,displayType:d,records:u,title:m}=(0,n.useMemo)(()=>{switch(i){case s.Us.Increase:return getAmountIncreaseProps();case s.Us.Decrease:return getAmountDecreaseProps();default:return getAmountAnyChangeProps()}},[i]);return n.createElement(r.A,{title:t,body:l,imageUrl:e},n.createElement(o.N,{displayType:d,columns:c,records:u,title:m,isExpandedByDefault:!0,isPreview:!0}))};ScheduledNotificationPreview.displayName="ScheduledNotificationPreview";var u=a(0x1ea519746),m=a(0x21ff11be5),p=a(0x1235cf4a4),g=a(0x62accd6b),f=a(0xf33ac3d1),_=a(0x2253dfab8),h=a(0xd2e7c536),b=a(0x107cfc47d);let y=new i.Ay("modernselling"),AmountChangedFlowPage=({isAdmin:e=!1})=>{let t=e?s.Lb.adminAmountChanged:s.Lb.userAmountChanged,a=(0,p.A)(t,!0,e),i=(0,g.Ht)(t),l=i?.isRecurring,o=(0,u.Y)(t);return n.createElement(b.IS,null,n.createElement(b.cp,{isAdmin:e},n.createElement(f.A,{workflowView:e?s.Lb.adminAmountChanged:s.Lb.userAmountChanged,defaultListTitle:y.t("Amount changed")})),n.createElement(b.OC,null,n.createElement(_.A,{title:a?.description}),l?n.createElement(ScheduledNotificationPreview,{values:i,title:y.t("Amount changed"),imageUrl:o}):n.createElement(r.A,{title:y.t("Amount changed"),body:y.rt('{person} changed an amount: 1,225,000 \u2192 1,350,000',{person:"@geeta"}),imageUrl:o,showNotificationButton:(0,m.r)(i),buttonLabel:i?.buttonText??void 0}),n.createElement(h.A,{title:a?.destination})))};AmountChangedFlowPage.displayName="AmountChangedFlowPage";let A=AmountChangedFlowPage},0xcf06bcff:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var n=a(0xbad225b5),i=a(0x20482ad21),l=a(0x1ea519746),r=a(0x23cb9e36f),o=a(0x348940af),s=a(0x1d104c491);let c=new i.Ay("modernselling"),CloseDateChangedFlowHeader=({isAdmin:e=!1})=>{let t=e?s.Lb.adminCloseDateChanged:s.Lb.userCloseDateChanged,a=(0,r.A)(t,e?"ADMIN_SALES_HOME_OPPORTUNITY_CLOSE_DATE_CHANGED":"SALES_HOME_OPPORTUNITY_CLOSE_DATE_CHANGED"),i=(0,l.Y)(t),d=(0,n.useCallback)(async()=>a({reason:"date-changed"}),[a]);return n.createElement(o.A,{isAdmin:e,title:c.t("Close date changed"),imageUrl:i,onSave:d,description:c.t("Sent when opportunity closed dates change")})};CloseDateChangedFlowHeader.displayName="CloseDateChangedFlowHeader";let d=CloseDateChangedFlowHeader},0x16f1d7d2b:(e,t,a)=>{"use strict";a.d(t,{A:()=>y});var n=a(0xbad225b5),i=a(0x20482ad21),l=a(0xe976659c),r=a(0x13fb6986a),o=a(0xfca33088),s=a(0x1d104c491);let c=new i.Ay("modernselling"),ScheduledNotificationPreview=({title:e,imageUrl:t})=>{let a=(0,n.useMemo)(()=>(0,l.E)({amountDirection:s.Us.Increase}),[]),i=(0,n.useMemo)(()=>[l.f.opportunity(),l.f.amount("desc")],[]);return n.createElement(r.A,{body:c.rt("These opportunities\u2019 close dates have been updated."),title:e,imageUrl:t},n.createElement(o.N,{displayType:"standard",columns:i,records:a,title:c.t("Top updated opportunities"),isExpandedByDefault:!0,isPreview:!0}))};ScheduledNotificationPreview.displayName="ScheduledNotificationPreview";var d=a(0x1ea519746),u=a(0x21ff11be5),m=a(0x1235cf4a4),p=a(0x62accd6b),g=a(0xf33ac3d1),f=a(0x2253dfab8),_=a(0xd2e7c536),h=a(0x107cfc47d);let b=new i.Ay("modernselling"),CloseDateChangedFlowPage=({isAdmin:e=!1})=>{let t=e?s.Lb.adminCloseDateChanged:s.Lb.userCloseDateChanged,a=(0,m.A)(t,!0,e),i=(0,d.Y)(t),l=(0,p.Ht)(t),o=l?.isRecurring,c=b.t("Close date changed");return n.createElement(h.IS,null,n.createElement(h.cp,{isAdmin:e},n.createElement(g.A,{workflowView:t,defaultListTitle:c})),n.createElement(h.OC,null,n.createElement(f.A,{title:a?.description}),o?n.createElement(ScheduledNotificationPreview,{title:c,imageUrl:i}):n.createElement(r.A,{body:b.rt('{person} changed the close date: 2023-12-31 \u2192 2024-01-15',{person:"@geeta"}),title:c,imageUrl:i,showNotificationButton:(0,u.r)(l),buttonLabel:l?.buttonText??void 0}),n.createElement(_.A,{title:a?.destination})))};CloseDateChangedFlowPage.displayName="CloseDateChangedFlowPage";let y=CloseDateChangedFlowPage},0x66c4c9f7:(e,t,a)=>{"use strict";a.d(t,{T:()=>getClosingSoonConditionFromFormValue,Z:()=>getClosingSoonFormValueFromCondition});let getClosingSoonConditionFromFormValue=e=>({period_type:"DaysTimePeriod",period_value:Number(e)}),getClosingSoonFormValueFromCondition=e=>e?.period_value.toString()||""},0x1853b39ce:(e,t,a)=>{"use strict";a.d(t,{a:()=>getClosingSoonConditionsString});var n=a(0x20482ad21),i=a(0x1e864b930),l=a(0x1bc8d2ce4);let r=new n.Ay("modernselling"),getClosingSoonConditionsString=e=>{let t,a=[(t=e.closingIn,r.t("the opportunities are closing in {closingInValue, plural, one {# day} other {# days}}",{closingInValue:Number(t)})),...(0,l.zV)({scope:e.scope,criteria:e.criteria,accountName:e.account?.label,opportunityName:""})||[],...e.advancedFilterOptions&&(0,l.SH)(e.advancedFilterOptions)||[]].filter(Boolean);return(0,i.A)(a,{noEscape:!0}).join("")}},0x404d43c5:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var n=a(0xbad225b5),i=a(0x20482ad21),l=a(0x1ea519746),r=a(0x23cb9e36f),o=a(0x348940af),s=a(0x1d104c491);let c=new i.Ay("modernselling"),DealWonFlowHeader=({isAdmin:e=!1})=>{let t=e?s.Lb.adminDealWon:s.Lb.userDealWon,a=(0,r.A)(t,e?"ADMIN_SALES_HOME_DEAL_WON":"SALES_HOME_DEAL_WON"),i=(0,l.Y)(t),d=(0,n.useCallback)(async()=>a({reason:"deal-won"}),[a]);return n.createElement(o.A,{isAdmin:e,title:c.t("Deal won"),imageUrl:i,onSave:d,description:c.t("Sent when your team wins a deal")})};DealWonFlowHeader.displayName="DealWonFlowHeader";let d=DealWonFlowHeader},0xd171ec55:(e,t,a)=>{"use strict";a.d(t,{A:()=>y});var n=a(0xbad225b5),i=a(0x20482ad21),l=a(0xe976659c),r=a(0x13fb6986a),o=a(0xfca33088),s=a(0x1d104c491);let c=new i.Ay("modernselling");function ScheduledNotificationPreview({title:e,imageUrl:t}){let a=(0,n.useMemo)(()=>(0,l.E)({amountDirection:s.Us.Increase}),[]),i=(0,n.useMemo)(()=>[l.f.opportunity(),l.f.amount("desc")],[]);return n.createElement(r.A,{body:c.rt("These deals are closed and won! Congratulations, team!"),title:e,imageUrl:t},n.createElement(o.N,{displayType:"trend_positive",columns:i,records:a,title:c.t("Top wins"),isExpandedByDefault:!0,isPreview:!0}))}ScheduledNotificationPreview.displayName="ScheduledNotificationPreview";var d=a(0x1ea519746),u=a(0x21ff11be5),m=a(0x1235cf4a4),p=a(0x62accd6b),g=a(0xf33ac3d1),f=a(0x2253dfab8),_=a(0xd2e7c536),h=a(0x107cfc47d);let b=new i.Ay("modernselling"),DealWonFlowPage=({isAdmin:e=!1})=>{let t=e?s.Lb.adminDealWon:s.Lb.userDealWon,a=(0,m.A)(t,!0,e),i=(0,p.Ht)(t),l=i?.isRecurring,o=(0,d.Y)(t);return n.createElement(h.IS,null,n.createElement(h.cp,{isAdmin:e},n.createElement(g.A,{workflowView:t,defaultListTitle:b.t("Deal won")})),n.createElement(h.OC,null,n.createElement(f.A,{title:a?.description}),l?n.createElement(ScheduledNotificationPreview,{title:b.t("Deal won"),imageUrl:o}):n.createElement(r.A,{body:b.rt('{person} just closed a deal and it\u2019s a win! Congratulations, team!',{person:"@geeta"}),title:b.t("Deal won"),imageUrl:o,showNotificationButton:(0,u.r)(i),buttonLabel:i?.buttonText??void 0}),n.createElement(_.A,{title:a?.destination})))};DealWonFlowPage.displayName="DealWonFlowPage";let y=DealWonFlowPage},0xd0e3a30d:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var n=a(0xbad225b5),i=a(0x20482ad21),l=a(0x1ea519746),r=a(0x23cb9e36f),o=a(0x348940af),s=a(0x1d104c491);let c=new i.Ay("modernselling"),ForecastReminderFlowHeader=({isAdmin:e=!1})=>{let t=e?s.Lb.adminForecastReminder:s.Lb.userForecastReminder,a=(0,r.A)(t,e?"ADMIN_SALES_HOME_FORECAST_REMINDER":"SALES_HOME_FORECAST_REMINDER"),i=(0,l.Y)(t),d=(0,n.useCallback)(async()=>a({reason:"forecast-reminder"}),[a]);return n.createElement(o.A,{isAdmin:e,title:c.t("Update opportunities"),imageUrl:i,description:c.t("Sent on a schedule to remind your team to update their opportunities"),onSave:d})};ForecastReminderFlowHeader.displayName="ForecastReminderFlowHeader";let d=ForecastReminderFlowHeader},0x24c2c2673:(e,t,a)=>{"use strict";a.d(t,{A:()=>M});var n=a(0xbad225b5),i=a(0x16cf1da63),l=a(0x4bdf0df6),r=a(0x20482ad21),o=a(0x1e217163d),s=a(0x93fa1f74),c=a(0x3b556df0),d=a(0x1be40479b),u=a(0x1ea519746),m=a(0x21ff11be5),p=a(0x1235cf4a4),g=a(0x2b3a07cf),f=a(0x6374e095),_=a(0x1f2c612f5),h=a(0xe1721148),b=a(0xd00e724),y=a(0xf1b54886),A=a(0xc2d5849d),E=a(0x2253dfab8),S=a(0xd2e7c536),C=a(0x13fb6986a),v=a(0x107cfc47d),x=a(0x124d99cb0),w=a(0x1b9d5cc0c),O=a(0x226892387),k=a(0xe684f705),N=a(0x1c8beab7f),T=a(0xbd196b81),I=a(0x1d104c491);let F=new r.Ay("modernselling"),ForecastReminderFlowPage=({isAdmin:e=!1})=>{let t=(0,i.wA)(),a=(0,O.d4)(k.cA),r=(0,x.rJ)(a,"iso"),M=(0,w.et)(a)??l.vp,D=e?I.Lb.adminForecastReminder:I.Lb.userForecastReminder,R=(0,p.A)(D,!0,e),P=(0,O.d4)(e?N.Tt:N.rm),L=(0,O.d4)(e?N.MH:N.gE),U=(0,O.d4)(N.RC),B=(0,O.d4)(N.cc),H=(0,O.d4)(N.tx),V=(0,u.Y)(D),W=(0,n.useMemo)(()=>{if(P)return(0,c.l8)(P,e);let t={channelId:null,frequency:I.Ns.weekly,sendTo:I.Oz.SalesHome,startTime:r,timezone:M,title:F.t("Update your opportunities"),canvasTemplateId:null,includeMessageAddOn:!1,buttonText:(0,d.L)(D)};return e?{...t,type:I.g$.AdminReminder,recipientType:null,recipientRoles:null,recipientUsers:null}:{...t,type:I.g$.UserReminder}},[r,P,e,M,D]),{values:j,errors:G,handleBlur:q,handleChange:Y}=(0,g.A)({workflowView:D,initialValues:W}),{title:z,sendTo:$,startTime:Q,channelId:J,tokenUserId:K,frequency:Z,canvasTemplateId:X,includeMessageAddOn:ee,buttonText:et}=j,ea=(0,n.useCallback)(e=>{let a=B?.find(t=>t.salesforce_org_id===e.value);a&&t((0,T.T)({salesforceOrgId:a.salesforce_org_id,setDefaultInApi:!1}))},[t,B]),en=(0,n.useCallback)((e,t)=>Y(e)(t),[Y]);return n.createElement(v.IS,null,n.createElement(v.cp,{isAdmin:e},n.createElement("div",{className:"p-sales_notifications__workflow__section"},n.createElement("div",{className:"p-sales_notifications__workflow__subtitle"},F.t("Notification details")),n.createElement("div",{className:"full_width"},n.createElement(h.A,{value:z,errors:G.title,onBlur:q("title"),onChange:Y("title")}),n.createElement(o.B,{space:"125"},n.createElement(A.A,{isAdmin:e,errors:G,channelId:J,tokenUserId:K,destination:$,isRecurring:j.isRecurring,isEditNotification:!!P,onChannelSelectBlur:q("channelId"),onChannelSelected:Y("channelId"),onTokenSelectBlur:q("tokenUserId"),onTokenSelected:Y("tokenUserId"),onSendToSelected:Y("sendTo")})),n.createElement(o.B,{space:"125"},n.createElement(f.e,{value:Q,errors:G.startTime,onBlur:q("startTime"),onChange:Y("startTime"),required:!0}),n.createElement(_.x,{onChange:Y("frequency"),startDate:Q,value:Z})),!e&&U&&H&&n.createElement(n.Fragment,null,n.createElement("hr",{className:"p-sales_notifications__workflow__form__divider margin_top_150"}),n.createElement("div",{className:"p-sales_notifications__workflow__subtitle"},F.t("Apply to")),n.createElement(s.k,{onChange:ea,salesforceOrgId:P&&L?L:U,disabled:!!P,disabledText:F.t("To change org, please create a new notification."),showCoachMark:!P}))),e&&j.sendTo===I.Oz.SalesHome&&n.createElement("div",{className:"p-sales_notifications__workflow__section"},n.createElement("hr",{className:"p-sales_notifications__workflow__form__divider margin_top_150"}),n.createElement("div",{className:"p-sales_notifications__workflow__subtitle"},F.t("Recipients")),n.createElement(y.M,{hasMatchOption:!1,errors:G?.recipientRoles,onBlur:q("recipientRoles"),onChange:Y("recipientRoles"),recipientRoles:j.recipientRoles})),e&&n.createElement(b.A,{onChange:en,errors:G,canvasTemplateId:X,includeMessageAddOn:ee,buttonText:et}))),n.createElement(v.OC,null,n.createElement(E.A,{title:R?.description}),n.createElement(C.A,{body:F.t("Anything changed? Record progress and updates in your opportunity list."),title:F.t("Reminder: Update your opportunities"),imageUrl:V,buttonLabel:et??void 0,showNotificationButton:(0,m.r)(j)}),n.createElement(S.A,{title:R?.destination})))};ForecastReminderFlowPage.displayName="ForecastReminderFlowPage";let M=ForecastReminderFlowPage},0x151f56714:(e,t,a)=>{"use strict";a.d(t,{$:()=>getMissingFieldFormValueFromCondition,l:()=>getMissingFieldConditionFromFormValue});let getMissingFieldConditionFromFormValue=e=>{if(null!==e)return{schema_field_id:e.value,schema_field_label:e.label}},getMissingFieldFormValueFromCondition=e=>e?{value:e.schema_field_id,label:e.schema_field_label}:null},0x1d0dc57a0:(e,t,a)=>{"use strict";a.d(t,{v:()=>getMissingFieldsConditionsString});var n=a(0x20482ad21),i=a(0x1e864b930),l=a(0x1bc8d2ce4);let r=new n.Ay("modernselling"),getMissingFieldsConditionsString=e=>{var t;let a=[(t=e.missingField)&&"string"==typeof t.label?r.t("the missing field is {missingFieldLabel}",{missingFieldLabel:t.label}):"",...(0,l.zV)({scope:e.scope,criteria:e.criteria,accountName:e.account?.label,opportunityName:""})||[],...e.advancedFilterOptions&&(0,l.SH)(e.advancedFilterOptions)||[]].filter(Boolean);return(0,i.A)(a,{noEscape:!0}).join("")}},0x212a2c2d5:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var n=a(0xbad225b5),i=a(0x20482ad21),l=a(0x1ea519746),r=a(0x23cb9e36f),o=a(0x348940af),s=a(0x1d104c491);let c=new i.Ay("modernselling"),NewOpportunityFlowHeader=({isAdmin:e=!1})=>{let t=e?s.Lb.adminNewOpportunityAlert:s.Lb.userNewOpportunityAlert,a=(0,r.A)(t,e?"ADMIN_SALES_HOME_NEW_OPPORTUNITY":"SALES_HOME_NEW_OPPORTUNITY"),i=(0,l.Y)(t),d=(0,n.useCallback)(async()=>a({reason:"new-opportunity"}),[a]);return n.createElement(o.A,{isAdmin:e,title:c.t("New opportunity"),description:c.t("Sent when new opportunities are added"),imageUrl:i,onSave:d})};NewOpportunityFlowHeader.displayName="NewOpportunityFlowHeader";let d=NewOpportunityFlowHeader},0x1ee39de0b:(e,t,a)=>{"use strict";a.d(t,{A:()=>_});var n=a(0xbad225b5),i=a(0x20482ad21),l=a(0x1ea519746),r=a(0x21ff11be5),o=a(0x1235cf4a4),s=a(0x62accd6b),c=a(0xf33ac3d1),d=a(0x2253dfab8),u=a(0xd2e7c536),m=a(0x13fb6986a),p=a(0x107cfc47d),g=a(0x1d104c491);let f=new i.Ay("modernselling"),NewOpportunityFlowPage=({isAdmin:e=!1})=>{let t=e?g.Lb.adminNewOpportunityAlert:g.Lb.userNewOpportunityAlert,a=(0,o.A)(t,!0,e),i=(0,l.Y)(t),_=(0,s.Ht)(t);return n.createElement(p.IS,null,n.createElement(p.cp,{isAdmin:e},n.createElement(c.A,{workflowView:t,defaultListTitle:f.t("New opportunity")})),n.createElement(p.OC,null,n.createElement(d.A,{title:a?.description}),n.createElement(m.A,{body:f.rt('{person} created a new opportunity.',{person:"@geeta"}),title:f.t("New opportunity"),imageUrl:i,showNotificationButton:(0,r.r)(_),buttonLabel:_?.buttonText??void 0}),n.createElement(u.A,{title:a?.destination})))};NewOpportunityFlowPage.displayName="NewOpportunityFlowPage";let _=NewOpportunityFlowPage},0x1f58f3ef3:(e,t,a)=>{"use strict";a.d(t,{Sm:()=>i,a4:()=>r,em:()=>l});let n=new(a(0x20482ad21)).Ay("modernselling"),i={label:n.t("Day"),value:"DaysTimePeriod"},l={label:n.t("Month"),value:"MonthsTimePeriod"},r=[i,l]},0x125c85f04:(e,t,a)=>{"use strict";a.d(t,{ku:()=>getOutdatedFieldConditionFormValues,qJ:()=>getOutdatedFieldCondition,vZ:()=>i});var n=a(0x1f58f3ef3);let getOutdatedFieldCondition=(e,t,a)=>{if(null!==e)return{schema_field_id:e.value,schema_field_label:e.label,period:{period_type:t.value,period_value:Number(a)}}},i={outdatedFieldValue:null,outdatedFieldPeriod:n.Sm,outdatedFieldPeriodValue:"30"},l={DaysTimePeriod:n.Sm,MonthsTimePeriod:n.em},getOutdatedFieldConditionFormValues=e=>{if(!e)return i;let{schema_field_id:t,schema_field_label:a,period:n}=e;return{outdatedFieldValue:{value:t,label:a},outdatedFieldPeriod:l[n.period_type],outdatedFieldPeriodValue:n.period_value.toString()}}},0x7629109d:(e,t,a)=>{"use strict";a.d(t,{A:()=>getOutdatedFieldConditionsString});var n=a(0x1e864b930);let i=new(a(0x20482ad21)).Ay("modernselling"),l={DaysTimePeriod:(e,t)=>i.t("the outdated field is {outdatedFieldLabel} and it has not changed for {periodValueCount, plural, one {# day} other {# days}}",{outdatedFieldLabel:e,periodValueCount:t}),MonthsTimePeriod:(e,t)=>i.t("the outdated field is {outdatedFieldLabel} and it has not changed for {periodValueCount, plural, one {# month} other {# months}}",{outdatedFieldLabel:e,periodValueCount:t})};var r=a(0x1bc8d2ce4);let getOutdatedFieldConditionsString=e=>{let t=[(({outdatedFieldValue:e,outdatedFieldPeriod:t,outdatedFieldPeriodValue:a})=>{if(!e)return"";let n=l[t.value];return n&&"string"==typeof e.label?n(e.label,Number(a)):""})({outdatedFieldValue:e.outdatedFieldValue,outdatedFieldPeriodValue:e.outdatedFieldPeriodValue,outdatedFieldPeriod:e.outdatedFieldPeriod}),...(0,r.zV)({scope:e.scope,criteria:e.criteria,accountName:e.account?.label,opportunityName:""})||[],...e.advancedFilterOptions&&(0,r.SH)(e.advancedFilterOptions)||[]].filter(Boolean);return(0,n.A)(t,{noEscape:!0}).join("")}},0xb0222280:(e,t,a)=>{"use strict";a.d(t,{s:()=>getPastCloseDateConditionsString});var n=a(0x1e864b930),i=a(0x1bc8d2ce4);let getPastCloseDateConditionsString=e=>{let t=[...(0,i.zV)({scope:e.scope,criteria:e.criteria,accountName:e.account?.label,opportunityName:""})||[],...e.advancedFilterOptions&&(0,i.SH)(e.advancedFilterOptions)||[]].filter(Boolean);return(0,n.A)(t,{noEscape:!0}).join("")}},0x10b410a4d:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var n=a(0xbad225b5),i=a(0x20482ad21),l=a(0x1ea519746),r=a(0x23cb9e36f),o=a(0x348940af),s=a(0x1d104c491);let c=new i.Ay("modernselling"),StageChangedFlowHeader=({isAdmin:e=!1})=>{let t=e?s.Lb.adminStageChanged:s.Lb.userStageChanged,a=(0,r.A)(t,e?"ADMIN_SALES_HOME_OPPORTUNITY_STAGE_CHANGED":"SALES_HOME_OPPORTUNITY_STAGE_CHANGED"),i=(0,l.Y)(t),d=(0,n.useCallback)(async()=>a({reason:"stage-changed"}),[a]);return n.createElement(o.A,{isAdmin:e,imageUrl:i,title:c.t("Stage changed"),onSave:d,description:c.t("Sent when opportunity stages change")})};StageChangedFlowHeader.displayName="StageChangedFlowHeader";let d=StageChangedFlowHeader},0x18ee6860e:(e,t,a)=>{"use strict";a.d(t,{A:()=>y});var n=a(0xbad225b5),i=a(0x20482ad21),l=a(0xe976659c),r=a(0x13fb6986a),o=a(0xfca33088),s=a(0x1d104c491);let c=new i.Ay("modernselling");function ScheduledNotificationPreview({title:e,imageUrl:t}){let a=(0,n.useMemo)(()=>(0,l.E)({amountDirection:s.Us.Increase}),[]),i=(0,n.useMemo)(()=>[l.f.opportunity(),l.f.amount("desc")],[]);return n.createElement(r.A,{body:c.rt("These opportunities\u2019 stage have been updated."),title:e,imageUrl:t},n.createElement(o.N,{displayType:"standard",columns:i,records:a,title:c.t("Top updated opportunities"),isExpandedByDefault:!0,isPreview:!0}))}ScheduledNotificationPreview.displayName="ScheduledNotificationPreview";var d=a(0x1ea519746),u=a(0x21ff11be5),m=a(0x1235cf4a4),p=a(0x62accd6b),g=a(0xf33ac3d1),f=a(0x2253dfab8),_=a(0xd2e7c536),h=a(0x107cfc47d);let b=new i.Ay("modernselling"),StageChangedFlowPage=({isAdmin:e=!1})=>{let t=e?s.Lb.adminStageChanged:s.Lb.userStageChanged,a=(0,m.A)(t,!0,e),i=(0,p.Ht)(t),l=i?.isRecurring,o=(0,d.Y)(t);return n.createElement(h.IS,null,n.createElement(h.cp,{isAdmin:e},n.createElement(g.A,{workflowView:t,defaultListTitle:b.t("Stage changed")})),n.createElement(h.OC,null,n.createElement(f.A,{title:a?.description}),l?n.createElement(ScheduledNotificationPreview,{title:b.t("Stage changed"),imageUrl:o}):n.createElement(r.A,{body:b.rt('{person} changed a stage: 03-Proposal \u2192 04-Negotiation',{person:"@geeta"}),title:b.t("Stage changed"),imageUrl:o,showNotificationButton:(0,u.r)(i),buttonLabel:i?.buttonText??void 0}),n.createElement(_.A,{title:a?.destination})))};StageChangedFlowPage.displayName="StageChangedFlowPage";let y=StageChangedFlowPage},0x1f49c20b0:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});var n=a(0xbad225b5),i=a(0x20482ad21),l=a(0x128d54e52),r=a(0x2501a2cee),o=a(0x1c659cbb1);let s=new i.Ay("modernselling"),NotificationTemplateEntity=({workflow:e,showDescription:t=!0,size:a="medium",className:i})=>{let c="medium"===a?o.RG.medium:o.RG.verySmall,d=(0,n.useCallback)(()=>n.createElement(o.f1,{className:"medium"===a?"margin_right_100":"margin_right_50",size:c,imageUrl:e.icons?.image_96,isInteractive:!1}),[c,a,e.icons?.image_96]),u=(0,n.useMemo)(()=>n.createElement(n.Fragment,null,e.isMuted&&!e.isDisabled&&n.createElement("div",{className:"p-sales_notifications__notification_template_entity__muted"},n.createElement(r.Ah,{inline:!0,name:"notifications-off",size:"inherit"}),n.createElement("div",{className:"margin_left_25"},s.t("Muted"))),n.createElement(l.CG,{withTruncationTooltip:!0},n.createElement("strong",null,e.title))),[e]),m=(0,n.useMemo)(()=>t?n.createElement(l.sT,{className:"caption"},e.description):null,[t,e.description]);return n.createElement(l.Ay,{size:"medium",className:i,avatar:d,text:u,subtext:m})};NotificationTemplateEntity.displayName="NotificationTemplateEntity";let c=NotificationTemplateEntity},0x93fa1f74:(e,t,a)=>{"use strict";a.d(t,{k:()=>SalesforceOrgSelect});var n=a(0xbad225b5),i=a(0x20482ad21),l=a(0x1d2cd7755),r=a(0x15014e268),o=a(0x16cf1da63),s=a(0xed74b103),c=a(0x23c27866b),d=a(0x226892387),u=a(0x1472af90a),m=a(0xf052d367),p=a(0x18632f75a);let g=new i.Ay("modernselling"),OnboardingMultiOrgNotificationsCoachmark=()=>{let e=(0,o.wA)(),t=u.G7.SalesHomeMultiOrgNotificationsCoachmark,a="sales-home-multi-org-notifications-coachmark-seen",i=(0,c.A)(t,a),l=(0,d.d4)(e=>(0,m.kI)(e,t,u.X8.Click)),r=(0,d.d4)(e=>(0,m.h$)(e,t));(0,n.useEffect)(()=>{i()},[i]);let f=(0,n.useCallback)(()=>{e((0,p.z)({component:t,type:u.X8.Click,reason:a}))},[e,a,t]);return!l||r?null:n.createElement(s.r,{className:"p-sales_onboarding_multi_org_coachmark",onClose:f,theme:"purple"},g.t("Choose which org you\u2019d like this notification to apply to"))};function getAuthorizedUserOrgsAsOptions(e){return e.reduce((e,t)=>{if("ok"===t.auth){let a={label:t.name,value:t.salesforce_org_id};e.push(a)}return e},[])}OnboardingMultiOrgNotificationsCoachmark.displayName="OnboardingMultiOrgNotificationsCoachmark";var f=a(0x1c8beab7f);let _=new i.Ay("modernselling"),SalesforceOrgSelect=({className:e,salesforceOrgId:t,onChange:a,disabled:i,disabledText:o,hideLabel:s,size:c,showCoachMark:u})=>{let m=(0,d.d4)(f.cc),p=(0,n.useMemo)(()=>getAuthorizedUserOrgsAsOptions(m),[m]),g=(0,n.useMemo)(()=>n.createElement(r.Ay,{className:e,isRequired:!0,options:p,selectedOption:p.find(e=>e.value===t)||p[0],width:"100%",onOptionSelected:a,isDisabled:i,size:c}),[e,i,a,p,t,c]);return 1===p.length?null:n.createElement(n.Fragment,null,s?g:n.createElement(n.Fragment,null,n.createElement(l.A,{text:_.t("Salesforce org"),className:"p-sales_notifications__workflow__form__field"},g,i&&n.createElement("span",{className:"caption p-sales_notifications__workflow__form__field_caption"},o)),u&&n.createElement(OnboardingMultiOrgNotificationsCoachmark,null)))};SalesforceOrgSelect.displayName="SalesforceOrgSelect"},0x3b556df0:(e,t,a)=>{"use strict";a.d(t,{AN:()=>buildOpportunityChangedFormValues,DT:()=>buildPastCloseDateFormValues,MP:()=>buildMissingFieldsFormValues,Ni:()=>buildClosingSoonFormValues,S1:()=>buildOutdatedFieldsFormValues,l8:()=>buildReminderFormValues});var n=a(0x205f4fb61),i=a(0x66c4c9f7),l=a(0x151f56714),r=a(0x125c85f04),o=a(0x6f20b262),s=a(0xe08dc76c),c=a(0x1d104c491);function getFrequencyValue(e){return e?.type==="weekly"?e.on_days&&e.on_days.length>1?"weekdays":"weekly":e?.type||"weekly"}function getScheduleValues(e,t){return{isRecurring:!!e?.start_time,frequency:e?.frequency?.type?getFrequencyValue(e.frequency):t.frequency,startTime:e?.start_time||t.startTime,timezone:e?.timezone||t.timezone}}let d={owner:c._Y.Owner,account_owner:c._Y.AccountOwner,manager_chain:c._Y.ManagerChain,account_manager_chain:c._Y.AccountManagerChain,owner_manager:c._Y.OwnerManager,account_owner_manager:c._Y.AccountOwnerManager};function getRecipientValues(e){let t=e?.role_contains_one_of?.length||e?.role_contains_none_of?.length;return{recipientType:e?.user_ids?.length?c._Y.User:e?.relationships?.[0]?d[e.relationships[0]]:null,recipientRoles:{filter:t?c.yP.Match:c.yP.Specific,match:{containsOneOf:{isValid:!0,values:e?.role_contains_one_of||[]},containsNoneOf:{isValid:!0,values:e?.role_contains_none_of||[]}},specific:e?.roles||[]},recipientUsers:e?.user_ids||[]}}function getMessageAddOnValues(e){return{canvasTemplateId:e.canvas_template_id,includeMessageAddOn:!!e.message_add_on,buttonText:e.button_text}}function getStageValues(e){return e?.stage_to?.map(e=>({key:e,value:e,label:e}))??null}function getCloseDateValues(e){let t;switch(e?.direction){case"to_another":t=s.ig.ANY;break;case"to_future":t=s.ig.LATER;break;case"to_earlier":t=s.ig.EARLIER;break;default:t=null}return{closeDateDirection:t,closeDatePeriod:e?.period||null}}function getAdvancedOptionType(e){let t=e.rhs?.[0];if(e.type===o.hu.TimePeriodHasChangedTriggerCondition&&t){if(t.direction?.type===s.ig.ANY&&t.operator?.type===s.Kr.AT_LEAST&&t.period?.num===1)return o.hu.TimePeriodToAnotherTriggerCondition;if(t.direction?.type===s.ig.LATER&&t.operator?.type===s.Kr.AT_LEAST&&t.period?.num===1)return o.hu.TimePeriodToFutureTriggerCondition;if(t.direction?.type===s.ig.EARLIER&&t.operator?.type===s.Kr.AT_LEAST&&t.period?.num===1)return o.hu.TimePeriodToEarlierTriggerCondition;if(t.direction?.type===s.ig.ANY&&t.operator?.type===s.Kr.AT_LEAST)return o.hu.TimePeriodIsMoreThanTriggerCondition;if(t.direction?.type===s.ig.ANY&&t.operator?.type===s.Kr.AT_MOST)return o.hu.TimePeriodIsLessThanTriggerCondition;if(t.direction?.type===s.ig.ANY&&t.operator?.type===s.Kr.EXACT)return o.hu.TimePeriodIsEqualToTriggerCondition}else if(e.type===o.hu.TimePeriodWithinTriggerCondition&&t){if(t.operator?.type===s.Kr.AT_LEAST&&t.direction?.type===s.ig.EARLIER||t.operator?.type===s.Kr.AT_MOST&&t.direction?.type===s.ig.LATER)return o.hu.TimePeriodBeforeTriggerCondition;if(t.operator?.type===s.Kr.AT_LEAST&&t.direction?.type===s.ig.LATER)return o.hu.TimePeriodAfterTriggerCondition;if(t.operator?.type===s.Kr.EXACT)return o.hu.TimePeriodCurrentTriggerCondition}return e.type}function getAdvancedOptions(e){return e?.reduce((e,t)=>(t?.id&&(e[t.id]={...t,type:getAdvancedOptionType(t)}),e),{})}function getAdvancedFilterOptions(e){return e?e?.reduce((e,{rhs:t,...a})=>(a?.id&&(e[a.id]={...a,rhs:t&&!Array.isArray(t)?[t]:t}),e),{}):null}function getEcnScope(e){switch(e?.scope){case"account":return c.QO.SpecificAccount;case"opportunity":return c.QO.SpecificOpportunity;default:if(!e?.criteria?.length)return c.QO.All;switch(e.criteria[0]){case"account_owner":return c.QO.AccountsOwnedByMe;case"account_report_chain":return c.QO.AccountOwnedByReportChain;case"owner":return c.QO.OwnedByMe;case"direct_reports":return c.QO.OwnedByDirectReports;case"report_chain":return c.QO.OwnedByReportChain;default:return c.QO.MatchCriteria}}}function getDealWinCelebrationFields(e){return{displayOpportunityAccountName:e?.display_opportunity_account_name||!1,displayOpportunityAmount:e?.display_opportunity_amount||!1,displayOpportunityCloseDate:e?.display_opportunity_close_date||!1}}function getBaseReminderValues(e){let t=e.trigger.schedule;return{title:e.title,sendTo:e.send_to,channelId:e.channel_id||null,tokenUserId:e.token_user_id||null,startTime:t.start_time,timezone:t.timezone,frequency:getFrequencyValue(t.frequency),...getMessageAddOnValues(e)}}function getBaseOpportunityChangedValues(e){let t=e.condition||e.acn;return{title:e.title,sendTo:e.send_to,channelId:e.channel_id||null,tokenUserId:e.token_user_id||null,account:t?.account?{label:t.account.name,key:t.account.id,value:t.account.id}:null,amount:t?.min_deal_amount||t?.min_deal_amount===0?(0,n.ZV)(t.min_deal_amount):null,opportunity:t?.opportunity?{label:t.opportunity.name,key:t.opportunity.id,value:t.opportunity.id}:null,stage:t?.stage_for_win?{label:t.stage_for_win,key:t.stage_for_win,value:t.stage_for_win}:null,excludeSelfModifications:!!t?.exclude_self_modifications,includeCelebrations:!!e.display_celebration,criteria:void 0,recipientType:void 0,recipientRoles:void 0,recipientUsers:void 0,advancedOptions:getAdvancedOptions(t?.advanced_conditions),...getMessageAddOnValues(e),...getCloseDateValues(t?.close_date_condition)}}let u={account:c.QO.SpecificAccount,opportunity:c.QO.SpecificOpportunity,all:c.QO.All},getACNValuesOrFallbacks=e=>{if(!e)return{...r.vZ,opportunity:null,account:null,recipients:void 0,closingSoonFormValue:""};let{opportunity:t,account:a,recipients:n,outdated_field_condition:l,closing_soon_condition:o,advanced_filter_conditions:s,is_muting_disabled:c}=e,{outdatedFieldPeriod:d,outdatedFieldPeriodValue:u,outdatedFieldValue:m}=(0,r.ku)(l);return{recipients:n,outdatedFieldPeriod:d,outdatedFieldPeriodValue:u,outdatedFieldValue:m,closingSoonFormValue:(0,i.Z)(o),opportunity:t?{label:t.name,key:t.id,value:t.id}:null,account:a?{label:a.name,key:a.id,value:a.id}:null,advancedFilterConditions:s,isMutingDisabled:c}};function buildOutdatedFieldsFormValues(e,t){let a=e.acn?.scope?u[e.acn.scope]:c.QO.All,{acn:n,title:i="",send_to:l,trigger:r}=e,{account:o,recipients:s,outdatedFieldPeriod:d,outdatedFieldPeriodValue:m,outdatedFieldValue:p,advancedFilterConditions:g,isMutingDisabled:f}=getACNValuesOrFallbacks(n),{frequency:_,startTime:h,timezone:b}=getScheduleValues(r.schedule,t),y=getAdvancedFilterOptions(g);return{...getRecipientValues(s),type:c.g$.AdminOutdatedFields,scope:a,title:i,sendTo:l,account:o,frequency:_,startTime:h,timezone:b,outdatedFieldValue:p,outdatedFieldPeriod:d,outdatedFieldPeriodValue:m,advancedFilterOptions:y,channelId:null,tokenUserId:null,canvasTemplateId:null,buttonText:null,isMutingDisabled:f}}let buildClosingSoonFormValues=(e,t)=>{let a=e.acn?.scope?u[e.acn.scope]:c.QO.All,{acn:n,title:i="",send_to:l,trigger:r}=e,{account:o,recipients:s,closingSoonFormValue:d,advancedFilterConditions:m,isMutingDisabled:p}=getACNValuesOrFallbacks(n),{frequency:g,startTime:f,timezone:_}=getScheduleValues(r.schedule,t),h=getAdvancedFilterOptions(m);return{...getRecipientValues(s),type:c.g$.AdminClosingSoon,scope:a,title:i,sendTo:l,account:o,frequency:g,startTime:f,timezone:_,closingIn:d,advancedFilterOptions:h,channelId:null,tokenUserId:null,canvasTemplateId:null,buttonText:null,isMutingDisabled:p}},buildMissingFieldsFormValues=(e,t)=>{let a=e.acn?.scope?u[e.acn.scope]:c.QO.All,{acn:n,title:i="",send_to:r,trigger:o}=e,{account:s,recipients:d,advancedFilterConditions:m,isMutingDisabled:p}=getACNValuesOrFallbacks(n),g=(0,l.$)(e.acn?.missing_field_condition),{frequency:f,startTime:_,timezone:h}=getScheduleValues(o.schedule,t),b=getAdvancedFilterOptions(m);return{...getRecipientValues(d),type:c.g$.AdminMissingFields,scope:a,title:i,sendTo:r,account:s,frequency:f,startTime:_,timezone:h,missingField:g,advancedFilterOptions:b,channelId:null,tokenUserId:null,canvasTemplateId:null,buttonText:null,isMutingDisabled:p}},buildPastCloseDateFormValues=(e,t)=>{let a=e.acn?.scope?u[e.acn.scope]:c.QO.All,{acn:n,title:i="",send_to:l,trigger:r}=e,{account:o,recipients:s,advancedFilterConditions:d,isMutingDisabled:m}=getACNValuesOrFallbacks(n),{frequency:p,startTime:g,timezone:f}=getScheduleValues(r.schedule,t),_=getAdvancedFilterOptions(d);return{...getRecipientValues(s),type:c.g$.AdminPastCloseDate,scope:a,title:i,sendTo:l,account:o,frequency:p,startTime:g,timezone:f,advancedFilterOptions:_,channelId:null,tokenUserId:null,canvasTemplateId:null,buttonText:null,isMutingDisabled:m}};function buildOpportunityChangedFormValues(e,t=!1,a){return t?{...getBaseOpportunityChangedValues(e),...getRecipientValues(e.acn?.recipients),...getScheduleValues(e.trigger.schedule,a),amountDirection:e.acn?.amount_condition?.direction||null,scope:e.acn?.scope||c.QO.All,type:c.g$.AdminOpportunityChanged,stageChangedStages:getStageValues(e.acn?.stage_condition),isMutingDisabled:e.acn?.is_muting_disabled,dealWinCelebrationMessageFields:getDealWinCelebrationFields(e.acn?.deal_win_celebration_message_fields)}:{...getBaseOpportunityChangedValues(e),scope:getEcnScope(e.condition),criteria:e.condition?.criteria||[],type:c.g$.UserOpportunityChanged,stageChangedStages:getStageValues(e.acn?.stage_condition)}}function buildReminderFormValues(e,t=!1){return t?{...getBaseReminderValues(e),...getRecipientValues(e.acn?.recipients),type:c.g$.AdminReminder}:{...getBaseReminderValues(e),type:c.g$.UserReminder}}},0x3ebf4390:(e,t,a)=>{"use strict";a.d(t,{Un:()=>C,cB:()=>validateAllWorkflowFormFields,g7:()=>validateWorkflowFormField});var n=a(0xe180a236),i=a(0xb77a689a),l=a(0x1595bdd0),r=a(0x1b63e435a),o=a.n(r),s=a(0x20482ad21),c=a(0x405dcae6),d=a(0x124d99cb0),u=a(0x1d104c491);let m=new s.Ay("modernselling"),id=e=>`SALES_HOME_NOTIFICATIONS_CONFIG_${e}`,validateAccount=({currentValues:e,incomingValue:t})=>t||e.scope!==u.QO.SpecificAccount?null:[{id:id("ACCOUNT_SELECT"),message:m.t("Please select an account.")}],validateCriteria=({currentValues:e,incomingValue:t})=>e.scope!==u.QO.MatchCriteria||Array.isArray(t)&&t?.length?null:[{id:id("CRITERIA_SELECT"),message:m.t("Please select at least one option.")}],validateScope=({incomingValue:e})=>e?null:[{id:id("SCOPE_SELECT"),message:m.t("Please select an option.")}],validateOpportunity=({currentValues:e,incomingValue:t})=>t||e.scope!==u.QO.SpecificOpportunity?null:[{id:id("OPPORTUNITY_SELECT"),message:m.t("Please select an opportunity.")}],validateStage=({incomingValue:e,workflowView:t})=>e||t!==u.Lb.adminDealWon&&t!==u.Lb.userDealWon&&t!==u.Lb.adminDealWinCelebration?null:[{id:id("STAGE_FOR_WIN"),message:m.t("Please select an opportunity stage.")}],validateButtonText=({incomingValue:e,currentValues:t})=>e&&e.length<=40||!t.includeMessageAddOn?null:e&&e.length>40?[{id:id("BUTTON_TEXT_TOO_LONG"),message:m.t("You can\u2019t enter more than 40 characters.")}]:[{id:id("BUTTON_TEXT_CHANGE"),message:m.t("Please enter one or more keywords.")}],validateCanvasTemplate=({incomingValue:e,currentValues:t})=>e||!t.includeMessageAddOn?null:[{id:id("CANVAS_TEMPLATE_CHANGE"),message:m.t("Please select a canvas template.")}],validateStartTime=({currentValues:e,incomingValue:t})=>{let{type:a,isRecurring:n,timezone:l}=e;if(a===u.g$.AdminOpportunityChanged&&!n)return null;let r=(0,i.A)(t)?t:"";return(0,d.lP)(r,e.timezone).isAfter(o().tz(l))?null:[{id:id("START_TIME"),message:m.t("Scheduled to start in the past. Select a time today or on a future date.")}]},validateAdvancedOptions=({incomingValue:e})=>{if(!e)return null;let t=[];for(let a of(0,l.A)(Object.values(e))){let e=(0,c.K5)(a);e?.length&&t.push(...e)}return t.length?t:null},validateRecipientType=({currentValues:e,incomingValue:t})=>e.sendTo!==u.Oz.SalesHome||t?null:[{id:id("RECIPIENT_TYPE_SELECT"),message:m.t("Please select a recipient type.")}],validateRecipientRoles=({currentValues:e,incomingValue:t,workflowView:a,experiments:{experimentLobOrg62UnrestrictedGroupOn:n}})=>{if(e.sendTo!==u.Oz.SalesHome)return null;if(a===u.Lb.adminForecastReminder&&e.sendTo===u.Oz.SalesHome)return t?.filter===u.yP.Specific&&Array.isArray(t?.specific)&&t?.specific.length?null:[{id:id("RECIPIENT_ROLES_SPECIFIC"),message:m.t("Please select one or more roles.")}];if(e.recipientType===u._Y.User)return null;let i=e.recipientType===u._Y.Owner||e.recipientType===u._Y.AccountOwner;return t?.filter===u.yP.Specific?i||n||Array.isArray(t?.specific)&&t?.specific.length?null:[{id:id("RECIPIENT_ROLES_SPECIFIC"),message:m.t("Please select one or more roles.")}]:t?.filter===u.yP.Match?t.match.containsOneOf.isValid&&t.match.containsNoneOf.isValid?i||n||Array.isArray(t.match.containsOneOf.values)&&t.match.containsOneOf.values.length||Array.isArray(t.match.containsNoneOf.values)&&t.match?.containsNoneOf.values.length?null:[{id:id("RECIPIENT_ROLES_MATCH_EMPTY"),message:m.t("Please enter one or more keywords.")}]:[{id:id("RECIPIENT_ROLES_MATCH_INVALID"),message:""}]:null},validateRecipientUsers=({currentValues:e,incomingValue:t})=>e.sendTo!==u.Oz.SalesHome||e.recipientType!==u._Y.User||Array.isArray(t)&&t?.length?null:[{id:id("RECIPIENT_USERS_SELECT"),message:m.t("Please select one or more users.")}],p=Object.freeze({channelId:({currentValues:e,incomingValue:t})=>t||e.sendTo!==u.Oz.Channel?null:[{id:id("CHANNEL_ID"),message:m.t("Please select a channel.")}],tokenUserId:({currentValues:e,incomingValue:t,experiments:{experimentLobChannelAcnTokenGroupOn:a}})=>t||e.sendTo!==u.Oz.Channel||!a?null:[{id:id("TOKEN_USER_ID"),message:m.t("Please select a user.")}]}),g=Object.freeze({...p,startTime:validateStartTime}),f=Object.freeze({...p,startTime:validateStartTime,recipientRoles:validateRecipientRoles}),validateFieldOptionSelected=({incomingValue:e})=>e?null:[{id:id("FIELD_OPTION_IS_NOT_SELECTED"),message:m.t("Please select an option.")}],_={account:validateAccount,opportunity:validateOpportunity,recipientRoles:validateRecipientRoles,recipientType:validateRecipientType,recipientUsers:validateRecipientUsers,scope:validateScope,startTime:validateStartTime,outdatedFieldValue:validateFieldOptionSelected,outdatedFieldPeriodValue:({incomingValue:e})=>!e||0>=Number(e)||Number(e)>9999?[{id:id("OUTDATED_FIELD_PERIOD_VALUE"),message:m.t("Please enter the value between 1 and 9999.")}]:null,buttonText:validateButtonText,canvasTemplateId:validateCanvasTemplate,advancedFilterOptions:validateAdvancedOptions},h={account:validateAccount,opportunity:validateOpportunity,recipientRoles:validateRecipientRoles,recipientType:validateRecipientType,recipientUsers:validateRecipientUsers,scope:validateScope,startTime:validateStartTime,missingField:validateFieldOptionSelected,buttonText:validateButtonText,canvasTemplateId:validateCanvasTemplate,advancedFilterOptions:validateAdvancedOptions},b={account:validateAccount,opportunity:validateOpportunity,recipientRoles:validateRecipientRoles,recipientType:validateRecipientType,recipientUsers:validateRecipientUsers,closingIn:({incomingValue:e})=>!e||0>Number(e)?[{id:id("CLOSING_IN_DAYS_VALUE"),message:m.t("Negative numbers are not allowed.")}]:null,scope:validateScope,startTime:validateStartTime,buttonText:validateButtonText,canvasTemplateId:validateCanvasTemplate,advancedFilterOptions:validateAdvancedOptions},y={account:validateAccount,opportunity:validateOpportunity,recipientRoles:validateRecipientRoles,recipientType:validateRecipientType,recipientUsers:validateRecipientUsers,scope:validateScope,startTime:validateStartTime,buttonText:validateButtonText,canvasTemplateId:validateCanvasTemplate,advancedFilterOptions:validateAdvancedOptions},A=Object.freeze({...p,account:validateAccount,advancedOptions:validateAdvancedOptions,criteria:validateCriteria,opportunity:validateOpportunity,stage:validateStage,scope:validateScope,buttonText:validateButtonText,canvasTemplateId:validateCanvasTemplate}),E=Object.freeze({...p,account:validateAccount,advancedOptions:validateAdvancedOptions,criteria:validateCriteria,opportunity:validateOpportunity,recipientRoles:validateRecipientRoles,recipientType:validateRecipientType,recipientUsers:validateRecipientUsers,stage:validateStage,scope:validateScope,startTime:validateStartTime,stageChangedStages:({incomingValue:e,workflowView:t,currentValues:a})=>t!==u.Lb.userStageChanged&&t!==u.Lb.adminStageChanged||(0,n.A)(a.advancedOptions)||Array.isArray(e)&&e.length?null:[{id:id("STAGE_CHANGE_STAGES"),message:m.t("Please select at least one stage.")}],buttonText:validateButtonText,canvasTemplateId:validateCanvasTemplate});function getFormValidators(e){switch(e){case u.g$.AdminOpportunityChanged:return E;case u.g$.AdminReminder:return f;case u.g$.AdminOutdatedFields:return _;case u.g$.AdminClosingSoon:return b;case u.g$.AdminMissingFields:return h;case u.g$.AdminPastCloseDate:return y;case u.g$.UserOpportunityChanged:return A;case u.g$.UserReminder:return g;default:return p}}let S={ok:!1,errors:{}},C=[];function hasFormErrors(e){return!!e&&Object.values(e).some(e=>e?.length)}function validateWorkflowFormField(e,t,a,n,i){if(!n)return C;let l=getFormValidators(n.type);return l[t]?.({incomingValue:a,currentValues:n,workflowView:e,experiments:i})||C}function validateAllWorkflowFormFields(e,t,a){if(!e||!t)return S;let n={},i=getFormValidators(t.type),l={currentValues:t,workflowView:e,experiments:a};for(let[e,a]of Object.entries(i)){let i=t[e],r=a({...l,incomingValue:i});r&&(n[e]=r)}return{ok:!hasFormErrors(n),errors:n}}},0x1be40479b:(e,t,a)=>{"use strict";a.d(t,{L:()=>getDefaultButtonText});var n=a(0x20482ad21),i=a(0x1d104c491);let l=new n.Ay("modernselling");function getDefaultButtonText(e){switch(e){case i.Lb.adminDealWon:case i.Lb.userDealWon:return l.t("Create Win Story");case i.Lb.adminForecastReminder:case i.Lb.userForecastReminder:return l.t("Forecast Reminder");case i.Lb.adminNewOpportunityAlert:case i.Lb.userNewOpportunityAlert:return l.t("Create Proposal");default:case i.Lb.adminCloseDateChanged:case i.Lb.userCloseDateChanged:case i.Lb.adminStageChanged:case i.Lb.userStageChanged:return l.t("Create Deal Review")}}},0x1ea519746:(e,t,a)=>{"use strict";a.d(t,{Z:()=>getNotificationConfigIcon,Y:()=>useNotificationConfigIcon});var n=a(0x1d104c491);let i=a.p+"update-fa5aa52.svg",l=a.p+"amount-changed-0a849b9.svg",r=a.p+"close-date-changed-ab45769.svg";var o=a(0xc5a3e186);let s=a.p+"deal-won-da94eb7.svg",c=a.p+"forecast-reminder-14c2a6b.svg";var d=a(0x10398ed1f);let u=a.p+"new-opportunity-adf2289.svg";var m=a(0x86226b0b),p=a(0x11a940e89);let g=a.p+"stage-changed-069f628.svg";function getNewNotificationConfigIcon(e){switch(e){case n.Lb.adminAmountChanged:case n.Lb.userAmountChanged:return l;case n.Lb.adminCloseDateChanged:case n.Lb.userCloseDateChanged:return r;case n.Lb.adminDealWon:case n.Lb.userDealWon:return s;case n.Lb.adminForecastReminder:case n.Lb.userForecastReminder:return c;case n.Lb.adminNewOpportunityAlert:case n.Lb.userNewOpportunityAlert:return u;case n.Lb.adminStageChanged:case n.Lb.userStageChanged:return g;case n.Lb.adminMissingFields:return d;case n.Lb.adminOutdatedFields:return m;case n.Lb.adminClosingSoonAlert:return o;case n.Lb.adminPastCloseDateAlert:return p;default:return i}}function getNotificationConfigIcon(){return e=>getNewNotificationConfigIcon(e)}function useNotificationConfigIcon(e){return getNotificationConfigIcon()(e)}},0xe976659c:(e,t,a)=>{"use strict";a.d(t,{E:()=>mockScheduledRecords,f:()=>u});var n=a(0xd04cf7e4),i=a(0x237b6a339),l=a(0x1075d3a9c),r=a.n(l),o=a(0x205f4fb61),s=a(0x1d104c491);let c=["NextGen - Communications Cloud Integration","GreenTech - Solutions Software Upgrade","InnovateHub - Tech Expansion","AlphaData - Security Enhancement","QuantumSys - Data Analytics Revolution","EcoSync - Sustainable Connectivity Platform","NexGenius - AI-driven Business Optimization","CyberGuardian - Digital Defense Solutions","SolarSync - Renewable Energy Infrastructure","InnovateWare - Progressive Software Solutions","BlueSkyTech - Sky\u2018s the Limit Technology Innovations","ZenithConnect - Seamless Communication Integration","SafeBit Solutions - Data Security Fortification","RenewaGrid - Smart Grid Energy Solutions","EcoNet - Energy Management System"],d=["Qualification","Discovery","Proposal","Negotiation"];function mockStage(e){return e||d[(0,n.A)(0,d.length-1)]}function mockDate(e){return r()().add({days:e?(0,n.A)(3,90):(0,n.A)(0,7)}).locale(navigator.language).format("L")}function mockAmountFields(e){let t=(0,n.A)(1,400),a=(0,n.A)(Math.round(.05*t),Math.round(.5*t));t*=5e3,a*=5e3,e===s.Us.Decrease?a*=-1:e===s.Us.Any&&(a*=1===(0,n.A)(1,2)?-1:1);let i=t+a;return{amount:`${a<0?"-":""}$${(0,o.ZV)(Math.abs(i))}`,amount_raw:{amount:i},amount_change:`${a<0?"-":"+"}$${(0,o.ZV)(Math.abs(a))}`,amount_change_raw:{amount:a,percent:Math.round(Math.abs(100*a/t))}}}function mockScheduledRecords({amountDirection:e=s.Us.Any,stage:t,isClosingSoon:a}={}){return c.map(n=>({close_date:mockDate(a),id:(0,i.A)(),name:n,stage:mockStage(t),outdated_field_value_last_modified_date:mockDate(),...mockAmountFields(e),created_by:{},last_modified_by:{},owner:{},record_link:""}))}let u={amount:e=>({primary_sort:e,name:"Amount",type:"amount",payload_field:"amount",sort_payload_field:"amount_raw.amount"}),amountChange:e=>({primary_sort:e,name:"Amount Change",type:"delta",payload_field:"amount_change",sort_payload_field:"amount_change_raw.percent"}),closeDate:e=>({primary_sort:e,name:"Close Date",type:"date",payload_field:"close_date"}),opportunity:e=>({primary_sort:e,name:"Opportunity",type:"name",payload_field:"name"}),stage:e=>({primary_sort:e,name:"Stage",type:"stage",payload_field:"stage"}),nextStepLastUpdate:e=>({primary_sort:e,name:"Next step last update",type:"date",payload_field:"outdated_field_value_last_modified_date"})}},0x21ff11be5:(e,t,a)=>{"use strict";function shouldDisplayNotificationButton(e){return!!e?.includeMessageAddOn&&!!e?.canvasTemplateId&&!!e?.buttonText}a.d(t,{r:()=>shouldDisplayNotificationButton})},0x1bc8d2ce4:(e,t,a)=>{"use strict";a.d(t,{Ay:()=>useBuildWorkflowDescription,SH:()=>getAdvancedOptionsConditionsString,eq:()=>getScheduleStrings,pk:()=>useGetDestinationString,x4:()=>getDestination,zV:()=>getScopeStrings});var n=a(0xbad225b5),i=a(0x1595bdd0),l=a(0x1f355b555),r=a(0x20482ad21),o=a(0x1e864b930),s=a(0x16ac9b089),c=a(0xe08dc76c),d=a(0x247cf31a2),u=a(0x71c724c8),m=a(0x1d5b32854),p=a(0x1ec69ee01),g=a(0x1ecc7f772),f=a(0x82980ab8),_=a(0x6960d8b9),h=a(0x226892387),b=a(0x217553e42),y=a(0xe684f705),A=a(0x1d104c491);let E=new r.Ay("modernselling");function getHasSpecificRolesFilter(e){return!!e?.specific&&e.filter===A.yP.Specific&&!!e.specific.length}function getHasMatchesRolesFilter(e){return!!e?.match&&e.filter===A.yP.Match&&(e.match.containsOneOf.values.length||e.match.containsNoneOf.values.length)}function getSpecificRolesString(e){return getHasSpecificRolesFilter(e)?(0,o.A)(e?.specific?.map(e=>e.name)||[],{noEscape:!0}).join(""):""}function getMatchesRolesStrings(e){let t=getHasMatchesRolesFilter(e);return{roleContains:t?(0,o.A)(e?.match?.containsOneOf.values||[],{noEscape:!0}).join(""):"",roleNotContains:t?(0,o.A)(e?.match?.containsNoneOf.values||[],{noEscape:!0}).join(""):""}}function getWeekNumString(e){let t=e.date(),a=e.daysInMonth(),n=Math.ceil(t/7);switch(n+7>a&&(n=-1),n){case 1:return E.t("first");case 2:return E.t("second");case 3:return E.t("third");case 4:return E.t("fourth");case -1:return E.t("last");default:return""}}function getScheduleStrings(e){let t,{frequency:a,startTime:n}=e,i=(0,l.Ay)(n),r=(0,_.xe)(i.toDate());switch(a){case A.Ns.daily:t=E.t("daily");break;case A.Ns.weekdays:t=E.t("every weekday (Monday to Friday)");break;case A.Ns.weekly:t=E.t("weekly on {day}",{day:(0,m.SJ)(i)});break;case A.Ns.monthly:t=E.t("{weekNum} {day} of the month",{weekNum:getWeekNumString(i),day:(0,m.SJ)(i)});break;default:t=""}return{scheduleStr:t,timeStr:r}}function getCloseDateConditionString({advancedOptions:e,closeDateDirection:t,closeDatePeriod:a}){let n,i;if(e)return"";switch(t){case c.ig.ANY:n=E.t("another");break;case c.ig.LATER:n=E.t("a future");break;case c.ig.EARLIER:n=E.t("an earlier");break;default:n=""}switch(a){case c.ts.DAYS:i=E.t("day");break;case c.ts.MONTHS:i=E.t("month");break;case c.ts.FISCAL_QUARTER:i=E.t("fiscal quarter");break;case c.ts.FISCAL_YEAR:i=E.t("fiscal year");break;default:i=""}return n&&i?E.t("the close date changed to {direction} {period}",{direction:n,period:i}):E.t("the close date changed")}function getAmountDirectionString(e){switch(e){case A.Us.Decrease:return E.t("the amount has decreased");case A.Us.Increase:return E.t("the amount has increased");default:return E.t("the amount has changed",{fallbackHash:"89b7c029d91fe61c121adc4faba6f2af9380dd0f"})}}function getTemplateConditionsString(e,t,a=!1){switch(e){case A.Lb.adminAmountChanged:case A.Lb.userAmountChanged:return getAmountDirectionString(t.amountDirection);case A.Lb.adminStageChanged:case A.Lb.userStageChanged:return E.t("the stage changed");case A.Lb.adminCloseDateChanged:case A.Lb.userCloseDateChanged:return getCloseDateConditionString(t);case A.Lb.adminNewOpportunityAlert:case A.Lb.userNewOpportunityAlert:if(a)return E.t("a new opportunity is created");return E.t("is new");case A.Lb.adminDealWon:case A.Lb.userDealWon:return E.t("the stage changed to {stage}",{stage:t.stage?.label,__handlebars:!0});default:return""}}function getCriteriaString(e){switch(e){case A.Jd.OpportunityOwnedByDirectReports:return E.t("your direct report owns the opportunity");case A.Jd.AccountOwnedByMe:return E.t("you own the account");case A.Jd.OpportunityOwnedByMe:return E.t("you own the opportunity");case A.Jd.OpportunityOwnedByAnyoneInReportChain:return E.t("owned by people who roll up to you");case A.Jd.AccountOwnedByReportChain:return E.t("on an account people who roll up to you own");default:return""}}function getScopeStrings({scope:e,criteria:t,accountName:a,opportunityName:n}){switch(e){case A.QO.SpecificAccount:return[E.t("belongs to {accountName}",{accountName:a,__handlebars:!0})];case A.QO.SpecificOpportunity:return[E.t("is {opportunityName}",{opportunityName:n,__handlebars:!0})];case A.QO.MatchCriteria:return(0,i.A)((t||[]).map(e=>getCriteriaString(e)));default:return null}}let getAdvancedOptionsConditionsString=e=>{let t=[];return e&&Object.values(e).forEach(e=>{e?.description&&t.push(e?.description)}),t};function getConditionsString(e,t,a=!1){let n=[];n.push(getTemplateConditionsString(e,t,a));let l=getScopeStrings({scope:t.scope,criteria:t.criteria,accountName:t.account?.label,opportunityName:t.opportunity?.label});if(l?.length&&n.push(...l),t.amount&&!t.advancedOptions&&n.push(E.t("is worth at least {amount}",{amount:t.amount})),t.stageChangedStages?.length&&!t.advancedOptions){let e=t.stageChangedStages.map(({label:e})=>e).join(", ");n.push(E.t("stage is equal to {stages}",{stages:e}))}return t.sendTo===A.Oz.SalesHome&&t.type===A.g$.UserOpportunityChanged&&t.excludeSelfModifications&&(e===A.Lb.userNewOpportunityAlert?n.push(E.t("you didn\u2019t create the opportunity")):n.push(E.t("you didn\u2019t make the update"))),t.advancedOptions&&n.push(...getAdvancedOptionsConditionsString(t.advancedOptions)),(0,o.A)((0,i.A)(n),{noEscape:!0}).join("")}function getRecipientOpportunityOwnerDestinationString(e){let t=getSpecificRolesString(e),{roleContains:a,roleNotContains:n}=getMatchesRolesStrings(e);return t?E.t("specific opportunity owners of applicable opportunities, including {rolesStr}",{rolesStr:(0,s.Ay)(t)}):a&&n?E.t("specific opportunity owners of applicable opportunities, including roles that contain {containsStr}, but do not contain {notContainsStr}",{containsStr:(0,s.Ay)(a),notContainsStr:(0,s.Ay)(n),fallbackHash:"b132d8afd3f486941fa552b6ebbaa1ab0656beb5"}):a&&!n?E.t("specific opportunity owners of applicable opportunities, including roles that contain {containsStr}",{containsStr:(0,s.Ay)(a),fallbackHash:"b132d8afd3f486941fa552b6ebbaa1ab0656beb5"}):!a&&n?E.t("specific opportunity owners of applicable opportunities, excluding roles that contain {notContainsStr}",{notContainsStr:(0,s.Ay)(n),fallbackHash:"b132d8afd3f486941fa552b6ebbaa1ab0656beb5"}):E.t("opportunity owners of applicable opportunities")}function getRecipientAccountOwnerDestinationString(e){let t=getSpecificRolesString(e),{roleContains:a,roleNotContains:n}=getMatchesRolesStrings(e);return t?E.t("specific account owners of applicable opportunities, including {rolesStr}",{rolesStr:(0,s.Ay)(t)}):a&&n?E.t("specific account owners of applicable opportunities, including roles that contain {containsStr}, but do not contain {notContainsStr}",{containsStr:(0,s.Ay)(a),notContainsStr:(0,s.Ay)(n),fallbackHash:"b94e01ce329e7518e9ed5764b435697b5bf10dd7"}):a&&!n?E.t("specific account owners of applicable opportunities, including roles that contain {containsStr}",{containsStr:(0,s.Ay)(a),fallbackHash:"b94e01ce329e7518e9ed5764b435697b5bf10dd7"}):!a&&n?E.t("specific account owners of applicable opportunities, excluding roles that contain {notContainsStr}",{notContainsStr:(0,s.Ay)(n),fallbackHash:"b94e01ce329e7518e9ed5764b435697b5bf10dd7"}):E.t("account owners of applicable opportunities")}function getRecipientAccountManagerChainDestinationString(e){let t=getSpecificRolesString(e),{roleContains:a,roleNotContains:n}=getMatchesRolesStrings(e);return t?E.t("specific roles that the account owner rolls up to, including {rolesStr}",{rolesStr:(0,s.Ay)(t)}):a&&n?E.t("specific roles that the account owner rolls up to, including roles that contain {containsStr}, but do not contain {notContainsStr}",{containsStr:(0,s.Ay)(a),notContainsStr:(0,s.Ay)(n)}):a&&!n?E.t("specific roles that the account owner rolls up to, including roles that contain {containsStr}",{containsStr:(0,s.Ay)(a)}):!a&&n?E.t("specific roles that the account owner rolls up to, excluding roles that contain {notContainsStr}",{notContainsStr:(0,s.Ay)(n)}):E.t("roles that the account owner rolls up to")}function getRecipientOpportunityManagerChainDestinationString(e){let t=getSpecificRolesString(e),{roleContains:a,roleNotContains:n}=getMatchesRolesStrings(e);return t?E.t("specific roles that the opportunity owner rolls up to, including {rolesStr}",{rolesStr:(0,s.Ay)(t)}):a&&n?E.t("specific roles that the opportunity owner rolls up to, including roles that contain {containsStr}, but do not contain {notContainsStr}",{containsStr:(0,s.Ay)(a),notContainsStr:(0,s.Ay)(n)}):a&&!n?E.t("specific roles that the opportunity owner rolls up to, including roles that contain {containsStr}",{containsStr:(0,s.Ay)(a)}):!a&&n?E.t("specific roles that the opportunity owner rolls up to, excluding roles that contain {notContainsStr}",{notContainsStr:(0,s.Ay)(n)}):E.t("roles that the opportunity owner rolls up to")}function getRecipientOpportunityOwnerManagerDestinationString(e){let t=getSpecificRolesString(e),{roleContains:a,roleNotContains:n}=getMatchesRolesStrings(e);return t?E.t("specific managers of opportunity owners of applicable opportunities, including {rolesStr}",{rolesStr:(0,s.Ay)(t)}):a&&n?E.t("specific managers of opportunity owners of applicable opportunities, including roles that contain {containsStr}, but do not contain {notContainsStr}",{containsStr:(0,s.Ay)(a),notContainsStr:(0,s.Ay)(n)}):a&&!n?E.t("specific managers of opportunity owners of applicable opportunities, including roles that contain {containsStr}",{containsStr:(0,s.Ay)(a)}):!a&&n?E.t("specific managers of opportunity owners of applicable opportunities, excluding roles that contain {notContainsStr}",{notContainsStr:(0,s.Ay)(n)}):E.t("managers of opportunity owners of applicable opportunities")}function getRecipientAccountOwnerManagerDestinationString(e){let t=getSpecificRolesString(e),{roleContains:a,roleNotContains:n}=getMatchesRolesStrings(e);return t?E.t("specific managers of account owners of applicable opportunities, including {rolesStr}",{rolesStr:(0,s.Ay)(t)}):a&&n?E.t("specific managers of account owners of applicable opportunities, including roles that contain {containsStr}, but do not contain {notContainsStr}",{containsStr:(0,s.Ay)(a),notContainsStr:(0,s.Ay)(n)}):a&&!n?E.t("specific managers of account owners of applicable opportunities, including roles that contain {containsStr}",{containsStr:(0,s.Ay)(a)}):!a&&n?E.t("specific managers of account owners of applicable opportunities, excluding roles that contain {notContainsStr}",{notContainsStr:(0,s.Ay)(n)}):E.t("managers of account owners of applicable opportunities")}function useGetRecipientUsersString(e){let t=(0,h.Z2)(t=>(0,y.gA)(t,e?.recipientUsers||[]).map(f.wg));return(0,n.useCallback)(()=>{if(t.length>3){let e=t.slice(0,3),a=t.length-3,n=E.t("{othersCount, plural, =1 {# other} other {# others}}",{othersCount:a});return(0,o.A)([...e,n],{noEscape:!0}).join("")}return(0,o.A)(t,{noEscape:!0}).join("")},[t])}function useGetChannelInfo(e){let t=(0,h.d4)(t=>(0,b.OL)(t,e?.channelId)),a=(0,h.d4)(e=>(0,g.SB)(e,t));return(0,n.useCallback)(()=>({name:a,memberCount:(0,p.vC)(t)}),[t,a])}function useGetDestinationString(e,t,a=!1){let i=useGetChannelInfo(t),l=useGetRecipientUsersString(t);return(0,n.useCallback)(()=>{if(!t)return"";let{sendTo:n,recipientRoles:r,recipientType:o,recipientUsers:s}=t,c=i();if(n===A.Oz.Channel&&c.name)return a&&c.memberCount?E.t("{name} ({count, plural, =1 {# member} other {# members}})",{name:c.name,count:c.memberCount}):c.name;if(o){let a=[];if(o===A._Y.User)return s?.length?l():"";switch(o){case A._Y.Owner:a.push(getRecipientOpportunityOwnerDestinationString(r));break;case A._Y.AccountOwner:a.push(getRecipientAccountOwnerDestinationString(r));break;case A._Y.AccountManagerChain:a.push(getRecipientAccountManagerChainDestinationString(r));break;case A._Y.ManagerChain:a.push(getRecipientOpportunityManagerChainDestinationString(r));break;case A._Y.OwnerManager:a.push(getRecipientOpportunityOwnerManagerDestinationString(r));break;case A._Y.AccountOwnerManager:a.push(getRecipientAccountOwnerManagerDestinationString(r))}return t.sendTo===A.Oz.SalesHome&&t.type===A.g$.AdminOpportunityChanged&&t.excludeSelfModifications&&(e===A.Lb.adminNewOpportunityAlert?a.push(E.t("excluding the person who created the opportunity")):a.push(E.t("excluding the person who made the update"))),a.join(", ")}if(t.type===A.g$.AdminReminder&&t.sendTo===A.Oz.SalesHome){let e=getSpecificRolesString(r);if(e)return e}return E.t("your sales dashboard")},[i,l,a,t,e])}let getChannel=e=>E.rt("To {channel}",{channel:n.createElement("span",{className:"sk_highlight"},n.createElement(d.A,{channelId:e}))});getChannel.displayName="getChannel";let getRecepientList=e=>E.rt("To specific people ({numberOfMembers, plural, one {# member} other {# members}}) {recepients}",{numberOfMembers:e.length,recepients:n.createElement("ul",{className:"p-sales_notifications__workflow__presentation_box__specific_people"},e.map(e=>n.createElement("li",{key:e,className:"margin_0"},n.createElement(u.Ay,{id:e,showPresence:!1}))))});getRecepientList.displayName="getRecepientList";let getDestination=({channelId:e,recipientUsers:t,recipientType:a,destinationStr:n})=>e?getChannel(e):a===A._Y.User&&t&&t?.length>0?getRecepientList(t):E.t("To {destinationText}",{destinationText:n,__handlebars:!0});function useGetReminderDescription(e,t,a=!1,i){let l=useGetDestinationString(e,t,a);return(0,n.useCallback)(()=>{if(!t||t.type===A.g$.AdminOpportunityChanged||t.type===A.g$.UserOpportunityChanged)return null;let e=l(),{timeStr:n,scheduleStr:r}=getScheduleStrings(t);if(a){let a=E.t("Scheduled {scheduleStr} at {timeStr}",{scheduleStr:r,timeStr:n});i&&(a=E.t("Scheduled {scheduleStr} at {timeStr} for {salesforceOrgName}",{scheduleStr:r,timeStr:n,salesforceOrgName:i,__handlebars:!0}));let{channelId:l,recipientUsers:o,recipientType:s}=t;return{description:a,destination:getDestination({channelId:l,recipientUsers:o,recipientType:s,destinationStr:e})}}return i?{description:E.t("Sends a reminder to {destinationStr} to update opportunities in {salesforceOrgName}. Scheduled {scheduleStr} at {timeStr}",{destinationStr:e,scheduleStr:r,timeStr:n,salesforceOrgName:i,__handlebars:!0}),destination:""}:{description:E.t("Sends a reminder to {destinationStr} to update opportunities. Scheduled {scheduleStr} at {timeStr}",{destinationStr:e,scheduleStr:r,timeStr:n,__handlebars:!0}),destination:""}},[l,a,t,i])}function useGetOpportunityChangedDescription(e,t,a=!1,i){let l=useGetDestinationString(e,t,a);return(0,n.useCallback)(()=>{if(!t)return null;let n=l(),r=getConditionsString(e,t,a);if(a){let e;if(t.isRecurring){let{timeStr:a,scheduleStr:n}=getScheduleStrings(t);e=i?E.t("Scheduled {scheduleStr} at {timeStr} for opportunities that meet these conditions: {conditionsStr} in {salesforceOrgName}",{conditionsStr:r,scheduleStr:n,timeStr:a,salesforceOrgName:i,__handlebars:!0}):E.t("Scheduled {scheduleStr} at {timeStr} for opportunities that meet these conditions: {conditionsStr}",{conditionsStr:r,scheduleStr:n,timeStr:a,__handlebars:!0})}else e=i?E.t("When {conditionsStr} in {salesforceOrgName}",{conditionsStr:r,salesforceOrgName:i,__handlebars:!0}):E.t("When {conditionsStr}",{conditionsStr:r,__handlebars:!0});let{channelId:a,recipientUsers:l,recipientType:o}=t;return{description:e,destination:getDestination({channelId:a,recipientUsers:l,recipientType:o,destinationStr:n})}}if(t.isRecurring){let{timeStr:e,scheduleStr:a}=getScheduleStrings(t);return i?{description:E.t("Scheduled {scheduleStr} at {timeStr}, send to {destinationStr} under these opportunity conditions: {conditionsStr} in {salesforceOrgName}",{conditionsStr:r,destinationStr:n,scheduleStr:a,timeStr:e,salesforceOrgName:i,__handlebars:!0}),destination:""}:{description:E.t("Scheduled {scheduleStr} at {timeStr}, send to {destinationStr} under these opportunity conditions: {conditionsStr}",{conditionsStr:r,destinationStr:n,scheduleStr:a,timeStr:e,__handlebars:!0}),destination:""}}return i?{description:E.t("Send to {destinationStr} under these opportunity conditions: {conditionsStr} in {salesforceOrgName}",{destinationStr:n,conditionsStr:r,salesforceOrgName:i,__handlebars:!0}),destination:""}:{description:E.t("Send to {destinationStr} under these opportunity conditions: {conditionsStr}",{destinationStr:n,conditionsStr:r,__handlebars:!0}),destination:""}},[l,a,t,e,i])}function useBuildWorkflowDescription(e,t,a=!1,i){let l=useGetReminderDescription(e,t,a,i),r=useGetOpportunityChangedDescription(e,t,a,i);return(0,n.useCallback)(()=>t?t?.type===A.g$.AdminReminder||t?.type===A.g$.UserReminder?l():r():null,[t,l,r])}},0x4dfa0edd:(e,t,a)=>{"use strict";a.d(t,{Ay:()=>useBuildWorkflowPayload});var n=a(0xbad225b5),i=a(0x1db69cda),l=a(0x1595bdd0),r=a(0x1075d3a9c),o=a.n(r),s=a(0x20482ad21),c=a(0x16ac9b089),d=a(0x1853b39ce),u=a(0x1bc8d2ce4);let m=new s.Ay("modernselling");var p=a(0x66c4c9f7),g=a(0x151f56714),f=a(0x1d0dc57a0);let _=new s.Ay("modernselling");var h=a(0x7629109d);let b=new s.Ay("modernselling");var y=a(0x125c85f04),A=a(0xb0222280);let E=new s.Ay("modernselling");var S=a(0x3c7fcc66),C=a(0x6f20b262);function formatAdvancedFilterConditionsForTransmit(e){if(!e)return;let t=(0,l.A)(Object.values(e));if(t?.length)return t.filter(e=>!!e.type).map(({description:e,...t})=>{let a=t.rhs?.map(({formattedValue:e,label:t,...a})=>a);return t.type&&a?.length&&!C.EN.has(t.type)&&(a=a[0]),{...t,rhs:a}})}var v=a(0x405dcae6),x=a(0x98161168),w=a(0x1122238d8),O=a(0x124d99cb0),k=a(0x226892387),N=a(0x1c8beab7f),T=a(0x1d104c491);let getScopeFields=({scope:e,account:t})=>{let a={scope:e===T.QO.SpecificAccount?"account":e===T.QO.SpecificOpportunity?"opportunity":"all"};return"account"===e&&(a.account={id:t?.value||"",name:t?.label||""}),a};function getDayOfWeek(e){return[o()(e).locale("en").format("dddd")]}function getMonthWeekNum(e){return(0,O.Bz)(o()(e).format("YYYY-MM-DD"))??1}let getMinDealAmount=e=>null===e?void 0:(0,w.Ro)(e);function getSharedWorkflowPayload({sendTo:e,channelId:t,tokenUserId:a,title:n}){return{send_to:e,title:n,channel_id:t||void 0,token_user_id:a||void 0}}function getFrequencyPayload({frequency:e,startTime:t}){switch(e){case T.Ns.daily:return{type:"daily"};case T.Ns.weekdays:return{type:"weekly",on_days:["Monday","Tuesday","Wednesday","Thursday","Friday"]};case T.Ns.weekly:return{type:"weekly",on_days:getDayOfWeek(t)};case T.Ns.monthly:default:return{type:"monthly",on_days:getDayOfWeek(t),on_week_num:getMonthWeekNum(t)}}}function getRecipientRolesPayload(e){let t={roles:[],role_contains_none_of:[],role_contains_one_of:[]};return e?.filter===T.yP.Specific?t.roles=e.specific:(t.role_contains_none_of=e?.match.containsNoneOf.values||[],t.role_contains_one_of=e?.match.containsOneOf.values||[]),t}function getReminderTrigger(e){let{startTime:t,timezone:a}=e;return{type:"scheduled",schedule:{start_time:t,timezone:a,frequency:getFrequencyPayload(e)}}}function getRecurringTrigger(e){let{startTime:t,timezone:a}=e;return{type:"external",schedule:{start_time:t,timezone:a,frequency:getFrequencyPayload(e)}}}function getCloseDateChangePayload(e,t){let a,n;switch(e){case"LaterTemporalDirection":a=T.es.TO_FUTURE;break;case"EarlierTemporalDirection":a=T.es.TO_EARLIER;break;default:a=T.es.TO_ANOTHER}switch(t){case"FiscalYearTimePeriod":n=T.oE.FISCAL_YEAR;break;case"DaysTimePeriod":n=T.oE.DAYS;break;case"MonthsTimePeriod":n=T.oE.MONTHS;break;default:n=T.oE.FISCAL_QUARTER}return{direction:a,period:n}}function getFilteredAdvancedConditions(e){return e.map(e=>{if(e.type&&v.Xp.has(e.type)){let{rhs:t,...a}=e;return a}return e})}function setTimePeriodOperator(e){let t=(0,i.A)(e);return t&&Object.keys(t).forEach(e=>{let a=t[e];a?.type&&(C.aq.has(a.type)?a.type=C.hu.TimePeriodHasChangedTriggerCondition:C.rF.has(a.type)&&(a.type=C.hu.TimePeriodWithinTriggerCondition))}),t}let useGetSelectedOrgName=e=>{let t=(0,k.d4)(t=>e?(0,N.MH)(t):(0,N.gE)(t)),a=(0,k.d4)(N.RC),n=(0,k.d4)(N.Ey),i=(0,k.d4)(N.cc),l=(0,k.d4)(N.Kr),r=e?n?.name:i?.find(e=>e.salesforce_org_id===a)?.name,o=e?l?.find(e=>e.salesforce_org_id===t)?.name:i?.find(e=>e.salesforce_org_id===t)?.name;return(0,k.d4)(e?N.Tt:N.rm)?o:r},getRecipients=(e,t,a)=>e&&"user"!==e?{...getRecipientRolesPayload(t),relationships:[e]}:{user_ids:a||[]};function useBuildWorkflowPayload(e,t,a){let i,r,o,s,C,v,w,O,k=(0,S.iZ)(),N=(0,S.Se)(),I=a?k:N,F=(i=useGetSelectedOrgName(a),r=(0,u.Ay)(e,t,!1,i),(0,n.useCallback)(()=>{if(!t||t.type!==T.g$.AdminReminder)return null;let{canvasTemplateId:e,includeMessageAddOn:a,buttonText:n}=t,i={scope:T.QO.All};return t.sendTo===T.Oz.SalesHome&&(i.recipients=getRecipientRolesPayload(t.recipientRoles)),{...getSharedWorkflowPayload(t),trigger:getReminderTrigger(t),acn:i,description:r()?.description||"",canvas_template_id:e,message_add_on:a,button_text:n}},[r,t])),M=(o=useGetSelectedOrgName(a),s=(0,u.Ay)(e,t,!1,o),(0,n.useCallback)(()=>{if(!t||t.type!==T.g$.UserReminder)return null;let{canvasTemplateId:e,includeMessageAddOn:a,buttonText:n}=t;return{...getSharedWorkflowPayload(t),trigger:getReminderTrigger(t),description:s()?.description||"",canvas_template_id:e,message_add_on:a,button_text:n}},[s,t])),D=(C=useGetSelectedOrgName(!0),v=(0,u.Ay)(e,t,!1,C),(0,n.useCallback)(()=>{if(!t||t.type!==T.g$.AdminOpportunityChanged)return null;let{scope:a,amount:n,amountDirection:i,advancedOptions:r,opportunity:o,account:s,stage:c,sendTo:d,excludeSelfModifications:u,recipientType:m,recipientUsers:p,closeDateDirection:g,closeDatePeriod:f,includeCelebrations:_,isRecurring:h,stageChangedStages:b,canvasTemplateId:y,includeMessageAddOn:A,buttonText:E,isMutingDisabled:S,dealWinCelebrationMessageFields:C}=t,w={scope:a,stage_for_win:c?.key??void 0,is_muting_disabled:S};!r&&g&&f&&(w.close_date_condition=getCloseDateChangePayload(g,f));let O=setTimePeriodOperator(r);a===T.QO.SpecificAccount?w.account={id:s?.key,name:s?.label}:a===T.QO.SpecificOpportunity&&(w.opportunity={id:o?.key,name:o?.label});let k=O&&(0,x.V0)((0,l.A)(Object.values(O)));return k?.length?(w.advanced_conditions=getFilteredAdvancedConditions(k),e===T.Lb.adminDealWinCelebration&&(w.min_deal_amount=getMinDealAmount(n))):(w.min_deal_amount=getMinDealAmount(n),b?.length&&(w.stage_condition={stage_to:b.map(({value:e})=>e)})),i&&(w.amount_condition={direction:i}),d===T.Oz.SalesHome&&(w.exclude_self_modifications=!!u),d===T.Oz.SalesHome&&(m&&m!==T._Y.User?w.recipients={...getRecipientRolesPayload(t.recipientRoles),relationships:[m]}:w.recipients={user_ids:p||[]}),d===T.Oz.Profile&&m&&(w.recipients={...getRecipientRolesPayload(t.recipientRoles),relationships:[m]},w.exclude_self_modifications=!!u),C&&e===T.Lb.adminDealWinCelebration&&(w.deal_win_celebration_message_fields=C),{...getSharedWorkflowPayload(t),datasource_id:I,trigger:h?getRecurringTrigger(t):{type:"external"},acn:w,description:v()?.description||"",display_celebration:_,canvas_template_id:h?null:y,message_add_on:!h&&A,button_text:h?"":E}},[v,I,t,e])),R=(w=useGetSelectedOrgName(!1),O=(0,u.Ay)(e,t,!1,w),(0,n.useCallback)(()=>{if(!t||t.type!==T.g$.UserOpportunityChanged)return null;let{scope:e,amount:a,advancedOptions:n,criteria:i,opportunity:r,account:o,stage:s,sendTo:c,excludeSelfModifications:d,closeDateDirection:u,closeDatePeriod:m,includeCelebrations:p,canvasTemplateId:g}=t,f={scope:e,stage_for_win:s?.key??void 0};!n&&u&&m&&(f.close_date_condition=getCloseDateChangePayload(u,m));let _=setTimePeriodOperator(n);switch(e){case T.QO.All:f.scope=T.QO.MatchCriteria,f.criteria=[];break;case T.QO.AccountsOwnedByMe:f.scope=T.QO.MatchCriteria,f.criteria=[T.Jd.AccountOwnedByMe];break;case T.QO.AccountOwnedByReportChain:f.scope=T.QO.MatchCriteria,f.criteria=[T.Jd.AccountOwnedByReportChain];break;case T.QO.OwnedByMe:f.scope=T.QO.MatchCriteria,f.criteria=[T.Jd.OpportunityOwnedByMe];break;case T.QO.OwnedByDirectReports:f.scope=T.QO.MatchCriteria,f.criteria=[T.Jd.OpportunityOwnedByDirectReports];break;case T.QO.OwnedByReportChain:f.scope=T.QO.MatchCriteria,f.criteria=[T.Jd.OpportunityOwnedByAnyoneInReportChain];break;case T.QO.SpecificAccount:f.account={id:o?.key,name:o?.label};break;case T.QO.SpecificOpportunity:f.opportunity={id:r?.key,name:r?.label};break;case T.QO.MatchCriteria:f.criteria=i.filter(e=>e!==T.Jd.Any);break;default:return null}let h=_&&(0,x.V0)((0,l.A)(Object.values(_)));return h?.length?f.advanced_conditions=getFilteredAdvancedConditions(h):f.min_deal_amount=getMinDealAmount(a),c===T.Oz.SalesHome&&(f.exclude_self_modifications=!!d),{...getSharedWorkflowPayload(t),datasource_id:I,trigger:{type:"external"},condition:f,description:O()?.description||"",display_celebration:p,canvas_template_id:g}},[O,I,t])),P=useGetSelectedOrgName(a)||"",L=(0,u.pk)(e,t,!1)();return(0,n.useCallback)(()=>{switch(t?.type){case T.g$.AdminReminder:return F();case T.g$.UserReminder:return M();case T.g$.UserOpportunityChanged:return R();case T.g$.AdminOpportunityChanged:return D();case T.g$.AdminOutdatedFields:return(({values:e,datasourceId:t,selectedOrgName:a,destination:n})=>{if(!e||!t)return null;let{sendTo:i,title:l,channelId:r,startTime:o,timezone:s,frequency:d,scope:m,account:p,recipientType:g,recipientUsers:f,recipientRoles:_,outdatedFieldValue:A,outdatedFieldPeriod:E,outdatedFieldPeriodValue:S,advancedFilterOptions:C,isMutingDisabled:v}=e,x=getScopeFields({scope:m,account:p}),w=getRecipients(g,_,f),O=(0,y.qJ)(A,E,S),k=((e,t,a)=>{let n=(0,h.A)(e),{timeStr:i,scheduleStr:l}=(0,u.eq)(e);return(({schedule:e,time:t,destination:a,conditions:n,salesforceOrgName:i})=>b.t("Scheduled {schedule} at {time}, send to {destination} under these opportunity conditions: {conditions} in {salesforceOrgName}",{schedule:(0,c.Ay)(e),time:(0,c.Ay)(t),destination:(0,c.Ay)(a),conditions:(0,c.Ay)(n),salesforceOrgName:(0,c.Ay)(i)}))({time:i,schedule:l,salesforceOrgName:t,conditions:n,destination:a})})(e,a,n),N=C&&formatAdvancedFilterConditionsForTransmit(C);return{send_to:i,title:l,channel_id:void 0,token_user_id:void 0,datasource_id:t,trigger:{type:"external",schedule:{start_time:o,timezone:s,frequency:getFrequencyPayload({frequency:d,startTime:o})}},acn:{...x,recipients:w,outdated_field_condition:O,advanced_filter_conditions:N||void 0,is_muting_disabled:v},description:k}})({values:t,datasourceId:I,selectedOrgName:P,destination:L});case T.g$.AdminClosingSoon:return(({values:e,datasourceId:t,selectedOrgName:a,destination:n})=>{if(!e||!t)return null;let{sendTo:i,title:l,channelId:r,startTime:o,timezone:s,frequency:g,scope:f,account:_,recipientType:h,recipientUsers:b,recipientRoles:y,closingIn:A,advancedFilterOptions:E,isMutingDisabled:S}=e,C=getScopeFields({scope:f,account:_}),v=getRecipients(h,y,b),x=(0,p.T)(A),w=((e,t,a)=>{let n=(0,d.a)(e),{timeStr:i,scheduleStr:l}=(0,u.eq)(e);return(({schedule:e,time:t,destination:a,conditions:n,salesforceOrgName:i})=>m.t("Scheduled {schedule} at {time}, send to {destination} under these opportunity conditions: {conditions} in {salesforceOrgName}",{schedule:(0,c.Ay)(e),time:(0,c.Ay)(t),destination:(0,c.Ay)(a),conditions:(0,c.Ay)(n),salesforceOrgName:(0,c.Ay)(i)}))({time:i,schedule:l,salesforceOrgName:t,conditions:n,destination:a})})(e,a,n),O=E&&formatAdvancedFilterConditionsForTransmit(E);return{send_to:i,title:l,channel_id:void 0,token_user_id:void 0,datasource_id:t,trigger:{type:"external",schedule:{start_time:o,timezone:s,frequency:getFrequencyPayload({frequency:g,startTime:o})}},acn:{...C,recipients:v,closing_soon_condition:x,advanced_filter_conditions:O||void 0,is_muting_disabled:S},description:w}})({values:t,datasourceId:I,selectedOrgName:P,destination:L});case T.g$.AdminMissingFields:return(({values:e,datasourceId:t,selectedOrgName:a,destination:n})=>{if(!e||!t)return null;let{sendTo:i,title:l,channelId:r,startTime:o,timezone:s,frequency:d,scope:m,account:p,recipientType:h,recipientUsers:b,recipientRoles:y,missingField:A,advancedFilterOptions:E,isMutingDisabled:S}=e,C=getScopeFields({scope:m,account:p}),v=getRecipients(h,y,b),x=(0,g.l)(A),w=((e,t,a)=>{let n=(0,f.v)(e),{timeStr:i,scheduleStr:l}=(0,u.eq)(e);return(({schedule:e,time:t,destination:a,conditions:n,salesforceOrgName:i})=>_.t("Scheduled {schedule} at {time}, send to {destination} under these opportunity conditions: {conditions} in {salesforceOrgName}",{schedule:(0,c.Ay)(e),time:(0,c.Ay)(t),destination:(0,c.Ay)(a),conditions:(0,c.Ay)(n),salesforceOrgName:(0,c.Ay)(i)}))({time:i,schedule:l,salesforceOrgName:t,conditions:n,destination:a})})(e,a,n),O=formatAdvancedFilterConditionsForTransmit(E);return{send_to:i,title:l,channel_id:void 0,token_user_id:void 0,datasource_id:t,trigger:{type:"external",schedule:{start_time:o,timezone:s,frequency:getFrequencyPayload({frequency:d,startTime:o})}},acn:{...C,recipients:v,missing_field_condition:x,advanced_filter_conditions:O,is_muting_disabled:S},description:w}})({values:t,datasourceId:I,selectedOrgName:P,destination:L});case T.g$.AdminPastCloseDate:return(({values:e,datasourceId:t,selectedOrgName:a,destination:n})=>{if(!e||!t)return null;let{sendTo:i,title:l,channelId:r,startTime:o,timezone:s,frequency:d,scope:m,account:p,recipientType:g,recipientUsers:f,recipientRoles:_,advancedFilterOptions:h,isMutingDisabled:b}=e,y=getScopeFields({scope:m,account:p}),S=getRecipients(g,_,f),C=((e,t,a)=>{let n=(0,A.s)(e),{timeStr:i,scheduleStr:l}=(0,u.eq)(e);return(({schedule:e,time:t,destination:a,conditions:n,salesforceOrgName:i})=>E.t("Scheduled {schedule} at {time}, send to {destination} under these opportunity conditions: {conditions} in {salesforceOrgName}",{schedule:(0,c.Ay)(e),time:(0,c.Ay)(t),destination:(0,c.Ay)(a),conditions:(0,c.Ay)(n),salesforceOrgName:(0,c.Ay)(i)}))({time:i,schedule:l,salesforceOrgName:t,conditions:n,destination:a})})(e,a,n),v=formatAdvancedFilterConditionsForTransmit(h);return{send_to:i,title:l,channel_id:void 0,token_user_id:void 0,datasource_id:t,trigger:{type:"external",schedule:{start_time:o,timezone:s,frequency:getFrequencyPayload({frequency:d,startTime:o})}},acn:{...y,recipients:S,advanced_filter_conditions:v,is_muting_disabled:b},description:C}})({values:t,datasourceId:I,selectedOrgName:P,destination:L});default:return null}},[t,F,M,R,D,I,P,L])}},0x3c7fcc66:(e,t,a)=>{"use strict";a.d(t,{Se:()=>useGetSelectedDatasourceIdForSearchForUser,UE:()=>useGetSelectedSalesforceOrgIdForSearchForAdmin,iZ:()=>useGetSelectedDatasourceIdForSearchForAdmin,mi:()=>useGetSelectedSalesforceOrgIdForSearchForUser});var n=a(0x226892387),i=a(0x1c8beab7f);let useGetSelectedDatasourceIdForSearchForAdmin=()=>{let e=!!(0,n.d4)(e=>(0,i.DY)(e,!0)),t=(0,n.d4)(i.e$),a=(0,n.d4)(e=>(0,i.iN)(e)?.datasource_id);return e?a:t},useGetSelectedDatasourceIdForSearchForUser=()=>{let e=!!(0,n.d4)(e=>(0,i.DY)(e,!1)),t=(0,n.d4)(i.ZQ)?.datasource_id,a=(0,n.d4)(e=>(0,i.cw)(e)?.datasource_id);return e?a:t},useGetSelectedSalesforceOrgIdForSearchForAdmin=()=>{let e=!!(0,n.d4)(e=>(0,i.DY)(e,!0)),t=(0,n.d4)(i.rg),a=(0,n.d4)(i.MH);return e?a:t},useGetSelectedSalesforceOrgIdForSearchForUser=()=>{let e=!!(0,n.d4)(e=>(0,i.DY)(e,!1)),t=(0,n.d4)(i.ZQ)?.salesforce_org_id,a=(0,n.d4)(e=>(0,i.cw)(e)?.salesforce_org_id);return e?a:t}},0x133aee58f:(e,t,a)=>{"use strict";a.d(t,{A:()=>useGetSelectedSalesforceOrgIdForSearch});var n=a(0x226892387),i=a(0x1c8beab7f);function useGetSelectedSalesforceOrgIdForSearch(e=!1){let t=!!(0,n.d4)(t=>(0,i.DY)(t,e)),a=(0,n.d4)(i.rg),l=(0,n.d4)(i.RC),r=(0,n.d4)(e?i.MH:i.gE);return t?r:e?a:l}},0x173712bc0:(e,t,a)=>{"use strict";a.d(t,{A:()=>useIsEditWorkflow});var n=a(0x226892387),i=a(0x1c8beab7f);function useIsEditWorkflow(e=!1){return!!(0,n.d4)(t=>(0,i.DY)(t,e))}},0x1aa0ab2cd:(e,t,a)=>{"use strict";a.d(t,{i:()=>useOpenAdminSetup});var n=a(0xbad225b5),i=a(0x1b955e8fc),l=a(0xd896af8a),r=a(0x226892387),o=a(0x1c8beab7f);function useOpenAdminSetup(){let e=(0,r.d4)(o.e$),t=(0,i.A)();return(0,n.useCallback)(()=>{t(l.b.MapFields,{selectedSalesforceOrgDatasourceId:e})},[t,e])}},0x1e85f5284:(e,t,a)=>{"use strict";a.d(t,{A:()=>useOpenDeleteNotificationModal});var n=a(0xbad225b5),i=a(0x16cf1da63),l=a(0xca924ee1),r=a(0x20482ad21),o=a(0x6e87d4ec),s=a(0x40c0d834),c=a(0x2b7f0bcc),d=a(0x11a296110),u=a(0xce378727),m=a(0x20e80190e),p=a(0x3711e82d),g=a(0x1fcbb004d),f=a(0xd2ed875e),_=a(0x11c82607b),h=a(0x16b708a7f);let b=(0,_.Ay)("Delete sales notification Workflow",(e,t,{workflowId:a})=>e((0,f.a)({workflowId:a,reason:"delete-workflow-function"})).then(()=>{e((0,h.HC)({workflowId:a}))}).catch(()=>e((0,h.in)({workflowId:a}))));b.meta={name:"deleteSalesNotificationWorkflowFunction",key:"createThunkDeleteSalesNotificationWorkflowFunction",description:"Delete sales notification Workflow"};let y=new r.Ay("modernselling"),A={elementName:"delete_notification",onClick:{enableClogAction:!0}},NotificationDeleteModal=({workflow:e,onDelete:t})=>{let a=(0,i.wA)(),[l,r]=(0,n.useState)(!1),[o,f]=(0,n.useState)(!1),_=(0,n.useCallback)(()=>{a((0,g.O)()),f(!1)},[a]),h=(0,n.useCallback)(()=>{let n=e.id;r(!0),a(b({workflowId:n})).then(()=>{t(n),r(!1),a((0,g.O)())}).catch(()=>{f(!0),r(!1)})},[a,e,t]);return n.createElement(s.A,{eventId:p.EventId.LOB_NOTIFICATIONS,uiComponentName:p.UiComponentName.LOB_NOTIFICATIONS_LIST,workflowId:e.id},n.createElement(m.dW,{closeModal:_},n.createElement(m.rQ,null,n.createElement(m.Rc,{title:y.t("Delete Notification?")})),n.createElement(m.$m,null,n.createElement(m.qf,null,o?n.createElement(c.Ay,{type:"boxed",level:"error",className:"margin_bottom_150"},y.rt("Oops\u2026 we had trouble deleting this notification")):null,n.createElement("p",null,y.rt("{name} will be deleted from this list and will stop sending notifications. This can\u2019t be undone.",{name:e.title})))),n.createElement(m.jl,null,n.createElement(m.ox,null,n.createElement(d.Ay,{onClick:_,type:"outline"},y.t("Cancel")),n.createElement(u.A,{onClick:h,type:"danger",loading:l,autoClogProps:A,"aria-label":y.t("Delete Notification {name}",{name:e.title})},y.t("Delete Notification"))))))};NotificationDeleteModal.displayName="NotificationDeleteModal";var E=a(0x46dbff89),S=a(0x16ffed5ab);let C=new r.Ay("modernselling");function useOpenDeleteNotificationModal(){let e=(0,i.wA)(),t=(0,n.useCallback)(t=>{e((0,S.M)({element:n.createElement(o.A,null,C.rt("Successfully deleted notification {name}",{name:t}))}))},[e]);return(0,n.useCallback)((a,i)=>{let r=(0,l.A)(()=>{i?.(a.id),t(a.title)});e((0,E.q)({element:n.createElement(NotificationDeleteModal,{workflow:a,onDelete:r})}))},[e,t])}useOpenDeleteNotificationModal.displayName="useOpenDeleteNotificationModal"},0x23cb9e36f:(e,t,a)=>{"use strict";a.d(t,{A:()=>useSaveNotificationTemplate});var n=a(0xbad225b5),i=a(0x16cf1da63),l=a(0x4dfa0edd),r=a(0x62accd6b),o=a(0x1122238d8),s=a(0x75bda81e),c=a(0x226892387),d=a(0x1c8beab7f),u=a(0x10d5ee185);function useSaveNotificationTemplate(e,t){let a=(0,i.wA)(),m=(0,r.Ht)(e),p=(0,o.g1)(e),g=(0,l.Ay)(e,m,p),f=(0,c.d4)(e=>(0,d.DY)(e,p)),_=(0,c.d4)(d.rg),h=(0,c.d4)(d.RC);return(0,n.useCallback)(async({reason:e})=>{let n=g();if(!n)throw Error("Invalid workflow type. Missing payload.");f?await a((0,s.m)({workflowId:f,reason:e,payload:n})):await a((0,u._)({templateId:t,reason:e,payload:n,...p&&{salesforceOrgId:_},...!p&&h&&{salesforceOrgId:h}}))},[g,a,t,f,_,h,p])}},0x12e380801:(e,t,a)=>{"use strict";a.d(t,{d:()=>useStageForClosedSetUpRequired});var n=a(0x226892387),i=a(0x1c8beab7f);function useStageForClosedSetUpRequired(){let e=(0,n.d4)(i.i$),t=e?.field_mappings.find(e=>"stage"===e.target),a=t?.source.values?.stage_closed;return(e?.source.sfdc_object_identifier!=="Opportunity"||t?.source.sfdc_field_identifier!=="StageName")&&(!a||a?.length===0)}},0x1235cf4a4:(e,t,a)=>{"use strict";a.d(t,{A:()=>useValidatedDescription});var n=a(0xbad225b5),i=a(0x3ebf4390),l=a(0x1bc8d2ce4),r=a(0x62accd6b),o=a(0x91728dda),s=a(0x226892387),c=a(0x1c8beab7f);function useValidatedDescription(e,t=!1,a=!1){let d=(0,s.d4)(o.Jx),u=(0,s.d4)(o.V$),m=(0,r.Ht)(e),p=(0,s.d4)(c.RC),g=(0,s.d4)(c.Ey),f=(0,s.d4)(c.cc),_=(0,s.d4)(c.Kr),h=a?g?.name:f.find(e=>e.salesforce_org_id===p)?.name,b=(0,s.d4)(e=>a?(0,c.MH)(e):(0,c.gE)(e)),y=a?_?.find(e=>e.salesforce_org_id===b)?.name:f?.find(e=>e.salesforce_org_id===b)?.name,A=(0,s.d4)(a?c.Tt:c.rm),E=(0,l.Ay)(e,m,t,A?y:h);return(0,n.useMemo)(()=>(0,i.cB)(e,m,{experimentLobOrg62UnrestrictedGroupOn:d,experimentLobChannelAcnTokenGroupOn:u}).ok?E():null,[e,m,d,u,E])}},0x237e57f1d:(e,t,a)=>{"use strict";a.d(t,{K:()=>useAdvancedOptionsFieldData});var n=a(0xbad225b5),i=a(0x17b887603),l=a(0x1aa941557),r=a(0x205f4fb61),o=a(0x13d4e5f52),s=a(0x405dcae6),c=a(0x98161168),d=a(0x6f20b262),u=a(0x1122238d8),m=a(0x91728dda),p=a(0xe08dc76c),g=a(0x226892387);let f={[p.ig.ANY]:d.hu.TimePeriodToAnotherTriggerCondition,[p.ig.LATER]:d.hu.TimePeriodToFutureTriggerCondition,[p.ig.EARLIER]:d.hu.TimePeriodToEarlierTriggerCondition};function useAdvancedOptionsFieldData({opportunitySchema:e,isAllowedSchemaType:t=i.A,amount:a,stages:_,closeDateDirection:h,closeDatePeriod:b,isAdmin:y,isRecurring:A,workflowView:E,shouldDefaultToBlankOptions:S=!1}){let C=(0,g.d4)(m.sw),v=(0,n.useMemo)(()=>(e?.fields||[]).filter(({is_active:e,type:a})=>!1!==e&&!!s._h[a]&&t(a)),[e,t]),x=(0,n.useMemo)(()=>(0,l.A)(v,"id"),[v]),w=(0,o.q)("amount",e,y),O=(0,o.q)("close_date",e,y),k=(0,o.q)("stage",e,y);return{fieldOptions:(0,n.useMemo)(()=>{let e=[];return w&&e.push(w),O&&e.push(O),k&&e.push(k),(0,c.D0)(v,e)},[w,O,v,k]),fieldSchemaById:x,defaultCondition:(0,n.useMemo)(()=>{let e=(0,c.Gv)();if(!w||S)return[e];let t=A&&C?[]:[(0,c.kp)(w,{...(0,c.Gv)(),type:d.hu.GreaterThanTriggerCondition,schema_field_id:w.id,rhs:[{type:d.Yf.DoubleNumber,value:(0,u.Ro)(a),formattedValue:(0,r.ZV)((0,u.Ro)(a))}]})];return E&&A&&(0,u.Xk)(E)&&C&&t.unshift((0,c.kp)(w,{...(0,c.Gv)(),type:d.hu.GreaterThanTriggerCondition,schema_field_id:w.id,rhs:[{type:d.Yf.DoubleNumber,value:0,formattedValue:(0,r.ZV)(0)}]})),O&&h&&b&&t.unshift((0,c.kp)(O,{...(0,c.Gv)(),schema_field_id:O.id,type:f[h],rhs:[{type:d.Yf.TimePeriodChange,period:{type:b,num:1},direction:{type:h},operator:{type:p.Kr.AT_LEAST}}]})),_&&k&&t.unshift((0,c.kp)(k,{...(0,c.Gv)(),type:d.hu.EqualsTriggerCondition,schema_field_id:k.id,rhs:_.map(e=>({type:d.Yf.Select,value:e.value}))})),t},[a,w,h,b,O,S,_,k,A,E,C])}}},0x9a7ccd79:(e,t,a)=>{"use strict";a.d(t,{Cj:()=>getAdvancedOptionsOperatorLabels,Lb:()=>useAdvancedOptionsOperators,XG:()=>getAdvancedOptionsTemporalFrameLabels,Zs:()=>getAdvancedOptionsTemporalFrameValue,hn:()=>getAdvancedOptionsTimePeriodPeriodLabels});var n=a(0xbad225b5),i=a(0x17b887603),l=a(0x1595bdd0),r=a(0x20482ad21),o=a(0x6f20b262),s=a(0x1122238d8),c=a(0xe08dc76c),d=a(0x1d104c491);let u=new r.Ay("modernselling");function getAdvancedOptionsOperatorLabels(){return{[o.hu.ContainsTriggerCondition]:u.t("contains"),[o.hu.DoesNotContainTriggerCondition]:u.t("does not contain"),[o.hu.DoesNotEqualTriggerCondition]:u.t("does not equal"),[o.hu.EndsWithTriggerCondition]:u.t("ends with"),[o.hu.EqualsTriggerCondition]:u.t("is equal to"),[o.hu.GreaterThanTriggerCondition]:u.t("is greater than"),[o.hu.HasChangedTriggerCondition]:u.t("has changed"),[o.hu.HasDecreasedTriggerCondition]:u.t("has decreased"),[o.hu.HasIncreasedTriggerCondition]:u.t("has increased"),[o.hu.IsEmptyTriggerCondition]:u.t("is empty"),[o.hu.IsNotEmptyTriggerCondition]:u.t("is not empty"),[o.hu.LessThanTriggerCondition]:u.t("is less than"),[o.hu.SetContainsAllOfTriggerCondition]:u.t("contains all of"),[o.hu.SetContainsNoneOfTriggerCondition]:u.t("contains none of"),[o.hu.SetContainsOneOfTriggerCondition]:u.t("contains one of"),[o.hu.SetEqualsTriggerCondition]:u.t("is exactly all of"),[o.hu.SetNotEqualsTriggerCondition]:u.t("is not exactly all of"),[o.hu.StartsWithTriggerCondition]:u.t("starts with"),[o.hu.TimePeriodToAnotherTriggerCondition]:u.t("has changed to another"),[o.hu.TimePeriodToFutureTriggerCondition]:u.t("has changed to future"),[o.hu.TimePeriodToEarlierTriggerCondition]:u.t("has changed to earlier"),[o.hu.TimePeriodIsMoreThanTriggerCondition]:u.t("has changed at least by"),[o.hu.TimePeriodIsLessThanTriggerCondition]:u.t("has changed at most by"),[o.hu.TimePeriodIsEqualToTriggerCondition]:u.t("has changed by"),[o.hu.TimePeriodCurrentTriggerCondition]:u.t("is within"),[o.hu.TimePeriodBeforeTriggerCondition]:u.t("is before"),[o.hu.TimePeriodAfterTriggerCondition]:u.t("is after"),[o.hu.ContainsFilterCondition]:u.t("contains"),[o.hu.DoesNotContainFilterCondition]:u.t("does not contain"),[o.hu.DoesNotEqualFilterCondition]:u.t("does not equal"),[o.hu.EndsWithFilterCondition]:u.t("ends with"),[o.hu.EqualsFilterCondition]:u.t("is equal to"),[o.hu.GreaterThanFilterCondition]:u.t("is greater than"),[o.hu.IsEmptyFilterCondition]:u.t("is empty"),[o.hu.IsNotEmptyFilterCondition]:u.t("is not empty"),[o.hu.LessThanFilterCondition]:u.t("is less than"),[o.hu.SetEqualsFilterCondition]:u.t("is exactly all of"),[o.hu.SetNotEqualsFilterCondition]:u.t("is not exactly all of"),[o.hu.StartsWithFilterCondition]:u.t("starts with"),[o.hu.DateOffsetEqualsFilterCondition]:"",[o.hu.DateOffsetGreaterThanFilterCondition]:"",[o.hu.DateOffsetLessThanFilterCondition]:""}}function getAdvancedOptionsTemporalFrameValue(e,t){if(!t)return;let a=t.direction?.type,n=t.period?.num;switch(e){case o.hu.TimePeriodBeforeTriggerCondition:if(a===c.ig.EARLIER&&2===n)return c.kH.Previous;if(a===c.ig.EARLIER&&1===n)return c.kH.Current;if(a===c.ig.LATER&&0===n)return c.kH.Next;break;case o.hu.TimePeriodAfterTriggerCondition:if(a===c.ig.LATER&&0===n)return c.kH.Previous;if(a===c.ig.LATER&&1===n)return c.kH.Current;if(a===c.ig.LATER&&2===n)return c.kH.Next;break;case o.hu.TimePeriodCurrentTriggerCondition:if(a===c.ig.EARLIER&&1===n)return c.kH.Previous;if(a===c.ig.ANY&&0===n)return c.kH.Current;if(a===c.ig.LATER&&1===n)return c.kH.Next}}function getAdvancedOptionsTemporalFrameLabels(){return{[c.kH.Previous]:u.t("last"),[c.kH.Current]:u.t("this"),[c.kH.Next]:u.t("next")}}function getAdvancedOptionsTimePeriodPeriodLabels(e=!1){return e?{[c.ts.FISCAL_QUARTER]:u.t("fiscal quarters"),[c.ts.FISCAL_YEAR]:u.t("fiscal years"),[c.ts.DAYS]:u.t("days"),[c.ts.MONTHS]:u.t("months")}:{[c.ts.FISCAL_QUARTER]:u.t("fiscal quarter"),[c.ts.FISCAL_YEAR]:u.t("fiscal year"),[c.ts.DAYS]:u.t("day"),[c.ts.MONTHS]:u.t("month")}}function getTimePeriodOperatorList(e){return[{label:u.t("Value"),value:"",options:[{key:o.hu.TimePeriodBeforeTriggerCondition,value:o.hu.TimePeriodBeforeTriggerCondition,label:e[o.hu.TimePeriodBeforeTriggerCondition]},{key:o.hu.TimePeriodAfterTriggerCondition,value:o.hu.TimePeriodAfterTriggerCondition,label:e[o.hu.TimePeriodAfterTriggerCondition]},{key:o.hu.TimePeriodCurrentTriggerCondition,value:o.hu.TimePeriodCurrentTriggerCondition,label:e[o.hu.TimePeriodCurrentTriggerCondition]},{key:o.hu.IsEmptyTriggerCondition,value:o.hu.IsEmptyTriggerCondition,label:e[o.hu.IsEmptyTriggerCondition]},{key:o.hu.IsNotEmptyTriggerCondition,value:o.hu.IsNotEmptyTriggerCondition,label:e[o.hu.IsNotEmptyTriggerCondition]}]},{label:u.t("Change"),value:"",options:[{key:o.hu.HasChangedTriggerCondition,value:o.hu.HasChangedTriggerCondition,label:e[o.hu.HasChangedTriggerCondition]},{key:o.hu.TimePeriodToAnotherTriggerCondition,value:o.hu.TimePeriodToAnotherTriggerCondition,label:e[o.hu.TimePeriodToAnotherTriggerCondition]},{key:o.hu.TimePeriodToFutureTriggerCondition,value:o.hu.TimePeriodToFutureTriggerCondition,label:e[o.hu.TimePeriodToFutureTriggerCondition]},{key:o.hu.TimePeriodToEarlierTriggerCondition,value:o.hu.TimePeriodToEarlierTriggerCondition,label:e[o.hu.TimePeriodToEarlierTriggerCondition]},{key:o.hu.TimePeriodIsMoreThanTriggerCondition,value:o.hu.TimePeriodIsMoreThanTriggerCondition,label:e[o.hu.TimePeriodIsMoreThanTriggerCondition]}]}]}function getAmountOperatorList(e){return[{label:u.t("Value"),value:"",options:[{key:o.hu.GreaterThanTriggerCondition,value:o.hu.GreaterThanTriggerCondition,label:e[o.hu.GreaterThanTriggerCondition]},{key:o.hu.LessThanTriggerCondition,value:o.hu.LessThanTriggerCondition,label:e[o.hu.LessThanTriggerCondition]},{key:o.hu.EqualsTriggerCondition,value:o.hu.EqualsTriggerCondition,label:e[o.hu.EqualsTriggerCondition]},{key:o.hu.DoesNotEqualTriggerCondition,value:o.hu.DoesNotEqualTriggerCondition,label:e[o.hu.DoesNotEqualTriggerCondition]},{key:o.hu.IsEmptyTriggerCondition,value:o.hu.IsEmptyTriggerCondition,label:e[o.hu.IsEmptyTriggerCondition]},{key:o.hu.IsNotEmptyTriggerCondition,value:o.hu.IsNotEmptyTriggerCondition,label:e[o.hu.IsNotEmptyTriggerCondition]}]},{label:u.t("Change"),value:"",options:[{key:o.hu.HasChangedTriggerCondition,value:o.hu.HasChangedTriggerCondition,label:e[o.hu.HasChangedTriggerCondition]},{key:o.hu.HasIncreasedTriggerCondition,value:o.hu.HasIncreasedTriggerCondition,label:e[o.hu.HasIncreasedTriggerCondition]},{key:o.hu.HasDecreasedTriggerCondition,value:o.hu.HasDecreasedTriggerCondition,label:e[o.hu.HasDecreasedTriggerCondition]}]}]}function useAdvancedOptionsOperators(e,t,a=i.A,r=!1){let o=(0,n.useMemo)(()=>Object.keys(t||{}).filter(a),[a,t]),c=(0,n.useMemo)(()=>getAdvancedOptionsOperatorLabels(),[]);return(0,n.useMemo)(()=>{if(e===d.gI.DateSchemaField&&!r){let e=getTimePeriodOperatorList(c);return[o.join("-"),e]}if(e===d.gI.CurrencySchemaField&&!r)return[o.join("-"),getAmountOperatorList(c)];let t=(0,l.A)(o.map(e=>{let t=c[e];return t?{key:e,value:e,label:t}:null}));return[o.join("-"),t.sort(s.JC)]},[e,o,c,r])}},0x13d4e5f52:(e,t,a)=>{"use strict";a.d(t,{q:()=>useOpportunitySchemaField});var n=a(0xbad225b5),i=a(0x200c38ed8);function useOpportunitySchemaField(e,t,a){let l=(0,i.aV)(),r=(0,i.jv)(),o=a?l:r;return(0,n.useMemo)(()=>{if(!o||!e||!t)return null;let a=o.field_mappings?.find(t=>t.target===e),n=a?.source?.troops_schema_field_id;return n?t?.fields?.find?.(e=>e?.id===n)??null:null},[e,t,o])}},0x3bf6c48:(e,t,a)=>{"use strict";a.d(t,{hz:()=>useFetchListViewSfdcObjects,E:()=>useFetchOpportunitySchema,b1:()=>useFetchWithLoadStateOnMount});var n=a(0xbad225b5),i=a(0x16cf1da63),l=a(0x1d01572a2),r=a(0xe874a88a),o=a(0x3c7fcc66),s=a(0x133aee58f),c=a(0x200c38ed8),d=a(0x226892387),u=a(0x1c8beab7f),m=a(0x1216bc813),p=a(0x22a29f141),g=a(0x1dfdeb1c8),f=a(0x1ec68d6a3),_=a(0xe747dd27);let h=(0,g.A)("sfdc.getListViews generated fetcher",(e,t,a)=>new r.S((n,i)=>{let{abortSignal:l,reason:r,...o}=a,s=(0,_.VA)(o);e((0,p.apiCall)({method:"sfdc.getListViews",args:s,abortSignal:l,reason:r})).then(e=>{n(e)}).catch(e=>{(0,f.Ay)({getState:t}).error(`API call to sfdc.getListViews with reason ${r} failed, initiated by generated fetcher`),i(e)})}));h.meta={name:"sfdcGetListViewsFetcher",key:"createFetcherSfdcGetListViewsFetcher",description:"sfdc.getListViews generated fetcher"};var b=a(0x231dcfd36);let y=(0,a(0x11c82607b).Ay)("Fetches a set of SFDC objects related to a list view, given a list view label",async(e,t,{sobjectApiName:a,listViewLabel:n,sortByColumnKey:i,salesforceOrgId:l,asIntegrationUser:r})=>{try{let t=await e(h({sobjectApiName:a,reason:"modern-selling",...l&&{salesforceOrgId:l},asIntegrationUser:r})),o=t?.listviews?.find?.(e=>e?.label===n)?.id??null;if(!o)return null;let{objects:s}=await e((0,b.a)({reason:"modern-selling",listviewId:o,sortByColumnKey:i,...l&&{salesforceOrgId:l},asIntegrationUser:r}));return s||null}catch{return null}});function useFetchListViewSfdcObjects({isAdmin:e}={}){let t=(0,i.wA)(),a=(0,s.A)(e);return(0,n.useCallback)(async(n,i,l)=>t(y({sobjectApiName:n,listViewLabel:i,sortByColumnKey:l,salesforceOrgId:a,asIntegrationUser:e})),[t,a,e])}function useFetchOpportunitySchema({isAdmin:e}={}){let t=(0,i.wA)(),a=(0,c.aV)(),l=(0,c.jv)(),r=(e?a:l)?.source.troops_schema_object_id,s=(0,o.iZ)(),p=(0,o.Se)(),g=e?s:p,f=(0,o.UE)(),_=(0,o.mi)(),h=e?f:_,b=(0,d.d4)(u.UU);return(0,n.useCallback)(async()=>{try{if(b||!r)return null;return await t((0,m.g)({objectId:r,...g?{datasourceId:g}:void 0,salesforceOrgId:h??""}))}catch{return null}},[b,r,t,g,h])}function useFetchWithLoadStateOnMount(e){let t=(0,n.useRef)(e),[a,i]=(0,n.useState)(()=>({error:null,payload:null,isLoading:!0}));(0,n.useEffect)(()=>{t.current=e});let o=(0,n.useCallback)(()=>{r.S.resolve().then(t.current).then(e=>i({error:null,payload:e,isLoading:!1})).catch(e=>i({error:e,payload:null,isLoading:!1}))},[]),s=(0,n.useCallback)(()=>{i(e=>({...e,error:null,isLoading:!0})),o()},[o]);return(0,l.A)(()=>o()),(0,n.useMemo)(()=>({...a,retry:s}),[a,s])}y.meta={name:"fetchSfdcObjectsForListView",key:"createThunkFetchSfdcObjectsForListView",description:"Fetches a set of SFDC objects related to a list view, given a list view label"}},0x2b3a07cf:(e,t,a)=>{"use strict";a.d(t,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var n=a(0xbad225b5),i=a(0xb77a689a),l=a(0xf4930165),r=a(0xca924ee1),o=a(0x1d01572a2),s=a(0x3ebf4390),c=a(0x62accd6b),d=a(0x91728dda),u=a(0x226892387);function getMaybeDefaultedValue(e,t){return(0,i.A)(t)&&""===t.trim()?e:t}let __WEBPACK_DEFAULT_EXPORT__=function({workflowView:e,initialValues:t}){let[a,i]=(0,n.useState)(t),m=(0,n.useRef)(t),p=(0,n.useRef)(t),g=(0,c.sn)(e),f=(0,c.kR)(e),_=(0,c.HC)(e),h=(0,u.d4)(d.Jx),b=(0,u.d4)(d.V$);(0,o.A)(()=>{f({values:t,errors:(0,l.A)(t,()=>s.Un),formSubmitError:null})});let y=(0,n.useCallback)((e,t)=>i(a=>{let n=a[e]===t?a:{...a,[e]:t};return p.current=n,n}),[]),A=(0,n.useMemo)(()=>(0,r.A)(e=>t=>_({errors:{[e]:t}})),[_]),E=(0,n.useMemo)(()=>(0,r.A)((e,t=!0)=>a=>{y(e,a);let n={values:{[e]:a}};t&&(n.errors={[e]:s.Un}),_(n)}),[y,_]),S=(0,n.useMemo)(()=>(0,r.A)(t=>a=>{let n=a?.target&&"value"in a.target?getMaybeDefaultedValue(m.current?.[t],a?.target?.value):p.current[t],i=(0,s.g7)(e,t,n,p.current,{experimentLobOrg62UnrestrictedGroupOn:h,experimentLobChannelAcnTokenGroupOn:b}),l={errors:{[t]:i}};n!==p.current[t]&&(l.values={[t]:n}),y(t,n),_(l)}),[e,h,b,y,_]);return(0,n.useMemo)(()=>({values:a,errors:g||{},handleBlur:S,handleChange:E,setFieldErrors:A}),[a,g,S,E,A])}},0x62accd6b:(e,t,a)=>{"use strict";a.d(t,{HC:()=>useUpdateWorkflowFormState,Ht:()=>useWorkflowFormValues,kR:()=>useSetWorkflowFormState,sn:()=>useWorkflowFormErrors});var n=a(0xbad225b5),i=a(0x16cf1da63),l=a(0x226892387),r=a(0x16b708a7f),o=a(0x1c8beab7f);function useWorkflowFormValues(e){return(0,l.wz)(t=>e?(0,o.C1)(t,e):null)}function useWorkflowFormErrors(e){return(0,l.rY)(t=>e?(0,o.dl)(t,e):null)}function useSetWorkflowFormState(e){let t=(0,i.wA)();return(0,n.useCallback)(a=>{t((0,r.a2)({...a,workflowView:e}))},[t,e])}function useUpdateWorkflowFormState(e){let t=(0,i.wA)();return(0,n.useCallback)(a=>{t((0,r.jK)({workflowView:e,...a}))},[t,e])}},0x1ce916d0b:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});var n=a(0xbad225b5),i=a(0x20482ad21),l=a(0x348940af);let r=new i.Ay("modernselling"),SelectNotificationTypeHeader=({isAdmin:e=!1})=>{let t=e?r.t("Admin-created notifications"):r.t("Your active notifications");return n.createElement(l.A,{isAdmin:e,title:t})};SelectNotificationTypeHeader.displayName="SelectNotificationTypeHeader";let o=SelectNotificationTypeHeader},0x198f5e201:(e,t,a)=>{"use strict";a.d(t,{A:()=>C});var n=a(0xbad225b5),i=a(0x16cf1da63),l=a(0x20482ad21),r=a(0x1ea519746),o=a(0x11a296110),s=a(0x1aa0ab2cd),c=a(0x20e80190e),d=a(0x1fcbb004d);let u=new l.Ay("modernselling"),AdminSetupRequiredModal=()=>{let e=(0,i.wA)(),t=(0,n.useCallback)(()=>{e((0,d.O)())},[e]),a=(0,s.i)();return n.createElement(c.dW,{closeModal:t},n.createElement(c.rQ,null,n.createElement(c.Rc,{title:u.t("Admin setup required")})),n.createElement(c.$m,null,n.createElement(c.qf,null,n.createElement("p",null,u.t("Looks like you are using custom objects. To create this notification, please add additional stage values to ensure notifications will send as expected")))),n.createElement(c.jl,null,n.createElement(c.ox,null,n.createElement(o.Ay,{onClick:t,type:"outline"},u.t("Later")),n.createElement(o.Ay,{onClick:a,type:"primary","aria-label":u.t("Set Up")},u.t("Set Up")))))};AdminSetupRequiredModal.displayName="AdminSetupRequiredModal";var m=a(0x46dbff89);function useOpenAdminSetupRequiredModal(){let e=(0,i.wA)();return(0,n.useCallback)(()=>{e((0,m.q)({element:n.createElement(AdminSetupRequiredModal,null)}))},[e])}useOpenAdminSetupRequiredModal.displayName="useOpenAdminSetupRequiredModal";var p=a(0x12e380801),g=a(0x2501a2cee);let f=new l.Ay("modernselling"),SelectNotificationTypeButton=({imageUrl:e,title:t,details:a,onClick:i,addBadge:l=!1,requiresSetUp:r=!1})=>n.createElement(o.Nm,{className:"p-sales_notifications__select_notification_type_button",onClick:i},n.createElement("div",{className:"display_flex align_items_center"},n.createElement("img",{className:"p-sales_notifications__select_notification_type_button__image",src:e,alt:t}),n.createElement("div",{className:"p-sales_notifications__select_notification_type_button__main"},n.createElement("div",{className:"p-sales_notifications__select_notification_type_button__title"},t,n.createElement(g.Ah,{name:"caret-right",size:"20"})),n.createElement("div",{className:"p-sales_notifications__select_notification_type_button__details"},a))),l&&n.createElement("div",{className:"p-sales_notifications__select_notification_type_button_badge"},"Most popular"),r&&n.createElement("div",{className:"p-sales_notifications__select_notification_type_button_badge_admin_setup_required"},f.t("Admin setup required")));SelectNotificationTypeButton.displayName="SelectNotificationTypeButton";var _=a(0x16b708a7f),h=a(0x1d104c491);let b=a.p+"bubble-2a91bf6.svg",y=a.p+"clipboard-f9ce38b.svg",A=a.p+"megaphone-32a566a.svg";var E=a(0x86226b0b);let S=new l.Ay("modernselling"),SelectNotificationTypePage=({isAdmin:e=!1})=>{let t=(0,i.wA)(),a=(0,n.useCallback)(()=>{t((0,d.O)())},[t]),l=(0,n.useCallback)(n=>()=>{e?t((0,_.kC)({workflowView:n})):t((0,_.yK)({workflowView:n})),a()},[t,a,e]),o=e?h.Lb.adminForecastReminder:h.Lb.userForecastReminder,s=e?h.Lb.adminNewOpportunityAlert:h.Lb.userNewOpportunityAlert,c=e?h.Lb.adminAmountChanged:h.Lb.userAmountChanged,u=e?h.Lb.adminStageChanged:h.Lb.userStageChanged,m=e?h.Lb.adminCloseDateChanged:h.Lb.userCloseDateChanged,g=e?h.Lb.adminDealWon:h.Lb.userDealWon,f=(0,r.Z)(),C=useOpenAdminSetupRequiredModal(),v=(0,p.d)();return n.createElement("div",{className:"p-sales_notifications__select_notification_type__container"},n.createElement("div",{className:"p-sales_notifications__select_notification_type__container_inner"},n.createElement("div",{className:"p-sales_notifications__select_notification_type__title"},e&&S.t("Empower your team with sales insights and reminders"),!e&&S.t("Choose a template to get started")),n.createElement("div",{className:"p-sales_notifications__select_notification_type__section"},n.createElement("div",{className:"p-sales_notifications__select_notification_type__section_header"},n.createElement("div",null,n.createElement("div",{className:"p-sales_notifications__select_notification_type__section_title"},S.t("Stay informed about opportunity updates")),n.createElement("div",null,S.t("Automatically send alerts for more visibility with less overhead."))),n.createElement("img",{src:A,alt:""})),n.createElement(SelectNotificationTypeButton,{imageUrl:f(s),title:S.t("New opportunity"),details:S.t("Find out when new opportunities are added"),onClick:l(s),addBadge:!0}),n.createElement(SelectNotificationTypeButton,{imageUrl:f(c),title:S.t("Amount changed"),details:S.t("Get alerts when opportunity amounts change"),onClick:l(c)}),n.createElement(SelectNotificationTypeButton,{imageUrl:f(u),title:S.t("Stage changed"),details:S.t("Follow opportunities through the sales cycle"),onClick:l(u)}),n.createElement(SelectNotificationTypeButton,{imageUrl:f(m),title:S.t("Close date changed"),details:S.t("Keep an eye on opportunity close dates"),onClick:l(m)}),e&&n.createElement(SelectNotificationTypeButton,{imageUrl:f(g),title:S.t("Deal won",{fallbackHash:"02206b1aab8ed8b501ead50432dc8f091e382018"}),details:S.t("Make time to celebrate with your team"),onClick:l(g)})),n.createElement("div",{className:"p-sales_notifications__select_notification_type__section"},n.createElement("div",{className:"p-sales_notifications__select_notification_type__section_header"},n.createElement("div",null,n.createElement("div",{className:"p-sales_notifications__select_notification_type__section_title"},e&&S.t("Keep deals on track"),!e&&S.t("Build a winning sales culture")),n.createElement("div",null,e&&S.t("Send scheduled reminders to make sure opportunity details are accurate."),!e&&S.t("Healthy team habits start with updating forecasts and end with celebration."))),n.createElement("img",{src:e?y:b,alt:""})),!e&&n.createElement(SelectNotificationTypeButton,{imageUrl:f(g),title:S.t("Deal won"),details:S.t("Make time to celebrate with your team"),onClick:l(e?h.Lb.adminDealWon:h.Lb.userDealWon)}),n.createElement(SelectNotificationTypeButton,{imageUrl:f(o),title:S.t("Update opportunities"),details:S.t("Send a regular nudge to keep opportunity details up to date"),onClick:l(o)}),e&&n.createElement(n.Fragment,null,n.createElement(SelectNotificationTypeButton,{title:S.t("Review opportunities with out-of-date info"),details:S.t("Clean up opportunity details"),imageUrl:E,onClick:v?C:l(h.YB.adminOutdatedFields),requiresSetUp:v}),n.createElement(SelectNotificationTypeButton,{imageUrl:f(h.Lb.adminMissingFields),title:S.t("Add missing details"),details:S.t("Make sure key information is captured for every opportunity"),onClick:v?C:l(h.Lb.adminMissingFields),requiresSetUp:v}),n.createElement(SelectNotificationTypeButton,{imageUrl:f(h.Lb.adminClosingSoonAlert),title:S.t("Check upcoming close dates"),details:S.t("Make sure deals stay on track"),onClick:v?C:l(h.Lb.adminClosingSoonAlert),requiresSetUp:v}),n.createElement(SelectNotificationTypeButton,{imageUrl:f(h.Lb.adminPastCloseDateAlert),title:S.t("Review opportunities with past close dates"),details:S.t("Regain momentum on open opportunities"),onClick:v?C:l(h.Lb.adminPastCloseDateAlert),requiresSetUp:v}))),n.createElement("div",{className:"sk_foreground_high align_center"},S.t("Keep an eye on this space, we\u2019ll be adding more templates soon!"))))};SelectNotificationTypePage.displayName="SelectNotificationTypePage";let C=SelectNotificationTypePage},0x155f83bf4:(e,t,a)=>{"use strict";a.d(t,{m:()=>BooleanSchemaInput});var n=a(0xbad225b5),i=a(0x20482ad21),l=a(0x15014e268),r=a(0x6f20b262);let o=new i.Ay("modernselling"),BooleanSchemaInput=({fieldSchema:e,operator:t,onBlur:a,onChange:i,value:s,error:c})=>{let d=(0,n.useMemo)(()=>c&&[c],[c]),u=(0,n.useMemo)(()=>[{value:!0,label:o.t("True")},{value:!1,label:o.t("False")}],[]),m=(0,n.useCallback)(e=>i([{type:r.Yf.BooleanValue,value:e.value}]),[i]);return n.createElement(l.Ay,{className:"full_width",key:`${e.id}-${t}`,ariaLabel:o.t("Value for {name}",{name:e.label}),errors:d,isInvalid:!!d,isRequired:!0,onOptionsListClose:a,onOptionSelected:m,options:u,placeholderText:o.t("Select a value\u2026"),selectedOption:u.find(e=>s.rhs?.[0]?.value===e.value),selectId:s.id,width:"100%"})};BooleanSchemaInput.displayName="BooleanSchemaInput"},0x2080006ef:(e,t,a)=>{"use strict";a.d(t,{W:()=>p,v:()=>m});var n=a(0xbad225b5),i=a(0x1d01572a2),l=a(0x20482ad21),r=a(0x205f4fb61),o=a(0x126f22530),s=a(0x1e586fbba),c=a(0x6f20b262),d=a(0x1122238d8);let u=new l.Ay("modernselling");function asNumericSchemaInput({type:e,getNumericValue:t,formatOptions:a}){return function({fieldSchema:l,onChange:c,error:d,value:m}){let p=(0,n.useCallback)(()=>{let n=t(+(m.rhs?.[0]?.value||0));c([{type:e,value:n,formattedValue:(0,r.Ay)(n,a)}])},[c,m.rhs]),g=(0,n.useCallback)(a=>{c([{type:e,value:t(a),formattedValue:a}])},[c]);return(0,i.A)(()=>{m.rhs?.[0]&&p()}),n.createElement("div",{className:"full_width"},n.createElement(o.A,{id:m.id,name:m.id,"aria-label":u.t("Value for {name}",{name:l.label}),onBlur:p,onChange:g,isInvalid:!!d,placeholder:u.t("Enter a value\u2026"),value:m.rhs?.[0]?.formattedValue}),d&&n.createElement(s.A,null,d.message))}}asNumericSchemaInput.displayName="asNumericSchemaInput";let m=asNumericSchemaInput({type:c.Yf.DoubleNumber,getNumericValue:e=>(0,d.Ro)(e,!0),formatOptions:{minimumFractionDigits:0,maximumFractionDigits:9}}),p=asNumericSchemaInput({type:c.Yf.LongInt,getNumericValue:e=>(0,d.Ro)(e,!1)})},0x200abc41e:(e,t,a)=>{"use strict";a.d(t,{_:()=>ReferenceFieldSchemaInputMulti});var n=a(0xbad225b5),i=a(0x1595bdd0),l=a(0x1407c6c2c),r=a(0x20482ad21),o=a(0x16cf1da63),s=a(0xe874a88a),c=a(0x3c7fcc66),d=a(0x1122238d8),u=a(0x28d59ea1);function toSchemaObject(e){if(!e.schema_object_id||!e.schema_object_label)return null;let t=(e.records||[]).map(e=>({key:e.identifier,value:e.identifier,label:e.name})).sort(d.JC);return{key:`${e.schema_object_id}`,value:e.schema_object_label,label:e.schema_object_label,options:t}}function useFieldReferencesSearch({id:e,schema_object_id:t}={},a){let l=(0,o.wA)(),r=(0,c.iZ)(),m=(0,c.Se)(),p=a?r:m;return(0,n.useCallback)((n="")=>{let r=n&&n.length>=3;return p&&e&&t&&r?l((0,u.J)({query:n,datasourceId:p,fieldId:e,reason:"modern-selling",schemaObjectId:t,asIntegrationUser:a})).then(({results:e})=>(0,i.A)(e?.flatMap(toSchemaObject)).sort(d.JC)):s.S.resolve([])},[p,l,e,t,a])}var m=a(0x6f20b262),p=a(0x18a03595d),g=a(0x4a120eb2);a(0xa9a7442);let f=new r.Ay("modern_selling");function getEmptyStateMessage(e){return(e?.length||0){let c=(0,n.useMemo)(()=>o&&[o],[o]),u=useFieldReferencesSearch(e,s),_=(0,l.A)(),h=(0,n.useCallback)(e=>getEmptyStateMessage(e),[]),b=(0,n.useCallback)(e=>{a(e.map(({label:e,value:t})=>({type:m.Yf.ReferenceValue,label:`${e}`,identifier:t})))},[a]),y=(0,n.useMemo)(()=>(0,i.A)(r?.rhs?.map(d.AS)),[r?.rhs]);return n.createElement(g.x,{ariaLabel:f.t("Values for {name}",{name:e.label}),className:"full_width",classPrefix:"p-sales_notifications__workflow__form__field__advanced_options__select",debounceWaitPeriod:p.Vp,disableSearchOnMount:!0,emptyStateMessage:h,errors:c,isInvalid:!!c?.length,isRequired:!0,minOptionsListWidth:350,onBlur:t,onSelectedItemsChange:b,placeholderText:f.t("Search\u2026"),search:u,selectedOptions:y,selectId:_,width:"100%"})};ReferenceFieldSchemaInputMulti.displayName="ReferenceFieldSchemaInputMulti"},0x423b2bde:(e,t,a)=>{"use strict";a.d(t,{a:()=>SelectSchemaInput,j:()=>MultiSelectSchemaInput});var n=a(0xbad225b5),i=a(0x1595bdd0),l=a(0x1407c6c2c),r=a(0x20482ad21),o=a(0xa7ec93c2),s=a(0x1d1911997),c=a(0x6f20b262),d=a(0x1122238d8);let u=new r.Ay("modernselling"),SelectSchemaInput=({error:e,fieldSchema:t,onBlur:a,onChange:i,value:r,operator:o})=>{let m=(0,l.A)(),p=(0,n.useMemo)(()=>e&&[e],[e]),g=(0,n.useMemo)(()=>(0,d.I_)(t),[t]),f=(0,n.useCallback)(e=>i([{type:c.Yf.Select,value:e.value}]),[i]);return n.createElement(s.Ay,{key:`${t.id}-${o}`,ariaLabel:u.t("Value for {name}",{name:t.label}),minOptionsListWidth:200,errors:p,isRequired:!0,onBlur:a,onOptionSelected:f,options:g,placeholderText:u.t("Select a value\u2026"),selectedOption:g?.find(e=>e.value===r.rhs?.[0]?.value),selectId:m})};SelectSchemaInput.displayName="SelectSchemaInput";let MultiSelectSchemaInput=({error:e,fieldSchema:t,onBlur:a,onChange:r,value:s})=>{let m=(0,l.A)(),p=(0,n.useMemo)(()=>e&&[e],[e]),g=(0,n.useMemo)(()=>(0,d.I_)(t),[t]),f=(0,n.useCallback)(e=>{r(e.map(e=>({type:c.Yf.Select,value:e.value})))},[r]),[_,h]=(0,n.useMemo)(()=>{let e=(0,i.A)(g?.filter(e=>s?.rhs?.find(t=>e.value===t.value)));return[e.map(e=>e.label).join("-"),e]},[s?.rhs,g]);return n.createElement(o.Ay,{className:"full_width",key:_,ariaLabel:u.t("Values for {name}",{name:t.label}),disableIdParsing:!0,errors:p,expandOnFocus:!0,isInvalid:!!p?.length,isRequired:!0,onBlur:a,onSelectedItemsChange:f,options:g,placeholderText:u.t("Select a value\u2026"),selectedOptions:h,selectId:m,shouldAllowUnselectInMultiSelectMode:!0,width:"100%"})};MultiSelectSchemaInput.displayName="MultiSelectSchemaInput"},0x1450587d7:(e,t,a)=>{"use strict";a.d(t,{IW:()=>_,jq:()=>f,sq:()=>g});var n=a(0xbad225b5),i=a(0x120c268ad),l=a.n(i),r=a(0x854f5389),o=a(0x1d01572a2),s=a(0x20482ad21),c=a(0x205f4fb61),d=a(0x6f20b262),u=a(0x1122238d8),m=a(0xb214261e);let p=new s.Ay("modernselling");function tokenize(e){return(e.rhs||[]).filter(e=>e.value||0===e.value).map(e=>`${e.formattedValue??e.value}`)}function getTokenizedInput({inputValueType:e,formatRawValue:t=r.A,formatDisplayValue:a=r.A}){return function({error:i,fieldSchema:r,onBlur:s,onChange:c,value:d}){let u=(0,n.useMemo)(()=>tokenize(d),[d]),[g,f]=(0,n.useState)(""),_=(0,n.useCallback)(n=>{c(n.map(n=>({type:e,value:t(n),formattedValue:a(n)})))},[c]),h=(0,n.useCallback)((e,t,a)=>{_(e),f(t),a&&s?.()},[s,_]);(0,o.A)(()=>{u.length&&_(u)});let b=i?.message?"p-sales_notifications__workflow__form__advanced_options__field__input__tokenized--invalid":void 0;return n.createElement(m.G,{className:l()("full_width",b),ariaLabel:p.t("Values for {name}",{name:r.label}),errorMessage:i?.message,isInvalid:!!i,onBlur:s,onChange:h,tokenizedItems:u,tokenizeOnBlur:!0,placeholderText:p.t("Enter a value\u2026"),untokenizedText:g})}}getTokenizedInput.displayName="getTokenizedInput";let g=getTokenizedInput({inputValueType:d.Yf.StringValue}),f=getTokenizedInput({inputValueType:d.Yf.LongInt,formatRawValue:u.Ro,formatDisplayValue:e=>(0,c.Ay)((0,u.Ro)(e))}),_=getTokenizedInput({inputValueType:d.Yf.DoubleNumber,formatRawValue:e=>(0,u.Ro)(e,!0),formatDisplayValue:e=>(0,c.Ay)((0,u.Ro)(e,!0),{minimumFractionDigits:0,maximumFractionDigits:9})})},0x405dcae6:(e,t,a)=>{"use strict";a.d(t,{_h:()=>L,Xp:()=>O,K5:()=>validateAdvancedCondition});var n=a(0x20482ad21),i=a(0x155f83bf4),l=a(0x2080006ef),r=a(0x200abc41e),o=a(0x423b2bde),s=a(0xbad225b5),c=a(0x120c268ad),d=a.n(c),u=a(0x1db69cda),m=a(0xc6a2c86f),p=a(0x126f22530),g=a(0x9a7ccd79),f=a(0x6f20b262),_=a(0xd7a36639),h=a(0x26f5f245),b=a(0x1122238d8),y=a(0xe08dc76c);let A=new Set([f.hu.TimePeriodIsMoreThanTriggerCondition,f.hu.TimePeriodIsLessThanTriggerCondition,f.hu.TimePeriodIsEqualToTriggerCondition]),E=new Set([f.hu.TimePeriodBeforeTriggerCondition,f.hu.TimePeriodAfterTriggerCondition,f.hu.TimePeriodCurrentTriggerCondition]),S=new Set([y.ts.MONTHS,y.ts.FISCAL_QUARTER,y.ts.FISCAL_YEAR]),C=new Set([y.ts.DAYS,y.ts.MONTHS,y.ts.FISCAL_QUARTER,y.ts.FISCAL_YEAR]);function getTimePeriodRhs(e,t,a=!1){let n=(0,u.A)(t);if(n?.direction&&n?.period&&n?.operator&&n.type===f.Yf.TimePeriodChange)switch(e){case f.hu.TimePeriodToAnotherTriggerCondition:n.direction.type=y.ig.ANY,n.operator.type=y.Kr.AT_LEAST,n.period.num=1;break;case f.hu.TimePeriodToFutureTriggerCondition:n.direction.type=y.ig.LATER,n.operator.type=y.Kr.AT_LEAST,n.period.num=1;break;case f.hu.TimePeriodToEarlierTriggerCondition:n.direction.type=y.ig.EARLIER,n.operator.type=y.Kr.AT_LEAST,n.period.num=1;break;case f.hu.TimePeriodIsMoreThanTriggerCondition:n.direction.type=y.ig.ANY,n.operator.type=y.Kr.AT_LEAST;break;case f.hu.TimePeriodIsLessThanTriggerCondition:n.direction.type=y.ig.ANY,n.operator.type=y.Kr.AT_MOST;break;case f.hu.TimePeriodIsEqualToTriggerCondition:n.direction.type=y.ig.ANY,n.operator.type=y.Kr.EXACT;break;case f.hu.TimePeriodBeforeTriggerCondition:a||(n.direction.type=y.ig.EARLIER,n.operator.type=y.Kr.AT_LEAST,n.period.num=1);break;case f.hu.TimePeriodAfterTriggerCondition:a||(n.direction.type=y.ig.LATER,n.operator.type=y.Kr.AT_LEAST,n.period.num=1);break;case f.hu.TimePeriodCurrentTriggerCondition:a||(n.direction.type=y.ig.ANY,n.operator.type=y.Kr.EXACT,n.period.num=0)}return n}let TimePeriodChangeSchemaInput=({error:e,onBlur:t,onChange:a,value:n,operator:i})=>{let l=(0,s.useMemo)(()=>e&&[e],[e]),r=(0,m.A)(i),[o,c]=(0,s.useState)({type:f.Yf.TimePeriodChange,period:{type:y.ts.FISCAL_QUARTER,num:1},direction:{type:y.ig.ANY},operator:{type:y.Kr.AT_LEAST}}),v=A.has(i),x=E.has(i),w=(0,s.useCallback)(e=>a([e]),[a]);(0,s.useEffect)(()=>{if(i===r)return;let e=!!(i&&!r),t=getTimePeriodRhs(i,n.rhs?.[0]||o,e);c(t),w(t)},[n,i,r,o,w]);let O=(0,s.useCallback)(e=>{let t=(0,u.A)(o);t.period&&(t.period.type=e),c(t),w(t)},[o,w]),k=(0,s.useCallback)(e=>{let t=(0,u.A)(o);t.period&&(t.period.num=e),c(t),w(t)},[o,w]),N=(0,s.useCallback)(()=>{let e=(0,u.A)(o);if(e.period){let t=(0,b.Ro)(e.period.num,!1);e.period.num=Math.min(Math.max(t,1),365)}c(e),w(e)},[o,w]),T=(0,s.useCallback)(e=>{let t=(0,u.A)(o);if(t.period)switch(i){case f.hu.TimePeriodBeforeTriggerCondition:e===y.kH.Previous?(t.operator={type:y.Kr.AT_LEAST},t.direction={type:y.ig.EARLIER},t.period.num=2):e===y.kH.Current?(t.operator={type:y.Kr.AT_LEAST},t.direction={type:y.ig.EARLIER},t.period.num=1):e===y.kH.Next&&(t.operator={type:y.Kr.AT_MOST},t.direction={type:y.ig.LATER},t.period.num=0);break;case f.hu.TimePeriodAfterTriggerCondition:t.operator={type:y.Kr.AT_LEAST},t.direction={type:y.ig.LATER},e===y.kH.Previous?t.period.num=0:e===y.kH.Current?t.period.num=1:e===y.kH.Next&&(t.period.num=2);break;case f.hu.TimePeriodCurrentTriggerCondition:t.operator={type:y.Kr.EXACT},e===y.kH.Previous?(t.direction={type:y.ig.EARLIER},t.period.num=1):e===y.kH.Current?(t.direction={type:y.ig.ANY},t.period.num=0):e===y.kH.Next&&(t.direction={type:y.ig.LATER},t.period.num=1)}c(t),w(t)},[w,i,o]);return s.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field__row"},v&&s.createElement(p.A,{className:"p-sales_notifications__workflow__form__advanced_options__field__input__fixed",id:n.id,type:"number",name:n.id,onBlur:N,onChange:k,isInvalid:!!e,value:o.period?.num,min:1,max:365}),x&&s.createElement(_.A,{onChange:T,temporalFrame:(0,g.Zs)(i,o)}),s.createElement(h.A,{className:d()(x&&"p-sales_notifications__workflow__form__advanced_options__field__input__fixed"),timePeriods:x?S:C,errors:l,selectedTimePeriod:o.period?.type,onChange:O,onBlur:t,periodNum:x?1:o.period?.num}))};TimePeriodChangeSchemaInput.displayName="TimePeriodChangeSchemaInput";var v=a(0x1450587d7),x=a(0x1d104c491);let w=new n.Ay("modernselling"),Null=()=>null,O=new Set([f.hu.HasChangedTriggerCondition,f.hu.HasDecreasedTriggerCondition,f.hu.HasIncreasedTriggerCondition,f.hu.IsEmptyTriggerCondition,f.hu.IsNotEmptyTriggerCondition,f.hu.IsEmptyFilterCondition,f.hu.IsNotEmptyFilterCondition]),k={[f.hu.HasChangedTriggerCondition]:Null},N={[f.hu.HasIncreasedTriggerCondition]:Null,[f.hu.HasDecreasedTriggerCondition]:Null},T={[f.hu.IsNotEmptyTriggerCondition]:Null},I={[f.hu.EqualsTriggerCondition]:v.sq,[f.hu.DoesNotEqualTriggerCondition]:v.sq,[f.hu.ContainsTriggerCondition]:v.sq,[f.hu.DoesNotContainTriggerCondition]:v.sq,[f.hu.StartsWithTriggerCondition]:v.sq,[f.hu.EndsWithTriggerCondition]:v.sq},F={[f.hu.EqualsTriggerCondition]:v.IW,[f.hu.DoesNotEqualTriggerCondition]:v.IW,[f.hu.GreaterThanTriggerCondition]:l.v,[f.hu.LessThanTriggerCondition]:l.v},M={[f.hu.EqualsTriggerCondition]:v.jq,[f.hu.DoesNotEqualTriggerCondition]:v.jq,[f.hu.GreaterThanTriggerCondition]:l.W,[f.hu.LessThanTriggerCondition]:l.W},D={[f.hu.SetContainsOneOfTriggerCondition]:o.j,[f.hu.SetContainsAllOfTriggerCondition]:o.j,[f.hu.SetContainsNoneOfTriggerCondition]:o.j,[f.hu.SetEqualsTriggerCondition]:o.j,[f.hu.SetNotEqualsTriggerCondition]:o.j},R={[f.hu.TimePeriodBeforeTriggerCondition]:TimePeriodChangeSchemaInput,[f.hu.TimePeriodAfterTriggerCondition]:TimePeriodChangeSchemaInput,[f.hu.TimePeriodCurrentTriggerCondition]:TimePeriodChangeSchemaInput},P={[f.hu.TimePeriodIsEqualToTriggerCondition]:TimePeriodChangeSchemaInput,[f.hu.TimePeriodIsLessThanTriggerCondition]:TimePeriodChangeSchemaInput,[f.hu.TimePeriodIsMoreThanTriggerCondition]:TimePeriodChangeSchemaInput,[f.hu.TimePeriodToAnotherTriggerCondition]:TimePeriodChangeSchemaInput,[f.hu.TimePeriodToEarlierTriggerCondition]:TimePeriodChangeSchemaInput,[f.hu.TimePeriodToFutureTriggerCondition]:TimePeriodChangeSchemaInput};function getBaseComponents(e){return{...k,...e.is_nullable?T:{}}}function getSelectFieldSetOperators(e){return e.is_multi_select?D:{[f.hu.EqualsTriggerCondition]:o.j,[f.hu.DoesNotEqualTriggerCondition]:o.a}}let L={[x.gI.DateSchemaField]:(e,{isSemanticPrevious:t})=>t?R:{...R,...P,...k},[x.gI.DateTimeSchemaField]:()=>k,[x.gI.BooleanSchemaField]:e=>({[f.hu.EqualsTriggerCondition]:i.m,[f.hu.DoesNotEqualTriggerCondition]:i.m,...getBaseComponents(e)}),[x.gI.ReferenceSchemaField]:e=>({[f.hu.EqualsTriggerCondition]:r._,[f.hu.DoesNotEqualTriggerCondition]:r._,...getBaseComponents(e)}),[x.gI.CurrencySchemaField]:(e,{isSemanticPrevious:t})=>t?F:{...F,...N,...getBaseComponents(e)},[x.gI.DoubleSchemaField]:e=>({...F,...N,...getBaseComponents(e)}),[x.gI.LongSchemaField]:e=>({...M,...N,...getBaseComponents(e)}),[x.gI.StringSchemaField]:e=>({...I,...getBaseComponents(e)}),[x.gI.EmailSchemaField]:e=>({...I,...getBaseComponents(e)}),[x.gI.URLSchemaField]:e=>({...I,...getBaseComponents(e)}),[x.gI.SelectSchemaField]:(e,{isSemanticPrevious:t})=>t?getSelectFieldSetOperators(e):{...getSelectFieldSetOperators(e),...getBaseComponents(e)}};function hasValidRHS({type:e,rhs:t}){return!!(e&&O.has(e))||!!e&&!!t?.length&&t.every(e=>null!=e)}function validateAdvancedCondition(e,t=["field","operator","value"]){let a=[],n=w.t("This field is required.");return t.includes("field")&&null==e.schema_field_id&&a.push({id:e.id,location:"field",message:n}),t.includes("operator")&&!e.type&&a.push({id:e.id,location:"operator",message:n}),t.includes("value")&&!hasValidRHS(e)&&a.push({id:e.id,location:"value",message:n}),a.length?a:null}},0x98161168:(e,t,a)=>{"use strict";a.d(t,{D0:()=>toFieldSchemaOptions,Gv:()=>getNewAdvancedCondition,V0:()=>formatAdvancedConditionsForTransmit,kp:()=>withConditionDescription,w_:()=>getResolvedSchemaLabel});var n=a(0x1595bdd0),i=a(0x20482ad21),l=a(0x2172ff7ff),r=a(0x12edaa96a),o=a(0x9a7ccd79),s=a(0x405dcae6),c=a(0x6f20b262),d=a(0x1122238d8);let u=new i.Ay("modernselling");function getResolvedSchemaLabel(e,t=!1){let a=e.relationships?.find(e=>e.is_active),n=a?.relationship_label??a?.relationship_name??e.label??e.identifier;return t?u.t("Last {label}",{label:n}):n}function toSelectOptionFromFieldSchema(e){return e&&e.id?{key:`${e.id}`,value:e.id,label:getResolvedSchemaLabel(e),extras:{isPrevious:!1,fieldId:e.id}}:null}function toSemanticPreviousSelectOptionFromFieldSchema(e){return{key:`previous-${e.id}`,value:`previous-${e.id}`,label:getResolvedSchemaLabel(e,!0),extras:{isPrevious:!0,fieldId:e.id}}}function toFieldSchemaOptions(e=[],t=[]){let a=e.map(toSelectOptionFromFieldSchema),i=t.map(toSemanticPreviousSelectOptionFromFieldSchema);return(0,n.A)([...a,...i]).sort(d.JC)}function getNewAdvancedCondition(){return{id:(0,r.A)()}}function getAdvancedConditionDescription(e,t){if(!t.type)return"";let a=[],i=(0,o.Cj)()[t.type]||"";if(c.aq.has(t.type)){let e=t.rhs?.[0].period;if(!e)return"";let n=!1;e.num>1&&(n=!0);let i=(0,o.hn)(n)[e.type]||"";switch(t.type){case c.hu.TimePeriodIsMoreThanTriggerCondition:case c.hu.TimePeriodIsLessThanTriggerCondition:case c.hu.TimePeriodIsEqualToTriggerCondition:null!=i&&a.push(`${e.num} ${i}`);break;default:null!=i&&a.push(`${i}`)}}else if(c.rF.has(t.type)){let e=t.rhs?.[0].period,n=t.rhs?.[0].direction?.type;if(!e||!n)return"";let i=(0,o.hn)()[e.type],l=(0,o.Zs)(t.type,t.rhs?.[0]);if(l&&i){let e=(0,o.XG)()[l];a.push(`${e} ${i}`)}}else if(!s.Xp.has(t.type))for(let{formattedValue:e,value:n,label:i}of t.rhs||[]){let t=e??n??i;null!=t&&a.push(`${t}`)}let r=a.sort(l.Ay).join(", "),d=t.semantics?.current_or_previous==="previous";return(0,n.A)([`${getResolvedSchemaLabel(e,d)}`,i,r]).join(" ")}function withConditionDescription(e,t){return e?{...t,description:getAdvancedConditionDescription(e,t)}:t}function formatAdvancedConditionsForTransmit(e){return e.map(e=>({...e,rhs:e.rhs?.map(({formattedValue:e,...t})=>t)}))}},0x6f20b262:(e,t,a)=>{"use strict";a.d(t,{EN:()=>l,Yf:()=>n,aq:()=>r,hu:()=>i,rF:()=>o});let n={Empty:"empty",StringValue:"StringValue",UnknownValue:"UnknownValue",DoubleNumber:"DoubleNumber",LongInt:"LongInt",BooleanValue:"BooleanValue",ReferenceValue:"ReferenceValue",Select:"Select",IntDaysAgo:"IntDaysAgo",IntDaysAway:"IntDaysAway",RelativeChange:"RelativeChange",TimePeriodChange:"TimePeriodChange"},i={ContainsTriggerCondition:"ContainsTriggerCondition",DoesNotContainTriggerCondition:"DoesNotContainTriggerCondition",DoesNotEqualTriggerCondition:"DoesNotEqualTriggerCondition",EndsWithTriggerCondition:"EndsWithTriggerCondition",EqualsTriggerCondition:"EqualsTriggerCondition",GreaterThanTriggerCondition:"GreaterThanTriggerCondition",HasChangedTriggerCondition:"HasChangedTriggerCondition",HasDecreasedTriggerCondition:"HasDecreasedTriggerCondition",HasIncreasedTriggerCondition:"HasIncreasedTriggerCondition",IsEmptyTriggerCondition:"IsEmptyTriggerCondition",IsNotEmptyTriggerCondition:"IsNotEmptyTriggerCondition",LessThanTriggerCondition:"LessThanTriggerCondition",SetContainsAllOfTriggerCondition:"SetContainsAllOfTriggerCondition",SetContainsNoneOfTriggerCondition:"SetContainsNoneOfTriggerCondition",SetContainsOneOfTriggerCondition:"SetContainsAnyOfTriggerCondition",SetEqualsTriggerCondition:"SetEqualsTriggerCondition",SetNotEqualsTriggerCondition:"SetNotEqualsTriggerCondition",StartsWithTriggerCondition:"StartsWithTriggerCondition",TimePeriodHasChangedTriggerCondition:"TimePeriodHasChangedByTriggerCondition",TimePeriodToAnotherTriggerCondition:"TimePeriodToAnotherTriggerCondition",TimePeriodToFutureTriggerCondition:"TimePeriodToFutureTriggerCondition",TimePeriodToEarlierTriggerCondition:"TimePeriodToEarlierTriggerCondition",TimePeriodIsMoreThanTriggerCondition:"TimePeriodIsMoreThanTriggerCondition",TimePeriodIsLessThanTriggerCondition:"TimePeriodIsLessThanTriggerCondition",TimePeriodIsEqualToTriggerCondition:"TimePeriodIsEqualToTriggerCondition",TimePeriodAfterTriggerCondition:"TimePeriodAfterTriggerCondition",TimePeriodBeforeTriggerCondition:"TimePeriodBeforeTriggerCondition",TimePeriodCurrentTriggerCondition:"TimePeriodCurrentTriggerCondition",TimePeriodWithinTriggerCondition:"TimePeriodWithinTriggerCondition",ContainsFilterCondition:"ContainsFilterCondition",DateOffsetEqualsFilterCondition:"DateOffsetEqualsFilterCondition",DateOffsetGreaterThanFilterCondition:"DateOffsetGreaterThanFilterCondition",DateOffsetLessThanFilterCondition:"DateOffsetLessThanFilterCondition",DoesNotContainFilterCondition:"DoesNotContainFilterCondition",DoesNotEqualFilterCondition:"DoesNotEqualFilterCondition",EndsWithFilterCondition:"EndsWithFilterCondition",EqualsFilterCondition:"EqualsFilterCondition",GreaterThanFilterCondition:"GreaterThanFilterCondition",IsEmptyFilterCondition:"IsEmptyFilterCondition",IsNotEmptyFilterCondition:"IsNotEmptyFilterCondition",LessThanFilterCondition:"LessThanFilterCondition",SetEqualsFilterCondition:"SetEqualsFilterCondition",SetNotEqualsFilterCondition:"SetNotEqualsFilterCondition",StartsWithFilterCondition:"StartsWithFilterCondition"},l=new Set([i.EqualsFilterCondition,i.DoesNotEqualFilterCondition,i.SetEqualsFilterCondition,i.SetNotEqualsFilterCondition]),r=new Set([i.TimePeriodToAnotherTriggerCondition,i.TimePeriodToFutureTriggerCondition,i.TimePeriodToEarlierTriggerCondition,i.TimePeriodIsMoreThanTriggerCondition,i.TimePeriodIsLessThanTriggerCondition,i.TimePeriodIsEqualToTriggerCondition]),o=new Set([i.TimePeriodAfterTriggerCondition,i.TimePeriodBeforeTriggerCondition,i.TimePeriodCurrentTriggerCondition])},0x2c625329:(e,t,a)=>{"use strict";a.d(t,{M:()=>AllowMutingNotificationCheckbox});var n=a(0xbad225b5),i=a(0x120c268ad),l=a.n(i),r=a(0x20482ad21),o=a(0x45bd075),s=a(0x1d2cd7755);let c=new r.Ay("modernselling"),AllowMutingNotificationCheckbox=({isMutingDisabled:e,onChange:t})=>{let a=(0,n.useCallback)(e=>{t(!e.target.checked)},[t]);return n.createElement(s.A,{text:c.t("Allow recipients to mute this notification"),className:l()("p-sales_notifications__workflow__form__field"),type:"inline",cursor:"pointer"},n.createElement(o.A,{name:"allowMutingNotificationOption",checked:!e,onChange:a}))};AllowMutingNotificationCheckbox.displayName="AllowMutingNotificationCheckbox"},0x15038689e:(e,t,a)=>{"use strict";a.d(t,{A:()=>g});var n=a(0xbad225b5),i=a(0x120c268ad),l=a.n(i),r=a(0x1407c6c2c),o=a(0x20482ad21),s=a(0x205f4fb61),c=a(0x1d2cd7755),d=a(0x126f22530),u=a(0x1122238d8),m=a(0x10047bce3);let p=new o.Ay("modernselling"),AmountInput=({className:e,currency:t="USD",onBlur:a,onChange:i,value:o})=>{let g=(0,r.A)(),f=(0,n.useCallback)(e=>i(e.replace(/[^\d,]/g,"")),[i]),_=(0,n.useCallback)(e=>{let t={...e.target,value:(0,s.ZV)((0,u.Ro)(e.target?.value))};a?.({...e,target:t})},[a]);return n.createElement(c.A,{className:l()("p-sales_notifications__workflow__form__field",e),htmlFor:g,text:p.t("Minimum opportunity amount")},n.createElement(d.A,{id:g,name:"sales-home-notifications-amount-input",value:o,prefix:`${(0,m.Q)(t)} `,onBlur:_,onChange:f,isRequired:!0}))};AmountInput.displayName="AmountInput";let g=AmountInput},0x6374e095:(e,t,a)=>{"use strict";a.d(t,{e:()=>DateTimeInput});var n=a(0xbad225b5),i=a(0x1b63e435a),l=a.n(i),r=a(0x1407c6c2c),o=a(0x4bdf0df6),s=a(0x20482ad21),c=a(0x2503b7c1),d=a(0x1d2cd7755),u=a(0x1e586fbba),m=a(0x9154b87c),p=a(0x1feb18f19),g=a(0x1e217163d),f=a(0x124d99cb0),_=a(0x1b9d5cc0c),h=a(0x226892387),b=a(0x19c76d181),y=a(0xe684f705);let A=new s.Ay("workflow_builder"),DateTimeInput=({caption:e,errors:t,onBlur:a,onChange:i,required:s,timezone:E,value:S,isInWorkflowBuilder:C})=>{let v=(0,h.d4)(b.WR),x=(0,h.d4)(e=>(0,y.nv)(e,v,{preferNonExistentToNull:!1})),w=(0,_.et)(x)??o.vp,O=E||w,k=(0,n.useMemo)(()=>l().tz(O),[O]),{valueDate:N,valueTime:T}=(0,n.useMemo)(()=>{let e=(0,f.lP)(S,O);return e?.isValid()?{valueDate:e.format("YYYY-MM-DD"),valueTime:e.format("HH:mm")}:{}},[O,S]),I=(0,n.useCallback)((e,t)=>{i((0,f.lP)(`${e} ${t}`,O).toISOString()),a?.()},[i,a,O]),F=(0,n.useCallback)(e=>{N&&T&&I(e,T)},[N,I,T]),M=(0,n.useCallback)(e=>{e&&T&&N&&I(N,e)},[T,N,I]),D=(0,n.useCallback)(()=>a?.(),[a]),R=(0,r.A)();return n.createElement(g.B,{space:"50"},n.createElement(g.B,{space:"0"},n.createElement(d.A,{text:A.t("Starts on"),htmlFor:R}),n.createElement(p.c,{space:"50",alignY:"start"},n.createElement("div",{className:"flex_one"},n.createElement(c.b,{id:R,selectedDate:N,dateFormat:"YYYY-MM-DD",displayFormat:"MMMM D, YYYY",disableDatesBefore:k.format("YYYY-MM-DD"),"aria-label":A.t("Select a date"),onBlur:D,onDateChange:F,isInvalid:!!t?.length,required:s})),C&&n.createElement("span",{className:"margin_50","aria-hidden":!0},A.t("at")),n.createElement("div",{className:"flex_one"},n.createElement(m.Ay,{onBlur:D,onChange:M,width:"100%",value:T,ariaLabel:A.t("Select a time"),optionsHourIncrement:"quarter",isInvalid:!!t?.length,isRequired:s,allowCustomInput:!0,showTimeZone:!1})))),e&&n.createElement("div",{className:"caption sk_foreground_max"},e),t?.map(e=>n.createElement(u.A,{key:e.id,className:"margin_0"},e.message)))};DateTimeInput.displayName="DateTimeInput"},0x1c815ab49:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var n=a(0xbad225b5),i=a(0x12edaa96a),l=a(0x1e586fbba),r=a(0x1d1911997),o=a(0x207fb9b92);let DynamicSelect=({className:e,options:t,value:a,id:s,placeholder:c,required:d=!1,errorText:u,isInvalid:m=!1,onChange:p,...g})=>{let f=(0,n.useMemo)(()=>`${(0,i.A)()}-${t.length}`,[t]),_=(0,n.useMemo)(()=>{let e=null;return t.some(t=>!!(Array.isArray(t.options)&&(e=t.options.find(e=>e.value===a)))||t.value===a&&(e=t,!0)),e||null},[t,a]),h=(0,n.useCallback)((e={})=>p(e.value,e),[p]),{onBlur:b,errorText:y}=(0,o.K)({errorMessage:u,isErrored:m,shouldErrorPreventSave:!0});return n.createElement(n.Fragment,null,n.createElement(r.Ay,{key:f,options:t,width:"100%",selectId:s,selectedOption:_||void 0,onOptionSelected:h,placeholderText:c,isRequired:d,onBlur:b,isInvalid:!!y,...g}),!!y&&n.createElement(l.A,null,y))};DynamicSelect.displayName="DynamicSelect";let s=DynamicSelect},0x1f2c612f5:(e,t,a)=>{"use strict";a.d(t,{x:()=>FrequencySelect});var n=a(0xbad225b5),i=a(0x1075d3a9c),l=a.n(i),r=a(0x20482ad21),o=a(0x1d2cd7755),s=a(0x1c815ab49),c=a(0x124d99cb0);let d=new r.Ay("workflow_builder"),NthDay=({date:e,toLowerCase:t=!1})=>{switch((0,c.Bz)(e)){case 1:if(t)return n.createElement(n.Fragment,null,d.t("first"));return n.createElement(n.Fragment,null,d.t("First"));case 2:if(t)return n.createElement(n.Fragment,null,d.t("second"));return n.createElement(n.Fragment,null,d.t("Second"));case 3:if(t)return n.createElement(n.Fragment,null,d.t("third"));return n.createElement(n.Fragment,null,d.t("Third"));case 4:if(t)return n.createElement(n.Fragment,null,d.t("fourth"));return n.createElement(n.Fragment,null,d.t("Fourth"));case -1:if(t)return n.createElement(n.Fragment,null,d.t("last"));return n.createElement(n.Fragment,null,d.t("Last"));default:return n.createElement(n.Fragment,null,d.t("Same"))}},u=new r.Ay("workflow_builder"),m=["daily","weekdays","weekly","monthly"];function getDayString(e){return l()(e).format("dddd")}function getNthDay(e){return n.createElement(NthDay,{date:e})}function getLabels(e){return{daily:()=>u.t("Daily"),weekdays:()=>u.t("Every weekday (Monday to Friday)"),weekly:()=>u.t("Weekly on {dayOfWeek}s",{dayOfWeek:getDayString(e)}),monthly:()=>u.rt("{nthDay} {dayOfWeek} of the month",{dayOfWeek:getDayString(e),nthDay:getNthDay(e)})}}getNthDay.displayName="getNthDay";let FrequencySelect=({frequencies:e=m,isDisabled:t=!1,onChange:a,startDate:i,value:l,...r})=>{let c=(0,n.useMemo)(()=>{let t=getLabels(i);return e.map(e=>({label:t[e](),value:e}))},[e,i]);return n.createElement(o.A,{text:u.t("Frequency")},n.createElement(s.A,{options:c,ariaLabel:u.t("Please select a frequency option"),id:"frequency-select",errorText:u.t("Please select one"),value:l,onChange:a,required:!0,...r}))};FrequencySelect.displayName="FrequencySelect"},0x1655dc9c9:(e,t,a)=>{"use strict";a.d(t,{v:()=>InputGroupBox});var n=a(0xbad225b5),i=a(0xff304643),l=a.n(i);let InputGroupBox=({children:e,isWrapping:t})=>n.createElement("div",{className:t?l().inputGroupBoxWrap:l().inputGroupBox},e);InputGroupBox.displayName="InputGroupBox"},0xe1721148:(e,t,a)=>{"use strict";a.d(t,{A:()=>u});var n=a(0xbad225b5),i=a(0x120c268ad),l=a.n(i),r=a(0x1407c6c2c),o=a(0x20482ad21),s=a(0x1d2cd7755),c=a(0x126f22530);let d=new o.Ay("modernselling"),ListNameInput=({className:e,errors:t,onBlur:a,onChange:i,value:o})=>{let u=(0,r.A)();return n.createElement(s.A,{className:l()("p-sales_notifications__workflow__form__field",e),htmlFor:u,text:d.t("Name")},n.createElement(c.A,{id:u,errorText:t?.[0]?.message,name:"sales-home-notifications-list-name-input",onBlur:a,onChange:i,value:o,isRequired:!0}))};ListNameInput.displayName="ListNameInput";let u=ListNameInput},0xd00e724:(e,t,a)=>{"use strict";a.d(t,{A:()=>C});var n=a(0xbad225b5),i=a(0x16cf1da63),l=a(0x1407c6c2c),r=a(0x20482ad21),o=a(0x45bd075),s=a(0x1d2cd7755),c=a(0x126f22530),d=a(0xe874a88a),u=a(0x2172ff7ff),m=a(0x7f5a02e8),p=a(0x408bdeff),g=a(0x226d2c646),f=a(0xa1832ae4),_=a(0x226892387),h=a(0xbc72568a),b=a(0x14ea3ce99),y=a(0x1ee439e69);let A=new r.Ay("lists"),InputCanvasSalesTemplateSelect=({isDisabled:e,onValueChange:t,canvasId:a,errors:i})=>{let r=(0,_.d4)(y.H7),o=(0,f.F1)(r),s=(0,_.d4)(h.sk),c=(0,_.d4)(h.jM),E=(0,_.d4)(h.GB),S=(0,_.d4)(h._I),C=(0,_.d4)(h.iS),v=(0,_.d4)(e=>a?(0,b.Lp)(e,a):null),x=(0,l.A)(),w=(0,n.useMemo)(()=>new Set([...s?.map(e=>e.id)??[],...c?.map(e=>e.id)??[],...E?.map(e=>e.id)??[],...S?.map(e=>e.id)??[],...C?.map(e=>e.id)??[]]),[s,C,S,c,E]),O=(0,n.useMemo)(()=>v?{value:v.id,label:v.title}:null,[v]),k=(0,n.useCallback)(e=>{t&&t(e.value)},[t]),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[]},N=(0,n.useCallback)((e,t)=>{let a=[],n=w&&w.size>0?e.filter(e=>!w.has(e.value)):e;n.length>0&&a.push({label:A.t("Recent templates"),options:n});let i=getFilteredTemplateOptions(c,t);i.length>0&&a.push({label:A.t("Your templates"),options:i});let l=getFilteredTemplateOptions(E,t);l.length>0&&a.push({label:A.t("Sales templates"),options:l});let r=getFilteredTemplateOptions(S,t);r.length>0&&a.push({label:A.t("Shared with you"),options:r});let m=getFilteredTemplateOptions(C,t);m.length>0&&a.push({label:A.t("Created by {teamName}",{teamName:o}),options:m});let p=getFilteredTemplateOptions(s,t);return p.length>0&&a.push({label:A.t("Slack built templates",{teamName:o}),options:p.sort((e,t)=>(0,u.Ay)(e.label,t.label))}),d.K.resolve(a)},[w,c,E,S,C,s,o]),T=(0,n.useCallback)(e=>e.value?n.createElement(p.A,{id:e.value}):e.label,[]);return n.createElement(g.u,{selectId:x,width:"auto",isDisabled:!!e,placeholderText:A.t("Select a canvas"),processOptions:N,onOptionSelected:k,renderOption:T,renderSelectedOption:T,selectedOption:O,searcherOptions:(0,m.Zq)(m.oz),errors:i,size:"medium"})};InputCanvasSalesTemplateSelect.displayName="InputCanvasSalesTemplateSelect";var E=a(0x1bc939146);let S=new r.Ay("modernselling");function useCanvasTemplates(){let e=(0,i.wA)(),t=(0,_.d4)(h.uf);(0,n.useEffect)(()=>{t||e((0,E.dR)())},[e,t])}let MessageAddOn=({onChange:e,errors:t,includeMessageAddOn:a,canvasTemplateId:i,buttonText:r})=>{let d=(0,l.A)();useCanvasTemplates();let u=(0,n.useCallback)(t=>e("canvasTemplateId",t),[e]),m=(0,n.useCallback)(t=>{e("includeMessageAddOn",t.target.checked)},[e]),p=(0,n.useCallback)(t=>e("buttonText",t),[e]);return n.createElement("div",{className:"p-sales_notifications__workflow__form__field"},n.createElement("hr",{className:"p-sales_notifications__workflow__form__divider margin_top_150"}),n.createElement("div",{className:"p-sales_notifications__workflow__subtitle"},S.t("Message add-on")),n.createElement("div",null,n.createElement(s.A,{text:S.t("Add a button to create a canvas from a template"),type:"inline",cursor:"pointer"},n.createElement(o.A,{name:"includeCanvasTemplateButton",checked:!!a,onChange:m})),a&&n.createElement(n.Fragment,null,n.createElement(s.A,{className:"p-sales_notifications__workflow__form__field margin_top_50",htmlFor:d,text:S.t("Button text")},n.createElement(c.A,{id:d,errorText:t?.buttonText?.[0]?.message,name:"button-text-input",value:r,onChange:p,maxCharacterLimit:40,isRequired:!0})),n.createElement(s.A,{text:S.t("Canvas template"),className:"p-sales_notifications__workflow__form__field margin_top_50"},n.createElement(InputCanvasSalesTemplateSelect,{key:"lob-canvas-template-select",onValueChange:u,canvasId:i,errors:t?.canvasTemplateId})))))};MessageAddOn.displayName="MessageAddOn";let C=MessageAddOn},0xf33ac3d1:(e,t,a)=>{"use strict";a.d(t,{A:()=>eI});var n=a(0xbad225b5),i=a(0x16cf1da63),l=a(0x1d01572a2),r=a(0x4bdf0df6),o=a(0x16998c9bf),s=a(0x20482ad21),c=a(0x205f4fb61),d=a(0x12edaa96a),u=a(0x1e217163d),m=a(0x93fa1f74),p=a(0x3b556df0),g=a(0x1be40479b),f=a(0x3bf6c48),_=a(0x2b3a07cf),h=a(0x13d4e5f52),b=a(0x98161168),y=a(0x1407c6c2c),A=a(0x1d2cd7755),E=a(0x15014e268),S=a(0x9a7ccd79),C=a(0x6f20b262),v=a(0x1d104c491);let x=new s.Ay("modernselling"),UnstyledAmountDirectionSelect=({className:e,isAdvancedOption:t=!1,onBlur:a,onChange:i,value:l})=>{let r=(0,y.A)(),o=(0,n.useMemo)(()=>{if(t){let e=(0,S.Cj)();return[{label:e[C.hu.HasChangedTriggerCondition],value:v.Us.Any},{label:e[C.hu.HasIncreasedTriggerCondition],value:v.Us.Increase},{label:e[C.hu.HasDecreasedTriggerCondition],value:v.Us.Decrease}]}return[{label:x.t("Any amount change"),value:v.Us.Any},{label:x.t("Increased amount"),value:v.Us.Increase},{label:x.t("Decreased amount"),value:v.Us.Decrease}]},[t]),s=(0,n.useMemo)(()=>o.find(e=>e.value===l),[o,l]),c=(0,n.useCallback)(e=>i(e.value),[i]);return n.createElement(E.Ay,{className:e,onBlur:a,onOptionSelected:c,options:o,selectedOption:s,selectId:r,width:"100%",isRequired:!0})};UnstyledAmountDirectionSelect.displayName="UnstyledAmountDirectionSelect";let AmountDirectionSelect=({className:e,onBlur:t,onChange:a,value:i})=>n.createElement(A.A,{text:x.t("Amount change"),className:"p-sales_notifications__workflow__form__field"},n.createElement(UnstyledAmountDirectionSelect,{className:e,onBlur:t,onChange:a,value:i}));AmountDirectionSelect.displayName="AmountDirectionSelect";var w=a(0x1c3fd5e76);let O=new s.Ay("modernselling"),k={[v.Lb.adminStageChanged]:"stage",[v.Lb.adminAmountChanged]:"amount",[v.Lb.adminDealWon]:"stage",[v.Lb.adminCloseDateChanged]:"close_date",[v.Lb.userStageChanged]:"stage",[v.Lb.userAmountChanged]:"amount",[v.Lb.userDealWon]:"stage",[v.Lb.userCloseDateChanged]:"close_date"};function useWorkflowViewReadOnlyCondition({handleBlur:e,handleChange:t,isAdmin:a,opportunitySchema:i,values:l,errors:r,workflowView:o}){let s=k[o],c=(0,h.q)(s,i,a);return(0,n.useMemo)(()=>{if(!i)return null;switch(o){case v.Lb.adminAmountChanged:case v.Lb.userAmountChanged:if(a)return c&&{field:(0,b.w_)(c),renderOperator:()=>n.createElement(UnstyledAmountDirectionSelect,{className:"p-sales_notifications__workflow__form__advanced_options__field__operator",isAdvancedOption:!0,onBlur:e("amountDirection"),onChange:t("amountDirection"),value:l.amountDirection})};return c&&{field:(0,b.w_)(c),operator:O.t("has changed")};case v.Lb.adminStageChanged:case v.Lb.adminCloseDateChanged:case v.Lb.userStageChanged:case v.Lb.userCloseDateChanged:return c&&{field:(0,b.w_)(c),operator:O.t("has changed")};case v.Lb.adminDealWon:case v.Lb.userDealWon:if(a)return c&&{field:(0,b.w_)(c),operator:O.t("is equal to"),renderValue:()=>n.createElement(w.N,{isAdmin:a,isLoading:!1,onBlur:e("stage"),onChange:t("stage"),value:l.stage,errors:r.stage,opportunitySchema:i})};return c&&{field:(0,b.w_)(c),operator:O.t("is equal to"),value:l.stage?.value};case v.Lb.adminNewOpportunityAlert:case v.Lb.userNewOpportunityAlert:return{field:O.t("is new opportunity")};default:return null}},[i,o,a,c,e,t,l.amountDirection,l.stage,r.stage])}useWorkflowViewReadOnlyCondition.displayName="useWorkflowViewReadOnlyCondition";var N=a(0x2c625329),T=a(0x120c268ad),I=a.n(T),F=a(0x2b7f0bcc),M=a(0x11a296110),D=a(0x1faa3f1ac),R=a(0x2501a2cee),P=a(0xb1ea448c),L=a(0x1595bdd0),U=a(0x237e57f1d),B=a(0x1d1911997),H=a(0x405dcae6),V=a(0x1122238d8);let W=new s.Ay("modernselling"),AdvancedOptionsField=({id:e,errors:t,fieldOptions:a,fieldSchema:i,focusOnMount:l,isAllowedOperator:r,isRemovable:o,labelText:s,onBlur:c,onChange:d,onRemove:u,value:m,isAdmin:p})=>{let g=m.semantics?.current_or_previous==="previous",f=!o,_=(0,y.A)(),h=(0,y.A)(),b=(0,n.useMemo)(()=>i&&H._h[i.type]?.(i,{isSemanticPrevious:g}),[i,g]),[A,C]=(0,S.Lb)(i?.type,b,r,g),v=(0,n.useMemo)(()=>a.find(e=>{let{fieldId:t,isPrevious:a}=e.extras;return g===a&&t===m.schema_field_id}),[a,g,m.schema_field_id]),x=(0,V.FT)(C).find(e=>e.value===m.type),w=x&&b?.[x.value],O=(0,n.useCallback)(()=>u(e),[e,u]),k=(0,n.useCallback)(()=>c(e,"field"),[e,c]),N=(0,n.useCallback)(()=>c(e,"operator"),[e,c]),T=(0,n.useCallback)(()=>c(e,"value"),[e,c]),I=(0,n.useCallback)(t=>{let{fieldId:a,isPrevious:n}=t.extras;d({id:e,schema_field_id:a,semantics:n?{type:"basic",current_or_previous:"previous",condition_or_filter:"filter"}:void 0})},[e,d]),F=(0,n.useCallback)(e=>{d({...m,type:e.value})},[d,m]),D=(0,n.useCallback)(e=>d({...m,rhs:e}),[d,m]),P=(0,n.useMemo)(()=>t?.find(e=>"value"===e.location),[t]),L=(0,n.useMemo)(()=>t?.filter(e=>"field"===e.location),[t]),U=(0,n.useMemo)(()=>t?.filter(e=>"operator"===e.location),[t]);return n.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field"},n.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field__row"},n.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field__label"},s),n.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field__controls"},n.createElement(M.Nm,{"aria-disabled":f,"aria-label":W.t("Remove condition"),disabled:f,onClick:O},n.createElement("span",{className:f?"sk_soft_gray cursor_default":void 0},n.createElement(R.Ah,{name:"trash",size:"20"}))))),n.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field__row"},n.createElement(B.Ay,{ariaLabel:W.t("Select an opportunity field"),errors:L,isInvalid:!!L?.length,isRequired:!0,minOptionsListWidth:200,onOptionsListClose:k,onOptionSelected:I,options:a,placeholderText:W.t("Select field\u2026"),selectedOption:v,selectId:_,focusOnMount:l,expandOnFocus:!1}),n.createElement(E.Ay,{key:`${v?.value}-${A}`,ariaLabel:W.t("Select operator"),errors:v&&U,isRequired:!0,isDisabled:!v,onOptionsListClose:N,onOptionSelected:F,options:C,placeholderText:W.t("Select operator\u2026"),selectedOption:x,selectId:h,width:"auto",className:"flex_one"})),i&&x&&w&&n.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field__row"},n.createElement(w,{id:e,error:P,operator:x.value,fieldSchema:i,onBlur:T,onChange:D,value:m,isAdmin:p})))};AdvancedOptionsField.displayName="AdvancedOptionsField";var j=a(0x126f22530);let G=new s.Ay("modernselling"),AdvancedOptionsReadOnlyField=({field:e,operator:t,renderField:a,renderOperator:i,renderValue:l,value:r})=>{let o=(0,y.A)(),s=(0,y.A)(),c=(0,y.A)(),d=(0,n.useMemo)(()=>(0,L.A)([e&&{value:null,label:e}]),[e]),u=(0,n.useMemo)(()=>(0,L.A)([t&&{value:null,label:t}]),[t]);return n.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field p-sales_notifications__workflow__form__advanced_options__field--read_only"},n.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field__row"},n.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field__label"},G.t("When"))),n.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field__row"},a?.(),e&&n.createElement(B.Ay,{isDisabled:!0,options:d,selectedOption:d[0],selectId:s}),i?.(),t&&n.createElement(E.Ay,{isDisabled:!0,options:u,selectedOption:u[0],selectId:c,width:"auto",className:"p-sales_notifications__workflow__form__advanced_options__field__operator"})),l&&n.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field__row"},l?.()),null!=r&&n.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__field__row"},n.createElement(j.A,{className:"full_width",id:o,"aria-label":e??"",name:"read-only-condition-value",value:`${r}`,isDisabled:!0})))};AdvancedOptionsReadOnlyField.displayName="AdvancedOptionsReadOnlyField";var q=a(0x1655dc9c9);let Y=new s.Ay("modernselling"),AdvancedOptionsFields=({errors:e,hasFocusOnMount:t=!1,onChange:a,setErrors:i,advancedOptions:r,isAllowedOperator:o,isAllowedSchemaType:s,opportunitySchema:c,maxAllowedConditions:d=7,firstReadOnlyCondition:u,amount:m,stages:p,closeDateDirection:g,closeDatePeriod:f,isAdmin:_,isRecurring:h,workflowView:y})=>{let A=(0,n.useRef)(r),E=(0,n.useRef)(e||null),{fieldOptions:S,fieldSchemaById:C,defaultCondition:v}=(0,U.K)({opportunitySchema:c,isAllowedSchemaType:s,amount:m,stages:p,closeDateDirection:g,closeDatePeriod:f,isAdmin:_,isRecurring:h,workflowView:y});(0,n.useEffect)(()=>{A.current=r,E.current=e||null});let x=(0,n.useCallback)(e=>{let t=E.current?.filter(t=>t.id!==e)||null;t?.length!==E.current?.length&&(E.current=t,i(E.current))},[i]),w=(0,n.useCallback)(e=>{a({...A.current,[e]:null}),x(e)},[a,x]),O=(0,n.useCallback)((e,t)=>{let a=A.current?.[e];if(!a)return;let n=E.current||[],l=(0,H.K5)(a,[t])||[],r=n.filter(a=>a.id!==e||a.id===e&&a.location!==t);if(l.length||r.length!==n.length){let e=[...r,...l];E.current=e.length?e:null,i(E.current)}},[i]),k=(0,n.useCallback)(e=>{let{id:t}=e;if(!A.current?.[t])return;let n=e.schema_field_id,i=n?C[n]:null,l=(0,b.kp)(i,e);A.current={...A.current,[t]:l},a(A.current),x(t)},[a,x,C]),N=(0,n.useMemo)(()=>(0,L.A)(Object.values(r||{})),[r]),T=(0,n.useCallback)((e,t,n=!1)=>{let i=t||[(0,b.Gv)()],l={...A.current};i.forEach(e=>{l[e.id]=e}),a(l,n)},[a]);(0,l.A)(()=>{N.length||T(null,v,!0)});let I=N.length?N:v;return n.createElement(q.v,{isWrapping:!0},u&&n.createElement(AdvancedOptionsReadOnlyField,u),I.map((a,i)=>{let{schema_field_id:l}=a;return n.createElement(AdvancedOptionsField,{id:a.id,key:a.id,errors:e?.filter(e=>e.id===a.id),fieldOptions:S,fieldSchema:null!=l?C[l]:void 0,focusOnMount:t&&i===I.length-1,isAllowedOperator:o,isRemovable:I.length>1,labelText:Y.t("And"),onBlur:O,onChange:k,onRemove:w,value:a,isAdmin:_})}),n.createElement(M.Ay,{size:"small",type:"outline",disabled:I.length>=d,onClick:T},Y.t("Add Condition")))};AdvancedOptionsFields.displayName="AdvancedOptionsFields";let z=new s.Ay("modernselling"),AdvancedOptions=({errors:e,onChange:t,setErrors:a,isLoading:i,hasFocusOnMount:l,advancedOptions:r,opportunitySchema:o,isAllowedOperator:s,isAllowedSchemaType:c,firstReadOnlyCondition:d,amount:u,stages:m,closeDateDirection:p,closeDatePeriod:g,isAdmin:f,isRecurring:_,workflowView:h})=>n.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options"},n.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__header"},n.createElement("div",{className:"bold"},z.t("Advanced conditions"))),n.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__content"},i&&n.createElement("div",{className:"p-sales_notifications__workflow__form__advanced_options__spinner"},n.createElement(P.A,null)),!i&&o&&n.createElement(AdvancedOptionsFields,{hasFocusOnMount:l,onChange:t,setErrors:a,isAllowedOperator:s,isAllowedSchemaType:c,advancedOptions:r,opportunitySchema:o,firstReadOnlyCondition:d,errors:e,amount:u,stages:m,closeDateDirection:p,closeDatePeriod:g,isAdmin:f,isRecurring:_,workflowView:h})));AdvancedOptions.displayName="AdvancedOptions";var $=a(0x15038689e),Q=a(0xe08dc76c);let J=new s.Ay("modernselling"),K=[],TimePeriodDirectionSelect=({errors:e,timePeriodDirection:t,onChange:a,onBlur:i})=>{let l=(0,y.A)(),r=(0,n.useCallback)(e=>{a(e.value)},[a]),o=(0,n.useMemo)(()=>[{value:Q.ig.ANY,label:J.t("Another")},{value:Q.ig.LATER,label:J.t("Future")},{value:Q.ig.EARLIER,label:J.t("Earlier")}],[]);return n.createElement(E.Ay,{onBlur:i,errors:e,isRequired:!0,onOptionSelected:r,options:o||K,selectedOption:o.find(e=>t===e.value),selectId:l,width:"100%"})};TimePeriodDirectionSelect.displayName="TimePeriodDirectionSelect";var Z=a(0x26f5f245);let X=new s.Ay("modernselling"),CloseDateSelect=({errors:e,closeDateDirection:t,onCloseDateDirectionChange:a,onCloseDateDirectionBlur:i,closeDatePeriod:l,onCloseDatePeriodChange:r,onCloseDatePeriodBlur:o})=>n.createElement(A.A,{text:X.t("Close date changes to\u2026"),className:"p-sales_notifications__workflow__form__field"},n.createElement("div",{className:"display_flex align_items_center"},n.createElement("div",{className:"flex_one margin_right_100"},n.createElement(TimePeriodDirectionSelect,{errors:e?.closeDateDirection,timePeriodDirection:t,onChange:a,onBlur:i})),n.createElement("div",{className:"flex_one"},n.createElement(Z.A,{errors:e?.closeDatePeriod,selectedTimePeriod:l,onChange:r,onBlur:o,periodNum:1}))));CloseDateSelect.displayName="CloseDateSelect";var ee=a(0xb77a689a),et=a(0xa7ec93c2),ea=a(0x4a120eb2);let en=new s.Ay("modernselling"),ei=[],UnstyledStageMultiSelect=({id:e,errors:t,isLoading:a,onBlur:i,onChange:l,opportunitySchema:r,value:o})=>{let s=(0,h.q)("stage",r,!0),c=(0,n.useMemo)(()=>s?(0,V.I_)(s):[],[s]),d=(0,n.useCallback)(async e=>e?c.filter(t=>((0,ee.A)(t.label)?t.label:t.value).toLowerCase().includes(e.toLowerCase())):c,[c]),u=en.t("Search for stages");return n.createElement(n.Fragment,null,a&&n.createElement(et.Ay,{className:"normal",errors:t,isInvalid:!!t?.length,isLoading:a,isRequired:!0,onBlur:i,options:o||ei,placeholderText:u,selectId:e,selectedOptions:o??void 0,width:"100%"}),!a&&n.createElement(ea.x,{className:"normal",classPrefix:"p-sales_notifications__workflow__form__field__select",errors:t,expandOnFocus:!0,debounceWaitPeriod:0,isInvalid:!!t?.length,onBlur:i,onSelectedItemsChange:l,placeholderText:u,search:d,selectedOptions:o??void 0,selectId:e,shouldAllowUnselectInMultiSelectMode:!0,width:"100%"}))};UnstyledStageMultiSelect.displayName="UnstyledStageMultiSelect";let StageMultiSelect=({className:e,...t})=>{let a=(0,y.A)();return n.createElement(A.A,{className:I()("p-sales_notifications__workflow__form__field",e),htmlFor:a,text:en.t("Stage changes to\u2026")},n.createElement(UnstyledStageMultiSelect,{...t,id:a}))};StageMultiSelect.displayName="StageMultiSelect";var el=a(0x91728dda),er=a(0x226892387),eo=a(0x1c8beab7f);let es=new s.Ay("modernselling"),ec=[],ed=new Set([C.hu.HasChangedTriggerCondition,C.hu.HasDecreasedTriggerCondition,C.hu.HasIncreasedTriggerCondition]),eu=new Set([v.gI.DateSchemaField,v.gI.DateTimeSchemaField]),ConditionalInputsWithAdvancedOptions=({values:e,errors:t,advancedOptions:a,advancedOptionsErrors:i,advancedOptionsLoadError:l,className:r,isAdmin:o,isAdvancedOptionsOpenOnMount:s=!1,isLoading:c,handleBlur:d,handleChange:u,onAmountInputBlur:m,onAmountInputChange:p,onAdvancedOptionsChange:g,opportunitySchema:f,refetchOpportunitySchema:_,setAdvancedOptionsFieldErrors:h,workflowView:b,firstReadOnlyCondition:y,onCloseDateDirectionChange:A,onCloseDateDirectionBlur:E,onCloseDatePeriodChange:S,onCloseDatePeriodBlur:C})=>{let[v,x]=(0,n.useState)(s),[O,k]=(0,n.useState)(!1),N=(0,er.d4)(el.sw),T=(0,er.d4)(eo.UU);(0,n.useEffect)(()=>{O||(s||g(null),x(s))},[s,O,g]);let P=(0,V.g0)(b),L=(0,n.useCallback)(()=>{x(!0),k(!0)},[]),U=(0,n.useCallback)((e,t)=>{g(e),t||k(!0)},[g]),B=(0,n.useCallback)(e=>!P||!ed.has(e),[P]),H=(0,n.useCallback)(e=>!P||!eu.has(e),[P]);if(!v)return n.createElement("div",{className:r},o&&(0,V.N)(b)&&n.createElement(w.A,{value:e.stage,errors:t.stage,isLoading:c,onBlur:d("stage"),onChange:u("stage"),opportunitySchema:f,isAdmin:!0}),o&&(0,V.Bf)(b)&&n.createElement(StageMultiSelect,{value:e.stageChangedStages,errors:t.stageChangedStages,isLoading:c,onBlur:d("stageChangedStages"),onChange:u("stageChangedStages"),opportunitySchema:f}),o&&(0,V.Xk)(b)&&n.createElement(AmountDirectionSelect,{onBlur:d("amountDirection"),onChange:u("amountDirection"),value:e.amountDirection}),(0,V.DD)(b)&&n.createElement(CloseDateSelect,{onCloseDateDirectionBlur:E,onCloseDateDirectionChange:A,onCloseDatePeriodBlur:C,onCloseDatePeriodChange:S,closeDateDirection:e.closeDateDirection,closeDatePeriod:e.closeDatePeriod,errors:t}),N&&e.isRecurring?null:n.createElement($.A,{value:e.amount,onBlur:m,onChange:p}),n.createElement(D.A,{className:"p-sales_notifications__workflow__form__field",onClick:L},n.createElement(R.Ah,{size:"18",name:"settings",inline:!0}),n.createElement("span",{className:"margin_left_25"},es.t("Use advanced conditions"))));let W=T&&!o;if(l||!c&&!f&&!W)return n.createElement("div",{className:r},n.createElement($.A,{value:e.amount,onBlur:m,onChange:p}),n.createElement(F.Ay,{type:"boxed",level:"warning"},es.t("There was a problem loading advanced conditions.")," ",n.createElement(M.jV,{onClick:_},es.t("Try again?"))));let j=o&&(0,V.Bf)(b)?e.stageChangedStages||ec:null;return n.createElement("div",{className:I()("full_width margin_bottom_125",r)},n.createElement(AdvancedOptions,{errors:i,advancedOptions:a,isLoading:c,onChange:U,opportunitySchema:f,setErrors:h,hasFocusOnMount:!s,isAllowedOperator:B,isAllowedSchemaType:H,firstReadOnlyCondition:y,amount:e.amount,stages:j,closeDateDirection:e.closeDateDirection,closeDatePeriod:e.closeDatePeriod,isAdmin:o,isRecurring:e.isRecurring,workflowView:b}))};ConditionalInputsWithAdvancedOptions.displayName="ConditionalInputsWithAdvancedOptions";var em=a(0x45bd075);let ep=new s.Ay("modernselling"),ExcludeCheckbox=({isAdmin:e,className:t,workflowView:a,excludeSelfModifications:i,onChange:l})=>{let r=(0,n.useCallback)(e=>{l(e.target.checked)},[l]),o=(0,n.useMemo)(()=>e?(0,V.g0)(a)?ep.t("Exclude the person who created the opportunity"):ep.t("Exclude the person who made the update"):(0,V.g0)(a)?ep.t("Don\u2019t send this notification if you created the opportunity"):ep.t("Don\u2019t send this notification if you made the update"),[e,a]);return n.createElement(A.A,{text:o,className:I()("p-sales_notifications__workflow__form__field",t),type:"inline",cursor:"pointer"},n.createElement(em.A,{name:"excludeSelfModificationsOption",checked:!!i,onChange:r}))};ExcludeCheckbox.displayName="ExcludeCheckbox";var eg=a(0xe1721148),ef=a(0xd00e724),e_=a(0x1c24ff2dd),eh=a(0x4cdd4e70),eb=a(0xc2d5849d),ey=a(0x199da57a4);let eA=new s.Ay("modernselling"),TriggerTypeSelectButton=({icon:e,isSelected:t,onClick:a,subtext:i,text:l})=>n.createElement(M.Ay,{"aria-selected":t,className:I()("p-sales_notifications__workflow__form__trigger_type_button",{"p-sales_notifications__workflow__form__trigger_type_button--selected":t}),onClick:a,type:"outline"},n.createElement("div",{className:"flex_shrink_none padding_top_25"},n.createElement(R.Ah,{name:e,size:"20"})),n.createElement("div",{className:"flex_one align_left"},n.createElement("div",{className:"bold margin_bottom_25"},l),n.createElement("div",{className:"caption sk_foreground_high"},i)));TriggerTypeSelectButton.displayName="TriggerTypeSelectButton";let TriggerTypeSelect=({isRecurring:e,onIsRecurringChange:t})=>{let a=(0,n.useCallback)(()=>{t(!1)},[t]),i=(0,n.useCallback)(()=>{t(!0)},[t]),l=eA.t("Real-time"),r=eA.t("Get notified as soon as an opportunity meets your criteria"),o=eA.t("Scheduled"),s=eA.t("Get a recurring summary of updated opportunities (up to 50)");return n.createElement("div",{className:"display_flex gap_100"},n.createElement(TriggerTypeSelectButton,{icon:"bolt",isSelected:!e,onClick:a,subtext:r,text:l}),n.createElement(TriggerTypeSelectButton,{icon:"schedule-send",isSelected:e,onClick:i,subtext:s,text:o}))};TriggerTypeSelect.displayName="TriggerTypeSelect";let eE=new s.Ay("modernselling"),TriggerConfig=({frequency:e,isRecurring:t,onFrequencyChange:a,onIsRecurringChange:i,onStartTimeBlur:l,onStartTimeChange:r,startTime:o,startTimeErrors:s})=>{let c=eE.t("Notification type");return n.createElement(u.B,{space:"125"},n.createElement(u.B,{space:"0"},n.createElement(A.A,{text:c}),n.createElement(TriggerTypeSelect,{isRecurring:t,onIsRecurringChange:i})),t&&n.createElement(ey.Y,{frequency:e,onFrequencyChange:a,onStartTimeBlur:l,onStartTimeChange:r,startTime:o,startTimeErrors:s}))};TriggerConfig.displayName="TriggerConfig";var eS=a(0x124d99cb0),eC=a(0x1b9d5cc0c),ev=a(0xe684f705),ex=a(0x16b708a7f),ew=a(0xbd196b81),eO=a(0x11c82607b),ek=a(0xa49ba833);let eN=(0,eO.Ay)("Fetch and set object mappings for a selected org",async(e,t,a)=>{if((0,eo.cw)(t())?.datasource_id){let t=await e((0,ek.Y)({salesforceOrgId:a}));e((0,ex.hr)({objectMappings:t,salesforceOrgId:a}))}});eN.meta={name:"setUserSalesforceOrgObjectMappings",key:"createThunkSetUserSalesforceOrgObjectMappings",description:"Fetch and set object mappings for a selected org"};let eT=new s.Ay("modernselling"),OpportunityChangedForm=({workflowView:e,defaultListTitle:t})=>{let a=(0,i.wA)(),s=e in v.u3,h=(0,f.E)({isAdmin:s}),b=(0,er.d4)(el.QJ),y=(0,er.d4)(el.sw),A=(0,er.d4)(eo.RC),E=(0,er.d4)(eo.cc),[S,C]=(0,n.useState)(),x=(0,er.d4)(eo.UU),[O,k]=(0,n.useState)(!0),[T,I]=(0,n.useState)(null),[F,M]=(0,n.useState)(null),D=(0,er.d4)(s?eo.Tt:eo.rm),R=(0,er.d4)(s?eo.MH:eo.gE),P=(0,er.d4)(ev.cA),L=(0,n.useMemo)(()=>b?[]:[v.Jd.OpportunityOwnedByDirectReports,v.Jd.AccountOwnedByMe],[b]),U=(0,n.useMemo)(()=>{let e=(0,eS.rJ)(P,"iso"),t=(0,eC.et)(P)??r.vp;return{isRecurring:!1,frequency:v.Ns.weekly,startTime:e,timezone:t}},[P]),B=(0,n.useMemo)(()=>{if(D)return(0,p.AN)(D,s,U);let a={account:null,advancedOptions:null,amount:(0,c.ZV)(5e4),channelId:null,tokenUserId:null,opportunity:null,scope:null,sendTo:v.Oz.SalesHome,stage:null,title:t,stageChangedStages:null,canvasTemplateId:null,includeMessageAddOn:!1,buttonText:(0,g.L)(e),isMutingDisabled:!1};return((0,V.DD)(e)&&(a.closeDateDirection=Q.ig.ANY,a.closeDatePeriod=Q.ts.FISCAL_QUARTER),s)?((0,V.Xk)(e)&&(a.amountDirection=v.Us.Any),{...a,...U,type:v.g$.AdminOpportunityChanged,recipientType:null,recipientRoles:null,recipientUsers:null}):{...a,type:v.g$.UserOpportunityChanged,criteria:L,excludeSelfModifications:!1}},[D,t,e,s,L,U]),{values:H,errors:W,handleBlur:j,handleChange:G,setFieldErrors:q}=(0,_.A)({workflowView:e,initialValues:B}),Y=(0,n.useCallback)(e=>{G("isRecurring")(e),!0===e?(G("sendTo")("sales_home"),G("excludeSelfModifications")(void 0),y&&G("amount")(null),(0,V.Yo)(H.scope)&&G("scope")(null)):y&&G("amount")((0,c.ZV)(5e4))},[G,H.scope,y]),z=(0,n.useCallback)(e=>{G("sendTo")(e),(0,V.lA)(e)&&G("excludeSelfModifications")(void 0)},[G]),$=(0,n.useCallback)(e=>j(e)(),[j]),J=(0,n.useCallback)((e,t)=>G(e)(t),[G]),K=(0,n.useCallback)((e,t)=>G(e)(t),[G]),Z=(0,n.useCallback)(e=>{let t=E?.find(t=>t.salesforce_org_id===e.value);t&&(k(!0),H.advancedOptions&&G("advancedOptions")(null),a((0,ex.c2)(!0)),a((0,ew.T)({salesforceOrgId:t.salesforce_org_id,setDefaultInApi:!1})),C((0,d.A)()),((0,V.Yo)(H.scope)||(0,V.Su)(H.scope))&&(G("scope")(null),G("account")(null)))},[a,G,C,H.scope,E,k,H.advancedOptions]),X=(0,n.useMemo)(()=>(0,V.g0)(e)||H.isRecurring?[v.QO.SpecificOpportunity]:null,[e,H.isRecurring]);(0,l.A)(()=>{D&&R&&!s&&(a((0,ex.c2)(!0)),k(!0),I(null),a(eN(R)))});let ee=(0,n.useCallback)(async()=>{k(!0),I(null),M(null);try{let e=await h();M(e)}catch(e){I((0,o.iT)(e))}finally{k(!1)}},[h]);(0,n.useEffect)(()=>{x||ee()},[ee,x]);let et=useWorkflowViewReadOnlyCondition({values:H,errors:W,isAdmin:s,handleBlur:j,handleChange:G,opportunitySchema:F,workflowView:e}),ea=s&&!(0,V.g0)(e),en=(0,V.ti)(H.sendTo)&&!H.isRecurring,ei=!!((0,V.L8)(H.scope)||(0,V.dy)(H.criteria)||D?.condition?.advanced_conditions?.length||D?.acn?.advanced_conditions?.length);return n.createElement(n.Fragment,null,n.createElement("div",{className:"p-sales_notifications__workflow__section"},n.createElement("div",{className:"p-sales_notifications__workflow__subtitle"},eT.t("Notification details")),n.createElement(eg.A,{errors:W.title,onBlur:j("title"),onChange:G("title"),value:H.title}),n.createElement(u.B,{space:"125"},ea&&n.createElement(TriggerConfig,{frequency:H.frequency,isRecurring:!!H.isRecurring,onFrequencyChange:G("frequency"),onIsRecurringChange:Y,onStartTimeBlur:j("startTime"),onStartTimeChange:G("startTime"),startTime:H.startTime,startTimeErrors:W.startTime}),n.createElement(eb.A,{channelId:H.channelId,tokenUserId:H.tokenUserId,destination:H.sendTo,errors:W,isAdmin:s,isRecurring:H.isRecurring,isEditNotification:!!D,onChannelSelectBlur:j("channelId"),onChannelSelected:G("channelId"),onTokenSelectBlur:j("tokenUserId"),onTokenSelected:G("tokenUserId"),onSendToSelected:z})),en&&n.createElement(ExcludeCheckbox,{isAdmin:s,workflowView:e,excludeSelfModifications:H.excludeSelfModifications,onChange:G("excludeSelfModifications")}),!s&&(0,V.N)(e)&&n.createElement(w.A,{value:H.stage,errors:W.stage,isLoading:O,onBlur:j("stage"),onChange:G("stage"),opportunitySchema:F,isAdmin:s}),n.createElement("hr",{className:"p-sales_notifications__workflow__form__divider"}),n.createElement("div",{className:"p-sales_notifications__workflow__subtitle"},eT.t("Apply to")),!s&&A&&n.createElement(m.k,{onChange:Z,salesforceOrgId:D&&R?R:A,disabled:!!D,disabledText:eT.t("To change org, please create a new notification."),showCoachMark:!D}),n.createElement(eh.A,{key:S,isAdmin:s,errors:W,account:H.account,criteria:H.criteria,ignoreScopes:X,onScopeTypeBlur:j("scope"),onScopeTypeChange:G("scope"),onScopeValueBlur:$,onScopeValueChange:J,opportunity:H.opportunity,scope:H.scope}),n.createElement(ConditionalInputsWithAdvancedOptions,{values:H,errors:W,isAdmin:s,handleBlur:j,handleChange:G,advancedOptions:H.advancedOptions,advancedOptionsErrors:W.advancedOptions,advancedOptionsLoadError:T,isLoading:O,onAdvancedOptionsChange:G("advancedOptions",!1),onAmountInputBlur:j("amount"),onAmountInputChange:G("amount"),opportunitySchema:F,refetchOpportunitySchema:ee,setAdvancedOptionsFieldErrors:q("advancedOptions"),workflowView:e,firstReadOnlyCondition:et,isAdvancedOptionsOpenOnMount:ei,onCloseDateDirectionBlur:j("closeDateDirection"),onCloseDateDirectionChange:G("closeDateDirection"),onCloseDatePeriodBlur:j("closeDatePeriod"),onCloseDatePeriodChange:G("closeDatePeriod")})),s&&(0,V.ti)(H.sendTo)&&n.createElement("div",{className:"p-sales_notifications__workflow__section"},n.createElement("hr",{className:"p-sales_notifications__workflow__form__divider"}),n.createElement("div",{className:"p-sales_notifications__workflow__subtitle"},eT.t("Recipients")),n.createElement(e_.$,{errors:W,onRecipientTypeBlur:j("recipientType"),onRecipientTypeChange:G("recipientType"),onRecipientRolesBlur:j("recipientRoles"),onRecipientRolesChange:G("recipientRoles"),onRecipientUsersBlur:j("recipientUsers"),onRecipientUsersChange:G("recipientUsers"),recipientType:H.recipientType,recipientRoles:H.recipientRoles,recipientUsers:H.recipientUsers,setRecipientRolesFieldsErrors:q("recipientRoles"),setRecipientUsersFieldsErrors:q("recipientUsers")})),s&&!H.isRecurring&&n.createElement(ef.A,{onChange:K,errors:W,canvasTemplateId:H.canvasTemplateId,includeMessageAddOn:H.includeMessageAddOn,buttonText:H.buttonText}),s&&n.createElement("div",{className:"p-sales_notifications__workflow__section"},n.createElement(N.M,{isMutingDisabled:H.isMutingDisabled,onChange:G("isMutingDisabled")})))};OpportunityChangedForm.displayName="OpportunityChangedForm";let eI=OpportunityChangedForm},0x1c24ff2dd:(e,t,a)=>{"use strict";a.d(t,{$:()=>RecipientsSelect});var n=a(0xbad225b5),i=a(0x1407c6c2c),l=a(0x20482ad21),r=a(0x1d2cd7755),o=a(0x15014e268),s=a(0x226892387),c=a(0x1c8beab7f),d=a(0x10d53599f),u=a(0x19dc73101);let m=new l.Ay("modernselling"),p={entities:{channels:!1,members:{includeSelf:!0,includeSlackbot:!1,includeBots:!1},userGroups:!1},sort:{frecency:!0},allowEmptyQuery:!0},MembersSelect=({errors:e,onBlur:t,onChange:a,selectedMembers:l})=>{let r=(0,i.A)(),o=(0,n.useCallback)(e=>n.createElement(d.A,{id:e.value,showAvatar:!0,showPresence:!1}),[]),s=(0,n.useCallback)(e=>{a(e.map(e=>e.value))},[a]),c=(0,n.useMemo)(()=>l?.map(e=>({value:e})),[l]);return n.createElement("div",{className:"p-sales_notifications__workflow__form__field"},n.createElement(u.h,{className:"normal",errors:e,onBlur:t,classPrefix:"p-sales_notifications__workflow__form__field__select",onSelectedItemsChange:s,placeholderText:m.t("Search for users"),renderOption:o,searcherOptions:p,selectedOptions:c,selectId:r,width:"100%",expandOnFocus:!0,forceRealName:!0}))};MembersSelect.displayName="MembersSelect";var g=a(0xf1b54886),f=a(0x1122238d8),_=a(0x91728dda),h=a(0x1d104c491);let b=new l.Ay("modernselling"),RecipientsSelect=({hasFrontLineManagerOptions:e,errors:t,recipientType:a,onRecipientTypeChange:l,onRecipientTypeBlur:d,recipientRoles:u,onRecipientRolesChange:m,onRecipientRolesBlur:p,setRecipientRolesFieldsErrors:y,recipientUsers:A,onRecipientUsersChange:E,onRecipientUsersBlur:S,setRecipientUsersFieldsErrors:C})=>{let v,x=(0,s.d4)(_.Jx),w=(0,i.A)(),O=(v=(0,s.d4)(c.yp),!!v?.some(e=>"UserRole"===e.identifier)),k=(0,n.useCallback)(e=>{l(e.value),y([]),C([])},[l,y,C]),N=(0,n.useMemo)(()=>e?[{label:b.t("Direct owner"),value:"",options:[{label:b.t("Opportunity owner"),value:h._Y.Owner},{label:b.t("Account owner"),value:h._Y.AccountOwner}]},{label:b.t("Manager"),value:"",options:[{label:b.t("Manager of the opportunity owner"),value:h._Y.OwnerManager},{label:b.t("Manager of the account owner"),value:h._Y.AccountOwnerManager}]},{label:b.t("Specific people"),value:h._Y.User}]:[{label:b.t("Direct owner"),value:"",options:[{label:b.t("Opportunity owner"),value:h._Y.Owner},{label:b.t("Account owner"),value:h._Y.AccountOwner}]},{label:b.t("Manager or leader"),value:"",options:[{label:b.t("People the opportunity owner rolls up to"),value:h._Y.ManagerChain},{label:b.t("People the account owner rolls up to"),value:h._Y.AccountManagerChain}]},{label:b.t("Specific people"),value:h._Y.User}],[e]),T=(0,n.useMemo)(()=>a?(0,f.FT)(N).find(e=>e.value===a):null,[N,a]);return n.createElement(n.Fragment,null,n.createElement(r.A,{text:b.t("Recipient types"),className:"p-sales_notifications__workflow__form__field"},n.createElement(o.Ay,{errors:t?.recipientType,options:N,selectId:w,onOptionsListClose:d,selectedOption:T,onOptionSelected:k,width:"100%",maxListHeight:400})),O&&a&&a!==h._Y.User&&n.createElement(g.M,{errors:t?.recipientRoles,isOptional:[h._Y.Owner,h._Y.AccountOwner].includes(a)||x,onBlur:p,onChange:m,recipientRoles:u}),a&&a===h._Y.User&&n.createElement(MembersSelect,{errors:t?.recipientUsers,onBlur:S,onChange:E,selectedMembers:A}))};RecipientsSelect.displayName="RecipientsSelect"},0xf1b54886:(e,t,a)=>{"use strict";a.d(t,{M:()=>RolesSelect});var n,i=a(0xbad225b5),l=a(0x1d01572a2),r=a(0x20482ad21),o=a(0x1d2cd7755),s=a(0x8716533d),c=a(0x15014e268),d=a(0x1faa3f1ac),u=a(0x2501a2cee),m=a(0x1655dc9c9),p=a(0x120c268ad),g=a.n(p),f=a(0xb77a689a),_=a(0x237b6a339),h=a(0x1cbdfeceb),b=a(0x1229d92d),y=a(0xc6a2c86f),A=a(0xb6f15b90),E=a(0x223fb5a56);let S=new r.Ay("modernselling"),C={filterQuery:"",options:[],selectedOptions:[],selectId:""};var v=((n=v||{}).BAD_ENTRY="bad_entry",n.DUPLICATE_ENTRIES="duplicate_entries",n.MAX_TOKENS_EXCEEDED="max_tokens_exceeded",n.TOO_LONG="too_long",n.TOO_SHORT="too_short",n);let getFormatErrors=(e="")=>{let t=[];return(0,f.A)(e)||t.push("bad_entry"),e.length>50&&t.push("too_long"),e.length<2&&t.push("too_short"),t},createTokens=e=>e.map(e=>({key:(0,_.A)("token"),label:e,value:e})),renderCountStatus=(e,t=!1)=>i.createElement("div",{className:g()("caption",t?"sk_raspberry_red":"sk_foreground_max")},e);renderCountStatus.displayName="renderCountStatus";let x=(0,b.A)(({instruction:e,onBlur:t,onChange:a,placeholderText:n,selectId:l,selectedValues:r=[],windowRef:o})=>{let c=(0,i.useRef)(null),[d,u]=(0,i.useState)(!1),[m,p]=(0,i.useState)([]),[g,f]=(0,i.useState)([]),[_,b]=(0,i.useState)({...C,selectedOptions:createTokens(r),selectId:l}),{filterQuery:v,selectedOptions:x}=_,w=(0,i.useMemo)(()=>x?.map(e=>e.value)||[],[x]),O=(0,y.A)(w),k=!g.length&&!m.length&&!v?.trim(),N=(0,y.A)(k),T=(0,i.useCallback)(()=>{let e=[],t=new Set,a=w.filter((e,t)=>w.indexOf(e)!==t);a?.length&&(t=new Set([...t,...a]),e.push("duplicate_entries")),w.length>50&&e.push("max_tokens_exceeded"),f(e),b(a=>({...a,isInvalid:m.length>0||e.length>0,selectedOptions:a.selectedOptions?.map(e=>({...e,isError:t.has(e.value)}))||[]}))},[m,w]),I=(0,i.useCallback)(e=>{let t=e.includes(",")?e.split(","):e.split(/\n|\t/),{newTokenValues:a,badEntries:n,errors:i}=(t=t.filter(e=>""!==e.trim())).reduce((e,t)=>{let a=t.trim(),n=getFormatErrors(a);return n.length>0?(e.errors=new Set([...e.errors,...n]),e.badEntries.push(a)):e.newTokenValues.push(a),e},{newTokenValues:[],badEntries:[],errors:new Set});p([...i]);let l=createTokens(a);b(e=>({...e,isInvalid:i.size>0||g.length>0,selectedOptions:[...e.selectedOptions||[],...l],filterQuery:n.join(" ")}))},[g.length]),F=(0,i.useCallback)(e=>{b(t=>({...t,...e()}))},[]),M=(0,i.useCallback)(e=>{("Enter"===e.key||"Tab"===e.key)&&I(v)},[v,I]),D=(0,i.useCallback)(e=>{let t=e.clipboardData.getData("text");o.deref()?.requestAnimationFrame(()=>{I(t)})},[I,o]),R=(0,i.useCallback)(()=>{t(),I(v),u(!1)},[t,I,v]),P=(0,i.useCallback)(()=>{u(!0)},[]),L=(0,i.useMemo)(()=>[...g,...m].reduce((e,t)=>("max_tokens_exceeded"!==t&&e.push({id:t,message:(e=>{switch(e){case"bad_entry":return S.t("Invalid entry");case"too_short":return S.t("Minimum of {count} characters required",{count:2});case"too_long":return S.t("Maximum of {count} characters exceeded",{count:50});case"duplicate_entries":return S.t("Duplicate entries");default:return""}})(t)}),e),[]),[m,g]);(0,i.useEffect)(()=>{!v?.trim()&&(p([]),w?.length||b(e=>({...e,isInvalid:!1})))},[v,w]),(0,i.useEffect)(()=>{w?.length!==O?.length&&T()},[w,O,T]),(0,i.useEffect)(()=>{(w!==O||k!==N)&&a({isValid:k,values:w})},[w,k,a,O,N]);let U=(0,i.useMemo)(()=>{let e=d&&!!v?.length,t=!e&&(d||w.length>50);if(e){let e=50-(v?.length||0);return renderCountStatus(S.t("{count, plural, =1 {# character} other {# characters}} left",{count:e}),e<0)}if(t){let e=50-w.length;return e<0?renderCountStatus(S.t("{maxTokens} keywords maximum",{maxTokens:50}),!0):renderCountStatus(S.t("{count, plural, =1 {# token} other {# tokens}} left",{count:e}))}return null},[d,v,w]),B=(0,i.useMemo)(()=>({filterQuery:v,options:[],selectId:l}),[v,l]),H=d&&0===getFormatErrors(v?.trim()).length,V=(0,i.useCallback)(()=>null,[]);return i.createElement("div",{className:"margin_bottom_125 position_relative"},i.createElement(A.A,{width:"100%",placeholderText:n,selectState:_,setSelectState:F,onFocus:P,onBlur:R,onKeyDown:M,onFilterQueryPaste:D,inputRef:c}),H&&i.createElement(E.Ay,{className:"position_absolute full_width",emptyStateMessage:e=>i.createElement("div",{className:"display_flex justify_content_between full_width caption"},i.createElement("div",null,S.t("Add \u201C{filterQuery}\u201D",{filterQuery:e})),i.createElement("div",{className:"flex_shrink_none margin_left_50 sk_foreground_max"},S.rt("Return to add"))),renderOption:V,selectState:B,setSelectState:h.A,width:1}),i.createElement("div",{className:"margin_top_50 display_flex justify_content_between"},i.createElement("div",{className:"caption sk_foreground_max",role:"note"},e),U),L&&i.createElement(s.A,{errors:L}))});var w=a(0x226892387),O=a(0x1c8beab7f);let k=new r.Ay("modernselling"),RolesSelectMatch=({matches:e,onBlur:t,onChange:a})=>{let n,l=(0,w.d4)(O.Ey),r=(0,i.useCallback)(t=>n=>{a({...e,[t]:n})},[e,a]);return i.createElement(m.v,null,i.createElement(o.A,{className:"bold",text:k.t("Contain")}),i.createElement(x,{instruction:k.rt("Include roles with any keyword match in their names"),onBlur:t,onChange:r("containsOneOf"),placeholderText:k.t("ex. AMER SVP, RVP, Retail"),selectedValues:e?.containsOneOf.values,selectId:"containsOneOf"}),i.createElement(o.A,{className:"bold",text:k.t("Do not contain")}),i.createElement(x,{instruction:k.rt("Exclude roles with any keyword match in their names"),onBlur:t,onChange:r("containsNoneOf"),placeholderText:k.t("ex. ACME, CSE"),selectedValues:e?.containsNoneOf.values,selectId:"containsNoneOf"}),l&&i.createElement(d.A,{className:"display_flex align_items_center",href:(n=l.instance_url,`${n}/lightning/setup/Roles/home`)},i.createElement(u.Ah,{name:"new-window",inline:!0,size:"20"}),i.createElement("span",{className:"margin_left_25"},k.t("Check all roles in Salesforce"))))};RolesSelectMatch.displayName="RolesSelectMatch";var N=a(0x16cf1da63),T=a(0x1407c6c2c),I=a(0x133aee58f),F=a(0x18a03595d),M=a(0x1952a5c50),D=a(0x4a120eb2),R=a(0x2fd935d8);let P=new r.Ay("modernselling"),RolesSelectSpecific=({onBlur:e,onChange:t,selectedRoles:a})=>{let n=(0,N.wA)(),l=(0,T.A)(),r=(0,I.A)(!0),o=(0,i.useCallback)(async e=>{if(!(0,M.u)(e))return[{label:P.t("Type at least 3 characters to search roles"),value:"",options:[]}];let{records:t}=await n((0,R.R)({sobjects:[{sobjectApiName:"UserRole",fields:["Name"]}],asIntegrationUser:!0,query:e,...r&&{salesforceOrgId:r},reason:"notifications_role_search"}));return t},[n,r]),s=(0,i.useCallback)(e=>{t(e.map(e=>({id:e.value,name:e.label})))},[t]);return i.createElement(D.x,{className:"normal",onBlur:e,classPrefix:"p-sales_notifications__workflow__form__field__select",debounceWaitPeriod:F.Vp,onSelectedItemsChange:s,placeholderText:P.t("Search for roles"),search:o,selectedOptions:a?.map(e=>({key:e.id,value:e.id,label:e.name})),selectId:l,width:"100%"})};RolesSelectSpecific.displayName="RolesSelectSpecific";var L=a(0x1d104c491);let U=new r.Ay("modernselling"),B={filter:L.yP.Specific,match:{containsOneOf:{isValid:!0,values:[]},containsNoneOf:{isValid:!0,values:[]}},specific:[]},RolesSelect=({errors:e,hasMatchOption:t=!0,isOptional:a=!1,onBlur:n,onChange:r,recipientRoles:d})=>{let u=d||B;t||(u.filter=L.yP.Specific);let m=(0,i.useMemo)(()=>[{label:U.t("Specific roles"),value:L.yP.Specific},{label:U.t("Roles with matching keyword"),value:L.yP.Match}],[]),p=(0,i.useCallback)(e=>{r({...u,filter:e.value})},[r,u]),g=(0,i.useCallback)(e=>{r({...u,match:e})},[r,u]),f=(0,i.useCallback)(e=>{r({...u,specific:e})},[r,u]);return(0,l.A)(()=>{r({...u})}),i.createElement(i.Fragment,null,i.createElement(o.A,{className:"p-sales_notifications__workflow__form__field margin_bottom_75",text:U.t("Narrow by roles"),optional:a},t?i.createElement(c.Ay,{onOptionSelected:p,options:m,selectedOption:m.find(e=>e.value===u.filter),width:"100%"}):i.createElement(RolesSelectSpecific,{onBlur:n,onChange:f,selectedRoles:u.specific})),t&&i.createElement(i.Fragment,null,u.filter===L.yP.Match&&i.createElement(RolesSelectMatch,{matches:u.match,onBlur:n,onChange:g}),u.filter===L.yP.Specific&&i.createElement(RolesSelectSpecific,{onBlur:n,onChange:f,selectedRoles:u.specific})),e&&i.createElement(s.A,{errors:e}),i.createElement("div",{className:"caption sk_dark_grey margin_top_50"},U.t("People without access to a sales dashboard won\u2019t receive notifications.")))};RolesSelect.displayName="RolesSelect"},0x4cdd4e70:(e,t,a)=>{"use strict";a.d(t,{A:()=>D});var n=a(0xbad225b5),i=a(0x120c268ad),l=a.n(i),r=a(0x1595bdd0),o=a(0x1407c6c2c),s=a(0x1df96de4c),c=a(0x20482ad21),d=a(0x1d2cd7755),u=a(0x15014e268),m=a(0x3bf6c48),p=a(0x16cf1da63),g=a(0x1d1911997),f=a(0x133aee58f);let select_option=({label:e,width:t=16,height:a,image:i})=>n.createElement("div",{className:"display_flex align_items_center"},"string"==typeof i?n.createElement("img",{alt:e,className:"margin_right_50",height:a,src:i,width:t}):n.createElement("span",{className:"display_flex margin_right_50"},i),e);var _=a(0x18a03595d),h=a(0x1952a5c50),b=a(0xa9a7442),y=a(0x2fd935d8);let A=a.p+"account-24d2400.svg",E=new c.Ay("modernselling"),S=[],AccountsSearchSelect=({isAdmin:e=!1,value:t,errors:a,className:i,initialSelectOptions:r=S,isLoading:s,onBlur:c,onChange:d})=>{let u=(0,p.wA)(),m=(0,o.A)(),C=(0,n.useRef)(!0),v=(0,f.A)(e),x=(0,n.useCallback)(e=>d(e),[d]),w=(0,n.useCallback)(async t=>{if(C.current||!(0,h.u)(t))return C.current=!1,r;let{records:a}=await u((0,y.R)({sobjects:[{sobjectApiName:"Account",fields:["Name"]}],asIntegrationUser:e,query:t,...v&&{salesforceOrgId:v},reason:"notifications_account_search"}));return a},[u,r,e,v]),O=(0,n.useCallback)(({label:e},{isGroupHeader:t})=>t?e:n.createElement(select_option,{width:12,image:A,label:e}),[]),k=(0,n.useCallback)(({label:e})=>n.createElement(select_option,{width:16,image:A,label:e}),[]);return n.createElement("div",{className:l()("p-sales_notifications__workflow__form__field",i)},s&&n.createElement(g.Ay,{isLoading:!0,options:r,selectId:m,width:"100%"}),!s&&n.createElement(b.m,{errors:a,onBlur:c,classPrefix:"p-sales_notifications__workflow__form__field__select",debounceWaitPeriod:_.Vp,onOptionSelected:x,placeholderText:E.t("Search for accounts"),renderOption:O,renderSelectedOption:k,search:w,selectId:m,selectedOption:t||void 0,width:"100%"}))};AccountsSearchSelect.displayName="AccountsSearchSelect";var C=a(0xa7ec93c2),v=a(0x85e904d5),x=a(0x91728dda),w=a(0x226892387),O=a(0x1d104c491);let k=new c.Ay("modernselling"),MatchCriteriaSelect=({className:e,errors:t,onBlur:a,onChange:i,value:r})=>{let o=(0,n.useRef)(null),s=(0,w.d4)(x.QJ),c=(0,n.useMemo)(()=>s?[{label:k.t("Direct owner"),options:[{label:k.t("Opportunities you own"),value:O.Jd.OpportunityOwnedByMe},{label:k.t("Opportunities on an account you own"),value:O.Jd.AccountOwnedByMe}],value:O.Jd.AccountOwnedByMe},{label:k.t("Manager or leader"),options:[{label:k.t("Opportunities that roll up to you"),value:O.Jd.OpportunityOwnedByAnyoneInReportChain},{label:k.t("Opportunities on accounts that roll up to you"),value:O.Jd.AccountOwnedByReportChain}],value:O.Jd.AccountOwnedByReportChain},{label:k.t("Any ownership"),value:O.Jd.Any}]:[{label:k.t("You own the account"),value:O.Jd.AccountOwnedByMe},{label:k.t("Your direct report owns the opportunity"),value:O.Jd.OpportunityOwnedByDirectReports},{label:k.t("You own the opportunity"),value:O.Jd.OpportunityOwnedByMe},{label:k.t("People who roll up to you own the opportunity"),value:O.Jd.OpportunityOwnedByAnyoneInReportChain},{label:k.t("People who roll up to you own the accounts"),value:O.Jd.AccountOwnedByReportChain}],[s]),[u,m]=(0,n.useState)({filterQuery:"",options:c,selectedOptions:[],selectId:"matchCriteriaSelect"}),p=(0,n.useCallback)(e=>{m(t=>{let a=e();return void 0!==a.filterQuery&&a.filterQuery!==t.filterQuery?a=(0,v.k)(c,a):s&&void 0!==a.selectedOptions&&(a.selectedOptions.some(e=>e.value===O.Jd.Any)&&!r.includes(O.Jd.Any)?a.selectedOptions=[c.find(e=>e.value===O.Jd.Any)]:a.selectedOptions=a.selectedOptions.filter(e=>e.value!==O.Jd.Any)),{...t,...a}})},[s,c,r]),g=(0,n.useCallback)(e=>{i(e.map(e=>e.value))},[i]);return n.createElement(d.A,{text:k.t("Ownership"),className:l()("p-sales_notifications__workflow__form__field",e)},n.createElement(C.yW,{inputRef:o,width:"100%",expandOnFocus:!0,className:e,shouldAllowUnselectInMultiSelectMode:!0,onBlur:a,errors:t,selectState:u,setSelectState:p,onSelectedItemsChange:g}))};MatchCriteriaSelect.displayName="MatchCriteriaSelect";var N=a(0x30e98603);let T=new c.Ay("modernselling"),I=[],OpportunitySearchSelect=({isAdmin:e=!1,value:t,errors:a,initialSelectOptions:i=I,isLoading:l,onBlur:r,onChange:s})=>{let c=(0,p.wA)(),d=(0,o.A)(),u=(0,n.useRef)(!0),m=(0,f.A)(e),A=(0,n.useCallback)(e=>s(e),[s]),E=(0,n.useCallback)(async t=>{if(u.current||!(0,h.u)(t))return u.current=!1,i;let{records:a}=await c((0,y.R)({sobjects:[{sobjectApiName:"Opportunity",fields:["Name"]}],asIntegrationUser:e,query:t,...m&&{salesforceOrgId:m},reason:"notifications_opportunity_search"}));return a},[c,i,e,m]),S=(0,n.useCallback)(({label:e},{isGroupHeader:t})=>t?e:n.createElement(select_option,{width:12,image:n.createElement(N.Ay,{fillColor:N.n9.ORANGE,size:N.or.SMALL}),label:e}),[]),C=(0,n.useCallback)(({label:e})=>n.createElement(select_option,{width:16,image:n.createElement(N.Ay,{fillColor:N.n9.ORANGE}),label:e}),[]);return n.createElement("div",{className:"p-sales_notifications__workflow__form__field"},l&&n.createElement(g.Ay,{isLoading:!0,options:I,selectId:d,width:"100%"}),!l&&n.createElement(b.m,{errors:a,onBlur:r,classPrefix:"p-sales_notifications__workflow__form__field__select",debounceWaitPeriod:_.Vp,onOptionSelected:A,placeholderText:T.t("Search for opportunity by name"),renderOption:S,renderSelectedOption:C,search:E,selectedOption:t||void 0,selectId:d,width:"100%"}))};OpportunitySearchSelect.displayName="OpportunitySearchSelect";var F=a(0x1122238d8);let M=new c.Ay("modernselling"),ScopeSelect=({isAdmin:e=!1,account:t,className:a,criteria:i,errors:c,ignoreScopes:p,onScopeTypeBlur:g,onScopeTypeChange:f,onScopeValueBlur:_,onScopeValueChange:h,opportunity:b,scope:y,key:A})=>{let E=(0,o.A)(),S=A??E,C=(0,w.d4)(x.QJ),v=(0,m.hz)({isAdmin:e}),k=(0,n.useMemo)(()=>e?[{label:M.t("All opportunities"),value:O.QO.All},{label:M.t("A specific opportunity"),value:O.QO.SpecificOpportunity},{label:M.t("A specific account\u2019s opportunities"),value:O.QO.SpecificAccount}].filter(e=>!p?.includes(e.value)):C?[{label:M.t("All opportunities"),value:O.QO.MatchCriteria},{label:M.t("A specific opportunity"),value:O.QO.SpecificOpportunity},{label:M.t("A specific account\u2019s opportunities"),value:O.QO.SpecificAccount}].filter(e=>!p?.includes(e.value)):[{label:M.t("Direct owner"),options:[{label:M.t("Opportunities you own"),value:O.QO.OwnedByMe},{label:M.t("Opportunities on an account you own"),value:O.QO.AccountsOwnedByMe}],value:O.QO.AccountsOwnedByMe},{label:M.t("Manager or leader"),options:[{label:M.t("Opportunities that roll up to you"),value:O.QO.OwnedByReportChain},{label:M.t("Opportunities on accounts that roll up to you"),value:O.QO.AccountOwnedByReportChain}],value:O.QO.OwnedByReportChain},{label:M.t("General"),options:[{label:M.t("All opportunities"),value:O.QO.All},{label:M.t("A specific opportunity"),value:O.QO.SpecificOpportunity},{label:M.t("A specific account\u2019s opportunities"),value:O.QO.SpecificAccount}],value:O.QO.SpecificOpportunity}].map(e=>e.options?{label:e.label,options:e.options.filter(e=>!p?.includes(e.value)),value:e.value}:e),[C,p,e]),N=(0,n.useCallback)(e=>f(e.value),[f]),T=(0,n.useCallback)(()=>_?.(y),[y,_]),I=(0,n.useCallback)(e=>h(y,e),[h,y]),D=(0,m.b1)(()=>v("Account","My Accounts","Name").then(e=>{let t={label:M.t("Type at least 3 characters to search all accounts"),value:"",options:[]};return e?.length?[t,{label:M.t("My Accounts"),value:"",options:(0,r.A)(e?.map(F._F))}]:[t]})),R=(0,m.b1)(()=>v("Opportunity","My Opportunities","CloseDate").then(e=>{let t={label:M.t("Type at least 3 characters to search all opportunities"),value:"",options:[]};return e?.length?[t,{label:M.t("My Opportunities"),value:"",options:(0,r.A)(e?.map(F._F))}]:[t]})),P=(0,n.useMemo)(()=>(0,F.FT)(k).find(e=>e.value===y),[y,k]);return n.createElement("div",{className:a},n.createElement(d.A,{text:M.t("Opportunity type"),className:l()("p-sales_notifications__workflow__form__field",{margin_bottom_50:(0,F.V)(y)||(0,F.Su)(y)||(0,F.Yo)(y)})},n.createElement(u.Ay,{key:`${S}-${k.length}`,errors:c?.scope,options:k,selectId:S,onOptionsListClose:g,selectedOption:P,onOptionSelected:N,width:"100%",maxListHeight:400})),(0,F.V)(y)&&n.createElement(MatchCriteriaSelect,{errors:c?.criteria,value:i||s.Ml,onBlur:T,onChange:I}),(0,F.Su)(y)&&n.createElement(AccountsSearchSelect,{isAdmin:e,value:t,errors:c?.account,onBlur:T,onChange:I,isLoading:D.isLoading,initialSelectOptions:D.payload||void 0}),(0,F.Yo)(y)&&n.createElement(OpportunitySearchSelect,{isAdmin:e,value:b,errors:c?.opportunity,onBlur:T,onChange:I,isLoading:R.isLoading,initialSelectOptions:R.payload||void 0}))};ScopeSelect.displayName="ScopeSelect";let D=ScopeSelect},0xc2d5849d:(e,t,a)=>{"use strict";a.d(t,{A:()=>M});var n=a(0xbad225b5),i=a(0x120c268ad),l=a.n(i),r=a(0x1595bdd0),o=a(0x1407c6c2c),s=a(0x20482ad21),c=a(0x1d2cd7755),d=a(0x15014e268),u=a(0x133aee58f),m=a(0x1fe613d6e),p=a(0x226892387),g=a(0x1c8beab7f),f=a(0x1d104c491);let _=new s.Ay("modernselling");function useCanSendNotificationToChannel(e,t){let a=(0,u.A)(e)??"",n=(0,p.d4)(e=>(0,g.uS)(e,a));if((0,p.d4)(m.K)&&n?.allow_admins_to_send_to_all_channel_types)return{canSendNotificationToChannel:!0,canSendNotificationtoChannelCaption:""};if(n?.send_notification_to_channel_permission===f.$4.NO_CHANNELS)return{canSendNotificationToChannel:!1,canSendNotificationtoChannelCaption:t?_.t("Sending to a channel has been turned off by an administrator. Click Save Notification to use the sales dashboard."):_.t("Sending to a channel has been turned off by an administrator.")};return{canSendNotificationToChannel:!0,canSendNotificationtoChannelCaption:""}}var h=a(0xb62e6bf4),b=a(0x200c38ed8),y=a(0x253c586a2),A=a(0x12185e091),E=a(0xb8504a42),S=a(0x217553e42),C=a(0x1ee439e69);let v=new s.Ay("modernselling"),ChannelsSelect=({className:e,errors:t,isAdmin:a,channelId:i,onBlur:r,placeholder:o,...s})=>{let c=(0,p.d4)(C.H7),d=(0,E.kA)(c),m=(0,p.d4)(h.ss),_=o||v.t("Search for channel"),x=(0,u.A)(a)??"",{isFetchingPrefs:w,searcherOptions:O}=(0,b.qI)(x),k=(0,p.d4)(e=>(0,g.uS)(e,x)),N=(0,p.d4)(e=>(0,S.OL)(e,i)),T=(0,n.useMemo)(()=>{let e=[];return t&&e.push(...t),k?.send_notification_to_channel_permission===f.$4.PRIVATE_CHANNELS_ONLY&&(0,A.rW)(N)&&e.push({id:"restricted_channel_type",message:v.t("Sending to a public channel has been turned off by an administrator.")}),e},[t,k?.send_notification_to_channel_permission,N]);return n.createElement("div",{className:l()(e)},n.createElement(y.NV,{key:w?"fetching":"fetched",...s,ariaLabel:v.t("Search for channel"),searcherOptions:O,placeholder:_,className:"p-sales_notifications__workflow__form__field__channel_select",isRequired:!0,isDisabled:w,errors:T,onOptionsListClose:r,showTeamForLocalChannels:d||m}))};ChannelsSelect.displayName="ChannelsSelect";var x=a(0x10d53599f);let w=new s.Ay("modernselling"),MemberSelect=({errors:e,onBlur:t,onChange:a,selectedMember:i,currentUserId:l})=>{let r=(0,o.A)(),s=(0,n.useCallback)(e=>n.createElement(x.A,{id:e.value,showAvatar:!0,showPresence:!1}),[]),c=(0,n.useCallback)(e=>{a(e.value)},[a]),u=(0,n.useMemo)(()=>[{value:l,label:"self"}],[l]),m=(0,n.useMemo)(()=>i?{value:i,label:"selected"}:void 0,[i]);return n.createElement("div",{className:"p-sales_notifications__workflow__form__field"},n.createElement(d.Ay,{className:"normal",errors:e,onBlur:t,classPrefix:"p-sales_notifications__workflow__form__field__select",placeholderText:w.t("Select a user",{fallbackHash:"6876c5c6fc9e725b31fc5f6014d319fb5e2b9c51"}),renderOption:s,renderSelectedOption:s,options:u,selectedOption:m,onOptionSelected:c,shouldAllowUnselectInSingleSelectMode:!1,selectId:r,selectDataQa:"member-select",width:"100%",isRequired:!0}))};MemberSelect.displayName="MemberSelect";var O=a(0x1122238d8),k=a(0x91728dda),N=a(0x19c76d181),T=a(0x250d8187a),I=a.n(T);let F=new s.Ay("modernselling");function getCaption(e,t){return t?F.t("Sending scheduled notifications to channels is not supported right now."):e||""}let SendToSelect=({channelId:e=null,tokenUserId:t=null,className:a,destination:i=f.Oz.SalesHome,errors:s,isAdmin:m,isRecurring:g,isEditNotification:_,onChannelSelectBlur:h,onChannelSelected:y,onTokenSelectBlur:A,onTokenSelected:E,onSendToSelected:S})=>{let C=(0,o.A)(),v=(0,u.A)(m)??"",{isFetchingPrefs:x}=(0,b.qI)(v),{canSendNotificationToChannel:w,canSendNotificationtoChannelCaption:T}=useCanSendNotificationToChannel(m,_),M=getCaption(T,g),D=!w||g,R=(0,n.useMemo)(()=>(0,r.A)([{label:m?F.t("Recipient\u2019s sales dashboards"):F.t("Your sales notifications"),value:f.Oz.SalesHome},!D&&{label:F.t("A channel"),value:f.Oz.Channel}]),[m,D]),P=(0,p.d4)(N.WR),L=(0,p.d4)(k.V$),U=(0,n.useCallback)(({value:e})=>{(0,O.lA)(e)?L&&E(P):(y(null),E(null)),S(e)},[y,S,P,E,L]);return(0,n.useEffect)(()=>{D&&(S(f.Oz.SalesHome),y(null))},[i,D,S,y]),n.createElement(n.Fragment,null,n.createElement(c.A,{text:F.t("Notification destination"),className:l()("p-sales_notifications__workflow__form__field",(0,O.lA)(i)&&"margin_bottom_75",a)},n.createElement(d.Ay,{ariaLabel:F.t("Notification destination"),key:D?"single-option":"multi-option",errors:s?.sendTo,isDisabled:1===R.length||x,onOptionSelected:U,options:R,selectedOption:R.find(e=>e.value===i),selectId:C,width:"100%"}),(0,O.lA)(i)&&n.createElement("div",{className:"caption full_width sk_foreground_max margin_top_50"},L?F.t("Notifications will be visible to everyone in the channel."):F.t("Notifications will be visible to everyone in the channel, and show data accessible by the integration user.")),M&&n.createElement("div",{className:"caption margin_top_50 sk_foreground_max"},M)),(0,O.lA)(i)&&n.createElement(ChannelsSelect,{className:l()(I().channelSelect,L&&I().channelSelectWithTokenSelect),isAdmin:m,onBlur:h,onChange:y,channelId:e,value:e,errors:s?.channelId}),L&&(0,O.lA)(i)&&n.createElement(c.A,{text:L?F.t("Notification token"):"Notification token",className:l()("p-sales_notifications__workflow__form__field",(0,O.lA)(i)&&"margin_bottom_75",a)},n.createElement("div",{className:"caption full_width sk_foreground_max"},L?F.t("Notifications will only contain information this account can access in Salesforce.",{fallbackHash:"4cd03e97a30852a3e507298a63fb6b5e216449c6"}):"Notifications will only contain information this account can access in Salesforce."),n.createElement(MemberSelect,{errors:s?.tokenUserId,onBlur:A,onChange:E,selectedMember:t,currentUserId:P})))};SendToSelect.displayName="SendToSelect";let M=SendToSelect},0x1c3fd5e76:(e,t,a)=>{"use strict";a.d(t,{A:()=>f,N:()=>UnstyledStageSelect});var n=a(0xbad225b5),i=a(0x120c268ad),l=a.n(i),r=a(0x1407c6c2c),o=a(0x20482ad21),s=a(0x1d2cd7755),c=a(0x15014e268),d=a(0x1d1911997),u=a(0x13d4e5f52),m=a(0x1122238d8);let p=new o.Ay("modernselling"),g=[],UnstyledStageSelect=({errors:e,isLoading:t,onBlur:a,onChange:i,opportunitySchema:l,value:o,isAdmin:s})=>{let p=(0,r.A)(),f=(0,n.useRef)(!1),_=(0,u.q)("stage",l,s),h=(0,n.useMemo)(()=>_?(0,m.I_)(_,"desc"):g,[_]),b=(0,n.useMemo)(()=>{if(o){let e=h.find(e=>e.label===o.label);if(e)return e}return h.find(e=>"Closed Won"===e.label)||h[0]||null},[h,o]);return(0,n.useEffect)(()=>{o||t||f.current||(f.current=!0,i(b))},[o,t,i,b]),n.createElement(n.Fragment,null,t&&n.createElement(d.Ay,{onBlur:a,errors:e,isRequired:!0,isLoading:t,options:g,selectId:p,width:"100%"}),!t&&n.createElement(c.Ay,{onBlur:a,errors:e,isRequired:!0,onOptionSelected:i,options:h||g,selectedOption:b,selectId:p,width:"100%"}))};UnstyledStageSelect.displayName="UnstyledStageSelect";let StageSelect=({className:e,...t})=>n.createElement(s.A,{text:p.t("Stage for \u201Cwin\u201D"),className:l()("p-sales_notifications__workflow__form__field",e)},n.createElement(UnstyledStageSelect,t));StageSelect.displayName="StageSelect";let f=StageSelect},0xd7a36639:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});var n=a(0xbad225b5),i=a(0x1407c6c2c),l=a(0x20482ad21),r=a(0x15014e268),o=a(0xe08dc76c);let s=new l.Ay("modernselling"),TimePeriodFrameSelect=({errors:e,onChange:t,temporalFrame:a,isDisabled:l=!1})=>{let c=(0,i.A)(),d=(0,n.useCallback)(e=>{t(e.value)},[t]),u=(0,n.useMemo)(()=>[{value:o.kH.Previous,label:s.t("last")},{value:o.kH.Current,label:s.t("this")},{value:o.kH.Next,label:s.t("next")}],[]);return n.createElement(r.Ay,{errors:e,isRequired:!0,onOptionSelected:d,options:u,selectedOption:u.find(e=>a===e.value),selectId:c,width:"auto",className:"flex_one",isDisabled:l})};TimePeriodFrameSelect.displayName="TimePeriodFrameSelect";let c=TimePeriodFrameSelect},0x26f5f245:(e,t,a)=>{"use strict";a.d(t,{A:()=>f});var n=a(0xbad225b5),i=a(0x120c268ad),l=a.n(i),r=a(0x1595bdd0),o=a(0x1407c6c2c),s=a(0x20482ad21),c=a(0x12edaa96a),d=a(0x15014e268),u=a(0xe08dc76c);let m=new s.Ay("modernselling"),p=[],g=new Set([u.ts.DAYS,u.ts.MONTHS,u.ts.FISCAL_QUARTER,u.ts.FISCAL_YEAR]),TimePeriodSelect=({className:e,timePeriods:t=g,errors:a,selectedTimePeriod:i,onChange:s,onBlur:f,periodNum:_,isDisabled:h=!1})=>{let b=(0,o.A)(),y=(0,n.useCallback)(e=>{s(e.value)},[s]),A=(0,n.useMemo)(()=>{let e=[{value:u.ts.FISCAL_QUARTER,label:m.t("{periodNum, plural, one {Fiscal quarter} other {Fiscal quarters}}",{periodNum:_})},{value:u.ts.FISCAL_YEAR,label:m.t("{periodNum, plural, one {Fiscal year} other {Fiscal years}}",{periodNum:_})},{value:u.ts.DAYS,label:m.t("{periodNum, plural, one {Day} other {Days}}",{periodNum:_})},{value:u.ts.MONTHS,label:m.t("{periodNum, plural, one {Month} other {Months}}",{periodNum:_})}];return(0,r.A)(e.filter(e=>e&&t?.has(e.value)))},[_,t]),E=(0,n.useMemo)(()=>`${(0,c.A)()}-${A.length}`,[A]);return n.createElement(d.Ay,{key:E,onBlur:f,errors:a,isRequired:!0,onOptionSelected:y,options:A||p,selectedOption:A.find(e=>i===e.value),selectId:b,width:"auto",className:l()(e,{flex_one:!e}),isDisabled:h})};TimePeriodSelect.displayName="TimePeriodSelect";let f=TimePeriodSelect},0x199da57a4:(e,t,a)=>{"use strict";a.d(t,{Y:()=>TriggerScheduleSelect});var n=a(0xbad225b5),i=a(0x20482ad21),l=a(0x1e217163d),r=a(0x6374e095),o=a(0x1f2c612f5),s=a(0x1d104c491);let c=new i.Ay("modernselling"),d=[s.Ns.daily,s.Ns.weekdays,s.Ns.weekly],TriggerScheduleSelect=({frequency:e,onFrequencyChange:t,onStartTimeBlur:a,onStartTimeChange:i,startTime:s,startTimeErrors:u})=>{let m=c.t("Will send based on recipient\u2019s configured timezone");return n.createElement(l.B,{space:"125"},n.createElement(r.e,{caption:m,errors:u,onBlur:a,onChange:i,required:!0,value:s}),n.createElement(o.x,{frequencies:d,onChange:t,startDate:s,value:e}))};TriggerScheduleSelect.displayName="TriggerScheduleSelect"},0x2253dfab8:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});var n=a(0xbad225b5),i=a(0x20482ad21),l=a(0x2333b5d68);let r=new i.Ay("modernselling"),NotificationConditions=({title:e})=>n.createElement(l.A,{iconName:"clock",title:e||r.t("When\u2026")});NotificationConditions.displayName="NotificationConditions";let o=NotificationConditions},0xd2e7c536:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});var n=a(0xbad225b5),i=a(0x20482ad21),l=a(0x2333b5d68);let r=new i.Ay("modernselling"),NotificationDestination=({title:e})=>n.createElement(l.A,{iconName:"user-groups",title:e||r.t("To\u2026")});NotificationDestination.displayName="NotificationDestination";let o=NotificationDestination},0x13fb6986a:(e,t,a)=>{"use strict";a.d(t,{A:()=>u});var n=a(0xbad225b5),i=a(0x20482ad21),l=a(0x11a296110),r=a(0x15e813115),o=a.n(r);let NotificationPreviewTitle=({children:e})=>n.createElement("span",{className:o().notificationPreviewTitle},e);NotificationPreviewTitle.displayName="NotificationPreviewTitle";var s=a(0x2333b5d68),c=a(0x6960d8b9);let d=new i.Ay("modernselling"),NotificationPreview=({body:e,children:t,imageUrl:a,title:i,buttonLabel:r,showNotificationButton:o})=>n.createElement(s.A,{iconName:"send",title:d.t("Send this notification")},n.createElement(n.Fragment,null,n.createElement("div",{className:"display_flex flex_wrap align_items_start"},n.createElement("div",{className:"margin_top_25"},n.createElement("img",{src:a,alt:i})),n.createElement("div",{className:"flex_one margin_left_50"},n.createElement("div",{className:"display_flex justify_content_between flex_wrap"},n.createElement(NotificationPreviewTitle,null,i),n.createElement("span",{className:"micro sk_light_grey margin_left_50 flex_shrink_none"},(0,c.Yq)("11:30 AM","{time}"))),n.createElement("div",null,e),o&&n.createElement(l.Ay,{className:"flex_two margin_top_50",type:"outline",size:"small"},r||i))),t));NotificationPreview.displayName="NotificationPreview";let u=NotificationPreview},0x1122238d8:(e,t,a)=>{"use strict";a.d(t,{AS:()=>toSelectOptionFromSchema,Bf:()=>f,DD:()=>_,FT:()=>toFlatSelectOptions,I_:()=>getSelectOptionsFromFieldSchema,JC:()=>labelSort,L8:()=>s,N:()=>p,Ro:()=>toNumber,Su:()=>d,V:()=>c,Xk:()=>m,Yo:()=>u,_F:()=>toSelectOptionFromSfdcObjectField,dy:()=>b,g0:()=>g,g1:()=>h,lA:()=>isSendToChannel,ti:()=>isSendToSalesHome});var n=a(0x174bb7323),i=a(0x1595bdd0),l=a(0xe1870af4),r=a(0x2172ff7ff),o=a(0x1d104c491);function labelSort(e,t){return(0,r.Ay)((0,n.A)(e.label),(0,n.A)(t.label))}function toNumber(e,t=!1){return+(t?`${e||0}`.replace(/[^-\d.]/g,""):`${e||0}`.replace(/[^-\d]/g,""))||0}function toFlatSelectOptions(e){return e.reduce((e,t)=>(t.options?t.options.forEach(t=>{e.push(t)}):e.push(t),e),[])}function toSelectOptionFromSfdcObjectField(e){return e?.Id?.value&&e?.Name?.value?{key:e.Id.value,value:e.Id.value,label:e.Name.value}:null}function toSelectOptionFromSchema(e){if(!e||!e.identifier||!1===e.is_active)return null;let t=e.label||e.identifier;return{key:e.identifier,value:e.identifier,label:t}}function getSelectOptionsFromFieldSchema(e,t="asc"){return(0,i.A)((0,l.A)(e?.options||[],"position",[t]).map(toSelectOptionFromSchema))}function isScope(e){return t=>e===t}function isWorkflowView(e){return t=>!!e?.includes(t)}function hasCriteria(e){return t=>t?.includes(e)}let s=isScope(o.QO.All),c=isScope(o.QO.MatchCriteria),d=isScope(o.QO.SpecificAccount),u=isScope(o.QO.SpecificOpportunity),m=isWorkflowView([o.Lb.adminAmountChanged,o.Lb.userAmountChanged]),p=isWorkflowView([o.Lb.adminDealWon,o.Lb.userDealWon]);isWorkflowView([o.Lb.adminForecastReminder,o.Lb.userForecastReminder]);let g=isWorkflowView([o.Lb.adminNewOpportunityAlert,o.Lb.userNewOpportunityAlert]),f=isWorkflowView([o.Lb.adminStageChanged,o.Lb.userStageChanged]),_=isWorkflowView([o.Lb.adminCloseDateChanged,o.Lb.userCloseDateChanged]),h=isWorkflowView(Object.values(o.YB)),b=hasCriteria(o.Jd.Any),isSendToSalesHome=e=>e===o.Oz.SalesHome,isSendToChannel=e=>e===o.Oz.Channel},0x348940af:(e,t,a)=>{"use strict";a.d(t,{A:()=>v});var n=a(0xbad225b5),i=a(0x16cf1da63),l=a(0xe0376d2),r=a(0x40c0d834),o=a(0x20482ad21),s=a(0x11a296110),c=a(0x2501a2cee),d=a(0x6e87d4ec),u=a(0x1fdec3e16),m=a(0x3ebf4390),p=a(0x173712bc0),g=a(0x62accd6b),f=a(0x91728dda),_=a(0x3711e82d),h=a(0x226892387),b=a(0x16b708a7f),y=a(0x1c8beab7f),A=a(0x11d9e4b2f),E=a(0x1d104c491),S=a(0x16ffed5ab);let C=new o.Ay("modernselling"),WorkflowHeader=({description:e,imageUrl:t,isAdmin:a=!1,onSave:o,title:v})=>{let x=(0,h.d4)(f.QJ),w=(0,h.d4)(f.Jx),O=(0,h.d4)(f.V$),k=(0,i.wA)(),[N,T]=(0,n.useState)(!1),[I,F]=(0,n.useState)(!1),M=(0,h.d4)(y.RC),D=(0,h.d4)(a?y.uJ:y.EH),R=(0,g.Ht)(D),P=(0,p.A)(a),L=(0,h.d4)(e=>(0,y.DY)(e,a)),U=R?.type!==E.g$.UserReminder&&R?.type!==E.g$.AdminReminder&&R?.isRecurring,B=(0,n.useMemo)(()=>({elementName:P?"update_notification":"add_notification",action:P?_.UiAction.UPDATE:_.UiAction.ADD,onClick:{enableClogAction:!0}}),[P]),H=(0,n.useMemo)(()=>R&&(R.type===E.g$.UserOpportunityChanged||R.type===E.g$.AdminOpportunityChanged)&&R.scope?R.scope:void 0,[R]),V=(0,n.useMemo)(()=>{let e=[];if(!x){if(H)switch(H){case E.QO.All:case E.QO.SpecificOpportunity:case E.QO.SpecificAccount:e.push(E.bc.General);break;case E.QO.OwnedByMe:case E.QO.AccountsOwnedByMe:e.push(E.bc.DirectOwner);break;case E.QO.AccountOwnedByReportChain:case E.QO.OwnedByDirectReports:case E.QO.OwnedByReportChain:e.push(E.bc.ManagerOrLeader)}return(0,l.A)(e)}if(R&&R.type===E.g$.UserOpportunityChanged&&R.scope===E.QO.MatchCriteria&&R.criteria)for(let t of R.criteria)switch(t){case E.Jd.Any:e.push(E.bc.Any);break;case E.Jd.OpportunityOwnedByMe:case E.Jd.AccountOwnedByMe:e.push(E.bc.DirectOwner);break;case E.Jd.AccountOwnedByReportChain:case E.Jd.OpportunityOwnedByDirectReports:case E.Jd.OpportunityOwnedByAnyoneInReportChain:e.push(E.bc.ManagerOrLeader)}return(0,l.A)(e)},[H,x,R]),W=(0,n.useMemo)(()=>{let e=[];switch(R?.recipientType){case E._Y.User:e.push(E.bc.General);break;case E._Y.Owner:case E._Y.AccountOwner:e.push(E.bc.DirectOwner);break;case E._Y.AccountManagerChain:case E._Y.ManagerChain:e.push(E.bc.ManagerOrLeader)}return(0,l.A)(e)},[R]),j=(0,n.useMemo)(()=>R?.type===E.g$.UserOpportunityChanged?V:R?.type===E.g$.AdminOpportunityChanged?W:void 0,[R,V,W]);(0,n.useEffect)(()=>{I&&(0,m.cB)(D,R,{experimentLobOrg62UnrestrictedGroupOn:w,experimentLobChannelAcnTokenGroupOn:O}).ok&&F(!1)},[I,D,R,w,O]);let G=(0,n.useCallback)(async()=>{if(!D||!o)return;let{ok:e}=k((0,A.A)({workflowView:D}));if(!e)return void F(!0);T(!0),k((0,b.a2)({workflowView:D,formSubmitError:null}));try{await o(),a?k((0,b.kC)(null)):k((0,b.yK)(null)),k((0,b.a2)({workflowView:D,values:null,errors:null,formSubmitError:null})),k((0,S.M)({element:n.createElement(d.A,{svgIconProps:{name:"check"}},C.t("Notification saved."))}))}catch(e){k((0,b.a2)({workflowView:D,formSubmitError:C.t("There was a problem saving this notification. Please try again.")}))}T(!1)},[D,o,k,a]),q=(0,n.useCallback)(()=>{if(a){k((0,b.JH)()),D===E.Lb.adminSelectNotificationType||P?k((0,b.kC)(null)):k((0,b.kC)({workflowView:E.Lb.adminSelectNotificationType}));return}k((0,b.LO)()),D===E.Lb.userSelectNotificationType||P?k((0,b.yK)(null)):k((0,b.yK)({workflowView:E.Lb.userSelectNotificationType}))},[k,a,D,P]);return n.createElement(r.A,{eventId:_.EventId.LOB_NOTIFICATIONS,uiComponentName:_.UiComponentName.LOB_NOTIFICATION_WORKFLOW,lobNotificationWorkflowView:D??void 0,lobNotificationWorkflowScope:H,lobNotificationWorkflowCriteriaGroup:j,isLobNotificationWorkflowAdmin:a,isLobNotificationWorkflowScheduled:U,workflowId:L??void 0,salesforceOrgId:M||""},n.createElement("div",{className:"p-view_header p-sales_notifications__workflow_header"},n.createElement("div",{className:"display_flex align_items_center"},n.createElement(s.jV,{"aria-label":C.t("Back"),onClick:q},n.createElement(c.Ah,{name:"caret-left-full"})),t?n.createElement("img",{className:"p-sales_notifications__workflow_header__image",alt:v,src:t}):null,n.createElement("h2",null,n.createElement(u.A,{lines:1},v)),e?n.createElement(u.A,{lines:2},n.createElement("div",{className:"p-sales_notifications__workflow_header__description"},e)):null),o?n.createElement(s.lV,{disabled:I,loading:N,onClick:G,autoClogProps:B,"aria-label":C.t("Save Notification")},C.t("Save Notification")):null))};WorkflowHeader.displayName="WorkflowHeader";let v=WorkflowHeader},0x92e81718:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var n=a(0xbad225b5),i=a(0x107cfc47d);let WorkflowLoading=()=>n.createElement(i.IS,null,n.createElement(i.cp,{isLoading:!0}),n.createElement(i.OC,null));WorkflowLoading.displayName="WorkflowLoading";let l=WorkflowLoading},0x107cfc47d:(e,t,a)=>{"use strict";a.d(t,{IS:()=>WorkflowPageBase,OC:()=>WorkflowPageSecondaryContent,cp:()=>WorkflowPagePrimaryContent});var n=a(0xbad225b5),i=a(0x20482ad21),l=a(0x2b7f0bcc),r=a(0xb1ea448c),o=a(0x226892387),s=a(0x1c8beab7f);let c=new i.Ay("modernselling"),WorkflowPageBase=({children:e})=>n.createElement("div",{className:"p-sales_notifications__workflow"},n.createElement("div",{className:"p-sales_notifications__workflow__page"},e));WorkflowPageBase.displayName="WorkflowPageBase";let WorkflowPagePrimaryContent=({children:e,isAdmin:t=!1,isLoading:a=!1})=>{let i=(0,o.d4)(t?s.uJ:s.EH),c=(0,o.d4)(e=>i?(0,s.CP)(e,i):null);return a?n.createElement("div",{className:"full_width display_flex justify_content_center align_items_center"},n.createElement(r.A,null)):n.createElement("div",{className:"p-sales_notifications__workflow__page__primary"},c&&n.createElement(l.Ay,{type:"boxed",level:"error",className:"margin_bottom_150 full_width"},c),e)};WorkflowPagePrimaryContent.displayName="WorkflowPagePrimaryContent";let WorkflowPageSecondaryContent=({children:e})=>n.createElement("div",{className:"p-sales_notifications__workflow__page__secondary"},n.createElement("div",{className:"p-sales_notifications__workflow__page__secondary__inner"},e&&n.createElement("div",{className:"p-sales_notifications__workflow__subtitle"},c.t("What to expect")),n.Children.map(e,(e,t)=>t>0&&e?n.createElement(n.Fragment,null,n.createElement("div",{className:"p-sales_notifications__workflow__page__presentation_box_connector"}),e):e)));WorkflowPageSecondaryContent.displayName="WorkflowPageSecondaryContent"},0x2333b5d68:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var n=a(0xbad225b5),i=a(0x2501a2cee);let WorkflowPresentationBox=({iconName:e,title:t,children:a})=>n.createElement("div",{role:"presentation",className:"p-sales_notifications__workflow__presentation_box"},n.createElement("div",{className:"display_flex"},n.createElement("div",{className:"p-sales_notifications__workflow__presentation_box__icon"},n.createElement(i.Ah,{name:e,size:"18"})),n.createElement("div",{className:"flex_one margin_left_50"},t)),a&&n.createElement("div",{className:"margin_top_50"},a));WorkflowPresentationBox.displayName="WorkflowPresentationBox";let l=WorkflowPresentationBox},0x1ec19bc0c:(e,t,a)=>{"use strict";a.d(t,{y:()=>UserOrgConnectionBaseModal});var n=a(0xbad225b5),i=a(0x16cf1da63),l=a(0x20482ad21),r=a(0x11a296110),o=a(0x189615fa),s=a(0x23b496ae9),c=a(0xf225ecf2),d=a(0x1c7997c1),u=a(0x96920791),m=a(0x16d221c7f),p=a(0x142775427),g=a(0x1f803375e),f=a(0x214e51545),_=a(0x1e217163d),h=a(0x20158cb6),b=a(0x14fad6485),y=a(0x226892387),A=a(0x1c8beab7f),E=a(0xcf9c4f5d);function useWaitForOrgConnection(e,t){let a=(0,i.wA)(),{windowRef:l}=(0,n.useContext)(b._0),r=(0,y.d4)(A.H2);(0,n.useEffect)(()=>{if("fetching"!==r)return;let handleRefocus=async()=>{await a((0,E.u)({salesforceOrgId:e,reason:"wait-for-org-connection"}))&&(l.deref()?.removeEventListener("focus",handleRefocus),t?.())};return l.deref()?.addEventListener("focus",handleRefocus),()=>{l.deref()?.removeEventListener("focus",handleRefocus)}},[l,a,r,e,t])}var S=a(0x1fcbb004d),C=a(0x230985d4a),v=a(0x40c0d834),x=a(0x1a02c72b5),w=a(0xd6a16321),O=a(0x20e80190e),k=a(0x3711e82d),N=a(0x1fb2d2a87),T=a(0x16b708a7f);let I=a.p+"onboarding-new-org-connected-dark-6a97fd8.png",F=a.p+"onboarding-new-org-connected-light-eaac6f1.png",M=new l.Ay("modernselling"),D={elementName:"sales_home_onboarding_new_org_connected",onClick:{enableClogAction:!0}},OnboardingNewOrgConnectedModal=()=>{let e=(0,i.wA)(),t=(0,y.d4)(N.to),a=(0,n.useCallback)(()=>{e((0,T.Ko)())},[e]),l=(0,n.useCallback)(()=>{e((0,S.O)()),a()},[e,a]),r=(0,n.useCallback)(()=>{e((0,S.O)()),e((0,x.o)((0,w.RJ)())),a()},[e,a]),s=(0,y.d4)(A.RC),c=(0,y.d4)(A.cc).find(e=>e.salesforce_org_id===s)?.name;if(!c)throw Error("No org name found");return n.createElement(v.A,{eventId:k.EventId.LOB_SALES_HOME,uiComponentName:k.UiComponentName.SALES_ONBOARDING_MULTI_ORG,clogImpression:!0},n.createElement(o.A,{closeModal:l,maxWidth:520,role:"dialog"},n.createElement(O.$m,null,n.createElement(O.hR,{height:200,width:520,alt:"",src:"light"===t?F:I}),n.createElement(O.rQ,{className:".p-sales_onboarding__new_org_connected_modal_header"},n.createElement(O.Rc,{title:M.t("New Salesforce org connected"),className:".p-sales_onboarding__new_org_connected_modal_header"})),n.createElement(O.qf,null,M.rt("With {salesforceOrgName} connected, you can now keep track of all the deals you care about across organizations. Start by viewing Salesforce lists from this new org to stay informed.",{salesforceOrgName:c}))),n.createElement(O.jl,null,n.createElement(O.ox,null,n.createElement(O.s_,{type:"outline",onClick:l,autoClogProps:D,"aria-label":M.t("Later")},M.t("Later")),n.createElement(O.s_,{type:"primary",onClick:r,autoClogProps:D,"aria-label":M.t("View Salesforce Lists")},M.t("View Salesforce Lists"))))))};OnboardingNewOrgConnectedModal.displayName="OnboardingNewOrgConnectedModal";var R=a(0x11c82607b),P=a(0x46dbff89);let L=(0,R.Ay)("Opens Onboarding New Org Connected Modal",(e,t)=>{e((0,P.q)({element:n.createElement(OnboardingNewOrgConnectedModal,null)}))});L.meta={name:"openOnboardingNewOrgConnectedModal",key:"createThunkOpenOnboardingNewOrgConnectedModal",description:"Opens Onboarding New Org Connected Modal"};var U=a(0xbd196b81),B=a(0x330e5328),H=a(0x1472af90a),V=a(0xf052d367),W=a(0x1bee6742c),j=a.n(W);let G=new l.Ay("modernselling"),UserOrgConnectionBaseModal=({title:e,mainText:t,additionalText:a,userOrgsToConnect:l,defaultSelectedOrgId:b="",handleClose:E,onOrgConnected:v})=>{let x=(0,i.wA)(),w=(0,y.d4)(A.H2),O=(0,y.d4)(A.$r),[k,N]=(0,n.useState)(b),T=(0,y.d4)(e=>(0,V.h$)(e,H.G7.SalesHomeNotificationsOnboarding)),I=(0,n.useCallback)(()=>{E(),x((0,S.O)())},[x,E]),F=(0,n.useCallback)(()=>{x((0,C.m)({salesforceOrgId:k})),T?(x((0,U.T)({salesforceOrgId:k})),x(L())):I(),v?.()},[x,k,I,v,T]),handleContinue=async()=>{let e=l.find(({salesforce_org_id:e})=>e===k);if(!e)return;let{salesforce_org_id:t}=e;"seamless-auth"===await x((0,B.m)({salesforceOrgId:t}))&&F()};return useWaitForOrgConnection(k,F),n.createElement(o.A,{centered:!0,closeModal:I},n.createElement(p.A,null,n.createElement(g.A,{title:e})),n.createElement(c.A,null,n.createElement(d.A,null,n.createElement(_.B,{space:"150"},"error"===w&&O&&n.createElement(f.F,{errorType:O}),n.createElement("span",{className:j().primaryText},t),n.createElement(h.v,{defaultCheckedOrgId:k,orgs:l,onOrgSelect:N}),n.createElement("span",{className:j().tertiaryText},a)))),n.createElement(u.A,null,n.createElement(m.A,null,n.createElement(s.A,{onClick:I,type:"outline","aria-label":G.t("Cancel")},G.t("Cancel")),n.createElement(r.lV,{loading:"fetching"===w,type:"primary",onClick:handleContinue,disabled:!k,"aria-label":G.t("Continue")},G.t("Continue")))))};UserOrgConnectionBaseModal.displayName="UserOrgConnectionBaseModal"},0x200c38ed8:(e,t,a)=>{"use strict";a.d(t,{aV:()=>useNotificationsOpportunitySchema,jv:()=>useNotificationsOpportunitySchemaForEndUser,qI:()=>useSalesHomeNotificationsSearcherOptions});var n=a(0xbad225b5),i=a(0x16cf1da63),l=a(0x133aee58f),r=a(0x3d5a0d18),o=a(0x12185e091),s=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,i=!0,l=!0,r=e?.allow_slack_connect_channels??!1;if(t&&n)return{shouldIncludePublicChannels:i,shouldIncludePrivateChannels:l,shouldIncludeSlackConnectChannels:r=!0};switch(a){case p.$4.PRIVATE_CHANNELS_ONLY:i=!1;break;case p.$4.NO_CHANNELS:i=!1,l=!1;case p.$4.ALL_CHANNELS:}return{shouldIncludePublicChannels:i,shouldIncludePrivateChannels:l,shouldIncludeSlackConnectChannels:r}}function useSalesHomeNotificationsSearcherOptions(e=""){let[t,a]=(0,n.useState)(!1),l=(0,i.wA)(),p=(0,c.d4)(t=>(0,u.uS)(t,e)),g=(0,c.d4)(s.K),f=p?.allowed_channel_workspaces,{shouldIncludePublicChannels:_,shouldIncludePrivateChannels:h,shouldIncludeSlackConnectChannels:b}=getChannelPermissions(p,g),y=(0,n.useMemo)(()=>({workspaceFilter:{type:d.MR.All},peopleFilter:{type:d.E7.All}}),[]),A=(0,r.J)(y),E=(0,n.useCallback)(e=>!(0,o.jq)(e)||A(e),[A]);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:b,includePrivate:h,includePublic:_,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:E}),[f,b,h,_,E])}}},0x1e84d332f:(e,t,a)=>{"use strict";a.d(t,{K:()=>isMigratingOrgPresent});let isMigratingOrgPresent=e=>e.some(e=>e.is_migrating)},0x146e4ebc8:(e,t,a)=>{"use strict";a.d(t,{V:()=>ActionBarForward});var n=a(0xbad225b5),i=a(0x16cf1da63),l=a(0x8601851c),r=a(0x40c0d834),o=a(0x20482ad21),s=a(0x344bb842),c=a(0x2501a2cee),d=a(0x4c96e5d9),u=a(0x11036d95f),m=a(0xe874a88a),p=a(0x22a29f141),g=a(0x1dfdeb1c8),f=a(0x1ec68d6a3),_=a(0xe747dd27);let h=(0,g.A)("salesHome.notifications.formatShare generated fetcher",(e,t,a)=>new m.S((n,i)=>{let{abortSignal:l,reason:r,...o}=a,s=(0,_.VA)(o);e((0,p.apiCall)({method:"salesHome.notifications.formatShare",args:s,abortSignal:l,reason:r})).then(e=>{n(e)}).catch(e=>{(0,f.Ay)({getState:t}).error(`API call to salesHome.notifications.formatShare with reason ${r} failed, initiated by generated fetcher`),i(e)})}));h.meta={name:"salesHomeNotificationsFormatShareFetcher",key:"createFetcherSalesHomeNotificationsFormatShareFetcher",description:"salesHome.notifications.formatShare generated fetcher"};var b=a(0x3711e82d),y=a(0x32d3ef3d),A=a(0xcea4a81c),E=a(0x113cdbbd7),S=a(0x1608420cc),C=a(0x103f48cb9),v=a(0x1506d547b),x=a(0xf7a922a4),w=a(0x181fc1a60);let O=(0,g.A)("salesHome.notifications.share generated fetcher",(e,t,a)=>new m.S((n,i)=>{let{abortSignal:l,reason:r,...o}=a,s=(0,_.VA)(o);e((0,p.apiCall)({method:"salesHome.notifications.share",args:s,abortSignal:l,reason:r})).then(e=>{n(e)}).catch(e=>{(0,f.Ay)({getState:t}).error(`API call to salesHome.notifications.share with reason ${r} failed, initiated by generated fetcher`),i(e)})}));O.meta={name:"salesHomeNotificationsShareFetcher",key:"createFetcherSalesHomeNotificationsShareFetcher",description:"salesHome.notifications.share generated fetcher"};var k=a(0x1d600678),N=a(0xa6b90d4b),T=a(0x24cf1145d),I=a(0x226892387);let F=new o.Ay("modernselling"),ForwardNotificationModal=e=>{let{createdTs:t,notificationType:a,isAdminCreated:l,msgOps:o,selectedChannelId:s,opportunityId:c,attachmentBlocks:d,salesforceRecord:u}=e,m=(0,i.wA)(),p="forward-sales-notification-dialog",g=F.t("Forward this notification");c&&(g=F.t("Forward this record update"));let f=F.t("Forward"),_=(0,n.useCallback)(()=>m((0,T.I)({channelOrMemberId:s,reason:p})).then(e=>{let a=m((0,N.A)({msgOps:o,channelId:e}))||[];return m(O({createdTs:t,channelId:e,...a.length&&{shareBlocks:a},reason:"sales-home-forward-notification",opportunityId:c}))}),[m,s,o,t,c]),h=(0,n.useMemo)(()=>({onClick:{enableClogAction:!0},elementName:"forward_notification_modal_btn",elementValue:t}),[t]),x=(0,n.useMemo)(()=>d&&n.createElement("div",{className:"c-message_attachment_v2"},n.createElement(C.A,{version2:!0}),n.createElement("div",null,n.createElement(S.A,{blocks:d,service:void 0,channelId:s,blocksContainerContext:E.pi.share_dialog}),u&&n.createElement("div",{className:"margin_top_100"},n.createElement(A.a,{entityState:y.w.enabled,size:y.S.expanded,record:u,showActionsBar:!1,isInteractive:!1})))),[d,u,s]),M=(0,I.d4)(e=>(0,k.x)(e,"salesforce_forwarding")?.default==="speedbump");return n.createElement(r.A,{eventId:b.EventId.LOB_SALES_HOME,uiComponentName:b.UiComponentName.LOB_NOTIFICATION_FORWARD_MODAL,channelId:s,lobNotificationType:a,isLobNotificationWorkflowAdmin:l},n.createElement(v.A,{...e,title:g,goButtonText:f,goButtonAutoClogProps:h,goHandler:_,dialogType:w.hs.NOTIFICATION,shareReason:p,notificationType:a,attachment:x,forwardingSpeedbumpEnabled:M}))};ForwardNotificationModal.displayName="ForwardNotificationModal";let M=(0,x.A)(ForwardNotificationModal);var D=a(0x11c82607b),R=a(0x46dbff89);let P=(0,D.Ay)("Opens the Forward Notification Modal",(e,t,a)=>{e((0,R.q)({element:n.createElement(M,a)}))});P.meta={name:"openForwardNotificationModal",key:"createThunkOpenForwardNotificationModal",description:"Opens the Forward Notification Modal"};let L=new o.Ay("modernselling"),ActionBarForward=({hasFocus:e,createdTs:t,notificationType:a,isAdminCreated:o,opportunityId:m})=>{let p=(0,i.wA)(),{maybeClosePeek:g}=(0,n.useContext)(u.Z),f=L.t("Forward notification");m&&(f=L.t("Forward record update"));let _=(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:i,salesforce_record:l}=n;p(P({createdTs:t,notificationType:a,isAdminCreated:o,contentBlocks:e,attachmentBlocks:i,salesforceRecord:l,opportunityId:m}))}g()},[p,t,m,g,a,o]),A=(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:_,action:"keyup"}]),()=>e.reset()},[_,y]),n.createElement(r.A,{eventId:b.EventId.LOB_SALES_HOME,uiComponentName:b.UiComponentName.LOB_NOTIFICATION_ACTIONS_BAR,lobNotificationType:a,isLobNotificationWorkflowAdmin:o},n.createElement(d.Ay,{tip:f,position:"top"},n.createElement(s.A,{"aria-label":f,onClick:y,className:"c-message_actions__button",size:"small",autoClogProps:A()},n.createElement(c.Ah,{name:"share-message"}))))};ActionBarForward.displayName="ActionBarForward"},0x129529b49:(e,t,a)=>{"use strict";a.d(t,{E:()=>OpportunityHoverCardTrigger});var n=a(0xbad225b5),i=a(0x1cbdfeceb),l=a(0x217f0c263),r=a(0x14fad6485),o=a(0x1f3598f80),s=a(0xc745739a),c=a(0x20482ad21),d=a(0x2b7f0bcc),u=a(0x102edf836),m=a(0x11a296110),p=a(0x1ee57b3a0),g=a(0x1fa67866c),f=a(0xb1ea448c),_=a(0x128d54e52),h=a(0x1535e80f3),b=a(0x15fb82076),y=a(0x2501a2cee),A=a(0x4c96e5d9),E=a(0x12b6a33fc),S=a(0x16cf1da63),C=a(0xe874a88a),v=a(0x22a29f141),x=a(0x1dfdeb1c8),w=a(0x1ec68d6a3),O=a(0xe747dd27);let k=(0,x.A)("sfdc.getOpportunity generated fetcher",(e,t,a)=>new C.S((n,i)=>{let{abortSignal:l,reason:r,...o}=a,s=(0,O.VA)(o);e((0,v.apiCall)({method:"sfdc.getOpportunity",args:s,abortSignal:l,reason:r})).then(e=>{n(e)}).catch(e=>{(0,w.Ay)({getState:t}).error(`API call to sfdc.getOpportunity with reason ${r} failed, initiated by generated fetcher`),i(e)})}));function useFetchOpportunityInfo(){let e=(0,S.wA)();return(0,n.useCallback)((t,a)=>e(k({id:t,reason:"sales-home-get-opportunity-info",salesforceOrgId:a})),[e])}k.meta={name:"sfdcGetOpportunityFetcher",key:"createFetcherSfdcGetOpportunityFetcher",description:"sfdc.getOpportunity generated fetcher"};var N=a(0x1c659cbb1),T=a(0x110b4f809),I=a(0xe38b5635),F=a(0x1ed767a16),M=a(0x6960d8b9),D=a(0x226892387),R=a(0x1c8beab7f);let P=a.p+"crown-f27246b.svg",L=new c.Ay("modernselling"),U={elementName:"open_in_salesforce",onClick:{enableClogAction:!0}},B={elementName:"copy_opportunity_link",onClick:{enableClogAction:!0}},H=new RegExp(/\bhttps?:\/\/[^\s]+\b/g),OpportunityNextStep=({nextStep:e})=>{let t=e.split(H),a=e.match(H)||[],i=t.reduce((e,t,i)=>{if(e.push(t),i{let i,l=e?.id??t?.record_identifier,r=e?.record_link??t?.record_link,o=useFetchOpportunityInfo(),s=(0,D.d4)(R.cc),[c,b]=(0,n.useState)(),[S,C]=(0,n.useState)(!0),[v,x]=(0,n.useState)(!1),[w,O]=(0,T.A)(!1,2e3);(0,n.useEffect)(()=>{l&&o(l,a).then(e=>{b(e)}).catch(()=>{x(!0)}).finally(()=>{C(!1)})},[o,l,a]);let k=(0,n.useCallback)(()=>n.createElement(N.f1,{className:"p-sales_feed__opp_hover_card_avatar",size:36,imageUrl:P,isInteractive:!1}),[]),H=(0,n.useCallback)(()=>n.createElement(N.Ay,{className:"c-base_entity__avatar",size:h.RG.small,userId:e?.owner.slack_user_id,isInteractive:!1,tabIndex:-1,ariaHidden:!0}),[e]),V=(0,n.useCallback)(()=>{(0,F.x3)(r),O(!0)},[r,O]),W=s.length>1?s.find(e=>e.salesforce_org_id===a)?.name:void 0;return i=c?W?c.account?.name?L.rt("Opportunity in {account_name}, {salesforceOrgName}",{account_name:c.account.name,salesforceOrgName:W}):L.rt("Opportunity in {salesforceOrgName}",{salesforceOrgName:W}):c.account?.name?L.t("Opportunity in {account_name}",{account_name:c.account.name}):L.t("Opportunity"):W?L.rt("Opportunity in {salesforceOrgName}",{salesforceOrgName:W}):"Opportunity",n.createElement(I.A,{elevation:4,size:"medium",className:"p-sales_feed__opp_hover_card"},S&&n.createElement(g.A,{className:"margin_top_200"},n.createElement(f.A,{size:"jumbo"})),v&&n.createElement(g.A,null,n.createElement(d.Ay,{type:"boxed",level:"error",className:"margin_bottom_150"},L.rt("Oops\u2026 we had trouble fetching opportunity info"))),c&&n.createElement(n.Fragment,null,n.createElement(p.A,null,n.createElement(_.Ay,{size:"medium",avatar:k,text:n.createElement(_.CG,{className:"black",withTruncationTooltip:!0},c.name),subtext:n.createElement(_.sT,{className:"caption p-sales_feed__opp_hover_card_header_subtext"},i)})),n.createElement(g.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"},L.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"},L.t("Close date")),(0,M.Yq)((0,M.$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"},L.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"},L.t("Owner")),n.createElement(_.Ay,{avatar:H,className:"c-member c-member--small",text:n.createElement("span",{className:"c-member__primary_content"},n.createElement(_.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"},L.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:r,autoClogProps:U},n.createElement("span",{className:"p-sales_feed__opp_hover_card_linkbutton_text"},L.t("Open in Salesforce")),n.createElement(y.Ah,{inline:!0,name:"new-window"})),n.createElement(A.Ay,{tip:w?L.t("Copied!"):L.t("Copy link"),status:w?E.YU.Success:E.YU.Info},n.createElement(m.Ay,{className:"p-sales_feed__opp_hover_card_copybutton",size:"medium",type:"outline",onClick:V,autoClogProps:B,"aria-label":w?L.t("Copied"):L.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)(r._0),[u,m]=(0,n.useState)(null),p=(0,n.useRef)(null),g=(0,n.useCallback)(()=>{let e=(e=>{let{pageYOffset:t,innerWidth:a,innerHeight:n}=e.deref()||{pageYOffset:0,innerWidth:0,innerHeight:0};return{top:(0,s.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,i=t.bottom+250>e.bottom,l=t.top-250{m(null)},[]),_=(0,n.useCallback)(()=>{let e=g();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}))))},[g,a,t,f,c]),[h,b]=(0,o.i)(_),[y,A]=(0,o.i)(f),E=(0,n.useCallback)(()=>(A(),u)?void b():h(350),[A,h,b,u]),S=(0,n.useCallback)(()=>(b(),u)?y(250):void A(),[b,y,A,u]);return n.createElement("span",{className:"p-sales_feed__opportunity_hover_card",onMouseOver:E,onMouseLeave:S,onClick:E,role:"presentation",onFocus:i.A,ref:p},e,u)};OpportunityHoverCardTrigger.displayName="OpportunityHoverCardTrigger"},0xfca33088:(e,t,a)=>{"use strict";a.d(t,{N:()=>L});var n=a(0xbad225b5),i=a(0x120c268ad),l=a.n(i),r=a(0x11a296110),o=a(0x2501a2cee),s=a(0x1fdec3e16),c=a(0x16cf1da63),d=a(0x77727995),u=a(0x130d89881),m=a(0x1a043bf26),p=a(0x20482ad21),g=a(0x1d104c491),f=a(0x2493ba930),_=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:g.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:_()[`${e}_text`]||_().standard_text,border:_()[`${e}_border`]||_().standard_border,borderDark:_()[`${e}_border_dark`]||_().standard_border_dark,lightText:_()[`${e}_light_text`]||_().standard_light_text,background:_()[`${e}_background`]||_().standard_background}}function RecordsListTableHeader({column:e,displayType:t,isSortAsc:a,isSortKey:i,onClick:c}){let d=getDisplayTypeClassNames(t);return n.createElement(r.Nm,{onClick:c,className:l()(_().records_list_table_cell,_().records_list_table_cell_header,d.text)},n.createElement(s.A,{withTooltip:!0,lines:1},e.name),i&&n.createElement(o.Ah,{name:a?"arrow-up":"arrow-down",size:"16"}))}RecordsListTableHeader.displayName="RecordsListTableHeader";let b=new p.Ay("modernselling");function RecordsListTablePagination({pageRange:[e,t],totalItems:a,autoClogProps:i,onNextClick:l,onPrevClick:s}){return n.createElement("div",{className:_().records_list_table_pagination},n.createElement(r.Nm,{"aria-label":b.t("Previous page"),autoClogProps:i,disabled:!s,onClick:s},n.createElement(o.Ah,{name:"caret-left",size:"16"})),n.createElement("span",null,b.t("Showing {start}-{end} of {totalItems}",{start:e+1,end:t,totalItems:a})),n.createElement(r.Nm,{"aria-label":b.t("Next page"),autoClogProps:i,disabled:!l,onClick:l},n.createElement(o.Ah,{name:"caret-right",size:"16"})))}RecordsListTablePagination.displayName="RecordsListTablePagination";var y=a(0x4c96e5d9),A=a(0x146e4ebc8),E=a(0x174bb7323),S=a(0x1faa3f1ac),C=a(0x1feb18f19),v=a(0x129529b49),x=a(0x11928a844),w=a.n(x);let Stage=e=>n.createElement("div",{className:l()(w().stage,{[w().previous]:"previous"===e.type,[w().current]:"current"===e.type})},n.createElement(s.A,{lines:1,withTooltip:!0},e.children));Stage.displayName="Stage";var O=a(0x113cdbbd7),k=a(0x944e06df),N=a(0x81d6854c),T=a(0xf01a9d50);let I=new p.Ay("modernselling");function MaybeHoverCard({record:e,children:t,shouldHide:a,salesforceOrgId:i}){return a||isGenericRecord(e)?n.createElement(n.Fragment,null,t):n.createElement(v.E,{opportunity:e,salesforceOrgId:i},t)}function MaybeLink({record:e,children:t,shouldHide:a}){return a?n.createElement(n.Fragment,null,t):n.createElement(S.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,i=e.amount_change_raw.percent,l=!t&&100===i,r=`${l?"-":""}${i}%`;return 0x7fffffff===i&&(r=I.t("New")),n.createElement("div",{className:l||a<0?_().amount_change_negative:_().amount_change_positive},n.createElement(s.A,{lines:1,withTooltip:!0},n.createElement("span",{className:"bold"},e.amount_change),n.createElement("span",null," (",r,")")))};renderRecordDeltaValue.displayName="renderRecordDeltaValue";let renderRecordNameValue=(e,t,{isPreview:a,showHoverCard:i},l)=>n.createElement(MaybeHoverCard,{record:e,shouldHide:a||!i,salesforceOrgId:l},n.createElement(MaybeLink,{record:e,shouldHide:!i},n.createElement(S.A,null,n.createElement(s.A,{lines:1},n.createElement(o.Ah,{inline:!0,...(0,T.C)(getObjectType(e))}),n.createElement("span",{className:"margin_left_25 bold"},getRecordName(e)))))),renderOpportunityRecordStageChangeValue=e=>n.createElement(C.c,{space:"75"},n.createElement(Stage,{type:"previous"},e.prev_stage),n.createElement(o.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(k.A,{blocks:e.close_date_change?.blocks,blocksContainerContext:O.pi.sales_home_notification}):n.createElement(C.c,{space:"75"},n.createElement(N.A,null));renderOpportunityRecordRichTextValue.displayName="renderOpportunityRecordRichTextValue";let renderOpportunityRecordStageValue=e=>n.createElement(Stage,{type:"current"},e.stage);renderOpportunityRecordStageValue.displayName="renderOpportunityRecordStageValue";let renderRecordValueAsString=(e,t)=>n.createElement(s.A,{lines:1,withTooltip:!0},n.createElement("span",{className:t.primary_sort?"bold":void 0},(0,E.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:i,salesforceOrgId:r,notificationCreatedTs:o,isLastRow:s,isWorkflowPreview:c}){let[d,u]=(0,n.useState)(!1),m=(0,n.useMemo)(()=>{if(a)return[];let e=getRecordKey(i);return[{key:"opportunity-share-button",enabled:!!o,render:()=>e&&o&&n.createElement(A.V,{hasFocus:!!t,createdTs:o,notificationType:"record",isAdminCreated:!0,opportunityId:e})}].filter(({enabled:e=!0})=>e)},[a,i,o,t]),p=!a&&m.length>0,g=(0,n.useCallback)(()=>u(!0),[]),f=(0,n.useCallback)(()=>u(!1),[]),h=!a,b=n.createElement("div",{onPointerOver:g,onPointerLeave:f,className:l()(_().records_list_table_row,_().records_list_table_row_body,{[_().records_list_table_row_border]:!s}),style:h?{cursor:"pointer"}:void 0},e.map(t=>c?n.createElement("div",{key:t.name,className:l()(_().records_list_table_cell,_().preview_table_cell,getDisplayTypeClassNames("standard").background)}):n.createElement("div",{key:t.name,className:l()(_().records_list_table_cell,{[_().records_list_table_cell_2_col]:2===e.length})},renderRecordValue(i,t,{isPreview:a,showHoverCard:!1},r))),p&&n.createElement("div",{className:l()(_().records_list_action_bar_container,p&&(t||d)&&_().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"},b):b}RecordsListTableRow.displayName="RecordsListTableRow";var M=a(0x106809bc6);function getPageRange(e,t,a){return[(0,M.A)(e,0,a-1),(0,M.A)(e+t,t,a)]}function usePagination(e,{pageSize:t}){let[a,i]=(0,n.useState)(0);(0,n.useEffect)(()=>i(0),[t]);let l=e.length,r=Math.ceil(l/t),o=a>=t,s=ai(0),[]),d=(0,n.useCallback)(()=>i(e=>e-t),[t]),u=(0,n.useCallback)(()=>i(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:o?d:void 0,next:s?u:void 0,range:m,reset:c,totalPages:r}}var D=a(0x754ea859),R=a(0xc0b7c558);function RecordsListTable({columns:e,displayType:t,isPreview:a,records:i,paginationAutoClogProps:r,salesforceOrgId:o,notificationCreatedTs:s,isWorkflowPreview:p,isStepPreview:g}){let[f,h]=(0,n.useState)(!1),[b,y]=(0,n.useState)(()=>getInitialSortByValue(e)),A=getDisplayTypeClassNames(t),{page:E,reset:S,...C}=usePagination((0,n.useMemo)(()=>p?[...i]:[...i].sort((e,t)=>{let a="asc"===b.dir,n=isGenericRecord(e)?getGenericRecordValue(e,b):(0,d.A)(e,b.key),i=isGenericRecord(t)?getGenericRecordValue(t,b):(0,d.A)(t,b.key);return("string"==typeof n&&"string"==typeof i&&(n=n.toLocaleUpperCase(),i=i.toLocaleUpperCase()),void 0===n)?1:void 0===i?-1:ni?a?1:-1:0}),[p,i,b]),{pageSize:5}),v=(0,n.useCallback)(e=>()=>{S(),y(({key:t,dir:a})=>({key:e,dir:e===t&&"asc"===a?"desc":"asc"}))},[S]),x=(0,n.useCallback)(e=>{let a=getColumnSortField(e);return n.createElement(RecordsListTableHeader,{key:e.name,column:e,displayType:t,isSortAsc:"asc"===b.dir,isSortKey:!p&&a===b.key,onClick:v(a)})},[b,v,t,p]),w=(0,n.useCallback)((i,{hasFocus:l,hasFocusWithin:r})=>n.createElement(RecordsListTableRow,{key:getRecordKey(E[i]),columns:e,displayType:t,isFocused:l||r,isPreview:a,record:E[i],salesforceOrgId:o,notificationCreatedTs:s,isLastRow:i===E.length-1,isWorkflowPreview:p}),[E,e,t,a,o,s,p]),O=(0,n.useCallback)(()=>h(!0),[]),k=(0,n.useCallback)(()=>h(!1),[]),N=(0,c.wA)(),T=(0,n.useCallback)(e=>{N((0,D.c)({recordId:E[e.id].slack_record_id??(0,R.j)(o,getRecordKey(E[e.id]))}))},[N,E,o]);return n.createElement("div",{onPointerOver:O,onPointerLeave:k,className:l()(A.background,_().records_list_table,{[_().records_list_table_workflow_preview]:p,[_().records_list_table_workflow_step_preview]:g})},n.createElement("div",{className:_().records_list_table_row},e.map(x)),n.createElement(u.A,{disableHeight:!0},({width:e})=>n.createElement(m.A,{keys:Object.keys(E),width:e,height:51*E.length,rowRenderer:w,onItemClick:a?void 0:T,containerClassName:l()(_().records_list_table_rows_container,f&&!p?A.borderDark:A.border)})),C.totalPages>1&&n.createElement(RecordsListTablePagination,{pageRange:C.range,totalItems:i.length,autoClogProps:r,onNextClick:C.next,onPrevClick:C.prev}))}RecordsListTable.displayName="RecordsListTable";var P=a(0x3711e82d);let L=n.memo(({columns:e,displayType:t="standard",isWorkflowPreview:a,isExpandedByDefault:i=a,isPreview:c,isStepPreview:d,records:u,title:m,workflowId:p,salesforceOrgId:g,notificationCreatedTs:f})=>{let[h,b]=(0,n.useState)(i),y=(0,n.useCallback)(()=>b(e=>!e),[]),A=getDisplayTypeClassNames(t),E=(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()(_().records_list_container,{[_().preview_not_expanded]:a&&!h})},n.createElement(r.Nm,{autoClogProps:E("expand_notification"),className:l()(A.text,A.background,_().records_list_toggle,h&&_().records_list_toggle_expanded),onClick:y},n.createElement(o.Ah,{name:h?"caret-down-filled":"caret-right-filled",size:"20"}),a?n.createElement(s.A,{withTooltip:!0,lines:1},n.createElement("span",{className:_().records_list_title},m)):n.createElement(n.Fragment,null,n.createElement("span",{className:_().records_list_title},m),n.createElement("span",{className:A.text},u.length))),h&&n.createElement(RecordsListTable,{columns:e,displayType:t,isPreview:c,records:u,paginationAutoClogProps:E("show_more"),salesforceOrgId:g,notificationCreatedTs:f,isWorkflowPreview:a,isStepPreview:d}))})},0xc5a3e186:(e,t,a)=>{"use strict";e.exports=a.p+"closing-soon-56adea6.svg"},0x10398ed1f:(e,t,a)=>{"use strict";e.exports=a.p+"missing-fields-6aaf1ef.svg"},0x86226b0b:(e,t,a)=>{"use strict";e.exports=a.p+"outdated-fields-a212a08.svg"},0x11a940e89:(e,t,a)=>{"use strict";e.exports=a.p+"past-close-date-993aaf3.svg"},0x18008605a:(e,t,a)=>{"use strict";a.d(t,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var n=a(0x19f42982e),i=a(0x152d4868a),l=a(0xe76086ae);let __WEBPACK_DEFAULT_EXPORT__=function(e,t,a){var r=e.length;if(r<2)return r?(0,l.A)(e[0]):[];for(var o=-1,s=Array(r);++o{"use strict";a.d(t,{A:()=>__WEBPACK_DEFAULT_EXPORT__});let __WEBPACK_DEFAULT_EXPORT__=function(){return!0}},0x1909216e8:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});var n=a(0x96910e17),i=a(0x21b3c8033),l=a(0x18008605a),r=a(0x1144c65c4);let o=(0,i.A)(function(e){return(0,l.A)((0,n.A)(e,r.A))})}}]); //# sourceMappingURL=https://slack.com/source-maps/bv1-13/gantry-v2-async-client-sales-admin-view.0b9e0d02d77e5b8768c7.min.js.mapØA —Eoúô