@dsaplatform/content-sdk 1.4.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -0
- package/dist/index.d.mts +121 -1
- package/dist/index.d.ts +121 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -3
package/README.md
CHANGED
|
@@ -215,6 +215,60 @@ interface DsaContentConfig {
|
|
|
215
215
|
}
|
|
216
216
|
```
|
|
217
217
|
|
|
218
|
+
## Sitemap Generation
|
|
219
|
+
|
|
220
|
+
Next.js App Router handles sitemaps natively. The SDK exposes `fetchSitemap` — use it in `app/sitemap.ts`:
|
|
221
|
+
|
|
222
|
+
```ts
|
|
223
|
+
// app/sitemap.ts
|
|
224
|
+
import { fetchSitemap } from '@dsaplatform/content-sdk/server';
|
|
225
|
+
|
|
226
|
+
const config = {
|
|
227
|
+
apiUrl: process.env.CONTENT_ENGINE_URL!,
|
|
228
|
+
apiKey: process.env.CONTENT_API_KEY!,
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
export default async function sitemap() {
|
|
232
|
+
const slugs = await fetchSitemap(config);
|
|
233
|
+
const base = process.env.NEXT_PUBLIC_SITE_URL || 'https://yoursite.com';
|
|
234
|
+
|
|
235
|
+
return slugs.map((slug) => ({
|
|
236
|
+
url: `${base}/blog/${slug}`,
|
|
237
|
+
lastModified: new Date(),
|
|
238
|
+
changeFrequency: 'weekly' as const,
|
|
239
|
+
priority: 0.8,
|
|
240
|
+
}));
|
|
241
|
+
}
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
Next.js will serve `/sitemap.xml` automatically — no additional packages needed.
|
|
245
|
+
|
|
246
|
+
## IndexNow (Instant Search Engine Indexing)
|
|
247
|
+
|
|
248
|
+
[IndexNow](https://www.indexnow.org/) lets Bing and Yandex index new pages within minutes of publishing.
|
|
249
|
+
|
|
250
|
+
**The Content OS handles IndexNow submission automatically** when you configure the key in your site settings. You only need to verify domain ownership:
|
|
251
|
+
|
|
252
|
+
### Setup (one-time, per domain)
|
|
253
|
+
|
|
254
|
+
**Step 1.** In your Content OS admin → Site Settings → enter your IndexNow key.
|
|
255
|
+
|
|
256
|
+
**Step 2.** Host a verification file at the root of your site. Create a static text file containing **only the key** (no whitespace):
|
|
257
|
+
|
|
258
|
+
```
|
|
259
|
+
// public/bbf9f3f15c3e4342a912cd0c105516b0.txt
|
|
260
|
+
bbf9f3f15c3e4342a912cd0c105516b0
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
In Next.js, files in `/public` are served at the root automatically. Bing will verify at:
|
|
264
|
+
```
|
|
265
|
+
https://www.yoursite.com/bbf9f3f15c3e4342a912cd0c105516b0.txt
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
**Step 3.** Done — every new article published by Content OS is automatically submitted to `api.indexnow.org`.
|
|
269
|
+
|
|
270
|
+
> **Note:** The key file must be UTF-8 encoded and contain the key only. If you use a CDN or middleware that rewrites routes, make sure `/{key}.txt` is excluded from rewrites and returns a plain text `200` response.
|
|
271
|
+
|
|
218
272
|
## License
|
|
219
273
|
|
|
220
274
|
MIT
|
package/dist/index.d.mts
CHANGED
|
@@ -198,6 +198,60 @@ interface UseCategoriesState {
|
|
|
198
198
|
loading: boolean;
|
|
199
199
|
error: Error | null;
|
|
200
200
|
}
|
|
201
|
+
/** Supported form field names */
|
|
202
|
+
type LeadFormFieldName = 'name' | 'email' | 'phone' | 'company' | 'website' | 'message' | 'city' | 'country';
|
|
203
|
+
/** Form field descriptor */
|
|
204
|
+
interface LeadFormField {
|
|
205
|
+
name: LeadFormFieldName;
|
|
206
|
+
label?: string;
|
|
207
|
+
placeholder?: string;
|
|
208
|
+
type?: 'text' | 'email' | 'tel' | 'url' | 'textarea';
|
|
209
|
+
required?: boolean;
|
|
210
|
+
}
|
|
211
|
+
/** Lead magnet config shown before/after form submission */
|
|
212
|
+
interface LeadMagnetConfig {
|
|
213
|
+
title: string;
|
|
214
|
+
description?: string;
|
|
215
|
+
/** URL to download the lead magnet after form submission */
|
|
216
|
+
downloadUrl?: string;
|
|
217
|
+
/** Image/cover URL for the lead magnet */
|
|
218
|
+
imageUrl?: string;
|
|
219
|
+
}
|
|
220
|
+
/** Configuration for DsaLeadForm component */
|
|
221
|
+
interface DsaLeadFormConfig {
|
|
222
|
+
/** DSA Orchestrator base URL (e.g. "https://api.example.com") */
|
|
223
|
+
webhookUrl: string;
|
|
224
|
+
/** Project slug in DSA */
|
|
225
|
+
projectSlug: string;
|
|
226
|
+
/** Form webhook secret token */
|
|
227
|
+
webhookToken: string;
|
|
228
|
+
}
|
|
229
|
+
/** Payload submitted to the DSA webhook */
|
|
230
|
+
interface LeadFormPayload {
|
|
231
|
+
email: string;
|
|
232
|
+
name?: string;
|
|
233
|
+
phone?: string;
|
|
234
|
+
company?: string;
|
|
235
|
+
website?: string;
|
|
236
|
+
message?: string;
|
|
237
|
+
city?: string;
|
|
238
|
+
country?: string;
|
|
239
|
+
source_url?: string;
|
|
240
|
+
}
|
|
241
|
+
/** Result of a form submission */
|
|
242
|
+
interface LeadFormSubmitResult {
|
|
243
|
+
ok: boolean;
|
|
244
|
+
message?: string;
|
|
245
|
+
error?: string;
|
|
246
|
+
}
|
|
247
|
+
/** Hook state for lead form */
|
|
248
|
+
interface UseLeadFormState {
|
|
249
|
+
submitting: boolean;
|
|
250
|
+
submitted: boolean;
|
|
251
|
+
error: Error | null;
|
|
252
|
+
submit: (data: LeadFormPayload) => Promise<LeadFormSubmitResult>;
|
|
253
|
+
reset: () => void;
|
|
254
|
+
}
|
|
201
255
|
|
|
202
256
|
/**
|
|
203
257
|
* ContentClient — HTTP client for DSA Content Engine Public API.
|
|
@@ -286,6 +340,25 @@ declare function useCategories(): UseCategoriesState & {
|
|
|
286
340
|
refetch: () => void;
|
|
287
341
|
};
|
|
288
342
|
|
|
343
|
+
/**
|
|
344
|
+
* Headless hook for lead capture — handles submission to DSA webhook.
|
|
345
|
+
* Use this when you want full control over form UI.
|
|
346
|
+
*
|
|
347
|
+
* ```tsx
|
|
348
|
+
* const { submitting, submitted, error, submit, reset } = useDsaLeadForm({
|
|
349
|
+
* webhookUrl: "https://api.example.com",
|
|
350
|
+
* projectSlug: "my-project",
|
|
351
|
+
* webhookToken: "abc123",
|
|
352
|
+
* });
|
|
353
|
+
*
|
|
354
|
+
* const handleSubmit = (e) => {
|
|
355
|
+
* e.preventDefault();
|
|
356
|
+
* submit({ email: "user@example.com", name: "John" });
|
|
357
|
+
* };
|
|
358
|
+
* ```
|
|
359
|
+
*/
|
|
360
|
+
declare function useDsaLeadForm(config: DsaLeadFormConfig): UseLeadFormState;
|
|
361
|
+
|
|
289
362
|
interface ArticleFeedProps {
|
|
290
363
|
articles: ArticleListItem[];
|
|
291
364
|
layout?: 'grid' | 'list';
|
|
@@ -434,4 +507,51 @@ declare function SeoMetaBridge({ article, siteUrl, }: {
|
|
|
434
507
|
siteUrl?: string;
|
|
435
508
|
}): react_jsx_runtime.JSX.Element;
|
|
436
509
|
|
|
437
|
-
|
|
510
|
+
/** Theme for the lead form */
|
|
511
|
+
type LeadFormTheme = 'light' | 'dark' | 'inherit';
|
|
512
|
+
interface DsaLeadFormProps extends DsaLeadFormConfig {
|
|
513
|
+
/** Form fields to display. Shorthand: pass an array of field names. */
|
|
514
|
+
fields?: (LeadFormFieldName | LeadFormField)[];
|
|
515
|
+
/** Lead magnet to promote above the form / show after submission */
|
|
516
|
+
leadMagnet?: LeadMagnetConfig;
|
|
517
|
+
/** CTA button text */
|
|
518
|
+
ctaText?: string;
|
|
519
|
+
/** Thank-you message shown after successful submission */
|
|
520
|
+
thankYouMessage?: string;
|
|
521
|
+
/** Theme: "light" | "dark" | "inherit" (no styles) */
|
|
522
|
+
theme?: LeadFormTheme;
|
|
523
|
+
/** Additional CSS class on the wrapper */
|
|
524
|
+
className?: string;
|
|
525
|
+
/** Called after successful submission */
|
|
526
|
+
onSuccess?: (data: LeadFormPayload) => void;
|
|
527
|
+
/** Called on submission error */
|
|
528
|
+
onError?: (error: Error) => void;
|
|
529
|
+
/** Override source_url (defaults to window.location.href) */
|
|
530
|
+
sourceUrl?: string;
|
|
531
|
+
/** Render prop for full custom rendering */
|
|
532
|
+
children?: (state: {
|
|
533
|
+
submitting: boolean;
|
|
534
|
+
submitted: boolean;
|
|
535
|
+
error: Error | null;
|
|
536
|
+
submit: (data: LeadFormPayload) => void;
|
|
537
|
+
reset: () => void;
|
|
538
|
+
}) => React.ReactNode;
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* Ready-to-use lead capture form with built-in DSA webhook integration.
|
|
542
|
+
*
|
|
543
|
+
* ```tsx
|
|
544
|
+
* <DsaLeadForm
|
|
545
|
+
* webhookUrl="https://api.example.com"
|
|
546
|
+
* projectSlug="my-project"
|
|
547
|
+
* webhookToken="abc123"
|
|
548
|
+
* fields={['name', 'email', 'company']}
|
|
549
|
+
* ctaText="Get Free Audit"
|
|
550
|
+
* leadMagnet={{ title: "SEO Audit Checklist", description: "47-point checklist" }}
|
|
551
|
+
* theme="dark"
|
|
552
|
+
* />
|
|
553
|
+
* ```
|
|
554
|
+
*/
|
|
555
|
+
declare function DsaLeadForm({ webhookUrl, projectSlug, webhookToken, fields, leadMagnet, ctaText, thankYouMessage, theme, className, onSuccess, onError, sourceUrl, children, }: DsaLeadFormProps): react_jsx_runtime.JSX.Element;
|
|
556
|
+
|
|
557
|
+
export { type Article, type ArticleAuthor, ArticleFeed, type ArticleFeedProps, type ArticleFilters, type ArticleHeading, type ArticleListItem, ArticlePage, type ArticlePageProps, type ArticlePublisher, type ArticleTheme, type Category, type ClusterInfo, ContentClient, type DsaContentConfig, DsaContentProvider, type DsaContentProviderProps, DsaLeadForm, type DsaLeadFormConfig, type DsaLeadFormProps, FaqBlock, type FaqBlockProps, type FaqItem, type InternalLink, type LeadFormField, type LeadFormFieldName, type LeadFormPayload, type LeadFormSubmitResult, type LeadFormTheme, type LeadMagnetConfig, type PaginatedResponse, RelatedArticles, type RelatedArticlesProps, SeoMetaBridge, type SitemapEntry, type UseArticleListState, type UseArticleState, type UseArticlesState, type UseCategoriesState, type UseLeadFormState, generateArticleMetadata, useArticle, useArticles, useCategories, useDsaContent, useDsaLeadForm, useRelatedArticles };
|
package/dist/index.d.ts
CHANGED
|
@@ -198,6 +198,60 @@ interface UseCategoriesState {
|
|
|
198
198
|
loading: boolean;
|
|
199
199
|
error: Error | null;
|
|
200
200
|
}
|
|
201
|
+
/** Supported form field names */
|
|
202
|
+
type LeadFormFieldName = 'name' | 'email' | 'phone' | 'company' | 'website' | 'message' | 'city' | 'country';
|
|
203
|
+
/** Form field descriptor */
|
|
204
|
+
interface LeadFormField {
|
|
205
|
+
name: LeadFormFieldName;
|
|
206
|
+
label?: string;
|
|
207
|
+
placeholder?: string;
|
|
208
|
+
type?: 'text' | 'email' | 'tel' | 'url' | 'textarea';
|
|
209
|
+
required?: boolean;
|
|
210
|
+
}
|
|
211
|
+
/** Lead magnet config shown before/after form submission */
|
|
212
|
+
interface LeadMagnetConfig {
|
|
213
|
+
title: string;
|
|
214
|
+
description?: string;
|
|
215
|
+
/** URL to download the lead magnet after form submission */
|
|
216
|
+
downloadUrl?: string;
|
|
217
|
+
/** Image/cover URL for the lead magnet */
|
|
218
|
+
imageUrl?: string;
|
|
219
|
+
}
|
|
220
|
+
/** Configuration for DsaLeadForm component */
|
|
221
|
+
interface DsaLeadFormConfig {
|
|
222
|
+
/** DSA Orchestrator base URL (e.g. "https://api.example.com") */
|
|
223
|
+
webhookUrl: string;
|
|
224
|
+
/** Project slug in DSA */
|
|
225
|
+
projectSlug: string;
|
|
226
|
+
/** Form webhook secret token */
|
|
227
|
+
webhookToken: string;
|
|
228
|
+
}
|
|
229
|
+
/** Payload submitted to the DSA webhook */
|
|
230
|
+
interface LeadFormPayload {
|
|
231
|
+
email: string;
|
|
232
|
+
name?: string;
|
|
233
|
+
phone?: string;
|
|
234
|
+
company?: string;
|
|
235
|
+
website?: string;
|
|
236
|
+
message?: string;
|
|
237
|
+
city?: string;
|
|
238
|
+
country?: string;
|
|
239
|
+
source_url?: string;
|
|
240
|
+
}
|
|
241
|
+
/** Result of a form submission */
|
|
242
|
+
interface LeadFormSubmitResult {
|
|
243
|
+
ok: boolean;
|
|
244
|
+
message?: string;
|
|
245
|
+
error?: string;
|
|
246
|
+
}
|
|
247
|
+
/** Hook state for lead form */
|
|
248
|
+
interface UseLeadFormState {
|
|
249
|
+
submitting: boolean;
|
|
250
|
+
submitted: boolean;
|
|
251
|
+
error: Error | null;
|
|
252
|
+
submit: (data: LeadFormPayload) => Promise<LeadFormSubmitResult>;
|
|
253
|
+
reset: () => void;
|
|
254
|
+
}
|
|
201
255
|
|
|
202
256
|
/**
|
|
203
257
|
* ContentClient — HTTP client for DSA Content Engine Public API.
|
|
@@ -286,6 +340,25 @@ declare function useCategories(): UseCategoriesState & {
|
|
|
286
340
|
refetch: () => void;
|
|
287
341
|
};
|
|
288
342
|
|
|
343
|
+
/**
|
|
344
|
+
* Headless hook for lead capture — handles submission to DSA webhook.
|
|
345
|
+
* Use this when you want full control over form UI.
|
|
346
|
+
*
|
|
347
|
+
* ```tsx
|
|
348
|
+
* const { submitting, submitted, error, submit, reset } = useDsaLeadForm({
|
|
349
|
+
* webhookUrl: "https://api.example.com",
|
|
350
|
+
* projectSlug: "my-project",
|
|
351
|
+
* webhookToken: "abc123",
|
|
352
|
+
* });
|
|
353
|
+
*
|
|
354
|
+
* const handleSubmit = (e) => {
|
|
355
|
+
* e.preventDefault();
|
|
356
|
+
* submit({ email: "user@example.com", name: "John" });
|
|
357
|
+
* };
|
|
358
|
+
* ```
|
|
359
|
+
*/
|
|
360
|
+
declare function useDsaLeadForm(config: DsaLeadFormConfig): UseLeadFormState;
|
|
361
|
+
|
|
289
362
|
interface ArticleFeedProps {
|
|
290
363
|
articles: ArticleListItem[];
|
|
291
364
|
layout?: 'grid' | 'list';
|
|
@@ -434,4 +507,51 @@ declare function SeoMetaBridge({ article, siteUrl, }: {
|
|
|
434
507
|
siteUrl?: string;
|
|
435
508
|
}): react_jsx_runtime.JSX.Element;
|
|
436
509
|
|
|
437
|
-
|
|
510
|
+
/** Theme for the lead form */
|
|
511
|
+
type LeadFormTheme = 'light' | 'dark' | 'inherit';
|
|
512
|
+
interface DsaLeadFormProps extends DsaLeadFormConfig {
|
|
513
|
+
/** Form fields to display. Shorthand: pass an array of field names. */
|
|
514
|
+
fields?: (LeadFormFieldName | LeadFormField)[];
|
|
515
|
+
/** Lead magnet to promote above the form / show after submission */
|
|
516
|
+
leadMagnet?: LeadMagnetConfig;
|
|
517
|
+
/** CTA button text */
|
|
518
|
+
ctaText?: string;
|
|
519
|
+
/** Thank-you message shown after successful submission */
|
|
520
|
+
thankYouMessage?: string;
|
|
521
|
+
/** Theme: "light" | "dark" | "inherit" (no styles) */
|
|
522
|
+
theme?: LeadFormTheme;
|
|
523
|
+
/** Additional CSS class on the wrapper */
|
|
524
|
+
className?: string;
|
|
525
|
+
/** Called after successful submission */
|
|
526
|
+
onSuccess?: (data: LeadFormPayload) => void;
|
|
527
|
+
/** Called on submission error */
|
|
528
|
+
onError?: (error: Error) => void;
|
|
529
|
+
/** Override source_url (defaults to window.location.href) */
|
|
530
|
+
sourceUrl?: string;
|
|
531
|
+
/** Render prop for full custom rendering */
|
|
532
|
+
children?: (state: {
|
|
533
|
+
submitting: boolean;
|
|
534
|
+
submitted: boolean;
|
|
535
|
+
error: Error | null;
|
|
536
|
+
submit: (data: LeadFormPayload) => void;
|
|
537
|
+
reset: () => void;
|
|
538
|
+
}) => React.ReactNode;
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* Ready-to-use lead capture form with built-in DSA webhook integration.
|
|
542
|
+
*
|
|
543
|
+
* ```tsx
|
|
544
|
+
* <DsaLeadForm
|
|
545
|
+
* webhookUrl="https://api.example.com"
|
|
546
|
+
* projectSlug="my-project"
|
|
547
|
+
* webhookToken="abc123"
|
|
548
|
+
* fields={['name', 'email', 'company']}
|
|
549
|
+
* ctaText="Get Free Audit"
|
|
550
|
+
* leadMagnet={{ title: "SEO Audit Checklist", description: "47-point checklist" }}
|
|
551
|
+
* theme="dark"
|
|
552
|
+
* />
|
|
553
|
+
* ```
|
|
554
|
+
*/
|
|
555
|
+
declare function DsaLeadForm({ webhookUrl, projectSlug, webhookToken, fields, leadMagnet, ctaText, thankYouMessage, theme, className, onSuccess, onError, sourceUrl, children, }: DsaLeadFormProps): react_jsx_runtime.JSX.Element;
|
|
556
|
+
|
|
557
|
+
export { type Article, type ArticleAuthor, ArticleFeed, type ArticleFeedProps, type ArticleFilters, type ArticleHeading, type ArticleListItem, ArticlePage, type ArticlePageProps, type ArticlePublisher, type ArticleTheme, type Category, type ClusterInfo, ContentClient, type DsaContentConfig, DsaContentProvider, type DsaContentProviderProps, DsaLeadForm, type DsaLeadFormConfig, type DsaLeadFormProps, FaqBlock, type FaqBlockProps, type FaqItem, type InternalLink, type LeadFormField, type LeadFormFieldName, type LeadFormPayload, type LeadFormSubmitResult, type LeadFormTheme, type LeadMagnetConfig, type PaginatedResponse, RelatedArticles, type RelatedArticlesProps, SeoMetaBridge, type SitemapEntry, type UseArticleListState, type UseArticleState, type UseArticlesState, type UseCategoriesState, type UseLeadFormState, generateArticleMetadata, useArticle, useArticles, useCategories, useDsaContent, useDsaLeadForm, useRelatedArticles };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";var Q=Object.create;var k=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var G=Object.getOwnPropertyNames;var X=Object.getPrototypeOf,Y=Object.prototype.hasOwnProperty;var Z=(e,t)=>{for(var a in t)k(e,a,{get:t[a],enumerable:!0})},F=(e,t,a,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of G(t))!Y.call(e,o)&&o!==a&&k(e,o,{get:()=>t[o],enumerable:!(r=V(t,o))||r.enumerable});return e};var N=(e,t,a)=>(a=e!=null?Q(X(e)):{},F(t||!e||!e.__esModule?k(a,"default",{value:e,enumerable:!0}):a,e)),ee=e=>F(k({},"__esModule",{value:!0}),e);var ge={};Z(ge,{ArticleFeed:()=>R,ArticlePage:()=>P,ContentClient:()=>y,DsaContentProvider:()=>z,FaqBlock:()=>A,RelatedArticles:()=>S,SeoMetaBridge:()=>I,generateArticleMetadata:()=>q,useArticle:()=>D,useArticles:()=>E,useCategories:()=>$,useDsaContent:()=>h,useRelatedArticles:()=>B});module.exports=ee(ge);var y=class{constructor(t){this.apiUrl=t.apiUrl.replace(/\/+$/,""),this.apiKey=t.apiKey,this.cacheStrategy=t.cacheStrategy==="revalidate"?"default":t.cacheStrategy==="force-cache"?"force-cache":"no-cache",this.revalidateSeconds=t.revalidateSeconds}async request(t,a){let r=new URL(`${this.apiUrl}${t}`);a&&Object.entries(a).forEach(([i,p])=>{p!=null&&p!==""&&r.searchParams.set(i,String(p))}),r.searchParams.set("site_key",this.apiKey);let o={method:"GET",headers:{"X-API-Key":this.apiKey},cache:this.cacheStrategy};this.revalidateSeconds&&this.cacheStrategy!=="no-cache"&&(o.next={revalidate:this.revalidateSeconds});let s=await fetch(r.toString(),o);if(!s.ok){let i=await s.text().catch(()=>"");throw new Error(`DSA Content API error ${s.status}: ${i||s.statusText}`)}return s.json()}normalizeArticle(t){return{...t,headings:t.headings??[],faq:t.faq??[],internal_links:t.internal_links??[],secondary_keywords:t.secondary_keywords??[],schema_json:t.schema_json??null,content_json:t.content_json??null}}async getArticles(t){let a=await this.request("/api/public/articles",{page:t?.page,per_page:t?.per_page,pillar:t?.pillar,cluster:t?.cluster,content_type:t?.content_type,search:t?.search});return{items:a.items??a.data??[],total:a.total??0,page:a.page??1,per_page:a.per_page??20,total_pages:a.total_pages??a.pages??1}}async getArticleBySlug(t){let a=await this.request(`/api/public/articles/${encodeURIComponent(t)}`);return this.normalizeArticle(a)}async getRelatedArticles(t,a=3){let r=await this.request(`/api/public/articles/${encodeURIComponent(t)}/related`,{limit:a});return r.items??(Array.isArray(r)?r:[])}async getCategories(){let t=await this.request("/api/public/categories");return t.items??(Array.isArray(t)?t:[])}async getSitemap(){let t=await this.request("/api/public/sitemap");return t.items??(Array.isArray(t)?t:[])}};var x=require("react");var L=require("react/jsx-runtime"),T=(0,x.createContext)(null);function z({config:e,children:t}){let a=(0,x.useMemo)(()=>new y(e),[e.apiUrl,e.apiKey]);return(0,L.jsx)(T.Provider,{value:a,children:t})}function h(){let e=(0,x.useContext)(T);if(!e)throw new Error("useDsaContent() must be used inside <DsaContentProvider>");return e}var c=require("react");function E(e){let t=h(),[a,r]=(0,c.useState)({articles:[],loading:!0,error:null,pagination:{page:1,per_page:10,total:0,total_pages:0}}),o=(0,c.useCallback)(()=>{r(s=>({...s,loading:!0,error:null})),t.getArticles(e).then(s=>r({articles:s.items,loading:!1,error:null,pagination:{page:s.page,per_page:s.per_page,total:s.total,total_pages:s.total_pages}})).catch(s=>r(i=>({...i,loading:!1,error:s instanceof Error?s:new Error(String(s))})))},[t,e?.page,e?.per_page,e?.pillar,e?.cluster,e?.content_type,e?.search]);return(0,c.useEffect)(()=>{o()},[o]),{...a,refetch:o}}function D(e){let t=h(),[a,r]=(0,c.useState)({article:null,loading:!0,error:null}),o=(0,c.useCallback)(()=>{if(!e){r({article:null,loading:!1,error:null});return}r(s=>({...s,loading:!0,error:null})),t.getArticleBySlug(e).then(s=>r({article:s,loading:!1,error:null})).catch(s=>r({article:null,loading:!1,error:s instanceof Error?s:new Error(String(s))}))},[t,e]);return(0,c.useEffect)(()=>{o()},[o]),{...a,refetch:o}}function B(e,t=3){let a=h(),[r,o]=(0,c.useState)({articles:[],loading:!0,error:null}),s=(0,c.useCallback)(()=>{if(!e){o({articles:[],loading:!1,error:null});return}o(i=>({...i,loading:!0,error:null})),a.getRelatedArticles(e,t).then(i=>o({articles:i,loading:!1,error:null})).catch(i=>o({articles:[],loading:!1,error:i instanceof Error?i:new Error(String(i))}))},[a,e,t]);return(0,c.useEffect)(()=>{s()},[s]),{...r,refetch:s}}function $(){let e=h(),[t,a]=(0,c.useState)({categories:[],loading:!0,error:null}),r=(0,c.useCallback)(()=>{a(o=>({...o,loading:!0,error:null})),e.getCategories().then(o=>a({categories:o,loading:!1,error:null})).catch(o=>a({categories:[],loading:!1,error:o instanceof Error?o:new Error(String(o))}))},[e]);return(0,c.useEffect)(()=>{r()},[r]),{...t,refetch:r}}var C=N(require("react")),m=require("react/jsx-runtime"),te={light:{"--dsa-text":"#111827","--dsa-text-muted":"#6b7280","--dsa-text-faint":"#9ca3af","--dsa-card-bg":"#fff","--dsa-card-border":"#e5e7eb","--dsa-badge-bg":"#f3f4f6","--dsa-badge-text":"#4b5563","--dsa-hover-shadow":"0 4px 12px rgba(0,0,0,0.08)"},dark:{"--dsa-text":"#f3f4f6","--dsa-text-muted":"#9ca3af","--dsa-text-faint":"#6b7280","--dsa-card-bg":"#1f2937","--dsa-card-border":"#374151","--dsa-badge-bg":"#374151","--dsa-badge-text":"#d1d5db","--dsa-hover-shadow":"0 4px 12px rgba(0,0,0,0.3)"}};function ae({article:e,layout:t,showExcerpt:a,showImage:r,showMeta:o,onClick:s}){let i=t==="grid",[p,l]=C.default.useState(!1),u={...i?{border:"1px solid var(--dsa-card-border)",borderRadius:"0.75rem",overflow:"hidden",background:"var(--dsa-card-bg)",cursor:"pointer",transition:"box-shadow 0.2s"}:{display:"flex",border:"1px solid var(--dsa-card-border)",borderRadius:"0.75rem",overflow:"hidden",background:"var(--dsa-card-bg)",cursor:"pointer",transition:"box-shadow 0.2s"},...p?{boxShadow:"var(--dsa-hover-shadow)"}:{}};return(0,m.jsxs)("article",{style:u,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),onClick:s,role:"link",tabIndex:0,onKeyDown:v=>v.key==="Enter"&&s?.(),children:[r&&e.featured_image_url&&(0,m.jsx)("img",{src:e.featured_image_url,alt:e.featured_image_alt||e.title,style:i?{width:"100%",height:"200px",objectFit:"cover",display:"block"}:{width:"240px",minHeight:"160px",objectFit:"cover",flexShrink:0},loading:"lazy"}),(0,m.jsxs)("div",{style:i?{padding:"1.25rem"}:{padding:"1.25rem",flex:1},children:[(0,m.jsx)("h3",{style:{margin:"0 0 0.5rem",fontSize:"1.125rem",fontWeight:600,lineHeight:1.3,color:"var(--dsa-text)"},children:e.title}),a&&e.excerpt&&(0,m.jsx)("p",{style:{margin:"0 0 0.75rem",fontSize:"0.875rem",color:"var(--dsa-text-muted)",lineHeight:1.5},children:e.excerpt}),o&&(0,m.jsxs)("div",{style:{display:"flex",gap:"0.75rem",fontSize:"0.75rem",color:"var(--dsa-text-faint)",flexWrap:"wrap"},children:[e.pillar_name&&(0,m.jsx)("span",{style:{display:"inline-block",padding:"0.125rem 0.5rem",borderRadius:"9999px",background:"var(--dsa-badge-bg)",fontSize:"0.75rem",color:"var(--dsa-badge-text)"},children:e.pillar_name}),e.content_type&&(0,m.jsx)("span",{style:{display:"inline-block",padding:"0.125rem 0.5rem",borderRadius:"9999px",background:"var(--dsa-badge-bg)",fontSize:"0.75rem",color:"var(--dsa-badge-text)"},children:e.content_type.replace(/_/g," ")}),e.reading_time_minutes&&(0,m.jsxs)("span",{children:[e.reading_time_minutes," min read"]}),e.published_at&&(0,m.jsx)("span",{children:new Date(e.published_at).toLocaleDateString()})]})]})]})}function R({articles:e,layout:t="grid",columns:a=3,showExcerpt:r=!0,showImage:o=!0,showMeta:s=!0,onArticleClick:i,className:p,theme:l="light",renderArticle:u}){let v=t==="grid"?`repeat(${a}, 1fr)`:"1fr",_=l!=="inherit"?te[l]:{};return(0,m.jsx)("div",{className:p,style:{display:"grid",gap:"1.5rem",gridTemplateColumns:v,..._},children:(e??[]).map(d=>u?(0,m.jsx)(C.default.Fragment,{children:u(d)},d.id):(0,m.jsx)(ae,{article:d,layout:t,showExcerpt:r,showImage:o,showMeta:s,onClick:()=>i?.(d.slug)},d.id))})}var H=N(require("react"));var j=require("react"),g=require("react/jsx-runtime"),re={light:{"--dsa-text":"#111827","--dsa-text-muted":"#4b5563","--dsa-text-faint":"#9ca3af","--dsa-divider":"#e5e7eb"},dark:{"--dsa-text":"#f3f4f6","--dsa-text-muted":"#d1d5db","--dsa-text-faint":"#6b7280","--dsa-divider":"#374151"}};function oe({item:e,collapsible:t,defaultOpen:a}){let[r,o]=(0,j.useState)(a);return t?(0,g.jsxs)("div",{style:{borderBottom:"1px solid var(--dsa-divider)",padding:"0.75rem 0"},children:[(0,g.jsxs)("button",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"pointer",background:"none",border:"none",width:"100%",textAlign:"left",padding:"0.5rem 0",fontSize:"1rem",fontWeight:600,color:"var(--dsa-text)",fontFamily:"inherit"},onClick:()=>o(!r),"aria-expanded":r,children:[(0,g.jsx)("span",{children:e.question}),(0,g.jsx)("span",{style:{flexShrink:0,marginLeft:"1rem",transition:"transform 0.2s",fontSize:"1.25rem",color:"var(--dsa-text-faint)",transform:r?"rotate(180deg)":"rotate(0deg)"},children:"\u25BC"})]}),r&&(0,g.jsx)("div",{style:{fontSize:"0.9375rem",color:"var(--dsa-text-muted)",lineHeight:1.6,paddingTop:"0.5rem"},children:e.answer})]}):(0,g.jsxs)("div",{style:{borderBottom:"1px solid var(--dsa-divider)",padding:"0.75rem 0"},children:[(0,g.jsx)("p",{style:{fontSize:"1rem",fontWeight:600,color:"var(--dsa-text)",margin:"0 0 0.5rem"},children:e.question}),(0,g.jsx)("div",{style:{fontSize:"0.9375rem",color:"var(--dsa-text-muted)",lineHeight:1.6},children:e.answer})]})}function A({items:e,collapsible:t=!0,defaultOpen:a=!1,className:r,title:o="Frequently Asked Questions",theme:s="light"}){if(!e||e.length===0)return null;let i=s!=="inherit"?re[s]:{},p={"@context":"https://schema.org","@type":"FAQPage",mainEntity:e.map(l=>({"@type":"Question",name:l.question,acceptedAnswer:{"@type":"Answer",text:l.answer}}))};return(0,g.jsxs)("section",{className:r,style:{marginTop:"1rem",...i},children:[(0,g.jsx)("h2",{style:{fontSize:"1.5rem",fontWeight:700,color:"var(--dsa-text)",margin:"0 0 1rem"},children:o}),e.map((l,u)=>(0,g.jsx)(oe,{item:l,collapsible:t,defaultOpen:a},u)),(0,g.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(p)}})]})}var f=require("react/jsx-runtime"),se={light:{"--dsa-text":"#111827","--dsa-text-muted":"#6b7280","--dsa-card-bg":"#fff","--dsa-card-border":"#e5e7eb"},dark:{"--dsa-text":"#f3f4f6","--dsa-text-muted":"#9ca3af","--dsa-card-bg":"#1f2937","--dsa-card-border":"#374151"}};function S({articles:e,title:t="Related Articles",limit:a=3,onArticleClick:r,className:o,theme:s="light"}){let i=(e??[]).slice(0,a);if(i.length===0)return null;let p=s!=="inherit"?se[s]:{};return(0,f.jsxs)("section",{className:o,style:{marginTop:"1rem",...p},children:[(0,f.jsx)("h3",{style:{fontSize:"1.25rem",fontWeight:700,color:"var(--dsa-text)",margin:"0 0 1rem"},children:t}),(0,f.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(250px, 1fr))",gap:"1rem"},children:i.map(l=>(0,f.jsxs)("div",{style:{border:"1px solid var(--dsa-card-border)",borderRadius:"0.5rem",overflow:"hidden",cursor:"pointer",transition:"box-shadow 0.2s",background:"var(--dsa-card-bg)"},onClick:()=>r?.(l.slug),role:"link",tabIndex:0,onKeyDown:u=>u.key==="Enter"&&r?.(l.slug),children:[l.featured_image_url&&(0,f.jsx)("img",{src:l.featured_image_url,alt:l.featured_image_alt||l.title,style:{width:"100%",height:"140px",objectFit:"cover",display:"block"},loading:"lazy"}),(0,f.jsxs)("div",{style:{padding:"1rem"},children:[(0,f.jsx)("h4",{style:{fontSize:"0.9375rem",fontWeight:600,color:"var(--dsa-text)",margin:0,lineHeight:1.3},children:l.title}),l.excerpt&&(0,f.jsx)("p",{style:{fontSize:"0.8125rem",color:"var(--dsa-text-muted)",marginTop:"0.5rem",lineHeight:1.4},children:l.excerpt})]})]},l.id))})]})}var n=require("react/jsx-runtime"),ne={light:{"--dsa-text":"#111827","--dsa-text-muted":"#6b7280","--dsa-text-faint":"#9ca3af","--dsa-card-bg":"#fff","--dsa-card-border":"#e5e7eb","--dsa-toc-bg":"#f9fafb","--dsa-badge-bg":"#eff6ff","--dsa-badge-text":"#2563eb","--dsa-badge-alt-bg":"#f0fdf4","--dsa-badge-alt-text":"#16a34a","--dsa-content-text":"#374151","--dsa-h2-text":"#111827","--dsa-h3-text":"#1f2937","--dsa-h4-text":"#1f2937","--dsa-link":"#2563eb","--dsa-link-hover":"#1d4ed8","--dsa-blockquote-border":"#d1d5db","--dsa-blockquote-text":"#4b5563","--dsa-pre-bg":"#f3f4f6","--dsa-table-border":"#e5e7eb","--dsa-table-header-bg":"#f9fafb","--dsa-divider":"#e5e7eb"},dark:{"--dsa-text":"#f3f4f6","--dsa-text-muted":"#9ca3af","--dsa-text-faint":"#6b7280","--dsa-card-bg":"#1f2937","--dsa-card-border":"#374151","--dsa-toc-bg":"#111827","--dsa-badge-bg":"#1e3a5f","--dsa-badge-text":"#93c5fd","--dsa-badge-alt-bg":"#14532d","--dsa-badge-alt-text":"#86efac","--dsa-content-text":"#d1d5db","--dsa-h2-text":"#f3f4f6","--dsa-h3-text":"#e5e7eb","--dsa-h4-text":"#e5e7eb","--dsa-link":"#60a5fa","--dsa-link-hover":"#93c5fd","--dsa-blockquote-border":"#4b5563","--dsa-blockquote-text":"#9ca3af","--dsa-pre-bg":"#111827","--dsa-table-border":"#374151","--dsa-table-header-bg":"#111827","--dsa-divider":"#374151"}},U="dsa-article-prose",ie=`
|
|
2
|
+
"use strict";var se=Object.create;var z=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var ie=Object.getOwnPropertyNames;var de=Object.getPrototypeOf,le=Object.prototype.hasOwnProperty;var ce=(e,t)=>{for(var a in t)z(e,a,{get:t[a],enumerable:!0})},O=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of ie(t))!le.call(e,r)&&r!==a&&z(e,r,{get:()=>t[r],enumerable:!(o=ne(t,r))||o.enumerable});return e};var K=(e,t,a)=>(a=e!=null?se(de(e)):{},O(t||!e||!e.__esModule?z(a,"default",{value:e,enumerable:!0}):a,e)),me=e=>O(z({},"__esModule",{value:!0}),e);var ke={};ce(ke,{ArticleFeed:()=>B,ArticlePage:()=>j,ContentClient:()=>N,DsaContentProvider:()=>G,DsaLeadForm:()=>M,FaqBlock:()=>T,RelatedArticles:()=>D,SeoMetaBridge:()=>W,generateArticleMetadata:()=>H,useArticle:()=>Y,useArticles:()=>Q,useCategories:()=>Z,useDsaContent:()=>F,useDsaLeadForm:()=>I,useRelatedArticles:()=>X});module.exports=me(ke);var N=class{constructor(t){this.apiUrl=t.apiUrl.replace(/\/+$/,""),this.apiKey=t.apiKey,this.cacheStrategy=t.cacheStrategy==="revalidate"?"default":t.cacheStrategy==="force-cache"?"force-cache":"no-cache",this.revalidateSeconds=t.revalidateSeconds}async request(t,a){let o=new URL(`${this.apiUrl}${t}`);a&&Object.entries(a).forEach(([i,m])=>{m!=null&&m!==""&&o.searchParams.set(i,String(m))}),o.searchParams.set("site_key",this.apiKey);let r={method:"GET",headers:{"X-API-Key":this.apiKey},cache:this.cacheStrategy};this.revalidateSeconds&&this.cacheStrategy!=="no-cache"&&(r.next={revalidate:this.revalidateSeconds});let s=await fetch(o.toString(),r);if(!s.ok){let i=await s.text().catch(()=>"");throw new Error(`DSA Content API error ${s.status}: ${i||s.statusText}`)}return s.json()}normalizeArticle(t){return{...t,headings:t.headings??[],faq:t.faq??[],internal_links:t.internal_links??[],secondary_keywords:t.secondary_keywords??[],schema_json:t.schema_json??null,content_json:t.content_json??null}}async getArticles(t){let a=await this.request("/api/public/articles",{page:t?.page,per_page:t?.per_page,pillar:t?.pillar,cluster:t?.cluster,content_type:t?.content_type,search:t?.search});return{items:a.items??a.data??[],total:a.total??0,page:a.page??1,per_page:a.per_page??20,total_pages:a.total_pages??a.pages??1}}async getArticleBySlug(t){let a=await this.request(`/api/public/articles/${encodeURIComponent(t)}`);return this.normalizeArticle(a)}async getRelatedArticles(t,a=3){let o=await this.request(`/api/public/articles/${encodeURIComponent(t)}/related`,{limit:a});return o.items??(Array.isArray(o)?o:[])}async getCategories(){let t=await this.request("/api/public/categories");return t.items??(Array.isArray(t)?t:[])}async getSitemap(){let t=await this.request("/api/public/sitemap");return t.items??(Array.isArray(t)?t:[])}};var q=require("react");var J=require("react/jsx-runtime"),V=(0,q.createContext)(null);function G({config:e,children:t}){let a=(0,q.useMemo)(()=>new N(e),[e.apiUrl,e.apiKey]);return(0,J.jsx)(V.Provider,{value:a,children:t})}function F(){let e=(0,q.useContext)(V);if(!e)throw new Error("useDsaContent() must be used inside <DsaContentProvider>");return e}var h=require("react");function Q(e){let t=F(),[a,o]=(0,h.useState)({articles:[],loading:!0,error:null,pagination:{page:1,per_page:10,total:0,total_pages:0}}),r=(0,h.useCallback)(()=>{o(s=>({...s,loading:!0,error:null})),t.getArticles(e).then(s=>o({articles:s.items,loading:!1,error:null,pagination:{page:s.page,per_page:s.per_page,total:s.total,total_pages:s.total_pages}})).catch(s=>o(i=>({...i,loading:!1,error:s instanceof Error?s:new Error(String(s))})))},[t,e?.page,e?.per_page,e?.pillar,e?.cluster,e?.content_type,e?.search]);return(0,h.useEffect)(()=>{r()},[r]),{...a,refetch:r}}function Y(e){let t=F(),[a,o]=(0,h.useState)({article:null,loading:!0,error:null}),r=(0,h.useCallback)(()=>{if(!e){o({article:null,loading:!1,error:null});return}o(s=>({...s,loading:!0,error:null})),t.getArticleBySlug(e).then(s=>o({article:s,loading:!1,error:null})).catch(s=>o({article:null,loading:!1,error:s instanceof Error?s:new Error(String(s))}))},[t,e]);return(0,h.useEffect)(()=>{r()},[r]),{...a,refetch:r}}function X(e,t=3){let a=F(),[o,r]=(0,h.useState)({articles:[],loading:!0,error:null}),s=(0,h.useCallback)(()=>{if(!e){r({articles:[],loading:!1,error:null});return}r(i=>({...i,loading:!0,error:null})),a.getRelatedArticles(e,t).then(i=>r({articles:i,loading:!1,error:null})).catch(i=>r({articles:[],loading:!1,error:i instanceof Error?i:new Error(String(i))}))},[a,e,t]);return(0,h.useEffect)(()=>{s()},[s]),{...o,refetch:s}}function Z(){let e=F(),[t,a]=(0,h.useState)({categories:[],loading:!0,error:null}),o=(0,h.useCallback)(()=>{a(r=>({...r,loading:!0,error:null})),e.getCategories().then(r=>a({categories:r,loading:!1,error:null})).catch(r=>a({categories:[],loading:!1,error:r instanceof Error?r:new Error(String(r))}))},[e]);return(0,h.useEffect)(()=>{o()},[o]),{...t,refetch:o}}var w=require("react");function I(e){let[t,a]=(0,w.useState)(!1),[o,r]=(0,w.useState)(!1),[s,i]=(0,w.useState)(null),m=(0,w.useCallback)(async u=>{a(!0),i(null);try{let A=`${e.webhookUrl.replace(/\/+$/,"")}/api/webhook/form/${encodeURIComponent(e.projectSlug)}?token=${encodeURIComponent(e.webhookToken)}`,d={...u};!d.source_url&&typeof window<"u"&&(d.source_url=window.location.href);let y=await fetch(A,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)}),f=await y.json().catch(()=>({}));if(!y.ok){let L=f.error||`Submission failed (${y.status})`;throw new Error(L)}return r(!0),{ok:!0,message:f.message}}catch(_){let A=_ instanceof Error?_:new Error(String(_));return i(A),{ok:!1,error:A.message}}finally{a(!1)}},[e.webhookUrl,e.projectSlug,e.webhookToken]),l=(0,w.useCallback)(()=>{a(!1),r(!1),i(null)},[]);return{submitting:t,submitted:o,error:s,submit:m,reset:l}}var $=K(require("react")),b=require("react/jsx-runtime"),pe={light:{"--dsa-text":"#111827","--dsa-text-muted":"#6b7280","--dsa-text-faint":"#9ca3af","--dsa-card-bg":"#fff","--dsa-card-border":"#e5e7eb","--dsa-badge-bg":"#f3f4f6","--dsa-badge-text":"#4b5563","--dsa-hover-shadow":"0 4px 12px rgba(0,0,0,0.08)"},dark:{"--dsa-text":"#f3f4f6","--dsa-text-muted":"#9ca3af","--dsa-text-faint":"#6b7280","--dsa-card-bg":"#1f2937","--dsa-card-border":"#374151","--dsa-badge-bg":"#374151","--dsa-badge-text":"#d1d5db","--dsa-hover-shadow":"0 4px 12px rgba(0,0,0,0.3)"}};function ue({article:e,layout:t,showExcerpt:a,showImage:o,showMeta:r,onClick:s}){let i=t==="grid",[m,l]=$.default.useState(!1),u={...i?{border:"1px solid var(--dsa-card-border)",borderRadius:"0.75rem",overflow:"hidden",background:"var(--dsa-card-bg)",cursor:"pointer",transition:"box-shadow 0.2s"}:{display:"flex",border:"1px solid var(--dsa-card-border)",borderRadius:"0.75rem",overflow:"hidden",background:"var(--dsa-card-bg)",cursor:"pointer",transition:"box-shadow 0.2s"},...m?{boxShadow:"var(--dsa-hover-shadow)"}:{}};return(0,b.jsxs)("article",{style:u,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),onClick:s,role:"link",tabIndex:0,onKeyDown:_=>_.key==="Enter"&&s?.(),children:[o&&e.featured_image_url&&(0,b.jsx)("img",{src:e.featured_image_url,alt:e.featured_image_alt||e.title,style:i?{width:"100%",height:"200px",objectFit:"cover",display:"block"}:{width:"240px",minHeight:"160px",objectFit:"cover",flexShrink:0},loading:"lazy"}),(0,b.jsxs)("div",{style:i?{padding:"1.25rem"}:{padding:"1.25rem",flex:1},children:[(0,b.jsx)("h3",{style:{margin:"0 0 0.5rem",fontSize:"1.125rem",fontWeight:600,lineHeight:1.3,color:"var(--dsa-text)"},children:e.title}),a&&e.excerpt&&(0,b.jsx)("p",{style:{margin:"0 0 0.75rem",fontSize:"0.875rem",color:"var(--dsa-text-muted)",lineHeight:1.5},children:e.excerpt}),r&&(0,b.jsxs)("div",{style:{display:"flex",gap:"0.75rem",fontSize:"0.75rem",color:"var(--dsa-text-faint)",flexWrap:"wrap"},children:[e.pillar_name&&(0,b.jsx)("span",{style:{display:"inline-block",padding:"0.125rem 0.5rem",borderRadius:"9999px",background:"var(--dsa-badge-bg)",fontSize:"0.75rem",color:"var(--dsa-badge-text)"},children:e.pillar_name}),e.content_type&&(0,b.jsx)("span",{style:{display:"inline-block",padding:"0.125rem 0.5rem",borderRadius:"9999px",background:"var(--dsa-badge-bg)",fontSize:"0.75rem",color:"var(--dsa-badge-text)"},children:e.content_type.replace(/_/g," ")}),e.reading_time_minutes&&(0,b.jsxs)("span",{children:[e.reading_time_minutes," min read"]}),e.published_at&&(0,b.jsx)("span",{children:new Date(e.published_at).toLocaleDateString()})]})]})]})}function B({articles:e,layout:t="grid",columns:a=3,showExcerpt:o=!0,showImage:r=!0,showMeta:s=!0,onArticleClick:i,className:m,theme:l="light",renderArticle:u}){let _=t==="grid"?`repeat(${a}, 1fr)`:"1fr",A=l!=="inherit"?pe[l]:{};return(0,b.jsx)("div",{className:m,style:{display:"grid",gap:"1.5rem",gridTemplateColumns:_,...A},children:(e??[]).map(d=>u?(0,b.jsx)($.default.Fragment,{children:u(d)},d.id):(0,b.jsx)(ue,{article:d,layout:t,showExcerpt:o,showImage:r,showMeta:s,onClick:()=>i?.(d.slug)},d.id))})}var ae=K(require("react"));var ee=require("react"),S=require("react/jsx-runtime"),ge={light:{"--dsa-text":"#111827","--dsa-text-muted":"#4b5563","--dsa-text-faint":"#9ca3af","--dsa-divider":"#e5e7eb"},dark:{"--dsa-text":"#f3f4f6","--dsa-text-muted":"#d1d5db","--dsa-text-faint":"#6b7280","--dsa-divider":"#374151"}};function fe({item:e,collapsible:t,defaultOpen:a}){let[o,r]=(0,ee.useState)(a);return t?(0,S.jsxs)("div",{style:{borderBottom:"1px solid var(--dsa-divider)",padding:"0.75rem 0"},children:[(0,S.jsxs)("button",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"pointer",background:"none",border:"none",width:"100%",textAlign:"left",padding:"0.5rem 0",fontSize:"1rem",fontWeight:600,color:"var(--dsa-text)",fontFamily:"inherit"},onClick:()=>r(!o),"aria-expanded":o,children:[(0,S.jsx)("span",{children:e.question}),(0,S.jsx)("span",{style:{flexShrink:0,marginLeft:"1rem",transition:"transform 0.2s",fontSize:"1.25rem",color:"var(--dsa-text-faint)",transform:o?"rotate(180deg)":"rotate(0deg)"},children:"\u25BC"})]}),o&&(0,S.jsx)("div",{style:{fontSize:"0.9375rem",color:"var(--dsa-text-muted)",lineHeight:1.6,paddingTop:"0.5rem"},children:e.answer})]}):(0,S.jsxs)("div",{style:{borderBottom:"1px solid var(--dsa-divider)",padding:"0.75rem 0"},children:[(0,S.jsx)("p",{style:{fontSize:"1rem",fontWeight:600,color:"var(--dsa-text)",margin:"0 0 0.5rem"},children:e.question}),(0,S.jsx)("div",{style:{fontSize:"0.9375rem",color:"var(--dsa-text-muted)",lineHeight:1.6},children:e.answer})]})}function T({items:e,collapsible:t=!0,defaultOpen:a=!1,className:o,title:r="Frequently Asked Questions",theme:s="light"}){if(!e||e.length===0)return null;let i=s!=="inherit"?ge[s]:{},m={"@context":"https://schema.org","@type":"FAQPage",mainEntity:e.map(l=>({"@type":"Question",name:l.question,acceptedAnswer:{"@type":"Answer",text:l.answer}}))};return(0,S.jsxs)("section",{className:o,style:{marginTop:"1rem",...i},children:[(0,S.jsx)("h2",{style:{fontSize:"1.5rem",fontWeight:700,color:"var(--dsa-text)",margin:"0 0 1rem"},children:r}),e.map((l,u)=>(0,S.jsx)(fe,{item:l,collapsible:t,defaultOpen:a},u)),(0,S.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(m)}})]})}var C=require("react/jsx-runtime"),he={light:{"--dsa-text":"#111827","--dsa-text-muted":"#6b7280","--dsa-card-bg":"#fff","--dsa-card-border":"#e5e7eb"},dark:{"--dsa-text":"#f3f4f6","--dsa-text-muted":"#9ca3af","--dsa-card-bg":"#1f2937","--dsa-card-border":"#374151"}};function D({articles:e,title:t="Related Articles",limit:a=3,onArticleClick:o,className:r,theme:s="light"}){let i=(e??[]).slice(0,a);if(i.length===0)return null;let m=s!=="inherit"?he[s]:{};return(0,C.jsxs)("section",{className:r,style:{marginTop:"1rem",...m},children:[(0,C.jsx)("h3",{style:{fontSize:"1.25rem",fontWeight:700,color:"var(--dsa-text)",margin:"0 0 1rem"},children:t}),(0,C.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(250px, 1fr))",gap:"1rem"},children:i.map(l=>(0,C.jsxs)("div",{style:{border:"1px solid var(--dsa-card-border)",borderRadius:"0.5rem",overflow:"hidden",cursor:"pointer",transition:"box-shadow 0.2s",background:"var(--dsa-card-bg)"},onClick:()=>o?.(l.slug),role:"link",tabIndex:0,onKeyDown:u=>u.key==="Enter"&&o?.(l.slug),children:[l.featured_image_url&&(0,C.jsx)("img",{src:l.featured_image_url,alt:l.featured_image_alt||l.title,style:{width:"100%",height:"140px",objectFit:"cover",display:"block"},loading:"lazy"}),(0,C.jsxs)("div",{style:{padding:"1rem"},children:[(0,C.jsx)("h4",{style:{fontSize:"0.9375rem",fontWeight:600,color:"var(--dsa-text)",margin:0,lineHeight:1.3},children:l.title}),l.excerpt&&(0,C.jsx)("p",{style:{fontSize:"0.8125rem",color:"var(--dsa-text-muted)",marginTop:"0.5rem",lineHeight:1.4},children:l.excerpt})]})]},l.id))})]})}var n=require("react/jsx-runtime"),be={light:{"--dsa-text":"#111827","--dsa-text-muted":"#6b7280","--dsa-text-faint":"#9ca3af","--dsa-card-bg":"#fff","--dsa-card-border":"#e5e7eb","--dsa-toc-bg":"#f9fafb","--dsa-badge-bg":"#eff6ff","--dsa-badge-text":"#2563eb","--dsa-badge-alt-bg":"#f0fdf4","--dsa-badge-alt-text":"#16a34a","--dsa-content-text":"#374151","--dsa-h2-text":"#111827","--dsa-h3-text":"#1f2937","--dsa-h4-text":"#1f2937","--dsa-link":"#2563eb","--dsa-link-hover":"#1d4ed8","--dsa-blockquote-border":"#d1d5db","--dsa-blockquote-text":"#4b5563","--dsa-pre-bg":"#f3f4f6","--dsa-table-border":"#e5e7eb","--dsa-table-header-bg":"#f9fafb","--dsa-divider":"#e5e7eb"},dark:{"--dsa-text":"#f3f4f6","--dsa-text-muted":"#9ca3af","--dsa-text-faint":"#6b7280","--dsa-card-bg":"#1f2937","--dsa-card-border":"#374151","--dsa-toc-bg":"#111827","--dsa-badge-bg":"#1e3a5f","--dsa-badge-text":"#93c5fd","--dsa-badge-alt-bg":"#14532d","--dsa-badge-alt-text":"#86efac","--dsa-content-text":"#d1d5db","--dsa-h2-text":"#f3f4f6","--dsa-h3-text":"#e5e7eb","--dsa-h4-text":"#e5e7eb","--dsa-link":"#60a5fa","--dsa-link-hover":"#93c5fd","--dsa-blockquote-border":"#4b5563","--dsa-blockquote-text":"#9ca3af","--dsa-pre-bg":"#111827","--dsa-table-border":"#374151","--dsa-table-header-bg":"#111827","--dsa-divider":"#374151"}},te="dsa-article-prose",ye=`
|
|
3
3
|
[data-dsa-article-body] h2 { font-size: 1.5rem; font-weight: 700; line-height: 1.3; color: var(--dsa-h2-text, #111827); margin: 2rem 0 0.75rem; }
|
|
4
4
|
[data-dsa-article-body] h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.4; color: var(--dsa-h3-text, #1f2937); margin: 1.75rem 0 0.5rem; }
|
|
5
5
|
[data-dsa-article-body] h4 { font-size: 1.125rem; font-weight: 600; line-height: 1.4; color: var(--dsa-h4-text, #1f2937); margin: 1.5rem 0 0.5rem; }
|
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
[data-dsa-article-body] hr { border: none; border-top: 1px solid var(--dsa-divider, #e5e7eb); margin: 2rem 0; }
|
|
23
23
|
[data-dsa-article-body] > *:first-child { margin-top: 0; }
|
|
24
24
|
[data-dsa-article-body] > *:last-child { margin-bottom: 0; }
|
|
25
|
-
`.trim();function de(e){H.default.useEffect(()=>{if(!e||typeof document>"u"||document.getElementById(U))return;let t=document.createElement("style");t.id=U,t.textContent=ie,document.head.appendChild(t)},[e])}function le({headings:e}){return!e||e.length===0?null:(0,n.jsxs)("nav",{className:"dsa-toc","data-dsa-toc":"",style:{background:"var(--dsa-toc-bg, #f9fafb)",border:"1px solid var(--dsa-card-border, #e5e7eb)",borderRadius:"0.75rem",padding:"1.25rem",marginBottom:"2rem"},children:[(0,n.jsx)("p",{style:{fontSize:"0.875rem",fontWeight:600,color:"var(--dsa-text-muted, #374151)",margin:"0 0 0.75rem",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Table of Contents"}),(0,n.jsx)("ul",{style:{listStyle:"none",padding:0,margin:0},children:e.map((t,a)=>(0,n.jsx)("li",{style:{padding:"0.25rem 0",paddingLeft:`${(t.level-2)*1}rem`},children:(0,n.jsx)("a",{href:`#${t.id}`,style:{color:"var(--dsa-text-muted, #4b5563)",textDecoration:"none",fontSize:"0.875rem"},children:t.text})},a))})]})}function ce({headings:e}){return!e||e.length===0?null:(0,n.jsxs)("nav",{className:"dsa-toc","data-dsa-toc":"",children:[(0,n.jsx)("p",{className:"dsa-toc-title",children:"Table of Contents"}),(0,n.jsx)("ul",{className:"dsa-toc-list",children:e.map((t,a)=>(0,n.jsx)("li",{className:"dsa-toc-item",style:{paddingLeft:`${(t.level-2)*1}rem`},children:(0,n.jsx)("a",{href:`#${t.id}`,className:"dsa-toc-link",children:t.text})},a))})]})}function P({article:e,showFaq:t=!0,showTableOfContents:a=!0,showMeta:r=!0,showRelated:o=!1,relatedArticles:s,onRelatedClick:i,className:p,contentClassName:l,theme:u="light",disableProseStyles:v=!1,components:_}){let d=u==="inherit";de(!d&&!v);let M=_?.H1||(d?({children:w})=>(0,n.jsx)("h1",{className:"dsa-h1",children:w}):({children:w})=>(0,n.jsx)("h1",{className:"dsa-h1",style:{fontSize:"2.25rem",fontWeight:700,lineHeight:1.2,color:"var(--dsa-text)",margin:"0 0 1rem"},children:w})),O=_?.Toc||(d?ce:le),W=_?.Faq||A,K=d?{}:ne[u],J=["dsa-article-body",l].filter(Boolean).join(" ");return(0,n.jsxs)("article",{className:p,"data-dsa-theme":u,style:d?void 0:{maxWidth:"48rem",margin:"0 auto",fontFamily:"system-ui, -apple-system, sans-serif",...K},children:[r&&(0,n.jsxs)("div",{className:"dsa-meta","data-dsa-meta":"",style:d?void 0:{display:"flex",gap:"1rem",flexWrap:"wrap",fontSize:"0.875rem",color:"var(--dsa-text-muted)",marginBottom:"1.5rem"},children:[e.pillar_name&&(0,n.jsx)("span",{className:"dsa-badge",style:d?void 0:{display:"inline-block",padding:"0.125rem 0.5rem",borderRadius:"9999px",background:"var(--dsa-badge-bg)",color:"var(--dsa-badge-text)",fontSize:"0.75rem"},children:e.pillar_name}),e.content_type&&(0,n.jsx)("span",{className:"dsa-badge dsa-badge--alt",style:d?void 0:{display:"inline-block",padding:"0.125rem 0.5rem",borderRadius:"9999px",background:"var(--dsa-badge-alt-bg, var(--dsa-badge-bg))",color:"var(--dsa-badge-alt-text, var(--dsa-badge-text))",fontSize:"0.75rem"},children:e.content_type.replace(/_/g," ")}),e.reading_time_minutes&&(0,n.jsxs)("span",{className:"dsa-reading-time",children:[e.reading_time_minutes," min read"]}),e.published_at&&(0,n.jsx)("span",{className:"dsa-published-at",children:new Date(e.published_at).toLocaleDateString()})]}),(0,n.jsx)(M,{children:e.h1||e.title}),e.author?.name&&(0,n.jsxs)("div",{className:"dsa-author","data-dsa-author":"",style:d?void 0:{display:"flex",alignItems:"center",gap:"0.75rem",marginBottom:"1.5rem"},children:[e.author.image_url&&(0,n.jsx)("img",{className:"dsa-author-avatar",src:e.author.image_url,alt:e.author.name,style:d?void 0:{width:"2.5rem",height:"2.5rem",borderRadius:"9999px",objectFit:"cover"}}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{style:d?void 0:{fontSize:"0.875rem",fontWeight:600,color:"var(--dsa-text)"},children:[e.author.url?(0,n.jsx)("a",{href:e.author.url,className:"dsa-author-link",rel:"author",style:d?void 0:{color:"inherit",textDecoration:"none"},children:e.author.name}):e.author.name,e.author.job_title&&(0,n.jsxs)("span",{className:"dsa-author-title",style:d?void 0:{fontWeight:400,color:"var(--dsa-text-muted)",marginLeft:"0.25rem"},children:[" ","\xB7 ",e.author.job_title]})]}),e.author.bio&&(0,n.jsx)("p",{className:"dsa-author-bio",style:d?void 0:{fontSize:"0.75rem",color:"var(--dsa-text-muted)",margin:"0.125rem 0 0"},children:e.author.bio})]})]}),e.featured_image_url&&(0,n.jsx)("img",{className:"dsa-featured-image",src:e.featured_image_url,alt:e.featured_image_alt||e.title,style:d?void 0:{width:"100%",borderRadius:"0.75rem",marginBottom:"2rem"}}),a&&(e.headings??[]).length>0&&(0,n.jsx)(O,{headings:e.headings}),(0,n.jsx)("div",{className:J,"data-dsa-article-body":"",style:d?void 0:{lineHeight:1.75,color:"var(--dsa-content-text)",fontSize:"1.0625rem"},dangerouslySetInnerHTML:{__html:e.content_html}}),t&&(e.faq??[]).length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("hr",{className:"dsa-divider",style:d?void 0:{border:"none",borderTop:"1px solid var(--dsa-divider)",margin:"2.5rem 0"}}),(0,n.jsx)(W,{items:e.faq})]}),e.schema_json&&(0,n.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(e.schema_json)}}),o&&s&&s.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("hr",{className:"dsa-divider",style:d?void 0:{border:"none",borderTop:"1px solid var(--dsa-divider)",margin:"2.5rem 0"}}),(0,n.jsx)(S,{articles:s,onArticleClick:i,theme:u})]})]})}var b=require("react/jsx-runtime");function q(e,t){let a=t?`${t.replace(/\/+$/,"")}/blog/${e.slug}`:void 0,r={title:e.meta_title||e.title,description:e.meta_description||e.excerpt||"",openGraph:{title:e.meta_title||e.title,description:e.meta_description||e.excerpt||"",type:"article",publishedTime:e.published_at||void 0,modifiedTime:e.updated_at||void 0,...a?{url:a}:{},...e.featured_image_url?{images:[{url:e.featured_image_url,alt:e.featured_image_alt||e.title}]}:{}},twitter:{card:"summary_large_image",title:e.meta_title||e.title,description:e.meta_description||e.excerpt||"",...e.featured_image_url?{images:[e.featured_image_url]}:{}},...e.canonical_url?{alternates:{canonical:e.canonical_url}}:a?{alternates:{canonical:a}}:{}};return e.author?.name&&(r.authors=[{name:e.author.name,url:e.author.url||void 0}]),r}function me(e,t){if(e.schema_json&&e.schema_json["@context"])return e.schema_json;let a=t?`${t.replace(/\/+$/,"")}/blog/${e.slug}`:void 0,r={"@context":"https://schema.org","@type":"Article",headline:e.meta_title||e.title,description:e.meta_description||e.excerpt||"",datePublished:e.published_at||void 0,dateModified:e.updated_at||e.published_at||void 0,...e.featured_image_url?{image:e.featured_image_url}:{},...a?{url:a}:{},...e.target_keyword?{keywords:[e.target_keyword,...e.secondary_keywords||[]].join(", ")}:{}};if(e.author?.name){let o={"@type":"Person",name:e.author.name};e.author.url&&(o.url=e.author.url),e.author.image_url&&(o.image=e.author.image_url),e.author.job_title&&(o.jobTitle=e.author.job_title);let s=[];if(e.author.url&&s.push(e.author.url),e.author.socials)for(let i of Object.values(e.author.socials))i&&i.startsWith("http")&&s.push(i);s.length&&(o.sameAs=s),r.author=o}if(e.publisher?.name){let o={"@type":"Organization",name:e.publisher.name};e.publisher.url&&(o.url=e.publisher.url),e.publisher.logo_url&&(o.logo={"@type":"ImageObject",url:e.publisher.logo_url}),r.publisher=o}return r.speakable={"@type":"SpeakableSpecification",cssSelector:["[data-speakable]",".dsa-article-body > p:first-of-type"]},e.faq?.length&&(r.mainEntity=e.faq.map(o=>({"@type":"Question",name:o.question,acceptedAnswer:{"@type":"Answer",text:o.answer}}))),r}function pe(e,t){if(!t)return null;let a=t.replace(/\/+$/,""),r=[{name:"Home",url:a},{name:"Blog",url:`${a}/blog`}];return e.pillar_name&&r.push({name:e.pillar_name,url:`${a}/blog?pillar=${encodeURIComponent(e.pillar_name)}`}),r.push({name:e.h1||e.title,url:`${a}/blog/${e.slug}`}),{"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:r.map((o,s)=>({"@type":"ListItem",position:s+1,name:o.name,item:o.url}))}}function I({article:e,siteUrl:t}){let a=me(e,t),r=pe(e,t);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(a)}}),r&&(0,b.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(r)}})]})}0&&(module.exports={ArticleFeed,ArticlePage,ContentClient,DsaContentProvider,FaqBlock,RelatedArticles,SeoMetaBridge,generateArticleMetadata,useArticle,useArticles,useCategories,useDsaContent,useRelatedArticles});
|
|
25
|
+
`.trim();function xe(e){ae.default.useEffect(()=>{if(!e||typeof document>"u"||document.getElementById(te))return;let t=document.createElement("style");t.id=te,t.textContent=ye,document.head.appendChild(t)},[e])}function ve({headings:e}){return!e||e.length===0?null:(0,n.jsxs)("nav",{className:"dsa-toc","data-dsa-toc":"",style:{background:"var(--dsa-toc-bg, #f9fafb)",border:"1px solid var(--dsa-card-border, #e5e7eb)",borderRadius:"0.75rem",padding:"1.25rem",marginBottom:"2rem"},children:[(0,n.jsx)("p",{style:{fontSize:"0.875rem",fontWeight:600,color:"var(--dsa-text-muted, #374151)",margin:"0 0 0.75rem",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Table of Contents"}),(0,n.jsx)("ul",{style:{listStyle:"none",padding:0,margin:0},children:e.map((t,a)=>(0,n.jsx)("li",{style:{padding:"0.25rem 0",paddingLeft:`${(t.level-2)*1}rem`},children:(0,n.jsx)("a",{href:`#${t.id}`,style:{color:"var(--dsa-text-muted, #4b5563)",textDecoration:"none",fontSize:"0.875rem"},children:t.text})},a))})]})}function Se({headings:e}){return!e||e.length===0?null:(0,n.jsxs)("nav",{className:"dsa-toc","data-dsa-toc":"",children:[(0,n.jsx)("p",{className:"dsa-toc-title",children:"Table of Contents"}),(0,n.jsx)("ul",{className:"dsa-toc-list",children:e.map((t,a)=>(0,n.jsx)("li",{className:"dsa-toc-item",style:{paddingLeft:`${(t.level-2)*1}rem`},children:(0,n.jsx)("a",{href:`#${t.id}`,className:"dsa-toc-link",children:t.text})},a))})]})}function j({article:e,showFaq:t=!0,showTableOfContents:a=!0,showMeta:o=!0,showRelated:r=!1,relatedArticles:s,onRelatedClick:i,className:m,contentClassName:l,theme:u="light",disableProseStyles:_=!1,components:A}){let d=u==="inherit";xe(!d&&!_);let y=A?.H1||(d?({children:p})=>(0,n.jsx)("h1",{className:"dsa-h1",children:p}):({children:p})=>(0,n.jsx)("h1",{className:"dsa-h1",style:{fontSize:"2.25rem",fontWeight:700,lineHeight:1.2,color:"var(--dsa-text)",margin:"0 0 1rem"},children:p})),f=A?.Toc||(d?Se:ve),L=A?.Faq||T,E=d?{}:be[u],U=["dsa-article-body",l].filter(Boolean).join(" ");return(0,n.jsxs)("article",{className:m,"data-dsa-theme":u,style:d?void 0:{maxWidth:"48rem",margin:"0 auto",fontFamily:"system-ui, -apple-system, sans-serif",...E},children:[o&&(0,n.jsxs)("div",{className:"dsa-meta","data-dsa-meta":"",style:d?void 0:{display:"flex",gap:"1rem",flexWrap:"wrap",fontSize:"0.875rem",color:"var(--dsa-text-muted)",marginBottom:"1.5rem"},children:[e.pillar_name&&(0,n.jsx)("span",{className:"dsa-badge",style:d?void 0:{display:"inline-block",padding:"0.125rem 0.5rem",borderRadius:"9999px",background:"var(--dsa-badge-bg)",color:"var(--dsa-badge-text)",fontSize:"0.75rem"},children:e.pillar_name}),e.content_type&&(0,n.jsx)("span",{className:"dsa-badge dsa-badge--alt",style:d?void 0:{display:"inline-block",padding:"0.125rem 0.5rem",borderRadius:"9999px",background:"var(--dsa-badge-alt-bg, var(--dsa-badge-bg))",color:"var(--dsa-badge-alt-text, var(--dsa-badge-text))",fontSize:"0.75rem"},children:e.content_type.replace(/_/g," ")}),e.reading_time_minutes&&(0,n.jsxs)("span",{className:"dsa-reading-time",children:[e.reading_time_minutes," min read"]}),e.published_at&&(0,n.jsx)("span",{className:"dsa-published-at",children:new Date(e.published_at).toLocaleDateString()})]}),(0,n.jsx)(y,{children:e.h1||e.title}),e.author?.name&&(0,n.jsxs)("div",{className:"dsa-author","data-dsa-author":"",style:d?void 0:{display:"flex",alignItems:"center",gap:"0.75rem",marginBottom:"1.5rem"},children:[e.author.image_url&&(0,n.jsx)("img",{className:"dsa-author-avatar",src:e.author.image_url,alt:e.author.name,style:d?void 0:{width:"2.5rem",height:"2.5rem",borderRadius:"9999px",objectFit:"cover"}}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{style:d?void 0:{fontSize:"0.875rem",fontWeight:600,color:"var(--dsa-text)"},children:[e.author.url?(0,n.jsx)("a",{href:e.author.url,className:"dsa-author-link",rel:"author",style:d?void 0:{color:"inherit",textDecoration:"none"},children:e.author.name}):e.author.name,e.author.job_title&&(0,n.jsxs)("span",{className:"dsa-author-title",style:d?void 0:{fontWeight:400,color:"var(--dsa-text-muted)",marginLeft:"0.25rem"},children:[" ","\xB7 ",e.author.job_title]})]}),e.author.bio&&(0,n.jsx)("p",{className:"dsa-author-bio",style:d?void 0:{fontSize:"0.75rem",color:"var(--dsa-text-muted)",margin:"0.125rem 0 0"},children:e.author.bio})]})]}),e.featured_image_url&&(0,n.jsx)("img",{className:"dsa-featured-image",src:e.featured_image_url,alt:e.featured_image_alt||e.title,style:d?void 0:{width:"100%",borderRadius:"0.75rem",marginBottom:"2rem"}}),a&&(e.headings??[]).length>0&&(0,n.jsx)(f,{headings:e.headings}),(0,n.jsx)("div",{className:U,"data-dsa-article-body":"",style:d?void 0:{lineHeight:1.75,color:"var(--dsa-content-text)",fontSize:"1.0625rem"},dangerouslySetInnerHTML:{__html:e.content_html}}),t&&(e.faq??[]).length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("hr",{className:"dsa-divider",style:d?void 0:{border:"none",borderTop:"1px solid var(--dsa-divider)",margin:"2.5rem 0"}}),(0,n.jsx)(L,{items:e.faq})]}),e.schema_json&&(0,n.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(e.schema_json)}}),r&&s&&s.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("hr",{className:"dsa-divider",style:d?void 0:{border:"none",borderTop:"1px solid var(--dsa-divider)",margin:"2.5rem 0"}}),(0,n.jsx)(D,{articles:s,onArticleClick:i,theme:u})]})]})}var R=require("react/jsx-runtime");function H(e,t){let a=t?`${t.replace(/\/+$/,"")}/blog/${e.slug}`:void 0,o={title:e.meta_title||e.title,description:e.meta_description||e.excerpt||"",openGraph:{title:e.meta_title||e.title,description:e.meta_description||e.excerpt||"",type:"article",publishedTime:e.published_at||void 0,modifiedTime:e.updated_at||void 0,...a?{url:a}:{},...e.featured_image_url?{images:[{url:e.featured_image_url,alt:e.featured_image_alt||e.title}]}:{}},twitter:{card:"summary_large_image",title:e.meta_title||e.title,description:e.meta_description||e.excerpt||"",...e.featured_image_url?{images:[e.featured_image_url]}:{}},...e.canonical_url?{alternates:{canonical:e.canonical_url}}:a?{alternates:{canonical:a}}:{}};return e.author?.name&&(o.authors=[{name:e.author.name,url:e.author.url||void 0}]),o}function _e(e,t){if(e.schema_json&&e.schema_json["@context"])return e.schema_json;let a=t?`${t.replace(/\/+$/,"")}/blog/${e.slug}`:void 0,o={"@context":"https://schema.org","@type":"Article",headline:e.meta_title||e.title,description:e.meta_description||e.excerpt||"",datePublished:e.published_at||void 0,dateModified:e.updated_at||e.published_at||void 0,...e.featured_image_url?{image:e.featured_image_url}:{},...a?{url:a}:{},...e.target_keyword?{keywords:[e.target_keyword,...e.secondary_keywords||[]].join(", ")}:{}};if(e.author?.name){let r={"@type":"Person",name:e.author.name};e.author.url&&(r.url=e.author.url),e.author.image_url&&(r.image=e.author.image_url),e.author.job_title&&(r.jobTitle=e.author.job_title);let s=[];if(e.author.url&&s.push(e.author.url),e.author.socials)for(let i of Object.values(e.author.socials))i&&i.startsWith("http")&&s.push(i);s.length&&(r.sameAs=s),o.author=r}if(e.publisher?.name){let r={"@type":"Organization",name:e.publisher.name};e.publisher.url&&(r.url=e.publisher.url),e.publisher.logo_url&&(r.logo={"@type":"ImageObject",url:e.publisher.logo_url}),o.publisher=r}return o.speakable={"@type":"SpeakableSpecification",cssSelector:["[data-speakable]",".dsa-article-body > p:first-of-type"]},e.faq?.length&&(o.mainEntity=e.faq.map(r=>({"@type":"Question",name:r.question,acceptedAnswer:{"@type":"Answer",text:r.answer}}))),o}function Ae(e,t){if(!t)return null;let a=t.replace(/\/+$/,""),o=[{name:"Home",url:a},{name:"Blog",url:`${a}/blog`}];return e.pillar_name&&o.push({name:e.pillar_name,url:`${a}/blog?pillar=${encodeURIComponent(e.pillar_name)}`}),o.push({name:e.h1||e.title,url:`${a}/blog/${e.slug}`}),{"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:o.map((r,s)=>({"@type":"ListItem",position:s+1,name:r.name,item:r.url}))}}function W({article:e,siteUrl:t}){let a=_e(e,t),o=Ae(e,t);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(a)}}),o&&(0,R.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(o)}})]})}var oe=require("react");var c=require("react/jsx-runtime"),re={name:{label:"Name",placeholder:"Your name",type:"text",required:!1},email:{label:"Email",placeholder:"you@company.com",type:"email",required:!0},phone:{label:"Phone",placeholder:"+1 (555) 000-0000",type:"tel",required:!1},company:{label:"Company",placeholder:"Company name",type:"text",required:!1},website:{label:"Website",placeholder:"https://...",type:"url",required:!1},message:{label:"Message",placeholder:"How can we help?",type:"textarea",required:!1},city:{label:"City",placeholder:"City",type:"text",required:!1},country:{label:"Country",placeholder:"Country",type:"text",required:!1}};function Ce(e){if(typeof e=="string"){let a=re[e];return{name:e,...a}}return{...re[e.name],...e}}function M({webhookUrl:e,projectSlug:t,webhookToken:a,fields:o=["name","email"],leadMagnet:r,ctaText:s="Submit",thankYouMessage:i,theme:m="light",className:l,onSuccess:u,onError:_,sourceUrl:A,children:d}){let y=I({webhookUrl:e,projectSlug:t,webhookToken:a}),[f,L]=(0,oe.useState)({}),E=o.map(Ce);if(d)return(0,c.jsx)(c.Fragment,{children:d({...y})});let U=async g=>{g.preventDefault();let P={email:f.email||"",name:f.name,phone:f.phone,company:f.company,website:f.website,message:f.message,city:f.city,country:f.country,source_url:A},k=await y.submit(P);k.ok?u?.(P):k.error&&_?.(new Error(k.error))},p=m==="inherit",x=m==="dark",v=p?{}:{wrapper:{fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',backgroundColor:x?"#1e293b":"#ffffff",border:`1px solid ${x?"#334155":"#e2e8f0"}`,borderRadius:"12px",padding:"24px",maxWidth:"480px",color:x?"#f1f5f9":"#0f172a"},heading:{margin:"0 0 4px 0",fontSize:"18px",fontWeight:700,color:x?"#f1f5f9":"#0f172a"},description:{margin:"0 0 16px 0",fontSize:"14px",color:x?"#94a3b8":"#64748b"},label:{display:"block",fontSize:"13px",fontWeight:500,marginBottom:"4px",color:x?"#cbd5e1":"#374151"},input:{display:"block",width:"100%",padding:"8px 12px",fontSize:"14px",border:`1px solid ${x?"#475569":"#d1d5db"}`,borderRadius:"8px",backgroundColor:x?"#0f172a":"#ffffff",color:x?"#f1f5f9":"#0f172a",outline:"none",boxSizing:"border-box"},textarea:{display:"block",width:"100%",padding:"8px 12px",fontSize:"14px",border:`1px solid ${x?"#475569":"#d1d5db"}`,borderRadius:"8px",backgroundColor:x?"#0f172a":"#ffffff",color:x?"#f1f5f9":"#0f172a",outline:"none",minHeight:"80px",resize:"vertical",fontFamily:"inherit",boxSizing:"border-box"},button:{width:"100%",padding:"10px 20px",fontSize:"14px",fontWeight:600,color:"#ffffff",backgroundColor:"#2563eb",border:"none",borderRadius:"8px",cursor:"pointer",marginTop:"4px",opacity:y.submitting?.7:1},fieldGroup:{marginBottom:"12px"},error:{fontSize:"13px",color:"#ef4444",marginTop:"8px"},success:{textAlign:"center",padding:"16px 0"},successTitle:{fontSize:"18px",fontWeight:700,color:x?"#34d399":"#059669",marginBottom:"8px"},successText:{fontSize:"14px",color:x?"#94a3b8":"#64748b",marginBottom:"16px"},downloadLink:{display:"inline-block",padding:"10px 24px",fontSize:"14px",fontWeight:600,color:"#ffffff",backgroundColor:"#2563eb",borderRadius:"8px",textDecoration:"none"}};return y.submitted?(0,c.jsx)("div",{className:`dsa-lead-form dsa-lead-form--success ${l||""}`,"data-dsa-lead-form":!0,"data-theme":m,style:p?void 0:v.wrapper,children:(0,c.jsxs)("div",{style:p?void 0:v.success,children:[(0,c.jsx)("div",{style:p?void 0:v.successTitle,children:i||"Thank you!"}),r?.downloadUrl&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("p",{style:p?void 0:v.successText,children:"Your download is ready:"}),(0,c.jsxs)("a",{href:r.downloadUrl,target:"_blank",rel:"noopener noreferrer",className:"dsa-lead-form__download",style:p?void 0:v.downloadLink,children:["Download ",r.title]})]})]})}):(0,c.jsxs)("div",{className:`dsa-lead-form ${l||""}`,"data-dsa-lead-form":!0,"data-theme":m,style:p?void 0:v.wrapper,children:[r&&(0,c.jsxs)("div",{className:"dsa-lead-form__magnet",style:{marginBottom:"16px"},children:[r.imageUrl&&(0,c.jsx)("img",{src:r.imageUrl,alt:r.title,style:p?void 0:{width:"100%",borderRadius:"8px",marginBottom:"12px",display:"block"},className:"dsa-lead-form__magnet-image"}),(0,c.jsx)("h3",{className:"dsa-lead-form__magnet-title",style:p?void 0:v.heading,children:r.title}),r.description&&(0,c.jsx)("p",{className:"dsa-lead-form__magnet-description",style:p?void 0:v.description,children:r.description})]}),(0,c.jsxs)("form",{onSubmit:U,className:"dsa-lead-form__form",noValidate:!0,children:[E.map(g=>(0,c.jsxs)("div",{className:"dsa-lead-form__field",style:p?void 0:v.fieldGroup,children:[(0,c.jsxs)("label",{className:"dsa-lead-form__label",style:p?void 0:v.label,children:[g.label,g.required&&" *"]}),g.type==="textarea"?(0,c.jsx)("textarea",{name:g.name,placeholder:g.placeholder,required:g.required,value:f[g.name]||"",onChange:P=>L(k=>({...k,[g.name]:P.target.value})),className:"dsa-lead-form__textarea",style:p?void 0:v.textarea}):(0,c.jsx)("input",{type:g.type||"text",name:g.name,placeholder:g.placeholder,required:g.required,value:f[g.name]||"",onChange:P=>L(k=>({...k,[g.name]:P.target.value})),className:"dsa-lead-form__input",style:p?void 0:v.input})]},g.name)),(0,c.jsx)("button",{type:"submit",disabled:y.submitting,className:"dsa-lead-form__submit",style:p?void 0:v.button,children:y.submitting?"Sending...":s}),y.error&&(0,c.jsx)("p",{className:"dsa-lead-form__error",style:p?void 0:v.error,children:y.error.message})]})]})}0&&(module.exports={ArticleFeed,ArticlePage,ContentClient,DsaContentProvider,DsaLeadForm,FaqBlock,RelatedArticles,SeoMetaBridge,generateArticleMetadata,useArticle,useArticles,useCategories,useDsaContent,useDsaLeadForm,useRelatedArticles});
|
|
26
26
|
//# sourceMappingURL=index.js.map
|