@momentco-ai/moment-sdk 0.9.0-dev.49 → 0.9.0-dev.50
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/CHANGELOG.md +2 -0
- package/README.md +11 -9
- package/dist/moment-sdk.js +1 -1
- package/dist/moment-sdk.mjs +19 -19
- package/dist/types/sdk/popup-bridge.d.ts +3 -2
- package/dist/types/sdk/types.d.ts +17 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
15
15
|
- **Roman's v2 sheet, on request.** When the embed's `moment.embed.theme` carries `design: "v2"`, the tray stops 48px below the top of the screen, home indicator included: its cap leaves room for the bottom safe area the frame pads by. The 90% cap and the "Powered by" strip go, because the sheet draws its own footer. The frame becomes translucent thick glass that blurs the page behind it, the page dims to 40% instead of 50%, and the card and iframe turn transparent, with the iframe's own `color-scheme` so a dark-scheme host page can't paint behind it. `design: "v1"` puts the 0.8.0 look back, card colour included (the default, or the `surface` the embed last sent), so the frame can follow an embed between a v2 sheet and its older steps. Without the hint nothing changes.
|
|
16
16
|
- **Collections in the sign-in popup.** A `schedule` selection can carry collection ids (`scheduleListIds`) alongside events and playlists, and `counts.lists` reports them.
|
|
17
17
|
- The sign-in popup carries the add-ons ticked in the sheet.
|
|
18
|
+
- **Connect-only sign-in.** `moment.embed.oauth.start` can carry `intent: "connect"`: the popup only connects the fan's calendar, subscribes nothing, and its result goes to the embed alone, with no `onSuccess`, `onError` or `onClose` and no `subscribe.*` analytics.
|
|
18
19
|
- **Confetti and toasts over the page.** Two new embed messages, drawn on a click-through layer over the host page instead of clipped inside the iframe. `moment.embed.celebrate` launches confetti up from the sheet's top edge once its height has settled, fading out before the top of the screen, and is skipped when the visitor prefers reduced motion. `moment.embed.toast` (`text`, optional `variant`: `success`, `info`, `warning` or `error`) shows Roman's light toast 56px below the top of the screen for 4 s, replacing any current one. It is announced by a status region inside the dialog, the same message again included, and its text is drawn as text, never HTML.
|
|
19
20
|
|
|
20
21
|
### Fixed
|
|
@@ -28,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
28
29
|
- Additive: sites without `autoOpen` are unchanged. Link opens add `entry=link` (and `campaignId` when present) to the iframe URL, which an older Moment Live ignores.
|
|
29
30
|
- Additive: an embed that never sends `design: "v2"` gets the 0.8.0 frame, and `scheduleListIds` is optional.
|
|
30
31
|
- Additive: older SDKs ignore `moment.embed.celebrate` and `moment.embed.toast`, and Live keeps drawing confetti and toasts inside the iframe for them.
|
|
32
|
+
- Additive: `intent` is optional. Older SDKs drop it, so Moment Live sends it only to 0.9.0 frames.
|
|
31
33
|
- Behaviour: 0.8.0 called `onClose` a second time (`cancelled`) when a `keepOpen` sheet closed; 0.9.0 doesn't, except after a `schedule` result.
|
|
32
34
|
|
|
33
35
|
## [0.8.0] - Unreleased
|
package/README.md
CHANGED
|
@@ -93,14 +93,14 @@ On screens narrower than 1024px the sheet opens as a bottom tray: full width, or
|
|
|
93
93
|
|
|
94
94
|
Set `data-moment-trigger-type` (or `triggerType` in `open()` / `createMomentButton()`):
|
|
95
95
|
|
|
96
|
-
| Type | Required attributes | Subscribes to
|
|
97
|
-
| ------------------ | ------------------------------------------------------ |
|
|
98
|
-
| `moment` (default) | `data-moment-team-slug` + `data-moment-slug` | One or more specific games/events
|
|
99
|
-
| `list` | `data-moment-team-slug` + `data-moment-list-slug` | A curated list of moments
|
|
100
|
-
| `team` | `data-moment-team-slug` | All published moments for the brand/team
|
|
101
|
-
| `brand-playlist` | `data-moment-team-slug` | The brand's default playlist (dynamic schedule thread)
|
|
102
|
-
| `playlist` | `data-moment-team-slug` + `data-moment-playlist-slugs` | One of several playlists (picker when >1 slug)
|
|
103
|
-
| `schedule` | `data-moment-team-slug`
|
|
96
|
+
| Type | Required attributes | Subscribes to |
|
|
97
|
+
| ------------------ | ------------------------------------------------------ | ----------------------------------------------------------------------------------------- |
|
|
98
|
+
| `moment` (default) | `data-moment-team-slug` + `data-moment-slug` | One or more specific games/events |
|
|
99
|
+
| `list` | `data-moment-team-slug` + `data-moment-list-slug` | A curated list of moments |
|
|
100
|
+
| `team` | `data-moment-team-slug` | All published moments for the brand/team |
|
|
101
|
+
| `brand-playlist` | `data-moment-team-slug` | The brand's default playlist (dynamic schedule thread) |
|
|
102
|
+
| `playlist` | `data-moment-team-slug` + `data-moment-playlist-slugs` | One of several playlists (picker when >1 slug) |
|
|
103
|
+
| `schedule` | `data-moment-team-slug` (a team's or a league's) | The brand's hub: the fan picks playlists, collections and events and syncs them in one go |
|
|
104
104
|
|
|
105
105
|
For `team`, `brand-playlist`, and `schedule`, omit moment/list/ID and source-resolution attributes — only `data-moment-team-slug` is required.
|
|
106
106
|
|
|
@@ -287,6 +287,8 @@ The `onAnalytics` callback receives:
|
|
|
287
287
|
| `subscribe.error` | Calendar sync failed |
|
|
288
288
|
| `embed.close` | Sync finished or modal dismissed |
|
|
289
289
|
|
|
290
|
+
A connect-only sign-in (the embed connects a calendar without syncing, 0.9.0+) fires `oauth.start` but no `subscribe.*` event, no `embed.close` at its result and no `onSuccess` / `onError` / `onClose`. If its popup is blocked or closed early, `oauth.popup.blocked` / `oauth.popup.closed` fire as usual.
|
|
291
|
+
|
|
290
292
|
---
|
|
291
293
|
|
|
292
294
|
## Result payload
|
|
@@ -305,7 +307,7 @@ The `onAnalytics` callback receives:
|
|
|
305
307
|
}
|
|
306
308
|
```
|
|
307
309
|
|
|
308
|
-
`result` is one of `success`, `error`, `cancelled`, or `partial` (schedule trigger, when only some resources synced). `provider` is `google`, `outlook`, or `apple` when applicable. `triggerType` echoes the trigger (`moment`, `list`, `team`, `brand-playlist`, `playlist`, or `schedule`). For `schedule`, an optional `counts: { requested, succeeded, failed }` reports the aggregate outcome.
|
|
310
|
+
`result` is one of `success`, `error`, `cancelled`, or `partial` (schedule trigger, when only some resources synced). `provider` is `google`, `outlook`, or `apple` when applicable. `triggerType` echoes the trigger (`moment`, `list`, `team`, `brand-playlist`, `playlist`, or `schedule`). For `schedule`, an optional `counts: { requested, succeeded, failed, moments?, playlists?, lists? }` reports the aggregate outcome; `moments`, `playlists` and `lists` (collections, 0.9.0+) break down the successful count by type.
|
|
309
311
|
|
|
310
312
|
When the embed shows its own confirmation, the payload carries `keepOpen: true`: the sheet stays open after `onSuccess` / `onError` until the fan closes it. `onClose` and `embed.close` have already fired with the result, so closing the sheet then fires no second `onClose` or `embed.close` (0.9.0+; 0.8.0 fired `onClose` again with `result: "cancelled"`). A `schedule` result still reports the dismissal: `onClose` (with `result: "cancelled"`) and `embed.close` fire again when its sheet closes.
|
|
311
313
|
|
package/dist/moment-sdk.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(A){"use strict";const E="moment_sync",L="moment_campaign",q=/^(?:schedule|(moment|list):([a-z0-9-]+)|playlist:([a-z0-9-]+(?:,[a-z0-9-]+)*))$/,X=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function J(i,e){if(!e)return null;const t=new URL(i),n=t.searchParams.get(E);if(n===null||n.length>200)return null;const r=q.exec(n);if(!r)return null;const[,o,s,a]=r;let m;o==="moment"?m={teamSlug:e,triggerType:"moment",momentSlug:s}:o==="list"?m={teamSlug:e,triggerType:"list",listSlug:s}:a?m={teamSlug:e,triggerType:"playlist",playlistSlugs:a.split(",")}:m={teamSlug:e,triggerType:"schedule"};const u=t.searchParams.get(L);return t.search=t.search.slice(1).split("&").filter(f=>{const l=f.split("=",1)[0];return l!==E&&l!==L}).join("&"),{payload:m,...u&&X.test(u)?{campaignId:u}:{},cleanUrl:t.href}}let I=!1;function Q(){return I?!1:(I=!0,!0)}function ee(i,e){i.body?e():i.addEventListener("DOMContentLoaded",e,{once:!0})}const te="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='15.55 11.94 120.52 21.28'%3E%3Cpath d='M16.59 33.04L17.42 29.54C18.62 24.54 19.22 21.32 19.22 19.89C19.22 19.68 19.19 19.54 19.12 19.47C19.05 19.4 18.91 19.38 18.7 19.4C18.4 19.47 17.97 19.65 17.42 19.94C16.86 20.23 16.32 20.62 15.79 21.1C15.63 20.9 15.55 20.69 15.55 20.48C15.55 20.27 15.65 20.03 15.86 19.75C16.16 19.38 16.65 18.95 17.33 18.45C18.02 17.95 18.74 17.53 19.5 17.2C20.27 16.86 20.92 16.7 21.48 16.7C21.78 16.7 22 16.79 22.14 16.99C22.28 17.19 22.35 17.5 22.35 17.94C22.35 18.55 22.24 19.42 22.04 20.56C21.83 21.71 21.55 22.88 21.2 24.09C22.34 21.96 23.59 20.19 24.95 18.79C26.32 17.4 27.7 16.7 29.12 16.7C29.79 16.7 30.27 16.87 30.57 17.23C30.87 17.59 31.02 18.14 31.02 18.88C31.02 19.97 30.69 21.7 30.02 24.09C31.13 22.01 32.44 20.25 33.94 18.83C35.44 17.41 36.94 16.7 38.42 16.7C39.11 16.7 39.63 16.88 39.98 17.25C40.33 17.62 40.5 18.16 40.5 18.88C40.5 19.18 40.45 19.62 40.34 20.18C40.24 20.75 40.1 21.37 39.91 22.04L38.42 27.7C38.09 28.92 37.93 29.77 37.93 30.23C37.93 30.48 37.97 30.67 38.05 30.8C38.13 30.93 38.27 30.99 38.45 30.99C38.89 30.99 39.47 30.69 40.17 30.09C40.88 29.49 41.46 28.85 41.92 28.18C42.25 28.44 42.41 28.72 42.41 29.05C42.41 29.26 42.34 29.48 42.2 29.71C41.74 30.5 40.98 31.28 39.93 32.05C38.87 32.82 37.82 33.21 36.75 33.21C36.08 33.21 35.56 33.02 35.17 32.62C34.79 32.23 34.6 31.66 34.6 30.92C34.6 30.3 34.8 29.22 35.19 27.7L36.79 21.55C37 20.74 37.1 20.13 37.1 19.71C37.1 19.2 36.89 18.95 36.48 18.95C35.97 18.95 35.3 19.33 34.46 20.08C33.63 20.83 32.79 21.94 31.93 23.41C31.07 24.88 30.33 26.62 29.71 28.63L28.91 31.27C28.77 31.73 28.59 32.09 28.37 32.33C28.15 32.57 27.82 32.73 27.38 32.8L25.54 33.22L25.37 33.04L26.13 29.67C26.73 27.11 27.19 25.03 27.49 23.44C27.79 21.86 27.94 20.72 27.94 20.03C27.94 19.33 27.72 19.02 27.28 19.02C26.79 19.02 26.17 19.4 25.42 20.15C24.67 20.9 23.89 22 23.1 23.46C22.3 24.92 21.6 26.65 21 28.67L20.2 31.27C20.06 31.71 19.87 32.05 19.63 32.29C19.38 32.54 19.02 32.71 18.53 32.8L16.76 33.22L16.59 33.04L16.59 33.04Z' fill='%23FAFAF9'%3E%3C/path%3E%3Cpath d='M57.66 17.94C57 17.13 55.99 16.73 54.62 16.73C52.93 16.73 51.31 17.3 49.75 18.43C49.51 18.6 49.28 18.78 49.06 18.97C49.24 19.85 49.39 20.78 49.48 21.74C49.86 21.01 50.3 20.37 50.79 19.82C51.63 18.87 52.5 18.39 53.41 18.39C54.08 18.39 54.55 18.68 54.81 19.24C55.08 19.81 55.21 20.58 55.21 21.55C55.21 23.08 54.97 24.63 54.48 26.19C54 27.75 53.35 29.03 52.54 30.04C51.73 31.04 50.86 31.55 49.94 31.55C49.53 31.55 49.19 31.44 48.9 31.22C48.74 31.9 48.54 32.55 48.31 33.19C48.5 33.2 48.7 33.21 48.9 33.21C50.54 33.21 52.11 32.63 53.61 31.48C55.12 30.32 56.33 28.82 57.26 26.98C58.18 25.14 58.65 23.28 58.65 21.38C58.65 19.9 58.32 18.75 57.66 17.94L57.66 17.94Z' fill='%23FAFAF9'%3E%3C/path%3E%3Cpath d='M61.84 33.04L62.67 29.54C63.88 24.54 64.48 21.32 64.48 19.89C64.48 19.68 64.44 19.54 64.37 19.47C64.3 19.4 64.17 19.38 63.96 19.4C63.66 19.47 63.23 19.65 62.67 19.94C62.12 20.23 61.57 20.62 61.04 21.1C60.88 20.9 60.8 20.69 60.8 20.48C60.8 20.27 60.9 20.03 61.11 19.75C61.41 19.38 61.9 18.95 62.59 18.45C63.27 17.95 63.99 17.53 64.76 17.2C65.52 16.86 66.18 16.7 66.73 16.7C67.04 16.7 67.26 16.79 67.39 16.99C67.53 17.19 67.6 17.5 67.6 17.94C67.6 18.55 67.5 19.42 67.29 20.56C67.08 21.71 66.8 22.88 66.46 24.09C67.59 21.96 68.84 20.19 70.2 18.79C71.57 17.4 72.96 16.7 74.37 16.7C75.04 16.7 75.53 16.87 75.83 17.23C76.13 17.59 76.28 18.14 76.28 18.88C76.28 19.97 75.94 21.7 75.27 24.09C76.38 22.01 77.69 20.25 79.19 18.83C80.7 17.41 82.19 16.7 83.67 16.7C84.36 16.7 84.89 16.88 85.23 17.25C85.58 17.62 85.75 18.16 85.75 18.88C85.75 19.18 85.7 19.62 85.6 20.18C85.49 20.75 85.35 21.37 85.16 22.04L83.67 27.7C83.35 28.92 83.19 29.77 83.19 30.23C83.19 30.48 83.23 30.67 83.31 30.8C83.39 30.93 83.52 30.99 83.71 30.99C84.15 30.99 84.72 30.69 85.42 30.09C86.13 29.49 86.71 28.85 87.18 28.18C87.5 28.44 87.66 28.72 87.66 29.05C87.66 29.26 87.59 29.48 87.46 29.71C86.99 30.5 86.24 31.28 85.18 32.05C84.13 32.82 83.07 33.21 82.01 33.21C81.34 33.21 80.81 33.02 80.43 32.62C80.05 32.23 79.86 31.66 79.86 30.92C79.86 30.3 80.05 29.22 80.44 27.7L82.04 21.55C82.25 20.74 82.35 20.13 82.35 19.71C82.35 19.2 82.15 18.95 81.73 18.95C81.22 18.95 80.55 19.33 79.72 20.08C78.88 20.83 78.04 21.94 77.18 23.41C76.33 24.88 75.59 26.62 74.96 28.63L74.16 31.27C74.02 31.73 73.85 32.09 73.63 32.33C73.41 32.57 73.08 32.73 72.64 32.8L70.8 33.22L70.62 33.04L71.39 29.67C71.99 27.11 72.44 25.03 72.74 23.44C73.04 21.86 73.19 20.72 73.19 20.03C73.19 19.33 72.97 19.02 72.53 19.02C72.05 19.02 71.43 19.4 70.68 20.15C69.92 20.9 69.15 22 68.35 23.46C67.55 24.92 66.85 26.65 66.25 28.67L65.45 31.27C65.31 31.71 65.12 32.05 64.88 32.29C64.64 32.54 64.27 32.71 63.79 32.8L62.02 33.22L61.84 33.04L61.84 33.04Z' fill='%23FAFAF9'%3E%3C/path%3E%3Cpath d='M91.01 31.91C90.19 31.04 89.78 29.85 89.78 28.32C89.78 26.47 90.32 24.64 91.41 22.84C92.49 21.03 93.87 19.56 95.54 18.41C97.2 17.27 98.82 16.69 100.4 16.69C101.23 16.69 101.87 16.9 102.31 17.3C102.75 17.71 102.97 18.25 102.97 18.95C102.97 20.08 102.55 21.13 101.72 22.09C100.88 23.05 99.77 23.81 98.37 24.38C96.97 24.95 95.47 25.23 93.87 25.23H93.52C93.25 26.16 93.11 27.05 93.11 27.9C93.11 28.97 93.32 29.79 93.75 30.37C94.18 30.95 94.8 31.24 95.61 31.24C96.51 31.24 97.4 30.91 98.28 30.26C99.16 29.62 99.99 28.69 100.78 27.49C100.96 27.72 101.1 27.91 101.18 28.06C101.26 28.21 101.3 28.39 101.3 28.6C101.3 28.81 101.22 29.06 101.06 29.36C100.78 29.89 100.32 30.46 99.67 31.05C99.02 31.63 98.24 32.14 97.33 32.57C96.41 33 95.43 33.21 94.39 33.21C92.96 33.21 91.83 32.78 91.01 31.91V31.91ZM94.32 23.81C95.43 23.81 96.43 23.58 97.33 23.12C98.22 22.65 98.92 22.08 99.42 21.4C99.93 20.71 100.19 20.05 100.19 19.4C100.19 18.69 99.85 18.33 99.18 18.33C98.3 18.33 97.37 18.85 96.39 19.91C95.41 20.96 94.61 22.25 94.01 23.78C94.08 23.8 94.19 23.81 94.32 23.81L94.32 23.81Z' fill='%23FAFAF9'%3E%3C/path%3E%3Cpath d='M105.91 33.04L106.78 29.12C107.96 24.08 108.55 21.04 108.55 20.03C108.55 19.82 108.5 19.66 108.4 19.56C108.29 19.45 108.15 19.4 107.96 19.4C107.68 19.4 107.3 19.54 106.82 19.82C106.33 20.1 105.75 20.51 105.08 21.07C105.01 21 104.95 20.89 104.91 20.75C104.86 20.62 104.84 20.5 104.84 20.41C104.84 20.27 104.86 20.13 104.89 19.99C104.93 19.85 105.01 19.7 105.15 19.54C105.43 19.17 105.88 18.76 106.52 18.31C107.16 17.86 107.83 17.47 108.55 17.16C109.27 16.85 109.89 16.69 110.43 16.69C110.79 16.69 111.06 16.79 111.21 16.97C111.36 17.16 111.43 17.47 111.43 17.91C111.43 19.09 111.05 21.2 110.29 24.26C111.42 22.08 112.72 20.28 114.19 18.84C115.66 17.41 117.14 16.69 118.65 16.69C119.37 16.69 119.92 16.88 120.3 17.25C120.68 17.62 120.87 18.14 120.87 18.81C120.87 19.48 120.67 20.57 120.28 22.07L118.72 27.97C118.44 28.99 118.3 29.74 118.3 30.23C118.3 30.71 118.48 30.99 118.82 30.99C119.26 30.99 119.84 30.69 120.54 30.09C121.25 29.49 121.83 28.85 122.29 28.18C122.62 28.43 122.78 28.72 122.78 29.05C122.78 29.26 122.71 29.48 122.57 29.71C122.32 30.17 121.91 30.67 121.34 31.22C120.77 31.76 120.12 32.23 119.39 32.62C118.67 33.02 117.92 33.21 117.16 33.21C116.46 33.21 115.92 33.02 115.54 32.62C115.16 32.23 114.97 31.63 114.97 30.82C114.97 30.15 115.18 29.04 115.59 27.49L117.09 22.14C117.36 21.05 117.5 20.24 117.5 19.71C117.5 19.18 117.32 18.95 116.95 18.95C116.37 18.95 115.65 19.35 114.8 20.15C113.94 20.95 113.08 22.09 112.21 23.58C111.34 25.07 110.63 26.84 110.08 28.87L109.45 31.06C109.31 31.59 109.13 31.98 108.9 32.22C108.67 32.47 108.33 32.65 107.89 32.76L106.09 33.21L105.91 33.04L105.91 33.04Z' fill='%23FAFAF9'%3E%3C/path%3E%3Cpath d='M126.29 32.28C125.82 31.65 125.59 30.84 125.59 29.85C125.59 29.27 125.7 28.37 125.9 27.16C126.11 25.94 126.47 24.18 126.98 21.87L127.6 18.88H124.52L124.76 17.49L127.99 17.15L130.03 13.12C130.24 12.75 130.43 12.48 130.59 12.32C130.75 12.16 130.95 12.06 131.18 12.01C131.41 11.96 131.76 11.94 132.22 11.94L132.36 12.11L131.28 17.15H136.07L135.9 18.01C135.85 18.36 135.75 18.59 135.6 18.71C135.45 18.82 135.18 18.88 134.79 18.88H130.9L130.24 21.94C129.73 24.34 129.37 26.11 129.17 27.23C128.96 28.35 128.85 29.14 128.85 29.61C128.85 30 128.93 30.29 129.08 30.47C129.23 30.66 129.48 30.75 129.82 30.75C130.42 30.75 131.14 30.5 131.98 30.01C132.81 29.51 133.55 28.89 134.2 28.15C134.57 28.43 134.75 28.69 134.75 28.95C134.75 29.39 134.42 29.95 133.75 30.63C133.07 31.31 132.25 31.91 131.26 32.43C130.28 32.96 129.34 33.22 128.44 33.22C127.47 33.22 126.75 32.9 126.28 32.28L126.29 32.28Z' fill='%23FAFAF9'%3E%3C/path%3E%3C/svg%3E",ie=120.52/21.28,ne=4e3,se=80,O=["#f04a34","#041abe","#041139","#1cd4ed","#b8e070"],re=10,oe=260,_={success:{fill:"#1c1d22",glyph:"#fafafc",path:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"},info:{fill:"#146eaa",glyph:"#ffffff",path:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z"},warning:{fill:"#aa4e19",glyph:"#ffffff",path:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"},error:{fill:"#c62734",glyph:"#ffffff",path:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z"}},ae={position:"absolute",top:"calc(56px + env(safe-area-inset-top, 0px))",left:"0",right:"0",margin:"0 auto",width:"max-content",maxWidth:"min(320px, calc(100% - 32px))",boxSizing:"border-box",display:"flex",alignItems:"center",gap:"8px",padding:"4px 16px 4px 4px",borderRadius:"20px",backgroundColor:"#ffffff",color:"#1c1d22",boxShadow:"0 4px 8px 0 #0000000a, 0 12px 32px 0 #0000001f",fontFamily:"Inter, system-ui, -apple-system, sans-serif",fontSize:"14px",lineHeight:"20px",fontWeight:"400",overflowWrap:"anywhere"},le={display:"flex",alignItems:"center",justifyContent:"center",flexShrink:"0",width:"28px",height:"28px",margin:"2px",borderRadius:"50%"},de={position:"absolute",width:"1px",height:"1px",margin:"-1px",padding:"0",border:"0",overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap"};function y(i,e){const t=document.createElement(i);return Object.assign(t.style,e),t}function ce(i,e){const t=y("div",{position:"absolute",inset:"0",overflow:"hidden",pointerEvents:"none",zIndex:"1"});t.setAttribute("aria-hidden","true"),i.appendChild(t);const n=y("span",de);n.setAttribute("role","status"),(e.querySelector('[role="dialog"]')??e).appendChild(n);let r=null,o=null,s=null,a=null;const m=()=>{o&&clearTimeout(o),o=null,a?.(),a=null,r?.remove(),r=null,n.textContent=""},u=l=>{const d=()=>{a=null,n.textContent=l};if(typeof requestAnimationFrame=="function"){const c=requestAnimationFrame(d);a=()=>cancelAnimationFrame(c)}else{const c=setTimeout(d,0);a=()=>clearTimeout(c)}},f=()=>{s=null;const l=e.getBoundingClientRect(),d=Math.max(0,l.top-re);for(let c=0;c<se;c++){const p=4+Math.random()*6,g=y("span",{position:"absolute",left:`${l.left+Math.random()*l.width}px`,top:`${d}px`,width:`${p}px`,height:`${p*(.5+Math.random())}px`,borderRadius:c%3===0?"50%":"1px",backgroundColor:O[c%O.length]});g.setAttribute("data-moment-confetti",""),t.appendChild(g);const h=d*(.35+Math.random()*.55),C=(Math.random()-.5)*120,b=(Math.random()-.5)*1080;g.animate([{transform:"translate(0px, 0px) rotate(0deg)",opacity:1},{opacity:1,offset:.6},{transform:`translate(${C}px, ${-h}px) rotate(${b}deg)`,opacity:0}],{duration:1200+Math.random()*800,delay:Math.random()*150,easing:"cubic-bezier(0.2, 0.6, 0.35, 1)",fill:"both"}).onfinish=()=>g.remove()}};return{celebrate(){window.matchMedia?.("(prefers-reduced-motion: reduce)").matches||typeof t.animate!="function"||s||(s=setTimeout(f,oe))},toast(l,d="success"){m();const c=_[Object.hasOwn(_,d)?d:"success"],p=y("span",{...le,backgroundColor:c.fill,color:c.glyph});p.innerHTML=`<svg width="16" height="16" viewBox="0 0 256 256" fill="currentColor" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><path d="${c.path}"/></svg>`;const g=y("span",{minWidth:"0"});g.textContent=l,r=y("div",ae),r.setAttribute("data-moment-toast",""),r.appendChild(p),r.appendChild(g),t.appendChild(r),u(l),o=setTimeout(m,ne)},destroy(){s&&clearTimeout(s),s=null,m(),t.remove(),n.remove()}}}function M(){if(typeof window>"u")return"";const i=window.location.origin,e=i==="null"?self.origin:i;return e==="null"&&console.error('[MomentSdk] This page has an opaque origin ("null"), so Moment Live cannot message it and calendar sync will not work. Serve the page over http(s), and give a sandboxed iframe allow-same-origin.'),e}function ue(i,e,t=M(),n){if(e.triggerType==="schedule"){const o=new URLSearchParams;return o.set("teamSlug",e.teamSlug),o.set("returnOrigin",t),o.set("embed","1"),o.set("sdkVersion","0.9.0-dev.49"),n&&(o.set("entry","link"),n.campaignId&&o.set("campaignId",n.campaignId)),`${i}/en/embed/schedule?${o.toString()}`}const r=new URLSearchParams;return r.set("teamSlug",e.teamSlug),e.momentSlug&&r.set("momentSlug",e.momentSlug),e.listSlug&&r.set("listSlug",e.listSlug),r.set("triggerType",e.triggerType),e.ids?.length&&r.set("ids",e.ids.join(",")),e.playlistSlugs?.length&&r.set("playlistSlugs",e.playlistSlugs.join(",")),e.calendar&&r.set("calendar",e.calendar),e.apiSourceId&&r.set("subscriptionId",e.apiSourceId),e.externalEventId&&r.set("externalId",e.externalEventId),e.externalEventIdPrefix&&!e.externalEventId&&r.set("externalIdPrefix",e.externalEventIdPrefix),r.set("returnOrigin",t),r.set("embed","1"),r.set("sdkVersion","0.9.0-dev.49"),n&&(r.set("entry","link"),n.campaignId&&r.set("campaignId",n.campaignId)),`${i}/en/embed/sync?${r.toString()}`}const R=500,k=700,pe=500;class me{popup=null;pollTimer=null;messageHandler=null;resultReceived=!1;opts;constructor(e){this.opts=e}open(e){this.cleanup(),this.resultReceived=!1;const t=this.buildPopupUrl(e),n=Math.round(window.screenX+(window.outerWidth-R)/2),r=Math.round(window.screenY+(window.outerHeight-k)/2);if(this.popup=window.open(t,"moment-oauth-popup",`width=${R},height=${k},left=${n},top=${r},menubar=no,toolbar=no,location=yes,status=no`),!this.popup||this.popup.closed){this.sendStatusToIframe("popup-blocked"),this.opts.onPopupBlocked();return}this.sendStatusToIframe("popup-opened"),this.startPolling(),this.messageHandler=o=>{if(o.origin!==this.opts.liveOrigin||o.source!==this.popup)return;const s=o.data;!s||typeof s!="object"||s.source!=="moment-live-embed"||s.type!=="moment.embed.result"||(this.resultReceived=!0,this.sendStatusToIframe("completed"),this.opts.iframeWindow&&this.opts.iframeWindow.postMessage(s,this.opts.liveOrigin),this.opts.onResult(s),this.cleanup())},window.addEventListener("message",this.messageHandler)}cleanup(){if(this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null),this.messageHandler&&(window.removeEventListener("message",this.messageHandler),this.messageHandler=null),this.popup&&!this.popup.closed)try{this.popup.close()}catch{}this.popup=null}buildPopupUrl(e){const t=he(e,M());return this.opts.campaignId&&t.set("campaignId",this.opts.campaignId),`${this.opts.liveBaseUrl}/en/embed/oauth-popup?${t.toString()}`}startPolling(){this.pollTimer=setInterval(()=>{(!this.popup||this.popup.closed)&&(this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null),this.resultReceived||(this.sendStatusToIframe("popup-closed"),this.opts.onPopupClosed()),this.cleanup())},pe)}sendStatusToIframe(e){if(!this.opts.iframeWindow)return;const t={source:"moment-sdk",type:"moment.embed.oauth.status",status:e};this.opts.iframeWindow.postMessage(t,this.opts.liveOrigin)}}function he(i,e){const t=new URLSearchParams({provider:i.provider,teamSlug:i.teamSlug,ids:i.ids.join(","),triggerType:i.triggerType,returnOrigin:e});i.subscriptionType&&t.set("subscriptionType",i.subscriptionType);const n={scheduleMomentIds:i.scheduleMomentIds,schedulePlaylistIds:i.schedulePlaylistIds,scheduleListIds:i.scheduleListIds};for(const[r,o]of Object.entries(n))o?.length&&t.set(r,o.join(","));return i.addons?.length&&t.set("addons",i.addons.join(",")),t}const H="moment-sdk-styles",P="moment-sdk-close",B="moment-sdk-tray",ge=`
|
|
1
|
+
(function(A){"use strict";const E="moment_sync",L="moment_campaign",q=/^(?:schedule|(moment|list):([a-z0-9-]+)|playlist:([a-z0-9-]+(?:,[a-z0-9-]+)*))$/,X=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function J(i,e){if(!e)return null;const t=new URL(i),n=t.searchParams.get(E);if(n===null||n.length>200)return null;const r=q.exec(n);if(!r)return null;const[,o,s,a]=r;let m;o==="moment"?m={teamSlug:e,triggerType:"moment",momentSlug:s}:o==="list"?m={teamSlug:e,triggerType:"list",listSlug:s}:a?m={teamSlug:e,triggerType:"playlist",playlistSlugs:a.split(",")}:m={teamSlug:e,triggerType:"schedule"};const u=t.searchParams.get(L);return t.search=t.search.slice(1).split("&").filter(f=>{const l=f.split("=",1)[0];return l!==E&&l!==L}).join("&"),{payload:m,...u&&X.test(u)?{campaignId:u}:{},cleanUrl:t.href}}let I=!1;function Q(){return I?!1:(I=!0,!0)}function ee(i,e){i.body?e():i.addEventListener("DOMContentLoaded",e,{once:!0})}const te="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='15.55 11.94 120.52 21.28'%3E%3Cpath d='M16.59 33.04L17.42 29.54C18.62 24.54 19.22 21.32 19.22 19.89C19.22 19.68 19.19 19.54 19.12 19.47C19.05 19.4 18.91 19.38 18.7 19.4C18.4 19.47 17.97 19.65 17.42 19.94C16.86 20.23 16.32 20.62 15.79 21.1C15.63 20.9 15.55 20.69 15.55 20.48C15.55 20.27 15.65 20.03 15.86 19.75C16.16 19.38 16.65 18.95 17.33 18.45C18.02 17.95 18.74 17.53 19.5 17.2C20.27 16.86 20.92 16.7 21.48 16.7C21.78 16.7 22 16.79 22.14 16.99C22.28 17.19 22.35 17.5 22.35 17.94C22.35 18.55 22.24 19.42 22.04 20.56C21.83 21.71 21.55 22.88 21.2 24.09C22.34 21.96 23.59 20.19 24.95 18.79C26.32 17.4 27.7 16.7 29.12 16.7C29.79 16.7 30.27 16.87 30.57 17.23C30.87 17.59 31.02 18.14 31.02 18.88C31.02 19.97 30.69 21.7 30.02 24.09C31.13 22.01 32.44 20.25 33.94 18.83C35.44 17.41 36.94 16.7 38.42 16.7C39.11 16.7 39.63 16.88 39.98 17.25C40.33 17.62 40.5 18.16 40.5 18.88C40.5 19.18 40.45 19.62 40.34 20.18C40.24 20.75 40.1 21.37 39.91 22.04L38.42 27.7C38.09 28.92 37.93 29.77 37.93 30.23C37.93 30.48 37.97 30.67 38.05 30.8C38.13 30.93 38.27 30.99 38.45 30.99C38.89 30.99 39.47 30.69 40.17 30.09C40.88 29.49 41.46 28.85 41.92 28.18C42.25 28.44 42.41 28.72 42.41 29.05C42.41 29.26 42.34 29.48 42.2 29.71C41.74 30.5 40.98 31.28 39.93 32.05C38.87 32.82 37.82 33.21 36.75 33.21C36.08 33.21 35.56 33.02 35.17 32.62C34.79 32.23 34.6 31.66 34.6 30.92C34.6 30.3 34.8 29.22 35.19 27.7L36.79 21.55C37 20.74 37.1 20.13 37.1 19.71C37.1 19.2 36.89 18.95 36.48 18.95C35.97 18.95 35.3 19.33 34.46 20.08C33.63 20.83 32.79 21.94 31.93 23.41C31.07 24.88 30.33 26.62 29.71 28.63L28.91 31.27C28.77 31.73 28.59 32.09 28.37 32.33C28.15 32.57 27.82 32.73 27.38 32.8L25.54 33.22L25.37 33.04L26.13 29.67C26.73 27.11 27.19 25.03 27.49 23.44C27.79 21.86 27.94 20.72 27.94 20.03C27.94 19.33 27.72 19.02 27.28 19.02C26.79 19.02 26.17 19.4 25.42 20.15C24.67 20.9 23.89 22 23.1 23.46C22.3 24.92 21.6 26.65 21 28.67L20.2 31.27C20.06 31.71 19.87 32.05 19.63 32.29C19.38 32.54 19.02 32.71 18.53 32.8L16.76 33.22L16.59 33.04L16.59 33.04Z' fill='%23FAFAF9'%3E%3C/path%3E%3Cpath d='M57.66 17.94C57 17.13 55.99 16.73 54.62 16.73C52.93 16.73 51.31 17.3 49.75 18.43C49.51 18.6 49.28 18.78 49.06 18.97C49.24 19.85 49.39 20.78 49.48 21.74C49.86 21.01 50.3 20.37 50.79 19.82C51.63 18.87 52.5 18.39 53.41 18.39C54.08 18.39 54.55 18.68 54.81 19.24C55.08 19.81 55.21 20.58 55.21 21.55C55.21 23.08 54.97 24.63 54.48 26.19C54 27.75 53.35 29.03 52.54 30.04C51.73 31.04 50.86 31.55 49.94 31.55C49.53 31.55 49.19 31.44 48.9 31.22C48.74 31.9 48.54 32.55 48.31 33.19C48.5 33.2 48.7 33.21 48.9 33.21C50.54 33.21 52.11 32.63 53.61 31.48C55.12 30.32 56.33 28.82 57.26 26.98C58.18 25.14 58.65 23.28 58.65 21.38C58.65 19.9 58.32 18.75 57.66 17.94L57.66 17.94Z' fill='%23FAFAF9'%3E%3C/path%3E%3Cpath d='M61.84 33.04L62.67 29.54C63.88 24.54 64.48 21.32 64.48 19.89C64.48 19.68 64.44 19.54 64.37 19.47C64.3 19.4 64.17 19.38 63.96 19.4C63.66 19.47 63.23 19.65 62.67 19.94C62.12 20.23 61.57 20.62 61.04 21.1C60.88 20.9 60.8 20.69 60.8 20.48C60.8 20.27 60.9 20.03 61.11 19.75C61.41 19.38 61.9 18.95 62.59 18.45C63.27 17.95 63.99 17.53 64.76 17.2C65.52 16.86 66.18 16.7 66.73 16.7C67.04 16.7 67.26 16.79 67.39 16.99C67.53 17.19 67.6 17.5 67.6 17.94C67.6 18.55 67.5 19.42 67.29 20.56C67.08 21.71 66.8 22.88 66.46 24.09C67.59 21.96 68.84 20.19 70.2 18.79C71.57 17.4 72.96 16.7 74.37 16.7C75.04 16.7 75.53 16.87 75.83 17.23C76.13 17.59 76.28 18.14 76.28 18.88C76.28 19.97 75.94 21.7 75.27 24.09C76.38 22.01 77.69 20.25 79.19 18.83C80.7 17.41 82.19 16.7 83.67 16.7C84.36 16.7 84.89 16.88 85.23 17.25C85.58 17.62 85.75 18.16 85.75 18.88C85.75 19.18 85.7 19.62 85.6 20.18C85.49 20.75 85.35 21.37 85.16 22.04L83.67 27.7C83.35 28.92 83.19 29.77 83.19 30.23C83.19 30.48 83.23 30.67 83.31 30.8C83.39 30.93 83.52 30.99 83.71 30.99C84.15 30.99 84.72 30.69 85.42 30.09C86.13 29.49 86.71 28.85 87.18 28.18C87.5 28.44 87.66 28.72 87.66 29.05C87.66 29.26 87.59 29.48 87.46 29.71C86.99 30.5 86.24 31.28 85.18 32.05C84.13 32.82 83.07 33.21 82.01 33.21C81.34 33.21 80.81 33.02 80.43 32.62C80.05 32.23 79.86 31.66 79.86 30.92C79.86 30.3 80.05 29.22 80.44 27.7L82.04 21.55C82.25 20.74 82.35 20.13 82.35 19.71C82.35 19.2 82.15 18.95 81.73 18.95C81.22 18.95 80.55 19.33 79.72 20.08C78.88 20.83 78.04 21.94 77.18 23.41C76.33 24.88 75.59 26.62 74.96 28.63L74.16 31.27C74.02 31.73 73.85 32.09 73.63 32.33C73.41 32.57 73.08 32.73 72.64 32.8L70.8 33.22L70.62 33.04L71.39 29.67C71.99 27.11 72.44 25.03 72.74 23.44C73.04 21.86 73.19 20.72 73.19 20.03C73.19 19.33 72.97 19.02 72.53 19.02C72.05 19.02 71.43 19.4 70.68 20.15C69.92 20.9 69.15 22 68.35 23.46C67.55 24.92 66.85 26.65 66.25 28.67L65.45 31.27C65.31 31.71 65.12 32.05 64.88 32.29C64.64 32.54 64.27 32.71 63.79 32.8L62.02 33.22L61.84 33.04L61.84 33.04Z' fill='%23FAFAF9'%3E%3C/path%3E%3Cpath d='M91.01 31.91C90.19 31.04 89.78 29.85 89.78 28.32C89.78 26.47 90.32 24.64 91.41 22.84C92.49 21.03 93.87 19.56 95.54 18.41C97.2 17.27 98.82 16.69 100.4 16.69C101.23 16.69 101.87 16.9 102.31 17.3C102.75 17.71 102.97 18.25 102.97 18.95C102.97 20.08 102.55 21.13 101.72 22.09C100.88 23.05 99.77 23.81 98.37 24.38C96.97 24.95 95.47 25.23 93.87 25.23H93.52C93.25 26.16 93.11 27.05 93.11 27.9C93.11 28.97 93.32 29.79 93.75 30.37C94.18 30.95 94.8 31.24 95.61 31.24C96.51 31.24 97.4 30.91 98.28 30.26C99.16 29.62 99.99 28.69 100.78 27.49C100.96 27.72 101.1 27.91 101.18 28.06C101.26 28.21 101.3 28.39 101.3 28.6C101.3 28.81 101.22 29.06 101.06 29.36C100.78 29.89 100.32 30.46 99.67 31.05C99.02 31.63 98.24 32.14 97.33 32.57C96.41 33 95.43 33.21 94.39 33.21C92.96 33.21 91.83 32.78 91.01 31.91V31.91ZM94.32 23.81C95.43 23.81 96.43 23.58 97.33 23.12C98.22 22.65 98.92 22.08 99.42 21.4C99.93 20.71 100.19 20.05 100.19 19.4C100.19 18.69 99.85 18.33 99.18 18.33C98.3 18.33 97.37 18.85 96.39 19.91C95.41 20.96 94.61 22.25 94.01 23.78C94.08 23.8 94.19 23.81 94.32 23.81L94.32 23.81Z' fill='%23FAFAF9'%3E%3C/path%3E%3Cpath d='M105.91 33.04L106.78 29.12C107.96 24.08 108.55 21.04 108.55 20.03C108.55 19.82 108.5 19.66 108.4 19.56C108.29 19.45 108.15 19.4 107.96 19.4C107.68 19.4 107.3 19.54 106.82 19.82C106.33 20.1 105.75 20.51 105.08 21.07C105.01 21 104.95 20.89 104.91 20.75C104.86 20.62 104.84 20.5 104.84 20.41C104.84 20.27 104.86 20.13 104.89 19.99C104.93 19.85 105.01 19.7 105.15 19.54C105.43 19.17 105.88 18.76 106.52 18.31C107.16 17.86 107.83 17.47 108.55 17.16C109.27 16.85 109.89 16.69 110.43 16.69C110.79 16.69 111.06 16.79 111.21 16.97C111.36 17.16 111.43 17.47 111.43 17.91C111.43 19.09 111.05 21.2 110.29 24.26C111.42 22.08 112.72 20.28 114.19 18.84C115.66 17.41 117.14 16.69 118.65 16.69C119.37 16.69 119.92 16.88 120.3 17.25C120.68 17.62 120.87 18.14 120.87 18.81C120.87 19.48 120.67 20.57 120.28 22.07L118.72 27.97C118.44 28.99 118.3 29.74 118.3 30.23C118.3 30.71 118.48 30.99 118.82 30.99C119.26 30.99 119.84 30.69 120.54 30.09C121.25 29.49 121.83 28.85 122.29 28.18C122.62 28.43 122.78 28.72 122.78 29.05C122.78 29.26 122.71 29.48 122.57 29.71C122.32 30.17 121.91 30.67 121.34 31.22C120.77 31.76 120.12 32.23 119.39 32.62C118.67 33.02 117.92 33.21 117.16 33.21C116.46 33.21 115.92 33.02 115.54 32.62C115.16 32.23 114.97 31.63 114.97 30.82C114.97 30.15 115.18 29.04 115.59 27.49L117.09 22.14C117.36 21.05 117.5 20.24 117.5 19.71C117.5 19.18 117.32 18.95 116.95 18.95C116.37 18.95 115.65 19.35 114.8 20.15C113.94 20.95 113.08 22.09 112.21 23.58C111.34 25.07 110.63 26.84 110.08 28.87L109.45 31.06C109.31 31.59 109.13 31.98 108.9 32.22C108.67 32.47 108.33 32.65 107.89 32.76L106.09 33.21L105.91 33.04L105.91 33.04Z' fill='%23FAFAF9'%3E%3C/path%3E%3Cpath d='M126.29 32.28C125.82 31.65 125.59 30.84 125.59 29.85C125.59 29.27 125.7 28.37 125.9 27.16C126.11 25.94 126.47 24.18 126.98 21.87L127.6 18.88H124.52L124.76 17.49L127.99 17.15L130.03 13.12C130.24 12.75 130.43 12.48 130.59 12.32C130.75 12.16 130.95 12.06 131.18 12.01C131.41 11.96 131.76 11.94 132.22 11.94L132.36 12.11L131.28 17.15H136.07L135.9 18.01C135.85 18.36 135.75 18.59 135.6 18.71C135.45 18.82 135.18 18.88 134.79 18.88H130.9L130.24 21.94C129.73 24.34 129.37 26.11 129.17 27.23C128.96 28.35 128.85 29.14 128.85 29.61C128.85 30 128.93 30.29 129.08 30.47C129.23 30.66 129.48 30.75 129.82 30.75C130.42 30.75 131.14 30.5 131.98 30.01C132.81 29.51 133.55 28.89 134.2 28.15C134.57 28.43 134.75 28.69 134.75 28.95C134.75 29.39 134.42 29.95 133.75 30.63C133.07 31.31 132.25 31.91 131.26 32.43C130.28 32.96 129.34 33.22 128.44 33.22C127.47 33.22 126.75 32.9 126.28 32.28L126.29 32.28Z' fill='%23FAFAF9'%3E%3C/path%3E%3C/svg%3E",ie=120.52/21.28,ne=4e3,se=80,O=["#f04a34","#041abe","#041139","#1cd4ed","#b8e070"],re=10,oe=260,_={success:{fill:"#1c1d22",glyph:"#fafafc",path:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"},info:{fill:"#146eaa",glyph:"#ffffff",path:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z"},warning:{fill:"#aa4e19",glyph:"#ffffff",path:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"},error:{fill:"#c62734",glyph:"#ffffff",path:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z"}},ae={position:"absolute",top:"calc(56px + env(safe-area-inset-top, 0px))",left:"0",right:"0",margin:"0 auto",width:"max-content",maxWidth:"min(320px, calc(100% - 32px))",boxSizing:"border-box",display:"flex",alignItems:"center",gap:"8px",padding:"4px 16px 4px 4px",borderRadius:"20px",backgroundColor:"#ffffff",color:"#1c1d22",boxShadow:"0 4px 8px 0 #0000000a, 0 12px 32px 0 #0000001f",fontFamily:"Inter, system-ui, -apple-system, sans-serif",fontSize:"14px",lineHeight:"20px",fontWeight:"400",overflowWrap:"anywhere"},le={display:"flex",alignItems:"center",justifyContent:"center",flexShrink:"0",width:"28px",height:"28px",margin:"2px",borderRadius:"50%"},de={position:"absolute",width:"1px",height:"1px",margin:"-1px",padding:"0",border:"0",overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap"};function y(i,e){const t=document.createElement(i);return Object.assign(t.style,e),t}function ce(i,e){const t=y("div",{position:"absolute",inset:"0",overflow:"hidden",pointerEvents:"none",zIndex:"1"});t.setAttribute("aria-hidden","true"),i.appendChild(t);const n=y("span",de);n.setAttribute("role","status"),(e.querySelector('[role="dialog"]')??e).appendChild(n);let r=null,o=null,s=null,a=null;const m=()=>{o&&clearTimeout(o),o=null,a?.(),a=null,r?.remove(),r=null,n.textContent=""},u=l=>{const d=()=>{a=null,n.textContent=l};if(typeof requestAnimationFrame=="function"){const c=requestAnimationFrame(d);a=()=>cancelAnimationFrame(c)}else{const c=setTimeout(d,0);a=()=>clearTimeout(c)}},f=()=>{s=null;const l=e.getBoundingClientRect(),d=Math.max(0,l.top-re);for(let c=0;c<se;c++){const p=4+Math.random()*6,g=y("span",{position:"absolute",left:`${l.left+Math.random()*l.width}px`,top:`${d}px`,width:`${p}px`,height:`${p*(.5+Math.random())}px`,borderRadius:c%3===0?"50%":"1px",backgroundColor:O[c%O.length]});g.setAttribute("data-moment-confetti",""),t.appendChild(g);const h=d*(.35+Math.random()*.55),C=(Math.random()-.5)*120,b=(Math.random()-.5)*1080;g.animate([{transform:"translate(0px, 0px) rotate(0deg)",opacity:1},{opacity:1,offset:.6},{transform:`translate(${C}px, ${-h}px) rotate(${b}deg)`,opacity:0}],{duration:1200+Math.random()*800,delay:Math.random()*150,easing:"cubic-bezier(0.2, 0.6, 0.35, 1)",fill:"both"}).onfinish=()=>g.remove()}};return{celebrate(){window.matchMedia?.("(prefers-reduced-motion: reduce)").matches||typeof t.animate!="function"||s||(s=setTimeout(f,oe))},toast(l,d="success"){m();const c=_[Object.hasOwn(_,d)?d:"success"],p=y("span",{...le,backgroundColor:c.fill,color:c.glyph});p.innerHTML=`<svg width="16" height="16" viewBox="0 0 256 256" fill="currentColor" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><path d="${c.path}"/></svg>`;const g=y("span",{minWidth:"0"});g.textContent=l,r=y("div",ae),r.setAttribute("data-moment-toast",""),r.appendChild(p),r.appendChild(g),t.appendChild(r),u(l),o=setTimeout(m,ne)},destroy(){s&&clearTimeout(s),s=null,m(),t.remove(),n.remove()}}}function M(){if(typeof window>"u")return"";const i=window.location.origin,e=i==="null"?self.origin:i;return e==="null"&&console.error('[MomentSdk] This page has an opaque origin ("null"), so Moment Live cannot message it and calendar sync will not work. Serve the page over http(s), and give a sandboxed iframe allow-same-origin.'),e}function ue(i,e,t=M(),n){if(e.triggerType==="schedule"){const o=new URLSearchParams;return o.set("teamSlug",e.teamSlug),o.set("returnOrigin",t),o.set("embed","1"),o.set("sdkVersion","0.9.0-dev.50"),n&&(o.set("entry","link"),n.campaignId&&o.set("campaignId",n.campaignId)),`${i}/en/embed/schedule?${o.toString()}`}const r=new URLSearchParams;return r.set("teamSlug",e.teamSlug),e.momentSlug&&r.set("momentSlug",e.momentSlug),e.listSlug&&r.set("listSlug",e.listSlug),r.set("triggerType",e.triggerType),e.ids?.length&&r.set("ids",e.ids.join(",")),e.playlistSlugs?.length&&r.set("playlistSlugs",e.playlistSlugs.join(",")),e.calendar&&r.set("calendar",e.calendar),e.apiSourceId&&r.set("subscriptionId",e.apiSourceId),e.externalEventId&&r.set("externalId",e.externalEventId),e.externalEventIdPrefix&&!e.externalEventId&&r.set("externalIdPrefix",e.externalEventIdPrefix),r.set("returnOrigin",t),r.set("embed","1"),r.set("sdkVersion","0.9.0-dev.50"),n&&(r.set("entry","link"),n.campaignId&&r.set("campaignId",n.campaignId)),`${i}/en/embed/sync?${r.toString()}`}const R=500,k=700,pe=500;class me{popup=null;pollTimer=null;messageHandler=null;resultReceived=!1;opts;constructor(e){this.opts=e}open(e){this.cleanup(),this.resultReceived=!1;const t=this.buildPopupUrl(e),n=Math.round(window.screenX+(window.outerWidth-R)/2),r=Math.round(window.screenY+(window.outerHeight-k)/2);if(this.popup=window.open(t,"moment-oauth-popup",`width=${R},height=${k},left=${n},top=${r},menubar=no,toolbar=no,location=yes,status=no`),!this.popup||this.popup.closed){this.sendStatusToIframe("popup-blocked"),this.opts.onPopupBlocked();return}this.sendStatusToIframe("popup-opened"),this.startPolling(),this.messageHandler=o=>{if(o.origin!==this.opts.liveOrigin||o.source!==this.popup)return;const s=o.data;!s||typeof s!="object"||s.source!=="moment-live-embed"||s.type!=="moment.embed.result"||(this.resultReceived=!0,this.sendStatusToIframe("completed"),this.opts.iframeWindow&&this.opts.iframeWindow.postMessage(s,this.opts.liveOrigin),e.intent!=="connect"&&this.opts.onResult(s),this.cleanup())},window.addEventListener("message",this.messageHandler)}cleanup(){if(this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null),this.messageHandler&&(window.removeEventListener("message",this.messageHandler),this.messageHandler=null),this.popup&&!this.popup.closed)try{this.popup.close()}catch{}this.popup=null}buildPopupUrl(e){const t=he(e,M());return this.opts.campaignId&&t.set("campaignId",this.opts.campaignId),`${this.opts.liveBaseUrl}/en/embed/oauth-popup?${t.toString()}`}startPolling(){this.pollTimer=setInterval(()=>{(!this.popup||this.popup.closed)&&(this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null),this.resultReceived||(this.sendStatusToIframe("popup-closed"),this.opts.onPopupClosed()),this.cleanup())},pe)}sendStatusToIframe(e){if(!this.opts.iframeWindow)return;const t={source:"moment-sdk",type:"moment.embed.oauth.status",status:e};this.opts.iframeWindow.postMessage(t,this.opts.liveOrigin)}}function he(i,e){const t=new URLSearchParams({provider:i.provider,teamSlug:i.teamSlug,ids:i.ids.join(","),triggerType:i.triggerType,returnOrigin:e});i.subscriptionType&&t.set("subscriptionType",i.subscriptionType);const n={scheduleMomentIds:i.scheduleMomentIds,schedulePlaylistIds:i.schedulePlaylistIds,scheduleListIds:i.scheduleListIds};for(const[r,o]of Object.entries(n))o?.length&&t.set(r,o.join(","));return i.addons?.length&&t.set("addons",i.addons.join(",")),i.intent==="connect"&&t.set("intent","connect"),t}const H="moment-sdk-styles",P="moment-sdk-close",B="moment-sdk-tray",ge=`
|
|
2
2
|
:where(.moment-sync-trigger) {
|
|
3
3
|
background-color: #1c1917;
|
|
4
4
|
color: #ffffff;
|
package/dist/moment-sdk.mjs
CHANGED
|
@@ -74,12 +74,12 @@ const J = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox=
|
|
|
74
74
|
clipPath: "inset(50%)",
|
|
75
75
|
whiteSpace: "nowrap"
|
|
76
76
|
};
|
|
77
|
-
function
|
|
77
|
+
function v(i, e) {
|
|
78
78
|
const t = document.createElement(i);
|
|
79
79
|
return Object.assign(t.style, e), t;
|
|
80
80
|
}
|
|
81
81
|
function ue(i, e) {
|
|
82
|
-
const t =
|
|
82
|
+
const t = v("div", {
|
|
83
83
|
position: "absolute",
|
|
84
84
|
inset: "0",
|
|
85
85
|
overflow: "hidden",
|
|
@@ -87,7 +87,7 @@ function ue(i, e) {
|
|
|
87
87
|
zIndex: "1"
|
|
88
88
|
});
|
|
89
89
|
t.setAttribute("aria-hidden", "true"), i.appendChild(t);
|
|
90
|
-
const n =
|
|
90
|
+
const n = v("span", ce);
|
|
91
91
|
n.setAttribute("role", "status"), (e.querySelector('[role="dialog"]') ?? e).appendChild(n);
|
|
92
92
|
let r = null, o = null, s = null, a = null;
|
|
93
93
|
const m = () => {
|
|
@@ -107,7 +107,7 @@ function ue(i, e) {
|
|
|
107
107
|
s = null;
|
|
108
108
|
const l = e.getBoundingClientRect(), d = Math.max(0, l.top - ie);
|
|
109
109
|
for (let c = 0; c < te; c++) {
|
|
110
|
-
const p = 4 + Math.random() * 6, g =
|
|
110
|
+
const p = 4 + Math.random() * 6, g = v("span", {
|
|
111
111
|
position: "absolute",
|
|
112
112
|
left: `${l.left + Math.random() * l.width}px`,
|
|
113
113
|
top: `${d}px`,
|
|
@@ -139,10 +139,10 @@ function ue(i, e) {
|
|
|
139
139
|
},
|
|
140
140
|
toast(l, d = "success") {
|
|
141
141
|
m();
|
|
142
|
-
const c = _[Object.hasOwn(_, d) ? d : "success"], p =
|
|
142
|
+
const c = _[Object.hasOwn(_, d) ? d : "success"], p = v("span", { ...de, backgroundColor: c.fill, color: c.glyph });
|
|
143
143
|
p.innerHTML = `<svg width="16" height="16" viewBox="0 0 256 256" fill="currentColor" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><path d="${c.path}"/></svg>`;
|
|
144
|
-
const g =
|
|
145
|
-
g.textContent = l, r =
|
|
144
|
+
const g = v("span", { minWidth: "0" });
|
|
145
|
+
g.textContent = l, r = v("div", le), r.setAttribute("data-moment-toast", ""), r.appendChild(p), r.appendChild(g), t.appendChild(r), u(l), o = setTimeout(m, ee);
|
|
146
146
|
},
|
|
147
147
|
destroy() {
|
|
148
148
|
s && clearTimeout(s), s = null, m(), t.remove(), n.remove();
|
|
@@ -159,10 +159,10 @@ function N() {
|
|
|
159
159
|
function pe(i, e, t = N(), n) {
|
|
160
160
|
if (e.triggerType === "schedule") {
|
|
161
161
|
const o = new URLSearchParams();
|
|
162
|
-
return o.set("teamSlug", e.teamSlug), o.set("returnOrigin", t), o.set("embed", "1"), o.set("sdkVersion", "0.9.0-dev.
|
|
162
|
+
return o.set("teamSlug", e.teamSlug), o.set("returnOrigin", t), o.set("embed", "1"), o.set("sdkVersion", "0.9.0-dev.50"), n && (o.set("entry", "link"), n.campaignId && o.set("campaignId", n.campaignId)), `${i}/en/embed/schedule?${o.toString()}`;
|
|
163
163
|
}
|
|
164
164
|
const r = new URLSearchParams();
|
|
165
|
-
return r.set("teamSlug", e.teamSlug), e.momentSlug && r.set("momentSlug", e.momentSlug), e.listSlug && r.set("listSlug", e.listSlug), r.set("triggerType", e.triggerType), e.ids?.length && r.set("ids", e.ids.join(",")), e.playlistSlugs?.length && r.set("playlistSlugs", e.playlistSlugs.join(",")), e.calendar && r.set("calendar", e.calendar), e.apiSourceId && r.set("subscriptionId", e.apiSourceId), e.externalEventId && r.set("externalId", e.externalEventId), e.externalEventIdPrefix && !e.externalEventId && r.set("externalIdPrefix", e.externalEventIdPrefix), r.set("returnOrigin", t), r.set("embed", "1"), r.set("sdkVersion", "0.9.0-dev.
|
|
165
|
+
return r.set("teamSlug", e.teamSlug), e.momentSlug && r.set("momentSlug", e.momentSlug), e.listSlug && r.set("listSlug", e.listSlug), r.set("triggerType", e.triggerType), e.ids?.length && r.set("ids", e.ids.join(",")), e.playlistSlugs?.length && r.set("playlistSlugs", e.playlistSlugs.join(",")), e.calendar && r.set("calendar", e.calendar), e.apiSourceId && r.set("subscriptionId", e.apiSourceId), e.externalEventId && r.set("externalId", e.externalEventId), e.externalEventIdPrefix && !e.externalEventId && r.set("externalIdPrefix", e.externalEventIdPrefix), r.set("returnOrigin", t), r.set("embed", "1"), r.set("sdkVersion", "0.9.0-dev.50"), n && (r.set("entry", "link"), n.campaignId && r.set("campaignId", n.campaignId)), `${i}/en/embed/sync?${r.toString()}`;
|
|
166
166
|
}
|
|
167
167
|
const M = 500, R = 700, me = 500;
|
|
168
168
|
class he {
|
|
@@ -191,7 +191,7 @@ class he {
|
|
|
191
191
|
this.sendStatusToIframe("popup-opened"), this.startPolling(), this.messageHandler = (o) => {
|
|
192
192
|
if (o.origin !== this.opts.liveOrigin || o.source !== this.popup) return;
|
|
193
193
|
const s = o.data;
|
|
194
|
-
!s || typeof s != "object" || s.source !== "moment-live-embed" || s.type !== "moment.embed.result" || (this.resultReceived = !0, this.sendStatusToIframe("completed"), this.opts.iframeWindow && this.opts.iframeWindow.postMessage(s, this.opts.liveOrigin), this.opts.onResult(s), this.cleanup());
|
|
194
|
+
!s || typeof s != "object" || s.source !== "moment-live-embed" || s.type !== "moment.embed.result" || (this.resultReceived = !0, this.sendStatusToIframe("completed"), this.opts.iframeWindow && this.opts.iframeWindow.postMessage(s, this.opts.liveOrigin), e.intent !== "connect" && this.opts.onResult(s), this.cleanup());
|
|
195
195
|
}, window.addEventListener("message", this.messageHandler);
|
|
196
196
|
}
|
|
197
197
|
/**
|
|
@@ -240,7 +240,7 @@ function ge(i, e) {
|
|
|
240
240
|
};
|
|
241
241
|
for (const [r, o] of Object.entries(n))
|
|
242
242
|
o?.length && t.set(r, o.join(","));
|
|
243
|
-
return i.addons?.length && t.set("addons", i.addons.join(",")), t;
|
|
243
|
+
return i.addons?.length && t.set("addons", i.addons.join(",")), i.intent === "connect" && t.set("intent", "connect"), t;
|
|
244
244
|
}
|
|
245
245
|
const k = "moment-sdk-styles", U = "moment-sdk-close", $ = "moment-sdk-tray", fe = `
|
|
246
246
|
:where(.moment-sync-trigger) {
|
|
@@ -292,10 +292,10 @@ function Ce() {
|
|
|
292
292
|
function be(i) {
|
|
293
293
|
return typeof i == "string" && i.startsWith("webcal://");
|
|
294
294
|
}
|
|
295
|
-
function
|
|
295
|
+
function ve(i) {
|
|
296
296
|
return !i || i.closed ? "blocked" : "opened";
|
|
297
297
|
}
|
|
298
|
-
const
|
|
298
|
+
const ye = 1024, w = 600, xe = 400, Ae = 40, H = 80, P = 90, we = 420, Te = 520, B = 48, j = "#0d0d0d", y = "#121316", Se = {
|
|
299
299
|
backgroundColor: j,
|
|
300
300
|
boxShadow: "0 25px 50px -12px rgba(0, 0, 0, 0.25)",
|
|
301
301
|
backdropFilter: "none",
|
|
@@ -329,8 +329,8 @@ const ve = 1024, w = 600, xe = 400, Ae = 40, H = 80, P = 90, we = 420, Te = 520,
|
|
|
329
329
|
alignItems: "center",
|
|
330
330
|
justifyContent: "center"
|
|
331
331
|
};
|
|
332
|
-
function Re(i, e, t = x, n = "v1", r = 0, o =
|
|
333
|
-
const s = n === "v2", a = i <
|
|
332
|
+
function Re(i, e, t = x, n = "v1", r = 0, o = y) {
|
|
333
|
+
const s = n === "v2", a = i < ye, u = {
|
|
334
334
|
showFooter: !s,
|
|
335
335
|
material: s ? "glass" : "solid",
|
|
336
336
|
wrapperMaterial: s ? a ? Le : z : Se,
|
|
@@ -432,7 +432,7 @@ class Ue {
|
|
|
432
432
|
/** The frame the embed last asked for: `v2` (glass) or `v1` (the 0.8.0 look). */
|
|
433
433
|
design = "v1";
|
|
434
434
|
/** The card colour the embed last sent, kept through a v2 sheet so v1 gets it back. */
|
|
435
|
-
surface =
|
|
435
|
+
surface = y;
|
|
436
436
|
/** The height the embed last asked for, so a re-cap after a resize can grow back to it. */
|
|
437
437
|
lastRequestedHeight = null;
|
|
438
438
|
footer = null;
|
|
@@ -607,7 +607,7 @@ class Ue {
|
|
|
607
607
|
overflow: "auto",
|
|
608
608
|
// The sheet colour Live's embeds paint, so the card never flashes white before the
|
|
609
609
|
// embed's theme (and its own `surface`) arrives.
|
|
610
|
-
backgroundColor:
|
|
610
|
+
backgroundColor: y,
|
|
611
611
|
// `tabIndex = -1` above makes this a programmatic focus target for the
|
|
612
612
|
// focus trap, never a Tab stop — but browsers still draw their platform
|
|
613
613
|
// focus ring (blue on stock macOS/Windows) around the whole card when we
|
|
@@ -746,7 +746,7 @@ class Ue {
|
|
|
746
746
|
if (t.source === "moment-live-embed" && t.type === "moment.embed.open.url") {
|
|
747
747
|
const { url: n } = t;
|
|
748
748
|
if (be(n)) {
|
|
749
|
-
const r =
|
|
749
|
+
const r = ve(window.open(n, "_blank"));
|
|
750
750
|
r === "blocked" && this.emitAnalytics("open.url.blocked", {}), this.sendOpenUrlStatus(r, n);
|
|
751
751
|
} else
|
|
752
752
|
this.sendOpenUrlStatus("blocked", typeof n == "string" ? n : "");
|
|
@@ -835,7 +835,7 @@ class Ue {
|
|
|
835
835
|
}
|
|
836
836
|
// ── Private: cleanup ──────────────────────────────────────────────
|
|
837
837
|
cleanup() {
|
|
838
|
-
if (this.closeTimer && (clearTimeout(this.closeTimer), this.closeTimer = null), this.popupBridge && (this.popupBridge.cleanup(), this.popupBridge = null), this.messageHandler && (window.removeEventListener("message", this.messageHandler), this.messageHandler = null), this.feedback?.destroy(), this.feedback = null, this.closeReported = !1, this.design = "v1", this.surface =
|
|
838
|
+
if (this.closeTimer && (clearTimeout(this.closeTimer), this.closeTimer = null), this.popupBridge && (this.popupBridge.cleanup(), this.popupBridge = null), this.messageHandler && (window.removeEventListener("message", this.messageHandler), this.messageHandler = null), this.feedback?.destroy(), this.feedback = null, this.closeReported = !1, this.design = "v1", this.surface = y, this.lastRequestedHeight = null, this.footer = null, this.hairline = null, this.viewportResizeHandler && (window.removeEventListener("resize", this.viewportResizeHandler), this.viewportResizeHandler = null), this.overlay) {
|
|
839
839
|
const { _escHandler: e, _focusTrapHandler: t } = this.overlay;
|
|
840
840
|
e && document.removeEventListener("keydown", e);
|
|
841
841
|
const n = this.overlay.firstElementChild;
|
|
@@ -38,8 +38,9 @@ export declare class PopupBridge {
|
|
|
38
38
|
/**
|
|
39
39
|
* The sign-in popup's query: who is syncing what, and the host page's origin to report back to
|
|
40
40
|
* (never the iframe-supplied one). Schedule selections travel comma-joined in the URL rather than
|
|
41
|
-
* through storage, which browser partitioning would break. `scheduleListIds` carries collections
|
|
42
|
-
*
|
|
41
|
+
* through storage, which browser partitioning would break. `scheduleListIds` carries collections,
|
|
42
|
+
* `addons` the add-on kinds ticked in the sheet, and `intent=connect` a connect-only sign-in
|
|
43
|
+
* (all 0.9.0+). Only `intent` values the SDK defines are forwarded.
|
|
43
44
|
*/
|
|
44
45
|
export declare function popupSearchParams(payload: MomentOAuthStartPayload, returnOrigin: string): URLSearchParams;
|
|
45
46
|
export {};
|
|
@@ -9,9 +9,10 @@
|
|
|
9
9
|
* - `playlist` → subscribe to one of several specific playlists. When more than
|
|
10
10
|
* one slug is supplied, Live fetches each playlist and prompts the user to
|
|
11
11
|
* pick which one to sync.
|
|
12
|
-
* - `schedule` → open the brand's
|
|
13
|
-
* surface where the fan picks any mix of the brand's collections
|
|
14
|
-
* and individual events (moments) and syncs them all
|
|
12
|
+
* - `schedule` → open the brand's hub (a team's or a league's): a multi-select
|
|
13
|
+
* surface where the fan picks any mix of the brand's playlists, collections
|
|
14
|
+
* (curated lists, 0.9.0+) and individual events (moments) and syncs them all
|
|
15
|
+
* at once.
|
|
15
16
|
*/
|
|
16
17
|
export type MomentTriggerType = 'moment' | 'list' | 'team' | 'brand-playlist' | 'playlist' | 'schedule';
|
|
17
18
|
/**
|
|
@@ -63,8 +64,9 @@ export interface MomentSdkInitOptions {
|
|
|
63
64
|
* With a single slug Live syncs that playlist directly; with several it shows
|
|
64
65
|
* a picker. Omit `momentSlug`, `listSlug`, `ids`, `apiSourceId`, and
|
|
65
66
|
* `externalEventId` for this trigger type.
|
|
66
|
-
* - `schedule` → `teamSlug` only. Opens
|
|
67
|
-
*
|
|
67
|
+
* - `schedule` → `teamSlug` only: a team's or a league's. Opens that brand's
|
|
68
|
+
* hub of playlists, collections and events. Omit every other field
|
|
69
|
+
* (including `calendar`, which is ignored here).
|
|
68
70
|
*/
|
|
69
71
|
export interface MomentSdkOpenPayload {
|
|
70
72
|
teamSlug: string;
|
|
@@ -133,6 +135,16 @@ export interface MomentOAuthStartPayload {
|
|
|
133
135
|
scheduleListIds?: string[];
|
|
134
136
|
/** The add-on kinds ticked in the sheet (e.g. `highlights`), saved with the subscription (0.9.0+). */
|
|
135
137
|
addons?: string[];
|
|
138
|
+
/**
|
|
139
|
+
* `connect`: the popup only connects the fan's calendar (Google or Outlook) and subscribes
|
|
140
|
+
* nothing, for the v2 Welcome's Select Calendar. Its result goes to the embed alone: no
|
|
141
|
+
* `onSuccess`, `onError` or `onClose`, and no `subscribe.*` analytics. Omitted for a sync.
|
|
142
|
+
* Any other value is not forwarded (0.9.0+).
|
|
143
|
+
*
|
|
144
|
+
* TODO(sdk-v2 roman Q23): Apple on Select Calendar — Apple is a per-guest webcal feed with no
|
|
145
|
+
* popup, so it has no `intent` value until Roman says what its pill does.
|
|
146
|
+
*/
|
|
147
|
+
intent?: 'connect';
|
|
136
148
|
returnOrigin: string;
|
|
137
149
|
}
|
|
138
150
|
/** Parent → Iframe: relay OAuth popup status */
|
package/package.json
CHANGED