@wix/blog 1.0.697 → 1.0.698
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-context-provider/runtime.js +3 -3
- package/_sdk-exports/context-post-by-id-context-provider/runtime.js +4 -4
- package/_sdk-exports/context-post-context-provider/runtime.js +2 -2
- package/_sdk-exports/context-related-posts-context-provider/runtime.js +4 -4
- package/build/cjs/context-blog-feed-context-provider.js +195 -180
- package/build/cjs/context-blog-feed-context-provider.js.map +1 -1
- package/build/cjs/context-post-by-id-context-provider.js +474 -467
- package/build/cjs/context-post-by-id-context-provider.js.map +1 -1
- package/build/cjs/context-post-context-provider.js +208 -192
- package/build/cjs/context-post-context-provider.js.map +1 -1
- package/build/cjs/context-related-posts-context-provider.js +773 -757
- package/build/cjs/context-related-posts-context-provider.js.map +1 -1
- package/build/es/context-blog-feed-context-provider.mjs +195 -180
- package/build/es/context-blog-feed-context-provider.mjs.map +1 -1
- package/build/es/context-post-by-id-context-provider.mjs +474 -467
- package/build/es/context-post-by-id-context-provider.mjs.map +1 -1
- package/build/es/context-post-context-provider.mjs +208 -192
- package/build/es/context-post-context-provider.mjs.map +1 -1
- package/build/es/context-related-posts-context-provider.mjs +773 -757
- package/build/es/context-related-posts-context-provider.mjs.map +1 -1
- package/package.json +4 -4
|
@@ -20,10 +20,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// context-post-context-provider.ts
|
|
21
21
|
var context_post_context_provider_exports = {};
|
|
22
22
|
__export(context_post_context_provider_exports, {
|
|
23
|
-
PostProvider: () =>
|
|
24
|
-
default: () =>
|
|
25
|
-
injectAccessTokenGetter: () =>
|
|
26
|
-
usePostContext: () =>
|
|
23
|
+
PostProvider: () => Yh,
|
|
24
|
+
default: () => Yh,
|
|
25
|
+
injectAccessTokenGetter: () => Xh,
|
|
26
|
+
usePostContext: () => Hh
|
|
27
27
|
});
|
|
28
28
|
module.exports = __toCommonJS(context_post_context_provider_exports);
|
|
29
29
|
|
|
@@ -4938,19 +4938,33 @@ var Lp = (e6, t2) => {
|
|
|
4938
4938
|
return n2 ? Promise.resolve(n2) : Promise.reject(Error(`no messages file`));
|
|
4939
4939
|
};
|
|
4940
4940
|
var Rp = eu({ isDev: false, loadMessages: (e6) => Lp(e6, ``), loadDevMessages: (e6) => Lp(e6, `.dev`) });
|
|
4941
|
-
var zp = [{ path: `
|
|
4942
|
-
|
|
4941
|
+
var zp = (e6) => E(O(e6, [{ transformFn: L, paths: [{ path: `posts.url` }, { path: `posts.translations.url` }] }, { transformFn: I, paths: [{ path: `posts.heroImage` }, { path: `posts.media.wixMedia.image` }] }, { transformFn: R, paths: [{ path: `posts.media.wixMedia.videoV2` }] }]), [`posts.richContent`, `posts.rich_content`]).posts ?? [];
|
|
4942
|
+
var Bp = `https://blog.wixsite.com/blog-demo-posts`;
|
|
4943
|
+
var Vp = A((e6) => async (t2) => {
|
|
4944
|
+
let n2 = await e6.fetchWithAuth(`${globalThis.location.origin}/_serverless/blog-demo-posts/v3/demo-posts?${j(t2)}`);
|
|
4945
|
+
if (!n2.ok) throw Error(`ListDemoPosts answered ${n2.status}`);
|
|
4946
|
+
return zp(await n2.json()).filter((e7) => !e7.url?.startsWith(Bp));
|
|
4947
|
+
});
|
|
4948
|
+
var Hp = async (e6) => {
|
|
4949
|
+
try {
|
|
4950
|
+
return await Vp(e6);
|
|
4951
|
+
} catch (e7) {
|
|
4952
|
+
return console.info(`[blog demo posts]`, `read failed`, e7), [];
|
|
4953
|
+
}
|
|
4954
|
+
};
|
|
4955
|
+
var Up = [{ path: `member.createdDate` }, { path: `member.updatedDate` }, { path: `member.lastLoginDate` }];
|
|
4956
|
+
function Wp(e6) {
|
|
4943
4957
|
return M(Object.assign(e6, { domainToMappings: { "www.wixapis.com": [{ srcPath: `/members/v1/members`, destPath: `/v1/members` }], "api._api_base_domain_": [{ srcPath: `/members-ng-api`, destPath: `` }], "www._base_domain_": [{ srcPath: `/_api/members/v1/members`, destPath: `/v1/members` }], "manage._base_domain_": [{ srcPath: `/_api/members/v1/members`, destPath: `/v1/members` }], "editor._base_domain_": [{ srcPath: `/_api/members/v1/members`, destPath: `/v1/members` }], "blocks._base_domain_": [{ srcPath: `/_api/members/v1/members`, destPath: `/v1/members` }], "create.editorx": [{ srcPath: `/_api/members/v1/members`, destPath: `/v1/members` }], "editor.wixapps.net": [{ srcPath: `/_api/members/v1/members`, destPath: `/v1/members` }], "*.dev.wix-code.com": [{ srcPath: `/_api/members/v1/members`, destPath: `/v1/members` }], "bo._base_domain_": [{ srcPath: `/_api/members/v1/members`, destPath: `/v1/members` }], "wixbo.ai": [{ srcPath: `/_api/members/v1/members`, destPath: `/v1/members` }], "wix-bo.com": [{ srcPath: `/_api/members/v1/members`, destPath: `/v1/members` }], _: [{ srcPath: `/_api/members/v1/members`, destPath: `/v1/members` }], "members.wixapps.net": [{ srcPath: `/_api/members/v1/members`, destPath: `/v1/members` }] } }));
|
|
4944
4958
|
}
|
|
4945
|
-
var
|
|
4946
|
-
function
|
|
4959
|
+
var Gp = `@wix/auto_sdk_members_members`;
|
|
4960
|
+
function Kp(e6) {
|
|
4947
4961
|
function t2({ host: t3 }) {
|
|
4948
|
-
return { entityFqdn: `wix.members.v1.member`, method: `GET`, methodFqn: `com.wixpress.members.api.Members.GetMember`, packageName:
|
|
4962
|
+
return { entityFqdn: `wix.members.v1.member`, method: `GET`, methodFqn: `com.wixpress.members.api.Members.GetMember`, packageName: Gp, migrationOptions: { optInTransformResponse: true }, url: Wp({ protoPath: `/v1/members/{id}`, data: e6, host: t3 }), params: j(e6), transformResponse: (e7) => O(e7, [{ transformFn: D, paths: Up }]) };
|
|
4949
4963
|
}
|
|
4950
4964
|
return t2;
|
|
4951
4965
|
}
|
|
4952
|
-
async function
|
|
4953
|
-
let { httpClient: n2, sideEffects: r2 } = arguments[2], i2 =
|
|
4966
|
+
async function qp(e6, t2) {
|
|
4967
|
+
let { httpClient: n2, sideEffects: r2 } = arguments[2], i2 = Kp(T({ id: e6, fieldsets: t2?.fieldsets }));
|
|
4954
4968
|
r2?.onSiteCall?.();
|
|
4955
4969
|
try {
|
|
4956
4970
|
let e7 = await n2.request(i2);
|
|
@@ -4960,43 +4974,43 @@ async function Up(e6, t2) {
|
|
|
4960
4974
|
throw r2?.onError?.(e7), t3;
|
|
4961
4975
|
}
|
|
4962
4976
|
}
|
|
4963
|
-
function
|
|
4964
|
-
return (t2, n2) =>
|
|
4977
|
+
function Jp(e6) {
|
|
4978
|
+
return (t2, n2) => qp(t2, n2, { httpClient: e6 });
|
|
4965
4979
|
}
|
|
4966
|
-
var
|
|
4967
|
-
var
|
|
4980
|
+
var Yp = A(Jp);
|
|
4981
|
+
var Xp = async (e6) => {
|
|
4968
4982
|
try {
|
|
4969
|
-
return await
|
|
4983
|
+
return await Yp(e6, { fieldsets: [`PUBLIC`] });
|
|
4970
4984
|
} catch {
|
|
4971
4985
|
return;
|
|
4972
4986
|
}
|
|
4973
4987
|
};
|
|
4974
|
-
var
|
|
4975
|
-
var
|
|
4976
|
-
var Yp = [{ path: `posts.heroImage.focalPoint.x` }, { path: `posts.heroImage.focalPoint.y` }, { path: `posts.media.wixMedia.image.focalPoint.x` }, { path: `posts.media.wixMedia.image.focalPoint.y` }, { path: `posts.media.wixMedia.videoV2.resolutions.poster.focalPoint.x` }, { path: `posts.media.wixMedia.videoV2.resolutions.poster.focalPoint.y` }, { path: `posts.media.wixMedia.videoV2.posters.focalPoint.x` }, { path: `posts.media.wixMedia.videoV2.posters.focalPoint.y` }, { path: `posts.metrics.averageRating` }, { path: `posts.richContent.nodes.buttonData.styles.background.gradient.centerX` }, { path: `posts.richContent.nodes.buttonData.styles.background.gradient.centerY` }, { path: `posts.richContent.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `posts.richContent.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `posts.richContent.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `posts.richContent.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `posts.richContent.nodes.galleryData.items.image.media.duration` }, { path: `posts.richContent.nodes.galleryData.items.video.media.duration` }, { path: `posts.richContent.nodes.galleryData.items.video.thumbnail.duration` }, { path: `posts.richContent.nodes.galleryData.options.item.ratio` }, { path: `posts.richContent.nodes.imageData.image.duration` }, { path: `posts.richContent.nodes.imageData.crop.x` }, { path: `posts.richContent.nodes.imageData.crop.y` }, { path: `posts.richContent.nodes.imageData.crop.width` }, { path: `posts.richContent.nodes.imageData.crop.height` }, { path: `posts.richContent.nodes.mapData.mapSettings.lat` }, { path: `posts.richContent.nodes.mapData.mapSettings.lng` }, { path: `posts.richContent.nodes.pollData.poll.image.duration` }, { path: `posts.richContent.nodes.pollData.poll.options.image.duration` }, { path: `posts.richContent.nodes.pollData.design.poll.background.image.duration` }, { path: `posts.richContent.nodes.textData.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.nodes.textData.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.nodes.textData.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.nodes.textData.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.nodes.textData.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.nodes.textData.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `posts.richContent.nodes.appEmbedData.image.duration` }, { path: `posts.richContent.nodes.videoData.video.duration` }, { path: `posts.richContent.nodes.videoData.thumbnail.duration` }, { path: `posts.richContent.nodes.audioData.audio.duration` }, { path: `posts.richContent.nodes.audioData.coverImage.duration` }, { path: `posts.richContent.nodes.layoutData.backgroundImage.media.duration` }, { path: `posts.richContent.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `posts.richContent.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `posts.richContent.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `posts.richContent.nodes.layoutData.backdropImage.media.duration` }, { path: `posts.richContent.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `posts.richContent.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `posts.richContent.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `posts.richContent.nodes.layoutData.background.gradient.centerX` }, { path: `posts.richContent.nodes.layoutData.background.gradient.centerY` }, { path: `posts.richContent.nodes.layoutData.background.gradient.stops.position` }, { path: `posts.richContent.nodes.layoutData.backdrop.gradient.centerX` }, { path: `posts.richContent.nodes.layoutData.backdrop.gradient.centerY` }, { path: `posts.richContent.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `posts.richContent.nodes.shapeData.shape.duration` }, { path: `posts.richContent.nodes.cardData.background.gradient.centerX` }, { path: `posts.richContent.nodes.cardData.background.gradient.centerY` }, { path: `posts.richContent.nodes.cardData.background.gradient.stops.position` }, { path: `posts.richContent.nodes.cardData.backgroundImage.media.duration` }, { path: `posts.richContent.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `posts.richContent.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `posts.richContent.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `posts.richContent.nodes.tocData.fontSize` }, { path: `posts.richContent.nodes.tocData.itemSpacing` }, { path: `posts.richContent.nodes.smartBlockCellData.shape.duration` }, { path: `posts.richContent.documentStyle.headerOne.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerOne.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerOne.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerOne.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerOne.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerOne.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerTwo.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerTwo.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerTwo.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerTwo.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerTwo.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerTwo.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerThree.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerThree.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerThree.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerThree.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerThree.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerThree.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerFour.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerFour.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerFour.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerFour.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerFour.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerFour.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerFive.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerFive.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerFive.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerFive.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerFive.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerFive.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerSix.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerSix.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerSix.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerSix.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerSix.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerSix.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.paragraph.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.paragraph.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.paragraph.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.paragraph.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.paragraph.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.paragraph.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.blockquote.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.blockquote.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.blockquote.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.blockquote.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.blockquote.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.blockquote.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.codeBlock.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.codeBlock.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.codeBlock.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.codeBlock.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.codeBlock.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.codeBlock.decorations.colorData.backgroundStyle.gradient.stops.position` }];
|
|
4977
|
-
var
|
|
4978
|
-
function
|
|
4988
|
+
var Zp = [{ path: `posts.firstPublishedDate` }, { path: `posts.lastPublishedDate` }, { path: `posts.heroImage.urlExpirationDate` }, { path: `posts.richContent.metadata.createdTimestamp` }, { path: `posts.richContent.metadata.updatedTimestamp` }, { path: `posts.moderationDetails.submittedDate` }, { path: `posts.moderationDetails.moderationDate` }, { path: `posts.media.wixMedia.image.urlExpirationDate` }, { path: `posts.media.wixMedia.videoV2.urlExpirationDate` }, { path: `posts.media.wixMedia.videoV2.resolutions.urlExpirationDate` }, { path: `posts.media.wixMedia.videoV2.resolutions.poster.urlExpirationDate` }, { path: `posts.media.wixMedia.videoV2.posters.urlExpirationDate` }];
|
|
4989
|
+
var Qp = [{ path: `posts.richContentCompressed` }];
|
|
4990
|
+
var $p = [{ path: `posts.heroImage.focalPoint.x` }, { path: `posts.heroImage.focalPoint.y` }, { path: `posts.media.wixMedia.image.focalPoint.x` }, { path: `posts.media.wixMedia.image.focalPoint.y` }, { path: `posts.media.wixMedia.videoV2.resolutions.poster.focalPoint.x` }, { path: `posts.media.wixMedia.videoV2.resolutions.poster.focalPoint.y` }, { path: `posts.media.wixMedia.videoV2.posters.focalPoint.x` }, { path: `posts.media.wixMedia.videoV2.posters.focalPoint.y` }, { path: `posts.metrics.averageRating` }, { path: `posts.richContent.nodes.buttonData.styles.background.gradient.centerX` }, { path: `posts.richContent.nodes.buttonData.styles.background.gradient.centerY` }, { path: `posts.richContent.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `posts.richContent.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `posts.richContent.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `posts.richContent.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `posts.richContent.nodes.galleryData.items.image.media.duration` }, { path: `posts.richContent.nodes.galleryData.items.video.media.duration` }, { path: `posts.richContent.nodes.galleryData.items.video.thumbnail.duration` }, { path: `posts.richContent.nodes.galleryData.options.item.ratio` }, { path: `posts.richContent.nodes.imageData.image.duration` }, { path: `posts.richContent.nodes.imageData.crop.x` }, { path: `posts.richContent.nodes.imageData.crop.y` }, { path: `posts.richContent.nodes.imageData.crop.width` }, { path: `posts.richContent.nodes.imageData.crop.height` }, { path: `posts.richContent.nodes.mapData.mapSettings.lat` }, { path: `posts.richContent.nodes.mapData.mapSettings.lng` }, { path: `posts.richContent.nodes.pollData.poll.image.duration` }, { path: `posts.richContent.nodes.pollData.poll.options.image.duration` }, { path: `posts.richContent.nodes.pollData.design.poll.background.image.duration` }, { path: `posts.richContent.nodes.textData.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.nodes.textData.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.nodes.textData.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.nodes.textData.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.nodes.textData.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.nodes.textData.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `posts.richContent.nodes.appEmbedData.image.duration` }, { path: `posts.richContent.nodes.videoData.video.duration` }, { path: `posts.richContent.nodes.videoData.thumbnail.duration` }, { path: `posts.richContent.nodes.audioData.audio.duration` }, { path: `posts.richContent.nodes.audioData.coverImage.duration` }, { path: `posts.richContent.nodes.layoutData.backgroundImage.media.duration` }, { path: `posts.richContent.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `posts.richContent.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `posts.richContent.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `posts.richContent.nodes.layoutData.backdropImage.media.duration` }, { path: `posts.richContent.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `posts.richContent.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `posts.richContent.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `posts.richContent.nodes.layoutData.background.gradient.centerX` }, { path: `posts.richContent.nodes.layoutData.background.gradient.centerY` }, { path: `posts.richContent.nodes.layoutData.background.gradient.stops.position` }, { path: `posts.richContent.nodes.layoutData.backdrop.gradient.centerX` }, { path: `posts.richContent.nodes.layoutData.backdrop.gradient.centerY` }, { path: `posts.richContent.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `posts.richContent.nodes.shapeData.shape.duration` }, { path: `posts.richContent.nodes.cardData.background.gradient.centerX` }, { path: `posts.richContent.nodes.cardData.background.gradient.centerY` }, { path: `posts.richContent.nodes.cardData.background.gradient.stops.position` }, { path: `posts.richContent.nodes.cardData.backgroundImage.media.duration` }, { path: `posts.richContent.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `posts.richContent.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `posts.richContent.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `posts.richContent.nodes.tocData.fontSize` }, { path: `posts.richContent.nodes.tocData.itemSpacing` }, { path: `posts.richContent.nodes.smartBlockCellData.shape.duration` }, { path: `posts.richContent.documentStyle.headerOne.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerOne.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerOne.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerOne.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerOne.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerOne.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerTwo.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerTwo.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerTwo.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerTwo.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerTwo.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerTwo.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerThree.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerThree.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerThree.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerThree.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerThree.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerThree.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerFour.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerFour.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerFour.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerFour.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerFour.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerFour.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerFive.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerFive.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerFive.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerFive.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerFive.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerFive.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerSix.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerSix.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerSix.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.headerSix.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.headerSix.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.headerSix.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.paragraph.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.paragraph.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.paragraph.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.paragraph.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.paragraph.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.paragraph.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.blockquote.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.blockquote.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.blockquote.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.blockquote.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.blockquote.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.blockquote.decorations.colorData.backgroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.codeBlock.decorations.colorData.foregroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.codeBlock.decorations.colorData.foregroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.codeBlock.decorations.colorData.foregroundStyle.gradient.stops.position` }, { path: `posts.richContent.documentStyle.codeBlock.decorations.colorData.backgroundStyle.gradient.centerX` }, { path: `posts.richContent.documentStyle.codeBlock.decorations.colorData.backgroundStyle.gradient.centerY` }, { path: `posts.richContent.documentStyle.codeBlock.decorations.colorData.backgroundStyle.gradient.stops.position` }];
|
|
4991
|
+
var em = [{ path: `sort.origin.latitude` }, { path: `sort.origin.longitude` }, { path: `query.sort.origin.latitude` }, { path: `query.sort.origin.longitude` }];
|
|
4992
|
+
function tm(e6) {
|
|
4979
4993
|
return M(Object.assign(e6, { domainToMappings: { _: [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }], "apps._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }], "www._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }], "www.wixapis.com": [{ srcPath: `/v3/posts`, destPath: `/v3/posts` }, { srcPath: `/blog/v3/posts`, destPath: `/v3/posts` }, { srcPath: `/_api/v3/posts`, destPath: `/v3/posts` }], "manage._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }, { srcPath: `/_api/post-service-api-proxy/v3/bulk/posts`, destPath: `/v3/bulk/posts` }], "*.dev.wix-code.com": [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }], "editor._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }], "blocks._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }], "create.editorx": [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }], "editor.wixapps.net": [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }], "dev._base_domain_": [{ srcPath: `/_api/communities-blog-node-api/v3/posts`, destPath: `/v3/posts` }] } }));
|
|
4980
4994
|
}
|
|
4981
|
-
var
|
|
4982
|
-
function
|
|
4995
|
+
var nm = `@wix/auto_sdk_blog_posts`;
|
|
4996
|
+
function rm(e6) {
|
|
4983
4997
|
function t2({ host: t3 }) {
|
|
4984
|
-
let n2 = O(e6, [{ transformFn: hn, paths:
|
|
4985
|
-
return { entityFqdn: `wix.blog.v3.post`, method: `POST`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.PostService.QueryPosts`, packageName:
|
|
4998
|
+
let n2 = O(e6, [{ transformFn: hn, paths: em }]);
|
|
4999
|
+
return { entityFqdn: `wix.blog.v3.post`, method: `POST`, methodFqn: `com.wixpress.npm.communities.platformized.blog.v3.PostService.QueryPosts`, packageName: nm, migrationOptions: { optInTransformResponse: true }, url: tm({ protoPath: `/v3/posts/query`, data: n2, host: t3 }), data: n2, transformResponse: (e7) => O(e7, [{ transformFn: D, paths: Zp }, { transformFn: gn, paths: Qp }, { transformFn: N, paths: $p }]) };
|
|
4986
5000
|
}
|
|
4987
5001
|
return t2;
|
|
4988
5002
|
}
|
|
4989
|
-
function
|
|
4990
|
-
let e6 =
|
|
5003
|
+
function im() {
|
|
5004
|
+
let e6 = rm({});
|
|
4991
5005
|
return { getUrl: (t2) => {
|
|
4992
5006
|
let { url: n2 } = e6(t2);
|
|
4993
5007
|
return n2;
|
|
4994
5008
|
}, httpMethod: `POST`, path: `/v3/posts/query`, pathParams: {}, __requestType: null, __originalRequestType: null, __responseType: null, __originalResponseType: null };
|
|
4995
5009
|
}
|
|
4996
|
-
var
|
|
4997
|
-
var
|
|
5010
|
+
var am = im();
|
|
5011
|
+
var om = (e6) => (t2) => ({ method: `POST`, url: am.getUrl(t2), data: { query: { filter: { id: { $in: e6 } }, paging: { limit: e6.length } } } });
|
|
4998
5012
|
A((e6) => async (t2) => {
|
|
4999
|
-
let { data: n2 } = await e6.request(
|
|
5013
|
+
let { data: n2 } = await e6.request(om(t2)), r2 = {};
|
|
5000
5014
|
for (let e7 of n2.posts ?? []) {
|
|
5001
5015
|
let { id: t3 } = e7, n3 = e7.media?.wixMedia?.videoV2?.resolutions;
|
|
5002
5016
|
if (!t3 || !n3?.length) continue;
|
|
@@ -5005,42 +5019,43 @@ A((e6) => async (t2) => {
|
|
|
5005
5019
|
}
|
|
5006
5020
|
return r2;
|
|
5007
5021
|
});
|
|
5008
|
-
var
|
|
5022
|
+
var sm = class extends Error {
|
|
5009
5023
|
constructor(e6, t2) {
|
|
5010
5024
|
super(`SSR fetch "${e6}" exceeded its ${t2}ms deadline`), this.name = `SsrDeadlineError`;
|
|
5011
5025
|
}
|
|
5012
5026
|
};
|
|
5013
|
-
var
|
|
5027
|
+
var cm = (e6, t2, n2) => {
|
|
5014
5028
|
let r2, i2 = new Promise((e7, i3) => {
|
|
5015
|
-
r2 = setTimeout(() => i3(new
|
|
5029
|
+
r2 = setTimeout(() => i3(new sm(n2, t2)), t2);
|
|
5016
5030
|
});
|
|
5017
5031
|
return Promise.race([e6, i2]).finally(() => clearTimeout(r2));
|
|
5018
5032
|
};
|
|
5019
|
-
var
|
|
5020
|
-
G.RICH_CONTENT, G.URL
|
|
5021
|
-
|
|
5033
|
+
var lm = [G.RICH_CONTENT, G.SEO, G.URL, G.CONTENT_TEXT, `TRANSLATIONS`];
|
|
5034
|
+
var um = [G.RICH_CONTENT, G.URL];
|
|
5035
|
+
G.URL, G.METRICS;
|
|
5036
|
+
var dm = (e6) => {
|
|
5022
5037
|
let { status: t2, details: n2 } = e6 ?? {};
|
|
5023
5038
|
return t2 === 404 || String(n2?.applicationError?.code ?? ``).includes(`NOT_FOUND`);
|
|
5024
5039
|
};
|
|
5025
|
-
var
|
|
5026
|
-
if (t2 && !
|
|
5040
|
+
var fm = (e6, t2) => {
|
|
5041
|
+
if (t2 && !dm(e6)) throw e6;
|
|
5027
5042
|
};
|
|
5028
|
-
var
|
|
5043
|
+
var pm = async (e6, t2, n2 = false, r2) => {
|
|
5029
5044
|
try {
|
|
5030
5045
|
let { post: n3 } = await tc(e6, { ...t2 && { fieldsets: t2 }, ...r2 && { language: r2 } });
|
|
5031
5046
|
if (n3) return n3;
|
|
5032
5047
|
} catch (e7) {
|
|
5033
|
-
|
|
5048
|
+
fm(e7, n2);
|
|
5034
5049
|
}
|
|
5035
5050
|
try {
|
|
5036
5051
|
let { items: n3 } = await ac(t2 ? { fieldsets: t2 } : void 0).eq(`slug`, e6).limit(1).find();
|
|
5037
5052
|
return n3[0];
|
|
5038
5053
|
} catch (e7) {
|
|
5039
|
-
|
|
5054
|
+
fm(e7, n2);
|
|
5040
5055
|
return;
|
|
5041
5056
|
}
|
|
5042
5057
|
};
|
|
5043
|
-
var
|
|
5058
|
+
var mm = async (e6, t2 = false, n2) => {
|
|
5044
5059
|
try {
|
|
5045
5060
|
let t3 = async (t4) => {
|
|
5046
5061
|
let { posts: r2 } = await nc({ paging: { limit: 1 }, ...e6 && { fieldsets: e6 }, ...t4 && n2 && { language: n2 } });
|
|
@@ -5048,12 +5063,12 @@ var lm = async (e6, t2 = false, n2) => {
|
|
|
5048
5063
|
};
|
|
5049
5064
|
return await t3(true) ?? (n2 ? await t3(false) : void 0);
|
|
5050
5065
|
} catch (e7) {
|
|
5051
|
-
|
|
5066
|
+
fm(e7, t2);
|
|
5052
5067
|
return;
|
|
5053
5068
|
}
|
|
5054
5069
|
};
|
|
5055
|
-
var
|
|
5056
|
-
var
|
|
5070
|
+
var hm = async (e6, t2 = false, n2) => (e6 ? await pm(e6, lm, t2, n2) : void 0) ?? await mm(lm, t2, n2);
|
|
5071
|
+
var gm = async (e6) => {
|
|
5057
5072
|
try {
|
|
5058
5073
|
let { metrics: t2 } = await rc(e6);
|
|
5059
5074
|
return t2;
|
|
@@ -5061,51 +5076,52 @@ var dm = async (e6) => {
|
|
|
5061
5076
|
return;
|
|
5062
5077
|
}
|
|
5063
5078
|
};
|
|
5064
|
-
var
|
|
5065
|
-
var
|
|
5079
|
+
var _m = 100;
|
|
5080
|
+
var vm = async () => {
|
|
5066
5081
|
try {
|
|
5067
|
-
let { categories: e6 } = await ai({ paging: { limit:
|
|
5082
|
+
let { categories: e6 } = await ai({ paging: { limit: _m } });
|
|
5068
5083
|
return e6 ?? [];
|
|
5069
5084
|
} catch {
|
|
5070
5085
|
return [];
|
|
5071
5086
|
}
|
|
5072
5087
|
};
|
|
5073
|
-
var
|
|
5088
|
+
var ym = (e6, t2) => {
|
|
5074
5089
|
let { categoryIds: n2 } = e6 ?? {};
|
|
5075
5090
|
if (!n2?.length) return [];
|
|
5076
5091
|
let r2 = new Map(t2.map((e7) => [e7._id, e7]));
|
|
5077
5092
|
return n2.map((e7) => r2.get(e7)).filter((e7) => e7 !== void 0);
|
|
5078
5093
|
};
|
|
5079
|
-
var
|
|
5080
|
-
var
|
|
5094
|
+
var bm = 30;
|
|
5095
|
+
var xm = async (e6) => {
|
|
5081
5096
|
if (!e6?.length) return [];
|
|
5082
5097
|
try {
|
|
5083
|
-
let { items: t2 } = await _c().in(`_id`, e6).limit(
|
|
5098
|
+
let { items: t2 } = await _c().in(`_id`, e6).limit(bm).find();
|
|
5084
5099
|
return t2 ?? [];
|
|
5085
5100
|
} catch {
|
|
5086
5101
|
return [];
|
|
5087
5102
|
}
|
|
5088
5103
|
};
|
|
5089
|
-
var
|
|
5104
|
+
var Sm = (e6, t2) => {
|
|
5090
5105
|
let { tagIds: n2 } = e6 ?? {};
|
|
5091
5106
|
if (!n2?.length) return [];
|
|
5092
5107
|
let r2 = new Map(t2.map((e7) => [e7._id, e7]));
|
|
5093
5108
|
return n2.map((e7) => r2.get(e7)).filter((e7) => e7 !== void 0);
|
|
5094
5109
|
};
|
|
5095
|
-
var
|
|
5096
|
-
var
|
|
5097
|
-
|
|
5098
|
-
|
|
5110
|
+
var Cm = async (e6, t2) => e6.post ? e6 : { ...e6, demoPost: (await Hp({ paging: { limit: 1, offset: 0 }, fieldsets: um, ...t2 && { language: t2 } }))[0] };
|
|
5111
|
+
var wm = 1e3;
|
|
5112
|
+
var Tm = async (e6, t2 = false, n2) => {
|
|
5113
|
+
let r2 = vm();
|
|
5114
|
+
return Em(await hm(e6, t2, n2), r2);
|
|
5099
5115
|
};
|
|
5100
|
-
var
|
|
5101
|
-
let { _id: n2, memberId: r2, tagIds: i2, preview: a2 } = e6 ?? {}, [o2, s2, c2, l2, u2] = await Promise.all([r2 ?
|
|
5102
|
-
return { post: e6, author: o2, metrics: s2, categories:
|
|
5116
|
+
var Em = async (e6, t2) => {
|
|
5117
|
+
let { _id: n2, memberId: r2, tagIds: i2, preview: a2 } = e6 ?? {}, [o2, s2, c2, l2, u2] = await Promise.all([r2 ? Xp(r2) : void 0, n2 ? gm(n2) : void 0, t2, xm(i2), a2 && n2 ? cm(Bl(n2, e6?.language ?? void 0), wm, `post-paywall`).catch(() => void 0) : void 0]);
|
|
5118
|
+
return { post: e6, author: o2, metrics: s2, categories: ym(e6, c2), tags: Sm(e6, l2), ...u2 && { paywall: u2 } };
|
|
5103
5119
|
};
|
|
5104
|
-
var
|
|
5120
|
+
var Dm = (e6) => {
|
|
5105
5121
|
let { _id: t2, categoryIds: n2, relatedPostIds: r2 } = e6 ?? {};
|
|
5106
5122
|
return { currentPostId: t2 ?? void 0, categoryIds: n2, relatedPostIds: r2 };
|
|
5107
5123
|
};
|
|
5108
|
-
var
|
|
5124
|
+
var Om = async (e6, t2) => {
|
|
5109
5125
|
try {
|
|
5110
5126
|
let { items: n2 } = await ac().eq(`translationId`, e6).eq(`language`, t2).limit(1).find();
|
|
5111
5127
|
return n2[0]?.slug ?? void 0;
|
|
@@ -5113,7 +5129,7 @@ var Sm = async (e6, t2) => {
|
|
|
5113
5129
|
return;
|
|
5114
5130
|
}
|
|
5115
5131
|
};
|
|
5116
|
-
var
|
|
5132
|
+
var km = class extends import_react.Component {
|
|
5117
5133
|
state = { error: void 0 };
|
|
5118
5134
|
static getDerivedStateFromError(e6) {
|
|
5119
5135
|
return { error: e6 ?? Error(`Unknown render error`) };
|
|
@@ -5127,30 +5143,30 @@ var Cm = class extends import_react.Component {
|
|
|
5127
5143
|
return this.props.fallback;
|
|
5128
5144
|
}
|
|
5129
5145
|
};
|
|
5130
|
-
var
|
|
5131
|
-
var
|
|
5132
|
-
var
|
|
5133
|
-
var
|
|
5134
|
-
var
|
|
5135
|
-
var
|
|
5136
|
-
var
|
|
5146
|
+
var Am = (e6) => e6.then((e7) => ({ ...e7, fetchedAt: Date.now() }));
|
|
5147
|
+
var jm = { post: void 0, author: void 0, metrics: void 0, categories: [], tags: [] };
|
|
5148
|
+
var Mm = [so.RICH_CONTENT, so.GENERATED_EXCERPT];
|
|
5149
|
+
var Nm = A((e6) => () => e6.fetchWithAuth);
|
|
5150
|
+
var Pm = (e6) => e6 ? Nm() : (...e7) => globalThis.fetch(...e7);
|
|
5151
|
+
var Fm = (e6, t2) => Je({ modules: { draftPosts: si }, auth: { getAuthHeaders: () => ({ headers: { authorization: e6 } }) }, fetch: Pm(t2) });
|
|
5152
|
+
var Im = (e6) => {
|
|
5137
5153
|
let { _id: t2, title: n2, excerpt: r2, seoSlug: i2, memberId: a2, minutesToRead: o2, categoryIds: s2, tagIds: c2, firstPublishedDate: l2, richContent: u2, media: d2 } = e6 ?? {};
|
|
5138
5154
|
if (t2) return { _id: t2, title: n2, excerpt: r2 ?? void 0, slug: i2 ?? void 0, memberId: a2 ?? void 0, minutesToRead: o2, categoryIds: s2, tagIds: c2, firstPublishedDate: l2 ?? void 0, richContent: u2, ...d2 && { media: d2 } };
|
|
5139
5155
|
};
|
|
5140
|
-
var
|
|
5141
|
-
var
|
|
5142
|
-
let r2 =
|
|
5156
|
+
var Lm = (e6) => e6 instanceof Error ? e6.message : String(e6);
|
|
5157
|
+
var Rm = async ({ draftPostId: e6, instance: t2 }, n2) => {
|
|
5158
|
+
let r2 = vm();
|
|
5143
5159
|
try {
|
|
5144
|
-
let { draftPost: i2 } = await
|
|
5145
|
-
return { post: a2, author: c2, metrics: void 0, categories:
|
|
5160
|
+
let { draftPost: i2 } = await Fm(t2, n2).draftPosts.getDraftPost(e6, { fieldsets: Mm }), a2 = Im(i2), { memberId: o2, tagIds: s2 } = a2 ?? {}, [c2, l2, u2] = await Promise.all([o2 ? Xp(o2) : void 0, r2, xm(s2)]);
|
|
5161
|
+
return { post: a2, author: c2, metrics: void 0, categories: ym(a2, l2), tags: Sm(a2, u2) };
|
|
5146
5162
|
} catch (e7) {
|
|
5147
|
-
let t3 =
|
|
5148
|
-
return console.error(`[blog-builder] draft preview fetch failed (${t3})`, e7), { ...
|
|
5163
|
+
let t3 = Lm(e7);
|
|
5164
|
+
return console.error(`[blog-builder] draft preview fetch failed (${t3})`, e7), { ...jm, reason: t3 };
|
|
5149
5165
|
}
|
|
5150
5166
|
};
|
|
5151
|
-
var
|
|
5152
|
-
var
|
|
5153
|
-
var
|
|
5167
|
+
var zm = (0, import_react.createContext)(void 0);
|
|
5168
|
+
var Bm = (0, import_react.createContext)(void 0);
|
|
5169
|
+
var Vm = (e6) => {
|
|
5154
5170
|
let t2;
|
|
5155
5171
|
try {
|
|
5156
5172
|
t2 = (0, import_services_manager_react.useService)(kc);
|
|
@@ -5159,41 +5175,41 @@ var Fm = (e6) => {
|
|
|
5159
5175
|
}
|
|
5160
5176
|
return Hc(t2, e6);
|
|
5161
5177
|
};
|
|
5162
|
-
var
|
|
5163
|
-
function
|
|
5178
|
+
var Hm = 1e4;
|
|
5179
|
+
function Um(e6) {
|
|
5164
5180
|
let [t2, n2] = (0, import_react.useState)(void 0);
|
|
5165
5181
|
return (0, import_react.useEffect)(() => {
|
|
5166
5182
|
let t3 = Date.now();
|
|
5167
|
-
t3 - e6 >
|
|
5183
|
+
t3 - e6 > Hm && (0, import_react.startTransition)(() => n2(t3));
|
|
5168
5184
|
}, []), t2 ?? e6;
|
|
5169
5185
|
}
|
|
5170
|
-
var
|
|
5171
|
-
var
|
|
5172
|
-
await Gr({ like: { entityId: e6, fqdn:
|
|
5186
|
+
var Wm = `wix.blog.v3.post`;
|
|
5187
|
+
var Gm = async (e6) => {
|
|
5188
|
+
await Gr({ like: { entityId: e6, fqdn: Wm } });
|
|
5173
5189
|
};
|
|
5174
|
-
var
|
|
5175
|
-
await Kr({ fqdn:
|
|
5190
|
+
var Km = async (e6) => {
|
|
5191
|
+
await Kr({ fqdn: Wm, entityId: e6 });
|
|
5176
5192
|
};
|
|
5177
|
-
var
|
|
5178
|
-
var
|
|
5179
|
-
let [t2, n2] = await Promise.allSettled([qr().eq(`fqdn`,
|
|
5180
|
-
return { liked: t2.status === `fulfilled` && t2.value.items.length > 0, likeCount:
|
|
5193
|
+
var qm = (e6) => typeof e6 == `number` ? e6 : void 0;
|
|
5194
|
+
var Jm = async (e6) => {
|
|
5195
|
+
let [t2, n2] = await Promise.allSettled([qr().eq(`fqdn`, Wm).eq(`entityId`, e6).limit(1).find(), rc(e6)]), r2 = n2.status === `fulfilled` ? n2.value.metrics : void 0;
|
|
5196
|
+
return { liked: t2.status === `fulfilled` && t2.value.items.length > 0, likeCount: qm(r2?.likes), viewCount: qm(r2?.views), commentCount: qm(r2?.comments) };
|
|
5181
5197
|
};
|
|
5182
|
-
var
|
|
5183
|
-
var
|
|
5184
|
-
var
|
|
5198
|
+
var Ym = { liked: false, baselineLiked: false, freshLikeCount: void 0, viewCount: void 0, commentCount: void 0, isLikeCountLoaded: false };
|
|
5199
|
+
var Xm = `wix-blog:post-like-toggled`;
|
|
5200
|
+
var Zm = () => {
|
|
5185
5201
|
let e6 = window;
|
|
5186
|
-
return e6[
|
|
5202
|
+
return e6[Xm] ??= /* @__PURE__ */ new Map();
|
|
5187
5203
|
};
|
|
5188
|
-
var
|
|
5189
|
-
|
|
5204
|
+
var Qm = (e6) => {
|
|
5205
|
+
Zm().set(e6.postId, e6.liked), window.dispatchEvent(new CustomEvent(Xm, { detail: e6 }));
|
|
5190
5206
|
};
|
|
5191
|
-
var
|
|
5192
|
-
var
|
|
5193
|
-
let o2 = bc() || n2, [d2, f2] = (0, import_react.useState)(
|
|
5207
|
+
var $m = (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 });
|
|
5208
|
+
var eh = (e6, t2, n2 = false, r2) => {
|
|
5209
|
+
let o2 = bc() || n2, [d2, f2] = (0, import_react.useState)(Ym), p2 = (0, import_react.useRef)(Ym), m2 = (0, import_react.useRef)(t2), h2 = (0, import_react.useRef)(/* @__PURE__ */ new Set()), g2 = (0, import_react.useRef)(false), _2 = (0, import_react.useRef)(false), v2 = (0, import_react.useRef)(void 0), y2 = Dc(), [b2, x2] = (0, import_react.useState)(0);
|
|
5194
5210
|
(0, import_react.useEffect)(() => {
|
|
5195
5211
|
let e7 = y2?.addMemberLoginListener?.(() => {
|
|
5196
|
-
|
|
5212
|
+
Zm().clear(), x2((e8) => e8 + 1);
|
|
5197
5213
|
});
|
|
5198
5214
|
return () => {
|
|
5199
5215
|
e7 !== void 0 && y2?.removeMemberLoginListener?.(e7);
|
|
@@ -5202,18 +5218,18 @@ var Jm = (e6, t2, n2 = false, r2) => {
|
|
|
5202
5218
|
let S2 = (0, import_react.useCallback)((e7) => {
|
|
5203
5219
|
let t3 = p2.current, n3 = { ...t3, ...e7 };
|
|
5204
5220
|
Object.keys(n3).every((e8) => n3[e8] === t3[e8]) || (p2.current = n3, h2.current.forEach((e8) => e8()), (0, import_react.startTransition)(() => f2(n3)));
|
|
5205
|
-
}, []), ee2 = (0, import_react.useMemo)(() => ({ get: () =>
|
|
5221
|
+
}, []), ee2 = (0, import_react.useMemo)(() => ({ get: () => $m(p2.current, m2.current), subscribe: (e7) => (h2.current.add(e7), () => {
|
|
5206
5222
|
h2.current.delete(e7);
|
|
5207
5223
|
}) }), []);
|
|
5208
5224
|
(0, import_react.useEffect)(() => {
|
|
5209
5225
|
m2.current !== t2 && (m2.current = t2, h2.current.forEach((e7) => e7()));
|
|
5210
5226
|
}, [t2]), (0, import_react.useEffect)(() => {
|
|
5211
|
-
if (v2.current !== e6 && (v2.current = e6, S2(
|
|
5227
|
+
if (v2.current !== e6 && (v2.current = e6, S2(Ym)), _2.current = false, !e6 || o2) {
|
|
5212
5228
|
S2({ isLikeCountLoaded: true });
|
|
5213
5229
|
return;
|
|
5214
5230
|
}
|
|
5215
5231
|
let t3 = false;
|
|
5216
|
-
return
|
|
5232
|
+
return Jm(e6).then(({ liked: e7, likeCount: n3, viewCount: r3, commentCount: i2 }) => {
|
|
5217
5233
|
t3 || S2({ isLikeCountLoaded: true, viewCount: r3, commentCount: i2, baselineLiked: e7, freshLikeCount: n3, ...!_2.current && { liked: e7 } });
|
|
5218
5234
|
}).catch((n3) => {
|
|
5219
5235
|
t3 || S2({ isLikeCountLoaded: true }), rl(r2, n3, { feature: el.likes, action: `read-like-state`, level: `warning`, contexts: { likes: { postId: e6 } } });
|
|
@@ -5224,32 +5240,32 @@ var Jm = (e6, t2, n2 = false, r2) => {
|
|
|
5224
5240
|
if (!e6) return;
|
|
5225
5241
|
let t3 = (e7) => {
|
|
5226
5242
|
_2.current = true, S2({ liked: e7 });
|
|
5227
|
-
}, n3 =
|
|
5243
|
+
}, n3 = Zm().get(e6);
|
|
5228
5244
|
n3 !== void 0 && t3(n3);
|
|
5229
5245
|
let r3 = (n4) => {
|
|
5230
5246
|
let { detail: r4 } = n4;
|
|
5231
5247
|
r4.postId === e6 && t3(r4.liked);
|
|
5232
5248
|
};
|
|
5233
|
-
return window.addEventListener(
|
|
5249
|
+
return window.addEventListener(Xm, r3), () => window.removeEventListener(Xm, r3);
|
|
5234
5250
|
}, [e6, S2]);
|
|
5235
5251
|
let te2 = (0, import_react.useCallback)(async (t3) => {
|
|
5236
5252
|
if (!e6 || g2.current) return;
|
|
5237
5253
|
_2.current = true;
|
|
5238
5254
|
let n3 = !p2.current.liked;
|
|
5239
|
-
if (S2({ liked: n3 }),
|
|
5255
|
+
if (S2({ liked: n3 }), Qm({ postId: e6, liked: n3 }), !o2) {
|
|
5240
5256
|
g2.current = true;
|
|
5241
5257
|
try {
|
|
5242
|
-
await (n3 ?
|
|
5258
|
+
await (n3 ? Gm(e6) : Km(e6));
|
|
5243
5259
|
} catch (t4) {
|
|
5244
|
-
S2({ liked: !n3 }),
|
|
5260
|
+
S2({ liked: !n3 }), Qm({ postId: e6, liked: !n3 }), rl(r2, t4, { feature: el.likes, action: n3 ? `like-post` : `unlike-post`, contexts: { likes: { postId: e6 } } });
|
|
5245
5261
|
} finally {
|
|
5246
5262
|
g2.current = false;
|
|
5247
5263
|
}
|
|
5248
5264
|
}
|
|
5249
5265
|
}, [e6, o2, r2, S2]);
|
|
5250
|
-
return {
|
|
5266
|
+
return { ...$m(d2, t2), toggleLike: te2, liveLikes: ee2 };
|
|
5251
5267
|
};
|
|
5252
|
-
var
|
|
5268
|
+
var th = () => {
|
|
5253
5269
|
try {
|
|
5254
5270
|
let { locale: e6, language: t2 } = (0, import_services_manager_react.useService)(jl);
|
|
5255
5271
|
return e6 || t2;
|
|
@@ -5257,144 +5273,144 @@ var Ym = () => {
|
|
|
5257
5273
|
return;
|
|
5258
5274
|
}
|
|
5259
5275
|
};
|
|
5260
|
-
var
|
|
5276
|
+
var nh = (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);
|
|
5261
5277
|
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` };
|
|
5262
|
-
var
|
|
5263
|
-
let n2 = (n3) => (r2) => e6(n3, { count: r2, formatted:
|
|
5278
|
+
var rh = (e6, t2) => {
|
|
5279
|
+
let n2 = (n3) => (r2) => e6(n3, { count: r2, formatted: nh(r2, `full`, t2) });
|
|
5264
5280
|
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) } };
|
|
5265
5281
|
};
|
|
5266
|
-
var
|
|
5267
|
-
var $ = (e6) => ({ text: e6, html: `<p>${
|
|
5268
|
-
var
|
|
5269
|
-
var
|
|
5270
|
-
var
|
|
5271
|
-
var
|
|
5272
|
-
var
|
|
5273
|
-
var
|
|
5282
|
+
var ih = (e6) => e6.replace(/&/g, `&`).replace(/</g, `<`).replace(/>/g, `>`).replace(/"/g, `"`).replace(/'/g, `'`);
|
|
5283
|
+
var $ = (e6) => ({ text: e6, html: `<p>${ih(e6)}</p>`, linkList: [] });
|
|
5284
|
+
var ah = 6e4;
|
|
5285
|
+
var oh = ah * 60;
|
|
5286
|
+
var sh = oh * 24;
|
|
5287
|
+
var ch = sh * 7;
|
|
5288
|
+
var lh = (e6) => e6 < ah ? [`second`, e6 / 1e3] : e6 < oh ? [`minute`, e6 / ah] : e6 < sh ? [`hour`, e6 / oh] : [`day`, e6 / sh];
|
|
5289
|
+
var uh = (e6, t2, n2 = Date.now()) => {
|
|
5274
5290
|
let r2 = e6 instanceof Date ? e6 : new Date(e6), i2 = n2 - r2.getTime();
|
|
5275
|
-
if (i2 >= 0 && i2 <
|
|
5276
|
-
let [e7, n3] =
|
|
5291
|
+
if (i2 >= 0 && i2 < ch) {
|
|
5292
|
+
let [e7, n3] = lh(i2);
|
|
5277
5293
|
return new Intl.RelativeTimeFormat(t2).format(-Math.round(n3), e7);
|
|
5278
5294
|
}
|
|
5279
5295
|
let a2 = r2.getFullYear() === new Date(n2).getFullYear();
|
|
5280
5296
|
return new Intl.DateTimeFormat(t2, { ...a2 ? {} : { year: `numeric` }, month: `short`, day: `numeric` }).format(r2);
|
|
5281
5297
|
};
|
|
5282
|
-
var
|
|
5283
|
-
var
|
|
5284
|
-
var
|
|
5298
|
+
var dh = `https://static.wixstatic.com/media/`;
|
|
5299
|
+
var fh = `wix:video://`;
|
|
5300
|
+
var ph = (e6) => {
|
|
5285
5301
|
if (!e6) return;
|
|
5286
5302
|
let t2 = Number.parseInt(e6, 10);
|
|
5287
5303
|
return Number.isFinite(t2) && t2 > 0 ? t2 : void 0;
|
|
5288
5304
|
};
|
|
5289
|
-
var
|
|
5290
|
-
if (!e6.startsWith(
|
|
5305
|
+
var mh = (e6) => {
|
|
5306
|
+
if (!e6.startsWith(fh)) return;
|
|
5291
5307
|
let [t2, n2] = e6.slice(12).split(`#`), [, r2] = t2.split(`/`).filter(Boolean);
|
|
5292
5308
|
if (!r2) return;
|
|
5293
5309
|
let i2 = new URLSearchParams(n2 ?? ``), a2 = i2.get(`posterUri`);
|
|
5294
|
-
return { id: decodeURIComponent(r2), posterUrl: a2 ? `${
|
|
5310
|
+
return { id: decodeURIComponent(r2), posterUrl: a2 ? `${dh}${a2}` : void 0, posterWidth: ph(i2.get(`posterWidth`)), posterHeight: ph(i2.get(`posterHeight`)) };
|
|
5295
5311
|
};
|
|
5296
|
-
var
|
|
5312
|
+
var hh = (e6) => {
|
|
5297
5313
|
let t2 = hl(e6), n2 = e6?.media?.wixMedia?.videoV2;
|
|
5298
5314
|
if (t2 || !n2) return t2;
|
|
5299
|
-
let r2 =
|
|
5315
|
+
let r2 = mh(n2), i2 = ml(r2?.posterUrl?.slice(35), e6?.media?.altText ?? e6?.title);
|
|
5300
5316
|
return i2 && { ...i2, width: r2?.posterWidth ?? i2.width, height: r2?.posterHeight ?? i2.height };
|
|
5301
5317
|
};
|
|
5302
|
-
var
|
|
5318
|
+
var gh = (e6) => {
|
|
5303
5319
|
if (!e6) return;
|
|
5304
5320
|
let t2 = e6 instanceof Date ? e6 : new Date(e6);
|
|
5305
5321
|
return Number.isFinite(t2.getTime()) ? t2.toISOString() : void 0;
|
|
5306
5322
|
};
|
|
5307
|
-
var
|
|
5308
|
-
var
|
|
5309
|
-
var
|
|
5310
|
-
let n2 =
|
|
5323
|
+
var _h = (e6) => typeof e6 == `number` && e6 > 0 ? e6 : void 0;
|
|
5324
|
+
var vh = (e6, t2) => e6 && t2 ? `${e6}/${encodeURIComponent(t2)}` : void 0;
|
|
5325
|
+
var yh = (e6, t2) => {
|
|
5326
|
+
let n2 = vh(e6, t2);
|
|
5311
5327
|
return n2 ? { href: n2, target: `_self` } : void 0;
|
|
5312
5328
|
};
|
|
5313
|
-
var
|
|
5314
|
-
var
|
|
5329
|
+
var bh = { href: `#`, target: `_self` };
|
|
5330
|
+
var xh = (e6, t2) => {
|
|
5315
5331
|
let { _id: n2, label: r2, slug: i2 } = e6, a2 = r2 ?? ``;
|
|
5316
|
-
return { _id: n2 ?? i2 ?? ``, label: a2, itemCategoryLabel: $(a2), itemCategoryLink:
|
|
5332
|
+
return { _id: n2 ?? i2 ?? ``, label: a2, itemCategoryLabel: $(a2), itemCategoryLink: yh(t2, i2 ?? ``), categoryItem: { label: a2, slug: i2 ?? `` } };
|
|
5317
5333
|
};
|
|
5318
|
-
var
|
|
5319
|
-
var
|
|
5334
|
+
var Sh = 2;
|
|
5335
|
+
var Ch = (e6) => Array.from({ length: Sh }, (t2, n2) => {
|
|
5320
5336
|
let r2 = e6.canvas.categoryNumbered(n2 + 1);
|
|
5321
|
-
return { _id: `placeholder-category-${n2}`, label: r2, itemCategoryLabel: $(r2), itemCategoryLink:
|
|
5337
|
+
return { _id: `placeholder-category-${n2}`, label: r2, itemCategoryLabel: $(r2), itemCategoryLink: bh, categoryItem: { label: r2, slug: `` } };
|
|
5322
5338
|
});
|
|
5323
|
-
var
|
|
5339
|
+
var wh = (e6, t2) => {
|
|
5324
5340
|
let { _id: n2, label: r2, slug: i2 } = e6, a2 = r2 ?? ``;
|
|
5325
|
-
return { _id: n2 ?? i2 ?? ``, label: a2, itemTagLabel: $(a2), itemTagLink:
|
|
5341
|
+
return { _id: n2 ?? i2 ?? ``, label: a2, itemTagLabel: $(a2), itemTagLink: yh(t2, i2 ?? ``), tagItem: { label: a2, slug: i2 ?? `` } };
|
|
5326
5342
|
};
|
|
5327
|
-
var
|
|
5328
|
-
var
|
|
5343
|
+
var Th = 3;
|
|
5344
|
+
var Eh = (e6) => Array.from({ length: Th }, (t2, n2) => {
|
|
5329
5345
|
let r2 = e6.canvas.tagNumbered(n2 + 1);
|
|
5330
|
-
return { _id: `placeholder-tag-${n2}`, label: r2, itemTagLabel: $(r2), itemTagLink:
|
|
5346
|
+
return { _id: `placeholder-tag-${n2}`, label: r2, itemTagLabel: $(r2), itemTagLink: bh, tagItem: { label: r2, slug: `` } };
|
|
5331
5347
|
});
|
|
5332
|
-
var
|
|
5333
|
-
var
|
|
5334
|
-
var
|
|
5335
|
-
var
|
|
5336
|
-
var
|
|
5337
|
-
var
|
|
5338
|
-
var
|
|
5339
|
-
var
|
|
5340
|
-
var
|
|
5341
|
-
let { t: a2 } = sp(), o2 =
|
|
5348
|
+
var Dh = 1;
|
|
5349
|
+
var Oh = { views: 120, comments: 4, likes: 12 };
|
|
5350
|
+
var kh = (e6) => ({ nodes: [{ type: `PARAGRAPH`, nodes: [{ type: `TEXT`, nodes: [], textData: { text: e6, decorations: [] } }] }] });
|
|
5351
|
+
var Ah = (e6, t2, n2, r2) => $(e6 === void 0 ? n2 ? r2(t2) : `` : r2(e6));
|
|
5352
|
+
var jh = (e6, t2, n2) => e6 ?? (n2 ? t2 : void 0);
|
|
5353
|
+
var Mh = { nodes: [] };
|
|
5354
|
+
var Nh = () => ({ title: $(``), excerpt: $(``), coverImage: void 0, richContent: Mh, authorName: $(``), authorImage: void 0, timeToRead: $(``), publishedDate: $(``), viewCount: $(``), commentCount: $(``), likeCount: $(``), postCategories: [], postTags: [], hasCoverImage: false, hasExcerpt: false, hasTags: false, publishedDateValue: void 0, minutesToReadValue: void 0, viewCountValue: void 0, commentCountValue: void 0 });
|
|
5355
|
+
var Ph = ({ post: e6, author: t2, metrics: n2, categories: r2, tags: i2 }, a2, o2, s2 = false, c2 = Date.now(), l2 = {}) => !e6 && !s2 ? Nh() : { title: $(e6?.title ?? a2.canvas.postTitle()), excerpt: $(e6?.excerpt ?? a2.canvas.excerpt()), coverImage: hh(e6), richContent: e6?.richContent ?? kh(a2.canvas.content()), authorName: $(t2?.profile?.nickname ?? a2.canvas.authorName()), authorImage: sl(t2, a2.canvas.authorPhotoAlt()), timeToRead: $(typeof e6?.minutesToRead == `number` && e6.minutesToRead > 0 ? a2.timeToRead(e6.minutesToRead) : s2 ? a2.timeToRead(Dh) : ``), publishedDate: $(uh(e6?.firstPublishedDate ?? new Date(c2), o2, c2)), viewCount: Ah(n2?.views, Oh.views, s2, a2.viewCount), commentCount: Ah(n2?.comments, Oh.comments, s2, a2.commentCount), likeCount: Ah(n2?.likes, Oh.likes, s2, a2.likeCount), postCategories: r2.length === 0 && s2 ? Ch(a2) : r2.map((e7) => xh(e7, l2.category)), postTags: i2.length === 0 && s2 ? Eh(a2) : i2.map((e7) => wh(e7, l2.tag)), hasCoverImage: !e6 || e6.media?.displayed !== false && hh(e6) !== void 0, hasExcerpt: !e6 || !!e6.excerpt?.trim(), hasTags: !e6 || i2.length > 0, publishedDateValue: gh(e6?.firstPublishedDate) ?? (s2 ? `2026-05-12T12:00:00.000Z` : void 0), minutesToReadValue: _h(e6?.minutesToRead) ?? (s2 ? Dh : void 0), viewCountValue: jh(n2?.views, Oh.views, s2), commentCountValue: jh(n2?.comments, Oh.comments, s2) };
|
|
5356
|
+
var Fh = ({ postWithAuthor: e6, hasError: t2, monitoringClient: n2, isPostInPreview: r2, postPageBase: i2 }) => {
|
|
5357
|
+
let { t: a2 } = sp(), o2 = th(), s2 = (0, import_react.useMemo)(() => rh(a2, o2), [a2, o2]), l2 = Um(e6.fetchedAt), u2 = Rl(), { isLiked: d2, likeCount: f2, isLikeCountLoaded: p2, viewCount: m2, commentCount: h2, toggleLike: g2, liveLikes: _2 } = eh(e6.post?._id ?? void 0, e6.metrics?.likes ?? 0, r2, n2), v2 = Vm(Mc), y2 = Vm(`tag`), b2 = (0, import_react.useMemo)(() => Dm(e6.post), [e6]), x2 = ql(), S2 = (0, import_react.useMemo)(() => e6.post?.richContent && e6.paywall ? Gl(e6.post.richContent, e6.paywall, x2) : void 0, [e6, x2]);
|
|
5342
5358
|
return (0, import_react.useMemo)(() => {
|
|
5343
|
-
let n3 =
|
|
5359
|
+
let n3 = Ph(!e6.post && u2 && e6.demoPost ? { ...e6, post: e6.demoPost } : e6, s2, o2, u2, l2, { category: v2, tag: y2 });
|
|
5344
5360
|
return { ...n3, ...S2 && { richContent: S2 }, relatedPostsSource: b2, viewCountValue: m2 ?? n3.viewCountValue, commentCountValue: h2 ?? n3.commentCountValue, postUrl: r2 || !e6.post ? void 0 : Vc(e6.post, i2)?.href, ...e6.post && (e6.metrics?.likes !== void 0 || p2) ? { likeCount: $(s2.likeCount(f2)) } : {}, isLiked: d2, likeCountValue: f2, isLikeCountLoaded: p2, toggleLike: g2, liveLikes: _2, clockValue: l2, isLoadingPost: false, hasError: t2, isEmpty: !e6.post && !u2 };
|
|
5345
5361
|
}, [e6, t2, b2, S2, s2, o2, l2, f2, d2, p2, m2, h2, g2, _2, u2, r2, i2, v2, y2]);
|
|
5346
5362
|
};
|
|
5347
|
-
var
|
|
5348
|
-
var
|
|
5349
|
-
var
|
|
5363
|
+
var Ih = (e6) => ({ post: e6, hasError: false });
|
|
5364
|
+
var Lh = () => ({ post: { post: void 0, author: void 0, metrics: void 0, categories: [], tags: [], fetchedAt: Date.now() }, hasError: true });
|
|
5365
|
+
var Rh = (e6) => {
|
|
5350
5366
|
throw e6;
|
|
5351
5367
|
};
|
|
5352
|
-
var
|
|
5368
|
+
var zh = { ...Nh(), isLiked: false, likeCountValue: 0, isLikeCountLoaded: false, toggleLike: async () => {
|
|
5353
5369
|
}, liveLikes: void 0, postUrl: void 0, clockValue: 0, relatedPostsSource: { currentPostId: void 0, categoryIds: void 0, relatedPostIds: void 0 }, isLoadingPost: true, hasError: false, isEmpty: false };
|
|
5354
|
-
var
|
|
5355
|
-
var
|
|
5356
|
-
function
|
|
5357
|
-
let e6 = (0, import_react.useContext)(
|
|
5370
|
+
var Bh = { ...zh, isLoadingPost: false, hasError: true, isEmpty: true };
|
|
5371
|
+
var Vh = (0, import_react.createContext)(void 0);
|
|
5372
|
+
function Hh() {
|
|
5373
|
+
let e6 = (0, import_react.useContext)(Vh);
|
|
5358
5374
|
if (!e6) throw Error(`usePostContext must be used within a PostProvider`);
|
|
5359
5375
|
return e6;
|
|
5360
5376
|
}
|
|
5361
|
-
var
|
|
5377
|
+
var Uh = new Promise(() => {
|
|
5362
5378
|
});
|
|
5363
|
-
var
|
|
5364
|
-
var
|
|
5379
|
+
var Wh = 2500;
|
|
5380
|
+
var Gh = (e6) => {
|
|
5365
5381
|
try {
|
|
5366
5382
|
return decodeURIComponent(e6);
|
|
5367
5383
|
} catch {
|
|
5368
5384
|
return e6;
|
|
5369
5385
|
}
|
|
5370
5386
|
};
|
|
5371
|
-
var
|
|
5372
|
-
let { post: s2, hasError: c2 } = Kn(t2), l2 = Oc(s2, (0, import_react.useCallback)(() =>
|
|
5373
|
-
Al(l2, o2, n2), Yl(r2 && l2.post?.slug ===
|
|
5387
|
+
var Kh = ({ children: e6, postLoadPromise: t2, monitoringClient: n2, slug: r2, language: i2, isPostInPreview: o2 }) => {
|
|
5388
|
+
let { post: s2, hasError: c2 } = Kn(t2), l2 = Oc(s2, (0, import_react.useCallback)(() => hm(r2, false, i2), [r2, i2]));
|
|
5389
|
+
Al(l2, o2, n2), Yl(r2 && l2.post?.slug === Gh(r2) && !o2 ? l2.post : void 0, i2, Om);
|
|
5374
5390
|
let { _id: u2 } = l2.post ?? {};
|
|
5375
5391
|
xc(o2 ? void 0 : u2 ?? void 0);
|
|
5376
|
-
let d2 =
|
|
5377
|
-
return Zc(Yc.postProvider, c2 ? `error` : l2.post ? `data` : `empty`), (0, import_jsx_runtime.jsx)(
|
|
5378
|
-
};
|
|
5379
|
-
function
|
|
5380
|
-
let n2 = Kc(), r2 = Jc(), i2 = Nl(), a2 = Cc(), { draftPostId: o2, instance: s2 } = n2 ?? {}, l2 =
|
|
5381
|
-
let e7 = o2 && s2 ?
|
|
5382
|
-
let e8 =
|
|
5383
|
-
return
|
|
5384
|
-
} }), t2 = e7.then(({ post: e8 }) =>
|
|
5392
|
+
let d2 = Fh({ postWithAuthor: l2, hasError: c2, monitoringClient: n2, isPostInPreview: o2, postPageBase: Uc(r2) });
|
|
5393
|
+
return Zc(Yc.postProvider, c2 ? `error` : l2.post ? `data` : `empty`), (0, import_jsx_runtime.jsx)(Vh.Provider, { value: d2, children: e6 });
|
|
5394
|
+
};
|
|
5395
|
+
function qh({ children: e6 }) {
|
|
5396
|
+
let n2 = Kc(), r2 = Jc(), i2 = Nl(), a2 = Cc(), { draftPostId: o2, instance: s2 } = n2 ?? {}, l2 = Rl(), u2 = Zl(), d2 = (0, import_react.useMemo)(() => tl(Wn), []), { i18n: f2, locale: h2 } = Ap(Rp), g2 = Tc(() => {
|
|
5397
|
+
let e7 = o2 && s2 ? Am(Rm({ draftPostId: o2, instance: s2 }, a2)) : _p({ key: r2 ? `blog-builder:post:${r2}|${i2 ?? ``}` : null, warmupData: u2, fetchData: () => {
|
|
5398
|
+
let e8 = Tm(r2, a2, i2).then((e9) => l2 ? Cm(e9, i2) : e9);
|
|
5399
|
+
return Am(il(d2, `post-read`, { feature: el.post }, a2 ? cm(e8, Wh, `post`) : e8));
|
|
5400
|
+
} }), t2 = e7.then(({ post: e8 }) => Dm(e8));
|
|
5385
5401
|
return t2.catch(() => {
|
|
5386
|
-
}), { slug: r2, language: i2, isPostInPreview: !!o2, postLoadPromise: Jn(e7,
|
|
5387
|
-
}, [o2, s2, i2, r2, a2, l2, u2]);
|
|
5388
|
-
return (0, import_jsx_runtime.jsx)(
|
|
5402
|
+
}), { slug: r2, language: i2, isPostInPreview: !!o2, postLoadPromise: Jn(e7, Ih, a2 ? Rh : Lh), relatedSourcePromise: t2 };
|
|
5403
|
+
}, [o2, s2, i2, r2, a2, l2, u2, d2]);
|
|
5404
|
+
return (0, import_jsx_runtime.jsx)(zm.Provider, { value: g2.relatedSourcePromise, children: (0, import_jsx_runtime.jsx)(cp, { i18n: f2, children: (0, import_jsx_runtime.jsxs)(import_react.Suspense, { fallback: (0, import_jsx_runtime.jsx)(Vh.Provider, { value: zh, children: e6 }), children: [(0, import_jsx_runtime.jsx)(kp, { i18n: f2, locale: h2 }), (0, import_jsx_runtime.jsx)(km, { fallback: (0, import_jsx_runtime.jsx)(Vh.Provider, { value: Bh, children: e6 }), feature: el.post, monitoringClient: d2, rethrow: a2, children: (0, import_jsx_runtime.jsx)(Kh, { postLoadPromise: g2.postLoadPromise, monitoringClient: d2, slug: g2.isPostInPreview ? void 0 : g2.slug, language: g2.language, isPostInPreview: g2.isPostInPreview, children: e6 }) })] }) }) });
|
|
5389
5405
|
}
|
|
5390
|
-
function
|
|
5391
|
-
let n2 = (0, import_react.useMemo)(() => t2.isLoadingPost ?
|
|
5392
|
-
return (0, import_jsx_runtime.jsx)(
|
|
5406
|
+
function Jh({ children: e6, value: t2 }) {
|
|
5407
|
+
let n2 = (0, import_react.useMemo)(() => t2.isLoadingPost ? Uh : Promise.resolve(t2.relatedPostsSource), [t2.isLoadingPost, t2.relatedPostsSource]);
|
|
5408
|
+
return (0, import_jsx_runtime.jsx)(Bm.Provider, { value: t2.relatedPostsSource.currentPostId, children: (0, import_jsx_runtime.jsx)(zm.Provider, { value: n2, children: (0, import_jsx_runtime.jsx)(Vh.Provider, { value: t2, children: e6 }) }) });
|
|
5393
5409
|
}
|
|
5394
|
-
function
|
|
5395
|
-
return t2 === void 0 ? (0, import_jsx_runtime.jsx)(
|
|
5410
|
+
function Yh({ children: e6, value: t2 }) {
|
|
5411
|
+
return t2 === void 0 ? (0, import_jsx_runtime.jsx)(qh, { children: e6 }) : (0, import_jsx_runtime.jsx)(Jh, { value: t2, children: e6 });
|
|
5396
5412
|
}
|
|
5397
|
-
var
|
|
5413
|
+
var Xh = Ln(`d89e577c-857b-4604-ab4a-9801a3386d40`);
|
|
5398
5414
|
// Annotate the CommonJS export names for ESM import in node:
|
|
5399
5415
|
0 && (module.exports = {
|
|
5400
5416
|
PostProvider,
|