@wix/blog 1.0.715 → 1.0.716
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/_sdk-exports/context-blog-feed/runtime.d.ts +7 -0
- package/_sdk-exports/context-blog-feed/runtime.js +2 -2
- package/_sdk-exports/context-post-by-id/runtime.js +4 -4
- package/_sdk-exports/context-post-by-slug/runtime.js +2 -2
- package/_sdk-exports/context-post-list-item/runtime.d.ts +8 -3
- package/_sdk-exports/context-post-list-item/runtime.js +4 -4
- package/_sdk-exports/context-related-posts/runtime.d.ts +7 -0
- package/_sdk-exports/context-related-posts/runtime.js +2 -2
- package/build/cjs/context-blog-feed.d.ts +7 -0
- package/build/cjs/context-blog-feed.js +4 -4
- package/build/cjs/context-blog-feed.js.map +1 -1
- package/build/cjs/context-post-by-id.js +916 -893
- package/build/cjs/context-post-by-id.js.map +1 -1
- package/build/cjs/context-post-by-slug.js +145 -122
- package/build/cjs/context-post-by-slug.js.map +1 -1
- package/build/cjs/context-post-list-item.d.ts +8 -3
- package/build/cjs/context-post-list-item.js +896 -873
- package/build/cjs/context-post-list-item.js.map +1 -1
- package/build/cjs/context-related-posts.d.ts +7 -0
- package/build/cjs/context-related-posts.js +4 -4
- package/build/cjs/context-related-posts.js.map +1 -1
- package/build/es/context-blog-feed.d.mts +7 -0
- package/build/es/context-blog-feed.mjs +4 -4
- package/build/es/context-blog-feed.mjs.map +1 -1
- package/build/es/context-post-by-id.mjs +916 -893
- package/build/es/context-post-by-id.mjs.map +1 -1
- package/build/es/context-post-by-slug.mjs +146 -123
- package/build/es/context-post-by-slug.mjs.map +1 -1
- package/build/es/context-post-list-item.d.mts +8 -3
- package/build/es/context-post-list-item.mjs +896 -873
- package/build/es/context-post-list-item.mjs.map +1 -1
- package/build/es/context-related-posts.d.mts +7 -0
- package/build/es/context-related-posts.mjs +4 -4
- package/build/es/context-related-posts.mjs.map +1 -1
- package/build/internal/cjs/context-blog-feed.d.ts +7 -0
- package/build/internal/cjs/context-post-list-item.d.ts +8 -3
- package/build/internal/cjs/context-related-posts.d.ts +7 -0
- package/build/internal/es/context-blog-feed.d.mts +7 -0
- package/build/internal/es/context-post-list-item.d.mts +8 -3
- package/build/internal/es/context-related-posts.d.mts +7 -0
- package/package.json +2 -2
|
@@ -30,10 +30,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// context-post-by-slug.ts
|
|
31
31
|
var context_post_by_slug_exports = {};
|
|
32
32
|
__export(context_post_by_slug_exports, {
|
|
33
|
-
PostBySlugProvider: () =>
|
|
34
|
-
default: () =>
|
|
35
|
-
injectAccessTokenGetter: () =>
|
|
36
|
-
usePostBySlugContext: () =>
|
|
33
|
+
PostBySlugProvider: () => Vf,
|
|
34
|
+
default: () => Vf,
|
|
35
|
+
injectAccessTokenGetter: () => Hf,
|
|
36
|
+
usePostBySlugContext: () => Lf
|
|
37
37
|
});
|
|
38
38
|
module.exports = __toCommonJS(context_post_by_slug_exports);
|
|
39
39
|
|
|
@@ -4740,82 +4740,105 @@ var Ad = async (e6) => {
|
|
|
4740
4740
|
var jd = async (e6) => {
|
|
4741
4741
|
await Wr({ fqdn: kd, entityId: e6 });
|
|
4742
4742
|
};
|
|
4743
|
-
var Md =
|
|
4744
|
-
var Nd
|
|
4745
|
-
|
|
4746
|
-
|
|
4743
|
+
var Md = 100;
|
|
4744
|
+
var Nd;
|
|
4745
|
+
var Pd = (e6) => {
|
|
4746
|
+
let t2 = [...e6.keys()];
|
|
4747
|
+
for (let n2 = 0; n2 < t2.length; n2 += Md) {
|
|
4748
|
+
let r2 = t2.slice(n2, n2 + Md);
|
|
4749
|
+
Gr().eq(`fqdn`, kd).in(`entityId`, r2).limit(r2.length).find().then(({ items: t3 }) => {
|
|
4750
|
+
let n3 = new Set(t3.map((e7) => e7.entityId));
|
|
4751
|
+
for (let t4 of r2) e6.get(t4)?.forEach((e7) => e7.resolve(n3.has(t4)));
|
|
4752
|
+
}, (t3) => {
|
|
4753
|
+
for (let n3 of r2) e6.get(n3)?.forEach((e7) => e7.reject(t3));
|
|
4754
|
+
});
|
|
4755
|
+
}
|
|
4756
|
+
};
|
|
4757
|
+
var Fd = (e6) => new Promise((t2, n2) => {
|
|
4758
|
+
if (!Nd) {
|
|
4759
|
+
let e7 = /* @__PURE__ */ new Map();
|
|
4760
|
+
Nd = e7, setTimeout(() => {
|
|
4761
|
+
Nd = void 0, Pd(e7);
|
|
4762
|
+
});
|
|
4763
|
+
}
|
|
4764
|
+
Nd.set(e6, [...Nd.get(e6) ?? [], { resolve: t2, reject: n2 }]);
|
|
4765
|
+
});
|
|
4766
|
+
var Id = (e6) => typeof e6 == `number` ? e6 : void 0;
|
|
4767
|
+
var Ld = async (e6, t2 = true) => {
|
|
4768
|
+
let [n2, r2] = await Promise.allSettled([Fd(e6), t2 ? Xi(e6) : void 0]), i2 = r2.status === `fulfilled` ? r2.value?.metrics : void 0;
|
|
4769
|
+
return { liked: n2.status === `fulfilled` && n2.value, likeCount: Id(i2?.likes), viewCount: Id(i2?.views), commentCount: Id(i2?.comments) };
|
|
4747
4770
|
};
|
|
4748
|
-
var
|
|
4749
|
-
var
|
|
4750
|
-
var
|
|
4771
|
+
var Rd = { liked: false, baselineLiked: false, freshLikeCount: void 0, viewCount: void 0, commentCount: void 0, isLikeCountLoaded: false };
|
|
4772
|
+
var zd = `wix-blog:post-like-toggled`;
|
|
4773
|
+
var Bd = () => {
|
|
4751
4774
|
let e6 = window;
|
|
4752
|
-
return e6[
|
|
4775
|
+
return e6[zd] ??= /* @__PURE__ */ new Map();
|
|
4753
4776
|
};
|
|
4754
|
-
var
|
|
4755
|
-
|
|
4777
|
+
var Vd = (e6) => {
|
|
4778
|
+
Bd().set(e6.postId, e6.liked), window.dispatchEvent(new CustomEvent(zd, { detail: e6 }));
|
|
4756
4779
|
};
|
|
4757
|
-
var
|
|
4758
|
-
var
|
|
4759
|
-
let
|
|
4780
|
+
var Hd = (e6, t2) => ({ isLiked: e6.liked, likeCount: Math.max(0, (e6.freshLikeCount ?? t2) + Number(e6.liked) - Number(e6.baselineLiked)), isLikeCountLoaded: e6.isLikeCountLoaded, viewCount: e6.viewCount, commentCount: e6.commentCount });
|
|
4781
|
+
var Ud = (e6, t2, n2 = false, r2, i2 = true) => {
|
|
4782
|
+
let a2 = Kn() || n2, [c2, p2] = (0, import_react.useState)(Rd), m2 = (0, import_react.useRef)(Rd), h2 = (0, import_react.useRef)(t2), g2 = (0, import_react.useRef)(/* @__PURE__ */ new Set()), _2 = (0, import_react.useRef)(false), v2 = (0, import_react.useRef)(false), y2 = (0, import_react.useRef)(void 0), b2 = _a(), [x2, S2] = (0, import_react.useState)(0);
|
|
4760
4783
|
(0, import_react.useEffect)(() => {
|
|
4761
|
-
let e7 =
|
|
4762
|
-
|
|
4784
|
+
let e7 = b2?.addMemberLoginListener?.(() => {
|
|
4785
|
+
Bd().clear(), S2((e8) => e8 + 1);
|
|
4763
4786
|
});
|
|
4764
4787
|
return () => {
|
|
4765
|
-
e7 !== void 0 &&
|
|
4788
|
+
e7 !== void 0 && b2?.removeMemberLoginListener?.(e7);
|
|
4766
4789
|
};
|
|
4767
|
-
}, [
|
|
4768
|
-
let
|
|
4769
|
-
let t3 =
|
|
4770
|
-
Object.keys(n3).every((e8) => n3[e8] === t3[e8]) || (
|
|
4771
|
-
}, []),
|
|
4772
|
-
|
|
4790
|
+
}, [b2]);
|
|
4791
|
+
let C2 = (0, import_react.useCallback)((e7) => {
|
|
4792
|
+
let t3 = m2.current, n3 = { ...t3, ...e7 };
|
|
4793
|
+
Object.keys(n3).every((e8) => n3[e8] === t3[e8]) || (m2.current = n3, g2.current.forEach((e8) => e8()), (0, import_react.startTransition)(() => p2(n3)));
|
|
4794
|
+
}, []), ee2 = (0, import_react.useMemo)(() => ({ get: () => Hd(m2.current, h2.current), subscribe: (e7) => (g2.current.add(e7), () => {
|
|
4795
|
+
g2.current.delete(e7);
|
|
4773
4796
|
}) }), []);
|
|
4774
4797
|
(0, import_react.useEffect)(() => {
|
|
4775
|
-
|
|
4798
|
+
h2.current !== t2 && (h2.current = t2, g2.current.forEach((e7) => e7()));
|
|
4776
4799
|
}, [t2]), (0, import_react.useEffect)(() => {
|
|
4777
|
-
if (
|
|
4778
|
-
|
|
4800
|
+
if (y2.current !== e6 && (y2.current = e6, C2(Rd)), v2.current = false, !e6 || a2) {
|
|
4801
|
+
C2({ isLikeCountLoaded: true });
|
|
4779
4802
|
return;
|
|
4780
4803
|
}
|
|
4781
4804
|
let t3 = false;
|
|
4782
|
-
return
|
|
4783
|
-
t3 ||
|
|
4805
|
+
return Ld(e6, i2).then(({ liked: e7, likeCount: n3, viewCount: r3, commentCount: i3 }) => {
|
|
4806
|
+
t3 || C2({ isLikeCountLoaded: true, viewCount: r3, commentCount: i3, baselineLiked: e7, freshLikeCount: n3, ...!v2.current && { liked: e7 } });
|
|
4784
4807
|
}).catch((n3) => {
|
|
4785
|
-
t3 ||
|
|
4808
|
+
t3 || C2({ isLikeCountLoaded: true }), Ka(r2, n3, { feature: Ua.likes, action: `read-like-state`, level: `warning`, contexts: { likes: { postId: e6 } } });
|
|
4786
4809
|
}), () => {
|
|
4787
4810
|
t3 = true;
|
|
4788
4811
|
};
|
|
4789
|
-
}, [e6,
|
|
4812
|
+
}, [e6, a2, r2, C2, x2, i2]), (0, import_react.useEffect)(() => {
|
|
4790
4813
|
if (!e6) return;
|
|
4791
4814
|
let t3 = (e7) => {
|
|
4792
|
-
|
|
4793
|
-
}, n3 =
|
|
4815
|
+
v2.current = true, C2({ liked: e7 });
|
|
4816
|
+
}, n3 = Bd().get(e6);
|
|
4794
4817
|
n3 !== void 0 && t3(n3);
|
|
4795
4818
|
let r3 = (n4) => {
|
|
4796
4819
|
let { detail: r4 } = n4;
|
|
4797
4820
|
r4.postId === e6 && t3(r4.liked);
|
|
4798
4821
|
};
|
|
4799
|
-
return window.addEventListener(
|
|
4800
|
-
}, [e6,
|
|
4801
|
-
let
|
|
4802
|
-
if (!e6 ||
|
|
4803
|
-
|
|
4804
|
-
let n3 = !
|
|
4805
|
-
if (
|
|
4806
|
-
|
|
4822
|
+
return window.addEventListener(zd, r3), () => window.removeEventListener(zd, r3);
|
|
4823
|
+
}, [e6, C2]);
|
|
4824
|
+
let w2 = (0, import_react.useCallback)(async (t3) => {
|
|
4825
|
+
if (!e6 || _2.current) return;
|
|
4826
|
+
v2.current = true;
|
|
4827
|
+
let n3 = !m2.current.liked;
|
|
4828
|
+
if (C2({ liked: n3 }), Vd({ postId: e6, liked: n3 }), !a2) {
|
|
4829
|
+
_2.current = true;
|
|
4807
4830
|
try {
|
|
4808
4831
|
await (n3 ? Ad(e6) : jd(e6));
|
|
4809
4832
|
} catch (t4) {
|
|
4810
|
-
|
|
4833
|
+
C2({ liked: !n3 }), Vd({ postId: e6, liked: !n3 }), Ka(r2, t4, { feature: Ua.likes, action: n3 ? `like-post` : `unlike-post`, contexts: { likes: { postId: e6 } } });
|
|
4811
4834
|
} finally {
|
|
4812
|
-
|
|
4835
|
+
_2.current = false;
|
|
4813
4836
|
}
|
|
4814
4837
|
}
|
|
4815
|
-
}, [e6,
|
|
4816
|
-
return { ...
|
|
4838
|
+
}, [e6, a2, r2, C2]);
|
|
4839
|
+
return { ...Hd(c2, t2), toggleLike: w2, liveLikes: ee2 };
|
|
4817
4840
|
};
|
|
4818
|
-
var
|
|
4841
|
+
var Wd = () => {
|
|
4819
4842
|
let e6;
|
|
4820
4843
|
try {
|
|
4821
4844
|
let { multilingualEnabled: t3, currentLocale: n3 } = (0, import_services_manager_react.useService)(Ha);
|
|
@@ -4829,154 +4852,154 @@ var Bd = () => {
|
|
|
4829
4852
|
}
|
|
4830
4853
|
return e6 || t2 || n2;
|
|
4831
4854
|
};
|
|
4832
|
-
var
|
|
4855
|
+
var Gd = (e6, t2, n2) => typeof e6 != `number` || !Number.isFinite(e6) || e6 < 0 ? `` : new Intl.NumberFormat(n2, t2 === `compact` ? { notation: `compact`, maximumFractionDigits: 1 } : void 0).format(e6);
|
|
4833
4856
|
var Q = { timeToRead: `post.time-to-read`, viewCount: `post.view-count`, commentCount: `post.comment-count`, likeCount: `post.like-count`, noPostsTitle: `post-list.empty-state.title`, noPostsDescription: `post-list.empty-state.description`, noRelatedPostsTitle: `related-posts.empty-state.title`, noRelatedPostsDescription: `related-posts.empty-state.description`, canvasPostTitle: `canvas.post-title`, canvasAuthorName: `canvas.author-name`, canvasExcerpt: `canvas.excerpt`, canvasContent: `canvas.content`, canvasCategory: `canvas.category`, canvasCategoryNumbered: `canvas.category-numbered`, canvasTagNumbered: `canvas.tag-numbered`, canvasCoverAlt: `cover-media.placeholder-alt`, canvasAuthorPhotoAlt: `canvas.author-photo-alt` };
|
|
4834
|
-
var
|
|
4835
|
-
let n2 = (n3) => (r2) => e6(n3, { count: r2, formatted:
|
|
4857
|
+
var Kd = (e6, t2) => {
|
|
4858
|
+
let n2 = (n3) => (r2) => e6(n3, { count: r2, formatted: Gd(r2, `full`, t2) });
|
|
4836
4859
|
return { timeToRead: (t3) => e6(Q.timeToRead, { count: t3 }), viewCount: n2(Q.viewCount), commentCount: n2(Q.commentCount), likeCount: n2(Q.likeCount), noPostsEmptyState: () => ({ title: e6(Q.noPostsTitle), description: e6(Q.noPostsDescription) }), noRelatedPostsEmptyState: () => ({ title: e6(Q.noRelatedPostsTitle), description: e6(Q.noRelatedPostsDescription) }), canvas: { postTitle: () => e6(Q.canvasPostTitle), authorName: () => e6(Q.canvasAuthorName), excerpt: () => e6(Q.canvasExcerpt), content: () => e6(Q.canvasContent), category: () => e6(Q.canvasCategory), categoryNumbered: (t3) => e6(Q.canvasCategoryNumbered, { number: t3 }), tagNumbered: (t3) => e6(Q.canvasTagNumbered, { number: t3 }), coverAlt: () => e6(Q.canvasCoverAlt), authorPhotoAlt: () => e6(Q.canvasAuthorPhotoAlt) } };
|
|
4837
4860
|
};
|
|
4838
|
-
var
|
|
4839
|
-
var
|
|
4861
|
+
var qd = (e6) => ({ href: e6 ?? `#`, target: `_self` });
|
|
4862
|
+
var Jd = (e6) => {
|
|
4840
4863
|
if (!e6) return;
|
|
4841
4864
|
let t2 = e6 instanceof Date ? e6 : new Date(e6);
|
|
4842
4865
|
return Number.isFinite(t2.getTime()) ? t2.toISOString() : void 0;
|
|
4843
4866
|
};
|
|
4844
|
-
var
|
|
4845
|
-
var
|
|
4846
|
-
var $ = (e6) => ({ text: e6, html: `<p>${
|
|
4847
|
-
var
|
|
4848
|
-
var
|
|
4849
|
-
var
|
|
4850
|
-
var
|
|
4851
|
-
var
|
|
4852
|
-
var
|
|
4867
|
+
var Yd = (e6) => typeof e6 == `number` && e6 > 0 ? e6 : void 0;
|
|
4868
|
+
var Xd = (e6) => e6.replace(/&/g, `&`).replace(/</g, `<`).replace(/>/g, `>`).replace(/"/g, `"`).replace(/'/g, `'`);
|
|
4869
|
+
var $ = (e6) => ({ text: e6, html: `<p>${Xd(e6)}</p>`, linkList: [] });
|
|
4870
|
+
var Zd = 6e4;
|
|
4871
|
+
var Qd = Zd * 60;
|
|
4872
|
+
var $d = Qd * 24;
|
|
4873
|
+
var ef = $d * 7;
|
|
4874
|
+
var tf = (e6) => e6 < Zd ? [`second`, e6 / 1e3] : e6 < Qd ? [`minute`, e6 / Zd] : e6 < $d ? [`hour`, e6 / Qd] : [`day`, e6 / $d];
|
|
4875
|
+
var nf = (e6, t2, n2 = Date.now()) => {
|
|
4853
4876
|
let r2 = e6 instanceof Date ? e6 : new Date(e6), i2 = n2 - r2.getTime();
|
|
4854
|
-
if (i2 >= 0 && i2 <
|
|
4855
|
-
let [e7, n3] =
|
|
4877
|
+
if (i2 >= 0 && i2 < ef) {
|
|
4878
|
+
let [e7, n3] = tf(i2);
|
|
4856
4879
|
return new Intl.RelativeTimeFormat(t2).format(-Math.round(n3), e7);
|
|
4857
4880
|
}
|
|
4858
4881
|
let a2 = r2.getFullYear() === new Date(n2).getFullYear();
|
|
4859
4882
|
return new Intl.DateTimeFormat(t2, { ...a2 ? {} : { year: `numeric` }, month: `short`, day: `numeric` }).format(r2);
|
|
4860
4883
|
};
|
|
4861
|
-
var
|
|
4862
|
-
var
|
|
4863
|
-
var
|
|
4884
|
+
var rf = `https://static.wixstatic.com/media/`;
|
|
4885
|
+
var af = `wix:video://`;
|
|
4886
|
+
var of = (e6) => {
|
|
4864
4887
|
if (!e6) return;
|
|
4865
4888
|
let t2 = Number.parseInt(e6, 10);
|
|
4866
4889
|
return Number.isFinite(t2) && t2 > 0 ? t2 : void 0;
|
|
4867
4890
|
};
|
|
4868
|
-
var
|
|
4869
|
-
if (!e6.startsWith(
|
|
4891
|
+
var sf = (e6) => {
|
|
4892
|
+
if (!e6.startsWith(af)) return;
|
|
4870
4893
|
let [t2, n2] = e6.slice(12).split(`#`), [, r2] = t2.split(`/`).filter(Boolean);
|
|
4871
4894
|
if (!r2) return;
|
|
4872
4895
|
let i2 = new URLSearchParams(n2 ?? ``), a2 = i2.get(`posterUri`);
|
|
4873
|
-
return { id: decodeURIComponent(r2), posterUrl: a2 ? `${
|
|
4896
|
+
return { id: decodeURIComponent(r2), posterUrl: a2 ? `${rf}${a2}` : void 0, posterWidth: of(i2.get(`posterWidth`)), posterHeight: of(i2.get(`posterHeight`)) };
|
|
4874
4897
|
};
|
|
4875
|
-
var
|
|
4876
|
-
var
|
|
4877
|
-
var
|
|
4898
|
+
var cf = [/https?:\/\/(?:www\.|m\.)?youtube\.com\/watch\?(?:[^#]*&)?v=([\w-]+)/i, /https?:\/\/(?:www\.)?youtube\.com\/embed\/([\w-]+)/i, /https?:\/\/youtu\.be\/([\w-]+)/i];
|
|
4899
|
+
var lf = [/https?:\/\/player\.vimeo\.com\/video\/(\d+)/i, /https?:\/\/vimeo\.com\/(\d+)/i];
|
|
4900
|
+
var uf = (e6, t2) => {
|
|
4878
4901
|
for (let n2 of e6) {
|
|
4879
4902
|
let e7 = n2.exec(t2);
|
|
4880
4903
|
if (e7) return e7[1];
|
|
4881
4904
|
}
|
|
4882
4905
|
};
|
|
4883
|
-
var
|
|
4884
|
-
let t2 =
|
|
4906
|
+
var df = (e6) => {
|
|
4907
|
+
let t2 = uf(cf, e6);
|
|
4885
4908
|
if (t2) return { provider: `youtube`, embedUrl: `https://www.youtube.com/embed/${t2}?autoplay=1` };
|
|
4886
|
-
let n2 =
|
|
4909
|
+
let n2 = uf(lf, e6);
|
|
4887
4910
|
return n2 ? { provider: `vimeo`, embedUrl: `https://player.vimeo.com/video/${n2}?autoplay=1` } : { provider: `unknown` };
|
|
4888
4911
|
};
|
|
4889
|
-
var
|
|
4912
|
+
var ff = (e6, t2 = []) => {
|
|
4890
4913
|
let n2 = e6?.media;
|
|
4891
4914
|
if (!n2 || n2.displayed === false) return;
|
|
4892
4915
|
let r2 = io(e6);
|
|
4893
4916
|
if (r2) return { kind: `image`, image: r2 };
|
|
4894
|
-
let i2 = n2.altText ?? e6?.title ?? ``, a2 = n2.wixMedia?.videoV2 ?
|
|
4917
|
+
let i2 = n2.altText ?? e6?.title ?? ``, a2 = n2.wixMedia?.videoV2 ? sf(n2.wixMedia.videoV2) : void 0;
|
|
4895
4918
|
if (a2) return { kind: `wixVideo`, ...a2, sources: t2, altText: i2 };
|
|
4896
4919
|
let o2 = n2.embedMedia?.video?.url;
|
|
4897
4920
|
if (o2) {
|
|
4898
4921
|
let { thumbnail: e7 } = n2.embedMedia ?? {};
|
|
4899
|
-
return { kind: `embed`, videoUrl: o2, ...
|
|
4922
|
+
return { kind: `embed`, videoUrl: o2, ...df(o2), thumbnailUrl: e7?.url, thumbnailWidth: e7?.width, thumbnailHeight: e7?.height, altText: i2 };
|
|
4900
4923
|
}
|
|
4901
4924
|
};
|
|
4902
|
-
var
|
|
4925
|
+
var pf = (e6) => {
|
|
4903
4926
|
let t2 = io(e6), n2 = e6?.media?.wixMedia?.videoV2;
|
|
4904
4927
|
if (t2 || !n2) return t2;
|
|
4905
|
-
let r2 =
|
|
4928
|
+
let r2 = sf(n2), i2 = ro(r2?.posterUrl?.slice(35), e6?.media?.altText ?? e6?.title);
|
|
4906
4929
|
return i2 && { ...i2, width: r2?.posterWidth ?? i2.width, height: r2?.posterHeight ?? i2.height };
|
|
4907
4930
|
};
|
|
4908
|
-
var
|
|
4909
|
-
var
|
|
4910
|
-
let n2 =
|
|
4931
|
+
var mf = (e6, t2) => e6 && t2 ? `${e6}/${encodeURIComponent(t2)}` : void 0;
|
|
4932
|
+
var hf = (e6, t2) => {
|
|
4933
|
+
let n2 = mf(e6, t2);
|
|
4911
4934
|
return n2 ? { href: n2, target: `_self` } : void 0;
|
|
4912
4935
|
};
|
|
4913
|
-
var
|
|
4914
|
-
var
|
|
4936
|
+
var gf = { href: `#`, target: `_self` };
|
|
4937
|
+
var _f = (e6, t2) => {
|
|
4915
4938
|
let { _id: n2, label: r2, slug: i2 } = e6, a2 = r2 ?? ``;
|
|
4916
|
-
return { _id: n2 ?? i2 ?? ``, label: a2, itemCategoryLabel: $(a2), itemCategoryLink:
|
|
4939
|
+
return { _id: n2 ?? i2 ?? ``, label: a2, itemCategoryLabel: $(a2), itemCategoryLink: hf(t2, i2 ?? ``), categoryItem: { label: a2, slug: i2 ?? `` } };
|
|
4917
4940
|
};
|
|
4918
|
-
var
|
|
4919
|
-
var
|
|
4941
|
+
var vf = 2;
|
|
4942
|
+
var yf = (e6) => Array.from({ length: vf }, (t2, n2) => {
|
|
4920
4943
|
let r2 = e6.canvas.categoryNumbered(n2 + 1);
|
|
4921
|
-
return { _id: `placeholder-category-${n2}`, label: r2, itemCategoryLabel: $(r2), itemCategoryLink:
|
|
4944
|
+
return { _id: `placeholder-category-${n2}`, label: r2, itemCategoryLabel: $(r2), itemCategoryLink: gf, categoryItem: { label: r2, slug: `` } };
|
|
4922
4945
|
});
|
|
4923
|
-
var
|
|
4946
|
+
var bf = (e6, t2) => {
|
|
4924
4947
|
let { _id: n2, label: r2, slug: i2 } = e6, a2 = r2 ?? ``;
|
|
4925
|
-
return { _id: n2 ?? i2 ?? ``, label: a2, itemTagLabel: $(a2), itemTagLink:
|
|
4948
|
+
return { _id: n2 ?? i2 ?? ``, label: a2, itemTagLabel: $(a2), itemTagLink: hf(t2, i2 ?? ``), tagItem: { label: a2, slug: i2 ?? `` } };
|
|
4926
4949
|
};
|
|
4927
|
-
var
|
|
4928
|
-
var
|
|
4950
|
+
var xf = 3;
|
|
4951
|
+
var Sf = (e6) => Array.from({ length: xf }, (t2, n2) => {
|
|
4929
4952
|
let r2 = e6.canvas.tagNumbered(n2 + 1);
|
|
4930
|
-
return { _id: `placeholder-tag-${n2}`, label: r2, itemTagLabel: $(r2), itemTagLink:
|
|
4953
|
+
return { _id: `placeholder-tag-${n2}`, label: r2, itemTagLabel: $(r2), itemTagLink: gf, tagItem: { label: r2, slug: `` } };
|
|
4931
4954
|
});
|
|
4932
|
-
var
|
|
4933
|
-
var
|
|
4934
|
-
var
|
|
4935
|
-
var
|
|
4936
|
-
var
|
|
4937
|
-
var
|
|
4938
|
-
var
|
|
4939
|
-
var
|
|
4940
|
-
var
|
|
4941
|
-
let { t: a2 } = Hl(), o2 =
|
|
4955
|
+
var Cf = 1;
|
|
4956
|
+
var wf = { views: 120, comments: 4, likes: 12 };
|
|
4957
|
+
var Tf = (e6) => ({ nodes: [{ type: `PARAGRAPH`, nodes: [{ type: `TEXT`, nodes: [], textData: { text: e6, decorations: [] } }] }] });
|
|
4958
|
+
var Ef = (e6, t2, n2, r2) => $(e6 === void 0 ? n2 ? r2(t2) : `` : r2(e6));
|
|
4959
|
+
var Df = (e6, t2, n2) => e6 ?? (n2 ? t2 : void 0);
|
|
4960
|
+
var Of = { nodes: [] };
|
|
4961
|
+
var kf = () => ({ title: $(``), excerpt: $(``), coverImage: void 0, coverMedia: void 0, richContent: Of, authorName: $(``), authorImage: void 0, timeToRead: $(``), publishedDate: $(``), viewCount: $(``), commentCount: $(``), likeCount: $(``), postCategories: [], itemCategoryLabel: $(``), postTags: [], hasCoverImage: false, hasExcerpt: false, hasTags: false, publishedDateValue: void 0, minutesToReadValue: void 0, viewCountValue: void 0, commentCountValue: void 0 });
|
|
4962
|
+
var Af = ({ post: e6, author: t2, metrics: n2, categories: r2, tags: i2, videoSources: a2 }, o2, s2, c2 = false, l2 = Date.now(), u2 = {}) => !e6 && !c2 ? kf() : { title: $(e6?.title ?? o2.canvas.postTitle()), excerpt: $(e6?.excerpt ?? o2.canvas.excerpt()), coverImage: pf(e6), coverMedia: ff(e6, a2), richContent: e6?.richContent ?? Tf(o2.canvas.content()), authorName: $(t2?.profile?.nickname ?? o2.canvas.authorName()), authorImage: Xa(t2, o2.canvas.authorPhotoAlt()), timeToRead: $(typeof e6?.minutesToRead == `number` && e6.minutesToRead > 0 ? o2.timeToRead(e6.minutesToRead) : c2 ? o2.timeToRead(Cf) : ``), publishedDate: $(nf(e6?.firstPublishedDate ?? new Date(l2), s2, l2)), viewCount: Ef(n2?.views, wf.views, c2, o2.viewCount), commentCount: Ef(n2?.comments, wf.comments, c2, o2.commentCount), likeCount: Ef(n2?.likes, wf.likes, c2, o2.likeCount), postCategories: r2.length === 0 && c2 ? yf(o2) : r2.map((e7) => _f(e7, u2.category)), itemCategoryLabel: $(r2[0]?.label ?? (c2 ? o2.canvas.category() : ``)), postTags: i2.length === 0 && c2 ? Sf(o2) : i2.map((e7) => bf(e7, u2.tag)), hasCoverImage: !e6 || e6.media?.displayed !== false && pf(e6) !== void 0, hasExcerpt: !e6 || !!e6.excerpt?.trim(), hasTags: !e6 || i2.length > 0, publishedDateValue: Jd(e6?.firstPublishedDate) ?? (c2 ? `2026-05-12T12:00:00.000Z` : void 0), minutesToReadValue: Yd(e6?.minutesToRead) ?? (c2 ? Cf : void 0), viewCountValue: Df(n2?.views, wf.views, c2), commentCountValue: Df(n2?.comments, wf.comments, c2) };
|
|
4963
|
+
var jf = ({ postWithAuthor: e6, hasError: t2, monitoringClient: n2, isPostInPreview: r2, postPageBase: i2 }) => {
|
|
4964
|
+
let { t: a2 } = Hl(), o2 = Wd(), s2 = (0, import_react.useMemo)(() => Kd(a2, o2), [a2, o2]), c2 = Od(e6.fetchedAt), l2 = Zn(), { isLiked: d2, likeCount: f2, isLikeCountLoaded: p2, viewCount: m2, commentCount: h2, toggleLike: g2, liveLikes: _2 } = Ud(e6.post?._id ?? void 0, e6.metrics?.likes ?? 0, r2, n2), v2 = Ed(xa), y2 = Ed(`tag`), b2 = (0, import_react.useMemo)(() => fd(e6.post), [e6]), x2 = Mo(), S2 = (0, import_react.useMemo)(() => e6.post?.richContent && e6.paywall ? Ao(e6.post.richContent, e6.paywall, x2) : void 0, [e6, x2]);
|
|
4942
4965
|
return (0, import_react.useMemo)(() => {
|
|
4943
|
-
let n3 =
|
|
4966
|
+
let n3 = Af(!e6.post && l2 && e6.demoPost ? { ...e6, post: e6.demoPost } : e6, s2, o2, l2, c2, { category: v2, tag: y2 }), a3 = r2 || !e6.post ? void 0 : Aa(e6.post, i2), u2 = a3 ?? (l2 ? qd(i2) : void 0);
|
|
4944
4967
|
return { ...n3, ...S2 && { richContent: S2 }, relatedPostsSource: b2, commentingEnabled: e6.post?.commentingEnabled ?? void 0, viewCountValue: m2 ?? n3.viewCountValue, commentCountValue: h2 ?? n3.commentCountValue, itemLink: u2, postUrl: a3?.href, ...e6.post && (e6.metrics?.likes !== void 0 || p2) ? { likeCount: $(s2.likeCount(f2)) } : {}, isLiked: d2, likeCountValue: f2, isLikeCountLoaded: p2, toggleLike: g2, liveLikes: _2, clockValue: c2, isLoadingPost: false, hasError: t2, isEmpty: !e6.post && !l2 };
|
|
4945
4968
|
}, [e6, t2, b2, S2, s2, o2, c2, f2, d2, p2, m2, h2, g2, _2, l2, r2, i2, v2, y2]);
|
|
4946
4969
|
};
|
|
4947
|
-
var
|
|
4948
|
-
var
|
|
4949
|
-
var
|
|
4970
|
+
var Mf = (e6) => ({ post: e6, hasError: false });
|
|
4971
|
+
var Nf = () => ({ post: { post: void 0, author: void 0, metrics: void 0, categories: [], tags: [], fetchedAt: Date.now() }, hasError: true });
|
|
4972
|
+
var Pf = (e6) => {
|
|
4950
4973
|
throw e6;
|
|
4951
4974
|
};
|
|
4952
|
-
var
|
|
4975
|
+
var Ff = { ...kf(), isLiked: false, likeCountValue: 0, isLikeCountLoaded: false, toggleLike: async () => {
|
|
4953
4976
|
}, liveLikes: void 0, postUrl: void 0, itemLink: void 0, clockValue: 0, relatedPostsSource: { currentPostId: void 0, categoryIds: void 0, relatedPostIds: void 0 }, commentingEnabled: void 0, isLoadingPost: true, hasError: false, isEmpty: false };
|
|
4954
|
-
var
|
|
4955
|
-
function
|
|
4977
|
+
var If = { ...Ff, isLoadingPost: false, hasError: true, isEmpty: true };
|
|
4978
|
+
function Lf() {
|
|
4956
4979
|
return (0, import_post_context_provider.usePostContext)();
|
|
4957
4980
|
}
|
|
4958
|
-
var
|
|
4959
|
-
var
|
|
4960
|
-
var
|
|
4981
|
+
var Rf = ({ source: e6, children: t2 }) => (0, import_jsx_runtime.jsx)(Td.Provider, { value: void 0, children: (0, import_jsx_runtime.jsx)(wd.Provider, { value: e6, children: t2 }) });
|
|
4982
|
+
var zf = 2500;
|
|
4983
|
+
var Bf = ({ children: t2, postLoadPromise: n2, relatedSourcePromise: r2, monitoringClient: i2, slug: a2, language: o2, isPostInPreview: c2 }) => {
|
|
4961
4984
|
let { post: l2, hasError: u2 } = Vn(n2), d2 = va(l2, (0, import_react.useCallback)(() => $u(a2, false, o2), [a2, o2]));
|
|
4962
4985
|
bo(d2, c2, i2), Po(a2 && d2.post?.slug === a2 && !c2 ? d2.post : void 0, o2, pd);
|
|
4963
4986
|
let { _id: f2 } = d2.post ?? {};
|
|
4964
4987
|
fa(c2 ? void 0 : f2 ?? void 0);
|
|
4965
|
-
let p2 =
|
|
4966
|
-
return Ba(Ra.postBySlugProvider, u2 ? `error` : d2.post ? `data` : `empty`), (0, import_jsx_runtime.jsx)(import_post_context_provider.default, { value: p2, children: (0, import_jsx_runtime.jsx)(
|
|
4988
|
+
let p2 = jf({ postWithAuthor: d2, hasError: u2, monitoringClient: i2, isPostInPreview: c2, postPageBase: Ma(a2) });
|
|
4989
|
+
return Ba(Ra.postBySlugProvider, u2 ? `error` : d2.post ? `data` : `empty`), (0, import_jsx_runtime.jsx)(import_post_context_provider.default, { value: p2, children: (0, import_jsx_runtime.jsx)(Rf, { source: r2, children: t2 }) });
|
|
4967
4990
|
};
|
|
4968
|
-
function
|
|
4991
|
+
function Vf({ children: t2 }) {
|
|
4969
4992
|
let n2 = Fa(), i2 = La(), a2 = Co(), o2 = pa(), { draftPostId: s2, instance: c2 } = n2 ?? {}, l2 = Zn(), d2 = Io(), f2 = (0, import_react.useMemo)(() => Wa(zn), []), { i18n: p2, locale: m2 } = du(yu), _2 = ha(() => {
|
|
4970
4993
|
let e6 = s2 && c2 ? hd(Cd({ draftPostId: s2, instance: c2 }, o2)) : Ql({ key: i2 ? `blog-builder:post:${i2}|${a2 ?? ``}` : null, warmupData: d2, fetchData: () => {
|
|
4971
4994
|
let e7 = ud(i2, o2, a2).then((e8) => l2 ? sd(e8, a2) : e8);
|
|
4972
|
-
return hd(qa(f2, `post-read`, { feature: Ua.post }, o2 ? Gu(e7,
|
|
4995
|
+
return hd(qa(f2, `post-read`, { feature: Ua.post }, o2 ? Gu(e7, zf, `post`) : e7));
|
|
4973
4996
|
} }), t3 = e6.then(({ post: e7 }) => fd(e7));
|
|
4974
4997
|
return t3.catch(() => {
|
|
4975
|
-
}), { slug: i2, language: a2, isPostInPreview: !!s2, postLoadPromise: Un(e6,
|
|
4998
|
+
}), { slug: i2, language: a2, isPostInPreview: !!s2, postLoadPromise: Un(e6, Mf, o2 ? Pf : Nf), relatedSourcePromise: t3 };
|
|
4976
4999
|
}, [s2, c2, a2, i2, o2, l2, d2, f2]);
|
|
4977
|
-
return (0, import_jsx_runtime.jsx)(Ul, { i18n: p2, children: (0, import_jsx_runtime.jsxs)(import_react.Suspense, { fallback: (0, import_jsx_runtime.jsx)(import_post_context_provider.default, { value:
|
|
5000
|
+
return (0, import_jsx_runtime.jsx)(Ul, { i18n: p2, children: (0, import_jsx_runtime.jsxs)(import_react.Suspense, { fallback: (0, import_jsx_runtime.jsx)(import_post_context_provider.default, { value: Ff, children: (0, import_jsx_runtime.jsx)(Rf, { source: _2.relatedSourcePromise, children: t2 }) }), children: [(0, import_jsx_runtime.jsx)(uu, { i18n: p2, locale: m2 }), (0, import_jsx_runtime.jsx)(md, { fallback: (0, import_jsx_runtime.jsx)(import_post_context_provider.default, { value: If, children: (0, import_jsx_runtime.jsx)(Rf, { source: _2.relatedSourcePromise, children: t2 }) }), feature: Ua.post, monitoringClient: f2, rethrow: o2, children: (0, import_jsx_runtime.jsx)(Bf, { postLoadPromise: _2.postLoadPromise, relatedSourcePromise: _2.relatedSourcePromise, monitoringClient: f2, slug: _2.isPostInPreview ? void 0 : _2.slug, language: _2.language, isPostInPreview: _2.isPostInPreview, children: t2 }) })] }) });
|
|
4978
5001
|
}
|
|
4979
|
-
var
|
|
5002
|
+
var Hf = Mn(`12ed204c-821c-4ce9-802b-8bfe8e98d7e2`);
|
|
4980
5003
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4981
5004
|
0 && (module.exports = {
|
|
4982
5005
|
PostBySlugProvider,
|