@hiver/connector-admin 4.18.0-themeMode-beta.2 → 4.18.0-themeMode-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.es.js
CHANGED
|
@@ -36750,6 +36750,7 @@ const Jb = {
|
|
|
36750
36750
|
tA,
|
|
36751
36751
|
{
|
|
36752
36752
|
popupIcon: l,
|
|
36753
|
+
disablePortal: !0,
|
|
36753
36754
|
slotProps: { popper: { sx: eB() }, paper: tB() },
|
|
36754
36755
|
value: Object.keys((a == null ? void 0 : a[0]) || {}).length ? a[0] : null,
|
|
36755
36756
|
getOptionLabel: (g) => g[r] ?? "",
|
|
@@ -38916,7 +38917,9 @@ const dX = S(ee)`
|
|
|
38916
38917
|
classes: {
|
|
38917
38918
|
...t,
|
|
38918
38919
|
popper: e,
|
|
38919
|
-
|
|
38920
|
+
// connectorAdmin-portal carries the theme's --connector-admin-* variables
|
|
38921
|
+
// into the body portal, where the wrapper's own copies don't reach.
|
|
38922
|
+
tooltip: ["connector-admin-rich-tooltip", "connectorAdmin-portal", t == null ? void 0 : t.tooltip].filter(Boolean).join(" ")
|
|
38920
38923
|
}
|
|
38921
38924
|
}
|
|
38922
38925
|
)
|
package/index.umd.js
CHANGED
|
@@ -3426,7 +3426,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
3426
3426
|
color: var(--connector-admin-icon-secondary);
|
|
3427
3427
|
margin-top: 0.5px;
|
|
3428
3428
|
}
|
|
3429
|
-
`,lu=({options:e=[],type:t,placeholder:n,labelKey:r="label",valueKey:o="id",onChangeFunc:a,currentSelectedOptions:A=[],isSingleSelect:s=!1,inputVariant:c="standard",popupIcon:u})=>{const g=!A.length;return l.jsx(NJ,{children:s?l.jsx(i.Autocomplete,{popupIcon:u,slotProps:{popper:{sx:yy()},paper:by()},value:Object.keys((A==null?void 0:A[0])||{}).length?A[0]:null,getOptionLabel:d=>d[r]??"",onChange:a,options:e,renderOption:(d,f)=>l.jsx(i.Box,{component:"li",...d,minHeight:"34px !important",children:f[r]}),renderInput:d=>l.jsx(KC,{...d,ref:d.inputProps.ref,variant:c,placeholder:n})}):l.jsx(i.Autocomplete,{popupIcon:u,value:A,slotProps:{popper:{modifiers:[{name:"flip",options:{rootBoundary:"document"}}],sx:yy()},paper:by()},"data-testid":`${t}-dropdown`,disablePortal:!0,multiple:!0,disableCloseOnSelect:!0,limitTags:2,options:e,isOptionEqualToValue:(d,f)=>(f==null?void 0:f[o])===""?!0:d[o]===f[o],renderOption:(d,f,{selected:h})=>{const{key:p,...E}=d;return l.jsxs(i.Box,{component:"li",...E,minHeight:"36px",children:[l.jsx(i.Checkbox,{style:{marginRight:8},checked:h}),f[r]]},p)},renderTags:(d,f)=>d.map((h,p)=>l.jsx("div",{children:l.jsx(jJ,{...f({index:p}),label:h[r],variant:"outlined",deleteIcon:l.jsx(i.icons.Close,{})})},h[o])),renderInput:d=>l.jsx(KC,{...d,variant:c,placeholder:g?n:""}),getOptionLabel:d=>d[r],ListboxProps:{style:{maxHeight:250}},onChange:a})})},VJ=e=>S.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},S.createElement("g",{clipPath:"url(#clip0_3803_129233)"},S.createElement("path",{d:"M7.3335 4.66683H8.66683V6.00016H7.3335V4.66683ZM7.3335 7.3335H8.66683V11.3335H7.3335V7.3335ZM8.00016 1.3335C4.32016 1.3335 1.3335 4.32016 1.3335 8.00016C1.3335 11.6802 4.32016 14.6668 8.00016 14.6668C11.6802 14.6668 14.6668 11.6802 14.6668 8.00016C14.6668 4.32016 11.6802 1.3335 8.00016 1.3335ZM8.00016 13.3335C5.06016 13.3335 2.66683 10.9402 2.66683 8.00016C2.66683 5.06016 5.06016 2.66683 8.00016 2.66683C10.9402 2.66683 13.3335 5.06016 13.3335 8.00016C13.3335 10.9402 10.9402 13.3335 8.00016 13.3335Z",fill:"#6F7C90"})),S.createElement("defs",null,S.createElement("clipPath",{id:"clip0_3803_129233"},S.createElement("rect",{width:16,height:16,fill:"white"})))),xy=e=>{const{selectedEmailInboxes:t,setSelectedEmailInboxes:n,selectedRoles:r,setSelectedRoles:o}=e,a=Te(Fa)??[],A=Te(Xo)??[];return[{type:$1,options:A,label:Iz,isSingleSelect:!1},{type:mz,options:a,label:hz,isSingleSelect:!0}].map(({type:c,options:u,label:g,isSingleSelect:d})=>{const f=c===$1,h=f?t:r;return l.jsxs(i.Box,{marginBottom:"20px",children:[l.jsx(Nz,{variant:"h4",children:g}),l.jsx(lu,{isSingleSelect:d,currentSelectedOptions:d?[h]:h,options:u,type:c,placeholder:f?pz:Bz,onChangeFunc:(p,E)=>f?n(E):o(E??{}),valueKey:"id",labelKey:f?"name":"displayName"}),d?l.jsxs(jz,{width:"fit-content",children:[l.jsx(VJ,{className:"**:[path]:fill-[var(--connector-admin-icon-secondary)]"}),l.jsx(i.Typography,{variant:"caption",color:"var(--connector-admin-text-tertiary)",fontSize:`${i.theme.typography.overline.fontSize}px`,children:yz})]}):null]},c)})},ka={CARD_VISIBILITY:{ID:0,LABEL:"Card visibility"},FIELD_VISIBILITY:{ID:1,LABEL:"Field visibility"}},vy="New fields",HJ=({handleClose:e,id:t,emailSMs:n,setShowEnabledModal:r,roles:o,currentConnectorId:a,title:A,fields:s,setVisitedFieldVisTab:c})=>{var U,te;const{availableFeatures:u,sendTrackingEvent:g}=Q.useContext(Et),d=Yn(),f=Te(Rr),h=Te(Fa)??[],p=Te(Xo)??[],E=Te(nE),C=Te(tE),{userId:B}=ar()||{},I=(te=(U=f==null?void 0:f[a])==null?void 0:U.cardList)==null?void 0:te.find(ee=>ee.id===t),[m,y]=Q.useState(()=>(p==null?void 0:p.filter(ee=>n==null?void 0:n.includes(ee.id)))??[]),[b,v]=Q.useState(()=>(h==null?void 0:h.find(ee=>o==null?void 0:o.includes(ee.name)))??{}),[w,x]=Q.useState(()=>(I==null?void 0:I.fields)??[]),[T,R]=Q.useState(ka.CARD_VISIBILITY.ID);Q.useEffect(()=>{d(NA(t))},[d,t]),Q.useEffect(()=>{E[t]&&x(ee=>Bi(ee,E[t]||[]))},[E,t]);const F=Q.useMemo(()=>!Array.isArray(n)||n.length!==m.length?!1:n.every(ee=>m.some(({id:ce})=>ce===ee)),[n,m]),P=Q.useMemo(()=>Array.isArray(o)?o.length?!!(o!=null&&o.every(ee=>b.name===ee)):!Object.keys(b).length:!1,[o,b]),M=Q.useMemo(()=>{const ee=E[t]||[];if(!Array.isArray(s))return!1;const ce=Bi(s,ee);if(w.length!=ce.length)return!1;for(let Ie=0;Ie<ce.length;Ie++){const ge=ce[Ie],Pe=w[Ie];if(w&&(ge.key!==Pe.key||ge.enabled!==Pe.enabled||ge.fieldAccessMode!==Pe.fieldAccessMode))return!1}return!0},[s,w,E,t]),D=m.length!==0&&w.filter(ee=>ee.enabled).length===0,z=C===pe.LOADING||F&&P&&M||D,Z=Q.useMemo(()=>!!(s!=null&&s.some(ee=>ee.isFieldNew)),[s]),K=B&&BE(t,B),Y=LA(u)&&Z&&!K?vy:"",k=ee=>{ee.stopPropagation();const ce=b!=null&&b.name?[b.name]:[],Ie=m.map(Pe=>Pe.id),ge=w.map((Pe,q)=>({...Pe,priority:q+1}));d(kA({cardId:t,data:{roles:ce,inboxes:{email:Ie,chat:[]},fields:ge},currentConnector:a})).unwrap().then(()=>{var de,ye,Ze;const Pe=(de=f==null?void 0:f[a])==null?void 0:de.name,q=(Ze=(ye=f==null?void 0:f[a])==null?void 0:ye.cardList)==null?void 0:Ze.some(Ke=>{var wn;if(Ke.id===t)return!1;const{email:qt,chat:it}=Ke.inboxes,ft=!!(((qt==null?void 0:qt.length)??0)+((it==null?void 0:it.length)??0)),vt=!!((wn=Ke==null?void 0:Ke.roles)!=null&&wn.length);return ft&&vt});g(Je.CARD_VISIBILITY_UPDATED,{new_status:Ie.length&&(b!=null&&b.name)?HA:GA,pre_status:n!=null&&n.length&&(h!=null&&h.length)?HA:GA,connector_name:Pe,card_title:A}),!q&&(b!=null&&b.name)&&Ie.length?r(!0):Pe&&Ot({message:K1.replace(Au,Pe),type:Mr})}).catch(()=>{Ot({message:aE,type:xn})}).finally(()=>e())},O=()=>{e(),g(Je.CARD_VISIBILITY_UPDATE_CLOSED)},L=(ee,ce)=>{R(ce),ce===ka.FIELD_VISIBILITY.ID&&(g(Je.CONNECTOR_VISIBILITY_FIELD_TAB_CLICKED),c(!0))},j=(ee,ce)=>{var ge;const Ie=(ge=Object.values(ka).find(Pe=>Pe.ID===ee))==null?void 0:ge.LABEL;return l.jsxs(i.Stack,{direction:"row",alignItems:"center",gap:1.25,children:[Ie,ce?l.jsx(WA,{label:ce}):null]})},G=(I==null?void 0:I.cardAccessMode)===En.READ_WRITE;return l.jsx(sE,{children:l.jsxs(lE,{style:{height:"max-content"},children:[l.jsx(Rz,{variant:"h2",children:rE}),l.jsx(i.Box,{marginBottom:"24px",children:l.jsxs(i.Tabs,{value:T,onChange:L,children:[l.jsx(ty,{label:j(ka.CARD_VISIBILITY.ID)}),l.jsx(ty,{label:j(ka.FIELD_VISIBILITY.ID,Y)})]})}),l.jsx("div",{hidden:T!==ka.CARD_VISIBILITY.ID,style:{height:"100%"},children:l.jsx(xy,{selectedEmailInboxes:m,setSelectedEmailInboxes:y,selectedRoles:b,setSelectedRoles:v})}),l.jsx("div",{hidden:T!==ka.FIELD_VISIBILITY.ID,style:{height:"100%"},children:l.jsx(Qy,{showCreate:G,fields:w,setFields:x,cardId:t})}),l.jsxs(iE,{children:[l.jsx(gE,{onClick:O,variant:"text",children:oE}),l.jsx(i.Tooltip,{title:D?ey:null,children:l.jsx("div",{children:l.jsx(uE,{onClick:k,disabled:z,children:C!==pe.LOADING?l.jsx(i.Typography,{variant:"body2_medium",children:AE}):l.jsx(i.Grid,{height:"22px",children:l.jsx(cE,{size:22})})})})})]})]})})},GJ=({id:e,title:t,emailSMs:n,roles:r,currentConnectorId:o,handleClose:a,setShowEnabledModal:A})=>{var F;const{sendTrackingEvent:s}=Q.useContext(Et),c=Yn(),u=Te(Rr),g=Te(Fa)??[],d=Te(Xo)??[],f=Te(nE),h=Te(tE),p=u==null?void 0:u[o],E=(F=p==null?void 0:p.cardList)==null?void 0:F.find(P=>P.id===e),[C,B]=Q.useState(()=>(d==null?void 0:d.filter(P=>n==null?void 0:n.includes(P.id)))??[]),[I,m]=Q.useState(()=>(g==null?void 0:g.find(P=>r==null?void 0:r.includes(P.name)))??{}),[y,b]=Q.useState(()=>(E==null?void 0:E.fields)??[]);Q.useEffect(()=>{c(NA(e))},[c,e]),Q.useEffect(()=>{f[e]&&b(P=>Bi(P,f[e]||[]))},[f,e]);const v=Q.useMemo(()=>!Array.isArray(n)||n.length!==C.length?!1:n.every(P=>C.some(({id:M})=>M===P)),[n,C]),w=Q.useMemo(()=>Array.isArray(r)?r.length?!!(r!=null&&r.every(P=>I.name===P)):!Object.keys(I).length:!1,[r,I]),x=h===pe.LOADING||v&&w,T=P=>{P.stopPropagation();const M=I!=null&&I.name?[I.name]:[],D=C.map(Z=>Z.id),z=y.map((Z,K)=>({...Z,priority:K+1}));c(kA({cardId:e,data:{roles:M,inboxes:{email:D,chat:[]},fields:z},currentConnector:o})).unwrap().then(()=>{var Ae;const Z=p==null?void 0:p.name,K=(Ae=p==null?void 0:p.cardList)==null?void 0:Ae.some(Y=>{var G;if(Y.id===e)return!1;const{email:k,chat:O}=Y.inboxes,L=!!(((k==null?void 0:k.length)??0)+((O==null?void 0:O.length)??0)),j=!!((G=Y==null?void 0:Y.roles)!=null&&G.length);return L&&j});s(Je.CARD_VISIBILITY_UPDATED,{new_status:D.length&&(I!=null&&I.name)?HA:GA,pre_status:n!=null&&n.length&&(g!=null&&g.length)?HA:GA,connector_name:Z,card_title:t}),!K&&(I!=null&&I.name)&&D.length?A(!0):Z&&Ot({message:K1.replace(Au,Z),type:Mr})}).catch(()=>{Ot({message:aE,type:xn})}).finally(()=>a())},R=()=>{a(),s(Je.CARD_VISIBILITY_UPDATE_CLOSED)};return l.jsx(sE,{children:l.jsxs(lE,{children:[l.jsx(i.Typography,{variant:"h2",children:rE}),l.jsx(i.Typography,{variant:"body2",marginBottom:"24px",color:"var(--connector-admin-text-tertiary)",children:Ez.replace(Au,(p==null?void 0:p.name)??"")}),l.jsx("div",{style:{height:"100%"},children:l.jsx(xy,{selectedEmailInboxes:C,setSelectedEmailInboxes:B,selectedRoles:I,setSelectedRoles:m})}),l.jsxs(iE,{children:[l.jsx(gE,{onClick:R,variant:"text",children:oE}),l.jsx(uE,{onClick:T,disabled:x,children:h!==pe.LOADING?l.jsx(i.Typography,{variant:"body2_medium",children:AE}):l.jsx(i.Grid,{height:"22px",children:l.jsx(cE,{size:22})})})]})]})})},WJ=({id:e,title:t,emailSMs:n,roles:r,currentConnectorId:o,fields:a,preSelectTab:A,handleClose:s})=>{var F;const{sendTrackingEvent:c}=Q.useContext(Et),u=Yn(),g=Te(Rr),d=Te(Fa),f=Te(Xo),h=Te(nE),p=Te(tE),E=g==null?void 0:g[o],C=(F=E==null?void 0:E.cardList)==null?void 0:F.find(P=>P.id===e),B=Q.useMemo(()=>(f==null?void 0:f.filter(P=>n==null?void 0:n.includes(P.id)))??[],[n,f]),I=Q.useMemo(()=>(d==null?void 0:d.find(P=>r==null?void 0:r.includes(P.name)))??{},[r,d]),[m,y]=Q.useState(()=>(C==null?void 0:C.fields)??[]);Q.useEffect(()=>{u(NA(e))},[u,e]),Q.useEffect(()=>{h[e]&&y(P=>Bi(P,h[e]||[]))},[h,e]);const b=Q.useMemo(()=>{const P=h[e]||[];if(!Array.isArray(a))return!1;const M=Bi(a,P);if(m.length!==M.length)return!1;for(let D=0;D<M.length;D++){const z=M[D],Z=m[D];if(m&&(z.key!==Z.key||z.enabled!==Z.enabled||z.fieldAccessMode!==Z.fieldAccessMode))return!1}return!0},[a,m,h,e]),v=B.length!==0&&m.filter(P=>P.enabled).length===0,w=p===pe.LOADING||b||v,x=(C==null?void 0:C.cardAccessMode)===En.READ_WRITE,T=P=>{P.stopPropagation();const M=I!=null&&I.name?[I.name]:[],D=B.map(K=>K.id),Z=m.map((K,Ae)=>({...K,priority:Ae+1})).map(K=>{if(K.fieldAccessMode||!x)return K;const Ae={...K};return K.enabled&&K.isWriteRequired?Ae.fieldAccessMode=En.READ_WRITE:K.enabled?Ae.fieldAccessMode=En.READ:K.isWriteRequired&&(Ae.fieldAccessMode=En.WRITE),Ae});u(kA({cardId:e,data:{roles:M,inboxes:{email:D,chat:[]},fields:Z},currentConnector:o})).unwrap().then(()=>{const K=E==null?void 0:E.name;c(Je.CARD_VISIBILITY_UPDATED,{new_status:D.length&&(I!=null&&I.name)?HA:GA,pre_status:n!=null&&n.length&&(d!=null&&d.length)?HA:GA,connector_name:K,card_title:t}),Ot({message:Qz,type:Mr}),u(MA())}).catch(()=>{Ot({message:aE,type:xn})}).finally(()=>s())},R=()=>{s(),c(Je.CARD_VISIBILITY_UPDATE_CLOSED)};return l.jsx(sE,{children:l.jsxs(lE,{style:{height:"max-content"},children:[l.jsx(i.Typography,{variant:"h2",children:q1}),l.jsx(i.Typography,{variant:"body2",marginBottom:"24px",color:"var(--connector-admin-text-tertiary)",children:fz.replace(Au,(E==null?void 0:E.name)??"")}),l.jsx(Qy,{showCreate:x,fields:m,setFields:y,cardId:e,preSelectTab:A}),l.jsxs(iE,{children:[l.jsx(gE,{onClick:R,variant:"text",children:oE}),l.jsx(i.Tooltip,{title:v?ey:null,children:l.jsx("div",{children:l.jsx(uE,{onClick:T,disabled:w,children:p!==pe.LOADING?l.jsx(i.Typography,{variant:"body2_medium",children:AE}):l.jsx(i.Grid,{height:"22px",children:l.jsx(cE,{size:22})})})})})]})]})})},zJ=i.styled(i.Box)`
|
|
3429
|
+
`,lu=({options:e=[],type:t,placeholder:n,labelKey:r="label",valueKey:o="id",onChangeFunc:a,currentSelectedOptions:A=[],isSingleSelect:s=!1,inputVariant:c="standard",popupIcon:u})=>{const g=!A.length;return l.jsx(NJ,{children:s?l.jsx(i.Autocomplete,{popupIcon:u,disablePortal:!0,slotProps:{popper:{sx:yy()},paper:by()},value:Object.keys((A==null?void 0:A[0])||{}).length?A[0]:null,getOptionLabel:d=>d[r]??"",onChange:a,options:e,renderOption:(d,f)=>l.jsx(i.Box,{component:"li",...d,minHeight:"34px !important",children:f[r]}),renderInput:d=>l.jsx(KC,{...d,ref:d.inputProps.ref,variant:c,placeholder:n})}):l.jsx(i.Autocomplete,{popupIcon:u,value:A,slotProps:{popper:{modifiers:[{name:"flip",options:{rootBoundary:"document"}}],sx:yy()},paper:by()},"data-testid":`${t}-dropdown`,disablePortal:!0,multiple:!0,disableCloseOnSelect:!0,limitTags:2,options:e,isOptionEqualToValue:(d,f)=>(f==null?void 0:f[o])===""?!0:d[o]===f[o],renderOption:(d,f,{selected:h})=>{const{key:p,...E}=d;return l.jsxs(i.Box,{component:"li",...E,minHeight:"36px",children:[l.jsx(i.Checkbox,{style:{marginRight:8},checked:h}),f[r]]},p)},renderTags:(d,f)=>d.map((h,p)=>l.jsx("div",{children:l.jsx(jJ,{...f({index:p}),label:h[r],variant:"outlined",deleteIcon:l.jsx(i.icons.Close,{})})},h[o])),renderInput:d=>l.jsx(KC,{...d,variant:c,placeholder:g?n:""}),getOptionLabel:d=>d[r],ListboxProps:{style:{maxHeight:250}},onChange:a})})},VJ=e=>S.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},S.createElement("g",{clipPath:"url(#clip0_3803_129233)"},S.createElement("path",{d:"M7.3335 4.66683H8.66683V6.00016H7.3335V4.66683ZM7.3335 7.3335H8.66683V11.3335H7.3335V7.3335ZM8.00016 1.3335C4.32016 1.3335 1.3335 4.32016 1.3335 8.00016C1.3335 11.6802 4.32016 14.6668 8.00016 14.6668C11.6802 14.6668 14.6668 11.6802 14.6668 8.00016C14.6668 4.32016 11.6802 1.3335 8.00016 1.3335ZM8.00016 13.3335C5.06016 13.3335 2.66683 10.9402 2.66683 8.00016C2.66683 5.06016 5.06016 2.66683 8.00016 2.66683C10.9402 2.66683 13.3335 5.06016 13.3335 8.00016C13.3335 10.9402 10.9402 13.3335 8.00016 13.3335Z",fill:"#6F7C90"})),S.createElement("defs",null,S.createElement("clipPath",{id:"clip0_3803_129233"},S.createElement("rect",{width:16,height:16,fill:"white"})))),xy=e=>{const{selectedEmailInboxes:t,setSelectedEmailInboxes:n,selectedRoles:r,setSelectedRoles:o}=e,a=Te(Fa)??[],A=Te(Xo)??[];return[{type:$1,options:A,label:Iz,isSingleSelect:!1},{type:mz,options:a,label:hz,isSingleSelect:!0}].map(({type:c,options:u,label:g,isSingleSelect:d})=>{const f=c===$1,h=f?t:r;return l.jsxs(i.Box,{marginBottom:"20px",children:[l.jsx(Nz,{variant:"h4",children:g}),l.jsx(lu,{isSingleSelect:d,currentSelectedOptions:d?[h]:h,options:u,type:c,placeholder:f?pz:Bz,onChangeFunc:(p,E)=>f?n(E):o(E??{}),valueKey:"id",labelKey:f?"name":"displayName"}),d?l.jsxs(jz,{width:"fit-content",children:[l.jsx(VJ,{className:"**:[path]:fill-[var(--connector-admin-icon-secondary)]"}),l.jsx(i.Typography,{variant:"caption",color:"var(--connector-admin-text-tertiary)",fontSize:`${i.theme.typography.overline.fontSize}px`,children:yz})]}):null]},c)})},ka={CARD_VISIBILITY:{ID:0,LABEL:"Card visibility"},FIELD_VISIBILITY:{ID:1,LABEL:"Field visibility"}},vy="New fields",HJ=({handleClose:e,id:t,emailSMs:n,setShowEnabledModal:r,roles:o,currentConnectorId:a,title:A,fields:s,setVisitedFieldVisTab:c})=>{var U,te;const{availableFeatures:u,sendTrackingEvent:g}=Q.useContext(Et),d=Yn(),f=Te(Rr),h=Te(Fa)??[],p=Te(Xo)??[],E=Te(nE),C=Te(tE),{userId:B}=ar()||{},I=(te=(U=f==null?void 0:f[a])==null?void 0:U.cardList)==null?void 0:te.find(ee=>ee.id===t),[m,y]=Q.useState(()=>(p==null?void 0:p.filter(ee=>n==null?void 0:n.includes(ee.id)))??[]),[b,v]=Q.useState(()=>(h==null?void 0:h.find(ee=>o==null?void 0:o.includes(ee.name)))??{}),[w,x]=Q.useState(()=>(I==null?void 0:I.fields)??[]),[T,R]=Q.useState(ka.CARD_VISIBILITY.ID);Q.useEffect(()=>{d(NA(t))},[d,t]),Q.useEffect(()=>{E[t]&&x(ee=>Bi(ee,E[t]||[]))},[E,t]);const F=Q.useMemo(()=>!Array.isArray(n)||n.length!==m.length?!1:n.every(ee=>m.some(({id:ce})=>ce===ee)),[n,m]),P=Q.useMemo(()=>Array.isArray(o)?o.length?!!(o!=null&&o.every(ee=>b.name===ee)):!Object.keys(b).length:!1,[o,b]),M=Q.useMemo(()=>{const ee=E[t]||[];if(!Array.isArray(s))return!1;const ce=Bi(s,ee);if(w.length!=ce.length)return!1;for(let Ie=0;Ie<ce.length;Ie++){const ge=ce[Ie],Pe=w[Ie];if(w&&(ge.key!==Pe.key||ge.enabled!==Pe.enabled||ge.fieldAccessMode!==Pe.fieldAccessMode))return!1}return!0},[s,w,E,t]),D=m.length!==0&&w.filter(ee=>ee.enabled).length===0,z=C===pe.LOADING||F&&P&&M||D,Z=Q.useMemo(()=>!!(s!=null&&s.some(ee=>ee.isFieldNew)),[s]),K=B&&BE(t,B),Y=LA(u)&&Z&&!K?vy:"",k=ee=>{ee.stopPropagation();const ce=b!=null&&b.name?[b.name]:[],Ie=m.map(Pe=>Pe.id),ge=w.map((Pe,q)=>({...Pe,priority:q+1}));d(kA({cardId:t,data:{roles:ce,inboxes:{email:Ie,chat:[]},fields:ge},currentConnector:a})).unwrap().then(()=>{var de,ye,Ze;const Pe=(de=f==null?void 0:f[a])==null?void 0:de.name,q=(Ze=(ye=f==null?void 0:f[a])==null?void 0:ye.cardList)==null?void 0:Ze.some(Ke=>{var wn;if(Ke.id===t)return!1;const{email:qt,chat:it}=Ke.inboxes,ft=!!(((qt==null?void 0:qt.length)??0)+((it==null?void 0:it.length)??0)),vt=!!((wn=Ke==null?void 0:Ke.roles)!=null&&wn.length);return ft&&vt});g(Je.CARD_VISIBILITY_UPDATED,{new_status:Ie.length&&(b!=null&&b.name)?HA:GA,pre_status:n!=null&&n.length&&(h!=null&&h.length)?HA:GA,connector_name:Pe,card_title:A}),!q&&(b!=null&&b.name)&&Ie.length?r(!0):Pe&&Ot({message:K1.replace(Au,Pe),type:Mr})}).catch(()=>{Ot({message:aE,type:xn})}).finally(()=>e())},O=()=>{e(),g(Je.CARD_VISIBILITY_UPDATE_CLOSED)},L=(ee,ce)=>{R(ce),ce===ka.FIELD_VISIBILITY.ID&&(g(Je.CONNECTOR_VISIBILITY_FIELD_TAB_CLICKED),c(!0))},j=(ee,ce)=>{var ge;const Ie=(ge=Object.values(ka).find(Pe=>Pe.ID===ee))==null?void 0:ge.LABEL;return l.jsxs(i.Stack,{direction:"row",alignItems:"center",gap:1.25,children:[Ie,ce?l.jsx(WA,{label:ce}):null]})},G=(I==null?void 0:I.cardAccessMode)===En.READ_WRITE;return l.jsx(sE,{children:l.jsxs(lE,{style:{height:"max-content"},children:[l.jsx(Rz,{variant:"h2",children:rE}),l.jsx(i.Box,{marginBottom:"24px",children:l.jsxs(i.Tabs,{value:T,onChange:L,children:[l.jsx(ty,{label:j(ka.CARD_VISIBILITY.ID)}),l.jsx(ty,{label:j(ka.FIELD_VISIBILITY.ID,Y)})]})}),l.jsx("div",{hidden:T!==ka.CARD_VISIBILITY.ID,style:{height:"100%"},children:l.jsx(xy,{selectedEmailInboxes:m,setSelectedEmailInboxes:y,selectedRoles:b,setSelectedRoles:v})}),l.jsx("div",{hidden:T!==ka.FIELD_VISIBILITY.ID,style:{height:"100%"},children:l.jsx(Qy,{showCreate:G,fields:w,setFields:x,cardId:t})}),l.jsxs(iE,{children:[l.jsx(gE,{onClick:O,variant:"text",children:oE}),l.jsx(i.Tooltip,{title:D?ey:null,children:l.jsx("div",{children:l.jsx(uE,{onClick:k,disabled:z,children:C!==pe.LOADING?l.jsx(i.Typography,{variant:"body2_medium",children:AE}):l.jsx(i.Grid,{height:"22px",children:l.jsx(cE,{size:22})})})})})]})]})})},GJ=({id:e,title:t,emailSMs:n,roles:r,currentConnectorId:o,handleClose:a,setShowEnabledModal:A})=>{var F;const{sendTrackingEvent:s}=Q.useContext(Et),c=Yn(),u=Te(Rr),g=Te(Fa)??[],d=Te(Xo)??[],f=Te(nE),h=Te(tE),p=u==null?void 0:u[o],E=(F=p==null?void 0:p.cardList)==null?void 0:F.find(P=>P.id===e),[C,B]=Q.useState(()=>(d==null?void 0:d.filter(P=>n==null?void 0:n.includes(P.id)))??[]),[I,m]=Q.useState(()=>(g==null?void 0:g.find(P=>r==null?void 0:r.includes(P.name)))??{}),[y,b]=Q.useState(()=>(E==null?void 0:E.fields)??[]);Q.useEffect(()=>{c(NA(e))},[c,e]),Q.useEffect(()=>{f[e]&&b(P=>Bi(P,f[e]||[]))},[f,e]);const v=Q.useMemo(()=>!Array.isArray(n)||n.length!==C.length?!1:n.every(P=>C.some(({id:M})=>M===P)),[n,C]),w=Q.useMemo(()=>Array.isArray(r)?r.length?!!(r!=null&&r.every(P=>I.name===P)):!Object.keys(I).length:!1,[r,I]),x=h===pe.LOADING||v&&w,T=P=>{P.stopPropagation();const M=I!=null&&I.name?[I.name]:[],D=C.map(Z=>Z.id),z=y.map((Z,K)=>({...Z,priority:K+1}));c(kA({cardId:e,data:{roles:M,inboxes:{email:D,chat:[]},fields:z},currentConnector:o})).unwrap().then(()=>{var Ae;const Z=p==null?void 0:p.name,K=(Ae=p==null?void 0:p.cardList)==null?void 0:Ae.some(Y=>{var G;if(Y.id===e)return!1;const{email:k,chat:O}=Y.inboxes,L=!!(((k==null?void 0:k.length)??0)+((O==null?void 0:O.length)??0)),j=!!((G=Y==null?void 0:Y.roles)!=null&&G.length);return L&&j});s(Je.CARD_VISIBILITY_UPDATED,{new_status:D.length&&(I!=null&&I.name)?HA:GA,pre_status:n!=null&&n.length&&(g!=null&&g.length)?HA:GA,connector_name:Z,card_title:t}),!K&&(I!=null&&I.name)&&D.length?A(!0):Z&&Ot({message:K1.replace(Au,Z),type:Mr})}).catch(()=>{Ot({message:aE,type:xn})}).finally(()=>a())},R=()=>{a(),s(Je.CARD_VISIBILITY_UPDATE_CLOSED)};return l.jsx(sE,{children:l.jsxs(lE,{children:[l.jsx(i.Typography,{variant:"h2",children:rE}),l.jsx(i.Typography,{variant:"body2",marginBottom:"24px",color:"var(--connector-admin-text-tertiary)",children:Ez.replace(Au,(p==null?void 0:p.name)??"")}),l.jsx("div",{style:{height:"100%"},children:l.jsx(xy,{selectedEmailInboxes:C,setSelectedEmailInboxes:B,selectedRoles:I,setSelectedRoles:m})}),l.jsxs(iE,{children:[l.jsx(gE,{onClick:R,variant:"text",children:oE}),l.jsx(uE,{onClick:T,disabled:x,children:h!==pe.LOADING?l.jsx(i.Typography,{variant:"body2_medium",children:AE}):l.jsx(i.Grid,{height:"22px",children:l.jsx(cE,{size:22})})})]})]})})},WJ=({id:e,title:t,emailSMs:n,roles:r,currentConnectorId:o,fields:a,preSelectTab:A,handleClose:s})=>{var F;const{sendTrackingEvent:c}=Q.useContext(Et),u=Yn(),g=Te(Rr),d=Te(Fa),f=Te(Xo),h=Te(nE),p=Te(tE),E=g==null?void 0:g[o],C=(F=E==null?void 0:E.cardList)==null?void 0:F.find(P=>P.id===e),B=Q.useMemo(()=>(f==null?void 0:f.filter(P=>n==null?void 0:n.includes(P.id)))??[],[n,f]),I=Q.useMemo(()=>(d==null?void 0:d.find(P=>r==null?void 0:r.includes(P.name)))??{},[r,d]),[m,y]=Q.useState(()=>(C==null?void 0:C.fields)??[]);Q.useEffect(()=>{u(NA(e))},[u,e]),Q.useEffect(()=>{h[e]&&y(P=>Bi(P,h[e]||[]))},[h,e]);const b=Q.useMemo(()=>{const P=h[e]||[];if(!Array.isArray(a))return!1;const M=Bi(a,P);if(m.length!==M.length)return!1;for(let D=0;D<M.length;D++){const z=M[D],Z=m[D];if(m&&(z.key!==Z.key||z.enabled!==Z.enabled||z.fieldAccessMode!==Z.fieldAccessMode))return!1}return!0},[a,m,h,e]),v=B.length!==0&&m.filter(P=>P.enabled).length===0,w=p===pe.LOADING||b||v,x=(C==null?void 0:C.cardAccessMode)===En.READ_WRITE,T=P=>{P.stopPropagation();const M=I!=null&&I.name?[I.name]:[],D=B.map(K=>K.id),Z=m.map((K,Ae)=>({...K,priority:Ae+1})).map(K=>{if(K.fieldAccessMode||!x)return K;const Ae={...K};return K.enabled&&K.isWriteRequired?Ae.fieldAccessMode=En.READ_WRITE:K.enabled?Ae.fieldAccessMode=En.READ:K.isWriteRequired&&(Ae.fieldAccessMode=En.WRITE),Ae});u(kA({cardId:e,data:{roles:M,inboxes:{email:D,chat:[]},fields:Z},currentConnector:o})).unwrap().then(()=>{const K=E==null?void 0:E.name;c(Je.CARD_VISIBILITY_UPDATED,{new_status:D.length&&(I!=null&&I.name)?HA:GA,pre_status:n!=null&&n.length&&(d!=null&&d.length)?HA:GA,connector_name:K,card_title:t}),Ot({message:Qz,type:Mr}),u(MA())}).catch(()=>{Ot({message:aE,type:xn})}).finally(()=>s())},R=()=>{s(),c(Je.CARD_VISIBILITY_UPDATE_CLOSED)};return l.jsx(sE,{children:l.jsxs(lE,{style:{height:"max-content"},children:[l.jsx(i.Typography,{variant:"h2",children:q1}),l.jsx(i.Typography,{variant:"body2",marginBottom:"24px",color:"var(--connector-admin-text-tertiary)",children:fz.replace(Au,(E==null?void 0:E.name)??"")}),l.jsx(Qy,{showCreate:x,fields:m,setFields:y,cardId:e,preSelectTab:A}),l.jsxs(iE,{children:[l.jsx(gE,{onClick:R,variant:"text",children:oE}),l.jsx(i.Tooltip,{title:v?ey:null,children:l.jsx("div",{children:l.jsx(uE,{onClick:T,disabled:w,children:p!==pe.LOADING?l.jsx(i.Typography,{variant:"body2_medium",children:AE}):l.jsx(i.Grid,{height:"22px",children:l.jsx(cE,{size:22})})})})})]})]})})},zJ=i.styled(i.Box)`
|
|
3430
3430
|
height: 52px;
|
|
3431
3431
|
box-sizing: border-box;
|
|
3432
3432
|
width: 100%;
|
|
@@ -3738,7 +3738,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
3738
3738
|
padding-bottom: 13px;
|
|
3739
3739
|
border-top: 1px solid var(--connector-admin-border-strong);
|
|
3740
3740
|
gap: 16px;
|
|
3741
|
-
`,gZ=e=>S.createElement("svg",{width:22,height:22,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},S.createElement("g",{clipPath:"url(#clip0_1446_32274)"},S.createElement("path",{d:"M14.6663 0.916687H3.66634C2.65801 0.916687 1.83301 1.74169 1.83301 2.75002V15.5834H3.66634V2.75002H14.6663V0.916687ZM17.4163 4.58335H7.33301C6.32467 4.58335 5.49967 5.40835 5.49967 6.41669V19.25C5.49967 20.2584 6.32467 21.0834 7.33301 21.0834H17.4163C18.4247 21.0834 19.2497 20.2584 19.2497 19.25V6.41669C19.2497 5.40835 18.4247 4.58335 17.4163 4.58335ZM17.4163 19.25H7.33301V6.41669H17.4163V19.25Z",fill:"#6F7C90"})),S.createElement("defs",null,S.createElement("clipPath",{id:"clip0_1446_32274"},S.createElement("rect",{width:22,height:22,fill:"white"})))),dZ=()=>l.jsxs(i.Stack,{gap:"24px",marginTop:"28px",paddingRight:"65px",children:[l.jsxs("div",{children:[l.jsx(Jo,{variant:"rounded",width:100,height:24,animation:"wave",margin:"12px 0px 10px 0px"}),l.jsx(Jo,{variant:"rounded",height:40,animation:"wave",margin:"12px 0px 10px 0px"})]}),l.jsxs("div",{children:[l.jsx(Jo,{variant:"rounded",width:100,height:24,animation:"wave",margin:"12px 0px 10px 0px"}),l.jsx(Jo,{variant:"rounded",height:40,animation:"wave",margin:"12px 0px 10px 0px"})]})]}),CZ=({isEdit:e=!1,connectorId:t,isLoading:n=!1,connectorData:r,isAuthPending:o=!1,authStatus:a,authMutate:A})=>{const{sendTrackingEvent:s,availableFeatures:c}=Q.useContext(Et),[u,g]=Q.useReducer(KX,$X),[d,f]=Q.useState(!1),h=r?r.name:"",p=r?r.description:"",E=r?r.isAuthenticated:!1,C=r?r.showUpgradeButton:!1,B=(r==null?void 0:r.advancedSettingsFields)??[],I=v1(c),m=r==null?void 0:r.oneClickAuthEnabled,y=(r==null?void 0:r.hiddenFields)??[],b=Q.useMemo(()=>!I||!(r!=null&&r.interpolationFields)?{}:AZ(r==null?void 0:r.interpolationFields),[r==null?void 0:r.interpolationFields,I]),{variableConfigs:v,variableKeys:w}=Q.useMemo(()=>{const O=r&&r.variablesConfig?r.variablesConfig:[],L=Object.fromEntries(O.map(j=>[j.name,j.name]));return{variableConfigs:O,variableKeys:L}},[r]);Q.useEffect(()=>{var O;if(r!=null&&r.authDetails){const L=rZ(r.authDetails);g({type:ao.SET_FIELDS,payload:{values:L}})}if(r!=null&&r.variables&&Object.keys(r.variables).forEach(L=>{var j;g({type:ao.SET_FIELD_VALUE,payload:{name:L,value:((j=r.variables)==null?void 0:j[L])||""}})}),r!=null&&r.redirectUrl&&g({type:ao.SET_FIELD_VALUE,payload:{name:he.oAuthRedirectUrl,value:r==null?void 0:r.redirectUrl}}),I&&(r!=null&&r.interpolationFields)&&(r!=null&&r.variables)){const L=Xy((O=r==null?void 0:r.authDetails)==null?void 0:O.authType);Object.entries(r.interpolationFields).forEach(([j,G])=>{const U=L[j];if(!U)return;const te=Zy(G,r.variables);te!=null&&g({type:ao.SET_FIELD_VALUE,payload:{name:U,value:te}})})}},[r,I]);const x=(O,L)=>{var ee,ce;g({type:ao.SET_FIELD_VALUE,payload:{value:L,name:O}});const j=typeof L=="object"?L.value:L,G=b[O];if(!I||!(G!=null&&G.length))return;const U=(ee=u.values)==null?void 0:ee.authType,te=Xy(typeof U=="object"?U.value:void 0);for(const Ie of G){const ge=te[Ie]||w[Ie],Pe=(ce=r==null?void 0:r.interpolationFields)==null?void 0:ce[Ie];if(!ge||!Pe)continue;const q=Zy(Pe,{...u.values,[O]:j??""});q!=null&&x(ge,q)}},T=O=>{O.stopPropagation();const{name:L,value:j}=(O==null?void 0:O.target)||{};x(L,j.trim())},R=(O,L)=>{O&&typeof O=="object"&&"label"in O&&typeof O.label=="string"&&"value"in O&&typeof O.value=="string"&&typeof L.name<"u"&&(L.name===lr.authType&&s(Je.AUTH_UPDATED,{selected_auth_type:O.label}),x(L.name,{value:O.value,label:O.label}))},F=(O,L)=>{g({type:ao.SET_FIELD_ERROR,payload:{name:O,value:L}})},P=()=>{const O={...YX};if(v)if(I){const{advanced:G,basic:U}=Yy(v,B);Qi.formFields=G,O.formFields=U}else Qi.formFields=[...v];let L=[];Qi.formFields&&Qi.formFields.length&&(L=[Qi]);const j=u.values.authType;if(I){const G=typeof j=="object"?j.value:void 0,U=[...$A];G===Qr.apiToken.value?U.push(...Ny):G===Qr.oAuth2.value?U.push(...Vy):G===Qr.oAuth2Pat.value?U.push(...Hy):G===Qr.oAuth1.value?U.push(...jy):U.push(...Gy);const{basicFields:te,advancedConfigs:ee}=tZ(U,B,G);O.formFields.push(...te),L.push(...ee),O.formFields.length&&L.push(O)}else typeof j=="object"&&j.value===Qr.apiToken.value?L=[...L,...$A,...Ny]:typeof j=="object"&&j.value===Qr.oAuth2.value?L=[...L,...$A,...Vy]:typeof j=="object"&&j.value===Qr.oAuth2Pat.value?L=[...L,...$A,...Hy]:typeof j=="object"&&j.value===Qr.oAuth1.value?L=[...L,...$A,...jy]:L=[...L,...$A,...Gy];return L.map(G=>({...G,formFields:G.formFields.map(U=>({...U,hideInUI:!!(m&&y.includes(U.name))}))}))},M=()=>{const O={};return typeof u.values.apiAddTo=="object"&&u.values.apiAddTo.value===uu.queryParam.value?(O.apiHeaderPrefix=!1,O.apiHeaderName=!1):O.apiParamName=!1,O},D=()=>{const O=M(),L=x1(P());return!Object.keys(u.errors).filter(G=>!!u.errors[G]).filter(G=>G in O?O[G]:!0).filter(G=>G in L).length},z=()=>{var G;const O=M(),L=x1(P()),j=nZ({isEdit:e,templateId:t,values:u.values,formFields:L,predicates:O});if(v&&v.length){const U=oZ(v,u.values);j.variables=U}s(Je.SAVE_AUTHORIZE_CLICKED,{connector_name:h,auth_type:((G=u.values.authType)==null?void 0:G.label)??u.values.authType,base_url:u.values.baseUrl}),!e&&"templateId"in j?A({data:j}):A({data:j,connectorId:t})},Z=()=>{u.values.oAuthRedirectUrl&&yG(u.values.oAuthRedirectUrl,O=>f(!O))},K={[he.oAuthRedirectUrl]:{icon:l.jsx(gZ,{"aria-label":"copy",className:"**:[path]:fill-[var(--connector-admin-icon-secondary)]",onClick:Z}),toolTipText:cG}},Ae=P().filter(O=>!zy(O)),Y=P().filter(zy),k=Y.some(O=>O.formFields&&O.formFields.some(L=>!L.hideInUI));return l.jsxs(l.Fragment,{children:[e&&r&&(!E||C)?l.jsx(sZ,{direction:"column",gap:1,children:l.jsx(CE,{id:r.id,status:E?"upgrade":"notAuthenticated",connectorName:r.name,hideCta:!0})}):null,l.jsxs(lZ,{id:"connectors-auth-wrapper",className:"grow overflow-auto",children:[n?l.jsxs(l.Fragment,{children:[l.jsx(WX,{}),l.jsx(dZ,{})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx(i.Typography,{variant:"h3",children:h}),l.jsx(iZ,{variant:"body2",children:p})]}),l.jsxs(cZ,{id:"conectors-auth-form",children:[l.jsx(jl,{formConfig:I?Ae:P(),selectChangeHandler:R,inputChangeHandler:T,predicates:M(),values:u.values,validations:Wy,onValidationError:F,icons:K}),I&&k&&l.jsx(GX,{titleNode:l.jsx(i.Typography,{variant:"h3",children:"Advanced settings"}),children:l.jsx(jl,{formConfig:Y,selectChangeHandler:R,inputChangeHandler:T,predicates:M(),values:u.values,validations:Wy,onValidationError:F,icons:K})})]}),l.jsx(uZ,{direction:"row",children:l.jsx(i.Button,{disabled:!D()||o||a===et.PENDING,onClick:z,children:"Click to authenticate"})})]}),l.jsx(i.Snackbar,{message:_X,anchorOrigin:{vertical:"bottom",horizontal:"left"},autoHideDuration:2e3,onClose:()=>f(!1),open:d})]})]})},EZ=e=>S.createElement("svg",{width:42,height:44,viewBox:"0 0 42 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},S.createElement("rect",{width:42,height:44,rx:4,fill:"var(--connector-admin-feature-icon-surface, #F6F8FC)"}),S.createElement("g",{clipPath:"url(#clip0_484_5911)"},S.createElement("path",{d:"M21.0001 24.0139C20.4663 24.0139 19.9543 23.8019 19.5768 23.4244C19.1994 23.0469 18.9873 22.5349 18.9873 22.0011C18.9873 21.4673 19.1994 20.9553 19.5768 20.5778C19.9543 20.2003 20.4663 19.9883 21.0001 19.9883C21.534 19.9883 22.0459 20.2003 22.4234 20.5778C22.8009 20.9553 23.0129 21.4673 23.0129 22.0011C23.0129 22.5349 22.8009 23.0469 22.4234 23.4244C22.0459 23.8019 21.534 24.0139 21.0001 24.0139ZM21.0001 20.9947C20.7332 20.9947 20.4772 21.1007 20.2885 21.2895C20.0997 21.4782 19.9937 21.7342 19.9937 22.0011C19.9937 22.268 20.0997 22.524 20.2885 22.7127C20.4772 22.9015 20.7332 23.0075 21.0001 23.0075C21.267 23.0075 21.523 22.9015 21.7118 22.7127C21.9005 22.524 22.0065 22.268 22.0065 22.0011C22.0065 21.7342 21.9005 21.4782 21.7118 21.2895C21.523 21.1007 21.267 20.9947 21.0001 20.9947Z",fill:"var(--connector-admin-feature-icon-stroke, #344A64)"}),S.createElement("circle",{cx:14.9655,cy:28.1286,r:1.22238,fill:"#FFE250"}),S.createElement("circle",{cx:27.133,cy:28.1286,r:1.22238,fill:"#FFE250"}),S.createElement("circle",{cx:27.133,cy:15.8943,r:1.22238,fill:"#FFE250"}),S.createElement("circle",{cx:14.9655,cy:15.8943,r:1.22238,fill:"#FFE250"}),S.createElement("path",{d:"M23.4468 23.5947L26.0483 26.1953C26.3509 26.0279 26.6901 25.9368 27.0366 25.9316H27.0386C27.4553 25.9317 27.863 26.0556 28.2095 26.2871C28.5558 26.5186 28.8254 26.8476 28.9849 27.2324C29.1444 27.6175 29.1863 28.0414 29.105 28.4502C29.0236 28.8589 28.8235 29.2346 28.5288 29.5293C28.2341 29.824 27.8584 30.0241 27.4497 30.1055C27.0409 30.1868 26.617 30.1448 26.2319 29.9854C25.8471 29.8259 25.5181 29.5563 25.2866 29.21C25.0551 28.8635 24.9312 28.4558 24.9312 28.0391V28.0371C24.9363 27.6903 25.0272 27.3506 25.1948 27.0479L22.604 24.4375L22.5376 24.3701L23.3804 23.5273L23.4468 23.5947ZM14.9614 27.127C14.7196 27.127 14.4879 27.2235 14.3169 27.3945C14.1459 27.5655 14.0493 27.7973 14.0493 28.0391C14.0493 28.2809 14.1459 28.5126 14.3169 28.6836C14.4879 28.8546 14.7196 28.9511 14.9614 28.9512C15.2032 28.9512 15.4349 28.8545 15.606 28.6836C15.777 28.5126 15.8735 28.2809 15.8735 28.0391C15.8735 27.7972 15.777 27.5656 15.606 27.3945C15.4349 27.2235 15.2033 27.127 14.9614 27.127ZM27.0386 27.127C26.7967 27.127 26.5651 27.2235 26.394 27.3945C26.223 27.5656 26.1265 27.7972 26.1265 28.0391C26.1265 28.2809 26.223 28.5126 26.394 28.6836C26.5651 28.8545 26.7968 28.9512 27.0386 28.9512C27.2804 28.9511 27.5121 28.8546 27.6831 28.6836C27.8541 28.5126 27.9507 28.2809 27.9507 28.0391C27.9507 27.7973 27.8541 27.5655 27.6831 27.3945C27.5121 27.2235 27.2804 27.127 27.0386 27.127ZM26.2319 14.0156C26.617 13.8561 27.0409 13.8142 27.4497 13.8955C27.8584 13.9768 28.2341 14.177 28.5288 14.4717C28.8235 14.7663 29.0236 15.1421 29.105 15.5508C29.1863 15.9595 29.1444 16.3835 28.9849 16.7686C28.8254 17.1534 28.5558 17.4824 28.2095 17.7139C27.863 17.9454 27.4553 18.0693 27.0386 18.0693H27.0366C26.69 18.0642 26.351 17.9722 26.0483 17.8047L23.437 20.4121L23.3696 20.4795L23.3022 20.4111L22.5933 19.6865L22.5278 19.6201L22.5942 19.5537L25.1948 16.9512C25.0277 16.6488 24.9363 16.3101 24.9312 15.9639V15.9619C24.9312 15.5452 25.0551 15.1375 25.2866 14.791C25.5181 14.4447 25.8471 14.1751 26.2319 14.0156ZM14.5503 13.8955C14.9591 13.8142 15.383 13.8561 15.7681 14.0156C16.1529 14.1751 16.4819 14.4447 16.7134 14.791C16.9449 15.1375 17.0688 15.5452 17.0688 15.9619V15.9639C17.0637 16.3105 16.9717 16.6495 16.8042 16.9521L19.396 19.5635L19.4624 19.6309L18.6196 20.4736L18.5532 20.4062L15.9507 17.8047C15.6482 17.9719 15.3098 18.0642 14.9634 18.0693H14.9614C14.5447 18.0693 14.137 17.9454 13.7905 17.7139C13.4442 17.4824 13.1746 17.1534 13.0151 16.7686C12.8556 16.3835 12.8137 15.9595 12.895 15.5508C12.9764 15.1421 13.1765 14.7663 13.4712 14.4717C13.7659 14.177 14.1416 13.9768 14.5503 13.8955ZM14.9614 15.0498C14.7196 15.0498 14.4879 15.1464 14.3169 15.3174C14.1459 15.4884 14.0493 15.7201 14.0493 15.9619C14.0493 16.2037 14.1459 16.4354 14.3169 16.6064C14.4879 16.7774 14.7196 16.874 14.9614 16.874C15.2033 16.874 15.4349 16.7775 15.606 16.6064C15.777 16.4354 15.8735 16.2038 15.8735 15.9619C15.8735 15.7201 15.777 15.4884 15.606 15.3174C15.4349 15.1464 15.2032 15.0498 14.9614 15.0498ZM27.0386 15.0498C26.7968 15.0498 26.5651 15.1464 26.394 15.3174C26.223 15.4884 26.1265 15.7201 26.1265 15.9619C26.1265 16.2038 26.223 16.4354 26.394 16.6064C26.5651 16.7775 26.7967 16.874 27.0386 16.874C27.2804 16.874 27.5121 16.7774 27.6831 16.6064C27.8541 16.4354 27.9507 16.2037 27.9507 15.9619C27.9507 15.7201 27.8541 15.4884 27.6831 15.3174C27.5121 15.1464 27.2804 15.0498 27.0386 15.0498ZM17.0688 28.0391C17.0688 28.4558 16.9449 28.8635 16.7134 29.21C16.4819 29.5563 16.1529 29.8259 15.7681 29.9854C15.383 30.1448 14.9591 30.1868 14.5503 30.1055C14.1416 30.0241 13.7659 29.824 13.4712 29.5293C13.1765 29.2346 12.9764 28.8589 12.895 28.4502C12.8137 28.0414 12.8556 27.6175 13.0151 27.2324C13.1746 26.8476 13.4442 26.5186 13.7905 26.2871C14.137 26.0556 14.5447 25.9317 14.9614 25.9316H14.9634C15.3096 25.9368 15.6483 26.0282 15.9507 26.1953L18.563 23.5889L18.6304 23.5215L18.6978 23.5898L19.4067 24.3145L19.4722 24.3809L16.8042 27.0488C16.9717 27.3515 17.0637 27.6904 17.0688 28.0371V28.0391Z",fill:"var(--connector-admin-feature-icon-stroke, #344A64)",stroke:"var(--connector-admin-feature-icon-stroke, #344A64)",strokeWidth:.188888})),S.createElement("defs",null,S.createElement("clipPath",{id:"clip0_484_5911"},S.createElement("rect",{width:17.0498,height:17.0498,fill:"white",transform:"translate(12.4751 13.4766)"})))),fZ=e=>S.createElement("svg",{width:44,height:44,viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},S.createElement("rect",{width:44,height:44,rx:4,fill:"var(--connector-admin-feature-icon-surface, #F6F8FC)"}),S.createElement("g",{clipPath:"url(#clip0_484_5901)"},S.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.5048 16.8071L22.5908 23.8886L29.6767 16.8071L30.7134 18.0399V26.705L29.6767 28.3375H16.7537L14.6384 27.6048V16.8071H15.5048Z",fill:"#FFE250"}),S.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28.7908 15.0078H16.3904C14.9228 15.0078 13.7332 16.2164 13.7332 17.7072V26.7053C13.7332 28.1961 14.9228 29.4047 16.3904 29.4047H28.7908C30.2584 29.4047 31.4481 28.1961 31.4481 26.7053V17.7072C31.4481 16.2164 30.2584 15.0078 28.7908 15.0078ZM28.4275 16.8071L23.2193 22.0979C23.053 22.2683 22.8266 22.3641 22.5905 22.3641C22.3543 22.3641 22.1279 22.2683 21.9616 22.0979L16.7534 16.8071H28.4275ZM28.7907 27.6041C29.2799 27.6041 29.6765 27.2012 29.6765 26.7043V18.0392L24.4683 23.33C23.4309 24.3826 21.7502 24.3826 20.7127 23.33L15.5046 18.0392V26.7043C15.5046 27.2012 15.9011 27.6041 16.3903 27.6041H28.7907Z",fill:"var(--connector-admin-feature-icon-stroke, #3E4C5A)"}),S.createElement("circle",{cx:29.8638,cy:28.8776,r:4.5602,fill:"var(--connector-admin-feature-icon-surface, #F6F8FC)"})),S.createElement("path",{d:"M28.424 26C28.5478 25.9312 28.6811 25.9286 28.8116 25.9873C28.9422 26.0462 29.033 26.1469 29.0753 26.2832H29.0743C29.1145 26.405 29.1126 26.5284 29.0685 26.6494C29.0233 26.773 28.941 26.8692 28.8263 26.9346L28.8253 26.9355C28.4684 27.1325 28.184 27.4041 27.9718 27.752C27.7605 28.0983 27.6547 28.4802 27.6544 28.8984C27.6545 29.1739 27.7073 29.4421 27.8116 29.7031C27.8976 29.9181 28.0262 30.1186 28.1945 30.3086V30.042C28.1945 29.9024 28.2432 29.78 28.3409 29.6826C28.4385 29.5854 28.561 29.5365 28.7003 29.5361C28.84 29.5359 28.9629 29.5848 29.0607 29.6826C29.1582 29.7803 29.2067 29.9027 29.2062 30.042V31.5938C29.2062 31.7335 29.1574 31.8564 29.0597 31.9541C28.9866 32.0271 28.8996 32.0727 28.8019 32.0908L28.7003 32.0996H27.1486C27.0089 32.0996 26.8866 32.0509 26.7892 31.9531C26.6919 31.8556 26.643 31.7331 26.6427 31.5938C26.6424 31.4542 26.6914 31.3319 26.7892 31.2344C26.8869 31.137 27.0093 31.0879 27.1486 31.0879H27.5187C27.2093 30.7954 26.9862 30.4639 26.8536 30.0918C26.7136 29.6982 26.6427 29.2994 26.6427 28.8975C26.6428 28.2687 26.8036 27.6958 27.1261 27.1816C27.4077 26.7328 27.7748 26.3748 28.2257 26.1084L28.424 26ZM32.5792 25.6572C32.7189 25.6572 32.8419 25.706 32.9396 25.8037C33.037 25.9013 33.0853 26.0237 33.0851 26.1631C33.0848 26.3024 33.0367 26.4257 32.9396 26.5234C32.8421 26.6216 32.719 26.6685 32.5792 26.668V26.6689H32.2013C32.4962 26.9782 32.7173 27.3134 32.8595 27.6768C33.0103 28.0619 33.0854 28.4565 33.0851 28.8594C33.085 29.4882 32.9242 30.061 32.6017 30.5752C32.2809 31.0866 31.849 31.4796 31.3087 31.7539L31.3068 31.7559C31.3058 31.7563 31.3048 31.7573 31.3038 31.7578L31.3029 31.7568C31.1791 31.8252 31.0464 31.8284 30.9161 31.7695C30.7863 31.7108 30.6964 31.6108 30.6534 31.4756C30.6127 31.353 30.6155 31.2281 30.6603 31.1064C30.7057 30.9835 30.7875 30.8876 30.9015 30.8223L30.9025 30.8213C31.2595 30.6243 31.5435 30.3525 31.756 30.0049C31.9674 29.6589 32.0736 29.2781 32.0734 28.8594C32.0734 28.5838 32.0215 28.3156 31.9171 28.0547C31.8309 27.8392 31.7024 27.6372 31.5333 27.4463V27.7148C31.5333 27.8545 31.4854 27.9775 31.3878 28.0752C31.2901 28.1729 31.1671 28.221 31.0275 28.2207C30.8882 28.2204 30.7657 28.1715 30.6681 28.0742C30.5705 27.9768 30.5216 27.8544 30.5216 27.7148V26.1631C30.5217 26.0235 30.5704 25.9011 30.6681 25.8037C30.7657 25.7065 30.8882 25.6576 31.0275 25.6572H32.5792Z",fill:"var(--connector-admin-feature-icon-stroke, #3E4C5A)",stroke:"var(--connector-admin-feature-icon-stroke, #3E4C5A)",strokeWidth:.236199}),S.createElement("defs",null,S.createElement("clipPath",{id:"clip0_484_5901"},S.createElement("rect",{width:23.6199,height:23.6199,fill:"white",transform:"translate(10.1901 11.4648)"})))),pZ=e=>S.createElement("svg",{width:44,height:44,viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},S.createElement("rect",{width:44,height:44,rx:4,fill:"var(--connector-admin-feature-icon-surface, #F6F8FC)"}),S.createElement("circle",{cx:20.5679,cy:20.5946,r:4.60441,fill:"#FFE250"}),S.createElement("path",{d:"M26.6912 25.1994H25.8843L25.5984 24.9236C26.5993 23.7593 27.2018 22.2477 27.2018 20.6034C27.2018 16.9369 24.2298 13.9648 20.5633 13.9648C17.0703 13.9648 14.2107 16.6611 13.9553 20.0928H16.0184C16.2737 17.7948 18.1938 16.0075 20.5633 16.0075C23.1063 16.0075 25.1592 18.0603 25.1592 20.6034C25.1592 23.1465 23.1063 25.1994 20.5633 25.1994C20.3896 25.1994 20.2262 25.1687 20.0526 25.1483V27.2114C20.2262 27.2318 20.3896 27.242 20.5633 27.242C22.2076 27.242 23.7191 26.6394 24.8834 25.6385L25.1592 25.9245V26.7313L30.2658 31.8277L31.7876 30.306L26.6912 25.1994Z",fill:"var(--connector-admin-feature-icon-stroke, #343C45)"}),S.createElement("path",{d:"M16.634 26.8226C16.5552 26.823 16.4782 26.7993 16.4132 26.7548C16.3483 26.7102 16.2984 26.6469 16.2704 26.5733L15.6496 24.9591C15.6371 24.9266 15.6178 24.897 15.5932 24.8724C15.5685 24.8477 15.539 24.8285 15.5064 24.8159L13.8918 24.1947C13.8182 24.1665 13.755 24.1166 13.7104 24.0517C13.6657 23.9868 13.6418 23.9098 13.6418 23.831C13.6418 23.7523 13.6657 23.6753 13.7104 23.6104C13.755 23.5455 13.8182 23.4956 13.8918 23.4674L15.506 22.8467C15.5385 22.8341 15.568 22.8148 15.5927 22.7902C15.6174 22.7655 15.6366 22.736 15.6492 22.7035L16.2704 21.0888C16.2986 21.0153 16.3485 20.952 16.4134 20.9074C16.4783 20.8628 16.5553 20.8389 16.634 20.8389C16.7128 20.8389 16.7897 20.8628 16.8547 20.9074C16.9196 20.952 16.9695 21.0153 16.9977 21.0888L17.6184 22.703C17.631 22.7355 17.6502 22.7651 17.6749 22.7897C17.6996 22.8144 17.7291 22.8336 17.7616 22.8462L19.3665 23.4637C19.443 23.492 19.509 23.5433 19.5553 23.6105C19.6016 23.6777 19.6262 23.7575 19.6256 23.8392C19.6244 23.9165 19.6 23.9918 19.5555 24.0552C19.5111 24.1186 19.4486 24.1672 19.3763 24.1947L17.7621 24.8155C17.7296 24.828 17.7 24.8472 17.6754 24.8719C17.6507 24.8966 17.6315 24.9261 17.6189 24.9587L16.9977 26.5733C16.9697 26.6469 16.9198 26.7102 16.8548 26.7548C16.7898 26.7993 16.7128 26.823 16.634 26.8226Z",fill:"var(--connector-admin-feature-icon-stroke, #343C45)"})),IZ=e=>S.createElement("svg",{width:44,height:44,viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},S.createElement("rect",{width:44,height:44,rx:4,fill:"var(--connector-admin-feature-icon-surface, #F6F8FC)"}),S.createElement("g",{clipPath:"url(#clip0_484_5848)"},S.createElement("circle",{cx:26.037,cy:25.8514,r:3.95008,fill:"#FFE250"}),S.createElement("path",{d:"M26.0364 25.7071C26.5717 25.7071 27.0056 25.2731 27.0056 24.7378C27.0056 24.2025 26.5717 23.7686 26.0364 23.7686C25.5011 23.7686 25.0671 24.2025 25.0671 24.7378C25.0671 25.2731 25.5011 25.7071 26.0364 25.7071Z",fill:"var(--connector-admin-feature-icon-stroke, #343C45)"}),S.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M26.0364 26.4688C25.4047 26.4688 24.1412 26.7803 24.0979 27.4034C24.5306 28.0178 25.2402 28.4159 26.0364 28.4159C26.8326 28.4159 27.5422 28.0178 27.9749 27.4034C27.9316 26.7803 26.6681 26.4688 26.0364 26.4688Z",fill:"var(--connector-admin-feature-icon-stroke, #343C45)"}),S.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M26.902 20.9215V16.7503L20.4115 13.9204L13.921 16.7503V20.9994C13.921 24.9283 16.6903 28.6063 20.4115 29.4976C20.8875 29.3851 21.3462 29.2207 21.7962 29.0216C22.7308 30.3544 24.2799 31.2284 26.0366 31.2284C28.9011 31.2284 31.229 28.9005 31.229 26.036C31.229 23.4658 29.3598 21.3369 26.902 20.9215ZM20.8442 26.036C20.8442 26.5206 20.9135 26.9966 21.0433 27.438C20.8356 27.5332 20.6279 27.6283 20.4115 27.6976C17.6682 26.8322 15.6518 24.0283 15.6518 20.9994V17.8839L20.4115 15.807L25.1712 17.8839V20.9215C22.7135 21.3369 20.8442 23.4658 20.8442 26.036ZM26.0366 29.4976C24.1241 29.4976 22.575 27.9485 22.575 26.036C22.575 24.1235 24.1241 22.5744 26.0366 22.5744C27.9492 22.5744 29.4982 24.1235 29.4982 26.036C29.4982 27.9485 27.9492 29.4976 26.0366 29.4976Z",fill:"var(--connector-admin-feature-icon-stroke, #343C45)"})),S.createElement("defs",null,S.createElement("clipPath",{id:"clip0_484_5848"},S.createElement("rect",{width:19.2388,height:19.2388,fill:"white",transform:"translate(12.9556 12.9556)"})))),hZ="integration_sense",qy="email_log_settings",BZ="quick_access",yi="user_auth_enabled",mZ="This feature can only be used for one App and is currently enabled for :enabledConnector.",QZ=[{id:hZ,heading:"Smart Previews",subHeading:"Quickly view details from {{app_name}} by hovering on entities in emails.",icon:EZ,featureKey:UH},{id:qy,heading:"Sync conversation",subHeading:"Save emails from Hiver to {{app_name}} to create a single source of truth for customer information.",icon:fZ,featureKey:KH,modalSettings:{title:"Tell us why you no longer want to use this feature",radioOptions:[{label:"We already use another tool for this",value:"already_using_another_extension"},{label:"We don't need to log emails",value:"do_not_have-email_logging_requirement"},{label:"The feature isn't working as expected",value:"not_working_as_expected"},{label:"Other",value:"other"}],textArea:{placeholder:"Tell us more (optional)"}}},{id:BZ,heading:"Quick Access",subHeading:"Access your {{app_name}} entities quickly with a single click.",icon:pZ,featureKey:$H},{id:yi,heading:"User level authentication",subHeading:"Allow users to connect their own accounts and access data according to their permissions",icon:IZ,featureKey:eG}],yZ="Advanced settings",bZ="Enhance your integrations with contextual insights and email logging.",gu={title:"Confirm Changes?",description:"After enabling user-level authentication, users must connect their own accounts to access integration data.",confirmLabel:"Confirm",cancelLabel:"Cancel"},xZ=i.styled(({className:e,classes:t,...n})=>l.jsx(i.Tooltip,{...n,classes:{...t,popper:e,tooltip:["connector-admin-rich-tooltip",t==null?void 0:t.tooltip].filter(Boolean).join(" ")}}))(({width:e,height:t,color:n})=>({[`& .${i.tooltipClasses.arrow}`]:{color:n||"var(--connector-admin-surface-elevated) !important"},[`& .${i.tooltipClasses.tooltip}`]:{backgroundColor:n||"var(--connector-admin-surface-elevated)",maxWidth:e,height:t,width:e,borderRadius:"6px",boxShadow:"0px 2px 10px 0px #00000026, inset 0 0 0 1px var(--connector-admin-surface-outline)"}})),Uy=e=>l.jsx(i.Button,{...e,disabled:e.isLoading||e.disabled,children:e.isLoading?l.jsx(i.CircularProgress,{sx:{color:"var(--connector-admin-icon-secondary)"},size:20}):e.label}),vZ=({onCancel:e,onSubmit:t,isLoading:n,showOptions:r=!0,title:o,feedbackOptions:a,placeholder:A})=>{const[s,c]=Q.useState(""),[u,g]=Q.useState(""),d=C=>{c(C.target.value)},f=C=>{C.stopPropagation();const{value:B}=(C==null?void 0:C.target)||{};g(B)},h=()=>{t({feedbackOption:s,feedbackComment:u})},p=()=>{e==null||e()},E=r?!s:!u;return l.jsxs("div",{className:"max-h-[420px] w-[510px] rounded-xl p-4 box-border [&>*]:box-border [&_.MuiFormGroup-root]:mb-3",children:[l.jsx(i.Typography,{variant:"h3",children:o}),l.jsx("div",{className:"border-b border-gray-6 mx-[-16px] my-3"}),r?l.jsx(i.FormControl,{children:l.jsx(i.RadioGroup,{"aria-labelledby":"demo-controlled-radio-buttons-group",name:"controlled-radio-buttons-group",value:s,onChange:d,children:a.map(C=>l.jsx(i.FormControlLabel,{value:C.value,control:l.jsx(i.Radio,{}),label:C.label},C.value))})}):null,l.jsx(RC,{type:"text",placeholder:A,value:u,name:"feedbackComment",inputChangeHandler:f,multiline:!0,rows:5,limit:250,validation:{validate:WR()}}),l.jsxs("div",{className:"flex justify-end mt-8 gap-2",children:[l.jsx(i.Button,{variant:"text",color:"primary",style:{color:"var(--connector-admin-text-tertiary)"},disabled:n,onClick:p,children:"Cancel"}),l.jsx(Uy,{variant:"contained",color:"primary",isLoading:n,disabled:E,label:"Submit",onClick:h})]})]})},du='"Open Sans", sans-serif',wZ=({title:e,description:t,confirmLabel:n="Confirm",cancelLabel:r="Cancel",isLoading:o=!1,danger:a=!1,onConfirm:A,onCancel:s})=>l.jsxs("div",{className:"flex flex-col items-end gap-[20px] p-5",style:{width:380,borderRadius:10},children:[l.jsxs("div",{className:"flex flex-col w-full",children:[l.jsx(i.Typography,{sx:{fontFamily:du,fontWeight:i.theme.typography.fontWeightMedium,fontSize:`${i.theme.typography.h2.fontSize}px`,lineHeight:"21px",letterSpacing:"-0.16px",color:"var(--connector-admin-text-primary)",margin:"0px 0px 12px",pr:"34px"},children:e}),l.jsx(i.Typography,{sx:{fontFamily:du,fontWeight:i.theme.typography.fontWeightRegular,fontSize:`${i.theme.typography.body2.fontSize}px`,lineHeight:"20px",letterSpacing:"-0.07px",color:"var(--connector-admin-text-secondary)"},children:t})]}),l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx(i.Button,{variant:"text",disabled:o,onClick:s,sx:{textTransform:"none",fontFamily:du,fontWeight:i.theme.typography.fontWeightMedium,fontSize:`${i.theme.typography.body2.fontSize}px`,lineHeight:"24px",letterSpacing:"0.2px",padding:"3px 19px",borderRadius:"4px",minWidth:"auto",color:"var(--connector-admin-text-secondary)","&:hover":{color:"var(--connector-admin-text-secondary)",backgroundColor:"var(--connector-admin-control-hover)"}},children:r}),l.jsx(Uy,{variant:"contained",isLoading:o,label:n,onClick:A,disableElevation:!0,sx:{textTransform:"none",fontFamily:du,fontWeight:i.theme.typography.fontWeightMedium,fontSize:`${i.theme.typography.body2.fontSize}px`,lineHeight:"24px",letterSpacing:"0.2px",padding:"3px 19px",borderRadius:"4px",minWidth:"auto",boxShadow:"none",...a?{backgroundColor:"var(--connector-admin-negative)","&:hover":{backgroundColor:"var(--connector-admin-negative-hover)",boxShadow:"none"}}:{}}})]})]}),SZ=Tt+"/connectors/:connectorId/advanced-feature",TZ=Tt+"/connectors/:connectorId/user-auth-enabled",_Z=`${Tt}/connector/admin-feedback`,DZ=async(e,t)=>{try{const n=cr(SZ,{connectorId:t})+"?channel_type=email",r=await ke({url:n,method:Pt.PATCH,data:e});return Ot({type:Mr,message:"Successfully updated feature"}),r}catch(n){return Ot({type:xn,message:"Failed to update feature"}),Promise.reject(n)}};function OZ(){return ko({mutationKey:["toggle-advanced-feature"],mutationFn:async({connectorId:e,data:t})=>{if(!e)throw new Error("Connector ID is required");const n=await DZ(t,e);return n==null?void 0:n.data}})}const LZ=async({connectorId:e,userAuthEnabled:t})=>{try{const n=cr(TZ,{connectorId:e}),r=await ke({url:n,method:Pt.PATCH,data:{userAuthEnabled:t}});return Ot({type:Mr,message:t?"Enabled user-level authentication":"Disabled user-level authentication"}),r}catch(n){return Ot({type:xn,message:"Failed to update user-level authentication"}),Promise.reject(n)}};function FZ(){return ko({mutationKey:["toggle-user-auth-enabled"],mutationFn:async({connectorId:e,userAuthEnabled:t})=>{if(!e)throw new Error("Connector ID is required");const n=await LZ({connectorId:e,userAuthEnabled:t});return n==null?void 0:n.data}})}const PZ=async({feedbackData:e})=>{try{const t=await ke({url:_Z+"?channel_type=email",method:"POST",data:e});return t==null?void 0:t.data}catch(t){throw console.error("Error submitting feedback:",t),t}};function kZ(){return ko({mutationFn:PZ})}const MZ=({id:e,heading:t,subHeading:n,isEnabled:r,icon:o,connectorId:a,connectorType:A,modalSettings:s,disabled:c=!1,tooltipContent:u="",soloSpansFullWidth:g=!0})=>{var F;const d=o,[f,h]=Q.useState(!1),[p,E]=Q.useState(r),[C,B]=Q.useState(!1),[I,m]=Q.useState(!1),y=Te(VA)===pe.LOADING,{mutate:b}=OZ(),{mutate:v}=FZ(),{mutate:w}=kZ();Q.useEffect(()=>{E(r)},[r]);const x=()=>{h(!0),v({connectorId:a,userAuthEnabled:!0},{onSettled:()=>{h(!1),m(!1)},onSuccess:P=>{(P==null?void 0:P.userAuthEnabled)!==void 0&&E(P.userAuthEnabled)}})},T=P=>{const M=P.target.checked;if(e===yi&&M){m(!0);return}if(h(!0),e===yi){v({connectorId:a,userAuthEnabled:M},{onSettled:()=>{h(!1)},onSuccess:D=>{(D==null?void 0:D.userAuthEnabled)!==void 0&&E(D.userAuthEnabled),(D==null?void 0:D.userAuthEnabled)===!1&&s&&B(!0)}});return}b({connectorId:a,data:{[e]:M}},{onSettled:()=>{h(!1)},onSuccess:D=>{D.enabled!==void 0&&E(D.enabled),!M&&s&&B(!0)}})},R=P=>{const M={feedback_type:"email-logging-disabled",comment:P.feedbackComment,option:P.feedbackOption,connector_id:a,connector_type:A};w({feedbackData:M}),B(!1)};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:`w-full flex justify-between items-start rounded-sm p-4 gap-2.5 bg-[var(--connector-admin-feature-card-surface)] ${g?"[&:first-child:last-child]:col-span-2":""}`,children:[l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx(d,{"aria-label":`${t} icon`,className:"h-11 w-11 shrink-0"}),l.jsxs("div",{className:"flex flex-col items-start gap-1",children:[l.jsx("h3",{className:"font-semibold! text-body1",children:t}),l.jsx("p",{className:"text-body2",children:n})]})]}),l.jsx(xZ,{title:u,placement:"top",color:"var(--connector-admin-feature-tooltip-surface)",arrow:!0,width:"287px",children:l.jsx("div",{className:"w-12",children:l.jsx(Fy,{id:`switch_${e}`,checked:p,onClick:P=>P==null?void 0:P.stopPropagation(),onChange:T,isLoading:f||y,disabled:f||y||c})})})]}),l.jsx(Pa,{shown:C,setShown:B,borderRadius:12,sx:{zIndex:15002},children:l.jsx(vZ,{onCancel:()=>B(!1),onSubmit:R,isLoading:f,title:(s==null?void 0:s.title)||"",feedbackOptions:(s==null?void 0:s.radioOptions)||[],placeholder:((F=s==null?void 0:s.textArea)==null?void 0:F.placeholder)||""})}),l.jsx(Pa,{shown:I,setShown:m,showCloseButton:!0,closeButtonSize:20,borderRadius:10,sx:{zIndex:15002},children:l.jsx(wZ,{title:gu.title,description:gu.description,confirmLabel:gu.confirmLabel,cancelLabel:gu.cancelLabel,isLoading:f,danger:!0,onConfirm:x,onCancel:()=>m(!1)})})]})},RZ=(e,t)=>typeof e[t]=="boolean",NZ=(e,t)=>{var n;return typeof e[t]=="object"&&typeof((n=e[t])==null?void 0:n.enabled)=="boolean"},jZ=e=>{const t={};for(const n in e)NZ(e,n)?t[n]=e[n]:RZ(e,n)&&(t[n]={enabled:e[n],connector:n===qy?e.connector:void 0});return t},$y=({advancedFeatures:e,connectorId:t,connectorName:n,connectorType:r,featureIds:o,excludeFeatureIds:a,soloSpansFullWidth:A=!0})=>{const{availableFeatures:s}=Q.useContext(Et),c=jZ(e),u=QZ.filter(f=>o&&!o.includes(f.id)||a!=null&&a.includes(f.id)?!1:ir(s,f.featureKey)&&typeof c[f.id]=="object");if(u.length===0)return null;const g=f=>c[f].enabled,d=f=>{var p;const h=c[f];return!g(f)&&((p=h==null?void 0:h.connector)!=null&&p.id)?{isDisabled:!0,tooltipContent:cr(mZ,{enabledConnector:h.connector.name,currentConnector:n})}:{isDisabled:!1,tooltipContent:""}};return l.jsxs("div",{children:[l.jsx("h2",{className:"text-h2 text-gray-2! mt-8 mb-2",children:yZ}),l.jsx("p",{className:"text-body2 text-gray-3!",children:bZ}),l.jsx("div",{className:"grid grid-cols-2 mt-6 gap-4",children:u.map(f=>{const{isDisabled:h,tooltipContent:p}=d(f.id);return l.jsx(MZ,{id:f.id,heading:f.heading.replace(/\{\{app_name\}\}/g,n),subHeading:f.subHeading.replace(/\{\{app_name\}\}/g,n),isEnabled:g(f.id),icon:f.icon,connectorId:t,connectorType:r,modalSettings:f.modalSettings,disabled:h,tooltipContent:p,soloSpansFullWidth:A},f.id)})})]})},VZ=e=>S.createElement("svg",{width:19,height:14,viewBox:"0 0 19 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},S.createElement("path",{d:"M4.5 11C5.15764 11 5.79771 11.0833 6.42021 11.25C7.04285 11.4167 7.65278 11.625 8.25 11.875V2.41667C7.66667 2.11111 7.0625 1.88194 6.4375 1.72917C5.8125 1.57639 5.16514 1.5 4.49542 1.5C3.98236 1.5 3.47292 1.54514 2.96708 1.63542C2.46125 1.72569 1.97222 1.875 1.5 2.08333V11.5C1.98611 11.3194 2.47785 11.191 2.97521 11.1146C3.47271 11.0382 3.98097 11 4.5 11ZM9.75 11.875C10.3472 11.5972 10.9572 11.3819 11.5798 11.2292C12.2023 11.0764 12.8424 11 13.5 11C14.0139 11 14.5243 11.0312 15.0312 11.0938C15.5382 11.1562 16.0278 11.2917 16.5 11.5V2.08333C16.0139 1.90278 15.5195 1.76042 15.0169 1.65625C14.5142 1.55208 14.0081 1.5 13.4983 1.5C12.8328 1.5 12.1875 1.57639 11.5625 1.72917C10.9375 1.88194 10.3333 2.11111 9.75 2.41667V11.875ZM9 14C8.31944 13.5556 7.60417 13.1944 6.85417 12.9167C6.10417 12.6389 5.31944 12.5 4.5 12.5C3.97222 12.5 3.44444 12.5521 2.91667 12.6562C2.38889 12.7604 1.88194 12.9167 1.39583 13.125C1.0625 13.2639 0.746528 13.2394 0.447917 13.0515C0.149306 12.8635 0 12.5894 0 12.2292V1.75C0 1.55556 0.0520833 1.375 0.15625 1.20833C0.260417 1.04167 0.402778 0.916667 0.583333 0.833333C1.20833 0.555556 1.8475 0.347222 2.50083 0.208333C3.15417 0.0694444 3.82056 0 4.5 0C5.29097 0 6.06486 0.09375 6.82167 0.28125C7.57847 0.46875 8.30458 0.75 9 1.125C9.70833 0.763889 10.4388 0.486111 11.1915 0.291667C11.944 0.0972222 12.7135 0 13.5 0C14.1794 0 14.8458 0.0694444 15.4992 0.208333C16.1525 0.347222 16.7917 0.555556 17.4167 0.833333C17.5972 0.916667 17.7431 1.04167 17.8542 1.20833C17.9653 1.375 18.0208 1.55556 18.0208 1.75V12.2292C18.0208 12.5764 17.9132 12.8542 17.6979 13.0625C17.4826 13.2708 17.2569 13.3194 17.0208 13.2083C16.4653 12.9583 15.8925 12.7778 15.3025 12.6667C14.7126 12.5556 14.1118 12.5 13.5 12.5C12.6806 12.5 11.8958 12.6389 11.1458 12.9167C10.3958 13.1944 9.68056 13.5556 9 14Z",fill:"#4D596C"})),HZ=e=>S.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,viewBox:"0 0 20 20",fill:"none",...e},S.createElement("g",{clipPath:"url(#clip0_5762_155564)"},S.createElement("path",{d:"M8.33342 13.75L13.3334 9.99996L8.33342 6.24996V13.75ZM10.0001 1.66663C5.40008 1.66663 1.66675 5.39996 1.66675 9.99996C1.66675 14.6 5.40008 18.3333 10.0001 18.3333C14.6001 18.3333 18.3334 14.6 18.3334 9.99996C18.3334 5.39996 14.6001 1.66663 10.0001 1.66663ZM10.0001 16.6666C6.32508 16.6666 3.33341 13.675 3.33341 9.99996C3.33341 6.32496 6.32508 3.33329 10.0001 3.33329C13.6751 3.33329 16.6667 6.32496 16.6667 9.99996C16.6667 13.675 13.6751 16.6666 10.0001 16.6666Z",fill:"#4D596C"})),S.createElement("defs",null,S.createElement("clipPath",{id:"clip0_5762_155564"},S.createElement("rect",{width:20,height:20,fill:"white"})))),GZ=e=>S.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},S.createElement("path",{d:"M17.5 9.31947C17.503 10.456 17.2374 11.5772 16.725 12.5917C16.1174 13.8074 15.1834 14.8299 14.0275 15.5447C12.8717 16.2595 11.5396 16.6384 10.1806 16.6389C9.044 16.6419 7.92282 16.3763 6.90833 15.8639L2 17.5L3.63611 12.5917C3.12369 11.5772 2.85815 10.456 2.86111 9.31947C2.86164 7.96043 3.24053 6.62837 3.95534 5.4725C4.67016 4.31663 5.69266 3.3826 6.90833 2.77502C7.92282 2.2626 9.044 1.99706 10.1806 2.00002H10.6111C11.4833 2.04814 12.332 2.25177 13.1199 2.59427C13.9534 2.95658 14.7189 3.4743 15.3723 4.12771C16.1287 4.8841 16.7033 5.7907 17.0654 6.77911C17.3118 7.45168 17.4599 8.16213 17.5 8.88891V9.31947Z",stroke:"#4D596C",strokeWidth:1.44667,strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("circle",{cx:7,cy:9.5,r:1,fill:"#4D596C"}),S.createElement("circle",{cx:10,cy:9.5,r:1,fill:"#4D596C"}),S.createElement("circle",{cx:13,cy:9.5,r:1,fill:"#4D596C"})),WZ=i.styled(i.Box)`
|
|
3741
|
+
`,gZ=e=>S.createElement("svg",{width:22,height:22,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},S.createElement("g",{clipPath:"url(#clip0_1446_32274)"},S.createElement("path",{d:"M14.6663 0.916687H3.66634C2.65801 0.916687 1.83301 1.74169 1.83301 2.75002V15.5834H3.66634V2.75002H14.6663V0.916687ZM17.4163 4.58335H7.33301C6.32467 4.58335 5.49967 5.40835 5.49967 6.41669V19.25C5.49967 20.2584 6.32467 21.0834 7.33301 21.0834H17.4163C18.4247 21.0834 19.2497 20.2584 19.2497 19.25V6.41669C19.2497 5.40835 18.4247 4.58335 17.4163 4.58335ZM17.4163 19.25H7.33301V6.41669H17.4163V19.25Z",fill:"#6F7C90"})),S.createElement("defs",null,S.createElement("clipPath",{id:"clip0_1446_32274"},S.createElement("rect",{width:22,height:22,fill:"white"})))),dZ=()=>l.jsxs(i.Stack,{gap:"24px",marginTop:"28px",paddingRight:"65px",children:[l.jsxs("div",{children:[l.jsx(Jo,{variant:"rounded",width:100,height:24,animation:"wave",margin:"12px 0px 10px 0px"}),l.jsx(Jo,{variant:"rounded",height:40,animation:"wave",margin:"12px 0px 10px 0px"})]}),l.jsxs("div",{children:[l.jsx(Jo,{variant:"rounded",width:100,height:24,animation:"wave",margin:"12px 0px 10px 0px"}),l.jsx(Jo,{variant:"rounded",height:40,animation:"wave",margin:"12px 0px 10px 0px"})]})]}),CZ=({isEdit:e=!1,connectorId:t,isLoading:n=!1,connectorData:r,isAuthPending:o=!1,authStatus:a,authMutate:A})=>{const{sendTrackingEvent:s,availableFeatures:c}=Q.useContext(Et),[u,g]=Q.useReducer(KX,$X),[d,f]=Q.useState(!1),h=r?r.name:"",p=r?r.description:"",E=r?r.isAuthenticated:!1,C=r?r.showUpgradeButton:!1,B=(r==null?void 0:r.advancedSettingsFields)??[],I=v1(c),m=r==null?void 0:r.oneClickAuthEnabled,y=(r==null?void 0:r.hiddenFields)??[],b=Q.useMemo(()=>!I||!(r!=null&&r.interpolationFields)?{}:AZ(r==null?void 0:r.interpolationFields),[r==null?void 0:r.interpolationFields,I]),{variableConfigs:v,variableKeys:w}=Q.useMemo(()=>{const O=r&&r.variablesConfig?r.variablesConfig:[],L=Object.fromEntries(O.map(j=>[j.name,j.name]));return{variableConfigs:O,variableKeys:L}},[r]);Q.useEffect(()=>{var O;if(r!=null&&r.authDetails){const L=rZ(r.authDetails);g({type:ao.SET_FIELDS,payload:{values:L}})}if(r!=null&&r.variables&&Object.keys(r.variables).forEach(L=>{var j;g({type:ao.SET_FIELD_VALUE,payload:{name:L,value:((j=r.variables)==null?void 0:j[L])||""}})}),r!=null&&r.redirectUrl&&g({type:ao.SET_FIELD_VALUE,payload:{name:he.oAuthRedirectUrl,value:r==null?void 0:r.redirectUrl}}),I&&(r!=null&&r.interpolationFields)&&(r!=null&&r.variables)){const L=Xy((O=r==null?void 0:r.authDetails)==null?void 0:O.authType);Object.entries(r.interpolationFields).forEach(([j,G])=>{const U=L[j];if(!U)return;const te=Zy(G,r.variables);te!=null&&g({type:ao.SET_FIELD_VALUE,payload:{name:U,value:te}})})}},[r,I]);const x=(O,L)=>{var ee,ce;g({type:ao.SET_FIELD_VALUE,payload:{value:L,name:O}});const j=typeof L=="object"?L.value:L,G=b[O];if(!I||!(G!=null&&G.length))return;const U=(ee=u.values)==null?void 0:ee.authType,te=Xy(typeof U=="object"?U.value:void 0);for(const Ie of G){const ge=te[Ie]||w[Ie],Pe=(ce=r==null?void 0:r.interpolationFields)==null?void 0:ce[Ie];if(!ge||!Pe)continue;const q=Zy(Pe,{...u.values,[O]:j??""});q!=null&&x(ge,q)}},T=O=>{O.stopPropagation();const{name:L,value:j}=(O==null?void 0:O.target)||{};x(L,j.trim())},R=(O,L)=>{O&&typeof O=="object"&&"label"in O&&typeof O.label=="string"&&"value"in O&&typeof O.value=="string"&&typeof L.name<"u"&&(L.name===lr.authType&&s(Je.AUTH_UPDATED,{selected_auth_type:O.label}),x(L.name,{value:O.value,label:O.label}))},F=(O,L)=>{g({type:ao.SET_FIELD_ERROR,payload:{name:O,value:L}})},P=()=>{const O={...YX};if(v)if(I){const{advanced:G,basic:U}=Yy(v,B);Qi.formFields=G,O.formFields=U}else Qi.formFields=[...v];let L=[];Qi.formFields&&Qi.formFields.length&&(L=[Qi]);const j=u.values.authType;if(I){const G=typeof j=="object"?j.value:void 0,U=[...$A];G===Qr.apiToken.value?U.push(...Ny):G===Qr.oAuth2.value?U.push(...Vy):G===Qr.oAuth2Pat.value?U.push(...Hy):G===Qr.oAuth1.value?U.push(...jy):U.push(...Gy);const{basicFields:te,advancedConfigs:ee}=tZ(U,B,G);O.formFields.push(...te),L.push(...ee),O.formFields.length&&L.push(O)}else typeof j=="object"&&j.value===Qr.apiToken.value?L=[...L,...$A,...Ny]:typeof j=="object"&&j.value===Qr.oAuth2.value?L=[...L,...$A,...Vy]:typeof j=="object"&&j.value===Qr.oAuth2Pat.value?L=[...L,...$A,...Hy]:typeof j=="object"&&j.value===Qr.oAuth1.value?L=[...L,...$A,...jy]:L=[...L,...$A,...Gy];return L.map(G=>({...G,formFields:G.formFields.map(U=>({...U,hideInUI:!!(m&&y.includes(U.name))}))}))},M=()=>{const O={};return typeof u.values.apiAddTo=="object"&&u.values.apiAddTo.value===uu.queryParam.value?(O.apiHeaderPrefix=!1,O.apiHeaderName=!1):O.apiParamName=!1,O},D=()=>{const O=M(),L=x1(P());return!Object.keys(u.errors).filter(G=>!!u.errors[G]).filter(G=>G in O?O[G]:!0).filter(G=>G in L).length},z=()=>{var G;const O=M(),L=x1(P()),j=nZ({isEdit:e,templateId:t,values:u.values,formFields:L,predicates:O});if(v&&v.length){const U=oZ(v,u.values);j.variables=U}s(Je.SAVE_AUTHORIZE_CLICKED,{connector_name:h,auth_type:((G=u.values.authType)==null?void 0:G.label)??u.values.authType,base_url:u.values.baseUrl}),!e&&"templateId"in j?A({data:j}):A({data:j,connectorId:t})},Z=()=>{u.values.oAuthRedirectUrl&&yG(u.values.oAuthRedirectUrl,O=>f(!O))},K={[he.oAuthRedirectUrl]:{icon:l.jsx(gZ,{"aria-label":"copy",className:"**:[path]:fill-[var(--connector-admin-icon-secondary)]",onClick:Z}),toolTipText:cG}},Ae=P().filter(O=>!zy(O)),Y=P().filter(zy),k=Y.some(O=>O.formFields&&O.formFields.some(L=>!L.hideInUI));return l.jsxs(l.Fragment,{children:[e&&r&&(!E||C)?l.jsx(sZ,{direction:"column",gap:1,children:l.jsx(CE,{id:r.id,status:E?"upgrade":"notAuthenticated",connectorName:r.name,hideCta:!0})}):null,l.jsxs(lZ,{id:"connectors-auth-wrapper",className:"grow overflow-auto",children:[n?l.jsxs(l.Fragment,{children:[l.jsx(WX,{}),l.jsx(dZ,{})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx(i.Typography,{variant:"h3",children:h}),l.jsx(iZ,{variant:"body2",children:p})]}),l.jsxs(cZ,{id:"conectors-auth-form",children:[l.jsx(jl,{formConfig:I?Ae:P(),selectChangeHandler:R,inputChangeHandler:T,predicates:M(),values:u.values,validations:Wy,onValidationError:F,icons:K}),I&&k&&l.jsx(GX,{titleNode:l.jsx(i.Typography,{variant:"h3",children:"Advanced settings"}),children:l.jsx(jl,{formConfig:Y,selectChangeHandler:R,inputChangeHandler:T,predicates:M(),values:u.values,validations:Wy,onValidationError:F,icons:K})})]}),l.jsx(uZ,{direction:"row",children:l.jsx(i.Button,{disabled:!D()||o||a===et.PENDING,onClick:z,children:"Click to authenticate"})})]}),l.jsx(i.Snackbar,{message:_X,anchorOrigin:{vertical:"bottom",horizontal:"left"},autoHideDuration:2e3,onClose:()=>f(!1),open:d})]})]})},EZ=e=>S.createElement("svg",{width:42,height:44,viewBox:"0 0 42 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},S.createElement("rect",{width:42,height:44,rx:4,fill:"var(--connector-admin-feature-icon-surface, #F6F8FC)"}),S.createElement("g",{clipPath:"url(#clip0_484_5911)"},S.createElement("path",{d:"M21.0001 24.0139C20.4663 24.0139 19.9543 23.8019 19.5768 23.4244C19.1994 23.0469 18.9873 22.5349 18.9873 22.0011C18.9873 21.4673 19.1994 20.9553 19.5768 20.5778C19.9543 20.2003 20.4663 19.9883 21.0001 19.9883C21.534 19.9883 22.0459 20.2003 22.4234 20.5778C22.8009 20.9553 23.0129 21.4673 23.0129 22.0011C23.0129 22.5349 22.8009 23.0469 22.4234 23.4244C22.0459 23.8019 21.534 24.0139 21.0001 24.0139ZM21.0001 20.9947C20.7332 20.9947 20.4772 21.1007 20.2885 21.2895C20.0997 21.4782 19.9937 21.7342 19.9937 22.0011C19.9937 22.268 20.0997 22.524 20.2885 22.7127C20.4772 22.9015 20.7332 23.0075 21.0001 23.0075C21.267 23.0075 21.523 22.9015 21.7118 22.7127C21.9005 22.524 22.0065 22.268 22.0065 22.0011C22.0065 21.7342 21.9005 21.4782 21.7118 21.2895C21.523 21.1007 21.267 20.9947 21.0001 20.9947Z",fill:"var(--connector-admin-feature-icon-stroke, #344A64)"}),S.createElement("circle",{cx:14.9655,cy:28.1286,r:1.22238,fill:"#FFE250"}),S.createElement("circle",{cx:27.133,cy:28.1286,r:1.22238,fill:"#FFE250"}),S.createElement("circle",{cx:27.133,cy:15.8943,r:1.22238,fill:"#FFE250"}),S.createElement("circle",{cx:14.9655,cy:15.8943,r:1.22238,fill:"#FFE250"}),S.createElement("path",{d:"M23.4468 23.5947L26.0483 26.1953C26.3509 26.0279 26.6901 25.9368 27.0366 25.9316H27.0386C27.4553 25.9317 27.863 26.0556 28.2095 26.2871C28.5558 26.5186 28.8254 26.8476 28.9849 27.2324C29.1444 27.6175 29.1863 28.0414 29.105 28.4502C29.0236 28.8589 28.8235 29.2346 28.5288 29.5293C28.2341 29.824 27.8584 30.0241 27.4497 30.1055C27.0409 30.1868 26.617 30.1448 26.2319 29.9854C25.8471 29.8259 25.5181 29.5563 25.2866 29.21C25.0551 28.8635 24.9312 28.4558 24.9312 28.0391V28.0371C24.9363 27.6903 25.0272 27.3506 25.1948 27.0479L22.604 24.4375L22.5376 24.3701L23.3804 23.5273L23.4468 23.5947ZM14.9614 27.127C14.7196 27.127 14.4879 27.2235 14.3169 27.3945C14.1459 27.5655 14.0493 27.7973 14.0493 28.0391C14.0493 28.2809 14.1459 28.5126 14.3169 28.6836C14.4879 28.8546 14.7196 28.9511 14.9614 28.9512C15.2032 28.9512 15.4349 28.8545 15.606 28.6836C15.777 28.5126 15.8735 28.2809 15.8735 28.0391C15.8735 27.7972 15.777 27.5656 15.606 27.3945C15.4349 27.2235 15.2033 27.127 14.9614 27.127ZM27.0386 27.127C26.7967 27.127 26.5651 27.2235 26.394 27.3945C26.223 27.5656 26.1265 27.7972 26.1265 28.0391C26.1265 28.2809 26.223 28.5126 26.394 28.6836C26.5651 28.8545 26.7968 28.9512 27.0386 28.9512C27.2804 28.9511 27.5121 28.8546 27.6831 28.6836C27.8541 28.5126 27.9507 28.2809 27.9507 28.0391C27.9507 27.7973 27.8541 27.5655 27.6831 27.3945C27.5121 27.2235 27.2804 27.127 27.0386 27.127ZM26.2319 14.0156C26.617 13.8561 27.0409 13.8142 27.4497 13.8955C27.8584 13.9768 28.2341 14.177 28.5288 14.4717C28.8235 14.7663 29.0236 15.1421 29.105 15.5508C29.1863 15.9595 29.1444 16.3835 28.9849 16.7686C28.8254 17.1534 28.5558 17.4824 28.2095 17.7139C27.863 17.9454 27.4553 18.0693 27.0386 18.0693H27.0366C26.69 18.0642 26.351 17.9722 26.0483 17.8047L23.437 20.4121L23.3696 20.4795L23.3022 20.4111L22.5933 19.6865L22.5278 19.6201L22.5942 19.5537L25.1948 16.9512C25.0277 16.6488 24.9363 16.3101 24.9312 15.9639V15.9619C24.9312 15.5452 25.0551 15.1375 25.2866 14.791C25.5181 14.4447 25.8471 14.1751 26.2319 14.0156ZM14.5503 13.8955C14.9591 13.8142 15.383 13.8561 15.7681 14.0156C16.1529 14.1751 16.4819 14.4447 16.7134 14.791C16.9449 15.1375 17.0688 15.5452 17.0688 15.9619V15.9639C17.0637 16.3105 16.9717 16.6495 16.8042 16.9521L19.396 19.5635L19.4624 19.6309L18.6196 20.4736L18.5532 20.4062L15.9507 17.8047C15.6482 17.9719 15.3098 18.0642 14.9634 18.0693H14.9614C14.5447 18.0693 14.137 17.9454 13.7905 17.7139C13.4442 17.4824 13.1746 17.1534 13.0151 16.7686C12.8556 16.3835 12.8137 15.9595 12.895 15.5508C12.9764 15.1421 13.1765 14.7663 13.4712 14.4717C13.7659 14.177 14.1416 13.9768 14.5503 13.8955ZM14.9614 15.0498C14.7196 15.0498 14.4879 15.1464 14.3169 15.3174C14.1459 15.4884 14.0493 15.7201 14.0493 15.9619C14.0493 16.2037 14.1459 16.4354 14.3169 16.6064C14.4879 16.7774 14.7196 16.874 14.9614 16.874C15.2033 16.874 15.4349 16.7775 15.606 16.6064C15.777 16.4354 15.8735 16.2038 15.8735 15.9619C15.8735 15.7201 15.777 15.4884 15.606 15.3174C15.4349 15.1464 15.2032 15.0498 14.9614 15.0498ZM27.0386 15.0498C26.7968 15.0498 26.5651 15.1464 26.394 15.3174C26.223 15.4884 26.1265 15.7201 26.1265 15.9619C26.1265 16.2038 26.223 16.4354 26.394 16.6064C26.5651 16.7775 26.7967 16.874 27.0386 16.874C27.2804 16.874 27.5121 16.7774 27.6831 16.6064C27.8541 16.4354 27.9507 16.2037 27.9507 15.9619C27.9507 15.7201 27.8541 15.4884 27.6831 15.3174C27.5121 15.1464 27.2804 15.0498 27.0386 15.0498ZM17.0688 28.0391C17.0688 28.4558 16.9449 28.8635 16.7134 29.21C16.4819 29.5563 16.1529 29.8259 15.7681 29.9854C15.383 30.1448 14.9591 30.1868 14.5503 30.1055C14.1416 30.0241 13.7659 29.824 13.4712 29.5293C13.1765 29.2346 12.9764 28.8589 12.895 28.4502C12.8137 28.0414 12.8556 27.6175 13.0151 27.2324C13.1746 26.8476 13.4442 26.5186 13.7905 26.2871C14.137 26.0556 14.5447 25.9317 14.9614 25.9316H14.9634C15.3096 25.9368 15.6483 26.0282 15.9507 26.1953L18.563 23.5889L18.6304 23.5215L18.6978 23.5898L19.4067 24.3145L19.4722 24.3809L16.8042 27.0488C16.9717 27.3515 17.0637 27.6904 17.0688 28.0371V28.0391Z",fill:"var(--connector-admin-feature-icon-stroke, #344A64)",stroke:"var(--connector-admin-feature-icon-stroke, #344A64)",strokeWidth:.188888})),S.createElement("defs",null,S.createElement("clipPath",{id:"clip0_484_5911"},S.createElement("rect",{width:17.0498,height:17.0498,fill:"white",transform:"translate(12.4751 13.4766)"})))),fZ=e=>S.createElement("svg",{width:44,height:44,viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},S.createElement("rect",{width:44,height:44,rx:4,fill:"var(--connector-admin-feature-icon-surface, #F6F8FC)"}),S.createElement("g",{clipPath:"url(#clip0_484_5901)"},S.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.5048 16.8071L22.5908 23.8886L29.6767 16.8071L30.7134 18.0399V26.705L29.6767 28.3375H16.7537L14.6384 27.6048V16.8071H15.5048Z",fill:"#FFE250"}),S.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28.7908 15.0078H16.3904C14.9228 15.0078 13.7332 16.2164 13.7332 17.7072V26.7053C13.7332 28.1961 14.9228 29.4047 16.3904 29.4047H28.7908C30.2584 29.4047 31.4481 28.1961 31.4481 26.7053V17.7072C31.4481 16.2164 30.2584 15.0078 28.7908 15.0078ZM28.4275 16.8071L23.2193 22.0979C23.053 22.2683 22.8266 22.3641 22.5905 22.3641C22.3543 22.3641 22.1279 22.2683 21.9616 22.0979L16.7534 16.8071H28.4275ZM28.7907 27.6041C29.2799 27.6041 29.6765 27.2012 29.6765 26.7043V18.0392L24.4683 23.33C23.4309 24.3826 21.7502 24.3826 20.7127 23.33L15.5046 18.0392V26.7043C15.5046 27.2012 15.9011 27.6041 16.3903 27.6041H28.7907Z",fill:"var(--connector-admin-feature-icon-stroke, #3E4C5A)"}),S.createElement("circle",{cx:29.8638,cy:28.8776,r:4.5602,fill:"var(--connector-admin-feature-icon-surface, #F6F8FC)"})),S.createElement("path",{d:"M28.424 26C28.5478 25.9312 28.6811 25.9286 28.8116 25.9873C28.9422 26.0462 29.033 26.1469 29.0753 26.2832H29.0743C29.1145 26.405 29.1126 26.5284 29.0685 26.6494C29.0233 26.773 28.941 26.8692 28.8263 26.9346L28.8253 26.9355C28.4684 27.1325 28.184 27.4041 27.9718 27.752C27.7605 28.0983 27.6547 28.4802 27.6544 28.8984C27.6545 29.1739 27.7073 29.4421 27.8116 29.7031C27.8976 29.9181 28.0262 30.1186 28.1945 30.3086V30.042C28.1945 29.9024 28.2432 29.78 28.3409 29.6826C28.4385 29.5854 28.561 29.5365 28.7003 29.5361C28.84 29.5359 28.9629 29.5848 29.0607 29.6826C29.1582 29.7803 29.2067 29.9027 29.2062 30.042V31.5938C29.2062 31.7335 29.1574 31.8564 29.0597 31.9541C28.9866 32.0271 28.8996 32.0727 28.8019 32.0908L28.7003 32.0996H27.1486C27.0089 32.0996 26.8866 32.0509 26.7892 31.9531C26.6919 31.8556 26.643 31.7331 26.6427 31.5938C26.6424 31.4542 26.6914 31.3319 26.7892 31.2344C26.8869 31.137 27.0093 31.0879 27.1486 31.0879H27.5187C27.2093 30.7954 26.9862 30.4639 26.8536 30.0918C26.7136 29.6982 26.6427 29.2994 26.6427 28.8975C26.6428 28.2687 26.8036 27.6958 27.1261 27.1816C27.4077 26.7328 27.7748 26.3748 28.2257 26.1084L28.424 26ZM32.5792 25.6572C32.7189 25.6572 32.8419 25.706 32.9396 25.8037C33.037 25.9013 33.0853 26.0237 33.0851 26.1631C33.0848 26.3024 33.0367 26.4257 32.9396 26.5234C32.8421 26.6216 32.719 26.6685 32.5792 26.668V26.6689H32.2013C32.4962 26.9782 32.7173 27.3134 32.8595 27.6768C33.0103 28.0619 33.0854 28.4565 33.0851 28.8594C33.085 29.4882 32.9242 30.061 32.6017 30.5752C32.2809 31.0866 31.849 31.4796 31.3087 31.7539L31.3068 31.7559C31.3058 31.7563 31.3048 31.7573 31.3038 31.7578L31.3029 31.7568C31.1791 31.8252 31.0464 31.8284 30.9161 31.7695C30.7863 31.7108 30.6964 31.6108 30.6534 31.4756C30.6127 31.353 30.6155 31.2281 30.6603 31.1064C30.7057 30.9835 30.7875 30.8876 30.9015 30.8223L30.9025 30.8213C31.2595 30.6243 31.5435 30.3525 31.756 30.0049C31.9674 29.6589 32.0736 29.2781 32.0734 28.8594C32.0734 28.5838 32.0215 28.3156 31.9171 28.0547C31.8309 27.8392 31.7024 27.6372 31.5333 27.4463V27.7148C31.5333 27.8545 31.4854 27.9775 31.3878 28.0752C31.2901 28.1729 31.1671 28.221 31.0275 28.2207C30.8882 28.2204 30.7657 28.1715 30.6681 28.0742C30.5705 27.9768 30.5216 27.8544 30.5216 27.7148V26.1631C30.5217 26.0235 30.5704 25.9011 30.6681 25.8037C30.7657 25.7065 30.8882 25.6576 31.0275 25.6572H32.5792Z",fill:"var(--connector-admin-feature-icon-stroke, #3E4C5A)",stroke:"var(--connector-admin-feature-icon-stroke, #3E4C5A)",strokeWidth:.236199}),S.createElement("defs",null,S.createElement("clipPath",{id:"clip0_484_5901"},S.createElement("rect",{width:23.6199,height:23.6199,fill:"white",transform:"translate(10.1901 11.4648)"})))),pZ=e=>S.createElement("svg",{width:44,height:44,viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},S.createElement("rect",{width:44,height:44,rx:4,fill:"var(--connector-admin-feature-icon-surface, #F6F8FC)"}),S.createElement("circle",{cx:20.5679,cy:20.5946,r:4.60441,fill:"#FFE250"}),S.createElement("path",{d:"M26.6912 25.1994H25.8843L25.5984 24.9236C26.5993 23.7593 27.2018 22.2477 27.2018 20.6034C27.2018 16.9369 24.2298 13.9648 20.5633 13.9648C17.0703 13.9648 14.2107 16.6611 13.9553 20.0928H16.0184C16.2737 17.7948 18.1938 16.0075 20.5633 16.0075C23.1063 16.0075 25.1592 18.0603 25.1592 20.6034C25.1592 23.1465 23.1063 25.1994 20.5633 25.1994C20.3896 25.1994 20.2262 25.1687 20.0526 25.1483V27.2114C20.2262 27.2318 20.3896 27.242 20.5633 27.242C22.2076 27.242 23.7191 26.6394 24.8834 25.6385L25.1592 25.9245V26.7313L30.2658 31.8277L31.7876 30.306L26.6912 25.1994Z",fill:"var(--connector-admin-feature-icon-stroke, #343C45)"}),S.createElement("path",{d:"M16.634 26.8226C16.5552 26.823 16.4782 26.7993 16.4132 26.7548C16.3483 26.7102 16.2984 26.6469 16.2704 26.5733L15.6496 24.9591C15.6371 24.9266 15.6178 24.897 15.5932 24.8724C15.5685 24.8477 15.539 24.8285 15.5064 24.8159L13.8918 24.1947C13.8182 24.1665 13.755 24.1166 13.7104 24.0517C13.6657 23.9868 13.6418 23.9098 13.6418 23.831C13.6418 23.7523 13.6657 23.6753 13.7104 23.6104C13.755 23.5455 13.8182 23.4956 13.8918 23.4674L15.506 22.8467C15.5385 22.8341 15.568 22.8148 15.5927 22.7902C15.6174 22.7655 15.6366 22.736 15.6492 22.7035L16.2704 21.0888C16.2986 21.0153 16.3485 20.952 16.4134 20.9074C16.4783 20.8628 16.5553 20.8389 16.634 20.8389C16.7128 20.8389 16.7897 20.8628 16.8547 20.9074C16.9196 20.952 16.9695 21.0153 16.9977 21.0888L17.6184 22.703C17.631 22.7355 17.6502 22.7651 17.6749 22.7897C17.6996 22.8144 17.7291 22.8336 17.7616 22.8462L19.3665 23.4637C19.443 23.492 19.509 23.5433 19.5553 23.6105C19.6016 23.6777 19.6262 23.7575 19.6256 23.8392C19.6244 23.9165 19.6 23.9918 19.5555 24.0552C19.5111 24.1186 19.4486 24.1672 19.3763 24.1947L17.7621 24.8155C17.7296 24.828 17.7 24.8472 17.6754 24.8719C17.6507 24.8966 17.6315 24.9261 17.6189 24.9587L16.9977 26.5733C16.9697 26.6469 16.9198 26.7102 16.8548 26.7548C16.7898 26.7993 16.7128 26.823 16.634 26.8226Z",fill:"var(--connector-admin-feature-icon-stroke, #343C45)"})),IZ=e=>S.createElement("svg",{width:44,height:44,viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},S.createElement("rect",{width:44,height:44,rx:4,fill:"var(--connector-admin-feature-icon-surface, #F6F8FC)"}),S.createElement("g",{clipPath:"url(#clip0_484_5848)"},S.createElement("circle",{cx:26.037,cy:25.8514,r:3.95008,fill:"#FFE250"}),S.createElement("path",{d:"M26.0364 25.7071C26.5717 25.7071 27.0056 25.2731 27.0056 24.7378C27.0056 24.2025 26.5717 23.7686 26.0364 23.7686C25.5011 23.7686 25.0671 24.2025 25.0671 24.7378C25.0671 25.2731 25.5011 25.7071 26.0364 25.7071Z",fill:"var(--connector-admin-feature-icon-stroke, #343C45)"}),S.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M26.0364 26.4688C25.4047 26.4688 24.1412 26.7803 24.0979 27.4034C24.5306 28.0178 25.2402 28.4159 26.0364 28.4159C26.8326 28.4159 27.5422 28.0178 27.9749 27.4034C27.9316 26.7803 26.6681 26.4688 26.0364 26.4688Z",fill:"var(--connector-admin-feature-icon-stroke, #343C45)"}),S.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M26.902 20.9215V16.7503L20.4115 13.9204L13.921 16.7503V20.9994C13.921 24.9283 16.6903 28.6063 20.4115 29.4976C20.8875 29.3851 21.3462 29.2207 21.7962 29.0216C22.7308 30.3544 24.2799 31.2284 26.0366 31.2284C28.9011 31.2284 31.229 28.9005 31.229 26.036C31.229 23.4658 29.3598 21.3369 26.902 20.9215ZM20.8442 26.036C20.8442 26.5206 20.9135 26.9966 21.0433 27.438C20.8356 27.5332 20.6279 27.6283 20.4115 27.6976C17.6682 26.8322 15.6518 24.0283 15.6518 20.9994V17.8839L20.4115 15.807L25.1712 17.8839V20.9215C22.7135 21.3369 20.8442 23.4658 20.8442 26.036ZM26.0366 29.4976C24.1241 29.4976 22.575 27.9485 22.575 26.036C22.575 24.1235 24.1241 22.5744 26.0366 22.5744C27.9492 22.5744 29.4982 24.1235 29.4982 26.036C29.4982 27.9485 27.9492 29.4976 26.0366 29.4976Z",fill:"var(--connector-admin-feature-icon-stroke, #343C45)"})),S.createElement("defs",null,S.createElement("clipPath",{id:"clip0_484_5848"},S.createElement("rect",{width:19.2388,height:19.2388,fill:"white",transform:"translate(12.9556 12.9556)"})))),hZ="integration_sense",qy="email_log_settings",BZ="quick_access",yi="user_auth_enabled",mZ="This feature can only be used for one App and is currently enabled for :enabledConnector.",QZ=[{id:hZ,heading:"Smart Previews",subHeading:"Quickly view details from {{app_name}} by hovering on entities in emails.",icon:EZ,featureKey:UH},{id:qy,heading:"Sync conversation",subHeading:"Save emails from Hiver to {{app_name}} to create a single source of truth for customer information.",icon:fZ,featureKey:KH,modalSettings:{title:"Tell us why you no longer want to use this feature",radioOptions:[{label:"We already use another tool for this",value:"already_using_another_extension"},{label:"We don't need to log emails",value:"do_not_have-email_logging_requirement"},{label:"The feature isn't working as expected",value:"not_working_as_expected"},{label:"Other",value:"other"}],textArea:{placeholder:"Tell us more (optional)"}}},{id:BZ,heading:"Quick Access",subHeading:"Access your {{app_name}} entities quickly with a single click.",icon:pZ,featureKey:$H},{id:yi,heading:"User level authentication",subHeading:"Allow users to connect their own accounts and access data according to their permissions",icon:IZ,featureKey:eG}],yZ="Advanced settings",bZ="Enhance your integrations with contextual insights and email logging.",gu={title:"Confirm Changes?",description:"After enabling user-level authentication, users must connect their own accounts to access integration data.",confirmLabel:"Confirm",cancelLabel:"Cancel"},xZ=i.styled(({className:e,classes:t,...n})=>l.jsx(i.Tooltip,{...n,classes:{...t,popper:e,tooltip:["connector-admin-rich-tooltip","connectorAdmin-portal",t==null?void 0:t.tooltip].filter(Boolean).join(" ")}}))(({width:e,height:t,color:n})=>({[`& .${i.tooltipClasses.arrow}`]:{color:n||"var(--connector-admin-surface-elevated) !important"},[`& .${i.tooltipClasses.tooltip}`]:{backgroundColor:n||"var(--connector-admin-surface-elevated)",maxWidth:e,height:t,width:e,borderRadius:"6px",boxShadow:"0px 2px 10px 0px #00000026, inset 0 0 0 1px var(--connector-admin-surface-outline)"}})),Uy=e=>l.jsx(i.Button,{...e,disabled:e.isLoading||e.disabled,children:e.isLoading?l.jsx(i.CircularProgress,{sx:{color:"var(--connector-admin-icon-secondary)"},size:20}):e.label}),vZ=({onCancel:e,onSubmit:t,isLoading:n,showOptions:r=!0,title:o,feedbackOptions:a,placeholder:A})=>{const[s,c]=Q.useState(""),[u,g]=Q.useState(""),d=C=>{c(C.target.value)},f=C=>{C.stopPropagation();const{value:B}=(C==null?void 0:C.target)||{};g(B)},h=()=>{t({feedbackOption:s,feedbackComment:u})},p=()=>{e==null||e()},E=r?!s:!u;return l.jsxs("div",{className:"max-h-[420px] w-[510px] rounded-xl p-4 box-border [&>*]:box-border [&_.MuiFormGroup-root]:mb-3",children:[l.jsx(i.Typography,{variant:"h3",children:o}),l.jsx("div",{className:"border-b border-gray-6 mx-[-16px] my-3"}),r?l.jsx(i.FormControl,{children:l.jsx(i.RadioGroup,{"aria-labelledby":"demo-controlled-radio-buttons-group",name:"controlled-radio-buttons-group",value:s,onChange:d,children:a.map(C=>l.jsx(i.FormControlLabel,{value:C.value,control:l.jsx(i.Radio,{}),label:C.label},C.value))})}):null,l.jsx(RC,{type:"text",placeholder:A,value:u,name:"feedbackComment",inputChangeHandler:f,multiline:!0,rows:5,limit:250,validation:{validate:WR()}}),l.jsxs("div",{className:"flex justify-end mt-8 gap-2",children:[l.jsx(i.Button,{variant:"text",color:"primary",style:{color:"var(--connector-admin-text-tertiary)"},disabled:n,onClick:p,children:"Cancel"}),l.jsx(Uy,{variant:"contained",color:"primary",isLoading:n,disabled:E,label:"Submit",onClick:h})]})]})},du='"Open Sans", sans-serif',wZ=({title:e,description:t,confirmLabel:n="Confirm",cancelLabel:r="Cancel",isLoading:o=!1,danger:a=!1,onConfirm:A,onCancel:s})=>l.jsxs("div",{className:"flex flex-col items-end gap-[20px] p-5",style:{width:380,borderRadius:10},children:[l.jsxs("div",{className:"flex flex-col w-full",children:[l.jsx(i.Typography,{sx:{fontFamily:du,fontWeight:i.theme.typography.fontWeightMedium,fontSize:`${i.theme.typography.h2.fontSize}px`,lineHeight:"21px",letterSpacing:"-0.16px",color:"var(--connector-admin-text-primary)",margin:"0px 0px 12px",pr:"34px"},children:e}),l.jsx(i.Typography,{sx:{fontFamily:du,fontWeight:i.theme.typography.fontWeightRegular,fontSize:`${i.theme.typography.body2.fontSize}px`,lineHeight:"20px",letterSpacing:"-0.07px",color:"var(--connector-admin-text-secondary)"},children:t})]}),l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx(i.Button,{variant:"text",disabled:o,onClick:s,sx:{textTransform:"none",fontFamily:du,fontWeight:i.theme.typography.fontWeightMedium,fontSize:`${i.theme.typography.body2.fontSize}px`,lineHeight:"24px",letterSpacing:"0.2px",padding:"3px 19px",borderRadius:"4px",minWidth:"auto",color:"var(--connector-admin-text-secondary)","&:hover":{color:"var(--connector-admin-text-secondary)",backgroundColor:"var(--connector-admin-control-hover)"}},children:r}),l.jsx(Uy,{variant:"contained",isLoading:o,label:n,onClick:A,disableElevation:!0,sx:{textTransform:"none",fontFamily:du,fontWeight:i.theme.typography.fontWeightMedium,fontSize:`${i.theme.typography.body2.fontSize}px`,lineHeight:"24px",letterSpacing:"0.2px",padding:"3px 19px",borderRadius:"4px",minWidth:"auto",boxShadow:"none",...a?{backgroundColor:"var(--connector-admin-negative)","&:hover":{backgroundColor:"var(--connector-admin-negative-hover)",boxShadow:"none"}}:{}}})]})]}),SZ=Tt+"/connectors/:connectorId/advanced-feature",TZ=Tt+"/connectors/:connectorId/user-auth-enabled",_Z=`${Tt}/connector/admin-feedback`,DZ=async(e,t)=>{try{const n=cr(SZ,{connectorId:t})+"?channel_type=email",r=await ke({url:n,method:Pt.PATCH,data:e});return Ot({type:Mr,message:"Successfully updated feature"}),r}catch(n){return Ot({type:xn,message:"Failed to update feature"}),Promise.reject(n)}};function OZ(){return ko({mutationKey:["toggle-advanced-feature"],mutationFn:async({connectorId:e,data:t})=>{if(!e)throw new Error("Connector ID is required");const n=await DZ(t,e);return n==null?void 0:n.data}})}const LZ=async({connectorId:e,userAuthEnabled:t})=>{try{const n=cr(TZ,{connectorId:e}),r=await ke({url:n,method:Pt.PATCH,data:{userAuthEnabled:t}});return Ot({type:Mr,message:t?"Enabled user-level authentication":"Disabled user-level authentication"}),r}catch(n){return Ot({type:xn,message:"Failed to update user-level authentication"}),Promise.reject(n)}};function FZ(){return ko({mutationKey:["toggle-user-auth-enabled"],mutationFn:async({connectorId:e,userAuthEnabled:t})=>{if(!e)throw new Error("Connector ID is required");const n=await LZ({connectorId:e,userAuthEnabled:t});return n==null?void 0:n.data}})}const PZ=async({feedbackData:e})=>{try{const t=await ke({url:_Z+"?channel_type=email",method:"POST",data:e});return t==null?void 0:t.data}catch(t){throw console.error("Error submitting feedback:",t),t}};function kZ(){return ko({mutationFn:PZ})}const MZ=({id:e,heading:t,subHeading:n,isEnabled:r,icon:o,connectorId:a,connectorType:A,modalSettings:s,disabled:c=!1,tooltipContent:u="",soloSpansFullWidth:g=!0})=>{var F;const d=o,[f,h]=Q.useState(!1),[p,E]=Q.useState(r),[C,B]=Q.useState(!1),[I,m]=Q.useState(!1),y=Te(VA)===pe.LOADING,{mutate:b}=OZ(),{mutate:v}=FZ(),{mutate:w}=kZ();Q.useEffect(()=>{E(r)},[r]);const x=()=>{h(!0),v({connectorId:a,userAuthEnabled:!0},{onSettled:()=>{h(!1),m(!1)},onSuccess:P=>{(P==null?void 0:P.userAuthEnabled)!==void 0&&E(P.userAuthEnabled)}})},T=P=>{const M=P.target.checked;if(e===yi&&M){m(!0);return}if(h(!0),e===yi){v({connectorId:a,userAuthEnabled:M},{onSettled:()=>{h(!1)},onSuccess:D=>{(D==null?void 0:D.userAuthEnabled)!==void 0&&E(D.userAuthEnabled),(D==null?void 0:D.userAuthEnabled)===!1&&s&&B(!0)}});return}b({connectorId:a,data:{[e]:M}},{onSettled:()=>{h(!1)},onSuccess:D=>{D.enabled!==void 0&&E(D.enabled),!M&&s&&B(!0)}})},R=P=>{const M={feedback_type:"email-logging-disabled",comment:P.feedbackComment,option:P.feedbackOption,connector_id:a,connector_type:A};w({feedbackData:M}),B(!1)};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:`w-full flex justify-between items-start rounded-sm p-4 gap-2.5 bg-[var(--connector-admin-feature-card-surface)] ${g?"[&:first-child:last-child]:col-span-2":""}`,children:[l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx(d,{"aria-label":`${t} icon`,className:"h-11 w-11 shrink-0"}),l.jsxs("div",{className:"flex flex-col items-start gap-1",children:[l.jsx("h3",{className:"font-semibold! text-body1",children:t}),l.jsx("p",{className:"text-body2",children:n})]})]}),l.jsx(xZ,{title:u,placement:"top",color:"var(--connector-admin-feature-tooltip-surface)",arrow:!0,width:"287px",children:l.jsx("div",{className:"w-12",children:l.jsx(Fy,{id:`switch_${e}`,checked:p,onClick:P=>P==null?void 0:P.stopPropagation(),onChange:T,isLoading:f||y,disabled:f||y||c})})})]}),l.jsx(Pa,{shown:C,setShown:B,borderRadius:12,sx:{zIndex:15002},children:l.jsx(vZ,{onCancel:()=>B(!1),onSubmit:R,isLoading:f,title:(s==null?void 0:s.title)||"",feedbackOptions:(s==null?void 0:s.radioOptions)||[],placeholder:((F=s==null?void 0:s.textArea)==null?void 0:F.placeholder)||""})}),l.jsx(Pa,{shown:I,setShown:m,showCloseButton:!0,closeButtonSize:20,borderRadius:10,sx:{zIndex:15002},children:l.jsx(wZ,{title:gu.title,description:gu.description,confirmLabel:gu.confirmLabel,cancelLabel:gu.cancelLabel,isLoading:f,danger:!0,onConfirm:x,onCancel:()=>m(!1)})})]})},RZ=(e,t)=>typeof e[t]=="boolean",NZ=(e,t)=>{var n;return typeof e[t]=="object"&&typeof((n=e[t])==null?void 0:n.enabled)=="boolean"},jZ=e=>{const t={};for(const n in e)NZ(e,n)?t[n]=e[n]:RZ(e,n)&&(t[n]={enabled:e[n],connector:n===qy?e.connector:void 0});return t},$y=({advancedFeatures:e,connectorId:t,connectorName:n,connectorType:r,featureIds:o,excludeFeatureIds:a,soloSpansFullWidth:A=!0})=>{const{availableFeatures:s}=Q.useContext(Et),c=jZ(e),u=QZ.filter(f=>o&&!o.includes(f.id)||a!=null&&a.includes(f.id)?!1:ir(s,f.featureKey)&&typeof c[f.id]=="object");if(u.length===0)return null;const g=f=>c[f].enabled,d=f=>{var p;const h=c[f];return!g(f)&&((p=h==null?void 0:h.connector)!=null&&p.id)?{isDisabled:!0,tooltipContent:cr(mZ,{enabledConnector:h.connector.name,currentConnector:n})}:{isDisabled:!1,tooltipContent:""}};return l.jsxs("div",{children:[l.jsx("h2",{className:"text-h2 text-gray-2! mt-8 mb-2",children:yZ}),l.jsx("p",{className:"text-body2 text-gray-3!",children:bZ}),l.jsx("div",{className:"grid grid-cols-2 mt-6 gap-4",children:u.map(f=>{const{isDisabled:h,tooltipContent:p}=d(f.id);return l.jsx(MZ,{id:f.id,heading:f.heading.replace(/\{\{app_name\}\}/g,n),subHeading:f.subHeading.replace(/\{\{app_name\}\}/g,n),isEnabled:g(f.id),icon:f.icon,connectorId:t,connectorType:r,modalSettings:f.modalSettings,disabled:h,tooltipContent:p,soloSpansFullWidth:A},f.id)})})]})},VZ=e=>S.createElement("svg",{width:19,height:14,viewBox:"0 0 19 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},S.createElement("path",{d:"M4.5 11C5.15764 11 5.79771 11.0833 6.42021 11.25C7.04285 11.4167 7.65278 11.625 8.25 11.875V2.41667C7.66667 2.11111 7.0625 1.88194 6.4375 1.72917C5.8125 1.57639 5.16514 1.5 4.49542 1.5C3.98236 1.5 3.47292 1.54514 2.96708 1.63542C2.46125 1.72569 1.97222 1.875 1.5 2.08333V11.5C1.98611 11.3194 2.47785 11.191 2.97521 11.1146C3.47271 11.0382 3.98097 11 4.5 11ZM9.75 11.875C10.3472 11.5972 10.9572 11.3819 11.5798 11.2292C12.2023 11.0764 12.8424 11 13.5 11C14.0139 11 14.5243 11.0312 15.0312 11.0938C15.5382 11.1562 16.0278 11.2917 16.5 11.5V2.08333C16.0139 1.90278 15.5195 1.76042 15.0169 1.65625C14.5142 1.55208 14.0081 1.5 13.4983 1.5C12.8328 1.5 12.1875 1.57639 11.5625 1.72917C10.9375 1.88194 10.3333 2.11111 9.75 2.41667V11.875ZM9 14C8.31944 13.5556 7.60417 13.1944 6.85417 12.9167C6.10417 12.6389 5.31944 12.5 4.5 12.5C3.97222 12.5 3.44444 12.5521 2.91667 12.6562C2.38889 12.7604 1.88194 12.9167 1.39583 13.125C1.0625 13.2639 0.746528 13.2394 0.447917 13.0515C0.149306 12.8635 0 12.5894 0 12.2292V1.75C0 1.55556 0.0520833 1.375 0.15625 1.20833C0.260417 1.04167 0.402778 0.916667 0.583333 0.833333C1.20833 0.555556 1.8475 0.347222 2.50083 0.208333C3.15417 0.0694444 3.82056 0 4.5 0C5.29097 0 6.06486 0.09375 6.82167 0.28125C7.57847 0.46875 8.30458 0.75 9 1.125C9.70833 0.763889 10.4388 0.486111 11.1915 0.291667C11.944 0.0972222 12.7135 0 13.5 0C14.1794 0 14.8458 0.0694444 15.4992 0.208333C16.1525 0.347222 16.7917 0.555556 17.4167 0.833333C17.5972 0.916667 17.7431 1.04167 17.8542 1.20833C17.9653 1.375 18.0208 1.55556 18.0208 1.75V12.2292C18.0208 12.5764 17.9132 12.8542 17.6979 13.0625C17.4826 13.2708 17.2569 13.3194 17.0208 13.2083C16.4653 12.9583 15.8925 12.7778 15.3025 12.6667C14.7126 12.5556 14.1118 12.5 13.5 12.5C12.6806 12.5 11.8958 12.6389 11.1458 12.9167C10.3958 13.1944 9.68056 13.5556 9 14Z",fill:"#4D596C"})),HZ=e=>S.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,viewBox:"0 0 20 20",fill:"none",...e},S.createElement("g",{clipPath:"url(#clip0_5762_155564)"},S.createElement("path",{d:"M8.33342 13.75L13.3334 9.99996L8.33342 6.24996V13.75ZM10.0001 1.66663C5.40008 1.66663 1.66675 5.39996 1.66675 9.99996C1.66675 14.6 5.40008 18.3333 10.0001 18.3333C14.6001 18.3333 18.3334 14.6 18.3334 9.99996C18.3334 5.39996 14.6001 1.66663 10.0001 1.66663ZM10.0001 16.6666C6.32508 16.6666 3.33341 13.675 3.33341 9.99996C3.33341 6.32496 6.32508 3.33329 10.0001 3.33329C13.6751 3.33329 16.6667 6.32496 16.6667 9.99996C16.6667 13.675 13.6751 16.6666 10.0001 16.6666Z",fill:"#4D596C"})),S.createElement("defs",null,S.createElement("clipPath",{id:"clip0_5762_155564"},S.createElement("rect",{width:20,height:20,fill:"white"})))),GZ=e=>S.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},S.createElement("path",{d:"M17.5 9.31947C17.503 10.456 17.2374 11.5772 16.725 12.5917C16.1174 13.8074 15.1834 14.8299 14.0275 15.5447C12.8717 16.2595 11.5396 16.6384 10.1806 16.6389C9.044 16.6419 7.92282 16.3763 6.90833 15.8639L2 17.5L3.63611 12.5917C3.12369 11.5772 2.85815 10.456 2.86111 9.31947C2.86164 7.96043 3.24053 6.62837 3.95534 5.4725C4.67016 4.31663 5.69266 3.3826 6.90833 2.77502C7.92282 2.2626 9.044 1.99706 10.1806 2.00002H10.6111C11.4833 2.04814 12.332 2.25177 13.1199 2.59427C13.9534 2.95658 14.7189 3.4743 15.3723 4.12771C16.1287 4.8841 16.7033 5.7907 17.0654 6.77911C17.3118 7.45168 17.4599 8.16213 17.5 8.88891V9.31947Z",stroke:"#4D596C",strokeWidth:1.44667,strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("circle",{cx:7,cy:9.5,r:1,fill:"#4D596C"}),S.createElement("circle",{cx:10,cy:9.5,r:1,fill:"#4D596C"}),S.createElement("circle",{cx:13,cy:9.5,r:1,fill:"#4D596C"})),WZ=i.styled(i.Box)`
|
|
3742
3742
|
color: var(--connector-admin-text-primary);
|
|
3743
3743
|
background-color: var(--connector-admin-guide-link-surface);
|
|
3744
3744
|
border-radius: ${i.theme.shape.borderRadius}px;
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/v2/components/ui/auto-complete/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAMtD,UAAU,mBAAmB;IAC3B,OAAO,EAAE,QAAQ,EAAE,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,CAAC,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,QAAQ,GAAG,IAAI,KAAK,IAAI,CAAC;IACtG,sBAAsB,CAAC,EAAE,QAAQ,EAAE,CAAC;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;IAClD;6DACyD;IACzD,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAED,eAAO,MAAM,kBAAkB,sIAW5B,mBAAmB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/v2/components/ui/auto-complete/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAMtD,UAAU,mBAAmB;IAC3B,OAAO,EAAE,QAAQ,EAAE,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,CAAC,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,QAAQ,GAAG,IAAI,KAAK,IAAI,CAAC;IACtG,sBAAsB,CAAC,EAAE,QAAQ,EAAE,CAAC;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;IAClD;6DACyD;IACzD,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAED,eAAO,MAAM,kBAAkB,sIAW5B,mBAAmB,4CAsFrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/v2/components/ui/custom-tooltip/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmC,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEpF,KAAK,kBAAkB,GAAG,YAAY,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAC7F,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/v2/components/ui/custom-tooltip/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmC,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEpF,KAAK,kBAAkB,GAAG,YAAY,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAC7F,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAyBpD,CAAC"}
|