"use strict";var T=Object.create;var i=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var P=Object.getPrototypeOf;var k=Object.prototype.hasOwnProperty;var d=(s,e)=>i(s,"name",{value:e,configurable:true});var U=(s,e)=>{for(var t in e)i(s,t,{get:e[t],enumerable:true})};var v=(s,e,t,r)=>{if(e&&typeof e==="object"||typeof e==="function"){for(let a of u(e))if(!k.call(s,a)&&a!==t)i(s,a,{get:()=>e[a],enumerable:!(r=h(e,a))||r.enumerable})}return s};var c=(s,e,t)=>(t=s!=null?T(P(s)):{},v(e||!s||!s.__esModule?i(t,"default",{value:s,enumerable:true}):t,s));var O=s=>v(i({},"__esModule",{value:true}),s);var S=(s,e,t,r)=>{var a=r>1?void 0:r?h(e,t):e;for(var n=s.length-1,p;n>=0;n--)if(p=s[n])a=(r?p(e,t,a):p(a))||a;if(r&&a)i(e,t,a);return a};var b={};U(b,{default:()=>E});module.exports=O(b);var y=require("react/jsx-runtime");var o=require("mobx-react");var l=c(require("ms"));var g=require("react");var I=c(require("../../components/auth/SetupAssistant"));var f=c(require("../../helpers/async-helpers"));let m=class extends g.Component{services;constructor(e){super(e);this.state={isSettingUpServices:false};this.services={whatsapp:{name:"WhatsApp",hasTeamId:false},messenger:{name:"Messenger",hasTeamId:false},gmail:{name:"Gmail",hasTeamId:false},skype:{name:"Skype",hasTeamId:false},telegram:{name:"Telegram",hasTeamId:false},instagram:{name:"Instagram",hasTeamId:false},slack:{name:"Slack",hasTeamId:true},hangouts:{name:"Hangouts",hasTeamId:false},linkedin:{name:"LinkedIn",hasTeamId:false}}}async setupServices(e){const{services:t,router:r}=this.props.stores;this.setState({isSettingUpServices:true});for(const a of e){await t._createService({recipeId:a.id,serviceData:{name:this.services[a.id].name,team:a.team},redirect:false,skipCleanup:true});await(0,f.default)((0,l.default)("100ms"))}this.setState({isSettingUpServices:false});await(0,f.default)((0,l.default)("100ms"));r.push("/")}render(){return(0,y.jsx)(I.default,{onSubmit:e=>this.setupServices(e),services:this.services,isSettingUpServices:this.state.isSettingUpServices})}};d(m,"SetupAssistantScreen");m=S([(0,o.inject)("stores","actions"),o.observer],m);var E=m;
