@burdenoff/website-sdk 2026.1021.2 → 2026.1021.4

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/dist/index.mjs CHANGED
@@ -1287,10 +1287,15 @@ function useContentPage(slug, options) {
1287
1287
  hasProvider,
1288
1288
  productLoading
1289
1289
  );
1290
+ const enabled = options?.enabled !== false;
1290
1291
  const [data, setData] = useState(null);
1291
- const [loading, setLoading] = useState(true);
1292
+ const [loading, setLoading] = useState(enabled);
1292
1293
  const [error, setError] = useState(null);
1293
1294
  const fetchPage = useCallback(async () => {
1295
+ if (!enabled) {
1296
+ setLoading(false);
1297
+ return;
1298
+ }
1294
1299
  if (gate === "wait") return;
1295
1300
  if (gate === "unavailable") {
1296
1301
  setData(null);
@@ -1324,7 +1329,15 @@ function useContentPage(slug, options) {
1324
1329
  } finally {
1325
1330
  setLoading(false);
1326
1331
  }
1327
- }, [client, gate, productError, resolvedProductId, slug, options?.resolve]);
1332
+ }, [
1333
+ client,
1334
+ enabled,
1335
+ gate,
1336
+ productError,
1337
+ resolvedProductId,
1338
+ slug,
1339
+ options?.resolve
1340
+ ]);
1328
1341
  useEffect(() => {
1329
1342
  fetchPage();
1330
1343
  }, [fetchPage]);
@@ -3653,7 +3666,7 @@ function PricingSection(props) {
3653
3666
  /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: subtitle })
3654
3667
  ] }),
