@nylas/react 1.1.0-canary.19 → 1.1.0-canary.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/add-circle-icon_2.entry-29cc2385.cjs +1 -0
- package/dist/add-circle-icon_2.entry-b8d6df60.js +69 -0
- package/dist/{archive-icon_7.entry-896a1054.js → archive-icon_7.entry-3830776a.js} +18 -18
- package/dist/{archive-icon_7.entry-2b56ef80.cjs → archive-icon_7.entry-afaef817.cjs} +1 -1
- package/dist/{arrow-icon.entry-9aaa93fd.js → arrow-icon.entry-19f00716.js} +1 -1
- package/dist/{arrow-icon.entry-0288f3fc.cjs → arrow-icon.entry-460cdd9f.cjs} +1 -1
- package/dist/{bold-icon_3.entry-e7810620.cjs → bold-icon_3.entry-1893eeec.cjs} +1 -1
- package/dist/{bold-icon_3.entry-0061cf1f.js → bold-icon_3.entry-80abafbb.js} +3 -3
- package/dist/button-component.entry-36137536.js +16 -0
- package/dist/button-component.entry-b78dc39e.cjs +1 -0
- package/dist/calendar-agenda-fill-icon_40.entry-62c66fce.cjs +10 -0
- package/dist/{calendar-agenda-fill-icon_35.entry-a19cae9c.js → calendar-agenda-fill-icon_40.entry-f19d6ad7.js} +1474 -1077
- package/dist/{calendar-cancel-icon.entry-8e8b25b6.cjs → calendar-cancel-icon.entry-0d83ee82.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-71eae711.js → calendar-cancel-icon.entry-1fae00c5.js} +1 -1
- package/dist/{calendar-check-icon_2.entry-6f971ca2.js → calendar-check-icon_2.entry-159c38af.js} +1 -1
- package/dist/{calendar-check-icon_2.entry-562e98cf.cjs → calendar-check-icon_2.entry-e01c9028.cjs} +1 -1
- package/dist/{calendar-icon.entry-3a59af30.cjs → calendar-icon.entry-2e701aab.cjs} +1 -1
- package/dist/{calendar-icon.entry-3e496896.js → calendar-icon.entry-3af9cb76.js} +1 -1
- package/dist/checkbox-component_2.entry-5eee51f6.js +56 -0
- package/dist/checkbox-component_2.entry-9ff2c85b.cjs +1 -0
- package/dist/checkmark-icon.entry-0749b942.js +15 -0
- package/dist/checkmark-icon.entry-f96f1117.cjs +1 -0
- package/dist/{chevron-icon_3.entry-7eac0ed5.js → chevron-icon_3.entry-2e9eebbc.js} +10 -10
- package/dist/{chevron-icon_3.entry-7ff10540.cjs → chevron-icon_3.entry-c3989df2.cjs} +1 -1
- package/dist/clock-icon_4.entry-9395d0cb.js +45 -0
- package/dist/clock-icon_4.entry-d4563931.cjs +1 -0
- package/dist/close-icon.entry-cf9f0a69.js +15 -0
- package/dist/close-icon.entry-e24af309.cjs +1 -0
- package/dist/{constants-7ce66b44-e7ca66c2.js → constants-67de2eec-b17f5b96.js} +37 -17
- package/dist/{constants-7ce66b44-a951d78c.cjs → constants-67de2eec-e3b50fc6.cjs} +5 -5
- package/dist/{copy-icon_4.entry-9a949d24.js → copy-icon_3.entry-7b276fa2.js} +9 -19
- package/dist/copy-icon_3.entry-7de3667f.cjs +1 -0
- package/dist/document-refresh-icon.entry-582ac233.cjs +1 -0
- package/dist/{document-refresh-icon.entry-f0d95ac8.js → document-refresh-icon.entry-6dd65cb6.js} +2 -2
- package/dist/elements/index.d.ts +8 -0
- package/dist/{elements-dc5b338e-62b53496.cjs → elements-dc5b338e-158dce67.cjs} +1 -1
- package/dist/{elements-dc5b338e-974e2077.js → elements-dc5b338e-5e8a704b.js} +1 -1
- package/dist/{focus-visible-e8093c16-923e1041.cjs → focus-visible-e8093c16-5883a317.cjs} +1 -1
- package/dist/{focus-visible-e8093c16-7a512fc0.js → focus-visible-e8093c16-9d88e8ee.js} +1 -1
- package/dist/{forward-icon_6.entry-45b70066.cjs → forward-icon_6.entry-a59dada5.cjs} +3 -3
- package/dist/{forward-icon_6.entry-675c0b73.js → forward-icon_6.entry-acdf04ad.js} +7 -7
- package/dist/{globe-icon.entry-3296e427.js → globe-icon.entry-389c0391.js} +2 -2
- package/dist/{globe-icon.entry-7ecd6221.cjs → globe-icon.entry-eef27331.cjs} +1 -1
- package/dist/google-logo-icon_4.entry-e9be320c.cjs +1 -0
- package/dist/google-logo-icon_4.entry-eae19fc8.js +637 -0
- package/dist/index-53420959-82a5306f.cjs +1 -0
- package/dist/index-53420959-9b1699ec.js +5 -0
- package/dist/{index-6d9eeb53-aa1dfa96.cjs → index-6d9eeb53-15c69801.cjs} +1 -1
- package/dist/{index-6d9eeb53-4e2a7f9f.js → index-6d9eeb53-c70fc8a7.js} +2 -2
- package/dist/index-db48e0b6.cjs +42 -0
- package/dist/index-f8317a8e.js +7638 -0
- package/dist/{index.es-9cc0eb3c-65f8af0c.js → index.es-b16d0cf5-386496a9.js} +1 -1
- package/dist/{index.es-9cc0eb3c-8eefd4fc.cjs → index.es-b16d0cf5-d7f30c4a.cjs} +1 -1
- package/dist/{info-icon_2.entry-e612f1d6.cjs → info-icon_2.entry-63914227.cjs} +1 -1
- package/dist/{info-icon_2.entry-f06c8dd0.js → info-icon_2.entry-97d75550.js} +5 -5
- package/dist/input-dropdown.entry-4d29246a.js +132 -0
- package/dist/input-dropdown.entry-629d7b54.cjs +1 -0
- package/dist/loading-icon.entry-2f15a09f.cjs +1 -0
- package/dist/loading-icon.entry-fc9bc740.js +15 -0
- package/dist/{mailbox-store-64b4ef7c-9bd02ffd.cjs → mailbox-store-f11de360-02a6de93.cjs} +1 -1
- package/dist/{mailbox-store-64b4ef7c-b56d5e78.js → mailbox-store-f11de360-d781fd36.js} +2 -2
- package/dist/{multi-select-dropdown.entry-5bb80d89.cjs → multi-select-dropdown.entry-68fcca98.cjs} +1 -1
- package/dist/{multi-select-dropdown.entry-edf10867.js → multi-select-dropdown.entry-8e14e9af.js} +2 -2
- package/dist/nylas-booked-event-card_10.entry-4da23b61.cjs +1 -0
- package/dist/{nylas-booked-event-card_10.entry-92f6e85d.js → nylas-booked-event-card_10.entry-9487941d.js} +357 -316
- package/dist/{nylas-custom-booking-flow.entry-b39a2bf2.js → nylas-custom-booking-flow.entry-0e16973b.js} +32 -32
- package/dist/{nylas-custom-booking-flow.entry-cef0041a.cjs → nylas-custom-booking-flow.entry-338b0a8f.cjs} +1 -1
- package/dist/nylas-form-card.entry-ca669dea.cjs +1 -0
- package/dist/{nylas-form-card.entry-bf4545e2.js → nylas-form-card.entry-ccfa5692.js} +10 -10
- package/dist/{nylas-if-state.entry-2739dc10.js → nylas-if-state.entry-93935670.js} +2 -2
- package/dist/{nylas-if-state.entry-d7b818a6.cjs → nylas-if-state.entry-faa11bb6.cjs} +1 -1
- package/dist/{nylas-list-folders.entry-3197e390.js → nylas-list-folders.entry-14fc1fe8.js} +4 -4
- package/dist/{nylas-list-folders.entry-0ec6ba20.cjs → nylas-list-folders.entry-e7e179ea.cjs} +1 -1
- package/dist/{nylas-list-threads.entry-9004c490.js → nylas-list-threads.entry-2118b146.js} +3 -3
- package/dist/{nylas-list-threads.entry-2a7e1e84.cjs → nylas-list-threads.entry-3f52fc06.cjs} +1 -1
- package/dist/{nylas-login.entry-f2927406.js → nylas-login.entry-87a902d6.js} +7 -7
- package/dist/{nylas-login.entry-c2ffd6a5.cjs → nylas-login.entry-915f0284.cjs} +1 -1
- package/dist/{nylas-mailbox-pagination.entry-839c9ad3.cjs → nylas-mailbox-pagination.entry-9aa8a606.cjs} +1 -1
- package/dist/{nylas-mailbox-pagination.entry-e9356835.js → nylas-mailbox-pagination.entry-eedbf796.js} +2 -2
- package/dist/{nylas-mailbox-toolbar-button.entry-298a3c47.js → nylas-mailbox-toolbar-button.entry-40b75810.js} +2 -2
- package/dist/{nylas-mailbox-toolbar-button.entry-43812d51.cjs → nylas-mailbox-toolbar-button.entry-ba5b826e.cjs} +1 -1
- package/dist/{nylas-mailbox.entry-aa42f6c4.js → nylas-mailbox.entry-179e5a5c.js} +3 -3
- package/dist/{nylas-mailbox.entry-cf13ddf5.cjs → nylas-mailbox.entry-31de7f8f.cjs} +1 -1
- package/dist/{nylas-provider.entry-843b5593.cjs → nylas-provider.entry-46fe01b6.cjs} +1 -1
- package/dist/{nylas-provider.entry-1a3a195f.js → nylas-provider.entry-7b70bbdc.js} +36 -36
- package/dist/{nylas-scheduler-editor.entry-048e7a8f.cjs → nylas-scheduler-editor.entry-76b68f66.cjs} +2 -2
- package/dist/{nylas-scheduler-editor.entry-d56d6d2a.js → nylas-scheduler-editor.entry-f1f80de1.js} +7 -10
- package/dist/{nylas-scheduling.entry-7039a890.js → nylas-scheduling.entry-31d13205.js} +83 -70
- package/dist/nylas-scheduling.entry-3ce8c52f.cjs +1 -0
- package/dist/{nylas-threads-refresh.entry-d951050a.js → nylas-threads-refresh.entry-a3ea46aa.js} +2 -2
- package/dist/{nylas-threads-refresh.entry-9cae6ac8.cjs → nylas-threads-refresh.entry-c9f9db8c.cjs} +1 -1
- package/dist/{nylas-threads-search.entry-7a4bbc75.js → nylas-threads-search.entry-01482ddf.js} +8 -8
- package/dist/{nylas-threads-search.entry-0d34c5a8.cjs → nylas-threads-search.entry-a4ab0d47.cjs} +1 -1
- package/dist/{nylas-time-window-picker.entry-062bc8c1.cjs → nylas-time-window-picker.entry-5a3bb0b7.cjs} +1 -1
- package/dist/{nylas-time-window-picker.entry-210c3f1a.js → nylas-time-window-picker.entry-5f063b2b.js} +18 -18
- package/dist/{nylas-view-thread.entry-db78ed9c.cjs → nylas-view-thread.entry-82e78b82.cjs} +1 -1
- package/dist/{nylas-view-thread.entry-8b39a997.js → nylas-view-thread.entry-cb057b9e.js} +6 -6
- package/dist/person-icon.entry-3e30c63c.js +15 -0
- package/dist/person-icon.entry-78cdc7f9.cjs +1 -0
- package/dist/play-icon_2.entry-4fb1938c.cjs +1 -0
- package/dist/play-icon_2.entry-71eaad5c.js +25 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +116 -108
- package/dist/{refresh-icon.entry-e695cf7f.cjs → refresh-icon.entry-3570353d.cjs} +1 -1
- package/dist/{refresh-icon.entry-75139a0c.js → refresh-icon.entry-db85d14d.js} +4 -4
- package/dist/{register-component-a5a9ca5d-d69a7a05.js → register-component-b2a51b20-8a262dcf.js} +1 -1
- package/dist/{register-component-a5a9ca5d-eebf89e7.cjs → register-component-b2a51b20-9a913603.cjs} +1 -1
- package/dist/{scheduler-config-store-9ccfba4d-22a58b7d.cjs → scheduler-config-store-9ccfba4d-6806e3cb.cjs} +1 -1
- package/dist/{scheduler-config-store-9ccfba4d-fd62a421.js → scheduler-config-store-9ccfba4d-a6745ccc.js} +1 -1
- package/dist/{scheduler-store-8a400448-3b007d4d.js → scheduler-store-db06b30a-1e63b67f.js} +119 -116
- package/dist/scheduler-store-db06b30a-d5e6b6c3.cjs +1 -0
- package/dist/{textarea-component.entry-48feabb3.cjs → textarea-component.entry-be870b8f.cjs} +1 -1
- package/dist/{textarea-component.entry-ead5ab00.js → textarea-component.entry-f5f402a1.js} +4 -4
- package/dist/time-period-selector.entry-d1a8470b.js +93 -0
- package/dist/time-period-selector.entry-fc7d61c6.cjs +1 -0
- package/dist/{translate-icon.entry-5f62bc61.cjs → translate-icon.entry-3ae0ddae.cjs} +1 -1
- package/dist/{translate-icon.entry-55043beb.js → translate-icon.entry-b91a0449.js} +2 -2
- package/dist/{warning-icon.entry-2e0a80da.cjs → warning-icon.entry-54127f45.cjs} +1 -1
- package/dist/{warning-icon.entry-fa644462.js → warning-icon.entry-acdc811b.js} +5 -5
- package/package.json +3 -3
- package/dist/add-circle-icon_2.entry-3ca337a6.js +0 -25
- package/dist/add-circle-icon_2.entry-adde5fdf.cjs +0 -1
- package/dist/button-component_4.entry-276606e6.js +0 -115
- package/dist/button-component_4.entry-e53a8f37.cjs +0 -1
- package/dist/calendar-agenda-fill-icon_35.entry-fa968081.cjs +0 -7
- package/dist/clock-icon_2.entry-120d672e.js +0 -25
- package/dist/clock-icon_2.entry-43873262.cjs +0 -1
- package/dist/copy-icon_4.entry-57874c4f.cjs +0 -1
- package/dist/document-refresh-icon.entry-f1d3f32d.cjs +0 -1
- package/dist/google-logo-icon_4.entry-aa9f8b35.js +0 -584
- package/dist/google-logo-icon_4.entry-fd734a59.cjs +0 -1
- package/dist/index-53420959-1c0d390d.js +0 -5
- package/dist/index-53420959-8e7b10db.cjs +0 -1
- package/dist/index-5efb84b8.js +0 -5011
- package/dist/index-d36b8fb8.cjs +0 -42
- package/dist/input-dropdown_2.entry-ad380260.cjs +0 -1
- package/dist/input-dropdown_2.entry-ccd95678.js +0 -220
- package/dist/loading-icon.entry-678a6b3f.cjs +0 -1
- package/dist/loading-icon.entry-9e6670d5.js +0 -15
- package/dist/nylas-booked-event-card_10.entry-ad4671b2.cjs +0 -1
- package/dist/nylas-form-card.entry-fba5d623.cjs +0 -1
- package/dist/nylas-scheduling.entry-0ad9b1d0.cjs +0 -1
- package/dist/play-icon_2.entry-19271982.cjs +0 -1
- package/dist/play-icon_2.entry-c53f3cac.js +0 -25
- package/dist/scheduler-store-8a400448-44e0edad.cjs +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { r as
|
|
1
|
+
import { r as e, h as c } from "./index-f8317a8e.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "react-dom";
|
|
4
4
|
const t = ".sc-refresh-icon-h{display:flex}", l = t, h = class {
|
|
5
|
-
constructor(
|
|
6
|
-
|
|
5
|
+
constructor(s) {
|
|
6
|
+
e(this, s), this.width = "15", this.height = "15";
|
|
7
7
|
}
|
|
8
8
|
render() {
|
|
9
|
-
return c("svg", { key: "
|
|
9
|
+
return c("svg", { key: "03402ef22595092998627fb5f41087a831ab4320", fill: "auto", width: this.width, height: this.height, viewBox: "0 0 32 32", version: "1.1", xmlns: "http://www.w3.org/2000/svg" }, c("path", { key: "2e4a1b6a6a02bd6b0bc5e58ed07e5f5903dbcd44", d: "M15.544 28.080c-0.002-0.006-0.008-0.010-0.012-0.015l-2.873-4.489c-0.204-0.335-0.646-0.454-0.992-0.266l-0.256 0.157c-0.344 0.188-0.337 0.673-0.133 1.008l1.841 2.857c-0.157-0.035-0.316-0.063-0.471-0.103-3.224-0.843-5.953-3.026-7.485-5.988-1.448-2.797-1.72-5.99-0.766-8.992s3.118-5.452 5.915-6.899c0.476-0.247 0.662-0.832 0.416-1.308-0.246-0.477-0.832-0.663-1.308-0.416-3.258 1.686-5.763 4.54-6.874 8.036s-0.794 7.215 0.892 10.473c1.786 3.448 4.963 5.989 8.72 6.973 0.043 0.011 0.087 0.017 0.13 0.028l-2.541 1.288c-0.344 0.189-0.458 0.613-0.254 0.948l0.098 0.256c0.205 0.335 0.557 0.454 0.9 0.266l4.651-2.381c0.006-0.004 0.012-0.003 0.018-0.007l0.312-0.171c0.172-0.095 0.287-0.249 0.332-0.422 0.047-0.172 0.025-0.364-0.076-0.531zM28.559 10.025c-1.783-3.447-4.862-5.988-8.618-6.972-0.267-0.070-0.541-0.124-0.814-0.179l2.494-1.265c0.344-0.189 0.549-0.614 0.345-0.949l-0.099-0.255c-0.205-0.336-0.648-0.454-0.991-0.267l-4.651 2.381c-0.006 0.003-0.012 0.002-0.018 0.006l-0.312 0.171c-0.173 0.095-0.287 0.249-0.332 0.422-0.047 0.172-0.025 0.364 0.077 0.53l0.185 0.304c0.003 0.006 0.008 0.010 0.012 0.016l2.873 4.489c0.203 0.335 0.646 0.454 0.991 0.266l0.226-0.157c0.344-0.188 0.366-0.673 0.163-1.008l-1.85-2.87c0.407 0.063 0.811 0.138 1.207 0.242 3.226 0.845 5.856 3.027 7.387 5.986 1.448 2.797 1.72 5.99 0.765 8.991s-3.020 5.451-5.818 6.901c-0.476 0.247-0.662 0.831-0.415 1.308 0.172 0.332 0.511 0.524 0.863 0.524 0.15 0 0.302-0.035 0.446-0.109 3.259-1.686 5.664-4.54 6.776-8.035 1.111-3.497 0.794-7.217-0.893-10.473z" }));
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
12
|
h.style = l;
|
package/dist/{register-component-a5a9ca5d-eebf89e7.cjs → register-component-b2a51b20-9a913603.cjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const s=require("./index-
|
|
1
|
+
"use strict";const s=require("./index-db48e0b6.cjs");function m(e,o,u="registerComponent"){return new CustomEvent(u,{bubbles:!0,composed:!0,detail:o})}function P(e,o,u="unregisterComponent"){return new CustomEvent(u,{bubbles:!0,composed:!0,detail:o})}function b(e){return(o,u)=>{const r=e.name;s.debug(`[${r}] Registering component ${r} being called on ${u}`);const l=o.componentWillLoad;if(!l){s.error(`[${r}] componentWillLoad lifecycle method in ${r} missing. Required for RegisterComponent decorator.`);return}const p=o.connectedCallback;if(!p){s.error(`[${r}] connectedCallback lifecycle method in ${r} missing. Required for RegisterComponent decorator.`);return}const a=o.disconnectedCallback;if(!a){s.error(`[${r}] disconnectedCallback lifecycle method in ${r} missing. Required for RegisterComponent decorator.`);return}if(e.storeToProps&&e.stateToProps){const n=Array.from(e.storeToProps.values()),t=Array.from(e.stateToProps.values()),i=n.filter(c=>t.includes(c));if(i.length>0){s.error(`[${r}] Overlapping prop keys detected in ${r} for storeToProps and stateToProps. Make sure to only define them once. Overlapping keys: ${i.join(", ")}`);return}}const d=new Map;e.eventToProps&&Object.keys(e.eventToProps).forEach(n=>{var t;d.set(n,(t=e.eventToProps)==null?void 0:t[n])}),o.connectedCallback=function(){s.debug(`[~${r}] connectedCallback called`);const n=p==null?void 0:p.call(this),t=s.getElement(this);return t.dataset.nylasId||(Object.defineProperty(t,"registerNylasComponent",{get(){return!0},enumerable:!0}),Object.defineProperty(t,"stateToProps",{get(){return e.stateToProps},enumerable:!0}),Object.defineProperty(t,"getStoresToProp",{get(){return e.getStoresToProp},enumerable:!0}),Object.defineProperty(t,"storeToProps",{get(){return e.storeToProps},enumerable:!0}),Object.defineProperty(t,"eventToProps",{get(){return d},enumerable:!0}),Object.defineProperty(t,"authToProp",{get(){return e.authToProp},enumerable:!0}),Object.defineProperty(t,"connectorToProp",{get(){return e.connectorToProp},enumerable:!0}),Object.defineProperty(t,"localPropsToProp",{get(){return e.localPropsToProp},enumerable:!0})),n},e.fireRegisterEvent&&(o.componentWillLoad=function(){const n=l==null?void 0:l.call(this),t=s.getElement(this),i={element:t,...e,eventToProps:d},c=m(o,i,e.registrationEventName);return t.dispatchEvent(c)&&s.debug(`[${r}] Component ${r} successfully fired registration event`),n},o.disconnectedCallback=function(){const n=a==null?void 0:a.call(this),t=s.getElement(this),i={element:t,...e,eventToProps:d},c=P(o,i,e.unregistrationEventName);return t.dispatchEvent(c)&&s.debug(`[${r}] Component ${r} successfully fired unregistration event`),n})}}exports.RegisterComponent=b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const r=require("./index-
|
|
1
|
+
"use strict";const r=require("./index-db48e0b6.cjs");function a(n={}){const i={selectedConfiguration:{},configurations:[],listConfigurationsNextCursor:null,calendars:[],currentUser:null,action:null,additionalParticipants:[],hideEditorTabs:[],...n},e=r.createStore(i);function t(){e.set("selectedConfiguration",{...n.selectedConfiguration})}return e.onChange("action",async o=>{o||t()}),{...e,resetSelectedConfiguration:t}}exports.CreateNylasSchedulerConfigStore=a;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as b, e as z,
|
|
1
|
+
import { d as b, e as z, k as d, m as F } from "./index-f8317a8e.js";
|
|
2
2
|
var k;
|
|
3
3
|
(function(a) {
|
|
4
4
|
a.Component = "component", a.Api = "api", a.Auth = "auth";
|
|
@@ -7,11 +7,11 @@ var A;
|
|
|
7
7
|
(function(a) {
|
|
8
8
|
a.endtime_not_in_future = "endtime_not_in_future", a.no_booking_info = "no_booking_info", a.no_timeslot_selected = "no_timeslot_selected", a.no_timezone_selected = "no_timezone_selected", a.no_booking_id = "no_booking_id", a.invalid_start_time = "invalid_start_time", a.invalid_end_time = "invalid_end_time", a.invalid_timezone = "invalid_timezone";
|
|
9
9
|
})(A || (A = {}));
|
|
10
|
-
var
|
|
10
|
+
var L;
|
|
11
11
|
(function(a) {
|
|
12
12
|
a.invalid_session = "invalid_session", a.general_error = "general_error", a.internal_error = "internal_error", a.invalid_request_error = "invalid_request_error", a.timeslot_not_available = "timeslot_not_available", a.provider_error = "provider_error", a.not_found_error = "not_found_error";
|
|
13
|
-
})(
|
|
14
|
-
class
|
|
13
|
+
})(L || (L = {}));
|
|
14
|
+
class R {
|
|
15
15
|
constructor() {
|
|
16
16
|
this.component = (e) => {
|
|
17
17
|
const t = k.Component, s = `${e} Error`;
|
|
@@ -99,9 +99,9 @@ class F {
|
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
class
|
|
102
|
+
class C {
|
|
103
103
|
constructor({ schedulerAPIURL: e, schedulerStore: t, sessionId: s, configId: i }) {
|
|
104
|
-
this.errors = new
|
|
104
|
+
this.errors = new R(), this.schedulerStore = t, this.schedulerAPIURL = e, this.sessionId = s, this.configId = i;
|
|
105
105
|
}
|
|
106
106
|
getHeaders() {
|
|
107
107
|
return this.sessionId ? {
|
|
@@ -110,8 +110,8 @@ class U {
|
|
|
110
110
|
}
|
|
111
111
|
async makeAPIRequest(e, t, s, i = {}) {
|
|
112
112
|
try {
|
|
113
|
-
const
|
|
114
|
-
return
|
|
113
|
+
const r = new URL(this.schedulerAPIURL);
|
|
114
|
+
return r.pathname = e, await (await fetch(decodeURIComponent(r.toString()), {
|
|
115
115
|
method: t,
|
|
116
116
|
headers: {
|
|
117
117
|
"Content-Type": "application/json",
|
|
@@ -120,10 +120,10 @@ class U {
|
|
|
120
120
|
},
|
|
121
121
|
body: s
|
|
122
122
|
})).json();
|
|
123
|
-
} catch (
|
|
123
|
+
} catch (r) {
|
|
124
124
|
return {
|
|
125
125
|
error: {
|
|
126
|
-
message:
|
|
126
|
+
message: r.message,
|
|
127
127
|
title: "API request failed",
|
|
128
128
|
type: "api"
|
|
129
129
|
}
|
|
@@ -131,9 +131,9 @@ class U {
|
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
getErrorMessage(e) {
|
|
134
|
-
var s, i,
|
|
134
|
+
var s, i, r, n;
|
|
135
135
|
let t = (e == null ? void 0 : e.message) || (e == null ? void 0 : e.title) || "Something went wrong";
|
|
136
|
-
return (e == null ? void 0 : e.type) === "provider_error" && (t = ((i = (s = e == null ? void 0 : e.provider_error) == null ? void 0 : s.error) == null ? void 0 : i.message) || ((
|
|
136
|
+
return (e == null ? void 0 : e.type) === "provider_error" && (t = ((i = (s = e == null ? void 0 : e.provider_error) == null ? void 0 : s.error) == null ? void 0 : i.message) || ((n = (r = e == null ? void 0 : e.provider_error) == null ? void 0 : r.error) == null ? void 0 : n.title) || "Something went wrong"), t;
|
|
137
137
|
}
|
|
138
138
|
setConfigId(e) {
|
|
139
139
|
this.configId = e;
|
|
@@ -147,6 +147,9 @@ class U {
|
|
|
147
147
|
selectTimezone(e) {
|
|
148
148
|
this.schedulerStore.set("selectedTimezone", e);
|
|
149
149
|
}
|
|
150
|
+
selectLanguage(e) {
|
|
151
|
+
this.schedulerStore.set("selectedLanguage", e), d.changeLanguage(e);
|
|
152
|
+
}
|
|
150
153
|
async toggleAdditionalData(e) {
|
|
151
154
|
e || await this.refetchAvailability(), this.schedulerStore.set("showBookingForm", e);
|
|
152
155
|
}
|
|
@@ -175,7 +178,7 @@ class U {
|
|
|
175
178
|
return await this.getAvailability(s, i);
|
|
176
179
|
}
|
|
177
180
|
async resetStoreStateAndFetchAvailability() {
|
|
178
|
-
const e = /* @__PURE__ */ new Date(), t = await this.refetchAvailability(), s = this.schedulerStore.get("availability").find((
|
|
181
|
+
const e = /* @__PURE__ */ new Date(), t = await this.refetchAvailability(), s = this.schedulerStore.get("availability").find((r) => new Date(r.start_time) > /* @__PURE__ */ new Date());
|
|
179
182
|
let i = e;
|
|
180
183
|
return s && (i = s.start_time), this.schedulerStore.set("selectedDate", i), this.schedulerStore.set("eventInfo", null), this.schedulerStore.set("showBookingForm", !1), this.schedulerStore.set("selectedTimeslot", null), t;
|
|
181
184
|
}
|
|
@@ -194,57 +197,57 @@ class U {
|
|
|
194
197
|
return this.schedulerStore.set("cancelBookingId", ""), this.schedulerStore.set("cancelledEventInfo", null), e;
|
|
195
198
|
}
|
|
196
199
|
async bookTimeslot(e) {
|
|
197
|
-
var
|
|
200
|
+
var m;
|
|
198
201
|
this.schedulerStore.set("isLoading", !0);
|
|
199
202
|
const { selectedTimeslot: t, selectedTimezone: s, bookingInfo: i } = this.schedulerStore.state;
|
|
200
203
|
if (!e && !i)
|
|
201
|
-
return { error: this.errors.component("
|
|
202
|
-
const
|
|
203
|
-
if (!n)
|
|
204
|
-
return { error: this.errors.component("Create Booking").no_timeslot_selected() };
|
|
205
|
-
const r = e && (e != null && e.timezone) ? e == null ? void 0 : e.timezone : s;
|
|
204
|
+
return { error: this.errors.component(d.t("createBookingErrorTitle")).no_booking_info() };
|
|
205
|
+
const r = (e == null ? void 0 : e.timeslot) || t;
|
|
206
206
|
if (!r)
|
|
207
|
-
return { error: this.errors.component("
|
|
207
|
+
return { error: this.errors.component(d.t("createBookingErrorTitle")).no_timeslot_selected() };
|
|
208
|
+
const n = e && (e != null && e.timezone) ? e == null ? void 0 : e.timezone : s;
|
|
209
|
+
if (!n)
|
|
210
|
+
return { error: this.errors.component(d.t("createBookingErrorTitle")).no_timezone_selected() };
|
|
208
211
|
const o = this.schedulerStore.get("availabilityOrderEmails");
|
|
209
|
-
let
|
|
212
|
+
let u = "";
|
|
210
213
|
if (o.length > 0) {
|
|
211
|
-
const
|
|
214
|
+
const g = r.emails;
|
|
212
215
|
for (let c = 0; c < o.length; c++)
|
|
213
|
-
if (
|
|
214
|
-
|
|
216
|
+
if (g.includes(o[c])) {
|
|
217
|
+
u = o[c];
|
|
215
218
|
break;
|
|
216
219
|
}
|
|
217
220
|
}
|
|
218
|
-
const
|
|
219
|
-
participants:
|
|
220
|
-
additional_fields:
|
|
221
|
-
additional_guests:
|
|
222
|
-
guest: { ...
|
|
223
|
-
start_time:
|
|
224
|
-
end_time:
|
|
225
|
-
timezone:
|
|
226
|
-
}),
|
|
221
|
+
const _ = e ? e == null ? void 0 : e.primaryParticipant : i == null ? void 0 : i.primaryParticipant, h = e ? (e == null ? void 0 : e.guests) || [] : (i == null ? void 0 : i.guests) || [], y = e ? e == null ? void 0 : e.additionalFields : i == null ? void 0 : i.additionalFields, I = this.getHeaders(), S = `/v3/scheduling/bookings${!this.sessionId && this.configId ? `?configuration_id=${this.configId}` : ""}`, l = await this.makeAPIRequest(decodeURIComponent(S), "POST", JSON.stringify({
|
|
222
|
+
participants: u ? [{ email: u }] : void 0,
|
|
223
|
+
additional_fields: y,
|
|
224
|
+
additional_guests: h,
|
|
225
|
+
guest: { ..._ },
|
|
226
|
+
start_time: r.start_time.getTime() / 1e3,
|
|
227
|
+
end_time: r.end_time.getTime() / 1e3,
|
|
228
|
+
timezone: n
|
|
229
|
+
}), I);
|
|
227
230
|
if ("error" in l) {
|
|
228
231
|
this.schedulerStore.set("isLoading", !1);
|
|
229
|
-
const
|
|
232
|
+
const g = (m = l.error) == null ? void 0 : m.type;
|
|
230
233
|
let c = l.error;
|
|
231
|
-
if (
|
|
234
|
+
if (g && g in this.errors.api("Create Booking")) {
|
|
232
235
|
const w = this.getErrorMessage(c);
|
|
233
|
-
c = this.errors.api("Create Booking")[
|
|
236
|
+
c = this.errors.api("Create Booking")[g](w);
|
|
234
237
|
}
|
|
235
238
|
return { error: c };
|
|
236
239
|
}
|
|
237
240
|
return "data" in l && this.schedulerStore.set("eventInfo", l == null ? void 0 : l.data), this.schedulerStore.set("isLoading", !1), l;
|
|
238
241
|
}
|
|
239
242
|
async getUISettings() {
|
|
240
|
-
var
|
|
243
|
+
var r;
|
|
241
244
|
this.schedulerStore.set("isLoading", !0);
|
|
242
245
|
const e = this.getHeaders(), s = `/v3/scheduling/ui-settings${!this.sessionId && this.configId ? `?configuration_id=${this.configId}` : ""}`, i = await this.makeAPIRequest(s, "GET", void 0, e);
|
|
243
246
|
if ("error" in i) {
|
|
244
247
|
this.schedulerStore.set("isLoading", !1);
|
|
245
|
-
const
|
|
248
|
+
const n = (r = i.error) == null ? void 0 : r.type;
|
|
246
249
|
let o = i.error;
|
|
247
|
-
return
|
|
250
|
+
return n && n in this.errors.api(d.t("getUISettingErrorTitle")) && (o = this.errors.api(d.t("getUISettingErrorTitle"))[n]((o == null ? void 0 : o.message) || (o == null ? void 0 : o.title) || "Something went wrong")), { error: o };
|
|
248
251
|
}
|
|
249
252
|
return "data" in i && this.schedulerStore.set("configSettings", i.data), this.schedulerStore.set("isLoading", !1), i;
|
|
250
253
|
}
|
|
@@ -254,16 +257,16 @@ class U {
|
|
|
254
257
|
return s ? e + s * 60 : e;
|
|
255
258
|
}
|
|
256
259
|
getEndTimeForAvailableDaysInFuture(e) {
|
|
257
|
-
var
|
|
258
|
-
const t = /* @__PURE__ */ new Date(), s = (o = (
|
|
260
|
+
var n, o;
|
|
261
|
+
const t = /* @__PURE__ */ new Date(), s = (o = (n = this.schedulerStore.get("configSettings")) == null ? void 0 : n.scheduler) == null ? void 0 : o.available_days_in_future, i = Math.floor(F(t, s).getTime() / 1e3);
|
|
259
262
|
return Math.min(i, e);
|
|
260
263
|
}
|
|
261
264
|
async getAvailability(e = 0, t = 0) {
|
|
262
|
-
var
|
|
265
|
+
var y, I, f, S;
|
|
263
266
|
this.schedulerStore.set("isLoading", !0);
|
|
264
|
-
const s = new URLSearchParams(), i = /* @__PURE__ */ new Date(),
|
|
265
|
-
if (t && t <
|
|
266
|
-
return this.schedulerStore.set("isLoading", !1), { error: this.errors.component("
|
|
267
|
+
const s = new URLSearchParams(), i = /* @__PURE__ */ new Date(), r = i.getTime();
|
|
268
|
+
if (t && t < r / 1e3)
|
|
269
|
+
return this.schedulerStore.set("isLoading", !1), { error: this.errors.component(d.t("getAvailabilityErrorTitle")).endtime_not_in_future() };
|
|
267
270
|
if (!e) {
|
|
268
271
|
const l = new Date(i.getFullYear(), i.getMonth(), 1);
|
|
269
272
|
e = Math.floor(l.getTime() / 1e3);
|
|
@@ -273,110 +276,110 @@ class U {
|
|
|
273
276
|
t = Math.floor(l.getTime() / 1e3);
|
|
274
277
|
}
|
|
275
278
|
t = this.getEndTimeForAvailableDaysInFuture(t), s.append("start_time", encodeURIComponent(e.toString())), s.append("end_time", encodeURIComponent(t.toString())), this.configId && !this.sessionId && s.append("configuration_id", encodeURIComponent(this.configId));
|
|
276
|
-
const
|
|
277
|
-
|
|
278
|
-
const o = s.toString(),
|
|
279
|
-
if ("error" in
|
|
279
|
+
const n = this.schedulerStore.get("rescheduleBookingId");
|
|
280
|
+
n && s.append("booking_id", encodeURIComponent(n));
|
|
281
|
+
const o = s.toString(), u = `/v3/scheduling/availability${o ? `?${o}` : ""}`, _ = this.getHeaders(), h = await this.makeAPIRequest(decodeURIComponent(u), "GET", void 0, _);
|
|
282
|
+
if ("error" in h) {
|
|
280
283
|
this.schedulerStore.set("availability", []), this.schedulerStore.set("isLoading", !1);
|
|
281
|
-
const l = (
|
|
282
|
-
let
|
|
283
|
-
if (l && l in this.errors.api("
|
|
284
|
-
const
|
|
285
|
-
|
|
284
|
+
const l = (y = h.error) == null ? void 0 : y.type;
|
|
285
|
+
let m = h.error;
|
|
286
|
+
if (l && l in this.errors.api(d.t("getAvailabilityErrorTitle"))) {
|
|
287
|
+
const g = this.getErrorMessage(m);
|
|
288
|
+
m = this.errors.api(d.t("getAvailabilityErrorTitle"))[l](g);
|
|
286
289
|
}
|
|
287
|
-
return { error:
|
|
290
|
+
return { error: m };
|
|
288
291
|
}
|
|
289
|
-
if ("data" in
|
|
290
|
-
const
|
|
292
|
+
if ("data" in h) {
|
|
293
|
+
const m = (((f = (I = h.data) == null ? void 0 : I.time_slots) == null ? void 0 : f.map((c) => ({
|
|
291
294
|
...c,
|
|
292
295
|
start_time: new Date(c.start_time * 1e3),
|
|
293
296
|
end_time: new Date(c.end_time * 1e3)
|
|
294
|
-
}))) || []).filter((c) => c.start_time.getTime() >
|
|
295
|
-
this.schedulerStore.set("availability",
|
|
296
|
-
const
|
|
297
|
-
this.schedulerStore.set("availabilityOrderEmails",
|
|
297
|
+
}))) || []).filter((c) => c.start_time.getTime() > r);
|
|
298
|
+
this.schedulerStore.set("availability", m);
|
|
299
|
+
const g = ((S = h.data) == null ? void 0 : S.order) || [];
|
|
300
|
+
this.schedulerStore.set("availabilityOrderEmails", g);
|
|
298
301
|
}
|
|
299
|
-
return this.schedulerStore.set("isLoading", !1),
|
|
302
|
+
return this.schedulerStore.set("isLoading", !1), h;
|
|
300
303
|
}
|
|
301
304
|
async cancelBooking(e, t) {
|
|
302
305
|
var o;
|
|
303
306
|
if (this.schedulerStore.set("isLoading", !0), !e)
|
|
304
|
-
return { error: this.errors.component("
|
|
305
|
-
const s = !this.sessionId && this.configId ? `?configuration_id=${this.configId}` : "", i = `/v3/scheduling/bookings/${e}${s}`,
|
|
307
|
+
return { error: this.errors.component(d.t("cancelBookingErrorTitle")).no_booking_id() };
|
|
308
|
+
const s = !this.sessionId && this.configId ? `?configuration_id=${this.configId}` : "", i = `/v3/scheduling/bookings/${e}${s}`, r = this.getHeaders(), n = await this.makeAPIRequest(decodeURIComponent(i), "DELETE", JSON.stringify({
|
|
306
309
|
action: "cancel",
|
|
307
310
|
cancellation_reason: t
|
|
308
|
-
}),
|
|
309
|
-
if ("error" in
|
|
311
|
+
}), r);
|
|
312
|
+
if ("error" in n) {
|
|
310
313
|
this.schedulerStore.set("isLoading", !1);
|
|
311
|
-
const
|
|
312
|
-
let
|
|
313
|
-
if (
|
|
314
|
-
const
|
|
315
|
-
|
|
314
|
+
const u = (o = n.error) == null ? void 0 : o.type;
|
|
315
|
+
let _ = n.error;
|
|
316
|
+
if (u && u in this.errors.api(d.t("cancelBookingErrorTitle"))) {
|
|
317
|
+
const h = this.getErrorMessage(_);
|
|
318
|
+
_ = this.errors.api(d.t("cancelBookingErrorTitle"))[u](h);
|
|
316
319
|
}
|
|
317
|
-
return { error:
|
|
320
|
+
return { error: _ };
|
|
318
321
|
}
|
|
319
322
|
return this.schedulerStore.set("cancelledEventInfo", {
|
|
320
323
|
booking_id: e
|
|
321
|
-
}), this.schedulerStore.set("rescheduleBookingId", ""), this.schedulerStore.set("isLoading", !1),
|
|
324
|
+
}), this.schedulerStore.set("rescheduleBookingId", ""), this.schedulerStore.set("isLoading", !1), n;
|
|
322
325
|
}
|
|
323
326
|
async rescheduleBooking(e, t) {
|
|
324
|
-
var
|
|
327
|
+
var E;
|
|
325
328
|
if (this.schedulerStore.set("isLoading", !0), !e)
|
|
326
|
-
return { error: this.errors.component("
|
|
327
|
-
const s = this.errors.api("
|
|
328
|
-
if (!v)
|
|
329
|
-
return { error: i.invalid_start_time('Please pass "startTime" in data or set "selectedTimeslot" in the defaultSchedulerState.') };
|
|
330
|
-
const y = m || (r == null ? void 0 : r.end_time);
|
|
329
|
+
return { error: this.errors.component(d.t("rescheduleBookingErrorTitle")).no_booking_id() };
|
|
330
|
+
const s = this.errors.api(d.t("rescheduleBookingErrorTitle")), i = this.errors.component(d.t("rescheduleBookingErrorTitle")), { bookingInfo: r, selectedTimeslot: n, selectedTimezone: o } = this.schedulerStore.state, { startTime: u, endTime: _, timezone: h } = t, y = u || (n == null ? void 0 : n.start_time);
|
|
331
331
|
if (!y)
|
|
332
|
+
return { error: i.invalid_start_time('Please pass "startTime" in data or set "selectedTimeslot" in the defaultSchedulerState.') };
|
|
333
|
+
const I = _ || (n == null ? void 0 : n.end_time);
|
|
334
|
+
if (!I)
|
|
332
335
|
return { error: i.invalid_end_time('Please pass "endTime" in data or set "selectedTimeslot" in the defaultSchedulerState.') };
|
|
333
|
-
const
|
|
334
|
-
let
|
|
335
|
-
if (
|
|
336
|
-
const
|
|
337
|
-
for (let
|
|
338
|
-
if (
|
|
339
|
-
|
|
336
|
+
const f = this.schedulerStore.get("availabilityOrderEmails");
|
|
337
|
+
let S = "";
|
|
338
|
+
if (f.length > 0) {
|
|
339
|
+
const T = (n == null ? void 0 : n.emails) || [];
|
|
340
|
+
for (let v = 0; v < f.length; v++)
|
|
341
|
+
if (T.includes(f[v])) {
|
|
342
|
+
S = f[v];
|
|
340
343
|
break;
|
|
341
344
|
}
|
|
342
345
|
}
|
|
343
|
-
const l =
|
|
346
|
+
const l = h || o;
|
|
344
347
|
if (!l)
|
|
345
348
|
return { error: i.invalid_timezone('Please pass "timezone" in data or set "selectedTimezone" in the defaultSchedulerState.') };
|
|
346
|
-
const
|
|
347
|
-
start_time:
|
|
348
|
-
end_time:
|
|
349
|
+
const m = t ? t == null ? void 0 : t.primaryParticipant : r == null ? void 0 : r.primaryParticipant, g = t ? (t == null ? void 0 : t.guests) || [] : (r == null ? void 0 : r.guests) || [], c = t ? t == null ? void 0 : t.additionalFields : r == null ? void 0 : r.additionalFields, w = !this.sessionId && this.configId ? `?configuration_id=${this.configId}` : "", B = `/v3/scheduling/bookings/${e}${w}`, P = this.getHeaders(), p = await this.makeAPIRequest(decodeURIComponent(B), "PATCH", JSON.stringify({
|
|
350
|
+
start_time: y.getTime() / 1e3,
|
|
351
|
+
end_time: I.getTime() / 1e3,
|
|
349
352
|
time_zone: l,
|
|
350
353
|
additional_fields: c,
|
|
351
|
-
guest: { ...
|
|
352
|
-
additional_guests:
|
|
353
|
-
participants:
|
|
354
|
-
}),
|
|
355
|
-
if ("error" in
|
|
354
|
+
guest: { ...m },
|
|
355
|
+
additional_guests: g,
|
|
356
|
+
participants: S ? [{ email: S }] : void 0
|
|
357
|
+
}), P);
|
|
358
|
+
if ("error" in p) {
|
|
356
359
|
this.schedulerStore.set("isLoading", !1);
|
|
357
|
-
const
|
|
358
|
-
let
|
|
359
|
-
if (
|
|
360
|
-
const M = this.getErrorMessage(
|
|
361
|
-
|
|
360
|
+
const T = (E = p.error) == null ? void 0 : E.type;
|
|
361
|
+
let v = p.error;
|
|
362
|
+
if (T && T in s) {
|
|
363
|
+
const M = this.getErrorMessage(v);
|
|
364
|
+
v = s[T](M);
|
|
362
365
|
}
|
|
363
|
-
return { error:
|
|
366
|
+
return { error: v };
|
|
364
367
|
}
|
|
365
|
-
const
|
|
366
|
-
if ("data" in
|
|
367
|
-
this.schedulerStore.set("eventInfo",
|
|
368
|
-
else if (
|
|
369
|
-
this.schedulerStore.set("eventInfo",
|
|
368
|
+
const D = this.schedulerStore.get("reschedulingEventInfo");
|
|
369
|
+
if ("data" in p)
|
|
370
|
+
this.schedulerStore.set("eventInfo", p == null ? void 0 : p.data);
|
|
371
|
+
else if (D)
|
|
372
|
+
this.schedulerStore.set("eventInfo", D);
|
|
370
373
|
else {
|
|
371
|
-
const
|
|
374
|
+
const T = {
|
|
372
375
|
booking_id: e
|
|
373
376
|
};
|
|
374
|
-
this.schedulerStore.set("eventInfo",
|
|
377
|
+
this.schedulerStore.set("eventInfo", T);
|
|
375
378
|
}
|
|
376
|
-
return this.schedulerStore.set("isLoading", !1),
|
|
379
|
+
return this.schedulerStore.set("isLoading", !1), p;
|
|
377
380
|
}
|
|
378
381
|
}
|
|
379
|
-
function
|
|
382
|
+
function N(a = {}) {
|
|
380
383
|
const e = {
|
|
381
384
|
selectedDate: null,
|
|
382
385
|
selectedLanguage: navigator.language,
|
|
@@ -400,11 +403,11 @@ function E(a = {}) {
|
|
|
400
403
|
b("[availability]: ", s);
|
|
401
404
|
const i = s.map((o) => o.start_time);
|
|
402
405
|
b("[selectableDates]: ", i), t.set("selectableDates", i);
|
|
403
|
-
const
|
|
404
|
-
if (!
|
|
406
|
+
const r = s[0];
|
|
407
|
+
if (!r)
|
|
405
408
|
return;
|
|
406
|
-
const
|
|
407
|
-
b("[durationMinutes]: ",
|
|
409
|
+
const n = Math.floor((r.end_time.getTime() - r.start_time.getTime()) / 6e4);
|
|
410
|
+
b("[durationMinutes]: ", n), t.set("eventDuration", n);
|
|
408
411
|
}), t.reset = () => {
|
|
409
412
|
for (const s in e) {
|
|
410
413
|
const i = e[s];
|
|
@@ -413,7 +416,7 @@ function E(a = {}) {
|
|
|
413
416
|
}, t;
|
|
414
417
|
}
|
|
415
418
|
export {
|
|
416
|
-
|
|
419
|
+
N as C,
|
|
417
420
|
k as E,
|
|
418
|
-
|
|
421
|
+
C as N
|
|
419
422
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const c=require("./index-db48e0b6.cjs");exports.ErrorCategory=void 0;(function(a){a.Component="component",a.Api="api",a.Auth="auth"})(exports.ErrorCategory||(exports.ErrorCategory={}));var D;(function(a){a.endtime_not_in_future="endtime_not_in_future",a.no_booking_info="no_booking_info",a.no_timeslot_selected="no_timeslot_selected",a.no_timezone_selected="no_timezone_selected",a.no_booking_id="no_booking_id",a.invalid_start_time="invalid_start_time",a.invalid_end_time="invalid_end_time",a.invalid_timezone="invalid_timezone"})(D||(D={}));var E;(function(a){a.invalid_session="invalid_session",a.general_error="general_error",a.internal_error="internal_error",a.invalid_request_error="invalid_request_error",a.timeslot_not_available="timeslot_not_available",a.provider_error="provider_error",a.not_found_error="not_found_error"})(E||(E={}));class P{constructor(){this.component=e=>{const t=exports.ErrorCategory.Component,s=`${e} Error`;return{endtime_not_in_future:(i='"endtime" can not be in the future')=>({title:s,message:i,category:t}),no_booking_info:(i="No booking info provided")=>({title:s,message:i,category:t}),no_timeslot_selected:(i="No timeslot selected")=>({title:s,message:i,category:t}),no_timezone_selected:(i="No timezone selected")=>({title:s,message:i,category:t}),no_booking_id:(i="No booking id provided")=>({title:s,message:i,category:t}),invalid_start_time:(i="Invalid start time")=>({title:s,message:i,category:t}),invalid_end_time:(i="Invalid end time")=>({title:s,message:i,category:t}),invalid_timezone:(i="Invalid timezone")=>({title:s,message:i,category:t})}},this.api=e=>{const t=exports.ErrorCategory.Api,s=`${e} Error`;return{invalid_session:i=>({title:s,message:i,category:t}),general_error:i=>({title:s,message:i,category:t}),internal_error:i=>({title:s,message:i,category:t}),invalid_request_error:i=>({title:s,message:i,category:t}),timeslot_not_available:i=>({title:s,message:i,category:t}),provider_error:i=>({title:s,message:i,category:t}),not_found_error:i=>({title:s,message:i,category:t})}}}}class M{constructor({schedulerAPIURL:e,schedulerStore:t,sessionId:s,configId:i}){this.errors=new P,this.schedulerStore=t,this.schedulerAPIURL=e,this.sessionId=s,this.configId=i}getHeaders(){return this.sessionId?{Authorization:`Bearer ${this.sessionId}`}:{}}async makeAPIRequest(e,t,s,i={}){try{const r=new URL(this.schedulerAPIURL);return r.pathname=e,await(await fetch(decodeURIComponent(r.toString()),{method:t,headers:{"Content-Type":"application/json",Origin:window.location.origin,...i},body:s})).json()}catch(r){return{error:{message:r.message,title:"API request failed",type:"api"}}}}getErrorMessage(e){var s,i,r,n;let t=(e==null?void 0:e.message)||(e==null?void 0:e.title)||"Something went wrong";return(e==null?void 0:e.type)==="provider_error"&&(t=((i=(s=e==null?void 0:e.provider_error)==null?void 0:s.error)==null?void 0:i.message)||((n=(r=e==null?void 0:e.provider_error)==null?void 0:r.error)==null?void 0:n.title)||"Something went wrong"),t}setConfigId(e){this.configId=e}selectDate(e){this.schedulerStore.set("selectedDate",e),this.schedulerStore.set("selectedTimeslot",null)}selectTime(e){this.schedulerStore.set("selectedTimeslot",e)}selectTimezone(e){this.schedulerStore.set("selectedTimezone",e)}selectLanguage(e){this.schedulerStore.set("selectedLanguage",e),c.instance.changeLanguage(e)}async toggleAdditionalData(e){e||await this.refetchAvailability(),this.schedulerStore.set("showBookingForm",e)}setParticipantName(e){const{bookingInfo:t}=this.schedulerStore.state;this.schedulerStore.set("bookingInfo",{...t,primaryParticipant:{...t==null?void 0:t.primaryParticipant,name:e}})}setParticipantEmail(e){const{bookingInfo:t}=this.schedulerStore.state;this.schedulerStore.set("bookingInfo",{...t,primaryParticipant:{...t==null?void 0:t.primaryParticipant,email:e}})}async refetchAvailability(){const e=new Date,t=new Date(e.getFullYear(),e.getMonth(),1).getTime()/1e3,s=t<e.getTime()/1e3?Math.floor(e.getTime()/1e3):t,i=new Date(e.getFullYear(),e.getMonth()+1,1).getTime()/1e3;return await this.getAvailability(s,i)}async resetStoreStateAndFetchAvailability(){const e=new Date,t=await this.refetchAvailability(),s=this.schedulerStore.get("availability").find(r=>new Date(r.start_time)>new Date);let i=e;return s&&(i=s.start_time),this.schedulerStore.set("selectedDate",i),this.schedulerStore.set("eventInfo",null),this.schedulerStore.set("showBookingForm",!1),this.schedulerStore.set("selectedTimeslot",null),t}async setReschedule(e){this.schedulerStore.set("isLoading",!0);const t=this.schedulerStore.state.eventInfo;return t&&this.schedulerStore.set("reschedulingEventInfo",t),this.schedulerStore.set("rescheduleBookingId",e),await this.resetStoreStateAndFetchAvailability().finally(()=>{this.schedulerStore.set("isLoading",!1)})}async setCancel(e){this.schedulerStore.set("cancelBookingId",e)}async resetCancel(){const e=await this.resetStoreStateAndFetchAvailability();return this.schedulerStore.set("cancelBookingId",""),this.schedulerStore.set("cancelledEventInfo",null),e}async bookTimeslot(e){var m;this.schedulerStore.set("isLoading",!0);const{selectedTimeslot:t,selectedTimezone:s,bookingInfo:i}=this.schedulerStore.state;if(!e&&!i)return{error:this.errors.component(c.instance.t("createBookingErrorTitle")).no_booking_info()};const r=(e==null?void 0:e.timeslot)||t;if(!r)return{error:this.errors.component(c.instance.t("createBookingErrorTitle")).no_timeslot_selected()};const n=e&&(e!=null&&e.timezone)?e==null?void 0:e.timezone:s;if(!n)return{error:this.errors.component(c.instance.t("createBookingErrorTitle")).no_timezone_selected()};const o=this.schedulerStore.get("availabilityOrderEmails");let u="";if(o.length>0){const g=r.emails;for(let d=0;d<o.length;d++)if(g.includes(o[d])){u=o[d];break}}const _=e?e==null?void 0:e.primaryParticipant:i==null?void 0:i.primaryParticipant,h=e?(e==null?void 0:e.guests)||[]:(i==null?void 0:i.guests)||[],y=e?e==null?void 0:e.additionalFields:i==null?void 0:i.additionalFields,I=this.getHeaders(),S=`/v3/scheduling/bookings${!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:""}`,l=await this.makeAPIRequest(decodeURIComponent(S),"POST",JSON.stringify({participants:u?[{email:u}]:void 0,additional_fields:y,additional_guests:h,guest:{..._},start_time:r.start_time.getTime()/1e3,end_time:r.end_time.getTime()/1e3,timezone:n}),I);if("error"in l){this.schedulerStore.set("isLoading",!1);const g=(m=l.error)==null?void 0:m.type;let d=l.error;if(g&&g in this.errors.api("Create Booking")){const T=this.getErrorMessage(d);d=this.errors.api("Create Booking")[g](T)}return{error:d}}return"data"in l&&this.schedulerStore.set("eventInfo",l==null?void 0:l.data),this.schedulerStore.set("isLoading",!1),l}async getUISettings(){var r;this.schedulerStore.set("isLoading",!0);const e=this.getHeaders(),s=`/v3/scheduling/ui-settings${!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:""}`,i=await this.makeAPIRequest(s,"GET",void 0,e);if("error"in i){this.schedulerStore.set("isLoading",!1);const n=(r=i.error)==null?void 0:r.type;let o=i.error;return n&&n in this.errors.api(c.instance.t("getUISettingErrorTitle"))&&(o=this.errors.api(c.instance.t("getUISettingErrorTitle"))[n]((o==null?void 0:o.message)||(o==null?void 0:o.title)||"Something went wrong")),{error:o}}return"data"in i&&this.schedulerStore.set("configSettings",i.data),this.schedulerStore.set("isLoading",!1),i}getStartTimeWithMinBookingNotice(e){var i;const t=(i=this.schedulerStore.get("configSettings"))==null?void 0:i.scheduler,s=t==null?void 0:t.min_booking_notice;return s?e+s*60:e}getEndTimeForAvailableDaysInFuture(e){var n,o;const t=new Date,s=(o=(n=this.schedulerStore.get("configSettings"))==null?void 0:n.scheduler)==null?void 0:o.available_days_in_future,i=Math.floor(c.addDaysToCurrentDate(t,s).getTime()/1e3);return Math.min(i,e)}async getAvailability(e=0,t=0){var y,I,f,S;this.schedulerStore.set("isLoading",!0);const s=new URLSearchParams,i=new Date,r=i.getTime();if(t&&t<r/1e3)return this.schedulerStore.set("isLoading",!1),{error:this.errors.component(c.instance.t("getAvailabilityErrorTitle")).endtime_not_in_future()};if(!e){const l=new Date(i.getFullYear(),i.getMonth(),1);e=Math.floor(l.getTime()/1e3)}if(e=this.getStartTimeWithMinBookingNotice(e),!t){const l=new Date(i.getFullYear(),i.getMonth()+1,0);t=Math.floor(l.getTime()/1e3)}t=this.getEndTimeForAvailableDaysInFuture(t),s.append("start_time",encodeURIComponent(e.toString())),s.append("end_time",encodeURIComponent(t.toString())),this.configId&&!this.sessionId&&s.append("configuration_id",encodeURIComponent(this.configId));const n=this.schedulerStore.get("rescheduleBookingId");n&&s.append("booking_id",encodeURIComponent(n));const o=s.toString(),u=`/v3/scheduling/availability${o?`?${o}`:""}`,_=this.getHeaders(),h=await this.makeAPIRequest(decodeURIComponent(u),"GET",void 0,_);if("error"in h){this.schedulerStore.set("availability",[]),this.schedulerStore.set("isLoading",!1);const l=(y=h.error)==null?void 0:y.type;let m=h.error;if(l&&l in this.errors.api(c.instance.t("getAvailabilityErrorTitle"))){const g=this.getErrorMessage(m);m=this.errors.api(c.instance.t("getAvailabilityErrorTitle"))[l](g)}return{error:m}}if("data"in h){const m=(((f=(I=h.data)==null?void 0:I.time_slots)==null?void 0:f.map(d=>({...d,start_time:new Date(d.start_time*1e3),end_time:new Date(d.end_time*1e3)})))||[]).filter(d=>d.start_time.getTime()>r);this.schedulerStore.set("availability",m);const g=((S=h.data)==null?void 0:S.order)||[];this.schedulerStore.set("availabilityOrderEmails",g)}return this.schedulerStore.set("isLoading",!1),h}async cancelBooking(e,t){var o;if(this.schedulerStore.set("isLoading",!0),!e)return{error:this.errors.component(c.instance.t("cancelBookingErrorTitle")).no_booking_id()};const s=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:"",i=`/v3/scheduling/bookings/${e}${s}`,r=this.getHeaders(),n=await this.makeAPIRequest(decodeURIComponent(i),"DELETE",JSON.stringify({action:"cancel",cancellation_reason:t}),r);if("error"in n){this.schedulerStore.set("isLoading",!1);const u=(o=n.error)==null?void 0:o.type;let _=n.error;if(u&&u in this.errors.api(c.instance.t("cancelBookingErrorTitle"))){const h=this.getErrorMessage(_);_=this.errors.api(c.instance.t("cancelBookingErrorTitle"))[u](h)}return{error:_}}return this.schedulerStore.set("cancelledEventInfo",{booking_id:e}),this.schedulerStore.set("rescheduleBookingId",""),this.schedulerStore.set("isLoading",!1),n}async rescheduleBooking(e,t){var w;if(this.schedulerStore.set("isLoading",!0),!e)return{error:this.errors.component(c.instance.t("rescheduleBookingErrorTitle")).no_booking_id()};const s=this.errors.api(c.instance.t("rescheduleBookingErrorTitle")),i=this.errors.component(c.instance.t("rescheduleBookingErrorTitle")),{bookingInfo:r,selectedTimeslot:n,selectedTimezone:o}=this.schedulerStore.state,{startTime:u,endTime:_,timezone:h}=t,y=u||(n==null?void 0:n.start_time);if(!y)return{error:i.invalid_start_time('Please pass "startTime" in data or set "selectedTimeslot" in the defaultSchedulerState.')};const I=_||(n==null?void 0:n.end_time);if(!I)return{error:i.invalid_end_time('Please pass "endTime" in data or set "selectedTimeslot" in the defaultSchedulerState.')};const f=this.schedulerStore.get("availabilityOrderEmails");let S="";if(f.length>0){const b=(n==null?void 0:n.emails)||[];for(let v=0;v<f.length;v++)if(b.includes(f[v])){S=f[v];break}}const l=h||o;if(!l)return{error:i.invalid_timezone('Please pass "timezone" in data or set "selectedTimezone" in the defaultSchedulerState.')};const m=t?t==null?void 0:t.primaryParticipant:r==null?void 0:r.primaryParticipant,g=t?(t==null?void 0:t.guests)||[]:(r==null?void 0:r.guests)||[],d=t?t==null?void 0:t.additionalFields:r==null?void 0:r.additionalFields,T=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:"",A=`/v3/scheduling/bookings/${e}${T}`,L=this.getHeaders(),p=await this.makeAPIRequest(decodeURIComponent(A),"PATCH",JSON.stringify({start_time:y.getTime()/1e3,end_time:I.getTime()/1e3,time_zone:l,additional_fields:d,guest:{...m},additional_guests:g,participants:S?[{email:S}]:void 0}),L);if("error"in p){this.schedulerStore.set("isLoading",!1);const b=(w=p.error)==null?void 0:w.type;let v=p.error;if(b&&b in s){const B=this.getErrorMessage(v);v=s[b](B)}return{error:v}}const k=this.schedulerStore.get("reschedulingEventInfo");if("data"in p)this.schedulerStore.set("eventInfo",p==null?void 0:p.data);else if(k)this.schedulerStore.set("eventInfo",k);else{const b={booking_id:e};this.schedulerStore.set("eventInfo",b)}return this.schedulerStore.set("isLoading",!1),p}}function z(a={}){const e={selectedDate:null,selectedLanguage:navigator.language,selectedTimezone:Intl.DateTimeFormat().resolvedOptions().timeZone,selectedTimeslot:null,showBookingForm:!1,availabilityOrderEmails:[],selectableDates:null,availability:[],eventDuration:0,state:"ready",eventInfo:null,cancelledEventInfo:null,isLoading:!1,nylasBranding:!0,...a};c.debug("[defaultNylasStoreState]: ",e);const t=c.createStore(e);return t.onChange("availability",s=>{c.debug("[availability]: ",s);const i=s.map(o=>o.start_time);c.debug("[selectableDates]: ",i),t.set("selectableDates",i);const r=s[0];if(!r)return;const n=Math.floor((r.end_time.getTime()-r.start_time.getTime())/6e4);c.debug("[durationMinutes]: ",n),t.set("eventDuration",n)}),t.reset=()=>{for(const s in e){const i=e[s];t.set(s,i)}},t}exports.CreateNylasSchedulerStore=z;exports.NylaSchedulerAPIConnector=M;
|
package/dist/{textarea-component.entry-48feabb3.cjs → textarea-component.entry-be870b8f.cjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-db48e0b6.cjs"),r=require("./index-6d9eeb53-15c69801.cjs");require("./index-53420959-82a5306f.cjs");require("react");require("react-dom");const l=':host{display:block;--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-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;width:100%}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%;flex-direction:column;gap:4px;font-family:var(--nylas-font-family);font-size:16px;color:var(--nylas-base-800)}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}label p{margin:0}label .error{color:var(--nylas-error)}textarea{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%;padding:12px 16px;border-width:1;resize:vertical;border-radius:8px;font-family:var(--nylas-font-family);font-size:16px;line-height:24px}textarea:focus{outline-color:var(--nylas-primary)}textarea.error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}textarea.error::placeholder{font-weight:400}textarea::placeholder{color:var(--nylas-base-300)}textarea::-webkit-resizer{display:none}',n=l,t=class{constructor(e){a.registerInstance(this,e),this.nylasFormInputChanged=a.createEvent(this,"nylasFormInputChanged",7),this.name="textarea",this.defaultValue="",this.label="",this.placeholder="",this.required=!1,this.readOnly=!1,this.autoFocus=!1,this.maxLength=255,this.type="multi_line_text",this.value="",this.error=""}componentWillLoad(){this.value=r.sanitizeHtml$1(this.defaultValue)}handleBookingFormSubmitted(e){this.validate(this.value),this.error&&e.preventDefault()}handleInput(e){const s=e.target;this.value=r.sanitizeHtml$1(s.value),this.nylasFormInputChanged.emit({value:this.value,name:this.name,error:this.error,label:this.label,type:this.type})}validate(e){this.required&&!e?this.error=`${this.label} is required.`:e.length>this.maxLength?this.error=`${this.label} cannot exceed ${this.maxLength} characters.`:this.error=""}render(){return a.h("label",{key:"c4613e2747b6ef5345a0c83ad10c1708b39a40f5",part:"tc__label",class:{error:!!this.error}},a.h("p",{key:"c59a2f5b0f2ebf9f995bc9583c36cca7efe44364"},a.h("span",{key:"9a3eb4aa71ad8f8d71ee644e3c4c137e6f1b4bb0",class:"label"},this.label),this.required&&a.h("span",{class:"required"},"*")),a.h("textarea",{key:"d3536d83d71282935863a947fc3dd0ced53e0e0b",name:this.name,placeholder:this.placeholder,readOnly:this.readOnly,autoFocus:this.autoFocus,value:this.value,maxLength:this.maxLength,onInput:e=>this.handleInput(e),class:{error:!!this.error},part:"tc__textarea"}),this.error&&a.h("span",{class:"error help-text"},this.error))}};t.style=n;exports.textarea_component=t;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as t, c as l, h as a } from "./index-
|
|
2
|
-
import { s as r } from "./index-6d9eeb53-
|
|
3
|
-
import "./index-53420959-
|
|
1
|
+
import { r as t, c as l, h as a } from "./index-f8317a8e.js";
|
|
2
|
+
import { s as r } from "./index-6d9eeb53-c70fc8a7.js";
|
|
3
|
+
import "./index-53420959-9b1699ec.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "react-dom";
|
|
6
6
|
const n = ':host{display:block;--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-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;width:100%}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%;flex-direction:column;gap:4px;font-family:var(--nylas-font-family);font-size:16px;color:var(--nylas-base-800)}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}label p{margin:0}label .error{color:var(--nylas-error)}textarea{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%;padding:12px 16px;border-width:1;resize:vertical;border-radius:8px;font-family:var(--nylas-font-family);font-size:16px;line-height:24px}textarea:focus{outline-color:var(--nylas-primary)}textarea.error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}textarea.error::placeholder{font-weight:400}textarea::placeholder{color:var(--nylas-base-300)}textarea::-webkit-resizer{display:none}', i = n, o = class {
|
|
@@ -27,7 +27,7 @@ const n = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--n
|
|
|
27
27
|
this.required && !e ? this.error = `${this.label} is required.` : e.length > this.maxLength ? this.error = `${this.label} cannot exceed ${this.maxLength} characters.` : this.error = "";
|
|
28
28
|
}
|
|
29
29
|
render() {
|
|
30
|
-
return a("label", { key: "
|
|
30
|
+
return a("label", { key: "c4613e2747b6ef5345a0c83ad10c1708b39a40f5", part: "tc__label", class: { error: !!this.error } }, a("p", { key: "c59a2f5b0f2ebf9f995bc9583c36cca7efe44364" }, a("span", { key: "9a3eb4aa71ad8f8d71ee644e3c4c137e6f1b4bb0", class: "label" }, this.label), this.required && a("span", { class: "required" }, "*")), a("textarea", { key: "d3536d83d71282935863a947fc3dd0ced53e0e0b", name: this.name, placeholder: this.placeholder, readOnly: this.readOnly, autoFocus: this.autoFocus, value: this.value, maxLength: this.maxLength, onInput: (e) => this.handleInput(e), class: { error: !!this.error }, part: "tc__textarea" }), this.error && a("span", { class: "error help-text" }, this.error));
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
o.style = i;
|