social-embeds 0.9.5 → 0.10.1

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/README.md CHANGED
@@ -117,7 +117,7 @@ JavaScript added to a page in a Next.js 16 production build, gzipped:
117
117
 
118
118
  Before 0.9.4, Next.js kept every platform in a `createSocialEmbed` component as well: about 17 KB for `youtube` alone.
119
119
 
120
- - **A fixed list:** the list is set when the app is built, not per page, and a platform that is not in it is never recognised. If embed code comes from a CMS where editors can paste any platform, list every platform they use, add `genericIframe` and handle the rest with `fallback`, or use `<SocialEmbed>`.
120
+ - **A fixed list:** the list is set when the app is built, not per page, and a platform that is not in it is never recognised. If embed code comes from a CMS where editors can paste any platform, list every platform they use, add `genericIframe` and handle the rest with `fallback`, or use `<SocialEmbed>`. No list is chosen per page at runtime; in Next.js, see [Embed code from a CMS](#embed-code-from-a-cms) for two ways to load less.
121
121
  - **Names:** each platform is exported under its id, as in `embed.platform`: `x`, `instagram`, `threads`, `facebook`, `tiktok`, `youtube`, `telegram`, `snapchat`, `linkedin`, `reddit`, `pinterest`, `spotify`, `vimeo`, `twitch`, `dailymotion`, `bluesky`, `soundcloud`, `applemusic`, `applepodcasts`, `tumblr`, `kick`, `giphy`, `truthsocial`, `imgur`, `tenor`, `streamable`, `strava`, `flickr` and `rumble`. `genericIframe` adds [generic iframe embeds](#generic-iframe-embeds). The order of the list does not matter.
122
122
  - **The same component:** it takes the same props and renders exactly what `<SocialEmbed>` renders for the platforms it knows. Embed code of another platform goes to `fallback`, or to `onError` as `social-embeds: unrecognised embed code`; a URL of another platform is reported as `social-embeds: not a supported post URL: …`. A frame that a named platform serves never renders as a generic iframe, even when that platform is not in the list.
123
123
  - **A client module:** call `createSocialEmbed` once, at the top of a module with `'use client'`, and import the component from there. In the Next.js App Router a Server Component cannot call it, because it comes from a client module; it can render the component it returns.
@@ -346,11 +346,12 @@ A component checks an `embed` before using it: its `url` must be the exact URL `
346
346
  | `maxHeight` | `number` | | Fixed-size iframe embeds only: the embed is at most this tall, in pixels. It narrows to keep its aspect ratio, so a vertical video does not fill the column. |
347
347
  | `placeholder` | `ReactNode` | a skeleton | Shown until the post has loaded. The default skeleton has a per-platform minimum height to limit layout shift. |
348
348
  | `lazy` | `boolean` | `true` | Load the embed only when it comes within 200 px of the viewport. |
349
+ | `iframeTitle` | `string` | per platform | The embed's iframe `title`, which screen readers announce. See [Iframe titles](#iframe-titles). |
349
350
  | `onLoad` | `() => void` | | Called once the platform has rendered the post (iframe embeds: when the iframe has loaded; Telegram, Reddit, Bluesky, Tumblr, Truth Social, Imgur and Strava: when the frame first reports its height). |
350
351
  | `onError` | `(error: Error) => void` | | Called on invalid input, a script that fails to load, or a post that does not render. Components never throw. |
351
352
  | `...rest` | `ComponentProps<'div'>` | | Passed to the wrapper `div` (`className`, `style`, `data-*`, …). |
352
353
 
353
- Script-based embeds try to render three times, waiting 15 s each time, 1 s and then 2 s apart, before `onError` reports the failure. Iframe embeds get 15 s, counted from when the embed comes near the viewport, also with `lazy={false}`. Telegram, Reddit, Bluesky, Tumblr, Truth Social, Imgur and Strava frames that report no height by then show at their starting height; other frames that have not loaded by then show as they are, such as a frame the browser blocked. `onError` reports both, and a frame that loads or reports its height later still calls `onLoad`.
354
+ Script-based embeds try to render three times, waiting 15 s each time, 1 s and then 2 s apart, before `onError` reports the failure. Iframe embeds get 15 s, counted from when the embed comes near the viewport, also with `lazy={false}`. Telegram, Reddit, Bluesky, Tumblr, Truth Social, Imgur and Strava frames count their 15 s only while they are on screen in a visible tab, and start again when they leave it first: browsers paint a frame only there, and Bluesky's and Tumblr's report their height only once painted. Those that report no height by then show at their starting height; other frames that have not loaded by then show as they are, such as a frame the browser blocked. `onError` reports both, and a frame that loads or reports its height later still calls `onLoad`.
354
355
 
355
356
  Instagram's and Threads' script scans only the document, so their embeds cannot render inside another component's shadow root (Lit, Stencil): `onError` reports that at once. X, Facebook and Pinterest embeds work there.
356
357
 
@@ -358,6 +359,32 @@ The scripts the package adds carry the nonce of the page's first `<script nonce>
358
359
 
359
360
  When a script-based embed fails for good, its placeholder goes, as an iframe's does: a URL leaves a "View this post on {Platform}" link to the post, and embed code keeps its fallback content. A platform `<script>` tag already in the page whose platform never appears, such as one written through `innerHTML` or `dangerouslySetInnerHTML` (those never run), holds an embed back for at most 3 s after the page's `load` event; the package then adds its own tag.
360
361
 
362
+ ### Iframe titles
363
+
364
+ Every embed's iframe gets a `title`, so screen readers can name it and Lighthouse's `frame-title` audit passes. The package's own iframes have always had one, such as `YouTube video player`. Instagram's and Threads' scripts add their iframe without a title, so the package gives it `Instagram post` or `Threads post`, also when the script adds or replaces the iframe later. X's and Facebook's scripts title their own iframes (`X Post`, `fb:post Facebook Social Plugin`); a title a script sets is never replaced. Any other iframe a platform script adds without a title gets `X post`, `Facebook post`, `Facebook video` or `Pinterest pin`.
365
+
366
+ `iframeTitle` replaces the default, for example to localise it, but not a title the platform's script set:
367
+
368
+ ```tsx
369
+ <InstagramEmbed url={url} iframeTitle="Публикация в Instagram" />
370
+ ```
371
+
372
+ `<SocialEmbed>` and `createSocialEmbed` components also take a function of the platform id (`'iframe'` for a generic iframe). Return `undefined` to keep the default:
373
+
374
+ ```tsx
375
+ import type { Platform } from 'social-embeds/parser';
376
+
377
+ const TITLES: Partial<Record<Platform | 'iframe', string>> = {
378
+ instagram: 'Публикация в Instagram',
379
+ x: 'Публикация в X',
380
+ tiktok: 'Видео в TikTok',
381
+ };
382
+
383
+ <SocialEmbed html={code} iframeTitle={(platform) => TITLES[platform]} />;
384
+ ```
385
+
386
+ A blank `iframeTitle` keeps the default. A generic iframe keeps the title from its embed code, or `Embedded content`, unless `iframeTitle` gives one. Error messages keep the default title.
387
+
361
388
  ## Platforms
362
389
 
363
390
  | Platform | Mechanism | URL formats | Options read from embed code | Default `maxWidth` |
@@ -629,21 +656,22 @@ Embed code goes in a `<template>`, which keeps the platform's own `<script>` fro
629
656
  </social-embed>
630
657
  ```
631
658
 
632
- | Attribute / property | Meaning |
633
- | -------------------------- | ------------------------------------------------------------------------------------------------------- |
634
- | `html` | Embed code. Usually set as a property (below). |
635
- | `url` | A post URL. |
636
- | `width` | A number means pixels; otherwise any CSS length. |
637
- | `max-width` / `maxWidth` | Pixels: `400` or `400px`. |
638
- | `height` | Pixels: `400` or `400px`. Reaches only iframe-based platforms, as in React. |
639
- | `max-height` / `maxHeight` | Pixels: `400` or `400px`. Reaches only iframe-based platforms, as in React. |
640
- | `eager` | Load at once instead of when near the viewport (the inverse of React's `lazy`); `eager="false"` is off. |
659
+ | Attribute / property | Meaning |
660
+ | ------------------------------ | ------------------------------------------------------------------------------------------------------- |
661
+ | `html` | Embed code. Usually set as a property (below). |
662
+ | `url` | A post URL. |
663
+ | `width` | A number means pixels; otherwise any CSS length. |
664
+ | `max-width` / `maxWidth` | Pixels: `400` or `400px`. |
665
+ | `height` | Pixels: `400` or `400px`. Reaches only iframe-based platforms, as in React. |
666
+ | `max-height` / `maxHeight` | Pixels: `400` or `400px`. Reaches only iframe-based platforms, as in React. |
667
+ | `eager` | Load at once instead of when near the viewport (the inverse of React's `lazy`); `eager="false"` is off. |
668
+ | `iframe-title` / `iframeTitle` | The iframe's `title`, as React's `iframeTitle` (a string only). |
641
669
 
642
- Each property reflects its attribute, so framework property bindings such as Angular's `[url]` work. `url` and the size properties take a string, and `null` removes the attribute; `eager` takes a boolean.
670
+ Each property reflects its attribute, so framework property bindings such as Angular's `[url]` work. `url`, `iframeTitle` and the size properties take a string, and `null` removes the attribute; `eager` takes a boolean.
643
671
 
644
672
  The `html` property takes embed code from script. From a framework, pass embed code this way: a `<template>` the framework renders keeps its children in `childNodes`, not in `content`, where the element reads them. Before the tag is defined, React 19, Vue and Svelte write `html` as an attribute, and server HTML can carry it that way too; the element reads that attribute. When several inputs are set, the `html` property wins over the `html` attribute, which wins over the `<template>`, which wins over `url`. Options come only from the embed code, as with `<SocialEmbed>`, and the element renders into the light DOM. The element has no `playerId`, so Dailymotion needs embed code that names a Player ID; a Dailymotion URL alone fires `error`.
645
673
 
646
- The element's own children other than `<template>` are never rendered and never moved, so a framework that renders children into it keeps owning them. Copies of them, taken each time the embed starts and without their `id`s, are the placeholder until it loads; without any, a neutral skeleton shows. Embed code written straight inside the element, without a `<template>` (as a CMS that strips `<template>` leaves it), is used as `html` when there is no other input. Changing `width`, `max-width`, `height` or `max-height` restyles the embed in place; only a new `url` or `html` starts it again. The embed renders into a `<div slot="embed">` in the light DOM, which a shadow root holding only that slot shows; the `embed` slot name is the element's own. If other code removes that `<div>`, for example a framework setting a text child or a DOM morph, the embed starts again. If the element connects while the document is still loading, it waits for `DOMContentLoaded` before reading its children.
674
+ The element's own children other than `<template>` are never rendered and never moved, so a framework that renders children into it keeps owning them. Copies of them, taken each time the embed starts and without their `id`s, are the placeholder until it loads; without any, a neutral skeleton shows. Embed code written straight inside the element, without a `<template>` (as a CMS that strips `<template>` leaves it), is used as `html` when there is no other input. Changing `width`, `max-width`, `height`, `max-height` or `iframe-title` restyles or retitles the embed in place; only a new `url` or `html` starts it again. The embed renders into a `<div slot="embed">` in the light DOM, which a shadow root holding only that slot shows; the `embed` slot name is the element's own. If other code removes that `<div>`, for example a framework setting a text child or a DOM morph, the embed starts again. If the element connects while the document is still loading, it waits for `DOMContentLoaded` before reading its children.
647
675
 
648
676
  It dispatches `load` (an `Event`) when the platform has rendered, and `error` (an `ErrorEvent`) when it cannot. `error.error` is an `Error` with the same message as React's `onError`. Neither event bubbles, both fire in a microtask, and only while the element is connected.
649
677
 
@@ -706,7 +734,71 @@ export function Embed({ html }: { html: string }) {
706
734
 
707
735
  Client navigation needs nothing extra: each platform script loads once per page, and an embed that mounts after navigation renders without loading it again. With `lazy` (the default), a page with five embeds loads no platform script until the first embed comes near the viewport, and each embed then renders only when it comes near.
708
736
 
709
- In a Next.js 16 production build, with Turbopack (the default) or webpack, a platform component adds about 3 to 5.5 KB gzipped to a page (`FacebookEmbed` about 7 KB), a [`createSocialEmbed`](#only-the-platforms-you-use) component with five platforms about 12 to 13 KB, and `<SocialEmbed>` about 27 KB. Before 0.9.4, any one component added at least 15 KB under Turbopack. When a page's embed code comes from a CMS and can be any platform, `<SocialEmbed>` is the component that recognises all of them.
737
+ In a Next.js 16 production build, with Turbopack (the default) or webpack, a platform component adds about 3 to 5.5 KB gzipped to a page (`FacebookEmbed` about 7 KB), a [`createSocialEmbed`](#only-the-platforms-you-use) component with five platforms about 12 to 13 KB, and `<SocialEmbed>` about 27 KB. Before 0.9.4, any one component added at least 15 KB under Turbopack. When a page's embed code comes from a CMS and can be any platform, `<SocialEmbed>` is the component that recognises all of them; see [Embed code from a CMS](#embed-code-from-a-cms) for loading less of it.
738
+
739
+ ### Embed code from a CMS
740
+
741
+ Nothing chooses platforms per page. In a Next.js 16 build, Turbopack and webpack put every component a route can render into one chunk, so a page with one X post loads the same code as a page with every platform. Two things load less.
742
+
743
+ **Pages without an embed, under Turbopack.** Turbopack loads the package on every page of a route that renders embeds, also on a page that has none: about 27 KB with `<SocialEmbed>`. Load it through `next/dynamic` instead:
744
+
745
+ ```tsx
746
+ // app/lazy-social-embed.tsx
747
+ 'use client';
748
+
749
+ import dynamic from 'next/dynamic';
750
+ import type { SocialEmbedProps } from 'social-embeds';
751
+
752
+ const SocialEmbed = dynamic(() =>
753
+ import('social-embeds').then((module) => module.SocialEmbed),
754
+ );
755
+
756
+ export function LazySocialEmbed(props: SocialEmbedProps) {
757
+ return <SocialEmbed {...props} />;
758
+ }
759
+ ```
760
+
761
+ Render `<LazySocialEmbed>` where you rendered `<SocialEmbed>`. A page without an embed then adds 1.8 KB, and a page with one about 29 KB. webpack already loads nothing on a page without an embed.
762
+
763
+ **Recognition on the server.** `parseEmbed` in a Server Component keeps the code that reads embed code out of the browser. Render the component of each platform your editors use:
764
+
765
+ ```tsx
766
+ // app/server-embed.tsx: a Server Component
767
+ import {
768
+ FacebookEmbed,
769
+ GenericIframeEmbed,
770
+ InstagramEmbed,
771
+ TikTokEmbed,
772
+ XEmbed,
773
+ YouTubeEmbed,
774
+ } from 'social-embeds';
775
+ import { parseEmbed, parseIframe } from 'social-embeds/parser';
776
+
777
+ export function ServerEmbed({ html }: { html: string }) {
778
+ const embed = parseEmbed(html);
779
+ if (!embed) {
780
+ const iframe = parseIframe(html);
781
+ return iframe ? <GenericIframeEmbed embed={iframe} /> : null;
782
+ }
783
+ switch (embed.platform) {
784
+ case 'x':
785
+ return <XEmbed embed={embed} />;
786
+ case 'instagram':
787
+ return <InstagramEmbed embed={embed} />;
788
+ case 'facebook':
789
+ return <FacebookEmbed embed={embed} locale="bg_BG" />;
790
+ case 'tiktok':
791
+ return <TikTokEmbed embed={embed} />;
792
+ case 'youtube':
793
+ return <YouTubeEmbed embed={embed} />;
794
+ // … one case for each platform your editors use
795
+ default:
796
+ return null;
797
+ }
798
+ }
799
+ ```
800
+
801
+ With every platform in the switch it adds about 21 KB under Turbopack or webpack, against 27 KB for `<SocialEmbed>`; with the five above and generic iframes, about 12 KB under Turbopack. As with `<SocialEmbed>`, Turbopack loads it on every page of the route, and webpack only on a page with an embed. Each case can pass the platform's own props, such as Facebook's `locale`, which `<SocialEmbed>` has no prop for. Return your own fallback where the switch returns `null`. `onLoad` and `onError` cannot be passed from a Server Component, so a platform component that needs them goes in a Client Component of your own, as above.
710
802
 
711
803
  ## Server-side fallback content
712
804
 
@@ -23,6 +23,16 @@ function useNearViewport(ref, lazy) {
23
23
  }, [ref, lazy]);
24
24
  return near;
25
25
  }
26
+ /** Whether `watch` reports the element on screen; false while `watch` is undefined. */
27
+ function useOnScreen(ref, watch) {
28
+ const [onScreen, setOnScreen] = useState(false);
29
+ useEffect(() => {
30
+ const element = ref.current;
31
+ if (!watch || !element) return;
32
+ return watch(element, setOnScreen);
33
+ }, [ref, watch]);
34
+ return watch !== void 0 && onScreen;
35
+ }
26
36
  /** Calls `onError` from an effect, once per distinct message. */
27
37
  function useReportError(message, onError) {
28
38
  const latest = useRef(onError);
@@ -35,4 +45,4 @@ function useReportError(message, onError) {
35
45
  reported.current = message;
36
46
  }, [message]);
37
47
  }
38
- export { useNearViewport, useReportError };
48
+ export { useNearViewport, useOnScreen, useReportError };
@@ -1,6 +1,7 @@
1
+ import { titleOr } from "../core/frame-title.js";
1
2
  import { FRAME_TIMEOUT_MS } from "../core/timing.js";
2
3
  import { frameStyle } from "../core/layout.js";
3
- import { useNearViewport } from "./hooks.js";
4
+ import { useNearViewport, useOnScreen } from "./hooks.js";
4
5
  import { useCallback, useEffect, useRef, useState } from "react";
5
6
  import { jsx, jsxs } from "react/jsx-runtime";
6
7
  // src/components/iframe-embed.tsx
@@ -39,12 +40,13 @@ const FILL = {
39
40
  function IframeEmbed(props) {
40
41
  return /* @__PURE__ */ jsx(Frame, { ...props }, props.src);
41
42
  }
42
- function Frame({ src, title, allow, allowFullscreen = true, referrerPolicy, scrolling, sandbox, ratio, size, messageHeight, startHeight, clientSrc, borderRadius, sizeInSrc, width, maxWidth, height, maxHeight, placeholder, lazy = true, onLoad, onError, style, ...rest }) {
43
+ function Frame({ src, title, allow, allowFullscreen = true, referrerPolicy, scrolling, sandbox, ratio, size, messageHeight, startHeight, clientSrc, borderRadius, sizeInSrc, iframeTitle, width, maxWidth, height, maxHeight, placeholder, lazy = true, onLoad, onError, style, ...rest }) {
43
44
  const frame = useRef(null);
44
45
  const iframe = useRef(null);
45
46
  const near = useNearViewport(frame, lazy);
46
- const inView = useNearViewport(frame, !lazy);
47
47
  const [loaded, setLoaded] = useState(false);
48
+ const inView = useNearViewport(frame, !lazy && !messageHeight);
49
+ const onScreen = useOnScreen(frame, near && !loaded ? messageHeight?.onScreen : void 0);
48
50
  const [reportedHeight, setReportedHeight] = useState();
49
51
  const [boxWidth, setBoxWidth] = useState();
50
52
  const reported = useRef(false);
@@ -85,8 +87,9 @@ function Frame({ src, title, allow, allowFullscreen = true, referrerPolicy, scro
85
87
  if (!near || !sized || !element) return;
86
88
  return sizing.current?.watch(element, setBoxWidth);
87
89
  }, [near, sized]);
90
+ const counting = messageHeight ? onScreen : inView;
88
91
  useEffect(() => {
89
- if (!near || !inView) return;
92
+ if (!near || !counting) return;
90
93
  const failure = messageHeight ? "did not report its height" : "did not load";
91
94
  const timer = setTimeout(() => {
92
95
  if (reported.current) return;
@@ -98,7 +101,7 @@ function Frame({ src, title, allow, allowFullscreen = true, referrerPolicy, scro
98
101
  };
99
102
  }, [
100
103
  near,
101
- inView,
104
+ counting,
102
105
  messageHeight,
103
106
  title
104
107
  ]);
@@ -131,7 +134,7 @@ function Frame({ src, title, allow, allowFullscreen = true, referrerPolicy, scro
131
134
  children: [near && frameSrc !== void 0 && /* @__PURE__ */ jsx("iframe", {
132
135
  ref: iframe,
133
136
  src: clientSrc ? clientSrc(frameSrc) : frameSrc,
134
- title,
137
+ title: titleOr(iframeTitle, title),
135
138
  allow,
136
139
  allowFullScreen: allowFullscreen,
137
140
  referrerPolicy,
@@ -1,4 +1,5 @@
1
1
  import { FinalError } from "../core/drivers.js";
2
+ import { titleFrames, titleOr } from "../core/frame-title.js";
2
3
  import { postLinkText, postUrl } from "../core/post-link.js";
3
4
  import { RENDER_TIMEOUT_MS, RETRY_DELAY_MS } from "../core/timing.js";
4
5
  import { useNearViewport } from "./hooks.js";
@@ -9,9 +10,10 @@ import { jsx, jsxs } from "react/jsx-runtime";
9
10
  const LAYER = { width: "100%" };
10
11
  /** A platform component's script embed: it sizes itself, so `height` and `maxHeight` are dropped. */
11
12
  function scriptOf(plan, props) {
12
- const { maxWidth, height, maxHeight, ...rest } = props;
13
+ const { maxWidth, height, maxHeight, iframeTitle, ...rest } = props;
13
14
  return /* @__PURE__ */ jsx(ScriptEmbed, {
14
15
  ...rest,
16
+ iframeTitle: titleOr(iframeTitle, plan.title),
15
17
  maxWidth: maxWidth ?? plan.maxWidth,
16
18
  driver: plan.driver,
17
19
  markup: plan.markup,
@@ -23,7 +25,7 @@ function scriptOf(plan, props) {
23
25
  function toError(error) {
24
26
  return error instanceof Error ? error : new Error(String(error));
25
27
  }
26
- function ScriptEmbed({ driver, markup, hasFallback, minHeight, label, width = "100%", maxWidth, placeholder, lazy = true, onLoad, onError, style, ...rest }) {
28
+ function ScriptEmbed({ driver, markup, hasFallback, minHeight, label, iframeTitle, width = "100%", maxWidth, placeholder, lazy = true, onLoad, onError, style, ...rest }) {
27
29
  const container = useRef(null);
28
30
  const near = useNearViewport(container, lazy);
29
31
  const [rendered, setRendered] = useState(false);
@@ -39,6 +41,11 @@ function ScriptEmbed({ driver, markup, hasFallback, minHeight, label, width = "1
39
41
  onError
40
42
  };
41
43
  });
44
+ useEffect(() => {
45
+ const element = container.current;
46
+ if (!element) return;
47
+ return titleFrames(element, iframeTitle);
48
+ }, [iframeTitle]);
42
49
  useEffect(() => {
43
50
  const element = container.current;
44
51
  if (!near || !element || done.current) return;
@@ -16,6 +16,8 @@ export type SharedProps = Omit<ComponentProps<'div'>, 'children' | 'onLoad' | 'o
16
16
  placeholder?: ReactNode;
17
17
  /** Load the embed only when it comes near the viewport. Default `true`. */
18
18
  lazy?: boolean;
19
+ /** The iframe's `title`. Default: per platform. A title the platform's script sets is kept. */
20
+ iframeTitle?: string;
19
21
  /** Fires once the platform has rendered the post. */
20
22
  onLoad?: () => void;
21
23
  /** Fires on invalid input, script load failure or init timeout. */
@@ -1,5 +1,5 @@
1
1
  import { PlatformParser } from "../parser/platform.js";
2
- import { ParsedEmbed } from "../parser/types.js";
2
+ import { ParsedEmbed, Platform } from "../parser/types.js";
3
3
  import "./bluesky-embed.js";
4
4
  import "./dailymotion-embed.js";
5
5
  import { BlueskyOptions } from "../core/plans/bluesky.js";
@@ -51,16 +51,23 @@ export type SocialEmbedSource = {
51
51
  html?: never;
52
52
  };
53
53
  type PlatformOption = keyof XOptions | keyof InstagramOptions | keyof ThreadsOptions | keyof FacebookOptions | keyof TikTokOptions | keyof YouTubeOptions | keyof TelegramOptions | keyof RedditOptions | keyof LinkedInOptions | keyof PinterestOptions | keyof VimeoOptions | keyof TwitchOptions | keyof DailymotionOptions | keyof BlueskyOptions | keyof SoundCloudOptions | keyof KickOptions | keyof StreamableOptions | keyof ImgurOptions | keyof StravaOptions | keyof FlickrOptions;
54
- export type SocialEmbedProps = SocialEmbedSource & Omit<FrameProps, PlatformOption> & {
54
+ export type SocialEmbedProps = SocialEmbedSource & Omit<FrameProps, PlatformOption | 'iframeTitle'> & {
55
55
  /**
56
56
  * Called with the original string when `html` is neither a platform's embed code nor a
57
57
  * safe iframe. Without it, nothing is rendered and `onError` is called.
58
58
  */
59
59
  fallback?: (html: string) => ReactNode;
60
+ /**
61
+ * The iframe's `title`, or a function of the platform (`'iframe'` for a generic iframe) that
62
+ * returns it; `undefined` keeps the default. A title the platform's script sets is kept.
63
+ */
64
+ iframeTitle?: string | ((platform: Platform | 'iframe') => string | undefined);
60
65
  };
61
66
  /** What `<SocialEmbed>` passes on to the platform it renders. */
62
67
  export type RouteProps = {
63
- shared: Omit<SocialEmbedProps, 'html' | 'url' | 'fallback' | 'height' | 'maxHeight' | 'onError'>;
68
+ shared: Omit<SocialEmbedProps, 'html' | 'url' | 'fallback' | 'height' | 'maxHeight' | 'onError' | 'iframeTitle'> & {
69
+ iframeTitle?: string;
70
+ };
64
71
  frame: Pick<FrameProps, 'height' | 'maxHeight'>;
65
72
  onError: FrameProps['onError'];
66
73
  };
@@ -14,15 +14,18 @@ function tableOf(list) {
14
14
  };
15
15
  }
16
16
  function useSocialEmbed(props, table) {
17
- const { html, url, fallback, height, maxHeight, onError, ...shared } = props;
18
- const route = {
19
- shared,
17
+ const { html, url, fallback, height, maxHeight, onError, iframeTitle, ...shared } = props;
18
+ const route = (platform) => ({
19
+ shared: {
20
+ ...shared,
21
+ iframeTitle: typeof iframeTitle === "function" ? iframeTitle(platform) : iframeTitle
22
+ },
20
23
  frame: {
21
24
  height,
22
25
  maxHeight
23
26
  },
24
27
  onError
25
- };
28
+ });
26
29
  const embed = useMemo(() => html !== void 0 ? parseEmbedWith(table.parsers, html) : matchUrlWith(table.parsers, url), [
27
30
  html,
28
31
  url,
@@ -34,9 +37,9 @@ function useSocialEmbed(props, table) {
34
37
  table
35
38
  ]);
36
39
  useReportError(embed === null && iframe === null && !(html !== void 0 && fallback) ? sourceError(html !== void 0 ? { html } : { url }) : void 0, onError);
37
- if (iframe && table.iframe) return table.iframe.render(iframe, route);
40
+ if (iframe && table.iframe) return table.iframe.render(iframe, route("iframe"));
38
41
  if (!embed) return html !== void 0 && fallback ? fallback(html) : null;
39
- return table.renders.get(embed.platform)?.(embed, route) ?? null;
42
+ return table.renders.get(embed.platform)?.(embed, route(embed.platform)) ?? null;
40
43
  }
41
44
  /**
42
45
  * A `<SocialEmbed>` that recognises only the listed platforms, so a bundler leaves the others
@@ -70,11 +70,19 @@ const instagramDriver = {
70
70
  return stop;
71
71
  }
72
72
  };
73
+ let threadsIds = 0;
74
+ function ownId(container) {
75
+ const blockquote = container.querySelector("blockquote");
76
+ if (!blockquote?.id || blockquote.hasAttribute("class")) return;
77
+ threadsIds += 1;
78
+ blockquote.id = `${blockquote.id}-${String(threadsIds)}`;
79
+ }
73
80
  const threadsDriver = {
74
81
  load: () => loadThreads(),
75
82
  render(container, done) {
76
83
  inDocument(container, "Threads");
77
84
  const stop = watch(container, (element) => element.querySelector("iframe") !== null && element.querySelector("blockquote") === null, done);
85
+ ownId(container);
78
86
  reveal(container, "text-post-media");
79
87
  processEmbeds();
80
88
  return stop;
@@ -0,0 +1,35 @@
1
+ // src/core/frame-title.ts
2
+ const ours = /* @__PURE__ */ new WeakMap();
3
+ function retitle(container, title) {
4
+ for (const iframe of container.querySelectorAll("iframe")) {
5
+ const current = iframe.getAttribute("title");
6
+ if (current === title) continue;
7
+ if (current?.trim() && current !== ours.get(iframe)) continue;
8
+ iframe.setAttribute("title", title);
9
+ ours.set(iframe, title);
10
+ }
11
+ }
12
+ /** `title`, unless it is missing or blank. */
13
+ function titleOr(title, fallback) {
14
+ return title?.trim() ? title : fallback;
15
+ }
16
+ /**
17
+ * Titles each iframe under `container` that has none, including ones a platform script adds or
18
+ * replaces later (docs/decisions.md D119). Returns the cleanup.
19
+ */
20
+ function titleFrames(container, title) {
21
+ retitle(container, title);
22
+ const observer = new MutationObserver(() => {
23
+ retitle(container, title);
24
+ });
25
+ observer.observe(container, {
26
+ subtree: true,
27
+ childList: true,
28
+ attributes: true,
29
+ attributeFilter: ["title"]
30
+ });
31
+ return () => {
32
+ observer.disconnect();
33
+ };
34
+ }
35
+ export { titleFrames, titleOr };
@@ -21,4 +21,34 @@ function listenForHeight(frame, onHeight) {
21
21
  window.removeEventListener("message", listen);
22
22
  };
23
23
  }
24
- export { listenForHeight };
24
+ /**
25
+ * `MessageHeight.onScreen`: whether the element is in the viewport of a visible page, once at the
26
+ * first observation, then on each change. Without IntersectionObserver it is always on screen.
27
+ */
28
+ function watchOnScreen(element, onChange) {
29
+ if (typeof IntersectionObserver === "undefined") {
30
+ onChange(true);
31
+ return () => {};
32
+ }
33
+ let intersecting = false;
34
+ let last;
35
+ const update = () => {
36
+ const onScreen = intersecting && document.visibilityState !== "hidden";
37
+ if (onScreen === last) return;
38
+ last = onScreen;
39
+ onChange(onScreen);
40
+ };
41
+ const observer = new IntersectionObserver((entries) => {
42
+ const entry = entries[entries.length - 1];
43
+ if (!entry) return;
44
+ intersecting = entry.isIntersecting;
45
+ update();
46
+ });
47
+ observer.observe(element);
48
+ document.addEventListener("visibilitychange", update);
49
+ return () => {
50
+ observer.disconnect();
51
+ document.removeEventListener("visibilitychange", update);
52
+ };
53
+ }
54
+ export { listenForHeight, watchOnScreen };
@@ -1,5 +1,5 @@
1
1
  import { query } from "../params.js";
2
- import { listenForHeight } from "../message-height.js";
2
+ import { listenForHeight, watchOnScreen } from "../message-height.js";
3
3
  // src/core/plans/bluesky.ts
4
4
  /** The frame posts `{ height }` once it has painted (docs/decisions.md D70). */
5
5
  const BLUESKY_HEIGHT = {
@@ -8,7 +8,8 @@ const BLUESKY_HEIGHT = {
8
8
  const height = data?.height;
9
9
  return typeof height === "number" ? height : void 0;
10
10
  },
11
- listen: listenForHeight
11
+ listen: listenForHeight,
12
+ onScreen: watchOnScreen
12
13
  };
13
14
  /**
14
15
  * At most 600px wide by default, Bluesky's oEmbed width. Renders the frame `embed.js` would
@@ -72,6 +72,7 @@ function facebookPlan(embed, options) {
72
72
  driver: facebookDriver(sdkLocale),
73
73
  minHeight: MIN_HEIGHT[embed.kind],
74
74
  label: "Facebook",
75
+ title: embed.kind === "video" ? "Facebook video" : "Facebook post",
75
76
  hasFallback: hasFallback(embed.fallbackHtml),
76
77
  maxWidth: embed.kind === "post" ? POST_MAX_WIDTH : void 0
77
78
  };
@@ -1,4 +1,4 @@
1
- import { listenForHeight } from "../message-height.js";
1
+ import { listenForHeight, watchOnScreen } from "../message-height.js";
2
2
  // src/core/plans/imgur.ts
3
3
  /** The frame posts one JSON string at `load`, unasked (docs/decisions.md D94). */
4
4
  const IMGUR_HEIGHT = {
@@ -8,7 +8,8 @@ const IMGUR_HEIGHT = {
8
8
  const message = JSON.parse(data);
9
9
  return message.message === "resize_imgur" && typeof message.height === "number" ? message.height : void 0;
10
10
  },
11
- listen: listenForHeight
11
+ listen: listenForHeight,
12
+ onScreen: watchOnScreen
12
13
  };
13
14
  /** At most 540px wide by default, the widest `embed.js` makes the frame (docs/decisions.md D94). */
14
15
  function imgurPlan(embed, options) {
@@ -19,6 +19,7 @@ function instagramPlan(embed, options) {
19
19
  driver: instagramDriver,
20
20
  minHeight: MIN_HEIGHT,
21
21
  label: "Instagram",
22
+ title: "Instagram post",
22
23
  hasFallback: hasFallback(embed.fallbackHtml),
23
24
  maxWidth: 540
24
25
  };
@@ -24,6 +24,7 @@ function pinterestPlan(embed, options) {
24
24
  driver: pinterestDriver,
25
25
  minHeight: MIN_HEIGHT,
26
26
  label: "Pinterest",
27
+ title: "Pinterest pin",
27
28
  hasFallback: false,
28
29
  maxWidth: PIN_WIDTHS[String(merged.width)] ?? DEFAULT_PIN_WIDTH
29
30
  };
@@ -1,5 +1,5 @@
1
1
  import { query } from "../params.js";
2
- import { listenForHeight } from "../message-height.js";
2
+ import { listenForHeight, watchOnScreen } from "../message-height.js";
3
3
  // src/core/plans/reddit.ts
4
4
  const PARAMS = {
5
5
  theme: "theme",
@@ -20,7 +20,8 @@ const REDDIT_HEIGHT = {
20
20
  const message = JSON.parse(data);
21
21
  return message.type === "resize.embed" && typeof message.data === "number" ? message.data : void 0;
22
22
  },
23
- listen: listenForHeight
23
+ listen: listenForHeight,
24
+ onScreen: watchOnScreen
24
25
  };
25
26
  /** At most 640px wide by default, the width widgets.js gives the frame (docs/decisions.md D52). */
26
27
  function redditPlan(embed, options) {
@@ -1,4 +1,4 @@
1
- import { listenForHeight } from "../message-height.js";
1
+ import { listenForHeight, watchOnScreen } from "../message-height.js";
2
2
  // src/core/plans/strava.ts
3
3
  const NS = "social-embeds";
4
4
  /** The frame posts `[ns, 'BROADCAST_IFRAME_HEIGHT', height]` once, unasked (docs/decisions.md D97). */
@@ -9,7 +9,8 @@ const STRAVA_HEIGHT = {
9
9
  const [, type, height] = data;
10
10
  return type === "BROADCAST_IFRAME_HEIGHT" && typeof height === "number" ? height : void 0;
11
11
  },
12
- listen: listenForHeight
12
+ listen: listenForHeight,
13
+ onScreen: watchOnScreen
13
14
  };
14
15
  function styleOf(value) {
15
16
  return value === "minimal" ? "minimal" : "standard";
@@ -1,5 +1,5 @@
1
1
  import { query } from "../params.js";
2
- import { listenForHeight } from "../message-height.js";
2
+ import { listenForHeight, watchOnScreen } from "../message-height.js";
3
3
  // src/core/plans/telegram.ts
4
4
  const PARAMS = [
5
5
  ["comment", "comment"],
@@ -26,7 +26,8 @@ const TELEGRAM_HEIGHT = {
26
26
  const message = JSON.parse(data);
27
27
  return message.event === "resize" && typeof message.height === "number" ? message.height : void 0;
28
28
  },
29
- listen: listenForHeight
29
+ listen: listenForHeight,
30
+ onScreen: watchOnScreen
30
31
  };
31
32
  /** At most 500px wide by default, the widest the post renders (docs/decisions.md D49). */
32
33
  function telegramPlan(embed, options) {
@@ -18,6 +18,7 @@ function threadsPlan(embed, options) {
18
18
  driver: threadsDriver,
19
19
  minHeight: MIN_HEIGHT,
20
20
  label: "Threads",
21
+ title: "Threads post",
21
22
  hasFallback: hasFallback(embed.fallbackHtml),
22
23
  maxWidth: 658
23
24
  };
@@ -1,4 +1,4 @@
1
- import { listenForHeight } from "../message-height.js";
1
+ import { listenForHeight, watchOnScreen } from "../message-height.js";
2
2
  // src/core/plans/truthsocial.ts
3
3
  const VIDEO_EXTRA = 165;
4
4
  function setHeight(data) {
@@ -9,7 +9,8 @@ function setHeight(data) {
9
9
  const TRUTH_SOCIAL_HEIGHT = {
10
10
  origin: "https://truthsocial.com",
11
11
  read: setHeight,
12
- listen: listenForHeight
12
+ listen: listenForHeight,
13
+ onScreen: watchOnScreen
13
14
  };
14
15
  /** A video post reports its height before the video is sized (docs/decisions.md D100). */
15
16
  const TRUTH_SOCIAL_VIDEO_HEIGHT = {
@@ -18,7 +19,8 @@ const TRUTH_SOCIAL_VIDEO_HEIGHT = {
18
19
  const height = setHeight(data);
19
20
  return height === void 0 || height <= 0 ? void 0 : height + VIDEO_EXTRA;
20
21
  },
21
- listen: listenForHeight
22
+ listen: listenForHeight,
23
+ onScreen: watchOnScreen
22
24
  };
23
25
  const CANONICAL = /^https:\/\/truthsocial\.com\/(@[^/]+)\/posts\/\d+$/;
24
26
  /** At most 600px wide by default, the width of Truth Social's embed code (docs/decisions.md D93). */
@@ -1,4 +1,4 @@
1
- import { listenForHeight } from "../message-height.js";
1
+ import { listenForHeight, watchOnScreen } from "../message-height.js";
2
2
  // src/core/plans/tumblr.ts
3
3
  /** The frame posts a JSON string once it has painted (docs/decisions.md D74). */
4
4
  const TUMBLR_HEIGHT = {
@@ -9,7 +9,8 @@ const TUMBLR_HEIGHT = {
9
9
  const [height] = Array.isArray(message.args) ? message.args : [];
10
10
  return message.method === "tumblr-post:sizeChange" && typeof height === "number" ? height : void 0;
11
11
  },
12
- listen: listenForHeight
12
+ listen: listenForHeight,
13
+ onScreen: watchOnScreen
13
14
  };
14
15
  /** At most 540px wide by default, Tumblr's oEmbed width. Renders the frame `post.js` would create (docs/decisions.md D77). */
15
16
  function tumblrPlan(embed) {
@@ -24,6 +24,7 @@ function xPlan(embed, options) {
24
24
  driver: xDriver,
25
25
  minHeight: MIN_HEIGHT,
26
26
  label: "X",
27
+ title: "X post",
27
28
  hasFallback: hasFallback(embed.fallbackHtml),
28
29
  maxWidth: 550
29
30
  };
package/dist/element.d.ts CHANGED
@@ -18,6 +18,8 @@ export declare class SocialEmbedElement extends Base {
18
18
  set height(value: string | null);
19
19
  get maxHeight(): string | null;
20
20
  set maxHeight(value: string | null);
21
+ get iframeTitle(): string | null;
22
+ set iframeTitle(value: string | null);
21
23
  get eager(): boolean;
22
24
  set eager(value: boolean | string | null | undefined);
23
25
  connectedCallback(): void;
package/dist/element.js CHANGED
@@ -1 +1 @@
1
- const e=`autoplay *; encrypted-media *; fullscreen *; clipboard-write`,t=`allow-forms allow-popups allow-same-origin allow-scripts allow-storage-access-by-user-activation allow-top-navigation-by-user-activation`;function n(n){let r=n.url.slice(23),i=r.includes(`/song/`)||r.includes(`?i=`);return{kind:`iframe`,src:`https://embed.music.apple.com${r}`,title:`Apple Music player`,allow:e,sandbox:t,ratio:{width:16,height:9},height:n.size?.height??(i?175:450),maxWidth:660,borderRadius:10}}function r(n){let r=n.url.slice(26);return{kind:`iframe`,src:`https://embed.podcasts.apple.com${r}`,title:`Apple Podcasts player`,allow:e,sandbox:t,ratio:{width:16,height:9},height:n.size?.height??(r.includes(`?i=`)?160:450),maxWidth:640,borderRadius:12}}function i(e,t){return Object.entries(e).filter(([e])=>!t.includes(e.toLowerCase()))}function a(...e){let t=/* @__PURE__ */ new Map;for(let n of e)for(let[e,r]of n??[])t.set(e,String(r));let n=[...t].map(([e,t])=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`);return n.length>0?`?${n.join(`&`)}`:``}function o(e,t){let n=[];for(let[r,i]of Object.entries(t)){let t=e[r];typeof t==`boolean`?n.push([i,+!!t]):(typeof t==`string`||typeof t==`number`)&&n.push([i,t])}return n}function s(e,t){let{origin:n,read:r}=this,i=i=>{if(i.origin!==n)return;let a=e();if(!a||i.source!==a.contentWindow)return;let o;try{o=r(i.data)}catch{return}typeof o==`number`&&o>0&&o<=5e4&&t(Math.ceil(o))};return window.addEventListener(`message`,i),()=>{window.removeEventListener(`message`,i)}}const c={origin:`https://embed.bsky.app`,read(e){let t=e?.height;return typeof t==`number`?t:void 0},listen:s};function l(e,t){let n=t.colorMode??e.options.colorMode;return{kind:`iframe`,src:`https://embed.bsky.app/embed/${e.id}${a(typeof n==`string`?[[`colorMode`,n]]:void 0)}`,title:`Bluesky post`,allow:``,scrolling:`no`,ratio:{width:1,height:1},messageHeight:c,startHeight:300,maxWidth:600,fallbackHtml:e.fallbackHtml}}const u=/^x[a-z0-9]{3,12}$/;function d(e,t){let{playerId:n,mute:r,startTime:o,loop:s}=t,{playerId:c,...l}=e.options,d=n??c;if(d===void 0)return{kind:`error`,message:`social-embeds: a Dailymotion embed needs a Player ID: pass playerId to DailymotionEmbed`};if(typeof d!=`string`||!u.test(d))return{kind:`error`,message:`social-embeds: not a Dailymotion Player ID: ${String(d)}`};let f=[];return r!==void 0&&f.push([`mute`,String(r)]),o!==void 0&&f.push([`startTime`,o]),s!==void 0&&f.push([`loop`,String(s)]),{kind:`iframe`,src:`https://geo.dailymotion.com/player/${d}.html${a([[`video`,e.id]],i(l,[`video`,`playlist`]),f)}`,title:`Dailymotion video player`,allow:`autoplay; fullscreen; picture-in-picture; web-share`,ratio:{width:16,height:9},size:e.size}}const f=15e3,p=3e3,m=/* @__PURE__ */ new Map;function h(e){if(typeof document>`u`)return Promise.reject(/* @__PURE__ */ Error(`social-embeds: platform scripts load only in the browser`));let t=m.get(e.key);return t||(t=g(e).catch(t=>{throw m.delete(e.key),t}),m.set(e.key,t)),t}async function g(e){if(!e.isPresent()){let t=[...document.querySelectorAll(`script[src]`)].filter(t=>e.isOwn(t.src));t.length!==0&&await _(e,t)||await y(e)}await e.whenPresent?.()}function _(e,t){return new Promise(n=>{let r=Date.now()+(document.readyState===`complete`?p:f),i,a=()=>{r=Date.now()+p},o=()=>{clearTimeout(i),window.removeEventListener(`load`,a);for(let e of t)e.removeEventListener(`error`,o);n(e.isPresent())},s=()=>{e.isPresent()||Date.now()>=r?o():i=setTimeout(s,50)};window.addEventListener(`load`,a);for(let e of t)e.addEventListener(`error`,o);s()})}var v=class extends Error{};async function y(e){let t=e.readyCallback?.();for(let t=1;;t++)try{let n=await ee(e);if(t>=3||!e.skipped?.())break;n.remove()}catch(e){if(!(e instanceof v)||t>=3)throw e;await S(1e3*2**(t-1))}await(t?x(t,`${e.url} did not report ready`):b(e))}async function ee(e){let t=e.prepare?.(),n=document.createElement(`script`),r=new Promise((t,r)=>{n.src=e.url,n.async=!0,e.crossOrigin&&(n.crossOrigin=e.crossOrigin);let i=document.querySelector(`script[nonce]`)?.nonce;i&&n.setAttribute(`nonce`,i),n.addEventListener(`load`,()=>{t()}),n.addEventListener(`error`,()=>{n.remove(),r(new v(`social-embeds: could not load ${e.url}`))}),document.head.appendChild(n)});try{await x(r,`${e.url} did not load`)}finally{t?.()}return n}function b(e){return new Promise((t,n)=>{let r=Date.now()+f,i=()=>{e.isPresent()?t():Date.now()>=r?n(/* @__PURE__ */ Error(`social-embeds: ${e.url} did not initialise`)):setTimeout(i,50)};i()})}function x(e,t){return new Promise((n,r)=>{let i=setTimeout(()=>{r(/* @__PURE__ */ Error(`social-embeds: ${t}`))},f);e.then(()=>{clearTimeout(i),n()},e=>{clearTimeout(i),r(e instanceof Error?e:Error(String(e)))})})}function S(e){return new Promise(t=>setTimeout(t,e))}const C=()=>window,w=`v26.0`,te=/^[a-z]{2,3}_[A-Z]{2}$/;function ne(e){let t=C().instgrm?.Embeds;return t?.registeredEmbedSDKs?.[e]===!0&&typeof t.process==`function`}const re={key:`x`,url:`https://platform.twitter.com/widgets.js`,isOwn:e=>/^https?:\/\/platform\.(?:twitter|x)\.com\/widgets\.js(?:[?#]|$)/.test(e),isPresent:()=>typeof C().twttr?.widgets?.load==`function`,whenPresent:()=>new Promise(e=>{let t=C().twttr?.ready;t?t(()=>{e()}):e()})};function ie(){let e=C().FB;return!e||e.__buffer?()=>{}:(e.__buffer=!0,()=>{delete e.__buffer})}function ae(e){let t=C().FB;return!ne(e)&&t!==void 0&&!t.__buffer}const oe={key:`instagram`,url:`https://www.instagram.com/embed.js`,isOwn:e=>/^https?:\/\/www\.instagram\.com\/embed\.js(?:[?#]|$)/.test(e),isPresent:()=>ne(`instagram`),prepare:ie,skipped:()=>ae(`instagram`)},se={key:`threads`,url:`https://www.threads.com/embed.js`,isOwn:e=>/^https?:\/\/www\.threads\.(?:com|net)\/embed\.js(?:[?#]|$)/.test(e),isPresent:()=>ne(`threads`),prepare:ie,skipped:()=>ae(`threads`)};function ce(e){return{key:`facebook`,url:`https://connect.facebook.net/${e}/sdk.js#xfbml=0&version=${w}`,crossOrigin:`anonymous`,isOwn:e=>/^https?:\/\/connect\.facebook\.net\/[a-z]{2,3}_[A-Z]{2}\/(?:sdk(?:\/debug)?|all)\.js(?:[?#]|$)/.test(e),isPresent:()=>typeof C().FB?.XFBML?.parse==`function`,readyCallback:()=>new Promise(e=>{let t=C().fbAsyncInit;C().fbAsyncInit=()=>{t?.(),e()}})}}const le={key:`pinterest`,url:`https://assets.pinterest.com/js/pinit_main.js`,isOwn:e=>/^https?:\/\/assets\.pinterest\.com\/js\/pinit(?:_main)?\.js(?:[?#]|$)/.test(e),isPresent:()=>typeof C().PinUtils?.build==`function`};function ue(){return h(re)}function de(){return h(oe)}function fe(){return h(se)}function pe(){return h(le)}function me(e){return te.test(e)?h(ce(e)):Promise.reject(/* @__PURE__ */ Error(`social-embeds: invalid Facebook locale "${e}"`))}const T=()=>window;var he=class extends Error{};function E(e,t,n){if(t(e))return n(),()=>{};let r=new MutationObserver(()=>{t(e)&&(r.disconnect(),n())});return r.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`class`,`style`,`height`]}),()=>{r.disconnect()}}function ge(e,t){let n=e.querySelector(`blockquote`);n&&!n.hasAttribute(`class`)&&n.classList.add(t)}function _e(e){return[...e.querySelectorAll(`iframe`)].some(e=>Number.parseFloat(e.style.height)>0)}const ve={load:()=>ue(),render(e,t){let n=T().twttr,r=n=>{n.target instanceof Node&&e.contains(n.target)&&t()};n?.events?.bind?.(`rendered`,r);let i=E(e,_e,t);return ge(e,`twitter-tweet`),n?.widgets?.load?.(e),()=>{n?.events?.unbind?.(`rendered`,r),i()}}};function ye(e,t){if(e.getRootNode()!==document)throw new he(`social-embeds: the ${t} embed cannot render inside a shadow root`)}function be(){let e=T().instgrm?.Embeds?.process;if(!e)throw Error(`social-embeds: instgrm.Embeds.process is missing`);e()}const xe={load:()=>de(),render(e,t){ye(e,`Instagram`);let n=E(e,e=>e.querySelector(`iframe.instagram-media-rendered`)!==null,t);return ge(e,`instagram-media`),be(),n}},Se={load:()=>fe(),render(e,t){ye(e,`Threads`);let n=E(e,e=>e.querySelector(`iframe`)!==null&&e.querySelector(`blockquote`)===null,t);return ge(e,`text-post-media`),be(),n}},Ce=/* @__PURE__ */ new Map;function we(e){let t=Ce.get(e);return t||(t={load:()=>me(e),render(e,t){let n=T().FB,r=n?.XFBML?.parse;if(!n||!r)throw Error(`social-embeds: FB.XFBML.parse is missing`);let i=()=>{r(e,t)};try{i()}catch(e){if(!(e instanceof Error)||!/init not called/.test(e.message))throw e;n.init?.({xfbml:!1,version:w}),i()}return()=>{}}},Ce.set(e,t)),t}const Te={load:()=>pe(),render(e,t){let n=T().PinUtils?.build;if(!n)throw Error(`social-embeds: PinUtils.build is missing`);let r=E(e,e=>e.querySelector(`span[data-pin-id]`)!==null,t),i=e.querySelector(`a`);return i&&!i.hasAttribute(`data-pin-do`)&&i.setAttribute(`data-pin-do`,`embedPin`),n(e),r}},Ee=/* @__PURE__ */ new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`source`,`track`,`wbr`]),De=/* @__PURE__ */ new Map([[`script`,/<\/script\s*>/giu],[`style`,/<\/style\s*>/giu]]),Oe=/<([a-zA-Z][a-zA-Z0-9-]*)/y,ke=/\s+([^\s"'>/=]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/y,Ae=/\s*(\/?)>/y,je=/<\/([a-zA-Z][a-zA-Z0-9-]*)\s*>/y,Me=/* @__PURE__ */ new Map([[`amp`,`&`],[`lt`,`<`],[`gt`,`>`],[`quot`,`"`],[`apos`,`'`],[`nbsp`,`\xA0`]]);function D(e){let t={type:`element`,tag:``,attrs:/* @__PURE__ */ new Map,children:[]},n=[t],r=0;for(;r<e.length;){let i=n[n.length-1]??t,a=e.indexOf(`<`,r),o=a===-1?e.length:a;if(o>r&&i.children.push({type:`text`,raw:e.slice(r,o)}),a===-1)break;if(e.startsWith(`<!--`,a)){let t=e.indexOf(`-->`,a+4);if(t===-1)return null;i.children.push({type:`comment`}),r=t+3;continue}je.lastIndex=a;let s=je.exec(e);if(s){if(i===t||i.tag!==s[1]?.toLowerCase())return null;n.pop(),r=je.lastIndex;continue}let c=Ne(e,a);if(!c)return null;let{element:l}=c;i.children.push(l),r=c.end;let u=c.selfClosing?void 0:De.get(l.tag);if(u){u.lastIndex=r;let t=u.exec(e);if(!t)return null;t.index>r&&l.children.push({type:`text`,raw:e.slice(r,t.index)}),r=u.lastIndex}else if(!c.selfClosing&&!Ee.has(l.tag)){if(n.length>100)return null;n.push(l)}}return n.length===1?t.children:null}function Ne(e,t){Oe.lastIndex=t;let n=Oe.exec(e)?.[1];if(n===void 0)return null;let r=/* @__PURE__ */ new Map,i=Oe.lastIndex;for(;;){Ae.lastIndex=i;let t=Ae.exec(e);if(t)return{element:{type:`element`,tag:n.toLowerCase(),attrs:r,children:[]},selfClosing:t[1]===`/`,end:Ae.lastIndex};ke.lastIndex=i;let a=ke.exec(e);if(!a)return null;let[,o=``,s,c,l]=a,u=o.toLowerCase();r.has(u)||r.set(u,Pe(s??c??l??``)),i=ke.lastIndex}}function Pe(e){return e.replace(/&(#[0-9]{1,7}|#[xX][0-9a-fA-F]{1,6}|[a-zA-Z]+);/g,(e,t)=>{if(!t.startsWith(`#`))return Me.get(t)??e;let n=t[1]===`x`||t[1]===`X`,r=Number.parseInt(t.slice(n?2:1),n?16:10);return r>0&&r<=1114111&&(r<55296||r>57343)?String.fromCodePoint(r):e})}function O(e,t){return(e.attrs.get(`class`)??``).split(/\s+/).includes(t)}function k(e){let t=[];return Fe(e,t),t}function Fe(e,t){for(let n of e)n.type===`element`&&(t.push(n),Fe(n.children,t))}const Ie=/* @__PURE__ */ new Set([`href`,`cite`]),Le=/^https?:\/\//i;function A(e,t){let n=``;for(let r of e){if(r.type===`text`){n+=r.raw;continue}if(r.type!==`element`)continue;let e=t.get(r.tag);if(e){n+=`<${r.tag}`;for(let t of e){let e=typeof t==`string`?t:t.name,i=r.attrs.get(e);i===void 0||typeof t!=`string`&&!t.value.test(i)||Ie.has(e)&&!Le.test(i)||(n+=` ${e}="${j(i)}"`)}n+=`>`,Ee.has(r.tag)||(n+=`${A(r.children,t)}</${r.tag}>`)}}return n}function j(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function M(e,t){let n=D(e);return n!==null&&A(n,t)===e}function Re(e){let t=``;for(let[n,r]of Object.entries(e))r!==void 0&&(t+=r===!0?` ${n}`:` ${n}="${j(String(r))}"`);return t}function ze(e,t){let n={};for(let[r,i]of Object.entries(e)){let e=t[r];e!==void 0&&(n[i]=String(e))}return Re(n)}function N(e,t){let n={...e};for(let[e,r]of Object.entries(t))r!==void 0&&(n[e]=r);return n}function P(e){return e!==void 0&&e.trim()!==``}const Be={width:`data-width`,showText:`data-show-text`,lazy:`data-lazy`,allowfullscreen:`data-allowfullscreen`,autoplay:`data-autoplay`,showCaptions:`data-show-captions`},Ve={showText:`show_text`,allowfullscreen:`allowfullscreen`,autoplay:`autoplay`,showCaptions:`show_captions`},He={post:300,video:200};function Ue(e){let t=Object.entries(e.options).filter(([e])=>e!==`href`);return{kind:`iframe`,src:`https://www.facebook.com/plugins/video.php${a([[`href`,e.url]],t)}`,title:`Facebook video player`,allow:`autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share`,scrolling:`no`,ratio:{width:16,height:9},size:e.size}}function We(e,t){if(e.variant===`iframe`)return Ue(e);let n=N(e.options,{showText:t.showText,allowfullscreen:t.allowfullscreen,autoplay:t.autoplay,showCaptions:t.showCaptions}),{size:r}=e;if(e.kind===`video`&&n.showText===!1&&r?.width!==void 0&&r.height!==void 0){let t={};for(let[e,r]of Object.entries(Ve)){let i=n[e];i!==void 0&&(t[r]=i)}return t.width=r.width,t.height=r.height,Ue({...e,options:t})}let i=t.locale??(typeof n.locale==`string`?n.locale:`en_US`),a=`<div class="${e.kind===`video`?`fb-video`:`fb-post`}" data-href="${j(e.url)}"${ze(Be,n)}>${e.fallbackHtml??``}</div>`;return{kind:`script`,key:`${i} ${a}`,markup:a,driver:we(i),minHeight:He[e.kind],label:`Facebook`,hasFallback:P(e.fallbackHtml),maxWidth:e.kind===`post`?750:void 0}}function Ge(e){return{width:e.size?.width??e.ratio.width,height:e.size?.height??e.ratio.height}}function Ke(e,t,n){let{width:r=`100%`,maxHeight:i}=t,a=t.height??e.height,o=t.maxWidth??e.maxWidth,{width:s,height:c}=Ge(e),l=i===void 0||a!==void 0?void 0:Math.floor(i*s/c);return{position:`relative`,width:r,maxWidth:l===void 0||o!==void 0&&o<l?o:l,...e.messageHeight?{height:n??e.startHeight}:a===void 0?{aspectRatio:`${String(s)} / ${String(c)}`}:{height:a,maxHeight:i},...e.borderRadius===void 0?{}:{borderRadius:e.borderRadius,overflow:`hidden`}}}function qe(e,t){let n=Ge(e),r=Math.round(t*n.height/n.width),i=e.src.indexOf(`?`),a=i===-1?e.src:e.src.slice(0,i),o=i===-1?``:`&${e.src.slice(i+1)}`;return`${a}?width=${String(t)}&height=${String(r)}${o}`}function Je(e,t){let n,r,i=e=>{let i=Math.round(e);i<=0||(clearTimeout(r),i!==n&&(n===void 0?(n=i,t(i)):r=setTimeout(()=>{n=i,t(i)},200)))};if(typeof ResizeObserver>`u`)return i(e.getBoundingClientRect().width),()=>{};let a=new ResizeObserver(e=>{for(let t of e)i(t.contentRect.width)});return a.observe(e),()=>{a.disconnect(),clearTimeout(r)}}const Ye=[`header`,`footer`,`context`],Xe=/\/albums\/\d+$/;function Ze(e,t){let n=Xe.test(e.url),r=Ye.filter(n=>t[n]??e.options[n]===!0),{width:i,height:a}=e.size??{},o=i!==void 0&&a!==void 0?{width:i,height:a}:void 0,s=`https://embedr.flickr.com/${n?`photosets`:`photos`}/${e.id}${r.length>0?`?${r.map(e=>`${e}=true`).join(`&`)}`:``}`,c={width:4,height:3};return{kind:`iframe`,src:s,title:n?`Flickr album`:`Flickr photo`,allow:``,scrolling:`no`,ratio:c,...o?{size:o,maxWidth:o.width}:{},sizeInSrc:{watch:Je,src:e=>qe({src:s,ratio:c,size:o},e)},...e.fallbackHtml===void 0?{}:{fallbackHtml:e.fallbackHtml.replace(/<img(?=[\s>])/g,`<img style="display:block;width:100%;height:100%;object-fit:cover"`)},fallbackImage:!0}}function Qe(e){return{kind:`iframe`,src:`https://giphy.com/embed/${e.id}`,title:`Giphy GIF`,allow:`fullscreen`,ratio:{width:1,height:1},size:e.size}}const $e={origin:`https://imgur.com`,read(e){if(typeof e!=`string`)return;let t=JSON.parse(e);return t.message===`resize_imgur`&&typeof t.height==`number`?t.height:void 0},listen:s};function et(e,t){let n=[`pub=true`,...t.context??e.options.context!==!1?[]:[`context=false`],...e.options.analytics===!1?[`analytics=false`]:[]];return{kind:`iframe`,src:`https://imgur.com/${e.id}/embed?${n.join(`&`)}`,title:`Imgur post`,allow:``,scrolling:`no`,ratio:{width:1,height:1},messageHeight:$e,startHeight:500,maxWidth:540,fallbackHtml:e.fallbackHtml}}function tt(e,t){let n=N(e.options,{captioned:t.captioned}),r=`<blockquote${Re({"data-instgrm-permalink":e.url,"data-instgrm-version":n.version,"data-instgrm-captioned":n.captioned===!0||void 0,style:`width:calc(100% - 2px)`})}>${e.fallbackHtml??``}</blockquote>`;return{kind:`script`,key:r,markup:r,driver:xe,minHeight:680,label:`Instagram`,hasFallback:P(e.fallbackHtml),maxWidth:540}}const nt=/* @__PURE__ */ new Set([`autoplay`,`muted`]);function rt(e,t){let n=[];return t.autoplay!==void 0&&n.push([`autoplay`,t.autoplay]),t.muted!==void 0&&n.push([`muted`,t.muted]),{kind:`iframe`,src:`https://player.kick.com/${e.id}${a(Object.entries(e.options).filter(([e])=>nt.has(e)),n)}`,title:`Kick player`,allow:`autoplay; fullscreen`,scrolling:`no`,ratio:{width:16,height:9},size:e.size}}function it(e,t){let n=new Map(Object.entries(e.options));return t.collapsed===!0&&n.set(`collapsed`,1),t.collapsed===!1&&n.delete(`collapsed`),{kind:`iframe`,src:`https://www.linkedin.com/embed/feed/update/${e.id}${a(n)}`,title:`LinkedIn post`,allow:``,ratio:{width:504,height:670},height:e.size?.height??670,maxWidth:e.size?.width??504}}const at={width:`data-pin-width`,lang:`data-pin-lang`,terse:`data-pin-terse`},ot={small:236,medium:345,large:600};function st(e,t){let n=N(e.options,{width:t.pinWidth}),r=`<a href="${j(e.url)}"${ze(at,n)}></a>`;return{kind:`script`,key:r,markup:r,driver:Te,minHeight:270,label:`Pinterest`,hasFallback:!1,maxWidth:ot[String(n.width)]??236}}const ct={theme:`theme`,showMedia:`showmedia`,showTitle:`showtitle`,showUsername:`showusername`,locale:`locale`,depth:`depth`},lt={origin:`https://embed.reddit.com`,read(e){if(typeof e!=`string`)return;let t=JSON.parse(e);return t.type===`resize.embed`&&typeof t.data==`number`?t.data:void 0},listen:s};function ut(e,t){let n=[];for(let[e,r]of Object.entries(ct)){let i=t[e];i!==void 0&&n.push([r,i])}return{kind:`iframe`,src:`https://embed.reddit.com${e.url.slice(22)}${a([[`embed`,!0]],Object.entries(e.options),n)}`,title:`Reddit post`,allow:`clipboard-read; clipboard-write`,sandbox:`allow-scripts allow-same-origin allow-popups`,scrolling:`no`,ratio:{width:1,height:1},messageHeight:lt,startHeight:e.size?.height??316,maxWidth:640}}function dt(e){let t=e.options.title;return{kind:`iframe`,src:`${e.url}/embed`,title:typeof t==`string`&&t!==``?t:`Snapchat`,allow:`autoplay; camera; microphone; clipboard-write;`,scrolling:`no`,ratio:{width:416,height:692},size:e.size,maxWidth:416}}const ft={visual:`visual`,color:`color`,autoPlay:`auto_play`,hideRelated:`hide_related`,showComments:`show_comments`,showUser:`show_user`,showReposts:`show_reposts`,showTeaser:`show_teaser`,showArtwork:`show_artwork`};function pt(e,t){let n=[];for(let[e,r]of Object.entries(ft)){let i=t[e];i!==void 0&&n.push([r,i])}let r=e.size===void 0;return{kind:`iframe`,src:`https://w.soundcloud.com/player/${a([[`url`,e.url]],r?[[`visual`,!0]]:void 0,i(e.options,[`url`,`secret_token`]),n)}`,title:`SoundCloud player`,allow:`autoplay; encrypted-media`,scrolling:`no`,ratio:{width:16,height:9},height:e.size?.height??400}}function mt(e){let t=i(e.options,[]).filter(([e])=>e===`pub`);return{kind:`iframe`,src:`https://rumble.com/embed/${e.id}/${a(t)}`,title:`Rumble video`,allow:`fullscreen`,ratio:{width:16,height:9},size:e.size}}const ht=/* @__PURE__ */ new Set([`track`,`episode`]);function gt(e,t){let n=new URL(e.url).pathname.split(`/`)[1]??``,r=e.kind===`video`,i=a(Object.entries(e.options),t.theme===void 0?void 0:[[`theme`,t.theme]]);return{kind:`iframe`,src:`https://open.spotify.com/embed/${n}/${e.id}${r?`/video`:``}${i}`,title:`Spotify Embed`,allow:`autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture`,ratio:{width:16,height:9},size:r?e.size:void 0,borderRadius:12,height:r?void 0:e.size?.height??(ht.has(n)?152:352)}}const _t={origin:`https://strava-embeds.com`,read(e){if(!Array.isArray(e))return;let[,t,n]=e;return t===`BROADCAST_IFRAME_HEIGHT`&&typeof n==`number`?n:void 0},listen:s};function vt(e){return e===`minimal`?`minimal`:`standard`}function yt(e,t){let n=e.id.startsWith(`route/`),r=vt(t.embedStyle??e.options.style),i=n&&(t.fullWidth??e.options.fullWidth===!0),a=t.mapHash??e.options.mapHash,o=`?style=${r}${i?`&fullWidth=true`:``}`,s=`#ns=social-embeds${typeof a==`string`&&a!==``?`&mapHash=${encodeURIComponent(a)}`:``}`;return{kind:`iframe`,src:`https://strava-embeds.com/${e.id}${o}${s}`,title:n?`Strava route`:`Strava activity`,allow:``,scrolling:`no`,ratio:{width:1,height:1},messageHeight:_t,startHeight:650,...i?{}:{maxWidth:554}}}const bt=/* @__PURE__ */ new Set([`autoplay`,`hd`,`loop`,`muted`,`nocontrols`]),xt={autoplay:`autoplay`,hd:`hd`,loop:`loop`,muted:`muted`,nocontrols:`nocontrols`};function St(e,t){let n=Object.entries(e.options).filter(([e])=>bt.has(e));return{kind:`iframe`,src:`https://streamable.com/e/${e.id}${a(n,o(t,xt))}`,title:`Streamable video`,allow:`autoplay; fullscreen`,ratio:{width:16,height:9},size:e.size}}const Ct=[[`comment`,`comment`],[`userpic`,`userpic`],[`mode`,`mode`],[`single`,`single`],[`color`,`color`],[`dark`,`dark`],[`darkColor`,`dark_color`]];function wt(e,t){return typeof t==`boolean`?e===`userpic`?String(t):e===`single`?t?1:void 0:+!!t:typeof t==`string`||typeof t==`number`?t:void 0}const Tt={origin:`https://t.me`,read(e){if(typeof e!=`string`)return;let t=JSON.parse(e);return t.event===`resize`&&typeof t.height==`number`?t.height:void 0},listen:s};function Et(e,t){let{userpic:n,color:r,dark:i,darkColor:o}=t,s={...e.options,...n===void 0?{}:{userpic:n},...r===void 0?{}:{color:r},...i===void 0?{}:{dark:i},...o===void 0?{}:{darkColor:o}},c=[[`embed`,1]];for(let[e,t]of Ct){let n=wt(t,s[e]);n!==void 0&&c.push([t,n])}return{kind:`iframe`,src:`${e.url}${a(c)}`,title:`Telegram post`,allow:``,scrolling:`no`,ratio:{width:1,height:1},messageHeight:Tt,startHeight:300,maxWidth:500}}function Dt(e){return{kind:`iframe`,src:`https://tenor.com/embed/${e.id}`,title:`Tenor GIF`,allow:`fullscreen`,ratio:{width:133,height:100},size:e.size}}function Ot(e,t){let n=N(e.options,{theme:t.theme}),r=`<blockquote${Re({"data-text-post-permalink":e.url,"data-text-post-version":n.version??0,id:`ig-tp-${e.id}`,"data-theme":n.theme})}>${e.fallbackHtml??``}</blockquote>`;return{kind:`script`,key:r,markup:r,driver:Se,minHeight:240,label:`Threads`,hasFallback:P(e.fallbackHtml),maxWidth:658}}const kt={controls:`controls`,progressBar:`progress_bar`,playButton:`play_button`,volumeControl:`volume_control`,fullscreenButton:`fullscreen_button`,timestamp:`timestamp`,loop:`loop`,autoplay:`autoplay`,musicInfo:`music_info`,description:`description`,rel:`rel`,nativeContextMenu:`native_context_menu`,closedCaption:`closed_caption`,forceMuted:`force_muted`};function At(e,t){let n=o(t,kt);return{kind:`iframe`,src:`https://www.tiktok.com/player/v1/${e.id}${a(Object.entries(e.options),n)}`,title:`TikTok video player`,allow:`accelerometer; autoplay; clipboard-write; encrypted-media; fullscreen; gyroscope; picture-in-picture; web-share`,ratio:{width:9,height:16},size:e.size,maxWidth:325}}function jt(e){let t=e;return t?.type===`setHeight`&&typeof t.height==`number`?t.height:void 0}const Mt={origin:`https://truthsocial.com`,read:jt,listen:s},Nt={origin:`https://truthsocial.com`,read(e){let t=jt(e);return t===void 0||t<=0?void 0:t+165},listen:s},Pt=/^https:\/\/truthsocial\.com\/(@[^/]+)\/posts\/\d+$/;function Ft(e){let t=Pt.exec(e.url)?.[1];return t===void 0?{kind:`error`,message:`social-embeds: not a Truth Social post URL: ${e.url}`}:{kind:`iframe`,src:`https://truthsocial.com/${t}/${e.id}/embed`,title:`Truth Social post`,allow:``,scrolling:`no`,ratio:{width:1,height:1},messageHeight:e.options.video===!0?Nt:Mt,startHeight:150,maxWidth:e.size?.width??600}}const It={origin:`https://embed.tumblr.com`,read(e){if(typeof e!=`string`)return;let t=JSON.parse(e),[n]=Array.isArray(t.args)?t.args:[];return t.method===`tumblr-post:sizeChange`&&typeof n==`number`?n:void 0},listen:s};function Lt(e){return{kind:`iframe`,src:`https://embed.tumblr.com/embed/post/${e.url.slice(23).split(`/`)[0]??``}/${e.id}/v2`,title:`Tumblr post`,allow:``,scrolling:`no`,ratio:{width:1,height:1},messageHeight:It,startHeight:400,maxWidth:540}}const Rt=[`channel`,`video`,`collection`,`clip`,`parent`];function zt(e,t){let{hostname:n,pathname:r}=new URL(e);if(n===`clips.twitch.tv`)return[`https://clips.twitch.tv/embed`,[`clip`,t]];let i=r.split(`/`)[1];return[`https://player.twitch.tv/`,i===`videos`?[`video`,`v${t}`]:i===`collections`?[`collection`,t]:[`channel`,t]]}function Bt(e,t){let{autoplay:n,muted:r,time:o}=t,s=[];n!==void 0&&s.push([`autoplay`,String(n)]),r!==void 0&&s.push([`muted`,String(r)]),o!==void 0&&s.push([`time`,o]);let[c,l]=zt(e.url,e.id);return{kind:`iframe`,src:`${c}${a([l],i(e.options,Rt),s)}`,title:`Twitch player`,allow:``,ratio:{width:16,height:9},size:e.size,clientSrc:Vt}}function Vt(e){return`${e}${e.includes(`?`)?`&`:`?`}parent=${encodeURIComponent(window.location.hostname)}`}const Ht={autopause:`autopause`,autoplay:`autoplay`,background:`background`,byline:`byline`,color:`color`,controls:`controls`,dnt:`dnt`,keyboard:`keyboard`,loop:`loop`,muted:`muted`,pip:`pip`,playsinline:`playsinline`,portrait:`portrait`,quality:`quality`,speed:`speed`,title:`title`,transparent:`transparent`};function Ut(e,t){let{t:n,...r}=t,{t:s,...c}=e.options,l=new URL(e.url).pathname.split(`/`)[2],u=o(r,Ht),d=n??s;return{kind:`iframe`,src:`https://player.vimeo.com/video/${e.id}${a(l?[[`h`,l]]:void 0,i(c,[`h`]),u)}${d===void 0?``:`#t=${encodeURIComponent(String(d))}`}`,title:`Vimeo video player`,allow:`autoplay; fullscreen; picture-in-picture; clipboard-write; encrypted-media; web-share`,referrerPolicy:`strict-origin-when-cross-origin`,ratio:{width:16,height:9},size:e.size}}const Wt={theme:`data-theme`,conversation:`data-conversation`,cards:`data-cards`,align:`data-align`,lang:`data-lang`,dnt:`data-dnt`,width:`data-width`};function Gt(e,t){let n=N(e.options,{...t}),r=e.fallbackHtml??`<a href="${j(e.url)}"></a>`,i=`<blockquote${ze(Wt,n)}>${r}</blockquote>`;return{kind:`script`,key:i,markup:i,driver:ve,minHeight:250,label:`X`,hasFallback:P(e.fallbackHtml),maxWidth:550}}const Kt={autoplay:`autoplay`,ccLangPref:`cc_lang_pref`,ccLoadPolicy:`cc_load_policy`,color:`color`,controls:`controls`,disablekb:`disablekb`,enablejsapi:`enablejsapi`,end:`end`,fs:`fs`,hl:`hl`,ivLoadPolicy:`iv_load_policy`,list:`list`,listType:`listType`,loop:`loop`,origin:`origin`,playlist:`playlist`,playsinline:`playsinline`,rel:`rel`,start:`start`,widgetReferrer:`widget_referrer`};function qt(e){return e.url.startsWith(`https://www.youtube.com/playlist?`)?{path:`videoseries`,key:`list`}:e.url.startsWith(`https://www.youtube.com/channel/`)?{path:`live_stream`,key:`channel`}:{path:e.id}}function Jt(e,t){let{nocookie:n,...r}=t,{nocookie:s,...c}=e.options,l=n??s===!0?`https://www.youtube-nocookie.com`:`https://www.youtube.com`,{path:u,key:d}=qt(e),f=o(r,Kt).filter(([e])=>e!==d);return{kind:`iframe`,src:`${l}/embed/${u}${a(d===void 0?void 0:[[d,e.id]],i(c,d===void 0?[]:[d]),f)}`,title:`YouTube video player`,allow:`accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share`,referrerPolicy:`strict-origin-when-cross-origin`,ratio:e.url.includes(`/shorts/`)?{width:9,height:16}:{width:16,height:9},size:e.size}}function Yt(e){switch(e.platform){case`x`:return Gt(e,{});case`instagram`:return tt(e,{});case`threads`:return Ot(e,{});case`facebook`:return We(e,{});case`tiktok`:return At(e,{});case`youtube`:return Jt(e,{});case`telegram`:return Et(e,{});case`snapchat`:return dt(e);case`linkedin`:return it(e,{});case`reddit`:return ut(e,{});case`pinterest`:return st(e,{});case`spotify`:return gt(e,{});case`vimeo`:return Ut(e,{});case`twitch`:return Bt(e,{});case`dailymotion`:return d(e,{});case`bluesky`:return l(e,{});case`soundcloud`:return pt(e,{});case`applemusic`:return n(e);case`applepodcasts`:return r(e);case`tumblr`:return Lt(e);case`kick`:return rt(e,{});case`giphy`:return Qe(e);case`tenor`:return Dt(e);case`streamable`:return St(e,{});case`rumble`:return mt(e);case`truthsocial`:return Ft(e);case`imgur`:return et(e,{});case`strava`:return yt(e,{});case`flickr`:return Ze(e,{});default:return e.platform}}const Xt=/^(?:https?:)?\/\/([^/?#\s@]+)((?:\/[^?#\s]*)?)(?:\?([^#\s]*))?(?:#(\S*))?$/i;function F(e){let t=Xt.exec(e.trim());if(!t)return null;let[,n=``,r=``,i=``,a]=t,o=/* @__PURE__ */ new Map;for(let e of i.replaceAll(`&amp;`,`&`).split(`&`)){if(e===``)continue;let t=e.indexOf(`=`),n=Zt(t===-1?e:e.slice(0,t)),r=Zt(t===-1?``:e.slice(t+1));if(n===null||r===null)return null;o.has(n)||o.set(n,r)}return{host:n.toLowerCase(),path:r,query:o,...a?{fragment:a}:{}}}function Zt(e){try{return decodeURIComponent(e.replace(/\+/g,` `))}catch{return null}}function I(e){return e===`true`?!0:e===`false`?!1:/^(?:0|[1-9]\d{0,14})$/.test(e)?Number(e):e}function L(e){return e!==void 0&&/^[1-9]\d{0,5}$/.test(e)?Number(e):void 0}function R(e,t){return{...e,...t}}function z(e,t){return e===t||e.startsWith(`${t}/`)}function B(e,t,n){let r={};for(let[i,a]of t){let t=e.attrs.get(i);t!==void 0&&!(a in r)&&(r[a]=n(t))}return r}function V(e){let t=L(e.attrs.get(`width`)),n=L(e.attrs.get(`height`));if(t!==void 0||n!==void 0)return{...t===void 0?{}:{width:t},...n===void 0?{}:{height:n}}}function H(e,t){return t?{...e,size:t}:e}function U(e,t){if(e.tag!==`div`||e.attrs.size!==1)return null;let[,n]=t.exec(e.attrs.get(`style`)??``)??[];if(n===void 0)return null;let r;for(let t of e.children)if(!(t.type===`text`&&/^\s*$/.test(t.raw))){if(t.type!==`element`||t.tag!==`iframe`||r)return null;r=t}let i=Math.round(Number(n)*100);if(!r||!(i>0&&i<=1e5))return null;let a=Qt(1e4,i);return{iframe:r,size:{width:1e4/a,height:i/a}}}function Qt(e,t){return t===0?e:Qt(t,e%t)}const $t=/* @__PURE__ */ new Set([`youtube.com`,`www.youtube.com`,`m.youtube.com`]),en=/* @__PURE__ */ new Set([`youtube-nocookie.com`,`www.youtube-nocookie.com`]),tn=/* @__PURE__ */ new Set([`dailymotion.com`,`www.dailymotion.com`]),W=/* @__PURE__ */ new Set([`tiktok.com`,`www.tiktok.com`]),nn=/* @__PURE__ */ new Set([`facebook.com`,`www.facebook.com`,`web.facebook.com`]),G=/* @__PURE__ */ new Set([`giphy.com`,`www.giphy.com`]),rn=/* @__PURE__ */ new Set([`player.kick.com`]),an=`embed.music.apple.com`,on=`embed.podcasts.apple.com`,sn=e=>en.has(e.host)||$t.has(e.host)&&z(e.path,`/embed`),cn=e=>e.host===`geo.dailymotion.com`||e.host===`dai.ly`||tn.has(e.host)&&(z(e.path,`/embed`)||z(e.path,`/video`)),ln=e=>W.has(e.host)&&z(e.path,`/player`),un=e=>e.host===`player.twitch.tv`||e.host===`clips.twitch.tv`&&z(e.path,`/embed`),dn=e=>e.host===`player.vimeo.com`,fn=e=>nn.has(e.host)&&z(e.path,`/plugins`),pn=e=>G.has(e.host)&&z(e.path,`/embed`),mn=e=>rn.has(e.host),hn=e=>e.host===`www.linkedin.com`&&z(e.path,`/embed`),gn=e=>e.host===`assets.pinterest.com`,_n=e=>e.host===an,vn=e=>e.host===on,yn=e=>e.host===`w.soundcloud.com`,bn=e=>e.host===`open.spotify.com`&&z(e.path,`/embed`),xn=e=>e.host===`rumble.com`&&z(e.path,`/embed`),Sn=e=>e.host===`streamable.com`&&(z(e.path,`/e`)||z(e.path,`/o`)),Cn=e=>e.host===`tenor.com`&&z(e.path,`/embed`),wn=e=>e.host===`truthsocial.com`&&e.path.startsWith(`/@`);function Tn(e){return[sn,cn,ln,un,dn,fn,pn,mn,hn,gn,_n,vn,yn,bn,xn,Sn,Cn,wn].some(t=>t(e))}const En=[`no-referrer`,`origin`,`same-origin`,`strict-origin`,`strict-origin-when-cross-origin`],Dn=/* @__PURE__ */ new Set([`allow-downloads`,`allow-forms`,`allow-modals`,`allow-orientation-lock`,`allow-pointer-lock`,`allow-popups`,`allow-popups-to-escape-sandbox`,`allow-presentation`,`allow-same-origin`,`allow-scripts`,`allow-top-navigation`,`allow-top-navigation-by-user-activation`,`allow-top-navigation-to-custom-protocols`]),On=/* @__PURE__ */ new Set([`autoplay`,`fullscreen`,`encrypted-media`,`picture-in-picture`,`clipboard-write`,`web-share`]),kn=`[a-z0-9-]+(?:\\.[a-z0-9-]+)*(?::\\d{1,5})?`,An=/* @__PURE__ */ RegExp(`^(?:https:)?//${kn}(?:[/?#]|$)`,`i`),jn=/* @__PURE__ */ RegExp(`^(?:\\*|'self'|'src'|'none'|https://${kn})$`,`i`),Mn=/\/\.{1,2}(?:\/|$)|\/\/|%(?:2[de]|3\d|[46][1-9a-f]|[57][\da]|5f|7e)/i,Nn=/[\t\n\f\r ]+/,Pn=/^\s*(width|height)\s*:(.*)$/is,Fn=/^(\d+)px$/i,In=/(?:^|;)\s*padding-bottom:\s*(\d{1,3}(?:\.\d{1,20})?)%\s*(?:;|$)/i;function Ln(e){if(typeof e!=`string`)return null;let t=D(e);if(!t)return null;let n=k(t),[r,...i]=n.filter(e=>e.tag===`iframe`);if(!r||i.length>0)return null;let a=n.find(e=>e.children.includes(r)),{attrs:o}=r,s=V(r)??Kn(r);return zn({src:o.get(`src`),title:o.get(`title`),allow:o.get(`allow`),allowFullscreen:o.has(`allowfullscreen`),referrerPolicy:o.get(`referrerpolicy`),sandbox:o.get(`sandbox`),scrolling:o.get(`scrolling`),size:s??{},ratio:s?void 0:a&&U(a,In)?.size})}function Rn(e){return zn(e)}function zn(e){if(typeof e!=`object`||!e)return null;let t=e,n=Bn(t.src);if(n===null)return null;let r=typeof t.title==`string`?t.title.trim():``,i=typeof t.referrerPolicy==`string`?t.referrerPolicy.toLowerCase():void 0,a=En.find(e=>e===i),o=Un(t.ratio);return{src:n,...r?{title:r}:{},allow:typeof t.allow==`string`?Vn(t.allow):``,allowFullscreen:t.allowFullscreen===!0,...a?{referrerPolicy:a}:{},...typeof t.sandbox==`string`?{sandbox:Hn(t.sandbox)}:{},...typeof t.scrolling==`string`&&t.scrolling.toLowerCase()===`no`?{scrolling:`no`}:{},size:Gn(t.size),...o?{ratio:o}:{}}}function Bn(e){if(typeof e!=`string`)return null;let t=e.trim(),n=An.test(t)&&!t.includes(`\\`)?F(t):null;return!n||Mn.test(n.path)||Tn({...n,host:n.host.replace(/:\d+$/,``),path:(n.path.toLowerCase().split(`;`)[0]??``).replaceAll(`%2f`,`/`)})?null:t.startsWith(`//`)?`https:${t}`:t}function Vn(e){return e.split(`;`).map(e=>e.split(Nn).filter(Boolean)).filter(([e,...t])=>e!==void 0&&On.has(e)&&t.every(e=>jn.test(e))).map(e=>e.join(` `)).join(`; `)}function Hn(e){let t=e.split(Nn).map(e=>e.toLowerCase()).filter(e=>Dn.has(e));return[...new Set(t)].join(` `)}function Un(e){if(typeof e!=`object`||!e)return;let{width:t,height:n}=e;return Wn(t)&&Wn(n)?{width:t,height:n}:void 0}function Wn(e){return typeof e==`number`&&Number.isFinite(e)&&e>0}function Gn(e){if(typeof e!=`object`||!e)return{};let{width:t,height:n}=e,r=typeof t==`number`?L(String(t)):void 0,i=typeof n==`number`?L(String(n)):void 0;return{...r===void 0?{}:{width:r},...i===void 0?{}:{height:i}}}function Kn(e){let t,n;for(let r of(e.attrs.get(`style`)??``).split(`;`)){let[,e=``,i=``]=Pn.exec(r)??[],a=L(Fn.exec(i.trim())?.[1]);e.toLowerCase()===`width`&&(t=a),e.toLowerCase()===`height`&&(n=a)}return t===void 0&&n===void 0?void 0:{width:t,height:n}}const qn={width:16,height:9};function Jn(e){let t=Rn(e);return t?{kind:`iframe`,src:t.src,title:t.title??`Embedded content`,allow:t.allow,allowFullscreen:t.allowFullscreen,...t.referrerPolicy?{referrerPolicy:t.referrerPolicy}:{},...t.sandbox===void 0?{}:{sandbox:t.sandbox},...t.scrolling?{scrolling:t.scrolling}:{},...Yn(t)}:{kind:`error`,message:`social-embeds: not a generic iframe embed`}}function Yn({size:e,ratio:t}){let{width:n,height:r}=e;return n!==void 0&&r!==void 0?{ratio:{width:n,height:r},maxWidth:n}:r===void 0?{ratio:t??qn,...n===void 0?{}:{maxWidth:n}}:{ratio:qn,height:r}}const Xn=/* @__PURE__ */ new Set([`bsky.app`,`www.bsky.app`]),Zn=/^\/profile\/([^/]{1,253})\/post\/[A-Za-z0-9._~:-]{1,512}\/?$/,Qn=/^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z](?:[a-z0-9-]{0,61}[a-z0-9])?$/i,$n=/* @__PURE__ */ new Set([`rumble.com`,`www.rumble.com`]),er=/^\/v[a-z0-9]{1,12}-[^/]{1,300}\.html$/;function tr(e){let t=typeof e==`string`?F(e):null;return t?nr(t)?`rumble`:rr(t)?`bluesky`:null:null}function nr(e){return $n.has(e.host)&&er.test(e.path)}function rr(e){if(!Xn.has(e.host))return!1;let[,t]=Zn.exec(e.path)??[];return t!==void 0&&Qn.test(t)}const ir=/^\/([a-z]{2})\/(album|song|playlist)\/(?:[^/]{1,200}\/)?(\d{1,15}|pl\.[A-Za-z0-9-]{1,64})\/?$/,ar=/^\d{1,15}$/;function or(e,t){if(e?.host!==t)return null;let[,n,r,i]=ir.exec(e.path)??[];if(n===void 0||r===void 0||i===void 0||(r===`playlist`?!i.startsWith(`pl.`):!ar.test(i)))return null;let a=r===`album`?e.query.get(`i`):void 0;return a!==void 0&&!ar.test(a)?null:{kind:`post`,url:`https://music.apple.com/${n}/${r}/${i}${a?`?i=${a}`:``}`,id:a??i,variant:`iframe`}}const sr=/* @__PURE__ */ R({platform:`applemusic`,name:`Apple Music`,shapes:[`post iframe`],match(e){let t=or(e,`music.apple.com`);return t&&{platform:`applemusic`,...t,options:{}}},ownsFrame:_n},{parse(e){if(e.tag!==`iframe`)return null;let t=or(F(e.attrs.get(`src`)??``),an);if(!t)return null;let{height:n}=V(e)??{};return H({platform:`applemusic`,...t,options:{}},n===void 0?void 0:{height:n})},isOwnScript:()=>!1}),cr=/^\/([a-z]{2})\/podcast\/(?:[^/]{1,200}\/)?(?:id)?(\d{1,15})\/?$/,lr=/^\d{1,15}$/;function ur(e,t){if(e?.host!==t)return null;let[,n,r]=cr.exec(e.path)??[];if(n===void 0||r===void 0)return null;let i=e.query.get(`i`);return i!==void 0&&!lr.test(i)?null:{platform:`applepodcasts`,kind:`post`,url:`https://podcasts.apple.com/${n}/podcast/id${r}${i?`?i=${i}`:``}`,id:i??r,variant:`iframe`}}const dr=/* @__PURE__ */ R({platform:`applepodcasts`,name:`Apple Podcasts`,shapes:[`post iframe`],match(e){let t=ur(e,`podcasts.apple.com`);return t&&{...t,options:{}}},ownsFrame:vn},{parse(e){if(e.tag!==`iframe`)return null;let t=ur(F(e.attrs.get(`src`)??``),on);return t&&H({...t,options:{}},V(e))},isOwnScript:()=>!1}),fr=`(did:(?:plc:[a-z2-7]{24}|web:[a-z0-9.-]{1,253}))`,pr=`((?!\\.{1,2}(?:/|$))[A-Za-z0-9._~:-]{1,512})`,mr=/* @__PURE__ */ new Set([`bsky.app`,`www.bsky.app`]),hr=/* @__PURE__ */ RegExp(`^/profile/${fr}/post/${pr}/?$`),gr=/* @__PURE__ */ new Map([[`p`,[`lang`]],[`a`,[`href`]],[`br`,[]]]);function _r(e,t){return{platform:`bluesky`,kind:`post`,url:`https://bsky.app/profile/${e}/post/${t}`,id:`${e}/app.bsky.feed.post/${t}`,variant:`iframe`}}function vr(e){if(!e||!mr.has(e.host))return null;let[,t,n]=hr.exec(e.path)??[];return t===void 0||n===void 0?null:_r(t,n)}const yr={platform:`bluesky`,name:`Bluesky`,shapes:[`post iframe`],needsLookup:rr,trustsFallback:e=>M(e,gr),match(e){let t=vr(e);return t&&{...t,options:{}}}},br=/* @__PURE__ */ RegExp(`^at://${fr}/app\\.bsky\\.feed\\.post/${pr}$`),xr=/^[a-z2-7]{20,100}$/,Sr=/* @__PURE__ */ new Set([`light`,`dark`,`system`]),Cr=/^(?:https?:)?\/\/embed\.bsky\.app\/static\/embed\.js$/,wr=/* @__PURE__ */ R(yr,{parse(e){if(e.tag!==`blockquote`||!O(e,`bluesky-embed`))return null;let[,t,n]=br.exec(e.attrs.get(`data-bluesky-uri`)??``)??[];if(t===void 0||n===void 0)return null;let r=_r(t,n);if(k(e.children).reverse().map(e=>e.tag===`a`?vr(F(e.attrs.get(`href`)??``)):null).find(e=>e!==null)?.id!==r.id)return null;let i={},a=e.attrs.get(`data-bluesky-cid`);a!==void 0&&xr.test(a)&&(i.cid=a);let o=e.attrs.get(`data-bluesky-embed-color-mode`);return o!==void 0&&Sr.has(o)&&(i.colorMode=o),{...r,options:i,fallbackHtml:A(e.children,gr)}},isOwnScript:e=>Cr.test(e)}),Tr=/^x[a-z0-9]{4,12}$/,Er=/^x[a-z0-9]{3,12}$/;function Dr(e,t){return{platform:`dailymotion`,kind:`video`,url:`https://www.dailymotion.com/video/${e}`,id:e,variant:`iframe`,options:t}}function Or(e){if(e.host!==`geo.dailymotion.com`||e.query.has(`playlist`))return null;let t=/^\/player(?:\/([a-z0-9]+))?\.html$/.exec(e.path);if(!t)return null;let[,n]=t,r=e.query.get(`video`)??``;if(!Tr.test(r)||n!==void 0&&!Er.test(n))return null;let i=Object.fromEntries([...e.query].filter(([e])=>e!==`video`).map(([e,t])=>[e,I(t)]));return n!==void 0&&(i.playerId=n),Dr(r,i)}function kr(e){if(e.host===`dai.ly`){let t=e.path.replace(/^\/|\/$/g,``);return Tr.test(t)?Dr(t,{}):null}if(!tn.has(e.host))return null;let[,t]=/^(?:\/embed)?\/video\/([a-z0-9]+)\/?$/.exec(e.path)??[];return t!==void 0&&Tr.test(t)?Dr(t,{}):null}const Ar={platform:`dailymotion`,name:`Dailymotion`,shapes:[`video iframe`],match(e){return Or(e)??kr(e)},ownsFrame:cn},jr=/^position:\s*relative;\s*padding-bottom:\s*(\d{1,3}(?:\.\d{1,4})?)%;\s*height:\s*0;\s*overflow:\s*hidden;?$/,Mr=/* @__PURE__ */ R(Ar,{parse(e){let t=U(e,jr),n=t?.iframe??e;if(n.tag!==`iframe`)return null;let r=F(n.attrs.get(`src`)??``);if(!r)return null;let i=Or(r)??kr(r);return i&&H(i,t?.size??V(n))},isOwnScript:()=>!1}),Nr=/* @__PURE__ */ new Set([`facebook.com`,`www.facebook.com`,`web.facebook.com`,`m.facebook.com`]),K=`https://www.facebook.com`,Pr=`[A-Za-z0-9.\\-]{1,80}`,Fr=`(?:\\d{1,25}|pfbid[A-Za-z0-9]{10,120})`,Ir=/* @__PURE__ */ RegExp(`^/(${Pr})/posts/(${Fr})/?$`),Lr=/* @__PURE__ */ RegExp(`^/(${Pr})/photos/([A-Za-z0-9.\\-]{1,80})/(\\d{1,25})/?$`),Rr=/* @__PURE__ */ RegExp(`^/(${Pr})/videos/(?:[^/]{1,200}/)?(\\d{1,25})/?$`),zr=/^\/reel\/(\d{1,25})\/?$/,Br=/* @__PURE__ */ new Set([`/permalink.php`,`/story.php`]),Vr=/* @__PURE__ */ new Set([`/photo.php`,`/photo/`,`/photo`]),Hr=/* @__PURE__ */ RegExp(`^${Fr}$`),Ur=/^\d{1,25}$/,Wr={name:`class`,value:/^fb-xfbml-parse-ignore$/},Gr=/* @__PURE__ */ new Map([[`div`,[Wr]],[`blockquote`,[`cite`,Wr]],[`a`,[`href`]],[`p`,[]]]);function Kr(e){if(!e||!Nr.has(e.host))return null;let{path:t,query:n}=e,[,r,i]=Ir.exec(t)??[];if(r!==void 0&&i!==void 0)return{kind:`post`,id:i,url:`${K}/${r}/posts/${i}`};if(Br.has(t)){let e=n.get(`story_fbid`);if(e===void 0||!Hr.test(e))return null;let r=n.get(`id`),i=r!==void 0&&Ur.test(r)?`&id=${r}`:``;return{kind:`post`,id:e,url:`${K}${t}?story_fbid=${e}${i}`}}if(Vr.has(t)){let e=n.get(`fbid`);return e===void 0||!Ur.test(e)?null:{kind:`post`,id:e,url:`${K}${t}?fbid=${e}`}}let[,a,o,s]=Lr.exec(t)??[];if(a!==void 0&&o!==void 0&&s!==void 0)return{kind:`post`,id:s,url:`${K}/${a}/photos/${o}/${s}/`};let[,c,l]=Rr.exec(t)??[];if(c!==void 0&&l!==void 0)return{kind:`video`,id:l,url:`${K}/${c}/videos/${l}/`};if(t===`/watch`||t===`/watch/`||t===`/video.php`){let e=n.get(`v`);return e===void 0||!Ur.test(e)?null:{kind:`video`,id:e,url:`${K}${t===`/video.php`?t:`/watch/`}?v=${e}`}}let[,u]=zr.exec(t)??[];return u===void 0?null:{kind:`video`,id:u,url:`${K}/reel/${u}`}}function q(e,t,n,r){return{platform:`facebook`,kind:t,url:e.url,id:e.id,variant:n,options:r}}const qr={platform:`facebook`,name:`Facebook`,shapes:[`post sdk`,`video sdk`,`video iframe`],trustsFallback:e=>M(e,Gr),match(e){let t=Kr(e);return t&&q(t,t.kind,`sdk`,{})},ownsFrame:fn},Jr=/^(?:https?:)?\/\/connect\.facebook\.net\/([a-z]{2,3}_[A-Z]{2})\/sdk\.js(?:[?#].*)?$/,Yr=[[`data-width`,`width`],[`data-show-text`,`showText`],[`data-lazy`,`lazy`],[`data-allowfullscreen`,`allowfullscreen`],[`data-autoplay`,`autoplay`],[`data-show-captions`,`showCaptions`]],Xr=[[`show_text`,`showText`],[`allowfullscreen`,`allowfullscreen`],[`autoplay`,`autoplay`],[`show_captions`,`showCaptions`]],Zr=/* @__PURE__ */ R(qr,{parse(e){if(e.tag===`div`){let t=O(e,`fb-post`)?`post`:O(e,`fb-video`)?`video`:null,n=Kr(F(e.attrs.get(`data-href`)??``));return!t||!n?null:{...q(n,t,`sdk`,B(e,Yr,I)),fallbackHtml:A(e.children,Gr)}}if(e.tag!==`iframe`)return null;let t=F(e.attrs.get(`src`)??``);if(!t||!nn.has(t.host))return null;let n=Kr(F(t.query.get(`href`)??``));if(!n)return null;if(t.path===`/plugins/post.php`){let e={},r=t.query.get(`show_text`),i=t.query.get(`width`);return r!==void 0&&(e.showText=I(r)),i!==void 0&&(e.width=I(i)),q(n,`post`,`sdk`,e)}if(t.path===`/plugins/video.php`){let r=I(t.query.get(`show_text`)??``);if(r===!0||r===1){let e={};for(let[n,r]of Xr){let i=t.query.get(n);i!==void 0&&(e[r]=I(i))}let r=L(t.query.get(`width`)),i=L(t.query.get(`height`));return H(q(n,`video`,`sdk`,{...e,showText:!0}),r===void 0||i===void 0?void 0:{width:r,height:i})}return H(q(n,`video`,`iframe`,Object.fromEntries([...t.query].filter(([e])=>e!==`href`).map(([e,t])=>[e,I(t)]))),V(e))}return null},isOwnScript:e=>Jr.test(e),scriptOptions(e){let[,t]=Jr.exec(e)??[];return t===void 0?{}:{locale:t}},allowsFbRoot:!0}),Qr=/* @__PURE__ */ new Set([`flickr.com`,`www.flickr.com`]),$r=`((?!\\.{1,2}(?:/|$))[A-Za-z0-9@_.-]{1,64})`,ei=`(\\d{1,20})`,ti=/* @__PURE__ */ RegExp(`^/photos/${$r}/${ei}(?:/in/[A-Za-z0-9_@./-]{1,200})?/?$`),ni=/* @__PURE__ */ RegExp(`^/photos/${$r}/(?:albums|sets)/${ei}/?$`),ri=/^\/p\/([1-9a-km-zA-HJ-NP-Z]{1,12})$/,ii=`123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ`,ai=/^https:\/\/(?:live|farm\d{1,3})\.staticflickr\.com\//,oi=/* @__PURE__ */ new Map([[`a`,[{name:`href`,value:/^https:\/\/(?:www\.)?flickr\.com\//}]],[`img`,[{name:`src`,value:ai},{name:`width`,value:/^\d{1,6}$/},{name:`height`,value:/^\d{1,6}$/},`alt`]]]);function si(e){if(e===``)return null;let t=0n;for(let n of e){let e=ii.indexOf(n);if(e===-1)return null;t=t*58n+BigInt(e)}return t.toString()}function ci(e){let t=BigInt(e),n=``;for(;t>0n;)n=ii.charAt(Number(t%58n))+n,t/=58n;return n}function li(e,t){return{platform:`flickr`,kind:`post`,url:`https://www.flickr.com/photos/${e}/${t}/`,id:t,variant:`iframe`}}function ui(e,t){return{platform:`flickr`,kind:`post`,url:`https://www.flickr.com/photos/${e}/albums/${t}`,id:t,variant:`iframe`}}function di(e){if(!e||!Qr.has(e.host))return null;let[,t,n]=ni.exec(e.path)??[];if(t!==void 0&&n!==void 0)return ui(t,n);let[,r,i]=ti.exec(e.path)??[];return r===void 0||i===void 0?null:li(r,i)}function fi(e){if(e.host!==`flic.kr`)return null;let[,t]=ri.exec(e.path)??[],n=t===void 0?null:si(t);return t===void 0||n===null||ci(n)!==t?null:{platform:`flickr`,kind:`post`,url:`https://flic.kr/p/${t}`,id:n,variant:`iframe`}}const pi={platform:`flickr`,name:`Flickr`,shapes:[`post iframe`],trustsFallback:e=>M(e,oi),match(e){let t=di(e)??fi(e);return t&&{...t,options:{}}}},mi=/^(?:https?:)?\/\/embedr\.flickr\.com\/assets\/client-code\.js$/,hi=[`header`,`footer`,`context`];function gi(e){let t=null;for(let n of e.children)if(!(n.type===`text`&&/^\s*$/.test(n.raw))){if(n.type!==`element`||n.tag!==`img`||t)return null;t=n}return t}const _i=/* @__PURE__ */ R(pi,{parse(e){if(e.tag!==`a`||e.attrs.get(`data-flickr-embed`)!==`true`)return null;let t=di(F(e.attrs.get(`href`)??``)),n=gi(e);if(!t||!n)return null;let r={};for(let t of hi)e.attrs.get(`data-${t}`)===`true`&&(r[t]=!0);let i=V(n),a=ai.test(n.attrs.get(`src`)??``)?e:{...e,children:[]};return H({...t,options:r,fallbackHtml:A([a],oi)},i?.width!==void 0&&i.height!==void 0?i:void 0)},isOwnScript:e=>mi.test(e)}),J=`([A-Za-z0-9]{6,40})`,vi=/* @__PURE__ */ RegExp(`^/(?:gifs|stickers)/(?:[A-Za-z0-9-]{0,200}-)?${J}/?$`),yi=/* @__PURE__ */ RegExp(`^/embed/${J}/?$`),bi=/^(?:media\d?|i)\.giphy\.com$/,xi=`\\.(?:gif|webp|mp4)`,Si=/* @__PURE__ */ RegExp(`^/media/(?:v1\\.[A-Za-z0-9_-]{1,500}/)?${J}/[A-Za-z0-9_-]{1,40}${xi}$`),Ci=/* @__PURE__ */ RegExp(`^/${J}${xi}$`);function wi(e){return{platform:`giphy`,kind:`video`,url:`https://giphy.com/gifs/${e}`,id:e,variant:`iframe`}}function Ti(e){if(e){if(G.has(e.host))return(vi.exec(e.path)??yi.exec(e.path))?.[1];if(bi.test(e.host))return(Si.exec(e.path)??(e.host===`i.giphy.com`?Ci.exec(e.path):null))?.[1]}}const Ei={platform:`giphy`,name:`Giphy`,shapes:[`video iframe`],match(e){let t=Ti(e);return t===void 0?null:{...wi(t),options:{}}},ownsFrame:pn},Di=/^width:\s*100%;\s*height:\s*0;\s*padding-bottom:\s*(\d{1,3}(?:\.\d{1,4})?)%;\s*position:\s*relative;?$/;function Oi(e){if(e.tag!==`iframe`)return null;let t=F(e.attrs.get(`src`)??``);if(!t||!G.has(t.host))return null;let[,n]=yi.exec(t.path)??[];return n===void 0?null:wi(n)}function ki(e,t){if(e.tag!==`p`||e.attrs.size!==0)return!1;let[n,...r]=e.children;if(r.length>0||n?.type!==`element`||n.tag!==`a`||n.attrs.size!==1)return!1;let i=F(n.attrs.get(`href`)??``);if(!i||!G.has(i.host)||vi.exec(i.path)?.[1]!==t.id)return!1;let[a,...o]=n.children;return o.length===0&&a?.type===`text`&&a.raw.trim()===`via GIPHY`}const Ai=/* @__PURE__ */ R(Ei,{parse(e){let t=U(e,Di),n=t?.iframe??e,r=Oi(n);return r?H({...r,options:{}},t?.size??V(n)):null},isOwnScript:()=>!1,isOwnExtra:ki}),ji=/* @__PURE__ */ new Set([`imgur.com`,`www.imgur.com`,`m.imgur.com`]),Y=`([A-Za-z0-9]{5,7})`,Mi=/* @__PURE__ */ RegExp(`^/a/${Y}/?$`),Ni=/* @__PURE__ */ RegExp(`^/gallery/(?:[A-Za-z0-9-]{1,200}-)?${Y}/?$`),Pi=/* @__PURE__ */ RegExp(`^/${Y}/?$`),Fi=/* @__PURE__ */ RegExp(`^/${Y}\\.(?:jpe?g|png|gif|gifv|mp4|webp)$`),Ii=/* @__PURE__ */ new Set([`about`,`apps`,`blog`,`help`,`jobs`,`login`,`press`,`privacy`,`random`,`search`,`signin`,`signup`,`terms`,`tools`,`upload`,`account`,`contact`,`emerald`,`explore`,`gallery`,`hot`,`new`,`rules`,`user`]),Li=/* @__PURE__ */ new Map([[`a`,[{name:`href`,value:/^https:\/\/(?:www\.)?imgur\.com\//}]]]);function Ri(e){return{platform:`imgur`,kind:`post`,url:`https://imgur.com/${e}`,id:e,variant:`iframe`}}function zi(e){return e===void 0||Ii.has(e.toLowerCase())?void 0:e}function Bi(e){if(!e)return;if(e.host===`i.imgur.com`)return zi(Fi.exec(e.path)?.[1]);if(!ji.has(e.host))return;let t=(Mi.exec(e.path)??Ni.exec(e.path))?.[1];return t===void 0?zi(Pi.exec(e.path)?.[1]):`a/${t}`}const Vi={platform:`imgur`,name:`Imgur`,shapes:[`post iframe`],trustsFallback:e=>M(e,Li),match(e){let t=Bi(e);return t===void 0?null:{...Ri(t),options:{}}}},Hi=/* @__PURE__ */ RegExp(`^(a/)?${Y}$`),Ui=/^(?:https?:)?\/\/s\.imgur\.com\/min\/embed\.js$/;function Wi(e){return e.map(e=>{if(e.type!==`element`)return e;let t=e.attrs.get(`href`),n=new Map(e.attrs);return e.tag===`a`&&t?.startsWith(`//`)&&n.set(`href`,`https:${t}`),{...e,attrs:n,children:Wi(e.children)}})}function Gi(e,t){return e.attrs.get(t)===`false`}const Ki=/* @__PURE__ */ R(Vi,{parse(e){if(e.tag!==`blockquote`||!O(e,`imgur-embed-pub`))return null;let t=e.attrs.get(`data-id`)??``,[,n,r]=Hi.exec(t)??[];if(r===void 0||n===void 0&&!zi(r))return null;let i={};return Gi(e,`data-context`)&&(i.context=!1),Gi(e,`data-analytics`)&&(i.analytics=!1),{...Ri(t),options:i,fallbackHtml:A(Wi(e.children),Li)}},isOwnScript:e=>Ui.test(e)}),qi=/* @__PURE__ */ new Set([`instagram.com`,`www.instagram.com`]),Ji=/^\/(?:([A-Za-z0-9._]{1,30})\/)?(p|reel|reels|tv)\/([A-Za-z0-9_-]{1,64})\/?$/,Yi=/* @__PURE__ */ new Set([`p`,`reel`,`reels`,`tv`]),Xi=/* @__PURE__ */ new Set([`p`,`reel`]),Zi=/* @__PURE__ */ new Map([[`div`,[]],[`a`,[`href`]],[`p`,[]]]);function Qi(e){if(!e||!qi.has(e.host))return null;let[,t,n,r]=Ji.exec(e.path)??[];return n===void 0||r===void 0||t!==void 0&&(Yi.has(t)||!Xi.has(n))?null:{platform:`instagram`,kind:`post`,url:`https://www.instagram.com/${n===`reels`?`reel`:n}/${r}/`,id:r,variant:`sdk`}}const $i={platform:`instagram`,name:`Instagram`,shapes:[`post sdk`],trustsFallback:e=>M(e,Zi),match(e){let t=Qi(e);return t&&{...t,options:{}}}},ea=/^(?:https?:)?\/\/www\.instagram\.com\/embed\.js$/,ta=/* @__PURE__ */ R($i,{parse(e){if(e.tag!==`blockquote`||!O(e,`instagram-media`))return null;let t=e.attrs.get(`data-instgrm-permalink`),n=t===void 0?k(e.children).reverse().map(e=>e.tag===`a`?Qi(F(e.attrs.get(`href`)??``)):null).find(e=>e!==null):Qi(F(t));if(!n)return null;let r={};e.attrs.has(`data-instgrm-captioned`)&&(r.captioned=!0);let i=e.attrs.get(`data-instgrm-version`);return i!==void 0&&(r.version=I(i)),{...n,options:r,fallbackHtml:A(e.children,Zi)}},isOwnScript:e=>ea.test(e)}),na=/* @__PURE__ */ new Set([`kick.com`,`www.kick.com`]),ra=/^\/([A-Za-z0-9_-]{1,32})\/?$/,ia=/* @__PURE__ */ new Set([`browse`,`categories`,`category`,`clips`,`video`,`videos`,`following`,`search`,`settings`,`dashboard`,`subscriptions`,`privacy-policy`,`terms-of-service`,`community-guidelines`,`help`]);function aa(e,t){if(!e||!t.has(e.host))return null;let[,n]=ra.exec(e.path)??[];if(n===void 0||ia.has(n.toLowerCase()))return null;let r=n.toLowerCase();return{platform:`kick`,kind:`video`,url:`https://kick.com/${r}`,id:r,variant:`iframe`}}const oa={platform:`kick`,name:`Kick`,shapes:[`video iframe`],match(e){let t=aa(e,na)??aa(e,rn);return t&&{...t,options:{}}},ownsFrame:mn},sa=/* @__PURE__ */ new Set([`autoplay`,`muted`]),ca=/* @__PURE__ */ R(oa,{parse(e){if(e.tag!==`iframe`)return null;let t=F(e.attrs.get(`src`)??``),n=aa(t,rn);if(!n||!t)return null;let r=Object.fromEntries([...t.query].filter(([e])=>sa.has(e)).map(([e,t])=>[e,I(t)]));return H({...n,options:r},V(e))},isOwnScript:()=>!1}),la=/^(?:www\.|[a-z]{2}\.)?linkedin\.com$/,ua=`(activity|share|ugcPost):(\\d{19})`,da=/* @__PURE__ */ RegExp(`^(?:/embed)?/feed/update/urn:li:${ua}/?$`),fa=/* @__PURE__ */ RegExp(`^/posts/[^/]{1,300}-(activity|share|ugcPost)-(\\d{19})-[A-Za-z0-9_-]{1,8}/?$`);function pa(e,t,n={}){let r=`urn:li:${e}:${t}`;return{platform:`linkedin`,kind:`post`,url:`https://www.linkedin.com/feed/update/${r}/`,id:r,variant:`iframe`,options:n}}const ma=e=>e.replace(/%3A/gi,`:`),ha={platform:`linkedin`,name:`LinkedIn`,shapes:[`post iframe`],match(e){if(!la.test(e.host))return null;let t=ma(e.path),[,n,r]=da.exec(t)??fa.exec(t)??[];return n===void 0||r===void 0?null:pa(n,r)},ownsFrame:hn},ga=/* @__PURE__ */ RegExp(`^/embed/feed/update/urn:li:${ua}$`),_a=/* @__PURE__ */ R(ha,{parse(e){if(e.tag!==`iframe`)return null;let t=F(e.attrs.get(`src`)??``);if(t?.host!==`www.linkedin.com`)return null;let[,n,r]=ga.exec(t.path)??[];return n===void 0||r===void 0?null:H(pa(n,r,Object.fromEntries([...t.query].map(([e,t])=>[e,I(t)]))),V(e))},isOwnScript:()=>!1}),va=/^(?:(?:www|[a-z]{2})\.)?pinterest\.(?:[a-z]{2,3}|co\.[a-z]{2}|com\.[a-z]{2})$/,ya=/^\/pin\/(?:[A-Za-z0-9-]{0,200}--)?(\d{1,25})\/?$/;function ba(e){return{platform:`pinterest`,kind:`post`,url:`https://www.pinterest.com/pin/${e}/`,id:e,variant:`sdk`}}function xa(e){if(!e||!va.test(e.host))return null;let[,t]=ya.exec(e.path)??[];return t===void 0?null:ba(t)}const Sa={platform:`pinterest`,name:`Pinterest`,shapes:[`post sdk`],match(e){let t=xa(e);return t&&{...t,options:{}}},ownsFrame:gn},Ca=/^\d{1,25}$/,wa=/^(?:https?:)?\/\/assets\.pinterest\.com\/js\/pinit(?:_main)?\.js$/,Ta=[[`data-pin-width`,`width`],[`data-pin-lang`,`lang`],[`data-pin-terse`,`terse`]],Ea=/* @__PURE__ */ R(Sa,{parse(e){if(e.tag===`a`){if(e.attrs.get(`data-pin-do`)!==`embedPin`||e.children.some(e=>e.type===`element`))return null;let t=xa(F(e.attrs.get(`href`)??``));return t&&{...t,options:B(e,Ta,I)}}if(e.tag!==`iframe`)return null;let t=F(e.attrs.get(`src`)??``);if(t?.host!==`assets.pinterest.com`||t.path!==`/ext/embed.html`)return null;let n=t.query.get(`id`);return n!==void 0&&Ca.test(n)?{...ba(n),options:{}}:null},isOwnScript:e=>wa.test(e)}),Da=/* @__PURE__ */ new Set([`reddit.com`,`www.reddit.com`,`old.reddit.com`,`new.reddit.com`]),Oa=/^\/r\/([A-Za-z0-9_]{2,21})\/comments\/([a-z0-9]{1,12})(?:\/([^/]{1,300}))?(?:\/([a-z0-9]{1,16}))?\/?$/;function ka(e){if(!e||!Da.has(e.host))return null;let[,t,n,r,i]=Oa.exec(e.path)??[];if(t===void 0||n===void 0)return null;let a={platform:`reddit`,kind:`post`,variant:`iframe`},o=`https://www.reddit.com/r/${t}/comments/${n}/`;return i===void 0?{...a,url:o,id:n}:r===void 0?null:{...a,url:`${o}comment/${i}/`,id:i}}const Aa={platform:`reddit`,name:`Reddit`,shapes:[`post iframe`],match(e){let t=ka(e);return t&&{...t,options:{}}}},ja=/^(?:https?:)?\/\/embed\.reddit\.com\/widgets\.js$/,Ma=/^(?:https?:)?\/\/embed\.redditmedia\.com\/widgets\/platform\.js$/,Na=/* @__PURE__ */ [`depth`,`style`,`theme`,`showmedia`,`showtitle`,`showedits`,`created`,`locale`,`showusername`,`snippet`].map(e=>[`data-embed-${e}`,e]),Pa=/* @__PURE__ */ R(Aa,{parse(e){if(e.tag!==`blockquote`||!(O(e,`reddit-embed-bq`)||O(e,`reddit-card`)))return null;let t=k(e.children).map(e=>e.tag===`a`?ka(F(e.attrs.get(`href`)??``)):null).find(e=>e!==null);if(!t)return null;let n=L(e.attrs.get(`data-embed-height`));return H({...t,options:B(e,Na,I)},n===void 0?void 0:{height:n})},isOwnScript:e=>ja.test(e)||Ma.test(e)}),Fa=/* @__PURE__ */ new Set([`snapchat.com`,`www.snapchat.com`]),Ia=`([A-Za-z][A-Za-z0-9._-]{1,29})`,La=/* @__PURE__ */ RegExp(`^(?:/@${Ia})?/spotlight/([A-Za-z0-9_-]{20,120})$`),Ra=/* @__PURE__ */ RegExp(`^/(?:@|add/)${Ia}$`),za=/^\/lens\/([0-9a-f]{32}|\d{1,20})$/,Ba=/* @__PURE__ */ RegExp(`^/@${Ia}/highlight/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$`);function Va(e){if(!e||!Fa.has(e.host))return null;let t=e.path.replace(/\/$/,``),n={platform:`snapchat`,variant:`iframe`},[,r,i]=La.exec(t)??[];if(i!==void 0){let e=r===void 0?``:`/@${r}`;return{...n,kind:`video`,url:`https://www.snapchat.com${e}/spotlight/${i}`,id:i}}let[,a]=Ra.exec(t)??[];if(a!==void 0)return{...n,kind:`post`,url:`https://www.snapchat.com/@${a}`,id:a};let[,o]=za.exec(t)??[];if(o!==void 0)return{...n,kind:`post`,url:`https://www.snapchat.com/lens/${o}`,id:o};let[,s,c]=Ba.exec(t)??[];return s!==void 0&&c!==void 0?{...n,kind:`post`,url:`https://www.snapchat.com/@${s}/highlight/${c}`,id:c}:null}const Ha={platform:`snapchat`,name:`Snapchat`,shapes:[`post iframe`,`video iframe`],match(e){let t=Va(e);return t&&{...t,options:{}}}},Ua=/^(?:https?:)?\/\/www\.snapchat\.com\/embed\.js$/,Wa=/* @__PURE__ */ R(Ha,{parse(e){if(e.tag!==`blockquote`||!O(e,`snapchat-embed`))return null;let t=F(e.attrs.get(`data-snapchat-embed-url`)??``);if(!t?.path.endsWith(`/embed`))return null;let n=Va({...t,path:t.path.slice(0,-6)});if(!n||!k(e.children).filter(e=>e.tag===`a`).every(e=>{let t=Va(F(e.attrs.get(`href`)??``));return t?.kind===n.kind&&t.id===n.id}))return null;let r=e.attrs.get(`data-snapchat-embed-title`),i=L(e.attrs.get(`data-snapchat-embed-width`)),a=L(e.attrs.get(`data-snapchat-embed-height`));return H({...n,options:r===void 0?{}:{title:r}},i===void 0||a===void 0?void 0:{width:i,height:a})},isOwnScript:e=>Ua.test(e)}),Ga=/* @__PURE__ */ new Set([`soundcloud.com`,`www.soundcloud.com`,`m.soundcloud.com`]),Ka=/^\/(tracks|playlists|users)\/(?:soundcloud%3A(?:tracks|playlists|users)%3A)?(\d{1,15})\/?$/i,qa=`[a-z0-9_-]{1,64}`,Ja=`s-[A-Za-z0-9]{1,32}`,Ya=/* @__PURE__ */ RegExp(`^/(${qa})(?:/(sets/${qa}|${qa})(?:/(${Ja}))?)?/?$`,`i`),Xa=/* @__PURE__ */ new Set([`discover`,`search`,`stream`,`feed`,`you`,`upload`,`charts`,`pages`,`settings`,`messages`,`notifications`,`people`,`stations`,`library`,`terms-of-use`,`signin`]),Za=/* @__PURE__ */ new Set([`likes`,`tracks`,`sets`,`albums`,`reposts`,`popular-tracks`,`followers`,`following`,`comments`,`spotlight`,`toptracks`]),Qa=/* @__PURE__ */ RegExp(`^${Ja}$`);function $a(e,t){return{platform:`soundcloud`,kind:`post`,url:e,id:t,variant:`iframe`}}function eo(e){if(e?.host!==`api.soundcloud.com`)return null;let[,t,n]=Ka.exec(e.path)??[];if(t===void 0||n===void 0)return null;let r=e.query.get(`secret_token`);if(r!==void 0&&!Qa.test(r))return null;let i=r===void 0?``:`?secret_token=${r}`;return $a(`https://api.soundcloud.com/${t.toLowerCase()}/${n}${i}`,n)}function to(e){if(!Ga.has(e.host))return null;let[,t,n,r]=Ya.exec(e.path)??[];if(t===void 0||Xa.has(t.toLowerCase())||n!==void 0&&Za.has(n.toLowerCase()))return null;let i=[t,n,r].filter(Boolean).join(`/`);return $a(`https://soundcloud.com/${i}`,i)}const no={platform:`soundcloud`,name:`SoundCloud`,shapes:[`post iframe`],match(e){let t=eo(e)??to(e);return t&&{...t,options:{}}},ownsFrame:yn},ro=/* @__PURE__ */ new Set([`href`,`title`,`target`,`style`]);function io(e){if(e?.type!==`element`||e.tag!==`a`||[...e.attrs.keys()].some(e=>!ro.has(e)))return!1;let[t,...n]=e.children;return n.length===0&&t?.type===`text`&&Ga.has(F(e.attrs.get(`href`)??``)?.host??``)}function ao(e){if(e.tag!==`div`||e.attrs.size!==1||!e.attrs.has(`style`))return!1;let[t,n,r,...i]=e.children;return i.length===0&&io(t)&&n?.type===`text`&&/^\s*·\s*$/.test(n.raw)&&io(r)}const oo=/* @__PURE__ */ R(no,{parse(e){if(e.tag!==`iframe`)return null;let t=F(e.attrs.get(`src`)??``);if(t?.host!==`w.soundcloud.com`||!/^\/player\/?$/.test(t.path))return null;let n=eo(F(t.query.get(`url`)??``));if(!n)return null;let r=t.query.get(`secret_token`);if(r!==void 0){if(!Qa.test(r))return null;n.url.includes(`?`)||(n={...n,url:`${n.url}?secret_token=${r}`})}let i=Object.fromEntries([...t.query].filter(([e])=>e!==`url`&&e!==`secret_token`).map(([e,t])=>[e,I(t)])),{height:a}=V(e)??{};return H({...n,options:i},a===void 0?void 0:{height:a})},isOwnScript:()=>!1,isOwnExtra:ao}),so=/^\/embed\/(v[a-z0-9]{1,12})\/?$/,co=/* @__PURE__ */ new Set([`rumble.com`,`www.rumble.com`]);function lo(e){return{platform:`rumble`,kind:`video`,url:`https://rumble.com/embed/${e}/`,id:e,variant:`iframe`}}function uo(e,t){return e&&t.has(e.host)?so.exec(e.path)?.[1]:void 0}const fo=/* @__PURE__ */ R({platform:`rumble`,name:`Rumble`,shapes:[`video iframe`],needsLookup:nr,match(e){let t=uo(e,co);return t===void 0?null:{...lo(t),options:{}}},ownsFrame:xn},{parse(e){if(e.tag!==`iframe`)return null;let t=F(e.attrs.get(`src`)??``),n=uo(t,/* @__PURE__ */ new Set([`rumble.com`]));if(n===void 0||!t)return null;let r={},i=t.query.get(`pub`);return i&&(r.pub=I(i)),H({...lo(n),options:r},V(e))},isOwnScript:()=>!1}),po=/* @__PURE__ */ RegExp(`^(?:/intl-[a-z]{2}(?:-[A-Za-z]{2})?)?(?:/embed)?/(track|album|playlist|artist|episode|show|audiobook|chapter)/([A-Za-z0-9]{22})(/video)?/?$`),mo=/* @__PURE__ */ new Set([`utm_source`,`si`]);function ho(e){if(e?.host!==`open.spotify.com`)return null;let[,t,n,r]=po.exec(e.path)??[];return t===void 0||n===void 0?null:{platform:`spotify`,kind:r?`video`:`post`,url:`https://open.spotify.com/${t}/${n}`,id:n,variant:`iframe`,query:e.query}}function go(e){return Object.fromEntries([...e].filter(([e])=>!mo.has(e)).map(([e,t])=>[e,I(t)]))}const _o=/* @__PURE__ */ R({platform:`spotify`,name:`Spotify`,shapes:[`post iframe`,`video iframe`],match(e){let t=ho(e);return t&&{platform:t.platform,kind:`post`,url:t.url,id:t.id,variant:t.variant,options:{}}},ownsFrame:bn},{parse(e){if(e.tag!==`iframe`)return null;let t=F(e.attrs.get(`src`)??``);if(!t?.path.startsWith(`/embed/`))return null;let n=ho(t);if(!n)return null;let{query:r,...i}=n;return H({...i,options:go(r)},V(e))},isOwnScript:()=>!1}),vo=/* @__PURE__ */ new Set([`strava.com`,`www.strava.com`]),yo=/^\/(activities|routes)\/(\d{1,20})\/?$/,bo={activity:`activities`,route:`routes`};function xo(e,t){return{platform:`strava`,kind:`post`,url:`https://www.strava.com/${bo[e]}/${t}`,id:`${e}/${t}`,variant:`iframe`}}const So={platform:`strava`,name:`Strava`,shapes:[`post iframe`],match(e){if(!vo.has(e.host))return null;let[,t,n]=yo.exec(e.path)??[];return t===void 0||n===void 0?null:{...xo(t===`routes`?`route`:`activity`,n),options:{}}}},Co=/^\d{1,20}$/,wo=/^(?:https?:)?\/\/strava-embeds\.com\/embed\.js$/,To=/* @__PURE__ */ new Set([`standard`,`minimal`]),Eo=/^[A-Za-z0-9_-]{1,100}$/;function Do(e){return e===`activity`||e===`route`}const Oo=/* @__PURE__ */ R(So,{parse(e){if(e.tag!==`div`||!O(e,`strava-embed-placeholder`)||!e.children.every(e=>e.type===`comment`||e.type===`text`&&/^\s*$/.test(e.raw)))return null;let t=e.attrs.get(`data-embed-type`),n=e.attrs.get(`data-embed-id`)??``;if(!Do(t)||!Co.test(n))return null;let r={},i=e.attrs.get(`data-style`);i!==void 0&&To.has(i)&&(r.style=i),t===`route`&&e.attrs.get(`data-full-width`)===`true`&&(r.fullWidth=!0);let a=e.attrs.get(`data-map-hash`);return a!==void 0&&Eo.test(a)&&(r.mapHash=a),{...xo(t,n),options:r}},isOwnScript:e=>wo.test(e)}),ko=`([a-z0-9]{4,8})`,Ao=/* @__PURE__ */ new Set([`streamable.com`,`www.streamable.com`]),jo=/* @__PURE__ */ RegExp(`^/[eo]/${ko}$`),Mo=/* @__PURE__ */ RegExp(`^/${ko}/?$`),No=/* @__PURE__ */ new Set([`about`,`login`,`signup`,`terms`,`privacy`,`pricing`,`upload`,`help`,`apps`,`blog`,`jobs`,`press`,`tools`,`embed`,`plans`,`contact`,`support`,`videos`,`account`,`profile`]);function Po(e){return{platform:`streamable`,kind:`video`,url:`https://streamable.com/${e}`,id:e,variant:`iframe`}}function Fo(e){return e!==void 0&&!No.has(e)}function Io(e){if(!e||!Ao.has(e.host))return;let t=(jo.exec(e.path)??Mo.exec(e.path))?.[1];return Fo(t)?t:void 0}const Lo={platform:`streamable`,name:`Streamable`,shapes:[`video iframe`],match(e){let t=Io(e);return t===void 0?null:{...Po(t),options:{}}},ownsFrame:Sn},Ro=/^width:\s*100%;\s*height:\s*0(?:px)?;\s*position:\s*relative;\s*padding-bottom:\s*(\d{1,3}(?:\.\d{1,4})?)%;?$/,zo=/* @__PURE__ */ new Set([`loop`,`autoplay`,`nocontrols`,`hd`,`muted`]),Bo=/<\/div\s*>$/i;function Vo(e){if(e.tag!==`iframe`)return null;let t=F(e.attrs.get(`src`)??``);if(!t||t.host!==`streamable.com`)return null;let[,n]=jo.exec(t.path)??[];if(!Fo(n))return null;let r=Object.fromEntries([...t.query].filter(([e])=>zo.has(e)).map(([e,t])=>[e,I(t)]));return{...Po(n),options:r}}const Ho=/* @__PURE__ */ R(Lo,{parse(e){let t=U(e,Ro),n=t?.iframe??e,r=Vo(n);return r?H(r,t?.size??V(n)):null},isOwnScript:()=>!1,repair(e){let t=e.trimEnd(),n=Bo.exec(t);if(!n)return null;let r=t.slice(0,n.index).trimEnd();return/^\s*<iframe[\s>]/i.test(r)?r:null}}),Uo=/* @__PURE__ */ new Set([`t.me`,`telegram.me`,`www.telegram.me`]),Wo=`[A-Za-z][A-Za-z0-9_]{2,31}`,Go=/* @__PURE__ */ RegExp(`^/(?:s/)?(${Wo})/(\\d{1,10})/?$`);function Ko(e,t,n){return{platform:`telegram`,kind:`post`,url:`https://t.me/${e}/${t}`,id:`${e}/${t}`,variant:`iframe`,options:n}}const qo={platform:`telegram`,name:`Telegram`,shapes:[`post iframe`],match(e){if(!Uo.has(e.host))return null;let[,t,n]=Go.exec(e.path)??[];if(t===void 0||n===void 0)return null;let r={};e.query.has(`single`)&&(r.single=!0);let i=e.query.get(`comment`);return i!==void 0&&/^\d{1,10}$/.test(i)&&(r.comment=Number(i)),Ko(t,n,r)}},Jo=/* @__PURE__ */ RegExp(`^(${Wo})/(\\d{1,10})$`),Yo=/^(?:https?:)?\/\/telegram\.org\/js\/telegram-widget\.js(?:\?\d{1,3})?$/,Xo=[`data-telegram-login`,`data-telegram-discussion`,`data-telegram-share-url`],Zo=[[`data-width`,`width`],[`data-comment`,`comment`],[`data-userpic`,`userpic`],[`data-mode`,`mode`],[`data-color`,`color`],[`data-dark`,`dark`],[`data-dark-color`,`darkColor`]],Qo=/* @__PURE__ */ R(qo,{parse:()=>null,parseScript(e){if(!Yo.test(e.attrs.get(`src`)??``)||Xo.some(t=>e.attrs.has(t)))return null;let[,t,n]=Jo.exec(e.attrs.get(`data-telegram-post`)??``)??[];if(t===void 0||n===void 0)return null;let r=B(e,Zo,I);return e.attrs.has(`data-single`)&&(r.single=!0),Ko(t,n,r)},isOwnScript:e=>Yo.test(e)}),$o=/* @__PURE__ */ new Set([`tenor.com`,`www.tenor.com`]),es=`(\\d{1,20})`,ts=/* @__PURE__ */ RegExp(`^/(?:[a-z]{2}(?:-[A-Za-z]{2,4})?/)?view/(?:[A-Za-z0-9%_.~-]{1,300}-gif-)?${es}/?$`),ns=/* @__PURE__ */ new Map([[`a`,[`href`]]]);function rs(e){return{platform:`tenor`,kind:`video`,url:`https://tenor.com/view/${e}`,id:e,variant:`iframe`}}function is(e){return e&&$o.has(e.host)?ts.exec(e.path)?.[1]:void 0}const as={platform:`tenor`,name:`Tenor`,shapes:[`video iframe`],trustsFallback:e=>M(e,ns),match(e){let t=is(e);return t===void 0?null:{...rs(t),options:{}}},ownsFrame:Cn},os=/* @__PURE__ */ RegExp(`^/embed/${es}$`),ss=/^(?:https?:)?\/\/tenor\.com\/embed\.js$/,cs=/^\d{1,3}(?:\.\d{1,20})?$/;function ls(e){let t=Math.round(e*1e4);if(!(t>=100&&t<=1e6))return;let n=us(t,1e4);return{width:t/n,height:1e4/n}}function us(e,t){return t===0?e:us(t,e%t)}function ds(e){if(!O(e,`tenor-gif-embed`))return null;let t=e.attrs.get(`data-postid`)??``;if(!(/* @__PURE__ */ RegExp(`^(\\d{1,20})$`)).test(t))return null;let n=e.attrs.get(`data-aspect-ratio`);if(n!==void 0&&!cs.test(n))return null;let r=ls(n===void 0?1.33:Number(n));return r?H({...rs(t),options:{},fallbackHtml:A(e.children,ns)},r):null}function fs(e){let t=F(e.attrs.get(`src`)??``);if(!t||t.host!==`tenor.com`)return null;let[,n]=os.exec(t.path)??[];return n===void 0?null:H({...rs(n),options:{}},V(e))}const ps=/* @__PURE__ */ R(as,{parse(e){return e.tag===`div`?ds(e):e.tag===`iframe`?fs(e):null},isOwnScript:e=>ss.test(e)}),ms=/* @__PURE__ */ new Set([`threads.com`,`www.threads.com`,`threads.net`,`www.threads.net`]),hs=/^\/(?:@[A-Za-z0-9._]{1,30}\/post|t)\/([A-Za-z0-9_-]{1,64})\/?$/,gs=/* @__PURE__ */ new Map([[`a`,[`href`]],[`div`,[]]]);function _s(e){if(!e||!ms.has(e.host))return null;let[,t]=hs.exec(e.path)??[];return t===void 0?null:{platform:`threads`,kind:`post`,url:`https://www.threads.com/t/${t}`,id:t,variant:`sdk`}}const vs={platform:`threads`,name:`Threads`,shapes:[`post sdk`],trustsFallback:e=>M(e,gs),match(e){let t=_s(e);return t&&{...t,options:{}}}},ys=/^(?:https?:)?\/\/www\.threads\.(?:com|net)\/embed\.js$/,bs=[[`data-theme`,`theme`],[`data-text-post-version`,`version`]],xs=/* @__PURE__ */ R(vs,{parse(e){if(e.tag!==`blockquote`||!O(e,`text-post-media`))return null;let t=_s(F(e.attrs.get(`data-text-post-permalink`)??``));if(!t)return null;let n=e.attrs.get(`id`);return n!==void 0&&n!==`ig-tp-${t.id}`?null:{...t,options:B(e,bs,I),fallbackHtml:A(e.children,gs)}},isOwnScript:e=>ys.test(e)}),Ss=/^\/@([A-Za-z0-9._]{0,64})\/video\/(\d{1,25})\/?$/;function Cs(e,t=``,n={}){return{platform:`tiktok`,kind:`video`,url:`https://www.tiktok.com/@${t}/video/${e}`,id:e,variant:`iframe`,options:n}}const ws={platform:`tiktok`,name:`TikTok`,shapes:[`video iframe`],match(e){if(!W.has(e.host))return null;let[,t,n]=Ss.exec(e.path)??[];return t===void 0||n===void 0?null:Cs(n,t)},ownsFrame:ln},Ts=/^\/player\/v1\/(\d{1,25})\/?$/,Es=/^\d{1,25}$/,Ds=/^(?:https?:)?\/\/www\.tiktok\.com\/embed\.js$/,Os=/* @__PURE__ */ R(ws,{parse(e){if(e.tag===`blockquote`&&O(e,`tiktok-embed`)){let t=F(e.attrs.get(`cite`)??``),[,n,r]=t&&W.has(t.host)?Ss.exec(t.path)??[]:[],i=e.attrs.get(`data-video-id`);if(i!==void 0&&!Es.test(i)||i!==void 0&&r!==void 0&&i!==r)return null;let a=i??r;return a===void 0?null:Cs(a,n)}if(e.tag!==`iframe`)return null;let t=F(e.attrs.get(`src`)??``);if(!t||!W.has(t.host))return null;let[,n]=Ts.exec(t.path)??[];return n===void 0?null:H(Cs(n,``,Object.fromEntries([...t.query].map(([e,t])=>[e,I(t)]))),V(e))},isOwnScript:e=>Ds.test(e)}),ks=/* @__PURE__ */ new Set([`truthsocial.com`,`www.truthsocial.com`]),As=`(@[A-Za-z0-9_.-]{1,64})`,js=`(\\d{1,25})`,Ms=/* @__PURE__ */ RegExp(`^/${As}/(?:posts/)?${js}/?$`);function Ns(e,t){return{platform:`truthsocial`,kind:`post`,url:`https://truthsocial.com/${e}/posts/${t}`,id:t,variant:`iframe`}}function Ps(e){if(!e||!ks.has(e.host))return null;let[,t,n]=Ms.exec(e.path)??[];return t===void 0||n===void 0?null:Ns(t,n)}const Fs={platform:`truthsocial`,name:`Truth Social`,shapes:[`post iframe`],match(e){let t=Ps(e);return t&&{...t,options:{}}},ownsFrame:wn},Is=/* @__PURE__ */ RegExp(`^/${As}/${js}/embed$`),Ls=/^(?:https?:)?\/\/truthsocial\.com\/embed\.js$/,Rs=/* @__PURE__ */ R(Fs,{parse(e){if(e.tag!==`iframe`)return null;let t=F(e.attrs.get(`src`)??``);if(!t||t.host!==`truthsocial.com`)return null;let[,n,r]=Is.exec(t.path)??[];if(n===void 0||r===void 0)return null;let i=O(e,`truthsocial-video`)?{video:!0}:{};return H({...Ns(n,r),options:i},V(e))},isOwnScript:e=>Ls.test(e)}),zs=`([a-z0-9-]{1,32})`,X=`(\\d{1,20})`,Bs=/* @__PURE__ */ new Set([`www.tumblr.com`,`tumblr.com`]),Vs=/* @__PURE__ */ RegExp(`^/${zs}/${X}(?:/[^/]{1,200})?/?$`),Hs=/* @__PURE__ */ RegExp(`^${zs}\\.tumblr\\.com$`),Us=/* @__PURE__ */ RegExp(`^/post/${X}(?:/[^/]{1,200})?/?$`),Ws=/* @__PURE__ */ new Set([`dashboard`,`explore`,`tagged`,`search`,`settings`,`blog`,`www`,`assets`,`embed`,`api`,`help`]);function Gs(e){if(!e)return null;let t,n;return Bs.has(e.host)?[,t,n]=Vs.exec(e.path)??[]:([,t]=Hs.exec(e.host)??[],[,n]=Us.exec(e.path)??[]),t===void 0||n===void 0||Ws.has(t)?null:{platform:`tumblr`,kind:`post`,url:`https://www.tumblr.com/${t}/${n}`,id:n,variant:`iframe`}}const Ks={platform:`tumblr`,name:`Tumblr`,shapes:[`post iframe`],match(e){let t=Gs(e);return t&&{...t,options:{}}}},qs=/* @__PURE__ */ RegExp(`^/embed/post/(?:t:[A-Za-z0-9_-]{1,64}|${zs})/${X}/v2$`),Js=/* @__PURE__ */ RegExp(`^/embed/post/(?:t:)?[A-Za-z0-9_-]{1,64}/${X}$`),Ys=/^(?:https?:)?\/\/(?:secure\.)?assets\.tumblr\.com\/post\.js(?:\?[^#]*)?$/,Xs=/* @__PURE__ */ R(Ks,{parse(e){if(e.tag!==`div`||!O(e,`tumblr-post`))return null;let t=F(e.attrs.get(`data-href`)??``);if(t?.host!==`embed.tumblr.com`)return null;let[,n,r]=qs.exec(t.path)??[],i=r??Js.exec(t.path)?.[1];if(i===void 0)return null;let[a,...o]=e.children.filter(e=>e.type!==`text`||e.raw.trim()!==``);if(o.length>0||a?.type!==`element`||a.tag!==`a`)return null;let s=Gs(F(a.attrs.get(`href`)??``));return s?.id!==i||n!==void 0&&s.url!==`https://www.tumblr.com/${n}/${i}`?null:{...s,options:{}}},isOwnScript:e=>Ys.test(e)}),Zs=/* @__PURE__ */ new Set([`twitch.tv`,`www.twitch.tv`,`m.twitch.tv`]),Qs=/^[A-Za-z0-9_]{3,25}$/,$s=/^v?(\d{1,12})$/,ec=/^[A-Za-z0-9_-]{6,30}$/,tc=/^[A-Za-z0-9_-]{6,100}$/,nc=/^(?:\d+h)?(?:\d+m)?(?:\d+s)?$/,rc=/* @__PURE__ */ new Set([`directory`,`videos`,`collections`,`settings`,`subscriptions`,`inventory`,`wallet`,`drops`,`search`,`downloads`,`jobs`,`turbo`,`p`,`login`,`signup`]);function Z(e,t){return{platform:`twitch`,kind:`video`,url:e,id:t,variant:`iframe`}}const ic=e=>Z(`https://www.twitch.tv/${e.toLowerCase()}`,e.toLowerCase()),ac=e=>Z(`https://www.twitch.tv/videos/${e}`,e),oc=e=>Z(`https://www.twitch.tv/collections/${e}`,e),sc=e=>Z(`https://clips.twitch.tv/${e}`,e);function cc(e){if(e.host===`clips.twitch.tv`){let t=e.path.replace(/^\/|\/$/g,``);return tc.test(t)?{found:sc(t),options:{}}:null}if(!Zs.has(e.host))return null;let t=e.path.replace(/^\/|\/$/g,``).split(`/`),[n=``,r,i]=t;if(t.length===2&&n===`videos`){let[,t]=$s.exec(r??``)??[];if(t===void 0)return null;let n=e.query.get(`t`);return{found:ac(t),options:n!==void 0&&nc.test(n)&&n?{time:n}:{}}}return t.length===2&&n===`collections`?ec.test(r??``)?{found:oc(r??``),options:{}}:null:t.length===3&&r===`clip`?Qs.test(n)&&tc.test(i??``)?{found:sc(i??``),options:{}}:null:t.length===1&&Qs.test(n)&&!rc.has(n.toLowerCase())?{found:ic(n),options:{}}:null}const lc={platform:`twitch`,name:`Twitch`,shapes:[`video iframe`],match(e){let t=cc(e);return t&&{...t.found,options:t.options}},ownsFrame:un},uc=[`autoplay`,`muted`,`time`];function dc(e){let t={};for(let n of uc){let r=e.get(n);r!==void 0&&(t[n]=I(r))}return t}function fc(e){let t=e.query.get(`channel`);if(t!==void 0)return Qs.test(t)?ic(t):null;let[,n]=$s.exec(e.query.get(`video`)??``)??[];if(n!==void 0)return ac(n);let r=e.query.get(`collection`);return r!==void 0&&ec.test(r)?oc(r):null}const pc=/* @__PURE__ */ R(lc,{parse(e){if(e.tag!==`iframe`)return null;let t=F(e.attrs.get(`src`)??``);if(!t)return null;let n=null;if(t.host===`player.twitch.tv`&&/^\/?$/.test(t.path)&&(n=fc(t)),t.host===`clips.twitch.tv`&&t.path===`/embed`){let e=t.query.get(`clip`)??``;n=tc.test(e)?sc(e):null}return n&&H({...n,options:dc(t.query)},V(e))},isOwnScript:()=>!1}),mc=/* @__PURE__ */ new Set([`vimeo.com`,`www.vimeo.com`]),Q=`(\\d{1,12})`,hc=`([0-9a-f]{6,20})`,gc=[RegExp(`^/${Q}(?:/${hc})?/?$`),RegExp(`^/channels/[A-Za-z0-9_-]{1,64}/${Q}/?$`),RegExp(`^/groups/[A-Za-z0-9_-]{1,64}/videos/${Q}/?$`),RegExp(`^/showcase/\\d{1,12}/video/${Q}/?$`)],_c=/* @__PURE__ */ RegExp(`^/video/${Q}/?$`),vc=/* @__PURE__ */ new Set([`h`,`app_id`,`player_id`]),yc=/^t=(\d+(?:\.\d+)?|(?:\d+h)?(?:\d+m)?(?:\d+s)?)$/;function bc(e,t){return{platform:`vimeo`,kind:`video`,url:`https://vimeo.com/${e}${t?`/${t}`:``}`,id:e,variant:`iframe`}}function xc(e){let[,t]=yc.exec(e.fragment??``)??[];return t?{t}:{}}function Sc(e){if(!e||!mc.has(e.host))return null;for(let t of gc){let[,n,r]=t.exec(e.path)??[];if(n!==void 0)return bc(n,r)}return null}function Cc(e){if(e?.host!==`player.vimeo.com`)return null;let[,t]=_c.exec(e.path)??[];if(t===void 0)return null;let n=e.query.get(`h`);if(n!==void 0&&!RegExp(`^${hc}$`).test(n))return null;let r=Object.fromEntries([...e.query].filter(([e])=>!vc.has(e)).map(([e,t])=>[e,I(t)]));return{...bc(t,n),options:{...r,...xc(e)}}}const wc={platform:`vimeo`,name:`Vimeo`,shapes:[`video iframe`],match(e){let t=Cc(e);if(t)return t;let n=Sc(e);return n&&{...n,options:xc(e)}},ownsFrame:dn},Tc=/^padding:\s*(\d{1,3}(?:\.\d{1,4})?)% 0 0 0;\s*position:\s*relative;?$/,Ec=/^(?:https?:)?\/\/player\.vimeo\.com\/api\/player\.js$/;function Dc(e,t){if(e?.type!==`element`||e.tag!==`a`||e.attrs.size!==1)return!1;let n=F(e.attrs.get(`href`)??``);return n!==null&&mc.has(n.host)&&t(n)&&e.children.every(e=>e.type===`text`)}function Oc(e,t){return e?.type===`text`&&e.raw.trim()===t}function kc(e,t){if(e.tag!==`p`||e.attrs.size!==0)return!1;let[n,r,i,a,o,s,...c]=e.children;return c.length===0&&Dc(n,e=>Sc(e)?.id===t.id)&&Oc(r,`from`)&&Dc(i,()=>!0)&&Oc(a,`on`)&&Dc(o,e=>e.path===``||e.path===`/`)&&Oc(s,`.`)}const Ac=/* @__PURE__ */ R(wc,{parse(e){let t=U(e,Tc),n=t?.iframe??e;if(n.tag!==`iframe`)return null;let r=Cc(F(n.attrs.get(`src`)??``));return r&&H(r,t?.size??V(n))},isOwnScript:e=>Ec.test(e),isOwnExtra:kc}),jc=/* @__PURE__ */ new Set([`x.com`,`www.x.com`,`mobile.x.com`,`twitter.com`,`www.twitter.com`,`mobile.twitter.com`]),Mc=/^\/([A-Za-z0-9_]{1,15})\/status\/(\d{1,20})\/?$/,Nc=/^\/(?:([A-Za-z0-9_]{1,15})|i\/web)\/status\/(\d{1,20})(?:\/(?:photo|video)\/[1-4])?\/?$/,Pc=/* @__PURE__ */ new Map([[`p`,[`lang`,`dir`]],[`a`,[`href`]],[`br`,[]]]);function Fc(e,t=Mc){if(!e||!jc.has(e.host))return null;let[,n=`i`,r]=t.exec(e.path)??[];return r===void 0?null:{platform:`x`,kind:`post`,url:`https://x.com/${n}/status/${r}`,id:r,variant:`sdk`}}function Ic(e){return k(e).reverse().map(e=>e.tag===`a`?Fc(F(e.attrs.get(`href`)??``)):null).find(e=>e!==null)??null}function Lc(e,t){return Ic(D(e)??[])?.id===t}const Rc={platform:`x`,name:`X`,shapes:[`post sdk`],trustsFallback:(e,t)=>M(e,Pc)&&Lc(e,t.id),match(e){let t=Fc(e,Nc);return t&&{...t,options:{}}}},zc=/^(?:https?:)?\/\/platform\.(?:x|twitter)\.com\/widgets\.js$/,Bc=[[`data-theme`,`theme`],[`data-conversation`,`conversation`],[`data-cards`,`cards`],[`data-align`,`align`],[`align`,`align`],[`data-lang`,`lang`],[`data-dnt`,`dnt`],[`data-width`,`width`]],Vc=/* @__PURE__ */ R(Rc,{parse(e){if(e.tag!==`blockquote`||!(O(e,`twitter-tweet`)||O(e,`twitter-video`)))return null;let t=Ic(e.children);return t?{...t,options:B(e,Bc,I),fallbackHtml:A(e.children,Pc)}:null},isOwnScript:e=>zc.test(e)}),Hc=`https://www.youtube.com`,Uc=/^(?!videoseries|live_stream)[A-Za-z0-9_-]{11}$/,Wc=/^\/embed\/(?:(videoseries|live_stream)|([A-Za-z0-9_-]{11}))\/?$/,Gc=/^\/(shorts|live)\/((?!videoseries|live_stream)[A-Za-z0-9_-]{11})\/?$/,Kc=/^\/([A-Za-z0-9_-]{11})\/?$/,qc=/^[A-Za-z0-9_-]{10,64}$/,Jc=/^UC[A-Za-z0-9_-]{22}$/,Yc=/^\/channel\/(UC[A-Za-z0-9_-]{22})\/live\/?$/,Xc=/^(?:(\d{1,5})h)?(?:(\d{1,6})m)?(?:(\d{1,7})s?)?$/,Zc=/^t=(.+)$/;function Qc(e){if(e===void 0||e===``)return;let t=Xc.exec(e);if(!t)return;let[,n=`0`,r=`0`,i=`0`]=t;return Number(n)*3600+Number(r)*60+Number(i)}function $c(e){return Qc(e.get(`start`))??Qc(e.get(`t`))}function el(e,t){return{platform:`youtube`,kind:`video`,url:t,id:e,variant:`iframe`}}function tl(e,t=!1){return el(e,t?`${Hc}/shorts/${e}`:`${Hc}/watch?v=${e}`)}function nl(e){return e!==void 0&&qc.test(e)?el(e,`${Hc}/playlist?list=${e}`):null}function rl(e){return e!==void 0&&Jc.test(e)?el(e,`${Hc}/channel/${e}/live`):null}function il(e){let[,t,n]=Wc.exec(e.path)??[];if(n!==void 0)return{found:tl(n)};if(t===`videoseries`){let t=nl(e.query.get(`list`));return t&&{found:t,key:`list`}}if(t===`live_stream`){let t=rl(e.query.get(`channel`));return t&&{found:t,key:`channel`}}return null}function al(e,t){let n=$c(e.query)??Qc(Zc.exec(e.fragment??``)?.[1]);return{...n===void 0?{}:{start:n},...t?{nocookie:!0}:{}}}const ol=[Vc,ta,Zr,xs,Os,/* @__PURE__ */ R({platform:`youtube`,name:`YouTube`,shapes:[`video iframe`],match(e){if(e.host===`youtu.be`){let[,t]=Kc.exec(e.path)??[];return t===void 0?null:{...tl(t),options:al(e,!1)}}let t=en.has(e.host);if(!t&&!$t.has(e.host))return null;let n=al(e,t);if(z(e.path,`/embed`)){let t=il(e);return t&&{...t.found,options:n}}if(t)return null;if(/^\/watch\/?$/.test(e.path)){let t=e.query.get(`v`);return t!==void 0&&Uc.test(t)?{...tl(t),options:n}:null}if(/^\/playlist\/?$/.test(e.path)){let t=nl(e.query.get(`list`));return t&&{...t,options:n}}let[,r]=Yc.exec(e.path)??[],i=rl(r);if(i)return{...i,options:n};let[,a,o]=Gc.exec(e.path)??[];return a===void 0||o===void 0?null:{...tl(o,a===`shorts`),options:n}},ownsFrame:sn},{parse(e){if(e.tag!==`iframe`)return null;let t=F(e.attrs.get(`src`)??``),n=t!==null&&en.has(t.host);if(!t||!(n||$t.has(t.host)))return null;let r=il(t);if(!r)return null;let i=[...t.query].filter(([e])=>e!==`t`&&e!==r.key).map(([e,t])=>[e,I(t)]),a=Object.fromEntries(i),o=$c(t.query);return o!==void 0&&(a.start=o),n&&(a.nocookie=!0),H({...r.found,options:a},V(e))},isOwnScript:()=>!1}),Qo,Wa,_a,Pa,Ea,_o,Ac,pc,Mr,oo,sr,dr,ca,Ai,ps,Ho,fo,Rs,Ki,Oo,_i,wr,Xs];function sl(e){return ol.find(t=>t.platform===e)}function cl(e){return ll(ol,e)}function ll(e,t){let n=dl(t);if(!n)return null;for(let t of e){let e=t.match(n);if(e)return e}return null}function ul(e,t){let n=dl(t);return n&&e.match(n)}function dl(e){return typeof e==`string`?F(e):null}function fl(e,t){if(t.platform!==e.platform)return null;let n=ul(e,t.url);if(n?.platform!==t.platform||n.id!==t.id||n.url!==t.url||!e.shapes.includes(`${t.kind} ${t.variant}`))return null;if(t.fallbackHtml===void 0||e.trustsFallback?.(t.fallbackHtml,t))return t;let r={...t};return delete r.fallbackHtml,r}const pl={bluesky:`Bluesky`,rumble:`Rumble`};function ml(e){return`social-embeds: a ${e} URL needs a lookup: use the embed code`}function hl(e,t,n){let{platform:r,name:i}=n,a=t??(e===void 0?null:ul(n,e));if(!a&&e!==void 0&&_l(n,e))return{error:ml(i)};if(!a)return{error:`social-embeds: not a ${i} post URL: ${String(e)}`};if(a.platform!==r)return{error:`social-embeds: expected a ${i} embed, got ${a.platform}`};let o=fl(n,a);return o?{embed:o}:{error:`social-embeds: the ${i} embed's url and id do not match`}}function gl(e){if(`html`in e)return`social-embeds: unrecognised embed code`;let t=tr(e.url);return t?ml(pl[t]??t):`social-embeds: not a supported post URL: ${e.url}`}function _l(e,t){let n=typeof t==`string`?F(t):null;return n!==null&&e.needsLookup?.(n)===!0}function vl(e){return yl(ol,e)}function yl(e,t){if(typeof t!=`string`)return null;let n=D(t);return n?xl(e,n):bl(e,t)}function bl(e,t){for(let n of e){let r=n.repair?.(t),i=r==null?null:D(r),a=i&&xl(e,i);if(a?.platform===n.platform)return a}return null}function xl(e,t){let n,r,i=[],a=!1;for(let e of t)if(e.type!==`comment`){if(e.type===`text`){if(/^\s*$/.test(Pe(e.raw)))continue;return null}if(e.tag===`script`)i.push(e);else if(Sl(e))a=!0;else if(n){if(r)return null;r=e}else n=e}if(!n){let[t]=i;if(a||i.length!==1||!t||t.children.length!==0)return null;for(let n of e){let e=n.parseScript?.(t);if(e)return e}return null}for(let t of e){let e=t.parse(n);if(!e)continue;if(a&&!t.allowsFbRoot||r&&!t.isOwnExtra?.(r,e))return null;let o=i.map(e=>e.children.length===0?e.attrs.get(`src`):void 0);if(!o.every(e=>e!==void 0&&t.isOwnScript(e)))return null;let s=o.map(e=>e===void 0?{}:t.scriptOptions?.(e)??{});return{...e,options:Object.assign({},...s,e.options)}}return null}function Sl(e){return e.tag===`div`&&e.attrs.get(`id`)===`fb-root`&&e.attrs.size===1&&e.children.length===0}function Cl(e){if(e===null||e.trim()===``)return;let t=Number(e);return Number.isFinite(t)&&t>=0?t:void 0}function wl(e){return e===null?void 0:Cl(e.trim().replace(/px$/i,``))}function Tl(e){for(let t of e.children)if(t instanceof HTMLTemplateElement)return t}function El(e){let t=e.getAttribute(`eager`);return t!==null&&t!==`false`}function Dl(e,t){let n=t??e.getAttribute(`html`)??Tl(e)?.innerHTML,r=e.getAttribute(`url`),i=e.getAttribute(`width`);return{source:n===void 0?r===null?null:{url:r}:{html:n},layout:{width:Cl(i)??(i?.trim()?i:void 0),maxWidth:wl(e.getAttribute(`max-width`)),height:wl(e.getAttribute(`height`)),maxHeight:wl(e.getAttribute(`max-height`))},eager:El(e)}}const Ol=/* @__PURE__ */ new Set([`width`,`maxWidth`,`height`,`maxHeight`,`minHeight`,`borderRadius`]);function kl(e,t){e.removeAttribute(`style`),$(e,t)}function $(e,t){for(let[n,r]of Object.entries(t)){if(r===void 0)continue;let t=typeof r==`number`&&Ol.has(n)?`${String(r)}px`:String(r);e.style.setProperty(n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),t)}}function Al(e){let t=document.createElement(`div`);return t.setAttribute(`aria-hidden`,`true`),$(t,{width:`100%`,height:`100%`,minHeight:e,background:`rgba(128, 128, 128, 0.12)`}),t}function jl(e,t,n){if(t||typeof IntersectionObserver>`u`)return n(),()=>{};let r=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(r.disconnect(),n())},{rootMargin:`200px 0px`});return r.observe(e),()=>{r.disconnect()}}function Ml(e){return e.style.position=`absolute`,e.style.setProperty(`inset`,`0`),e}function Nl(e,t,n){let{eager:r,placeholder:i,onLoad:a,onError:o}=n,{messageHeight:s}=t,c=document.createElement(`div`),l,u=e=>{kl(c,Ke(t,e,l))};u(n);let d=Ml(document.createElement(`div`)),f=Ml(document.createElement(`div`)),p=i.length>0?i:[t.fallbackHtml===void 0?Al():Pl(t.fallbackHtml,t.fallbackImage===!0)];f.append(...p),d.append(f),c.append(d),e.append(c);let m,h=!1,g,_=[],v=()=>{f.remove(),h||(h=!0,a())},y=s?`did not report its height`:`did not load`,ee=()=>{g=setTimeout(()=>{h||(f.remove(),o(/* @__PURE__ */ Error(`social-embeds: ${t.title} ${y}`)))},15e3)},b=e=>{let n=document.createElement(`iframe`);n.src=t.clientSrc?t.clientSrc(e):e,n.title=t.title,n.setAttribute(`allow`,t.allow),t.allowFullscreen!==!1&&n.setAttribute(`allowfullscreen`,``),t.referrerPolicy&&(n.referrerPolicy=t.referrerPolicy),t.scrolling&&n.setAttribute(`scrolling`,t.scrolling),t.sandbox!==void 0&&n.setAttribute(`sandbox`,t.sandbox),$(n,{display:`block`,width:`100%`,height:`100%`,border:0}),n.addEventListener(`load`,()=>{s||v()}),m?m.replaceWith(n):d.prepend(n),m=n},x=!1,S=()=>{if(x)return;x=!0,s&&_.push(s.listen(()=>m,e=>{l=e,$(c,{height:l}),v()}));let{sizeInSrc:e}=t;e?_.push(e.watch(d,t=>{b(e.src(t))})):b(t.src)};return r&&S(),_.push(jl(d,!1,()=>{S(),ee()})),{wrapper:c,cleanup:()=>{for(let e of _)e();clearTimeout(g),c.remove()},update(e,t){u(e),t&&S()}}}function Pl(e,t){let n=document.createElement(t?`div`:`blockquote`);return t&&(n.style.height=`100%`),n.innerHTML=e,n}const Fl=[`href`,`data-href`,`data-instgrm-permalink`,`data-text-post-permalink`];function Il(e){let t=e.querySelector(Fl.map(e=>`[${e}]`).join());for(let e of Fl){let n=t?.getAttribute(e);if(n)return n}}function Ll(e){return`View this post on ${e}`}function Rl(e){return e instanceof Error?e:Error(String(e))}function zl(e,t,n){let{driver:r,label:i}=t,{eager:a,placeholder:o,onLoad:s,onError:c}=n,l=document.createElement(`div`),u=e=>{kl(l,{width:e.width??`100%`,maxWidth:e.maxWidth??t.maxWidth})};u(n);let d=document.createElement(`div`);$(d,{width:`100%`});let f=document.createElement(`div`);f.innerHTML=t.markup,d.append(f);let p=Il(f),m=t.hasFallback?[]:o.length>0?o:[Al(t.minHeight)];d.append(...m),l.append(d),e.append(l);let h=e=>{for(let e of m)e.parentNode?.removeChild(e);m=e,d.append(...e)},g=!1,_=!1,v,y=()=>{},ee=()=>{g||_||(_=!0,clearTimeout(v),y(),h([]),s())},b=e=>{if(t.hasFallback||p===void 0)h([]);else{let e=document.createElement(`a`);e.setAttribute(`href`,p),e.textContent=Ll(i),h([e])}c(e)},x=(e,t)=>{g||_||(y(),y=()=>{},e>=3||t instanceof he?b(t):v=setTimeout(()=>{S(e+1)},1e3*2**(e-1)))},S=e=>{if(!(g||_)){try{y=r.render(f,ee)}catch(t){x(e,Rl(t));return}v=setTimeout(()=>{x(e,/* @__PURE__ */ Error(`social-embeds: the ${i} embed did not render`))},15e3)}},C=!1,w=()=>{C||(C=!0,r.load().then(()=>{S(1)},e=>{g||b(Rl(e))}))},te=jl(f,a,w);return{wrapper:l,cleanup:()=>{g=!0,te(),clearTimeout(v),y(),l.remove()},update(e,t){u(e),t&&w()}}}const Bl=typeof HTMLElement>`u`?class{}:HTMLElement,Vl=`embed`;function Hl(e){let t=[];for(let n of e.childNodes)if(n.nodeType===Node.ELEMENT_NODE&&!(n instanceof HTMLTemplateElement)||n.nodeType===Node.TEXT_NODE&&n.textContent?.trim()){let e=n.cloneNode(!0);if(e instanceof Element)for(let t of[e,...e.querySelectorAll(`[id]`)])t.removeAttribute(`id`);t.push(e)}return t}function Ul(e){let t=``;for(let n of e.children)n.slot!==Vl&&(t+=n.outerHTML);return t&&(vl(t)??Ln(t))?t:void 0}function Wl(e){let t=`html`in e?vl(e.html):cl(e.url);if(!t){let t=`html`in e?Ln(e.html):null;return t?Jn(t):{kind:`error`,message:gl(e)}}let n=sl(t.platform);if(!n)return{kind:`error`,message:gl(e)};let r=hl(void 0,t,n);return r.error===void 0?Yt(r.embed):{kind:`error`,message:r.error}}const Gl=[`html`,`url`,`width`,`maxWidth`,`height`,`maxHeight`,`eager`];var Kl=class extends Bl{static observedAttributes=[`html`,`url`,`width`,`max-width`,`height`,`max-height`,`eager`];#e=null;#t;#n;#r;#i;#a=0;#o=!1;constructor(){super(),this.attachShadow({mode:`open`}).innerHTML=`<slot name="${Vl}"></slot>`;for(let e of Gl){if(!Object.hasOwn(this,e))continue;let t=this[e];Reflect.deleteProperty(this,e),Reflect.set(this,e,t)}}get html(){return this.#e}set html(e){this.#e=typeof e==`string`?e:null,this.#l()}get url(){return this.getAttribute(`url`)}set url(e){this.#c(`url`,e)}get width(){return this.getAttribute(`width`)}set width(e){this.#c(`width`,e)}get maxWidth(){return this.getAttribute(`max-width`)}set maxWidth(e){this.#c(`max-width`,e)}get height(){return this.getAttribute(`height`)}set height(e){this.#c(`height`,e)}get maxHeight(){return this.getAttribute(`max-height`)}set maxHeight(e){this.#c(`max-height`,e)}get eager(){return El(this)}set eager(e){this.#c(`eager`,e===``||e&&e!==`false`?``:null)}connectedCallback(){!this.#t&&document.readyState===`loading`?this.#o||(this.#o=!0,document.addEventListener(`DOMContentLoaded`,()=>{this.#o=!1,this.isConnected&&this.connectedCallback()},{once:!0})):(this.#t??=new MutationObserver(()=>{this.#s(),this.#l()}),this.#s(),this.#l())}disconnectedCallback(){queueMicrotask(()=>{this.isConnected||(this.#t?.disconnect(),this.#u(),this.#r=void 0,this.#i=void 0)})}attributeChangedCallback(){this.#l()}#s(){let e=this.#t;if(e){e.disconnect(),e.observe(this,{childList:!0});for(let t of this.children)t instanceof HTMLTemplateElement&&e.observe(t.content,{childList:!0,subtree:!0,characterData:!0})}}#c(e,t){t==null?this.removeAttribute(e):this.setAttribute(e,t)}#l(){if(!this.isConnected||!this.#t)return;let e=this.#n?.wrapper;for(let t of[...this.children])t!==e&&t.slot===Vl&&t.remove();let t=!e||e.parentNode===this,n=Dl(this,this.#e);this.#i=n.source?void 0:t&&this.#i||Ul(this),n.source??=this.#i===void 0?null:{html:this.#i};let r=JSON.stringify(n.source);r===this.#r&&t?this.#n?.update(n.layout,n.eager):(this.#u(),this.#r=r,this.#d(n))}#u(){this.#a+=1;let e=this.#n;this.#n=void 0,e?.cleanup()}#d(e){let{source:t,layout:n,eager:r}=e;if(!t)return;let i=this.#a,a=e=>{queueMicrotask(()=>{i===this.#a&&this.isConnected&&this.dispatchEvent(e)})},o=e=>{a(new ErrorEvent(`error`,{error:e,message:e.message}))},s=Wl(t);if(s.kind===`error`){o(Error(s.message));return}let c={...n,eager:r,placeholder:this.#i===void 0?Hl(this):[],onLoad:()=>{a(new Event(`load`))},onError:o};this.#n=s.kind===`iframe`?Nl(this,s,c):zl(this,s,c),this.#n.wrapper.slot=Vl}};typeof customElements<`u`&&!customElements.get(`social-embed`)&&customElements.define(`social-embed`,Kl);export{Kl as SocialEmbedElement};
1
+ const e=`autoplay *; encrypted-media *; fullscreen *; clipboard-write`,t=`allow-forms allow-popups allow-same-origin allow-scripts allow-storage-access-by-user-activation allow-top-navigation-by-user-activation`;function n(n){let r=n.url.slice(23),i=r.includes(`/song/`)||r.includes(`?i=`);return{kind:`iframe`,src:`https://embed.music.apple.com${r}`,title:`Apple Music player`,allow:e,sandbox:t,ratio:{width:16,height:9},height:n.size?.height??(i?175:450),maxWidth:660,borderRadius:10}}function r(n){let r=n.url.slice(26);return{kind:`iframe`,src:`https://embed.podcasts.apple.com${r}`,title:`Apple Podcasts player`,allow:e,sandbox:t,ratio:{width:16,height:9},height:n.size?.height??(r.includes(`?i=`)?160:450),maxWidth:640,borderRadius:12}}function i(e,t){return Object.entries(e).filter(([e])=>!t.includes(e.toLowerCase()))}function a(...e){let t=/* @__PURE__ */ new Map;for(let n of e)for(let[e,r]of n??[])t.set(e,String(r));let n=[...t].map(([e,t])=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`);return n.length>0?`?${n.join(`&`)}`:``}function o(e,t){let n=[];for(let[r,i]of Object.entries(t)){let t=e[r];typeof t==`boolean`?n.push([i,+!!t]):(typeof t==`string`||typeof t==`number`)&&n.push([i,t])}return n}function s(e,t){let{origin:n,read:r}=this,i=i=>{if(i.origin!==n)return;let a=e();if(!a||i.source!==a.contentWindow)return;let o;try{o=r(i.data)}catch{return}typeof o==`number`&&o>0&&o<=5e4&&t(Math.ceil(o))};return window.addEventListener(`message`,i),()=>{window.removeEventListener(`message`,i)}}function c(e,t){if(typeof IntersectionObserver>`u`)return t(!0),()=>{};let n=!1,r,i=()=>{let e=n&&document.visibilityState!==`hidden`;e!==r&&(r=e,t(e))},a=new IntersectionObserver(e=>{let t=e[e.length-1];t&&(n=t.isIntersecting,i())});return a.observe(e),document.addEventListener(`visibilitychange`,i),()=>{a.disconnect(),document.removeEventListener(`visibilitychange`,i)}}const l={origin:`https://embed.bsky.app`,read(e){let t=e?.height;return typeof t==`number`?t:void 0},listen:s,onScreen:c};function u(e,t){let n=t.colorMode??e.options.colorMode;return{kind:`iframe`,src:`https://embed.bsky.app/embed/${e.id}${a(typeof n==`string`?[[`colorMode`,n]]:void 0)}`,title:`Bluesky post`,allow:``,scrolling:`no`,ratio:{width:1,height:1},messageHeight:l,startHeight:300,maxWidth:600,fallbackHtml:e.fallbackHtml}}const d=/^x[a-z0-9]{3,12}$/;function f(e,t){let{playerId:n,mute:r,startTime:o,loop:s}=t,{playerId:c,...l}=e.options,u=n??c;if(u===void 0)return{kind:`error`,message:`social-embeds: a Dailymotion embed needs a Player ID: pass playerId to DailymotionEmbed`};if(typeof u!=`string`||!d.test(u))return{kind:`error`,message:`social-embeds: not a Dailymotion Player ID: ${String(u)}`};let f=[];return r!==void 0&&f.push([`mute`,String(r)]),o!==void 0&&f.push([`startTime`,o]),s!==void 0&&f.push([`loop`,String(s)]),{kind:`iframe`,src:`https://geo.dailymotion.com/player/${u}.html${a([[`video`,e.id]],i(l,[`video`,`playlist`]),f)}`,title:`Dailymotion video player`,allow:`autoplay; fullscreen; picture-in-picture; web-share`,ratio:{width:16,height:9},size:e.size}}const p=15e3,m=3e3,h=/* @__PURE__ */ new Map;function g(e){if(typeof document>`u`)return Promise.reject(/* @__PURE__ */ Error(`social-embeds: platform scripts load only in the browser`));let t=h.get(e.key);return t||(t=_(e).catch(t=>{throw h.delete(e.key),t}),h.set(e.key,t)),t}async function _(e){if(!e.isPresent()){let t=[...document.querySelectorAll(`script[src]`)].filter(t=>e.isOwn(t.src));t.length!==0&&await v(e,t)||await b(e)}await e.whenPresent?.()}function v(e,t){return new Promise(n=>{let r=Date.now()+(document.readyState===`complete`?m:p),i,a=()=>{r=Date.now()+m},o=()=>{clearTimeout(i),window.removeEventListener(`load`,a);for(let e of t)e.removeEventListener(`error`,o);n(e.isPresent())},s=()=>{e.isPresent()||Date.now()>=r?o():i=setTimeout(s,50)};window.addEventListener(`load`,a);for(let e of t)e.addEventListener(`error`,o);s()})}var y=class extends Error{};async function b(e){let t=e.readyCallback?.();for(let t=1;;t++)try{let n=await ee(e);if(t>=3||!e.skipped?.())break;n.remove()}catch(e){if(!(e instanceof y)||t>=3)throw e;await C(1e3*2**(t-1))}await(t?S(t,`${e.url} did not report ready`):x(e))}async function ee(e){let t=e.prepare?.(),n=document.createElement(`script`),r=new Promise((t,r)=>{n.src=e.url,n.async=!0,e.crossOrigin&&(n.crossOrigin=e.crossOrigin);let i=document.querySelector(`script[nonce]`)?.nonce;i&&n.setAttribute(`nonce`,i),n.addEventListener(`load`,()=>{t()}),n.addEventListener(`error`,()=>{n.remove(),r(new y(`social-embeds: could not load ${e.url}`))}),document.head.appendChild(n)});try{await S(r,`${e.url} did not load`)}finally{t?.()}return n}function x(e){return new Promise((t,n)=>{let r=Date.now()+p,i=()=>{e.isPresent()?t():Date.now()>=r?n(/* @__PURE__ */ Error(`social-embeds: ${e.url} did not initialise`)):setTimeout(i,50)};i()})}function S(e,t){return new Promise((n,r)=>{let i=setTimeout(()=>{r(/* @__PURE__ */ Error(`social-embeds: ${t}`))},p);e.then(()=>{clearTimeout(i),n()},e=>{clearTimeout(i),r(e instanceof Error?e:Error(String(e)))})})}function C(e){return new Promise(t=>setTimeout(t,e))}const w=()=>window,T=`v26.0`,te=/^[a-z]{2,3}_[A-Z]{2}$/;function ne(e){let t=w().instgrm?.Embeds;return t?.registeredEmbedSDKs?.[e]===!0&&typeof t.process==`function`}const re={key:`x`,url:`https://platform.twitter.com/widgets.js`,isOwn:e=>/^https?:\/\/platform\.(?:twitter|x)\.com\/widgets\.js(?:[?#]|$)/.test(e),isPresent:()=>typeof w().twttr?.widgets?.load==`function`,whenPresent:()=>new Promise(e=>{let t=w().twttr?.ready;t?t(()=>{e()}):e()})};function ie(){let e=w().FB;return!e||e.__buffer?()=>{}:(e.__buffer=!0,()=>{delete e.__buffer})}function ae(e){let t=w().FB;return!ne(e)&&t!==void 0&&!t.__buffer}const oe={key:`instagram`,url:`https://www.instagram.com/embed.js`,isOwn:e=>/^https?:\/\/www\.instagram\.com\/embed\.js(?:[?#]|$)/.test(e),isPresent:()=>ne(`instagram`),prepare:ie,skipped:()=>ae(`instagram`)},se={key:`threads`,url:`https://www.threads.com/embed.js`,isOwn:e=>/^https?:\/\/www\.threads\.(?:com|net)\/embed\.js(?:[?#]|$)/.test(e),isPresent:()=>ne(`threads`),prepare:ie,skipped:()=>ae(`threads`)};function ce(e){return{key:`facebook`,url:`https://connect.facebook.net/${e}/sdk.js#xfbml=0&version=${T}`,crossOrigin:`anonymous`,isOwn:e=>/^https?:\/\/connect\.facebook\.net\/[a-z]{2,3}_[A-Z]{2}\/(?:sdk(?:\/debug)?|all)\.js(?:[?#]|$)/.test(e),isPresent:()=>typeof w().FB?.XFBML?.parse==`function`,readyCallback:()=>new Promise(e=>{let t=w().fbAsyncInit;w().fbAsyncInit=()=>{t?.(),e()}})}}const le={key:`pinterest`,url:`https://assets.pinterest.com/js/pinit_main.js`,isOwn:e=>/^https?:\/\/assets\.pinterest\.com\/js\/pinit(?:_main)?\.js(?:[?#]|$)/.test(e),isPresent:()=>typeof w().PinUtils?.build==`function`};function ue(){return g(re)}function de(){return g(oe)}function fe(){return g(se)}function pe(){return g(le)}function me(e){return te.test(e)?g(ce(e)):Promise.reject(/* @__PURE__ */ Error(`social-embeds: invalid Facebook locale "${e}"`))}const E=()=>window;var he=class extends Error{};function D(e,t,n){if(t(e))return n(),()=>{};let r=new MutationObserver(()=>{t(e)&&(r.disconnect(),n())});return r.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`class`,`style`,`height`]}),()=>{r.disconnect()}}function ge(e,t){let n=e.querySelector(`blockquote`);n&&!n.hasAttribute(`class`)&&n.classList.add(t)}function _e(e){return[...e.querySelectorAll(`iframe`)].some(e=>Number.parseFloat(e.style.height)>0)}const ve={load:()=>ue(),render(e,t){let n=E().twttr,r=n=>{n.target instanceof Node&&e.contains(n.target)&&t()};n?.events?.bind?.(`rendered`,r);let i=D(e,_e,t);return ge(e,`twitter-tweet`),n?.widgets?.load?.(e),()=>{n?.events?.unbind?.(`rendered`,r),i()}}};function ye(e,t){if(e.getRootNode()!==document)throw new he(`social-embeds: the ${t} embed cannot render inside a shadow root`)}function be(){let e=E().instgrm?.Embeds?.process;if(!e)throw Error(`social-embeds: instgrm.Embeds.process is missing`);e()}const xe={load:()=>de(),render(e,t){ye(e,`Instagram`);let n=D(e,e=>e.querySelector(`iframe.instagram-media-rendered`)!==null,t);return ge(e,`instagram-media`),be(),n}};let Se=0;function Ce(e){let t=e.querySelector(`blockquote`);t?.id&&!t.hasAttribute(`class`)&&(Se+=1,t.id=`${t.id}-${String(Se)}`)}const we={load:()=>fe(),render(e,t){ye(e,`Threads`);let n=D(e,e=>e.querySelector(`iframe`)!==null&&e.querySelector(`blockquote`)===null,t);return Ce(e),ge(e,`text-post-media`),be(),n}},Te=/* @__PURE__ */ new Map;function Ee(e){let t=Te.get(e);return t||(t={load:()=>me(e),render(e,t){let n=E().FB,r=n?.XFBML?.parse;if(!n||!r)throw Error(`social-embeds: FB.XFBML.parse is missing`);let i=()=>{r(e,t)};try{i()}catch(e){if(!(e instanceof Error)||!/init not called/.test(e.message))throw e;n.init?.({xfbml:!1,version:T}),i()}return()=>{}}},Te.set(e,t)),t}const De={load:()=>pe(),render(e,t){let n=E().PinUtils?.build;if(!n)throw Error(`social-embeds: PinUtils.build is missing`);let r=D(e,e=>e.querySelector(`span[data-pin-id]`)!==null,t),i=e.querySelector(`a`);return i&&!i.hasAttribute(`data-pin-do`)&&i.setAttribute(`data-pin-do`,`embedPin`),n(e),r}},Oe=/* @__PURE__ */ new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`source`,`track`,`wbr`]),ke=/* @__PURE__ */ new Map([[`script`,/<\/script\s*>/giu],[`style`,/<\/style\s*>/giu]]),Ae=/<([a-zA-Z][a-zA-Z0-9-]*)/y,je=/\s+([^\s"'>/=]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/y,Me=/\s*(\/?)>/y,Ne=/<\/([a-zA-Z][a-zA-Z0-9-]*)\s*>/y,Pe=/* @__PURE__ */ new Map([[`amp`,`&`],[`lt`,`<`],[`gt`,`>`],[`quot`,`"`],[`apos`,`'`],[`nbsp`,`\xA0`]]);function O(e){let t={type:`element`,tag:``,attrs:/* @__PURE__ */ new Map,children:[]},n=[t],r=0;for(;r<e.length;){let i=n[n.length-1]??t,a=e.indexOf(`<`,r),o=a===-1?e.length:a;if(o>r&&i.children.push({type:`text`,raw:e.slice(r,o)}),a===-1)break;if(e.startsWith(`<!--`,a)){let t=e.indexOf(`-->`,a+4);if(t===-1)return null;i.children.push({type:`comment`}),r=t+3;continue}Ne.lastIndex=a;let s=Ne.exec(e);if(s){if(i===t||i.tag!==s[1]?.toLowerCase())return null;n.pop(),r=Ne.lastIndex;continue}let c=Fe(e,a);if(!c)return null;let{element:l}=c;i.children.push(l),r=c.end;let u=c.selfClosing?void 0:ke.get(l.tag);if(u){u.lastIndex=r;let t=u.exec(e);if(!t)return null;t.index>r&&l.children.push({type:`text`,raw:e.slice(r,t.index)}),r=u.lastIndex}else if(!c.selfClosing&&!Oe.has(l.tag)){if(n.length>100)return null;n.push(l)}}return n.length===1?t.children:null}function Fe(e,t){Ae.lastIndex=t;let n=Ae.exec(e)?.[1];if(n===void 0)return null;let r=/* @__PURE__ */ new Map,i=Ae.lastIndex;for(;;){Me.lastIndex=i;let t=Me.exec(e);if(t)return{element:{type:`element`,tag:n.toLowerCase(),attrs:r,children:[]},selfClosing:t[1]===`/`,end:Me.lastIndex};je.lastIndex=i;let a=je.exec(e);if(!a)return null;let[,o=``,s,c,l]=a,u=o.toLowerCase();r.has(u)||r.set(u,Ie(s??c??l??``)),i=je.lastIndex}}function Ie(e){return e.replace(/&(#[0-9]{1,7}|#[xX][0-9a-fA-F]{1,6}|[a-zA-Z]+);/g,(e,t)=>{if(!t.startsWith(`#`))return Pe.get(t)??e;let n=t[1]===`x`||t[1]===`X`,r=Number.parseInt(t.slice(n?2:1),n?16:10);return r>0&&r<=1114111&&(r<55296||r>57343)?String.fromCodePoint(r):e})}function k(e,t){return(e.attrs.get(`class`)??``).split(/\s+/).includes(t)}function A(e){let t=[];return Le(e,t),t}function Le(e,t){for(let n of e)n.type===`element`&&(t.push(n),Le(n.children,t))}const Re=/* @__PURE__ */ new Set([`href`,`cite`]),ze=/^https?:\/\//i;function j(e,t){let n=``;for(let r of e){if(r.type===`text`){n+=r.raw;continue}if(r.type!==`element`)continue;let e=t.get(r.tag);if(e){n+=`<${r.tag}`;for(let t of e){let e=typeof t==`string`?t:t.name,i=r.attrs.get(e);i===void 0||typeof t!=`string`&&!t.value.test(i)||Re.has(e)&&!ze.test(i)||(n+=` ${e}="${M(i)}"`)}n+=`>`,Oe.has(r.tag)||(n+=`${j(r.children,t)}</${r.tag}>`)}}return n}function M(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function N(e,t){let n=O(e);return n!==null&&j(n,t)===e}function Be(e){let t=``;for(let[n,r]of Object.entries(e))r!==void 0&&(t+=r===!0?` ${n}`:` ${n}="${M(String(r))}"`);return t}function Ve(e,t){let n={};for(let[r,i]of Object.entries(e)){let e=t[r];e!==void 0&&(n[i]=String(e))}return Be(n)}function P(e,t){let n={...e};for(let[e,r]of Object.entries(t))r!==void 0&&(n[e]=r);return n}function F(e){return e!==void 0&&e.trim()!==``}const He={width:`data-width`,showText:`data-show-text`,lazy:`data-lazy`,allowfullscreen:`data-allowfullscreen`,autoplay:`data-autoplay`,showCaptions:`data-show-captions`},Ue={showText:`show_text`,allowfullscreen:`allowfullscreen`,autoplay:`autoplay`,showCaptions:`show_captions`},We={post:300,video:200};function Ge(e){let t=Object.entries(e.options).filter(([e])=>e!==`href`);return{kind:`iframe`,src:`https://www.facebook.com/plugins/video.php${a([[`href`,e.url]],t)}`,title:`Facebook video player`,allow:`autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share`,scrolling:`no`,ratio:{width:16,height:9},size:e.size}}function Ke(e,t){if(e.variant===`iframe`)return Ge(e);let n=P(e.options,{showText:t.showText,allowfullscreen:t.allowfullscreen,autoplay:t.autoplay,showCaptions:t.showCaptions}),{size:r}=e;if(e.kind===`video`&&n.showText===!1&&r?.width!==void 0&&r.height!==void 0){let t={};for(let[e,r]of Object.entries(Ue)){let i=n[e];i!==void 0&&(t[r]=i)}return t.width=r.width,t.height=r.height,Ge({...e,options:t})}let i=t.locale??(typeof n.locale==`string`?n.locale:`en_US`),a=`<div class="${e.kind===`video`?`fb-video`:`fb-post`}" data-href="${M(e.url)}"${Ve(He,n)}>${e.fallbackHtml??``}</div>`;return{kind:`script`,key:`${i} ${a}`,markup:a,driver:Ee(i),minHeight:We[e.kind],label:`Facebook`,title:e.kind===`video`?`Facebook video`:`Facebook post`,hasFallback:F(e.fallbackHtml),maxWidth:e.kind===`post`?750:void 0}}function qe(e){return{width:e.size?.width??e.ratio.width,height:e.size?.height??e.ratio.height}}function Je(e,t,n){let{width:r=`100%`,maxHeight:i}=t,a=t.height??e.height,o=t.maxWidth??e.maxWidth,{width:s,height:c}=qe(e),l=i===void 0||a!==void 0?void 0:Math.floor(i*s/c);return{position:`relative`,width:r,maxWidth:l===void 0||o!==void 0&&o<l?o:l,...e.messageHeight?{height:n??e.startHeight}:a===void 0?{aspectRatio:`${String(s)} / ${String(c)}`}:{height:a,maxHeight:i},...e.borderRadius===void 0?{}:{borderRadius:e.borderRadius,overflow:`hidden`}}}function Ye(e,t){let n=qe(e),r=Math.round(t*n.height/n.width),i=e.src.indexOf(`?`),a=i===-1?e.src:e.src.slice(0,i),o=i===-1?``:`&${e.src.slice(i+1)}`;return`${a}?width=${String(t)}&height=${String(r)}${o}`}function Xe(e,t){let n,r,i=e=>{let i=Math.round(e);i<=0||(clearTimeout(r),i!==n&&(n===void 0?(n=i,t(i)):r=setTimeout(()=>{n=i,t(i)},200)))};if(typeof ResizeObserver>`u`)return i(e.getBoundingClientRect().width),()=>{};let a=new ResizeObserver(e=>{for(let t of e)i(t.contentRect.width)});return a.observe(e),()=>{a.disconnect(),clearTimeout(r)}}const Ze=[`header`,`footer`,`context`],Qe=/\/albums\/\d+$/;function $e(e,t){let n=Qe.test(e.url),r=Ze.filter(n=>t[n]??e.options[n]===!0),{width:i,height:a}=e.size??{},o=i!==void 0&&a!==void 0?{width:i,height:a}:void 0,s=`https://embedr.flickr.com/${n?`photosets`:`photos`}/${e.id}${r.length>0?`?${r.map(e=>`${e}=true`).join(`&`)}`:``}`,c={width:4,height:3};return{kind:`iframe`,src:s,title:n?`Flickr album`:`Flickr photo`,allow:``,scrolling:`no`,ratio:c,...o?{size:o,maxWidth:o.width}:{},sizeInSrc:{watch:Xe,src:e=>Ye({src:s,ratio:c,size:o},e)},...e.fallbackHtml===void 0?{}:{fallbackHtml:e.fallbackHtml.replace(/<img(?=[\s>])/g,`<img style="display:block;width:100%;height:100%;object-fit:cover"`)},fallbackImage:!0}}function et(e){return{kind:`iframe`,src:`https://giphy.com/embed/${e.id}`,title:`Giphy GIF`,allow:`fullscreen`,ratio:{width:1,height:1},size:e.size}}const tt={origin:`https://imgur.com`,read(e){if(typeof e!=`string`)return;let t=JSON.parse(e);return t.message===`resize_imgur`&&typeof t.height==`number`?t.height:void 0},listen:s,onScreen:c};function nt(e,t){let n=[`pub=true`,...t.context??e.options.context!==!1?[]:[`context=false`],...e.options.analytics===!1?[`analytics=false`]:[]];return{kind:`iframe`,src:`https://imgur.com/${e.id}/embed?${n.join(`&`)}`,title:`Imgur post`,allow:``,scrolling:`no`,ratio:{width:1,height:1},messageHeight:tt,startHeight:500,maxWidth:540,fallbackHtml:e.fallbackHtml}}function rt(e,t){let n=P(e.options,{captioned:t.captioned}),r=`<blockquote${Be({"data-instgrm-permalink":e.url,"data-instgrm-version":n.version,"data-instgrm-captioned":n.captioned===!0||void 0,style:`width:calc(100% - 2px)`})}>${e.fallbackHtml??``}</blockquote>`;return{kind:`script`,key:r,markup:r,driver:xe,minHeight:680,label:`Instagram`,title:`Instagram post`,hasFallback:F(e.fallbackHtml),maxWidth:540}}const it=/* @__PURE__ */ new Set([`autoplay`,`muted`]);function at(e,t){let n=[];return t.autoplay!==void 0&&n.push([`autoplay`,t.autoplay]),t.muted!==void 0&&n.push([`muted`,t.muted]),{kind:`iframe`,src:`https://player.kick.com/${e.id}${a(Object.entries(e.options).filter(([e])=>it.has(e)),n)}`,title:`Kick player`,allow:`autoplay; fullscreen`,scrolling:`no`,ratio:{width:16,height:9},size:e.size}}function ot(e,t){let n=new Map(Object.entries(e.options));return t.collapsed===!0&&n.set(`collapsed`,1),t.collapsed===!1&&n.delete(`collapsed`),{kind:`iframe`,src:`https://www.linkedin.com/embed/feed/update/${e.id}${a(n)}`,title:`LinkedIn post`,allow:``,ratio:{width:504,height:670},height:e.size?.height??670,maxWidth:e.size?.width??504}}const st={width:`data-pin-width`,lang:`data-pin-lang`,terse:`data-pin-terse`},ct={small:236,medium:345,large:600};function lt(e,t){let n=P(e.options,{width:t.pinWidth}),r=`<a href="${M(e.url)}"${Ve(st,n)}></a>`;return{kind:`script`,key:r,markup:r,driver:De,minHeight:270,label:`Pinterest`,title:`Pinterest pin`,hasFallback:!1,maxWidth:ct[String(n.width)]??236}}const ut={theme:`theme`,showMedia:`showmedia`,showTitle:`showtitle`,showUsername:`showusername`,locale:`locale`,depth:`depth`},dt={origin:`https://embed.reddit.com`,read(e){if(typeof e!=`string`)return;let t=JSON.parse(e);return t.type===`resize.embed`&&typeof t.data==`number`?t.data:void 0},listen:s,onScreen:c};function ft(e,t){let n=[];for(let[e,r]of Object.entries(ut)){let i=t[e];i!==void 0&&n.push([r,i])}return{kind:`iframe`,src:`https://embed.reddit.com${e.url.slice(22)}${a([[`embed`,!0]],Object.entries(e.options),n)}`,title:`Reddit post`,allow:`clipboard-read; clipboard-write`,sandbox:`allow-scripts allow-same-origin allow-popups`,scrolling:`no`,ratio:{width:1,height:1},messageHeight:dt,startHeight:e.size?.height??316,maxWidth:640}}function pt(e){let t=e.options.title;return{kind:`iframe`,src:`${e.url}/embed`,title:typeof t==`string`&&t!==``?t:`Snapchat`,allow:`autoplay; camera; microphone; clipboard-write;`,scrolling:`no`,ratio:{width:416,height:692},size:e.size,maxWidth:416}}const mt={visual:`visual`,color:`color`,autoPlay:`auto_play`,hideRelated:`hide_related`,showComments:`show_comments`,showUser:`show_user`,showReposts:`show_reposts`,showTeaser:`show_teaser`,showArtwork:`show_artwork`};function ht(e,t){let n=[];for(let[e,r]of Object.entries(mt)){let i=t[e];i!==void 0&&n.push([r,i])}let r=e.size===void 0;return{kind:`iframe`,src:`https://w.soundcloud.com/player/${a([[`url`,e.url]],r?[[`visual`,!0]]:void 0,i(e.options,[`url`,`secret_token`]),n)}`,title:`SoundCloud player`,allow:`autoplay; encrypted-media`,scrolling:`no`,ratio:{width:16,height:9},height:e.size?.height??400}}function gt(e){let t=i(e.options,[]).filter(([e])=>e===`pub`);return{kind:`iframe`,src:`https://rumble.com/embed/${e.id}/${a(t)}`,title:`Rumble video`,allow:`fullscreen`,ratio:{width:16,height:9},size:e.size}}const _t=/* @__PURE__ */ new Set([`track`,`episode`]);function vt(e,t){let n=new URL(e.url).pathname.split(`/`)[1]??``,r=e.kind===`video`,i=a(Object.entries(e.options),t.theme===void 0?void 0:[[`theme`,t.theme]]);return{kind:`iframe`,src:`https://open.spotify.com/embed/${n}/${e.id}${r?`/video`:``}${i}`,title:`Spotify Embed`,allow:`autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture`,ratio:{width:16,height:9},size:r?e.size:void 0,borderRadius:12,height:r?void 0:e.size?.height??(_t.has(n)?152:352)}}const yt={origin:`https://strava-embeds.com`,read(e){if(!Array.isArray(e))return;let[,t,n]=e;return t===`BROADCAST_IFRAME_HEIGHT`&&typeof n==`number`?n:void 0},listen:s,onScreen:c};function bt(e){return e===`minimal`?`minimal`:`standard`}function xt(e,t){let n=e.id.startsWith(`route/`),r=bt(t.embedStyle??e.options.style),i=n&&(t.fullWidth??e.options.fullWidth===!0),a=t.mapHash??e.options.mapHash,o=`?style=${r}${i?`&fullWidth=true`:``}`,s=`#ns=social-embeds${typeof a==`string`&&a!==``?`&mapHash=${encodeURIComponent(a)}`:``}`;return{kind:`iframe`,src:`https://strava-embeds.com/${e.id}${o}${s}`,title:n?`Strava route`:`Strava activity`,allow:``,scrolling:`no`,ratio:{width:1,height:1},messageHeight:yt,startHeight:650,...i?{}:{maxWidth:554}}}const St=/* @__PURE__ */ new Set([`autoplay`,`hd`,`loop`,`muted`,`nocontrols`]),Ct={autoplay:`autoplay`,hd:`hd`,loop:`loop`,muted:`muted`,nocontrols:`nocontrols`};function wt(e,t){let n=Object.entries(e.options).filter(([e])=>St.has(e));return{kind:`iframe`,src:`https://streamable.com/e/${e.id}${a(n,o(t,Ct))}`,title:`Streamable video`,allow:`autoplay; fullscreen`,ratio:{width:16,height:9},size:e.size}}const Tt=[[`comment`,`comment`],[`userpic`,`userpic`],[`mode`,`mode`],[`single`,`single`],[`color`,`color`],[`dark`,`dark`],[`darkColor`,`dark_color`]];function Et(e,t){return typeof t==`boolean`?e===`userpic`?String(t):e===`single`?t?1:void 0:+!!t:typeof t==`string`||typeof t==`number`?t:void 0}const Dt={origin:`https://t.me`,read(e){if(typeof e!=`string`)return;let t=JSON.parse(e);return t.event===`resize`&&typeof t.height==`number`?t.height:void 0},listen:s,onScreen:c};function Ot(e,t){let{userpic:n,color:r,dark:i,darkColor:o}=t,s={...e.options,...n===void 0?{}:{userpic:n},...r===void 0?{}:{color:r},...i===void 0?{}:{dark:i},...o===void 0?{}:{darkColor:o}},c=[[`embed`,1]];for(let[e,t]of Tt){let n=Et(t,s[e]);n!==void 0&&c.push([t,n])}return{kind:`iframe`,src:`${e.url}${a(c)}`,title:`Telegram post`,allow:``,scrolling:`no`,ratio:{width:1,height:1},messageHeight:Dt,startHeight:300,maxWidth:500}}function kt(e){return{kind:`iframe`,src:`https://tenor.com/embed/${e.id}`,title:`Tenor GIF`,allow:`fullscreen`,ratio:{width:133,height:100},size:e.size}}function At(e,t){let n=P(e.options,{theme:t.theme}),r=`<blockquote${Be({"data-text-post-permalink":e.url,"data-text-post-version":n.version??0,id:`ig-tp-${e.id}`,"data-theme":n.theme})}>${e.fallbackHtml??``}</blockquote>`;return{kind:`script`,key:r,markup:r,driver:we,minHeight:240,label:`Threads`,title:`Threads post`,hasFallback:F(e.fallbackHtml),maxWidth:658}}const jt={controls:`controls`,progressBar:`progress_bar`,playButton:`play_button`,volumeControl:`volume_control`,fullscreenButton:`fullscreen_button`,timestamp:`timestamp`,loop:`loop`,autoplay:`autoplay`,musicInfo:`music_info`,description:`description`,rel:`rel`,nativeContextMenu:`native_context_menu`,closedCaption:`closed_caption`,forceMuted:`force_muted`};function Mt(e,t){let n=o(t,jt);return{kind:`iframe`,src:`https://www.tiktok.com/player/v1/${e.id}${a(Object.entries(e.options),n)}`,title:`TikTok video player`,allow:`accelerometer; autoplay; clipboard-write; encrypted-media; fullscreen; gyroscope; picture-in-picture; web-share`,ratio:{width:9,height:16},size:e.size,maxWidth:325}}function Nt(e){let t=e;return t?.type===`setHeight`&&typeof t.height==`number`?t.height:void 0}const Pt={origin:`https://truthsocial.com`,read:Nt,listen:s,onScreen:c},Ft={origin:`https://truthsocial.com`,read(e){let t=Nt(e);return t===void 0||t<=0?void 0:t+165},listen:s,onScreen:c},It=/^https:\/\/truthsocial\.com\/(@[^/]+)\/posts\/\d+$/;function Lt(e){let t=It.exec(e.url)?.[1];return t===void 0?{kind:`error`,message:`social-embeds: not a Truth Social post URL: ${e.url}`}:{kind:`iframe`,src:`https://truthsocial.com/${t}/${e.id}/embed`,title:`Truth Social post`,allow:``,scrolling:`no`,ratio:{width:1,height:1},messageHeight:e.options.video===!0?Ft:Pt,startHeight:150,maxWidth:e.size?.width??600}}const Rt={origin:`https://embed.tumblr.com`,read(e){if(typeof e!=`string`)return;let t=JSON.parse(e),[n]=Array.isArray(t.args)?t.args:[];return t.method===`tumblr-post:sizeChange`&&typeof n==`number`?n:void 0},listen:s,onScreen:c};function zt(e){return{kind:`iframe`,src:`https://embed.tumblr.com/embed/post/${e.url.slice(23).split(`/`)[0]??``}/${e.id}/v2`,title:`Tumblr post`,allow:``,scrolling:`no`,ratio:{width:1,height:1},messageHeight:Rt,startHeight:400,maxWidth:540}}const Bt=[`channel`,`video`,`collection`,`clip`,`parent`];function Vt(e,t){let{hostname:n,pathname:r}=new URL(e);if(n===`clips.twitch.tv`)return[`https://clips.twitch.tv/embed`,[`clip`,t]];let i=r.split(`/`)[1];return[`https://player.twitch.tv/`,i===`videos`?[`video`,`v${t}`]:i===`collections`?[`collection`,t]:[`channel`,t]]}function Ht(e,t){let{autoplay:n,muted:r,time:o}=t,s=[];n!==void 0&&s.push([`autoplay`,String(n)]),r!==void 0&&s.push([`muted`,String(r)]),o!==void 0&&s.push([`time`,o]);let[c,l]=Vt(e.url,e.id);return{kind:`iframe`,src:`${c}${a([l],i(e.options,Bt),s)}`,title:`Twitch player`,allow:``,ratio:{width:16,height:9},size:e.size,clientSrc:Ut}}function Ut(e){return`${e}${e.includes(`?`)?`&`:`?`}parent=${encodeURIComponent(window.location.hostname)}`}const Wt={autopause:`autopause`,autoplay:`autoplay`,background:`background`,byline:`byline`,color:`color`,controls:`controls`,dnt:`dnt`,keyboard:`keyboard`,loop:`loop`,muted:`muted`,pip:`pip`,playsinline:`playsinline`,portrait:`portrait`,quality:`quality`,speed:`speed`,title:`title`,transparent:`transparent`};function Gt(e,t){let{t:n,...r}=t,{t:s,...c}=e.options,l=new URL(e.url).pathname.split(`/`)[2],u=o(r,Wt),d=n??s;return{kind:`iframe`,src:`https://player.vimeo.com/video/${e.id}${a(l?[[`h`,l]]:void 0,i(c,[`h`]),u)}${d===void 0?``:`#t=${encodeURIComponent(String(d))}`}`,title:`Vimeo video player`,allow:`autoplay; fullscreen; picture-in-picture; clipboard-write; encrypted-media; web-share`,referrerPolicy:`strict-origin-when-cross-origin`,ratio:{width:16,height:9},size:e.size}}const Kt={theme:`data-theme`,conversation:`data-conversation`,cards:`data-cards`,align:`data-align`,lang:`data-lang`,dnt:`data-dnt`,width:`data-width`};function qt(e,t){let n=P(e.options,{...t}),r=e.fallbackHtml??`<a href="${M(e.url)}"></a>`,i=`<blockquote${Ve(Kt,n)}>${r}</blockquote>`;return{kind:`script`,key:i,markup:i,driver:ve,minHeight:250,label:`X`,title:`X post`,hasFallback:F(e.fallbackHtml),maxWidth:550}}const Jt={autoplay:`autoplay`,ccLangPref:`cc_lang_pref`,ccLoadPolicy:`cc_load_policy`,color:`color`,controls:`controls`,disablekb:`disablekb`,enablejsapi:`enablejsapi`,end:`end`,fs:`fs`,hl:`hl`,ivLoadPolicy:`iv_load_policy`,list:`list`,listType:`listType`,loop:`loop`,origin:`origin`,playlist:`playlist`,playsinline:`playsinline`,rel:`rel`,start:`start`,widgetReferrer:`widget_referrer`};function Yt(e){return e.url.startsWith(`https://www.youtube.com/playlist?`)?{path:`videoseries`,key:`list`}:e.url.startsWith(`https://www.youtube.com/channel/`)?{path:`live_stream`,key:`channel`}:{path:e.id}}function Xt(e,t){let{nocookie:n,...r}=t,{nocookie:s,...c}=e.options,l=n??s===!0?`https://www.youtube-nocookie.com`:`https://www.youtube.com`,{path:u,key:d}=Yt(e),f=o(r,Jt).filter(([e])=>e!==d);return{kind:`iframe`,src:`${l}/embed/${u}${a(d===void 0?void 0:[[d,e.id]],i(c,d===void 0?[]:[d]),f)}`,title:`YouTube video player`,allow:`accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share`,referrerPolicy:`strict-origin-when-cross-origin`,ratio:e.url.includes(`/shorts/`)?{width:9,height:16}:{width:16,height:9},size:e.size}}function Zt(e){switch(e.platform){case`x`:return qt(e,{});case`instagram`:return rt(e,{});case`threads`:return At(e,{});case`facebook`:return Ke(e,{});case`tiktok`:return Mt(e,{});case`youtube`:return Xt(e,{});case`telegram`:return Ot(e,{});case`snapchat`:return pt(e);case`linkedin`:return ot(e,{});case`reddit`:return ft(e,{});case`pinterest`:return lt(e,{});case`spotify`:return vt(e,{});case`vimeo`:return Gt(e,{});case`twitch`:return Ht(e,{});case`dailymotion`:return f(e,{});case`bluesky`:return u(e,{});case`soundcloud`:return ht(e,{});case`applemusic`:return n(e);case`applepodcasts`:return r(e);case`tumblr`:return zt(e);case`kick`:return at(e,{});case`giphy`:return et(e);case`tenor`:return kt(e);case`streamable`:return wt(e,{});case`rumble`:return gt(e);case`truthsocial`:return Lt(e);case`imgur`:return nt(e,{});case`strava`:return xt(e,{});case`flickr`:return $e(e,{});default:return e.platform}}const Qt=/^(?:https?:)?\/\/([^/?#\s@]+)((?:\/[^?#\s]*)?)(?:\?([^#\s]*))?(?:#(\S*))?$/i;function I(e){let t=Qt.exec(e.trim());if(!t)return null;let[,n=``,r=``,i=``,a]=t,o=/* @__PURE__ */ new Map;for(let e of i.replaceAll(`&amp;`,`&`).split(`&`)){if(e===``)continue;let t=e.indexOf(`=`),n=$t(t===-1?e:e.slice(0,t)),r=$t(t===-1?``:e.slice(t+1));if(n===null||r===null)return null;o.has(n)||o.set(n,r)}return{host:n.toLowerCase(),path:r,query:o,...a?{fragment:a}:{}}}function $t(e){try{return decodeURIComponent(e.replace(/\+/g,` `))}catch{return null}}function L(e){return e===`true`?!0:e===`false`?!1:/^(?:0|[1-9]\d{0,14})$/.test(e)?Number(e):e}function R(e){return e!==void 0&&/^[1-9]\d{0,5}$/.test(e)?Number(e):void 0}function z(e,t){return{...e,...t}}function B(e,t){return e===t||e.startsWith(`${t}/`)}function V(e,t,n){let r={};for(let[i,a]of t){let t=e.attrs.get(i);t!==void 0&&!(a in r)&&(r[a]=n(t))}return r}function H(e){let t=R(e.attrs.get(`width`)),n=R(e.attrs.get(`height`));if(t!==void 0||n!==void 0)return{...t===void 0?{}:{width:t},...n===void 0?{}:{height:n}}}function U(e,t){return t?{...e,size:t}:e}function W(e,t){if(e.tag!==`div`||e.attrs.size!==1)return null;let[,n]=t.exec(e.attrs.get(`style`)??``)??[];if(n===void 0)return null;let r;for(let t of e.children)if(!(t.type===`text`&&/^\s*$/.test(t.raw))){if(t.type!==`element`||t.tag!==`iframe`||r)return null;r=t}let i=Math.round(Number(n)*100);if(!r||!(i>0&&i<=1e5))return null;let a=en(1e4,i);return{iframe:r,size:{width:1e4/a,height:i/a}}}function en(e,t){return t===0?e:en(t,e%t)}const tn=/* @__PURE__ */ new Set([`youtube.com`,`www.youtube.com`,`m.youtube.com`]),nn=/* @__PURE__ */ new Set([`youtube-nocookie.com`,`www.youtube-nocookie.com`]),rn=/* @__PURE__ */ new Set([`dailymotion.com`,`www.dailymotion.com`]),G=/* @__PURE__ */ new Set([`tiktok.com`,`www.tiktok.com`]),an=/* @__PURE__ */ new Set([`facebook.com`,`www.facebook.com`,`web.facebook.com`]),K=/* @__PURE__ */ new Set([`giphy.com`,`www.giphy.com`]),on=/* @__PURE__ */ new Set([`player.kick.com`]),sn=`embed.music.apple.com`,cn=`embed.podcasts.apple.com`,ln=e=>nn.has(e.host)||tn.has(e.host)&&B(e.path,`/embed`),un=e=>e.host===`geo.dailymotion.com`||e.host===`dai.ly`||rn.has(e.host)&&(B(e.path,`/embed`)||B(e.path,`/video`)),dn=e=>G.has(e.host)&&B(e.path,`/player`),fn=e=>e.host===`player.twitch.tv`||e.host===`clips.twitch.tv`&&B(e.path,`/embed`),pn=e=>e.host===`player.vimeo.com`,mn=e=>an.has(e.host)&&B(e.path,`/plugins`),hn=e=>K.has(e.host)&&B(e.path,`/embed`),gn=e=>on.has(e.host),_n=e=>e.host===`www.linkedin.com`&&B(e.path,`/embed`),vn=e=>e.host===`assets.pinterest.com`,yn=e=>e.host===sn,bn=e=>e.host===cn,xn=e=>e.host===`w.soundcloud.com`,Sn=e=>e.host===`open.spotify.com`&&B(e.path,`/embed`),Cn=e=>e.host===`rumble.com`&&B(e.path,`/embed`),wn=e=>e.host===`streamable.com`&&(B(e.path,`/e`)||B(e.path,`/o`)),Tn=e=>e.host===`tenor.com`&&B(e.path,`/embed`),En=e=>e.host===`truthsocial.com`&&e.path.startsWith(`/@`);function Dn(e){return[ln,un,dn,fn,pn,mn,hn,gn,_n,vn,yn,bn,xn,Sn,Cn,wn,Tn,En].some(t=>t(e))}const On=[`no-referrer`,`origin`,`same-origin`,`strict-origin`,`strict-origin-when-cross-origin`],kn=/* @__PURE__ */ new Set([`allow-downloads`,`allow-forms`,`allow-modals`,`allow-orientation-lock`,`allow-pointer-lock`,`allow-popups`,`allow-popups-to-escape-sandbox`,`allow-presentation`,`allow-same-origin`,`allow-scripts`,`allow-top-navigation`,`allow-top-navigation-by-user-activation`,`allow-top-navigation-to-custom-protocols`]),An=/* @__PURE__ */ new Set([`autoplay`,`fullscreen`,`encrypted-media`,`picture-in-picture`,`clipboard-write`,`web-share`]),jn=`[a-z0-9-]+(?:\\.[a-z0-9-]+)*(?::\\d{1,5})?`,Mn=/* @__PURE__ */ RegExp(`^(?:https:)?//${jn}(?:[/?#]|$)`,`i`),Nn=/* @__PURE__ */ RegExp(`^(?:\\*|'self'|'src'|'none'|https://${jn})$`,`i`),Pn=/\/\.{1,2}(?:\/|$)|\/\/|%(?:2[de]|3\d|[46][1-9a-f]|[57][\da]|5f|7e)/i,Fn=/[\t\n\f\r ]+/,In=/^\s*(width|height)\s*:(.*)$/is,Ln=/^(\d+)px$/i,Rn=/(?:^|;)\s*padding-bottom:\s*(\d{1,3}(?:\.\d{1,20})?)%\s*(?:;|$)/i;function zn(e){if(typeof e!=`string`)return null;let t=O(e);if(!t)return null;let n=A(t),[r,...i]=n.filter(e=>e.tag===`iframe`);if(!r||i.length>0)return null;let a=n.find(e=>e.children.includes(r)),{attrs:o}=r,s=H(r)??Jn(r);return Vn({src:o.get(`src`),title:o.get(`title`),allow:o.get(`allow`),allowFullscreen:o.has(`allowfullscreen`),referrerPolicy:o.get(`referrerpolicy`),sandbox:o.get(`sandbox`),scrolling:o.get(`scrolling`),size:s??{},ratio:s?void 0:a&&W(a,Rn)?.size})}function Bn(e){return Vn(e)}function Vn(e){if(typeof e!=`object`||!e)return null;let t=e,n=Hn(t.src);if(n===null)return null;let r=typeof t.title==`string`?t.title.trim():``,i=typeof t.referrerPolicy==`string`?t.referrerPolicy.toLowerCase():void 0,a=On.find(e=>e===i),o=Gn(t.ratio);return{src:n,...r?{title:r}:{},allow:typeof t.allow==`string`?Un(t.allow):``,allowFullscreen:t.allowFullscreen===!0,...a?{referrerPolicy:a}:{},...typeof t.sandbox==`string`?{sandbox:Wn(t.sandbox)}:{},...typeof t.scrolling==`string`&&t.scrolling.toLowerCase()===`no`?{scrolling:`no`}:{},size:qn(t.size),...o?{ratio:o}:{}}}function Hn(e){if(typeof e!=`string`)return null;let t=e.trim(),n=Mn.test(t)&&!t.includes(`\\`)?I(t):null;return!n||Pn.test(n.path)||Dn({...n,host:n.host.replace(/:\d+$/,``),path:(n.path.toLowerCase().split(`;`)[0]??``).replaceAll(`%2f`,`/`)})?null:t.startsWith(`//`)?`https:${t}`:t}function Un(e){return e.split(`;`).map(e=>e.split(Fn).filter(Boolean)).filter(([e,...t])=>e!==void 0&&An.has(e)&&t.every(e=>Nn.test(e))).map(e=>e.join(` `)).join(`; `)}function Wn(e){let t=e.split(Fn).map(e=>e.toLowerCase()).filter(e=>kn.has(e));return[...new Set(t)].join(` `)}function Gn(e){if(typeof e!=`object`||!e)return;let{width:t,height:n}=e;return Kn(t)&&Kn(n)?{width:t,height:n}:void 0}function Kn(e){return typeof e==`number`&&Number.isFinite(e)&&e>0}function qn(e){if(typeof e!=`object`||!e)return{};let{width:t,height:n}=e,r=typeof t==`number`?R(String(t)):void 0,i=typeof n==`number`?R(String(n)):void 0;return{...r===void 0?{}:{width:r},...i===void 0?{}:{height:i}}}function Jn(e){let t,n;for(let r of(e.attrs.get(`style`)??``).split(`;`)){let[,e=``,i=``]=In.exec(r)??[],a=R(Ln.exec(i.trim())?.[1]);e.toLowerCase()===`width`&&(t=a),e.toLowerCase()===`height`&&(n=a)}return t===void 0&&n===void 0?void 0:{width:t,height:n}}const Yn={width:16,height:9};function Xn(e){let t=Bn(e);return t?{kind:`iframe`,src:t.src,title:t.title??`Embedded content`,allow:t.allow,allowFullscreen:t.allowFullscreen,...t.referrerPolicy?{referrerPolicy:t.referrerPolicy}:{},...t.sandbox===void 0?{}:{sandbox:t.sandbox},...t.scrolling?{scrolling:t.scrolling}:{},...Zn(t)}:{kind:`error`,message:`social-embeds: not a generic iframe embed`}}function Zn({size:e,ratio:t}){let{width:n,height:r}=e;return n!==void 0&&r!==void 0?{ratio:{width:n,height:r},maxWidth:n}:r===void 0?{ratio:t??Yn,...n===void 0?{}:{maxWidth:n}}:{ratio:Yn,height:r}}const Qn=/* @__PURE__ */ new Set([`bsky.app`,`www.bsky.app`]),$n=/^\/profile\/([^/]{1,253})\/post\/[A-Za-z0-9._~:-]{1,512}\/?$/,er=/^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z](?:[a-z0-9-]{0,61}[a-z0-9])?$/i,tr=/* @__PURE__ */ new Set([`rumble.com`,`www.rumble.com`]),nr=/^\/v[a-z0-9]{1,12}-[^/]{1,300}\.html$/;function rr(e){let t=typeof e==`string`?I(e):null;return t?ir(t)?`rumble`:ar(t)?`bluesky`:null:null}function ir(e){return tr.has(e.host)&&nr.test(e.path)}function ar(e){if(!Qn.has(e.host))return!1;let[,t]=$n.exec(e.path)??[];return t!==void 0&&er.test(t)}const or=/^\/([a-z]{2})\/(album|song|playlist)\/(?:[^/]{1,200}\/)?(\d{1,15}|pl\.[A-Za-z0-9-]{1,64})\/?$/,sr=/^\d{1,15}$/;function cr(e,t){if(e?.host!==t)return null;let[,n,r,i]=or.exec(e.path)??[];if(n===void 0||r===void 0||i===void 0||(r===`playlist`?!i.startsWith(`pl.`):!sr.test(i)))return null;let a=r===`album`?e.query.get(`i`):void 0;return a!==void 0&&!sr.test(a)?null:{kind:`post`,url:`https://music.apple.com/${n}/${r}/${i}${a?`?i=${a}`:``}`,id:a??i,variant:`iframe`}}const lr=/* @__PURE__ */ z({platform:`applemusic`,name:`Apple Music`,shapes:[`post iframe`],match(e){let t=cr(e,`music.apple.com`);return t&&{platform:`applemusic`,...t,options:{}}},ownsFrame:yn},{parse(e){if(e.tag!==`iframe`)return null;let t=cr(I(e.attrs.get(`src`)??``),sn);if(!t)return null;let{height:n}=H(e)??{};return U({platform:`applemusic`,...t,options:{}},n===void 0?void 0:{height:n})},isOwnScript:()=>!1}),ur=/^\/([a-z]{2})\/podcast\/(?:[^/]{1,200}\/)?(?:id)?(\d{1,15})\/?$/,dr=/^\d{1,15}$/;function fr(e,t){if(e?.host!==t)return null;let[,n,r]=ur.exec(e.path)??[];if(n===void 0||r===void 0)return null;let i=e.query.get(`i`);return i!==void 0&&!dr.test(i)?null:{platform:`applepodcasts`,kind:`post`,url:`https://podcasts.apple.com/${n}/podcast/id${r}${i?`?i=${i}`:``}`,id:i??r,variant:`iframe`}}const pr=/* @__PURE__ */ z({platform:`applepodcasts`,name:`Apple Podcasts`,shapes:[`post iframe`],match(e){let t=fr(e,`podcasts.apple.com`);return t&&{...t,options:{}}},ownsFrame:bn},{parse(e){if(e.tag!==`iframe`)return null;let t=fr(I(e.attrs.get(`src`)??``),cn);return t&&U({...t,options:{}},H(e))},isOwnScript:()=>!1}),mr=`(did:(?:plc:[a-z2-7]{24}|web:[a-z0-9.-]{1,253}))`,hr=`((?!\\.{1,2}(?:/|$))[A-Za-z0-9._~:-]{1,512})`,gr=/* @__PURE__ */ new Set([`bsky.app`,`www.bsky.app`]),_r=/* @__PURE__ */ RegExp(`^/profile/${mr}/post/${hr}/?$`),vr=/* @__PURE__ */ new Map([[`p`,[`lang`]],[`a`,[`href`]],[`br`,[]]]);function yr(e,t){return{platform:`bluesky`,kind:`post`,url:`https://bsky.app/profile/${e}/post/${t}`,id:`${e}/app.bsky.feed.post/${t}`,variant:`iframe`}}function br(e){if(!e||!gr.has(e.host))return null;let[,t,n]=_r.exec(e.path)??[];return t===void 0||n===void 0?null:yr(t,n)}const xr={platform:`bluesky`,name:`Bluesky`,shapes:[`post iframe`],needsLookup:ar,trustsFallback:e=>N(e,vr),match(e){let t=br(e);return t&&{...t,options:{}}}},Sr=/* @__PURE__ */ RegExp(`^at://${mr}/app\\.bsky\\.feed\\.post/${hr}$`),Cr=/^[a-z2-7]{20,100}$/,wr=/* @__PURE__ */ new Set([`light`,`dark`,`system`]),Tr=/^(?:https?:)?\/\/embed\.bsky\.app\/static\/embed\.js$/,Er=/* @__PURE__ */ z(xr,{parse(e){if(e.tag!==`blockquote`||!k(e,`bluesky-embed`))return null;let[,t,n]=Sr.exec(e.attrs.get(`data-bluesky-uri`)??``)??[];if(t===void 0||n===void 0)return null;let r=yr(t,n);if(A(e.children).reverse().map(e=>e.tag===`a`?br(I(e.attrs.get(`href`)??``)):null).find(e=>e!==null)?.id!==r.id)return null;let i={},a=e.attrs.get(`data-bluesky-cid`);a!==void 0&&Cr.test(a)&&(i.cid=a);let o=e.attrs.get(`data-bluesky-embed-color-mode`);return o!==void 0&&wr.has(o)&&(i.colorMode=o),{...r,options:i,fallbackHtml:j(e.children,vr)}},isOwnScript:e=>Tr.test(e)}),Dr=/^x[a-z0-9]{4,12}$/,Or=/^x[a-z0-9]{3,12}$/;function kr(e,t){return{platform:`dailymotion`,kind:`video`,url:`https://www.dailymotion.com/video/${e}`,id:e,variant:`iframe`,options:t}}function Ar(e){if(e.host!==`geo.dailymotion.com`||e.query.has(`playlist`))return null;let t=/^\/player(?:\/([a-z0-9]+))?\.html$/.exec(e.path);if(!t)return null;let[,n]=t,r=e.query.get(`video`)??``;if(!Dr.test(r)||n!==void 0&&!Or.test(n))return null;let i=Object.fromEntries([...e.query].filter(([e])=>e!==`video`).map(([e,t])=>[e,L(t)]));return n!==void 0&&(i.playerId=n),kr(r,i)}function jr(e){if(e.host===`dai.ly`){let t=e.path.replace(/^\/|\/$/g,``);return Dr.test(t)?kr(t,{}):null}if(!rn.has(e.host))return null;let[,t]=/^(?:\/embed)?\/video\/([a-z0-9]+)\/?$/.exec(e.path)??[];return t!==void 0&&Dr.test(t)?kr(t,{}):null}const Mr={platform:`dailymotion`,name:`Dailymotion`,shapes:[`video iframe`],match(e){return Ar(e)??jr(e)},ownsFrame:un},Nr=/^position:\s*relative;\s*padding-bottom:\s*(\d{1,3}(?:\.\d{1,4})?)%;\s*height:\s*0;\s*overflow:\s*hidden;?$/,Pr=/* @__PURE__ */ z(Mr,{parse(e){let t=W(e,Nr),n=t?.iframe??e;if(n.tag!==`iframe`)return null;let r=I(n.attrs.get(`src`)??``);if(!r)return null;let i=Ar(r)??jr(r);return i&&U(i,t?.size??H(n))},isOwnScript:()=>!1}),Fr=/* @__PURE__ */ new Set([`facebook.com`,`www.facebook.com`,`web.facebook.com`,`m.facebook.com`]),q=`https://www.facebook.com`,Ir=`[A-Za-z0-9.\\-]{1,80}`,Lr=`(?:\\d{1,25}|pfbid[A-Za-z0-9]{10,120})`,Rr=/* @__PURE__ */ RegExp(`^/(${Ir})/posts/(${Lr})/?$`),zr=/* @__PURE__ */ RegExp(`^/(${Ir})/photos/([A-Za-z0-9.\\-]{1,80})/(\\d{1,25})/?$`),Br=/* @__PURE__ */ RegExp(`^/(${Ir})/videos/(?:[^/]{1,200}/)?(\\d{1,25})/?$`),Vr=/^\/reel\/(\d{1,25})\/?$/,Hr=/* @__PURE__ */ new Set([`/permalink.php`,`/story.php`]),Ur=/* @__PURE__ */ new Set([`/photo.php`,`/photo/`,`/photo`]),Wr=/* @__PURE__ */ RegExp(`^${Lr}$`),Gr=/^\d{1,25}$/,Kr={name:`class`,value:/^fb-xfbml-parse-ignore$/},qr=/* @__PURE__ */ new Map([[`div`,[Kr]],[`blockquote`,[`cite`,Kr]],[`a`,[`href`]],[`p`,[]]]);function Jr(e){if(!e||!Fr.has(e.host))return null;let{path:t,query:n}=e,[,r,i]=Rr.exec(t)??[];if(r!==void 0&&i!==void 0)return{kind:`post`,id:i,url:`${q}/${r}/posts/${i}`};if(Hr.has(t)){let e=n.get(`story_fbid`);if(e===void 0||!Wr.test(e))return null;let r=n.get(`id`),i=r!==void 0&&Gr.test(r)?`&id=${r}`:``;return{kind:`post`,id:e,url:`${q}${t}?story_fbid=${e}${i}`}}if(Ur.has(t)){let e=n.get(`fbid`);return e===void 0||!Gr.test(e)?null:{kind:`post`,id:e,url:`${q}${t}?fbid=${e}`}}let[,a,o,s]=zr.exec(t)??[];if(a!==void 0&&o!==void 0&&s!==void 0)return{kind:`post`,id:s,url:`${q}/${a}/photos/${o}/${s}/`};let[,c,l]=Br.exec(t)??[];if(c!==void 0&&l!==void 0)return{kind:`video`,id:l,url:`${q}/${c}/videos/${l}/`};if(t===`/watch`||t===`/watch/`||t===`/video.php`){let e=n.get(`v`);return e===void 0||!Gr.test(e)?null:{kind:`video`,id:e,url:`${q}${t===`/video.php`?t:`/watch/`}?v=${e}`}}let[,u]=Vr.exec(t)??[];return u===void 0?null:{kind:`video`,id:u,url:`${q}/reel/${u}`}}function J(e,t,n,r){return{platform:`facebook`,kind:t,url:e.url,id:e.id,variant:n,options:r}}const Yr={platform:`facebook`,name:`Facebook`,shapes:[`post sdk`,`video sdk`,`video iframe`],trustsFallback:e=>N(e,qr),match(e){let t=Jr(e);return t&&J(t,t.kind,`sdk`,{})},ownsFrame:mn},Xr=/^(?:https?:)?\/\/connect\.facebook\.net\/([a-z]{2,3}_[A-Z]{2})\/sdk\.js(?:[?#].*)?$/,Zr=[[`data-width`,`width`],[`data-show-text`,`showText`],[`data-lazy`,`lazy`],[`data-allowfullscreen`,`allowfullscreen`],[`data-autoplay`,`autoplay`],[`data-show-captions`,`showCaptions`]],Qr=[[`show_text`,`showText`],[`allowfullscreen`,`allowfullscreen`],[`autoplay`,`autoplay`],[`show_captions`,`showCaptions`]],$r=/* @__PURE__ */ z(Yr,{parse(e){if(e.tag===`div`){let t=k(e,`fb-post`)?`post`:k(e,`fb-video`)?`video`:null,n=Jr(I(e.attrs.get(`data-href`)??``));return!t||!n?null:{...J(n,t,`sdk`,V(e,Zr,L)),fallbackHtml:j(e.children,qr)}}if(e.tag!==`iframe`)return null;let t=I(e.attrs.get(`src`)??``);if(!t||!an.has(t.host))return null;let n=Jr(I(t.query.get(`href`)??``));if(!n)return null;if(t.path===`/plugins/post.php`){let e={},r=t.query.get(`show_text`),i=t.query.get(`width`);return r!==void 0&&(e.showText=L(r)),i!==void 0&&(e.width=L(i)),J(n,`post`,`sdk`,e)}if(t.path===`/plugins/video.php`){let r=L(t.query.get(`show_text`)??``);if(r===!0||r===1){let e={};for(let[n,r]of Qr){let i=t.query.get(n);i!==void 0&&(e[r]=L(i))}let r=R(t.query.get(`width`)),i=R(t.query.get(`height`));return U(J(n,`video`,`sdk`,{...e,showText:!0}),r===void 0||i===void 0?void 0:{width:r,height:i})}return U(J(n,`video`,`iframe`,Object.fromEntries([...t.query].filter(([e])=>e!==`href`).map(([e,t])=>[e,L(t)]))),H(e))}return null},isOwnScript:e=>Xr.test(e),scriptOptions(e){let[,t]=Xr.exec(e)??[];return t===void 0?{}:{locale:t}},allowsFbRoot:!0}),ei=/* @__PURE__ */ new Set([`flickr.com`,`www.flickr.com`]),ti=`((?!\\.{1,2}(?:/|$))[A-Za-z0-9@_.-]{1,64})`,ni=`(\\d{1,20})`,ri=/* @__PURE__ */ RegExp(`^/photos/${ti}/${ni}(?:/in/[A-Za-z0-9_@./-]{1,200})?/?$`),ii=/* @__PURE__ */ RegExp(`^/photos/${ti}/(?:albums|sets)/${ni}/?$`),ai=/^\/p\/([1-9a-km-zA-HJ-NP-Z]{1,12})$/,oi=`123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ`,si=/^https:\/\/(?:live|farm\d{1,3})\.staticflickr\.com\//,ci=/* @__PURE__ */ new Map([[`a`,[{name:`href`,value:/^https:\/\/(?:www\.)?flickr\.com\//}]],[`img`,[{name:`src`,value:si},{name:`width`,value:/^\d{1,6}$/},{name:`height`,value:/^\d{1,6}$/},`alt`]]]);function li(e){if(e===``)return null;let t=0n;for(let n of e){let e=oi.indexOf(n);if(e===-1)return null;t=t*58n+BigInt(e)}return t.toString()}function ui(e){let t=BigInt(e),n=``;for(;t>0n;)n=oi.charAt(Number(t%58n))+n,t/=58n;return n}function di(e,t){return{platform:`flickr`,kind:`post`,url:`https://www.flickr.com/photos/${e}/${t}/`,id:t,variant:`iframe`}}function fi(e,t){return{platform:`flickr`,kind:`post`,url:`https://www.flickr.com/photos/${e}/albums/${t}`,id:t,variant:`iframe`}}function pi(e){if(!e||!ei.has(e.host))return null;let[,t,n]=ii.exec(e.path)??[];if(t!==void 0&&n!==void 0)return fi(t,n);let[,r,i]=ri.exec(e.path)??[];return r===void 0||i===void 0?null:di(r,i)}function mi(e){if(e.host!==`flic.kr`)return null;let[,t]=ai.exec(e.path)??[],n=t===void 0?null:li(t);return t===void 0||n===null||ui(n)!==t?null:{platform:`flickr`,kind:`post`,url:`https://flic.kr/p/${t}`,id:n,variant:`iframe`}}const hi={platform:`flickr`,name:`Flickr`,shapes:[`post iframe`],trustsFallback:e=>N(e,ci),match(e){let t=pi(e)??mi(e);return t&&{...t,options:{}}}},gi=/^(?:https?:)?\/\/embedr\.flickr\.com\/assets\/client-code\.js$/,_i=[`header`,`footer`,`context`];function vi(e){let t=null;for(let n of e.children)if(!(n.type===`text`&&/^\s*$/.test(n.raw))){if(n.type!==`element`||n.tag!==`img`||t)return null;t=n}return t}const yi=/* @__PURE__ */ z(hi,{parse(e){if(e.tag!==`a`||e.attrs.get(`data-flickr-embed`)!==`true`)return null;let t=pi(I(e.attrs.get(`href`)??``)),n=vi(e);if(!t||!n)return null;let r={};for(let t of _i)e.attrs.get(`data-${t}`)===`true`&&(r[t]=!0);let i=H(n),a=si.test(n.attrs.get(`src`)??``)?e:{...e,children:[]};return U({...t,options:r,fallbackHtml:j([a],ci)},i?.width!==void 0&&i.height!==void 0?i:void 0)},isOwnScript:e=>gi.test(e)}),Y=`([A-Za-z0-9]{6,40})`,bi=/* @__PURE__ */ RegExp(`^/(?:gifs|stickers)/(?:[A-Za-z0-9-]{0,200}-)?${Y}/?$`),xi=/* @__PURE__ */ RegExp(`^/embed/${Y}/?$`),Si=/^(?:media\d?|i)\.giphy\.com$/,Ci=`\\.(?:gif|webp|mp4)`,wi=/* @__PURE__ */ RegExp(`^/media/(?:v1\\.[A-Za-z0-9_-]{1,500}/)?${Y}/[A-Za-z0-9_-]{1,40}${Ci}$`),Ti=/* @__PURE__ */ RegExp(`^/${Y}${Ci}$`);function Ei(e){return{platform:`giphy`,kind:`video`,url:`https://giphy.com/gifs/${e}`,id:e,variant:`iframe`}}function Di(e){if(e){if(K.has(e.host))return(bi.exec(e.path)??xi.exec(e.path))?.[1];if(Si.test(e.host))return(wi.exec(e.path)??(e.host===`i.giphy.com`?Ti.exec(e.path):null))?.[1]}}const Oi={platform:`giphy`,name:`Giphy`,shapes:[`video iframe`],match(e){let t=Di(e);return t===void 0?null:{...Ei(t),options:{}}},ownsFrame:hn},ki=/^width:\s*100%;\s*height:\s*0;\s*padding-bottom:\s*(\d{1,3}(?:\.\d{1,4})?)%;\s*position:\s*relative;?$/;function Ai(e){if(e.tag!==`iframe`)return null;let t=I(e.attrs.get(`src`)??``);if(!t||!K.has(t.host))return null;let[,n]=xi.exec(t.path)??[];return n===void 0?null:Ei(n)}function ji(e,t){if(e.tag!==`p`||e.attrs.size!==0)return!1;let[n,...r]=e.children;if(r.length>0||n?.type!==`element`||n.tag!==`a`||n.attrs.size!==1)return!1;let i=I(n.attrs.get(`href`)??``);if(!i||!K.has(i.host)||bi.exec(i.path)?.[1]!==t.id)return!1;let[a,...o]=n.children;return o.length===0&&a?.type===`text`&&a.raw.trim()===`via GIPHY`}const Mi=/* @__PURE__ */ z(Oi,{parse(e){let t=W(e,ki),n=t?.iframe??e,r=Ai(n);return r?U({...r,options:{}},t?.size??H(n)):null},isOwnScript:()=>!1,isOwnExtra:ji}),Ni=/* @__PURE__ */ new Set([`imgur.com`,`www.imgur.com`,`m.imgur.com`]),X=`([A-Za-z0-9]{5,7})`,Pi=/* @__PURE__ */ RegExp(`^/a/${X}/?$`),Fi=/* @__PURE__ */ RegExp(`^/gallery/(?:[A-Za-z0-9-]{1,200}-)?${X}/?$`),Ii=/* @__PURE__ */ RegExp(`^/${X}/?$`),Li=/* @__PURE__ */ RegExp(`^/${X}\\.(?:jpe?g|png|gif|gifv|mp4|webp)$`),Ri=/* @__PURE__ */ new Set([`about`,`apps`,`blog`,`help`,`jobs`,`login`,`press`,`privacy`,`random`,`search`,`signin`,`signup`,`terms`,`tools`,`upload`,`account`,`contact`,`emerald`,`explore`,`gallery`,`hot`,`new`,`rules`,`user`]),zi=/* @__PURE__ */ new Map([[`a`,[{name:`href`,value:/^https:\/\/(?:www\.)?imgur\.com\//}]]]);function Bi(e){return{platform:`imgur`,kind:`post`,url:`https://imgur.com/${e}`,id:e,variant:`iframe`}}function Vi(e){return e===void 0||Ri.has(e.toLowerCase())?void 0:e}function Hi(e){if(!e)return;if(e.host===`i.imgur.com`)return Vi(Li.exec(e.path)?.[1]);if(!Ni.has(e.host))return;let t=(Pi.exec(e.path)??Fi.exec(e.path))?.[1];return t===void 0?Vi(Ii.exec(e.path)?.[1]):`a/${t}`}const Ui={platform:`imgur`,name:`Imgur`,shapes:[`post iframe`],trustsFallback:e=>N(e,zi),match(e){let t=Hi(e);return t===void 0?null:{...Bi(t),options:{}}}},Wi=/* @__PURE__ */ RegExp(`^(a/)?${X}$`),Gi=/^(?:https?:)?\/\/s\.imgur\.com\/min\/embed\.js$/;function Ki(e){return e.map(e=>{if(e.type!==`element`)return e;let t=e.attrs.get(`href`),n=new Map(e.attrs);return e.tag===`a`&&t?.startsWith(`//`)&&n.set(`href`,`https:${t}`),{...e,attrs:n,children:Ki(e.children)}})}function qi(e,t){return e.attrs.get(t)===`false`}const Ji=/* @__PURE__ */ z(Ui,{parse(e){if(e.tag!==`blockquote`||!k(e,`imgur-embed-pub`))return null;let t=e.attrs.get(`data-id`)??``,[,n,r]=Wi.exec(t)??[];if(r===void 0||n===void 0&&!Vi(r))return null;let i={};return qi(e,`data-context`)&&(i.context=!1),qi(e,`data-analytics`)&&(i.analytics=!1),{...Bi(t),options:i,fallbackHtml:j(Ki(e.children),zi)}},isOwnScript:e=>Gi.test(e)}),Yi=/* @__PURE__ */ new Set([`instagram.com`,`www.instagram.com`]),Xi=/^\/(?:([A-Za-z0-9._]{1,30})\/)?(p|reel|reels|tv)\/([A-Za-z0-9_-]{1,64})\/?$/,Zi=/* @__PURE__ */ new Set([`p`,`reel`,`reels`,`tv`]),Qi=/* @__PURE__ */ new Set([`p`,`reel`]),$i=/* @__PURE__ */ new Map([[`div`,[]],[`a`,[`href`]],[`p`,[]]]);function ea(e){if(!e||!Yi.has(e.host))return null;let[,t,n,r]=Xi.exec(e.path)??[];return n===void 0||r===void 0||t!==void 0&&(Zi.has(t)||!Qi.has(n))?null:{platform:`instagram`,kind:`post`,url:`https://www.instagram.com/${n===`reels`?`reel`:n}/${r}/`,id:r,variant:`sdk`}}const ta={platform:`instagram`,name:`Instagram`,shapes:[`post sdk`],trustsFallback:e=>N(e,$i),match(e){let t=ea(e);return t&&{...t,options:{}}}},na=/^(?:https?:)?\/\/www\.instagram\.com\/embed\.js$/,ra=/* @__PURE__ */ z(ta,{parse(e){if(e.tag!==`blockquote`||!k(e,`instagram-media`))return null;let t=e.attrs.get(`data-instgrm-permalink`),n=t===void 0?A(e.children).reverse().map(e=>e.tag===`a`?ea(I(e.attrs.get(`href`)??``)):null).find(e=>e!==null):ea(I(t));if(!n)return null;let r={};e.attrs.has(`data-instgrm-captioned`)&&(r.captioned=!0);let i=e.attrs.get(`data-instgrm-version`);return i!==void 0&&(r.version=L(i)),{...n,options:r,fallbackHtml:j(e.children,$i)}},isOwnScript:e=>na.test(e)}),ia=/* @__PURE__ */ new Set([`kick.com`,`www.kick.com`]),aa=/^\/([A-Za-z0-9_-]{1,32})\/?$/,oa=/* @__PURE__ */ new Set([`browse`,`categories`,`category`,`clips`,`video`,`videos`,`following`,`search`,`settings`,`dashboard`,`subscriptions`,`privacy-policy`,`terms-of-service`,`community-guidelines`,`help`]);function sa(e,t){if(!e||!t.has(e.host))return null;let[,n]=aa.exec(e.path)??[];if(n===void 0||oa.has(n.toLowerCase()))return null;let r=n.toLowerCase();return{platform:`kick`,kind:`video`,url:`https://kick.com/${r}`,id:r,variant:`iframe`}}const ca={platform:`kick`,name:`Kick`,shapes:[`video iframe`],match(e){let t=sa(e,ia)??sa(e,on);return t&&{...t,options:{}}},ownsFrame:gn},la=/* @__PURE__ */ new Set([`autoplay`,`muted`]),ua=/* @__PURE__ */ z(ca,{parse(e){if(e.tag!==`iframe`)return null;let t=I(e.attrs.get(`src`)??``),n=sa(t,on);if(!n||!t)return null;let r=Object.fromEntries([...t.query].filter(([e])=>la.has(e)).map(([e,t])=>[e,L(t)]));return U({...n,options:r},H(e))},isOwnScript:()=>!1}),da=/^(?:www\.|[a-z]{2}\.)?linkedin\.com$/,fa=`(activity|share|ugcPost):(\\d{19})`,pa=/* @__PURE__ */ RegExp(`^(?:/embed)?/feed/update/urn:li:${fa}/?$`),ma=/* @__PURE__ */ RegExp(`^/posts/[^/]{1,300}-(activity|share|ugcPost)-(\\d{19})-[A-Za-z0-9_-]{1,8}/?$`);function ha(e,t,n={}){let r=`urn:li:${e}:${t}`;return{platform:`linkedin`,kind:`post`,url:`https://www.linkedin.com/feed/update/${r}/`,id:r,variant:`iframe`,options:n}}const ga=e=>e.replace(/%3A/gi,`:`),_a={platform:`linkedin`,name:`LinkedIn`,shapes:[`post iframe`],match(e){if(!da.test(e.host))return null;let t=ga(e.path),[,n,r]=pa.exec(t)??ma.exec(t)??[];return n===void 0||r===void 0?null:ha(n,r)},ownsFrame:_n},va=/* @__PURE__ */ RegExp(`^/embed/feed/update/urn:li:${fa}$`),ya=/* @__PURE__ */ z(_a,{parse(e){if(e.tag!==`iframe`)return null;let t=I(e.attrs.get(`src`)??``);if(t?.host!==`www.linkedin.com`)return null;let[,n,r]=va.exec(t.path)??[];return n===void 0||r===void 0?null:U(ha(n,r,Object.fromEntries([...t.query].map(([e,t])=>[e,L(t)]))),H(e))},isOwnScript:()=>!1}),ba=/^(?:(?:www|[a-z]{2})\.)?pinterest\.(?:[a-z]{2,3}|co\.[a-z]{2}|com\.[a-z]{2})$/,xa=/^\/pin\/(?:[A-Za-z0-9-]{0,200}--)?(\d{1,25})\/?$/;function Sa(e){return{platform:`pinterest`,kind:`post`,url:`https://www.pinterest.com/pin/${e}/`,id:e,variant:`sdk`}}function Ca(e){if(!e||!ba.test(e.host))return null;let[,t]=xa.exec(e.path)??[];return t===void 0?null:Sa(t)}const wa={platform:`pinterest`,name:`Pinterest`,shapes:[`post sdk`],match(e){let t=Ca(e);return t&&{...t,options:{}}},ownsFrame:vn},Ta=/^\d{1,25}$/,Ea=/^(?:https?:)?\/\/assets\.pinterest\.com\/js\/pinit(?:_main)?\.js$/,Da=[[`data-pin-width`,`width`],[`data-pin-lang`,`lang`],[`data-pin-terse`,`terse`]],Oa=/* @__PURE__ */ z(wa,{parse(e){if(e.tag===`a`){if(e.attrs.get(`data-pin-do`)!==`embedPin`||e.children.some(e=>e.type===`element`))return null;let t=Ca(I(e.attrs.get(`href`)??``));return t&&{...t,options:V(e,Da,L)}}if(e.tag!==`iframe`)return null;let t=I(e.attrs.get(`src`)??``);if(t?.host!==`assets.pinterest.com`||t.path!==`/ext/embed.html`)return null;let n=t.query.get(`id`);return n!==void 0&&Ta.test(n)?{...Sa(n),options:{}}:null},isOwnScript:e=>Ea.test(e)}),ka=/* @__PURE__ */ new Set([`reddit.com`,`www.reddit.com`,`old.reddit.com`,`new.reddit.com`]),Aa=/^\/r\/([A-Za-z0-9_]{2,21})\/comments\/([a-z0-9]{1,12})(?:\/([^/]{1,300}))?(?:\/([a-z0-9]{1,16}))?\/?$/;function ja(e){if(!e||!ka.has(e.host))return null;let[,t,n,r,i]=Aa.exec(e.path)??[];if(t===void 0||n===void 0)return null;let a={platform:`reddit`,kind:`post`,variant:`iframe`},o=`https://www.reddit.com/r/${t}/comments/${n}/`;return i===void 0?{...a,url:o,id:n}:r===void 0?null:{...a,url:`${o}comment/${i}/`,id:i}}const Ma={platform:`reddit`,name:`Reddit`,shapes:[`post iframe`],match(e){let t=ja(e);return t&&{...t,options:{}}}},Na=/^(?:https?:)?\/\/embed\.reddit\.com\/widgets\.js$/,Pa=/^(?:https?:)?\/\/embed\.redditmedia\.com\/widgets\/platform\.js$/,Fa=/* @__PURE__ */ [`depth`,`style`,`theme`,`showmedia`,`showtitle`,`showedits`,`created`,`locale`,`showusername`,`snippet`].map(e=>[`data-embed-${e}`,e]),Ia=/* @__PURE__ */ z(Ma,{parse(e){if(e.tag!==`blockquote`||!(k(e,`reddit-embed-bq`)||k(e,`reddit-card`)))return null;let t=A(e.children).map(e=>e.tag===`a`?ja(I(e.attrs.get(`href`)??``)):null).find(e=>e!==null);if(!t)return null;let n=R(e.attrs.get(`data-embed-height`));return U({...t,options:V(e,Fa,L)},n===void 0?void 0:{height:n})},isOwnScript:e=>Na.test(e)||Pa.test(e)}),La=/* @__PURE__ */ new Set([`snapchat.com`,`www.snapchat.com`]),Ra=`([A-Za-z][A-Za-z0-9._-]{1,29})`,za=/* @__PURE__ */ RegExp(`^(?:/@${Ra})?/spotlight/([A-Za-z0-9_-]{20,120})$`),Ba=/* @__PURE__ */ RegExp(`^/(?:@|add/)${Ra}$`),Va=/^\/lens\/([0-9a-f]{32}|\d{1,20})$/,Ha=/* @__PURE__ */ RegExp(`^/@${Ra}/highlight/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$`);function Ua(e){if(!e||!La.has(e.host))return null;let t=e.path.replace(/\/$/,``),n={platform:`snapchat`,variant:`iframe`},[,r,i]=za.exec(t)??[];if(i!==void 0){let e=r===void 0?``:`/@${r}`;return{...n,kind:`video`,url:`https://www.snapchat.com${e}/spotlight/${i}`,id:i}}let[,a]=Ba.exec(t)??[];if(a!==void 0)return{...n,kind:`post`,url:`https://www.snapchat.com/@${a}`,id:a};let[,o]=Va.exec(t)??[];if(o!==void 0)return{...n,kind:`post`,url:`https://www.snapchat.com/lens/${o}`,id:o};let[,s,c]=Ha.exec(t)??[];return s!==void 0&&c!==void 0?{...n,kind:`post`,url:`https://www.snapchat.com/@${s}/highlight/${c}`,id:c}:null}const Wa={platform:`snapchat`,name:`Snapchat`,shapes:[`post iframe`,`video iframe`],match(e){let t=Ua(e);return t&&{...t,options:{}}}},Ga=/^(?:https?:)?\/\/www\.snapchat\.com\/embed\.js$/,Ka=/* @__PURE__ */ z(Wa,{parse(e){if(e.tag!==`blockquote`||!k(e,`snapchat-embed`))return null;let t=I(e.attrs.get(`data-snapchat-embed-url`)??``);if(!t?.path.endsWith(`/embed`))return null;let n=Ua({...t,path:t.path.slice(0,-6)});if(!n||!A(e.children).filter(e=>e.tag===`a`).every(e=>{let t=Ua(I(e.attrs.get(`href`)??``));return t?.kind===n.kind&&t.id===n.id}))return null;let r=e.attrs.get(`data-snapchat-embed-title`),i=R(e.attrs.get(`data-snapchat-embed-width`)),a=R(e.attrs.get(`data-snapchat-embed-height`));return U({...n,options:r===void 0?{}:{title:r}},i===void 0||a===void 0?void 0:{width:i,height:a})},isOwnScript:e=>Ga.test(e)}),qa=/* @__PURE__ */ new Set([`soundcloud.com`,`www.soundcloud.com`,`m.soundcloud.com`]),Ja=/^\/(tracks|playlists|users)\/(?:soundcloud%3A(?:tracks|playlists|users)%3A)?(\d{1,15})\/?$/i,Ya=`[a-z0-9_-]{1,64}`,Xa=`s-[A-Za-z0-9]{1,32}`,Za=/* @__PURE__ */ RegExp(`^/(${Ya})(?:/(sets/${Ya}|${Ya})(?:/(${Xa}))?)?/?$`,`i`),Qa=/* @__PURE__ */ new Set([`discover`,`search`,`stream`,`feed`,`you`,`upload`,`charts`,`pages`,`settings`,`messages`,`notifications`,`people`,`stations`,`library`,`terms-of-use`,`signin`]),$a=/* @__PURE__ */ new Set([`likes`,`tracks`,`sets`,`albums`,`reposts`,`popular-tracks`,`followers`,`following`,`comments`,`spotlight`,`toptracks`]),eo=/* @__PURE__ */ RegExp(`^${Xa}$`);function to(e,t){return{platform:`soundcloud`,kind:`post`,url:e,id:t,variant:`iframe`}}function no(e){if(e?.host!==`api.soundcloud.com`)return null;let[,t,n]=Ja.exec(e.path)??[];if(t===void 0||n===void 0)return null;let r=e.query.get(`secret_token`);if(r!==void 0&&!eo.test(r))return null;let i=r===void 0?``:`?secret_token=${r}`;return to(`https://api.soundcloud.com/${t.toLowerCase()}/${n}${i}`,n)}function ro(e){if(!qa.has(e.host))return null;let[,t,n,r]=Za.exec(e.path)??[];if(t===void 0||Qa.has(t.toLowerCase())||n!==void 0&&$a.has(n.toLowerCase()))return null;let i=[t,n,r].filter(Boolean).join(`/`);return to(`https://soundcloud.com/${i}`,i)}const io={platform:`soundcloud`,name:`SoundCloud`,shapes:[`post iframe`],match(e){let t=no(e)??ro(e);return t&&{...t,options:{}}},ownsFrame:xn},ao=/* @__PURE__ */ new Set([`href`,`title`,`target`,`style`]);function oo(e){if(e?.type!==`element`||e.tag!==`a`||[...e.attrs.keys()].some(e=>!ao.has(e)))return!1;let[t,...n]=e.children;return n.length===0&&t?.type===`text`&&qa.has(I(e.attrs.get(`href`)??``)?.host??``)}function so(e){if(e.tag!==`div`||e.attrs.size!==1||!e.attrs.has(`style`))return!1;let[t,n,r,...i]=e.children;return i.length===0&&oo(t)&&n?.type===`text`&&/^\s*·\s*$/.test(n.raw)&&oo(r)}const co=/* @__PURE__ */ z(io,{parse(e){if(e.tag!==`iframe`)return null;let t=I(e.attrs.get(`src`)??``);if(t?.host!==`w.soundcloud.com`||!/^\/player\/?$/.test(t.path))return null;let n=no(I(t.query.get(`url`)??``));if(!n)return null;let r=t.query.get(`secret_token`);if(r!==void 0){if(!eo.test(r))return null;n.url.includes(`?`)||(n={...n,url:`${n.url}?secret_token=${r}`})}let i=Object.fromEntries([...t.query].filter(([e])=>e!==`url`&&e!==`secret_token`).map(([e,t])=>[e,L(t)])),{height:a}=H(e)??{};return U({...n,options:i},a===void 0?void 0:{height:a})},isOwnScript:()=>!1,isOwnExtra:so}),lo=/^\/embed\/(v[a-z0-9]{1,12})\/?$/,uo=/* @__PURE__ */ new Set([`rumble.com`,`www.rumble.com`]);function fo(e){return{platform:`rumble`,kind:`video`,url:`https://rumble.com/embed/${e}/`,id:e,variant:`iframe`}}function po(e,t){return e&&t.has(e.host)?lo.exec(e.path)?.[1]:void 0}const mo=/* @__PURE__ */ z({platform:`rumble`,name:`Rumble`,shapes:[`video iframe`],needsLookup:ir,match(e){let t=po(e,uo);return t===void 0?null:{...fo(t),options:{}}},ownsFrame:Cn},{parse(e){if(e.tag!==`iframe`)return null;let t=I(e.attrs.get(`src`)??``),n=po(t,/* @__PURE__ */ new Set([`rumble.com`]));if(n===void 0||!t)return null;let r={},i=t.query.get(`pub`);return i&&(r.pub=L(i)),U({...fo(n),options:r},H(e))},isOwnScript:()=>!1}),ho=/* @__PURE__ */ RegExp(`^(?:/intl-[a-z]{2}(?:-[A-Za-z]{2})?)?(?:/embed)?/(track|album|playlist|artist|episode|show|audiobook|chapter)/([A-Za-z0-9]{22})(/video)?/?$`),go=/* @__PURE__ */ new Set([`utm_source`,`si`]);function _o(e){if(e?.host!==`open.spotify.com`)return null;let[,t,n,r]=ho.exec(e.path)??[];return t===void 0||n===void 0?null:{platform:`spotify`,kind:r?`video`:`post`,url:`https://open.spotify.com/${t}/${n}`,id:n,variant:`iframe`,query:e.query}}function vo(e){return Object.fromEntries([...e].filter(([e])=>!go.has(e)).map(([e,t])=>[e,L(t)]))}const yo=/* @__PURE__ */ z({platform:`spotify`,name:`Spotify`,shapes:[`post iframe`,`video iframe`],match(e){let t=_o(e);return t&&{platform:t.platform,kind:`post`,url:t.url,id:t.id,variant:t.variant,options:{}}},ownsFrame:Sn},{parse(e){if(e.tag!==`iframe`)return null;let t=I(e.attrs.get(`src`)??``);if(!t?.path.startsWith(`/embed/`))return null;let n=_o(t);if(!n)return null;let{query:r,...i}=n;return U({...i,options:vo(r)},H(e))},isOwnScript:()=>!1}),bo=/* @__PURE__ */ new Set([`strava.com`,`www.strava.com`]),xo=/^\/(activities|routes)\/(\d{1,20})\/?$/,So={activity:`activities`,route:`routes`};function Co(e,t){return{platform:`strava`,kind:`post`,url:`https://www.strava.com/${So[e]}/${t}`,id:`${e}/${t}`,variant:`iframe`}}const wo={platform:`strava`,name:`Strava`,shapes:[`post iframe`],match(e){if(!bo.has(e.host))return null;let[,t,n]=xo.exec(e.path)??[];return t===void 0||n===void 0?null:{...Co(t===`routes`?`route`:`activity`,n),options:{}}}},To=/^\d{1,20}$/,Eo=/^(?:https?:)?\/\/strava-embeds\.com\/embed\.js$/,Do=/* @__PURE__ */ new Set([`standard`,`minimal`]),Oo=/^[A-Za-z0-9_-]{1,100}$/;function ko(e){return e===`activity`||e===`route`}const Ao=/* @__PURE__ */ z(wo,{parse(e){if(e.tag!==`div`||!k(e,`strava-embed-placeholder`)||!e.children.every(e=>e.type===`comment`||e.type===`text`&&/^\s*$/.test(e.raw)))return null;let t=e.attrs.get(`data-embed-type`),n=e.attrs.get(`data-embed-id`)??``;if(!ko(t)||!To.test(n))return null;let r={},i=e.attrs.get(`data-style`);i!==void 0&&Do.has(i)&&(r.style=i),t===`route`&&e.attrs.get(`data-full-width`)===`true`&&(r.fullWidth=!0);let a=e.attrs.get(`data-map-hash`);return a!==void 0&&Oo.test(a)&&(r.mapHash=a),{...Co(t,n),options:r}},isOwnScript:e=>Eo.test(e)}),jo=`([a-z0-9]{4,8})`,Mo=/* @__PURE__ */ new Set([`streamable.com`,`www.streamable.com`]),No=/* @__PURE__ */ RegExp(`^/[eo]/${jo}$`),Po=/* @__PURE__ */ RegExp(`^/${jo}/?$`),Fo=/* @__PURE__ */ new Set([`about`,`login`,`signup`,`terms`,`privacy`,`pricing`,`upload`,`help`,`apps`,`blog`,`jobs`,`press`,`tools`,`embed`,`plans`,`contact`,`support`,`videos`,`account`,`profile`]);function Io(e){return{platform:`streamable`,kind:`video`,url:`https://streamable.com/${e}`,id:e,variant:`iframe`}}function Lo(e){return e!==void 0&&!Fo.has(e)}function Ro(e){if(!e||!Mo.has(e.host))return;let t=(No.exec(e.path)??Po.exec(e.path))?.[1];return Lo(t)?t:void 0}const zo={platform:`streamable`,name:`Streamable`,shapes:[`video iframe`],match(e){let t=Ro(e);return t===void 0?null:{...Io(t),options:{}}},ownsFrame:wn},Bo=/^width:\s*100%;\s*height:\s*0(?:px)?;\s*position:\s*relative;\s*padding-bottom:\s*(\d{1,3}(?:\.\d{1,4})?)%;?$/,Vo=/* @__PURE__ */ new Set([`loop`,`autoplay`,`nocontrols`,`hd`,`muted`]),Ho=/<\/div\s*>$/i;function Uo(e){if(e.tag!==`iframe`)return null;let t=I(e.attrs.get(`src`)??``);if(!t||t.host!==`streamable.com`)return null;let[,n]=No.exec(t.path)??[];if(!Lo(n))return null;let r=Object.fromEntries([...t.query].filter(([e])=>Vo.has(e)).map(([e,t])=>[e,L(t)]));return{...Io(n),options:r}}const Wo=/* @__PURE__ */ z(zo,{parse(e){let t=W(e,Bo),n=t?.iframe??e,r=Uo(n);return r?U(r,t?.size??H(n)):null},isOwnScript:()=>!1,repair(e){let t=e.trimEnd(),n=Ho.exec(t);if(!n)return null;let r=t.slice(0,n.index).trimEnd();return/^\s*<iframe[\s>]/i.test(r)?r:null}}),Go=/* @__PURE__ */ new Set([`t.me`,`telegram.me`,`www.telegram.me`]),Ko=`[A-Za-z][A-Za-z0-9_]{2,31}`,qo=/* @__PURE__ */ RegExp(`^/(?:s/)?(${Ko})/(\\d{1,10})/?$`);function Jo(e,t,n){return{platform:`telegram`,kind:`post`,url:`https://t.me/${e}/${t}`,id:`${e}/${t}`,variant:`iframe`,options:n}}const Yo={platform:`telegram`,name:`Telegram`,shapes:[`post iframe`],match(e){if(!Go.has(e.host))return null;let[,t,n]=qo.exec(e.path)??[];if(t===void 0||n===void 0)return null;let r={};e.query.has(`single`)&&(r.single=!0);let i=e.query.get(`comment`);return i!==void 0&&/^\d{1,10}$/.test(i)&&(r.comment=Number(i)),Jo(t,n,r)}},Xo=/* @__PURE__ */ RegExp(`^(${Ko})/(\\d{1,10})$`),Zo=/^(?:https?:)?\/\/telegram\.org\/js\/telegram-widget\.js(?:\?\d{1,3})?$/,Qo=[`data-telegram-login`,`data-telegram-discussion`,`data-telegram-share-url`],$o=[[`data-width`,`width`],[`data-comment`,`comment`],[`data-userpic`,`userpic`],[`data-mode`,`mode`],[`data-color`,`color`],[`data-dark`,`dark`],[`data-dark-color`,`darkColor`]],es=/* @__PURE__ */ z(Yo,{parse:()=>null,parseScript(e){if(!Zo.test(e.attrs.get(`src`)??``)||Qo.some(t=>e.attrs.has(t)))return null;let[,t,n]=Xo.exec(e.attrs.get(`data-telegram-post`)??``)??[];if(t===void 0||n===void 0)return null;let r=V(e,$o,L);return e.attrs.has(`data-single`)&&(r.single=!0),Jo(t,n,r)},isOwnScript:e=>Zo.test(e)}),ts=/* @__PURE__ */ new Set([`tenor.com`,`www.tenor.com`]),ns=`(\\d{1,20})`,rs=/* @__PURE__ */ RegExp(`^/(?:[a-z]{2}(?:-[A-Za-z]{2,4})?/)?view/(?:[A-Za-z0-9%_.~-]{1,300}-gif-)?${ns}/?$`),is=/* @__PURE__ */ new Map([[`a`,[`href`]]]);function as(e){return{platform:`tenor`,kind:`video`,url:`https://tenor.com/view/${e}`,id:e,variant:`iframe`}}function os(e){return e&&ts.has(e.host)?rs.exec(e.path)?.[1]:void 0}const ss={platform:`tenor`,name:`Tenor`,shapes:[`video iframe`],trustsFallback:e=>N(e,is),match(e){let t=os(e);return t===void 0?null:{...as(t),options:{}}},ownsFrame:Tn},cs=/* @__PURE__ */ RegExp(`^/embed/${ns}$`),ls=/^(?:https?:)?\/\/tenor\.com\/embed\.js$/,us=/^\d{1,3}(?:\.\d{1,20})?$/;function ds(e){let t=Math.round(e*1e4);if(!(t>=100&&t<=1e6))return;let n=fs(t,1e4);return{width:t/n,height:1e4/n}}function fs(e,t){return t===0?e:fs(t,e%t)}function ps(e){if(!k(e,`tenor-gif-embed`))return null;let t=e.attrs.get(`data-postid`)??``;if(!(/* @__PURE__ */ RegExp(`^(\\d{1,20})$`)).test(t))return null;let n=e.attrs.get(`data-aspect-ratio`);if(n!==void 0&&!us.test(n))return null;let r=ds(n===void 0?1.33:Number(n));return r?U({...as(t),options:{},fallbackHtml:j(e.children,is)},r):null}function ms(e){let t=I(e.attrs.get(`src`)??``);if(!t||t.host!==`tenor.com`)return null;let[,n]=cs.exec(t.path)??[];return n===void 0?null:U({...as(n),options:{}},H(e))}const hs=/* @__PURE__ */ z(ss,{parse(e){return e.tag===`div`?ps(e):e.tag===`iframe`?ms(e):null},isOwnScript:e=>ls.test(e)}),gs=/* @__PURE__ */ new Set([`threads.com`,`www.threads.com`,`threads.net`,`www.threads.net`]),_s=/^\/(?:@[A-Za-z0-9._]{1,30}\/post|t)\/([A-Za-z0-9_-]{1,64})\/?$/,vs=/* @__PURE__ */ new Map([[`a`,[`href`]],[`div`,[]]]);function ys(e){if(!e||!gs.has(e.host))return null;let[,t]=_s.exec(e.path)??[];return t===void 0?null:{platform:`threads`,kind:`post`,url:`https://www.threads.com/t/${t}`,id:t,variant:`sdk`}}const bs={platform:`threads`,name:`Threads`,shapes:[`post sdk`],trustsFallback:e=>N(e,vs),match(e){let t=ys(e);return t&&{...t,options:{}}}},xs=/^(?:https?:)?\/\/www\.threads\.(?:com|net)\/embed\.js$/,Ss=[[`data-theme`,`theme`],[`data-text-post-version`,`version`]],Cs=/* @__PURE__ */ z(bs,{parse(e){if(e.tag!==`blockquote`||!k(e,`text-post-media`))return null;let t=ys(I(e.attrs.get(`data-text-post-permalink`)??``));if(!t)return null;let n=e.attrs.get(`id`);return n!==void 0&&n!==`ig-tp-${t.id}`?null:{...t,options:V(e,Ss,L),fallbackHtml:j(e.children,vs)}},isOwnScript:e=>xs.test(e)}),ws=/^\/@([A-Za-z0-9._]{0,64})\/video\/(\d{1,25})\/?$/;function Ts(e,t=``,n={}){return{platform:`tiktok`,kind:`video`,url:`https://www.tiktok.com/@${t}/video/${e}`,id:e,variant:`iframe`,options:n}}const Es={platform:`tiktok`,name:`TikTok`,shapes:[`video iframe`],match(e){if(!G.has(e.host))return null;let[,t,n]=ws.exec(e.path)??[];return t===void 0||n===void 0?null:Ts(n,t)},ownsFrame:dn},Ds=/^\/player\/v1\/(\d{1,25})\/?$/,Os=/^\d{1,25}$/,ks=/^(?:https?:)?\/\/www\.tiktok\.com\/embed\.js$/,As=/* @__PURE__ */ z(Es,{parse(e){if(e.tag===`blockquote`&&k(e,`tiktok-embed`)){let t=I(e.attrs.get(`cite`)??``),[,n,r]=t&&G.has(t.host)?ws.exec(t.path)??[]:[],i=e.attrs.get(`data-video-id`);if(i!==void 0&&!Os.test(i)||i!==void 0&&r!==void 0&&i!==r)return null;let a=i??r;return a===void 0?null:Ts(a,n)}if(e.tag!==`iframe`)return null;let t=I(e.attrs.get(`src`)??``);if(!t||!G.has(t.host))return null;let[,n]=Ds.exec(t.path)??[];return n===void 0?null:U(Ts(n,``,Object.fromEntries([...t.query].map(([e,t])=>[e,L(t)]))),H(e))},isOwnScript:e=>ks.test(e)}),js=/* @__PURE__ */ new Set([`truthsocial.com`,`www.truthsocial.com`]),Ms=`(@[A-Za-z0-9_.-]{1,64})`,Ns=`(\\d{1,25})`,Ps=/* @__PURE__ */ RegExp(`^/${Ms}/(?:posts/)?${Ns}/?$`);function Fs(e,t){return{platform:`truthsocial`,kind:`post`,url:`https://truthsocial.com/${e}/posts/${t}`,id:t,variant:`iframe`}}function Is(e){if(!e||!js.has(e.host))return null;let[,t,n]=Ps.exec(e.path)??[];return t===void 0||n===void 0?null:Fs(t,n)}const Ls={platform:`truthsocial`,name:`Truth Social`,shapes:[`post iframe`],match(e){let t=Is(e);return t&&{...t,options:{}}},ownsFrame:En},Rs=/* @__PURE__ */ RegExp(`^/${Ms}/${Ns}/embed$`),zs=/^(?:https?:)?\/\/truthsocial\.com\/embed\.js$/,Bs=/* @__PURE__ */ z(Ls,{parse(e){if(e.tag!==`iframe`)return null;let t=I(e.attrs.get(`src`)??``);if(!t||t.host!==`truthsocial.com`)return null;let[,n,r]=Rs.exec(t.path)??[];if(n===void 0||r===void 0)return null;let i=k(e,`truthsocial-video`)?{video:!0}:{};return U({...Fs(n,r),options:i},H(e))},isOwnScript:e=>zs.test(e)}),Vs=`([a-z0-9-]{1,32})`,Hs=`(\\d{1,20})`,Us=/* @__PURE__ */ new Set([`www.tumblr.com`,`tumblr.com`]),Ws=/* @__PURE__ */ RegExp(`^/${Vs}/${Hs}(?:/[^/]{1,200})?/?$`),Gs=/* @__PURE__ */ RegExp(`^${Vs}\\.tumblr\\.com$`),Ks=/* @__PURE__ */ RegExp(`^/post/${Hs}(?:/[^/]{1,200})?/?$`),qs=/* @__PURE__ */ new Set([`dashboard`,`explore`,`tagged`,`search`,`settings`,`blog`,`www`,`assets`,`embed`,`api`,`help`]);function Js(e){if(!e)return null;let t,n;return Us.has(e.host)?[,t,n]=Ws.exec(e.path)??[]:([,t]=Gs.exec(e.host)??[],[,n]=Ks.exec(e.path)??[]),t===void 0||n===void 0||qs.has(t)?null:{platform:`tumblr`,kind:`post`,url:`https://www.tumblr.com/${t}/${n}`,id:n,variant:`iframe`}}const Ys={platform:`tumblr`,name:`Tumblr`,shapes:[`post iframe`],match(e){let t=Js(e);return t&&{...t,options:{}}}},Xs=/* @__PURE__ */ RegExp(`^/embed/post/(?:t:[A-Za-z0-9_-]{1,64}|${Vs})/${Hs}/v2$`),Zs=/* @__PURE__ */ RegExp(`^/embed/post/(?:t:)?[A-Za-z0-9_-]{1,64}/${Hs}$`),Qs=/^(?:https?:)?\/\/(?:secure\.)?assets\.tumblr\.com\/post\.js(?:\?[^#]*)?$/,$s=/* @__PURE__ */ z(Ys,{parse(e){if(e.tag!==`div`||!k(e,`tumblr-post`))return null;let t=I(e.attrs.get(`data-href`)??``);if(t?.host!==`embed.tumblr.com`)return null;let[,n,r]=Xs.exec(t.path)??[],i=r??Zs.exec(t.path)?.[1];if(i===void 0)return null;let[a,...o]=e.children.filter(e=>e.type!==`text`||e.raw.trim()!==``);if(o.length>0||a?.type!==`element`||a.tag!==`a`)return null;let s=Js(I(a.attrs.get(`href`)??``));return s?.id!==i||n!==void 0&&s.url!==`https://www.tumblr.com/${n}/${i}`?null:{...s,options:{}}},isOwnScript:e=>Qs.test(e)}),ec=/* @__PURE__ */ new Set([`twitch.tv`,`www.twitch.tv`,`m.twitch.tv`]),tc=/^[A-Za-z0-9_]{3,25}$/,nc=/^v?(\d{1,12})$/,rc=/^[A-Za-z0-9_-]{6,30}$/,ic=/^[A-Za-z0-9_-]{6,100}$/,ac=/^(?:\d+h)?(?:\d+m)?(?:\d+s)?$/,oc=/* @__PURE__ */ new Set([`directory`,`videos`,`collections`,`settings`,`subscriptions`,`inventory`,`wallet`,`drops`,`search`,`downloads`,`jobs`,`turbo`,`p`,`login`,`signup`]);function sc(e,t){return{platform:`twitch`,kind:`video`,url:e,id:t,variant:`iframe`}}const cc=e=>sc(`https://www.twitch.tv/${e.toLowerCase()}`,e.toLowerCase()),lc=e=>sc(`https://www.twitch.tv/videos/${e}`,e),uc=e=>sc(`https://www.twitch.tv/collections/${e}`,e),dc=e=>sc(`https://clips.twitch.tv/${e}`,e);function fc(e){if(e.host===`clips.twitch.tv`){let t=e.path.replace(/^\/|\/$/g,``);return ic.test(t)?{found:dc(t),options:{}}:null}if(!ec.has(e.host))return null;let t=e.path.replace(/^\/|\/$/g,``).split(`/`),[n=``,r,i]=t;if(t.length===2&&n===`videos`){let[,t]=nc.exec(r??``)??[];if(t===void 0)return null;let n=e.query.get(`t`);return{found:lc(t),options:n!==void 0&&ac.test(n)&&n?{time:n}:{}}}return t.length===2&&n===`collections`?rc.test(r??``)?{found:uc(r??``),options:{}}:null:t.length===3&&r===`clip`?tc.test(n)&&ic.test(i??``)?{found:dc(i??``),options:{}}:null:t.length===1&&tc.test(n)&&!oc.has(n.toLowerCase())?{found:cc(n),options:{}}:null}const pc={platform:`twitch`,name:`Twitch`,shapes:[`video iframe`],match(e){let t=fc(e);return t&&{...t.found,options:t.options}},ownsFrame:fn},mc=[`autoplay`,`muted`,`time`];function hc(e){let t={};for(let n of mc){let r=e.get(n);r!==void 0&&(t[n]=L(r))}return t}function gc(e){let t=e.query.get(`channel`);if(t!==void 0)return tc.test(t)?cc(t):null;let[,n]=nc.exec(e.query.get(`video`)??``)??[];if(n!==void 0)return lc(n);let r=e.query.get(`collection`);return r!==void 0&&rc.test(r)?uc(r):null}const _c=/* @__PURE__ */ z(pc,{parse(e){if(e.tag!==`iframe`)return null;let t=I(e.attrs.get(`src`)??``);if(!t)return null;let n=null;if(t.host===`player.twitch.tv`&&/^\/?$/.test(t.path)&&(n=gc(t)),t.host===`clips.twitch.tv`&&t.path===`/embed`){let e=t.query.get(`clip`)??``;n=ic.test(e)?dc(e):null}return n&&U({...n,options:hc(t.query)},H(e))},isOwnScript:()=>!1}),vc=/* @__PURE__ */ new Set([`vimeo.com`,`www.vimeo.com`]),Z=`(\\d{1,12})`,yc=`([0-9a-f]{6,20})`,bc=[RegExp(`^/${Z}(?:/${yc})?/?$`),RegExp(`^/channels/[A-Za-z0-9_-]{1,64}/${Z}/?$`),RegExp(`^/groups/[A-Za-z0-9_-]{1,64}/videos/${Z}/?$`),RegExp(`^/showcase/\\d{1,12}/video/${Z}/?$`)],xc=/* @__PURE__ */ RegExp(`^/video/${Z}/?$`),Sc=/* @__PURE__ */ new Set([`h`,`app_id`,`player_id`]),Cc=/^t=(\d+(?:\.\d+)?|(?:\d+h)?(?:\d+m)?(?:\d+s)?)$/;function wc(e,t){return{platform:`vimeo`,kind:`video`,url:`https://vimeo.com/${e}${t?`/${t}`:``}`,id:e,variant:`iframe`}}function Tc(e){let[,t]=Cc.exec(e.fragment??``)??[];return t?{t}:{}}function Ec(e){if(!e||!vc.has(e.host))return null;for(let t of bc){let[,n,r]=t.exec(e.path)??[];if(n!==void 0)return wc(n,r)}return null}function Dc(e){if(e?.host!==`player.vimeo.com`)return null;let[,t]=xc.exec(e.path)??[];if(t===void 0)return null;let n=e.query.get(`h`);if(n!==void 0&&!RegExp(`^${yc}$`).test(n))return null;let r=Object.fromEntries([...e.query].filter(([e])=>!Sc.has(e)).map(([e,t])=>[e,L(t)]));return{...wc(t,n),options:{...r,...Tc(e)}}}const Oc={platform:`vimeo`,name:`Vimeo`,shapes:[`video iframe`],match(e){let t=Dc(e);if(t)return t;let n=Ec(e);return n&&{...n,options:Tc(e)}},ownsFrame:pn},kc=/^padding:\s*(\d{1,3}(?:\.\d{1,4})?)% 0 0 0;\s*position:\s*relative;?$/,Ac=/^(?:https?:)?\/\/player\.vimeo\.com\/api\/player\.js$/;function jc(e,t){if(e?.type!==`element`||e.tag!==`a`||e.attrs.size!==1)return!1;let n=I(e.attrs.get(`href`)??``);return n!==null&&vc.has(n.host)&&t(n)&&e.children.every(e=>e.type===`text`)}function Mc(e,t){return e?.type===`text`&&e.raw.trim()===t}function Nc(e,t){if(e.tag!==`p`||e.attrs.size!==0)return!1;let[n,r,i,a,o,s,...c]=e.children;return c.length===0&&jc(n,e=>Ec(e)?.id===t.id)&&Mc(r,`from`)&&jc(i,()=>!0)&&Mc(a,`on`)&&jc(o,e=>e.path===``||e.path===`/`)&&Mc(s,`.`)}const Pc=/* @__PURE__ */ z(Oc,{parse(e){let t=W(e,kc),n=t?.iframe??e;if(n.tag!==`iframe`)return null;let r=Dc(I(n.attrs.get(`src`)??``));return r&&U(r,t?.size??H(n))},isOwnScript:e=>Ac.test(e),isOwnExtra:Nc}),Fc=/* @__PURE__ */ new Set([`x.com`,`www.x.com`,`mobile.x.com`,`twitter.com`,`www.twitter.com`,`mobile.twitter.com`]),Ic=/^\/([A-Za-z0-9_]{1,15})\/status\/(\d{1,20})\/?$/,Lc=/^\/(?:([A-Za-z0-9_]{1,15})|i\/web)\/status\/(\d{1,20})(?:\/(?:photo|video)\/[1-4])?\/?$/,Rc=/* @__PURE__ */ new Map([[`p`,[`lang`,`dir`]],[`a`,[`href`]],[`br`,[]]]);function zc(e,t=Ic){if(!e||!Fc.has(e.host))return null;let[,n=`i`,r]=t.exec(e.path)??[];return r===void 0?null:{platform:`x`,kind:`post`,url:`https://x.com/${n}/status/${r}`,id:r,variant:`sdk`}}function Bc(e){return A(e).reverse().map(e=>e.tag===`a`?zc(I(e.attrs.get(`href`)??``)):null).find(e=>e!==null)??null}function Vc(e,t){return Bc(O(e)??[])?.id===t}const Hc={platform:`x`,name:`X`,shapes:[`post sdk`],trustsFallback:(e,t)=>N(e,Rc)&&Vc(e,t.id),match(e){let t=zc(e,Lc);return t&&{...t,options:{}}}},Uc=/^(?:https?:)?\/\/platform\.(?:x|twitter)\.com\/widgets\.js$/,Wc=[[`data-theme`,`theme`],[`data-conversation`,`conversation`],[`data-cards`,`cards`],[`data-align`,`align`],[`align`,`align`],[`data-lang`,`lang`],[`data-dnt`,`dnt`],[`data-width`,`width`]],Gc=/* @__PURE__ */ z(Hc,{parse(e){if(e.tag!==`blockquote`||!(k(e,`twitter-tweet`)||k(e,`twitter-video`)))return null;let t=Bc(e.children);return t?{...t,options:V(e,Wc,L),fallbackHtml:j(e.children,Rc)}:null},isOwnScript:e=>Uc.test(e)}),Kc=`https://www.youtube.com`,qc=/^(?!videoseries|live_stream)[A-Za-z0-9_-]{11}$/,Jc=/^\/embed\/(?:(videoseries|live_stream)|([A-Za-z0-9_-]{11}))\/?$/,Yc=/^\/(shorts|live)\/((?!videoseries|live_stream)[A-Za-z0-9_-]{11})\/?$/,Xc=/^\/([A-Za-z0-9_-]{11})\/?$/,Zc=/^[A-Za-z0-9_-]{10,64}$/,Qc=/^UC[A-Za-z0-9_-]{22}$/,$c=/^\/channel\/(UC[A-Za-z0-9_-]{22})\/live\/?$/,el=/^(?:(\d{1,5})h)?(?:(\d{1,6})m)?(?:(\d{1,7})s?)?$/,tl=/^t=(.+)$/;function nl(e){if(e===void 0||e===``)return;let t=el.exec(e);if(!t)return;let[,n=`0`,r=`0`,i=`0`]=t;return Number(n)*3600+Number(r)*60+Number(i)}function rl(e){return nl(e.get(`start`))??nl(e.get(`t`))}function il(e,t){return{platform:`youtube`,kind:`video`,url:t,id:e,variant:`iframe`}}function al(e,t=!1){return il(e,t?`${Kc}/shorts/${e}`:`${Kc}/watch?v=${e}`)}function ol(e){return e!==void 0&&Zc.test(e)?il(e,`${Kc}/playlist?list=${e}`):null}function sl(e){return e!==void 0&&Qc.test(e)?il(e,`${Kc}/channel/${e}/live`):null}function cl(e){let[,t,n]=Jc.exec(e.path)??[];if(n!==void 0)return{found:al(n)};if(t===`videoseries`){let t=ol(e.query.get(`list`));return t&&{found:t,key:`list`}}if(t===`live_stream`){let t=sl(e.query.get(`channel`));return t&&{found:t,key:`channel`}}return null}function ll(e,t){let n=rl(e.query)??nl(tl.exec(e.fragment??``)?.[1]);return{...n===void 0?{}:{start:n},...t?{nocookie:!0}:{}}}const ul=[Gc,ra,$r,Cs,As,/* @__PURE__ */ z({platform:`youtube`,name:`YouTube`,shapes:[`video iframe`],match(e){if(e.host===`youtu.be`){let[,t]=Xc.exec(e.path)??[];return t===void 0?null:{...al(t),options:ll(e,!1)}}let t=nn.has(e.host);if(!t&&!tn.has(e.host))return null;let n=ll(e,t);if(B(e.path,`/embed`)){let t=cl(e);return t&&{...t.found,options:n}}if(t)return null;if(/^\/watch\/?$/.test(e.path)){let t=e.query.get(`v`);return t!==void 0&&qc.test(t)?{...al(t),options:n}:null}if(/^\/playlist\/?$/.test(e.path)){let t=ol(e.query.get(`list`));return t&&{...t,options:n}}let[,r]=$c.exec(e.path)??[],i=sl(r);if(i)return{...i,options:n};let[,a,o]=Yc.exec(e.path)??[];return a===void 0||o===void 0?null:{...al(o,a===`shorts`),options:n}},ownsFrame:ln},{parse(e){if(e.tag!==`iframe`)return null;let t=I(e.attrs.get(`src`)??``),n=t!==null&&nn.has(t.host);if(!t||!(n||tn.has(t.host)))return null;let r=cl(t);if(!r)return null;let i=[...t.query].filter(([e])=>e!==`t`&&e!==r.key).map(([e,t])=>[e,L(t)]),a=Object.fromEntries(i),o=rl(t.query);return o!==void 0&&(a.start=o),n&&(a.nocookie=!0),U({...r.found,options:a},H(e))},isOwnScript:()=>!1}),es,Ka,ya,Ia,Oa,yo,Pc,_c,Pr,co,lr,pr,ua,Mi,hs,Wo,mo,Bs,Ji,Ao,yi,Er,$s];function dl(e){return ul.find(t=>t.platform===e)}function fl(e){return pl(ul,e)}function pl(e,t){let n=hl(t);if(!n)return null;for(let t of e){let e=t.match(n);if(e)return e}return null}function ml(e,t){let n=hl(t);return n&&e.match(n)}function hl(e){return typeof e==`string`?I(e):null}function gl(e,t){if(t.platform!==e.platform)return null;let n=ml(e,t.url);if(n?.platform!==t.platform||n.id!==t.id||n.url!==t.url||!e.shapes.includes(`${t.kind} ${t.variant}`))return null;if(t.fallbackHtml===void 0||e.trustsFallback?.(t.fallbackHtml,t))return t;let r={...t};return delete r.fallbackHtml,r}const _l={bluesky:`Bluesky`,rumble:`Rumble`};function vl(e){return`social-embeds: a ${e} URL needs a lookup: use the embed code`}function yl(e,t,n){let{platform:r,name:i}=n,a=t??(e===void 0?null:ml(n,e));if(!a&&e!==void 0&&xl(n,e))return{error:vl(i)};if(!a)return{error:`social-embeds: not a ${i} post URL: ${String(e)}`};if(a.platform!==r)return{error:`social-embeds: expected a ${i} embed, got ${a.platform}`};let o=gl(n,a);return o?{embed:o}:{error:`social-embeds: the ${i} embed's url and id do not match`}}function bl(e){if(`html`in e)return`social-embeds: unrecognised embed code`;let t=rr(e.url);return t?vl(_l[t]??t):`social-embeds: not a supported post URL: ${e.url}`}function xl(e,t){let n=typeof t==`string`?I(t):null;return n!==null&&e.needsLookup?.(n)===!0}function Sl(e){return Cl(ul,e)}function Cl(e,t){if(typeof t!=`string`)return null;let n=O(t);return n?Tl(e,n):wl(e,t)}function wl(e,t){for(let n of e){let r=n.repair?.(t),i=r==null?null:O(r),a=i&&Tl(e,i);if(a?.platform===n.platform)return a}return null}function Tl(e,t){let n,r,i=[],a=!1;for(let e of t)if(e.type!==`comment`){if(e.type===`text`){if(/^\s*$/.test(Ie(e.raw)))continue;return null}if(e.tag===`script`)i.push(e);else if(El(e))a=!0;else if(n){if(r)return null;r=e}else n=e}if(!n){let[t]=i;if(a||i.length!==1||!t||t.children.length!==0)return null;for(let n of e){let e=n.parseScript?.(t);if(e)return e}return null}for(let t of e){let e=t.parse(n);if(!e)continue;if(a&&!t.allowsFbRoot||r&&!t.isOwnExtra?.(r,e))return null;let o=i.map(e=>e.children.length===0?e.attrs.get(`src`):void 0);if(!o.every(e=>e!==void 0&&t.isOwnScript(e)))return null;let s=o.map(e=>e===void 0?{}:t.scriptOptions?.(e)??{});return{...e,options:Object.assign({},...s,e.options)}}return null}function El(e){return e.tag===`div`&&e.attrs.get(`id`)===`fb-root`&&e.attrs.size===1&&e.children.length===0}function Dl(e){if(e===null||e.trim()===``)return;let t=Number(e);return Number.isFinite(t)&&t>=0?t:void 0}function Ol(e){return e===null?void 0:Dl(e.trim().replace(/px$/i,``))}function kl(e){for(let t of e.children)if(t instanceof HTMLTemplateElement)return t}function Al(e){let t=e.getAttribute(`eager`);return t!==null&&t!==`false`}function jl(e,t){let n=t??e.getAttribute(`html`)??kl(e)?.innerHTML,r=e.getAttribute(`url`),i=e.getAttribute(`width`);return{source:n===void 0?r===null?null:{url:r}:{html:n},layout:{width:Dl(i)??(i?.trim()?i:void 0),maxWidth:Ol(e.getAttribute(`max-width`)),height:Ol(e.getAttribute(`height`)),maxHeight:Ol(e.getAttribute(`max-height`))},eager:Al(e),iframeTitle:e.getAttribute(`iframe-title`)??void 0}}const Ml=/* @__PURE__ */ new WeakMap;function Nl(e,t){for(let n of e.querySelectorAll(`iframe`)){let e=n.getAttribute(`title`);e!==t&&(e?.trim()&&e!==Ml.get(n)||(n.setAttribute(`title`,t),Ml.set(n,t)))}}function Pl(e,t){return e?.trim()?e:t}function Fl(e,t){Nl(e,t);let n=new MutationObserver(()=>{Nl(e,t)});return n.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`title`]}),()=>{n.disconnect()}}const Il=/* @__PURE__ */ new Set([`width`,`maxWidth`,`height`,`maxHeight`,`minHeight`,`borderRadius`]);function Ll(e,t){e.removeAttribute(`style`),Q(e,t)}function Q(e,t){for(let[n,r]of Object.entries(t)){if(r===void 0)continue;let t=typeof r==`number`&&Il.has(n)?`${String(r)}px`:String(r);e.style.setProperty(n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),t)}}function Rl(e){let t=document.createElement(`div`);return t.setAttribute(`aria-hidden`,`true`),Q(t,{width:`100%`,height:`100%`,minHeight:e,background:`rgba(128, 128, 128, 0.12)`}),t}function zl(e,t,n){if(t||typeof IntersectionObserver>`u`)return n(),()=>{};let r=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(r.disconnect(),n())},{rootMargin:`200px 0px`});return r.observe(e),()=>{r.disconnect()}}function Bl(e){return e.style.position=`absolute`,e.style.setProperty(`inset`,`0`),e}function Vl(e,t,n){let{eager:r,placeholder:i,onLoad:a,onError:o}=n,{messageHeight:s}=t,c=Pl(n.iframeTitle,t.title),l=document.createElement(`div`),u,d=e=>{Ll(l,Je(t,e,u))};d(n);let f=Bl(document.createElement(`div`)),p=Bl(document.createElement(`div`)),m=i.length>0?i:[t.fallbackHtml===void 0?Rl():Hl(t.fallbackHtml,t.fallbackImage===!0)];p.append(...m),f.append(p),l.append(f),e.append(l);let h,g=!1,_,v=()=>{},y=[],b=()=>{p.remove(),v(),g||(g=!0,a())},ee=s?`did not report its height`:`did not load`,x=()=>{clearTimeout(_),_=setTimeout(()=>{g||(v(),p.remove(),o(/* @__PURE__ */ Error(`social-embeds: ${t.title} ${ee}`)))},15e3)},S=e=>{let n=document.createElement(`iframe`);n.src=t.clientSrc?t.clientSrc(e):e,n.title=c,n.setAttribute(`allow`,t.allow),t.allowFullscreen!==!1&&n.setAttribute(`allowfullscreen`,``),t.referrerPolicy&&(n.referrerPolicy=t.referrerPolicy),t.scrolling&&n.setAttribute(`scrolling`,t.scrolling),t.sandbox!==void 0&&n.setAttribute(`sandbox`,t.sandbox),Q(n,{display:`block`,width:`100%`,height:`100%`,border:0}),n.addEventListener(`load`,()=>{s||b()}),h?h.replaceWith(n):f.prepend(n),h=n},C=!1,w=()=>{if(C)return;C=!0,s&&y.push(s.listen(()=>h,e=>{u=e,Q(l,{height:u}),b()}));let{sizeInSrc:e}=t;e?y.push(e.watch(f,t=>{S(e.src(t))})):S(t.src)};return r&&w(),y.push(zl(f,!1,()=>{w(),s?g||(v=s.onScreen(f,e=>{e?x():clearTimeout(_)})):x()})),{wrapper:l,cleanup:()=>{for(let e of y)e();v(),clearTimeout(_),l.remove()},update(e,n,r){d(e),c=Pl(r,t.title),h&&(h.title=c),n&&w()}}}function Hl(e,t){let n=document.createElement(t?`div`:`blockquote`);return t&&(n.style.height=`100%`),n.innerHTML=e,n}const Ul=[`href`,`data-href`,`data-instgrm-permalink`,`data-text-post-permalink`];function Wl(e){let t=e.querySelector(Ul.map(e=>`[${e}]`).join());for(let e of Ul){let n=t?.getAttribute(e);if(n)return n}}function Gl(e){return`View this post on ${e}`}function Kl(e){return e instanceof Error?e:Error(String(e))}function ql(e,t,n){let{driver:r,label:i}=t,{eager:a,placeholder:o,onLoad:s,onError:c}=n,l=document.createElement(`div`),u=e=>{Ll(l,{width:e.width??`100%`,maxWidth:e.maxWidth??t.maxWidth})};u(n);let d=document.createElement(`div`);Q(d,{width:`100%`});let f=document.createElement(`div`);f.innerHTML=t.markup,d.append(f);let p=Wl(f),m=t.hasFallback?[]:o.length>0?o:[Rl(t.minHeight)];d.append(...m),l.append(d),e.append(l);let h=Fl(f,Pl(n.iframeTitle,t.title)),g=e=>{for(let e of m)e.parentNode?.removeChild(e);m=e,d.append(...e)},_=!1,v=!1,y,b=()=>{},ee=()=>{_||v||(v=!0,clearTimeout(y),b(),g([]),s())},x=e=>{if(t.hasFallback||p===void 0)g([]);else{let e=document.createElement(`a`);e.setAttribute(`href`,p),e.textContent=Gl(i),g([e])}c(e)},S=(e,t)=>{_||v||(b(),b=()=>{},e>=3||t instanceof he?x(t):y=setTimeout(()=>{C(e+1)},1e3*2**(e-1)))},C=e=>{if(!(_||v)){try{b=r.render(f,ee)}catch(t){S(e,Kl(t));return}y=setTimeout(()=>{S(e,/* @__PURE__ */ Error(`social-embeds: the ${i} embed did not render`))},15e3)}},w=!1,T=()=>{w||(w=!0,r.load().then(()=>{C(1)},e=>{_||x(Kl(e))}))},te=zl(f,a,T);return{wrapper:l,cleanup:()=>{_=!0,te(),clearTimeout(y),b(),h(),l.remove()},update(e,n,r){u(e),h(),h=Fl(f,Pl(r,t.title)),n&&T()}}}const Jl=typeof HTMLElement>`u`?class{}:HTMLElement,$=`embed`;function Yl(e){let t=[];for(let n of e.childNodes)if(n.nodeType===Node.ELEMENT_NODE&&!(n instanceof HTMLTemplateElement)||n.nodeType===Node.TEXT_NODE&&n.textContent?.trim()){let e=n.cloneNode(!0);if(e instanceof Element)for(let t of[e,...e.querySelectorAll(`[id]`)])t.removeAttribute(`id`);t.push(e)}return t}function Xl(e){let t=``;for(let n of e.children)n.slot!==$&&(t+=n.outerHTML);return t&&(Sl(t)??zn(t))?t:void 0}function Zl(e){let t=`html`in e?Sl(e.html):fl(e.url);if(!t){let t=`html`in e?zn(e.html):null;return t?Xn(t):{kind:`error`,message:bl(e)}}let n=dl(t.platform);if(!n)return{kind:`error`,message:bl(e)};let r=yl(void 0,t,n);return r.error===void 0?Zt(r.embed):{kind:`error`,message:r.error}}const Ql=[`html`,`url`,`width`,`maxWidth`,`height`,`maxHeight`,`eager`,`iframeTitle`];var $l=class extends Jl{static observedAttributes=[`html`,`url`,`width`,`max-width`,`height`,`max-height`,`eager`,`iframe-title`];#e=null;#t;#n;#r;#i;#a=0;#o=!1;constructor(){super(),this.attachShadow({mode:`open`}).innerHTML=`<slot name="${$}"></slot>`;for(let e of Ql){if(!Object.hasOwn(this,e))continue;let t=this[e];Reflect.deleteProperty(this,e),Reflect.set(this,e,t)}}get html(){return this.#e}set html(e){this.#e=typeof e==`string`?e:null,this.#l()}get url(){return this.getAttribute(`url`)}set url(e){this.#c(`url`,e)}get width(){return this.getAttribute(`width`)}set width(e){this.#c(`width`,e)}get maxWidth(){return this.getAttribute(`max-width`)}set maxWidth(e){this.#c(`max-width`,e)}get height(){return this.getAttribute(`height`)}set height(e){this.#c(`height`,e)}get maxHeight(){return this.getAttribute(`max-height`)}set maxHeight(e){this.#c(`max-height`,e)}get iframeTitle(){return this.getAttribute(`iframe-title`)}set iframeTitle(e){this.#c(`iframe-title`,e)}get eager(){return Al(this)}set eager(e){this.#c(`eager`,e===``||e&&e!==`false`?``:null)}connectedCallback(){!this.#t&&document.readyState===`loading`?this.#o||(this.#o=!0,document.addEventListener(`DOMContentLoaded`,()=>{this.#o=!1,this.isConnected&&this.connectedCallback()},{once:!0})):(this.#t??=new MutationObserver(()=>{this.#s(),this.#l()}),this.#s(),this.#l())}disconnectedCallback(){queueMicrotask(()=>{this.isConnected||(this.#t?.disconnect(),this.#u(),this.#r=void 0,this.#i=void 0)})}attributeChangedCallback(){this.#l()}#s(){let e=this.#t;if(e){e.disconnect(),e.observe(this,{childList:!0});for(let t of this.children)t instanceof HTMLTemplateElement&&e.observe(t.content,{childList:!0,subtree:!0,characterData:!0})}}#c(e,t){t==null?this.removeAttribute(e):this.setAttribute(e,t)}#l(){if(!this.isConnected||!this.#t)return;let e=this.#n?.wrapper;for(let t of[...this.children])t!==e&&t.slot===$&&t.remove();let t=!e||e.parentNode===this,n=jl(this,this.#e);this.#i=n.source?void 0:t&&this.#i||Xl(this),n.source??=this.#i===void 0?null:{html:this.#i};let r=JSON.stringify(n.source);r===this.#r&&t?this.#n?.update(n.layout,n.eager,n.iframeTitle):(this.#u(),this.#r=r,this.#d(n))}#u(){this.#a+=1;let e=this.#n;this.#n=void 0,e?.cleanup()}#d(e){let{source:t,layout:n,eager:r,iframeTitle:i}=e;if(!t)return;let a=this.#a,o=e=>{queueMicrotask(()=>{a===this.#a&&this.isConnected&&this.dispatchEvent(e)})},s=e=>{o(new ErrorEvent(`error`,{error:e,message:e.message}))},c=Zl(t);if(c.kind===`error`){s(Error(c.message));return}let l={...n,eager:r,iframeTitle:i,placeholder:this.#i===void 0?Yl(this):[],onLoad:()=>{o(new Event(`load`))},onError:s};this.#n=c.kind===`iframe`?Vl(this,c,l):ql(this,c,l),this.#n.wrapper.slot=$}};typeof customElements<`u`&&!customElements.get(`social-embed`)&&customElements.define(`social-embed`,$l);export{$l as SocialEmbedElement};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "social-embeds",
3
- "version": "0.9.5",
3
+ "version": "0.10.1",
4
4
  "description": "Turn social media embed code or post URLs into working React components.",
5
5
  "keywords": [
6
6
  "react",