3655
3668
  /* @__PURE__ */ jsxs("div", { className: "text-center mb-2", children: [
3656
- price === "Custom" ? /* @__PURE__ */ jsx("span", { className: "text-3xl sm:text-4xl font-bold", children: "Custom" }) : /* @__PURE__ */ jsxs("div", { className: "flex items-baseline justify-center gap-1", children: [
3669
+ price === "Custom" ? /* @__PURE__ */ jsx("p", { className: "text-3xl sm:text-4xl font-bold", children: "Custom" }) : /* @__PURE__ */ jsxs("p", { className: "flex items-baseline justify-center gap-1", children: [
3657
3670
  /* @__PURE__ */ jsx("span", { className: "text-4xl sm:text-5xl font-extrabold", children: price }),
3658
3671
  /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-lg", children: period })
3659
3672
  ] }),
@@ -3721,7 +3734,7 @@ function PricingSection(props) {
3721
3734
  /* @__PURE__ */ jsx("h3", { className: "text-xl sm:text-2xl font-bold mb-2", children: plan.name }),
3722
3735
  /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: plan.description })
3723
3736
  ] }),
3724
- /* @__PURE__ */ jsx("div", { className: "text-center mb-8", children: plan.price === "Custom" ? /* @__PURE__ */ jsx("span", { className: "text-3xl sm:text-4xl font-bold", children: "Custom" }) : /* @__PURE__ */ jsxs("div", { className: "flex items-baseline justify-center gap-1", children: [
3737
+ /* @__PURE__ */ jsx("div", { className: "text-center mb-8", children: plan.price === "Custom" ? /* @__PURE__ */ jsx("p", { className: "text-3xl sm:text-4xl font-bold", children: "Custom" }) : /* @__PURE__ */ jsxs("p", { className: "flex items-baseline justify-center gap-1", children: [
3725
3738
  /* @__PURE__ */ jsx("span", { className: "text-4xl sm:text-5xl font-bold", children: plan.price }),
3726
3739
  /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-lg", children: plan.interval })
3727
3740
  ] }) }),
@@ -14757,6 +14770,205 @@ function RybbitAnalytics({
14757
14770
  }, [siteId, scriptUrl, enabled]);
14758
14771
  return null;
14759
14772
  }
14773
+ var LEGAL_DOCUMENTS = {
14774
+ privacy: {
14775
+ key: "privacy",
14776
+ slug: "privacy-policy",
14777
+ title: "Privacy Policy",
14778
+ description: "How we collect, use, share and protect your personal information."
14779
+ },
14780
+ terms: {
14781
+ key: "terms",
14782
+ slug: "terms-of-service",
14783
+ title: "Terms of Service",
14784
+ description: "The terms that govern your use of the service."
14785
+ },
14786
+ cookies: {
14787
+ key: "cookies",
14788
+ slug: "cookie-policy",
14789
+ title: "Cookie Policy",
14790
+ description: "The cookies and similar technologies we use, and why."
14791
+ },
14792
+ refunds: {
14793
+ key: "refunds",
14794
+ slug: "refund-policy",
14795
+ title: "Refund Policy",
14796
+ description: "How cancellations and refunds work for paid plans."
14797
+ },
14798
+ aup: {
14799
+ key: "aup",
14800
+ slug: "acceptable-use-policy",
14801
+ title: "Acceptable Use Policy",
14802
+ description: "What you may and may not do with the service."
14803
+ },
14804
+ dpa: {
14805
+ key: "dpa",
14806
+ slug: "data-processing-addendum",
14807
+ title: "Data Processing Addendum",
14808
+ description: "Our obligations as a processor of personal data on your behalf."
14809
+ },
14810
+ "ai-terms": {
14811
+ key: "ai-terms",
14812
+ slug: "ai-product-terms",
14813
+ title: "AI Product Terms",
14814
+ description: "The terms that apply to AI features, including how your data is and is not used."
14815
+ },
14816
+ subprocessors: {
14817
+ key: "subprocessors",
14818
+ slug: "subprocessors",
14819
+ title: "Subprocessors",
14820
+ description: "The third parties that help us host, secure and support the service."
14821
+ }
14822
+ };
14823
+ var LEGAL_DOCUMENT_KEYS = Object.keys(
14824
+ LEGAL_DOCUMENTS
14825
+ );
14826
+ function findLegalDocument(keyOrSlug) {
14827
+ if (Object.prototype.hasOwnProperty.call(LEGAL_DOCUMENTS, keyOrSlug)) {
14828
+ return LEGAL_DOCUMENTS[keyOrSlug];
14829
+ }
14830
+ return Object.values(LEGAL_DOCUMENTS).find((doc) => doc.slug === keyOrSlug) ?? null;
14831
+ }
14832
+ var LEGAL_CONTENT_QUERY = `
14833
+ query PublicLegalContentPage($slug: String!, $productId: String!) {
14834
+ publicResolvedContentPage(slug: $slug, productId: $productId) {
14835
+ title
14836
+ slug
14837
+ content
14838
+ contentFormat
14839
+ seoTitle
14840
+ seoDescription
14841
+ seoKeywords
14842
+ lastUpdated
14843
+ }
14844
+ }
14845
+ `;
14846
+ async function fetchLegalContentPage(client, slug, productId) {
14847
+ const result = await client.query(LEGAL_CONTENT_QUERY, { slug, productId }, { cache: false });
14848
+ if (result.errors?.length) {
14849
+ throw new Error(result.errors[0]?.message ?? "Unknown error");
14850
+ }
14851
+ return result.data?.publicResolvedContentPage ?? null;
14852
+ }
14853
+ async function fetchLegalContent(client, options) {
14854
+ const docs = (options.documents ?? LEGAL_DOCUMENT_KEYS).map(
14855
+ (key) => LEGAL_DOCUMENTS[key]
14856
+ );
14857
+ const entries = await Promise.all(
14858
+ docs.map(
14859
+ async (doc) => [
14860
+ doc.slug,
14861
+ await fetchLegalContentPage(client, doc.slug, options.productId)
14862
+ ]
14863
+ )
14864
+ );
14865
+ return Object.fromEntries(entries);
14866
+ }
14867
+ function splitLeadingHeading(content, format) {
14868
+ if (format.toLowerCase() !== "markdown")
14869
+ return { heading: null, body: content };
14870
+ const match = /^\s*#[ \t]+([^\n]+?)[ \t#]*(?:\n|$)/.exec(content);
14871
+ if (!match?.[1]) return { heading: null, body: content };
14872
+ return {
14873
+ heading: match[1].trim(),
14874
+ body: content.slice(match[0].length).replace(/^\s+/, "")
14875
+ };
14876
+ }
14877
+ function formatLegalDate(iso) {
14878
+ if (!iso) return null;
14879
+ const date = new Date(iso);
14880
+ if (Number.isNaN(date.getTime())) return null;
14881
+ return date.toLocaleDateString("en-US", {
14882
+ year: "numeric",
14883
+ month: "long",
14884
+ day: "numeric",
14885
+ timeZone: "UTC"
14886
+ });
14887
+ }
14888
+ function LegalPage(props) {
14889
+ const {
14890
+ document: document2,
14891
+ slug: slugProp,
14892
+ initialContent,
14893
+ fallbackTitle,
14894
+ fallbackDescription,
14895
+ productName,
14896
+ canonicalUrl,
14897
+ contactEmail,
14898
+ className = ""
14899
+ } = props;
14900
+ const registered = document2 ? LEGAL_DOCUMENTS[document2] : slugProp ? findLegalDocument(slugProp) : null;
14901
+ const slug = registered?.slug ?? slugProp ?? "";
14902
+ const prefetched = initialContent !== void 0;
14903
+ const { data: fetched, loading } = useContentPage(slug, {
14904
+ resolve: true,
14905
+ enabled: !prefetched && slug !== ""
14906
+ });
14907
+ const page = prefetched ? initialContent ?? null : fetched;
14908
+ const isLoading = !prefetched && slug !== "" && loading;
14909
+ const defaultTitle = fallbackTitle ?? registered?.title ?? "Legal";
14910
+ const defaultDescription = fallbackDescription ?? registered?.description ?? "";
14911
+ const { heading, body } = page ? splitLeadingHeading(page.content, page.contentFormat) : { heading: null, body: "" };
14912
+ const title = page?.title || heading || defaultTitle;
14913
+ const updated = formatLegalDate(page?.lastUpdated);
14914
+ const unavailable = !isLoading && !page;
14915
+ return /* @__PURE__ */ jsxs("div", { className: `w-full ${className}`, children: [
14916
+ /* @__PURE__ */ jsx(ProseStyles, {}),
14917
+ /* @__PURE__ */ jsx(
14918
+ PageHead,
14919
+ {
14920
+ title: page?.seoTitle || title,
14921
+ description: page?.seoDescription?.trim() || defaultDescription,
14922
+ keywords: page?.seoKeywords ?? void 0,
14923
+ productName,
14924
+ url: canonicalUrl,
14925
+ robots: unavailable ? "noindex, follow" : void 0
14926
+ }
14927
+ ),
14928
+ /* @__PURE__ */ jsxs(
14929
+ "article",
14930
+ {
14931
+ className: "max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-16 sm:py-24",
14932
+ "aria-busy": isLoading,
14933
+ children: [
14934
+ /* @__PURE__ */ jsx("h1", { className: "text-3xl sm:text-4xl font-bold tracking-tight text-foreground mb-3", children: title }),
14935
+ updated && /* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground mb-10", children: [
14936
+ "Last updated:",
14937
+ " ",
14938
+ /* @__PURE__ */ jsx("time", { dateTime: page?.lastUpdated ?? void 0, children: updated })
14939
+ ] }),
14940
+ isLoading ? /* @__PURE__ */ jsxs("div", { className: "space-y-3", "data-testid": "legal-page-loading", children: [
14941
+ /* @__PURE__ */ jsx("div", { className: "h-4 w-3/4 rounded bg-muted animate-pulse" }),
14942
+ /* @__PURE__ */ jsx("div", { className: "h-4 w-full rounded bg-muted animate-pulse" }),
14943
+ /* @__PURE__ */ jsx("div", { className: "h-4 w-5/6 rounded bg-muted animate-pulse" })
14944
+ ] }) : page ? /* @__PURE__ */ jsx("div", { className: "boff-prose max-w-none", children: /* @__PURE__ */ jsx(ContentRenderer, { content: body, format: page.contentFormat }) }) : /* @__PURE__ */ jsxs(
14945
+ "div",
14946
+ {
14947
+ role: "status",
14948
+ className: "rounded-xl border border-border bg-muted/30 p-6",
14949
+ children: [
14950
+ /* @__PURE__ */ jsx("p", { className: "text-base text-foreground", children: "This document is not available right now." }),
14951
+ contactEmail && /* @__PURE__ */ jsxs("p", { className: "mt-2 text-sm text-muted-foreground", children: [
14952
+ "For a copy, contact",
14953
+ " ",
14954
+ /* @__PURE__ */ jsx(
14955
+ "a",
14956
+ {
14957
+ className: "text-primary underline",
14958
+ href: `mailto:${contactEmail}`,
14959
+ children: contactEmail
14960
+ }
14961
+ ),
14962
+ "."
14963
+ ] })
14964
+ ]
14965
+ }
14966
+ )
14967
+ ]
14968
+ }
14969
+ )
14970
+ ] });
14971
+ }
14760
14972
  var PUBLIC_JOB_POSTING_FIELDS = (
14761
14973
  /* GraphQL */
14762
14974
  `
@@ -19313,6 +19525,6 @@ function shouldRenderSiteFooter(pathname) {
19313
19525
  return !isFooterlessPath(pathname);
19314
19526
  }
19315
19527
 
19316
- export { ANSWERS_PATH, ANSWER_HEADING_SHIFT, ANSWER_PATH_PREFIX, AnswerDetailPage, AnswersPage, BlogListPage, BlogPostPage, Button, CONCEPTS_PATH, CONCEPT_ILLUSTRATION_NOTICE, CONCEPT_PATH_PREFIX, CONCEPT_WORKFLOW_NOTICE, CareersApplyForm, CareersSubmissionForm, CaseStudiesListPage, CaseStudyPage, ChangelogPage, ConceptDetailPage, ConceptsPage, ContactPage, ContentRenderer, ContractsPage, DEFAULT_CONTACT_CATEGORIES, DEFAULT_EXPLORE_EXAMPLE_PROMPTS, DOMAINS_URL, ECOSYSTEM_PRODUCTS, ESCALATE_EXPLORE_CONVERSATION_MUTATION, EXPLORE_CATALOG_QUERY, EXPLORE_CATALOG_QUERY_WITHOUT_HIGHLIGHTS, EXPLORE_ESCALATION_NOTE_SOFT_MAX, EXPLORE_LOCALES, EXPLORE_MESSAGE_QUERY, EXPLORE_PREFILL_MAX_LENGTH, EXPLORE_RECAPTCHA_ACTION, ElectronDownloadLink, ExploreAnswerBody, ExploreAnswerStyles, ExploreCta, ExplorePage, FALLBACK_EXPLORE_LIMITS, FOOTERLESS_ROUTES, Input, Label, LaunchCountdown, Markdown, NewsletterForm, NewsletterPage, PRODUCT_SLUG_ALIASES, PRODUCT_SLUG_EMIT, PRODUCT_SLUG_RENAMES, PUBLISHED_ANSWER_FIELDS, PageHead, PartnersPage, PressKitPage, PricingPage, PricingProductKeyError, PricingSection, ProblemsSolvedSection, ProductCard, ProductProvider, ResourceLinks, RybbitAnalytics, SEND_EXPLORE_MESSAGE_MUTATION, Select, SocialLinks, StarRating, StoreBrowsePage, StoreHomePage, StoreProductDetailPage, Textarea, TypeBadge, UnsubscribePage, WaitlistForm, WaitlistPage, WebSDKClient, WebSDKProvider, WebsiteSwitcher, answerPath, answerPlainText, answerSourceHost, answerSpeechText, answerStrings, availablePlanCurrencies, buttonVariants, classifyExploreError, cleanPlanDisplayName, cn, conceptPath, detectElectronPlatform, emitProductSlug, exploreQuestionHref, fetchPublicJobPosting, fetchPublicJobPostings, fetchPublicJobPostingsForSubmission, fetchPublicProduct, formatAnswerDate, formatDownloads, formatPrice2 as formatPrice, getAnswerBySlug, getConceptBySlug, getRecaptchaV3Token, inlineImageOrigins, isFooterlessPath, isInlineImageAllowed, isInlineVideoAllowed, isPublishedSourceUrl, isSameProductSlug, isUuidLike, isValidUrl, legacyProductSlug, loadRecaptchaV3, looksLikeDeliverableEmail, normalizeProductSlug, normalizeRoutePath, planPriceIn, productSlugVariants, productSlugsByOrigin, resolvePricingProductKey, shouldRenderSiteFooter, speechLocaleOf, stopSpeaking, useContentPage, useContentPages, useExploreChat, useProduct, useProductConfig, useProgressiveReveal, usePublicJobPosting, usePublicJobPostings, usePublicJobPostingsForSubmission, useSpeechOutput, useWebSDK, useWebSDKConfig };
19528
+ export { ANSWERS_PATH, ANSWER_HEADING_SHIFT, ANSWER_PATH_PREFIX, AnswerDetailPage, AnswersPage, BlogListPage, BlogPostPage, Button, CONCEPTS_PATH, CONCEPT_ILLUSTRATION_NOTICE, CONCEPT_PATH_PREFIX, CONCEPT_WORKFLOW_NOTICE, CareersApplyForm, CareersSubmissionForm, CaseStudiesListPage, CaseStudyPage, ChangelogPage, ConceptDetailPage, ConceptsPage, ContactPage, ContentRenderer, ContractsPage, DEFAULT_CONTACT_CATEGORIES, DEFAULT_EXPLORE_EXAMPLE_PROMPTS, DOMAINS_URL, ECOSYSTEM_PRODUCTS, ESCALATE_EXPLORE_CONVERSATION_MUTATION, EXPLORE_CATALOG_QUERY, EXPLORE_CATALOG_QUERY_WITHOUT_HIGHLIGHTS, EXPLORE_ESCALATION_NOTE_SOFT_MAX, EXPLORE_LOCALES, EXPLORE_MESSAGE_QUERY, EXPLORE_PREFILL_MAX_LENGTH, EXPLORE_RECAPTCHA_ACTION, ElectronDownloadLink, ExploreAnswerBody, ExploreAnswerStyles, ExploreCta, ExplorePage, FALLBACK_EXPLORE_LIMITS, FOOTERLESS_ROUTES, Input, LEGAL_DOCUMENTS, LEGAL_DOCUMENT_KEYS, Label, LaunchCountdown, LegalPage, Markdown, NewsletterForm, NewsletterPage, PRODUCT_SLUG_ALIASES, PRODUCT_SLUG_EMIT, PRODUCT_SLUG_RENAMES, PUBLISHED_ANSWER_FIELDS, PageHead, PartnersPage, PressKitPage, PricingPage, PricingProductKeyError, PricingSection, ProblemsSolvedSection, ProductCard, ProductProvider, ResourceLinks, RybbitAnalytics, SEND_EXPLORE_MESSAGE_MUTATION, Select, SocialLinks, StarRating, StoreBrowsePage, StoreHomePage, StoreProductDetailPage, Textarea, TypeBadge, UnsubscribePage, WaitlistForm, WaitlistPage, WebSDKClient, WebSDKProvider, WebsiteSwitcher, answerPath, answerPlainText, answerSourceHost, answerSpeechText, answerStrings, availablePlanCurrencies, buttonVariants, classifyExploreError, cleanPlanDisplayName, cn, conceptPath, detectElectronPlatform, emitProductSlug, exploreQuestionHref, fetchLegalContent, fetchLegalContentPage, fetchPublicJobPosting, fetchPublicJobPostings, fetchPublicJobPostingsForSubmission, fetchPublicProduct, findLegalDocument, formatAnswerDate, formatDownloads, formatLegalDate, formatPrice2 as formatPrice, getAnswerBySlug, getConceptBySlug, getRecaptchaV3Token, inlineImageOrigins, isFooterlessPath, isInlineImageAllowed, isInlineVideoAllowed, isPublishedSourceUrl, isSameProductSlug, isUuidLike, isValidUrl, legacyProductSlug, loadRecaptchaV3, looksLikeDeliverableEmail, normalizeProductSlug, normalizeRoutePath, planPriceIn, productSlugVariants, productSlugsByOrigin, resolvePricingProductKey, shouldRenderSiteFooter, speechLocaleOf, splitLeadingHeading, stopSpeaking, useContentPage, useContentPages, useExploreChat, useProduct, useProductConfig, useProgressiveReveal, usePublicJobPosting, usePublicJobPostings, usePublicJobPostingsForSubmission, useSpeechOutput, useWebSDK, useWebSDKConfig };
19317
19529
  //# sourceMappingURL=index.mjs.map
19318
19530
  //# sourceMappingURL=index.mjs.map