forked from bombastictranz/awesome
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
9346-39f2bba9f43e1d73.js.download
2 lines (2 loc) · 71.5 KB
/
9346-39f2bba9f43e1d73.js.download
1
2
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9346],{82116:function(e,n,t){var i=t(52903),r=t(28165),a=function(e){var n,t=e.items.map((function(n,t){return(0,i.tZ)("li",{"data-testid":e.testId,children:e.itemRenderer(n,t)},e.getKey(n,t))}));return(0,i.tZ)("ul",{css:(n=e.gap,(0,r.iv)("list-style-type:none;display:flex;flex-direction:column;gap:",n,"px;li > a{text-decoration:none !important;}","List.tsx--rootStyle")),id:e.id,children:t})};a.defaultProps={getKey:function(e,n){return n},gap:10},n.Z=a},42722:function(e,n,t){t.d(n,{Z:function(){return I}});var i=t(70865),r=t(96670),a=t(92228),o=t(52903),l=t(28165),s=t(39097),c=t.n(s),u=t(70776),d=t(98628),p=t(10391),h=t(70398),v=t(76635),m=t(29620),f=t.n(m),g=function(e){return Array.isArray(e)?e:[e]};function Z(){var e=(0,a.Z)(["\n display: block;\n text-decoration: none !important;\n background-color: ",";\n border: "," solid\n ",";\n border-radius: 5px;\n padding: 15px;\n transition: ",";\n &:hover,\n &:focus {\n background-color: ",";\n border: 1px solid ",";\n box-shadow: ",";\n outline: 0;\n }\n "]);return Z=function(){return e},e}function b(){var e=(0,a.Z)(["\n padding: 15px 20px;\n "]);return b=function(){return e},e}var y={blue:{base:{backgroundColor:u.w.acidWash,border:u.w.blue},hover:{backgroundColor:u.w.neutral100,border:u.w.blue}},gray:{base:{backgroundColor:u.w.neutral100,border:u.w.neutral300},hover:{backgroundColor:u.w.neutral100,border:u.w.neutral300}},red:{base:{backgroundColor:u.w.neutral100,border:u.w.error400},hover:{backgroundColor:u.w.neutral100,border:u.w.error400}},white:{base:{backgroundColor:u.w.neutral100,border:u.w.blue},hover:{backgroundColor:u.w.neutral100,border:u.w.blue}}},x=function(e){return(0,h.uq)({mobile:(0,l.iv)(Z(),y[e.color].base.backgroundColor,"red"===e.color?"2px":"1px",y[e.color].base.border,d.f.transitionValue,y[e.color].hover.backgroundColor,y[e.color].hover.border,p.f.elevation5),tablet:(0,l.iv)(b())})},A=(0,l.iv)("cursor:pointer;","ListItem.tsx--clickableStyle"),C=function(e){var n,t,a=!e.href&&e.onClick?{onClick:e.onClick,onKeyDown:(n=["enter","space"],t=function(n){e.onClick&&e.onClick(n)},function(e){var i=g(n);(0,v.some)(i,(function(n){return e.keyCode===Number(f()(n))}))&&t(e)}),role:"button",tabIndex:0}:{};return e.href?(0,o.tZ)(c(),(0,r.Z)((0,i.Z)({href:e.href,target:e.target,legacyBehavior:!1},a),{children:(0,o.tZ)("span",{css:x(e),children:e.children})})):(0,o.tZ)("div",(0,r.Z)((0,i.Z)({css:[x(e),e.onClick&&A]},a),{children:e.children}))};C.defaultProps={color:"gray"};var I=C},15879:function(e,n,t){t.d(n,{Z:function(){return C}});var i=t(92228),r=t(52903),a=t(19928),o=t.n(a),l=t(28165),s=t(47043),c=t(55414),u=t(76635),d=["","k","M","B","T",""],p=function(e){if(!e||e<1&&e>-1)return(0,u.isNumber)(e)?e.toString():null;var n=Math.floor(Math.log(Math.abs(e))/Math.log(1e3)),t=d[Math.min(n,d.length)],i=String(Math.abs(e)/Math.pow(1e3,n)).substring(0,3),r=i.endsWith(".")?i.slice(0,-1):i;return"".concat(e<0?"-":"").concat(r).concat(t)},h=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;if(!e)return 0;var t=Math.floor(Math.log10(Math.abs(e))),i=t-n,r=e/Math.pow(10,i),a=Math[e<0?"floor":"ceil"](r);return parseFloat((a*Math.pow(10,i)).toPrecision(12))},v=function(e){var n=e.children,t=e.infinityLabel,i=void 0===t?"Infinity":t,a=e.isAbbreviated,o=void 0!==a&&a,l=e.isFriendly,s=void 0!==l&&l,c=e.isNegativeOneInfinity,d=void 0!==c&&c,v=e.maxDecimals,m=void 0===v?2:v,f=e.minDecimals,g=void 0===f?0:f,Z=e.nanLabel,b=void 0===Z?"NaN":Z,y=n;return(0,u.isNaN)(y)||!(0,u.isNumber)(y)?(0,r.tZ)("span",{children:b}):!(0,u.isFinite)(y)||d&&-1===y?(0,r.tZ)("span",{children:i}):(s&&(y=h(y)),y=o?p(y):y.toLocaleString(void 0,{maximumFractionDigits:m,minimumFractionDigits:g}),(0,r.tZ)("span",{title:o?n.toLocaleString():void 0,children:y}))},m=t(70398),f=t(49187);function g(){var e=(0,i.Z)(["\n align-items: center;\n display: grid;\n grid-gap: 5px;\n grid-template-columns: auto 1fr;\n "]);return g=function(){return e},e}function Z(){var e=(0,i.Z)(["\n grid-gap: 0px;\n grid-template-columns: 1fr;\n text-align: center;\n "]);return Z=function(){return e},e}function b(){var e=(0,i.Z)(["\n height: 20px;\n overflow: hidden;\n "]);return b=function(){return e},e}function y(){var e=(0,i.Z)(["\n height: 40px;\n "]);return y=function(){return e},e}var x=(0,m.uq)({mobile:(0,l.iv)(g()),desktop:(0,l.iv)(Z())}),A=(0,m.uq)({mobile:(0,l.iv)(b()),desktop:(0,l.iv)(y())}),C=function(e){var n=e.isLoading,t=e.label,i=e.count;return n?(0,r.tZ)("div",{css:A,children:(0,r.tZ)(s.q,{height:"100%",width:"100%"})}):(0,r.BX)("div",{css:[x,(0,f.f)(e.label.toLowerCase())],children:[(0,r.tZ)(c.x,{type:"paragraph3Bold",children:(0,r.tZ)(v,{children:i||0})}),(0,r.tZ)(c.x,{tag:"div",type:"smallPrint1",children:o()(t,i)})]})}},95207:function(e,n,t){t.d(n,{Z:function(){return Xt}});var i=t(52903),r=t(28165),a=t(5632),o=t(20271),l=t(60943),s=t(55414),c=t(76128),u=t(56119),d=t(66415),p=t(47043),h=t(2784),v=t(53939),m=t(87416),f=t(82116),g=t(70865),Z=t(8736),b=function(e,n){return(0,Z.emit)((0,g.Z)({},e||{}),n)},y=t(98788),x=t(96670),A=t(66383),C=t(5163),I=t(3842),S=t(33379),w=t(53736),k=t(50293),T=t(15466),D=t(94641),B=t(92228),M=t(60138);function L(){var e=(0,B.Z)(["\n query GetAuth($id: ID!) {\n authentication(id: $id) {\n id\n isStale\n }\n }\n"]);return L=function(){return e},e}function z(){var e=(0,B.Z)(["\n mutation DeleteAuthentication($id: ID!) {\n deleteAuthentication(id: $id)\n }\n"]);return z=function(){return e},e}function P(){var e=(0,B.Z)(["\n fragment TestAuth on TestAuthResponse {\n id\n errors\n success\n }\n"]);return P=function(){return e},e}function X(){var e=(0,B.Z)(["\n ","\n mutation TestAuth($id: ID!) {\n testAuth(id: $id) {\n ...TestAuth\n }\n }\n"]);return X=function(){return e},e}function $(){var e=(0,B.Z)(["\n mutation UpdateAuthTitle($id: ID!, $title: String!) {\n updateAuthTitle(id: $id, title: $title) {\n id\n title\n }\n }\n"]);return $=function(){return e},e}var R=(0,M.Ps)(L()),E=(0,M.Ps)(z()),F=(0,M.Ps)(P()),_=(0,M.Ps)(X(),F),q=(0,M.Ps)($()),O=function(e){return Array.isArray(e)&&e.length>0};function H(e){if(!e)return"";var n=function(e){var n=e.graphQLErrors;if(O(n)){var t,i,r,a=n[0],o=null===a||void 0===a||null===(t=a.extensions)||void 0===t?void 0:t.response,l=null===o||void 0===o||null===(i=o.body)||void 0===i?void 0:i.errors;if(O(l))return l[0]||"";var s=null===o||void 0===o||null===(r=o.body)||void 0===r?void 0:r.detail,c=null===o||void 0===o?void 0:o.status,u=null===o||void 0===o?void 0:o.statusText;return c&&u?"".concat(c,": ").concat(u).concat(s?" - ".concat(s):""):a.message||""}return""}(e)||function(e){var n,t=null===(n=e.networkError)||void 0===n?void 0:n.message;return t?"Network error: ".concat(t):""}(e)||e.toString()||"";return(null===n||void 0===n?void 0:n.message)||n}var W,N,Y,U,j=function(e){var n=e.cache,t=e.query,i=e.updater,r=e.variables;try{var a=n.readQuery({query:t,variables:r});if(!a)return;var o=i(a);n.writeQuery({data:o,query:t,variables:r})}catch(l){console.warn(l)}},K=function(e){var n=e.connection,t=e.serviceSlug,i=e.selectedApi,r=(0,w.l)().createNotification,a=(0,k.Z)(),o=(0,T.Z)({selectedApi:i,serviceSlug:t||""}).app,l=(0,A.Z)((0,I.t)(R),1)[0],s=(0,A.Z)((0,S.D)(E,{onCompleted:function(){r({message:"Successfuly deleted connection.",type:"success"})},onError:function(e){r({message:"Error deleting connection. ".concat(H(e)),type:"error"})},update:function(e,n){j({cache:e,query:D.c8,updater:function(e){var t;return{authentications:(0,x.Z)((0,g.Z)({},e.authentications),{edges:null===(t=e.authentications)||void 0===t?void 0:t.edges.filter((function(e){var t;return e.id!==(null===(t=n.data)||void 0===t?void 0:t.deleteAuthentication)})),totalCount:e.authentications.totalCount-1})}},variables:(0,g.Z)({},t?{serviceSlug:t}:{},i?{selectedApi:i}:{})})}}),1),c=s[0],u=(0,A.Z)((0,S.D)(_,{variables:{id:n.id},onError:function(){r({message:"Error testing connection.",type:"error"})}}),2),d=u[0],p=u[1],v=p.data,m=p.loading,f=(0,A.Z)((0,S.D)(q,{onError:function(){r({message:"Error updating name. Please try again.",type:"error"})}}),1)[0],Z=(0,h.useState)(0)[1],b=(0,h.useMemo)((function(){return null===v||void 0===v?void 0:v.testAuth}),[v]),B=(0,h.useRef)(b);(0,h.useEffect)((function(){b!==B.current&&(B.current=b,Z((function(e){return e+1})),(null===b||void 0===b?void 0:b.success)&&setTimeout((function(){B.current=void 0,Z((function(e){return e+1}))}),5e3))}),[b]);var M=(0,h.useCallback)((function(){c({variables:{id:null===n||void 0===n?void 0:n.id}})}),[c,n.id]),L=(0,h.useCallback)((0,y.Z)((function(){var e,t;return(0,C.__generator)(this,(function(i){switch(i.label){case 0:return[4,a(o,n)];case 1:return e=i.sent(),(null===(t=e.connection)||void 0===t?void 0:t.id)&&l({variables:{id:n.id}}),[2]}}))})),[a,l,n,o]);return{isTesting:m,onDeleteAuth:M,onReconnectAuth:L,onTestAuth:d,onUpdateAuthTitle:(0,h.useCallback)((function(e){f({optimisticResponse:{updateAuthTitle:{__typename:"Authentication",id:n.id,title:e}},variables:{id:n.id,title:e}})}),[f,n.id]),testAuthResult:B.current}},V=t(56675);function G(){var e=(0,B.Z)(["\n fragment PrimaryAuth on Authentication {\n created\n description\n destinationSelectedApi\n id\n identifier\n isPrivate\n isShared\n isStale\n permissions {\n delete\n edit\n reconnect\n share\n test\n transfer\n }\n selectedApi\n sharedWithAll\n title\n }\n"]);return G=function(){return e},e}function J(){var e=(0,B.Z)(["\n fragment SecondaryAuth on Authentication {\n destinationSelectedApiImages {\n url16X16\n url32X32\n url64X64\n url128X128\n }\n id\n owner {\n email\n id\n imageUrl\n name\n }\n selectedApiImages {\n url16X16\n url32X32\n url64X64\n url128X128\n }\n sharedWith {\n ... on ShareTeam {\n description\n id\n imageUrl\n memberCount\n name\n type\n }\n ... on ShareMember {\n description\n email\n id\n imageUrl\n name\n type\n }\n }\n zapCount\n }\n"]);return J=function(){return e},e}function Q(){var e=(0,B.Z)(["\n ","\n ","\n fragment Auth on Authentication {\n ...PrimaryAuth\n ...SecondaryAuth\n }\n"]);return Q=function(){return e},e}!function(e){e.admin="admin",e.member="member",e.owner="owner",e.super_admin="super_admin"}(W||(W={})),function(e){e.member="member",e.team="team"}(N||(N={})),function(e){e.asc="asc",e.desc="desc"}(Y||(Y={})),function(e){e.transfer="transfer",e.workflow="workflow"}(U||(U={}));var ee=(0,M.Ps)(G()),ne=(0,M.Ps)(J()),te=(0,M.Ps)(Q(),ee,ne);function ie(){var e=(0,B.Z)(["\n ","\n\n mutation CreateAuthMembership($id: ID!, $memberId: ID!) {\n createAuthMembership(id: $id, memberId: $memberId) {\n ...Auth\n }\n }\n"]);return ie=function(){return e},e}function re(){var e=(0,B.Z)(["\n ","\n\n mutation DeleteAuthMembership($id: ID!, $memberId: ID!) {\n deleteAuthMembership(id: $id, memberId: $memberId) {\n ...Auth\n }\n }\n"]);return re=function(){return e},e}function ae(){var e=(0,B.Z)(["\n ","\n\n mutation CreateAuthTeamship($id: ID!, $teamId: ID!) {\n createAuthTeamship(id: $id, teamId: $teamId) {\n ...Auth\n }\n }\n"]);return ae=function(){return e},e}function oe(){var e=(0,B.Z)(["\n ","\n\n mutation DeleteAuthTeamship($id: ID!, $teamId: ID!) {\n deleteAuthTeamship(id: $id, teamId: $teamId) {\n ...Auth\n }\n }\n"]);return oe=function(){return e},e}function le(){var e=(0,B.Z)(["\n mutation SetAuthIsShared($id: ID!, $isShared: Boolean!) {\n setAuthIsShared(id: $id, isShared: $isShared) {\n id\n isShared\n }\n }\n"]);return le=function(){return e},e}function se(){var e=(0,B.Z)(["\n mutation transferAuth($id: ID!, $customuserId: ID!) {\n transferAuth(id: $id, customuserId: $customuserId) {\n id\n customuserId\n }\n }\n"]);return se=function(){return e},e}var ce=(0,M.Ps)(ie(),te),ue=(0,M.Ps)(re(),te),de=(0,M.Ps)(ae(),te),pe=(0,M.Ps)(oe(),te),he=(0,M.Ps)(le()),ve=(0,M.Ps)(se()),me=function(e,n,t,i,r){var a=n.id,o=n.isShared,l=(0,w.l)().createNotification,s=(0,V.x)(),c=(0,A.Z)((0,S.D)(ce),1)[0],u=(0,A.Z)((0,S.D)(ue),1)[0],d=(0,A.Z)((0,S.D)(de),1)[0],p=(0,A.Z)((0,S.D)(pe),1)[0],v=(0,A.Z)((0,S.D)(he),1)[0],m=(0,A.Z)((0,S.D)(ve,{onCompleted:function(){l({message:"Connection ownership successfully changed",type:"success"}),t()},onError:function(){l({message:"Connection ownership successfully changed",type:"success"}),t()}}),1)[0],f=(0,h.useCallback)((function(e,t,i){t===N.member?i?c({variables:{id:a,memberId:e}}):u({optimisticResponse:{deleteAuthMembership:(0,x.Z)((0,g.Z)({},n),{sharedWith:n.sharedWith.filter((function(n){return n.id!==e}))})},variables:{id:a,memberId:e}}):i?d({variables:{id:a,teamId:e}}):p({optimisticResponse:{deleteAuthTeamship:(0,x.Z)((0,g.Z)({},n),{sharedWith:n.sharedWith.filter((function(n){return n.id!==e}))})},variables:{id:a,teamId:e}})}),[n,a,c,d,u,p]);return{onToggleAll:(0,h.useCallback)((function(e){e?d({optimisticResponse:{createAuthTeamship:(0,x.Z)((0,g.Z)({},n),{sharedWithAll:!0})},variables:{id:a,teamId:"all"}}):p({optimisticResponse:{deleteAuthTeamship:(0,x.Z)((0,g.Z)({},n),{sharedWithAll:!1})},variables:{id:a,teamId:"all"}})}),[n,d,a,p]),onToggleIsShared:(0,h.useCallback)((function(){v({optimisticResponse:{__typename:"Authentication",id:a,isShared:!o},variables:{id:a,isShared:!o}})}),[a,o,v]),onToggleShare:f,onTransferAuth:(0,h.useCallback)((function(n){(0,y.Z)((function(){return(0,C.__generator)(this,(function(t){switch(t.label){case 0:return[4,m({optimisticResponse:{transferAuth:{__typename:"Authentication",customuserId:n,id:a}},variables:{customuserId:n,id:a}})];case 1:return t.sent(),s.query({fetchPolicy:"network-only",query:D.c8,variables:{accountId:e,selectedApi:r,serviceSlug:i}}),[2]}}))}))()}),[e,s,a,r,i,m])}},fe=t(3e3),ge=t(70776),Ze=t(32945),be=t(64476),ye=t(12687),xe=t(47553),Ae=t(73223),Ce=t(25277),Ie=t(42722),Se=t(15879),we=t(70398),ke=function(e){return Array.isArray(e)&&e.length>0},Te=t(49187),De=t(71937),Be=t(25155),Me=t(19928),Le=t.n(Me),ze=function(e,n){var t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=Math.abs((0,Be.differenceInWeeks)(e,n));if(i>0&&i<4){var r=Math.abs((0,Be.differenceInDays)(e,n))%7,a=r<4?i:i+1,o=(0,Be.isAfter)(n,e),l=t&&o?"in ":"",s=t&&!o?" ago":"";return"".concat(l).concat(a," ").concat(Le()("week",a)).concat(s)}return(0,Be.distanceInWordsStrict)(e,n,{addSuffix:t})},Pe=(0,h.createContext)({}),Xe=function(){try{return(new Intl.DateTimeFormat).resolvedOptions().timeZone}catch(e){return null}},$e=t(82067),Re=function(e){return"number"===typeof e&&e<1e10&&(e*=1e3),new Date(e)},Ee={default:"MMMM DD, YYYY",short:"MMM DD, YYYY",exhaustive:"YYYY-MM-DD HH:mm:ss",iso:"YYYY-MM-DDTHH:mm:ssZ"},Fe=function(e,n,t){var i=Re(e);if("iso"===n)return i.toISOString();try{return(0,$e.default)(i,Ee[n]||n,t?{timezone:t}:void 0)}catch(r){try{return i.toLocaleDateString("en-US",t?{timeZone:t}:void 0)}catch(a){return Fe(e,n)}}},_e=Fe,qe=function(e){var n=e.date,t=e.formatter,r=void 0===t?ze:t,a=e.hasSuffix,o=(0,h.useContext)(Pe).timezone||Xe()||"UTC",l=_e(n,"iso",o);return(0,i.tZ)("time",{dateTime:l,title:l,children:r(Date.now(),n,!1!==a)})},Oe=(0,r.iv)("border-top:1px solid ",ge.w.neutral300,";display:grid;grid-gap:20px;margin-top:20px;padding-top:20px;","DownstreamConnections.tsx--rootStyle"),He=(0,r.iv)("display:grid;grid-gap:20px;","DownstreamConnections.tsx--listStyle"),We=function(e){return(0,i.BX)("div",{css:Oe,children:[(0,i.tZ)(s.x,{type:"smallPrint1Bold",children:"Gmail Approved Data Destinations"}),(0,i.tZ)("ul",{css:He,children:(e.connection.destinationAuths||[]).map((function(n){return(0,i.tZ)("li",{children:(0,i.tZ)(Bt,{accountId:e.accountId,connection:n,isDownstream:!0,isPersonal:e.isPersonal,isTeam:e.hasTeams,isAdmin:e.isAdmin})},n.id)}))})]})},Ne=t(76635),Ye=t(22211),Ue=t(87593),je=t(20110),Ke=t(61854),Ve=t(26215);var Ge=/\[([^[]+)\]\(([^)]+)\)/g;var Je=(0,r.iv)("min-width:200px;","TestErrorMessage.tsx--rootStyle");var Qe=function(e){var n=function(e){for(var n,t,r,a,o,l=e.trim(),s=0,c=[];null!==(n=Ge.exec(l));)0===s&&c.push(l.slice(0,n.index)),c.push((r=n[1],a=n[2],(0,i.tZ)(Ve.r,{href:a,children:r}))),t=n,s++;return c.length>0?(c.push(l.slice((null===t||void 0===t?void 0:t.index)+(null===t||void 0===t||null===(o=t[0])||void 0===o?void 0:o.length))),c):[l]}(e);return(0,i.tZ)("div",{css:Je,children:n})},en=t(28952),nn=t(66266),tn=t(61446),rn=t(96963),an=t(59712),on=t(90446),ln=t(41273),sn=t(66830),cn=t(15504),un=t(74936),dn=t(75725),pn=t(29476),hn=t(16181),vn=(0,r.iv)("display:grid;","ShareMember.tsx--descCss"),mn=(0,r.iv)("padding:10px;","ShareMember.tsx--menuCss"),fn=(0,r.iv)(fe.ZT.paragraph3Bold," color:",ge.w.neutral800,";text-transform:none;","ShareMember.tsx--nameCss"),gn=(0,r.iv)("align-items:center;cursor:initial;display:grid;grid-gap:10px;grid-template-columns:40px 1fr auto;min-width:min(80vw,600px);","ShareMember.tsx--rootStyle"),Zn=(0,r.iv)("grid-template-columns:40px 1fr auto 40px;","ShareMember.tsx--rootWithMenu");var bn=function(e){var n=(0,hn.gn)().isAdmin,t=(0,h.useState)(!1),r=t[0],a=t[1],o=(0,h.useState)(!1),l=o[0],c=o[1];return(0,i.BX)("div",{css:[gn,!e.isOwner&&Zn],children:[(0,i.tZ)(ln.q,{name:e.name,size:40,url:e.imageUrl}),(0,i.BX)("div",{css:vn,children:[(0,i.tZ)("span",{css:fn,children:e.name}),(0,i.tZ)(s.x,{type:"smallPrint3",children:e.description})]}),(0,i.tZ)(s.x,{type:"smallPrint3",children:e.isOwner?"Owner":"Has access"}),!e.isOwner&&(e.canTransfer||e.canTransfer)&&(0,i.BX)("div",{css:{position:"relative"},children:[(0,i.tZ)(sn.h,{icon:"navMoreHoriz",onClick:function(){return a(!0)}}),r&&(0,i.tZ)(cn.f,{align:"right",intersectHeight:140,minWidth:"170px",onClickOutside:function(){return a(!1)},children:(0,i.BX)("div",{css:mn,children:[(0,i.BX)(un.v,{ariaLabel:"Zap actions",children:[e.canEdit&&(0,i.tZ)(dn.s,{onClick:e.onRemove,children:"Remove"},"remove"),e.canTransfer&&(0,i.tZ)("div",{onMouseEnter:function(){return c(!0)},onMouseLeave:function(){return c(!1)},children:(0,i.tZ)(dn.s,{onClick:e.onTransfer,children:"Make Owner"},"transfer")})]}),l&&!n&&(0,i.tZ)(pn.u,{allowMultiline:!0,position:"northeast",children:"You will lose access to this connection when you transfer ownership."})]})})]})]})},yn=t(25914),xn=t(57037);function An(){var e=(0,B.Z)(["\n query ShareSearch($accountId: Int!, $search: String, $excludeTeams: Boolean) {\n searchShare(\n accountId: $accountId\n search: $search\n excludeTeams: $excludeTeams\n ) {\n description\n id\n imageUrl\n name\n type\n }\n }\n"]);return An=function(){return e},e}var Cn=(0,M.Ps)(An()),In=function(e){var n=e.accountId,t=e.excludeTeams,i=void 0!==t&&t,r=(0,A.Z)((0,I.t)(Cn),2),a=r[0],o=r[1],l=o.data,s=o.loading;return{error:o.error,isLoading:s,onSearch:function(e){e&&n&&a({variables:{accountId:n,excludeTeams:i,search:e}})},searchResults:(null===l||void 0===l?void 0:l.searchShare)||[]}};var Sn=function(e){var n=(0,h.useState)(0),t=n[0],r=n[1],a=(0,h.useState)(""),o=a[0],l=a[1],s=(0,xn.Z)(o,300),c=In({accountId:e.accountId,excludeTeams:e.excludeTeams}),u=c.isLoading,d=c.onSearch,p=c.searchResults,v=e.memberExclusions?p.filter((function(n){var t;return"member"!==n.type||!(null===(t=e.memberExclusions)||void 0===t?void 0:t.includes(n.id))})):p;return(0,h.useEffect)((function(){e.onInputValueChange&&e.onInputValueChange(s),d(s)}),[s]),(0,i.tZ)(yn.Z,{ariaLabel:"Member ".concat(e.excludeTeams?"":"and team ","search"),autoComplete:"off",filterItems:function(e,n){return n},getKeyForItem:function(e){return e.id},getLabelForItem:function(e){return"".concat(e.name," - ").concat(e.description)},initialSelectedItem:e.value,inputId:e.inputId,isBusy:u,isDisabled:e.isDisabled,isErrored:e.isErrored,items:u?[]:v,keepInputValueOnBlur:e.keepValueOnBlur,labelId:e.labelId,menuAriaLabel:"list of members".concat(e.excludeTeams?"":"or teams"),onChange:function(n){e.onChange(n),e.value||r(t+1)},onInputValueChange:function(e){return l(e)},placeholder:e.placeholder||"Enter email".concat(e.excludeTeams?" or name":", name, or team name"),renderIcon:function(e){return e?(0,i.tZ)(ln.q,{ariaHidden:!0,name:e.name,size:25,url:e.imageUrl}):null},size:e.size},t)},wn=t(38716),kn=(0,r.iv)("display:grid;grid-gap:1px;","AuthSharing.tsx--detailsCss"),Tn=(0,r.iv)("align-items:center;display:grid;grid-auto-flow:column;justify-content:space-between;","AuthSharing.tsx--footerCss"),Dn=(0,r.iv)("align-items:center;display:grid;grid-gap:10px;grid-template-columns:40px 1fr;","AuthSharing.tsx--headerCss"),Bn=(0,r.iv)("display:grid;grid-gap:10px;","AuthSharing.tsx--membersCss"),Mn=(0,r.iv)("display:grid;grid-gap:22px;padding:10px;","AuthSharing.tsx--rootCss");function Ln(e){var n,t,i;return e.sharedWithAll?"Shared with everyone":0===(null===(n=e.sharedWith)||void 0===n?void 0:n.length)?"Share":"Shared with ".concat((null===(t=e.sharedWith)||void 0===t?void 0:t.length)||0," ").concat(Le()("member",(null===(i=e.sharedWith)||void 0===i?void 0:i.length)||0))}var zn=function(e){var n,t,r,o,l,c,u=e.accountId,d=e.auth,p=e.onClose;(0,an.jj)("open AuthSharing modal"),u=(0,wn.X8)();var v=(0,h.useCallback)((function(){(0,on.Z)({account_id:u,event_action:"click",interaction_name:"share_connection_button",option_selected:"Share",system_name:"reporting",interaction_raw_text:"Share"},Ae.rw)}),[u]),m=(0,a.useRouter)().query,g=m.selectedApi?m.selectedApi:"",Z=m.serviceSlug?m.serviceSlug:"",b=me(u,d,p,Z,g),y=b.onToggleAll,x=b.onToggleShare,A=b.onTransferAuth;v();var C=(d.sharedWith||[]).filter((function(e){return"all"!==e.id}));return(0,i.tZ)(en.u,{onClosed:p,children:(0,i.tZ)(nn.hz,{children:(0,i.BX)("div",{css:Mn,children:[(0,i.BX)("div",{css:Dn,children:[(0,i.tZ)(be.A,{alt:d.title,serviceName:d.selectedApi,size:40,src:(null===d||void 0===d||null===(n=d.selectedApiImages)||void 0===n?void 0:n.url128X128)||Ae.hn}),(0,i.BX)("div",{css:kn,children:[(0,i.tZ)(s.x,{type:"paragraph3Bold",children:d.title}),(0,i.tZ)(s.x,{type:"smallPrint3",children:Ln(d)})]})]}),!d.sharedWithAll&&d.permissions.share&&(0,i.tZ)(Sn,{accountId:Number(u),excludeTeams:!1,keepValueOnBlur:!1,memberExclusions:[null===(t=d.owner)||void 0===t?void 0:t.id],onChange:function(e){e&&x(e.id,e.type,!0)},placeholder:"Share with members and teams",value:null}),(0,i.BX)("div",{css:Bn,children:[(0,i.tZ)(bn,{canEdit:!1,canTransfer:!1,description:(null===(r=d.owner)||void 0===r?void 0:r.email)||null,imageUrl:(null===(o=d.owner)||void 0===o?void 0:o.imageUrl)||null,isOwner:!0,name:(null===(l=d.owner)||void 0===l?void 0:l.name)||"Owner"},null===(c=d.owner)||void 0===c?void 0:c.id),!d.sharedWithAll&&C.length>0&&(0,i.tZ)(f.Z,{gap:10,itemRenderer:function(e){return(0,i.tZ)(bn,{canEdit:d.permissions.share,canTransfer:d.permissions.transfer,description:e.description,imageUrl:e.imageUrl,name:e.name,onRemove:function(){return x(e.id,e.type,!1)},onTransfer:function(){return A(e.id)}})},items:C})]}),(0,i.BX)("div",{css:Tn,children:[(0,i.BX)(tn.l,{isDisabled:!d.permissions.share,children:[(0,i.tZ)(rn.X,{checked:d.sharedWithAll,disabled:!d.permissions.share,name:"sharedWithAll",onChange:function(e){y(e.currentTarget.checked)},value:"sharedWithAll"}),"Share with everyone"]}),(0,i.tZ)(je.z,{onClick:p,children:"Done"})]})]})})})};var Pn=function(e){var n,t,r,a,o=e.connection,l=e.accountId,s=(0,h.useState)(!1),c=s[0],u=s[1],d=(0,h.useCallback)((function(){return u((function(e){return!e}))}),[]),p=(null===(n=o.sharedWith)||void 0===n?void 0:n.length)>0,v=(r=o.sharedWithAll,a=(null===(t=o.sharedWith)||void 0===t?void 0:t.length)||0,r?"Everyone":0===a?"Share":"".concat(a," ").concat(Le()("member",a)));return(0,i.BX)("div",{onClick:function(e){return e.stopPropagation()},children:[(0,i.tZ)(je.z,{color:"secondary",iconBefore:p?"personGroup":"actionLock",onClick:function(e){e.stopPropagation(),d()},size:"small",children:v}),c&&(0,i.tZ)(zn,{accountId:l,auth:o,onClose:d})]})},Xn=(0,r.iv)("align-items:center;display:grid;grid-auto-flow:column;grid-gap:7px;justify-content:flex-start;","useSharingOrTesting.tsx--messageStyle"),$n=function(e){var n,t,r,a,o=e.accountId,l=e.connection,c=e.hasTeams,u=e.onReconnectAuth,d=e.testAuthLoading,p=e.testAuthResult;return d?(0,i.BX)("div",{css:Xn,children:[(0,i.tZ)(Ye.$,{size:"small"}),(0,i.tZ)(s.x,{color:"neutral700",fontWeight:700,type:"smallPrint1",children:"Testing"})]}):!(null===p||void 0===p?void 0:p.success)&&ke(null===p||void 0===p?void 0:p.errors)?l.permissions.reconnect?(0,i.tZ)(Ue.p,{allowMultilineTooltip:!0,content:Qe(null===p||void 0===p||null===(n=p.errors)||void 0===n||null===(t=n[0])||void 0===t?void 0:t.title),isTooltipInteractive:!0,children:function(e){var n=e.childProps;return(0,i.tZ)(je.z,(0,x.Z)((0,g.Z)({},n),{color:"danger",onClick:u,size:"small",children:"Reconnect app"}))}}):(0,i.tZ)(Ue.p,{allowMultilineTooltip:!0,content:Qe(null===p||void 0===p||null===(r=p.errors)||void 0===r||null===(a=r[0])||void 0===a?void 0:a.title),isTooltipInteractive:!0,children:function(e){var n=e.childProps;return(0,i.BX)("div",(0,x.Z)((0,g.Z)({},n),{css:Xn,children:[(0,i.tZ)(Ke.J,{color:"error400",name:"alertInfo",size:16}),(0,i.tZ)(s.x,{color:"error400",type:"paragraph3Semibold",children:"Reconnect needed"})]}))}}):l.isStale?l.permissions.reconnect?(0,i.tZ)(je.z,{color:"danger",onClick:u,size:"small",children:"Reconnect app"}):(0,i.BX)("div",{css:Xn,children:[(0,i.tZ)(Ke.J,{color:"error400",name:"alertInfo",size:16}),(0,i.tZ)(s.x,{color:"error400",type:"paragraph3Semibold",children:"Reconnect needed"})]}):(null===p||void 0===p?void 0:p.success)?(0,i.BX)("div",{css:Xn,children:[(0,i.tZ)(Ke.J,{color:"success500",name:"formCheckCircle",size:16}),(0,i.tZ)(s.x,{color:"success500",type:"paragraph3Semibold",children:"Test successful"})]}):l.permissions.share&&c&&!(0,Ne.isUndefined)(l.sharedWith)?(0,i.tZ)(Pn,{accountId:o,connection:l}):null},Rn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",t=arguments.length>2?arguments[2]:void 0,i=!!n,r=i?"private/":"";return"".concat(Ae.Xu,"/").concat(r).concat(e||n,"/zaps?authId=").concat(t)},En=function(e){var n=e.connection,t=e.hasTeams,i=e.isDownstream,r=e.onClickChangeOwnership,a=e.onClickDelete,o=e.onClickRename,l=e.onReconnectAuth,s=e.onTestAuth,c=e.selectedApi,u=e.serviceSlug;return(0,h.useMemo)((function(){return[n.permissions.transfer&&t?{avroEvent:"change_ownership",onClick:r,text:"Change ownership",icon:"arrowConnect"}:void 0,n.permissions.edit?{avroEvent:"edit_connection_name",onClick:o,text:"Edit connection name",icon:"actionEdit"}:void 0,n.permissions.reconnect?{avroEvent:"reconnect",onClick:l,text:"Reconnect",icon:"actionAutoRenew"}:void 0,!i&&n.permissions.test?{avroEvent:"test_connection",onClick:s,text:"Test connection",icon:"actionCheckConnection"}:void 0,n.zapCount>0?{avroEvent:"view_zaps",href:Rn(u,c,n.id),text:"View Zaps",icon:"miscEye"}:void 0,n.permissions.delete?{avroEvent:"delete",onClick:a,text:"Delete",warningHighlight:!0,icon:"actionTrash"}:void 0].filter((function(e){return(0,Ne.isObject)(e)&&(!!e.href||!!e.onClick)}))}),[n,t,i,r,a,o,l,s,c,u])},Fn=(0,r.iv)("button:hover,button:focus{background-color:",ge.w.error100," !important;color:",ge.w.error400," !important;}","ConnectionListItemDropdownItem.tsx--warningItemStyle"),_n=(0,r.iv)("display:flex;gap:10px;","ConnectionListItemDropdownItem.tsx--itemContent"),qn=function(e){var n=e.avroEvent,t=e.icon,r=e.href,a=e.onClick,o=e.text,l=e.warningHighlight,c=(0,wn.X8)(),u=(0,h.useCallback)((function(){b({account_id:c,event_action:"click",interaction_name:"connection_kebab_interaction",option_selected:n,system_name:"reporting",interaction_raw_text:o},Ae.rw)}),[c,n,o]);return(0,i.tZ)("span",{css:!!l&&Fn,children:(0,i.tZ)(dn.s,{href:r,onClick:function(){a&&a(),n&&u()},role:"menuitem",children:(0,i.BX)("span",{css:_n,"data-testid":"connection-list-item-dropdown-item-".concat(o),children:[(0,i.tZ)(Ke.J,{name:t,size:24}),(0,i.tZ)(s.x,{color:"inherit",type:"paragraph3Medium",children:o})]})})})},On=(0,r.iv)("grid-area:options;position:relative;button{border:0 none transparent !important;}","ConnectionListItemDropdown.tsx--menuButtonStyle"),Hn=(0,r.iv)("padding:10px;","ConnectionListItemDropdown.tsx--menuStyle"),Wn=function(e){var n=e.connection,t=e.hasTeams,r=e.isDownstream,a=e.isMenuOpen,o=e.onClickChangeOwnership,l=e.onClickDelete,s=e.onClickRename,c=e.onHandleMenuState,u=e.onReconnectAuth,d=e.onTestAuth,p=e.selectedApi,v=e.serviceSlug,m=En({connection:n,hasTeams:t,isDownstream:r,onClickChangeOwnership:o,onClickDelete:l,onClickRename:s,onReconnectAuth:u,onTestAuth:d,selectedApi:p,serviceSlug:v});return(0,i.BX)("div",{css:On,"data-testid":"ConnectionListItem-menu-button-".concat(n.id),children:[(0,i.tZ)(sn.h,{ariaControls:"".concat(n.id,"-zap-actions-menu"),ariaExpanded:a,ariaHaspopup:!0,ariaLabel:"Connection List Item Menu Button",color:"icon-secondary",icon:"navMoreHoriz",onClick:c}),(0,i.tZ)(h.Fragment,{children:a&&(0,i.tZ)(cn.f,{align:"right",intersectHeight:180,minWidth:"190px",onClickOutside:c,children:(0,i.tZ)("div",{css:Hn,children:(0,i.tZ)(un.v,{ariaLabel:"Zap actions menu",id:"".concat(n.id,"-zap-actions-menu"),role:"menu",children:m.map((function(e){var t=e.avroEvent,r=e.href,a=e.icon,o=e.onClick,l=e.text,s=e.warningHighlight;return(0,i.tZ)(qn,{avroEvent:t,href:r,icon:a,onClick:o,text:l,warningHighlight:s},"".concat(n.id,"-").concat(l))}))})})})})]})};function Nn(){var e=(0,B.Z)(['\n grid-template-areas: "name zaps avatar options";\n grid-template-columns: 1fr 80px 110px 40px;\n grid-template-rows: 1fr;\n ']);return Nn=function(){return e},e}function Yn(){var e=(0,B.Z)(['\n align-items: center;\n display: grid;\n grid-gap: 10px;\n grid-template-areas: ". . options" "name name name" "zaps zaps .";\n grid-template-columns: 1fr 125px 40px;\n grid-template-rows: 1fr 1fr 1fr;\n ']);return Yn=function(){return e},e}function Un(){var e=(0,B.Z)(['\n grid-template-areas: "name zaps avatar options";\n grid-template-columns: 1fr 60px 120px 40px;\n ']);return Un=function(){return e},e}function jn(){var e=(0,B.Z)(['\n grid-template-areas: "avatar avatar . options" "name name name name" "zaps zaps . .";\n grid-template-columns: 40px 1fr 125px 40px;\n ']);return jn=function(){return e},e}function Kn(){var e=(0,B.Z)(['\n grid-template-areas: "name sharing zaps avatar options";\n grid-template-columns: 1fr 160px 60px 120px 40px;\n ']);return Kn=function(){return e},e}function Vn(){var e=(0,B.Z)(['\n grid-template-areas: "avatar avatar . options" "name name name name" "zaps . sharing sharing";\n grid-template-columns: 40px 1fr 125px 40px;\n ']);return Vn=function(){return e},e}function Gn(){var e=(0,B.Z)(['\n grid-template-areas: "apps name options";\n grid-template-columns: 81px 1fr 40px;\n grid-template-rows: 1fr;\n ']);return Gn=function(){return e},e}function Jn(){var e=(0,B.Z)(['\n grid-template-areas: "apps . . options" "name name name name";\n grid-template-columns: 81px 1fr 125px 40px;\n grid-template-rows: 1fr 1fr;\n ']);return Jn=function(){return e},e}function Qn(){var e=(0,B.Z)(['\n grid-template-areas: "apps name sharing options";\n grid-template-columns: 81px 1fr 160px 40px;\n ']);return Qn=function(){return e},e}function et(){var e=(0,B.Z)(['\n grid-template-areas: "apps . . options" "name name name name" ". . sharing sharing";\n grid-template-columns: 81px 1fr 125px 40px;\n ']);return et=function(){return e},e}var nt=(0,we.uq)({tablet:(0,r.iv)(Nn()),mobile:(0,r.iv)(Yn())}),tt=(0,we.uq)({tablet:(0,r.iv)(Un()),mobile:(0,r.iv)(jn())}),it=(0,we.uq)({tablet:(0,r.iv)(Kn()),mobile:(0,r.iv)(Vn())}),rt=(0,we.uq)({tablet:(0,r.iv)(Gn()),mobile:(0,r.iv)(Jn())}),at=(0,we.uq)({tablet:(0,r.iv)(Qn()),mobile:(0,r.iv)(et())}),ot=(0,r.iv)("display:flex;flex-direction:column;","ConnectionListItem.tsx--nameSectionStyle"),lt=(0,r.iv)(fe.ZT.paragraph1ShortBold," align-items:center;color:",ge.w.neutral800,";display:grid;font-weight:700;grid-auto-flow:column;grid-gap:5px;justify-content:flex-start;","ConnectionListItem.tsx--titleStyle"),st=(0,r.iv)("display:flex;justify-content:center;","ConnectionListItem.tsx--sharingStyle"),ct=function(e){var n=e.connection,t=e.hasTeams,r=e.isDownstream,a=e.isHighlighted,o=e.isMenuOpen,l=e.onClickChangeOwnership,c=e.onClickDelete,u=e.onClickRename,d=e.onHandleMenuState,p=e.onReconnectAuth,v=e.onTestAuth,m=e.selectedApi,f=e.serviceSlug,Z=e.testAuthResult,b=$n(e),y=n.isStale||!(null===Z||void 0===Z?void 0:Z.success)&&ke(null===Z||void 0===Z?void 0:Z.errors);return(0,i.tZ)(Ie.Z,{color:a?"blue":y?"red":"gray",children:(0,i.BX)("div",{"data-testid":"ConnectionListItem-root-".concat(n.id),id:n.id,children:[(0,i.BX)("div",{css:[nt,t&&!b&&tt,b&&it,r&&rt,r&&b&&at],children:[r&&(0,i.tZ)("div",{css:(0,Te.f)("apps"),children:(0,i.tZ)(Ze.r,{maxServices:2,renderServiceIcon:function(e){var n;return(0,i.tZ)(be.A,{serviceName:e.selectedApi,size:40,src:(null===e||void 0===e||null===(n=e.selectedApiImages)||void 0===n?void 0:n.url128X128)||Ae.hn})},services:[n,{selectedApi:n.destinationSelectedApi,selectedApiImages:n.destinationSelectedApiImages}]})}),(0,i.BX)("div",{css:[(0,Te.f)("name"),ot],"data-testid":"ConnectionListItem-attributes",children:[(0,i.tZ)("span",{css:lt,children:n.title}),(0,i.BX)(s.x,{type:"smallPrint1",children:[!r&&n.description&&"".concat(n.description," - "),"added ",(0,i.tZ)(qe,{date:n.created})]})]}),Boolean(b)&&(0,i.tZ)("div",{css:[(0,Te.f)("sharing"),st],children:b}),!r&&(0,i.tZ)("div",{css:(0,Te.f)("zaps"),children:(0,i.tZ)(Se.Z,{count:n.zapCount,label:"Zap"})}),!r&&t&&!!n.owner&&(0,i.tZ)("div",{css:(0,Te.f)("avatar"),children:(0,i.tZ)(Ce.Z,{avatarsCount:1,size:25,avatarsNodes:[(0,i.tZ)(ye.O,{name:n.owner.name||"",url:n.owner.imageUrl||""},n.owner.name)],children:n.owner.name&&(0,i.BX)(h.Fragment,{children:[(0,i.tZ)(xe.M,{kind:"light",children:"by"})," ",(0,i.tZ)(xe.M,{kind:"heavy",children:(0,De.G)(n.owner.name)})]})})}),(0,i.tZ)(Wn,{connection:n,hasTeams:t,isDownstream:r,isMenuOpen:o,onClickChangeOwnership:l,onClickDelete:c,onClickRename:u,onHandleMenuState:d,onReconnectAuth:p,onTestAuth:v,selectedApi:m,serviceSlug:f})]}),(n.destinationAuths||[]).length>0&&(0,i.tZ)(We,(0,x.Z)((0,g.Z)({},e),{onHandleMenuState:d}))]})})},ut=t(17688),dt=(0,r.iv)("display:grid;grid-gap:40px;min-width:min(688px,50vw);","ChangeAuthModal.tsx--rootStyle"),pt=(0,r.iv)("align-items:center;display:grid;grid-gap:5px;grid-template-columns:20px 1fr;","ChangeAuthModal.tsx--subStyle"),ht=(0,r.iv)("display:grid;grid-gap:10px;","ChangeAuthModal.tsx--titleStyle"),vt=function(e){var n=(0,h.useState)(),t=n[0],r=n[1],a=(0,h.useState)(),o=a[0],l=a[1];return(0,i.BX)("form",{css:dt,onSubmit:function(n){return n.preventDefault(),n.stopPropagation(),t?e.onAccept(t.id):l("Owner is required"),!1},children:[(0,i.BX)("div",{css:ht,children:[(0,i.tZ)(s.x,{type:"sectionHeader3",children:"Change Ownership"}),!e.isAdmin&&(0,i.BX)("span",{css:pt,children:[(0,i.tZ)(Ke.J,{name:"alertInfo",size:20}),(0,i.tZ)(s.x,{type:"smallPrint3",children:"You will lose access to this connection when you change ownership."})]})]}),(0,i.tZ)(ut.g,{error:o,isRequired:!0,label:"Choose a new owner",renderInput:function(n){return(0,i.tZ)(Sn,(0,x.Z)((0,g.Z)({},n),{accountId:e.accountId||-1,excludeTeams:!0,onChange:r,value:t}))}}),(0,i.tZ)(je.z,{disabled:!t,type:"submit",children:"Change ownership"})]})},mt=function(e){return(0,i.tZ)(en.u,{onClosed:e.onCancel,children:(0,i.tZ)(nn.hz,{children:(0,i.tZ)(vt,(0,g.Z)({},e))})})},ft=t(42126),gt=t(80327),Zt=(0,r.iv)("display:grid;grid-gap:40px;","RenameAuthModal.tsx--rootStyle"),bt="Edit connection name";function yt(e){var n=(0,h.useState)(e.title),t=n[0],r=n[1],a=(0,h.useState)(),o=a[0],l=a[1],c=(0,A.Z)((0,gt.Z)(),1)[0];return(0,i.BX)("form",{css:Zt,onSubmit:function(n){return n.preventDefault(),n.stopPropagation(),t?e.onAccept(t):l("Title is required"),!1},"data-testid":"RenameAuthModal-root",children:[(0,i.tZ)(s.x,{type:"sectionHeader3",children:bt}),(0,i.tZ)(ut.g,{error:o,isRequired:!0,label:"Name",renderInput:function(e){return(0,i.tZ)(ft.o,(0,x.Z)((0,g.Z)({},e),{ref:c,onChange:function(e){return r(e.currentTarget.value)},value:t}))}}),(0,i.tZ)(je.z,{disabled:!t,type:"submit",children:"OK"})]})}var xt=function(e){return(0,i.tZ)(en.u,{onClosed:e.onCancel,ariaLabel:bt,children:(0,i.tZ)(nn.hz,{children:(0,i.tZ)(yt,(0,g.Z)({},e))})})},At=(0,r.iv)("display:flex;flex-flow:row nowrap;gap:10px;> *{flex:1 1 auto !important;}","DeleteAuthModal.tsx--buttonStyle"),Ct=(0,r.iv)("display:grid;grid-gap:40px;","DeleteAuthModal.tsx--rootCss"),It=function(e){var n=e.onAccept,t=e.title,r=e.onCancel;return(0,i.BX)("form",{onSubmit:function(e){e.preventDefault(),e.stopPropagation(),n()},css:[Ct],"data-testid":"DeleteAuthModal-root",children:[(0,i.tZ)(s.x,{type:"sectionHeader3",children:t}),(0,i.tZ)(s.x,{type:"paragraph1Short",children:"Are you sure you want to delete this connection?"}),(0,i.BX)("div",{css:At,children:[(0,i.tZ)(je.z,{color:"secondary",onClick:r,children:"Cancel"}),(0,i.tZ)(je.z,{type:"submit",children:"Delete"})]})]})},St=function(e){return(0,i.tZ)(en.u,{onClosed:e.onCancel,ariaLabel:"Delete ".concat(e.title," connection"),children:(0,i.tZ)(nn.hz,{children:(0,i.tZ)(It,(0,g.Z)({},e))})})},wt="delete",kt="none",Tt="rename",Dt="change_ownership",Bt=function(e){var n=e.accountId,t=e.connection,r=e.isHighlighted,o=void 0!==r&&r,l=e.isTeam,s=e.isAdmin,c=e.isDownstream,u=void 0!==c&&c,d=e.isPersonal,p=void 0!==d&&d,v=e.testAuthsLoading,m=void 0!==v&&v,f=e.testAuthsResult,g=(0,h.useState)(kt),Z=g[0],y=g[1],x=(0,h.useState)(!1),A=x[0],C=x[1],I=(0,h.useState)(o),S=I[0],w=I[1],k=(0,a.useRouter)().query,T=k.serviceSlug,D=k.selectedApi,B=!!D,M=(0,h.useRef)(null);(0,h.useEffect)((function(){o&&(!function(e){for(var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=0,i=e?e.offsetHeight:0;e;)t+=e.offsetTop,e=e.offsetParent;window.scrollTo(0,n?t+i:t)}(M.current),setTimeout((function(){return w(!1)}),2e3))}),[]);var L=me(n,t,(function(){}),T,D).onTransferAuth,z=K({connection:t,isPrivate:B,selectedApi:D,serviceSlug:T||""}),P=z.isTesting,X=z.onDeleteAuth,$=z.onReconnectAuth,R=z.onTestAuth,E=z.onUpdateAuthTitle,F=z.testAuthResult,_=(0,h.useCallback)((function(){y(kt),C(!1)}),[C,y]),q=(0,h.useCallback)((function(){b({account_id:n,event_action:A?"close":"open",interaction_name:"connection_kebab_interaction",option_selected:"",system_name:"reporting"},Ae.rw)}),[A,n]),O=(0,h.useCallback)((function(e){null===e||void 0===e||e.stopPropagation(),Z===kt&&(q(),C((function(e){return!e})))}),[Z,C,q]),H=(0,h.useCallback)((function(e){null===e||void 0===e||e.stopPropagation(),R(),_(),q()}),[R,q,_]),W=(0,h.useCallback)((function(e){null===e||void 0===e||e.stopPropagation(),$(),_(),q()}),[$,_,q]),N=(0,h.useCallback)((function(e){E(e),_()}),[E,_]),Y=(0,h.useCallback)((function(e){L(e),_()}),[L,_]),U=(0,h.useCallback)((function(){X(),_()}),[X,_]),j=(0,h.useCallback)((function(){y(Tt),C(!1),q()}),[q]),V=(0,h.useCallback)((function(){y(Dt),C(!1),q()}),[q]),G=(0,h.useCallback)((function(){y(wt),C(!1),q()}),[q]);return(0,i.BX)("div",{"data-testid":"Connection",id:"connection-".concat(t.id),ref:M,children:[(0,i.tZ)(ct,{accountId:n,connection:t,hasTeams:l,isAdmin:s,isHighlighted:S,isMenuOpen:A,isPersonal:p,isDownstream:u,onClickChangeOwnership:V,onClickDelete:G,onClickRename:j,onHandleMenuState:O,onReconnectAuth:W,onTestAuth:H,selectedApi:D,serviceSlug:T,testAuthLoading:P||m,testAuthResult:F||f},t.id),Z===Tt&&(0,i.tZ)(xt,{onAccept:N,onCancel:_,title:t.title}),Z===wt&&(0,i.tZ)(St,{onAccept:U,onCancel:_,title:t.title}),Z===Dt&&(0,i.tZ)(mt,{accountId:n,isAdmin:s,onAccept:Y,onCancel:_})]})},Mt=(0,r.iv)("display:grid;grid-gap:10px;","ConnectionsSection.tsx--rootStyle"),Lt=(0,r.iv)("display:flex;place-items:center;","ConnectionsSection.tsx--header"),zt=function(e){var n=e.connections,t=e.highlightedId,r=e.isAdminSection,a=void 0!==r&&r,o=e.isPersonal,l=void 0!==o&&o,c=e.testAuthsLoading,u=e.testAuthsResults,d=e.title,p=(0,hn.gn)(),g=p.accountId,Z=p.isTeam,b=p.isAdmin,y=(0,h.useCallback)((function(e){return null===u||void 0===u?void 0:u.find((function(n){return n.id===e}))}),[u]);return(0,i.BX)("section",{css:Mt,"data-testid":"ConnectionsSection",children:[(0,i.BX)("div",{css:Lt,children:[(0,i.tZ)(s.x,{type:"subHeader3Medium",children:d}),(0,i.BX)(h.Fragment,{children:[(0,i.tZ)(v.L,{width:5}),(0,i.tZ)(m.C,{children:String(null===n||void 0===n?void 0:n.length)})]}),(0,i.tZ)(v.L,{width:5}),a&&(0,i.tZ)(m.C,{children:"Admin"})]}),(0,i.tZ)(f.Z,{gap:10,id:"",itemRenderer:function(e){var n=e.id===t||(e.destinationAuths||[]).some((function(e){return e.id===t})),r=y(e.id);return(0,i.tZ)(Bt,{accountId:g,connection:e,isAdmin:b,isHighlighted:n,isPersonal:l,isTeam:Z,testAuthsLoading:c,testAuthsResult:r})},items:n})]})},Pt=(0,r.iv)("display:grid;grid-gap:30px;padding:20px;","AppConnections.tsx--rootStyle"),Xt=function(e){var n=e.connectionsError,t=e.hasConnections,r=e.hasNextPage,h=e.isConnectionsLoading,v=e.myAuthentications,m=e.onLoadMore,f=e.privateAuthentications,g=e.sharedAuthentications,Z=e.testAuthsLoading,b=e.testAuthsResults,y=(0,hn.gn)().isAdmin,x=(0,a.useRouter)().query;return!h&&n?(0,i.tZ)("div",{css:Pt,children:(0,i.tZ)(o.b,{type:"error",children:n})}):(0,i.BX)("div",{css:Pt,children:[v.length>0&&(0,i.tZ)(zt,{connections:v,highlightedId:x.hl,isPersonal:!0,testAuthsLoading:Z,testAuthsResults:b,title:"My connections"}),g.length>0&&(0,i.tZ)(zt,{connections:g,highlightedId:x.hl,testAuthsLoading:Z,testAuthsResults:b,title:"Shared connections"}),f.length>0&&y&&(0,i.tZ)(zt,{connections:f,highlightedId:x.hl,isAdminSection:!0,testAuthsLoading:Z,testAuthsResults:b,title:"Private connections"}),r&&(0,i.tZ)(l.W,{isLoading:h,onClick:m,children:"Load More"}),!t&&!h&&(0,i.tZ)(s.x,{color:"neutral700",margin:"20px",type:"paragraph1Short",children:"You do not have any connections."}),h&&(0,i.tZ)(c.g,{children:(0,i.BX)(u.r,{gap:10,children:[(0,i.tZ)(d.N,{lines:1,size:"heading",width:"30%"}),Array.from({length:5}).map((function(e,n){return(0,i.tZ)(p.q,{height:79,width:"100%"},n)}))]})})]})}},39555:function(e,n,t){t.d(n,{Z:function(){return ue}});var i=t(52903),r=t(53939),a=t(87416),o=t(74897),l=t(53583),s=t(28165),c=t(2784),u=t(5632),d=t(98788),p=t(92228),h=t(5163),v=t(64476),m=t(55414),f=t(26215),g=t(61854),Z=t(20110),b=t(66830),y=t(70398),x=t(53736),A=t(16181),C=t(50293),I=t(90446),S=t(73223),w=t(60390),k=t(38716);function T(){var e=(0,p.Z)(['\n grid-template-columns: 1fr auto auto;\n grid-template-areas: "serviceTitle testButton button";\n grid-template-rows: 1fr;\n ']);return T=function(){return e},e}function D(){var e=(0,p.Z)(['\n align-items: center;\n display: grid;\n grid-gap: 15px;\n grid-template-columns: 1fr;\n grid-template-rows: auto auto auto;\n grid-template-areas: "serviceTitle" "testButton" "button";\n ']);return D=function(){return e},e}function B(){var e=(0,p.Z)(["\n display: grid;\n "]);return B=function(){return e},e}function M(){var e=(0,p.Z)(["\n display: block;\n "]);return M=function(){return e},e}var L=(0,y.uq)({tablet:(0,s.iv)(T()),mobile:(0,s.iv)(D())}),z=(0,s.iv)('align-items:center;display:grid;grid-gap:30px;grid-template-areas:"icon name";grid-template-columns:60px 1fr;',"AppDetailHeader.tsx--serviceTitle");function P(e){return(0,s.iv)("grid-area:",e,";","AppDetailHeader.tsx--serviceTitle")}var X=(0,s.iv)("align-items:center;background-color:transparent;border-radius:10px;display:flex;grid-area:icon;height:60px;justify-content:center;width:60px;","AppDetailHeader.tsx--iconStyle"),$=(0,s.iv)("display:grid;grid-area:name;","AppDetailHeader.tsx--infoStyle"),R=(0,s.iv)("align-items:center;display:grid;grid-auto-flow:column;grid-gap:10px;justify-content:flex-start;","AppDetailHeader.tsx--titleStyle"),E=(0,y.uq)({mobile:(0,s.iv)(B()),tablet:(0,s.iv)(M())}),F=function(e){var n,t,r,a=e.app,o=e.displayTestAuths,l=e.handleTestAuths,s=e.isPrivate,p=e.slug,T=e.testAuthsLoading,D=(0,x.l)().createNotification,B=(0,A.gn)().userId,M=(0,C.Z)(),F=(0,u.useRouter)(),_=F.query.serviceSlug,q=F.query.selectedApi,O=(0,k.X8)(),H=(0,c.useCallback)((function(){(0,I.Z)({account_id:O,event_action:"click",interaction_name:"add_connection_button",option_selected:"add connection",system_name:"reporting",interaction_raw_text:"Add Connection"},S.rw)}),[O]),W=(0,w.Z)({id:(null===(n=F.query)||void 0===n||null===(t=n.id)||void 0===t?void 0:t.includes("all"))?null:F.query.id,serviceSlug:_,userId:B,selectedApi:q}).refetch,N=null===a||void 0===a?void 0:a.canConnect,Y=(0,c.useMemo)((function(){return(null===a||void 0===a?void 0:a.name)||(null===a||void 0===a?void 0:a.title)}),[a]),U=(0,c.useCallback)((0,d.Z)((function(){var e;return(0,h.__generator)(this,(function(n){switch(n.label){case 0:return a?(H(),[4,M(a)]):[3,2];case 1:(e=n.sent().id)&&(W(),F.push("".concat(S.Xu,"/").concat(a.slug,"?hl=").concat(e)),D({message:"New connection added",type:"info"})),n.label=2;case 2:return[2]}}))})),[M,D,W,F,a]),j=function(){l()},K=Object.prototype.hasOwnProperty.call(a,"image")?(null===a||void 0===a?void 0:a.image)||S.hn:(null===a||void 0===a||null===(r=a.images)||void 0===r?void 0:r.url128X128)||S.hn,V=Object.prototype.hasOwnProperty.call(a,"categories")&&(null===a||void 0===a?void 0:a.categories)||[];return(0,i.BX)("div",{css:L,children:[(0,i.tZ)("div",{css:P("serviceTitle"),children:(0,i.BX)("div",{css:z,children:[(0,i.tZ)("div",{css:X,children:(0,i.tZ)(v.A,{serviceName:Y,size:60,src:K})}),(0,i.BX)("div",{css:$,children:[(0,i.BX)("div",{css:R,children:[(0,i.tZ)(m.x,{tag:"h1",type:"sectionHeader1Medium",children:Y}),!s&&(0,i.tZ)("div",{children:(0,i.tZ)(f.r,{ariaLabel:"View app info link",href:"/apps/".concat(p),rel:"noreferrer",style:{display:"flex"},target:"_blank",children:(0,i.tZ)(g.J,{name:"arrowOffsite",ariaLabel:"View app info",size:24})})})]}),(null===V||void 0===V?void 0:V.length)>0&&(0,i.tZ)(m.x,{color:"neutral700",type:"smallPrint1",children:V[0].name})]})]})}),N&&(0,i.BX)(c.Fragment,{children:[o&&(0,i.BX)("div",{css:P("testButton"),children:[(0,i.tZ)("div",{css:y.CD,children:(0,i.tZ)(Z.z,{color:"secondary",disabled:T,isFullWidth:!0,onClick:j,size:"small",children:T?"Testing...":"Test Connections"})}),(0,i.tZ)("div",{css:y.pI,children:(0,i.tZ)(b.h,{disabled:T,icon:"actionCheckConnection",label:T?"Testing...":"Test Connections",onClick:j})})]}),(0,i.tZ)("div",{css:P("button"),children:(0,i.tZ)("div",{css:E,children:(0,i.tZ)(Z.z,{color:"primary",iconBefore:"formAdd",onClick:U,size:"small",children:"Add connection"})})})]})]})},_=t(56357),q=t(15466),O=t(66383),H=t(33379),W=t(60138);function N(){var e=(0,p.Z)(["\n mutation TestAuths(\n $accountId: Int!\n $serviceSlug: String\n $selectedApi: String\n ) {\n testAuths(\n accountId: $accountId\n serviceSlug: $serviceSlug\n selectedApi: $selectedApi\n ) {\n id\n success\n errors\n }\n }\n"]);return N=function(){return e},e}var Y=(0,W.Ps)(N()),U=function(e){var n=e.accountId,t=e.serviceSlug,i=e.selectedApi,r=(0,O.Z)((0,H.D)(Y,{variables:{accountId:n,selectedApi:i,serviceSlug:t}}),2),a=r[0],o=r[1],l=o.loading,s=o.data,u=(0,c.useMemo)((function(){return(null===s||void 0===s?void 0:s.testAuths)||[]}),[s]),d=(0,c.useState)(0)[1],p=(0,c.useRef)(u);return(0,c.useEffect)((function(){u!==p.current&&(p.current=u,d((function(e){return e+1})),(null===u||void 0===u?void 0:u.some((function(e){return e.success})))&&setTimeout((function(){p.current=(null===u||void 0===u?void 0:u.filter((function(e){return!e.success})))||[],d((function(e){return e+1}))}),5e3))}),[u]),{handleTestAuths:a,isLoading:l,results:p.current}},j=t(47842),K=t(70865),V=t(96670),G=t(40794),J=t(92642);function Q(){var e=(0,p.Z)(["\n fragment LegacyZap on LegacyZap {\n accountId\n id\n isShared\n isTrashed\n kind\n title\n isEnabled\n folderId\n owner {\n email\n id\n imageUrl\n name\n }\n sourceUrl\n steps {\n app {\n actions {\n bulkReads {\n key\n }\n }\n images {\n url32X32\n url128X128\n }\n name\n id\n }\n id\n }\n updatedAt\n }\n"]);return Q=function(){return e},e}var ee,ne=(0,W.Ps)(Q());function te(){var e=(0,p.Z)(["\n ","\n\n query LegacyAppZaps(\n $activityEnd: String\n $activityStart: String\n $authIds: [ID!]\n $folderId: Int\n $limit: Int\n $offset: Int\n $orderBy: ZapOrderByInput\n $search: String\n $selectedApis: [String!]\n $slug: String\n $state: String\n ) {\n legacyZaps(\n activityEnd: $activityEnd\n activityStart: $activityStart\n authIds: $authIds\n folderId: $folderId\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n search: $search\n selectedApis: $selectedApis\n slug: $slug\n state: $state\n ) {\n totalCount\n pageInfo {\n hasNextPage\n }\n edges {\n ...LegacyZap\n }\n }\n }\n"]);return te=function(){return e},e}!function(e){e.asc="asc",e.desc="desc"}(ee||(ee={}));var ie=(0,W.Ps)(te(),ne),re=t(86692),ae=function(e){if(e)return e.split(",").reduce((function(e,n){var t=n.startsWith("-")?"desc":"asc";return(0,V.Z)((0,K.Z)({},e),(0,j.Z)({},n.replace("-",""),t))}),{})},oe=function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=n.activity,i=n.appId,r=n.authId,a=n.page,o=void 0===a?0:a,l=n.serviceSlug,s=n.sorting,u=n.selectedApi,d=n.state,p=[u,i].filter(Boolean),h=(0,V.Z)((0,K.Z)({},(null===t||void 0===t?void 0:t.to)?{activityEnd:t.to}:{},(null===t||void 0===t?void 0:t.from)?{activityStart:t.from}:{},r?{authIds:[r]}:{},s?{orderBy:ae(s)}:{},(null===p||void 0===p?void 0:p.length)?{selectedApis:p}:{},d?{state:d}:{}),{slug:l,limit:S.wt,offset:o*S.wt}),v=(0,G.a)(ie,{fetchPolicy:"cache-and-network",onError:function(e){var n="Error fetching LegacyZaps: ".concat((0,re.e$)(e));J.uT(n,{extra:{err:JSON.stringify(e)}})},variables:h}),m=v.data,f=v.loading,g=v.error,Z=(0,c.useMemo)((function(){var e;return(null===m||void 0===m||null===(e=m.legacyZaps)||void 0===e?void 0:e.edges)||[]}),[m]),b=(0,c.useMemo)((function(){return Z.map((function(e){return e.id}))}),[Z]);return{error:g,isLegacyLoading:f,legacyZapIds:b,legacyZaps:Z,totalCount:(null===m||void 0===m||null===(e=m.legacyZaps)||void 0===e?void 0:e.totalCount)||0}},le=(0,s.iv)("display:grid;grid-gap:20px;margin:0px auto;max-width:1120px;padding:20px;","AppDetails.tsx--rootStyle"),se=(0,s.iv)("max-width:120px;","AppDetails.tsx--backStyle"),ce=(0,s.iv)("display:flex;align-items:center;","AppDetails.tsx--countBadgeStyle"),ue=function(e){var n=e.serviceSlug,t=e.selectedApi,s=e.children,d=(0,A.gn)(),p=d.accountId,h=d.userId,v=(0,u.useRouter)(),m=v.query,f=v.asPath,g=(0,q.Z)({serviceSlug:n,selectedApi:t}).app,Z=m.appId?m.appId:"",b=m.authId?m.authId:"",y=m.zapSort?m.zapSort:void 0,x=parseInt(m.page)||0,C=m.status?m.status:void 0,I=(0,_.H7)(m),k=(0,w.Z)({serviceSlug:n,userId:h,selectedApi:t}),T=k.connectionsError,D=k.hasConnections,B=k.hasNextPage,M=k.isConnectionsLoading,L=k.myAuthentications,z=k.onLoadMore,P=k.privateAuthentications,X=k.sharedAuthentications,$=k.totalConnectionCount,R=U({accountId:p,selectedApi:t,serviceSlug:n}),E=R.handleTestAuths,O=R.isLoading,H=R.results,W=oe({activity:I,appId:Z,authId:b,page:x,selectedApi:t,serviceSlug:n,sorting:y,state:C}),N=W.error,Y=W.isLegacyLoading,j=W.legacyZapIds,K=W.legacyZaps,V=W.totalCount,G=(0,c.cloneElement)(s,{connectionsError:T,hasConnections:D,hasNextPage:B,isConnectionsLoading:M,isZapsLoading:Y,legacyZapIds:j,myAuthentications:L,onLoadMore:z,privateAuthentications:P,sharedAuthentications:X,testAuthsLoading:O,testAuthsResults:H,totalConnectionCount:$,totalZapCount:V,zaps:K,zapsError:N}),J=!!t,Q=J?"private/":"",ee="".concat(S.Xu,"/").concat(Q).concat(n||t),ne="".concat(ee,"/zaps"),te=[{href:ee,text:(0,i.BX)("div",{css:ce,children:["Connections",(0,i.tZ)(r.L,{width:5}),(0,i.tZ)(a.C,{color:"info-bold",children:M?"-":String($)})]})},{href:ne,text:(0,i.BX)("div",{css:ce,children:["Zaps",(0,i.tZ)(r.L,{width:5}),(0,i.tZ)(a.C,{color:"info-bold",children:Y?"-":String(V)})]})}];return(0,i.BX)("div",{css:le,children:[(0,i.tZ)("div",{css:se,children:(0,i.tZ)(o.x,{href:S.Xu,children:"My apps"})}),(0,i.tZ)(F,{app:g,displayTestAuths:$>1,handleTestAuths:E,isPrivate:J,slug:n,testAuthsLoading:O}),(0,i.tZ)(l.m,{items:te,selectedItemHref:f.split("?")[0],size:"large"}),(0,i.tZ)("div",{children:G})]})}},19782:function(e,n,t){t.d(n,{Z:function(){return an}});var i=t(92228),r=t(52903),a=t(2784),o=t(28165),l=t(5632),s=t(20271),c=t(55414),u=t(20110),d=t(76128),p=t(47043),h=t(90982),v=t(96459),m=t(70398),f=t(82116),g=t(68516),Z=t(32945),b=t(64476),y=t(29416),x=t(53939),A=t(12687),C=t(47553),I=t(49187),S=t(71937),w=t(42722),k=t(15879),T=t(73223),D=t(25277);function B(){var e=(0,i.Z)(['\n grid-template-areas: "serviceIcons info taskCount";\n grid-template-columns: 140px 1fr 120px;\n grid-template-rows: 1fr;\n ']);return B=function(){return e},e}function M(){var e=(0,i.Z)(['\n align-items: center;\n display: grid;\n grid-gap: 10px;\n grid-template-areas:\n "serviceIcons taskCount"\n "info info";\n grid-template-columns: 1fr 80px;\n grid-template-rows: auto 1fr;\n ']);return M=function(){return e},e}function L(){var e=(0,i.Z)(['\n grid-template-areas: "serviceIcons info taskCount avatar";\n grid-template-columns: 140px 1fr 120px 120px;\n ']);return L=function(){return e},e}function z(){var e=(0,i.Z)(['\n grid-template-areas:\n "serviceIcons serviceIcons taskCount"\n "info info info"\n "avatar avatar avatar";\n grid-template-columns: 1fr 80px auto;\n ']);return z=function(){return e},e}function P(){var e=(0,i.Z)(["\n padding-bottom: 0;\n "]);return P=function(){return e},e}function X(){var e=(0,i.Z)(["\n display: flex;\n align-items: center;\n padding-bottom: 5px;\n "]);return X=function(){return e},e}var $=(0,m.uq)({tablet:(0,o.iv)(B()),mobile:(0,o.iv)(M())}),R=(0,m.uq)({tablet:(0,o.iv)(L()),mobile:(0,o.iv)(z())}),E=(0,m.uq)({tablet:(0,o.iv)(P()),mobile:(0,o.iv)(X())}),F=(0,o.iv)("justify-content:end;","ZapListItem.tsx--taskCountStyle"),_=function(e){var n,t=e.zap,i=e.hasTeams,o=e.zapStat,l=e.isZapStatsLoading,s=t.title,u=t.id,d=t.steps,p=t.owner,h=t.updatedAt;return(0,r.tZ)(w.Z,{href:"/app/zap/".concat(u),children:(0,r.BX)("div",{css:[$,i&&R],children:[(0,r.tZ)("div",{css:(0,I.f)("serviceIcons"),children:(0,r.tZ)(Z.r,{size:40,maxServices:3,renderServiceIcon:function(e){var n,t,i=null===e||void 0===e||null===(n=e.app)||void 0===n?void 0:n.images;return(0,r.tZ)(b.A,{serviceName:null===e||void 0===e||null===(t=e.app)||void 0===t?void 0:t.id,size:40,src:(null===i||void 0===i?void 0:i.url128X128)||(null===i||void 0===i?void 0:i.url32X32)||T.hn})},services:d})}),(0,r.BX)("div",{css:(0,I.f)("info"),"data-testid":"ZapListItem-details-root",children:[(0,r.tZ)(c.x,{type:"paragraph1ShortBold",children:s||T.MK}),(0,r.BX)("div",{css:E,children:[(0,r.tZ)(y.S,{color:t.isEnabled?"info":"gray",size:"small",children:t.isEnabled?"ON":"OFF"}),(0,r.tZ)(x.L,{width:5}),(0,r.tZ)(c.x,{color:"neutral700",type:"smallPrint1",children:"Last changed"}),(0,r.tZ)(x.L,{width:5}),(0,r.tZ)(c.x,{type:"smallPrint1Semibold",children:(0,r.tZ)(g.ou,{date:h,format:"MMM DD, YYYY hh:mm a"})})]})]}),(0,r.tZ)("div",{css:[(0,I.f)("taskCount"),F],children:(0,r.tZ)(k.Z,{count:null===o||void 0===o||null===(n=o.tasks)||void 0===n?void 0:n.billable,isLoading:l,label:"Tasks"})}),i&&(0,r.tZ)("div",{css:(0,I.f)("avatar"),children:(0,r.tZ)(D.Z,{avatarsCount:1,size:25,avatarsNodes:[(0,r.tZ)(A.O,{name:p.name||"",url:p.imageUrl||""},p.name)],children:p.name&&(0,r.BX)(a.Fragment,{children:[(0,r.tZ)(C.M,{kind:"light",children:"by"})," ",(0,r.tZ)(C.M,{kind:"heavy",children:(0,S.G)(p.name)})]})})})]})})},q=t(58013),O=t(70865),H=t(96670),W=t(77466),N=t(13030),Y=t(95945),U=t(18672),j=t(61854),K=t(35080),V=(0,o.iv)("background-color:transparent !important;border:none !important;> span{align-items:center;display:grid;grid-auto-flow:column;grid-gap:4px;}","ZapSort.tsx--buttonStyle"),G=(0,o.iv)("cursor:pointer;","ZapSort.tsx--buttonWrapStyle"),J=(0,o.iv)("position:relative;","ZapSort.tsx--rootStyle"),Q=[{label:"Alphabetical A-Z",value:"title"},{label:"Alphabetical Z-A",value:"-title"}],ee=function(e){var n=e.label,t=e.value,i=e.placeholder;return[t,n,!t&&i].filter(Boolean).join(", ")},ne=function(e,n){return n.type===W.ZP.stateChangeTypes.keyDownEscape?{isOpen:!1}:n},te=function(e){var n=Q.find((function(n){return n.value===e.value}))||Q[0];return(0,r.tZ)(W.ZP,{getLabelForItem:function(e){return e.name},initialSelectedItem:n,inputId:"zapSorting",itemCount:Q.length,itemToString:function(e){return e.name},labelId:"zap-sorter-label",onChange:function(n){n&&e.onChange(n.value)},selectedItem:n,stateReducer:ne,children:function(e){var t=e.closeMenu,i=e.getInputProps,o=e.getItemProps,l=e.getMenuProps,s=e.getRootProps,u=e.highlightedIndex,d=e.isOpen,p=e.openMenu,h=e.selectedItem,v=!!h,m=s(),f=(0,q.Z)({},m);return(0,r.BX)("div",(0,H.Z)((0,O.Z)({css:J},f),{"data-testid":"ZapSort-root",children:[(0,r.tZ)("div",{css:G,children:(0,r.tZ)(N.I,(0,H.Z)((0,O.Z)({},(0,Y.j)(i())),{canClickIconAfter:!1,id:"zapSorter",children:function(e){return(0,r.BX)(a.Fragment,{children:[(0,r.tZ)(U.T,{children:(0,r.tZ)("label",{htmlFor:e.id,id:"zap-sorter-label",children:"Sort Zaps"})}),(0,r.tZ)("button",{"aria-activedescendant":e["aria-activedescendant"],"aria-invalid":e["aria-invalid"],"aria-controls":e["aria-controls"],"aria-expanded":d?"true":"false","aria-haspopup":"true","aria-label":ee({label:e["aria-label"]||"",value:v?h.label:void 0}),css:[e.css,V],disabled:e.disabled,id:e.id,onBlur:function(){return t()},onClick:function(){return p()},onKeyDown:e.onKeyDown,type:"button",children:(0,r.BX)("span",{children:[(0,r.tZ)(c.x,{color:"neutral700",type:"paragraph3",children:"Sort by:"}),(0,r.tZ)(c.x,{color:"neutral700",type:"paragraph3",children:n.label}),(0,r.tZ)(j.J,{color:"neutral700",name:"arrowSmallDown",size:20})]})})]})}}))}),d&&(0,r.tZ)(K.A,{ariaLabel:"zap sort options",getInputProps:i,getItemProps:o,getKeyForItem:function(e){return e.value},getLabelForItem:function(e){return e.label},getMenuProps:l,highlightedIndex:u,items:Q})]}))}})},ie=t(40794),re=t(17688),ae=t(57380),oe=t(76635),le=t(60138);function se(){var e=(0,i.Z)(["\n fragment AppByImplementationId on App {\n id\n slug\n name\n currentImplementation {\n id\n }\n images {\n url16X16\n url32X32\n url64X64\n url128X128\n }\n }\n"]);return se=function(){return e},e}function ce(){var e=(0,i.Z)(["\n ","\n\n query getAppByImplementationIdQuery($id: ID!) {\n appByImplementationId(id: $id) {\n ...AppByImplementationId\n }\n }\n"]);return ce=function(){return e},e}var ue,de=(0,le.Ps)(se()),pe=(0,le.Ps)(ce(),de),he=function(e){var n=e.id,t=(0,ie.a)(pe,{skip:!n,variables:{id:n}}),i=t.data,r=t.loading;if(null===i||void 0===i?void 0:i.appByImplementationId){var a=i.appByImplementationId.images,o=(0,oe.mapKeys)(a,(function(e,n){if(n.includes("url")){var t=n.toLowerCase().split("url")[1];return"url_".concat(t)}}));return{app:(0,H.Z)((0,O.Z)({},i.appByImplementationId),{images:o}),isLoading:r}}return{app:null,isLoading:r}},ve=(0,m.uq)({desktop:{align:"right",maxWidth:"500%",minWidth:"100%"},tablet:{align:"left",maxWidth:"200%",minWidth:"100%"},mobile:{align:"stretch"}}),me=function(e){var n=e.onChange,t=(0,a.useState)(),i=t[0],o=t[1],s=(0,l.useRouter)().query,c=s.appId?s.appId:"",u=he({id:c}).app;(0,a.useEffect)((function(){i!==(null===u||void 0===u?void 0:u.id)&&o(null===u||void 0===u?void 0:u.id)}),[i,u]);var d=function(e){var t,i=null===e||void 0===e||null===(t=e.currentImplementation)||void 0===t?void 0:t.id;n("app",i)};return(0,r.tZ)(re.g,{label:"APPS USED",renderInput:function(){return(0,r.tZ)(ae.U,{ariaLabel:"App Filter",initialSelectedItem:u,menuAriaLabel:"List of apps to filter by",onChange:d,placeholder:"All apps",renderFloatingMenu:function(e){return(0,r.tZ)(K.A,(0,O.Z)({},e,ve))},useQuery:ie.a},i)}})},fe=t(50930),ge=t(3e3),Ze=t(70776),be=t(81901),ye=t(15504),xe=t(16181),Ae=t(60390);!function(e){e.allMyConnections="my",e.allSharedConnections="shared",e.allPrivateConnections="private"}(ue||(ue={}));var Ce={id:void 0,title:"All Connections"},Ie={id:ue.allMyConnections,prefix:"Personal",title:"All personal connections"},Se={id:ue.allPrivateConnections,prefix:"Private",title:"All private connections"},we={id:ue.allSharedConnections,prefix:"Shared",title:"All shared connections"},ke=function(e){return(0,o.iv)("max-height:",40*((e||0)+.5)+10,"px;overflow:auto;padding:10px;","ConnectionFilter.tsx--listStyle")},Te=(0,o.iv)(ge.ZT.smallPrint1," align-items:center;border-radius:10px;cursor:pointer;display:flex;height:",40,"px;padding:0 10px;position:relative;","ConnectionFilter.tsx--menuItemStyle"),De=(0,o.iv)("color:",Ze.w.neutral700,";","ConnectionFilter.tsx--menuItemDisabled"),Be=(0,o.iv)("background-color:",Ze.w.ocean5,";color:",Ze.w.ocean,";font-weight:600;","ConnectionFilter.tsx--menuItemHighlighted"),Me=(0,o.iv)("flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;","ConnectionFilter.tsx--menuItemTextStyle"),Le=function(e){return(0,o.iv)("margin-top:42px;:before{",ge.ZT.superTitle3," background-color:",Ze.w.white,";color:",Ze.w.neutral800,';content:"',e,'";position:absolute;top:-20px;}',"ConnectionFilter.tsx--prefixStyle")};function ze(e){var n=e.onFilterChange,t=(0,l.useRouter)().query,i=t.selectedApi?t.selectedApi:"",o=t.serviceSlug?t.serviceSlug:"",s=t.authId,c=(0,xe.gn)().userId,u=(0,Ae.Z)({id:null,selectedApi:i,serviceSlug:o,userId:c}),d=u.myAuthentications.filter((function(e){return e.zapCount>0})),p=u.privateAuthentications.filter((function(e){return e.zapCount>0})),h=u.sharedAuthentications.filter((function(e){return e.zapCount>0})),v=d.length>0?[Ie].concat((0,fe.Z)(d)):[],f=p.length>0?[Se].concat((0,fe.Z)(p)):[],g=h.length>0?[we].concat((0,fe.Z)(h)):[],Z=[Ce].concat((0,fe.Z)(v),(0,fe.Z)(f),(0,fe.Z)(g)).filter(Boolean),b=Z.find((function(e){return e.id===s}));return(0,r.tZ)(re.g,{label:"CONNECTION",renderInput:function(){return(0,r.tZ)(be.L,{getKeyForItem:function(e){return e.id||"default"},getLabelForItem:function(e){return e.title},items:Z,onChange:function(e){return n("connection",e.id)},placeholder:"Select connection",renderFloatingMenu:function(e){var n=e.ariaLabel,t=e.getItemProps,i=e.getKeyForItem,o=e.getLabelForItem,l=e.getMenuProps,s=e.highlightedIndex,c=e.items,u=e.maxWidth,d=e.minWidth;return(0,r.BX)(a.Fragment,{children:[(0,r.tZ)("div",{css:m.Q0,children:(0,r.tZ)(ye.f,{maxWidth:u,minWidth:d,align:"stretch",children:(0,r.tZ)("ul",(0,H.Z)((0,O.Z)({css:ke(6)},l({"aria-label":n})),{children:c.map((function(e,n){return(0,a.createElement)("li",(0,H.Z)((0,O.Z)({},t({disabled:e.disabled,item:e})),{css:[Te,e.disabled&&De,s===n&&Be,e.prefix&&Le(e.prefix)],key:i?i(e):n}),(0,r.tZ)("span",{css:Me,children:o(e)}))}))}))})}),(0,r.tZ)("div",{css:m.eI,children:(0,r.tZ)(ye.f,{maxWidth:u,minWidth:d,align:"left",children:(0,r.tZ)("ul",(0,H.Z)((0,O.Z)({css:ke(6)},l({"aria-label":n})),{children:c.map((function(e,n){return(0,a.createElement)("li",(0,H.Z)((0,O.Z)({},t({disabled:e.disabled,item:e})),{css:[Te,e.disabled&&De,s===n&&Be,e.prefix&&Le(e.prefix)],key:i?i(e):n}),(0,r.tZ)("span",{css:Me,children:o(e)}))}))}))})})]})},selectedItem:b})}})}var Pe,Xe=t(44055),$e=t(56357),Re=function(e){var n=e.onFilterChange,t=(0,l.useRouter)().query,i=(0,$e.H7)(t);return(0,r.tZ)(re.g,{label:"LAST CHANGED",renderInput:function(){return(0,r.BX)(a.Fragment,{children:[(0,r.tZ)("div",{css:m.Q0,children:(0,r.tZ)(Xe.D,{ariaLabel:"Date Filter",closeText:"Apply",menuAlign:"right",menuAriaLabel:"Choice of date ranges",onChange:function(e){return n("activity",e)},placeholder:"Select date range",value:i,size:"small"})}),(0,r.tZ)("div",{css:m.eI,children:(0,r.tZ)(Xe.D,{ariaLabel:"Date Filter",closeText:"Apply",menuAlign:"left",menuAriaLabel:"Choice of date ranges",onChange:function(e){return n("activity",e)},placeholder:"Select date range",value:i,size:"large"})})]})}})};!function(e){e[void 0]="All",e.on="On",e.off="Off"}(Pe||(Pe={}));var Ee=function(e){var n=e.onFilterChange,t=(0,l.useRouter)().query,i=null===t||void 0===t?void 0:t.status,a=[{label:Pe.undefined,value:void 0},{label:Pe.on,value:"on"},{label:Pe.off,value:"off"}].filter(Boolean);return(0,r.tZ)(re.g,{label:"ZAP STATUS",renderInput:function(){return(0,r.tZ)(be.L,{ariaLabel:"Status",items:a,menuAriaLabel:"List of Zap statuses",onChange:function(e){return function(e){n("status",e)}(e.value)},placeholder:"Choose a status...",selectedItem:a.find((function(e){return(null===e||void 0===e?void 0:e.value)===i&&e}))})}})};function Fe(){var e=(0,i.Z)(['\n grid-template-areas: "ConnectionFilter DateFilter StatusFilter AppFilter clearButton";\n grid-template-columns: 1fr 1fr 1fr 1fr 0.5fr;\n grid-template-rows: 1fr;\n ']);return Fe=function(){return e},e}function _e(){var e=(0,i.Z)(['\n grid-template-areas:\n "ConnectionFilter DateFilter"\n "StatusFilter AppFilter"\n "clearButton clearButton";\n grid-template-columns: 1fr 1fr;\n grid-template-rows: 1fr 1fr auto;\n ']);return _e=function(){return e},e}function qe(){var e=(0,i.Z)(['\n grid-template-areas: "ConnectionFilter" "DateFilter" "StatusFilter" "AppFilter" "clearButton";\n display: grid;\n grid-gap: 10px;\n ']);return qe=function(){return e},e}var Oe=(0,m.uq)({desktop:(0,o.iv)(Fe()),tablet:(0,o.iv)(_e()),mobile:(0,o.iv)(qe())}),He=(0,o.iv)("align-self:end;grid-area:clearButton;padding-bottom:5px;","ZapFilters.tsx--clearButtonStyle"),We=function(){var e=(0,l.useRouter)(),n=e.asPath,t=e.push,i=(0,a.useCallback)((function(e,i){var r=n;switch(e){case"activity":var a=i;r=a&&a.from&&a.to?(0,v.aE)(n,(0,H.Z)((0,O.Z)({},(0,$e.xB)(a)),{page:"0"})):(0,v.Hn)(n,["end","start"]);break;case"app":var o=i;r=o?(0,v.aE)(n,{appId:o,page:"0"}):(0,v.Hn)(n,["appId"]);break;case"connection":var l=i;r=l?(0,v.aE)(n,{authId:l,page:"0"}):(0,v.Hn)(n,["authId"]);break;case"status":var s=i;r=s?(0,v.aE)(n,{page:"0",status:s}):(0,v.Hn)(n,["status"])}t(r,void 0,{shallow:!0})}),[n,t]);return(0,r.BX)("section",{css:Oe,children:[(0,r.tZ)(ze,{onFilterChange:i}),(0,r.tZ)(Re,{onFilterChange:i}),(0,r.tZ)(Ee,{onFilterChange:i}),(0,r.tZ)(me,{onChange:i}),(0,r.tZ)("span",{css:He,children:(0,r.tZ)(u.z,{color:"secondary",isFullWidth:!0,onClick:function(){var e=(0,v.Hn)(n,["appId","authId","end","start","status"]);t((0,v.aE)(e,{page:"0"}),void 0,{shallow:!0})},size:"small",children:"Clear all"})})]})},Ne=t(15466);function Ye(){var e=(0,i.Z)(["\n fragment TopZap on TopZap {\n id\n tasks {\n billable\n }\n }\n"]);return Ye=function(){return e},e}function Ue(){var e=(0,i.Z)(["\n ","\n query GetZapStats($accountId: Int!, $rootIds: [ID!]!) {\n account(id: $accountId) {\n id\n topZaps(rootIds: $rootIds) {\n ...TopZap\n }\n }\n }\n"]);return Ue=function(){return e},e}var je=(0,le.Ps)(Ye()),Ke=(0,le.Ps)(Ue(),je);var Ve=function(e){var n,t=e.accountId,i=e.rootIds,r=(0,ie.a)(Ke,{skip:!i||0===i.length||!t,variables:{accountId:t,rootIds:i}}),a=r.loading,o=r.data;return{isLoading:a,zapStats:null===o||void 0===o||null===(n=o.account)||void 0===n?void 0:n.topZaps}};function Ge(){var e=(0,i.Z)(["\n place-items: start;\n grid-template-columns: auto 250px 100px;\n "]);return Ge=function(){return e},e}function Je(){var e=(0,i.Z)(["\n display: grid;\n grid-gap: 20px;\n "]);return Je=function(){return e},e}var Qe=(0,o.iv)("display:grid;grid-gap:20px;padding:20px;","AppZaps.tsx--rootStyle"),en=(0,m.uq)({tablet:(0,o.iv)(Ge()),mobile:(0,o.iv)(Je())}),nn=(0,o.iv)("flex-grow:1;","AppZaps.tsx--headerAndDescStyle"),tn=(0,o.iv)("display:flex;flex-direction:column;flex:1;","AppZaps.tsx--headerTextStyle"),rn=(0,o.iv)("display:flex;justify-content:center;","AppZaps.tsx--paginatorStyle"),an=function(e){var n=e.isZapsLoading,t=e.legacyZapIds,i=e.totalZapCount,o=e.zaps,m=e.zapsError,g=(0,xe.gn)(),Z=g.isTeam,b=g.accountId,y=(0,l.useRouter)(),x=y.push,A=y.query,C=y.asPath,I=(0,a.useState)(!1),S=I[0],w=I[1],k=A.authId?A.authId:"",D=A.selectedApi?A.selectedApi:"",B=A.serviceSlug?A.serviceSlug:"",M=A.zapSort?A.zapSort:void 0,L=parseInt(A.page)||0,z=(0,Ne.Z)({selectedApi:D,serviceSlug:B}).app,P=(0,a.useMemo)((function(){var e=(null===z||void 0===z?void 0:z.name)||(null===z||void 0===z?void 0:z.title);return e?"All Zaps using ".concat(e):""}),[z]),X=Ve({accountId:b,rootIds:t}),$=X.zapStats,R=X.isLoading;return!n&&m?(0,r.tZ)("div",{css:Qe,children:(0,r.tZ)(s.b,{type:"error",children:m})}):(0,r.BX)("div",{css:Qe,children:[(0,r.BX)("div",{css:en,children:[(0,r.BX)("div",{css:nn,children:[(0,r.tZ)("div",{css:tn,children:(0,r.tZ)(c.x,{tag:"h2",type:"subHeader1Semibold",children:P})}),i>0&&(0,r.tZ)(c.x,{tag:"p",type:"smallPrint1",children:"Zap Task counts are from the current billing period."})]}),(0,r.tZ)(te,{onChange:function(e){var n=(0,v.Sr)(C,{zapSort:e});x(n,void 0,{shallow:!0})},value:M}),(0,r.tZ)(u.z,{color:S?"primary-alt":"secondary",iconBefore:"actionFilter",onClick:function(){return w((function(e){return!e}))},size:"small",children:"Filter"})]}),S&&(0,r.tZ)(We,{}),!n&&o.length>0&&(0,r.tZ)(f.Z,{gap:15,id:"zap-list",itemRenderer:function(e){return(0,r.tZ)(_,{hasTeams:Z,isZapStatsLoading:R,zap:e,zapStat:null===$||void 0===$?void 0:$.find((function(n){return n.id===e.id}))})},items:o}),n&&(0,r.tZ)(f.Z,{gap:10,itemRenderer:function(){return(0,r.tZ)(d.g,{children:(0,r.tZ)(p.q,{height:74,width:"100%"})})},items:Array.from({length:T.wt})}),!n&&0===o.length&&(0,r.tZ)(c.x,{color:"neutral700",type:"paragraph1Short",children:k?"There are no Zaps for your given filters":"We couldn't find any Zaps for this app."}),i>T.wt&&(0,r.tZ)("div",{css:rn,children:(0,r.tZ)(h.D,{currentPageIndex:L,pageUrls:Array.from({length:Math.ceil(i/T.wt)},(function(e,n){return(0,v.Sr)(C,{page:n})}))})})]})}},56357:function(e,n,t){t.d(n,{H7:function(){return s},xB:function(){return c}});var i=t(94149),r=t(42838),a=t(50930),o=t(25155);function l(e,n){if(e){var t=e.split("-").map(Number),o=n?[23,59,59.999]:[0,0,0],l=t[1]-1,s=(0,i.Z)(Date,[t[0],l,t[2]].concat((0,a.Z)(o)));return(0,r.Z)(s,Date)&&!isNaN(s.valueOf())?s:void 0}}function s(e){return e.end||e.start?{from:l(e.start,!1),to:l(e.end,!0)}:{}}function c(e){return{end:(null===e||void 0===e?void 0:e.to)?(0,o.format)(e.to,"YYYY-MM-DD"):void 0,start:(null===e||void 0===e?void 0:e.from)?(0,o.format)(e.from,"YYYY-MM-DD"):void 0}}},71937:function(e,n,t){t.d(n,{G:function(){return i}});var i=function(e){if(!e)return"";var n=e.indexOf(" ");return-1!==n?"".concat(e.substring(0,n+2),"."):e}},70398:function(e,n,t){t.d(n,{CD:function(){return c},Q0:function(){return p},eI:function(){return u},pI:function(){return d},uq:function(){return s}});var i=t(47842),r=t(28165),a="@media (min-width: 0)",o="@media (min-width: 660px)",l="@media (min-width: 1024px)",s=function(e){return[e.mobile?(0,i.Z)({},a,(0,r.iv)(e.mobile)):void 0,e.tablet?(0,i.Z)({},o,(0,r.iv)(e.tablet)):void 0,e.desktop?(0,i.Z)({},l,(0,r.iv)(e.desktop)):void 0].filter(Boolean)},c=s({mobile:{display:"inherit",visibility:"visible"},tablet:{display:"none",visibility:"hidden"},desktop:{display:"none",visibility:"hidden"}}),u=(s({mobile:{display:"none",visibility:"hidden"},tablet:{display:"inherit",visibility:"visible"},desktop:{display:"none",visibility:"hidden"}}),s({mobile:{display:"none",visibility:"hidden"},tablet:{display:"none",visibility:"hidden"},desktop:{display:"inherit",visibility:"visible"}})),d=s({mobile:{display:"none",visibility:"hidden"},tablet:{display:"inherit",visibility:"visible"},desktop:{display:"inherit",visibility:"visible"}}),p=s({mobile:{display:"inherit",visibility:"visible"},tablet:{display:"inherit",visibility:"visible"},desktop:{display:"none",visibility:"hidden"}})},49187:function(e,n,t){t.d(n,{f:function(){return r}});var i=t(28165);function r(e){return(0,i.iv)("grid-area:",e,";","[filename]--[local]")}},25277:function(e,n,t){var i=t(52903),r=t(21357),a=t(47553);n.Z=function(e){var n=e.avatarsCount,t=e.avatarsNodes,o=e.multiline,l=void 0!==o&&o,s=e.size,c=e.children,u=[t].slice(0,n),d=(0,i.tZ)(r.H,{children:u});return(0,i.tZ)(a.w,{avatars:d,multiline:l,size:s,children:c})}},80327:function(e,n,t){var i=t(2784);n.Z=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).id,n=(0,i.useRef)(null),t=function(){var e;null===n||void 0===n||null===(e=n.current)||void 0===e||e.focus()};return(0,i.useEffect)((function(){setTimeout((function(){var t,i;e?null===(t=document.getElementById(e))||void 0===t||t.focus():null===n||void 0===n||null===(i=n.current)||void 0===i||i.focus()}))}),[e]),[n,t]}}}]);
//# sourceMappingURL=9346-39f2bba9f43e1d73.js.map