@nylas/react 1.0.2-prealpha1 → 1.1.0-canary.3
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_22.entry-8d0ac489.cjs +1 -0
- package/dist/add-circle-icon_22.entry-da31fa71.js +1733 -0
- package/dist/{archive-icon_7.entry-84d70dbf.cjs → archive-icon_7.entry-7aad8104.cjs} +1 -1
- package/dist/{archive-icon_7.entry-91aaa1aa.js → archive-icon_7.entry-bc2418f7.js} +20 -20
- package/dist/{arrow-icon.entry-400a08fa.cjs → arrow-icon.entry-6eba68a9.cjs} +1 -1
- package/dist/arrow-icon.entry-9a932082.js +15 -0
- package/dist/{bold-icon_3.entry-4b2798a8.js → bold-icon_3.entry-5f7e3755.js} +4 -4
- package/dist/{bold-icon_3.entry-9ad35153.cjs → bold-icon_3.entry-db17d481.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-83ba884a.js → calendar-cancel-icon.entry-1ff7845a.js} +4 -4
- package/dist/{calendar-cancel-icon.entry-fcb66929.cjs → calendar-cancel-icon.entry-a5141f82.cjs} +1 -1
- package/dist/calendar-check-icon_2.entry-c3add652.cjs +1 -0
- package/dist/calendar-check-icon_2.entry-d7421059.js +25 -0
- package/dist/{calendar-icon.entry-8f38af4a.js → calendar-icon.entry-4458997f.js} +2 -2
- package/dist/{calendar-icon.entry-7bae38d7.cjs → calendar-icon.entry-445d624a.cjs} +1 -1
- package/dist/chevron-icon_3.entry-8961e6bb.cjs +1 -0
- package/dist/chevron-icon_3.entry-f7f3d487.js +117 -0
- package/dist/close-icon.entry-6dd5ff0a.js +15 -0
- package/dist/close-icon.entry-ebc527c5.cjs +1 -0
- package/dist/{nylas-booked-event-card_10.entry-7e66a648.js → constants-6ee60d6d-4cd16450.js} +1656 -2374
- package/dist/{nylas-booked-event-card_10.entry-ed515326.cjs → constants-6ee60d6d-6c0540db.cjs} +6 -6
- package/dist/document-refresh-icon.entry-298b2133.cjs +1 -0
- package/dist/document-refresh-icon.entry-bdc323b5.js +15 -0
- package/dist/elements/index.d.ts +31 -2
- package/dist/{forward-icon_6.entry-3345af84.cjs → forward-icon_6.entry-15208ea9.cjs} +3 -3
- package/dist/{forward-icon_6.entry-b60fcb35.js → forward-icon_6.entry-62759373.js} +127 -127
- package/dist/{globe-icon.entry-e3fd373f.js → globe-icon.entry-9e082178.js} +4 -4
- package/dist/{globe-icon.entry-8325e73e.cjs → globe-icon.entry-c8302bf5.cjs} +1 -1
- package/dist/google-logo-icon_3.entry-0c095209.js +258 -0
- package/dist/google-logo-icon_3.entry-f8433ff9.cjs +1 -0
- package/dist/index-0f3bd8df.js +1824 -0
- package/dist/index-7a55dc33.cjs +30 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.es-2578c6a5-098d48d0.cjs +7 -0
- package/dist/{index-b30d446a-a90f84b2.js → index.es-2578c6a5-71441142.js} +833 -933
- package/dist/info-icon_2.entry-73106882.js +34 -0
- package/dist/info-icon_2.entry-ca224a3b.cjs +1 -0
- package/dist/{loading-icon.entry-27410cf8.js → loading-icon.entry-012644b7.js} +4 -4
- package/dist/{loading-icon.entry-b2096d2b.cjs → loading-icon.entry-f9f5e66f.cjs} +1 -1
- package/dist/mailbox-store-bb21512c-045c3ea0.cjs +1 -0
- package/dist/{mailbox-store-19f0c6c9-e3e8b4e5.js → mailbox-store-bb21512c-615660ef.js} +17 -16
- package/dist/nylas-additional-participants.entry-a50ef8e2.cjs +1 -0
- package/dist/nylas-additional-participants.entry-db85836a.js +83 -0
- package/dist/nylas-booked-event-card_10.entry-b49b2369.js +784 -0
- package/dist/nylas-booked-event-card_10.entry-fccb783c.cjs +1 -0
- package/dist/nylas-form-card.entry-090a4d3b.js +56 -0
- package/dist/nylas-form-card.entry-f5230005.cjs +1 -0
- package/dist/nylas-if-state.entry-7924dde0.js +96 -0
- package/dist/nylas-if-state.entry-ff9c9a85.cjs +1 -0
- package/dist/{nylas-list-folders.entry-a5437201.js → nylas-list-folders.entry-9dd96530.js} +9 -8
- package/dist/nylas-list-folders.entry-dbfc2cf8.cjs +1 -0
- package/dist/nylas-list-threads.entry-6bcc0328.cjs +1 -0
- package/dist/{nylas-list-threads.entry-fd6cda61.js → nylas-list-threads.entry-b435eaae.js} +5 -4
- package/dist/nylas-login.entry-1623d309.cjs +1 -0
- package/dist/nylas-login.entry-97350c76.js +75 -0
- package/dist/nylas-mailbox-pagination.entry-1776eb16.cjs +1 -0
- package/dist/{nylas-mailbox-pagination.entry-988214bc.js → nylas-mailbox-pagination.entry-ceef8be2.js} +4 -3
- package/dist/nylas-mailbox-toolbar-button.entry-7d3f79b9.cjs +1 -0
- package/dist/{nylas-mailbox-toolbar-button.entry-c720e22a.js → nylas-mailbox-toolbar-button.entry-e6b3d3a4.js} +11 -10
- package/dist/nylas-mailbox.entry-06d8014a.js +136 -0
- package/dist/nylas-mailbox.entry-ae8da6ff.cjs +1 -0
- package/dist/{nylas-provider.entry-70721009.js → nylas-provider.entry-8b9c2b69.js} +46 -33
- package/dist/nylas-provider.entry-97c9e272.cjs +1 -0
- package/dist/nylas-scheduler-editor.entry-c3791787.js +2181 -0
- package/dist/nylas-scheduler-editor.entry-f6cf1cd9.cjs +7 -0
- package/dist/nylas-scheduling.entry-08ae840a.cjs +1 -0
- package/dist/nylas-scheduling.entry-6380509a.js +237 -0
- package/dist/nylas-threads-refresh.entry-246e6d77.cjs +1 -0
- package/dist/{nylas-threads-refresh.entry-b7f9e93f.js → nylas-threads-refresh.entry-eaee86fb.js} +6 -5
- package/dist/nylas-threads-search.entry-42a2acb1.cjs +1 -0
- package/dist/{nylas-threads-search.entry-95afea9c.js → nylas-threads-search.entry-7e12758e.js} +15 -14
- package/dist/nylas-view-thread.entry-78e6927a.cjs +1 -0
- package/dist/{nylas-view-thread.entry-165173b1.js → nylas-view-thread.entry-b936e76a.js} +5 -4
- package/dist/people-icon.entry-5c8ee696.js +15 -0
- package/dist/people-icon.entry-bcf848c0.cjs +1 -0
- package/dist/play-icon_2.entry-356e63cc.js +25 -0
- package/dist/play-icon_2.entry-92e78f1b.cjs +1 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +92 -61
- package/dist/{refresh-icon.entry-e48a338f.js → refresh-icon.entry-77f0c377.js} +2 -2
- package/dist/{refresh-icon.entry-601cac89.cjs → refresh-icon.entry-bec053b6.cjs} +1 -1
- package/dist/{register-component-152c6ad2-a06f58c2.js → register-component-dc659dc3-0fdb18dc.js} +2 -2
- package/dist/{register-component-152c6ad2-0df7215b.cjs → register-component-dc659dc3-f58bf25b.cjs} +1 -1
- package/dist/scheduler-config-store-51ee4f42-ce3a9b0e.cjs +1 -0
- package/dist/scheduler-config-store-51ee4f42-e02895da.js +14 -0
- package/dist/{scheduler-store-7d48e682-0c0c3991.js → scheduler-store-72116723-3ba2480c.js} +100 -95
- package/dist/scheduler-store-72116723-db9d91f6.cjs +1 -0
- package/dist/time-period-selector.entry-decd251b.js +78 -0
- package/dist/time-period-selector.entry-f25fad77.cjs +1 -0
- package/dist/translate-icon.entry-cac02c46.js +15 -0
- package/dist/translate-icon.entry-dd5b707c.cjs +1 -0
- package/dist/utils-c00bdc3c-89ab163d.js +2111 -0
- package/dist/utils-c00bdc3c-94b9c3b6.cjs +8 -0
- package/dist/warning-icon.entry-370b9cf0.js +15 -0
- package/dist/warning-icon.entry-8af8a742.cjs +1 -0
- package/package.json +7 -4
- package/dist/add-circle-icon.entry-2ccb238b.cjs +0 -1
- package/dist/add-circle-icon.entry-35d6aa07.js +0 -15
- package/dist/arrow-icon.entry-8b2e96a6.js +0 -15
- package/dist/calendar-check-icon_3.entry-903e2d82.js +0 -35
- package/dist/calendar-check-icon_3.entry-a16ce05e.cjs +0 -1
- package/dist/chevron-icon.entry-58366662.cjs +0 -1
- package/dist/chevron-icon.entry-5e11cef5.js +0 -15
- package/dist/close-icon_2.entry-011d9cf4.js +0 -25
- package/dist/close-icon_2.entry-83088b9a.cjs +0 -1
- package/dist/document-refresh-icon.entry-071ffd66.cjs +0 -1
- package/dist/document-refresh-icon.entry-9083a2e9.js +0 -15
- package/dist/duration-bddc4a13-05d3e3e2.cjs +0 -1
- package/dist/duration-bddc4a13-179ce826.js +0 -41
- package/dist/index-3b6f5cd5.cjs +0 -30
- package/dist/index-630f4e87.js +0 -1498
- package/dist/index-b30d446a-cbbef925.cjs +0 -7
- package/dist/mailbox-store-19f0c6c9-a0cbfa97.cjs +0 -1
- package/dist/nylas-if-state_3.entry-504be976.cjs +0 -1
- package/dist/nylas-if-state_3.entry-e96d01f1.js +0 -291
- package/dist/nylas-list-folders.entry-866361cc.cjs +0 -1
- package/dist/nylas-list-threads.entry-04989295.cjs +0 -1
- package/dist/nylas-mailbox-pagination.entry-e0bd4aef.cjs +0 -1
- package/dist/nylas-mailbox-toolbar-button.entry-3d772b26.cjs +0 -1
- package/dist/nylas-open-hours-picker.entry-6bdc7c73.js +0 -186
- package/dist/nylas-open-hours-picker.entry-881b6db7.cjs +0 -1
- package/dist/nylas-provider.entry-8d9a844b.cjs +0 -1
- package/dist/nylas-scheduler.entry-7321e18f.js +0 -230
- package/dist/nylas-scheduler.entry-e82977fb.cjs +0 -1
- package/dist/nylas-threads-refresh.entry-477e68e4.cjs +0 -1
- package/dist/nylas-threads-search.entry-c5854641.cjs +0 -1
- package/dist/nylas-view-thread.entry-8b72cbdb.cjs +0 -1
- package/dist/play-icon_2.entry-ed5877e3.js +0 -25
- package/dist/play-icon_2.entry-f23ed6c1.cjs +0 -1
- package/dist/scheduler-store-7d48e682-674705ef.cjs +0 -1
- package/dist/search-icon_3.entry-292138c3.js +0 -101
- package/dist/search-icon_3.entry-8e555357.cjs +0 -1
- package/dist/utils-5074a070-ce33ee6b.js +0 -119
- package/dist/utils-5074a070-d5ba6add.cjs +0 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as ne, h as g, c as We, H as $e, g as Rt, F as
|
|
2
|
-
import { d as T,
|
|
3
|
-
import { R as _n } from "./register-component-
|
|
1
|
+
import { r as ne, h as g, c as We, H as $e, g as Rt, F as bn } from "./index-0f3bd8df.js";
|
|
2
|
+
import { d as T, h as yn, i as En, p as Tn, j as An } from "./utils-c00bdc3c-89ab163d.js";
|
|
3
|
+
import { R as _n } from "./register-component-dc659dc3-0fdb18dc.js";
|
|
4
4
|
import { c as wn } from "./_commonjsHelpers-57e89916-af061c86.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "react-dom";
|
|
@@ -9,7 +9,7 @@ const vn = ".sc-forward-icon-h{display:flex}", Sn = vn, Cn = class {
|
|
|
9
9
|
ne(this, t), this.width = "15", this.height = "15";
|
|
10
10
|
}
|
|
11
11
|
render() {
|
|
12
|
-
return g("svg", { key: "
|
|
12
|
+
return g("svg", { key: "a858bd82169ace274a3c8cc1e214cd976e47e113", fill: "auto", width: this.width, height: this.height, viewBox: "0 0 1920 1920", xmlns: "http://www.w3.org/2000/svg" }, g("path", { key: "963f33f0803edfb6e8dfdbd287cee4917da7df01", d: "m1246.246 64-90.496 90.496 477.952 477.952h-590.848C467.878 632.448.038 1100.416.038 1675.392v109.056h128v-109.056c0-504.576 410.368-914.944 914.816-914.944h590.848l-477.952 478.08 90.496 90.496 632.448-632.576L1246.246 64Z", "fill-rule": "evenodd" }));
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
15
|
Cn.style = Sn;
|
|
@@ -58,20 +58,20 @@ const Ln = ':host{display:grid;color:var(--nylas-color-primary-900)}.editor{posi
|
|
|
58
58
|
T("no selection");
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
|
-
const
|
|
61
|
+
const m = s.getRangeAt(0), a = s.toString();
|
|
62
62
|
if (!a) {
|
|
63
63
|
o.style.display = "none";
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
66
|
-
const
|
|
67
|
-
if (!
|
|
66
|
+
const f = t.querySelector(".message-body");
|
|
67
|
+
if (!f) {
|
|
68
68
|
T("no message body");
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
|
-
const l =
|
|
71
|
+
const l = m.commonAncestorContainer.parentElement;
|
|
72
72
|
if (!l)
|
|
73
73
|
return;
|
|
74
|
-
const E =
|
|
74
|
+
const E = f.getBoundingClientRect();
|
|
75
75
|
T("messageBodyRect", { messageBodyRect: E });
|
|
76
76
|
const _ = l.getBoundingClientRect();
|
|
77
77
|
T("foundRect", { foundRect: _ });
|
|
@@ -85,22 +85,22 @@ const Ln = ':host{display:grid;color:var(--nylas-color-primary-900)}.editor{posi
|
|
|
85
85
|
T("no editor element");
|
|
86
86
|
return;
|
|
87
87
|
}
|
|
88
|
-
this.editorEl.querySelectorAll(".message-body").forEach((
|
|
88
|
+
this.editorEl.querySelectorAll(".message-body").forEach((f) => f.remove());
|
|
89
89
|
const o = document.createElement("div");
|
|
90
90
|
o.classList.add("message-body");
|
|
91
91
|
const u = document.createElement("p");
|
|
92
92
|
u.innerHTML = " ", o.appendChild(u);
|
|
93
93
|
const s = document.createElement("br");
|
|
94
94
|
o.appendChild(s);
|
|
95
|
-
const
|
|
96
|
-
if (
|
|
97
|
-
const
|
|
98
|
-
|
|
95
|
+
const m = document.createElement("div");
|
|
96
|
+
if (m.classList.add("reply-text"), m.innerText = `On ${new Date(t.date * 1e3).toLocaleDateString(void 0, { dateStyle: "full" })} <${(a = t.from) == null ? void 0 : a.map((f) => f.name || f.email).join(", ")}> wrote:`, o.appendChild(m), t.body) {
|
|
97
|
+
const f = document.createElement("html");
|
|
98
|
+
f.innerHTML = t.body;
|
|
99
99
|
const i = document.createElement("blockquote");
|
|
100
|
-
i.classList.add("collapsed"), i.classList.add("gmail_quote"), i.innerHTML =
|
|
100
|
+
i.classList.add("collapsed"), i.classList.add("gmail_quote"), i.innerHTML = f.innerHTML, o.appendChild(i), T("replyContainer", { replyContainer: i });
|
|
101
101
|
}
|
|
102
|
-
this.editorEl.appendChild(o), this.editorEl.querySelectorAll("blockquote.collapsed").forEach((
|
|
103
|
-
|
|
102
|
+
this.editorEl.appendChild(o), this.editorEl.querySelectorAll("blockquote.collapsed").forEach((f) => {
|
|
103
|
+
f.addEventListener("click", function(i) {
|
|
104
104
|
i.preventDefault();
|
|
105
105
|
const l = i.target;
|
|
106
106
|
l.classList.remove("collapsed"), l.classList.add("expanded");
|
|
@@ -108,7 +108,7 @@ const Ln = ':host{display:grid;color:var(--nylas-color-primary-900)}.editor{posi
|
|
|
108
108
|
}), this.editorEl.focus();
|
|
109
109
|
}
|
|
110
110
|
render() {
|
|
111
|
-
return g($e, { key: "
|
|
111
|
+
return g($e, { key: "89cdb2c6c606698704a06507ddbe301a37134ca4" }, g("sp-theme", { key: "4946560c2ab8518e5172e506caf36fa98fbc3912", scale: "medium", color: "dark" }, g("div", { key: "b21a8843aaebb1fd4169ce2b849fb801bce46df4", class: "editor", contentEditable: !0, ref: (t) => this.editorEl = t }, g("div", { key: "830a97d7947b65c0312630184d539d4f8c7a48eb", class: "toolbar", ref: (t) => this.toolbarEl = t, contentEditable: !1 }, g("sp-button", { key: "2fb11d997b13e4ec6e700155e3001d30f52bb217", quiet: !0, onClick: () => document.execCommand("bold") }, g("div", { key: "5c4fd64a8a3ccb94f36675047c05a662a1846426", slot: "icon" }, g("bold-icon", { key: "033043849fddd392bc078dbb2fd843f6701c0501" })), g("div", { key: "585b08407297a97e3214d716505331f0889ea68f", slot: "label" }, "Bold")), g("sp-button", { key: "b01e3c9c40fbe11122ca7be4b5120ba19262e1d5", quiet: !0, onClick: () => document.execCommand("underline") }, g("div", { key: "e407e888cb414fc4e5b15e9d21349038c7871f83", slot: "icon" }, g("underline-icon", { key: "838cf6c3b7b42708b5ed6e5c53072cda29043f40" })), g("div", { key: "c662e1cefa352cb8910050a77e5b0a2e18de6bed", slot: "label" }, "Underline")), g("sp-button", { key: "7e39fdbbdaeafabf1de93f42758f3b499c70206b", quiet: !0, onClick: () => document.execCommand("italic") }, g("div", { key: "8d7c7be8cf3959726b7541ed64e4e41995461258", slot: "icon" }, g("italic-icon", { key: "ae07a6648728e3f9720dfdc3e3f91e8e4cbf86d9" })), g("div", { key: "fc3fc026d47610df27752ec8a310db99e280014c", slot: "label" }, "Italic")))), g("div", { key: "9d4abb27a5d5a6b2c884da58191ca8f014e9ab43", class: "buttons" }, g("sp-button", { key: "43f2b6d9a4a6d5513eb6fd52fb8f68f416077b37", onClick: this.sendComposer, class: "send" }, "Send"), g("sp-button", { key: "fbae8e0490814b13347e3cc09bfd922ff5fceb43", onClick: this.closeComposer, class: "close" }, "Close"))));
|
|
112
112
|
}
|
|
113
113
|
get host() {
|
|
114
114
|
return Rt(this);
|
|
@@ -122,13 +122,13 @@ const Ln = ':host{display:grid;color:var(--nylas-color-primary-900)}.editor{posi
|
|
|
122
122
|
kn.style = Rn;
|
|
123
123
|
const Mn = ":host{display:block}sp-button{padding:0;border:0;border-radius:var(--nylas-border-radius);min-block-size:50%;min-inline-size:2rem;background-color:var(--nylas-color-primary-300);fill:var(--nylas-color-primary-800)}sp-button:hover{background-color:var(--nylas-color-primary-400)}.summarize-button.stopped{animation:none}.summarize-button.playing{animation:pulse 2s infinite}.summarize-button.loading{display:flex;align-content:center;height:1.5rem;width:2rem;vertical-align:middle;animation:pulse 2s infinite;flex-wrap:wrap}.summarize-button.loading loading-icon{--dot-color:var(--nylas-color-primary-600)}@keyframes pulse{0%{transform:scale(1);box-shadow:0 0 0 0 var(--nylas-color-primary-300)}70%{transform:scale(1.05);box-shadow:0 0 0 10px rgba(255, 69, 0, 0)}100%{transform:scale(1);box-shadow:0 0 0 0 rgba(255, 69, 0, 0)}}@keyframes wave{0%{transform:translateX(0)}50%{transform:translateX(100%)}100%{transform:translateX(0)}}", Nn = Mn;
|
|
124
124
|
var xn = function(t, o, u, s) {
|
|
125
|
-
var
|
|
125
|
+
var m = arguments.length, a = m < 3 ? o : s === null ? s = Object.getOwnPropertyDescriptor(o, u) : s, f;
|
|
126
126
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
127
127
|
a = Reflect.decorate(t, o, u, s);
|
|
128
128
|
else
|
|
129
129
|
for (var i = t.length - 1; i >= 0; i--)
|
|
130
|
-
(
|
|
131
|
-
return
|
|
130
|
+
(f = t[i]) && (a = (m < 3 ? f(a) : m > 3 ? f(o, u, a) : f(o, u)) || a);
|
|
131
|
+
return m > 3 && a && Object.defineProperty(o, u, a), a;
|
|
132
132
|
}, Be = function(t, o) {
|
|
133
133
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
134
134
|
return Reflect.metadata(t, o);
|
|
@@ -182,17 +182,17 @@ const kt = class {
|
|
|
182
182
|
return;
|
|
183
183
|
}
|
|
184
184
|
const u = new MediaSource();
|
|
185
|
-
let s,
|
|
185
|
+
let s, m = !1;
|
|
186
186
|
o.src = URL.createObjectURL(u), u.addEventListener("sourceopen", a);
|
|
187
187
|
async function a() {
|
|
188
|
-
s = u.addSourceBuffer("audio/mpeg"), s.addEventListener("updateend",
|
|
188
|
+
s = u.addSourceBuffer("audio/mpeg"), s.addEventListener("updateend", f);
|
|
189
189
|
const i = await t;
|
|
190
190
|
if (i == null)
|
|
191
191
|
throw new Error("ReadableStream not yet supported in this browser.");
|
|
192
192
|
const l = i.getReader(), E = () => {
|
|
193
193
|
l.read().then(({ done: _, value: N }) => {
|
|
194
194
|
if (_) {
|
|
195
|
-
|
|
195
|
+
m = !0;
|
|
196
196
|
return;
|
|
197
197
|
}
|
|
198
198
|
s.updating || s.appendBuffer(N), E();
|
|
@@ -202,11 +202,11 @@ const kt = class {
|
|
|
202
202
|
};
|
|
203
203
|
E(), o.paused && o.play().catch((_) => console.error("Error playing audio:", _));
|
|
204
204
|
}
|
|
205
|
-
function
|
|
206
|
-
if (
|
|
205
|
+
function f() {
|
|
206
|
+
if (m) {
|
|
207
207
|
u.endOfStream(), u.removeEventListener("sourceopen", a), u.removeEventListener("sourceclose", () => {
|
|
208
208
|
T("[nylas-summarize-message-button] Source closed");
|
|
209
|
-
}), s.removeEventListener("updateend",
|
|
209
|
+
}), s.removeEventListener("updateend", f);
|
|
210
210
|
return;
|
|
211
211
|
}
|
|
212
212
|
}
|
|
@@ -215,12 +215,12 @@ const kt = class {
|
|
|
215
215
|
return t.read().then(({ done: u, value: s }) => u ? o : (o.push(s), this.readChunk(t, o)));
|
|
216
216
|
}
|
|
217
217
|
render() {
|
|
218
|
-
return g($e, { key: "
|
|
218
|
+
return g($e, { key: "b14f3bab7ebd190d54a66a3e00704f9e4b147a8f" }, g("sp-theme", { key: "3a5b0782c84bbc7dba7b15306d608b885b5a6edc", scale: "medium", color: "dark" }, g("sp-button", { key: "d63121e6f80bd09f1e7ca35e1176aa3a070517b3", label: "Summarize email", "icon-only": !0, onClickCapture: this.onClick, class: {
|
|
219
219
|
"summarize-button": !0,
|
|
220
220
|
stopped: this.state === "stopped",
|
|
221
221
|
loading: this.state === "loading",
|
|
222
222
|
playing: this.state === "playing"
|
|
223
|
-
} }, this.state === "stopped" && g("play-icon", null), this.state === "loading" && g("loading-icon", null), this.state === "playing" && g("stop-icon", null)), g("audio", { key: "
|
|
223
|
+
} }, this.state === "stopped" && g("play-icon", null), this.state === "loading" && g("loading-icon", null), this.state === "playing" && g("stop-icon", null)), g("audio", { key: "954be0517a3b7328149830b2058d073ae9da591d", ref: (t) => this.audioRef = t, autoPlay: !0, onPlaying: () => this.state = "playing", onPause: () => this.state = "stopped", onEnded: () => {
|
|
224
224
|
this.state = "stopped", T("[nylas-summarize-message-button] Audio ended");
|
|
225
225
|
} })));
|
|
226
226
|
}
|
|
@@ -230,10 +230,10 @@ xn([
|
|
|
230
230
|
name: "nylas-summarize-message-button",
|
|
231
231
|
eventToProps: {
|
|
232
232
|
summarize: async (t, o) => {
|
|
233
|
-
const { playAudio: u, updateState: s, abortController:
|
|
233
|
+
const { playAudio: u, updateState: s, abortController: m, message: a } = t.detail, f = An(a.body || "");
|
|
234
234
|
await s("loading");
|
|
235
235
|
try {
|
|
236
|
-
const i = await o.messages.summarizeText(
|
|
236
|
+
const i = await o.messages.summarizeText(f), l = o.messages.textToSpeech(i, m);
|
|
237
237
|
await u(l);
|
|
238
238
|
} catch (i) {
|
|
239
239
|
await s("stopped"), console.error("Error summarizing message:", i);
|
|
@@ -260,16 +260,16 @@ function Mt(t) {
|
|
|
260
260
|
const o = (a = t.match(/\d+/g)) == null ? void 0 : a.map(Number);
|
|
261
261
|
if (!o)
|
|
262
262
|
return t;
|
|
263
|
-
const [u, s,
|
|
264
|
-
return `rgb(${255 - u}, ${255 - s}, ${255 -
|
|
263
|
+
const [u, s, m] = o;
|
|
264
|
+
return `rgb(${255 - u}, ${255 - s}, ${255 - m})`;
|
|
265
265
|
}
|
|
266
266
|
function On(t) {
|
|
267
267
|
var a;
|
|
268
268
|
const o = (a = t.match(/\d+\.?\d*/g)) == null ? void 0 : a.map(Number);
|
|
269
269
|
if (!o)
|
|
270
270
|
return t;
|
|
271
|
-
const [u, s,
|
|
272
|
-
return `hsl(${u}, ${s}%, ${100 -
|
|
271
|
+
const [u, s, m] = o;
|
|
272
|
+
return `hsl(${u}, ${s}%, ${100 - m}%)`;
|
|
273
273
|
}
|
|
274
274
|
function In(t) {
|
|
275
275
|
return /^[a-z]+$/i.test(t);
|
|
@@ -297,9 +297,9 @@ function Lt(t) {
|
|
|
297
297
|
const l = i[0].trim(), E = l.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), [_, N, U] = i[1].split(" ");
|
|
298
298
|
o = o.replaceAll(E, l.replace(U, P(U)));
|
|
299
299
|
}
|
|
300
|
-
const
|
|
301
|
-
if (
|
|
302
|
-
for (const i of
|
|
300
|
+
const m = o.matchAll(/background-color:\s*([^;]+)/g);
|
|
301
|
+
if (m)
|
|
302
|
+
for (const i of m) {
|
|
303
303
|
const [l, E] = i, _ = l.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
304
304
|
o = o.replaceAll(_, l.replace(E, P(E))), T("backgroundColor", { fullMatch: l, replace: l.replace(E, P(E)), color: E, invertColor: P(E) });
|
|
305
305
|
}
|
|
@@ -309,9 +309,9 @@ function Lt(t) {
|
|
|
309
309
|
const l = i[0].trim(), E = l.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), [_, N, U] = i[1].split(" ");
|
|
310
310
|
o = o.replaceAll(E, l.replace(U, P(U)));
|
|
311
311
|
}
|
|
312
|
-
const
|
|
313
|
-
if (
|
|
314
|
-
for (const i of
|
|
312
|
+
const f = o.matchAll(/color:\s*([^;]+)/g);
|
|
313
|
+
if (f)
|
|
314
|
+
for (const i of f) {
|
|
315
315
|
const [l, E] = i, _ = l.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
316
316
|
o = o.replaceAll(_, l.replace(E, P(E)));
|
|
317
317
|
}
|
|
@@ -319,8 +319,8 @@ function Lt(t) {
|
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
321
|
if (t instanceof HTMLElement) {
|
|
322
|
-
const o = window.getComputedStyle(t), u = o.color || t.style.color, s = o.backgroundColor || t.style.backgroundColor,
|
|
323
|
-
u && !s ? t.style.color = "" : u && s ? (t.style.color = P(u), t.style.backgroundColor = P(s), T("element", t), T("computedStyle.color", u), T("computedStyle.backgroundColor", s), T("invertColor(color)", P(u)), T("invertColor(backgroundColor)", P(s))) : !u && s && (t.style.backgroundColor = ""),
|
|
322
|
+
const o = window.getComputedStyle(t), u = o.color || t.style.color, s = o.backgroundColor || t.style.backgroundColor, m = o.borderColor || t.style.borderColor;
|
|
323
|
+
u && !s ? t.style.color = "" : u && s ? (t.style.color = P(u), t.style.backgroundColor = P(s), T("element", t), T("computedStyle.color", u), T("computedStyle.backgroundColor", s), T("invertColor(color)", P(u)), T("invertColor(backgroundColor)", P(s))) : !u && s && (t.style.backgroundColor = ""), m && (T("borderColor", m), t.style.borderColor = P(m)), t.hasAttribute("bgcolor") && t.removeAttribute("bgcolor");
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
326
|
function zn(t) {
|
|
@@ -335,9 +335,9 @@ var Nt = { exports: {} };
|
|
|
335
335
|
const {
|
|
336
336
|
entries: u,
|
|
337
337
|
setPrototypeOf: s,
|
|
338
|
-
isFrozen:
|
|
338
|
+
isFrozen: m,
|
|
339
339
|
getPrototypeOf: a,
|
|
340
|
-
getOwnPropertyDescriptor:
|
|
340
|
+
getOwnPropertyDescriptor: f
|
|
341
341
|
} = Object;
|
|
342
342
|
let {
|
|
343
343
|
freeze: i,
|
|
@@ -351,68 +351,68 @@ var Nt = { exports: {} };
|
|
|
351
351
|
return c;
|
|
352
352
|
}), l || (l = function(c) {
|
|
353
353
|
return c;
|
|
354
|
-
}), _ || (_ = function(c,
|
|
355
|
-
return c.apply(
|
|
356
|
-
}), N || (N = function(c,
|
|
357
|
-
return new c(...
|
|
354
|
+
}), _ || (_ = function(c, y, h) {
|
|
355
|
+
return c.apply(y, h);
|
|
356
|
+
}), N || (N = function(c, y) {
|
|
357
|
+
return new c(...y);
|
|
358
358
|
});
|
|
359
359
|
const U = I(Array.prototype.forEach), de = I(Array.prototype.pop), G = I(Array.prototype.push), X = I(String.prototype.toLowerCase), oe = I(String.prototype.toString), Ee = I(String.prototype.match), W = I(String.prototype.replace), xt = I(String.prototype.indexOf), Dt = I(String.prototype.trim), O = I(RegExp.prototype.test), ie = Ot(TypeError);
|
|
360
|
-
function I(
|
|
360
|
+
function I(b) {
|
|
361
361
|
return function(c) {
|
|
362
|
-
for (var
|
|
362
|
+
for (var y = arguments.length, h = new Array(y > 1 ? y - 1 : 0), k = 1; k < y; k++)
|
|
363
363
|
h[k - 1] = arguments[k];
|
|
364
|
-
return _(
|
|
364
|
+
return _(b, c, h);
|
|
365
365
|
};
|
|
366
366
|
}
|
|
367
|
-
function Ot(
|
|
367
|
+
function Ot(b) {
|
|
368
368
|
return function() {
|
|
369
|
-
for (var c = arguments.length,
|
|
370
|
-
|
|
371
|
-
return N(
|
|
369
|
+
for (var c = arguments.length, y = new Array(c), h = 0; h < c; h++)
|
|
370
|
+
y[h] = arguments[h];
|
|
371
|
+
return N(b, y);
|
|
372
372
|
};
|
|
373
373
|
}
|
|
374
|
-
function p(
|
|
375
|
-
let
|
|
376
|
-
s && s(
|
|
374
|
+
function p(b, c) {
|
|
375
|
+
let y = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : X;
|
|
376
|
+
s && s(b, null);
|
|
377
377
|
let h = c.length;
|
|
378
378
|
for (; h--; ) {
|
|
379
379
|
let k = c[h];
|
|
380
380
|
if (typeof k == "string") {
|
|
381
|
-
const F =
|
|
382
|
-
F !== k && (
|
|
381
|
+
const F = y(k);
|
|
382
|
+
F !== k && (m(c) || (c[h] = F), k = F);
|
|
383
383
|
}
|
|
384
|
-
|
|
384
|
+
b[k] = !0;
|
|
385
385
|
}
|
|
386
|
-
return
|
|
386
|
+
return b;
|
|
387
387
|
}
|
|
388
|
-
function It(
|
|
389
|
-
for (let c = 0; c <
|
|
390
|
-
|
|
391
|
-
return
|
|
388
|
+
function It(b) {
|
|
389
|
+
for (let c = 0; c < b.length; c++)
|
|
390
|
+
f(b, c) === void 0 && (b[c] = null);
|
|
391
|
+
return b;
|
|
392
392
|
}
|
|
393
|
-
function $(
|
|
393
|
+
function $(b) {
|
|
394
394
|
const c = E(null);
|
|
395
|
-
for (const [
|
|
396
|
-
|
|
395
|
+
for (const [y, h] of u(b))
|
|
396
|
+
f(b, y) !== void 0 && (Array.isArray(h) ? c[y] = It(h) : h && typeof h == "object" && h.constructor === Object ? c[y] = $(h) : c[y] = h);
|
|
397
397
|
return c;
|
|
398
398
|
}
|
|
399
|
-
function ue(
|
|
400
|
-
for (;
|
|
401
|
-
const h =
|
|
399
|
+
function ue(b, c) {
|
|
400
|
+
for (; b !== null; ) {
|
|
401
|
+
const h = f(b, c);
|
|
402
402
|
if (h) {
|
|
403
403
|
if (h.get)
|
|
404
404
|
return I(h.get);
|
|
405
405
|
if (typeof h.value == "function")
|
|
406
406
|
return I(h.value);
|
|
407
407
|
}
|
|
408
|
-
|
|
408
|
+
b = a(b);
|
|
409
409
|
}
|
|
410
|
-
function
|
|
410
|
+
function y(h) {
|
|
411
411
|
return console.warn("fallback value for", h), null;
|
|
412
412
|
}
|
|
413
|
-
return
|
|
413
|
+
return y;
|
|
414
414
|
}
|
|
415
|
-
const qe = i(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), Te = i(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), Ae = i(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), Pt = i(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), _e = i(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), Ut = i(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Ye = i(["#text"]), je = i(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "xmlns", "slot"]), we = i(["accent-height", "accumulate", "additive", "alignment-baseline", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), Xe = i(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]),
|
|
415
|
+
const qe = i(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), Te = i(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), Ae = i(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), Pt = i(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), _e = i(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), Ut = i(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Ye = i(["#text"]), je = i(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "xmlns", "slot"]), we = i(["accent-height", "accumulate", "additive", "alignment-baseline", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), Xe = i(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), fe = i(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), zt = l(/\{\{[\w\W]*|[\w\W]*\}\}/gm), Ft = l(/<%[\w\W]*|[\w\W]*%>/gm), Ht = l(/\${[\w\W]*}/gm), Bt = l(/^data-[\-\w.\u00B7-\uFFFF]/), Wt = l(/^aria-[\-\w]+$/), Ve = l(
|
|
416
416
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
417
417
|
// eslint-disable-line no-useless-escape
|
|
418
418
|
), Gt = l(/^(?:\w+script|data):/i), $t = l(
|
|
@@ -433,12 +433,12 @@ var Nt = { exports: {} };
|
|
|
433
433
|
});
|
|
434
434
|
const qt = function() {
|
|
435
435
|
return typeof window > "u" ? null : window;
|
|
436
|
-
}, Yt = function(c,
|
|
436
|
+
}, Yt = function(c, y) {
|
|
437
437
|
if (typeof c != "object" || typeof c.createPolicy != "function")
|
|
438
438
|
return null;
|
|
439
439
|
let h = null;
|
|
440
440
|
const k = "data-tt-policy-suffix";
|
|
441
|
-
|
|
441
|
+
y && y.hasAttribute(k) && (h = y.getAttribute(k));
|
|
442
442
|
const F = "dompurify" + (h ? "#" + h : "");
|
|
443
443
|
try {
|
|
444
444
|
return c.createPolicy(F, {
|
|
@@ -454,27 +454,27 @@ var Nt = { exports: {} };
|
|
|
454
454
|
}
|
|
455
455
|
};
|
|
456
456
|
function Qe() {
|
|
457
|
-
let
|
|
457
|
+
let b = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : qt();
|
|
458
458
|
const c = (d) => Qe(d);
|
|
459
|
-
if (c.version = "3.0.8", c.removed = [], !
|
|
459
|
+
if (c.version = "3.0.8", c.removed = [], !b || !b.document || b.document.nodeType !== 9)
|
|
460
460
|
return c.isSupported = !1, c;
|
|
461
461
|
let {
|
|
462
|
-
document:
|
|
463
|
-
} =
|
|
464
|
-
const h =
|
|
462
|
+
document: y
|
|
463
|
+
} = b;
|
|
464
|
+
const h = y, k = h.currentScript, {
|
|
465
465
|
DocumentFragment: F,
|
|
466
466
|
HTMLTemplateElement: V,
|
|
467
467
|
Node: ve,
|
|
468
468
|
Element: Je,
|
|
469
469
|
NodeFilter: Se,
|
|
470
|
-
NamedNodeMap: Xt =
|
|
470
|
+
NamedNodeMap: Xt = b.NamedNodeMap || b.MozNamedAttrMap,
|
|
471
471
|
HTMLFormElement: Vt,
|
|
472
472
|
DOMParser: Zt,
|
|
473
|
-
trustedTypes:
|
|
474
|
-
} =
|
|
473
|
+
trustedTypes: me
|
|
474
|
+
} = b, pe = Je.prototype, Kt = ue(pe, "cloneNode"), Qt = ue(pe, "nextSibling"), Jt = ue(pe, "childNodes"), Ce = ue(pe, "parentNode");
|
|
475
475
|
if (typeof V == "function") {
|
|
476
|
-
const d =
|
|
477
|
-
d.content && d.content.ownerDocument && (
|
|
476
|
+
const d = y.createElement("template");
|
|
477
|
+
d.content && d.content.ownerDocument && (y = d.content.ownerDocument);
|
|
478
478
|
}
|
|
479
479
|
let M, ae = "";
|
|
480
480
|
const {
|
|
@@ -482,7 +482,7 @@ var Nt = { exports: {} };
|
|
|
482
482
|
createNodeIterator: en,
|
|
483
483
|
createDocumentFragment: tn,
|
|
484
484
|
getElementsByTagName: nn
|
|
485
|
-
} =
|
|
485
|
+
} = y, {
|
|
486
486
|
importNode: on
|
|
487
487
|
} = h;
|
|
488
488
|
let z = {};
|
|
@@ -501,7 +501,7 @@ var Nt = { exports: {} };
|
|
|
501
501
|
} = Ke, v = null;
|
|
502
502
|
const nt = p({}, [...qe, ...Te, ...Ae, ..._e, ...Ye]);
|
|
503
503
|
let S = null;
|
|
504
|
-
const ot = p({}, [...je, ...we, ...Xe, ...
|
|
504
|
+
const ot = p({}, [...je, ...we, ...Xe, ...fe]);
|
|
505
505
|
let w = Object.seal(E(null, {
|
|
506
506
|
tagNameCheck: {
|
|
507
507
|
writable: !0,
|
|
@@ -528,50 +528,50 @@ var Nt = { exports: {} };
|
|
|
528
528
|
let dt = null;
|
|
529
529
|
const ut = p({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
530
530
|
let Pe = null;
|
|
531
|
-
const
|
|
531
|
+
const ft = p({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), be = "http://www.w3.org/1998/Math/MathML", ye = "http://www.w3.org/2000/svg", H = "http://www.w3.org/1999/xhtml";
|
|
532
532
|
let ee = H, Ue = !1, ze = null;
|
|
533
|
-
const cn = p({}, [
|
|
533
|
+
const cn = p({}, [be, ye, H], oe);
|
|
534
534
|
let le = null;
|
|
535
535
|
const dn = ["application/xhtml+xml", "text/html"], un = "text/html";
|
|
536
536
|
let C = null, te = null;
|
|
537
|
-
const
|
|
537
|
+
const fn = y.createElement("form"), mt = function(e) {
|
|
538
538
|
return e instanceof RegExp || e instanceof Function;
|
|
539
539
|
}, Fe = function() {
|
|
540
540
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
541
541
|
if (!(te && te === e)) {
|
|
542
542
|
if ((!e || typeof e != "object") && (e = {}), e = $(e), le = // eslint-disable-next-line unicorn/prefer-includes
|
|
543
543
|
dn.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? un : e.PARSER_MEDIA_TYPE, C = le === "application/xhtml+xml" ? oe : X, v = "ALLOWED_TAGS" in e ? p({}, e.ALLOWED_TAGS, C) : nt, S = "ALLOWED_ATTR" in e ? p({}, e.ALLOWED_ATTR, C) : ot, ze = "ALLOWED_NAMESPACES" in e ? p({}, e.ALLOWED_NAMESPACES, oe) : cn, Pe = "ADD_URI_SAFE_ATTR" in e ? p(
|
|
544
|
-
$(
|
|
544
|
+
$(ft),
|
|
545
545
|
// eslint-disable-line indent
|
|
546
546
|
e.ADD_URI_SAFE_ATTR,
|
|
547
547
|
// eslint-disable-line indent
|
|
548
548
|
C
|
|
549
549
|
// eslint-disable-line indent
|
|
550
|
-
) :
|
|
550
|
+
) : ft, dt = "ADD_DATA_URI_TAGS" in e ? p(
|
|
551
551
|
$(ut),
|
|
552
552
|
// eslint-disable-line indent
|
|
553
553
|
e.ADD_DATA_URI_TAGS,
|
|
554
554
|
// eslint-disable-line indent
|
|
555
555
|
C
|
|
556
556
|
// eslint-disable-line indent
|
|
557
|
-
) : ut, J = "FORBID_CONTENTS" in e ? p({}, e.FORBID_CONTENTS, C) : ct, re = "FORBID_TAGS" in e ? p({}, e.FORBID_TAGS, C) : {}, Ne = "FORBID_ATTR" in e ? p({}, e.FORBID_ATTR, C) : {}, Q = "USE_PROFILES" in e ? e.USE_PROFILES : !1, it = e.ALLOW_ARIA_ATTR !== !1, xe = e.ALLOW_DATA_ATTR !== !1, at = e.ALLOW_UNKNOWN_PROTOCOLS || !1, rt = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Z = e.SAFE_FOR_TEMPLATES || !1, q = e.WHOLE_DOCUMENT || !1, K = e.RETURN_DOM || !1, he = e.RETURN_DOM_FRAGMENT || !1, ge = e.RETURN_TRUSTED_TYPE || !1, Oe = e.FORCE_BODY || !1, st = e.SANITIZE_DOM !== !1, lt = e.SANITIZE_NAMED_PROPS || !1, Ie = e.KEEP_CONTENT !== !1, se = e.IN_PLACE || !1, tt = e.ALLOWED_URI_REGEXP || Ve, ee = e.NAMESPACE || H, w = e.CUSTOM_ELEMENT_HANDLING || {}, e.CUSTOM_ELEMENT_HANDLING &&
|
|
557
|
+
) : ut, J = "FORBID_CONTENTS" in e ? p({}, e.FORBID_CONTENTS, C) : ct, re = "FORBID_TAGS" in e ? p({}, e.FORBID_TAGS, C) : {}, Ne = "FORBID_ATTR" in e ? p({}, e.FORBID_ATTR, C) : {}, Q = "USE_PROFILES" in e ? e.USE_PROFILES : !1, it = e.ALLOW_ARIA_ATTR !== !1, xe = e.ALLOW_DATA_ATTR !== !1, at = e.ALLOW_UNKNOWN_PROTOCOLS || !1, rt = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Z = e.SAFE_FOR_TEMPLATES || !1, q = e.WHOLE_DOCUMENT || !1, K = e.RETURN_DOM || !1, he = e.RETURN_DOM_FRAGMENT || !1, ge = e.RETURN_TRUSTED_TYPE || !1, Oe = e.FORCE_BODY || !1, st = e.SANITIZE_DOM !== !1, lt = e.SANITIZE_NAMED_PROPS || !1, Ie = e.KEEP_CONTENT !== !1, se = e.IN_PLACE || !1, tt = e.ALLOWED_URI_REGEXP || Ve, ee = e.NAMESPACE || H, w = e.CUSTOM_ELEMENT_HANDLING || {}, e.CUSTOM_ELEMENT_HANDLING && mt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (w.tagNameCheck = e.CUSTOM_ELEMENT_HANDLING.tagNameCheck), e.CUSTOM_ELEMENT_HANDLING && mt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (w.attributeNameCheck = e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (w.allowCustomizedBuiltInElements = e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), Z && (xe = !1), he && (K = !0), Q && (v = p({}, Ye), S = [], Q.html === !0 && (p(v, qe), p(S, je)), Q.svg === !0 && (p(v, Te), p(S, we), p(S, fe)), Q.svgFilters === !0 && (p(v, Ae), p(S, we), p(S, fe)), Q.mathMl === !0 && (p(v, _e), p(S, Xe), p(S, fe))), e.ADD_TAGS && (v === nt && (v = $(v)), p(v, e.ADD_TAGS, C)), e.ADD_ATTR && (S === ot && (S = $(S)), p(S, e.ADD_ATTR, C)), e.ADD_URI_SAFE_ATTR && p(Pe, e.ADD_URI_SAFE_ATTR, C), e.FORBID_CONTENTS && (J === ct && (J = $(J)), p(J, e.FORBID_CONTENTS, C)), Ie && (v["#text"] = !0), q && p(v, ["html", "head", "body"]), v.table && (p(v, ["tbody"]), delete re.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
558
558
|
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
559
559
|
throw ie('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
560
560
|
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
561
561
|
throw ie('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
562
562
|
M = e.TRUSTED_TYPES_POLICY, ae = M.createHTML("");
|
|
563
563
|
} else
|
|
564
|
-
M === void 0 && (M = Yt(
|
|
564
|
+
M === void 0 && (M = Yt(me, k)), M !== null && typeof ae == "string" && (ae = M.createHTML(""));
|
|
565
565
|
i && i(e), te = e;
|
|
566
566
|
}
|
|
567
|
-
}, pt = p({}, ["mi", "mo", "mn", "ms", "mtext"]), ht = p({}, ["foreignobject", "desc", "title", "annotation-xml"]),
|
|
567
|
+
}, pt = p({}, ["mi", "mo", "mn", "ms", "mtext"]), ht = p({}, ["foreignobject", "desc", "title", "annotation-xml"]), mn = p({}, ["title", "style", "font", "a", "script"]), gt = p({}, [...Te, ...Ae, ...Pt]), bt = p({}, [..._e, ...Ut]), pn = function(e) {
|
|
568
568
|
let n = Ce(e);
|
|
569
569
|
(!n || !n.tagName) && (n = {
|
|
570
570
|
namespaceURI: ee,
|
|
571
571
|
tagName: "template"
|
|
572
572
|
});
|
|
573
573
|
const r = X(e.tagName), A = X(n.tagName);
|
|
574
|
-
return ze[e.namespaceURI] ? e.namespaceURI ===
|
|
574
|
+
return ze[e.namespaceURI] ? e.namespaceURI === ye ? n.namespaceURI === H ? r === "svg" : n.namespaceURI === be ? r === "svg" && (A === "annotation-xml" || pt[A]) : !!gt[r] : e.namespaceURI === be ? n.namespaceURI === H ? r === "math" : n.namespaceURI === ye ? r === "math" && ht[A] : !!bt[r] : e.namespaceURI === H ? n.namespaceURI === ye && !ht[A] || n.namespaceURI === be && !pt[A] ? !1 : !bt[r] && (mn[r] || !gt[r]) : !!(le === "application/xhtml+xml" && ze[e.namespaceURI]) : !1;
|
|
575
575
|
}, Y = function(e) {
|
|
576
576
|
G(c.removed, {
|
|
577
577
|
element: e
|
|
@@ -604,7 +604,7 @@ var Nt = { exports: {} };
|
|
|
604
604
|
n.setAttribute(e, "");
|
|
605
605
|
} catch {
|
|
606
606
|
}
|
|
607
|
-
},
|
|
607
|
+
}, yt = function(e) {
|
|
608
608
|
let n = null, r = null;
|
|
609
609
|
if (Oe)
|
|
610
610
|
e = "<remove></remove>" + e;
|
|
@@ -627,7 +627,7 @@ var Nt = { exports: {} };
|
|
|
627
627
|
}
|
|
628
628
|
}
|
|
629
629
|
const L = n.body || n.documentElement;
|
|
630
|
-
return e && r && L.insertBefore(
|
|
630
|
+
return e && r && L.insertBefore(y.createTextNode(r), L.childNodes[0] || null), ee === H ? nn.call(n, q ? "html" : "body")[0] : q ? n.documentElement : L;
|
|
631
631
|
}, Et = function(e) {
|
|
632
632
|
return en.call(
|
|
633
633
|
e.ownerDocument || e,
|
|
@@ -673,7 +673,7 @@ var Nt = { exports: {} };
|
|
|
673
673
|
element: e.cloneNode()
|
|
674
674
|
}), e.textContent = n)), B("afterSanitizeElements", e, null), !1);
|
|
675
675
|
}, _t = function(e, n, r) {
|
|
676
|
-
if (st && (n === "id" || n === "name") && (r in
|
|
676
|
+
if (st && (n === "id" || n === "name") && (r in y || r in fn))
|
|
677
677
|
return !1;
|
|
678
678
|
if (!(xe && !Ne[n] && O(an, n))) {
|
|
679
679
|
if (!(it && O(rn, n))) {
|
|
@@ -734,8 +734,8 @@ var Nt = { exports: {} };
|
|
|
734
734
|
});
|
|
735
735
|
const St = C(e.nodeName);
|
|
736
736
|
if (_t(St, ce, D)) {
|
|
737
|
-
if (lt && (ce === "id" || ce === "name") && (He(R, e), D = ln + D), M && typeof
|
|
738
|
-
switch (
|
|
737
|
+
if (lt && (ce === "id" || ce === "name") && (He(R, e), D = ln + D), M && typeof me == "object" && typeof me.getAttributeType == "function" && !x)
|
|
738
|
+
switch (me.getAttributeType(St, ce)) {
|
|
739
739
|
case "TrustedHTML": {
|
|
740
740
|
D = M.createHTML(D);
|
|
741
741
|
break;
|
|
@@ -776,12 +776,12 @@ var Nt = { exports: {} };
|
|
|
776
776
|
throw ie("root node is forbidden and cannot be sanitized in-place");
|
|
777
777
|
}
|
|
778
778
|
} else if (d instanceof ve)
|
|
779
|
-
n =
|
|
779
|
+
n = yt("<!---->"), r = n.ownerDocument.importNode(d, !0), r.nodeType === 1 && r.nodeName === "BODY" || r.nodeName === "HTML" ? n = r : n.appendChild(r);
|
|
780
780
|
else {
|
|
781
781
|
if (!K && !Z && !q && // eslint-disable-next-line unicorn/prefer-includes
|
|
782
782
|
d.indexOf("<") === -1)
|
|
783
783
|
return M && ge ? M.createHTML(d) : d;
|
|
784
|
-
if (n =
|
|
784
|
+
if (n = yt(d), !n)
|
|
785
785
|
return K ? null : ge ? ae : "";
|
|
786
786
|
}
|
|
787
787
|
n && Oe && Y(n.firstChild);
|
|
@@ -834,21 +834,21 @@ Ge.addHook("afterSanitizeAttributes", function(t) {
|
|
|
834
834
|
const Bn = class {
|
|
835
835
|
constructor(t) {
|
|
836
836
|
ne(this, t), this.htmlElement = document.createElement("html"), this.setBody = (o) => {
|
|
837
|
-
var
|
|
837
|
+
var m;
|
|
838
838
|
this.state = "loading", this.styles = [], this.hoistedFontURLs = /* @__PURE__ */ new Map(), this.sanitizedBody = "", document.querySelectorAll(".nylas-view-email-font").forEach((a) => {
|
|
839
839
|
a.remove();
|
|
840
|
-
}), (this.message ?
|
|
840
|
+
}), (this.message ? yn(this.message) : En(o)) || (o = `<html><body>${Tn(o)}</body></html>`), this.htmlElement.innerHTML = o, this.detectDarkMode && zn(this.htmlElement), this.htmlElement.querySelectorAll("link").forEach((a) => {
|
|
841
841
|
if (console.debug(`[nylas-view-email] Hoisting link: ${a.getAttribute("href")}`), a.getAttribute("rel") === "stylesheet" && a.getAttribute("href")) {
|
|
842
|
-
const
|
|
843
|
-
if (
|
|
844
|
-
const i = new URL(
|
|
842
|
+
const f = a.getAttribute("href");
|
|
843
|
+
if (f) {
|
|
844
|
+
const i = new URL(f, window.location.href);
|
|
845
845
|
(i.protocol === "https:" || i.protocol === "http:") && this.hoistedFontURLs.set(i.href, i.href);
|
|
846
846
|
}
|
|
847
847
|
}
|
|
848
848
|
}), this.htmlElement.querySelectorAll("style").forEach((a) => {
|
|
849
849
|
a.innerHTML.split(`
|
|
850
|
-
`).forEach((
|
|
851
|
-
const i =
|
|
850
|
+
`).forEach((f) => {
|
|
851
|
+
const i = f.match(/@import url\((.*)\)/);
|
|
852
852
|
if (i) {
|
|
853
853
|
const l = new URL(i[1], window.location.href);
|
|
854
854
|
(l.protocol === "https:" || l.protocol === "http:") && this.hoistedFontURLs.set(l.href, l.href);
|
|
@@ -860,25 +860,25 @@ const Bn = class {
|
|
|
860
860
|
const s = this.htmlElement.querySelector(".gmail_quote");
|
|
861
861
|
if (s) {
|
|
862
862
|
const a = document.createElement("button");
|
|
863
|
-
a.classList.add("nylas-view-email-toggle-button"), a.setAttribute("aria-label", "Show quoted text"), a.innerText = "...", (
|
|
863
|
+
a.classList.add("nylas-view-email-toggle-button"), a.setAttribute("aria-label", "Show quoted text"), a.innerText = "...", (m = s.parentElement) == null || m.insertBefore(a, s);
|
|
864
864
|
}
|
|
865
|
-
this.sanitizedBody = Ge.sanitize(this.htmlElement.innerHTML), this.hoistedFontURLs.forEach((a,
|
|
865
|
+
this.sanitizedBody = Ge.sanitize(this.htmlElement.innerHTML), this.hoistedFontURLs.forEach((a, f) => {
|
|
866
866
|
const i = document.createElement("link");
|
|
867
867
|
i.setAttribute("rel", "stylesheet"), i.setAttribute("href", a), i.classList.add("nylas-view-email-font"), document.head.appendChild(i);
|
|
868
868
|
}), this.state = "ready";
|
|
869
869
|
}, this.handleMobileSize = () => {
|
|
870
|
-
var u, s,
|
|
870
|
+
var u, s, m, a;
|
|
871
871
|
const o = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);
|
|
872
872
|
if (o <= 768) {
|
|
873
|
-
const
|
|
874
|
-
if (
|
|
873
|
+
const f = (u = this.viewEmailElement) == null ? void 0 : u.getBoundingClientRect();
|
|
874
|
+
if (f && this.viewEmailElement && this.parent && f.width > o) {
|
|
875
875
|
const i = this.parent, l = i == null ? void 0 : i.getBoundingClientRect();
|
|
876
876
|
T("Parent width:", l == null ? void 0 : l.width, "Parent height:", l == null ? void 0 : l.height), T("Parent client width:", i.clientWidth, "Parent client height:", i.clientHeight);
|
|
877
|
-
const E = l.width /
|
|
878
|
-
T("Scale:", N), this.viewEmailElement.style.setProperty("transform", `scale(${N})`), this.viewEmailElement.style.setProperty("transform-origin", "top left"), this.viewEmailElement.style.setProperty("height", `${
|
|
877
|
+
const E = l.width / f.width, _ = l.height / f.height, N = Math.min(E, _);
|
|
878
|
+
T("Scale:", N), this.viewEmailElement.style.setProperty("transform", `scale(${N})`), this.viewEmailElement.style.setProperty("transform-origin", "top left"), this.viewEmailElement.style.setProperty("height", `${f.height * N}px`);
|
|
879
879
|
}
|
|
880
880
|
} else
|
|
881
|
-
(s = this.viewEmailElement) == null || s.style.removeProperty("transform"), (
|
|
881
|
+
(s = this.viewEmailElement) == null || s.style.removeProperty("transform"), (m = this.viewEmailElement) == null || m.style.removeProperty("transform-origin"), (a = this.viewEmailElement) == null || a.style.removeProperty("height");
|
|
882
882
|
}, this.message = void 0, this.parent = void 0, this.attachments = [], this.detectDarkMode = !0, this.state = "loading", this.sanitizedBody = "", this.styles = [], this.viewEmailElement = void 0, this.hoistedFontURLs = /* @__PURE__ */ new Map();
|
|
883
883
|
}
|
|
884
884
|
connectedCallback() {
|
|
@@ -907,14 +907,14 @@ const Bn = class {
|
|
|
907
907
|
const t = (o = this.viewEmailElement) == null ? void 0 : o.querySelectorAll(".nylas-view-email-toggle-button");
|
|
908
908
|
t && t.forEach((u) => {
|
|
909
909
|
u.addEventListener("click", () => {
|
|
910
|
-
var
|
|
911
|
-
const s = (
|
|
910
|
+
var m;
|
|
911
|
+
const s = (m = this.viewEmailElement) == null ? void 0 : m.querySelector(".gmail_quote");
|
|
912
912
|
s && s.classList.toggle("show");
|
|
913
913
|
});
|
|
914
914
|
});
|
|
915
915
|
}
|
|
916
916
|
render() {
|
|
917
|
-
return console.debug("[nylas-view-email] render", { hoistedFontURLs: this.hoistedFontURLs }), g($e, { key: "
|
|
917
|
+
return console.debug("[nylas-view-email] render", { hoistedFontURLs: this.hoistedFontURLs }), g($e, { key: "5209aa3727b4c8013cec3ee0a33afdb38e9925d9" }, this.state === "loading" && g("div", null, "Loading..."), this.state === "ready" && g(bn, null, this.styles.map((t) => g("style", null, Ge.sanitize(t.innerHTML))), g("div", { class: "view-email", part: "view-email", innerHTML: this.sanitizedBody, ref: (t) => this.viewEmailElement = t })));
|
|
918
918
|
}
|
|
919
919
|
get host() {
|
|
920
920
|
return Rt(this);
|
|
@@ -932,7 +932,7 @@ const Wn = ".sc-reply-all-icon-h{display:flex}", Gn = Wn, $n = class {
|
|
|
932
932
|
ne(this, t), this.width = "15", this.height = "15";
|
|
933
933
|
}
|
|
934
934
|
render() {
|
|
935
|
-
return g("svg", { key: "
|
|
935
|
+
return g("svg", { key: "cf3a910b7232018b6579cfe31a868e3ba54f30b0", fill: "auto", width: this.width, height: this.height, viewBox: "0 0 1920 1920", xmlns: "http://www.w3.org/2000/svg" }, g("path", { key: "1db5bb9aa170d0a00c5939cdd7bfe7b878124c2c", d: "m1030.975 188 81.249 81.249-429.228 429.228h300.747c516.223 0 936.257 420.034 936.257 936.257v98.028h-114.92v-98.028c0-452.901-368.436-821.337-821.337-821.337H682.996l429.228 429.229-81.25 81.248-567.936-567.937L1030.975 188Zm-463.038.011 81.249 81.25-486.688 486.688 486.688 486.688-81.249 81.249L0 755.949 567.937 188.01Z", "fill-rule": "evenodd" }));
|
|
936
936
|
}
|
|
937
937
|
};
|
|
938
938
|
$n.style = Gn;
|
|
@@ -941,7 +941,7 @@ const qn = ".sc-reply-icon-h{display:flex}", Yn = qn, jn = class {
|
|
|
941
941
|
ne(this, t), this.width = "15", this.height = "15";
|
|
942
942
|
}
|
|
943
943
|
render() {
|
|
944
|
-
return g("svg", { key: "
|
|
944
|
+
return g("svg", { key: "a353055eb9122f1dae36fbf49a557c431fd8580a", fill: "auto", width: this.width, height: this.height, viewBox: "0 0 1920 1920", xmlns: "http://www.w3.org/2000/svg" }, g("path", { key: "97ac62efd50d229e10b45fc2a47f3c8c5a9b6e5d", d: "M835.942 632.563H244.966l478.08-478.08-90.496-90.496L-.026 696.563 632.55 1329.14l90.496-90.496-478.08-478.08h590.976c504.448 0 914.816 410.368 914.816 914.816v109.184h128V1675.38c0-574.976-467.84-1042.816-1042.816-1042.816", "fill-rule": "evenodd" }));
|
|
945
945
|
}
|
|
946
946
|
};
|
|
947
947
|
jn.style = Yn;
|