@hiver/connector-admin 4.11.0-oneClickAuto-beta.8 → 4.11.0-oneClickAuto-beta.10
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.umd.js
CHANGED
|
@@ -95,17 +95,17 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
|
|
|
95
95
|
* LICENSE.md file in the root directory of this source tree.
|
|
96
96
|
*
|
|
97
97
|
* @license MIT
|
|
98
|
-
*/function Po(){return Po=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Po.apply(this,arguments)}function yg(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,A;for(A=0;A<r.length;A++)o=r[A],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}const wl="get",Tl="application/x-www-form-urlencoded";function Sl(e){return e!=null&&typeof e.tagName=="string"}function VT(e){return Sl(e)&&e.tagName.toLowerCase()==="button"}function GT(e){return Sl(e)&&e.tagName.toLowerCase()==="form"}function HT(e){return Sl(e)&&e.tagName.toLowerCase()==="input"}function WT(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function zT(e,t){return e.button===0&&(!t||t==="_self")&&!WT(e)}function bg(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(o=>[n,o]):[[n,r]])},[]))}function YT(e,t){let n=bg(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(A=>{n.append(o,A)})}),n}let _l=null;function JT(){if(_l===null)try{new FormData(document.createElement("form"),0),_l=!1}catch{_l=!0}return _l}const XT=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function xg(e){return e!=null&&!XT.has(e)?(process.env.NODE_ENV!=="production"&&sn(!1,'"'+e+'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` '+('and will default to "'+Tl+'"')),null):e}function qT(e,t){let n,r,o,A,s;if(GT(e)){let a=e.getAttribute("action");r=a?xr(a,t):null,n=e.getAttribute("method")||wl,o=xg(e.getAttribute("enctype"))||Tl,A=new FormData(e)}else if(VT(e)||HT(e)&&(e.type==="submit"||e.type==="image")){let a=e.form;if(a==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let i=e.getAttribute("formaction")||a.getAttribute("action");if(r=i?xr(i,t):null,n=e.getAttribute("formmethod")||a.getAttribute("method")||wl,o=xg(e.getAttribute("formenctype"))||xg(a.getAttribute("enctype"))||Tl,A=new FormData(a,e),!JT()){let{name:l,type:u,value:d}=e;if(u==="image"){let f=l?l+".":"";A.append(f+"x","0"),A.append(f+"y","0")}else l&&A.append(l,d)}}else{if(Sl(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=wl,r=null,o=Tl,s=e}return A&&o==="text/plain"&&(s=A,A=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:A,body:s}}const ZT=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],UT=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],$T=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","unstable_viewTransition"],KT="6";try{window.__reactRouterVersion=KT}catch{}function SB(e,t){return $3({basename:t==null?void 0:t.basename,future:Po({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:m3({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||eS(),routes:e,mapRouteProperties:jT,unstable_dataStrategy:t==null?void 0:t.unstable_dataStrategy,unstable_patchRoutesOnNavigation:t==null?void 0:t.unstable_patchRoutesOnNavigation,window:t==null?void 0:t.window}).initialize()}function eS(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Po({},t,{errors:tS(t.errors)})),t}function tS(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,o]of t)if(o&&o.__type==="RouteErrorResponse")n[r]=new Ql(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let A=window[o.__subType];if(typeof A=="function")try{let s=new A(o.message);s.stack="",n[r]=s}catch{}}if(n[r]==null){let A=new Error(o.message);A.stack="",n[r]=A}}else n[r]=o;return n}const vg=_.createContext({isTransitioning:!1});process.env.NODE_ENV!=="production"&&(vg.displayName="ViewTransition");const _B=_.createContext(new Map);process.env.NODE_ENV!=="production"&&(_B.displayName="Fetchers");const DB=_["startTransition"],OB=I2["flushSync"];function nS(e){DB?DB(e):e()}function Ta(e){OB?OB(e):e()}class rS{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function LB(e){let{fallbackElement:t,router:n,future:r}=e,[o,A]=_.useState(n.state),[s,a]=_.useState(),[i,l]=_.useState({isTransitioning:!1}),[u,d]=_.useState(),[f,p]=_.useState(),[I,C]=_.useState(),E=_.useRef(new Map),{v7_startTransition:h}=r||{},B=_.useCallback(x=>{h?nS(x):x()},[h]),Q=_.useCallback((x,T)=>{let{deletedFetchers:V,unstable_flushSync:D,unstable_viewTransitionOpts:N}=T;V.forEach(L=>E.current.delete(L)),x.fetchers.forEach((L,q)=>{L.data!==void 0&&E.current.set(q,L.data)});let H=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!N||H){D?Ta(()=>A(x)):B(()=>A(x));return}if(D){Ta(()=>{f&&(u&&u.resolve(),f.skipTransition()),l({isTransitioning:!0,flushSync:!0,currentLocation:N.currentLocation,nextLocation:N.nextLocation})});let L=n.window.document.startViewTransition(()=>{Ta(()=>A(x))});L.finished.finally(()=>{Ta(()=>{d(void 0),p(void 0),a(void 0),l({isTransitioning:!1})})}),Ta(()=>p(L));return}f?(u&&u.resolve(),f.skipTransition(),C({state:x,currentLocation:N.currentLocation,nextLocation:N.nextLocation})):(a(x),l({isTransitioning:!0,flushSync:!1,currentLocation:N.currentLocation,nextLocation:N.nextLocation}))},[n.window,f,u,E,B]);_.useLayoutEffect(()=>n.subscribe(Q),[n,Q]),_.useEffect(()=>{i.isTransitioning&&!i.flushSync&&d(new rS)},[i]),_.useEffect(()=>{if(u&&s&&n.window){let x=s,T=u.promise,V=n.window.document.startViewTransition(async()=>{B(()=>A(x)),await T});V.finished.finally(()=>{d(void 0),p(void 0),a(void 0),l({isTransitioning:!1})}),p(V)}},[B,s,u,n.window]),_.useEffect(()=>{u&&s&&o.location.key===s.location.key&&u.resolve()},[u,f,o.location,s]),_.useEffect(()=>{!i.isTransitioning&&I&&(a(I.state),l({isTransitioning:!0,flushSync:!1,currentLocation:I.currentLocation,nextLocation:I.nextLocation}),C(void 0))},[i.isTransitioning,I]),_.useEffect(()=>{process.env.NODE_ENV!=="production"&&sn(t==null||!n.future.v7_partialHydration,"`<RouterProvider fallbackElement>` is deprecated when using `v7_partialHydration`, use a `HydrateFallback` component instead")},[]);let y=_.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:x=>n.navigate(x),push:(x,T,V)=>n.navigate(x,{state:T,preventScrollReset:V==null?void 0:V.preventScrollReset}),replace:(x,T,V)=>n.navigate(x,{replace:!0,state:T,preventScrollReset:V==null?void 0:V.preventScrollReset})}),[n]),b=n.basename||"/",v=_.useMemo(()=>({router:n,navigator:y,static:!1,basename:b}),[n,y,b]),w=_.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return _.createElement(_.Fragment,null,_.createElement(KA.Provider,{value:v},_.createElement(xl.Provider,{value:o},_.createElement(_B.Provider,{value:E.current},_.createElement(vg.Provider,{value:i},_.createElement(MT,{basename:b,location:o.location,navigationType:o.historyAction,navigator:y,future:w},o.initialized||n.future.v7_partialHydration?_.createElement(oS,{routes:n.routes,future:n.future,state:o}):t))))),null)}const oS=_.memo(AS);function AS(e){let{routes:t,future:n,state:r}=e;return vT(t,void 0,r,n)}process.env.NODE_ENV;const sS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",aS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,FB=_.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:A,replace:s,state:a,target:i,to:l,preventScrollReset:u,unstable_viewTransition:d}=t,f=yg(t,ZT),{basename:p}=_.useContext(wr),I,C=!1;if(typeof l=="string"&&aS.test(l)&&(I=l,sS))try{let Q=new URL(window.location.href),y=l.startsWith("//")?new URL(Q.protocol+l):new URL(l),b=xr(y.pathname,p);y.origin===Q.origin&&b!=null?l=b+y.search+y.hash:C=!0}catch{process.env.NODE_ENV!=="production"&&sn(!1,'<Link to="'+l+'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.')}let E=mT(l,{relative:o}),h=uS(l,{replace:s,state:a,target:i,preventScrollReset:u,relative:o,unstable_viewTransition:d});function B(Q){r&&r(Q),Q.defaultPrevented||h(Q)}return _.createElement("a",Po({},f,{href:I||E,onClick:C||A?r:B,ref:n,target:i}))});process.env.NODE_ENV!=="production"&&(FB.displayName="Link");const iS=_.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:o=!1,className:A="",end:s=!1,style:a,to:i,unstable_viewTransition:l,children:u}=t,d=yg(t,UT),f=va(i,{relative:d.relative}),p=Ro(),I=_.useContext(xl),{navigator:C,basename:E}=_.useContext(wr),h=I!=null&&IS(f)&&l===!0,B=C.encodeLocation?C.encodeLocation(f).pathname:f.pathname,Q=p.pathname,y=I&&I.navigation&&I.navigation.location?I.navigation.location.pathname:null;o||(Q=Q.toLowerCase(),y=y?y.toLowerCase():null,B=B.toLowerCase()),y&&E&&(y=xr(y,E)||y);const b=B!=="/"&&B.endsWith("/")?B.length-1:B.length;let v=Q===B||!s&&Q.startsWith(B)&&Q.charAt(b)==="/",w=y!=null&&(y===B||!s&&y.startsWith(B)&&y.charAt(B.length)==="/"),x={isActive:v,isPending:w,isTransitioning:h},T=v?r:void 0,V;typeof A=="function"?V=A(x):V=[A,v?"active":null,w?"pending":null,h?"transitioning":null].filter(Boolean).join(" ");let D=typeof a=="function"?a(x):a;return _.createElement(FB,Po({},d,{"aria-current":T,className:V,ref:n,style:D,to:i,unstable_viewTransition:l}),typeof u=="function"?u(x):u)});process.env.NODE_ENV!=="production"&&(iS.displayName="NavLink");const lS=_.forwardRef((e,t)=>{let{fetcherKey:n,navigate:r,reloadDocument:o,replace:A,state:s,method:a=wl,action:i,onSubmit:l,relative:u,preventScrollReset:d,unstable_viewTransition:f}=e,p=yg(e,$T),I=ES(),C=fS(i,{relative:u}),E=a.toLowerCase()==="get"?"get":"post",h=B=>{if(l&&l(B),B.defaultPrevented)return;B.preventDefault();let Q=B.nativeEvent.submitter,y=(Q==null?void 0:Q.getAttribute("formmethod"))||a;I(Q||B.currentTarget,{fetcherKey:n,method:y,navigate:r,replace:A,state:s,relative:u,preventScrollReset:d,unstable_viewTransition:f})};return _.createElement("form",Po({ref:t,method:E,action:C,onSubmit:o?l:h},p))});process.env.NODE_ENV!=="production"&&(lS.displayName="Form"),process.env.NODE_ENV;var Dl;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Dl||(Dl={}));var NB;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(NB||(NB={}));function cS(e){return e+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function RB(e){let t=_.useContext(KA);return t||(process.env.NODE_ENV!=="production"?Fe(!1,cS(e)):Fe(!1)),t}function uS(e,t){let{target:n,replace:r,state:o,preventScrollReset:A,relative:s,unstable_viewTransition:a}=t===void 0?{}:t,i=cn(),l=Ro(),u=va(e,{relative:s});return _.useCallback(d=>{if(zT(d,n)){d.preventDefault();let f=r!==void 0?r:Oo(l)===Oo(u);i(e,{replace:f,state:o,preventScrollReset:A,relative:s,unstable_viewTransition:a})}},[l,i,u,r,o,n,e,A,s,a])}function IA(e){process.env.NODE_ENV!=="production"&&sn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=_.useRef(bg(e)),n=_.useRef(!1),r=Ro(),o=_.useMemo(()=>YT(r.search,n.current?null:t.current),[r.search]),A=cn(),s=_.useCallback((a,i)=>{const l=bg(typeof a=="function"?a(o):a);n.current=!0,A("?"+l,i)},[A,o]);return[o,s]}function gS(){if(typeof document>"u")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}let dS=0,CS=()=>"__"+String(++dS)+"__";function ES(){let{router:e}=RB(Dl.UseSubmit),{basename:t}=_.useContext(wr),n=NT();return _.useCallback(function(r,o){o===void 0&&(o={}),gS();let{action:A,method:s,encType:a,formData:i,body:l}=qT(r,t);if(o.navigate===!1){let u=o.fetcherKey||CS();e.fetch(u,n,o.action||A,{preventScrollReset:o.preventScrollReset,formData:i,body:l,formMethod:o.method||s,formEncType:o.encType||a,unstable_flushSync:o.unstable_flushSync})}else e.navigate(o.action||A,{preventScrollReset:o.preventScrollReset,formData:i,body:l,formMethod:o.method||s,formEncType:o.encType||a,replace:o.replace,state:o.state,fromRouteId:n,unstable_flushSync:o.unstable_flushSync,unstable_viewTransition:o.unstable_viewTransition})},[e,t,n])}function fS(e,t){let{relative:n}=t===void 0?{}:t,{basename:r}=_.useContext(wr),o=_.useContext(Tr);o||(process.env.NODE_ENV!=="production"?Fe(!1,"useFormAction must be used inside a RouteContext"):Fe(!1));let[A]=o.matches.slice(-1),s=Po({},va(e||".",{relative:n})),a=Ro();if(e==null){s.search=a.search;let i=new URLSearchParams(s.search);i.has("index")&&i.get("index")===""&&(i.delete("index"),s.search=i.toString()?"?"+i.toString():"")}return(!e||e===".")&&A.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(s.pathname=s.pathname==="/"?r:Vr([r,s.pathname])),Oo(s)}function IS(e,t){t===void 0&&(t={});let n=_.useContext(vg);n==null&&(process.env.NODE_ENV!=="production"?Fe(!1,"`unstable_useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"):Fe(!1));let{basename:r}=RB(Dl.useViewTransitionState),o=va(e,{relative:t.relative});if(!n.isTransitioning)return!1;let A=xr(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=xr(n.nextLocation.pathname,r)||n.nextLocation.pathname;return hl(o.pathname,s)!=null||hl(o.pathname,A)!=null}const BS=g.styled(g.Stack)`
|
|
98
|
+
*/function Po(){return Po=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Po.apply(this,arguments)}function yg(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,A;for(A=0;A<r.length;A++)o=r[A],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}const wl="get",Tl="application/x-www-form-urlencoded";function Sl(e){return e!=null&&typeof e.tagName=="string"}function VT(e){return Sl(e)&&e.tagName.toLowerCase()==="button"}function GT(e){return Sl(e)&&e.tagName.toLowerCase()==="form"}function HT(e){return Sl(e)&&e.tagName.toLowerCase()==="input"}function WT(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function zT(e,t){return e.button===0&&(!t||t==="_self")&&!WT(e)}function bg(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(o=>[n,o]):[[n,r]])},[]))}function YT(e,t){let n=bg(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(A=>{n.append(o,A)})}),n}let _l=null;function JT(){if(_l===null)try{new FormData(document.createElement("form"),0),_l=!1}catch{_l=!0}return _l}const XT=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function xg(e){return e!=null&&!XT.has(e)?(process.env.NODE_ENV!=="production"&&sn(!1,'"'+e+'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` '+('and will default to "'+Tl+'"')),null):e}function qT(e,t){let n,r,o,A,s;if(GT(e)){let a=e.getAttribute("action");r=a?xr(a,t):null,n=e.getAttribute("method")||wl,o=xg(e.getAttribute("enctype"))||Tl,A=new FormData(e)}else if(VT(e)||HT(e)&&(e.type==="submit"||e.type==="image")){let a=e.form;if(a==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let i=e.getAttribute("formaction")||a.getAttribute("action");if(r=i?xr(i,t):null,n=e.getAttribute("formmethod")||a.getAttribute("method")||wl,o=xg(e.getAttribute("formenctype"))||xg(a.getAttribute("enctype"))||Tl,A=new FormData(a,e),!JT()){let{name:l,type:u,value:d}=e;if(u==="image"){let f=l?l+".":"";A.append(f+"x","0"),A.append(f+"y","0")}else l&&A.append(l,d)}}else{if(Sl(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=wl,r=null,o=Tl,s=e}return A&&o==="text/plain"&&(s=A,A=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:A,body:s}}const ZT=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],UT=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],$T=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","unstable_viewTransition"],KT="6";try{window.__reactRouterVersion=KT}catch{}function SB(e,t){return $3({basename:t==null?void 0:t.basename,future:Po({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:m3({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||e4(),routes:e,mapRouteProperties:jT,unstable_dataStrategy:t==null?void 0:t.unstable_dataStrategy,unstable_patchRoutesOnNavigation:t==null?void 0:t.unstable_patchRoutesOnNavigation,window:t==null?void 0:t.window}).initialize()}function e4(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Po({},t,{errors:t4(t.errors)})),t}function t4(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,o]of t)if(o&&o.__type==="RouteErrorResponse")n[r]=new Ql(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let A=window[o.__subType];if(typeof A=="function")try{let s=new A(o.message);s.stack="",n[r]=s}catch{}}if(n[r]==null){let A=new Error(o.message);A.stack="",n[r]=A}}else n[r]=o;return n}const vg=_.createContext({isTransitioning:!1});process.env.NODE_ENV!=="production"&&(vg.displayName="ViewTransition");const _B=_.createContext(new Map);process.env.NODE_ENV!=="production"&&(_B.displayName="Fetchers");const DB=_["startTransition"],OB=I2["flushSync"];function n4(e){DB?DB(e):e()}function Ta(e){OB?OB(e):e()}class r4{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function LB(e){let{fallbackElement:t,router:n,future:r}=e,[o,A]=_.useState(n.state),[s,a]=_.useState(),[i,l]=_.useState({isTransitioning:!1}),[u,d]=_.useState(),[f,p]=_.useState(),[I,C]=_.useState(),E=_.useRef(new Map),{v7_startTransition:h}=r||{},B=_.useCallback(x=>{h?n4(x):x()},[h]),Q=_.useCallback((x,T)=>{let{deletedFetchers:V,unstable_flushSync:D,unstable_viewTransitionOpts:N}=T;V.forEach(L=>E.current.delete(L)),x.fetchers.forEach((L,q)=>{L.data!==void 0&&E.current.set(q,L.data)});let H=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!N||H){D?Ta(()=>A(x)):B(()=>A(x));return}if(D){Ta(()=>{f&&(u&&u.resolve(),f.skipTransition()),l({isTransitioning:!0,flushSync:!0,currentLocation:N.currentLocation,nextLocation:N.nextLocation})});let L=n.window.document.startViewTransition(()=>{Ta(()=>A(x))});L.finished.finally(()=>{Ta(()=>{d(void 0),p(void 0),a(void 0),l({isTransitioning:!1})})}),Ta(()=>p(L));return}f?(u&&u.resolve(),f.skipTransition(),C({state:x,currentLocation:N.currentLocation,nextLocation:N.nextLocation})):(a(x),l({isTransitioning:!0,flushSync:!1,currentLocation:N.currentLocation,nextLocation:N.nextLocation}))},[n.window,f,u,E,B]);_.useLayoutEffect(()=>n.subscribe(Q),[n,Q]),_.useEffect(()=>{i.isTransitioning&&!i.flushSync&&d(new r4)},[i]),_.useEffect(()=>{if(u&&s&&n.window){let x=s,T=u.promise,V=n.window.document.startViewTransition(async()=>{B(()=>A(x)),await T});V.finished.finally(()=>{d(void 0),p(void 0),a(void 0),l({isTransitioning:!1})}),p(V)}},[B,s,u,n.window]),_.useEffect(()=>{u&&s&&o.location.key===s.location.key&&u.resolve()},[u,f,o.location,s]),_.useEffect(()=>{!i.isTransitioning&&I&&(a(I.state),l({isTransitioning:!0,flushSync:!1,currentLocation:I.currentLocation,nextLocation:I.nextLocation}),C(void 0))},[i.isTransitioning,I]),_.useEffect(()=>{process.env.NODE_ENV!=="production"&&sn(t==null||!n.future.v7_partialHydration,"`<RouterProvider fallbackElement>` is deprecated when using `v7_partialHydration`, use a `HydrateFallback` component instead")},[]);let y=_.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:x=>n.navigate(x),push:(x,T,V)=>n.navigate(x,{state:T,preventScrollReset:V==null?void 0:V.preventScrollReset}),replace:(x,T,V)=>n.navigate(x,{replace:!0,state:T,preventScrollReset:V==null?void 0:V.preventScrollReset})}),[n]),b=n.basename||"/",v=_.useMemo(()=>({router:n,navigator:y,static:!1,basename:b}),[n,y,b]),w=_.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return _.createElement(_.Fragment,null,_.createElement(KA.Provider,{value:v},_.createElement(xl.Provider,{value:o},_.createElement(_B.Provider,{value:E.current},_.createElement(vg.Provider,{value:i},_.createElement(MT,{basename:b,location:o.location,navigationType:o.historyAction,navigator:y,future:w},o.initialized||n.future.v7_partialHydration?_.createElement(o4,{routes:n.routes,future:n.future,state:o}):t))))),null)}const o4=_.memo(A4);function A4(e){let{routes:t,future:n,state:r}=e;return vT(t,void 0,r,n)}process.env.NODE_ENV;const s4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",a4=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,FB=_.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:A,replace:s,state:a,target:i,to:l,preventScrollReset:u,unstable_viewTransition:d}=t,f=yg(t,ZT),{basename:p}=_.useContext(wr),I,C=!1;if(typeof l=="string"&&a4.test(l)&&(I=l,s4))try{let Q=new URL(window.location.href),y=l.startsWith("//")?new URL(Q.protocol+l):new URL(l),b=xr(y.pathname,p);y.origin===Q.origin&&b!=null?l=b+y.search+y.hash:C=!0}catch{process.env.NODE_ENV!=="production"&&sn(!1,'<Link to="'+l+'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.')}let E=mT(l,{relative:o}),h=u4(l,{replace:s,state:a,target:i,preventScrollReset:u,relative:o,unstable_viewTransition:d});function B(Q){r&&r(Q),Q.defaultPrevented||h(Q)}return _.createElement("a",Po({},f,{href:I||E,onClick:C||A?r:B,ref:n,target:i}))});process.env.NODE_ENV!=="production"&&(FB.displayName="Link");const i4=_.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:o=!1,className:A="",end:s=!1,style:a,to:i,unstable_viewTransition:l,children:u}=t,d=yg(t,UT),f=va(i,{relative:d.relative}),p=Ro(),I=_.useContext(xl),{navigator:C,basename:E}=_.useContext(wr),h=I!=null&&I4(f)&&l===!0,B=C.encodeLocation?C.encodeLocation(f).pathname:f.pathname,Q=p.pathname,y=I&&I.navigation&&I.navigation.location?I.navigation.location.pathname:null;o||(Q=Q.toLowerCase(),y=y?y.toLowerCase():null,B=B.toLowerCase()),y&&E&&(y=xr(y,E)||y);const b=B!=="/"&&B.endsWith("/")?B.length-1:B.length;let v=Q===B||!s&&Q.startsWith(B)&&Q.charAt(b)==="/",w=y!=null&&(y===B||!s&&y.startsWith(B)&&y.charAt(B.length)==="/"),x={isActive:v,isPending:w,isTransitioning:h},T=v?r:void 0,V;typeof A=="function"?V=A(x):V=[A,v?"active":null,w?"pending":null,h?"transitioning":null].filter(Boolean).join(" ");let D=typeof a=="function"?a(x):a;return _.createElement(FB,Po({},d,{"aria-current":T,className:V,ref:n,style:D,to:i,unstable_viewTransition:l}),typeof u=="function"?u(x):u)});process.env.NODE_ENV!=="production"&&(i4.displayName="NavLink");const l4=_.forwardRef((e,t)=>{let{fetcherKey:n,navigate:r,reloadDocument:o,replace:A,state:s,method:a=wl,action:i,onSubmit:l,relative:u,preventScrollReset:d,unstable_viewTransition:f}=e,p=yg(e,$T),I=E4(),C=f4(i,{relative:u}),E=a.toLowerCase()==="get"?"get":"post",h=B=>{if(l&&l(B),B.defaultPrevented)return;B.preventDefault();let Q=B.nativeEvent.submitter,y=(Q==null?void 0:Q.getAttribute("formmethod"))||a;I(Q||B.currentTarget,{fetcherKey:n,method:y,navigate:r,replace:A,state:s,relative:u,preventScrollReset:d,unstable_viewTransition:f})};return _.createElement("form",Po({ref:t,method:E,action:C,onSubmit:o?l:h},p))});process.env.NODE_ENV!=="production"&&(l4.displayName="Form"),process.env.NODE_ENV;var Dl;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Dl||(Dl={}));var NB;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(NB||(NB={}));function c4(e){return e+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function RB(e){let t=_.useContext(KA);return t||(process.env.NODE_ENV!=="production"?Fe(!1,c4(e)):Fe(!1)),t}function u4(e,t){let{target:n,replace:r,state:o,preventScrollReset:A,relative:s,unstable_viewTransition:a}=t===void 0?{}:t,i=cn(),l=Ro(),u=va(e,{relative:s});return _.useCallback(d=>{if(zT(d,n)){d.preventDefault();let f=r!==void 0?r:Oo(l)===Oo(u);i(e,{replace:f,state:o,preventScrollReset:A,relative:s,unstable_viewTransition:a})}},[l,i,u,r,o,n,e,A,s,a])}function IA(e){process.env.NODE_ENV!=="production"&&sn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=_.useRef(bg(e)),n=_.useRef(!1),r=Ro(),o=_.useMemo(()=>YT(r.search,n.current?null:t.current),[r.search]),A=cn(),s=_.useCallback((a,i)=>{const l=bg(typeof a=="function"?a(o):a);n.current=!0,A("?"+l,i)},[A,o]);return[o,s]}function g4(){if(typeof document>"u")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}let d4=0,C4=()=>"__"+String(++d4)+"__";function E4(){let{router:e}=RB(Dl.UseSubmit),{basename:t}=_.useContext(wr),n=NT();return _.useCallback(function(r,o){o===void 0&&(o={}),g4();let{action:A,method:s,encType:a,formData:i,body:l}=qT(r,t);if(o.navigate===!1){let u=o.fetcherKey||C4();e.fetch(u,n,o.action||A,{preventScrollReset:o.preventScrollReset,formData:i,body:l,formMethod:o.method||s,formEncType:o.encType||a,unstable_flushSync:o.unstable_flushSync})}else e.navigate(o.action||A,{preventScrollReset:o.preventScrollReset,formData:i,body:l,formMethod:o.method||s,formEncType:o.encType||a,replace:o.replace,state:o.state,fromRouteId:n,unstable_flushSync:o.unstable_flushSync,unstable_viewTransition:o.unstable_viewTransition})},[e,t,n])}function f4(e,t){let{relative:n}=t===void 0?{}:t,{basename:r}=_.useContext(wr),o=_.useContext(Tr);o||(process.env.NODE_ENV!=="production"?Fe(!1,"useFormAction must be used inside a RouteContext"):Fe(!1));let[A]=o.matches.slice(-1),s=Po({},va(e||".",{relative:n})),a=Ro();if(e==null){s.search=a.search;let i=new URLSearchParams(s.search);i.has("index")&&i.get("index")===""&&(i.delete("index"),s.search=i.toString()?"?"+i.toString():"")}return(!e||e===".")&&A.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(s.pathname=s.pathname==="/"?r:Vr([r,s.pathname])),Oo(s)}function I4(e,t){t===void 0&&(t={});let n=_.useContext(vg);n==null&&(process.env.NODE_ENV!=="production"?Fe(!1,"`unstable_useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"):Fe(!1));let{basename:r}=RB(Dl.useViewTransitionState),o=va(e,{relative:t.relative});if(!n.isTransitioning)return!1;let A=xr(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=xr(n.nextLocation.pathname,r)||n.nextLocation.pathname;return hl(o.pathname,s)!=null||hl(o.pathname,A)!=null}const B4=g.styled(g.Stack)`
|
|
99
99
|
width: 100%;
|
|
100
100
|
height: 100%;
|
|
101
101
|
align-items: center;
|
|
102
102
|
justify-content: center;
|
|
103
|
-
`,
|
|
103
|
+
`,p4=g.styled(g.Stack)`
|
|
104
104
|
height: 380px;
|
|
105
105
|
border-radius: 10px;
|
|
106
106
|
overflow: hidden;
|
|
107
107
|
flex-direction: row;
|
|
108
|
-
`,
|
|
108
|
+
`,h4=g.styled(g.Box)`
|
|
109
109
|
width: 367px;
|
|
110
110
|
height: 100%;
|
|
111
111
|
background: #f6f8fc;
|
|
@@ -119,7 +119,7 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
|
|
|
119
119
|
color: #196fe0;
|
|
120
120
|
cursor: pointer;
|
|
121
121
|
}
|
|
122
|
-
`,
|
|
122
|
+
`,Q4=g.styled(g.Box)`
|
|
123
123
|
width: 501px;
|
|
124
124
|
height: 100%;
|
|
125
125
|
background: #e5eeff;
|
|
@@ -128,7 +128,7 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
|
|
|
128
128
|
width: 476px;
|
|
129
129
|
height: 267px;
|
|
130
130
|
}
|
|
131
|
-
`,
|
|
131
|
+
`,m4=g.styled(g.Stack)`
|
|
132
132
|
width: 92px;
|
|
133
133
|
height: 20px;
|
|
134
134
|
background: #fab400;
|
|
@@ -139,7 +139,7 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
|
|
|
139
139
|
border-radius: 11px;
|
|
140
140
|
justify-content: center;
|
|
141
141
|
align-items: center;
|
|
142
|
-
`,
|
|
142
|
+
`,y4="Customising connectors on the agent’s panel",b4="Configure your Connectors in the right panel, add your cards and name them how you want the agents to see and update them.",x4="Coming Soon",v4="Have any questions? ",kB="internal-chat",w4="https://cdn.hiverhq.com/connectors-module/assets/RequestNewCCLogo.svg",T4="https://cdn.hiverhq.com/connectors-module/assets/agent-view.svg",S4="https://cdn.hiverhq.com/connectors-module/assets/RequestConnector.svg",_4="https://cdn.hiverhq.com/connectors-module/assets/UpgradeImage.svg",D4=()=>{const{availableFeatures:e}=m.useContext(on),t=n=>{n.stopPropagation(),Pr(e,kB)&&Qf()};return c.jsx(B4,{children:c.jsxs(p4,{children:[c.jsxs(h4,{children:[c.jsx(m4,{children:x4}),c.jsx(g.Typography,{variant:"h2",children:y4}),c.jsx(g.Typography,{variant:"body2",className:"description__agentView",children:b4}),c.jsxs(g.Typography,{variant:"body1",className:"description__agentView",children:[v4,c.jsx("span",{className:"contact__agentView",onClick:t,children:ff})]})]}),c.jsx(Q4,{children:c.jsx("img",{src:T4,alt:"agent-view"})})]})})},O4=g.styled(g.Stack)`
|
|
143
143
|
box-sizing: border-box;
|
|
144
144
|
min-height: 100%;
|
|
145
145
|
padding: 0;
|
|
@@ -147,30 +147,30 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
|
|
|
147
147
|
align-items: center;
|
|
148
148
|
flex-direction: row;
|
|
149
149
|
margin-left: 23px;
|
|
150
|
-
`,
|
|
150
|
+
`,L4=()=>c.jsx(O4,{children:c.jsx(D4,{})}),F4="Enhance with Custom Connectors",N4="Let us know your use case, and we'll design and deliver a custom connector tailored to your needs within a few working days.",PB="Request new connector",R4="Create your own (coming soon)",k4="Request new feature",P4="Request a new connector",MB="Tell us your use case and we will create a connector for you within a few working days.",M4=`Request new connectors to get better customer context and key actions right into your inbox. ${MB}`,j4="Select a feature",V4="Select a connector",G4="Feel free to add specific details (Optional)",H4="Submit Request",W4="Request submitted",z4="Your request has been submitted successfully. We will get back to you within a few working days.",Y4="Done",J4="Add connector",X4="Edit connector",q4="Enable",Z4="Disable",jB={CONNECTOR:"connector",API:"api"},U4="Failed to submit the request. Please try again.",ct={REQUEST_NEW_CLICKED:"request_new_connector_clicked",TOGGLE_ENABLED:"connector_enabled_clicked",TOGGLE_DISABLED:"connector_disabled_clicked",SETTINGS_CLICKED:"connector_settings_clicked",ADD_CONNECTOR_CLICKED:"add_connector_clicked",CONNECTOR_BACK_CLICKED:"connector_back_button_clicked",SAVE_AUTHORIZE_CLICKED:"save_and_authenticate_clicked",SEND_TEST_CLICK:"send_test_request_clicked",AUTH_UPDATED:"auth_type_updated",REQUEST_NEW_FEATURE_CLICKED:"request_new_feature_clicked",REQUEST_NEW_CONNECTOR_SHOWN:"request_new_connector_popup_shown",REQUEST_NEW_CONNECTOR_SUBMIT_CLICKED:"request_new_connector_popup_submitted_clicked",REQUEST_NEW_CONNECTOR_CLOSE_CLICKED:"request_new_connector_popup_closed_clicked",REQUEST_NEW_CONNECTOR_DONE_CLICKED:"request_new_connector_popup_done_clicked",REQUEST_NEW_FEATURE_SHOWN:"request_new_feature_popup_shown",REQUEST_NEW_FEATURE_SUBMIT_CLICKED:"request_new_feature_popup_submitted_clicked",REQUEST_NEW_FEATURE_CLOSE_CLICKED:"request_new_feature_popup_closed_clicked",REQUEST_NEW_FEATURE_DONE_CLICKED:"request_new_feature_popup_done_clicked",LIBRARY_CARD_CLICKED:"library_item_clicked",TAB_CLICKED:"tab_clicked",CONFIGURE_VISIBILITY_CLICKED:"configure_visibility_clicked",CARD_VISIBILITY_UPDATED:"card_visibility_updated",CARD_VISIBILITY_UPDATE_CLOSED:"card_visibility_update_closed",CONNECTOR_VISIBILITY_FIELD_TAB_CLICKED:"connector_visibility_field_tab_clicked",SCHEDULE_CALL_CLICKED:"schedule_call_clicked",SCHEDULE_CALL_CROSS_CLICKED:"schedule_call_cross_clicked",CONNECTOR_VIDEO_CLICKED:"connector_video_clicked",CONNECTOR_AUTH_PAGE_KB_CLICKED:"connector_auth_page_kb_clicked",CONNECTOR_AUTH_PAGE_CONTACT_SUPPORT_CLICKED:"connector_auth_page_contact_support_clicked",CONNECTOR_AUTH_SUCCESS:"connector_auth_success",CONNECTOR_SECTION_VIEWED:"connector_section_viewed"},$4={AUTH_PAGE:"auth_page",DETAILS_PAGE:"details_page",CONNECTORS_PAGE_ADMIN_SIDE:"connectors_page_admin_side"},Mo=FE.withTypes(),At=_E.withTypes(),Sr=g.styled(g.Skeleton)`
|
|
151
151
|
display: block;
|
|
152
152
|
margin: ${e=>e.margin?e.margin:0};
|
|
153
|
-
`,
|
|
153
|
+
`,K4=g.styled("li")`
|
|
154
154
|
width: 252px;
|
|
155
155
|
height: 187px;
|
|
156
156
|
border: 1px solid ${g.theme.palette.gray.gray6};
|
|
157
157
|
border-radius: 8px;
|
|
158
158
|
padding: 24px;
|
|
159
159
|
box-sizing: border-box;
|
|
160
|
-
`,
|
|
160
|
+
`,eS=()=>c.jsx(c.Fragment,{children:Array(4).fill(0).map((e,t)=>c.jsxs(K4,{"data-testid":"connector-library-loading",children:[c.jsx(Sr,{variant:"rounded",width:53,height:43,animation:"wave"}),c.jsx(Sr,{variant:"rectangular",width:180,height:28,animation:"wave",margin:"12px 0px 10px 0px"}),c.jsx(Sr,{variant:"rectangular",width:204,height:40,animation:"wave"})]},t))}),wg=g.styled(g.Typography)`
|
|
161
161
|
line-height: 28px;
|
|
162
162
|
font-size: 16px;
|
|
163
163
|
overflow: hidden;
|
|
164
164
|
text-overflow: ellipsis;
|
|
165
165
|
white-space: nowrap;
|
|
166
|
-
`,
|
|
166
|
+
`,tS=g.styled(g.Box)`
|
|
167
167
|
display: flex;
|
|
168
168
|
flex-wrap: wrap;
|
|
169
169
|
gap: 20px;
|
|
170
170
|
max-width: 796px;
|
|
171
171
|
list-style: none;
|
|
172
172
|
justify-content: flex-start;
|
|
173
|
-
`,
|
|
173
|
+
`,nS=g.styled(g.Box)`
|
|
174
174
|
cursor: pointer;
|
|
175
175
|
width: 252px;
|
|
176
176
|
height: 187px;
|
|
@@ -183,7 +183,7 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
|
|
|
183
183
|
&:hover {
|
|
184
184
|
box-shadow: 0px 2px 4px 0px ${g.theme.palette.gray.gray6};
|
|
185
185
|
}
|
|
186
|
-
`,
|
|
186
|
+
`,rS=g.styled(g.Icon)`
|
|
187
187
|
width: 43px;
|
|
188
188
|
height: 43px;
|
|
189
189
|
border-radius: 5px;
|
|
@@ -193,7 +193,7 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
|
|
|
193
193
|
width: 100%;
|
|
194
194
|
height: 100%;
|
|
195
195
|
}
|
|
196
|
-
`,
|
|
196
|
+
`,oS=g.styled(g.Typography)`
|
|
197
197
|
margin-top: 4px;
|
|
198
198
|
width: 204px;
|
|
199
199
|
height: 40px;
|
|
@@ -202,35 +202,35 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
|
|
|
202
202
|
-webkit-box-orient: vertical;
|
|
203
203
|
overflow: hidden;
|
|
204
204
|
text-overflow: ellipsis;
|
|
205
|
-
`,
|
|
205
|
+
`,AS="Visibility not set",VB="Configure visibility settings",sS="Contact your admin to configure visibility",aS="Select inbox(es)",iS="Select the inbox(es)",lS="Select the role",cS="Select role",GB="inbox",uS="roles",gS="Close",dS="Configure Visibility",CS="Set card visibility across shared mailboxes and roles to enable the connector",HB="conn_visibility_popover",ES="useSingletonContext must be used within a SingletonProvider",fS="${{connector}}",IS="Visibility settings saved",BS="Some error occured. Please contact support@hiverhq.com",pS="Selecting any lower role will automatically select the roles above it",hS="Loading custom fields...",QS="Save",WB="enabled",zB="disabled",mS="Select atleast one field to save",Tg="New",yS="Upgrade now",bS="Authentication failed",xS="More info about the current updates that will be there in this connector",vS=g.styled(g.Box)`
|
|
206
206
|
min-height: 506px;
|
|
207
207
|
width: 462px;
|
|
208
208
|
padding: 32px;
|
|
209
209
|
box-sizing: border-box;
|
|
210
|
-
`,
|
|
210
|
+
`,wS=g.styled(g.Typography)`
|
|
211
211
|
display: flex;
|
|
212
212
|
align-items: center;
|
|
213
213
|
margin-bottom: 16px;
|
|
214
|
-
`,
|
|
214
|
+
`,TS=g.styled(g.Typography)`
|
|
215
215
|
letter-spacing: 0.5px;
|
|
216
|
-
`,
|
|
216
|
+
`,SS=g.styled(g.Stack)`
|
|
217
217
|
flex-direction: row;
|
|
218
218
|
gap: 12px;
|
|
219
219
|
justify-content: end;
|
|
220
220
|
align-items: center;
|
|
221
221
|
flex-grow: 1;
|
|
222
222
|
align-items: end;
|
|
223
|
-
`,
|
|
223
|
+
`,_S=g.styled(g.CircularProgress)`
|
|
224
224
|
color: ${g.palette.gray.white};
|
|
225
|
-
`,
|
|
225
|
+
`,DS=g.styled(g.Stack)`
|
|
226
226
|
flex-direction: column;
|
|
227
227
|
height: 100%;
|
|
228
|
-
`,
|
|
228
|
+
`,OS=g.styled(g.Button)`
|
|
229
229
|
height: 32px;
|
|
230
230
|
font-size: 13px;
|
|
231
|
-
`,
|
|
231
|
+
`,LS=g.styled(g.Button)`
|
|
232
232
|
height: 32px;
|
|
233
|
-
`,
|
|
233
|
+
`,FS=g.styled(g.Stack)`
|
|
234
234
|
flex-direction: row;
|
|
235
235
|
align-items: center;
|
|
236
236
|
gap: 11px;
|
|
@@ -242,10 +242,10 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
|
|
|
242
242
|
height: 20px;
|
|
243
243
|
background: linear-gradient(to right, #ffe250, #ffc350);
|
|
244
244
|
color: ${g.palette.gray.gray1};
|
|
245
|
-
`,
|
|
245
|
+
`,NS=()=>{const{availableFeatures:e,sendTrackingEvent:t}=m.useContext(on),n=cn(),r=Mo(),o=At(yI),A=At(Xu),s=At(lw);m.useEffect(()=>{r(ol())},[r]);const a=(i,l)=>{var d;i==null||i.stopPropagation();const u=(d=A==null?void 0:A[l])==null?void 0:d.name;t(ct.LIBRARY_CARD_CLICKED,{connector_name:u}),n(`${et.BASEPATH}${et.API_VIEW}/${l}`)};return c.jsx(tS,{"data-testid":"connector-library",component:"ul",children:s===Se.LOADING?c.jsx(eS,{}):c.jsx(c.Fragment,{children:o.map(i=>{const l=A==null?void 0:A[i];if(!l)return null;const{isTemplateNew:u}=l,d=ca(e)&&u;return c.jsxs(nS,{onClick:f=>a(f,i),component:"li",children:[c.jsxs(g.Stack,{direction:"row",justifyContent:"space-between",children:[c.jsx(rS,{children:c.jsx("img",{src:l.logo??"",alt:l.name})}),c.jsx(Sa,{hidden:!d,label:Tg})]}),c.jsx(wg,{variant:"h2",children:l.name}),c.jsx(oS,{variant:"body1",color:"rgba(108, 123, 148, 1)",children:l.description})]},i)})})})},RS=g.styled(g.Icon)`
|
|
246
246
|
width: 203px;
|
|
247
247
|
height: 161px;
|
|
248
|
-
`,
|
|
248
|
+
`,kS=g.styled(g.Stack)`
|
|
249
249
|
padding: 18px 30px;
|
|
250
250
|
box-sizing: border-box;
|
|
251
251
|
width: 873px;
|
|
@@ -253,26 +253,26 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
|
|
|
253
253
|
border-radius: 12px;
|
|
254
254
|
box-shadow: 0 0 10px 0 rgba(239, 241, 244, 1);
|
|
255
255
|
margin-bottom: 32px;
|
|
256
|
-
`,
|
|
256
|
+
`,PS=g.styled(g.Box)`
|
|
257
257
|
padding: 12.3px 0 12.3px 0;
|
|
258
258
|
box-sizing: border-box;
|
|
259
259
|
width: 531px;
|
|
260
260
|
height: 136px;
|
|
261
|
-
`,
|
|
261
|
+
`,MS=g.styled(g.Typography)`
|
|
262
262
|
font-size: 18px;
|
|
263
263
|
line-height: 32px;
|
|
264
|
-
`,
|
|
264
|
+
`,jS=g.styled(g.Typography)`
|
|
265
265
|
font-size: 14px;
|
|
266
266
|
line-height: 20px;
|
|
267
267
|
margin-top: 4px;
|
|
268
268
|
margin-bottom: 24px;
|
|
269
|
-
`,
|
|
269
|
+
`,VS=g.styled(g.Stack)`
|
|
270
270
|
width: 466px;
|
|
271
271
|
height: 36px;
|
|
272
272
|
& .create-own__btn {
|
|
273
273
|
pointer-events: none;
|
|
274
274
|
}
|
|
275
|
-
`,
|
|
275
|
+
`,GS=g.styled(g.Button)`
|
|
276
276
|
height: 36px;
|
|
277
277
|
width: 201px;
|
|
278
278
|
text-transform: none;
|
|
@@ -286,14 +286,14 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
|
|
|
286
286
|
color: ${g.theme.palette.purple.primary} !important;
|
|
287
287
|
border: 1px solid ${g.theme.palette.purple.primary} !important;
|
|
288
288
|
}
|
|
289
|
-
`,
|
|
289
|
+
`,HS=g.styled(g.Button)`
|
|
290
290
|
width: 253px;
|
|
291
291
|
height: 36px;
|
|
292
292
|
text-transform: none;
|
|
293
293
|
box-shadow: none;
|
|
294
294
|
color: ${g.theme.palette.gray.black};
|
|
295
295
|
border: 1px solid ${g.theme.palette.gray.gray5};
|
|
296
|
-
`,
|
|
296
|
+
`,WS=({setModalState:e})=>{const t=n=>{n==null||n.stopPropagation(),e(!0)};return c.jsxs(kS,{direction:"row",justifyContent:"space-between","data-testid":"connector-not-available-request-new",children:[c.jsxs(PS,{children:[c.jsx(MS,{variant:"h1",color:g.theme.palette.gray.black,children:F4}),c.jsx(jS,{variant:"body1",color:g.theme.palette.gray.gray2,children:N4}),c.jsxs(VS,{direction:"row",justifyContent:"space-between",children:[c.jsx(GS,{variant:"contained",onClick:t,children:PB}),c.jsx(HS,{variant:"outlined",className:"create-own__btn",children:R4})]})]}),c.jsx(RS,{children:c.jsx("img",{src:w4})})]})},Sg=m.createContext({hasRendered:!1,setHasRendered:()=>{}}),JB=m.memo(({children:e})=>{const[t,n]=m.useState(!1),r=m.useMemo(()=>({hasRendered:t,setHasRendered:n}),[t,n]);return c.jsx(Sg.Provider,{value:r,children:e})});JB.displayName="SingletonProvider";const XB=e=>e.connectorLirary.connectorList,Ol=e=>e.connectorLirary.connectors,qB=e=>e.connectorLirary.connectorsApiStatus,zS=e=>e.connectorLirary.currentUpdatingConnectors,_g=e=>e.connectorLirary.connectorDetailApiStatus,ZB=e=>e.connectorLirary.emailInboxDetails,UB=e=>e.connectorLirary.rolesAndPermissions,YS=e=>e.connectorLirary.updateEnableConnectorsApiStatus,JS=e=>e.connectorLirary.cardCustomFields,XS=e=>e.connectorLirary.cardCustomFieldsApiStatus,qS=g.styled(g.Box)`
|
|
297
297
|
border-radius: 4px;
|
|
298
298
|
border: 1px solid ${g.theme.palette.gray.gray5};
|
|
299
299
|
margin-bottom: 12px;
|
|
@@ -304,7 +304,7 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
|
|
|
304
304
|
& .MuiSwitch-root {
|
|
305
305
|
padding: 12px;
|
|
306
306
|
}
|
|
307
|
-
`,
|
|
307
|
+
`,ZS=g.styled(g.Box)`
|
|
308
308
|
box-sizing: border-box;
|
|
309
309
|
|
|
310
310
|
&.connector-grid,
|
|
@@ -354,15 +354,15 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
|
|
|
354
354
|
cursor: pointer;
|
|
355
355
|
padding: 5px;
|
|
356
356
|
}
|
|
357
|
-
`,
|
|
357
|
+
`,US=g.styled(g.Typography)`
|
|
358
358
|
height: 100%;
|
|
359
359
|
display: flex;
|
|
360
360
|
align-items: center;
|
|
361
|
-
`,$
|
|
361
|
+
`,$S=g.styled(g.Stack)`
|
|
362
362
|
gap: 10px;
|
|
363
363
|
align-items: center;
|
|
364
364
|
flex-direction: row;
|
|
365
|
-
`,
|
|
365
|
+
`,KS=g.styled(g.Stack)`
|
|
366
366
|
flex-direction: row;
|
|
367
367
|
align-items: center;
|
|
368
368
|
justify-content: center;
|
|
@@ -455,7 +455,7 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
|
|
|
455
455
|
`,b5=g.styled(g.Typography)`
|
|
456
456
|
margin-top: 9px;
|
|
457
457
|
color: ${g.theme.palette.gray.gray3};
|
|
458
|
-
`,x5="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3297_163628)'%3e%3cpath%20d='M9.99967%205.41667C13.158%205.41667%2015.9747%207.19167%2017.3497%2010C15.9747%2012.8083%2013.1663%2014.5833%209.99967%2014.5833C6.83301%2014.5833%204.02467%2012.8083%202.64967%2010C4.02467%207.19167%206.84134%205.41667%209.99967%205.41667ZM9.99967%203.75C5.83301%203.75%202.27467%206.34167%200.833008%2010C2.27467%2013.6583%205.83301%2016.25%209.99967%2016.25C14.1663%2016.25%2017.7247%2013.6583%2019.1663%2010C17.7247%206.34167%2014.1663%203.75%209.99967%203.75ZM9.99967%207.91667C11.1497%207.91667%2012.083%208.85%2012.083%2010C12.083%2011.15%2011.1497%2012.0833%209.99967%2012.0833C8.84967%2012.0833%207.91634%2011.15%207.91634%2010C7.91634%208.85%208.84967%207.91667%209.99967%207.91667ZM9.99967%206.25C7.93301%206.25%206.24967%207.93333%206.24967%2010C6.24967%2012.0667%207.93301%2013.75%209.99967%2013.75C12.0663%2013.75%2013.7497%2012.0667%2013.7497%2010C13.7497%207.93333%2012.0663%206.25%209.99967%206.25Z'%20fill='%233E4C5A'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_3297_163628'%3e%3crect%20width='20'%20height='20'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",v5=()=>c.jsxs(m5,{children:[c.jsxs(g.Stack,{direction:"row",alignItems:"center",gap:1,children:[c.jsx(y5,{direction:"row",alignItems:"center",justifyContent:"center",children:c.jsx("img",{src:x5,alt:"visibility"})}),c.jsx(g.Typography,{variant:"h2",children:d4})]}),c.jsx(b5,{children:C4})]});function w5(){const e=m.useContext(Sg);if(!e)throw new Error(E4);return e}const T5=g.styled(({className:e,...t})=>c.jsx(g.Tooltip,{...t,classes:{popper:e}}))(()=>({[`& .${g.tooltipClasses.arrow}`]:{color:"#fff !important"},[`& .${g.tooltipClasses.tooltip}`]:{backgroundColor:"#fff",maxWidth:"326px",height:"117px",width:"326px",borderRadius:"6px",boxShadow:"0px 2px 10px 0px #00000026"}})),S5=e=>{const{hasRendered:t,setHasRendered:n}=w5(),[r,o]=m.useState(!1),A=m.useCallback(s=>{s.target.closest(`.${g.tooltipClasses.tooltip}`)||o(!1)},[]);return m.useEffect(()=>{if(r)return document.addEventListener("click",A),()=>document.removeEventListener("click",A)},[r,A]),m.useEffect(()=>{try{!(localStorage.getItem(HB)==="true")&&!t&&(localStorage.setItem(HB,"true"),n(!0),o(!0))}catch{o(!1)}},[t,n]),c.jsx(T5,{arrow:!0,open:r,slotProps:{popper:{sx:{[`&.${g.tooltipClasses.popper}[data-popper-placement*="left"] .${g.tooltipClasses.tooltip}`]:{marginRight:"5px"}}}},title:c.jsx(v5,{}),placement:"left",...e})},_5=({children:e})=>{const{hasRendered:t,setHasRendered:n}=m.useContext(Sg),[r]=m.useState(()=>!t);return m.useEffect(()=>{r&&n(!0)},[r,n]),r?c.jsx(S5,{children:e}):c.jsx(c.Fragment,{children:e})},D5=e=>_.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},_.createElement("g",{clipPath:"url(#clip0_3297_163628)"},_.createElement("path",{d:"M9.99967 5.41667C13.158 5.41667 15.9747 7.19167 17.3497 10C15.9747 12.8083 13.1663 14.5833 9.99967 14.5833C6.83301 14.5833 4.02467 12.8083 2.64967 10C4.02467 7.19167 6.84134 5.41667 9.99967 5.41667ZM9.99967 3.75C5.83301 3.75 2.27467 6.34167 0.833008 10C2.27467 13.6583 5.83301 16.25 9.99967 16.25C14.1663 16.25 17.7247 13.6583 19.1663 10C17.7247 6.34167 14.1663 3.75 9.99967 3.75ZM9.99967 7.91667C11.1497 7.91667 12.083 8.85 12.083 10C12.083 11.15 11.1497 12.0833 9.99967 12.0833C8.84967 12.0833 7.91634 11.15 7.91634 10C7.91634 8.85 8.84967 7.91667 9.99967 7.91667ZM9.99967 6.25C7.93301 6.25 6.24967 7.93333 6.24967 10C6.24967 12.0667 7.93301 13.75 9.99967 13.75C12.0663 13.75 13.7497 12.0667 13.7497 10C13.7497 7.93333 12.0663 6.25 9.99967 6.25Z",fill:"#3E4C5A"})),_.createElement("defs",null,_.createElement("clipPath",{id:"clip0_3297_163628"},_.createElement("rect",{width:20,height:20,fill:"white"})))),O5=e=>_.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},_.createElement("mask",{id:"mask0_3354_177768",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:20,height:20},_.createElement("rect",{width:20,height:20,fill:"#D9D9D9"})),_.createElement("g",{mask:"url(#mask0_3354_177768)"},_.createElement("path",{d:"M13.2708 11.1462L11.9792 9.85449C12.0347 9.32671 11.875 8.87185 11.5 8.48991C11.125 8.10796 10.6736 7.94477 10.1458 8.00033L8.85417 6.70866C9.03472 6.63921 9.22222 6.58713 9.41667 6.55241C9.61111 6.51769 9.80556 6.50033 10 6.50033C10.9722 6.50033 11.7986 6.8406 12.4792 7.52116C13.1597 8.20171 13.5 9.0281 13.5 10.0003C13.5 10.1948 13.4826 10.3892 13.4479 10.5837C13.4132 10.7781 13.3542 10.9656 13.2708 11.1462ZM16.0417 13.917L14.9583 12.8337C15.4583 12.4448 15.9132 12.0177 16.3229 11.5524C16.7326 11.0871 17.0764 10.5698 17.3542 10.0003C16.6736 8.59755 15.6701 7.49685 14.3438 6.69824C13.0174 5.89963 11.5694 5.50033 10 5.50033C9.63889 5.50033 9.28472 5.52116 8.9375 5.56283C8.59028 5.60449 8.25 5.67394 7.91667 5.77116L6.70833 4.56283C7.23611 4.35449 7.77431 4.20866 8.32292 4.12533C8.87153 4.04199 9.43056 4.00033 10 4.00033C11.9861 4.00033 13.8021 4.53852 15.4479 5.61491C17.0938 6.6913 18.2778 8.1531 19 10.0003C18.6944 10.792 18.2882 11.5107 17.7812 12.1566C17.2743 12.8024 16.6944 13.3892 16.0417 13.917ZM16 18.1253L13.2917 15.417C12.7639 15.6114 12.2257 15.7573 11.6771 15.8545C11.1285 15.9517 10.5694 16.0003 10 16.0003C8.01389 16.0003 6.19792 15.4621 4.55208 14.3857C2.90625 13.3094 1.72222 11.8475 1 10.0003C1.30556 9.20866 1.70833 8.48644 2.20833 7.83366C2.70833 7.18088 3.29167 6.5906 3.95833 6.06283L1.875 3.97949L2.9375 2.91699L17.0625 17.0628L16 18.1253ZM5.02083 7.14616C4.53472 7.53505 4.08333 7.96213 3.66667 8.42741C3.25 8.89269 2.90972 9.41699 2.64583 10.0003C3.32639 11.4031 4.32986 12.5038 5.65625 13.3024C6.98264 14.101 8.43056 14.5003 10 14.5003C10.3611 14.5003 10.7153 14.476 11.0625 14.4274C11.4097 14.3788 11.7569 14.3128 12.1042 14.2295L11.1667 13.292C10.9722 13.3614 10.7778 13.4135 10.5833 13.4482C10.3889 13.483 10.1944 13.5003 10 13.5003C9.02778 13.5003 8.20139 13.16 7.52083 12.4795C6.84028 11.7989 6.5 10.9725 6.5 10.0003C6.5 9.80588 6.52431 9.61144 6.57292 9.41699C6.62153 9.22255 6.66667 9.0281 6.70833 8.83366L5.02083 7.14616Z",fill:"#6F7C90"})));function L5(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return m.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const Fl=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ts(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Og(e){return"nodeType"in e}function Gn(e){var t,n;return e?ts(e)?e:Og(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Lg(e){const{Document:t}=Gn(e);return e instanceof t}function _a(e){return ts(e)?!1:e instanceof Gn(e).HTMLElement}function ep(e){return e instanceof Gn(e).SVGElement}function ns(e){return e?ts(e)?e.document:Og(e)?Lg(e)?e:_a(e)||ep(e)?e.ownerDocument:document:document:document}const Gr=Fl?m.useLayoutEffect:m.useEffect;function Fg(e){const t=m.useRef(e);return Gr(()=>{t.current=e}),m.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function F5(){const e=m.useRef(null),t=m.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=m.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Da(e,t){t===void 0&&(t=[e]);const n=m.useRef(e);return Gr(()=>{n.current!==e&&(n.current=e)},t),n}function Oa(e,t){const n=m.useRef();return m.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Nl(e){const t=Fg(e),n=m.useRef(null),r=m.useCallback(o=>{o!==n.current&&(t==null||t(o,n.current)),n.current=o},[]);return[n,r]}function Ng(e){const t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}let Rg={};function La(e,t){return m.useMemo(()=>{if(t)return t;const n=Rg[e]==null?0:Rg[e]+1;return Rg[e]=n,e+"-"+n},[e,t])}function tp(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((A,s)=>{const a=Object.entries(s);for(const[i,l]of a){const u=A[i];u!=null&&(A[i]=u+e*l)}return A},{...t})}}const rs=tp(1),Rl=tp(-1);function N5(e){return"clientX"in e&&"clientY"in e}function kg(e){if(!e)return!1;const{KeyboardEvent:t}=Gn(e.target);return t&&e instanceof t}function R5(e){if(!e)return!1;const{TouchEvent:t}=Gn(e.target);return t&&e instanceof t}function Pg(e){if(R5(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return N5(e)?{x:e.clientX,y:e.clientY}:null}const BA=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[BA.Translate.toString(e),BA.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),np="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function k5(e){return e.matches(np)?e:e.querySelector(np)}const P5={display:"none"};function M5(e){let{id:t,value:n}=e;return m.createElement("div",{id:t,style:P5},n)}function j5(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return m.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function V5(){const[e,t]=m.useState("");return{announce:m.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const rp=m.createContext(null);function G5(e){const t=m.useContext(rp);m.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function H5(){const[e]=m.useState(()=>new Set),t=m.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[m.useCallback(r=>{let{type:o,event:A}=r;e.forEach(s=>{var a;return(a=s[o])==null?void 0:a.call(s,A)})},[e]),t]}const W5={draggable:`
|
|
458
|
+
`,x5="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3297_163628)'%3e%3cpath%20d='M9.99967%205.41667C13.158%205.41667%2015.9747%207.19167%2017.3497%2010C15.9747%2012.8083%2013.1663%2014.5833%209.99967%2014.5833C6.83301%2014.5833%204.02467%2012.8083%202.64967%2010C4.02467%207.19167%206.84134%205.41667%209.99967%205.41667ZM9.99967%203.75C5.83301%203.75%202.27467%206.34167%200.833008%2010C2.27467%2013.6583%205.83301%2016.25%209.99967%2016.25C14.1663%2016.25%2017.7247%2013.6583%2019.1663%2010C17.7247%206.34167%2014.1663%203.75%209.99967%203.75ZM9.99967%207.91667C11.1497%207.91667%2012.083%208.85%2012.083%2010C12.083%2011.15%2011.1497%2012.0833%209.99967%2012.0833C8.84967%2012.0833%207.91634%2011.15%207.91634%2010C7.91634%208.85%208.84967%207.91667%209.99967%207.91667ZM9.99967%206.25C7.93301%206.25%206.24967%207.93333%206.24967%2010C6.24967%2012.0667%207.93301%2013.75%209.99967%2013.75C12.0663%2013.75%2013.7497%2012.0667%2013.7497%2010C13.7497%207.93333%2012.0663%206.25%209.99967%206.25Z'%20fill='%233E4C5A'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_3297_163628'%3e%3crect%20width='20'%20height='20'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",v5=()=>c.jsxs(m5,{children:[c.jsxs(g.Stack,{direction:"row",alignItems:"center",gap:1,children:[c.jsx(y5,{direction:"row",alignItems:"center",justifyContent:"center",children:c.jsx("img",{src:x5,alt:"visibility"})}),c.jsx(g.Typography,{variant:"h2",children:dS})]}),c.jsx(b5,{children:CS})]});function w5(){const e=m.useContext(Sg);if(!e)throw new Error(ES);return e}const T5=g.styled(({className:e,...t})=>c.jsx(g.Tooltip,{...t,classes:{popper:e}}))(()=>({[`& .${g.tooltipClasses.arrow}`]:{color:"#fff !important"},[`& .${g.tooltipClasses.tooltip}`]:{backgroundColor:"#fff",maxWidth:"326px",height:"117px",width:"326px",borderRadius:"6px",boxShadow:"0px 2px 10px 0px #00000026"}})),S5=e=>{const{hasRendered:t,setHasRendered:n}=w5(),[r,o]=m.useState(!1),A=m.useCallback(s=>{s.target.closest(`.${g.tooltipClasses.tooltip}`)||o(!1)},[]);return m.useEffect(()=>{if(r)return document.addEventListener("click",A),()=>document.removeEventListener("click",A)},[r,A]),m.useEffect(()=>{try{!(localStorage.getItem(HB)==="true")&&!t&&(localStorage.setItem(HB,"true"),n(!0),o(!0))}catch{o(!1)}},[t,n]),c.jsx(T5,{arrow:!0,open:r,slotProps:{popper:{sx:{[`&.${g.tooltipClasses.popper}[data-popper-placement*="left"] .${g.tooltipClasses.tooltip}`]:{marginRight:"5px"}}}},title:c.jsx(v5,{}),placement:"left",...e})},_5=({children:e})=>{const{hasRendered:t,setHasRendered:n}=m.useContext(Sg),[r]=m.useState(()=>!t);return m.useEffect(()=>{r&&n(!0)},[r,n]),r?c.jsx(S5,{children:e}):c.jsx(c.Fragment,{children:e})},D5=e=>_.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},_.createElement("g",{clipPath:"url(#clip0_3297_163628)"},_.createElement("path",{d:"M9.99967 5.41667C13.158 5.41667 15.9747 7.19167 17.3497 10C15.9747 12.8083 13.1663 14.5833 9.99967 14.5833C6.83301 14.5833 4.02467 12.8083 2.64967 10C4.02467 7.19167 6.84134 5.41667 9.99967 5.41667ZM9.99967 3.75C5.83301 3.75 2.27467 6.34167 0.833008 10C2.27467 13.6583 5.83301 16.25 9.99967 16.25C14.1663 16.25 17.7247 13.6583 19.1663 10C17.7247 6.34167 14.1663 3.75 9.99967 3.75ZM9.99967 7.91667C11.1497 7.91667 12.083 8.85 12.083 10C12.083 11.15 11.1497 12.0833 9.99967 12.0833C8.84967 12.0833 7.91634 11.15 7.91634 10C7.91634 8.85 8.84967 7.91667 9.99967 7.91667ZM9.99967 6.25C7.93301 6.25 6.24967 7.93333 6.24967 10C6.24967 12.0667 7.93301 13.75 9.99967 13.75C12.0663 13.75 13.7497 12.0667 13.7497 10C13.7497 7.93333 12.0663 6.25 9.99967 6.25Z",fill:"#3E4C5A"})),_.createElement("defs",null,_.createElement("clipPath",{id:"clip0_3297_163628"},_.createElement("rect",{width:20,height:20,fill:"white"})))),O5=e=>_.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},_.createElement("mask",{id:"mask0_3354_177768",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:20,height:20},_.createElement("rect",{width:20,height:20,fill:"#D9D9D9"})),_.createElement("g",{mask:"url(#mask0_3354_177768)"},_.createElement("path",{d:"M13.2708 11.1462L11.9792 9.85449C12.0347 9.32671 11.875 8.87185 11.5 8.48991C11.125 8.10796 10.6736 7.94477 10.1458 8.00033L8.85417 6.70866C9.03472 6.63921 9.22222 6.58713 9.41667 6.55241C9.61111 6.51769 9.80556 6.50033 10 6.50033C10.9722 6.50033 11.7986 6.8406 12.4792 7.52116C13.1597 8.20171 13.5 9.0281 13.5 10.0003C13.5 10.1948 13.4826 10.3892 13.4479 10.5837C13.4132 10.7781 13.3542 10.9656 13.2708 11.1462ZM16.0417 13.917L14.9583 12.8337C15.4583 12.4448 15.9132 12.0177 16.3229 11.5524C16.7326 11.0871 17.0764 10.5698 17.3542 10.0003C16.6736 8.59755 15.6701 7.49685 14.3438 6.69824C13.0174 5.89963 11.5694 5.50033 10 5.50033C9.63889 5.50033 9.28472 5.52116 8.9375 5.56283C8.59028 5.60449 8.25 5.67394 7.91667 5.77116L6.70833 4.56283C7.23611 4.35449 7.77431 4.20866 8.32292 4.12533C8.87153 4.04199 9.43056 4.00033 10 4.00033C11.9861 4.00033 13.8021 4.53852 15.4479 5.61491C17.0938 6.6913 18.2778 8.1531 19 10.0003C18.6944 10.792 18.2882 11.5107 17.7812 12.1566C17.2743 12.8024 16.6944 13.3892 16.0417 13.917ZM16 18.1253L13.2917 15.417C12.7639 15.6114 12.2257 15.7573 11.6771 15.8545C11.1285 15.9517 10.5694 16.0003 10 16.0003C8.01389 16.0003 6.19792 15.4621 4.55208 14.3857C2.90625 13.3094 1.72222 11.8475 1 10.0003C1.30556 9.20866 1.70833 8.48644 2.20833 7.83366C2.70833 7.18088 3.29167 6.5906 3.95833 6.06283L1.875 3.97949L2.9375 2.91699L17.0625 17.0628L16 18.1253ZM5.02083 7.14616C4.53472 7.53505 4.08333 7.96213 3.66667 8.42741C3.25 8.89269 2.90972 9.41699 2.64583 10.0003C3.32639 11.4031 4.32986 12.5038 5.65625 13.3024C6.98264 14.101 8.43056 14.5003 10 14.5003C10.3611 14.5003 10.7153 14.476 11.0625 14.4274C11.4097 14.3788 11.7569 14.3128 12.1042 14.2295L11.1667 13.292C10.9722 13.3614 10.7778 13.4135 10.5833 13.4482C10.3889 13.483 10.1944 13.5003 10 13.5003C9.02778 13.5003 8.20139 13.16 7.52083 12.4795C6.84028 11.7989 6.5 10.9725 6.5 10.0003C6.5 9.80588 6.52431 9.61144 6.57292 9.41699C6.62153 9.22255 6.66667 9.0281 6.70833 8.83366L5.02083 7.14616Z",fill:"#6F7C90"})));function L5(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return m.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const Fl=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ts(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Og(e){return"nodeType"in e}function Gn(e){var t,n;return e?ts(e)?e:Og(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Lg(e){const{Document:t}=Gn(e);return e instanceof t}function _a(e){return ts(e)?!1:e instanceof Gn(e).HTMLElement}function ep(e){return e instanceof Gn(e).SVGElement}function ns(e){return e?ts(e)?e.document:Og(e)?Lg(e)?e:_a(e)||ep(e)?e.ownerDocument:document:document:document}const Gr=Fl?m.useLayoutEffect:m.useEffect;function Fg(e){const t=m.useRef(e);return Gr(()=>{t.current=e}),m.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function F5(){const e=m.useRef(null),t=m.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=m.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Da(e,t){t===void 0&&(t=[e]);const n=m.useRef(e);return Gr(()=>{n.current!==e&&(n.current=e)},t),n}function Oa(e,t){const n=m.useRef();return m.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Nl(e){const t=Fg(e),n=m.useRef(null),r=m.useCallback(o=>{o!==n.current&&(t==null||t(o,n.current)),n.current=o},[]);return[n,r]}function Ng(e){const t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}let Rg={};function La(e,t){return m.useMemo(()=>{if(t)return t;const n=Rg[e]==null?0:Rg[e]+1;return Rg[e]=n,e+"-"+n},[e,t])}function tp(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((A,s)=>{const a=Object.entries(s);for(const[i,l]of a){const u=A[i];u!=null&&(A[i]=u+e*l)}return A},{...t})}}const rs=tp(1),Rl=tp(-1);function N5(e){return"clientX"in e&&"clientY"in e}function kg(e){if(!e)return!1;const{KeyboardEvent:t}=Gn(e.target);return t&&e instanceof t}function R5(e){if(!e)return!1;const{TouchEvent:t}=Gn(e.target);return t&&e instanceof t}function Pg(e){if(R5(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return N5(e)?{x:e.clientX,y:e.clientY}:null}const BA=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[BA.Translate.toString(e),BA.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),np="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function k5(e){return e.matches(np)?e:e.querySelector(np)}const P5={display:"none"};function M5(e){let{id:t,value:n}=e;return m.createElement("div",{id:t,style:P5},n)}function j5(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return m.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function V5(){const[e,t]=m.useState("");return{announce:m.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const rp=m.createContext(null);function G5(e){const t=m.useContext(rp);m.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function H5(){const[e]=m.useState(()=>new Set),t=m.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[m.useCallback(r=>{let{type:o,event:A}=r;e.forEach(s=>{var a;return(a=s[o])==null?void 0:a.call(s,A)})},[e]),t]}const W5={draggable:`
|
|
459
459
|
To pick up a draggable item, press the space bar.
|
|
460
460
|
While dragging, use the arrow keys to move the item.
|
|
461
461
|
Press space again to drop the item in its new position, or press escape to cancel.
|
|
@@ -491,7 +491,7 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
|
|
|
491
491
|
background-color: #97a3b7;
|
|
492
492
|
}
|
|
493
493
|
}
|
|
494
|
-
`,E6="data:image/svg+xml,%3csvg%20width='20'%20height='21'%20viewBox='0%200%2020%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cellipse%20cx='7.48148'%20cy='4.94'%20rx='1.48148'%20ry='1.44'%20fill='%23828EA5'/%3e%3cellipse%20cx='7.48148'%20cy='10.7'%20rx='1.48148'%20ry='1.44'%20fill='%23828EA5'/%3e%3cellipse%20cx='7.48148'%20cy='16.46'%20rx='1.48148'%20ry='1.44'%20fill='%23828EA5'/%3e%3cellipse%20cx='12.42'%20cy='4.94'%20rx='1.48148'%20ry='1.44'%20fill='%23828EA5'/%3e%3cellipse%20cx='12.42'%20cy='10.7'%20rx='1.48148'%20ry='1.44'%20fill='%23828EA5'/%3e%3cellipse%20cx='12.42'%20cy='16.46'%20rx='1.48148'%20ry='1.44'%20fill='%23828EA5'/%3e%3c/svg%3e",f6=({field:e,toggleSelected:t,hideNewChip:n})=>{const{availableFeatures:r}=m.useContext(on),{key:o,label:A,enabled:s,isFieldNew:a}=e,{attributes:i,listeners:l,setNodeRef:u,transform:d,transition:f}=$g({id:o}),p=m.useRef(null),[I,C]=m.useState(!1),E=ca(r)&&a&&!n,h={transform:BA.Transform.toString(d),transition:f};return m.useEffect(()=>{const B=p.current;B&&C(B.scrollWidth>B.clientWidth||B.scrollHeight>B.clientHeight)},[A]),c.jsxs(d6,{ref:u,style:h,...i,children:[c.jsx("img",{className:"field-drag-handle",...l,src:E6}),c.jsx(g.Checkbox,{checked:s,onChange:()=>t(o),sx:{marginLeft:"-6px"}}),c.jsx(g.Tooltip,{title:A,disableHoverListener:!I,children:c.jsxs(g.Stack,{direction:"row",gap:"5px",alignItems:"center",children:[c.jsx(g.Typography,{ref:p,variant:"body2",maxWidth:"325px",noWrap:!0,children:A}),E?c.jsx(Sa,{label:Tg}):null]})})]})},I6=e=>({[e]:{isExtensionNew:[],sidePanel:[],cards:{},fieldVisibility:{cards:{}}}}),As=()=>{try{return JSON.parse(localStorage.getItem(la)||"{}")}catch{return{}}},ss=()=>{const e=As();return Object.keys(e)[0]},Fp=e=>{var t;return(t=As())==null?void 0:t[e]},B6=e=>{if(!e)return;const t=As(),n=ss();(Object.keys(t).length===0||n!=e)&&localStorage.setItem(la,JSON.stringify(I6(e)))},p6=(e,t)=>{var s,a,i,l,u,d;if(!e||!t)return;const n=ss()??"";if(!n)return;const r=As(),o=r[n],A={...r,[n]:{...o,fieldVisibility:{cards:{...(s=o==null?void 0:o.fieldVisibility)==null?void 0:s.cards,[e]:[...((i=(a=o==null?void 0:o.fieldVisibility)==null?void 0:a.cards)==null?void 0:i[e])||[],...(d=(u=(l=o==null?void 0:o.fieldVisibility)==null?void 0:l.cards)==null?void 0:u[e])!=null&&d.includes(t)?[]:[t]]}}}};localStorage.setItem(la,JSON.stringify(A))},Kg=(e,t)=>{var o,A;const n=ss();if(!n||!e||!t)return!1;const r=Fp(n);return!!((A=(o=r==null?void 0:r.fieldVisibility)==null?void 0:o.cards[e])!=null&&A.includes(t))},h6=(e,t)=>{var s,a,i;if(!e||!t)return;const n=ss()??"";if(!n)return;const r=As(),o=r[n],A={...r,[n]:{...o,cards:{...o==null?void 0:o.cards,[e]:[...((s=o==null?void 0:o.cards)==null?void 0:s[e])||[],...(i=(a=o==null?void 0:o.cards)==null?void 0:a[e])!=null&&i.includes(t)?[]:[t]]}}};localStorage.setItem(la,JSON.stringify(A))},Q6=(e,t)=>{var o;const n=ss();if(!n||!e||!t)return!1;const r=Fp(n);return!!((o=r==null?void 0:r.cards[e])!=null&&o.includes(t))},m6=e=>{var A;if(!e)return;const t=As(),n=ss();if(!n)return;const r=t[n],o={[n]:{...r,sidePanel:[...(r==null?void 0:r.sidePanel)||[],...(A=r==null?void 0:r.sidePanel)!=null&&A.includes(e)?[]:[e]]}};localStorage.setItem(la,JSON.stringify(o))},y6=({fields:e,setFields:t,cardId:n})=>{const r=Ap(op(Pl)),{userId:o}=yr()||{},A=At(
|
|
494
|
+
`,E6="data:image/svg+xml,%3csvg%20width='20'%20height='21'%20viewBox='0%200%2020%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cellipse%20cx='7.48148'%20cy='4.94'%20rx='1.48148'%20ry='1.44'%20fill='%23828EA5'/%3e%3cellipse%20cx='7.48148'%20cy='10.7'%20rx='1.48148'%20ry='1.44'%20fill='%23828EA5'/%3e%3cellipse%20cx='7.48148'%20cy='16.46'%20rx='1.48148'%20ry='1.44'%20fill='%23828EA5'/%3e%3cellipse%20cx='12.42'%20cy='4.94'%20rx='1.48148'%20ry='1.44'%20fill='%23828EA5'/%3e%3cellipse%20cx='12.42'%20cy='10.7'%20rx='1.48148'%20ry='1.44'%20fill='%23828EA5'/%3e%3cellipse%20cx='12.42'%20cy='16.46'%20rx='1.48148'%20ry='1.44'%20fill='%23828EA5'/%3e%3c/svg%3e",f6=({field:e,toggleSelected:t,hideNewChip:n})=>{const{availableFeatures:r}=m.useContext(on),{key:o,label:A,enabled:s,isFieldNew:a}=e,{attributes:i,listeners:l,setNodeRef:u,transform:d,transition:f}=$g({id:o}),p=m.useRef(null),[I,C]=m.useState(!1),E=ca(r)&&a&&!n,h={transform:BA.Transform.toString(d),transition:f};return m.useEffect(()=>{const B=p.current;B&&C(B.scrollWidth>B.clientWidth||B.scrollHeight>B.clientHeight)},[A]),c.jsxs(d6,{ref:u,style:h,...i,children:[c.jsx("img",{className:"field-drag-handle",...l,src:E6}),c.jsx(g.Checkbox,{checked:s,onChange:()=>t(o),sx:{marginLeft:"-6px"}}),c.jsx(g.Tooltip,{title:A,disableHoverListener:!I,children:c.jsxs(g.Stack,{direction:"row",gap:"5px",alignItems:"center",children:[c.jsx(g.Typography,{ref:p,variant:"body2",maxWidth:"325px",noWrap:!0,children:A}),E?c.jsx(Sa,{label:Tg}):null]})})]})},I6=e=>({[e]:{isExtensionNew:[],sidePanel:[],cards:{},fieldVisibility:{cards:{}}}}),As=()=>{try{return JSON.parse(localStorage.getItem(la)||"{}")}catch{return{}}},ss=()=>{const e=As();return Object.keys(e)[0]},Fp=e=>{var t;return(t=As())==null?void 0:t[e]},B6=e=>{if(!e)return;const t=As(),n=ss();(Object.keys(t).length===0||n!=e)&&localStorage.setItem(la,JSON.stringify(I6(e)))},p6=(e,t)=>{var s,a,i,l,u,d;if(!e||!t)return;const n=ss()??"";if(!n)return;const r=As(),o=r[n],A={...r,[n]:{...o,fieldVisibility:{cards:{...(s=o==null?void 0:o.fieldVisibility)==null?void 0:s.cards,[e]:[...((i=(a=o==null?void 0:o.fieldVisibility)==null?void 0:a.cards)==null?void 0:i[e])||[],...(d=(u=(l=o==null?void 0:o.fieldVisibility)==null?void 0:l.cards)==null?void 0:u[e])!=null&&d.includes(t)?[]:[t]]}}}};localStorage.setItem(la,JSON.stringify(A))},Kg=(e,t)=>{var o,A;const n=ss();if(!n||!e||!t)return!1;const r=Fp(n);return!!((A=(o=r==null?void 0:r.fieldVisibility)==null?void 0:o.cards[e])!=null&&A.includes(t))},h6=(e,t)=>{var s,a,i;if(!e||!t)return;const n=ss()??"";if(!n)return;const r=As(),o=r[n],A={...r,[n]:{...o,cards:{...o==null?void 0:o.cards,[e]:[...((s=o==null?void 0:o.cards)==null?void 0:s[e])||[],...(i=(a=o==null?void 0:o.cards)==null?void 0:a[e])!=null&&i.includes(t)?[]:[t]]}}};localStorage.setItem(la,JSON.stringify(A))},Q6=(e,t)=>{var o;const n=ss();if(!n||!e||!t)return!1;const r=Fp(n);return!!((o=r==null?void 0:r.cards[e])!=null&&o.includes(t))},m6=e=>{var A;if(!e)return;const t=As(),n=ss();if(!n)return;const r=t[n],o={[n]:{...r,sidePanel:[...(r==null?void 0:r.sidePanel)||[],...(A=r==null?void 0:r.sidePanel)!=null&&A.includes(e)?[]:[e]]}};localStorage.setItem(la,JSON.stringify(o))},y6=({fields:e,setFields:t,cardId:n})=>{const r=Ap(op(Pl)),{userId:o}=yr()||{},A=At(XS),s=l=>{const{active:u,over:d}=l;(u==null?void 0:u.id)!==(d==null?void 0:d.id)&&t(f=>{const p=f.findIndex(C=>C.key===(u==null?void 0:u.id)),I=f.findIndex(C=>C.key===(d==null?void 0:d.id));return Hl(f,p,I)})},a=!!(o&&Kg(n,o)),i=l=>{t(u=>u.map(d=>d.key===l?{...d,enabled:!d.enabled}:d))};return c.jsxs(c.Fragment,{children:[c.jsx(C6,{children:c.jsx(qg,{sensors:r,collisionDetection:Mg,onDragEnd:s,children:c.jsx(Ug,{items:e.map(l=>l.key),strategy:Zg,children:e.map(l=>c.jsx(f6,{field:l,toggleSelected:i,hideNewChip:a},l.key))})})}),A===Se.LOADING?c.jsxs(g.Stack,{flexDirection:"row",alignItems:"center",gap:"8px",children:[c.jsx(g.CircularProgress,{size:15}),c.jsx(g.Typography,{variant:"caption",color:g.palette.gray.gray3,fontSize:"12px",children:hS})]}):null]})},Np=e=>c.jsx(g.TextField,{...e}),b6=g.styled(g.Box)`
|
|
495
495
|
.request-new-connector-img {
|
|
496
496
|
width: 500px;
|
|
497
497
|
height: 500px;
|
|
@@ -536,7 +536,7 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
|
|
|
536
536
|
color: ${g.palette.gray.gray3};
|
|
537
537
|
margin-top: 0.5px;
|
|
538
538
|
}
|
|
539
|
-
`,T6=({options:e=[],type:t,placeholder:n,labelKey:r="label",valueKey:o="id",onChangeFunc:A,currentSelectedOptions:s=[],isSingleSelect:a=!1})=>{const i=!s.length;return c.jsx(v6,{children:a?c.jsx(g.Autocomplete,{value:Object.keys(s[0]).length?s[0]:null,getOptionLabel:l=>l[r]??"",onChange:A,options:e,renderOption:(l,u)=>c.jsx(g.Box,{component:"li",...l,minHeight:"34px !important",children:u[r]}),renderInput:l=>c.jsx(ed,{...l,ref:l.inputProps.ref,placeholder:n})}):c.jsx(g.Autocomplete,{value:s,slotProps:{popper:{modifiers:[{name:"flip",options:{rootBoundary:"document"}}]}},"data-testid":`${t}-dropdown`,disablePortal:!0,multiple:!0,disableCloseOnSelect:!0,limitTags:2,options:e,isOptionEqualToValue:(l,u)=>(u==null?void 0:u[o])===""?!0:l[o]===u[o],renderOption:(l,u,{selected:d})=>{const{key:f,...p}=l;return c.jsxs(g.Box,{component:"li",...p,minHeight:"36px",children:[c.jsx(g.Checkbox,{style:{marginRight:8},checked:d}),u[r]]},f)},renderTags:(l,u)=>l.map((d,f)=>c.jsx("div",{children:c.jsx(w6,{...u({index:f}),label:d[r],variant:"outlined",deleteIcon:c.jsx(g.icons.Close,{})})},d[o])),renderInput:l=>c.jsx(ed,{...l,variant:"standard",placeholder:i?n:""}),getOptionLabel:l=>l[r],ListboxProps:{style:{maxHeight:250}},onChange:A})})},S6="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3803_129233)'%3e%3cpath%20d='M7.3335%204.66683H8.66683V6.00016H7.3335V4.66683ZM7.3335%207.3335H8.66683V11.3335H7.3335V7.3335ZM8.00016%201.3335C4.32016%201.3335%201.3335%204.32016%201.3335%208.00016C1.3335%2011.6802%204.32016%2014.6668%208.00016%2014.6668C11.6802%2014.6668%2014.6668%2011.6802%2014.6668%208.00016C14.6668%204.32016%2011.6802%201.3335%208.00016%201.3335ZM8.00016%2013.3335C5.06016%2013.3335%202.66683%2010.9402%202.66683%208.00016C2.66683%205.06016%205.06016%202.66683%208.00016%202.66683C10.9402%202.66683%2013.3335%205.06016%2013.3335%208.00016C13.3335%2010.9402%2010.9402%2013.3335%208.00016%2013.3335Z'%20fill='%236F7C90'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_3803_129233'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",_6=e=>{const{selectedEmailInboxes:t,setSelectedEmailInboxes:n,selectedRoles:r,setSelectedRoles:o}=e,A=At(UB)??[],s=At(ZB)??[];return[{type:GB,options:s,label:
|
|
539
|
+
`,T6=({options:e=[],type:t,placeholder:n,labelKey:r="label",valueKey:o="id",onChangeFunc:A,currentSelectedOptions:s=[],isSingleSelect:a=!1})=>{const i=!s.length;return c.jsx(v6,{children:a?c.jsx(g.Autocomplete,{value:Object.keys(s[0]).length?s[0]:null,getOptionLabel:l=>l[r]??"",onChange:A,options:e,renderOption:(l,u)=>c.jsx(g.Box,{component:"li",...l,minHeight:"34px !important",children:u[r]}),renderInput:l=>c.jsx(ed,{...l,ref:l.inputProps.ref,placeholder:n})}):c.jsx(g.Autocomplete,{value:s,slotProps:{popper:{modifiers:[{name:"flip",options:{rootBoundary:"document"}}]}},"data-testid":`${t}-dropdown`,disablePortal:!0,multiple:!0,disableCloseOnSelect:!0,limitTags:2,options:e,isOptionEqualToValue:(l,u)=>(u==null?void 0:u[o])===""?!0:l[o]===u[o],renderOption:(l,u,{selected:d})=>{const{key:f,...p}=l;return c.jsxs(g.Box,{component:"li",...p,minHeight:"36px",children:[c.jsx(g.Checkbox,{style:{marginRight:8},checked:d}),u[r]]},f)},renderTags:(l,u)=>l.map((d,f)=>c.jsx("div",{children:c.jsx(w6,{...u({index:f}),label:d[r],variant:"outlined",deleteIcon:c.jsx(g.icons.Close,{})})},d[o])),renderInput:l=>c.jsx(ed,{...l,variant:"standard",placeholder:i?n:""}),getOptionLabel:l=>l[r],ListboxProps:{style:{maxHeight:250}},onChange:A})})},S6="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3803_129233)'%3e%3cpath%20d='M7.3335%204.66683H8.66683V6.00016H7.3335V4.66683ZM7.3335%207.3335H8.66683V11.3335H7.3335V7.3335ZM8.00016%201.3335C4.32016%201.3335%201.3335%204.32016%201.3335%208.00016C1.3335%2011.6802%204.32016%2014.6668%208.00016%2014.6668C11.6802%2014.6668%2014.6668%2011.6802%2014.6668%208.00016C14.6668%204.32016%2011.6802%201.3335%208.00016%201.3335ZM8.00016%2013.3335C5.06016%2013.3335%202.66683%2010.9402%202.66683%208.00016C2.66683%205.06016%205.06016%202.66683%208.00016%202.66683C10.9402%202.66683%2013.3335%205.06016%2013.3335%208.00016C13.3335%2010.9402%2010.9402%2013.3335%208.00016%2013.3335Z'%20fill='%236F7C90'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_3803_129233'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",_6=e=>{const{selectedEmailInboxes:t,setSelectedEmailInboxes:n,selectedRoles:r,setSelectedRoles:o}=e,A=At(UB)??[],s=At(ZB)??[];return[{type:GB,options:s,label:iS,isSingleSelect:!1},{type:uS,options:A,label:lS,isSingleSelect:!0}].map(({type:i,options:l,label:u,isSingleSelect:d})=>{const f=i===GB,p=f?t:r;return c.jsxs(g.Box,{marginBottom:"20px",children:[c.jsx(TS,{variant:"h4",children:u}),c.jsx(T6,{isSingleSelect:d,currentSelectedOptions:d?[p]:p,options:l,type:i,placeholder:f?aS:cS,onChangeFunc:(I,C)=>f?n(C):o(C??{}),valueKey:"id",labelKey:"name"}),d?c.jsxs(FS,{width:"fit-content",children:[c.jsx("img",{src:S6}),c.jsx(g.Typography,{variant:"caption",color:g.palette.gray.gray3,fontSize:"11px",children:pS})]}):null]},i)})},pA={CARD_VISIBILITY:{ID:0,LABEL:"Card visibility"},FIELD_VISIBILITY:{ID:1,LABEL:"Field visibility"}},Rp="New fields",kp=(e,t)=>{const n=e.reduce((o,A)=>(o[A.key]||(o[A.key]=!0),o),{}),r=[...e];return t.forEach(o=>{n[o.key]||r.push(o)}),r},D6=({handleClose:e,id:t,emailSMs:n,setShowEnabledModal:r,roles:o,currentConnectorId:A,title:s,fields:a,setVisitedFieldVisTab:i})=>{const{availableFeatures:l,sendTrackingEvent:u}=m.useContext(on),d=Mo(),f=At(Ol),p=At(UB)??[],I=At(ZB)??[],C=At(JS),E=At(YS),{userId:h}=yr()||{},[B,Q]=m.useState(()=>(I==null?void 0:I.filter(M=>n==null?void 0:n.includes(M.id)))??[]),[y,b]=m.useState(()=>(p==null?void 0:p.find(M=>o==null?void 0:o.includes(M.name)))??{}),[v,w]=m.useState(()=>{var M,G,X;return((X=(G=(M=f==null?void 0:f[A])==null?void 0:M.cardList)==null?void 0:G.find(re=>re.id===t))==null?void 0:X.fields)??[]}),[x,T]=m.useState(pA.CARD_VISIBILITY.ID);m.useEffect(()=>{d(cl(t))},[d,t]),m.useEffect(()=>{C[t]&&w(M=>kp(M,C[t]||[]))},[C,t]);const V=m.useMemo(()=>!Array.isArray(n)||n.length!==B.length?!1:n.every(M=>B.some(({id:G})=>G===M)),[n,B]),D=m.useMemo(()=>Array.isArray(o)?o.length?!!(o!=null&&o.every(M=>y.name===M)):!Object.keys(y).length:!1,[o,y]),N=m.useMemo(()=>{const M=C[t]||[];if(!Array.isArray(a))return!1;const G=kp(a,M);if(v.length!=G.length)return!1;for(let X=0;X<G.length;X++){const re=G[X],$=v[X];if(v&&(re.key!==$.key||re.enabled!==$.enabled))return!1}return!0},[a,v,C,t]),H=B.length!==0&&v.filter(M=>M.enabled).length===0,L=E===Se.LOADING||V&&D&&N||H,q=m.useMemo(()=>!!(a!=null&&a.some(M=>M.isFieldNew)),[a]),ne=h&&Kg(t,h),fe=ca(l)&&q&&!ne?Rp:"",U=M=>{M.stopPropagation();const G=y!=null&&y.name?[y.name]:[],X=B.map($=>$.id),re=v.map(($,ce)=>({...$,priority:ce+1}));d(al({cardId:t,data:{roles:G,inboxes:{email:X,chat:[]},fields:re},currentConnector:A})).unwrap().then(()=>{var K,ie,Le;const $=(K=f==null?void 0:f[A])==null?void 0:K.name,ce=(Le=(ie=f==null?void 0:f[A])==null?void 0:ie.cardList)==null?void 0:Le.some(Y=>{var En;if(Y.id===t)return!1;const{email:je,chat:ve}=Y.inboxes,Ue=!!(((je==null?void 0:je.length)??0)+((ve==null?void 0:ve.length)??0)),bt=!!((En=Y==null?void 0:Y.roles)!=null&&En.length);return Ue&&bt});u(ct.CARD_VISIBILITY_UPDATED,{new_status:X.length&&(y!=null&&y.name)?WB:zB,pre_status:n!=null&&n.length&&(p!=null&&p.length)?WB:zB,connector_name:$,card_title:s}),!ce&&(y!=null&&y.name)&&X.length?r(!0):$&&Vn({message:IS.replace(fS,$),type:es})}).catch(()=>{Vn({message:BS,type:Co})}).finally(()=>e())},P=()=>{e(),u(ct.CARD_VISIBILITY_UPDATE_CLOSED)},F=(M,G)=>{T(G),G===pA.FIELD_VISIBILITY.ID&&(u(ct.CONNECTOR_VISIBILITY_FIELD_TAB_CLICKED),i(!0))},O=(M,G)=>{var re;const X=(re=Object.values(pA).find($=>$.ID===M))==null?void 0:re.LABEL;return c.jsxs(g.Stack,{direction:"row",alignItems:"center",gap:1.25,children:[X,G?c.jsx(Sa,{label:G}):null]})};return c.jsx(vS,{children:c.jsxs(DS,{children:[c.jsx(wS,{variant:"h2",children:VB}),c.jsx(g.Box,{marginBottom:"24px",children:c.jsxs(g.Tabs,{value:x,onChange:F,children:[c.jsx(YB,{label:O(pA.CARD_VISIBILITY.ID)}),c.jsx(YB,{label:O(pA.FIELD_VISIBILITY.ID,fe)})]})}),c.jsx("div",{hidden:x!==pA.CARD_VISIBILITY.ID,children:c.jsx(_6,{selectedEmailInboxes:B,setSelectedEmailInboxes:Q,selectedRoles:y,setSelectedRoles:b})}),c.jsx("div",{hidden:x!==pA.FIELD_VISIBILITY.ID,children:c.jsx(y6,{fields:v,setFields:w,cardId:t})}),c.jsxs(SS,{children:[c.jsx(LS,{onClick:P,variant:"text",children:gS}),c.jsx(g.Tooltip,{title:H?mS:null,children:c.jsx("div",{children:c.jsx(OS,{onClick:U,disabled:L,children:E!==Se.LOADING?c.jsx(g.Typography,{variant:"body2_medium",children:QS}):c.jsx(g.Grid,{height:"22px",children:c.jsx(_S,{size:22})})})})})]})]})})},O6=g.styled(g.Box)`
|
|
540
540
|
height: 52px;
|
|
541
541
|
box-sizing: border-box;
|
|
542
542
|
width: 100%;
|
|
@@ -592,13 +592,13 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
|
|
|
592
592
|
opacity: 0.5;
|
|
593
593
|
background-color: transparent;
|
|
594
594
|
}
|
|
595
|
-
`,R6=({infoCard:e,currentConnectorId:t,setShowEnabledModal:n})=>{var w,x;const r=((w=e.inboxes)==null?void 0:w.email)||[],o=((x=e.inboxes)==null?void 0:x.chat)||[],A=e.roles??[],s=e.fields??[],{isCardNew:a}=e,i=r.length+o.length,l=i>0&&A.length>0,[u,d]=m.useState(!1),[f,p]=m.useState(!1),{availableFeatures:I,userPermissions:C,sendTrackingEvent:E}=m.useContext(on),h=Ob(C),{userId:B}=yr()||{},Q=T=>{d(T),!T&&B&&(h6(e.id,B),f&&p6(e.id,B))},y=()=>{d(!0),E(ct.CONFIGURE_VISIBILITY_CLICKED)},b=m.useMemo(()=>ca(I)&&a&&B&&!Q6(e.id,B),[I,e,B,u,a]),v=m.useMemo(()=>B&&ca(I)&&s.some(T=>T.isFieldNew)&&!Kg(e.id,B),[I,e,B,u,s]);return c.jsxs(c.Fragment,{children:[c.jsxs(O6,{children:[c.jsxs(g.Stack,{gap:"8px",direction:"row",children:[e.title,c.jsxs(g.Stack,{gap:"5px",direction:"row",children:[c.jsx(Sa,{hidden:!b,label:Tg}),c.jsx(Sa,{hidden:!v,label:Rp})]})]}),c.jsxs(L6,{children:[c.jsx(g.Typography,{className:"hover__text",variant:"caption",children:l?`Visible across ${i} Shared mailbox${i>1?"es":""}`:
|
|
595
|
+
`,R6=({infoCard:e,currentConnectorId:t,setShowEnabledModal:n})=>{var w,x;const r=((w=e.inboxes)==null?void 0:w.email)||[],o=((x=e.inboxes)==null?void 0:x.chat)||[],A=e.roles??[],s=e.fields??[],{isCardNew:a}=e,i=r.length+o.length,l=i>0&&A.length>0,[u,d]=m.useState(!1),[f,p]=m.useState(!1),{availableFeatures:I,userPermissions:C,sendTrackingEvent:E}=m.useContext(on),h=Ob(C),{userId:B}=yr()||{},Q=T=>{d(T),!T&&B&&(h6(e.id,B),f&&p6(e.id,B))},y=()=>{d(!0),E(ct.CONFIGURE_VISIBILITY_CLICKED)},b=m.useMemo(()=>ca(I)&&a&&B&&!Q6(e.id,B),[I,e,B,u,a]),v=m.useMemo(()=>B&&ca(I)&&s.some(T=>T.isFieldNew)&&!Kg(e.id,B),[I,e,B,u,s]);return c.jsxs(c.Fragment,{children:[c.jsxs(O6,{children:[c.jsxs(g.Stack,{gap:"8px",direction:"row",children:[e.title,c.jsxs(g.Stack,{gap:"5px",direction:"row",children:[c.jsx(Sa,{hidden:!b,label:Tg}),c.jsx(Sa,{hidden:!v,label:Rp})]})]}),c.jsxs(L6,{children:[c.jsx(g.Typography,{className:"hover__text",variant:"caption",children:l?`Visible across ${i} Shared mailbox${i>1?"es":""}`:AS}),c.jsx(_5,{children:c.jsx(F6,{})}),c.jsx(g.Tooltip,{title:h?VB:sS,placement:"bottom",children:c.jsx(N6,{className:"visibilityIcon",onClick:y,disabled:!h,children:l?c.jsx(D5,{}):c.jsx(O5,{})})})]})]}),c.jsx(Dg,{shown:u,setShown:Q,customPaperProps:{overflow:"inherit"},children:c.jsx(D6,{roles:A,emailSMs:r,fields:s,handleClose:()=>Q(!1),id:e.id,title:e.title,currentConnectorId:t,setShowEnabledModal:n,setVisitedFieldVisTab:p})})]})},k6=({infoCards:e,currentConnectorId:t,setShowEnabledModal:n})=>c.jsx("div",{children:e.map(r=>c.jsx(R6,{setShowEnabledModal:n,currentConnectorId:t,infoCard:r},r.id))}),P6=g.styled(g.Typography)`
|
|
596
596
|
text-align: left;
|
|
597
597
|
ul {
|
|
598
598
|
margin: 0;
|
|
599
599
|
padding-inline-start: 20px;
|
|
600
600
|
}
|
|
601
|
-
`,M6=({connectorName:e,updates:t=""})=>c.jsxs(g.Stack,{padding:"20px",children:[c.jsxs(g.Typography,{variant:"h2",marginBottom:1,children:["Upgrade ",e," connector"]}),c.jsx(P6,{variant:"body2",color:g.theme.palette.gray.gray2,dangerouslySetInnerHTML:{__html:t}})]}),j6=g.styled(({className:e,...t})=>c.jsx(g.Tooltip,{...t,classes:{popper:e}}))(()=>({[`& .${g.tooltipClasses.tooltip}`]:{backgroundColor:"#fff",padding:0,minWidth:"400px",borderRadius:"4px",boxShadow:"0px 3px 15px 0px #00000040"}})),Pp=({connector:e,isConfigSettingsPage:t,isEdit:n=!1,isConnectorCard:r=!1})=>{const{sendTrackingEvent:o}=m.useContext(on),{id:A,name:s,logo:a,description:i,isAuthenticated:l,showUpgradeButton:u=!1,updates:d}=e,f=At(
|
|
601
|
+
`,M6=({connectorName:e,updates:t=""})=>c.jsxs(g.Stack,{padding:"20px",children:[c.jsxs(g.Typography,{variant:"h2",marginBottom:1,children:["Upgrade ",e," connector"]}),c.jsx(P6,{variant:"body2",color:g.theme.palette.gray.gray2,dangerouslySetInnerHTML:{__html:t}})]}),j6=g.styled(({className:e,...t})=>c.jsx(g.Tooltip,{...t,classes:{popper:e}}))(()=>({[`& .${g.tooltipClasses.tooltip}`]:{backgroundColor:"#fff",padding:0,minWidth:"400px",borderRadius:"4px",boxShadow:"0px 3px 15px 0px #00000040"}})),Pp=({connector:e,isConfigSettingsPage:t,isEdit:n=!1,isConnectorCard:r=!1})=>{const{sendTrackingEvent:o}=m.useContext(on),{id:A,name:s,logo:a,description:i,isAuthenticated:l,showUpgradeButton:u=!1,updates:d}=e,f=At(zS),p=At(qB),I=At(_g),[C,E]=m.useState(!1),h=Mo(),B=cn(),Q=(L,q)=>{L==null||L.stopPropagation(),h(Al({id:q,enabled:L.target.checked})).unwrap().then(()=>{L.target.checked?o(ct.TOGGLE_ENABLED,{connector_name:s}):(o(ct.TOGGLE_DISABLED,{connector_name:s}),Vn({message:A5,type:$B}))}).catch(()=>{Vn({message:o5,type:Co})})},y=(L,q)=>{L==null||L.stopPropagation(),o(ct.ADD_CONNECTOR_CLICKED,{connector_name:s}),B(`${et.BASEPATH}${et.CONNECTOR_SETTINGS}/${q}`)},b=(L,q)=>{L==null||L.stopPropagation(),o(ct.SETTINGS_CLICKED,{connector_name:s}),B(`${et.BASEPATH}${et.CONNECTOR_SETTINGS}/${q}?isEdit=true`)},v=(L,q="")=>{L==null||L.preventDefault(),L==null||L.stopPropagation(),!t&&B(`${et.BASEPATH}${et.API_VIEW}/${q}?isEdit=true`)},w=L=>{L==null||L.stopPropagation(),B(`${et.BASEPATH}${et.CONNECTOR_SETTINGS}/${A}?isEdit=true`)};let x=!1;"isEnabled"in e&&typeof e.isEnabled=="boolean"&&(x=e.isEnabled);const T=!(e!=null&&e.isAuthenticated),V=[p,I].includes(Se.LOADING)||T,D=!t&&(e==null?void 0:e.cardList)&&e.isEnabled&&e.isAuthenticated,H=mf({"connector-flex":!0,"connector-settings":!!t,"connector-expanded":!t&&x&&!!l,"connector-has-upgrade":u});return c.jsxs(qS,{className:t?"noBorder":"",children:[c.jsx(C5,{shown:C,setShown:E,connectorName:e.name}),c.jsxs(ZS,{"data-testid":A,className:"connector-grid",onClick:L=>v(L,A),children:[c.jsxs(g.Stack,{className:H,width:"100%",children:[c.jsx(g.Stack,{direction:"row",gap:1,alignItems:"center",children:c.jsxs(g.Stack,{flexDirection:"row",alignItems:"center",children:[t?c.jsx("img",{src:a??"",className:"logoIcon",width:"28xp",height:"28px",alt:s}):null,c.jsxs(g.Box,{children:[c.jsx(US,{variant:r?"body1_medium":"h2",children:s}),c.jsxs(g.Stack,{direction:"row",alignItems:"center",gap:"4px",hidden:t||!u||T||!d,children:[c.jsx(g.Typography,{variant:"body2",color:g.theme.palette.gray.gray3,children:xS}),c.jsx(j6,{placement:"bottom",title:c.jsx(M6,{connectorName:e.name,updates:d}),children:c.jsx(g.Icon,{children:c.jsx(r5,{})})})]})]})]})}),t&&!n?c.jsx(t5,{variant:"contained",onClick:L=>y(L,A),children:J4}):c.jsxs($S,{children:[!t&&u&&!T?c.jsx(g.Box,{marginRight:"7px",children:c.jsx(g.Button,{size:"small",onClick:w,children:yS})}):null,!t&&T?c.jsx(n5,{severity:"error",children:bS}):null,c.jsx(g.Tooltip,{title:X4,placement:"bottom",children:c.jsx(g.IconButton,{onClick:L=>b(L,A),children:c.jsx("img",{src:s5,className:"settingsIcon"})})}),(f==null?void 0:f[A])!==Se.LOADING?c.jsx(g.Tooltip,{title:x?Z4:q4,placement:"bottom",children:c.jsx(g.Switch,{id:`switch_${A}`,checked:x,disabled:V,onClick:L=>L==null?void 0:L.stopPropagation(),onChange:L=>Q(L,A)})}):c.jsx(KS,{width:"58px",height:"38px",alignItems:"center",flexDirection:"row",justifyContent:"center",children:c.jsx(e5,{"data-testid":"loading"})})]})]}),t?c.jsx(g.Typography,{maxWidth:"577px",variant:"body1",color:g.theme.palette.gray.gray3,className:"connector-grid",children:i}):null]}),D?c.jsx(k6,{setShowEnabledModal:E,currentConnectorId:A,infoCards:e.cardList||[]}):null]})},V6=()=>{const e=At(XB),t=At(Ol);return c.jsx(JB,{children:c.jsx(g.Box,{"data-testid":"connector-custom-card",children:e.map(n=>{var r;return(r=t==null?void 0:t[n])!=null&&r.id?c.jsx(Pp,{connector:t[n],isConfigSettingsPage:!1,isConnectorCard:!0},n):null})})})},Mp=e=>e.requestConnectorApi.connectorRequestsApiStatus,G6=e=>e.requestConnectorApi.requestableConnectors,H6=e=>e.requestConnectorApi.requestableApis,W6=({connectors:e,canSubmit:t,setSelectedConnectors:n,selectedConnectors:r,setOptionalDetails:o,handleSubmit:A,isApiText:s})=>{const{sendTrackingEvent:a}=m.useContext(on),l=At(Mp)===Se.LOADING,u=r.length===0?s?j4:V4:"";return m.useEffect(()=>{a(s?ct.REQUEST_NEW_FEATURE_SHOWN:ct.REQUEST_NEW_CONNECTOR_SHOWN)},[a,s]),c.jsx(g.Stack,{"data-testid":"request-panel",children:c.jsxs(g.Stack,{padding:"30px",height:"100%",children:[c.jsx(g.Stack,{width:"440px",height:"100%",children:c.jsxs(g.Stack,{gap:"14px",children:[c.jsxs(g.Stack,{gap:"4px",marginBottom:"36px",children:[c.jsx(g.Typography,{variant:"h2",children:s?k4:P4}),c.jsx(g.Typography,{variant:"body2",children:s?MB:M4})]}),c.jsx(g.Autocomplete,{"data-testid":"request-dropdown",disablePortal:!0,multiple:!0,disableCloseOnSelect:!0,limitTags:2,options:e,disabled:l,isOptionEqualToValue:(d,f)=>d.id===f.id,renderOption:(d,f,{selected:p})=>{const{key:I,...C}=d;return c.jsxs(g.Box,{component:"li",...C,minHeight:"36px",children:[c.jsx(g.Checkbox,{style:{marginRight:8},checked:p}),f.label]},I)},renderInput:d=>c.jsx(ed,{...d,variant:"outlined",placeholder:u}),ListboxProps:{style:{maxHeight:250}},onChange:(d,f)=>{n(f)}}),c.jsx(Np,{multiline:!0,fullWidth:!0,minRows:8,variant:"outlined",disabled:l,placeholder:G4,onChange:d=>{o(d.target.value)}})]})}),c.jsx(g.Stack,{alignItems:"flex-end",children:c.jsx(g.Button,{"data-testid":"submit-request-button",onClick:A,color:"tertiary",size:"medium",sx:{height:"32px",width:"140.25px"},disabled:!t||l,children:l?c.jsx(g.CircularProgress,{sx:{color:"#97A3B7"},size:20}):c.jsx("div",{children:H4})})})]})})},z6=({handleClose:e})=>c.jsx(g.Stack,{children:c.jsxs(g.Stack,{padding:"30px",height:"100%",children:[c.jsx(g.Stack,{width:"378px",height:"100%",justifyContent:"center",children:c.jsxs(g.Stack,{gap:"14px",children:[c.jsx("img",{src:KB,alt:"checkmark",width:92,height:92}),c.jsxs(g.Stack,{gap:"4px",children:[c.jsx(g.Typography,{variant:"h2",children:W4}),c.jsx(g.Typography,{variant:"body2",children:z4})]})]})}),c.jsx(g.Stack,{alignItems:"flex-end",children:c.jsx(x6,{onClick:e,variant:"outlined",color:"tertiary",size:"medium",children:Y4})})]})}),td=({shown:e,setShown:t,connectorType:n,isApi:r=!1})=>{const{sendTrackingEvent:o}=m.useContext(on),A=Mo(),s=At(G6),a=At(H6),i=At(Mp),[l,u]=m.useState(""),[d,f]=m.useState([]),[p,I]=m.useState([]),[C,E]=m.useState(!1),[h,B]=m.useState(!1),Q=()=>{const w=r?jB.API:jB.CONNECTOR,x=p.map(T=>T.id);A(dl({type:w,values:x,description:l})).unwrap().then(()=>{o(r?ct.REQUEST_NEW_FEATURE_SUBMIT_CLICKED:ct.REQUEST_NEW_CONNECTOR_SUBMIT_CLICKED),B(!0)}).catch(()=>{Vn({message:U4,type:Co})})};m.useEffect(()=>(e&&h&&B(!1),()=>{I([]),u("")}),[e]),m.useEffect(()=>{var w;if(r){const x=((w=a==null?void 0:a.find(T=>T.connector_type===n))==null?void 0:w.apis)||[];f(x.map(T=>({label:T.name,id:T.key})))}else f((s||[]).map(x=>({label:x.name,id:x.key})))},[a,s,r,n]),m.useEffect(()=>{E(p.length>0)},[p,l]);const y=h&&i!==Se.LOADING,b=w=>{w||o(r?ct.REQUEST_NEW_FEATURE_CLOSE_CLICKED:ct.REQUEST_NEW_CONNECTOR_CLOSE_CLICKED),t(w)},v=()=>{t(!1),o(r?ct.REQUEST_NEW_FEATURE_DONE_CLICKED:ct.REQUEST_NEW_CONNECTOR_DONE_CLICKED)};return c.jsxs(Dg,{shown:e,setShown:b,showCloseButton:!0,children:[y?c.jsx(z6,{handleClose:v}):c.jsx(W6,{connectors:d,canSubmit:C,setSelectedConnectors:I,selectedConnectors:p,setOptionalDetails:u,handleSubmit:Q,isApiText:r}),c.jsx(b6,{children:c.jsx("img",{loading:"lazy",className:"request-new-connector-img",src:S4,alt:"Request new connector"})})]})},Y6="Custom Connectors",J6="Connectors help you get a better customer context and key actions right into your inbox",X6="Library",q6="Use these pre-built connectors to get started without any hassle. Authenticate and access them from the right panel of Hiver.",Z6=g.styled(g.Box)`
|
|
602
602
|
padding: 14px 0px 0 32px;
|
|
603
603
|
box-sizing: border-box;
|
|
604
604
|
`,U6=g.styled(g.Stack)`
|
|
@@ -682,7 +682,7 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
|
|
|
682
682
|
`,h_=g.styled(g.icons.CalendarTodayOutlinedIcon)`
|
|
683
683
|
height: 16px;
|
|
684
684
|
width: 16px;
|
|
685
|
-
`,rd=({isApiViewPage:e=!1,isSettingsPage:t=!1})=>{const{availableFeatures:n,sendTrackingEvent:r}=m.useContext(on),{DETAILS_PAGE:o,AUTH_PAGE:A,CONNECTORS_PAGE_ADMIN_SIDE:s}=$
|
|
685
|
+
`,rd=({isApiViewPage:e=!1,isSettingsPage:t=!1})=>{const{availableFeatures:n,sendTrackingEvent:r}=m.useContext(on),{DETAILS_PAGE:o,AUTH_PAGE:A,CONNECTORS_PAGE_ADMIN_SIDE:s}=$4,a=t?A:e?o:s,i=mf({"settings-page":t,"api-view-page":e}),[l,u]=m.useState(()=>{const p=localStorage.getItem(nd)==="true";return(t||!p)&&Pr(n,Cb)});m.useEffect(()=>{localStorage.getItem(nd)==="true"&&!t&&u(!1)},[t]);const d=()=>{window.open(C_,"_blank"),r(ct.SCHEDULE_CALL_CLICKED,{source:a})},f=()=>{localStorage.setItem(nd,"true"),u(!1),r(ct.SCHEDULE_CALL_CROSS_CLICKED,{source:a})};return l?c.jsxs(f_,{direction:"row",className:i,children:[c.jsxs(I_,{className:i,children:[c.jsxs("div",{children:[c.jsx(g.Typography,{color:g.theme.palette.gray.black,variant:"body2_medium",children:A_+(t?s_:"")}),c.jsx(g.Typography,{variant:"body2",children:a_})]}),c.jsxs(B_,{onClick:d,variant:"outlined",size:"small",children:[c.jsx(h_,{}),i_]})]}),t?null:c.jsx("div",{className:"schedule-close",children:c.jsx(g.Tooltip,{title:"Close",placement:"bottom",children:c.jsx(g.IconButton,{onClick:f,children:c.jsx(p_,{})})})})]}):null},jp=()=>{const e=Mo(),{connectorFunctions:t}=m.useContext(on),[n,r]=m.useState(!1),[o,A]=m.useState(!1),s=At(XB),a=At(yI),i=At(qB),l=!!s.length,u=!!a.length,{sendTrackingEvent:d}=m.useContext(on),f=i===Se.LOADING;m.useEffect(()=>{t&&(e(sl(t.getInboxDetails)),e(il(t.getRoles)))},[t,e]),m.useEffect(()=>{e(ll()),e(gl())},[e]);const p=(C,E=!1)=>{r(C),A(!1),E&&d(ct.REQUEST_NEW_CLICKED)},I=C=>{A(C),r(!1)};return c.jsxs(Z6,{"data-testid":"connector-dashboard",children:[c.jsx(rd,{}),c.jsxs(U6,{children:[c.jsx($6,{variant:"h2",children:Y6}),l&&!f?c.jsx(g.Button,{"data-testid":"connector-available-request-new",onClick:()=>{p(!0,!0)},children:PB}):null]}),c.jsx(K6,{variant:"body1",color:"rgba(108, 123, 148, 1)",children:J6}),f?c.jsx(o_,{}):c.jsx(c.Fragment,{children:l?c.jsx(V6,{}):c.jsx(WS,{setModalState:p})}),c.jsxs(g.Box,{marginTop:"32px",children:[u?c.jsxs(c.Fragment,{children:[c.jsx(e_,{variant:"h2",children:X6}),c.jsx(t_,{variant:"body1",color:g.theme.palette.gray.gray3,children:q6})]}):null,c.jsx(NS,{})]}),c.jsx(td,{shown:o||n,setShown:o?I:p,isApi:o})]})},Q_=g.styled(g.Box)`
|
|
686
686
|
box-sizing: border-box;
|
|
687
687
|
background-color: #ffffff;
|
|
688
688
|
width: 178px;
|
|
@@ -1385,7 +1385,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1385
1385
|
width: 40px;
|
|
1386
1386
|
height: 40px;
|
|
1387
1387
|
}
|
|
1388
|
-
`,Pk=e=>_.createElement("svg",{width:35,height:35,viewBox:"0 0 35 35",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},_.createElement("rect",{x:9,y:9,width:15,height:17,fill:"white"}),_.createElement("g",{clipPath:"url(#clip0_7787_114457)"},_.createElement("path",{d:"M17.1981 2.86633C9.28704 2.86633 2.86646 9.28691 2.86646 17.198C2.86646 25.1091 9.28704 31.5296 17.1981 31.5296C25.1092 31.5296 31.5298 25.1091 31.5298 17.198C31.5298 9.28691 25.1092 2.86633 17.1981 2.86633ZM14.3318 23.6472V10.7487L22.9308 17.198L14.3318 23.6472Z",fill:"#4D596C"})),_.createElement("defs",null,_.createElement("clipPath",{id:"clip0_7787_114457"},_.createElement("rect",{width:34.396,height:34.396,fill:"white"})))),Am=({aspectRatio:e="auto",...t})=>{const[n,r]=m.useState(!1);return n?null:c.jsxs(kk,{aspectRatio:e,children:[c.jsx("img",{className:"preview-img",onError:()=>r(!0),...t}),c.jsx(Pk,{className:"play-icon"})]})};g.styled(({className:e,...t})=>c.jsx(g.Tooltip,{...t,classes:{popper:e}}))(({tooltipStyle:e,arrowStyle:t})=>({[`& .${g.tooltipClasses.arrow}`]:{...t},[`& .${g.tooltipClasses.tooltip}`]:{...e}}));function Mk(e){return!!e.interfaceDetails||!!e.searchInterfaceDetails}const BC=e=>!!e&&typeof e=="object"&&"value"in e&&"label"in e,sm=e=>typeof e=="string"&&e.startsWith("{{")&&e.endsWith("}}")&&e.includes("."),jk=e=>{if(!e||!sm(e.value))return null;const t=String(e.value).replace(/\{|\}/g,"").split("."),n=e.label.split(".");return{name:n[0],id:t[0],option:{label:n[1],value:t[1]}}},am=e=>e?{label:`${e.name} > ${e.option.label}`,value:`{{${e.name}.${e.option.label}}}`}:null,Vk=/\{\{([^}]*)\}\}/g,Gk=/^[a-zA-Z0-9._]+$/,Hk="Invalid variable format. Please check inserted variables.",Wk=e=>{if(!e)return;const t=e.matchAll(Vk);for(const[,n]of[...t])if(!Gk.test(n))return Hk},zk=e=>{if(!e||e.includes("{{")&&e.includes("}}"))return;const t=new Date(e),n=/^\d{4}-\d{2}-\d{2}$/;if(isNaN(t.getTime())||!n.test(e))return"Invalid date format. Required date format is YYYY-MM-DD"},Yk=({argsMap:e,optionalArgsMap:t,data:n})=>{const{args:r,enabled:o}=m.useMemo(()=>{const A={};for(const s in e){const a=e[s],i=n[a];if(!i)return{args:{},enabled:!1};A[s]=BC(i)?i.value:i}for(const s in t){const a=t[s],i=n[a];A[s]=BC(i)?i.value:i,A[s]||(A[s]=null)}return{args:A,enabled:!0}},[e,t,n]);return{args:r,enabled:o}},Jk=({args:e,enabled:t,searchTerm:n,pagination:r,queryKey:o,debounceTime:A=500,fetchOptions:s})=>{const[a,i]=m.useState({args:e,enabled:t,searchTerm:n,pagination:r});m.useEffect(()=>{const B=setTimeout(()=>{i({args:e,enabled:t,searchTerm:n,pagination:r})},A);return()=>clearTimeout(B)},[e,t,n,r,A]);const l=m.useMemo(()=>{var B,Q;return{searchTerm:a.searchTerm,limit:((B=a.pagination)==null?void 0:B.limit)??10,enabled:((Q=a.pagination)==null?void 0:Q.enabled)??!1}},[a]),{data:u,isLoading:d,isError:f,isFetching:p,isFetchingNextPage:I,hasNextPage:C,fetchNextPage:E}=p3({queryKey:["fetch-options",o,a.args,l],queryFn:({pageParam:B})=>s({args:a.args,pagination:{...l,pageNumber:B}}),getNextPageParam:(B,Q)=>B.hasMore?Q.length+1:void 0,initialPageParam:1,enabled:a.enabled,refetchOnMount:!0});return{options:m.useMemo(()=>(u==null?void 0:u.pages.flatMap(B=>B.options))??[],[u]),isLoading:d,isError:f,isFetching:p,isFetchingNextPage:I,hasNextPage:C,fetchNextPage:E}},pC=e=>e instanceof Element,Xk=({onIntersect:e,threshold:t,rootMargin:n,enabled:r=!0})=>{const[o,A]=m.useState(!1),s=m.useRef(null),a=m.useRef(null),i=m.useRef(e);i.current=e;const l=m.useCallback(d=>{pC(d)&&(a.current||(a.current=new IntersectionObserver(f=>{var I;const p=f[f.length-1];p.isIntersecting&&((I=i.current)==null||I.call(i,p))},{root:d,threshold:t,rootMargin:n}),A(!0)))},[t,n]),u=m.useCallback(d=>{var f,p;pC(s.current)&&((f=a.current)==null||f.unobserve(s.current)),pC(d)&&r&&o&&((p=a.current)==null||p.observe(d))},[r,o]);return m.useEffect(()=>()=>{a.current&&(a.current.disconnect(),a.current=null)},[]),{parentRef:l,childRef:u}},im=({value:e,interfaceDetails:t,formData:n,fieldKey:r,hasApiSearch:o,fetchOptions:A})=>{var Q;const[s,a]=m.useState(""),{selectedOption:i,selectedValue:l}=m.useMemo(()=>BC(e)?{selectedOption:e,selectedValue:e.value}:{selectedOption:null,selectedValue:e},[e]),{args:u,enabled:d}=Yk({argsMap:t==null?void 0:t.args,optionalArgsMap:t==null?void 0:t.optionalArgs,data:n}),f=Jk({args:u,enabled:d,queryKey:r,searchTerm:o?s:"",pagination:t==null?void 0:t.pagination,fetchOptions:A}),p=f.options,I=!!((Q=t==null?void 0:t.pagination)!=null&&Q.enabled),C=I&&!!f.hasNextPage,E=Xk({onIntersect:()=>f.fetchNextPage(),threshold:.1,enabled:C}),h=m.useMemo(()=>{let y=p;i&&(y=[i],y.push(...p.filter(v=>v.value!==i.value)));const b=s.trim().toLowerCase();return!b||o?y:y.filter(v=>String(v.label).toLowerCase().includes(b))},[p,s,i,o]),B=m.useMemo(()=>{const y={};for(const b of p)y[b.value]=b.label;return y},[p]);return{selectedOption:i,selectedValue:l,search:s,optionsProps:f,observerProps:E,filteredOptions:h,labelsMap:B,paginationEnabled:I,setSearch:a}},qk=e=>_.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:10,viewBox:"0 0 12 10",fill:"none",...e},_.createElement("path",{d:"M4.0001 8.0299L1.2201 5.2499L0.273438 6.1899L4.0001 9.91656L12.0001 1.91656L11.0601 0.976562L4.0001 8.0299Z"})),Zk={borderRadius:"8px",boxShadow:"0px 3px 15px 0px rgba(0, 0, 0, 0.25)",mt:.5,backgroundColor:"#FFFFFF"},Uk={maxHeight:280,overflow:"auto",paddingTop:0,paddingBottom:1},$k={lineHeight:1,padding:"12px 12px 8px",backgroundColor:"#FFFFFF"},Kk={display:"flex",alignItems:"center",gap:"4px",padding:"8px",border:"1px solid #ECEFF6",borderRadius:"6px",width:"100%",boxSizing:"border-box"},eP={flex:1,minWidth:0,fontSize:13,lineHeight:"18px","& .MuiInputBase-input":{padding:0,"&::placeholder":{color:"#97A3B7",opacity:1}}},tP={fontSize:"14px",width:"100%",minWidth:200,height:"40px",background:"#F6F8FC",borderRadius:"8px",fontWeight:400,"& .MuiOutlinedInput-notchedOutline":{borderColor:"#ECEFF6"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#ECEFF6"},"& .MuiSelect-select":{display:"flex",alignItems:"center",paddingLeft:"12px",paddingRight:"8px"},"& .MuiSelect-icon":{color:"#97A3B7"}},nP=e=>({fontSize:14,lineHeight:"
|
|
1388
|
+
`,Pk=e=>_.createElement("svg",{width:35,height:35,viewBox:"0 0 35 35",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},_.createElement("rect",{x:9,y:9,width:15,height:17,fill:"white"}),_.createElement("g",{clipPath:"url(#clip0_7787_114457)"},_.createElement("path",{d:"M17.1981 2.86633C9.28704 2.86633 2.86646 9.28691 2.86646 17.198C2.86646 25.1091 9.28704 31.5296 17.1981 31.5296C25.1092 31.5296 31.5298 25.1091 31.5298 17.198C31.5298 9.28691 25.1092 2.86633 17.1981 2.86633ZM14.3318 23.6472V10.7487L22.9308 17.198L14.3318 23.6472Z",fill:"#4D596C"})),_.createElement("defs",null,_.createElement("clipPath",{id:"clip0_7787_114457"},_.createElement("rect",{width:34.396,height:34.396,fill:"white"})))),Am=({aspectRatio:e="auto",...t})=>{const[n,r]=m.useState(!1);return n?null:c.jsxs(kk,{aspectRatio:e,children:[c.jsx("img",{className:"preview-img",onError:()=>r(!0),...t}),c.jsx(Pk,{className:"play-icon"})]})};g.styled(({className:e,...t})=>c.jsx(g.Tooltip,{...t,classes:{popper:e}}))(({tooltipStyle:e,arrowStyle:t})=>({[`& .${g.tooltipClasses.arrow}`]:{...t},[`& .${g.tooltipClasses.tooltip}`]:{...e}}));function Mk(e){return!!e.interfaceDetails||!!e.searchInterfaceDetails}const BC=e=>!!e&&typeof e=="object"&&"value"in e&&"label"in e,sm=e=>typeof e=="string"&&e.startsWith("{{")&&e.endsWith("}}")&&e.includes("."),jk=e=>{if(!e||!sm(e.value))return null;const t=String(e.value).replace(/\{|\}/g,"").split("."),n=e.label.split(".");return{name:n[0],id:t[0],option:{label:n[1],value:t[1]}}},am=e=>e?{label:`${e.name} > ${e.option.label}`,value:`{{${e.name}.${e.option.label}}}`}:null,Vk=/\{\{([^}]*)\}\}/g,Gk=/^[a-zA-Z0-9._]+$/,Hk="Invalid variable format. Please check inserted variables.",Wk=e=>{if(!e)return;const t=e.matchAll(Vk);for(const[,n]of[...t])if(!Gk.test(n))return Hk},zk=e=>{if(!e||e.includes("{{")&&e.includes("}}"))return;const t=new Date(e),n=/^\d{4}-\d{2}-\d{2}$/;if(isNaN(t.getTime())||!n.test(e))return"Invalid date format. Required date format is YYYY-MM-DD"},Yk=({argsMap:e,optionalArgsMap:t,data:n})=>{const{args:r,enabled:o}=m.useMemo(()=>{const A={};for(const s in e){const a=e[s],i=n[a];if(!i)return{args:{},enabled:!1};A[s]=BC(i)?i.value:i}for(const s in t){const a=t[s],i=n[a];A[s]=BC(i)?i.value:i,A[s]||(A[s]=null)}return{args:A,enabled:!0}},[e,t,n]);return{args:r,enabled:o}},Jk=({args:e,enabled:t,searchTerm:n,pagination:r,queryKey:o,debounceTime:A=500,fetchOptions:s})=>{const[a,i]=m.useState({args:e,enabled:t,searchTerm:n,pagination:r});m.useEffect(()=>{const B=setTimeout(()=>{i({args:e,enabled:t,searchTerm:n,pagination:r})},A);return()=>clearTimeout(B)},[e,t,n,r,A]);const l=m.useMemo(()=>{var B,Q;return{searchTerm:a.searchTerm,limit:((B=a.pagination)==null?void 0:B.limit)??10,enabled:((Q=a.pagination)==null?void 0:Q.enabled)??!1}},[a]),{data:u,isLoading:d,isError:f,isFetching:p,isFetchingNextPage:I,hasNextPage:C,fetchNextPage:E}=p3({queryKey:["fetch-options",o,a.args,l],queryFn:({pageParam:B})=>s({args:a.args,pagination:{...l,pageNumber:B}}),getNextPageParam:(B,Q)=>B.hasMore?Q.length+1:void 0,initialPageParam:1,enabled:a.enabled,refetchOnMount:!0});return{options:m.useMemo(()=>(u==null?void 0:u.pages.flatMap(B=>B.options))??[],[u]),isLoading:d,isError:f,isFetching:p,isFetchingNextPage:I,hasNextPage:C,fetchNextPage:E}},pC=e=>e instanceof Element,Xk=({onIntersect:e,threshold:t,rootMargin:n,enabled:r=!0})=>{const[o,A]=m.useState(!1),s=m.useRef(null),a=m.useRef(null),i=m.useRef(e);i.current=e;const l=m.useCallback(d=>{pC(d)&&(a.current||(a.current=new IntersectionObserver(f=>{var I;const p=f[f.length-1];p.isIntersecting&&((I=i.current)==null||I.call(i,p))},{root:d,threshold:t,rootMargin:n}),A(!0)))},[t,n]),u=m.useCallback(d=>{var f,p;pC(s.current)&&((f=a.current)==null||f.unobserve(s.current)),pC(d)&&r&&o&&((p=a.current)==null||p.observe(d))},[r,o]);return m.useEffect(()=>()=>{a.current&&(a.current.disconnect(),a.current=null)},[]),{parentRef:l,childRef:u}},im=({value:e,interfaceDetails:t,formData:n,fieldKey:r,hasApiSearch:o,fetchOptions:A})=>{var Q;const[s,a]=m.useState(""),{selectedOption:i,selectedValue:l}=m.useMemo(()=>BC(e)?{selectedOption:e,selectedValue:e.value}:{selectedOption:null,selectedValue:e},[e]),{args:u,enabled:d}=Yk({argsMap:t==null?void 0:t.args,optionalArgsMap:t==null?void 0:t.optionalArgs,data:n}),f=Jk({args:u,enabled:d,queryKey:r,searchTerm:o?s:"",pagination:t==null?void 0:t.pagination,fetchOptions:A}),p=f.options,I=!!((Q=t==null?void 0:t.pagination)!=null&&Q.enabled),C=I&&!!f.hasNextPage,E=Xk({onIntersect:()=>f.fetchNextPage(),threshold:.1,enabled:C}),h=m.useMemo(()=>{let y=p;i&&(y=[i],y.push(...p.filter(v=>v.value!==i.value)));const b=s.trim().toLowerCase();return!b||o?y:y.filter(v=>String(v.label).toLowerCase().includes(b))},[p,s,i,o]),B=m.useMemo(()=>{const y={};for(const b of p)y[b.value]=b.label;return y},[p]);return{selectedOption:i,selectedValue:l,search:s,optionsProps:f,observerProps:E,filteredOptions:h,labelsMap:B,paginationEnabled:I,setSearch:a}},qk=e=>_.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:10,viewBox:"0 0 12 10",fill:"none",...e},_.createElement("path",{d:"M4.0001 8.0299L1.2201 5.2499L0.273438 6.1899L4.0001 9.91656L12.0001 1.91656L11.0601 0.976562L4.0001 8.0299Z"})),Zk={borderRadius:"8px",boxShadow:"0px 3px 15px 0px rgba(0, 0, 0, 0.25)",mt:.5,backgroundColor:"#FFFFFF"},Uk={maxHeight:280,overflow:"auto",paddingTop:0,paddingBottom:1},$k={lineHeight:1,padding:"12px 12px 8px",backgroundColor:"#FFFFFF"},Kk={display:"flex",alignItems:"center",gap:"4px",padding:"8px",border:"1px solid #ECEFF6",borderRadius:"6px",width:"100%",boxSizing:"border-box"},eP={flex:1,minWidth:0,fontSize:13,lineHeight:"18px","& .MuiInputBase-input":{padding:0,"&::placeholder":{color:"#97A3B7",opacity:1}}},tP={fontSize:"14px",width:"100%",minWidth:200,height:"40px",background:"#F6F8FC",borderRadius:"8px",fontWeight:400,"& .MuiOutlinedInput-notchedOutline":{borderColor:"#ECEFF6"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#ECEFF6"},"& .MuiSelect-select":{display:"flex",alignItems:"center",paddingLeft:"12px",paddingRight:"8px"},"& .MuiSelect-icon":{color:"#97A3B7"}},nP=e=>({fontSize:14,lineHeight:"20px",minHeight:36,py:1,pl:2,pr:2.5,mx:0,borderRadius:"4px",color:"#343C45",backgroundColor:e?"#F6F8FC":"transparent","&:hover":{backgroundColor:"#F6F8FC"},"&.Mui-selected":{backgroundColor:"#F6F8FC","&:hover":{backgroundColor:"#F6F8FC"}}}),rP=g.styled(g.Box)`
|
|
1389
1389
|
height: 28px;
|
|
1390
1390
|
width: 28px;
|
|
1391
1391
|
border-radius: 50%;
|
|
@@ -1460,7 +1460,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1460
1460
|
overflow: hidden;
|
|
1461
1461
|
text-overflow: ellipsis;
|
|
1462
1462
|
padding-top: 2px;
|
|
1463
|
-
`,lP=e=>{const t=n=>{var o;const r=n.target;r&&((o=e.onChange)==null||o.call(e,r.value))};return c.jsx(aP,{...e,variant:"outlined",onChange:t,...e.multiline?{rows:4}:null})},um=()=>{const[e,t]=m.useState(null),[n,r]=m.useState(null),o=m.useRef(null);return{activeField:e,anchorEl:n,onEnter:a=>{o.current&&clearTimeout(o.current),a&&(t(a.field),r(a.currentTarget))},onLeave:()=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{t(null),r(null)},100)}}},cP={borderRadius:"8px",boxShadow:"0px 3px 15px 0px rgba(0, 0, 0, 0.25)",mt:.5,backgroundColor:"#FFFFFF",minWidth:337},uP={maxHeight:280,overflow:"auto",paddingTop:0,paddingBottom:1},gP={lineHeight:1,padding:"12px",backgroundColor:"#FFFFFF",position:"sticky",top:0,zIndex:2},dP={m:0,minWidth:0,width:"100%"},CP={fontSize:"14px",width:"100%",minWidth:200,height:"40px",background:"#F6F8FC",borderRadius:"8px",fontWeight:500,"& .MuiOutlinedInput-notchedOutline":{borderColor:"#ECEFF6"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#ECEFF6"},"& .MuiSelect-select":{display:"flex",alignItems:"center",paddingLeft:"12px",paddingRight:"8px"},"& .MuiSelect-icon":{color:"#97A3B7"}},EP={fontSize:14,lineHeight:"18px",minHeight:36,py:.75,pl:2,pr:1.5,color:"#343C45",display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,boxSizing:"border-box"},fP=e=>({...EP,backgroundColor:e?"#F6F8FC":"transparent",cursor:"pointer",fontWeight:400,"&:hover":{backgroundColor:"#F6F8FC"}}),IP={display:"grid",gridTemplateColumns:"1fr 1fr",alignItems:"center",backgroundColor:"#
|
|
1463
|
+
`,lP=e=>{const t=n=>{var o;const r=n.target;r&&((o=e.onChange)==null||o.call(e,r.value))};return c.jsx(aP,{...e,variant:"outlined",onChange:t,...e.multiline?{rows:4}:null})},um=()=>{const[e,t]=m.useState(null),[n,r]=m.useState(null),o=m.useRef(null);return{activeField:e,anchorEl:n,onEnter:a=>{o.current&&clearTimeout(o.current),a&&(t(a.field),r(a.currentTarget))},onLeave:()=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{t(null),r(null)},100)}}},cP={borderRadius:"8px",boxShadow:"0px 3px 15px 0px rgba(0, 0, 0, 0.25)",mt:.5,backgroundColor:"#FFFFFF",minWidth:337},uP={maxHeight:280,overflow:"auto",paddingTop:0,paddingBottom:1},gP={lineHeight:1,padding:"12px 12px 2px",backgroundColor:"#FFFFFF",position:"sticky",top:0,zIndex:2},dP={m:0,minWidth:0,width:"100%"},CP={fontSize:"14px",width:"100%",minWidth:200,height:"40px",background:"#F6F8FC",borderRadius:"8px",fontWeight:500,"& .MuiOutlinedInput-notchedOutline":{borderColor:"#ECEFF6"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#ECEFF6"},"& .MuiSelect-select":{display:"flex",alignItems:"center",paddingLeft:"12px",paddingRight:"8px"},"& .MuiSelect-icon":{color:"#97A3B7"}},EP={fontSize:14,lineHeight:"18px",minHeight:36,py:.75,pl:2,pr:1.5,color:"#343C45",display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,boxSizing:"border-box"},fP=e=>({...EP,backgroundColor:e?"#F6F8FC":"transparent",cursor:"pointer",fontWeight:400,"&:hover":{backgroundColor:"#F6F8FC"}}),IP={display:"grid",gridTemplateColumns:"1fr 1fr",alignItems:"center",backgroundColor:"#F6F8FC",borderRadius:"8px",padding:"3px"},gm=e=>({border:"none",borderRadius:"8px",backgroundColor:e?"#FFFFFF":"transparent",color:e?"#196fe0":"#343C45",lineHeight:"24px",padding:"4px 12px",cursor:"pointer"}),BP={fontSize:12,color:"#6F7C90",flexShrink:0},pP={display:"flex",flexDirection:"column",alignItems:"stretch",py:0},hP=e=>({fontSize:14,fontWeight:400,lineHeight:"18px",minHeight:36,py:.75,px:1.5,pl:2,pr:1.5,color:"#343C45",textTransform:"none",justifyContent:"flex-start",backgroundColor:e?"#F6F8FC":"transparent","&:hover":{backgroundColor:"#F6F8FC"}}),QP={color:"#97A3B7",fontSize:13,px:2,py:1.5},mP=g.styled(g.Stack)`
|
|
1464
1464
|
flex-flow: row nowrap;
|
|
1465
1465
|
align-items: center;
|
|
1466
1466
|
color: #343c45;
|
|
@@ -1560,7 +1560,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1560
1560
|
font-size: 13px;
|
|
1561
1561
|
font-weight: 600;
|
|
1562
1562
|
line-height: 14px;
|
|
1563
|
-
`,DP=({name:e,variables:t,customFields:n,onOptionClick:r})=>{const[o,A]=m.useState(""),s=m.useMemo(()=>t.filter(C=>C.title.toLowerCase().includes(o.toLowerCase())),[t,o]),{activeField:a,anchorEl:i,onEnter:l,onLeave:u}=um(),d=C=>{var E;A(((E=C==null?void 0:C.target)==null?void 0:E.value)||"")},f=C=>{if(!C)return;const E=am(C);r({title:(E==null?void 0:E.label)||"",value:E==null?void 0:E.value})},p=n&&n.length>0,I=!!a&&Array.isArray(a==null?void 0:a.options)&&a.options.length>0;return c.jsxs(vP,{children:[c.jsx(SP,{value:o,onChange:d,InputProps:{startAdornment:c.jsx(_P,{children:c.jsx(g.icons.Search,{sx:{fontSize:18,color:g.theme.palette.gray.gray3,flexShrink:0}})})},placeholder:"Search variables",variant:"outlined"}),p&&c.jsx(c.Fragment,{children:c.jsx(fm,{variant:"body2_medium",children:"Variables"})}),s.map(({value:C,title:E},h)=>c.jsx(g.Tooltip,{title:E,placement:"top",arrow:!0,children:c.jsx(Cm,{onClick:()=>r({title:E,value:C}),children:c.jsx(Em,{variant:"body2",children:E})})},`${E}-${C}-${h}`)),p&&c.jsxs(c.Fragment,{children:[c.jsx(fm,{variant:"h2",children:"Custom Objects"}),n==null?void 0:n.map(({id:C,name:E,options:h})=>c.jsx(g.Tooltip,{title:E,placement:"top",arrow:!0,children:c.jsx(Cm,{onPointerEnter:B=>{B.pointerType==="touch"||!h.length||l({field:{id:C,name:E,options:h},currentTarget:B.currentTarget})},onPointerLeave:B=>{B.pointerType==="touch"||!h.length||u()},sx:{cursor:h.length?"pointer":"default"},children:c.jsx(Em,{variant:"body2",children:E})})},C))]}),c.jsx(dm,{name:e,customValue:null,popperOpen:I,anchorEl:i,zIndex:xP.POPPER,activeField:a,onEnter:l,onLeave:u,onChange:f})]})},OP=({setOpen:e})=>{const t=()=>{e(n=>!n)};return c.jsx(wP,{onClick:t,tabIndex:0,children:c.jsx(g.icons.Add,{sx:{fontSize:"12px",color:"#4d596c"}})})},LP=({name:e,variables:t,customFields:n,onOptionClick:r})=>{const[o,A]=m.useState(!1),s=a=>{A(!1),r(a)};return c.jsx(g.ClickAwayListener,{onClickAway:()=>{A(!1)},children:c.jsx(g.Box,{children:c.jsx(g.Tooltip,{title:c.jsx(DP,{name:e,variables:t,customFields:n,onOptionClick:s}),placement:"bottom-end",arrow:!1,open:o,PopperProps:{sx:{"& .MuiTooltip-popper":{zIndex:2e3},"& .MuiTooltip-tooltip":{backgroundColor:"transparent",color:"inherit",padding:0,boxShadow:"none",fontSize:"inherit"}}},children:c.jsx(g.Box,{children:c.jsx(OP,{setOpen:A})})})})})},FP=()=>{const e=m.useRef(0),t=m.useRef(null);return{onBlur:A=>{var a;const s=((a=A==null?void 0:A.target)==null?void 0:a.selectionStart)??0;e.current=s},inputRef:t,focusInput:(A=0)=>{var l;const s=t.current;if(!s)return;const a=e.current+A;(l=s.focus)==null||l.call(s),(window.requestAnimationFrame??window.setTimeout)(()=>{var u;(u=s.setSelectionRange)==null||u.call(s,a,a)})},insertVariable:(A,s)=>{const a=e.current;return A.slice(0,a)+s+A.slice(a)}}},NP=({name:e,type:t,value:n,label:r,variables:o,hasError:A,limit:s,multiline:a=!1,customFields:i,isRequired:l=!1,onChange:u,setError:d})=>{const{onBlur:f,inputRef:p,focusInput:I,insertVariable:C}=FP(),E=t==="date"?o.filter(y=>y.isDate):o,h=VQ(y=>{let b=Wk(y);t==="date"&&(b=zk(y)),l&&!y&&(b=`${r} is required`),d(b)},1e3),B=y=>{u(y),h(y)},Q=({value:y})=>{const b=C(n,y);B(b),I(y==null?void 0:y.length)};return c.jsx(lP,{inputRef:p,value:n,onChange:B,onBlur:f,placeholder:"Value",hasError:A,limit:s,multiline:a,InputProps:{endAdornment:E.length>0?c.jsx(TP,{style:{justifyContent:a?"flex-end":"center",padding:"10px"},children:c.jsx(LP,{name:e,variables:E,customFields:i,onOptionClick:Q})}):null}})},RP=({name:e,value:t,placeholder:n,searchPlaceholder:r="Search",formData:o,interfaceDetails:A,customFields:s=[],className:a,hasApiSearch:i=!1,zIndex:l=3e3,fetchOptions:u,onChange:d})=>{const[f,p]=m.useState(!1),[I,C]=m.useState("options"),{activeField:E,anchorEl:h,onEnter:B,onLeave:Q}=um(),y=jk(t),{selectedValue:b,search:v,optionsProps:w,observerProps:x,filteredOptions:T,paginationEnabled:V,labelsMap:D,setSearch:N}=im({value:y?void 0:t,interfaceDetails:A,formData:o,fieldKey:e,hasApiSearch:i,fetchOptions:u}),{parentRef:H}=x,L=U=>{const P=am(U);P&&(d(P),Q(),p(!1))},q=U=>{const P=String(U.target.value);if(P===lm)return;const F=D[P];d({value:P,label:F}),Q(),p(!1)},ne=U=>P=>{P.preventDefault(),P.stopPropagation(),C(U),Q()},le=I==="custom"&&Array.isArray(E==null?void 0:E.options)&&E.options.length>0,fe=()=>{if(!t)return c.jsx(_c,{children:n});const[U,P]=t.label.split(" > ");return y?c.jsxs(mP,{children:[c.jsx(_c,{children:U}),c.jsx(g.icons.ChevronRightOutlined,{sx:{fontSize:"18px"}}),c.jsx(_c,{children:P})]}):c.jsx(_c,{children:t.label})};return m.useEffect(()=>{if(!(t!=null&&t.value)||!f)return;const U=sm(t.value)?"custom":"options";C(U)},[t,f]),c.jsxs(g.FormControl,{fullWidth:!0,sx:dP,className:a,children:[c.jsxs(g.Select,{id:e,displayEmpty:!0,value:b,variant:"outlined",size:"small",sx:CP,open:f,onOpen:()=>{p(!0),C("options")},onClose:()=>{p(!1),Q()},renderValue:fe,MenuProps:{autoFocus:!1,sx:{zIndex:l},PaperProps:{sx:cP},MenuListProps:{sx:uP,ref:H}},onChange:q,children:[c.jsx(g.ListSubheader,{sx:gP,children:c.jsxs(g.Box,{sx:IP,children:[c.jsx(g.Box,{component:"button",type:"button",sx:gm(I==="options"),onClick:ne("options"),children:c.jsx(g.Typography,{variant:"caption",fontSize:14,fontWeight:500,color:I==="options"?g.theme.palette.gray.gray1:g.theme.palette.gray.gray3,children:"Options"})}),c.jsx(g.Box,{component:"button",type:"button",sx:gm(I==="custom"),onClick:ne("custom"),children:c.jsx(g.Typography,{variant:"caption",fontSize:14,fontWeight:500,color:I==="custom"?g.theme.palette.gray.gray1:g.theme.palette.gray.gray3,children:"Custom Object"})})]})}),I==="options"?cm({selectedValue:b,search:v,searchPlaceholder:r,paginationEnabled:V,filteredOptions:T,observerProps:x,optionsProps:w,setSearch:N,searchOffset:62}):s.map(U=>{const P=U.options.length>0;return c.jsxs(g.ListSubheader,{onPointerEnter:F=>{F.pointerType==="touch"||!P||B({field:U,currentTarget:F.currentTarget})},onPointerLeave:F=>{F.pointerType==="touch"||!P||Q()},sx:fP(P&&(E==null?void 0:E.id)===U.id),"data-field-id":U.id,children:[c.jsx("span",{style:{minWidth:0,flex:1,textAlign:"left"},children:U.name}),P?c.jsx(g.icons.PlayArrow,{sx:BP}):null]},U.id)})]}),c.jsx(dm,{name:e,customValue:y,popperOpen:le,anchorEl:h,zIndex:l,activeField:E,onEnter:B,onLeave:Q,onChange:L})]})},kP=({field:e,formId:t,value:n,formValues:r,variables:o,customFields:A,errors:s,checkMandatory:a,setError:i,fetchOptions:l,setFormValues:u,onFieldChange:d})=>{var Q,y;const f=m.useMemo(()=>UQ(500),[]),p=b=>{u(v=>({...v,[e.name]:b})),f(()=>{d==null||d({name:e.name,value:b,type:e.type})})},I=s[e.name],C=I?c.jsx(g.Tooltip,{title:I,placement:"bottom",children:c.jsx(iP,{variant:"body2",fontSize:"13px",color:g.theme.palette.error.main,children:I})}):null,h=Array.isArray(A)&&A.length>0?c.jsx(RP,{customFields:A??[],interfaceDetails:e.interfaceDetails??e.searchInterfaceDetails,formData:r,fetchOptions:b=>l(b,{formId:t,fieldName:e.name}),name:e.name,value:n,placeholder:"Select object",hasApiSearch:!!e.searchInterfaceDetails,onChange:p}):c.jsx(sP,{fieldKey:`${t}-${e.name}`,interfaceDetails:e.interfaceDetails??e.searchInterfaceDetails,value:n,fetchOptions:b=>l(b,{formId:t,fieldName:e.name}),disabled:e.disabled,placeholder:e.placeholder??"Select",menuZIndex:bP,formData:r,hasApiSearch:!!e.searchInterfaceDetails,onChange:p}),B=Mk(e)?h:c.jsx(NP,{name:e.name,label:e.label,type:e.type,variables:o,value:r[e.name]??"",isRequired:a&&!!((Q=e.validations)!=null&&Q.isRequired),onChange:p,hasError:!!I,limit:(y=e.validations)==null?void 0:y.maxCharacters,multiline:e.type==="multiline",setError:b=>i({name:e.name,value:b}),customFields:A});return c.jsxs(g.Stack,{direction:"row",alignItems:"center",gap:"4px",position:"relative",children:[B,C]})},PP=e=>_.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:15,height:15,viewBox:"0 0 15 15",fill:"none",...e},_.createElement("g",{clipPath:"url(#clip0_833_38792)"},_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.4 2.52266C11.4 2.86744 11.537 3.1981 11.7808 3.4419C12.0246 3.68569 12.3552 3.82266 12.7 3.82266C13.0448 3.82266 13.3754 3.68569 13.6192 3.4419C13.863 3.1981 14 2.86744 14 2.52266C14 2.17788 13.863 1.84722 13.6192 1.60342C13.3754 1.35962 13.0448 1.22266 12.7 1.22266C12.3552 1.22266 12.0246 1.35962 11.7808 1.60342C11.537 1.84722 11.4 2.17788 11.4 2.52266ZM1 2.52266C1 2.86744 1.13696 3.1981 1.38076 3.44189C1.62456 3.68569 1.95522 3.82266 2.3 3.82266C2.64478 3.82266 2.97544 3.68569 3.21924 3.44189C3.46304 3.1981 3.6 2.86744 3.6 2.52266C3.6 2.17788 3.46304 1.84721 3.21924 1.60342C2.97544 1.35962 2.64478 1.22266 2.3 1.22266C1.95522 1.22266 1.62456 1.35962 1.38076 1.60342C1.13696 1.84721 1 2.17787 1 2.52266Z",fill:"#7853FF",stroke:"#7853FF",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round"}),_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.4 12.3449C11.4 12.6897 11.537 13.0204 11.7808 13.2642C12.0246 13.508 12.3552 13.6449 12.7 13.6449C13.0448 13.6449 13.3754 13.508 13.6192 13.2642C13.863 13.0204 14 12.6897 14 12.3449C14 12.0001 13.863 11.6695 13.6192 11.4257C13.3754 11.1819 13.0448 11.0449 12.7 11.0449C12.3552 11.0449 12.0246 11.1819 11.7808 11.4257C11.537 11.6695 11.4 12.0001 11.4 12.3449ZM1 12.3449C1 12.6897 1.13696 13.0204 1.38076 13.2642C1.62456 13.508 1.95522 13.6449 2.3 13.6449C2.64478 13.6449 2.97544 13.508 3.21924 13.2642C3.46304 13.0204 3.6 12.6897 3.6 12.3449C3.6 12.0001 3.46304 11.6695 3.21924 11.4257C2.97544 11.1819 2.64478 11.0449 2.3 11.0449C1.95522 11.0449 1.62456 11.1819 1.38076 11.4257C1.13696 11.6695 1 12.0001 1 12.3449Z",fill:"#7853FF",stroke:"#7853FF",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round"}),_.createElement("path",{d:"M11.3984 2.52344L3.59844 2.52344L5.77656 2.52344",stroke:"#7853FF",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round"}),_.createElement("path",{d:"M11.3984 12.3457L3.59844 12.3457L5.77656 12.3457",stroke:"#7853FF",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round"})),_.createElement("defs",null,_.createElement("clipPath",{id:"clip0_833_38792"},_.createElement("rect",{width:15,height:15,fill:"white",transform:"translate(15) rotate(90)"})))),hC={outer:{display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,bgcolor:"#f3ebff",p:"6px",borderRadius:"8px"},frame:{width:24,height:24,overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center"},rotate:{display:"flex",alignItems:"center",justifyContent:"center",transform:"rotate(180deg)",transformOrigin:"center","& svg":{width:15,height:15,display:"block"}}},MP=()=>c.jsx(g.Box,{"aria-hidden":!0,component:"span",sx:hC.outer,children:c.jsx(g.Box,{component:"span",sx:hC.frame,children:c.jsx(g.Box,{component:"span",sx:hC.rotate,children:c.jsx(PP,{})})})}),jP=g.styled("img")`
|
|
1563
|
+
`,DP=({name:e,variables:t,customFields:n,onOptionClick:r})=>{const[o,A]=m.useState(""),s=m.useMemo(()=>t.filter(C=>C.title.toLowerCase().includes(o.toLowerCase())),[t,o]),{activeField:a,anchorEl:i,onEnter:l,onLeave:u}=um(),d=C=>{var E;A(((E=C==null?void 0:C.target)==null?void 0:E.value)||"")},f=C=>{if(!C)return;const E=am(C);r({title:(E==null?void 0:E.label)||"",value:E==null?void 0:E.value})},p=n&&n.length>0,I=!!a&&Array.isArray(a==null?void 0:a.options)&&a.options.length>0;return c.jsxs(vP,{children:[c.jsx(SP,{value:o,onChange:d,InputProps:{startAdornment:c.jsx(_P,{children:c.jsx(g.icons.Search,{sx:{fontSize:18,color:g.theme.palette.gray.gray3,flexShrink:0}})})},placeholder:"Search variables",variant:"outlined"}),p&&c.jsx(c.Fragment,{children:c.jsx(fm,{variant:"body2_medium",children:"Variables"})}),s.map(({value:C,title:E},h)=>c.jsx(g.Tooltip,{title:E,placement:"top",arrow:!0,children:c.jsx(Cm,{onClick:()=>r({title:E,value:C}),children:c.jsx(Em,{variant:"body2",children:E})})},`${E}-${C}-${h}`)),p&&c.jsxs(c.Fragment,{children:[c.jsx(fm,{variant:"h2",children:"Custom Objects"}),n==null?void 0:n.map(({id:C,name:E,options:h})=>c.jsx(g.Tooltip,{title:E,placement:"top",arrow:!0,children:c.jsx(Cm,{onPointerEnter:B=>{B.pointerType==="touch"||!h.length||l({field:{id:C,name:E,options:h},currentTarget:B.currentTarget})},onPointerLeave:B=>{B.pointerType==="touch"||!h.length||u()},sx:{cursor:h.length?"pointer":"default"},children:c.jsx(Em,{variant:"body2",children:E})})},C))]}),c.jsx(dm,{name:e,customValue:null,popperOpen:I,anchorEl:i,zIndex:xP.POPPER,activeField:a,onEnter:l,onLeave:u,onChange:f})]})},OP=({setOpen:e})=>{const t=()=>{e(n=>!n)};return c.jsx(wP,{onClick:t,tabIndex:0,children:c.jsx(g.icons.Add,{sx:{fontSize:"12px",color:"#4d596c"}})})},LP=({name:e,variables:t,customFields:n,onOptionClick:r})=>{const[o,A]=m.useState(!1),s=a=>{A(!1),r(a)};return c.jsx(g.ClickAwayListener,{onClickAway:()=>{A(!1)},children:c.jsx(g.Box,{children:c.jsx(g.Tooltip,{title:c.jsx(DP,{name:e,variables:t,customFields:n,onOptionClick:s}),placement:"bottom-end",arrow:!1,open:o,PopperProps:{sx:{"& .MuiTooltip-popper":{zIndex:2e3},"& .MuiTooltip-tooltip":{backgroundColor:"transparent",color:"inherit",padding:0,boxShadow:"none",fontSize:"inherit"}}},children:c.jsx(g.Box,{children:c.jsx(OP,{setOpen:A})})})})})},FP=()=>{const e=m.useRef(0),t=m.useRef(null);return{onBlur:A=>{var a;const s=((a=A==null?void 0:A.target)==null?void 0:a.selectionStart)??0;e.current=s},inputRef:t,focusInput:(A=0)=>{var l;const s=t.current;if(!s)return;const a=e.current+A;(l=s.focus)==null||l.call(s),(window.requestAnimationFrame??window.setTimeout)(()=>{var u;(u=s.setSelectionRange)==null||u.call(s,a,a)})},insertVariable:(A,s)=>{const a=e.current;return A.slice(0,a)+s+A.slice(a)}}},NP=({name:e,type:t,value:n,label:r,variables:o,hasError:A,limit:s,multiline:a=!1,customFields:i,isRequired:l=!1,onChange:u,setError:d})=>{const{onBlur:f,inputRef:p,focusInput:I,insertVariable:C}=FP(),E=t==="date"?o.filter(y=>y.isDate):o,h=VQ(y=>{let b=Wk(y);t==="date"&&(b=zk(y)),l&&!y&&(b=`${r} is required`),d(b)},1e3),B=y=>{u(y),h(y)},Q=({value:y})=>{const b=C(n,y);B(b),I(y==null?void 0:y.length)};return c.jsx(lP,{inputRef:p,value:n,onChange:B,onBlur:f,placeholder:"Value",hasError:A,limit:s,multiline:a,InputProps:{endAdornment:E.length>0?c.jsx(TP,{style:{justifyContent:a?"flex-end":"center",padding:"10px"},children:c.jsx(LP,{name:e,variables:E,customFields:i,onOptionClick:Q})}):null}})},RP=({name:e,value:t,placeholder:n,searchPlaceholder:r="Search",formData:o,interfaceDetails:A,customFields:s=[],className:a,hasApiSearch:i=!1,zIndex:l=3e3,fetchOptions:u,onChange:d})=>{const[f,p]=m.useState(!1),[I,C]=m.useState("options"),{activeField:E,anchorEl:h,onEnter:B,onLeave:Q}=um(),y=jk(t),{selectedValue:b,search:v,optionsProps:w,observerProps:x,filteredOptions:T,paginationEnabled:V,labelsMap:D,setSearch:N}=im({value:y?void 0:t,interfaceDetails:A,formData:o,fieldKey:e,hasApiSearch:i,fetchOptions:u}),{parentRef:H}=x,L=U=>{const P=am(U);P&&(d(P),Q(),p(!1))},q=U=>{const P=String(U.target.value);if(P===lm)return;const F=D[P];d({value:P,label:F}),Q(),p(!1)},ne=U=>P=>{P.preventDefault(),P.stopPropagation(),C(U),Q()},le=I==="custom"&&Array.isArray(E==null?void 0:E.options)&&E.options.length>0,fe=()=>{if(!t)return c.jsx(_c,{children:n});const[U,P]=t.label.split(" > ");return y?c.jsxs(mP,{children:[c.jsx(_c,{children:U}),c.jsx(g.icons.ChevronRightOutlined,{sx:{fontSize:"18px"}}),c.jsx(_c,{children:P})]}):c.jsx(_c,{children:t.label})};return m.useEffect(()=>{if(!(t!=null&&t.value)||!f)return;const U=sm(t.value)?"custom":"options";C(U)},[t,f]),c.jsxs(g.FormControl,{fullWidth:!0,sx:dP,className:a,children:[c.jsxs(g.Select,{id:e,displayEmpty:!0,value:b,variant:"outlined",size:"small",sx:CP,open:f,onOpen:()=>{p(!0),C("options")},onClose:()=>{p(!1),Q()},renderValue:fe,MenuProps:{autoFocus:!1,sx:{zIndex:l},PaperProps:{sx:cP},MenuListProps:{sx:uP,ref:H}},onChange:q,children:[c.jsx(g.ListSubheader,{sx:gP,children:c.jsxs(g.Box,{sx:IP,children:[c.jsx(g.Box,{component:"button",type:"button",sx:gm(I==="options"),onClick:ne("options"),children:c.jsx(g.Typography,{variant:"caption",fontSize:14,fontWeight:400,color:"inherit",children:"Options"})}),c.jsx(g.Box,{component:"button",type:"button",sx:gm(I==="custom"),onClick:ne("custom"),children:c.jsx(g.Typography,{variant:"caption",fontSize:14,fontWeight:400,color:"inherit",children:"Custom Object"})})]})}),I==="options"?cm({selectedValue:b,search:v,searchPlaceholder:r,paginationEnabled:V,filteredOptions:T,observerProps:x,optionsProps:w,setSearch:N,searchOffset:52}):s.map(U=>{const P=U.options.length>0;return c.jsxs(g.ListSubheader,{onPointerEnter:F=>{F.pointerType==="touch"||!P||B({field:U,currentTarget:F.currentTarget})},onPointerLeave:F=>{F.pointerType==="touch"||!P||Q()},sx:fP(P&&(E==null?void 0:E.id)===U.id),"data-field-id":U.id,children:[c.jsx("span",{style:{minWidth:0,flex:1,textAlign:"left"},children:U.name}),P?c.jsx(g.icons.PlayArrow,{sx:BP}):null]},U.id)})]}),c.jsx(dm,{name:e,customValue:y,popperOpen:le,anchorEl:h,zIndex:l,activeField:E,onEnter:B,onLeave:Q,onChange:L})]})},kP=({field:e,formId:t,value:n,formValues:r,variables:o,customFields:A,errors:s,checkMandatory:a,setError:i,fetchOptions:l,setFormValues:u,onFieldChange:d})=>{var Q,y;const f=m.useMemo(()=>UQ(500),[]),p=b=>{u(v=>({...v,[e.name]:b})),f(()=>{d==null||d({name:e.name,value:b,type:e.type})})},I=s[e.name],C=I?c.jsx(g.Tooltip,{title:I,placement:"bottom",children:c.jsx(iP,{variant:"body2",fontSize:"13px",color:g.theme.palette.error.main,children:I})}):null,h=Array.isArray(A)&&A.length>0?c.jsx(RP,{customFields:A??[],interfaceDetails:e.interfaceDetails??e.searchInterfaceDetails,formData:r,fetchOptions:b=>l(b,{formId:t,fieldName:e.name}),name:e.name,value:n,placeholder:"Select object",hasApiSearch:!!e.searchInterfaceDetails,onChange:p}):c.jsx(sP,{fieldKey:`${t}-${e.name}`,interfaceDetails:e.interfaceDetails??e.searchInterfaceDetails,value:n,fetchOptions:b=>l(b,{formId:t,fieldName:e.name}),disabled:e.disabled,placeholder:e.placeholder??"Select",menuZIndex:bP,formData:r,hasApiSearch:!!e.searchInterfaceDetails,onChange:p}),B=Mk(e)?h:c.jsx(NP,{name:e.name,label:e.label,type:e.type,variables:o,value:r[e.name]??"",isRequired:a&&!!((Q=e.validations)!=null&&Q.isRequired),onChange:p,hasError:!!I,limit:(y=e.validations)==null?void 0:y.maxCharacters,multiline:e.type==="multiline",setError:b=>i({name:e.name,value:b}),customFields:A});return c.jsxs(g.Stack,{direction:"row",alignItems:"center",gap:"4px",position:"relative",children:[B,C]})},PP=e=>_.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:15,height:15,viewBox:"0 0 15 15",fill:"none",...e},_.createElement("g",{clipPath:"url(#clip0_833_38792)"},_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.4 2.52266C11.4 2.86744 11.537 3.1981 11.7808 3.4419C12.0246 3.68569 12.3552 3.82266 12.7 3.82266C13.0448 3.82266 13.3754 3.68569 13.6192 3.4419C13.863 3.1981 14 2.86744 14 2.52266C14 2.17788 13.863 1.84722 13.6192 1.60342C13.3754 1.35962 13.0448 1.22266 12.7 1.22266C12.3552 1.22266 12.0246 1.35962 11.7808 1.60342C11.537 1.84722 11.4 2.17788 11.4 2.52266ZM1 2.52266C1 2.86744 1.13696 3.1981 1.38076 3.44189C1.62456 3.68569 1.95522 3.82266 2.3 3.82266C2.64478 3.82266 2.97544 3.68569 3.21924 3.44189C3.46304 3.1981 3.6 2.86744 3.6 2.52266C3.6 2.17788 3.46304 1.84721 3.21924 1.60342C2.97544 1.35962 2.64478 1.22266 2.3 1.22266C1.95522 1.22266 1.62456 1.35962 1.38076 1.60342C1.13696 1.84721 1 2.17787 1 2.52266Z",fill:"#7853FF",stroke:"#7853FF",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round"}),_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.4 12.3449C11.4 12.6897 11.537 13.0204 11.7808 13.2642C12.0246 13.508 12.3552 13.6449 12.7 13.6449C13.0448 13.6449 13.3754 13.508 13.6192 13.2642C13.863 13.0204 14 12.6897 14 12.3449C14 12.0001 13.863 11.6695 13.6192 11.4257C13.3754 11.1819 13.0448 11.0449 12.7 11.0449C12.3552 11.0449 12.0246 11.1819 11.7808 11.4257C11.537 11.6695 11.4 12.0001 11.4 12.3449ZM1 12.3449C1 12.6897 1.13696 13.0204 1.38076 13.2642C1.62456 13.508 1.95522 13.6449 2.3 13.6449C2.64478 13.6449 2.97544 13.508 3.21924 13.2642C3.46304 13.0204 3.6 12.6897 3.6 12.3449C3.6 12.0001 3.46304 11.6695 3.21924 11.4257C2.97544 11.1819 2.64478 11.0449 2.3 11.0449C1.95522 11.0449 1.62456 11.1819 1.38076 11.4257C1.13696 11.6695 1 12.0001 1 12.3449Z",fill:"#7853FF",stroke:"#7853FF",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round"}),_.createElement("path",{d:"M11.3984 2.52344L3.59844 2.52344L5.77656 2.52344",stroke:"#7853FF",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round"}),_.createElement("path",{d:"M11.3984 12.3457L3.59844 12.3457L5.77656 12.3457",stroke:"#7853FF",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round"})),_.createElement("defs",null,_.createElement("clipPath",{id:"clip0_833_38792"},_.createElement("rect",{width:15,height:15,fill:"white",transform:"translate(15) rotate(90)"})))),hC={outer:{display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,bgcolor:"#f3ebff",p:"6px",borderRadius:"8px"},frame:{width:24,height:24,overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center"},rotate:{display:"flex",alignItems:"center",justifyContent:"center",transform:"rotate(180deg)",transformOrigin:"center","& svg":{width:15,height:15,display:"block"}}},MP=()=>c.jsx(g.Box,{"aria-hidden":!0,component:"span",sx:hC.outer,children:c.jsx(g.Box,{component:"span",sx:hC.frame,children:c.jsx(g.Box,{component:"span",sx:hC.rotate,children:c.jsx(PP,{})})})}),jP=g.styled("img")`
|
|
1564
1564
|
width: 16px;
|
|
1565
1565
|
height: auto;
|
|
1566
1566
|
object-fit: cover;
|
|
@@ -1620,7 +1620,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1620
1620
|
display: inline-block;
|
|
1621
1621
|
color: inherit;
|
|
1622
1622
|
}
|
|
1623
|
-
`,UP={borderRadius:"0 !important",padding:"0 !important",width:"max-content !important",maxWidth:"max-content !important",height:"100% !important",maxHeight:"100% !important",position:"fixed",boxSizing:"border-box !important",top:0,bottom:0,right:0,margin:0};function $P(e){return e.name??e.rowId}const Im=({open:e,onClose:t,formId:n,fields:r,variables:o,connectorLogo:A,isSaving:s,title:a
|
|
1623
|
+
`,UP={borderRadius:"0 !important",padding:"0 !important",width:"max-content !important",maxWidth:"max-content !important",height:"100% !important",maxHeight:"100% !important",position:"fixed",boxSizing:"border-box !important",top:0,bottom:0,right:0,margin:0};function $P(e){return e.name??e.rowId}const Im=({open:e,onClose:t,formId:n,fields:r,variables:o,connectorLogo:A,isSaving:s,title:a,isLoading:i=!1,defaultValues:l,customFields:u,checkMandatory:d=!1,fetchOptions:f,onSave:p,onCancel:I,onFieldChange:C})=>{const[E,h]=m.useState({}),[B,Q]=m.useState({}),[y,b]=m.useState(!1),v=m.useMemo(()=>UQ(500),[]),w=m.useMemo(()=>{if(!Array.isArray(r)||!r.length)return[];const H=new Set;return r.filter(q=>H.has(q.name)?!1:(H.add(q.name),!0)).sort((q,ne)=>q.priority-ne.priority)},[r]),x=({name:H,value:L})=>{Q(q=>{const ne={...q};return L?ne[H]=L:delete ne[H],ne})};m.useEffect(()=>{l&&e&&h({...l})},[l,e]),m.useEffect(()=>()=>{e||(h({}),Q({}))},[e]),m.useEffect(()=>{d&&v(()=>{const L=r.filter(q=>{var ne;return!!((ne=q.validations)!=null&&ne.isRequired)}).filter(q=>!E[q.name]);b(L.length>0)})},[v,E,r,d]);const T=()=>{t(),h({})},V=()=>{I==null||I(),h({}),t()},D=()=>{const H={...E};for(const L in H)H[L]||delete H[L];p(H)},N=Object.keys(B).length>0||y;return c.jsx(g.Dialog,{open:e,onClose:T,PaperProps:{sx:UP},maxWidth:!1,children:i?c.jsx(g.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",width:"615px"},children:c.jsx(g.CircularProgress,{})}):c.jsxs(HP,{children:[c.jsxs(WP,{children:[c.jsxs(g.Stack,{direction:"row",alignItems:"center",gap:2,children:[c.jsx(MP,{}),c.jsx(g.Stack,{gap:.5,flex:1,minWidth:0,children:c.jsxs(g.Stack,{direction:"row",alignItems:"center",gap:.5,children:[c.jsx(g.Typography,{variant:"h6",fontSize:18,fontWeight:600,color:g.theme.palette.gray.gray1,children:a}),c.jsx(g.Tooltip,{title:"Assign default values to create fields",placement:"top",children:c.jsx(g.IconButton,{size:"small","aria-label":"About mapping fields",sx:{padding:"4px"},children:c.jsx(g.icons.InfoOutlined,{sx:{fontSize:18,color:g.theme.palette.gray.gray3}})})})]})})]}),c.jsx(g.Tooltip,{title:"Close",placement:"bottom",children:c.jsx(g.IconButton,{onClick:T,size:"small","aria-label":"Close",children:c.jsx(g.icons.Close,{sx:{fontSize:20}})})})]}),c.jsx(zP,{children:c.jsxs(YP,{children:[c.jsxs(g.Stack,{direction:"row",padding:"16px 24px",sx:{backgroundColor:g.theme.palette.gray.gray6a,borderBottom:"1px solid #ECEFF6",borderRadius:"8px 8px 0 0"},children:[c.jsx(VP,{src:A,alt:"Connector"}),c.jsx(g.Typography,{variant:"caption",fontSize:14,fontWeight:600,color:g.theme.palette.gray.gray3,flex:1,children:"Field"}),c.jsx(g.Typography,{variant:"caption",fontSize:14,fontWeight:600,color:g.theme.palette.gray.gray3,width:320,children:"Map to"})]}),w.map((H,L)=>{var le;const q=$P(H),ne=E[q]??"";return c.jsxs(g.Stack,{direction:"row",alignItems:"center",padding:"24px",gap:2,sx:{borderBottom:L<w.length-1?"1px solid #F6F8FC":void 0,"&:last-child":{borderBottom:"none"}},children:[c.jsx(qP,{children:c.jsxs(g.Typography,{variant:"body2",fontSize:14,color:g.theme.palette.gray.gray2,children:[H.label,d&&((le=H.validations)!=null&&le.isRequired)?c.jsx(ZP,{}):null]})}),c.jsx(GP,{width:20,height:20}),c.jsx(XP,{children:c.jsx(kP,{field:H,formId:String(n),value:ne,formValues:E,variables:o,customFields:u,errors:B,checkMandatory:d,setError:x,fetchOptions:f,setFormValues:h,onFieldChange:C})})]},q)})]})}),c.jsxs(JP,{children:[c.jsx(g.Button,{variant:"contained",onClick:D,sx:{textTransform:"none",padding:"3px 32px !important"},disabled:s||N,children:"Save"}),c.jsx(g.Button,{variant:"outlined",color:"inherit",onClick:V,disabled:s,sx:{textTransform:"none",padding:"3px 12px !important",borderColor:g.theme.palette.gray.gray5},children:"Cancel"})]})]})})};g.styled(g.Box)`
|
|
1624
1624
|
position: fixed;
|
|
1625
1625
|
inset: 0;
|
|
1626
1626
|
z-index: ${({zIndex:e})=>e};
|
|
@@ -1768,7 +1768,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1768
1768
|
width: 100vw;
|
|
1769
1769
|
height: 100vh;
|
|
1770
1770
|
padding: 20px;
|
|
1771
|
-
`,tj=()=>{const e=Mo(),t=At(KM),n=At($M);return m.useEffect(()=>{const r=new URLSearchParams(window.location.search),o=r.get(B7),A=r.get(p7);window.opener&&A&&o&&e(ul({data:{token:o},connectorId:A}))},[e]),m.useEffect(()=>{window.opener&&t&&window.opener.postMessage(n===Se.FAILED?a0:Md,window.location.origin)},[t,n]),c.jsxs(ej,{children:[c.jsx("h1",{children:"Authentication Complete"}),c.jsx("p",{children:"Redirecting..."})]})},nj=e=>SB([{path:et.BASEPATH,element:c.jsx(T_,{}),children:[{index:!0,element:c.jsx(jp,{})},{path:et.DASHBOARD,element:c.jsx(jp,{})},{path:et.AGENT,element:c.jsx(
|
|
1771
|
+
`,tj=()=>{const e=Mo(),t=At(KM),n=At($M);return m.useEffect(()=>{const r=new URLSearchParams(window.location.search),o=r.get(B7),A=r.get(p7);window.opener&&A&&o&&e(ul({data:{token:o},connectorId:A}))},[e]),m.useEffect(()=>{window.opener&&t&&window.opener.postMessage(n===Se.FAILED?a0:Md,window.location.origin)},[t,n]),c.jsxs(ej,{children:[c.jsx("h1",{children:"Authentication Complete"}),c.jsx("p",{children:"Redirecting..."})]})},nj=e=>SB([{path:et.BASEPATH,element:c.jsx(T_,{}),children:[{index:!0,element:c.jsx(jp,{})},{path:et.DASHBOARD,element:c.jsx(jp,{})},{path:et.AGENT,element:c.jsx(L4,{})},{path:`${et.API_VIEW}/:id`,element:c.jsx(d7,{})}]},{path:`${et.CONNECTOR_SETTINGS}/:id`,element:c.jsx(UM,{})},{path:et.AUTH_SUCCESS,element:c.jsx(tj,{})}],{basename:e}),rj=({basename:e="/",metaData:t,userId:n})=>{var o;const r=m.useMemo(()=>nj(e),[e]);return(o=t==null?void 0:t.templateUpdates)!=null&&o.version&&n&&(B6(t.templateUpdates.version),m6(n)),c.jsx(LB,{router:r})},oj=g.styled(g.Box)`
|
|
1772
1772
|
padding: 43px 0px 0 35px;
|
|
1773
1773
|
box-sizing: border-box;
|
|
1774
1774
|
width: 100%;
|
|
@@ -1852,7 +1852,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1852
1852
|
}
|
|
1853
1853
|
`,Om=g.styled(g.Typography)`
|
|
1854
1854
|
white-space: pre;
|
|
1855
|
-
`,Ej="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.44441%207.72259C1.2339%206.35423%201.02339%204.98592%200.812876%203.61756C0.766191%203.31424%201.11132%203.10736%201.35682%203.2915C2.01269%203.7834%202.66853%204.27527%203.32439%204.76717C3.54034%204.92913%203.84799%204.87642%203.9977%204.65182L5.63574%202.19474C5.80885%201.93509%206.19035%201.93509%206.36346%202.19474L8.0015%204.65182C8.15121%204.87642%208.45886%204.92909%208.67481%204.76717C9.33068%204.27527%209.98651%203.7834%2010.6424%203.2915C10.8879%203.10736%2011.233%203.31424%2011.1864%203.61756C10.9758%204.98592%2010.7653%206.35423%2010.5548%207.72259H1.44441Z'%20fill='white'/%3e%3cpath%20d='M10.0788%2010.0027H1.91834C1.65602%2010.0027%201.44336%209.79009%201.44336%209.52777V8.48438H10.5538V9.52777C10.5537%209.79009%2010.3411%2010.0027%2010.0788%2010.0027Z'%20fill='white'/%3e%3c/svg%3e",fj=({availableFeatures:e})=>{const t=n=>{n.stopPropagation(),Pr(e,kB)&&Qf()};return c.jsxs(oj,{children:[c.jsx(sj,{children:c.jsx(wg,{variant:"h2",children:Zu})}),c.jsxs(aj,{children:[c.jsxs(ij,{children:[c.jsxs(cj,{children:[c.jsx("img",{src:Ej}),c.jsx(uj,{variant:"caption",children:pb})]}),c.jsx(wg,{variant:"h2",children:Zu}),c.jsx(gj,{variant:"body2",children:hb}),c.jsxs(Dm,{children:[c.jsx(dj,{children:Qb}),c.jsx(Cj,{variant:"outlined",children:mb})]}),c.jsxs(Aj,{children:[c.jsx(Om,{variant:"body1",children:yb})," ",c.jsx(Om,{component:"a",variant:"body1",color:"#1a70e0",onClick:n=>t(n),children:ff})]})]}),c.jsx(lj,{children:c.jsx("img",{src:
|
|
1855
|
+
`,Ej="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.44441%207.72259C1.2339%206.35423%201.02339%204.98592%200.812876%203.61756C0.766191%203.31424%201.11132%203.10736%201.35682%203.2915C2.01269%203.7834%202.66853%204.27527%203.32439%204.76717C3.54034%204.92913%203.84799%204.87642%203.9977%204.65182L5.63574%202.19474C5.80885%201.93509%206.19035%201.93509%206.36346%202.19474L8.0015%204.65182C8.15121%204.87642%208.45886%204.92909%208.67481%204.76717C9.33068%204.27527%209.98651%203.7834%2010.6424%203.2915C10.8879%203.10736%2011.233%203.31424%2011.1864%203.61756C10.9758%204.98592%2010.7653%206.35423%2010.5548%207.72259H1.44441Z'%20fill='white'/%3e%3cpath%20d='M10.0788%2010.0027H1.91834C1.65602%2010.0027%201.44336%209.79009%201.44336%209.52777V8.48438H10.5538V9.52777C10.5537%209.79009%2010.3411%2010.0027%2010.0788%2010.0027Z'%20fill='white'/%3e%3c/svg%3e",fj=({availableFeatures:e})=>{const t=n=>{n.stopPropagation(),Pr(e,kB)&&Qf()};return c.jsxs(oj,{children:[c.jsx(sj,{children:c.jsx(wg,{variant:"h2",children:Zu})}),c.jsxs(aj,{children:[c.jsxs(ij,{children:[c.jsxs(cj,{children:[c.jsx("img",{src:Ej}),c.jsx(uj,{variant:"caption",children:pb})]}),c.jsx(wg,{variant:"h2",children:Zu}),c.jsx(gj,{variant:"body2",children:hb}),c.jsxs(Dm,{children:[c.jsx(dj,{children:Qb}),c.jsx(Cj,{variant:"outlined",children:mb})]}),c.jsxs(Aj,{children:[c.jsx(Om,{variant:"body1",children:yb})," ",c.jsx(Om,{component:"a",variant:"body1",color:"#1a70e0",onClick:n=>t(n),children:ff})]})]}),c.jsx(lj,{children:c.jsx("img",{src:_4})})]})]})},Ij=g.styled(g.Box)`
|
|
1856
1856
|
height: 100%;
|
|
1857
1857
|
& > div {
|
|
1858
1858
|
height: 100%;
|
|
@@ -2948,7 +2948,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
2948
2948
|
`,XC=({shown:e,connectorName:t,setShown:n,onClose:r})=>{const o=C1,A=()=>{n(!1),r==null||r()},s=`${t} ${hW}`;return c.jsxs(Os,{shown:e,setShown:n,onClose:A,showCloseButton:!0,children:[c.jsxs("div",{className:"flex flex-col gap-[14px] p-[30px] w-[378px] justify-center ",children:[c.jsx("img",{src:d1,alt:"checkmark",width:92,height:92}),c.jsxs("div",{children:[c.jsx(g.Typography,{className:"pb-1",variant:"h2",children:s}),c.jsx(g.Typography,{variant:"body2",children:QW})]}),c.jsx("div",{className:"items-start",children:c.jsx(g.Button,{onClick:A,children:mW})})]}),c.jsx(yW,{children:c.jsx("img",{className:"connector-enabled-img",src:o,alt:"App enabled"})})]})},bW="data:image/svg+xml,%3csvg%20width='21'%20height='20'%20viewBox='0%200%2021%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cmask%20id='mask0_10035_17637'%20style='mask-type:alpha'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='21'%20height='20'%3e%3crect%20x='20.6951'%20width='20'%20height='20'%20transform='rotate(90%2020.6951%200)'%20fill='%23D9D9D9'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_10035_17637)'%3e%3cpath%20d='M10.6951%2010.4974L14.5284%206.66406L15.6951%207.83073L10.6951%2012.8307L5.69507%207.83073L6.86174%206.66406L10.6951%2010.4974Z'%20fill='%236F7C90'/%3e%3c/g%3e%3c/svg%3e",xW=g.styled("img")`
|
|
2949
2949
|
transition: transform 0.3s;
|
|
2950
2950
|
transform: rotate(${e=>e.transformAngle}deg);
|
|
2951
|
-
`,vW=e=>_.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},_.createElement("g",{clipPath:"url(#clip0_3297_163628)"},_.createElement("path",{d:"M9.99967 5.41667C13.158 5.41667 15.9747 7.19167 17.3497 10C15.9747 12.8083 13.1663 14.5833 9.99967 14.5833C6.83301 14.5833 4.02467 12.8083 2.64967 10C4.02467 7.19167 6.84134 5.41667 9.99967 5.41667ZM9.99967 3.75C5.83301 3.75 2.27467 6.34167 0.833008 10C2.27467 13.6583 5.83301 16.25 9.99967 16.25C14.1663 16.25 17.7247 13.6583 19.1663 10C17.7247 6.34167 14.1663 3.75 9.99967 3.75ZM9.99967 7.91667C11.1497 7.91667 12.083 8.85 12.083 10C12.083 11.15 11.1497 12.0833 9.99967 12.0833C8.84967 12.0833 7.91634 11.15 7.91634 10C7.91634 8.85 8.84967 7.91667 9.99967 7.91667ZM9.99967 6.25C7.93301 6.25 6.24967 7.93333 6.24967 10C6.24967 12.0667 7.93301 13.75 9.99967 13.75C12.0663 13.75 13.7497 12.0667 13.7497 10C13.7497 7.93333 12.0663 6.25 9.99967 6.25Z",fill:"#3E4C5A"})),_.createElement("defs",null,_.createElement("clipPath",{id:"clip0_3297_163628"},_.createElement("rect",{width:20,height:20,fill:"white"})))),wW=e=>_.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},_.createElement("mask",{id:"mask0_3354_177768",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:20,height:20},_.createElement("rect",{width:20,height:20,fill:"#D9D9D9"})),_.createElement("g",{mask:"url(#mask0_3354_177768)"},_.createElement("path",{d:"M13.2708 11.1462L11.9792 9.85449C12.0347 9.32671 11.875 8.87185 11.5 8.48991C11.125 8.10796 10.6736 7.94477 10.1458 8.00033L8.85417 6.70866C9.03472 6.63921 9.22222 6.58713 9.41667 6.55241C9.61111 6.51769 9.80556 6.50033 10 6.50033C10.9722 6.50033 11.7986 6.8406 12.4792 7.52116C13.1597 8.20171 13.5 9.0281 13.5 10.0003C13.5 10.1948 13.4826 10.3892 13.4479 10.5837C13.4132 10.7781 13.3542 10.9656 13.2708 11.1462ZM16.0417 13.917L14.9583 12.8337C15.4583 12.4448 15.9132 12.0177 16.3229 11.5524C16.7326 11.0871 17.0764 10.5698 17.3542 10.0003C16.6736 8.59755 15.6701 7.49685 14.3438 6.69824C13.0174 5.89963 11.5694 5.50033 10 5.50033C9.63889 5.50033 9.28472 5.52116 8.9375 5.56283C8.59028 5.60449 8.25 5.67394 7.91667 5.77116L6.70833 4.56283C7.23611 4.35449 7.77431 4.20866 8.32292 4.12533C8.87153 4.04199 9.43056 4.00033 10 4.00033C11.9861 4.00033 13.8021 4.53852 15.4479 5.61491C17.0938 6.6913 18.2778 8.1531 19 10.0003C18.6944 10.792 18.2882 11.5107 17.7812 12.1566C17.2743 12.8024 16.6944 13.3892 16.0417 13.917ZM16 18.1253L13.2917 15.417C12.7639 15.6114 12.2257 15.7573 11.6771 15.8545C11.1285 15.9517 10.5694 16.0003 10 16.0003C8.01389 16.0003 6.19792 15.4621 4.55208 14.3857C2.90625 13.3094 1.72222 11.8475 1 10.0003C1.30556 9.20866 1.70833 8.48644 2.20833 7.83366C2.70833 7.18088 3.29167 6.5906 3.95833 6.06283L1.875 3.97949L2.9375 2.91699L17.0625 17.0628L16 18.1253ZM5.02083 7.14616C4.53472 7.53505 4.08333 7.96213 3.66667 8.42741C3.25 8.89269 2.90972 9.41699 2.64583 10.0003C3.32639 11.4031 4.32986 12.5038 5.65625 13.3024C6.98264 14.101 8.43056 14.5003 10 14.5003C10.3611 14.5003 10.7153 14.476 11.0625 14.4274C11.4097 14.3788 11.7569 14.3128 12.1042 14.2295L11.1667 13.292C10.9722 13.3614 10.7778 13.4135 10.5833 13.4482C10.3889 13.483 10.1944 13.5003 10 13.5003C9.02778 13.5003 8.20139 13.16 7.52083 12.4795C6.84028 11.7989 6.5 10.9725 6.5 10.0003C6.5 9.80588 6.52431 9.61144 6.57292 9.41699C6.62153 9.22255 6.66667 9.0281 6.70833 8.83366L5.02083 7.14616Z",fill:"#6F7C90"}))),TW=e=>_.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:18,height:18,viewBox:"0 0 18 18",fill:"#97A3B7",...e},_.createElement("path",{d:"M11.06 6.02L11.98 6.94L2.92 16H2V15.08L11.06 6.02ZM14.66 0C14.41 0 14.15 0.1 13.96 0.29L12.13 2.12L15.88 5.87L17.71 4.04C18.1 3.65 18.1 3.02 17.71 2.63L15.37 0.29C15.17 0.09 14.92 0 14.66 0ZM11.06 3.19L0 14.25V18H3.75L14.81 6.94L11.06 3.19Z",fill:"currentColor"})),SW=async({cardId:e,formType:t})=>{const n=new URLSearchParams;n.append("form_type",t);const r=await Me({url:cr(`${bV}?${n.toString()}`,{cardId:e}),method:Gt.GET});return(r==null?void 0:r.data).formsList.find(s=>s.type===t)},_W=({cardId:e,formType:t,enabled:n})=>go({queryKey:["fetchFormData",e,t],queryFn:()=>SW({cardId:e,formType:t}),enabled:!!e&&!!t&&n}),B1=(e,t,n="email")=>{const r=new URLSearchParams;return r.append("channel_type",n),Me({url:cr(`${yV}?${r.toString()}`,e),method:Gt.POST,data:t})},DW=async({formId:e})=>{try{const t=await Me({url:cr(zm,{formId:e}),method:Gt.GET}),n=t==null?void 0:t.data;return n.enabled?$Q(n.defaults):{}}catch(t){throw console.error(t),t}},p1=({formId:e})=>["Global","WriteForm","FormDefaults",e],OW=({formId:e,enabled:t})=>{const n=m.useRef(!0),r=go({queryKey:p1({formId:e}),queryFn:async()=>{const o=await DW({formId:e});return n.current=!1,o},refetchOnMount:!0,enabled:n.current&&!!e&&t,staleTime:0});return{enabledRef:n,...r}},LW=async({formId:e,data:t})=>{try{return await Me({url:cr(zm,{formId:e}),data:{defaults:t},method:Gt.PUT}),{formId:e,data:t}}catch(n){throw console.error(n),n}},FW=({formId:e,onSuccess:t,onError:n})=>{const r=Do();return ZA({mutationFn:o=>LW({formId:e,data:o}),onSuccess:o=>{r.invalidateQueries({queryKey:p1({formId:e})}),Vn({message:"Form defaults updated successfully",type:es}),t==null||t(o)},onError:()=>{n==null||n(),Vn({message:"Failed to update form defaults",type:Co})}})},NW=({open:e,formId:t,fields:n,connectorLogo:r,variables:o,customFormArgsEnabled:A,customFormArgsMap:s,title:a="Pre-fill fields",isLoading:i=!1,onSuccess:l,onClose:u})=>{const[d,f]=m.useState({}),{data:p}=ZQ({formId:t,formData:d,argsMap:s??{},enabled:A,delay:500}),{data:I,enabledRef:C,isLoading:E}=OW({formId:t,enabled:!!e&&!!t}),{mutate:h,isPending:B}=FW({formId:t,onSuccess:x=>{l==null||l(x),C.current=!0}}),Q=m.useMemo(()=>p!=null&&p.length?[...n,...p]:n,[n,p]);m.useEffect(()=>{I&&f(I)},[I]);const y=x=>{const T=KQ(x,Q??[]);h(T)},b=async({args:x,pagination:T},{formId:V,fieldName:D})=>{const N=await B1({formId:V,fieldName:D},{pagination:T,args:x}),H=Array.isArray(N==null?void 0:N.data.data)?N.data.data:[];return{options:H,hasMore:!!H.length}},v=()=>{u==null||u(),C.current=!0},w=x=>{const T=fC(x.value)?x.value.value:x.value,V=T&&x.type==="multi-select"?[T]:T;f(D=>({...D,[x.name]:V}))};return c.jsx(Im,{open:e,defaultValues:I,formId:t,fields:Q,connectorLogo:r,variables:o,
|
|
2951
|
+
`,vW=e=>_.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},_.createElement("g",{clipPath:"url(#clip0_3297_163628)"},_.createElement("path",{d:"M9.99967 5.41667C13.158 5.41667 15.9747 7.19167 17.3497 10C15.9747 12.8083 13.1663 14.5833 9.99967 14.5833C6.83301 14.5833 4.02467 12.8083 2.64967 10C4.02467 7.19167 6.84134 5.41667 9.99967 5.41667ZM9.99967 3.75C5.83301 3.75 2.27467 6.34167 0.833008 10C2.27467 13.6583 5.83301 16.25 9.99967 16.25C14.1663 16.25 17.7247 13.6583 19.1663 10C17.7247 6.34167 14.1663 3.75 9.99967 3.75ZM9.99967 7.91667C11.1497 7.91667 12.083 8.85 12.083 10C12.083 11.15 11.1497 12.0833 9.99967 12.0833C8.84967 12.0833 7.91634 11.15 7.91634 10C7.91634 8.85 8.84967 7.91667 9.99967 7.91667ZM9.99967 6.25C7.93301 6.25 6.24967 7.93333 6.24967 10C6.24967 12.0667 7.93301 13.75 9.99967 13.75C12.0663 13.75 13.7497 12.0667 13.7497 10C13.7497 7.93333 12.0663 6.25 9.99967 6.25Z",fill:"#3E4C5A"})),_.createElement("defs",null,_.createElement("clipPath",{id:"clip0_3297_163628"},_.createElement("rect",{width:20,height:20,fill:"white"})))),wW=e=>_.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},_.createElement("mask",{id:"mask0_3354_177768",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:20,height:20},_.createElement("rect",{width:20,height:20,fill:"#D9D9D9"})),_.createElement("g",{mask:"url(#mask0_3354_177768)"},_.createElement("path",{d:"M13.2708 11.1462L11.9792 9.85449C12.0347 9.32671 11.875 8.87185 11.5 8.48991C11.125 8.10796 10.6736 7.94477 10.1458 8.00033L8.85417 6.70866C9.03472 6.63921 9.22222 6.58713 9.41667 6.55241C9.61111 6.51769 9.80556 6.50033 10 6.50033C10.9722 6.50033 11.7986 6.8406 12.4792 7.52116C13.1597 8.20171 13.5 9.0281 13.5 10.0003C13.5 10.1948 13.4826 10.3892 13.4479 10.5837C13.4132 10.7781 13.3542 10.9656 13.2708 11.1462ZM16.0417 13.917L14.9583 12.8337C15.4583 12.4448 15.9132 12.0177 16.3229 11.5524C16.7326 11.0871 17.0764 10.5698 17.3542 10.0003C16.6736 8.59755 15.6701 7.49685 14.3438 6.69824C13.0174 5.89963 11.5694 5.50033 10 5.50033C9.63889 5.50033 9.28472 5.52116 8.9375 5.56283C8.59028 5.60449 8.25 5.67394 7.91667 5.77116L6.70833 4.56283C7.23611 4.35449 7.77431 4.20866 8.32292 4.12533C8.87153 4.04199 9.43056 4.00033 10 4.00033C11.9861 4.00033 13.8021 4.53852 15.4479 5.61491C17.0938 6.6913 18.2778 8.1531 19 10.0003C18.6944 10.792 18.2882 11.5107 17.7812 12.1566C17.2743 12.8024 16.6944 13.3892 16.0417 13.917ZM16 18.1253L13.2917 15.417C12.7639 15.6114 12.2257 15.7573 11.6771 15.8545C11.1285 15.9517 10.5694 16.0003 10 16.0003C8.01389 16.0003 6.19792 15.4621 4.55208 14.3857C2.90625 13.3094 1.72222 11.8475 1 10.0003C1.30556 9.20866 1.70833 8.48644 2.20833 7.83366C2.70833 7.18088 3.29167 6.5906 3.95833 6.06283L1.875 3.97949L2.9375 2.91699L17.0625 17.0628L16 18.1253ZM5.02083 7.14616C4.53472 7.53505 4.08333 7.96213 3.66667 8.42741C3.25 8.89269 2.90972 9.41699 2.64583 10.0003C3.32639 11.4031 4.32986 12.5038 5.65625 13.3024C6.98264 14.101 8.43056 14.5003 10 14.5003C10.3611 14.5003 10.7153 14.476 11.0625 14.4274C11.4097 14.3788 11.7569 14.3128 12.1042 14.2295L11.1667 13.292C10.9722 13.3614 10.7778 13.4135 10.5833 13.4482C10.3889 13.483 10.1944 13.5003 10 13.5003C9.02778 13.5003 8.20139 13.16 7.52083 12.4795C6.84028 11.7989 6.5 10.9725 6.5 10.0003C6.5 9.80588 6.52431 9.61144 6.57292 9.41699C6.62153 9.22255 6.66667 9.0281 6.70833 8.83366L5.02083 7.14616Z",fill:"#6F7C90"}))),TW=e=>_.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:18,height:18,viewBox:"0 0 18 18",fill:"#97A3B7",...e},_.createElement("path",{d:"M11.06 6.02L11.98 6.94L2.92 16H2V15.08L11.06 6.02ZM14.66 0C14.41 0 14.15 0.1 13.96 0.29L12.13 2.12L15.88 5.87L17.71 4.04C18.1 3.65 18.1 3.02 17.71 2.63L15.37 0.29C15.17 0.09 14.92 0 14.66 0ZM11.06 3.19L0 14.25V18H3.75L14.81 6.94L11.06 3.19Z",fill:"currentColor"})),SW=async({cardId:e,formType:t})=>{const n=new URLSearchParams;n.append("form_type",t);const r=await Me({url:cr(`${bV}?${n.toString()}`,{cardId:e}),method:Gt.GET});return(r==null?void 0:r.data).formsList.find(s=>s.type===t)},_W=({cardId:e,formType:t,enabled:n})=>go({queryKey:["fetchFormData",e,t],queryFn:()=>SW({cardId:e,formType:t}),enabled:!!e&&!!t&&n}),B1=(e,t,n="email")=>{const r=new URLSearchParams;return r.append("channel_type",n),Me({url:cr(`${yV}?${r.toString()}`,e),method:Gt.POST,data:t})},DW=async({formId:e})=>{try{const t=await Me({url:cr(zm,{formId:e}),method:Gt.GET}),n=t==null?void 0:t.data;return n.enabled?$Q(n.defaults):{}}catch(t){throw console.error(t),t}},p1=({formId:e})=>["Global","WriteForm","FormDefaults",e],OW=({formId:e,enabled:t})=>{const n=m.useRef(!0),r=go({queryKey:p1({formId:e}),queryFn:async()=>{const o=await DW({formId:e});return n.current=!1,o},refetchOnMount:!0,enabled:n.current&&!!e&&t,staleTime:0});return{enabledRef:n,...r}},LW=async({formId:e,data:t})=>{try{return await Me({url:cr(zm,{formId:e}),data:{defaults:t},method:Gt.PUT}),{formId:e,data:t}}catch(n){throw console.error(n),n}},FW=({formId:e,onSuccess:t,onError:n})=>{const r=Do();return ZA({mutationFn:o=>LW({formId:e,data:o}),onSuccess:o=>{r.invalidateQueries({queryKey:p1({formId:e})}),Vn({message:"Form defaults updated successfully",type:es}),t==null||t(o)},onError:()=>{n==null||n(),Vn({message:"Failed to update form defaults",type:Co})}})},NW=({open:e,formId:t,fields:n,connectorLogo:r,variables:o,customFormArgsEnabled:A,customFormArgsMap:s,title:a="Pre-fill fields",isLoading:i=!1,onSuccess:l,onClose:u})=>{const[d,f]=m.useState({}),{data:p}=ZQ({formId:t,formData:d,argsMap:s??{},enabled:A,delay:500}),{data:I,enabledRef:C,isLoading:E}=OW({formId:t,enabled:!!e&&!!t}),{mutate:h,isPending:B}=FW({formId:t,onSuccess:x=>{l==null||l(x),C.current=!0}}),Q=m.useMemo(()=>p!=null&&p.length?[...n,...p]:n,[n,p]);m.useEffect(()=>{I&&f(I)},[I]);const y=x=>{const T=KQ(x,Q??[]);h(T)},b=async({args:x,pagination:T},{formId:V,fieldName:D})=>{const N=await B1({formId:V,fieldName:D},{pagination:T,args:x}),H=Array.isArray(N==null?void 0:N.data.data)?N.data.data:[];return{options:H,hasMore:!!H.length}},v=()=>{u==null||u(),C.current=!0},w=x=>{const T=fC(x.value)?x.value.value:x.value,V=T&&x.type==="multi-select"?[T]:T;f(D=>({...D,[x.name]:V}))};return c.jsx(Im,{open:e,defaultValues:I,formId:t,fields:Q,connectorLogo:r,variables:o,title:`Pre-fill fields for ${a}`,isLoading:i||E,isSaving:B,fetchOptions:b,onSave:y,onClose:v,onCancel:v,onFieldChange:w})},RW=g.styled(g.Stack)`
|
|
2952
2952
|
flex-direction: row;
|
|
2953
2953
|
white-space: nowrap;
|
|
2954
2954
|
align-items: center;
|
|
@@ -4374,4 +4374,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
4374
4374
|
align-self: auto !important;
|
|
4375
4375
|
margin-left: 12px;
|
|
4376
4376
|
}
|
|
4377
|
-
`,sX=({basename:e,baseUrls:t,extraParams:n={},availableFeatures:r={},connectorFunctions:o,nativeIntegrations:A=[],suggestedAppsMap:s={}})=>{const{userId:a}=yr()||{};return c.jsx("div",{className:"connectorsAdmin-v2",children:c.jsx(IG,{baseUrls:t,availableFeatures:r,extraParams:n,connectorFunctions:o,nativeIntegrations:A,suggestedAppsMap:s,children:Uj(r)?c.jsx(rX,{availableFeatures:r}):c.jsxs(c.Fragment,{children:[c.jsx(HJ,{basename:e,metaData:n.metaData,userId:a}),ot.createPortal(c.jsx(AX,{id:"toast-message",children:c.jsx(yE,{position:"bottom-left",autoClose:5e3,hideProgressBar:!0,newestOnTop:!1,closeOnClick:!0,rtl:!1,draggable:!0,pauseOnHover:!0})}),document.body)]})})})},aX=e=>e.isUnifiedView?c.jsx(sX,{...e}):c.jsx(hj,{...e}),iX=async({formId:e})=>{const t=await Me({url:cr(xV,{formId:e}),method:Gt.GET}),n=t==null?void 0:t.data;if(!n.fieldList.length)throw new Error("Form has no fields");return n},lX=({formId:e,enabled:t})=>go({queryKey:["fetchFormById",e],queryFn:()=>iX({formId:e}),enabled:!!e&&t}),cX=async({entityId:e})=>{try{const t=new URLSearchParams;t.append("entity_type","step_automation");const n=cr(Wm,{entityId:e})+"?"+t.toString(),r=await Me({url:n,method:Gt.GET}),o=r==null?void 0:r.data;return o.enabled?$Q(o.defaults):{}}catch(t){throw console.error(t),t}},n2=({entityId:e})=>["Global","ConnectorLibrary","FormDefaultsById",e],uX=({entityId:e,enabled:t})=>{const n=m.useRef(!0),r=go({queryKey:n2({entityId:e}),queryFn:async()=>{const o=await cX({entityId:e});return n.current=!1,o},refetchOnMount:!0,enabled:n.current&&!!e&&t,staleTime:0});return{enabledRef:n,...r}},gX=async({formId:e,entityId:t,data:n})=>{try{let r;t?r=cr(Wm,{entityId:t}):(console.log("formID",e),r=vV);const o=new URLSearchParams;o.append("entity_type","step_automation"),r+="?"+o.toString();const A=await Me({url:r,data:{defaults:n},method:t?Gt.PUT:Gt.POST}),s=A==null?void 0:A.data;if(!t&&!s.entityId)throw console.error("Entity ID not present in the response",s),new Error("Entity ID not present in the response");return s}catch(r){throw console.error(r),r}},dX=({formId:e,entityId:t,onSuccess:n,onError:r})=>{const o=Do();return ZA({mutationFn:A=>gX({formId:e,entityId:t,data:A}),onSuccess:A=>{t&&o.invalidateQueries({queryKey:n2({entityId:t})}),Vn({message:"Form defaults updated successfully",type:es}),n==null||n(A)},onError:()=>{r==null||r(),Vn({message:"Failed to update form defaults",type:Co})}})},CX=({open:e,formId:t,entityId:n,variables:r,customFields:o,onSuccess:A,onClose:s})=>{const[a,i]=m.useState({}),{data:l,isLoading:u,isError:d}=lX({formId:t,enabled:e&&!!t}),{fieldList:f=[],logoUrl:p,name:I,customFieldsArgs:C,hasCustomFields:E}=l??{},{data:h}=ZQ({formId:t,formData:a,argsMap:C??{},enabled:E||!1,delay:500}),{data:B,enabledRef:Q,isLoading:y}=uX({entityId:n,enabled:!!e&&!!n}),{mutate:b,isPending:v}=dX({formId:t,entityId:n,onSuccess:N=>{A==null||A({...N,entityName:`Default values for ${(l==null?void 0:l.name)||"this form"}`}),Q.current=!0}}),w=m.useMemo(()=>h!=null&&h.length?[...f,...h]:f,[f,h]);m.useEffect(()=>{i(B)},[B]),m.useEffect(()=>{d&&(s==null||s())},[d,s]);const x=N=>{const H=KQ(N,f??[]);b(H)},T=async({args:N,pagination:H},{formId:L,fieldName:q})=>{const ne=await B1({formId:L,fieldName:q},{pagination:H,args:N}),le=Array.isArray(ne==null?void 0:ne.data.data)?ne.data.data:[];return{options:le,hasMore:!!le.length}},V=()=>{s==null||s(),Q.current=!0},D=N=>{const H=fC(N.value)?N.value.value:N.value,L=H&&N.type==="multi-select"?[H]:H;i(q=>({...q,[N.name]:L}))};return c.jsx(Im,{open:e,defaultValues:B,formId:t,fields:w,connectorLogo:p,variables:r,customFields:o,title
|
|
4377
|
+
`,sX=({basename:e,baseUrls:t,extraParams:n={},availableFeatures:r={},connectorFunctions:o,nativeIntegrations:A=[],suggestedAppsMap:s={}})=>{const{userId:a}=yr()||{};return c.jsx("div",{className:"connectorsAdmin-v2",children:c.jsx(IG,{baseUrls:t,availableFeatures:r,extraParams:n,connectorFunctions:o,nativeIntegrations:A,suggestedAppsMap:s,children:Uj(r)?c.jsx(rX,{availableFeatures:r}):c.jsxs(c.Fragment,{children:[c.jsx(HJ,{basename:e,metaData:n.metaData,userId:a}),ot.createPortal(c.jsx(AX,{id:"toast-message",children:c.jsx(yE,{position:"bottom-left",autoClose:5e3,hideProgressBar:!0,newestOnTop:!1,closeOnClick:!0,rtl:!1,draggable:!0,pauseOnHover:!0})}),document.body)]})})})},aX=e=>e.isUnifiedView?c.jsx(sX,{...e}):c.jsx(hj,{...e}),iX=async({formId:e})=>{const t=await Me({url:cr(xV,{formId:e}),method:Gt.GET}),n=t==null?void 0:t.data;if(!n.fieldList.length)throw new Error("Form has no fields");return n},lX=({formId:e,enabled:t})=>go({queryKey:["fetchFormById",e],queryFn:()=>iX({formId:e}),enabled:!!e&&t}),cX=async({entityId:e})=>{try{const t=new URLSearchParams;t.append("entity_type","step_automation");const n=cr(Wm,{entityId:e})+"?"+t.toString(),r=await Me({url:n,method:Gt.GET}),o=r==null?void 0:r.data;return o.enabled?$Q(o.defaults):{}}catch(t){throw console.error(t),t}},n2=({entityId:e})=>["Global","ConnectorLibrary","FormDefaultsById",e],uX=({entityId:e,enabled:t})=>{const n=m.useRef(!0),r=go({queryKey:n2({entityId:e}),queryFn:async()=>{const o=await cX({entityId:e});return n.current=!1,o},refetchOnMount:!0,enabled:n.current&&!!e&&t,staleTime:0});return{enabledRef:n,...r}},gX=async({formId:e,entityId:t,data:n})=>{try{let r;t?r=cr(Wm,{entityId:t}):(console.log("formID",e),r=vV);const o=new URLSearchParams;o.append("entity_type","step_automation"),r+="?"+o.toString();const A=await Me({url:r,data:{defaults:n},method:t?Gt.PUT:Gt.POST}),s=A==null?void 0:A.data;if(!t&&!s.entityId)throw console.error("Entity ID not present in the response",s),new Error("Entity ID not present in the response");return s}catch(r){throw console.error(r),r}},dX=({formId:e,entityId:t,onSuccess:n,onError:r})=>{const o=Do();return ZA({mutationFn:A=>gX({formId:e,entityId:t,data:A}),onSuccess:A=>{t&&o.invalidateQueries({queryKey:n2({entityId:t})}),Vn({message:"Form defaults updated successfully",type:es}),n==null||n(A)},onError:()=>{r==null||r(),Vn({message:"Failed to update form defaults",type:Co})}})},CX=({open:e,formId:t,entityId:n,variables:r,customFields:o,onSuccess:A,onClose:s})=>{const[a,i]=m.useState({}),{data:l,isLoading:u,isError:d}=lX({formId:t,enabled:e&&!!t}),{fieldList:f=[],logoUrl:p,name:I,customFieldsArgs:C,hasCustomFields:E}=l??{},{data:h}=ZQ({formId:t,formData:a,argsMap:C??{},enabled:E||!1,delay:500}),{data:B,enabledRef:Q,isLoading:y}=uX({entityId:n,enabled:!!e&&!!n}),{mutate:b,isPending:v}=dX({formId:t,entityId:n,onSuccess:N=>{A==null||A({...N,entityName:`Default values for ${(l==null?void 0:l.name)||"this form"}`}),Q.current=!0}}),w=m.useMemo(()=>h!=null&&h.length?[...f,...h]:f,[f,h]);m.useEffect(()=>{i(B)},[B]),m.useEffect(()=>{d&&(s==null||s())},[d,s]);const x=N=>{const H=KQ(N,f??[]);b(H)},T=async({args:N,pagination:H},{formId:L,fieldName:q})=>{const ne=await B1({formId:L,fieldName:q},{pagination:H,args:N}),le=Array.isArray(ne==null?void 0:ne.data.data)?ne.data.data:[];return{options:le,hasMore:!!le.length}},V=()=>{s==null||s(),Q.current=!0},D=N=>{const H=fC(N.value)?N.value.value:N.value,L=H&&N.type==="multi-select"?[H]:H;i(q=>({...q,[N.name]:L}))};return c.jsx(Im,{open:e,defaultValues:B,formId:t,fields:w,connectorLogo:p,variables:r,customFields:o,title:`Create ${I}`,isLoading:u||y,isSaving:v,checkMandatory:!0,fetchOptions:T,onSave:x,onClose:V,onCancel:V,onFieldChange:D})},EX=({children:e})=>c.jsx(g.HiverProvider,{inter:!0,children:c.jsx(m.Suspense,{fallback:c.jsx(c.Fragment,{}),children:c.jsx(eB,{children:e})})}),fX=e=>c.jsx(EX,{children:c.jsx(CX,{...e})});ze.AutomationMapDefaults=fX,ze.ConnectorsApp=aX,ze.HiverConnectorBifrostAuth=Me,ze.getConnectorDynamicFieldOptions=Ck,ze.getConnectorFieldDropdownOptions=gk,ze.getConnectorStaticFieldOptions=dk,ze.getConnectorsBifrostConfigs=yr,ze.getEnabledAuthenticatedConnectors=ck,ze.getMetaData=ik,ze.initConnectorsBifrost=ow,Object.defineProperty(ze,Symbol.toStringTag,{value:"Module"})});
|