@wix/blog 1.0.713 → 1.0.715

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.
@@ -1064,8 +1064,7 @@ var rr = (e6) => {
1064
1064
  let t2;
1065
1065
  try {
1066
1066
  let n3 = e6.appSectionRelativeUrl(Qn, tr);
1067
- if (n3 === e6.appSectionRelativeUrl(`14bcded7-0066-7c35-14d7-466cb3f09103`, nr) && !n3?.endsWith(`/post-page`)) return;
1068
- t2 = e6.appSectionRelativeUrl(Qn, tr, true);
1067
+ if (t2 = e6.appSectionRelativeUrl(Qn, tr, true), n3 === e6.appSectionRelativeUrl(`14bcded7-0066-7c35-14d7-466cb3f09103`, nr) && !n3?.endsWith(`/post-page`) && t2 === n3) return;
1069
1068
  } catch {
1070
1069
  return;
1071
1070
  }
@@ -4374,31 +4373,38 @@ var tu = (e6, t2, n2 = false, r2) => {
4374
4373
  }, [e6, i2, r2, S2]);
4375
4374
  return { ...eu(a2, t2), toggleLike: ee2, liveLikes: C2 };
4376
4375
  };
4377
- var nu = () => {
4376
+ var nu = I(`@wix/viewer-service-multilingual`);
4377
+ var ru = () => {
4378
+ let e6;
4378
4379
  try {
4379
- let { locale: e6, language: t2 } = m(xo);
4380
- return e6 || t2;
4380
+ let { multilingualEnabled: t3, currentLocale: n3 } = m(nu);
4381
+ t3 && n3 && !n3.primaryLocale && (e6 = n3.regionalFormat);
4381
4382
  } catch {
4382
- return;
4383
4383
  }
4384
+ let t2, n2;
4385
+ try {
4386
+ ({ locale: t2, language: n2 } = m(xo));
4387
+ } catch {
4388
+ }
4389
+ return e6 || t2 || n2;
4384
4390
  };
4385
- var ru = () => {
4391
+ var iu = () => {
4386
4392
  try {
4387
4393
  return Xc(m(Zn));
4388
4394
  } catch {
4389
4395
  return;
4390
4396
  }
4391
4397
  };
4392
- var iu = (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);
4398
+ var au = (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);
4393
4399
  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` };
4394
- var au = (e6, t2) => {
4395
- let n2 = (n3) => (r2) => e6(n3, { count: r2, formatted: iu(r2, `full`, t2) });
4400
+ var ou = (e6, t2) => {
4401
+ let n2 = (n3) => (r2) => e6(n3, { count: r2, formatted: au(r2, `full`, t2) });
4396
4402
  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) } };
4397
4403
  };
4398
- var ou = i({ isEditor: false, isPreview: false });
4399
- var su = () => c(ou);
4400
- var cu = ({ isEditor: e6, isPreview: t2 }) => e6 && !t2;
4401
- var lu = () => {
4404
+ var su = i({ isEditor: false, isPreview: false });
4405
+ var cu = () => c(su);
4406
+ var lu = ({ isEditor: e6, isPreview: t2 }) => e6 && !t2;
4407
+ var uu = () => {
4402
4408
  try {
4403
4409
  let { SSR: e6, SEO: t2 } = m(Wn);
4404
4410
  return e6 || t2;
@@ -4406,190 +4412,190 @@ var lu = () => {
4406
4412
  return false;
4407
4413
  }
4408
4414
  };
4409
- var uu = () => {
4410
- let e6 = lu();
4411
- return cu(su()) && !e6;
4415
+ var du = () => {
4416
+ let e6 = uu();
4417
+ return lu(cu()) && !e6;
4412
4418
  };
4413
- var du = (e6) => ({ href: e6 ?? `#`, target: `_self` });
4414
- var fu = (e6) => {
4419
+ var fu = (e6) => ({ href: e6 ?? `#`, target: `_self` });
4420
+ var pu = (e6) => {
4415
4421
  if (!e6) return;
4416
4422
  let t2 = e6 instanceof Date ? e6 : new Date(e6);
4417
4423
  return Number.isFinite(t2.getTime()) ? t2.toISOString() : void 0;
4418
4424
  };
4419
- var pu = (e6) => typeof e6 == `number` && e6 > 0 ? e6 : void 0;
4420
- var mu = (e6) => e6.replace(/&/g, `&amp;`).replace(/</g, `&lt;`).replace(/>/g, `&gt;`).replace(/"/g, `&quot;`).replace(/'/g, `&#39;`);
4421
- var $ = (e6) => ({ text: e6, html: `<p>${mu(e6)}</p>`, linkList: [] });
4422
- var hu = 6e4;
4423
- var gu = hu * 60;
4424
- var _u = gu * 24;
4425
- var vu = _u * 7;
4426
- var yu = (e6) => e6 < hu ? [`second`, e6 / 1e3] : e6 < gu ? [`minute`, e6 / hu] : e6 < _u ? [`hour`, e6 / gu] : [`day`, e6 / _u];
4427
- var bu = (e6, t2, n2 = Date.now()) => {
4425
+ var mu = (e6) => typeof e6 == `number` && e6 > 0 ? e6 : void 0;
4426
+ var hu = (e6) => e6.replace(/&/g, `&amp;`).replace(/</g, `&lt;`).replace(/>/g, `&gt;`).replace(/"/g, `&quot;`).replace(/'/g, `&#39;`);
4427
+ var $ = (e6) => ({ text: e6, html: `<p>${hu(e6)}</p>`, linkList: [] });
4428
+ var gu = 6e4;
4429
+ var _u = gu * 60;
4430
+ var vu = _u * 24;
4431
+ var yu = vu * 7;
4432
+ var bu = (e6) => e6 < gu ? [`second`, e6 / 1e3] : e6 < _u ? [`minute`, e6 / gu] : e6 < vu ? [`hour`, e6 / _u] : [`day`, e6 / vu];
4433
+ var xu = (e6, t2, n2 = Date.now()) => {
4428
4434
  let r2 = e6 instanceof Date ? e6 : new Date(e6), i2 = n2 - r2.getTime();
4429
- if (i2 >= 0 && i2 < vu) {
4430
- let [e7, n3] = yu(i2);
4435
+ if (i2 >= 0 && i2 < yu) {
4436
+ let [e7, n3] = bu(i2);
4431
4437
  return new Intl.RelativeTimeFormat(t2).format(-Math.round(n3), e7);
4432
4438
  }
4433
4439
  let a2 = r2.getFullYear() === new Date(n2).getFullYear();
4434
4440
  return new Intl.DateTimeFormat(t2, { ...a2 ? {} : { year: `numeric` }, month: `short`, day: `numeric` }).format(r2);
4435
4441
  };
4436
- var xu = `https://static.wixstatic.com/media/`;
4437
- var Su = 100;
4438
- var Cu = (e6, t2 = ``) => {
4442
+ var Su = `https://static.wixstatic.com/media/`;
4443
+ var Cu = 100;
4444
+ var wu = (e6, t2 = ``) => {
4439
4445
  let n2 = e6?.profile?.photo;
4440
4446
  if (!n2?.url) return;
4441
- let r2 = e6?.profile?.nickname, { _id: i2 } = n2, a2 = i2 || (n2.url.startsWith(xu) ? n2.url.slice(35).split(/[?#]/)[0] : void 0);
4442
- return { ...a2 && { uri: a2 }, url: n2.url, name: r2 ?? a2 ?? `author-photo`, width: n2.width || Su, height: n2.height || Su, alt: r2 ?? t2 };
4443
- };
4444
- var wu = `https://static.wixstatic.com/media/`;
4445
- var Tu = `wix:image://`;
4446
- var Eu = 1200;
4447
- var Du = 800;
4448
- var Ou = (e6) => {
4447
+ let r2 = e6?.profile?.nickname, { _id: i2 } = n2, a2 = i2 || (n2.url.startsWith(Su) ? n2.url.slice(35).split(/[?#]/)[0] : void 0);
4448
+ return { ...a2 && { uri: a2 }, url: n2.url, name: r2 ?? a2 ?? `author-photo`, width: n2.width || Cu, height: n2.height || Cu, alt: r2 ?? t2 };
4449
+ };
4450
+ var Tu = `https://static.wixstatic.com/media/`;
4451
+ var Eu = `wix:image://`;
4452
+ var Du = 1200;
4453
+ var Ou = 800;
4454
+ var ku = (e6) => {
4449
4455
  if (!e6) return;
4450
4456
  let t2 = Number.parseInt(e6, 10);
4451
4457
  return Number.isFinite(t2) && t2 > 0 ? t2 : void 0;
4452
4458
  };
4453
- var ku = (e6) => {
4454
- if (!e6.startsWith(Tu)) {
4459
+ var Au = (e6) => {
4460
+ if (!e6.startsWith(Eu)) {
4455
4461
  let t3 = e6.split(/[?#]/)[0];
4456
4462
  return t3 ? { uri: t3 } : void 0;
4457
4463
  }
4458
4464
  let [t2, n2] = e6.slice(12).split(`#`), [, r2, i2] = t2.split(`/`).filter(Boolean);
4459
4465
  if (!r2) return;
4460
4466
  let a2 = new URLSearchParams(n2 ?? ``);
4461
- return { uri: decodeURIComponent(r2), name: i2 ? decodeURIComponent(i2) : void 0, width: Ou(a2.get(`originWidth`)), height: Ou(a2.get(`originHeight`)) };
4467
+ return { uri: decodeURIComponent(r2), name: i2 ? decodeURIComponent(i2) : void 0, width: ku(a2.get(`originWidth`)), height: ku(a2.get(`originHeight`)) };
4462
4468
  };
4463
- var Au = (e6, t2) => {
4469
+ var ju = (e6, t2) => {
4464
4470
  if (!e6) return;
4465
- let n2 = ku(e6);
4471
+ let n2 = Au(e6);
4466
4472
  if (!n2) return;
4467
4473
  let r2 = n2.name ?? n2.uri;
4468
- return { uri: n2.uri, url: `${wu}${n2.uri}`, name: r2, width: n2.width ?? Eu, height: n2.height ?? Du, alt: t2 ?? r2 };
4474
+ return { uri: n2.uri, url: `${Tu}${n2.uri}`, name: r2, width: n2.width ?? Du, height: n2.height ?? Ou, alt: t2 ?? r2 };
4469
4475
  };
4470
- var ju = (e6) => {
4476
+ var Mu = (e6) => {
4471
4477
  let t2 = e6?.media?.wixMedia?.image;
4472
4478
  if (!t2) return;
4473
- let n2 = ku(t2);
4479
+ let n2 = Au(t2);
4474
4480
  if (!n2) return;
4475
4481
  let r2 = n2.name ?? n2.uri;
4476
- return { uri: n2.uri, url: `${wu}${n2.uri}`, name: r2, width: n2.width ?? Eu, height: n2.height ?? Du, alt: e6?.media?.altText ?? e6?.title ?? r2 };
4482
+ return { uri: n2.uri, url: `${Tu}${n2.uri}`, name: r2, width: n2.width ?? Du, height: n2.height ?? Ou, alt: e6?.media?.altText ?? e6?.title ?? r2 };
4477
4483
  };
4478
- var Mu = `https://static.wixstatic.com/media/`;
4479
- var Nu = `wix:video://`;
4480
- var Pu = (e6) => {
4484
+ var Nu = `https://static.wixstatic.com/media/`;
4485
+ var Pu = `wix:video://`;
4486
+ var Fu = (e6) => {
4481
4487
  if (!e6) return;
4482
4488
  let t2 = Number.parseInt(e6, 10);
4483
4489
  return Number.isFinite(t2) && t2 > 0 ? t2 : void 0;
4484
4490
  };
4485
- var Fu = (e6) => {
4486
- if (!e6.startsWith(Nu)) return;
4491
+ var Iu = (e6) => {
4492
+ if (!e6.startsWith(Pu)) return;
4487
4493
  let [t2, n2] = e6.slice(12).split(`#`), [, r2] = t2.split(`/`).filter(Boolean);
4488
4494
  if (!r2) return;
4489
4495
  let i2 = new URLSearchParams(n2 ?? ``), a2 = i2.get(`posterUri`);
4490
- return { id: decodeURIComponent(r2), posterUrl: a2 ? `${Mu}${a2}` : void 0, posterWidth: Pu(i2.get(`posterWidth`)), posterHeight: Pu(i2.get(`posterHeight`)) };
4496
+ return { id: decodeURIComponent(r2), posterUrl: a2 ? `${Nu}${a2}` : void 0, posterWidth: Fu(i2.get(`posterWidth`)), posterHeight: Fu(i2.get(`posterHeight`)) };
4491
4497
  };
4492
- var Iu = [/https?:\/\/(?:www\.|m\.)?youtube\.com\/watch\?(?:[^#]*&)?v=([\w-]+)/i, /https?:\/\/(?:www\.)?youtube\.com\/embed\/([\w-]+)/i, /https?:\/\/youtu\.be\/([\w-]+)/i];
4493
- var Lu = [/https?:\/\/player\.vimeo\.com\/video\/(\d+)/i, /https?:\/\/vimeo\.com\/(\d+)/i];
4494
- var Ru = (e6, t2) => {
4498
+ var Lu = [/https?:\/\/(?:www\.|m\.)?youtube\.com\/watch\?(?:[^#]*&)?v=([\w-]+)/i, /https?:\/\/(?:www\.)?youtube\.com\/embed\/([\w-]+)/i, /https?:\/\/youtu\.be\/([\w-]+)/i];
4499
+ var Ru = [/https?:\/\/player\.vimeo\.com\/video\/(\d+)/i, /https?:\/\/vimeo\.com\/(\d+)/i];
4500
+ var zu = (e6, t2) => {
4495
4501
  for (let n2 of e6) {
4496
4502
  let e7 = n2.exec(t2);
4497
4503
  if (e7) return e7[1];
4498
4504
  }
4499
4505
  };
4500
- var zu = (e6) => {
4501
- let t2 = Ru(Iu, e6);
4506
+ var Bu = (e6) => {
4507
+ let t2 = zu(Lu, e6);
4502
4508
  if (t2) return { provider: `youtube`, embedUrl: `https://www.youtube.com/embed/${t2}?autoplay=1` };
4503
- let n2 = Ru(Lu, e6);
4509
+ let n2 = zu(Ru, e6);
4504
4510
  return n2 ? { provider: `vimeo`, embedUrl: `https://player.vimeo.com/video/${n2}?autoplay=1` } : { provider: `unknown` };
4505
4511
  };
4506
- var Bu = (e6, t2 = []) => {
4512
+ var Vu = (e6, t2 = []) => {
4507
4513
  let n2 = e6?.media;
4508
4514
  if (!n2 || n2.displayed === false) return;
4509
- let r2 = ju(e6);
4515
+ let r2 = Mu(e6);
4510
4516
  if (r2) return { kind: `image`, image: r2 };
4511
- let i2 = n2.altText ?? e6?.title ?? ``, a2 = n2.wixMedia?.videoV2 ? Fu(n2.wixMedia.videoV2) : void 0;
4517
+ let i2 = n2.altText ?? e6?.title ?? ``, a2 = n2.wixMedia?.videoV2 ? Iu(n2.wixMedia.videoV2) : void 0;
4512
4518
  if (a2) return { kind: `wixVideo`, ...a2, sources: t2, altText: i2 };
4513
4519
  let o2 = n2.embedMedia?.video?.url;
4514
4520
  if (o2) {
4515
4521
  let { thumbnail: e7 } = n2.embedMedia ?? {};
4516
- return { kind: `embed`, videoUrl: o2, ...zu(o2), thumbnailUrl: e7?.url, thumbnailWidth: e7?.width, thumbnailHeight: e7?.height, altText: i2 };
4522
+ return { kind: `embed`, videoUrl: o2, ...Bu(o2), thumbnailUrl: e7?.url, thumbnailWidth: e7?.width, thumbnailHeight: e7?.height, altText: i2 };
4517
4523
  }
4518
4524
  };
4519
- var Vu = (e6) => {
4520
- let t2 = ju(e6), n2 = e6?.media?.wixMedia?.videoV2;
4525
+ var Hu = (e6) => {
4526
+ let t2 = Mu(e6), n2 = e6?.media?.wixMedia?.videoV2;
4521
4527
  if (t2 || !n2) return t2;
4522
- let r2 = Fu(n2), i2 = Au(r2?.posterUrl?.slice(35), e6?.media?.altText ?? e6?.title);
4528
+ let r2 = Iu(n2), i2 = ju(r2?.posterUrl?.slice(35), e6?.media?.altText ?? e6?.title);
4523
4529
  return i2 && { ...i2, width: r2?.posterWidth ?? i2.width, height: r2?.posterHeight ?? i2.height };
4524
4530
  };
4525
- var Hu = (e6, t2) => e6 && t2 ? `${e6}/${encodeURIComponent(t2)}` : void 0;
4526
- var Uu = (e6, t2) => {
4527
- let n2 = Hu(e6, t2);
4531
+ var Uu = (e6, t2) => e6 && t2 ? `${e6}/${encodeURIComponent(t2)}` : void 0;
4532
+ var Wu = (e6, t2) => {
4533
+ let n2 = Uu(e6, t2);
4528
4534
  return n2 ? { href: n2, target: `_self` } : void 0;
4529
4535
  };
4530
- var Wu = { href: `#`, target: `_self` };
4531
- var Gu = (e6, t2) => {
4536
+ var Gu = { href: `#`, target: `_self` };
4537
+ var Ku = (e6, t2) => {
4532
4538
  let { _id: n2, label: r2, slug: i2 } = e6, a2 = r2 ?? ``;
4533
- return { _id: n2 ?? i2 ?? ``, label: a2, itemCategoryLabel: $(a2), itemCategoryLink: Uu(t2, i2 ?? ``), categoryItem: { label: a2, slug: i2 ?? `` } };
4539
+ return { _id: n2 ?? i2 ?? ``, label: a2, itemCategoryLabel: $(a2), itemCategoryLink: Wu(t2, i2 ?? ``), categoryItem: { label: a2, slug: i2 ?? `` } };
4534
4540
  };
4535
- var Ku = 2;
4536
- var qu = (e6) => Array.from({ length: Ku }, (t2, n2) => {
4541
+ var qu = 2;
4542
+ var Ju = (e6) => Array.from({ length: qu }, (t2, n2) => {
4537
4543
  let r2 = e6.canvas.categoryNumbered(n2 + 1);
4538
- return { _id: `placeholder-category-${n2}`, label: r2, itemCategoryLabel: $(r2), itemCategoryLink: Wu, categoryItem: { label: r2, slug: `` } };
4544
+ return { _id: `placeholder-category-${n2}`, label: r2, itemCategoryLabel: $(r2), itemCategoryLink: Gu, categoryItem: { label: r2, slug: `` } };
4539
4545
  });
4540
- var Ju = (e6, t2) => {
4546
+ var Yu = (e6, t2) => {
4541
4547
  let { _id: n2, label: r2, slug: i2 } = e6, a2 = r2 ?? ``;
4542
- return { _id: n2 ?? i2 ?? ``, label: a2, itemTagLabel: $(a2), itemTagLink: Uu(t2, i2 ?? ``), tagItem: { label: a2, slug: i2 ?? `` } };
4548
+ return { _id: n2 ?? i2 ?? ``, label: a2, itemTagLabel: $(a2), itemTagLink: Wu(t2, i2 ?? ``), tagItem: { label: a2, slug: i2 ?? `` } };
4543
4549
  };
4544
- var Yu = 3;
4545
- var Xu = (e6) => Array.from({ length: Yu }, (t2, n2) => {
4550
+ var Xu = 3;
4551
+ var Zu = (e6) => Array.from({ length: Xu }, (t2, n2) => {
4546
4552
  let r2 = e6.canvas.tagNumbered(n2 + 1);
4547
- return { _id: `placeholder-tag-${n2}`, label: r2, itemTagLabel: $(r2), itemTagLink: Wu, tagItem: { label: r2, slug: `` } };
4553
+ return { _id: `placeholder-tag-${n2}`, label: r2, itemTagLabel: $(r2), itemTagLink: Gu, tagItem: { label: r2, slug: `` } };
4548
4554
  });
4549
- var Zu = 1;
4550
- var Qu = { views: 120, comments: 4, likes: 12 };
4551
- var $u = (e6) => ({ nodes: [{ type: `PARAGRAPH`, nodes: [{ type: `TEXT`, nodes: [], textData: { text: e6, decorations: [] } }] }] });
4552
- var ed = (e6, t2, n2, r2) => $(e6 === void 0 ? n2 ? r2(t2) : `` : r2(e6));
4553
- var td = (e6, t2, n2) => e6 ?? (n2 ? t2 : void 0);
4554
- var nd = { nodes: [] };
4555
- var rd = () => ({ title: $(``), excerpt: $(``), coverImage: void 0, coverMedia: void 0, richContent: nd, 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 });
4556
- var id = ({ post: e6, author: t2, metrics: n2, categories: r2, tags: i2, videoSources: a2 }, o2, s2, c2 = false, l2 = Date.now(), u2 = {}) => !e6 && !c2 ? rd() : { title: $(e6?.title ?? o2.canvas.postTitle()), excerpt: $(e6?.excerpt ?? o2.canvas.excerpt()), coverImage: Vu(e6), coverMedia: Bu(e6, a2), richContent: e6?.richContent ?? $u(o2.canvas.content()), authorName: $(t2?.profile?.nickname ?? o2.canvas.authorName()), authorImage: Cu(t2, o2.canvas.authorPhotoAlt()), timeToRead: $(typeof e6?.minutesToRead == `number` && e6.minutesToRead > 0 ? o2.timeToRead(e6.minutesToRead) : c2 ? o2.timeToRead(Zu) : ``), publishedDate: $(bu(e6?.firstPublishedDate ?? new Date(l2), s2, l2)), viewCount: ed(n2?.views, Qu.views, c2, o2.viewCount), commentCount: ed(n2?.comments, Qu.comments, c2, o2.commentCount), likeCount: ed(n2?.likes, Qu.likes, c2, o2.likeCount), postCategories: r2.length === 0 && c2 ? qu(o2) : r2.map((e7) => Gu(e7, u2.category)), itemCategoryLabel: $(r2[0]?.label ?? (c2 ? o2.canvas.category() : ``)), postTags: i2.length === 0 && c2 ? Xu(o2) : i2.map((e7) => Ju(e7, u2.tag)), hasCoverImage: !e6 || e6.media?.displayed !== false && Vu(e6) !== void 0, hasExcerpt: !e6 || !!e6.excerpt?.trim(), hasTags: !e6 || i2.length > 0, publishedDateValue: fu(e6?.firstPublishedDate) ?? (c2 ? `2026-05-12T12:00:00.000Z` : void 0), minutesToReadValue: pu(e6?.minutesToRead) ?? (c2 ? Zu : void 0), viewCountValue: td(n2?.views, Qu.views, c2), commentCountValue: td(n2?.comments, Qu.comments, c2) };
4557
- var ad = ({ postWithAuthor: e6, hasError: t2, monitoringClient: n2, isPostInPreview: r2, postPageBase: i2 }) => {
4558
- let { t: a2 } = yo(), o2 = nu(), s2 = u(() => au(a2, o2), [a2, o2]), c2 = Hl(e6.fetchedAt), l2 = uu(), { isLiked: d2, likeCount: f2, isLikeCountLoaded: p2, viewCount: m2, commentCount: h2, toggleLike: g2, liveLikes: _2 } = tu(e6.post?._id ?? void 0, e6.metrics?.likes ?? 0, r2, n2), v2 = Bl(er), y2 = Bl(`tag`), b2 = u(() => kl(e6.post), [e6]), x2 = ru(), S2 = u(() => e6.post?.richContent && e6.paywall ? Qc(e6.post.richContent, e6.paywall, x2) : void 0, [e6, x2]);
4555
+ var Qu = 1;
4556
+ var $u = { views: 120, comments: 4, likes: 12 };
4557
+ var ed = (e6) => ({ nodes: [{ type: `PARAGRAPH`, nodes: [{ type: `TEXT`, nodes: [], textData: { text: e6, decorations: [] } }] }] });
4558
+ var td = (e6, t2, n2, r2) => $(e6 === void 0 ? n2 ? r2(t2) : `` : r2(e6));
4559
+ var nd = (e6, t2, n2) => e6 ?? (n2 ? t2 : void 0);
4560
+ var rd = { nodes: [] };
4561
+ var id = () => ({ title: $(``), excerpt: $(``), coverImage: void 0, coverMedia: void 0, richContent: rd, 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 });
4562
+ var ad = ({ post: e6, author: t2, metrics: n2, categories: r2, tags: i2, videoSources: a2 }, o2, s2, c2 = false, l2 = Date.now(), u2 = {}) => !e6 && !c2 ? id() : { title: $(e6?.title ?? o2.canvas.postTitle()), excerpt: $(e6?.excerpt ?? o2.canvas.excerpt()), coverImage: Hu(e6), coverMedia: Vu(e6, a2), richContent: e6?.richContent ?? ed(o2.canvas.content()), authorName: $(t2?.profile?.nickname ?? o2.canvas.authorName()), authorImage: wu(t2, o2.canvas.authorPhotoAlt()), timeToRead: $(typeof e6?.minutesToRead == `number` && e6.minutesToRead > 0 ? o2.timeToRead(e6.minutesToRead) : c2 ? o2.timeToRead(Qu) : ``), publishedDate: $(xu(e6?.firstPublishedDate ?? new Date(l2), s2, l2)), viewCount: td(n2?.views, $u.views, c2, o2.viewCount), commentCount: td(n2?.comments, $u.comments, c2, o2.commentCount), likeCount: td(n2?.likes, $u.likes, c2, o2.likeCount), postCategories: r2.length === 0 && c2 ? Ju(o2) : r2.map((e7) => Ku(e7, u2.category)), itemCategoryLabel: $(r2[0]?.label ?? (c2 ? o2.canvas.category() : ``)), postTags: i2.length === 0 && c2 ? Zu(o2) : i2.map((e7) => Yu(e7, u2.tag)), hasCoverImage: !e6 || e6.media?.displayed !== false && Hu(e6) !== void 0, hasExcerpt: !e6 || !!e6.excerpt?.trim(), hasTags: !e6 || i2.length > 0, publishedDateValue: pu(e6?.firstPublishedDate) ?? (c2 ? `2026-05-12T12:00:00.000Z` : void 0), minutesToReadValue: mu(e6?.minutesToRead) ?? (c2 ? Qu : void 0), viewCountValue: nd(n2?.views, $u.views, c2), commentCountValue: nd(n2?.comments, $u.comments, c2) };
4563
+ var od = ({ postWithAuthor: e6, hasError: t2, monitoringClient: n2, isPostInPreview: r2, postPageBase: i2 }) => {
4564
+ let { t: a2 } = yo(), o2 = ru(), s2 = u(() => ou(a2, o2), [a2, o2]), c2 = Hl(e6.fetchedAt), l2 = du(), { isLiked: d2, likeCount: f2, isLikeCountLoaded: p2, viewCount: m2, commentCount: h2, toggleLike: g2, liveLikes: _2 } = tu(e6.post?._id ?? void 0, e6.metrics?.likes ?? 0, r2, n2), v2 = Bl(er), y2 = Bl(`tag`), b2 = u(() => kl(e6.post), [e6]), x2 = iu(), S2 = u(() => e6.post?.richContent && e6.paywall ? Qc(e6.post.richContent, e6.paywall, x2) : void 0, [e6, x2]);
4559
4565
  return u(() => {
4560
- let n3 = id(!e6.post && l2 && e6.demoPost ? { ...e6, post: e6.demoPost } : e6, s2, o2, l2, c2, { category: v2, tag: y2 }), a3 = r2 || !e6.post ? void 0 : lr(e6.post, i2), u2 = a3 ?? (l2 ? du(i2) : void 0);
4566
+ let n3 = ad(!e6.post && l2 && e6.demoPost ? { ...e6, post: e6.demoPost } : e6, s2, o2, l2, c2, { category: v2, tag: y2 }), a3 = r2 || !e6.post ? void 0 : lr(e6.post, i2), u2 = a3 ?? (l2 ? fu(i2) : void 0);
4561
4567
  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 };
4562
4568
  }, [e6, t2, b2, S2, s2, o2, c2, f2, d2, p2, m2, h2, g2, _2, l2, r2, i2, v2, y2]);
4563
4569
  };
4564
- var od = (e6) => ({ post: e6, hasError: false });
4565
- var sd = () => ({ post: { post: void 0, author: void 0, metrics: void 0, categories: [], tags: [], fetchedAt: Date.now() }, hasError: true });
4566
- var cd = (e6) => {
4570
+ var sd = (e6) => ({ post: e6, hasError: false });
4571
+ var cd = () => ({ post: { post: void 0, author: void 0, metrics: void 0, categories: [], tags: [], fetchedAt: Date.now() }, hasError: true });
4572
+ var ld = (e6) => {
4567
4573
  throw e6;
4568
4574
  };
4569
- var ld = { ...rd(), isLiked: false, likeCountValue: 0, isLikeCountLoaded: false, toggleLike: async () => {
4575
+ var ud = { ...id(), isLiked: false, likeCountValue: 0, isLikeCountLoaded: false, toggleLike: async () => {
4570
4576
  }, 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 };
4571
- var ud = { ...ld, isLoadingPost: false, hasError: true, isEmpty: true };
4572
- function dd() {
4577
+ var dd = { ...ud, isLoadingPost: false, hasError: true, isEmpty: true };
4578
+ function fd() {
4573
4579
  return t();
4574
4580
  }
4575
- var fd = 2500;
4576
- var pd = Promise.resolve(od({ post: void 0, author: void 0, metrics: void 0, categories: [], tags: [], fetchedAt: 0 }));
4577
- var md = ({ children: t2, postId: n2, postLoadPromise: r2, monitoringClient: i2 }) => {
4578
- let { post: a2, hasError: o2 } = Vn(r2), c2 = Xn(a2, s(() => n2 ? El(n2) : Promise.resolve(void 0), [n2])), l2 = ad({ postWithAuthor: c2, hasError: o2, monitoringClient: i2, isPostInPreview: false, postPageBase: dr() });
4581
+ var pd = 2500;
4582
+ var md = Promise.resolve(sd({ post: void 0, author: void 0, metrics: void 0, categories: [], tags: [], fetchedAt: 0 }));
4583
+ var hd = ({ children: t2, postId: n2, postLoadPromise: r2, monitoringClient: i2 }) => {
4584
+ let { post: a2, hasError: o2 } = Vn(r2), c2 = Xn(a2, s(() => n2 ? El(n2) : Promise.resolve(void 0), [n2])), l2 = od({ postWithAuthor: c2, hasError: o2, monitoringClient: i2, isPostInPreview: false, postPageBase: dr() });
4579
4585
  return mr(fr.postByIdProvider, o2 ? `error` : c2.post ? `data` : `empty`), h(e, { value: l2, children: t2 });
4580
4586
  };
4581
- function hd({ children: t2, postPicker: n2 }) {
4587
+ function gd({ children: t2, postPicker: n2 }) {
4582
4588
  let i2 = zl(n2), a2 = Gn(), o2 = gr(), s2 = u(() => jl(zn), []), { i18n: c2, locale: l2 } = Go($o), d2 = qn(() => i2 ? Un(Mo({ key: `blog-builder:post-by-id:${i2}`, warmupData: o2, fetchData: () => {
4583
4589
  let e6 = Dl(i2, a2);
4584
- return Il(Pl(s2, `post-by-id-read`, { feature: Al.post }, a2 ? fl(e6, fd, `post-by-id`) : e6));
4585
- } }), od, a2 ? cd : sd) : pd, [i2, a2, o2, s2]);
4586
- return h(bo, { i18n: c2, children: g(r, { fallback: h(e, { value: ld, children: t2 }), children: [h(Wo, { i18n: c2, locale: l2 }), h(Fl, { fallback: h(e, { value: ud, children: t2 }), feature: Al.post, monitoringClient: s2, rethrow: a2, children: h(md, { postId: i2, postLoadPromise: d2, monitoringClient: s2, children: t2 }, i2 ?? ``) })] }) });
4590
+ return Il(Pl(s2, `post-by-id-read`, { feature: Al.post }, a2 ? fl(e6, pd, `post-by-id`) : e6));
4591
+ } }), sd, a2 ? ld : cd) : md, [i2, a2, o2, s2]);
4592
+ return h(bo, { i18n: c2, children: g(r, { fallback: h(e, { value: ud, children: t2 }), children: [h(Wo, { i18n: c2, locale: l2 }), h(Fl, { fallback: h(e, { value: dd, children: t2 }), feature: Al.post, monitoringClient: s2, rethrow: a2, children: h(hd, { postId: i2, postLoadPromise: d2, monitoringClient: s2, children: t2 }, i2 ?? ``) })] }) });
4587
4593
  }
4588
- var gd = Mn(`474ee948-702b-4c0f-970e-b5319eff6d8b`);
4594
+ var _d = Mn(`474ee948-702b-4c0f-970e-b5319eff6d8b`);
4589
4595
  export {
4590
- hd as PostByIdProvider,
4591
- hd as default,
4592
- gd as injectAccessTokenGetter,
4593
- dd as usePostByIdContext
4596
+ gd as PostByIdProvider,
4597
+ gd as default,
4598
+ _d as injectAccessTokenGetter,
4599
+ fd as usePostByIdContext
4594
4600
  };
4595
4601
  //# sourceMappingURL=context-post-by-id.mjs.map