forked from Romeo-Rosete/awesome
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
8162-9be3b44d0089a091.js.download
87 lines (82 loc) · 30.9 KB
/
8162-9be3b44d0089a091.js.download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8162],{22938:function(e,n,t){t.d(n,{y:function(){return A}});var r=t(77293),o=t(28165),i=t(61854);const a=(e,n)=>(0,o.iv)({display:"flex",justifyContent:"center",alignItems:"center",marginLeft:e,marginRight:n}),l=({ariaHidden:e=!0,ariaLabel:n,name:t,position:o})=>(0,r.U)("div",{css:a("formX"===t&&"before"===o?"-5px":"0px","formX"===t&&"after"===o?"-5px":"0px")},(0,r.U)(i.J,{ariaHidden:e,ariaLabel:n,name:t,size:24}));var c=t(39479),s=t(3e3),u=t(98628),d=t(10391),p=t(70776),h=t(26215),v=t(38137),f=t(2784);const g=(0,f.createContext)(void 0),y=({children:e})=>{const[n,t]=(0,f.useState)(void 0),[r,o]=(0,f.useState)(void 0),[i,a]=(0,f.useState)(!1);return f.createElement(g.Provider,{value:{body:n,isTruncated:i,setBody:t,setTitle:o,setIsTruncated:a,title:r}},e)};var m=t(87593);const b=(0,v.F)("InteractiveTagWrapper",["backgroundColor","backgroundColorHover","backgroundColorFocus","color","colorHover","colorFocus","outlineColor","outlineOpacity"]),Z=(0,c.B)("InteractiveTag",{root:e=>o.iv`
max-width: ${e};
position: relative;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 10px;
text-align: center;
padding: 11px 15px;
height: 44px;
border-radius: 30px;
${s.ZT.paragraph3Semibold};
// Explicitly set 'line-height' to improve vertical alignment
// in Safari.
line-height: 44px;
white-space: nowrap;
transition: ${u.f.transitionValue};
color: var(${b.color});
background-color: var(${b.backgroundColor});
text-decoration: none;
&:hover {
color: var(${b.colorHover});
background-color: var(${b.backgroundColorHover});
box-shadow: ${d.f.elevation6};
}
&:focus {
color: var(${b.colorFocus});
background-color: var(${b.backgroundColorFocus});
${b.outlineOpacity}: 1;
outline: none;
}
&[data-color='primary'] {
border: 1px solid ${p.w.neutral600};
${b.color}: ${p.w.neutral800};
${b.colorHover}: ${p.w.blue};
${b.colorFocus}: ${p.w.blue};
${b.outlineColor}: ${p.w.blue};
${b.backgroundColor}: ${p.w.neutral200};
${b.backgroundColorHover}: ${p.w.neutral200};
${b.backgroundColorFocus}: ${p.w.neutral200};
&:hover {
border: 1px solid ${p.w.blue};
}
&:focus {
border: none;
}
}
&[data-color='secondary'] {
${b.color}: ${p.w.neutral100};
${b.colorHover}: ${p.w.neutral100};
${b.colorFocus}: ${p.w.neutral100};
${b.backgroundColor}: ${p.w.neutral800};
${b.outlineColor}: ${p.w.neutral800};
${b.backgroundColorHover}: ${p.w.neutral700};
${b.backgroundColorFocus}: ${p.w.neutral800};
}
&::before {
content: '';
opacity: var(${b.outlineOpacity}, 0);
position: absolute;
top: -4px;
right: -4px;
bottom: -4px;
left: -4px;
border: 2px solid var(${b.outlineColor});
border-radius: inherit;
transition: inherit;
}
`}),C=({children:e,color:n,href:t,onClick:o,maxWidth:i="none"})=>{const a={css:Z.root(i),"data-color":n,onClick:o},l=()=>t?(0,r.U)(h.r,Object.assign({},a,{color:null,href:t,weight:null}),e):(0,r.U)("button",Object.assign({},a,{type:"button"}),e);return(0,r.U)(y,null,(0,r.U)(g.Consumer,null,(e=>(null===e||void 0===e?void 0:e.isTruncated)?(0,r.U)(m.p,{allowMultilineTooltip:!0,content:e.body?`${e.title}: ${e.body}`:`${e.title}`,shouldCorrectPosition:!0},(()=>(0,r.U)(l,null))):(0,r.U)(l,null))))};var x=t(55414);const S={root:(0,o.iv)({overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"})},A=Object.assign((({children:e,color:n,href:t,iconAfter:o,iconAfterAriaHidden:i=!0,iconAfterAriaLabel:a,iconBefore:c,iconBeforeAriaHidden:s=!0,iconBeforeAriaLabel:u,onClick:d,maxWidth:p="none"})=>(0,r.U)(C,{color:n,href:t,onClick:d,maxWidth:p},c&&(0,r.U)(l,{ariaHidden:s,ariaLabel:u,name:c,position:"before"}),e,o&&(0,r.U)(l,{ariaHidden:i,ariaLabel:a,name:o,position:"after"}))),{Icon:l,Content:({body:e,title:n})=>{const t=(0,f.useRef)(null),{setBody:o,setIsTruncated:i,setTitle:a}=(()=>{const e=(0,f.useContext)(g);if(void 0===e)throw new Error("useInteractiveTagContext must be used within an InteractiveTagProvider (which is available by using InteractiveTag or InteractiveTagWrapper)");return e})();return(0,f.useEffect)((()=>{i(!!t.current&&t.current.scrollWidth>t.current.clientWidth),o(e),a(n)}),[]),(0,r.U)("div",{css:S.root,ref:t},(0,r.U)(x.x,{color:"inherit",type:"paragraph3Semibold"},n,e?": ":""),e&&(0,r.U)(x.x,{color:"inherit",type:"paragraph3"},e))},Wrapper:C})},85788:function(e,n,t){var r=t(92228),o=t(52903),i=t(28165),a=t(28952),l=t(66266),c=t(41273),s=t(55414),u=t(20110),d=t(38716),p=t(2784),h=t(73223),v=t(87744),f=t(28413);function g(){var e=(0,r.Z)(["\n display: grid;\n grid-gap: 10px;\n grid-template-columns: 1fr;\n "]);return g=function(){return e},e}function y(){var e=(0,r.Z)(["\n margin: auto;\n display: flex;\n gap: 20px;\n "]);return y=function(){return e},e}var m=(0,i.iv)("text-align:center;display:grid;grid-gap:20px;","AccountMismatchModal.tsx--root"),b=(0,v.uq)({mobile:(0,i.iv)(g()),tablet:(0,i.iv)(y())}),Z=(0,i.iv)("justify-content:center;align-items:center;display:flex;gap:10px;","AccountMismatchModal.tsx--header");n.Z=function(e){var n=e.account,t=e.continueText,r=void 0===t?"Cancel":t,i=e.targetAccountId,v=e.noun,g=(0,p.useState)(""),y=g[0],C=g[1];(0,p.useEffect)((function(){C((0,d.L5)(i||""))}),[i]);var x=(null===n||void 0===n?void 0:n.normalizedName)||"Account";return(0,o.tZ)(a.u,{ariaLabel:"Account mismatch",canClose:!1,onClosed:function(){},children:(0,o.tZ)(l.hz,{children:(0,o.BX)("div",{css:m,children:[(0,o.BX)("div",{css:Z,children:[(0,o.tZ)(c.q,{name:x,size:40,url:(0,f.Z)((null===n||void 0===n?void 0:n.normalizedImageUrl)||"")}),(0,o.tZ)(s.x,{tag:"h1",type:"paragraph1Bold",children:x})]}),(0,o.BX)(s.x,{tag:"p",type:"paragraph3",children:["That ",v," belongs to the ",x," account. Would you like to switch to that account to view the ",v,"?"]}),(0,o.BX)("div",{css:b,children:[(0,o.BX)(u.z,{color:"primary",href:y,target:"_self",children:["Switch to ",x]}),(0,o.tZ)(u.z,{color:"secondary",href:h.Mh,children:r})]})]})})})}},28162:function(e,n,t){t.d(n,{Z:function(){return Pe}});var r=t(52903),o=t(85788),i=t(47497),a=t(49146),l=t(28165),c=t(39633),s=t(82610),u=t(30896),d=t(2784),p=t(76128),h=t(47043),v=t(53939),f=t(39996),g=t(5632),y=t(70865),m=t(96670),b=t(38716),Z=t(70776),C=t(3e3),x=t(61854),S=t(42126),A=t(55414),w=t(20110),I=t(78581),k=t(23755),B=t(14725),T=t(1083),$=t(15504),L=t(74936),Q=t(39479),F=t(77293);const P=(0,Q.B)("InteractiveTags",{root:l.iv`
display: flex;
align-items: center;
flex-wrap: wrap;
// TODO: Switch to Flexbox 'gap' when Safari supports it
// and remove 'Styles.item' entirely.
margin-bottom: -10px;
`,item:l.iv`
margin-bottom: 10px;
&:not(:last-child) {
margin-right: 10px;
}
`}),M=e=>{const n=d.Children.toArray(e.children).filter(Boolean).map(((e,n)=>(0,F.U)("li",{css:P.item,key:n},e)));return(0,F.U)("ul",{"aria-label":e.ariaLabel,css:P.root},n)};var E=t(22938),O=t(71802),z=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t};const U=e=>{var{disabled:n,isDisabled:t}=e,r=z(e,["disabled","isDisabled"]);return(0,F.U)(O.G,Object.assign({},r,{isDisabled:n||t,type:"radio"}))};var X=t(26215),q=t(17688),_=t(54110),D=t(33885),N=t(16181),V=function(e){var n=e.accountId,t=e.currentUser,o=e.memberId,i=e.setOwnedByQuery,a=(0,_.LR)({accountId:n,currentUser:t,defaultSelectedMemberId:o||"",ownedBySearch:!0}),l=a.members,c=a.onSearch,s=a.selectedItem,u=a.search,d=a.isLoading,p=a.handleMemberChange,h=a.onLoadMore,v=a.isLoadingMore,f=function(e){p(e),i((null===e||void 0===e?void 0:e.id)||"")};return(0,r.tZ)("div",{"data-testid":"ownedBySearch",children:(0,r.tZ)(q.g,{label:"Owned by",renderInput:function(){return(0,r.tZ)(D.OwnerSearch,{currentUser:t,inputValue:u||"",isBusy:d,isDisabled:!1,isLoadingMore:v,members:l,onChange:f,onInputValueChange:c,onLoadMore:h,selectedItem:s,showLoadMore:Boolean(h)})}})})},H=function(e){var n=e.setOwnedByQuery,t=e.ownedByQuery,o=(0,b.X8)(),i=(0,N.gn)(),a=i.userId,l=i.email,c=i.fullName,s=i.photoUrl;if(!a||!o)return null;var u={id:a,email:l||"",fullName:c||"",photoUrl:s||""};return(0,r.tZ)(V,{accountId:o,currentUser:u,memberId:t,setOwnedByQuery:n})},R=t(92228),W=t(64476),j=t(79775),J=t(50930);function G(e,n){switch(n.type){case"UPDATE_SEARCH":return(0,m.Z)((0,y.Z)({},e),{search:n.search});case"UPDATE_SELECTED_API":return(0,m.Z)((0,y.Z)({},e),{selectedApi:n.selectedApi});case"UPDATE_SELECTED_API_AND_SEARCH":return(0,m.Z)((0,y.Z)({},e),{selectedApi:n.selectedApi,search:n.search});default:return e}}var K=t(57037),Y=t(9562);var ee=function(e){var n=e.inputValue,t=e.isLoading,o=e.onChange,i=e.onInputValueChange,a=e.selectedItem,l=e.connections,c=null===l||void 0===l?void 0:l.map((function(e){return(0,m.Z)((0,y.Z)({},e),{label:null===e||void 0===e?void 0:e.title})})),s=a?(0,m.Z)((0,y.Z)({},a),{label:a.title}):null;return(0,r.tZ)(j.p,{showClearSelectionButton:!!a,id:"CustomAppSearchTypeahead",itemLabel:"label",itemKey:"id",isBusy:t,ariaLabel:"App Search",selectedItem:s||null,items:c,inputValue:n,menuAriaLabel:"menuAriaLabel",placeholder:"",onInputValueChange:i,onChange:o,openOnFocus:!0,renderIcon:ne,inputIcon:ne,keepInputValueOnBlur:!0})},ne=function(e){var n,t=e.item;return t&&(null===t||void 0===t||null===(n=t.images)||void 0===n?void 0:n.url32X32)?(0,r.tZ)(W.A,{serviceName:String(t.title),size:20,src:t.images.url32X32}):(0,r.tZ)(x.J,{name:"navSearch",size:24})},te=function(e){var n=e.fieldLabel,t=function(e){var n=e.setConnectionQuery,t=e.setZapApp,r=e.setZapAppIdQuery,o={selectedApi:e.zapAppIdQuery||"",search:void 0},i=(0,d.useState)(!1),a=i[0],l=i[1],c=(0,d.useReducer)(G,o),s=c[0],u=s.search,p=s.selectedApi,h=c[1],v=(0,K.Z)(u,300),f=(0,Y.Z)({selectedFilter:"all",search:v,skipAppSearchRecommendations:!0}),g=f.connections,y=f.isLoading,m=(0,Y.Z)({selectedFilter:"myApps",search:v,skipAppSearchRecommendations:!0}),b=m.connections,Z=m.isLoading,C=(0,Y.Z)({selectedFilter:"private",search:v,skipAppSearchRecommendations:!0}),x=C.connections,S=C.isLoading,A=(0,Y.Z)({selectedFilter:"sharedWithMe",search:v,skipAppSearchRecommendations:!0}),w=A.connections,I=A.isLoading,k=(0,J.Z)(g).concat((0,J.Z)(b),(0,J.Z)(x),(0,J.Z)(w)),B=Array.from(new Set(k.map((function(e){return e.id})))).map((function(e){return k.find((function(n){return n.id===e}))})),T=null===B||void 0===B?void 0:B.find((function(e){return(null===e||void 0===e?void 0:e.selectedApi)===p}));(0,d.useEffect)((function(){T&&!a&&(h({type:"UPDATE_SEARCH",search:T.title}),l(!0),t&&t(T))}),[T,a,t]);var $=(0,d.useCallback)((function(e){(e.type===j.V.InputChange||e.type===j.V.FunctionOpenMenu||e.type===j.V.InputBlur||[6,7,13].includes(e.type))&&h({type:"UPDATE_SEARCH",search:e.inputValue})}),[h]),L=(0,d.useCallback)((function(e){null===e||void 0===e?(h({type:"UPDATE_SELECTED_API_AND_SEARCH",selectedApi:"",search:""}),r(""),n(""),t&&t(null)):(h({type:"UPDATE_SELECTED_API_AND_SEARCH",selectedApi:e.selectedApi,search:e.title}),r(e.selectedApi),t&&t(e))}),[h,r,t,n]);return{isLoading:S||I||Z||y,onSearch:$,search:u,selectedItem:T,handleChange:L,connections:B}}({setConnectionQuery:e.setConnectionQuery,setZapApp:e.setZapApp,setZapAppIdQuery:e.setZapAppIdQuery,zapAppIdQuery:e.zapAppIdQuery}),o=t.connections,i=t.handleChange,a=t.isLoading,l=t.onSearch,c=t.search,s=t.selectedItem;return(0,r.tZ)("div",{"data-testid":"CustomAppSearch",children:(0,r.tZ)(q.g,{label:n||"App",renderInput:function(){return(0,r.tZ)(ee,{connections:o,inputValue:c||"",isLoading:a,onChange:i,onInputValueChange:l,selectedItem:s})}})})},re=t(87744),oe=t(81901),ie=t(60390),ae=function(e){var n=e.appName,t=e.connection,o=e.serviceSlug,i=e.selectedApi,a=e.setConnectionQuery,l=(0,N.gn)().userId,c=(0,ie.Z)({userId:l,serviceSlug:o,selectedApi:i,limit:200,skip:!(i||o)}),s=c.allAuthentications,u=c.isConnectionsLoading,p=(0,d.useMemo)((function(){return s.map((function(e){return{label:e.title,value:e.id}}))}),[s]),v=(0,d.useState)(null),f=v[0],g=v[1],y=(0,d.useMemo)((function(){return"Choose ".concat(n||""," connection")}),[n]),m=(0,d.useMemo)((function(){return"No available ".concat(n||""," connections")}),[n]);return(0,d.useEffect)((function(){n||a("")}),[n,a]),(0,d.useEffect)((function(){a((null===f||void 0===f?void 0:f.value)||"")}),[f,a]),(0,d.useEffect)((function(){var e=n?p.find((function(e){return(null===e||void 0===e?void 0:e.value)===t})):null;g(e||null)}),[g,n,t,p]),(0,r.tZ)(q.g,{label:"Connection",renderInput:function(e){return u?(0,r.tZ)(h.q,{height:42}):(0,r.tZ)(oe.L,{initialSelectedItem:f,inputId:e.id,isReadonly:!p.length,getLabelForItem:function(e){return e.label},placeholder:p.length?y:m,readOnlyText:m,onChange:function(e){g(e)},menuAriaLabel:"List of available connections for the selected app",selectedItem:f,items:p})}})};function le(){var e=(0,R.Z)(["\n display: flex;\n flex-direction: column;\n width: 100%;\n gap: 10px;\n margin-bottom: 10px;\n & > div {\n flex-grow: 1;\n }\n "]);return le=function(){return e},e}function ce(){var e=(0,R.Z)(["\n flex-direction: row;\n gap: 25px;\n "]);return ce=function(){return e},e}var se=(0,l.iv)("padding-top:25px;position:relative;","AddFilters.tsx--rootStyle"),ue=(0,re.uq)({mobile:(0,l.iv)(le()),tablet:(0,l.iv)(ce())}),de=(0,l.iv)("border-top:1px solid ",Z.w.neutral400,";padding-top:25px;","AddFilters.tsx--dividerStyle"),pe=function(e){var n=e.zapAppIdQuery,t=e.connection,o=e.setZapAppIdQuery,i=e.setConnectionQuery,a=(0,d.useState)(null),l=a[0],c=a[1],s=(0,d.useCallback)((function(e){c(e),(null===e||void 0===e?void 0:e.selectedApi)!==n&&i("")}),[c,i,n]);return(0,r.tZ)("div",{css:se,children:(0,r.BX)("div",{children:[(0,r.tZ)("div",{css:[ue,de],children:(0,r.tZ)(te,{fieldLabel:"App",setConnectionQuery:i,setZapApp:s,setZapAppIdQuery:o,zapAppIdQuery:n})}),(0,r.tZ)(ae,{appName:null===l||void 0===l?void 0:l.title,connection:t,setConnectionQuery:i,serviceSlug:(null===l||void 0===l?void 0:l.slug)||"",selectedApi:null===l||void 0===l?void 0:l.selectedApi})]})})},he=(0,l.iv)('position:relative;[data-testid="floating-box"]{width:100% !important;}',"SearchOptionsAdvancedMenu.tsx--dropdownMenuStyle"),ve=(0,l.iv)("padding:20px;> ul{overflow:visible !important;}","SearchOptionsAdvancedMenu.tsx--dropdownMenuItemsStyle"),fe=(0,l.iv)("display:flex;justify-content:space-between;","SearchOptionsAdvancedMenu.tsx--dropdownSubtextStyle"),ge=(0,l.iv)("border-top:1px solid ",Z.w.neutral400,";padding-top:25px;","SearchOptionsAdvancedMenu.tsx--dividerStyle"),ye=(0,l.iv)("align-items:center;background:inherit;border:none;color:",Z.w.neutral600,";cursor:pointer;display:flex;justify-content:center;&:focus,&:active,&:focus-within,&:hover{color:inherit;}","SearchOptionsAdvancedMenu.tsx--clearButtonStyle"),me=(0,l.iv)("display:flex;> div{width:100%;}","SearchOptionsAdvancedMenu.tsx--filterWrapperStyle"),be=(0,l.iv)("background:",Z.w.neutral200,";display:flex;justify-content:flex-end;padding:10px 20px;","SearchOptionsAdvancedMenu.tsx--feedbackStyle"),Ze=function(e){var n=e.connection,t=e.folderTypeQuery,o=e.handleSearchOptionsDropdown,i=e.ownedByQuery,a=e.searchTypeQuery,l=e.setConnectionQuery,c=e.setFolderTypeQuery,s=e.setOwnedByQuery,u=e.setSearchTypeQuery,p=e.setTriggerQuery,h=e.setZapAppIdQuery,f=e.trigger,g=e.zapAppIdQuery,y=(0,b.X8)(),m=(0,d.useCallback)((function(e){(0,B.Z)({accountId:y,eventAction:"click",interactionName:"search_type_interaction",optionSelected:e,systemName:"settings"})}),[y]),Z=(0,d.useMemo)((function(){return[{searchType:T.sq.zap,label:"Zaps",icon:"miscBoltAlt"},{searchType:T.sq.folder,label:"Folders",icon:"navFolder"},{searchType:T.sq.webhook,label:"Webhooks",icon:"miscWorld"}]}),[]);return(0,r.tZ)("div",{css:he,children:(0,r.BX)($.f,{align:"left",position:"south",children:[(0,r.tZ)("div",{css:ve,children:(0,r.BX)(L.v,{ariaLabel:"Search by Zap, folder, webhook or all",id:"zap-folder-search-dropdown",role:"listbox","aria-roledescription":"Select if you would like to search for Zaps, folders, webhooks or all",children:[(0,r.BX)("div",{css:fe,children:["I'm looking for...",(0,r.tZ)("button",{css:ye,onClick:o,"aria-label":"Close dropdown",children:(0,r.tZ)(x.J,{canAcceptPointerEvents:!1,name:"formX",size:24})})]}),(0,r.tZ)(v.L,{height:20}),(0,r.tZ)(M,{children:Z.map((function(e){return(0,r.BX)(E.y.Wrapper,{color:a===e.searchType?"secondary":"primary",onClick:function(){var n=T.sq[e.searchType];m(e.searchType),u(n),c(T.Zq.empty),s(""),h(""),p(""),l("")},children:[(0,r.tZ)(E.y.Icon,{name:e.icon,position:"before"}),e.label]},"search-dropdown-option-".concat(e.label))}))}),a===T.sq.folder&&(0,r.BX)(d.Fragment,{children:[(0,r.tZ)(v.L,{height:15}),(0,r.tZ)("div",{css:fe,children:"Narrow your search (by default, we'll search for all Folders)"}),(0,r.tZ)(v.L,{height:10}),(0,r.BX)("div",{css:me,children:[(0,r.tZ)(U,{checked:t===T.Zq.personal,name:"folderTypeQueryRadio",onChange:function(){c(T.Zq.personal)},value:"personal",children:"Personal folders"}),(0,r.tZ)(U,{checked:t===T.Zq.shared,name:"folderTypeQueryRadio",onChange:function(){c(T.Zq.shared)},value:"shared",children:"Shared folders"})]})]}),a===T.sq.zap&&(0,r.BX)(d.Fragment,{children:[(0,r.tZ)(v.L,{height:25}),(0,r.tZ)("div",{css:[fe,ge],children:"Narrow your search (by default, we'll search for all Zaps)"}),(0,r.tZ)(v.L,{height:20}),(0,r.tZ)("div",{css:me,children:(0,r.tZ)(H,{ownedByQuery:i,setOwnedByQuery:s})}),(0,r.tZ)(pe,{connection:n,setZapAppIdQuery:h,zapAppIdQuery:g,setConnectionQuery:l,setTriggerQuery:p,trigger:f})]})]})}),(0,r.tZ)("div",{css:be,children:(0,r.BX)(A.x,{tag:"p",children:["Not what you're looking for?"," ",(0,r.tZ)(X.r,{href:"https://zap-search.zapier.app",target:"_blank",children:"Leave feedback"})]})})]})})},Ce=(0,l.iv)("position:relative;left:-1px;> button{border-top-left-radius:0px !important;border-bottom-left-radius:0px !important;&:focus,&:active{z-index:1 !important;}}","FolderZapSearchInputV3.tsx--magnifyButtonStyle"),xe=(0,l.iv)("align-items:center;background:inherit;border:0;border-right:1px solid ",Z.w.neutral600,";cursor:pointer;display:flex;gap:6px;height:100%;justify-content:center;padding:0 15px 0 8px;width:fit-content;","FolderZapSearchInputV3.tsx--searchZapierButtonStyle"),Se=(0,l.iv)("display:flex;height:45px;* div{margin:0px !important;}","FolderZapSearchInputV3.tsx--textInputWrapperStyle"),Ae=(0,l.iv)('flex:1;position:relative;right:-1px;> div{border-top-right-radius:0px !important;border-bottom-right-radius:0px !important;}* input{padding-left:9px !important;}&:focus,&:active,&:focus-within{[data-testid="FolderZapSearchOptions"]{border-right:1px solid ',Z.w.blueJeans," !important;box-shadow:0 0 0 1px ",Z.w.blueJeans,' !important;}}&:hover{[data-testid="FolderZapSearchOptions"]{border-right:1px solid ',Z.w.blueJeans," !important;}}","FolderZapSearchInputV3.tsx--textInputStyle"),we=(0,l.iv)("align-items:center;background:inherit;border:none;color:",Z.w.neutral600,";cursor:pointer;display:flex;justify-content:center;&:focus,&:active,&:focus-within,&:hover{color:inherit;}","FolderZapSearchInputV3.tsx--clearButtonStyle"),Ie=(0,l.iv)(C.ZT.base,";",C.ZT.smallPrint1Bold,";align-items:center;background-color:",Z.w.blue100,";border-radius:100px;color:",Z.w.neutral800,";display:inline-flex;font-size:14px;font-weight:700;gap:5px;height:26px;justify-content:center;line-height:20px;padding:3px 8px;text-align:center;margin-left:9px;","FolderZapSearchInputV3.tsx--badgeStyle"),ke=function(e){var n=e.searchQuery,t=e.setSearchQuery,o=(0,b.X8)(),a=(0,g.useRouter)(),l=(0,i.Z)(),c=l.searchType,s=l.folderType,u=l.app,p=l.ownedBy,h=l.connection,v=l.trigger,f=l.setParams,Z=(0,d.useState)(!1),C=Z[0],$=Z[1],L=(0,d.useState)(T.sq[c]||T.sq.empty),Q=L[0],F=L[1],P=(0,d.useState)(T.Zq[s]||T.Zq.empty),M=P[0],E=P[1],O=(0,d.useState)(p||""),z=O[0],U=O[1],X=(0,d.useState)(u||""),q=X[0],_=X[1],D=(0,d.useState)(h||""),N=D[0],V=D[1],H=(0,d.useState)(v||""),R=H[0],W=H[1],j=(0,d.useCallback)((function(){$(!C),(0,B.Z)({accountId:o,eventAction:C?"close":"open",interactionName:"search_type_interaction",optionSelected:"",systemName:"settings"})}),[o,C,$]),J=(0,d.useMemo)((function(){return n||!n&&(M||q||z||R||N)}),[n,M,q,z,R,N]),G=(0,d.useCallback)((function(){if(J){var e=(0,y.Z)((0,m.Z)((0,y.Z)({},n?{search:n}:{}),{searchType:Q||T.sq.all}),M?{folderType:M}:{},q?{app:q}:{},z?{ownedBy:z}:{},R?{trigger:R}:{},N?{connection:N}:{});a.push({pathname:"/app/zaps",query:e}),(0,I.Ch)("search-".concat(encodeURI(n)))}C&&j()}),[J,M,j,C,z,a,n,Q,q,R,N]),K=(0,d.useCallback)((function(e){"Enter"===e.key&&G()}),[G]),Y=(0,d.useCallback)((function(e){var n=e.target.value;t(n)}),[t]),ee=(0,d.useCallback)((function(e){e.preventDefault(),f({},["app","connection","folderType","orderBy","ownedBy","search","searchType","trigger","webhook_url"]),t(""),F(T.sq.empty),E(T.Zq.empty),_(""),U(""),W(""),V("")}),[V,E,U,f,t,F,W]),ne=(0,d.useMemo)((function(){return[{searchType:T.sq.zap,label:"Zaps",icon:"miscBoltAlt"},{searchType:T.sq.folder,label:M?M===T.Zq.personal?"Personal folders":"Shared folders":"Folders",icon:M===T.Zq.shared?"team":"navFolder"},{searchType:T.sq.webhook,label:"Webhooks",icon:"miscWorld"}]}),[M]),te=(0,d.useMemo)((function(){var e=ne.find((function(e){return e.searchType===Q}));return e?(0,r.BX)("span",{css:Ie,"aria-hidden":"true",children:[(0,r.tZ)(x.J,{name:e.icon,size:14}),e.label]}):null}),[Q,ne]);return(0,r.tZ)(d.Fragment,{children:(0,r.BX)(k.Z,{onClickOutside:function(){C&&j()},children:[(0,r.BX)("div",{css:Se,children:[(0,r.tZ)("div",{css:Ae,"data-testid":"FolderZapSearchInputV3",children:(0,r.tZ)(S.o,{ariaLabel:"Input search term to search Zaps, folders, webhooks or all",onChange:Y,onKeyDown:K,renderIconBefore:function(e){var n=e.iconSize,t=e.isFocused,o=e.isHovered,i=t||o||C?"inherit":"neutral600";return(0,r.BX)(d.Fragment,{children:[(0,r.BX)("button",{"data-testid":"FolderZapSearchOptions",css:xe,onClick:function(){return j()},"aria-haspopup":"listbox","aria-expanded":C,"aria-controls":"zap-folder-search-dropdown","aria-label":"Select if you would like to refine your search for Zaps, folders or webhooks",children:[(0,r.tZ)(x.J,{canAcceptPointerEvents:!1,color:i,name:C?"arrowSmallDown":"arrowSmallRight",size:n}),(0,r.tZ)(A.x,{color:t||o||C?"black":"neutral700",fontWeight:600,children:"Search"})]}),Q&&te]})},renderIconAfter:function(e){var t=e.iconSize,o=e.isFocused,i=e.isHovered,a=o||i?void 0:"neutral600";return n||Q?(0,r.tZ)("button",{css:we,onClick:ee,"aria-label":"Clear search",children:(0,r.tZ)(x.J,{canAcceptPointerEvents:!1,color:a,name:"formX",size:t})}):null},type:"search",value:n})}),(0,r.tZ)("div",{css:Ce,"data-testid":"FolderZapSearchButtonV3",children:(0,r.tZ)(w.z,{ariaLabel:"Search for ".concat("all"!==Q&&Q?"".concat(Q,"s"):"Zaps and folders"),color:"primary",iconBefore:"magnifyingGlass",id:"top-search-button",onClick:G,size:"small",disabled:!J})})]}),C&&(0,r.tZ)(Ze,{connection:h,folderTypeQuery:M,handleSearchOptionsDropdown:j,ownedByQuery:z,searchTypeQuery:Q,setConnectionQuery:V,setFolderTypeQuery:E,setOwnedByQuery:U,setSearchTypeQuery:F,setTriggerQuery:W,setZapAppIdQuery:_,trigger:v,zapAppIdQuery:q})]})})},Be=function(){var e=(0,g.useRouter)(),n=(0,i.Z)().search,t=(0,d.useState)(n||""),o=t[0],a=t[1];return(0,d.useEffect)((function(){var n=function(e){!e.includes("search=")&&o&&a("")};return e.events.on("routeChangeComplete",n),function(){e.events.off("routeChangeComplete",n)}})),(0,r.tZ)(ke,{setSearchQuery:a,searchQuery:o})},Te=t(59400),$e=t(73223),Le=(0,l.iv)("display:flex;> div{flex:1;}","FolderZapSearchInputConditionalWrapper.tsx--searchInputWrapperStyles"),Qe=function(){var e=(0,i.Z)().folderId,n=(0,Te.Z)(),t=n.isSearchServiceMVPEnabled,o=n.isFlagsLoading,a=String(e)===String($e.ZJ);return(0,r.tZ)(d.Fragment,{children:o?(0,r.tZ)(p.g,{children:(0,r.tZ)(h.q,{height:44,width:"100%"})}):(0,r.BX)("div",{css:Le,children:[t?(0,r.tZ)(Be,{}):(0,r.tZ)(f.Z,{}),!a&&(0,r.tZ)(v.L,{width:49})]})})},Fe=(0,l.iv)("display:flex;flex-direction:column;gap:20px;","MyZapsPage.tsx--myZapsPageStyles"),Pe=function(e){var n=e.discoveredAccount,t=e.serverErrors;(0,a.Z)({serverErrors:t});var l=(0,i.Z)(),d=l.search,p=l.searchType,h=l.emptyQuerySearch;return n?(0,r.tZ)(o.Z,{account:n,continueText:"Continue to Home folder",noun:"folder",targetAccountId:null===n||void 0===n?void 0:n.id}):(0,r.tZ)(u.N,{children:(0,r.BX)("div",{css:Fe,children:[(0,r.tZ)(Qe,{}),(d||h)&&(0,r.tZ)(s.Z,{}),!p&&(0,r.tZ)(c.Z,{})]})})}},15666:function(e,n,t){var r=t(92228);function o(){var e=(0,r.Z)(["\n fragment AppConnection on AppConnection {\n banner\n canConnect\n id\n slug\n selectedApi\n title\n images {\n url128X128\n url64X64\n url32X32\n url16X16\n }\n hasStaleAuth\n }\n"]);return o=function(){return e},e}var i=(0,t(60138).Ps)(o());n.Z=i},9562:function(e,n,t){t.d(n,{I:function(){return x},Z:function(){return S}});var r,o=t(70865),i=t(96670),a=t(50930),l=t(2784),c=t(40794),s=t(86692),u=t(64368);!function(e){e[e.empty=0]="empty",e[e.initial=1]="initial",e[e.loaded=2]="loaded",e[e.more=3]="more"}(r||(r={}));var d=function(e){switch(e){case u.I.loading:case u.I.setVariables:case u.I.refetch:return r.initial;case u.I.fetchMore:case u.I.poll:return r.more;case u.I.ready:return r.loaded}return r.empty},p=t(92228),h=t(60138),v=t(15666);function f(){var e=(0,p.Z)(["\n ","\n\n query GetAppConnections(\n $offset: Int!\n $limit: Int!\n $isPrivate: Boolean\n $owner: ID\n $isShared: Boolean\n $title: String\n ) {\n appConnections(\n offset: $offset\n limit: $limit\n isPrivate: $isPrivate\n owner: $owner\n isShared: $isShared\n title: $title\n ) {\n totalCount\n pageInfo {\n count\n hasNextPage\n }\n edges {\n ...AppConnection\n canConnect\n }\n }\n }\n"]);return f=function(){return e},e}var g=(0,h.Ps)(f(),v.Z),y=t(38017);function m(){var e=(0,p.Z)(["\n query GetCustomAppCount {\n appConnections(offset: 0, limit: 1, isPrivate: true) {\n totalCount\n }\n }\n"]);return m=function(){return e},e}var b=(0,h.Ps)(m()),Z=function(e){var n,t=e.skip,r=(0,c.a)(b,{skip:t}),o=r.data,i=r.loading;return{count:(null===o||void 0===o||null===(n=o.appConnections)||void 0===n?void 0:n.totalCount)||0,isLoading:i||!1}},C=t(16181),x=20,S=function(e){var n,t,r,u,p,h,v,f=e||{},m=f.page,b=void 0===m?0:m,S=f.search,A=void 0===S?"":S,w=f.selectedFilter,I=f.skipAppSearchRecommendations,k=(0,C.gn)(),B=k.isTeam,T=k.userId,$="private"===w,L=function(e){var n=e.selectedFilter,t=void 0===n?"myApps":n,r=e.page,o=void 0===r?0:r,i=e.limit,a=void 0===i?x:i,l=e.userId,c=e.search,s=void 0===c?"":c,u=e.isPrivate;return{isShared:"sharedWithMe"===t||null,limit:a,offset:o*a,owner:"myApps"===t&&l||null,title:s,isPrivate:void 0!==u&&u}}({page:b,search:A,userId:T,selectedFilter:w}),Q=Z({skip:B}),F=(0,c.a)(g,{skip:$||!T,variables:L}),P=(0,c.a)(g,{skip:!(!w||$)||!T,variables:(0,i.Z)((0,o.Z)({},L),{isPrivate:!0})}),M=(0,y.Z)(I?"":A),E=(null===(n=P.data)||void 0===n||null===(t=n.appConnections)||void 0===t?void 0:t.totalCount)||0,O=((null===(r=F.data)||void 0===r||null===(u=r.appConnections)||void 0===u?void 0:u.totalCount)||0)+E,z=(0,s.e$)(F.error||P.error),U=(0,l.useMemo)((function(){var e,n,t,r,l=(null===F||void 0===F||null===(e=F.data)||void 0===e||null===(n=e.appConnections)||void 0===n?void 0:n.edges)||[],c=(null===P||void 0===P||null===(t=P.data)||void 0===t||null===(r=t.appConnections)||void 0===r?void 0:r.edges)||[];return(0,a.Z)(l.map((function(e){return(0,i.Z)((0,o.Z)({},e),{isPrivate:!1})}))).concat((0,a.Z)(c.map((function(e){return(0,i.Z)((0,o.Z)({},e),{isPrivate:!0})}))))}),[F,P]),X=(0,l.useCallback)((function(){var e,n,t,r,l,c,s=$?P:F,u=(null===s||void 0===s||null===(e=s.data)||void 0===e||null===(n=e.appConnections)||void 0===n||null===(t=n.edges)||void 0===t?void 0:t.length)||0;return s.loading||!(null===s||void 0===s||null===(r=s.data)||void 0===r||null===(l=r.appConnections)||void 0===l||null===(c=l.pageInfo)||void 0===c?void 0:c.hasNextPage)?null:s.fetchMore({updateQuery:function(e,n){var t=n.fetchMoreResult;if(!t)return e;var r=e.appConnections.edges||[],l=t.appConnections.edges||[];return(0,i.Z)((0,o.Z)({},t),{appConnections:(0,i.Z)((0,o.Z)({},t.appConnections),{edges:(0,a.Z)(r).concat((0,a.Z)(l))})})},variables:{offset:u}})}),[$,P,F]),q=Boolean(null===(p=($?P:F).data)||void 0===p||null===(h=p.appConnections)||void 0===h||null===(v=h.pageInfo)||void 0===v?void 0:v.hasNextPage);return{appAlternatives:null===M||void 0===M?void 0:M.results,connections:U,count:O,error:z,hasMoreApps:q,hasPrivate:Q.count>0,isAltLoading:(null===M||void 0===M?void 0:M.isLoading)||(null===M||void 0===M?void 0:M.isPrivateLoading),isLoading:P.loading||F.loading,onLoadMoreApps:X,pageCount:Math.ceil(O/x),pageSize:x,privateLoadingState:d(P.networkStatus),publicLoadingState:d(F.networkStatus)}}},38017:function(e,n,t){t.d(n,{Z:function(){return f}});var r=t(50930),o=t(40794),i=t(2784),a=t(92228),l=t(60138),c=t(15666);function s(){var e=(0,a.Z)(["\n fragment App on App {\n categories {\n id\n name\n }\n canConnect\n currentImplementationId\n currentImplementationMeta {\n authType\n hasUpfrontFields\n id\n }\n description\n id\n image\n name\n primaryColor\n slug\n }\n"]);return s=function(){return e},e}var u=(0,l.Ps)(s());function d(){var e=(0,a.Z)(["\n ","\n\n query AppSearch($nameContains: String!) {\n appsByNameContains(nameContains: $nameContains) {\n edges {\n ...App\n }\n }\n }\n"]);return d=function(){return e},e}function p(){var e=(0,a.Z)(["\n ","\n\n query PrivateAppSearch($nameContains: String!) {\n privateAppConnections(nameContains: $nameContains) {\n edges {\n ...AppConnection\n currentImplementationMeta {\n authType\n hasUpfrontFields\n id\n }\n canConnect\n }\n }\n }\n"]);return p=function(){return e},e}var h=(0,l.Ps)(d(),u),v=(0,l.Ps)(p(),c.Z),f=function(e){var n=(0,o.a)(h,{variables:{nameContains:e},skip:!e.length}),t=(0,o.a)(v,{variables:{nameContains:e},skip:!e.length}),a=(0,i.useMemo)((function(){var e,t;return((null===n||void 0===n||null===(e=n.data)||void 0===e||null===(t=e.appsByNameContains)||void 0===t?void 0:t.edges)||[]).filter((function(e){return e.canConnect}))}),[n]),l=(0,i.useMemo)((function(){var e,n;return((null===t||void 0===t||null===(e=t.data)||void 0===e||null===(n=e.privateAppConnections)||void 0===n?void 0:n.edges)||[]).filter((function(e){return e.canConnect}))}),[t]);return{results:(0,i.useMemo)((function(){return(0,r.Z)(a).concat((0,r.Z)(l))}),[a,l]),isLoading:n.loading,isPrivateLoading:t.loading}}},28413:function(e,n,t){var r="https://cdn.zapier.com/zapier/",o=function(e){return e.replace(/(\/){2,}/g,"$1").replace(/(https?:\/)/g,"$1/").replace(/(\/static){2,}/g,"$1")},i=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return["http","data:","/media/storage","blob:"].some((function(n){return 0===(e||"").indexOf(n)}))};n.Z=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r;return i(e)?e:o("".concat(n,"/").concat(e))}}}]);
//# sourceMappingURL=8162-9be3b44d0089a091.js.map