@hiver/connector-agent 2.0.5-emailSelect-beta.0 → 2.0.5-emailSelect-beta.2
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connector-cards.d.ts","sourceRoot":"","sources":["../../src/app/connector-cards.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAgD,MAAM,OAAO,CAAC;AAoEzE,UAAU,SAAS;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,SAAS,
|
|
1
|
+
{"version":3,"file":"connector-cards.d.ts","sourceRoot":"","sources":["../../src/app/connector-cards.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAgD,MAAM,OAAO,CAAC;AAoEzE,UAAU,SAAS;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,SAAS,CAyRxC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email-selection.d.ts","sourceRoot":"","sources":["../../../../../src/features/connector-cards/components/card-list/email-selection.tsx"],"names":[],"mappings":"AASA,UAAU,MAAM;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AA8ED,eAAO,MAAM,cAAc,wCAAyC,MAAM,
|
|
1
|
+
{"version":3,"file":"email-selection.d.ts","sourceRoot":"","sources":["../../../../../src/features/connector-cards/components/card-list/email-selection.tsx"],"names":[],"mappings":"AASA,UAAU,MAAM;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AA8ED,eAAO,MAAM,cAAc,wCAAyC,MAAM,4CAiCzE,CAAC"}
|
package/index.es.js
CHANGED
|
@@ -41035,7 +41035,9 @@ const Ac = (e) => {
|
|
|
41035
41035
|
onChange: (r) => t(String((r == null ? void 0 : r.value) || "")),
|
|
41036
41036
|
components: { MenuList: NX, Option: UX, SingleValue: LX },
|
|
41037
41037
|
styles: jX,
|
|
41038
|
-
isSearchable: !1
|
|
41038
|
+
isSearchable: !1,
|
|
41039
|
+
closeMenuOnSelect: !1,
|
|
41040
|
+
menuIsOpen: !0
|
|
41039
41041
|
}
|
|
41040
41042
|
);
|
|
41041
41043
|
}, HX = V(ur)`
|
|
@@ -41613,7 +41615,7 @@ const Ac = (e) => {
|
|
|
41613
41615
|
const { email: t, currentSmIds: n, sendTrackingEvent: o, availableFeatures: r, conversationId: i } = Wn(ao), a = Ri(), { userGroupId: A } = Ks() || {}, [l, c] = ve(!1), [u, p] = ve(!1), [g, B] = ve(!1), [C, f] = ve(), [d, E] = ve(!1), [Q, h] = ve(t), m = bt(CW), I = bt(EW), v = bt(hW), b = bt(BW), w = bt(IW), T = bt(iQ), S = bt(sQ), R = bt(aQ), D = bt(AQ), M = Sr(r, YN), k = Sr(r, im), N = Sr(r, JN), L = Dt(() => {
|
|
41614
41616
|
t && n.length && i && a(bl({ inboxIds: n, conversationId: i }));
|
|
41615
41617
|
}, [a, t, n, i]), W = Dt(() => {
|
|
41616
|
-
|
|
41618
|
+
N && i && t && a(wl({ conversationId: i, email: t }));
|
|
41617
41619
|
}, [a, i, t, N]), H = Dt(
|
|
41618
41620
|
(_, ne) => {
|
|
41619
41621
|
_ && i && ne && a(
|
package/index.umd.js
CHANGED
|
@@ -2688,7 +2688,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
2688
2688
|
width: 40px;
|
|
2689
2689
|
height: 40px;
|
|
2690
2690
|
}
|
|
2691
|
-
`,BX=e=>T.createElement("svg",{width:35,height:35,viewBox:"0 0 35 35",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},T.createElement("rect",{x:9,y:9,width:15,height:17,fill:"white"}),T.createElement("g",{clipPath:"url(#clip0_7787_114457)"},T.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"})),T.createElement("defs",null,T.createElement("clipPath",{id:"clip0_7787_114457"},T.createElement("rect",{width:34.396,height:34.396,fill:"white"})))),mX=({aspectRatio:e="auto",...t})=>{const[n,o]=b.useState(!1);return n?null:y.jsxs(hX,{aspectRatio:e,children:[y.jsx("img",{className:"preview-img",onError:()=>o(!0),...t}),y.jsx(BX,{className:"play-icon"})]})},QX={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_HIVER_CDN_URL:"https://cdn.hiverhq.com/",VITE_MY_ENV_VAR:"myVariable From Agent"},{VITE_HIVER_CDN_URL:vX}=QX,IQ=({isAdmin:e=!0,hideHeading:t=!1})=>{const{sendTrackingEvent:n,availableFeatures:o,connectorFunctions:r}=b.useContext(eo),i=br(o,QN),a=c=>{c.stopPropagation(),n(zN),r==null||r.redirectToAdmin()},A=c=>{c.stopPropagation(),n(YN),window.open(XW,"_blank")},l=()=>{n(CU,{source:"main_tab"})};return y.jsxs("div",{"data-testid":"noConnectors",children:[i?y.jsxs(y.Fragment,{children:[t?null:y.jsx(He,{variant:"h2",children:qW}),y.jsx(tz,{onClick:l,href:_W,target:"_blank",children:y.jsx(mX,{src:vX+ZW,alt:JW,aspectRatio:"1000/783"})})]}):y.jsxs($W,{children:[y.jsx(ez,{variant:"body1_medium",children:HW}),y.jsx("img",{src:sz,alt:WW})]}),y.jsx(nz,{variant:"body2",children:zW}),e?y.jsx(dm,{endIcon:y.jsx(Oo.ArrowForward,{}),onClick:a,...i&&{size:"medium"},children:YW}):y.jsxs(y.Fragment,{children:[y.jsx(dm,{onClick:A,children:GW}),y.jsxs(oz,{direction:"row",children:[y.jsx(rz,{}),y.jsx(iz,{variant:"caption",children:KW})]})]})]})},yX=()=>y.jsxs(oB,{children:[y.jsxs(Ne,{direction:"row",marginBottom:"12px",height:"36px",alignItems:"center",children:[y.jsx(tB,{}),y.jsx(nB,{variant:"h2",children:"Connectors"})]}),y.jsxs(Ne,{gap:"12px",children:[y.jsx(ui,{variant:"rounded",width:"100%",height:"46px",animation:"wave"}),y.jsx(ui,{variant:"rounded",width:"100%",height:"46px",animation:"wave"}),y.jsx(ui,{variant:"rounded",width:"100%",height:"46px",animation:"wave"})]})]}),bX=()=>{const{metaData:e,sendTrackingEvent:t,isAdmin:n,connectorFunctions:o}=b.useContext(eo),[r,i]=b.useState(!1),a=b.useRef(null),[A,l]=b.useState(0),{templateUpdates:c}=e||{},{sections:u=[],actionButtons:p=[],title:g}=c||{},{version:B=""}=c||{},C=WN(B),f=b.useMemo(()=>HN(B),[B]),d=b.useMemo(()=>(p==null?void 0:p.filter(({isAdminPanelLink:m})=>!(!n&&m)))??[],[p,n]);if(b.useEffect(()=>{!f&&c&&uf(B,!0)},[f,B,c]),b.useLayoutEffect(()=>{var m;(m=a.current)!=null&&m.scrollHeight&&l(a.current.scrollHeight)},[a]),b.useEffect(()=>{c&&!C&&t(ZN,{update_version_id:B})},[]),!c||C)return null;const E=m=>{var I;m.stopPropagation(),i(v=>!v),(I=a.current)!=null&&I.scrollHeight&&l(a.current.scrollHeight),uf(B,!1,!0)},Q=(m,I="",v=!1,w=!1)=>{var x;if(m.stopPropagation(),v&&w?t(JN,{update_version_id:B}):w&&t(qN,{update_version_id:B}),!v&&I){(x=window.open(I,"_blank"))==null||x.focus();return}h(m,!1),o==null||o.redirectToAdmin()},h=(m,I=!0)=>{m.stopPropagation(),uf(B,!1),i(!1),I&&t($N,{update_version_id:B})};return y.jsxs(fj,{children:[y.jsxs(pj,{children:[y.jsx(gj,{variant:"h3",children:g}),y.jsxs(Et,{children:[r?y.jsx(Rt,{title:ON,placement:"bottom",children:y.jsx(nn,{onClick:h,children:y.jsx(Oo.Close,{sx:{height:"16px",width:"16px",opacity:"0.8"}})})}):null,y.jsx(Rt,{title:r?FN:Af,placement:"bottom",children:y.jsx(di,{onClick:E,children:y.jsx(Ef,{className:r?"":"hiver-up"})})})]})]}),y.jsx(Cj,{className:r?"slideDown":"slideUp",ref:a,height:A,children:y.jsxs(Ej,{children:[u.map(({title:m,items:I,type:v})=>y.jsxs(Qj,{children:[y.jsx(He,{variant:"body2_medium",children:m}),I.map(w=>{const x=v===NN,{deeplink:S,textHtml:O,imageUrl:k}=w,P=()=>y.jsx(oj,{className:x?"":"ellipsisClass",component:"div",variant:"body2",dangerouslySetInnerHTML:{__html:O}});return y.jsx(Ij,{component:"ul",children:y.jsxs(hj,{component:x?"li":"div",marginLeft:k?"0":"14px",children:[k?y.jsx("img",{src:k}):null,S?y.jsx(sB,{target:"_blank",underline:"none",onClick:D=>Q(D,S),fontSize:"13px",children:P()}):P()]})},O)})]},m)),y.jsx(Ne,{flexDirection:"row",gap:"8px",marginBottom:"11.5px",children:d.map(({text:m,link:I,isAdminPanelLink:v})=>y.jsx(Bj,{variant:v?"contained":"text",children:y.jsx(mj,{variant:"caption",onClick:w=>Q(w,I,v,!0),children:m})},m))})]})})]})},hQ=e=>{const t=b.useRef(null),[n,o]=b.useState(!1);return b.useEffect(()=>{t.current&&o(t.current.scrollWidth>t.current.clientWidth)},[e]),{textRef:t,isOverflow:n}},wX=e=>{const{textRef:t,isOverflow:n}=hQ(e.data.label);return y.jsx(Rt,{title:n?e.data.label:null,placement:"bottom",children:y.jsx(vj,{ref:t,variant:"body2",children:e.data.label})})},xX=e=>y.jsxs(Bi.MenuList,{...e,children:[y.jsx(yj,{children:y.jsx(He,{variant:"body2_medium",children:Oj})}),e.children]}),TX=e=>{const{isSelected:t}=e,{textRef:n,isOverflow:o}=hQ(e.data.label);return y.jsx(Bi.Option,{...e,children:y.jsxs(Ne,{direction:"row",gap:"8px",justifyContent:"space-between",children:[y.jsx(Rt,{title:o?e.data.label:null,placement:"bottom",children:y.jsx(wj,{ref:n,className:"dropdown-item-text",variant:"body2",children:e.data.label})}),t&&y.jsx(bj,{})]})})},SX={control:e=>({...e,border:"none",boxShadow:"none",height:"20px","&:hover":{border:"none"},"& > :first-child":{display:"flex !important",alignItems:"center",flexGrow:1}}),option:(e,t)=>({...e,backgroundColor:Fe.palette.gray.white,color:Fe.palette.gray.black,"&:hover":{backgroundColor:t.isFocused?Fe.palette.gray.gray7:Fe.palette.gray.white}}),singleValue:e=>({...e})},FX=({selectedEmail:e,setSelectedEmail:t})=>{const n=wt(dW),o=n?Object.entries(n).map(([r,i])=>({value:r,label:`${i}: ${r}`})):e?[{value:e,label:e}]:[];return console.log("SSSSSSSSSSSSS 1 selectedEmail : ",e),console.log("SSSSSSSSSSSSS 1 emailHeadersArray : ",o),b.useEffect(()=>{!e&&n&&Object.keys(n).length>0&&(t(Object.keys(n)[0]),console.log("SSSSSSSSSSSSS 1 useEffect : ",e))},[n,t,e]),y.jsx(gQ,{options:o,value:e?{value:e,label:e}:null,placeholder:e||"Select an email",name:"email-selection",type:"select",onChange:r=>t(String((r==null?void 0:r.value)||"")),components:{MenuList:xX,Option:TX,SingleValue:wX},styles:SX,isSearchable:!1})},OX=V(Yo)`
|
|
2691
|
+
`,BX=e=>T.createElement("svg",{width:35,height:35,viewBox:"0 0 35 35",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},T.createElement("rect",{x:9,y:9,width:15,height:17,fill:"white"}),T.createElement("g",{clipPath:"url(#clip0_7787_114457)"},T.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"})),T.createElement("defs",null,T.createElement("clipPath",{id:"clip0_7787_114457"},T.createElement("rect",{width:34.396,height:34.396,fill:"white"})))),mX=({aspectRatio:e="auto",...t})=>{const[n,o]=b.useState(!1);return n?null:y.jsxs(hX,{aspectRatio:e,children:[y.jsx("img",{className:"preview-img",onError:()=>o(!0),...t}),y.jsx(BX,{className:"play-icon"})]})},QX={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_HIVER_CDN_URL:"https://cdn.hiverhq.com/",VITE_MY_ENV_VAR:"myVariable From Agent"},{VITE_HIVER_CDN_URL:vX}=QX,IQ=({isAdmin:e=!0,hideHeading:t=!1})=>{const{sendTrackingEvent:n,availableFeatures:o,connectorFunctions:r}=b.useContext(eo),i=br(o,QN),a=c=>{c.stopPropagation(),n(zN),r==null||r.redirectToAdmin()},A=c=>{c.stopPropagation(),n(YN),window.open(XW,"_blank")},l=()=>{n(CU,{source:"main_tab"})};return y.jsxs("div",{"data-testid":"noConnectors",children:[i?y.jsxs(y.Fragment,{children:[t?null:y.jsx(He,{variant:"h2",children:qW}),y.jsx(tz,{onClick:l,href:_W,target:"_blank",children:y.jsx(mX,{src:vX+ZW,alt:JW,aspectRatio:"1000/783"})})]}):y.jsxs($W,{children:[y.jsx(ez,{variant:"body1_medium",children:HW}),y.jsx("img",{src:sz,alt:WW})]}),y.jsx(nz,{variant:"body2",children:zW}),e?y.jsx(dm,{endIcon:y.jsx(Oo.ArrowForward,{}),onClick:a,...i&&{size:"medium"},children:YW}):y.jsxs(y.Fragment,{children:[y.jsx(dm,{onClick:A,children:GW}),y.jsxs(oz,{direction:"row",children:[y.jsx(rz,{}),y.jsx(iz,{variant:"caption",children:KW})]})]})]})},yX=()=>y.jsxs(oB,{children:[y.jsxs(Ne,{direction:"row",marginBottom:"12px",height:"36px",alignItems:"center",children:[y.jsx(tB,{}),y.jsx(nB,{variant:"h2",children:"Connectors"})]}),y.jsxs(Ne,{gap:"12px",children:[y.jsx(ui,{variant:"rounded",width:"100%",height:"46px",animation:"wave"}),y.jsx(ui,{variant:"rounded",width:"100%",height:"46px",animation:"wave"}),y.jsx(ui,{variant:"rounded",width:"100%",height:"46px",animation:"wave"})]})]}),bX=()=>{const{metaData:e,sendTrackingEvent:t,isAdmin:n,connectorFunctions:o}=b.useContext(eo),[r,i]=b.useState(!1),a=b.useRef(null),[A,l]=b.useState(0),{templateUpdates:c}=e||{},{sections:u=[],actionButtons:p=[],title:g}=c||{},{version:B=""}=c||{},C=WN(B),f=b.useMemo(()=>HN(B),[B]),d=b.useMemo(()=>(p==null?void 0:p.filter(({isAdminPanelLink:m})=>!(!n&&m)))??[],[p,n]);if(b.useEffect(()=>{!f&&c&&uf(B,!0)},[f,B,c]),b.useLayoutEffect(()=>{var m;(m=a.current)!=null&&m.scrollHeight&&l(a.current.scrollHeight)},[a]),b.useEffect(()=>{c&&!C&&t(ZN,{update_version_id:B})},[]),!c||C)return null;const E=m=>{var I;m.stopPropagation(),i(v=>!v),(I=a.current)!=null&&I.scrollHeight&&l(a.current.scrollHeight),uf(B,!1,!0)},Q=(m,I="",v=!1,w=!1)=>{var x;if(m.stopPropagation(),v&&w?t(JN,{update_version_id:B}):w&&t(qN,{update_version_id:B}),!v&&I){(x=window.open(I,"_blank"))==null||x.focus();return}h(m,!1),o==null||o.redirectToAdmin()},h=(m,I=!0)=>{m.stopPropagation(),uf(B,!1),i(!1),I&&t($N,{update_version_id:B})};return y.jsxs(fj,{children:[y.jsxs(pj,{children:[y.jsx(gj,{variant:"h3",children:g}),y.jsxs(Et,{children:[r?y.jsx(Rt,{title:ON,placement:"bottom",children:y.jsx(nn,{onClick:h,children:y.jsx(Oo.Close,{sx:{height:"16px",width:"16px",opacity:"0.8"}})})}):null,y.jsx(Rt,{title:r?FN:Af,placement:"bottom",children:y.jsx(di,{onClick:E,children:y.jsx(Ef,{className:r?"":"hiver-up"})})})]})]}),y.jsx(Cj,{className:r?"slideDown":"slideUp",ref:a,height:A,children:y.jsxs(Ej,{children:[u.map(({title:m,items:I,type:v})=>y.jsxs(Qj,{children:[y.jsx(He,{variant:"body2_medium",children:m}),I.map(w=>{const x=v===NN,{deeplink:S,textHtml:O,imageUrl:k}=w,P=()=>y.jsx(oj,{className:x?"":"ellipsisClass",component:"div",variant:"body2",dangerouslySetInnerHTML:{__html:O}});return y.jsx(Ij,{component:"ul",children:y.jsxs(hj,{component:x?"li":"div",marginLeft:k?"0":"14px",children:[k?y.jsx("img",{src:k}):null,S?y.jsx(sB,{target:"_blank",underline:"none",onClick:D=>Q(D,S),fontSize:"13px",children:P()}):P()]})},O)})]},m)),y.jsx(Ne,{flexDirection:"row",gap:"8px",marginBottom:"11.5px",children:d.map(({text:m,link:I,isAdminPanelLink:v})=>y.jsx(Bj,{variant:v?"contained":"text",children:y.jsx(mj,{variant:"caption",onClick:w=>Q(w,I,v,!0),children:m})},m))})]})})]})},hQ=e=>{const t=b.useRef(null),[n,o]=b.useState(!1);return b.useEffect(()=>{t.current&&o(t.current.scrollWidth>t.current.clientWidth)},[e]),{textRef:t,isOverflow:n}},wX=e=>{const{textRef:t,isOverflow:n}=hQ(e.data.label);return y.jsx(Rt,{title:n?e.data.label:null,placement:"bottom",children:y.jsx(vj,{ref:t,variant:"body2",children:e.data.label})})},xX=e=>y.jsxs(Bi.MenuList,{...e,children:[y.jsx(yj,{children:y.jsx(He,{variant:"body2_medium",children:Oj})}),e.children]}),TX=e=>{const{isSelected:t}=e,{textRef:n,isOverflow:o}=hQ(e.data.label);return y.jsx(Bi.Option,{...e,children:y.jsxs(Ne,{direction:"row",gap:"8px",justifyContent:"space-between",children:[y.jsx(Rt,{title:o?e.data.label:null,placement:"bottom",children:y.jsx(wj,{ref:n,className:"dropdown-item-text",variant:"body2",children:e.data.label})}),t&&y.jsx(bj,{})]})})},SX={control:e=>({...e,border:"none",boxShadow:"none",height:"20px","&:hover":{border:"none"},"& > :first-child":{display:"flex !important",alignItems:"center",flexGrow:1}}),option:(e,t)=>({...e,backgroundColor:Fe.palette.gray.white,color:Fe.palette.gray.black,"&:hover":{backgroundColor:t.isFocused?Fe.palette.gray.gray7:Fe.palette.gray.white}}),singleValue:e=>({...e})},FX=({selectedEmail:e,setSelectedEmail:t})=>{const n=wt(dW),o=n?Object.entries(n).map(([r,i])=>({value:r,label:`${i}: ${r}`})):e?[{value:e,label:e}]:[];return console.log("SSSSSSSSSSSSS 1 selectedEmail : ",e),console.log("SSSSSSSSSSSSS 1 emailHeadersArray : ",o),b.useEffect(()=>{!e&&n&&Object.keys(n).length>0&&(t(Object.keys(n)[0]),console.log("SSSSSSSSSSSSS 1 useEffect : ",e))},[n,t,e]),y.jsx(gQ,{options:o,value:e?{value:e,label:e}:null,placeholder:e||"Select an email",name:"email-selection",type:"select",onChange:r=>t(String((r==null?void 0:r.value)||"")),components:{MenuList:xX,Option:TX,SingleValue:wX},styles:SX,isSearchable:!1,closeMenuOnSelect:!1,menuIsOpen:!0})},OX=V(Yo)`
|
|
2692
2692
|
width: stretch;
|
|
2693
2693
|
height: 100%;
|
|
2694
2694
|
position: absolute;
|
|
@@ -2787,7 +2787,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
2787
2787
|
& .content__btn {
|
|
2788
2788
|
margin-left: 8px;
|
|
2789
2789
|
}
|
|
2790
|
-
`,WX=e=>T.createElement("svg",{width:20,height:21,viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},T.createElement("mask",{id:"mask0_4649_80352",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:20,height:21},T.createElement("rect",{y:.320312,width:20,height:20,fill:"#D9D9D9"})),T.createElement("g",{mask:"url(#mask0_4649_80352)"},T.createElement("path",{d:"M9.16797 14.4873H10.8346V11.154H14.168V9.4873H10.8346V6.15397H9.16797V9.4873H5.83464V11.154H9.16797V14.4873ZM10.0013 18.654C8.84852 18.654 7.76519 18.4352 6.7513 17.9977C5.73741 17.5602 4.85547 16.9665 4.10547 16.2165C3.35547 15.4665 2.76172 14.5845 2.32422 13.5706C1.88672 12.5567 1.66797 11.4734 1.66797 10.3206C1.66797 9.16786 1.88672 8.08453 2.32422 7.07064C2.76172 6.05675 3.35547 5.1748 4.10547 4.4248C4.85547 3.6748 5.73741 3.08105 6.7513 2.64355C7.76519 2.20605 8.84852 1.9873 10.0013 1.9873C11.1541 1.9873 12.2374 2.20605 13.2513 2.64355C14.2652 3.08105 15.1471 3.6748 15.8971 4.4248C16.6471 5.1748 17.2409 6.05675 17.6784 7.07064C18.1159 8.08453 18.3346 9.16786 18.3346 10.3206C18.3346 11.4734 18.1159 12.5567 17.6784 13.5706C17.2409 14.5845 16.6471 15.4665 15.8971 16.2165C15.1471 16.9665 14.2652 17.5602 13.2513 17.9977C12.2374 18.4352 11.1541 18.654 10.0013 18.654ZM10.0013 16.9873C11.8624 16.9873 13.4388 16.3415 14.7305 15.0498C16.0221 13.7581 16.668 12.1817 16.668 10.3206C16.668 8.45953 16.0221 6.88314 14.7305 5.59147C13.4388 4.2998 11.8624 3.65397 10.0013 3.65397C8.14019 3.65397 6.5638 4.2998 5.27214 5.59147C3.98047 6.88314 3.33464 8.45953 3.33464 10.3206C3.33464 12.1817 3.98047 13.7581 5.27214 15.0498C6.5638 16.3415 8.14019 16.9873 10.0013 16.9873Z",fill:"#4D596C"}))),zX=e=>T.createElement("svg",{width:20,height:21,viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},T.createElement("path",{d:"M14.3462 8.73757C14.0406 8.43198 13.5451 8.43198 13.2395 8.73757C12.9339 9.04316 12.9339 9.53863 13.2395 9.84422L14.3462 8.73757ZM15.2392 10.7372L15.7925 10.1839L15.2392 10.7372ZM16.2377 13.1478L15.4552 13.1478L16.2377 13.1478ZM15.2392 15.5584L14.6859 15.0051L15.2392 15.5584ZM10.418 15.5584L9.86469 16.1118L10.418 15.5584ZM9.52499 13.5588C9.2194 13.2532 8.72393 13.2532 8.41834 13.5588C8.11275 13.8643 8.11275 14.3598 8.41834 14.6654L9.52499 13.5588ZM5.52477 11.7731C5.83036 12.0787 6.32583 12.0787 6.63142 11.7731C6.93701 11.4675 6.93701 10.972 6.63142 10.6665L5.52477 11.7731ZM9.45292 4.95224L10.0062 4.39892L9.45292 4.95224ZM10.346 6.95192C10.6515 7.25752 11.147 7.25752 11.4526 6.95192C11.7582 6.64633 11.7582 6.15087 11.4526 5.84527L10.346 6.95192ZM13.2395 9.84422L14.6859 11.2906L15.7925 10.1839L14.3462 8.73757L13.2395 9.84422ZM14.6859 11.2906C15.1785 11.7832 15.4552 12.4512 15.4552 13.1478L17.0202 13.1478C17.0202 12.0362 16.5786 10.97 15.7925 10.1839L14.6859 11.2906ZM15.4552 13.1478C15.4552 13.8445 15.1785 14.5125 14.6859 15.0051L15.7925 16.1118C16.5786 15.3257 17.0202 14.2595 17.0202 13.1478L15.4552 13.1478ZM14.6859 15.0051C13.6601 16.0308 11.9971 16.0308 10.9713 15.0051L9.86469 16.1118C11.5016 17.7487 14.1556 17.7487 15.7925 16.1118L14.6859 15.0051ZM10.9713 15.0051L9.52499 13.5588L8.41834 14.6654L9.86469 16.1118L10.9713 15.0051ZM6.63142 10.6665L5.18507 9.2201L4.07842 10.3268L5.52477 11.7731L6.63142 10.6665ZM5.18507 9.2201C4.69249 8.72752 4.41576 8.05944 4.41576 7.36283H2.85072C2.85072 8.47452 3.29234 9.54067 4.07842 10.3268L5.18507 9.2201ZM4.41576 7.36283C4.41576 6.66622 4.69249 5.99815 5.18507 5.50557L4.07842 4.39892C3.29234 5.185 2.85072 6.25115 2.85072 7.36283H4.41576ZM5.18507 5.50557C6.21081 4.47983 7.87386 4.47983 8.8996 5.50557L10.0062 4.39892C8.36932 2.76199 5.71534 2.76199 4.07842 4.39892L5.18507 5.50557ZM8.8996 5.50557L10.346 6.95192L11.4526 5.84527L10.0062 4.39892L8.8996 5.50557Z",fill:"#4D596C"}),T.createElement("rect",{x:6.36328,y:7.91895,width:1.66667,height:8.33333,rx:.833333,transform:"rotate(-45 6.36328 7.91895)",fill:"#4D596C"})),YX=({onCreateClick:e,onLinkClick:t,haveCreateObjects:n,haveLinkObjects:o})=>y.jsxs(Ne,{gap:2,marginTop:"12px",children:[y.jsx(He,{variant:"body2",color:Fe.palette.gray.gray1,children:OH}),y.jsxs(Ne,{gap:"12px",children:[n?y.jsxs(HX,{fullWidth:!0,onClick:e,size:"medium",children:[y.jsx(WX,{}),y.jsx("span",{className:"content__btn",children:L2})]}):null,o?y.jsxs(VX,{fullWidth:!0,color:"tertiary",variant:"outlined",onClick:t,size:"medium",children:[y.jsx(zX,{}),y.jsx("span",{className:"content__btn",children:N2})]}):null]})]}),GX="data:image/svg+xml,%3csvg%20width='20'%20height='21'%20viewBox='0%200%2020%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cmask%20id='mask0_4649_80352'%20style='mask-type:alpha'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='20'%20height='21'%3e%3crect%20y='0.320312'%20width='20'%20height='20'%20fill='%23D9D9D9'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_4649_80352)'%3e%3cpath%20d='M9.16797%2014.4873H10.8346V11.154H14.168V9.4873H10.8346V6.15397H9.16797V9.4873H5.83464V11.154H9.16797V14.4873ZM10.0013%2018.654C8.84852%2018.654%207.76519%2018.4352%206.7513%2017.9977C5.73741%2017.5602%204.85547%2016.9665%204.10547%2016.2165C3.35547%2015.4665%202.76172%2014.5845%202.32422%2013.5706C1.88672%2012.5567%201.66797%2011.4734%201.66797%2010.3206C1.66797%209.16786%201.88672%208.08453%202.32422%207.07064C2.76172%206.05675%203.35547%205.1748%204.10547%204.4248C4.85547%203.6748%205.73741%203.08105%206.7513%202.64355C7.76519%202.20605%208.84852%201.9873%2010.0013%201.9873C11.1541%201.9873%2012.2374%202.20605%2013.2513%202.64355C14.2652%203.08105%2015.1471%203.6748%2015.8971%204.4248C16.6471%205.1748%2017.2409%206.05675%2017.6784%207.07064C18.1159%208.08453%2018.3346%209.16786%2018.3346%2010.3206C18.3346%2011.4734%2018.1159%2012.5567%2017.6784%2013.5706C17.2409%2014.5845%2016.6471%2015.4665%2015.8971%2016.2165C15.1471%2016.9665%2014.2652%2017.5602%2013.2513%2017.9977C12.2374%2018.4352%2011.1541%2018.654%2010.0013%2018.654ZM10.0013%2016.9873C11.8624%2016.9873%2013.4388%2016.3415%2014.7305%2015.0498C16.0221%2013.7581%2016.668%2012.1817%2016.668%2010.3206C16.668%208.45953%2016.0221%206.88314%2014.7305%205.59147C13.4388%204.2998%2011.8624%203.65397%2010.0013%203.65397C8.14019%203.65397%206.5638%204.2998%205.27214%205.59147C3.98047%206.88314%203.33464%208.45953%203.33464%2010.3206C3.33464%2012.1817%203.98047%2013.7581%205.27214%2015.0498C6.5638%2016.3415%208.14019%2016.9873%2010.0013%2016.9873Z'%20fill='%234D596C'/%3e%3c/g%3e%3c/svg%3e",XX="data:image/svg+xml,%3csvg%20width='20'%20height='21'%20viewBox='0%200%2020%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14.3462%208.73757C14.0406%208.43198%2013.5451%208.43198%2013.2395%208.73757C12.9339%209.04316%2012.9339%209.53863%2013.2395%209.84422L14.3462%208.73757ZM15.2392%2010.7372L15.7925%2010.1839L15.2392%2010.7372ZM16.2377%2013.1478L15.4552%2013.1478L16.2377%2013.1478ZM15.2392%2015.5584L14.6859%2015.0051L15.2392%2015.5584ZM10.418%2015.5584L9.86469%2016.1118L10.418%2015.5584ZM9.52499%2013.5588C9.2194%2013.2532%208.72393%2013.2532%208.41834%2013.5588C8.11275%2013.8643%208.11275%2014.3598%208.41834%2014.6654L9.52499%2013.5588ZM5.52477%2011.7731C5.83036%2012.0787%206.32583%2012.0787%206.63142%2011.7731C6.93701%2011.4675%206.93701%2010.972%206.63142%2010.6665L5.52477%2011.7731ZM9.45292%204.95224L10.0062%204.39892L9.45292%204.95224ZM10.346%206.95192C10.6515%207.25752%2011.147%207.25752%2011.4526%206.95192C11.7582%206.64633%2011.7582%206.15087%2011.4526%205.84527L10.346%206.95192ZM13.2395%209.84422L14.6859%2011.2906L15.7925%2010.1839L14.3462%208.73757L13.2395%209.84422ZM14.6859%2011.2906C15.1785%2011.7832%2015.4552%2012.4512%2015.4552%2013.1478L17.0202%2013.1478C17.0202%2012.0362%2016.5786%2010.97%2015.7925%2010.1839L14.6859%2011.2906ZM15.4552%2013.1478C15.4552%2013.8445%2015.1785%2014.5125%2014.6859%2015.0051L15.7925%2016.1118C16.5786%2015.3257%2017.0202%2014.2595%2017.0202%2013.1478L15.4552%2013.1478ZM14.6859%2015.0051C13.6601%2016.0308%2011.9971%2016.0308%2010.9713%2015.0051L9.86469%2016.1118C11.5016%2017.7487%2014.1556%2017.7487%2015.7925%2016.1118L14.6859%2015.0051ZM10.9713%2015.0051L9.52499%2013.5588L8.41834%2014.6654L9.86469%2016.1118L10.9713%2015.0051ZM6.63142%2010.6665L5.18507%209.2201L4.07842%2010.3268L5.52477%2011.7731L6.63142%2010.6665ZM5.18507%209.2201C4.69249%208.72752%204.41576%208.05944%204.41576%207.36283H2.85072C2.85072%208.47452%203.29234%209.54067%204.07842%2010.3268L5.18507%209.2201ZM4.41576%207.36283C4.41576%206.66622%204.69249%205.99815%205.18507%205.50557L4.07842%204.39892C3.29234%205.185%202.85072%206.25115%202.85072%207.36283H4.41576ZM5.18507%205.50557C6.21081%204.47983%207.87386%204.47983%208.8996%205.50557L10.0062%204.39892C8.36932%202.76199%205.71534%202.76199%204.07842%204.39892L5.18507%205.50557ZM8.8996%205.50557L10.346%206.95192L11.4526%205.84527L10.0062%204.39892L8.8996%205.50557Z'%20fill='%234D596C'/%3e%3crect%20x='6.36328'%20y='7.91895'%20width='1.66667'%20height='8.33333'%20rx='0.833333'%20transform='rotate(-45%206.36328%207.91895)'%20fill='%234D596C'/%3e%3c/svg%3e",KX=({isAdmin:e=!1})=>{const{email:t,currentSmIds:n,sendTrackingEvent:o,availableFeatures:r,conversationId:i}=b.useContext(eo),a=ci(),{userGroupId:A}=li()||{},[l,c]=b.useState(!1),[u,p]=b.useState(!1),[g,B]=b.useState(!1),[C,f]=b.useState(),[d,E]=b.useState(!1),[Q,h]=b.useState(t),m=wt(sW),I=wt(aW),v=wt(lW),w=wt(cW),x=wt(AW),S=wt(Am),O=wt(lm),k=wt(cm),P=wt(um),D=br(r,mN),M=br(r,O2),N=br(r,xN),L=b.useCallback(()=>{t&&n.length&&i&&a(Nc({inboxIds:n,conversationId:i}))},[a,t,n,i]),W=b.useCallback(()=>{!N||!i||a(Uc({conversationId:i,email:t}))},[a,i,t,N]),H=b.useCallback((_,ne)=>{_&&i&&ne&&a(Lc({id:_,channelType:"email",conversationId:i,externalResourceId:ne,contactEmail:t})).unwrap().catch(()=>{a(ws(null))})},[a,i,t]);if(b.useEffect(()=>{var _;if(k){c(!0);const{externalResourceId:ne}=k,ie=(_=k.forms.find(U=>U.type==="edit"))==null?void 0:_.id;H(ie,ne)}else c(!1),a(tW())},[k,H,a]),b.useEffect(()=>(W(),()=>{a(Df.clearConnectorList())}),[a,W]),b.useEffect(()=>(L(),()=>{a(Df.clearConnectorList())}),[a,L]),b.useEffect(()=>{m&&m.length&&o(_N,{numOfCards:m.length})},[m,o,n]),b.useEffect(()=>{i&&n&&n.length&&a(Oc({inboxIds:n,conversationId:i,channelType:"email"}))},[a,n,i]),!t.length||x===be.LOADING)return y.jsx(yX,{});const $=()=>{p(!0),o(eU)},R=()=>{B(!0),o(tU)},z=_=>{o(_,C),P?E(!0):p(!1)},G=_=>{if(k){const{connectorName:ne,title:ie}=k;o(_,{connector_name:ne,card_title:ie,sm_ids:n,ug_id:A})}P?E(!0):a(ws(null))},Y=()=>{p(!1),a(ws(null)),f(void 0),E(!1)},X=()=>{L(),a(Df.clearConnectorList())},J=[{label:"Go back",variant:"text",action:Y},{label:"Stay",variant:"contained",action:()=>E(!1)}],te=S.length>0,K=O.length>0,q=()=>te||K?y.jsx(YX,{haveCreateObjects:te,haveLinkObjects:K,onCreateClick:()=>p(!0),onLinkClick:()=>B(!0)}):y.jsx(IQ,{isAdmin:e,hideHeading:!0});return y.jsxs(oB,{"data-testid":Array.isArray(m)?"connector-agent":"loading",id:"connector-agent-container",stopOverflow:u||g,children:[y.jsx(bQ,{shown:d,setShown:E,title:DH,description:PH,buttons:J}),y.jsx(ZU,{children:I?y.jsxs(y.Fragment,{children:[y.jsxs(Ne,{direction:"row",justifyContent:"space-between",marginBottom:"12px",height:"36px",children:[y.jsxs(Ne,{direction:"row",alignItems:"center",children:[y.jsx(tB,{}),y.jsx(nB,{variant:"h2",children:SN})]}),y.jsx(Ne,{direction:"row",gap:"4px",children:M&&(m!=null&&m.length)?y.jsxs(y.Fragment,{children:[te?y.jsx(Rt,{title:L2,placement:"bottom",children:y.jsx(nn,{onClick:$,children:y.jsx("img",{src:GX,alt:"Add",height:"20px"})})}):null,K?y.jsx(Rt,{title:N2,placement:"bottom",children:y.jsx(nn,{onClick:R,children:y.jsx("img",{src:XX,alt:"Link Task",height:"20px"})})}):null]}):null})]}),N?y.jsx(FX,{selectedEmail:Q,setSelectedEmail:h}):null,D?y.jsx(bX,{}):null,m!=null&&m.length?y.jsx(VW,{cards:m,specificCardData:v,email:Q??"",specificConnectorApiStatus:w,onCardUnlinking:L}):null,!(m!=null&&m.length)&&M?q():null]}):y.jsx(IQ,{isAdmin:e})}),y.jsx($f,{onClose:()=>G(fU),isOpen:l,setIsOpen:c,title:LN,portalId:"connector-layover-portal",backButtonTooltip:"Back",children:y.jsx(wQ,{isEdit:!0,onClose:()=>G(gU),onCreateSuccess:X,metaData:C,setMetaData:f})}),y.jsx($f,{onClose:()=>z(aU),portalId:"connector-layover-portal",isOpen:u,setIsOpen:p,children:y.jsx(wQ,{onClose:()=>z(sU),onCreateSuccess:X,metaData:C,setMetaData:f})}),y.jsx($f,{onClose:()=>B(!1),portalId:"connector-layover-portal",isOpen:g,setIsOpen:B,children:y.jsx(UX,{setOpenTaskLinking:B,onLinkingSuccess:L})}),!I&&y.jsx(SU,{})]})},_X=({children:e,sendTrackingEvent:t,contactEmail:n,baseUrls:o={},currentSmIds:r=[],metaData:i,availableFeatures:a,conversationId:A,connectorFunctions:l,isAdmin:c=!1})=>{const u=b.useMemo(()=>({email:n,baseUrls:o,currentSmIds:r,metaData:i,conversationId:A,sendTrackingEvent:t||(()=>{}),availableFeatures:a,isAdmin:c,connectorFunctions:l}),[n,o,t,r,i,a,A,c,l]);return y.jsx(eo.Provider,{value:u,children:e})};var tu=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},nu=typeof window>"u"||"Deno"in globalThis;function Eo(){}function ZX(e,t){return typeof e=="function"?e(t):e}function JX(e){return typeof e=="number"&&e>=0&&e!==1/0}function qX(e,t){return Math.max(e+(t||0)-Date.now(),0)}function xQ(e,t){return typeof e=="function"?e(t):e}function $X(e,t){return typeof e=="function"?e(t):e}function TQ(e,t){const{type:n="all",exact:o,fetchStatus:r,predicate:i,queryKey:a,stale:A}=e;if(a){if(o){if(t.queryHash!==e0(a,t.options))return!1}else if(!dA(t.queryKey,a))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof A=="boolean"&&t.isStale()!==A||r&&r!==t.state.fetchStatus||i&&!i(t))}function SQ(e,t){const{exact:n,status:o,predicate:r,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(uA(t.options.mutationKey)!==uA(i))return!1}else if(!dA(t.options.mutationKey,i))return!1}return!(o&&t.state.status!==o||r&&!r(t))}function e0(e,t){return((t==null?void 0:t.queryKeyHashFn)||uA)(e)}function uA(e){return JSON.stringify(e,(t,n)=>n0(n)?Object.keys(n).sort().reduce((o,r)=>(o[r]=n[r],o),{}):n)}function dA(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!dA(e[n],t[n])):!1}function t0(e,t){if(e===t)return e;const n=FQ(e)&&FQ(t);if(n||n0(e)&&n0(t)){const o=n?e:Object.keys(e),r=o.length,i=n?t:Object.keys(t),a=i.length,A=n?[]:{};let l=0;for(let c=0;c<a;c++){const u=n?c:i[c];(!n&&o.includes(u)||n)&&e[u]===void 0&&t[u]===void 0?(A[u]=void 0,l++):(A[u]=t0(e[u],t[u]),A[u]===e[u]&&e[u]!==void 0&&l++)}return r===a&&l===r?e:A}return t}function FQ(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function n0(e){if(!OQ(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!OQ(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function OQ(e){return Object.prototype.toString.call(e)==="[object Object]"}function eK(e){return new Promise(t=>{setTimeout(t,e)})}function tK(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return t0(e,t)}catch(o){console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${o}`)}return t0(e,t)}return t}function nK(e,t,n=0){const o=[...e,t];return n&&o.length>n?o.slice(1):o}function oK(e,t,n=0){const o=[t,...e];return n&&o.length>n?o.slice(0,-1):o}var ou=Symbol();function kQ(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===ou&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===ou?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var rK=(jQ=class extends tu{constructor(){super();rt(this,mi);rt(this,Sr);rt(this,Ss);Ve(this,Ss,t=>{if(!nu&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){oe(this,Sr)||this.setEventListener(oe(this,Ss))}onUnsubscribe(){var t;this.hasListeners()||((t=oe(this,Sr))==null||t.call(this),Ve(this,Sr,void 0))}setEventListener(t){var n;Ve(this,Ss,t),(n=oe(this,Sr))==null||n.call(this),Ve(this,Sr,t(o=>{typeof o=="boolean"?this.setFocused(o):this.onFocus()}))}setFocused(t){oe(this,mi)!==t&&(Ve(this,mi,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof oe(this,mi)=="boolean"?oe(this,mi):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},mi=new WeakMap,Sr=new WeakMap,Ss=new WeakMap,jQ),MQ=new rK,iK=(VQ=class extends tu{constructor(){super();rt(this,Fs,!0);rt(this,Fr);rt(this,Os);Ve(this,Os,t=>{if(!nu&&window.addEventListener){const n=()=>t(!0),o=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",o,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",o)}}})}onSubscribe(){oe(this,Fr)||this.setEventListener(oe(this,Os))}onUnsubscribe(){var t;this.hasListeners()||((t=oe(this,Fr))==null||t.call(this),Ve(this,Fr,void 0))}setEventListener(t){var n;Ve(this,Os,t),(n=oe(this,Fr))==null||n.call(this),Ve(this,Fr,t(this.setOnline.bind(this)))}setOnline(t){oe(this,Fs)!==t&&(Ve(this,Fs,t),this.listeners.forEach(o=>{o(t)}))}isOnline(){return oe(this,Fs)}},Fs=new WeakMap,Fr=new WeakMap,Os=new WeakMap,VQ),ru=new iK;function sK(){let e,t;const n=new Promise((r,i)=>{e=r,t=i});n.status="pending",n.catch(()=>{});function o(r){Object.assign(n,r),delete n.resolve,delete n.reject}return n.resolve=r=>{o({status:"fulfilled",value:r}),e(r)},n.reject=r=>{o({status:"rejected",reason:r}),t(r)},n}function aK(e){return Math.min(1e3*2**e,3e4)}function DQ(e){return(e??"online")==="online"?ru.isOnline():!0}var PQ=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function o0(e){return e instanceof PQ}function RQ(e){let t=!1,n=0,o=!1,r;const i=sK(),a=f=>{var d;o||(g(new PQ(f)),(d=e.abort)==null||d.call(e))},A=()=>{t=!0},l=()=>{t=!1},c=()=>MQ.isFocused()&&(e.networkMode==="always"||ru.isOnline())&&e.canRun(),u=()=>DQ(e.networkMode)&&e.canRun(),p=f=>{var d;o||(o=!0,(d=e.onSuccess)==null||d.call(e,f),r==null||r(),i.resolve(f))},g=f=>{var d;o||(o=!0,(d=e.onError)==null||d.call(e,f),r==null||r(),i.reject(f))},B=()=>new Promise(f=>{var d;r=E=>{(o||c())&&f(E)},(d=e.onPause)==null||d.call(e)}).then(()=>{var f;r=void 0,o||(f=e.onContinue)==null||f.call(e)}),C=()=>{if(o)return;let f;const d=n===0?e.initialPromise:void 0;try{f=d??e.fn()}catch(E){f=Promise.reject(E)}Promise.resolve(f).then(p).catch(E=>{var v;if(o)return;const Q=e.retry??(nu?0:3),h=e.retryDelay??aK,m=typeof h=="function"?h(n,E):h,I=Q===!0||typeof Q=="number"&&n<Q||typeof Q=="function"&&Q(n,E);if(t||!I){g(E);return}n++,(v=e.onFail)==null||v.call(e,n,E),eK(m).then(()=>c()?void 0:B()).then(()=>{t?g(E):C()})})};return{promise:i,cancel:a,continue:()=>(r==null||r(),i),cancelRetry:A,continueRetry:l,canStart:u,start:()=>(u()?C():B().then(C),i)}}function AK(){let e=[],t=0,n=A=>{A()},o=A=>{A()},r=A=>setTimeout(A,0);const i=A=>{t?e.push(A):r(()=>{n(A)})},a=()=>{const A=e;e=[],A.length&&r(()=>{o(()=>{A.forEach(l=>{n(l)})})})};return{batch:A=>{let l;t++;try{l=A()}finally{t--,t||a()}return l},batchCalls:A=>(...l)=>{i(()=>{A(...l)})},schedule:i,setNotifyFunction:A=>{n=A},setBatchNotifyFunction:A=>{o=A},setScheduler:A=>{r=A}}}var pn=AK(),LQ=(HQ=class{constructor(){rt(this,Qi)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),JX(this.gcTime)&&Ve(this,Qi,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(nu?1/0:5*60*1e3))}clearGcTimeout(){oe(this,Qi)&&(clearTimeout(oe(this,Qi)),Ve(this,Qi,void 0))}},Qi=new WeakMap,HQ),lK=(WQ=class extends LQ{constructor(t){super();rt(this,Io);rt(this,ks);rt(this,Ms);rt(this,to);rt(this,vi);rt(this,An);rt(this,gA);rt(this,yi);Ve(this,yi,!1),Ve(this,gA,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ve(this,vi,t.client),Ve(this,to,oe(this,vi).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ve(this,ks,uK(this.options)),this.state=t.state??oe(this,ks),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=oe(this,An))==null?void 0:t.promise}setOptions(t){this.options={...oe(this,gA),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&oe(this,to).remove(this)}setData(t,n){const o=tK(this.state.data,t,this.options);return ln(this,Io,Ar).call(this,{data:o,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),o}setState(t,n){ln(this,Io,Ar).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var o,r;const n=(o=oe(this,An))==null?void 0:o.promise;return(r=oe(this,An))==null||r.cancel(t),n?n.then(Eo).catch(Eo):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(oe(this,ks))}isActive(){return this.observers.some(t=>$X(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ou||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!qX(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(o=>o.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=oe(this,An))==null||n.continue()}onOnline(){var n;const t=this.observers.find(o=>o.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=oe(this,An))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),oe(this,to).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(oe(this,An)&&(oe(this,yi)?oe(this,An).cancel({revert:!0}):oe(this,An).cancelRetry()),this.scheduleGc()),oe(this,to).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ln(this,Io,Ar).call(this,{type:"invalidate"})}fetch(t,n){var l,c,u;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(oe(this,An))return oe(this,An).continueRetry(),oe(this,An).promise}if(t&&this.setOptions(t),!this.options.queryFn){const p=this.observers.find(g=>g.options.queryFn);p&&this.setOptions(p.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const o=new AbortController,r=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(Ve(this,yi,!0),o.signal)})},i=()=>{const p=kQ(this.options,n),g={client:oe(this,vi),queryKey:this.queryKey,meta:this.meta};return r(g),Ve(this,yi,!1),this.options.persister?this.options.persister(p,g,this):p(g)},a={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:oe(this,vi),state:this.state,fetchFn:i};r(a),(l=this.options.behavior)==null||l.onFetch(a,this),Ve(this,Ms,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=a.fetchOptions)==null?void 0:c.meta))&&ln(this,Io,Ar).call(this,{type:"fetch",meta:(u=a.fetchOptions)==null?void 0:u.meta});const A=p=>{var g,B,C,f;o0(p)&&p.silent||ln(this,Io,Ar).call(this,{type:"error",error:p}),o0(p)||((B=(g=oe(this,to).config).onError)==null||B.call(g,p,this),(f=(C=oe(this,to).config).onSettled)==null||f.call(C,this.state.data,p,this)),this.scheduleGc()};return Ve(this,An,RQ({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:o.abort.bind(o),onSuccess:p=>{var g,B,C,f;if(p===void 0){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),A(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(p)}catch(d){A(d);return}(B=(g=oe(this,to).config).onSuccess)==null||B.call(g,p,this),(f=(C=oe(this,to).config).onSettled)==null||f.call(C,p,this.state.error,this),this.scheduleGc()},onError:A,onFail:(p,g)=>{ln(this,Io,Ar).call(this,{type:"failed",failureCount:p,error:g})},onPause:()=>{ln(this,Io,Ar).call(this,{type:"pause"})},onContinue:()=>{ln(this,Io,Ar).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),oe(this,An).start()}},ks=new WeakMap,Ms=new WeakMap,to=new WeakMap,vi=new WeakMap,An=new WeakMap,gA=new WeakMap,yi=new WeakMap,Io=new WeakSet,Ar=function(t){const n=o=>{switch(t.type){case"failed":return{...o,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...o,fetchStatus:"paused"};case"continue":return{...o,fetchStatus:"fetching"};case"fetch":return{...o,...cK(o.data,this.options),fetchMeta:t.meta??null};case"success":return{...o,data:t.data,dataUpdateCount:o.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const r=t.error;return o0(r)&&r.revert&&oe(this,Ms)?{...oe(this,Ms),fetchStatus:"idle"}:{...o,error:r,errorUpdateCount:o.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:o.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...o,isInvalidated:!0};case"setState":return{...o,...t.state}}};this.state=n(this.state),pn.batch(()=>{this.observers.forEach(o=>{o.onQueryUpdate()}),oe(this,to).notify({query:this,type:"updated",action:t})})},WQ);function cK(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:DQ(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function uK(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,o=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var dK=(zQ=class extends tu{constructor(t={}){super();rt(this,Lo);this.config=t,Ve(this,Lo,new Map)}build(t,n,o){const r=n.queryKey,i=n.queryHash??e0(r,n);let a=this.get(i);return a||(a=new lK({client:t,queryKey:r,queryHash:i,options:t.defaultQueryOptions(n),state:o,defaultOptions:t.getQueryDefaults(r)}),this.add(a)),a}add(t){oe(this,Lo).has(t.queryHash)||(oe(this,Lo).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=oe(this,Lo).get(t.queryHash);n&&(t.destroy(),n===t&&oe(this,Lo).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){pn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return oe(this,Lo).get(t)}getAll(){return[...oe(this,Lo).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(o=>TQ(n,o))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(o=>TQ(t,o)):n}notify(t){pn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){pn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){pn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Lo=new WeakMap,zQ),gK=(YQ=class extends LQ{constructor(t){super();rt(this,Uo);rt(this,No);rt(this,Cn);rt(this,bi);this.mutationId=t.mutationId,Ve(this,Cn,t.mutationCache),Ve(this,No,[]),this.state=t.state||fK(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){oe(this,No).includes(t)||(oe(this,No).push(t),this.clearGcTimeout(),oe(this,Cn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ve(this,No,oe(this,No).filter(n=>n!==t)),this.scheduleGc(),oe(this,Cn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){oe(this,No).length||(this.state.status==="pending"?this.scheduleGc():oe(this,Cn).remove(this))}continue(){var t;return((t=oe(this,bi))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var r,i,a,A,l,c,u,p,g,B,C,f,d,E,Q,h,m,I,v,w;Ve(this,bi,RQ({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(x,S)=>{ln(this,Uo,Pr).call(this,{type:"failed",failureCount:x,error:S})},onPause:()=>{ln(this,Uo,Pr).call(this,{type:"pause"})},onContinue:()=>{ln(this,Uo,Pr).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>oe(this,Cn).canRun(this)}));const n=this.state.status==="pending",o=!oe(this,bi).canStart();try{if(!n){ln(this,Uo,Pr).call(this,{type:"pending",variables:t,isPaused:o}),await((i=(r=oe(this,Cn).config).onMutate)==null?void 0:i.call(r,t,this));const S=await((A=(a=this.options).onMutate)==null?void 0:A.call(a,t));S!==this.state.context&&ln(this,Uo,Pr).call(this,{type:"pending",context:S,variables:t,isPaused:o})}const x=await oe(this,bi).start();return await((c=(l=oe(this,Cn).config).onSuccess)==null?void 0:c.call(l,x,t,this.state.context,this)),await((p=(u=this.options).onSuccess)==null?void 0:p.call(u,x,t,this.state.context)),await((B=(g=oe(this,Cn).config).onSettled)==null?void 0:B.call(g,x,null,this.state.variables,this.state.context,this)),await((f=(C=this.options).onSettled)==null?void 0:f.call(C,x,null,t,this.state.context)),ln(this,Uo,Pr).call(this,{type:"success",data:x}),x}catch(x){try{throw await((E=(d=oe(this,Cn).config).onError)==null?void 0:E.call(d,x,t,this.state.context,this)),await((h=(Q=this.options).onError)==null?void 0:h.call(Q,x,t,this.state.context)),await((I=(m=oe(this,Cn).config).onSettled)==null?void 0:I.call(m,void 0,x,this.state.variables,this.state.context,this)),await((w=(v=this.options).onSettled)==null?void 0:w.call(v,void 0,x,t,this.state.context)),x}finally{ln(this,Uo,Pr).call(this,{type:"error",error:x})}}finally{oe(this,Cn).runNext(this)}}},No=new WeakMap,Cn=new WeakMap,bi=new WeakMap,Uo=new WeakSet,Pr=function(t){const n=o=>{switch(t.type){case"failed":return{...o,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...o,isPaused:!0};case"continue":return{...o,isPaused:!1};case"pending":return{...o,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...o,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...o,data:void 0,error:t.error,failureCount:o.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),pn.batch(()=>{oe(this,No).forEach(o=>{o.onMutationUpdate(t)}),oe(this,Cn).notify({mutation:this,type:"updated",action:t})})},YQ);function fK(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var pK=(GQ=class extends tu{constructor(t={}){super();rt(this,ar);rt(this,ho);rt(this,fA);this.config=t,Ve(this,ar,new Set),Ve(this,ho,new Map),Ve(this,fA,0)}build(t,n,o){const r=new gK({mutationCache:this,mutationId:++cu(this,fA)._,options:t.defaultMutationOptions(n),state:o});return this.add(r),r}add(t){oe(this,ar).add(t);const n=iu(t);if(typeof n=="string"){const o=oe(this,ho).get(n);o?o.push(t):oe(this,ho).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(oe(this,ar).delete(t)){const n=iu(t);if(typeof n=="string"){const o=oe(this,ho).get(n);if(o)if(o.length>1){const r=o.indexOf(t);r!==-1&&o.splice(r,1)}else o[0]===t&&oe(this,ho).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=iu(t);if(typeof n=="string"){const o=oe(this,ho).get(n),r=o==null?void 0:o.find(i=>i.state.status==="pending");return!r||r===t}else return!0}runNext(t){var o;const n=iu(t);if(typeof n=="string"){const r=(o=oe(this,ho).get(n))==null?void 0:o.find(i=>i!==t&&i.state.isPaused);return(r==null?void 0:r.continue())??Promise.resolve()}else return Promise.resolve()}clear(){pn.batch(()=>{oe(this,ar).forEach(t=>{this.notify({type:"removed",mutation:t})}),oe(this,ar).clear(),oe(this,ho).clear()})}getAll(){return Array.from(oe(this,ar))}find(t){const n={exact:!0,...t};return this.getAll().find(o=>SQ(n,o))}findAll(t={}){return this.getAll().filter(n=>SQ(t,n))}notify(t){pn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return pn.batch(()=>Promise.all(t.map(n=>n.continue().catch(Eo))))}},ar=new WeakMap,ho=new WeakMap,fA=new WeakMap,GQ);function iu(e){var t;return(t=e.options.scope)==null?void 0:t.id}function NQ(e){return{onFetch:(t,n)=>{var u,p,g,B,C;const o=t.options,r=(g=(p=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:p.fetchMore)==null?void 0:g.direction,i=((B=t.state.data)==null?void 0:B.pages)||[],a=((C=t.state.data)==null?void 0:C.pageParams)||[];let A={pages:[],pageParams:[]},l=0;const c=async()=>{let f=!1;const d=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(t.signal.aborted?f=!0:t.signal.addEventListener("abort",()=>{f=!0}),t.signal)})},E=kQ(t.options,t.fetchOptions),Q=async(h,m,I)=>{if(f)return Promise.reject();if(m==null&&h.pages.length)return Promise.resolve(h);const v={client:t.client,queryKey:t.queryKey,pageParam:m,direction:I?"backward":"forward",meta:t.options.meta};d(v);const w=await E(v),{maxPages:x}=t.options,S=I?oK:nK;return{pages:S(h.pages,w,x),pageParams:S(h.pageParams,m,x)}};if(r&&i.length){const h=r==="backward",m=h?CK:UQ,I={pages:i,pageParams:a},v=m(o,I);A=await Q(I,v,h)}else{const h=e??i.length;do{const m=l===0?a[0]??o.initialPageParam:UQ(o,A);if(l>0&&m==null)break;A=await Q(A,m),l++}while(l<h)}return A};t.options.persister?t.fetchFn=()=>{var f,d;return(d=(f=t.options).persister)==null?void 0:d.call(f,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function UQ(e,{pages:t,pageParams:n}){const o=t.length-1;return t.length>0?e.getNextPageParam(t[o],t,n[o],n):void 0}function CK(e,{pages:t,pageParams:n}){var o;return t.length>0?(o=e.getPreviousPageParam)==null?void 0:o.call(e,t[0],t,n[0],n):void 0}var EK=(XQ=class{constructor(e={}){rt(this,jt);rt(this,Or);rt(this,kr);rt(this,Ds);rt(this,Ps);rt(this,Mr);rt(this,Rs);rt(this,Ls);Ve(this,jt,e.queryCache||new dK),Ve(this,Or,e.mutationCache||new pK),Ve(this,kr,e.defaultOptions||{}),Ve(this,Ds,new Map),Ve(this,Ps,new Map),Ve(this,Mr,0)}mount(){cu(this,Mr)._++,oe(this,Mr)===1&&(Ve(this,Rs,MQ.subscribe(async e=>{e&&(await this.resumePausedMutations(),oe(this,jt).onFocus())})),Ve(this,Ls,ru.subscribe(async e=>{e&&(await this.resumePausedMutations(),oe(this,jt).onOnline())})))}unmount(){var e,t;cu(this,Mr)._--,oe(this,Mr)===0&&((e=oe(this,Rs))==null||e.call(this),Ve(this,Rs,void 0),(t=oe(this,Ls))==null||t.call(this),Ve(this,Ls,void 0))}isFetching(e){return oe(this,jt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return oe(this,Or).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=oe(this,jt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=oe(this,jt).build(this,t),o=n.state.data;return o===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(xQ(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(o))}getQueriesData(e){return oe(this,jt).findAll(e).map(({queryKey:t,state:n})=>{const o=n.data;return[t,o]})}setQueryData(e,t,n){const o=this.defaultQueryOptions({queryKey:e}),r=oe(this,jt).get(o.queryHash),i=r==null?void 0:r.state.data,a=ZX(t,i);if(a!==void 0)return oe(this,jt).build(this,o).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return pn.batch(()=>oe(this,jt).findAll(e).map(({queryKey:o})=>[o,this.setQueryData(o,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=oe(this,jt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=oe(this,jt);pn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=oe(this,jt);return pn.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},o=pn.batch(()=>oe(this,jt).findAll(e).map(r=>r.cancel(n)));return Promise.all(o).then(Eo).catch(Eo)}invalidateQueries(e,t={}){return pn.batch(()=>(oe(this,jt).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},o=pn.batch(()=>oe(this,jt).findAll(e).filter(r=>!r.isDisabled()).map(r=>{let i=r.fetch(void 0,n);return n.throwOnError||(i=i.catch(Eo)),r.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(o).then(Eo)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=oe(this,jt).build(this,t);return n.isStaleByTime(xQ(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Eo).catch(Eo)}fetchInfiniteQuery(e){return e.behavior=NQ(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Eo).catch(Eo)}ensureInfiniteQueryData(e){return e.behavior=NQ(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ru.isOnline()?oe(this,Or).resumePausedMutations():Promise.resolve()}getQueryCache(){return oe(this,jt)}getMutationCache(){return oe(this,Or)}getDefaultOptions(){return oe(this,kr)}setDefaultOptions(e){Ve(this,kr,e)}setQueryDefaults(e,t){oe(this,Ds).set(uA(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...oe(this,Ds).values()],n={};return t.forEach(o=>{dA(e,o.queryKey)&&Object.assign(n,o.defaultOptions)}),n}setMutationDefaults(e,t){oe(this,Ps).set(uA(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...oe(this,Ps).values()],n={};return t.forEach(o=>{dA(e,o.mutationKey)&&Object.assign(n,o.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...oe(this,kr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=e0(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===ou&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...oe(this,kr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){oe(this,jt).clear(),oe(this,Or).clear()}},jt=new WeakMap,Or=new WeakMap,kr=new WeakMap,Ds=new WeakMap,Ps=new WeakMap,Mr=new WeakMap,Rs=new WeakMap,Ls=new WeakMap,XQ),IK=T.createContext(void 0),hK=({client:e,children:t})=>(T.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),y.jsx(IK.Provider,{value:e,children:t}));const BK=({children:e})=>{const t=new EK;return y.jsx(hK,{client:t,children:e})},mK=uB({cardList:vW,write:nW}),QK=xV({reducer:mK,devTools:!0}),vK=({children:e,extraParams:t,contactEmail:n,baseUrls:o,availableFeatures:r,connectorFunctions:i})=>y.jsx(GU,{store:QK,children:y.jsx(KP,{custom:!0,children:y.jsx(BK,{children:y.jsx(_X,{availableFeatures:r,sendTrackingEvent:t==null?void 0:t.sendTrackingEvent,contactEmail:n,currentSmIds:t==null?void 0:t.currentSmIds,metaData:t==null?void 0:t.metaData,conversationId:t==null?void 0:t.conversationId,baseUrls:o,connectorFunctions:i,isAdmin:t==null?void 0:t.isAdmin,children:y.jsx(b.Suspense,{fallback:y.jsx(y.Fragment,{}),children:e})})})})}),yK=V(Et)`
|
|
2790
|
+
`,WX=e=>T.createElement("svg",{width:20,height:21,viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},T.createElement("mask",{id:"mask0_4649_80352",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:20,height:21},T.createElement("rect",{y:.320312,width:20,height:20,fill:"#D9D9D9"})),T.createElement("g",{mask:"url(#mask0_4649_80352)"},T.createElement("path",{d:"M9.16797 14.4873H10.8346V11.154H14.168V9.4873H10.8346V6.15397H9.16797V9.4873H5.83464V11.154H9.16797V14.4873ZM10.0013 18.654C8.84852 18.654 7.76519 18.4352 6.7513 17.9977C5.73741 17.5602 4.85547 16.9665 4.10547 16.2165C3.35547 15.4665 2.76172 14.5845 2.32422 13.5706C1.88672 12.5567 1.66797 11.4734 1.66797 10.3206C1.66797 9.16786 1.88672 8.08453 2.32422 7.07064C2.76172 6.05675 3.35547 5.1748 4.10547 4.4248C4.85547 3.6748 5.73741 3.08105 6.7513 2.64355C7.76519 2.20605 8.84852 1.9873 10.0013 1.9873C11.1541 1.9873 12.2374 2.20605 13.2513 2.64355C14.2652 3.08105 15.1471 3.6748 15.8971 4.4248C16.6471 5.1748 17.2409 6.05675 17.6784 7.07064C18.1159 8.08453 18.3346 9.16786 18.3346 10.3206C18.3346 11.4734 18.1159 12.5567 17.6784 13.5706C17.2409 14.5845 16.6471 15.4665 15.8971 16.2165C15.1471 16.9665 14.2652 17.5602 13.2513 17.9977C12.2374 18.4352 11.1541 18.654 10.0013 18.654ZM10.0013 16.9873C11.8624 16.9873 13.4388 16.3415 14.7305 15.0498C16.0221 13.7581 16.668 12.1817 16.668 10.3206C16.668 8.45953 16.0221 6.88314 14.7305 5.59147C13.4388 4.2998 11.8624 3.65397 10.0013 3.65397C8.14019 3.65397 6.5638 4.2998 5.27214 5.59147C3.98047 6.88314 3.33464 8.45953 3.33464 10.3206C3.33464 12.1817 3.98047 13.7581 5.27214 15.0498C6.5638 16.3415 8.14019 16.9873 10.0013 16.9873Z",fill:"#4D596C"}))),zX=e=>T.createElement("svg",{width:20,height:21,viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},T.createElement("path",{d:"M14.3462 8.73757C14.0406 8.43198 13.5451 8.43198 13.2395 8.73757C12.9339 9.04316 12.9339 9.53863 13.2395 9.84422L14.3462 8.73757ZM15.2392 10.7372L15.7925 10.1839L15.2392 10.7372ZM16.2377 13.1478L15.4552 13.1478L16.2377 13.1478ZM15.2392 15.5584L14.6859 15.0051L15.2392 15.5584ZM10.418 15.5584L9.86469 16.1118L10.418 15.5584ZM9.52499 13.5588C9.2194 13.2532 8.72393 13.2532 8.41834 13.5588C8.11275 13.8643 8.11275 14.3598 8.41834 14.6654L9.52499 13.5588ZM5.52477 11.7731C5.83036 12.0787 6.32583 12.0787 6.63142 11.7731C6.93701 11.4675 6.93701 10.972 6.63142 10.6665L5.52477 11.7731ZM9.45292 4.95224L10.0062 4.39892L9.45292 4.95224ZM10.346 6.95192C10.6515 7.25752 11.147 7.25752 11.4526 6.95192C11.7582 6.64633 11.7582 6.15087 11.4526 5.84527L10.346 6.95192ZM13.2395 9.84422L14.6859 11.2906L15.7925 10.1839L14.3462 8.73757L13.2395 9.84422ZM14.6859 11.2906C15.1785 11.7832 15.4552 12.4512 15.4552 13.1478L17.0202 13.1478C17.0202 12.0362 16.5786 10.97 15.7925 10.1839L14.6859 11.2906ZM15.4552 13.1478C15.4552 13.8445 15.1785 14.5125 14.6859 15.0051L15.7925 16.1118C16.5786 15.3257 17.0202 14.2595 17.0202 13.1478L15.4552 13.1478ZM14.6859 15.0051C13.6601 16.0308 11.9971 16.0308 10.9713 15.0051L9.86469 16.1118C11.5016 17.7487 14.1556 17.7487 15.7925 16.1118L14.6859 15.0051ZM10.9713 15.0051L9.52499 13.5588L8.41834 14.6654L9.86469 16.1118L10.9713 15.0051ZM6.63142 10.6665L5.18507 9.2201L4.07842 10.3268L5.52477 11.7731L6.63142 10.6665ZM5.18507 9.2201C4.69249 8.72752 4.41576 8.05944 4.41576 7.36283H2.85072C2.85072 8.47452 3.29234 9.54067 4.07842 10.3268L5.18507 9.2201ZM4.41576 7.36283C4.41576 6.66622 4.69249 5.99815 5.18507 5.50557L4.07842 4.39892C3.29234 5.185 2.85072 6.25115 2.85072 7.36283H4.41576ZM5.18507 5.50557C6.21081 4.47983 7.87386 4.47983 8.8996 5.50557L10.0062 4.39892C8.36932 2.76199 5.71534 2.76199 4.07842 4.39892L5.18507 5.50557ZM8.8996 5.50557L10.346 6.95192L11.4526 5.84527L10.0062 4.39892L8.8996 5.50557Z",fill:"#4D596C"}),T.createElement("rect",{x:6.36328,y:7.91895,width:1.66667,height:8.33333,rx:.833333,transform:"rotate(-45 6.36328 7.91895)",fill:"#4D596C"})),YX=({onCreateClick:e,onLinkClick:t,haveCreateObjects:n,haveLinkObjects:o})=>y.jsxs(Ne,{gap:2,marginTop:"12px",children:[y.jsx(He,{variant:"body2",color:Fe.palette.gray.gray1,children:OH}),y.jsxs(Ne,{gap:"12px",children:[n?y.jsxs(HX,{fullWidth:!0,onClick:e,size:"medium",children:[y.jsx(WX,{}),y.jsx("span",{className:"content__btn",children:L2})]}):null,o?y.jsxs(VX,{fullWidth:!0,color:"tertiary",variant:"outlined",onClick:t,size:"medium",children:[y.jsx(zX,{}),y.jsx("span",{className:"content__btn",children:N2})]}):null]})]}),GX="data:image/svg+xml,%3csvg%20width='20'%20height='21'%20viewBox='0%200%2020%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cmask%20id='mask0_4649_80352'%20style='mask-type:alpha'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='20'%20height='21'%3e%3crect%20y='0.320312'%20width='20'%20height='20'%20fill='%23D9D9D9'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_4649_80352)'%3e%3cpath%20d='M9.16797%2014.4873H10.8346V11.154H14.168V9.4873H10.8346V6.15397H9.16797V9.4873H5.83464V11.154H9.16797V14.4873ZM10.0013%2018.654C8.84852%2018.654%207.76519%2018.4352%206.7513%2017.9977C5.73741%2017.5602%204.85547%2016.9665%204.10547%2016.2165C3.35547%2015.4665%202.76172%2014.5845%202.32422%2013.5706C1.88672%2012.5567%201.66797%2011.4734%201.66797%2010.3206C1.66797%209.16786%201.88672%208.08453%202.32422%207.07064C2.76172%206.05675%203.35547%205.1748%204.10547%204.4248C4.85547%203.6748%205.73741%203.08105%206.7513%202.64355C7.76519%202.20605%208.84852%201.9873%2010.0013%201.9873C11.1541%201.9873%2012.2374%202.20605%2013.2513%202.64355C14.2652%203.08105%2015.1471%203.6748%2015.8971%204.4248C16.6471%205.1748%2017.2409%206.05675%2017.6784%207.07064C18.1159%208.08453%2018.3346%209.16786%2018.3346%2010.3206C18.3346%2011.4734%2018.1159%2012.5567%2017.6784%2013.5706C17.2409%2014.5845%2016.6471%2015.4665%2015.8971%2016.2165C15.1471%2016.9665%2014.2652%2017.5602%2013.2513%2017.9977C12.2374%2018.4352%2011.1541%2018.654%2010.0013%2018.654ZM10.0013%2016.9873C11.8624%2016.9873%2013.4388%2016.3415%2014.7305%2015.0498C16.0221%2013.7581%2016.668%2012.1817%2016.668%2010.3206C16.668%208.45953%2016.0221%206.88314%2014.7305%205.59147C13.4388%204.2998%2011.8624%203.65397%2010.0013%203.65397C8.14019%203.65397%206.5638%204.2998%205.27214%205.59147C3.98047%206.88314%203.33464%208.45953%203.33464%2010.3206C3.33464%2012.1817%203.98047%2013.7581%205.27214%2015.0498C6.5638%2016.3415%208.14019%2016.9873%2010.0013%2016.9873Z'%20fill='%234D596C'/%3e%3c/g%3e%3c/svg%3e",XX="data:image/svg+xml,%3csvg%20width='20'%20height='21'%20viewBox='0%200%2020%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14.3462%208.73757C14.0406%208.43198%2013.5451%208.43198%2013.2395%208.73757C12.9339%209.04316%2012.9339%209.53863%2013.2395%209.84422L14.3462%208.73757ZM15.2392%2010.7372L15.7925%2010.1839L15.2392%2010.7372ZM16.2377%2013.1478L15.4552%2013.1478L16.2377%2013.1478ZM15.2392%2015.5584L14.6859%2015.0051L15.2392%2015.5584ZM10.418%2015.5584L9.86469%2016.1118L10.418%2015.5584ZM9.52499%2013.5588C9.2194%2013.2532%208.72393%2013.2532%208.41834%2013.5588C8.11275%2013.8643%208.11275%2014.3598%208.41834%2014.6654L9.52499%2013.5588ZM5.52477%2011.7731C5.83036%2012.0787%206.32583%2012.0787%206.63142%2011.7731C6.93701%2011.4675%206.93701%2010.972%206.63142%2010.6665L5.52477%2011.7731ZM9.45292%204.95224L10.0062%204.39892L9.45292%204.95224ZM10.346%206.95192C10.6515%207.25752%2011.147%207.25752%2011.4526%206.95192C11.7582%206.64633%2011.7582%206.15087%2011.4526%205.84527L10.346%206.95192ZM13.2395%209.84422L14.6859%2011.2906L15.7925%2010.1839L14.3462%208.73757L13.2395%209.84422ZM14.6859%2011.2906C15.1785%2011.7832%2015.4552%2012.4512%2015.4552%2013.1478L17.0202%2013.1478C17.0202%2012.0362%2016.5786%2010.97%2015.7925%2010.1839L14.6859%2011.2906ZM15.4552%2013.1478C15.4552%2013.8445%2015.1785%2014.5125%2014.6859%2015.0051L15.7925%2016.1118C16.5786%2015.3257%2017.0202%2014.2595%2017.0202%2013.1478L15.4552%2013.1478ZM14.6859%2015.0051C13.6601%2016.0308%2011.9971%2016.0308%2010.9713%2015.0051L9.86469%2016.1118C11.5016%2017.7487%2014.1556%2017.7487%2015.7925%2016.1118L14.6859%2015.0051ZM10.9713%2015.0051L9.52499%2013.5588L8.41834%2014.6654L9.86469%2016.1118L10.9713%2015.0051ZM6.63142%2010.6665L5.18507%209.2201L4.07842%2010.3268L5.52477%2011.7731L6.63142%2010.6665ZM5.18507%209.2201C4.69249%208.72752%204.41576%208.05944%204.41576%207.36283H2.85072C2.85072%208.47452%203.29234%209.54067%204.07842%2010.3268L5.18507%209.2201ZM4.41576%207.36283C4.41576%206.66622%204.69249%205.99815%205.18507%205.50557L4.07842%204.39892C3.29234%205.185%202.85072%206.25115%202.85072%207.36283H4.41576ZM5.18507%205.50557C6.21081%204.47983%207.87386%204.47983%208.8996%205.50557L10.0062%204.39892C8.36932%202.76199%205.71534%202.76199%204.07842%204.39892L5.18507%205.50557ZM8.8996%205.50557L10.346%206.95192L11.4526%205.84527L10.0062%204.39892L8.8996%205.50557Z'%20fill='%234D596C'/%3e%3crect%20x='6.36328'%20y='7.91895'%20width='1.66667'%20height='8.33333'%20rx='0.833333'%20transform='rotate(-45%206.36328%207.91895)'%20fill='%234D596C'/%3e%3c/svg%3e",KX=({isAdmin:e=!1})=>{const{email:t,currentSmIds:n,sendTrackingEvent:o,availableFeatures:r,conversationId:i}=b.useContext(eo),a=ci(),{userGroupId:A}=li()||{},[l,c]=b.useState(!1),[u,p]=b.useState(!1),[g,B]=b.useState(!1),[C,f]=b.useState(),[d,E]=b.useState(!1),[Q,h]=b.useState(t),m=wt(sW),I=wt(aW),v=wt(lW),w=wt(cW),x=wt(AW),S=wt(Am),O=wt(lm),k=wt(cm),P=wt(um),D=br(r,mN),M=br(r,O2),N=br(r,xN),L=b.useCallback(()=>{t&&n.length&&i&&a(Nc({inboxIds:n,conversationId:i}))},[a,t,n,i]),W=b.useCallback(()=>{N&&i&&t&&a(Uc({conversationId:i,email:t}))},[a,i,t,N]),H=b.useCallback((_,ne)=>{_&&i&&ne&&a(Lc({id:_,channelType:"email",conversationId:i,externalResourceId:ne,contactEmail:t})).unwrap().catch(()=>{a(ws(null))})},[a,i,t]);if(b.useEffect(()=>{var _;if(k){c(!0);const{externalResourceId:ne}=k,ie=(_=k.forms.find(U=>U.type==="edit"))==null?void 0:_.id;H(ie,ne)}else c(!1),a(tW())},[k,H,a]),b.useEffect(()=>(W(),()=>{a(Df.clearConnectorList())}),[a,W]),b.useEffect(()=>(L(),()=>{a(Df.clearConnectorList())}),[a,L]),b.useEffect(()=>{m&&m.length&&o(_N,{numOfCards:m.length})},[m,o,n]),b.useEffect(()=>{i&&n&&n.length&&a(Oc({inboxIds:n,conversationId:i,channelType:"email"}))},[a,n,i]),!t.length||x===be.LOADING)return y.jsx(yX,{});const $=()=>{p(!0),o(eU)},R=()=>{B(!0),o(tU)},z=_=>{o(_,C),P?E(!0):p(!1)},G=_=>{if(k){const{connectorName:ne,title:ie}=k;o(_,{connector_name:ne,card_title:ie,sm_ids:n,ug_id:A})}P?E(!0):a(ws(null))},Y=()=>{p(!1),a(ws(null)),f(void 0),E(!1)},X=()=>{L(),a(Df.clearConnectorList())},J=[{label:"Go back",variant:"text",action:Y},{label:"Stay",variant:"contained",action:()=>E(!1)}],te=S.length>0,K=O.length>0,q=()=>te||K?y.jsx(YX,{haveCreateObjects:te,haveLinkObjects:K,onCreateClick:()=>p(!0),onLinkClick:()=>B(!0)}):y.jsx(IQ,{isAdmin:e,hideHeading:!0});return y.jsxs(oB,{"data-testid":Array.isArray(m)?"connector-agent":"loading",id:"connector-agent-container",stopOverflow:u||g,children:[y.jsx(bQ,{shown:d,setShown:E,title:DH,description:PH,buttons:J}),y.jsx(ZU,{children:I?y.jsxs(y.Fragment,{children:[y.jsxs(Ne,{direction:"row",justifyContent:"space-between",marginBottom:"12px",height:"36px",children:[y.jsxs(Ne,{direction:"row",alignItems:"center",children:[y.jsx(tB,{}),y.jsx(nB,{variant:"h2",children:SN})]}),y.jsx(Ne,{direction:"row",gap:"4px",children:M&&(m!=null&&m.length)?y.jsxs(y.Fragment,{children:[te?y.jsx(Rt,{title:L2,placement:"bottom",children:y.jsx(nn,{onClick:$,children:y.jsx("img",{src:GX,alt:"Add",height:"20px"})})}):null,K?y.jsx(Rt,{title:N2,placement:"bottom",children:y.jsx(nn,{onClick:R,children:y.jsx("img",{src:XX,alt:"Link Task",height:"20px"})})}):null]}):null})]}),N?y.jsx(FX,{selectedEmail:Q,setSelectedEmail:h}):null,D?y.jsx(bX,{}):null,m!=null&&m.length?y.jsx(VW,{cards:m,specificCardData:v,email:Q??"",specificConnectorApiStatus:w,onCardUnlinking:L}):null,!(m!=null&&m.length)&&M?q():null]}):y.jsx(IQ,{isAdmin:e})}),y.jsx($f,{onClose:()=>G(fU),isOpen:l,setIsOpen:c,title:LN,portalId:"connector-layover-portal",backButtonTooltip:"Back",children:y.jsx(wQ,{isEdit:!0,onClose:()=>G(gU),onCreateSuccess:X,metaData:C,setMetaData:f})}),y.jsx($f,{onClose:()=>z(aU),portalId:"connector-layover-portal",isOpen:u,setIsOpen:p,children:y.jsx(wQ,{onClose:()=>z(sU),onCreateSuccess:X,metaData:C,setMetaData:f})}),y.jsx($f,{onClose:()=>B(!1),portalId:"connector-layover-portal",isOpen:g,setIsOpen:B,children:y.jsx(UX,{setOpenTaskLinking:B,onLinkingSuccess:L})}),!I&&y.jsx(SU,{})]})},_X=({children:e,sendTrackingEvent:t,contactEmail:n,baseUrls:o={},currentSmIds:r=[],metaData:i,availableFeatures:a,conversationId:A,connectorFunctions:l,isAdmin:c=!1})=>{const u=b.useMemo(()=>({email:n,baseUrls:o,currentSmIds:r,metaData:i,conversationId:A,sendTrackingEvent:t||(()=>{}),availableFeatures:a,isAdmin:c,connectorFunctions:l}),[n,o,t,r,i,a,A,c,l]);return y.jsx(eo.Provider,{value:u,children:e})};var tu=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},nu=typeof window>"u"||"Deno"in globalThis;function Eo(){}function ZX(e,t){return typeof e=="function"?e(t):e}function JX(e){return typeof e=="number"&&e>=0&&e!==1/0}function qX(e,t){return Math.max(e+(t||0)-Date.now(),0)}function xQ(e,t){return typeof e=="function"?e(t):e}function $X(e,t){return typeof e=="function"?e(t):e}function TQ(e,t){const{type:n="all",exact:o,fetchStatus:r,predicate:i,queryKey:a,stale:A}=e;if(a){if(o){if(t.queryHash!==e0(a,t.options))return!1}else if(!dA(t.queryKey,a))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof A=="boolean"&&t.isStale()!==A||r&&r!==t.state.fetchStatus||i&&!i(t))}function SQ(e,t){const{exact:n,status:o,predicate:r,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(uA(t.options.mutationKey)!==uA(i))return!1}else if(!dA(t.options.mutationKey,i))return!1}return!(o&&t.state.status!==o||r&&!r(t))}function e0(e,t){return((t==null?void 0:t.queryKeyHashFn)||uA)(e)}function uA(e){return JSON.stringify(e,(t,n)=>n0(n)?Object.keys(n).sort().reduce((o,r)=>(o[r]=n[r],o),{}):n)}function dA(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!dA(e[n],t[n])):!1}function t0(e,t){if(e===t)return e;const n=FQ(e)&&FQ(t);if(n||n0(e)&&n0(t)){const o=n?e:Object.keys(e),r=o.length,i=n?t:Object.keys(t),a=i.length,A=n?[]:{};let l=0;for(let c=0;c<a;c++){const u=n?c:i[c];(!n&&o.includes(u)||n)&&e[u]===void 0&&t[u]===void 0?(A[u]=void 0,l++):(A[u]=t0(e[u],t[u]),A[u]===e[u]&&e[u]!==void 0&&l++)}return r===a&&l===r?e:A}return t}function FQ(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function n0(e){if(!OQ(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!OQ(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function OQ(e){return Object.prototype.toString.call(e)==="[object Object]"}function eK(e){return new Promise(t=>{setTimeout(t,e)})}function tK(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return t0(e,t)}catch(o){console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${o}`)}return t0(e,t)}return t}function nK(e,t,n=0){const o=[...e,t];return n&&o.length>n?o.slice(1):o}function oK(e,t,n=0){const o=[t,...e];return n&&o.length>n?o.slice(0,-1):o}var ou=Symbol();function kQ(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===ou&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===ou?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var rK=(jQ=class extends tu{constructor(){super();rt(this,mi);rt(this,Sr);rt(this,Ss);Ve(this,Ss,t=>{if(!nu&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){oe(this,Sr)||this.setEventListener(oe(this,Ss))}onUnsubscribe(){var t;this.hasListeners()||((t=oe(this,Sr))==null||t.call(this),Ve(this,Sr,void 0))}setEventListener(t){var n;Ve(this,Ss,t),(n=oe(this,Sr))==null||n.call(this),Ve(this,Sr,t(o=>{typeof o=="boolean"?this.setFocused(o):this.onFocus()}))}setFocused(t){oe(this,mi)!==t&&(Ve(this,mi,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof oe(this,mi)=="boolean"?oe(this,mi):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},mi=new WeakMap,Sr=new WeakMap,Ss=new WeakMap,jQ),MQ=new rK,iK=(VQ=class extends tu{constructor(){super();rt(this,Fs,!0);rt(this,Fr);rt(this,Os);Ve(this,Os,t=>{if(!nu&&window.addEventListener){const n=()=>t(!0),o=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",o,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",o)}}})}onSubscribe(){oe(this,Fr)||this.setEventListener(oe(this,Os))}onUnsubscribe(){var t;this.hasListeners()||((t=oe(this,Fr))==null||t.call(this),Ve(this,Fr,void 0))}setEventListener(t){var n;Ve(this,Os,t),(n=oe(this,Fr))==null||n.call(this),Ve(this,Fr,t(this.setOnline.bind(this)))}setOnline(t){oe(this,Fs)!==t&&(Ve(this,Fs,t),this.listeners.forEach(o=>{o(t)}))}isOnline(){return oe(this,Fs)}},Fs=new WeakMap,Fr=new WeakMap,Os=new WeakMap,VQ),ru=new iK;function sK(){let e,t;const n=new Promise((r,i)=>{e=r,t=i});n.status="pending",n.catch(()=>{});function o(r){Object.assign(n,r),delete n.resolve,delete n.reject}return n.resolve=r=>{o({status:"fulfilled",value:r}),e(r)},n.reject=r=>{o({status:"rejected",reason:r}),t(r)},n}function aK(e){return Math.min(1e3*2**e,3e4)}function DQ(e){return(e??"online")==="online"?ru.isOnline():!0}var PQ=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function o0(e){return e instanceof PQ}function RQ(e){let t=!1,n=0,o=!1,r;const i=sK(),a=f=>{var d;o||(g(new PQ(f)),(d=e.abort)==null||d.call(e))},A=()=>{t=!0},l=()=>{t=!1},c=()=>MQ.isFocused()&&(e.networkMode==="always"||ru.isOnline())&&e.canRun(),u=()=>DQ(e.networkMode)&&e.canRun(),p=f=>{var d;o||(o=!0,(d=e.onSuccess)==null||d.call(e,f),r==null||r(),i.resolve(f))},g=f=>{var d;o||(o=!0,(d=e.onError)==null||d.call(e,f),r==null||r(),i.reject(f))},B=()=>new Promise(f=>{var d;r=E=>{(o||c())&&f(E)},(d=e.onPause)==null||d.call(e)}).then(()=>{var f;r=void 0,o||(f=e.onContinue)==null||f.call(e)}),C=()=>{if(o)return;let f;const d=n===0?e.initialPromise:void 0;try{f=d??e.fn()}catch(E){f=Promise.reject(E)}Promise.resolve(f).then(p).catch(E=>{var v;if(o)return;const Q=e.retry??(nu?0:3),h=e.retryDelay??aK,m=typeof h=="function"?h(n,E):h,I=Q===!0||typeof Q=="number"&&n<Q||typeof Q=="function"&&Q(n,E);if(t||!I){g(E);return}n++,(v=e.onFail)==null||v.call(e,n,E),eK(m).then(()=>c()?void 0:B()).then(()=>{t?g(E):C()})})};return{promise:i,cancel:a,continue:()=>(r==null||r(),i),cancelRetry:A,continueRetry:l,canStart:u,start:()=>(u()?C():B().then(C),i)}}function AK(){let e=[],t=0,n=A=>{A()},o=A=>{A()},r=A=>setTimeout(A,0);const i=A=>{t?e.push(A):r(()=>{n(A)})},a=()=>{const A=e;e=[],A.length&&r(()=>{o(()=>{A.forEach(l=>{n(l)})})})};return{batch:A=>{let l;t++;try{l=A()}finally{t--,t||a()}return l},batchCalls:A=>(...l)=>{i(()=>{A(...l)})},schedule:i,setNotifyFunction:A=>{n=A},setBatchNotifyFunction:A=>{o=A},setScheduler:A=>{r=A}}}var pn=AK(),LQ=(HQ=class{constructor(){rt(this,Qi)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),JX(this.gcTime)&&Ve(this,Qi,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(nu?1/0:5*60*1e3))}clearGcTimeout(){oe(this,Qi)&&(clearTimeout(oe(this,Qi)),Ve(this,Qi,void 0))}},Qi=new WeakMap,HQ),lK=(WQ=class extends LQ{constructor(t){super();rt(this,Io);rt(this,ks);rt(this,Ms);rt(this,to);rt(this,vi);rt(this,An);rt(this,gA);rt(this,yi);Ve(this,yi,!1),Ve(this,gA,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ve(this,vi,t.client),Ve(this,to,oe(this,vi).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ve(this,ks,uK(this.options)),this.state=t.state??oe(this,ks),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=oe(this,An))==null?void 0:t.promise}setOptions(t){this.options={...oe(this,gA),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&oe(this,to).remove(this)}setData(t,n){const o=tK(this.state.data,t,this.options);return ln(this,Io,Ar).call(this,{data:o,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),o}setState(t,n){ln(this,Io,Ar).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var o,r;const n=(o=oe(this,An))==null?void 0:o.promise;return(r=oe(this,An))==null||r.cancel(t),n?n.then(Eo).catch(Eo):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(oe(this,ks))}isActive(){return this.observers.some(t=>$X(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ou||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!qX(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(o=>o.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=oe(this,An))==null||n.continue()}onOnline(){var n;const t=this.observers.find(o=>o.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=oe(this,An))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),oe(this,to).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(oe(this,An)&&(oe(this,yi)?oe(this,An).cancel({revert:!0}):oe(this,An).cancelRetry()),this.scheduleGc()),oe(this,to).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ln(this,Io,Ar).call(this,{type:"invalidate"})}fetch(t,n){var l,c,u;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(oe(this,An))return oe(this,An).continueRetry(),oe(this,An).promise}if(t&&this.setOptions(t),!this.options.queryFn){const p=this.observers.find(g=>g.options.queryFn);p&&this.setOptions(p.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const o=new AbortController,r=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(Ve(this,yi,!0),o.signal)})},i=()=>{const p=kQ(this.options,n),g={client:oe(this,vi),queryKey:this.queryKey,meta:this.meta};return r(g),Ve(this,yi,!1),this.options.persister?this.options.persister(p,g,this):p(g)},a={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:oe(this,vi),state:this.state,fetchFn:i};r(a),(l=this.options.behavior)==null||l.onFetch(a,this),Ve(this,Ms,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=a.fetchOptions)==null?void 0:c.meta))&&ln(this,Io,Ar).call(this,{type:"fetch",meta:(u=a.fetchOptions)==null?void 0:u.meta});const A=p=>{var g,B,C,f;o0(p)&&p.silent||ln(this,Io,Ar).call(this,{type:"error",error:p}),o0(p)||((B=(g=oe(this,to).config).onError)==null||B.call(g,p,this),(f=(C=oe(this,to).config).onSettled)==null||f.call(C,this.state.data,p,this)),this.scheduleGc()};return Ve(this,An,RQ({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:o.abort.bind(o),onSuccess:p=>{var g,B,C,f;if(p===void 0){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),A(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(p)}catch(d){A(d);return}(B=(g=oe(this,to).config).onSuccess)==null||B.call(g,p,this),(f=(C=oe(this,to).config).onSettled)==null||f.call(C,p,this.state.error,this),this.scheduleGc()},onError:A,onFail:(p,g)=>{ln(this,Io,Ar).call(this,{type:"failed",failureCount:p,error:g})},onPause:()=>{ln(this,Io,Ar).call(this,{type:"pause"})},onContinue:()=>{ln(this,Io,Ar).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),oe(this,An).start()}},ks=new WeakMap,Ms=new WeakMap,to=new WeakMap,vi=new WeakMap,An=new WeakMap,gA=new WeakMap,yi=new WeakMap,Io=new WeakSet,Ar=function(t){const n=o=>{switch(t.type){case"failed":return{...o,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...o,fetchStatus:"paused"};case"continue":return{...o,fetchStatus:"fetching"};case"fetch":return{...o,...cK(o.data,this.options),fetchMeta:t.meta??null};case"success":return{...o,data:t.data,dataUpdateCount:o.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const r=t.error;return o0(r)&&r.revert&&oe(this,Ms)?{...oe(this,Ms),fetchStatus:"idle"}:{...o,error:r,errorUpdateCount:o.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:o.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...o,isInvalidated:!0};case"setState":return{...o,...t.state}}};this.state=n(this.state),pn.batch(()=>{this.observers.forEach(o=>{o.onQueryUpdate()}),oe(this,to).notify({query:this,type:"updated",action:t})})},WQ);function cK(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:DQ(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function uK(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,o=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var dK=(zQ=class extends tu{constructor(t={}){super();rt(this,Lo);this.config=t,Ve(this,Lo,new Map)}build(t,n,o){const r=n.queryKey,i=n.queryHash??e0(r,n);let a=this.get(i);return a||(a=new lK({client:t,queryKey:r,queryHash:i,options:t.defaultQueryOptions(n),state:o,defaultOptions:t.getQueryDefaults(r)}),this.add(a)),a}add(t){oe(this,Lo).has(t.queryHash)||(oe(this,Lo).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=oe(this,Lo).get(t.queryHash);n&&(t.destroy(),n===t&&oe(this,Lo).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){pn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return oe(this,Lo).get(t)}getAll(){return[...oe(this,Lo).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(o=>TQ(n,o))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(o=>TQ(t,o)):n}notify(t){pn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){pn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){pn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Lo=new WeakMap,zQ),gK=(YQ=class extends LQ{constructor(t){super();rt(this,Uo);rt(this,No);rt(this,Cn);rt(this,bi);this.mutationId=t.mutationId,Ve(this,Cn,t.mutationCache),Ve(this,No,[]),this.state=t.state||fK(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){oe(this,No).includes(t)||(oe(this,No).push(t),this.clearGcTimeout(),oe(this,Cn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ve(this,No,oe(this,No).filter(n=>n!==t)),this.scheduleGc(),oe(this,Cn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){oe(this,No).length||(this.state.status==="pending"?this.scheduleGc():oe(this,Cn).remove(this))}continue(){var t;return((t=oe(this,bi))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var r,i,a,A,l,c,u,p,g,B,C,f,d,E,Q,h,m,I,v,w;Ve(this,bi,RQ({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(x,S)=>{ln(this,Uo,Pr).call(this,{type:"failed",failureCount:x,error:S})},onPause:()=>{ln(this,Uo,Pr).call(this,{type:"pause"})},onContinue:()=>{ln(this,Uo,Pr).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>oe(this,Cn).canRun(this)}));const n=this.state.status==="pending",o=!oe(this,bi).canStart();try{if(!n){ln(this,Uo,Pr).call(this,{type:"pending",variables:t,isPaused:o}),await((i=(r=oe(this,Cn).config).onMutate)==null?void 0:i.call(r,t,this));const S=await((A=(a=this.options).onMutate)==null?void 0:A.call(a,t));S!==this.state.context&&ln(this,Uo,Pr).call(this,{type:"pending",context:S,variables:t,isPaused:o})}const x=await oe(this,bi).start();return await((c=(l=oe(this,Cn).config).onSuccess)==null?void 0:c.call(l,x,t,this.state.context,this)),await((p=(u=this.options).onSuccess)==null?void 0:p.call(u,x,t,this.state.context)),await((B=(g=oe(this,Cn).config).onSettled)==null?void 0:B.call(g,x,null,this.state.variables,this.state.context,this)),await((f=(C=this.options).onSettled)==null?void 0:f.call(C,x,null,t,this.state.context)),ln(this,Uo,Pr).call(this,{type:"success",data:x}),x}catch(x){try{throw await((E=(d=oe(this,Cn).config).onError)==null?void 0:E.call(d,x,t,this.state.context,this)),await((h=(Q=this.options).onError)==null?void 0:h.call(Q,x,t,this.state.context)),await((I=(m=oe(this,Cn).config).onSettled)==null?void 0:I.call(m,void 0,x,this.state.variables,this.state.context,this)),await((w=(v=this.options).onSettled)==null?void 0:w.call(v,void 0,x,t,this.state.context)),x}finally{ln(this,Uo,Pr).call(this,{type:"error",error:x})}}finally{oe(this,Cn).runNext(this)}}},No=new WeakMap,Cn=new WeakMap,bi=new WeakMap,Uo=new WeakSet,Pr=function(t){const n=o=>{switch(t.type){case"failed":return{...o,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...o,isPaused:!0};case"continue":return{...o,isPaused:!1};case"pending":return{...o,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...o,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...o,data:void 0,error:t.error,failureCount:o.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),pn.batch(()=>{oe(this,No).forEach(o=>{o.onMutationUpdate(t)}),oe(this,Cn).notify({mutation:this,type:"updated",action:t})})},YQ);function fK(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var pK=(GQ=class extends tu{constructor(t={}){super();rt(this,ar);rt(this,ho);rt(this,fA);this.config=t,Ve(this,ar,new Set),Ve(this,ho,new Map),Ve(this,fA,0)}build(t,n,o){const r=new gK({mutationCache:this,mutationId:++cu(this,fA)._,options:t.defaultMutationOptions(n),state:o});return this.add(r),r}add(t){oe(this,ar).add(t);const n=iu(t);if(typeof n=="string"){const o=oe(this,ho).get(n);o?o.push(t):oe(this,ho).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(oe(this,ar).delete(t)){const n=iu(t);if(typeof n=="string"){const o=oe(this,ho).get(n);if(o)if(o.length>1){const r=o.indexOf(t);r!==-1&&o.splice(r,1)}else o[0]===t&&oe(this,ho).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=iu(t);if(typeof n=="string"){const o=oe(this,ho).get(n),r=o==null?void 0:o.find(i=>i.state.status==="pending");return!r||r===t}else return!0}runNext(t){var o;const n=iu(t);if(typeof n=="string"){const r=(o=oe(this,ho).get(n))==null?void 0:o.find(i=>i!==t&&i.state.isPaused);return(r==null?void 0:r.continue())??Promise.resolve()}else return Promise.resolve()}clear(){pn.batch(()=>{oe(this,ar).forEach(t=>{this.notify({type:"removed",mutation:t})}),oe(this,ar).clear(),oe(this,ho).clear()})}getAll(){return Array.from(oe(this,ar))}find(t){const n={exact:!0,...t};return this.getAll().find(o=>SQ(n,o))}findAll(t={}){return this.getAll().filter(n=>SQ(t,n))}notify(t){pn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return pn.batch(()=>Promise.all(t.map(n=>n.continue().catch(Eo))))}},ar=new WeakMap,ho=new WeakMap,fA=new WeakMap,GQ);function iu(e){var t;return(t=e.options.scope)==null?void 0:t.id}function NQ(e){return{onFetch:(t,n)=>{var u,p,g,B,C;const o=t.options,r=(g=(p=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:p.fetchMore)==null?void 0:g.direction,i=((B=t.state.data)==null?void 0:B.pages)||[],a=((C=t.state.data)==null?void 0:C.pageParams)||[];let A={pages:[],pageParams:[]},l=0;const c=async()=>{let f=!1;const d=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(t.signal.aborted?f=!0:t.signal.addEventListener("abort",()=>{f=!0}),t.signal)})},E=kQ(t.options,t.fetchOptions),Q=async(h,m,I)=>{if(f)return Promise.reject();if(m==null&&h.pages.length)return Promise.resolve(h);const v={client:t.client,queryKey:t.queryKey,pageParam:m,direction:I?"backward":"forward",meta:t.options.meta};d(v);const w=await E(v),{maxPages:x}=t.options,S=I?oK:nK;return{pages:S(h.pages,w,x),pageParams:S(h.pageParams,m,x)}};if(r&&i.length){const h=r==="backward",m=h?CK:UQ,I={pages:i,pageParams:a},v=m(o,I);A=await Q(I,v,h)}else{const h=e??i.length;do{const m=l===0?a[0]??o.initialPageParam:UQ(o,A);if(l>0&&m==null)break;A=await Q(A,m),l++}while(l<h)}return A};t.options.persister?t.fetchFn=()=>{var f,d;return(d=(f=t.options).persister)==null?void 0:d.call(f,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function UQ(e,{pages:t,pageParams:n}){const o=t.length-1;return t.length>0?e.getNextPageParam(t[o],t,n[o],n):void 0}function CK(e,{pages:t,pageParams:n}){var o;return t.length>0?(o=e.getPreviousPageParam)==null?void 0:o.call(e,t[0],t,n[0],n):void 0}var EK=(XQ=class{constructor(e={}){rt(this,jt);rt(this,Or);rt(this,kr);rt(this,Ds);rt(this,Ps);rt(this,Mr);rt(this,Rs);rt(this,Ls);Ve(this,jt,e.queryCache||new dK),Ve(this,Or,e.mutationCache||new pK),Ve(this,kr,e.defaultOptions||{}),Ve(this,Ds,new Map),Ve(this,Ps,new Map),Ve(this,Mr,0)}mount(){cu(this,Mr)._++,oe(this,Mr)===1&&(Ve(this,Rs,MQ.subscribe(async e=>{e&&(await this.resumePausedMutations(),oe(this,jt).onFocus())})),Ve(this,Ls,ru.subscribe(async e=>{e&&(await this.resumePausedMutations(),oe(this,jt).onOnline())})))}unmount(){var e,t;cu(this,Mr)._--,oe(this,Mr)===0&&((e=oe(this,Rs))==null||e.call(this),Ve(this,Rs,void 0),(t=oe(this,Ls))==null||t.call(this),Ve(this,Ls,void 0))}isFetching(e){return oe(this,jt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return oe(this,Or).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=oe(this,jt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=oe(this,jt).build(this,t),o=n.state.data;return o===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(xQ(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(o))}getQueriesData(e){return oe(this,jt).findAll(e).map(({queryKey:t,state:n})=>{const o=n.data;return[t,o]})}setQueryData(e,t,n){const o=this.defaultQueryOptions({queryKey:e}),r=oe(this,jt).get(o.queryHash),i=r==null?void 0:r.state.data,a=ZX(t,i);if(a!==void 0)return oe(this,jt).build(this,o).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return pn.batch(()=>oe(this,jt).findAll(e).map(({queryKey:o})=>[o,this.setQueryData(o,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=oe(this,jt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=oe(this,jt);pn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=oe(this,jt);return pn.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},o=pn.batch(()=>oe(this,jt).findAll(e).map(r=>r.cancel(n)));return Promise.all(o).then(Eo).catch(Eo)}invalidateQueries(e,t={}){return pn.batch(()=>(oe(this,jt).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},o=pn.batch(()=>oe(this,jt).findAll(e).filter(r=>!r.isDisabled()).map(r=>{let i=r.fetch(void 0,n);return n.throwOnError||(i=i.catch(Eo)),r.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(o).then(Eo)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=oe(this,jt).build(this,t);return n.isStaleByTime(xQ(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Eo).catch(Eo)}fetchInfiniteQuery(e){return e.behavior=NQ(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Eo).catch(Eo)}ensureInfiniteQueryData(e){return e.behavior=NQ(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ru.isOnline()?oe(this,Or).resumePausedMutations():Promise.resolve()}getQueryCache(){return oe(this,jt)}getMutationCache(){return oe(this,Or)}getDefaultOptions(){return oe(this,kr)}setDefaultOptions(e){Ve(this,kr,e)}setQueryDefaults(e,t){oe(this,Ds).set(uA(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...oe(this,Ds).values()],n={};return t.forEach(o=>{dA(e,o.queryKey)&&Object.assign(n,o.defaultOptions)}),n}setMutationDefaults(e,t){oe(this,Ps).set(uA(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...oe(this,Ps).values()],n={};return t.forEach(o=>{dA(e,o.mutationKey)&&Object.assign(n,o.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...oe(this,kr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=e0(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===ou&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...oe(this,kr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){oe(this,jt).clear(),oe(this,Or).clear()}},jt=new WeakMap,Or=new WeakMap,kr=new WeakMap,Ds=new WeakMap,Ps=new WeakMap,Mr=new WeakMap,Rs=new WeakMap,Ls=new WeakMap,XQ),IK=T.createContext(void 0),hK=({client:e,children:t})=>(T.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),y.jsx(IK.Provider,{value:e,children:t}));const BK=({children:e})=>{const t=new EK;return y.jsx(hK,{client:t,children:e})},mK=uB({cardList:vW,write:nW}),QK=xV({reducer:mK,devTools:!0}),vK=({children:e,extraParams:t,contactEmail:n,baseUrls:o,availableFeatures:r,connectorFunctions:i})=>y.jsx(GU,{store:QK,children:y.jsx(KP,{custom:!0,children:y.jsx(BK,{children:y.jsx(_X,{availableFeatures:r,sendTrackingEvent:t==null?void 0:t.sendTrackingEvent,contactEmail:n,currentSmIds:t==null?void 0:t.currentSmIds,metaData:t==null?void 0:t.metaData,conversationId:t==null?void 0:t.conversationId,baseUrls:o,connectorFunctions:i,isAdmin:t==null?void 0:t.isAdmin,children:y.jsx(b.Suspense,{fallback:y.jsx(y.Fragment,{}),children:e})})})})}),yK=V(Et)`
|
|
2791
2791
|
height: inherit;
|
|
2792
2792
|
.MuiScopedCssBaseline-root {
|
|
2793
2793
|
height: inherit;
|