1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9617],{44848:(e,o,t)=>{"use strict";t.r(o),t.d(o,{default:()=>h});var n=t(37876),s=t(14232),r=t(89099),l=t(60437),a=t(1992),d=t(81837),u=t(28539),i=t(58582),c=t(49398),v=t(16018);let h=()=>{let e=(0,r.useRouter)(),{mutate:o}=function(e){let o=(0,d.A)(),{user:t}=(0,u.Z2)();return(0,a.useMutation)(e=>{var n;if(console.log("requestBody",e),!e.eventId||!e.authCode)return console.error("Missing eventId or authCode"),Promise.reject(Error("Missing eventId or authCode"));let s={...e,adminUserId:null==t?void 0:t.id,businessId:null==t?void 0:null===(n=t.businesses[0])||void 0===n?void 0:n.businessId};return console.log("data",s),o.post("/admin/event/sync-event-with-google",s).catch(()=>null)},e)}({onSuccess(o){var t,s;(null==o?void 0:null===(t=o.data)||void 0===t?void 0:t.success)?((0,c.oR)((0,n.jsx)(i.y,{type:"success",children:null==o?void 0:null===(s=o.data)||void 0===s?void 0:s.message})),localStorage.removeItem("authCode"),localStorage.removeItem("authScope"),localStorage.removeItem("pendingEventId")):(0,v.H4)(null==o?void 0:o.data,e=>(0,c.oR)((0,n.jsx)(i.y,{type:"error",children:e}))),e.push("/calendar")},onError(o){(0,v.H4)(o,e=>(0,c.oR)((0,n.jsx)(i.y,{type:"error",children:e}))),e.push("/calendar")}}),{mutate:t}=function(e){let o=(0,d.A)(),{user:t}=(0,u.Z2)();return(0,a.useMutation)(e=>{var n;if(console.log("requestBody",e),!e.eventId||!e.authCode)return console.error("Missing eventId or authCode"),Promise.reject(Error("Missing eventId or authCode"));let s={...e,adminUserId:null==t?void 0:t.id,businessId:null==t?void 0:null===(n=t.businesses[0])||void 0===n?void 0:n.businessId};return console.log("data",s),o.post("/admin/event/sync-event-with-outlook",s).catch(()=>null)},e)}({onSuccess(o){var t,s;(null==o?void 0:null===(t=o.data)||void 0===t?void 0:t.success)?((0,c.oR)((0,n.jsx)(i.y,{type:"success",children:null==o?void 0:null===(s=o.data)||void 0===s?void 0:s.message})),localStorage.removeItem("authCode"),localStorage.removeItem("pendingEventId")):(0,v.H4)(null==o?void 0:o.data,e=>(0,c.oR)((0,n.jsx)(i.y,{type:"error",children:e}))),e.push("/calendar")},onError(o){(0,v.H4)(o,e=>(0,c.oR)((0,n.jsx)(i.y,{type:"error",children:e}))),e.push("/calendar")}});return(0,s.useEffect)(()=>{if(e.isReady&&"/callback"===window.location.pathname){let{code:n,scope:s}=e.query,r=localStorage.getItem("pendingEventId");if(n&&r){let e=parseInt(r,10);localStorage.setItem("authCode",n),s?(localStorage.setItem("authScope",s),o({eventId:e,authCode:n})):t({eventId:e,authCode:n})}else e.push("/calendar")}},[e.isReady,e.query,o,t]),(0,n.jsx)("div",{className:"flex items-center justify-center h-screen",children:(0,n.jsx)(l.$,{loading:!0})})}},71237:(e,o,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/callback",function(){return t(44848)}])}},e=>{var o=o=>e(e.s=o);e.O(0,[636,6593,8792],()=>o(71237)),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.