1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2830],{22830:(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{nylas_scheduler_editor:()=>NylasSchedulerEditor});var _index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(33712),_index_es_13ff6710_73fa05e6_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(29850),_scheduler_config_store_d6729d8d_50920e8c_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(89437),_constants_3d8016e3_3c080f00_js__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(95938),react__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(12115),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(95155),react_dom__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(47650),_e=Object.defineProperty,be=(e,t,n)=>t in e?_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P=(e,t,n)=>(be(e,"symbol"!=typeof t?t+"":t,n),n);_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.b.extend(_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.u),_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.b.extend(_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.t);class NylasSchedulerConfigAPIConnector{constructor({nylasApiRequest:e,nylasSchedulerConfigStore:t}){this.nylasApiRequest=e,this.nylasSchedulerConfigStore=t}async currentUser(){return this.nylasApiRequest?this.nylasApiRequest.currentUser():(console.warn("Nylas API Request is not initialized"),null)}async getCalendars(){var e;if(!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error fetching calendars: Nylas API Request is not initialized"});let[t,n]=await this.nylasApiRequest.request({method:"GET",path:"calendars"});return n?(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error fetching calendars: "+n.message}):(0,_index_es_13ff6710_73fa05e6_js__WEBPACK_IMPORTED_MODULE_1__.X)(t)?(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error fetching calendars: "+(null==(e=t.error)?void 0:e.message)}):(this.nylasSchedulerConfigStore.state.calendars=t.data,(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(t.data))}async getConfigurationById(e,t=!1){var n;if(!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error fetching configuration: Nylas API Request is not initialized"});if(!t){let t=this.nylasSchedulerConfigStore.state.configurations.find(t=>t.id===e);if(t)return this.nylasSchedulerConfigStore.state.selectedConfiguration=t,(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(t)}let[i,r]=await this.nylasApiRequest.request({method:"GET",path:`scheduling/configurations/${e}`});return r?(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error fetching configuration: "+r.message}):(0,_index_es_13ff6710_73fa05e6_js__WEBPACK_IMPORTED_MODULE_1__.X)(i)?(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error fetching configuration: "+(null==(n=i.error)?void 0:n.message)}):(this.nylasSchedulerConfigStore.state.selectedConfiguration=i.data,this.nylasSchedulerConfigStore.state.configurations.find(t=>t.id===e)?this.nylasSchedulerConfigStore.state.configurations=this.nylasSchedulerConfigStore.state.configurations.map(t=>t.id===e?i.data:t):this.nylasSchedulerConfigStore.state.configurations=[...this.nylasSchedulerConfigStore.state.configurations,i.data],(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(i.data))}async getConfigurations(e){var t;if(!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error fetching configurations: Nylas API Request is not initialized"});let n=50,[i,r]=await this.nylasApiRequest.request({method:"GET",path:`scheduling/configurations?limit=${n}${e?`&page_token=${e}`:""}`});return r?(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error fetching configurations: "+r.message}):(0,_index_es_13ff6710_73fa05e6_js__WEBPACK_IMPORTED_MODULE_1__.X)(i)?(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error fetching configurations: "+(null==(t=i.error)?void 0:t.message)}):(this.nylasSchedulerConfigStore.state.configurations=i.data,this.nylasSchedulerConfigStore.state.listConfigurationsNextCursor=i.next_cursor||null,(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(i.data))}async getMasterEventById(e){var t,n;if(!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error fetching master event: Nylas API Request is not initialized"});let i=this.nylasSchedulerConfigStore.state.selectedGroupEvent,r=null==(t=null==i?void 0:i.event)?void 0:t.calendar_id;if(!r)return console.warn("Calendar ID is not present"),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error fetching master event: Calendar ID is not present"});let s=new URLSearchParams;s.append("calendar_id",r);let[o,a]=await this.nylasApiRequest.request({method:"GET",path:`events/${e}?${s.toString()}`});if(a)return(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error fetching master event: "+a.message});if((0,_index_es_13ff6710_73fa05e6_js__WEBPACK_IMPORTED_MODULE_1__.X)(o))return(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error fetching master event: "+(null==(n=o.error)?void 0:n.message)});let l=this.nylasSchedulerConfigStore.state.masterGroupEvents;return l[e]?this.nylasSchedulerConfigStore.state.masterGroupEvents[e]=o.data:this.nylasSchedulerConfigStore.state.masterGroupEvents={...l,[e]:o.data},(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(o.data)}async createConfiguration(e){var t;if(!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error creating configuration: Nylas API Request is not initialized"});let[n,i]=await this.nylasApiRequest.request({method:"POST",path:"scheduling/configurations",body:e});return i?(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error creating configuration: "+i.message}):(0,_index_es_13ff6710_73fa05e6_js__WEBPACK_IMPORTED_MODULE_1__.X)(n)?(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error creating configuration: "+(null==(t=n.error)?void 0:t.message)}):(this.nylasSchedulerConfigStore.state.selectedConfiguration=n.data,this.nylasSchedulerConfigStore.state.configurations=[...this.nylasSchedulerConfigStore.state.configurations,n.data],(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(n.data))}async updateConfiguration(e){var t;if(!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error updating configuration: Nylas API Request is not initialized"});let[n,i]=await this.nylasApiRequest.request({method:"PUT",path:`scheduling/configurations/${e.id}`,body:e});return i?(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error updating configuration: "+i.message}):(0,_index_es_13ff6710_73fa05e6_js__WEBPACK_IMPORTED_MODULE_1__.X)(n)?(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error updating configuration: "+(null==(t=n.error)?void 0:t.message)}):(this.nylasSchedulerConfigStore.state.selectedConfiguration=n.data,this.nylasSchedulerConfigStore.state.configurations.find(t=>
1t.id===e.id)?this.nylasSchedulerConfigStore.state.configurations=this.nylasSchedulerConfigStore.state.configurations.map(t=>t.id===e.id?n.data:t):this.nylasSchedulerConfigStore.state.configurations=[...this.nylasSchedulerConfigStore.state.configurations,n.data],(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(n.data))}async deleteConfiguration(e){var t,n;if(!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error deleting configuration: Nylas API Request is not initialized"});let[i,r]=await this.nylasApiRequest.request({method:"DELETE",path:`scheduling/configurations/${e}`});return r?(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error deleting configuration: "+r.message}):(0,_index_es_13ff6710_73fa05e6_js__WEBPACK_IMPORTED_MODULE_1__.X)(i)?(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error deleting configuration: "+(null==(t=i.error)?void 0:t.message)}):(this.nylasSchedulerConfigStore.state.configurations=this.nylasSchedulerConfigStore.state.configurations.filter(t=>t.id!==e),(null==(n=this.nylasSchedulerConfigStore.state.selectedConfiguration)?void 0:n.id)===e&&this.nylasSchedulerConfigStore.resetSelectedConfiguration(),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(i.data))}async createGroupEvent(e,t){var n;if(this.nylasSchedulerConfigStore.state.isLoading=!0,!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error creating group event: Nylas API Request is not initialized"});let[i,r]=await this.nylasApiRequest.request({method:"POST",path:`scheduling/configurations/${t}/group-events`,body:e});return r?(this.nylasSchedulerConfigStore.state.isLoading=!1,(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error creating group event: "+r.message})):(0,_index_es_13ff6710_73fa05e6_js__WEBPACK_IMPORTED_MODULE_1__.X)(i)?(this.nylasSchedulerConfigStore.state.isLoading=!1,(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error creating group event: "+(null==(n=i.error)?void 0:n.message)})):(this.nylasSchedulerConfigStore.state.selectedGroupEvent=i.data,await this.getGroupEvents(t),this.nylasSchedulerConfigStore.state.isLoading=!1,(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(i.data))}async getGroupEvents(e){var t,n,i;if(!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error fetching group events: Nylas API Request is not initialized"});let r=new URLSearchParams;r.append("show_all","true");let s=this.nylasSchedulerConfigStore.state.calendarViewDateRange;if(s)r.append("start_time",s.start_time),r.append("end_time",s.end_time);else{let{startTime:e,endTime:t}=(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.j)(new Date().toISOString(),"week");r.append("start_time",e.toString()),r.append("end_time",t.toString())}let o=null==(n=null==(t=this.nylasSchedulerConfigStore.state.selectedConfiguration)?void 0:t.group_booking)?void 0:n.calendar_id;o&&r.append("calendar_id",o);let[a,l]=await this.nylasApiRequest.request({method:"GET",path:`scheduling/configurations/${e}/group-events?${r.toString()}`});return l?(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error fetching group events: "+l.message}):(0,_index_es_13ff6710_73fa05e6_js__WEBPACK_IMPORTED_MODULE_1__.X)(a)?(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error fetching group events: "+(null==(i=a.error)?void 0:i.message)}):(this.nylasSchedulerConfigStore.state.groupEvents=a.data,(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(a.data))}async updateGroupEventById(e,t){var n;if(this.nylasSchedulerConfigStore.state.isLoading=!0,!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error updating group event: Nylas API Request is not initialized"});let i=e.id;delete e.id;let[r,s]=await this.nylasApiRequest.request({method:"PATCH",path:`scheduling/configurations/${t}/group-events/${i}`,body:e});return s?(this.nylasSchedulerConfigStore.state.isLoading=!1,(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error updating group event: "+s.message})):(0,_index_es_13ff6710_73fa05e6_js__WEBPACK_IMPORTED_MODULE_1__.X)(r)?(this.nylasSchedulerConfigStore.state.isLoading=!1,(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error updating group event: "+(null==(n=r.error)?void 0:n.message)})):(this.nylasSchedulerConfigStore.state.selectedGroupEvent=r.data,await this.getGroupEvents(t),this.nylasSchedulerConfigStore.state.isLoading=!1,(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(r.data))}async updateGroupEvent(e,t,n){var i,r,s,o,a,l,d,c,u,h,g,f,p,y;this.nylasSchedulerConfigStore.state.isLoading=!0;let v=this.nylasSchedulerConfigStore.state.selectedGroupEvent,m=null==(i=null==v?void 0:v.event)?void 0:i.master_event_id,w=null==(r=null==v?void 0:v.event)?void 0:r.id,b=null==(o=null==(s=null==v?void 0:v.event)?void 0:s.when)?void 0:o.start_time,_=null==(l=null==(a=null==v?void 0:v.group_event_info)?void 0:a.rrule)?void 0:l[0],S=_?_.split(";").filter(e=>!e.startsWith("UNTIL")).join(";"):"",C=b?(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.b)(1e3*b).subtract(1,"minute").format("YYYYMMDDTHHmmss[Z]"):"";if("this"===t)return this.updateGroupEventById({...e,id:w,recurrence:m?void 0:e.recurrence},n);if("future"===t&&m){let t=await this.createGroupEvent(e,n),i={location:null==(d=null==v?void 0:v.event)?void 0:d.location,conferencing:null==(c=null==v?void 0:v.event)?void 0:c.conferencing,title:null==(u=null==v?void 0:v.event)?void 0:u.title,de
1scription:null==(h=null==v?void 0:v.event)?void 0:h.description,capacity:null==(g=null==v?void 0:v.group_event_info)?void 0:g.capacity,calendar_id:null==(f=null==v?void 0:v.event)?void 0:f.calendar_id,recurrence:S?[S+";UNTIL="+C]:[`RRULE:FREQ=DAILY;UNTIL=${C}`]};return await this.updateGroupEventById({...i,id:m},n),[i,t]}if("all"===t){let t=null==e?void 0:e.when,i=null==(p=null==v?void 0:v.event)?void 0:p.when,r=null==(y=this.nylasSchedulerConfigStore.state.masterGroupEvents)?void 0:y[m],s=null==r?void 0:r.when;return(null==t?void 0:t.start_time)!==(null==i?void 0:i.start_time)&&(s={...s,start_time:(null==t?void 0:t.start_time)||(null==s?void 0:s.start_time)}),(null==t?void 0:t.end_time)!==(null==i?void 0:i.end_time)&&(s={...s,end_time:(null==t?void 0:t.end_time)||(null==s?void 0:s.end_time)}),(null==t?void 0:t.start_timezone)!==(null==i?void 0:i.start_timezone)&&(s={...s,start_timezone:(null==t?void 0:t.start_timezone)||(null==s?void 0:s.start_timezone)}),(null==t?void 0:t.end_timezone)!==(null==i?void 0:i.end_timezone)&&(s={...s,end_timezone:(null==t?void 0:t.end_timezone)||(null==s?void 0:s.end_timezone)}),this.updateGroupEventById({...e,when:s,id:m},n)}throw this.nylasSchedulerConfigStore.state.isLoading=!1,Error("Invalid option")}async deleteGroupEvent(e,t,n){var i,r,s,o,a,l,d,c,u,h,g,f;this.nylasSchedulerConfigStore.state.isLoading=!0;let p=this.nylasSchedulerConfigStore.state.selectedGroupEvent,y=null==(i=null==p?void 0:p.event)?void 0:i.master_event_id,v=null==(r=null==p?void 0:p.event)?void 0:r.id,m=null==(o=null==(s=null==p?void 0:p.event)?void 0:s.when)?void 0:o.start_time,w=null==(l=null==(a=null==p?void 0:p.group_event_info)?void 0:a.rrule)?void 0:l[0],b=w?w.split(";").filter(e=>!e.startsWith("UNTIL")).join(";"):"",_=m?(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.b)(1e3*m).format("YYYYMMDDTHHmmss[Z]"):"",S={location:null==(d=null==p?void 0:p.event)?void 0:d.location,conferencing:null==(c=null==p?void 0:p.event)?void 0:c.conferencing,title:null==(u=null==p?void 0:p.event)?void 0:u.title,description:null==(h=null==p?void 0:p.event)?void 0:h.description,capacity:null==(g=null==p?void 0:p.group_event_info)?void 0:g.capacity,calendar_id:null==(f=null==p?void 0:p.event)?void 0:f.calendar_id,recurrence:b?[b+";UNTIL="+_]:[`RRULE:UNTIL=${_}`]};if("this"===t&&v)return this.deleteGroupEventById(v,n);if("future"===t&&y&&v)return await this.deleteGroupEventById(v,n),await this.updateGroupEventById({...S,id:y},n);if("all"===t&&y)return this.deleteGroupEventById(y,n);throw this.nylasSchedulerConfigStore.state.isLoading=!1,Error("Invalid option")}async deleteGroupEventById(e,t){var n,i,r;if(this.nylasSchedulerConfigStore.state.isLoading=!0,!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error deleting group event: Nylas API Request is not initialized"});let s=new URLSearchParams,o=null==(i=null==(n=this.nylasSchedulerConfigStore.state.selectedConfiguration)?void 0:n.group_booking)?void 0:i.calendar_id;o&&s.append("calendar_id",o);let[a,l]=await this.nylasApiRequest.request({method:"DELETE",path:`scheduling/configurations/${t}/group-events/${e}?calendar_id=${o}`});return l?(this.nylasSchedulerConfigStore.state.isLoading=!1,(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error deleting group event: "+l.message})):(0,_index_es_13ff6710_73fa05e6_js__WEBPACK_IMPORTED_MODULE_1__.X)(a)?(this.nylasSchedulerConfigStore.state.isLoading=!1,(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error deleting group event: "+(null==(r=a.error)?void 0:r.message)})):(await this.getGroupEvents(t),this.nylasSchedulerConfigStore.state.isLoading=!1,(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(a.data))}async importGroupEvent(e,t){var n,i,r,s,o;if(this.nylasSchedulerConfigStore.state.isLoading=!0,!this.nylasApiRequest)return console.warn("Nylas API Request is not initialized"),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error importing group event: Nylas API Request is not initialized"});let a=new URLSearchParams,l=null==(i=null==(n=this.nylasSchedulerConfigStore.state.selectedConfiguration)?void 0:n.group_booking)?void 0:i.calendar_id;l&&a.append("calendar_id",l);let[d,c]=await this.nylasApiRequest.request({method:"POST",path:`scheduling/configurations/${t}/import-group-events?${a.toString()}`,body:e});return c?(this.nylasSchedulerConfigStore.state.isLoading=!1,(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error importing group event: "+c.message})):(0,_index_es_13ff6710_73fa05e6_js__WEBPACK_IMPORTED_MODULE_1__.X)(d)?(this.nylasSchedulerConfigStore.state.isLoading=!1,(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(null,{message:"Error importing group event: "+(null==(r=d.error)?void 0:r.message)})):((null==(o=null==(s=d.data)?void 0:s.imported_events)?void 0:o.length)>0&&await this.getGroupEvents(t),this.nylasSchedulerConfigStore.state.isLoading=!1,(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.f)(d.data))}}class NylasSchedulerConfigConnector{constructor({nylasApiRequest:e,nylasSchedulerConfigStore:t}){this.nylasApiRequest=e,this.nylasSchedulerConfigStore=t}init(){(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.d)("NylasSchedulerConfigConnector init")}get schedulerConfigStore(){return this.nylasSchedulerConfigStore}get schedulerConfig(){return this._schedulerConfigConnector||(this._schedulerConfigConnector=new NylasSchedulerConfigAPIConnector({nylasApiRequest:this.nylasApiRequest,nylasSchedulerConfigStore:this.nylasSchedulerConfigStore})),this._schedulerConfigConnector}resetStores(){(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.d)("NylasSchedulerConfigConnector resetStores"),this.nylasSchedulerConfigStore.reset()}async logout(){(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.d)("NylasSchedulerConfigConnector logout"),this.resetStores()}}class LocalStorage{get(e){return new Promise(t=>{let n=window.localStorage.getItem(e);t(n?JSON.parse(n):null)})}async remove(e){return window.localStorage.removeItem(e),new Promise(e=>{e(null)})}set(e,t){return window.localStorage.setItem(e,JSON.stringify(t)),new Promise(e=>{e(null)})}}let PKCE_KEY="pkce",GRANT_KEY="grant",USER_KEY="user";class Storage{constructor(e){if(P(this,"Storage",new LocalStorage),e){this.Storage=e;return}}setPKCE(e){let t=_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.B.from(e);this.Storage.set(PKCE_KEY,t.toString("base64"))}async getPKCE(){try{let e=await this.Storage.get(PKCE_KEY);if(e)return _index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.B.from(e,"base64").toString("utf8")}catch{}return null}removePKCE(){this.Storage.remove(PKCE_KEY)}setGrant(e,t=!1){let{grant_id:n}=e;this.Storage.set(`${GRANT_KEY}${t?"-"+n:""}`,e)}removeGrant(e,t=!1){this.Storage.remove(`${GRANT_KEY}${t?"-"+e:""}`)}async getGrant(e,t=!1){return await this.Storage.get(`${GRANT_KEY}${t?"-"+e:""}`)||null}async setUserToken(e){let t=await this.getUserTokens();if(t)if(t.find(t=>t.sub===e.sub)){let n=t.map(t=>(t.sub===e.sub&&(t=e),t));this.Storage.set(USER_KEY,n)}else{let n=[...t,e];this.Storage.set(USER_KEY,n)}else this.Storage.set(USER_KEY,[e])}async getUserToken(e=""){let t=await this.Storage.get(USER_KEY);return t?""===e?t[0]:t.find(t=>t.sub===e):null}async getUserTokens(){return await this.Storage.get(USER_KEY)||null}removeUserTokens(){this.Storage.remove(USER_KEY)}async removeUserToken(e){let t=await this.getUserTokens(),n=null==t?void 0:t.filter(t=>t.sub!==e);this.Storage.set(USER_KEY,n)}async clearSession(){let e=await this.getUserTokens();
1null==e||e.forEach(e=>{this.removeGrant(e.sub)}),this.removePKCE(),this.removeUserTokens()}}class IndexedDBStorage{constructor(){P(this,"databaseName","identity-db"),P(this,"storeName","identity")}get(e){let t=this;return new Promise((n,i)=>{t.openDatabase().then(function(r){let s=r.transaction(t.storeName,"readwrite"),o=s.objectStore(t.storeName).get(e);o.onsuccess=()=>{n(o.result)},o.onerror=()=>{i(o.error)},s.oncomplete=()=>{r.close()}})})}async remove(e){let t=this;return new Promise((n,i)=>{let r=indexedDB.open(this.databaseName);r.onupgradeneeded=function(e){e.target.result.createObjectStore(t.storeName)},r.onerror=()=>{i(r.error)},r.onsuccess=t=>{let r=t.target.result,s=r.transaction(this.storeName,"readwrite"),o=s.objectStore(this.storeName).delete(e);o.onsuccess=()=>{n(null)},o.onerror=()=>{i(o.error)},s.oncomplete=()=>{r.close()}}})}set(e,t){return new Promise((n,i)=>{let r=indexedDB.open(this.databaseName);r.onerror=()=>{i(r.error)},r.onupgradeneeded=e=>{e.target.result.createObjectStore(this.storeName)},r.onsuccess=r=>{let s=r.target.result,o=s.transaction(this.storeName,"readwrite"),a=o.objectStore(this.storeName).put(t,e);a.onsuccess=()=>{n(t)},a.onerror=()=>{i(a.error)},o.oncomplete=()=>{s.close()}}})}openDatabase(){let e=this;return new Promise(function(t,n){let i=indexedDB.open(e.databaseName,2);i.onupgradeneeded=function(t){t.target.result.createObjectStore(e.storeName)},i.onsuccess=function(e){t(e.target.result)},i.onerror=function(e){n(e.error)}})}}var sha256={exports:{}};!function(module){!function(){var ERROR="input is invalid type",WINDOW="object"==typeof window,root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"==typeof self,NODE_JS=!root.JS_SHA256_NO_NODE_JS&&"object"==typeof _index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.p&&_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.p.versions&&_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.p.versions.node;NODE_JS?root=_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.e:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&module.exports,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&"u">typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-0x80000000,8388608,32768,128],SHIFT=[24,16,8,0],K=[0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];(root.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),ARRAY_BUFFER&&(root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var createOutputMethod=function(e,t){return function(n){return new Sha256(t,!0).update(n)[e]()}},createMethod=function(e){var t=createOutputMethod("hex",e);NODE_JS&&(t=nodeWrap(t,e)),t.create=function(){return new Sha256(e)},t.update=function(e){return t.create().update(e)};for(var n=0;n<OUTPUT_TYPES.length;++n){var i=OUTPUT_TYPES[n];t[i]=createOutputMethod(i,e)}return t},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(e){if("string"==typeof e)return crypto.createHash(algorithm).update(e,"utf8").digest("hex");if(null==e)throw Error(ERROR);return e.constructor===ArrayBuffer&&(e=new Uint8Array(e)),Array.isArray(e)||ArrayBuffer.isView(e)||e.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(e)).digest("hex"):method(e)};return nodeMethod},createHmacOutputMethod=function(e,t){return function(n,i){return new HmacSha256(n,t,!0).update(i)[e]()}},createHmacMethod=function(e){var t=createHmacOutputMethod("hex",e);t.create=function(t){return new HmacSha256(t,e)},t.update=function(e,n){return t.create(e).update(n)};for(var n=0;n<OUTPUT_TYPES.length;++n){var i=OUTPUT_TYPES[n];t[i]=createHmacOutputMethod(i,e)}return t};function Sha256(e,t){t?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e?(this.h0=0xc1059ed8,this.h1=0x367cd507,this.h2=0x3070dd17,this.h3=0xf70e5939,this.h4=0xffc00b31,this.h5=0x68581511,this.h6=0x64f98fa7,this.h7=0xbefa4fa4):(this.h0=0x6a09e66
17,this.h1=0xbb67ae85,this.h2=0x3c6ef372,this.h3=0xa54ff53a,this.h4=0x510e527f,this.h5=0x9b05688c,this.h6=0x1f83d9ab,this.h7=0x5be0cd19),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=e}function HmacSha256(e,t,n){var i,r=typeof e;if("string"===r){var s,o=[],a=e.length,l=0;for(i=0;i<a;++i)(s=e.charCodeAt(i))<128?o[l++]=s:(s<2048?o[l++]=192|s>>6:(s<55296||s>=57344?o[l++]=224|s>>12:(s=65536+((1023&s)<<10|1023&e.charCodeAt(++i)),o[l++]=240|s>>18,o[l++]=128|s>>12&63),o[l++]=128|s>>6&63),o[l++]=128|63&s);e=o}else if("object"===r){if(null===e)throw Error(ERROR);if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(e)))throw Error(ERROR)}else throw Error(ERROR);e.length>64&&(e=new Sha256(t,!0).update(e).array());var d=[],c=[];for(i=0;i<64;++i){var u=e[i]||0;d[i]=92^u,c[i]=54^u}Sha256.call(this,t,n),this.update(c),this.oKeyPad=d,this.inner=!0,this.sharedMemory=n}Sha256.prototype.update=function(e){if(!this.finalized){var t,n=typeof e;if("string"!==n){if("object"===n){if(null===e)throw Error(ERROR);if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(e)))throw Error(ERROR)}else throw Error(ERROR);t=!0}for(var i,r,s=0,o=e.length,a=this.blocks;s<o;){if(this.hashed&&(this.hashed=!1,a[0]=this.block,a[16]=a[1]=a[2]=a[3]=a[4]=a[5]=a[6]=a[7]=a[8]=a[9]=a[10]=a[11]=a[12]=a[13]=a[14]=a[15]=0),t)for(r=this.start;s<o&&r<64;++s)a[r>>2]|=e[s]<<SHIFT[3&r++];else for(r=this.start;s<o&&r<64;++s)(i=e.charCodeAt(s))<128?a[r>>2]|=i<<SHIFT[3&r++]:(i<2048?a[r>>2]|=(192|i>>6)<<SHIFT[3&r++]:(i<55296||i>=57344?a[r>>2]|=(224|i>>12)<<SHIFT[3&r++]:(i=65536+((1023&i)<<10|1023&e.charCodeAt(++s)),a[r>>2]|=(240|i>>18)<<SHIFT[3&r++],a[r>>2]|=(128|i>>12&63)<<SHIFT[3&r++]),a[r>>2]|=(128|i>>6&63)<<SHIFT[3&r++]),a[r>>2]|=(128|63&i)<<SHIFT[3&r++]);this.lastByteIndex=r,this.bytes+=r-this.start,r>=64?(this.block=a[16],this.start=r-64,this.hash(),this.hashed=!0):this.start=r}return this.bytes>0xffffffff&&(this.hBytes+=this.bytes/0x100000000|0,this.bytes=this.bytes%0x100000000),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>2]|=EXTRA[3&t],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var e,t,n,i,r,s,o,a,l,d,c,u=this.h0,h=this.h1,g=this.h2,f=this.h3,p=this.h4,y=this.h5,v=this.h6,m=this.h7,w=this.blocks;for(e=16;e<64;++e)t=((r=w[e-15])>>>7|r<<25)^(r>>>18|r<<14)^r>>>3,n=((r=w[e-2])>>>17|r<<15)^(r>>>19|r<<13)^r>>>10,w[e]=w[e-16]+t+w[e-7]+n|0;for(c=h&g,e=0;e<64;e+=4)this.first?(this.is224?(a=300032,m=(r=w[0]-0x543c9a5b)-0x8f1a6c7|0,f=r+0x170e9b5|0):(a=0x2a01a605,m=(r=w[0]-0xc881298)-0x5ab00ac6|0,f=r+0x8909ae5|0),this.first=!1):(t=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),n=(p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7),i=(a=u&h)^u&g^c,r=m+n+(o=p&y^~p&v)+K[e]+w[e],s=t+i,m=f+r|0,f=r+s|0),t=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),n=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7),i=(l=f&u)^f&h^a,r=v+n+(o=m&p^~m&y)+K[e+1]+w[e+1],s=t+i,v=g+r|0,t=((g=r+s|0)>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10),n=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7),i=(d=g&f)^g&u^l,r=y+n+(o=v&m^~v&p)+K[e+2]+w[e+2],s=t+i,y=h+r|0,t=((h=r+s|0)>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),n=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7),i=(c=h&g)^h&f^d,r=p+n+(o=y&v^~y&m)+K[e+3]+w[e+3],s=t+i,p=u+r|0,u=r+s|0;this.h0=this.h0+u|0,this.h1=this.h1+h|0,this.h2=this.h2+g|0,this.h3=this.h3+f|0,this.h4=this.h4+p|0,this.h5=this.h5+y|0,this.h6=this.h6+v|0,this.h7=this.h7+m|0},Sha256.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,i=this.h3,r=this.h4,s=this.h5,o=this.h6,a=this.h7,l=HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[15&s]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[15&o];return this.is224||(l+=HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[15&a]),l},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,i=this.h3,r=this.h4,s=this.h5,o=this.h6,a=this.h7,l=[e>>24&255,e>>16&255,e>>8&255,255&e,t>>24&255,t>>16&255,t>>8&255,255&t,n>>24&255,n>>16&255,n>>8&255,255&n,i>>24&255,i>>16&255,i>>8&255,255&i,r>>24&255,r>>16&255,r>>8&255,255&r,s>>24&255,s>>16&255,s>>8&255,255&s,o>>24&255,o>>16&255,o>>8&255,255&o];return this.is224||l.push(a>>24&255,a>>16&255,a>>8&255,255&a),l},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(this.is224?28:32),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),e},HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224)}()}(sha256);
1var getRandomValues,rnds8=new Uint8Array(16);function rng(){if(!getRandomValues&&!(getRandomValues="u">typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"u">typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return getRandomValues(rnds8)}let REGEX=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function validate(e){return"string"==typeof e&®EX.test(e)}for(var byteToHex=[],i=0;i<256;++i)byteToHex.push((i+256).toString(16).substr(1));function stringify(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(byteToHex[e[t+0]]+byteToHex[e[t+1]]+byteToHex[e[t+2]]+byteToHex[e[t+3]]+"-"+byteToHex[e[t+4]]+byteToHex[e[t+5]]+"-"+byteToHex[e[t+6]]+byteToHex[e[t+7]]+"-"+byteToHex[e[t+8]]+byteToHex[e[t+9]]+"-"+byteToHex[e[t+10]]+byteToHex[e[t+11]]+byteToHex[e[t+12]]+byteToHex[e[t+13]]+byteToHex[e[t+14]]+byteToHex[e[t+15]]).toLowerCase();if(!validate(n))throw TypeError("Stringified UUID is invalid");return n}function v4(e,t,n){var i=(e=e||{}).random||(e.rng||rng)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){n=n||0;for(var r=0;r<16;++r)t[n+r]=i[r];return t}return stringify(i)}async function getBytes(e,t){let n,i=e.getReader();for(;!(n=await i.read()).done;)t(n.value)}function getLines(e){let t,n,i,r=!1;return function(s){void 0===t?(t=s,n=0,i=-1):t=concat(t,s);let o=t.length,a=0;for(;n<o;){r&&(10===t[n]&&(a=++n),r=!1);let s=-1;for(;n<o&&-1===s;++n)switch(t[n]){case 58:-1===i&&(i=n-a);break;case 13:r=!0;case 10:s=n}if(-1===s)break;e(t.subarray(a,s),i),a=n,i=-1}a===o?t=void 0:0!==a&&(t=t.subarray(a),n-=a)}}function getMessages(e,t,n){let i=newMessage(),r=new TextDecoder;return function(s,o){if(0===s.length)null==n||n(i),i=newMessage();else if(o>0){let n=r.decode(s.subarray(0,o)),a=o+(32===s[o+1]?2:1),l=r.decode(s.subarray(a));switch(n){case"data":i.data=i.data?i.data+` 2`+l:l;break;case"event":i.event=l;break;case"id":e(i.id=l);break;case"retry":let d=parseInt(l,10);isNaN(d)||t(i.retry=d)}}}}function concat(e,t){let n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function newMessage(){return{data:"",event:"",id:"",retry:void 0}}var __rest=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&0>t.indexOf(i)&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r<i.length;r++)0>t.indexOf(i[r])&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]]);return n};let EventStreamContentType="text/event-stream",DefaultRetryInterval=1e3,LastEventId="last-event-id";function fetchEventSource(e,t){var{signal:n,headers:i,onopen:r,onmessage:s,onclose:o,onerror:a,openWhenHidden:l,fetch:d}=t,c=__rest(t,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((t,u)=>{let h,g=Object.assign({},i);function f(){h.abort(),document.hidden||b()}g.accept||(g.accept=EventStreamContentType),l||document.addEventListener("visibilitychange",f);let p=DefaultRetryInterval,y=0;function v(){document.removeEventListener("visibilitychange",f),window.clearTimeout(y),h.abort()}null==n||n.addEventListener("abort",()=>{v(),t()});let m=d??window.fetch,w=r??defaultOnOpen;async function b(){var n;h=new AbortController;try{let n=await m(e,Object.assign(Object.assign({},c),{headers:g,signal:h.signal}));await w(n),await getBytes(n.body,getLines(getMessages(e=>{e?g[LastEventId]=e:delete g[LastEventId]},e=>{p=e},s))),null==o||o(),v(),t()}catch(e){if(!h.signal.aborted)try{let t=null!=(n=null==a?void 0:a(e))?n:p;window.clearTimeout(y),y=window.setTimeout(b,t)}catch(e){v(),u(e)}}}b()})}function defaultOnOpen(e){let t=e.headers.get("content-type");if(!(null!=t&&t.startsWith(EventStreamContentType)))throw Error(`Expected content-type to be ${EventStreamContentType}, Actual: ${t}`)}function Base64EncodeUrl(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function getTimestamp(){return Math.floor(Date.now()/1e3)}function e(t){this.message=t}e.prototype=Error(),e.prototype.name="InvalidCharacterError";var r$1="u">typeof window&&window.atob&&window.atob.bind(window)||function(t){var n=String(t).replace(/=+$/,"");if(n.length%4==1)throw new e("'atob' failed: The string to be decoded is not correctly encoded.");for(var i,r,s=0,o=0,a="";r=n.charAt(o++);~r&&(i=s%4?64*i+r:r,s++%4)&&(a+=String.fromCharCode(255&i>>(-2*s&6))))r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
2+/=".indexOf(r);return a};function t$1(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(r$1(e).replace(/(.)/g,function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}(t)}catch{return r$1(t)}}function n$1(e){this.message=e}function o(e,t){if("string"!=typeof e)throw new n$1("Invalid token specified");var n=+(!0!==(t=t||{}).header);try{return JSON.parse(t$1(e.split(".")[n]))}catch(e){throw new n$1("Invalid token specified: "+e.message)}}n$1.prototype=Error(),n$1.prototype.name="InvalidTokenError";class NylasSessions{constructor(e){if(P(this,"clientId"),P(this,"redirectUri"),P(this,"accessType","online"),P(this,"domain","http://api.nylas.com"),P(this,"versioned",!1),P(this,"Storage"),P(this,"hosted",!1),P(this,"multiAccount",!1),P(this,"loginId",""),this.clientId=e.clientId,this.redirectUri=e.redirectUri,e.domain&&(this.domain=e.domain,this.domain.substring(this.domain.length-3).includes("/v")&&(this.versioned=!0)),e.multiAccount&&(this.multiAccount=e.multiAccount),e.sw){let e=new IndexedDBStorage;this.Storage=new Storage(e)}else this.Storage=new Storage;e.accessType&&(this.accessType=e.accessType),e.loginId&&(this.loginId=e.loginId),e.hosted&&(this.hosted=e.hosted),!0!==e.disableInitCodeExchange&&this.codeExchange(null)}async validateAccessToken(e=""){let t=await this.Storage.getGrant(e,this.multiAccount);if(!t)return!1;let{access_token:n}=t;try{return!!(await (await fetch(`${this.domain}/connect/tokeninfo?access_token=${n}`,{method:"GET"})).json()).data}catch{return!1}}async validateIDToken(e=""){let t=await this.Storage.getGrant(e,this.multiAccount);if(!t)return!1;let{id_token:n}=t;try{let e=await fetch(`${this.domain}/connect/tokeninfo?id_token=${n}`,{method:"GET"});return!(200!==e.status||!(await e.json()).data)}catch{return!1}}getDomain(){return this.domain}async auth(e){this.hosted&&(this.domain===window.location.origin||this.versioned&&this.domain.includes(window.location.origin))&&await this.hostedSetCodeChallenge();let t=await this.generateAuthURL(e);return e.popup?void this.popUp(t):t}async generateAuthURL(e){let t=await this.getCodeChallege(),n=`${this.domain}/connect/auth?client_id=${this.clientId}&redirect_uri=${this.redirectUri}&access_type=${this.accessType}&response_type=code`;return t&&(n+=`&code_challenge=${t}&code_challenge_method=S256&options=rotate_refresh_token`),e.provider&&(n+=`&provider=${e.provider}`),e.loginHint&&(n+=`&login_hint=${e.loginHint}`,e.includeGrantScopes&&(n+=`&include_grant_scopes=${e.includeGrantScopes}`)),e.scope&&(n+=`&scope=${e.scope.join(" ")}`),e.prompt&&(n+=`&prompt=${e.prompt}`),e.metadata&&(n+=`&metadata=${e.metadata}`),(e.state||this.loginId)&&(n+=`&state=${this.loginId?this.loginId:e.state}`),n}async generateReauthURL(e,t){if(!e)throw Error("Grant ID is required");let n=await this.Storage.getUserToken(e),i=await this.getCodeChallege(),r=`${this.domain}/connect/auth?client_id=${this.clientId}&redirect_uri=${this.redirectUri}&access_type=${this.accessType}&response_type=code`;return i&&(r+=`&code_challenge=${i}&code_challenge_method=S256&options=rotate_refresh_token`),null!=n&&n.provider&&(r+=`&provider=${n.provider}`),null!=n&&n.email&&(r+=`&login_hint=${n.email}`),t&&(r+=`&scope=${t.join(" ")}`),r}async generateCodeChallenge(){if(await this.Storage.getPKCE())return;let e=v4();this.Storage.setPKCE(e)}async hostedSetCodeChallenge(){if(!this.hosted)throw console.error("Method only used with hosted flag enabled");let e=new URLSearchParams(window.location.search).get("code_challenge");if(!e){if(await this.Storage.getPKCE())return;console.warn("Code challenge is recomended");return}this.Storage.setPKCE(e)}async getCodeChallege(){if(this.hosted&&(this.domain===window.location.origin||this.versioned&&this.domain.includes(window.location.origin)))return new URLSearchParams(window.location.search).get("code_challenge")||(console.warn("Code challenge is recomended"),"");let e=await this.Storage.getPKCE();if(e){let t=sha256.exports.sha256(e);return Base64EncodeUrl(_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.B.from(t).toString("base64"))}return""}async isLoggedIn(){if(this.hosted&&(this.domain===window.location.origin||this.versioned&&this.domain.includes(window.location.origin)))return!1;let e=await this.Storage.getUserTokens();return e&&e.length>
20?(this.multiAccount&&await this.generateCodeChallenge(),!0):(await this.generateCodeChallenge(),!1)}isMultiAccount(){return this.multiAccount}async logout(){let e=await this.getProfile();await this.Storage.clearSession();let t={detail:e};window.dispatchEvent(new CustomEvent("onLogoutSuccess",t))}async getProfile(e=""){let t;return(t=e?await this.Storage.getUserToken(e):await this.Storage.getUserToken())||null}async getProfiles(){return await this.Storage.getUserTokens()||null}async removeProfile(e){return await this.Storage.removeUserToken(e),await this.Storage.removeGrant(e),null}async authIMAP(e){let t=await this.getCodeChallege(),n={imap_username:e.imap_username,imap_password:e.imap_password,imap_host:e.imap_host,imap_port:e.imap_port,type:e.type,smtp_host:e.smtp_host,smtp_port:e.smtp_port,provider:e.provider,redirect_uri:this.redirectUri,state:e.state,public_application_id:this.clientId,access_type:this.accessType};return this.loginId&&(n.id=this.loginId),e.smtp_username&&e.smtp_password&&(n.smtp_username=e.smtp_username,n.smtp_password=e.smtp_password),""!=t&&(n.code_challenge=t,n.code_challenge_method="S256"),await (await fetch(`${this.domain}/connect/login/imap`,{method:"POST",headers:new Headers({"content-type":"application/json"}),body:JSON.stringify(n)})).json()}async authEWS(e){let t=await this.getCodeChallege(),n={...e,provider:"ews",redirect_uri:this.redirectUri,public_application_id:this.clientId,access_type:this.accessType};return this.loginId&&(n.id=this.loginId),""!=t&&(n.code_challenge=t,n.code_challenge_method="S256"),await (await fetch(`${this.domain}/connect/login/ews`,{method:"POST",headers:new Headers({"content-type":"application/json"}),body:JSON.stringify(n)})).json()}async detectEmail(e){return await (await fetch(`${this.versioned?this.domain:this.domain+"/connect"}/providers/detect?client_id=${this.clientId}&email=${e}`,{method:"POST",headers:new Headers({"content-type":"application/json"})})).json()}async applicationInfo(){return(await (await fetch(`${this.versioned?this.domain:this.domain+"/connect"}/applications?client_id=${this.clientId}`,{method:"GET",headers:new Headers({"content-type":"application/json"})})).json()).data}async getAvailableProviders(){let e=await fetch(`${this.domain}/connect/providers/find?client_id=${this.clientId}`,{method:"GET",headers:new Headers({"content-type":"application/json"})});return e?(await e.json()).data:null}onLoginSuccess(e){window.addEventListener("onLoginSuccess",t=>e(t))}onLogoutSuccess(e){window.addEventListener("onLogoutSuccess",t=>e(t))}onLoginFail(e){window.addEventListener("onLoginFail",t=>e(t))}onTokenRefreshSuccess(e){window.addEventListener("onTokenRefreshSuccess",t=>e(t))}onTokenRefreshFail(e){window.addEventListener("onTokenRefreshFail",t=>e(t))}onSessionExpired(e){window.addEventListener("onSessionExpired",t=>e(t))}async codeExchange(e){let t=new URLSearchParams(window.location.search);e&&(t=new URLSearchParams(e));let n=t.get("code"),i=t.get("state"),r=t.get("error"),s=t.get("error_description"),a=t.get("error_code");if(r&&s&&a){let e={detail:{error:r,error_description:s,error_code:a}};return window.dispatchEvent(new CustomEvent("onLoginFail",e)),window.history.pushState({},document.title,window.location.pathname),!1}if(!n)return console.warn("No code found"),!1;if(window.opener&&"uas-popup"===window.name)return console.warn("Popup window detected"),!1;let l=await this.Storage.getPKCE();if(!l)return console.warn("No code verifier found"),!1;try{let e={client_id:this.clientId,redirect_uri:this.redirectUri,code:n,grant_type:"authorization_code",code_verifier:l},t=await (await fetch(`${this.domain}/connect/token`,{method:"POST",headers:new Headers({"content-type":"application/json"}),body:JSON.stringify(e)})).json();if(t){if(t.error){let e={detail:t};return window.dispatchEvent(new CustomEvent("onLoginFail",e)),!0}let e=await this.handleCodeExchangeResponse(t);if(e.valid){i&&(e.data.state=i);let t={detail:e.data};window.dispatchEvent(new CustomEvent("onLoginSuccess",t)),window.history.pushState({},document.title,window.location.pathname)}
2else{let t={detail:e.data};return window.dispatchEvent(new CustomEvent("onLoginFail",t)),!0}}return this.Storage.removePKCE(),!0}catch(t){let e={detail:t};return window.dispatchEvent(new CustomEvent("onLoginFail",e)),window.history.pushState({},document.title,window.location.pathname),!1}}async tokenExchange(e=""){let t=await this.Storage.getGrant(e,this.multiAccount);if(!t)return!1;let n=t.refresh_token;try{let t={client_id:this.clientId,redirect_uri:this.redirectUri,refresh_token:n,grant_type:"refresh_token"},i=await (await fetch(`${this.domain}/connect/token`,{method:"POST",headers:new Headers({"content-type":"application/json"}),body:JSON.stringify(t)})).json();if(i){if(i.error||(i.expires_in=getTimestamp()+i.expires_in,this.Storage.setGrant(i,this.multiAccount),!await this.validateIDToken(e))){let e={detail:i};return window.dispatchEvent(new CustomEvent("onTokenRefreshFail",e)),!0}let t={detail:i};return window.dispatchEvent(new CustomEvent("onTokenRefreshSuccess",t)),!0}this.Storage.removePKCE()}catch(t){let e={detail:t};return window.dispatchEvent(new CustomEvent("onTokenRefreshFail",e)),!1}}async handleCodeExchangeResponse(e){if(e.error)return{data:e,valid:!1};e.expires_in=getTimestamp()+e.expires_in,this.Storage.setGrant(e,this.multiAccount);let t=o(e.id_token);return t.status="authenticated",this.Storage.setUserToken(t),await this.validateIDToken(t.sub)?{data:e,valid:!0}:{data:e,valid:!1}}async popUp(e){let t=window.screenX+(window.outerWidth-500)/2,n=window.screenY+(window.outerHeight-600)/2.5,i="uas-popup",r=e,s=window.open(r,i,`width=500,height=600,left=${t},top=${n}`);if(!s)return;let a=setInterval(async()=>{if(s.closed){let e={detail:{error_description:"OAuth provider window closed"}};window.dispatchEvent(new CustomEvent("onLoginFail",e)),a&&clearInterval(a);return}try{let e=s.location.href.split("?");if(!e[0])return;let t=s.location.search;if(s.history.pushState({},document.title,window.location.pathname),e[0]===this.redirectUri&&e.length>1){let e=await this.codeExchange(t);s.close(),e&&location.reload(),a&&clearInterval(a);return}}catch{return}},1e3)}async getAccessToken(e=""){let t=getTimestamp(),n=await this.Storage.getGrant(e,this.multiAccount);if(!n)return null;let{access_token:i,expires_in:r}=n,s=i;return s&&r&&r>getTimestamp()&&r-t>30?s:(await this.tokenExchange(e),(await this.Storage.getGrant(e,this.multiAccount)).access_token)}async sse(e,t){let n=t.headers||{},i=n["Grant-ID"],r="";if(this.multiAccount){if(!i)throw this.logout(),Error("Grant ID is required for multi account calls");r=await this.getAccessToken(i)}else r=await this.getAccessToken();return delete n["Grant-ID"],n.Authorization=`Bearer ${r}`,n["content-type"]||(n["content-type"]="application/json"),fetchEventSource(`${this.domain}/${e}`,{...t,headers:n})}async fetch(e,t,n=!0,i){let r="",s=1;if(this.multiAccount){if(!t.grant_id)throw this.logout(),Error("Grant ID is required for multi account calls");let e=await this.getProfiles();s=e?e.length:1,r=await this.getAccessToken(t.grant_id)}else r=await this.getAccessToken();if(!r)throw Error("Access token not found");let a=t.headers;Headers.prototype.isPrototypeOf(a)?(a.append("Authorization",`Bearer ${r}`),a.has("content-type")||a.append("content-type","application/json")):a=new Headers({Authorization:`Bearer ${r}`,"content-type":"application/json"});try{null!=t&&t.body&&(t.body=JSON.stringify(null==t?void 0:t.body));let r=await fetch(`${i||this.domain}/${e}`,{...t,headers:a});if(!n)return r;let l=await (null==r?void 0:r.json());if(!await this.isAuthenticatedResponse(r.status,l)){if(s>1){let e=await this.getProfile(t.grant_id);if(e){e.status="unauthorized",await this.Storage.setUserToken(e);let t={detail:{user:e}};window.dispatchEvent(new CustomEvent("onSessionExpired",t))}}else{let e={detail:{user:await this.Storage.getUserToken()}};window.dispatchEvent(new CustomEvent("onSessionExpired",e))}this.logout();return}return l}catch(e){throw e}}async fetchRequest(e,t,n,i=!0,r,s){let a=await this.isLoggedIn(),l=new URL(e,r??this.domain),d=new Headers;if(d.append("Accept","application/json"),d.append("Content-Type","application/json"),d.append("User-Agent","nylas-identity"),a){let e=await this.getAccessToken();d.append("Authorization",`Bearer ${e}`)}let c=await fetch(l.toString(),{method:t||"GET",headers:d,mode:"cors",referrer:location.origin,body:n?JSON.stringify(n):void 0,...s||{}});return i?await c.json():c.body}async isAuthenticatedResponse(e,t){var n;return 401!=e||(null==(n=null==t?void 0:t.error)?void 0:n.type)!="token.unauthorized_access"}addAPIKey(e,t,n){this.Storage.setUserToken({aud:"https://api-staging.us.nylas.com/",exp:2e9,email_verified:!0,iat:getTimestamp(),iss:"",email:t,provider:"virtual-calendar",status:"authenticated",name:t,sub:e}),this.Storage.setGrant({grant_id:e,access_token:n,expires_in:2e9},this.multiAccount)}}var B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(e,t,n){this.props=e,this.context=t,this.refs=D,this.updater=n||B}function F(){}function G(e,t,n){this.props=e,this.context=t,this.refs=D,this.updater=n||B}E.prototype.isReactComponent={},E.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},E.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},F.prototype=E.prototype;var H=G.prototype=new F;H.constructor=G,C(H,E.prototype),H.isPureReactComponent=!0;let LoginRequired=({authenticationUrl:e})=>(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("div",{class:"login-required",part:"nse__login-required login-component"},(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("div",{class:"card",part:"nse__login-required-card"},(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("p",{part:"nse__login-required-text"},"Log into your account to use the Scheduler Editor."),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("button",{class:"google-button",part:"nse__login-required-google-button",onClick:async t=>{t.preventDefault();let n=await e("google");n?window.location.href=n:console.error("[nylas-scheduler-editor] Unable to get authentication URL.")}},(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("span",{class:"icon"},(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("google-logo-icon",{width:"15",height:"15"}
2)),"Continue with Google"),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("button",{class:"microsoft-button",part:"nse__login-required-microsoft-button",onClick:async t=>{t.preventDefault();let n=await e("microsoft");n?window.location.href=n:console.error("[nylas-scheduler-editor] Unable to get authentication URL.")}},(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("span",{class:"icon"},(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("microsoft-logo-icon",{width:"15",height:"15"})),"Continue with Microsoft"),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("button",{class:"other-provider-button",part:"nse__login-required-other-provider-button",onClick:async t=>{t.preventDefault();let n=await e();n?window.location.href=n:console.error("[nylas-scheduler-editor] Unable to get authentication URL.")}},"View all providers ",(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("chevron-icon",{width:"17",height:"17"})),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("small",{class:"disclaimer-text",part:"nse__login-required-disclaimer-text"},"* You will be redirected to authenticate your account.")));function ExpressFlow({currentUser:e,calendars:t,selectedEventType:n,experimentalFeatures:i}){let r=(null==t?void 0:t.find(e=>e.is_primary))||(null==t?void 0:t[0]),s=(null==i?void 0:i[_constants_3d8016e3_3c080f00_js__WEBPACK_IMPORTED_MODULE_3__.E.group_events])||!1;switch(n){case _constants_3d8016e3_3c080f00_js__WEBPACK_IMPORTED_MODULE_3__.C.one_on_one:case _constants_3d8016e3_3c080f00_js__WEBPACK_IMPORTED_MODULE_3__.C.max_availability:case _constants_3d8016e3_3c080f00_js__WEBPACK_IMPORTED_MODULE_3__.C.max_fairness:return(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)(_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.F,null,(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("nylas-event-info",null,(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("div",{slot:"inputs"},(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("nylas-event-title",null),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("nylas-event-duration",null),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("nylas-event-location",{userProvider:e.provider}))),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("nylas-booking-calendar-picker",{expressFlow:!0,calendars:t,currentUser:e,defaultBookingCalendar:null==r?void 0:r.id}),!s&&(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("nylas-scheduling-method",{exportparts:"nsm, nsm__header, nsm__input-label, nsm__dropdown, nsm__dropdown-button, nsm__dropdown-content"}),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("nylas-custom-event-slug",{name:"custom-event-slug",exportparts:"nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield"}));case _constants_3d8016e3_3c080f00_js__WEBPACK_IMPORTED_MODULE_3__.C.collective:return(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)(_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.F,null,(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("nylas-event-info",null,(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("div",{slot:"inputs"},(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("nylas-event-title",null),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("nylas-event-duration",null),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("nylas-event-location",{userProvider:e.provider}))),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("nylas-booking-calendar-picker",{expressFlow:!0,calendars:t,currentUser:e,defaultBookingCalendar:null==r?void 0:r.id}),!s&&(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("nylas-scheduling-method",{exportparts:"nsm, nsm__header, nsm__input-label, nsm__dropdown, nsm__dropdown-button, nsm__dropdown-content"}),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("nylas-custom-event-slug",{name:"custom-event-slug",exportparts:"nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield"}),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("nylas-additional-participants",{name:"participants",eventParticipants:[{name:(null==e?void 0:e.name)||(null==e?void 0:e.email),email:(null==e?void 0:e.email)||"",is_organizer:!0}],exportparts:"nadtnlpart, nadtnlpart__title, nadtnlpart__subtitle, nadtnlpart__content, nadtnlpart__input_group, nadtnlpart__input_wrapper, nadtnlpart__input, nadtnlpart__remove-participant"}));case _constants_3d8016e3_3c080f00_js__WEBPACK_IMPORTED_MODULE_3__.C.group:return(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)(_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.F,null,(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("nylas-event-info",null,(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("div",{slot:"inputs"},(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("nylas-event-title",null),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("nylas-event-description",{hideAutoPopulateButton:!0}),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("nylas-event-location",{userProvider:e.provider}),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("nylas-event-timeslot",{name:"event-timeslot"}),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("nylas-event-capacity",null))),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("nylas-booking-calendar-picker",{expressFlow:!0,calendars:t,currentUser:e,defaultBookingCalendar:null==r?void 0:r.id}),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("nylas-additional-participants",{name:"participants",eventParticipants:[{name:(null==e?void 0:e.name)||(null==e?void 0:e.email),email:(null==e?void 0:e.email)||"",is_organizer:!0}],exportparts:"nadtnlpart, nadtnlpart__title, nadtnlpart__subtitle, nadtnlpart__content, nadtnlpart__input_group, nadtnlpart__input_wrapper, nadtnlpart__input, nadtnlpart__remove-participant"}),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("nylas-page-name",{requirePageName:!0,pageName:"Group events page"}),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("nylas-custom-event-slug",{name:"custom-event-slug",exportparts:"nces, nces__body, nces__header, nces__drawer-toggle--container, nces__input-textfield"}))}}let nylasSchedulerEditorCss=':host{display:flex;flex-direction:column;overflow:visible;border-radius:var(--nylas-border-radius-2x);width:fit-content;background:var(--nylas-base-0);position:relative;box-shadow:0px 0px 6px -2px rgba(0, 0, 0, 0.05), 0px 5px 15px -3px rgba(0, 0, 0, 0.1);--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}@media screen and (max-width: 768px){:host{width:-moz-available;width:-webkit-fill-available;width:fill-available;min-width:325px}}div.scheduler-editor-content{height:610px}div.scheduler-editor-content.scheduler-editor-content--group_feature_enabled{height:900px}@media screen and (max-width: 768px){div.scheduler-editor-content.scheduler-editor-content--group_feature_enabled{height:auto}}@media screen and (max-width: 768px){div.scheduler-editor-content{height:auto}}div.scheduler-editor-content--group{height:900px}@media screen and (max-width: 768px){div.scheduler-editor-content--group{height:auto}}div.scheduler-editor-header{display:grid;grid-template-columns:1fr auto auto;align-items:center;justify-content:space-between;padding:1rem;border-bottom:1px solid var(--nylas-base-200);color:var(--nylas-base-900);min-width:924px}@media screen and (max-width: 768px){div.scheduler-editor-header{width:auto;min-width:calc(325px - 1rem)}}div.scheduler-editor-header h1.scheduler-editor-title{display:flex;align-items:center;gap:0.5rem;margin:0;font-size:18px;line-height:24px;font-weight:600}div.scheduler-editor-header button{background:transparent;border:none;cursor:pointer}
2div.scheduler-editor-header button:hover,div.scheduler-editor-header button:active{color:var(--nylas-primary);background-color:transparent}div.scheduler-editor-header button:disabled{cursor:not-allowed}div.scheduler-editor-header div.language select-dropdown::part(sd_dropdown-button){border:none;padding:4px;margin-right:8px}div.scheduler-editor-header div.language select-dropdown::part(sd_dropdown-button):hover{outline:none;color:var(--nylas-primary)}@media screen and (max-width: 768px){div.scheduler-editor-header div.language select-dropdown::part(sd_dropdown-content){width:-webkit-fill-available;width:fill-available;width:-moz-available}}nylas-select-event-type{height:inherit;width:calc(924px + 2rem)}@media screen and (max-width: 768px){nylas-select-event-type{width:auto}}nylas-editor-tabs,nylas-editor-tabs-group{width:auto;height:inherit}nylas-editor-tabs .row,nylas-editor-tabs-group .row{display:flex;gap:1rem}nylas-editor-tabs .composable,nylas-editor-tabs-group .composable{height:inherit;overflow:auto}nylas-editor-tabs nylas-event-info div[slot=inputs],nylas-editor-tabs nylas-event-limits div[slot=inputs],nylas-editor-tabs-group nylas-event-info div[slot=inputs],nylas-editor-tabs-group nylas-event-limits div[slot=inputs]{display:flex;flex-direction:column;gap:1rem}.card{display:flex;flex-direction:column;padding:2rem;background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200);border-radius:5px;max-width:fit-content;align-self:center}.login-required{height:inherit;overflow-y:auto;display:flex;flex-direction:column;justify-content:center;padding:2rem 1rem;background-color:var(--nylas-base-25);border-radius:var(--nylas-border-radius-2x)}@media screen and (max-width: 768px){.login-required{height:auto}}.login-required p{margin:0 0 1rem}.login-required .microsoft-button,.login-required .google-button{height:48px;border:1px solid var(--nylas-base-300);border-radius:var(--nylas-border-radius-2x);font-size:16px;line-height:24px;padding:0 1rem;background-color:var(--nylas-base-0);font-weight:600;cursor:pointer;display:flex;margin-bottom:1rem;background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200);border-radius:5px;justify-content:center;gap:0.5rem;align-items:center}.login-required .microsoft-button:hover,.login-required .google-button:hover{background-color:var(--nylas-base-25)}.login-required .microsoft-button:hover,.login-required .google-button:hover{background-color:var(--nylas-base-25)}.login-required .other-provider-button{height:48px;border:1px solid var(--nylas-base-300);border-radius:var(--nylas-border-radius-2x);font-size:16px;line-height:24px;padding:0 1rem;background-color:var(--nylas-base-0);font-weight:600;cursor:pointer;display:flex;border:0;background-color:var(--nylas-base-0);height:48px;margin-bottom:1rem;font-size:0.95rem;justify-content:center;gap:0.25rem;align-items:center}.login-required .other-provider-button:hover{background-color:var(--nylas-base-25)}.login-required .other-provider-button svg{transform:rotate(180deg)}.login-required .other-provider-button:hover{background-color:var(--nylas-base-25)}.login-required .disclaimer-text{font-size:0.75rem;color:var(--nylas-base-600);align-self:center}.list-configurations{padding:2rem;height:inherit;background:var(--nylas-base-25);border-radius:var(--nylas-border-radius-2x)}@media screen and (max-width: 768px){.list-configurations{height:auto;padding:2rem 1rem}}.list-configurations nylas-list-configurations{height:inherit;display:flex;flex-direction:column}',NylasSchedulerEditorStyle0=nylasSchedulerEditorCss,NylasSchedulerEditor=class{constructor(e){(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.r)(this,e),this.init=(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.c)(this,"init",7),this.loggedIn=(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.c)(this,"loggedIn",7),this.loggedOut=(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.c)(this,"loggedOut",7),this.schedulerConfigCloseClicked=(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.c)(this,"schedulerConfigCloseClicked",7),this.handleSchedulerConfigCloseClicked=e=>
2{let t=this.schedulerConfigCloseClicked.emit(this.host);"schedulerConfigCloseClicked"in this.eventOverrides&&this.eventOverrides.schedulerConfigCloseClicked(t,this.nylasSchedulerConfigConnector),t.defaultPrevented||(localStorage.removeItem("grant"),localStorage.removeItem("user"),window.location.reload())},this.authenticationUrl=async e=>this.nylasApiRequest?await this.nylasApiRequest.authenticationUrl({provider:e})||"":(console.error("[nylas-scheduler-editor] Nylas API Request is not initialized."),""),this.configurationId=void 0,this.nylasApiRequest=void 0,this.nylasSessionsConfig=void 0,this.defaultAuthArgs=void 0,this.eventOverrides={},this.schedulerPreviewLink="",this.defaultSchedulerConfigState=void 0,this.mode="app",this.additionalParticipants=void 0,this.hideEditorTabs=[],this.conferenceProviders=void 0,this.requiresSlug=!1,this.enableUserFeedback=!0,this.defaultLanguage=void 0,this.localization=void 0,this.nylasBranding=!0,this.experimentalFeatures=void 0,this.automaticComponentRegistration=!0,this.selectedLanguage=this.defaultLanguage||_constants_3d8016e3_3c080f00_js__WEBPACK_IMPORTED_MODULE_3__.L.en,this.langVersion=0}connectedCallback(){(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.d)("[nylas-scheduler-editor] connectedCallback")}async componentWillLoad(){var e,t,n,i,r,s,o,a;(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.d)("[nylas-scheduler-editor] componentWillLoad");let l=null==(e=this.additionalParticipants)?void 0:e.filter(e=>{var t;let n=(null==(t=e.calendars)?void 0:t.length)>0?e.calendars.filter(e=>e.id&&e.name):[];if(e.name&&e.email&&n.length>0)return{name:e.name,email:e.email,calendars:n}});if(this.stores={schedulerConfig:(0,_scheduler_config_store_d6729d8d_50920e8c_js__WEBPACK_IMPORTED_MODULE_2__.C)({...this.defaultSchedulerConfigState,additionalParticipants:l,conferenceProviders:this.conferenceProviders,requiresSlug:this.requiresSlug,selectedLanguage:this.defaultLanguage||_constants_3d8016e3_3c080f00_js__WEBPACK_IMPORTED_MODULE_3__.L.en,nylasBranding:this.nylasBranding,experimentalFeatures:this.experimentalFeatures})},!this.nylasApiRequest&&this.nylasSessionsConfig){let e=new NylasSessions(this.nylasSessionsConfig);await e.isLoggedIn(),e.onLoginSuccess(async()=>{var e,t;let n=await (null==(t=null==(e=this.nylasSchedulerConfigConnector)?void 0:e.schedulerConfig)?void 0:t.currentUser());if(n){let e=this.loggedIn.emit(this.host);"loggedIn"in this.eventOverrides&&await this.eventOverrides.loggedIn(e,this.nylasSchedulerConfigConnector),e.defaultPrevented||await this.loggedInHandler(n)}}),e.onLoginFail(async()=>{var e,t;null==(t=null==(e=this.stores)?void 0:e.schedulerConfig)||t.set("currentUser",null);let n=this.loggedOut.emit(this.host);"loggedOut"in this.eventOverrides&&(await this.eventOverrides.loggedOut(n,this.nylasSchedulerConfigConnector),n.defaultPrevented)}),this.nylasApiRequest=new _index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.N(e)}this.nylasApiRequest&&this.defaultAuthArgs&&this.nylasApiRequest.setDefaultAuthArgs(this.defaultAuthArgs),this.baseProvider=new _index_es_13ff6710_73fa05e6_js__WEBPACK_IMPORTED_MODULE_1__.N(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides);let d=this.baseProvider.getStore("schedulerConfig");this.nylasSchedulerConfigConnector=new NylasSchedulerConfigConnector({nylasApiRequest:this.nylasApiRequest,nylasSchedulerConfigStore:d});let c=this.init.emit(this.host);if("init"in this.eventOverrides&&await this.eventOverrides.init(c,this.nylasSchedulerConfigConnector),!c.defaultPrevented){let e=await (null==(n=null==(t=this.nylasSchedulerConfigConnector)?void 0:t.schedulerConfig)?void 0:n.currentUser());if(e){let t=this.loggedIn.emit(this.host);"loggedIn"in this.eventOverrides&&await this.eventOverrides.loggedIn(t,this.nylasSchedulerConfigConnector),t.defaultPrevented||await this.loggedInHandler(e)}else{null==(r=null==(i=this.stores)?void 0:i.schedulerConfig)||r.set("currentUser",null);let e=this.loggedOut.emit(this.host);if("loggedOut"in this.eventOverrides&&(await this.eventOverrides.loggedOut(e,this.nylasSchedulerConfigConnector),e.defaultPrevented))return}}null==(o=null==(s=this.stores)?void 0:s.schedulerConfig)||o.onChange("selectedConfiguration",async e=>
2{e&&e.id&&(this.configurationId=e.id)}),null==(a=this.baseProvider)||a.componentWillLoad(this.nylasSchedulerConfigConnector)}async componentDidLoad(){var e;(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.d)("[nylas-scheduler-editor] componentDidLoad"),await (null==(e=this.baseProvider)?void 0:e.componentDidLoad()),this.updateLocalization(this.localization)}async componentDisconnected(){var e;await (null==(e=this.baseProvider)?void 0:e.componentDisconnected())}async configurationIdChanged(e){var t,n,i,r,s,o,a,l;e?(await (null==(n=null==(t=this.nylasSchedulerConfigConnector)?void 0:t.schedulerConfig)?void 0:n.getConfigurationById(e)),null==(r=null==(i=this.stores)?void 0:i.schedulerConfig)||r.set("action","edit")):(null==(o=null==(s=this.stores)?void 0:s.schedulerConfig)||o.set("selectedConfiguration",{}),null==(l=null==(a=this.stores)?void 0:a.schedulerConfig)||l.set("action",null))}updateLocalization(e){e&&(Object.keys(e).forEach(t=>{t in _constants_3d8016e3_3c080f00_js__WEBPACK_IMPORTED_MODULE_3__.L&&_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.i.addResourceBundle(t,"translation",e[t],!1,!0)}),this.langVersion++)}updateNylasBranding(e){var t,n;null==(n=null==(t=this.stores)?void 0:t.schedulerConfig)||n.set("nylasBranding",e)}updateExperimentalFeatures(e){var t,n;null==(n=null==(t=this.stores)?void 0:t.schedulerConfig)||n.set("experimentalFeatures",e)}async store(){var e;return null==(e=this.stores)?void 0:e.schedulerConfig}async schedulerConnector(){return this.nylasSchedulerConfigConnector}async registerComponentHandler(e){var t;null==(t=this.baseProvider)||t.registerComponent(e.detail)}async unregisterComponentHandler(e){var t;null==(t=this.baseProvider)||t.unregisterComponent(e.detail)}nylasFormDropdownChangedHandler(e){var t,n;let{name:i,value:r}=e.detail;"language"===i&&(this.selectedLanguage=_constants_3d8016e3_3c080f00_js__WEBPACK_IMPORTED_MODULE_3__.L[r],_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.i.changeLanguage(this.selectedLanguage),null==(n=null==(t=this.stores)?void 0:t.schedulerConfig)||n.set("selectedLanguage",this.selectedLanguage))}async loggedInHandler(e){var t,n,i,r,s,o,a;if(null==(n=null==(t=this.stores)?void 0:t.schedulerConfig)||n.set("currentUser",e),this.nylasSchedulerConfigConnector&&(await (null==(i=this.nylasSchedulerConfigConnector.schedulerConfig)?void 0:i.getCalendars()),this.configurationId)){let e=await (null==(r=this.nylasSchedulerConfigConnector.schedulerConfig)?void 0:r.getConfigurationById(this.configurationId));e&&null!=(s=e[0])&&s.id&&(null==(a=null==(o=this.stores)?void 0:o.schedulerConfig)||a.set("action","edit"))}}render(){var e,t,n,i,r,s,o,a,l,d,c,u,h,g,f,p,y,v,m,w,b,_,S,C,x,E,A,k,I,R,q,P,U,L,T,N,O,$,z,j,G,B,D,F,H,J,V,K,M,W,X,Y,Z,Q,ee,et;let en=this.host.querySelector('[slot="custom-page-style-inputs"]'),ei=null==(n=null==(t=null==(e=this.stores)?void 0:e.schedulerConfig)?void 0:t.state.selectedConfiguration)?void 0:n.id,er=Object.keys(_constants_3d8016e3_3c080f00_js__WEBPACK_IMPORTED_MODULE_3__.a).map(e=>({label:_constants_3d8016e3_3c080f00_js__WEBPACK_IMPORTED_MODULE_3__.a[e],value:e})),es=(null==(r=null==(i=this.stores)?void 0:i.schedulerConfig)?void 0:r.state.selectedEventType)===_constants_3d8016e3_3c080f00_js__WEBPACK_IMPORTED_MODULE_3__.C.group||(null==(a=null==(o=null==(s=this.stores)?void 0:s.schedulerConfig)?void 0:o.state.selectedConfiguration)?void 0:a.type)===_constants_3d8016e3_3c080f00_js__WEBPACK_IMPORTED_MODULE_3__.C.group;return(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)(_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.H,{key:"0053ea345fb1297974b68e859adc7caf738f0f35"},(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("div",{key:"e3059c866be7f1d804b451fb54e01a5c219019b1",class:"scheduler-editor-header",part:"nse__header"},(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("h1",{key:"56712052dd6fe1b8ff8a428c8ad3f0f491beac23",class:"scheduler-editor-title",part:"nse__title"},(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("calendar-icon",{key:"dfe74ae46374c05c480b419124ba2055606b400a",width:"18",height:"18"}),_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.i.t("schedulerEditorTitle")),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("div",{key:"f4ba96f86e1e6e79d720273e0808d87528d74fc1",class:{language:!0},part:"nse__language"},(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("select-dropdown",{key:"3bfe4634f550553f0e2002aa5fec9b39b1cd9e75",name:"language",options:er,withChevron:!1,defaultSelectedOption:er.find(e=>e.value==this.selectedLanguage),exportparts:"sd_dropdown: nse__language-dropdown, sd_dropdown-button: nse__language-drop-button, sd_dropdown-content: nse__language-drop-content, sd_dropdown_label: nse__language-drop-label"},(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("span",{key:"9926723981f56a7606ff94f213215e93bf51c472",slot:"select-icon"},(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("translate-icon",{key:"d22a01ac1cef04ff5f2015c2cc73932c6fd7885c",width:"20",height:"20"})))),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("button",{key:"8f256e2b3978b33a0887bd3af8c987ab2b6b5782",class:"scheduler-editor-close",title:"logout",onClick:e=>this.handleSchedulerConfigCloseClicked(e),part:"nse__close-button"},(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("close-icon",{key:"acd07b2fc1509f11440f4ad5047d20b3693e0750",width:"18",height:"18"}))),(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("div",{key:"d39be68578574cbba4993ca63d2a8f087cecff04",class:{"scheduler-editor-content":!0,"scheduler-editor-content--group_feature_enabled":!!(null!=(c=null==(d=null==(l=this.stores)?void 0:l.schedulerConfig)?void 0:d.state.experimentalFeatures)&&c[_constants_3d8016e3_3c080f00_js__WEBPACK_IMPORTED_MODULE_3__.E.group_events]),"scheduler-editor-content--group":es},part:"nse__content"},(null==(h=null==(u=this.stores)?void 0:u.schedulerConfig)?void 0:h.state.currentUser)&&null===this.stores.schedulerConfig.state.action&&(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("div",{class:"list-configurations",part:"nse__list-configurations"},(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("nylas-list-configurations",{exportparts:"nlc__create-new-cta, actions__dropdown, actions__dropdown-button, actions__dropdown-content, actions-Copy, actions-Preview, actions-Delete"})),(null==(f=null==(g=this.stores)?void 0:g.schedulerConfig)?void 0:f.state.currentUser)&&"create-select"===this.stores.schedulerConfig.state.action&&(null==(v=null==(y=null==(p=this.stores)?void 0:p.schedulerConfig)?void 0:y.state.experimentalFeatures)?void 0:v[_constants_3d8016e3_3c080f00_js__WEBPACK_IMPORTED_MODULE_3__.E.group_events])&&(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("nylas-select-event-type",null),(null==(w=null==(m=this.stores)?void 0:m.schedulerConfig)?void 0:w.state.currentUser)&&"create"===this.stores.schedulerConfig.state.action&&es&&(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("nylas-editor-tabs-group",{mode:"composable"},(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)(ExpressFlow,{experimentalFeatures:null==(S=null==(_=null==(b=this.stores)?void 0:b.schedulerConfig)?void 0:_.state)?void 0:S.experimentalFeatures,selectedEventType:(null==(E=null==(x=null==(C=this.stores)?void 0:C.schedulerConfig)?void 0:x.state)?void 0:E.selectedEventType)||_constants_3d8016e3_3c080f00_js__WEBPACK_IMPORTED_MODULE_3__.C.one_on_one,currentUser:null==(k=null==(A=this.stores)?void 0:A.schedulerConfig)?void 0:k.state.currentUser,calendars:null==(q=null==(R=null==(I=this.stores)?void 0:I.schedulerConfig)?void 0:R.state)?void 0:q.calendars,selectedConfiguration:null==(L=null==(U=null==(P=this.stores)?void 0:P.schedulerConfig)?void 0:U.state)?void 0:L.selectedConfiguration})),(null==(N=null==(T=this.stores)?void 0:T.schedulerConfig)?void 0:N.state.currentUser)&&"create"===this.stores.schedulerConfig.state.action&&!es&&(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("nylas-editor-tabs",{mode:"composable"},(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)(ExpressFlow,{experimentalFeatures:null==(z=null==($=null==(O=this.stores)?void 0:O.schedulerConfig)?void 0:$.state)?void 0:z.experimentalFeatures,selectedEventType:(null==(B=null==(G=null==(j=this.stores)?void 0:j.schedulerConfig)?void 0:G.state)?void 0:B.selectedEventType)||_constants_3d8016e3_3c080f00_js__WEBPACK_IMPORTED_MODULE_3__.C.one_on_one,currentUser:null==(F=null==(D=this.stores)?void 0:D.schedulerConfig)?void 0:F.state.currentUser,calendars:null==(V=null==(J=null==(H=this.stores)?void 0:H.schedulerConfig)?void 0:J.state)?void 0:V.calendars,selectedConfiguration:null==(W=null==(M=null==(K=this.stores)?void 0:K.schedulerConfig)?void 0:M.state)?void 0:W.selectedConfiguration})),(null==(Y=null==(X=this.stores)?void 0:X.schedulerConfig)?void 0:Y.state.currentUser)&&"edit"===this.stores.schedulerConfig.state.action&&es&&(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("nylas-editor-tabs-group",{key:ei,mode:this.mode},"composable"===this.mode&&(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("slot",null),"app"===this.mode&&en&&(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("div",{style:{display:"none"},slot:"custom-page-style-inputs",key:ei},(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("slot",{name:"custom-page-style-inputs"}))),(null==(Q=null==(Z=this.stores)?void 0:Z.schedulerConfig)?void 0:Q.state.currentUser)&&"edit"===this.stores.schedulerConfig.state.action&&!es&&(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("nylas-editor-tabs",{key:ei,mode:this.mode},"composable"===this.mode&&(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("slot",null),"app"===this.mode&&en&&(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("div",{style:{display:"none"},slot:"custom-page-style-inputs",key:ei},(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("slot",{name:"custom-page-style-inputs"}))),!(null!=(et=null==(ee=this.stores)?void 0:ee.schedulerConfig)&&et.state.currentUser)&&(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)("slot",{name:"login-required"},(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.h)(LoginRequired,{authenticationUrl:this.authenticationUrl}))))}get host(){return(0,_index_9243e481_js__WEBPACK_IMPORTED_MODULE_0__.g)(this)}static get watchers(){return{configurationId:["configurationIdChanged"],localization:["updateLocalization"],nylasBranding:["updateNylasBranding"],experimentalFeatures:["updateExperimentalFeatures"]}}};NylasSchedulerEditor.style=NylasSchedulerEditorStyle0},89437:(e,t,n)=>{n.d(t,{C:()=>r});var i=n(33712);function r(e={}){let t={selectedConfiguration:{},configurations:[],groupEvents:[],listConfigurationsNextCursor:null,calendars:[],currentUser:null,action:null,additionalParticipants:[],requiresSlug:!1,masterGroupEvents:{},isLoading:!1,...e},n=(0,i.a)(t);function s(){n.set("selectedConfiguration",{...e.selectedConfiguration})}return n.onChange("action",async e=>{e||s()}),{...n,resetSelectedConfiguration:s}}}}]);
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.