@dsaplatform/content-sdk 1.5.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 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
@@ -29,6 +29,10 @@ interface Article {
29
29
  pillar_name?: string;
30
30
  cluster_name?: string;
31
31
  content_type?: string;
32
+ /** Author info from site settings (E-E-A-T) */
33
+ author?: ArticleAuthor | null;
34
+ /** Publisher info from site settings (E-E-A-T) */
35
+ publisher?: ArticlePublisher | null;
32
36
  }
33
37
  /**
34
38
  * Article heading (from H1-H6 tags)
@@ -52,6 +56,25 @@ interface InternalLink {
52
56
  slug: string;
53
57
  anchor_text: string;
54
58
  }
59
+ /**
60
+ * Author information (E-E-A-T) — populated from site settings
61
+ */
62
+ interface ArticleAuthor {
63
+ name: string;
64
+ url?: string | null;
65
+ bio?: string | null;
66
+ image_url?: string | null;
67
+ job_title?: string | null;
68
+ socials?: Record<string, string>;
69
+ }
70
+ /**
71
+ * Publisher information (E-E-A-T) — populated from site settings
72
+ */
73
+ interface ArticlePublisher {
74
+ name: string;
75
+ logo_url?: string | null;
76
+ url?: string | null;
77
+ }
55
78
 
56
79
  /**
57
80
  * Headless utilities — data transformers with zero UI / zero inline styles.
@@ -29,6 +29,10 @@ interface Article {
29
29
  pillar_name?: string;
30
30
  cluster_name?: string;
31
31
  content_type?: string;
32
+ /** Author info from site settings (E-E-A-T) */
33
+ author?: ArticleAuthor | null;
34
+ /** Publisher info from site settings (E-E-A-T) */
35
+ publisher?: ArticlePublisher | null;
32
36
  }
33
37
  /**
34
38
  * Article heading (from H1-H6 tags)
@@ -52,6 +56,25 @@ interface InternalLink {
52
56
  slug: string;
53
57
  anchor_text: string;
54
58
  }
59
+ /**
60
+ * Author information (E-E-A-T) — populated from site settings
61
+ */
62
+ interface ArticleAuthor {
63
+ name: string;
64
+ url?: string | null;
65
+ bio?: string | null;
66
+ image_url?: string | null;
67
+ job_title?: string | null;
68
+ socials?: Record<string, string>;
69
+ }
70
+ /**
71
+ * Publisher information (E-E-A-T) — populated from site settings
72
+ */
73
+ interface ArticlePublisher {
74
+ name: string;
75
+ logo_url?: string | null;
76
+ url?: string | null;
77
+ }
55
78
 
56
79
  /**
57
80
  * Headless utilities — data transformers with zero UI / zero inline styles.
package/dist/index.d.mts CHANGED
@@ -45,6 +45,10 @@ interface Article {
45
45
  pillar_name?: string;
46
46
  cluster_name?: string;
47
47
  content_type?: string;
48
+ /** Author info from site settings (E-E-A-T) */
49
+ author?: ArticleAuthor | null;
50
+ /** Publisher info from site settings (E-E-A-T) */
51
+ publisher?: ArticlePublisher | null;
48
52
  }
49
53
  /**
50
54
  * Abbreviated article for lists
@@ -88,6 +92,25 @@ interface InternalLink {
88
92
  slug: string;
89
93
  anchor_text: string;
90
94
  }
95
+ /**
96
+ * Author information (E-E-A-T) — populated from site settings
97
+ */
98
+ interface ArticleAuthor {
99
+ name: string;
100
+ url?: string | null;
101
+ bio?: string | null;
102
+ image_url?: string | null;
103
+ job_title?: string | null;
104
+ socials?: Record<string, string>;
105
+ }
106
+ /**
107
+ * Publisher information (E-E-A-T) — populated from site settings
108
+ */
109
+ interface ArticlePublisher {
110
+ name: string;
111
+ logo_url?: string | null;
112
+ url?: string | null;
113
+ }
91
114
  /**
92
115
  * Category with clusters
93
116
  */
@@ -461,7 +484,7 @@ declare function RelatedArticles({ articles, title, limit, onArticleClick, class
461
484
  * Use in page.tsx generateMetadata():
462
485
  *
463
486
  * ```ts
464
- * import { generateArticleMetadata } from "@dsa/content-sdk/server";
487
+ * import { generateArticleMetadata } from "@dsaplatform/content-sdk/server";
465
488
  *
466
489
  * export async function generateMetadata({ params }) {
467
490
  * const article = await fetchArticleBySlug(config, params.slug);
@@ -472,7 +495,8 @@ declare function RelatedArticles({ articles, title, limit, onArticleClick, class
472
495
  declare function generateArticleMetadata(article: Article, siteUrl?: string): Record<string, any>;
473
496
  /**
474
497
  * Renders JSON-LD structured data for an article.
475
- * Include this component in your article page layout for SEO.
498
+ * Outputs Article schema (with Author, Publisher, Speakable, FAQ)
499
+ * and BreadcrumbList schema when siteUrl is provided.
476
500
  *
477
501
  * ```tsx
478
502
  * <SeoMetaBridge article={article} siteUrl="https://example.com" />
@@ -530,4 +554,4 @@ interface DsaLeadFormProps extends DsaLeadFormConfig {
530
554
  */
531
555
  declare function DsaLeadForm({ webhookUrl, projectSlug, webhookToken, fields, leadMagnet, ctaText, thankYouMessage, theme, className, onSuccess, onError, sourceUrl, children, }: DsaLeadFormProps): react_jsx_runtime.JSX.Element;
532
556
 
533
- export { type Article, ArticleFeed, type ArticleFeedProps, type ArticleFilters, type ArticleHeading, type ArticleListItem, ArticlePage, type ArticlePageProps, 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 };
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
@@ -45,6 +45,10 @@ interface Article {
45
45
  pillar_name?: string;
46
46
  cluster_name?: string;
47
47
  content_type?: string;
48
+ /** Author info from site settings (E-E-A-T) */
49
+ author?: ArticleAuthor | null;
50
+ /** Publisher info from site settings (E-E-A-T) */
51
+ publisher?: ArticlePublisher | null;
48
52
  }
49
53
  /**
50
54
  * Abbreviated article for lists
@@ -88,6 +92,25 @@ interface InternalLink {
88
92
  slug: string;
89
93
  anchor_text: string;
90
94
  }
95
+ /**
96
+ * Author information (E-E-A-T) — populated from site settings
97
+ */
98
+ interface ArticleAuthor {
99
+ name: string;
100
+ url?: string | null;
101
+ bio?: string | null;
102
+ image_url?: string | null;
103
+ job_title?: string | null;
104
+ socials?: Record<string, string>;
105
+ }
106
+ /**
107
+ * Publisher information (E-E-A-T) — populated from site settings
108
+ */
109
+ interface ArticlePublisher {
110
+ name: string;
111
+ logo_url?: string | null;
112
+ url?: string | null;
113
+ }
91
114
  /**
92
115
  * Category with clusters
93
116
  */
@@ -461,7 +484,7 @@ declare function RelatedArticles({ articles, title, limit, onArticleClick, class
461
484
  * Use in page.tsx generateMetadata():
462
485
  *
463
486
  * ```ts
464
- * import { generateArticleMetadata } from "@dsa/content-sdk/server";
487
+ * import { generateArticleMetadata } from "@dsaplatform/content-sdk/server";
465
488
  *
466
489
  * export async function generateMetadata({ params }) {
467
490
  * const article = await fetchArticleBySlug(config, params.slug);
@@ -472,7 +495,8 @@ declare function RelatedArticles({ articles, title, limit, onArticleClick, class
472
495
  declare function generateArticleMetadata(article: Article, siteUrl?: string): Record<string, any>;
473
496
  /**
474
497
  * Renders JSON-LD structured data for an article.
475
- * Include this component in your article page layout for SEO.
498
+ * Outputs Article schema (with Author, Publisher, Speakable, FAQ)
499
+ * and BreadcrumbList schema when siteUrl is provided.
476
500
  *
477
501
  * ```tsx
478
502
  * <SeoMetaBridge article={article} siteUrl="https://example.com" />
@@ -530,4 +554,4 @@ interface DsaLeadFormProps extends DsaLeadFormConfig {
530
554
  */
531
555
  declare function DsaLeadForm({ webhookUrl, projectSlug, webhookToken, fields, leadMagnet, ctaText, thankYouMessage, theme, className, onSuccess, onError, sourceUrl, children, }: DsaLeadFormProps): react_jsx_runtime.JSX.Element;
532
556
 
533
- export { type Article, ArticleFeed, type ArticleFeedProps, type ArticleFilters, type ArticleHeading, type ArticleListItem, ArticlePage, type ArticlePageProps, 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 };
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 se=Object.create;var D=Object.defineProperty;var ie=Object.getOwnPropertyDescriptor;var ne=Object.getOwnPropertyNames;var de=Object.getPrototypeOf,le=Object.prototype.hasOwnProperty;var ce=(e,t)=>{for(var a in t)D(e,a,{get:t[a],enumerable:!0})},j=(e,t,a,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of ne(t))!le.call(e,r)&&r!==a&&D(e,r,{get:()=>t[r],enumerable:!(s=ie(t,r))||s.enumerable});return e};var O=(e,t,a)=>(a=e!=null?se(de(e)):{},j(t||!e||!e.__esModule?D(a,"default",{value:e,enumerable:!0}):a,e)),me=e=>j(D({},"__esModule",{value:!0}),e);var Ce={};ce(Ce,{ArticleFeed:()=>B,ArticlePage:()=>$,ContentClient:()=>L,DsaContentProvider:()=>V,DsaLeadForm:()=>M,FaqBlock:()=>q,RelatedArticles:()=>T,SeoMetaBridge:()=>W,generateArticleMetadata:()=>H,useArticle:()=>Y,useArticles:()=>J,useCategories:()=>X,useDsaContent:()=>w,useDsaLeadForm:()=>z,useRelatedArticles:()=>Q});module.exports=me(Ce);var L=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 s=new URL(`${this.apiUrl}${t}`);a&&Object.entries(a).forEach(([n,m])=>{m!=null&&m!==""&&s.searchParams.set(n,String(m))}),s.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 o=await fetch(s.toString(),r);if(!o.ok){let n=await o.text().catch(()=>"");throw new Error(`DSA Content API error ${o.status}: ${n||o.statusText}`)}return o.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 s=await this.request(`/api/public/articles/${encodeURIComponent(t)}/related`,{limit:a});return s.items??(Array.isArray(s)?s:[])}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 N=require("react");var G=require("react/jsx-runtime"),K=(0,N.createContext)(null);function V({config:e,children:t}){let a=(0,N.useMemo)(()=>new L(e),[e.apiUrl,e.apiKey]);return(0,G.jsx)(K.Provider,{value:a,children:t})}function w(){let e=(0,N.useContext)(K);if(!e)throw new Error("useDsaContent() must be used inside <DsaContentProvider>");return e}var b=require("react");function J(e){let t=w(),[a,s]=(0,b.useState)({articles:[],loading:!0,error:null,pagination:{page:1,per_page:10,total:0,total_pages:0}}),r=(0,b.useCallback)(()=>{s(o=>({...o,loading:!0,error:null})),t.getArticles(e).then(o=>s({articles:o.items,loading:!1,error:null,pagination:{page:o.page,per_page:o.per_page,total:o.total,total_pages:o.total_pages}})).catch(o=>s(n=>({...n,loading:!1,error:o instanceof Error?o:new Error(String(o))})))},[t,e?.page,e?.per_page,e?.pillar,e?.cluster,e?.content_type,e?.search]);return(0,b.useEffect)(()=>{r()},[r]),{...a,refetch:r}}function Y(e){let t=w(),[a,s]=(0,b.useState)({article:null,loading:!0,error:null}),r=(0,b.useCallback)(()=>{if(!e){s({article:null,loading:!1,error:null});return}s(o=>({...o,loading:!0,error:null})),t.getArticleBySlug(e).then(o=>s({article:o,loading:!1,error:null})).catch(o=>s({article:null,loading:!1,error:o instanceof Error?o:new Error(String(o))}))},[t,e]);return(0,b.useEffect)(()=>{r()},[r]),{...a,refetch:r}}function Q(e,t=3){let a=w(),[s,r]=(0,b.useState)({articles:[],loading:!0,error:null}),o=(0,b.useCallback)(()=>{if(!e){r({articles:[],loading:!1,error:null});return}r(n=>({...n,loading:!0,error:null})),a.getRelatedArticles(e,t).then(n=>r({articles:n,loading:!1,error:null})).catch(n=>r({articles:[],loading:!1,error:n instanceof Error?n:new Error(String(n))}))},[a,e,t]);return(0,b.useEffect)(()=>{o()},[o]),{...s,refetch:o}}function X(){let e=w(),[t,a]=(0,b.useState)({categories:[],loading:!0,error:null}),s=(0,b.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,b.useEffect)(()=>{s()},[s]),{...t,refetch:s}}var A=require("react");function z(e){let[t,a]=(0,A.useState)(!1),[s,r]=(0,A.useState)(!1),[o,n]=(0,A.useState)(null),m=(0,A.useCallback)(async g=>{a(!0),n(null);try{let C=`${e.webhookUrl.replace(/\/+$/,"")}/api/webhook/form/${encodeURIComponent(e.projectSlug)}?token=${encodeURIComponent(e.webhookToken)}`,l={...g};!l.source_url&&typeof window<"u"&&(l.source_url=window.location.href);let y=await fetch(C,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)}),u=await y.json().catch(()=>({}));if(!y.ok){let R=u.error||`Submission failed (${y.status})`;throw new Error(R)}return r(!0),{ok:!0,message:u.message}}catch(_){let C=_ instanceof Error?_:new Error(String(_));return n(C),{ok:!1,error:C.message}}finally{a(!1)}},[e.webhookUrl,e.projectSlug,e.webhookToken]),d=(0,A.useCallback)(()=>{a(!1),r(!1),n(null)},[]);return{submitting:t,submitted:s,error:o,submit:m,reset:d}}var U=O(require("react")),h=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 ge({article:e,layout:t,showExcerpt:a,showImage:s,showMeta:r,onClick:o}){let n=t==="grid",[m,d]=U.default.useState(!1),g={...n?{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,h.jsxs)("article",{style:g,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onClick:o,role:"link",tabIndex:0,onKeyDown:_=>_.key==="Enter"&&o?.(),children:[s&&e.featured_image_url&&(0,h.jsx)("img",{src:e.featured_image_url,alt:e.featured_image_alt||e.title,style:n?{width:"100%",height:"200px",objectFit:"cover",display:"block"}:{width:"240px",minHeight:"160px",objectFit:"cover",flexShrink:0},loading:"lazy"}),(0,h.jsxs)("div",{style:n?{padding:"1.25rem"}:{padding:"1.25rem",flex:1},children:[(0,h.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,h.jsx)("p",{style:{margin:"0 0 0.75rem",fontSize:"0.875rem",color:"var(--dsa-text-muted)",lineHeight:1.5},children:e.excerpt}),r&&(0,h.jsxs)("div",{style:{display:"flex",gap:"0.75rem",fontSize:"0.75rem",color:"var(--dsa-text-faint)",flexWrap:"wrap"},children:[e.pillar_name&&(0,h.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,h.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,h.jsxs)("span",{children:[e.reading_time_minutes," min read"]}),e.published_at&&(0,h.jsx)("span",{children:new Date(e.published_at).toLocaleDateString()})]})]})]})}function B({articles:e,layout:t="grid",columns:a=3,showExcerpt:s=!0,showImage:r=!0,showMeta:o=!0,onArticleClick:n,className:m,theme:d="light",renderArticle:g}){let _=t==="grid"?`repeat(${a}, 1fr)`:"1fr",C=d!=="inherit"?pe[d]:{};return(0,h.jsx)("div",{className:m,style:{display:"grid",gap:"1.5rem",gridTemplateColumns:_,...C},children:(e??[]).map(l=>g?(0,h.jsx)(U.default.Fragment,{children:g(l)},l.id):(0,h.jsx)(ge,{article:l,layout:t,showExcerpt:s,showImage:r,showMeta:o,onClick:()=>n?.(l.slug)},l.id))})}var te=O(require("react"));var Z=require("react"),S=require("react/jsx-runtime"),fe={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 ue({item:e,collapsible:t,defaultOpen:a}){let[s,r]=(0,Z.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(!s),"aria-expanded":s,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:s?"rotate(180deg)":"rotate(0deg)"},children:"\u25BC"})]}),s&&(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 q({items:e,collapsible:t=!0,defaultOpen:a=!1,className:s,title:r="Frequently Asked Questions",theme:o="light"}){if(!e||e.length===0)return null;let n=o!=="inherit"?fe[o]:{},m={"@context":"https://schema.org","@type":"FAQPage",mainEntity:e.map(d=>({"@type":"Question",name:d.question,acceptedAnswer:{"@type":"Answer",text:d.answer}}))};return(0,S.jsxs)("section",{className:s,style:{marginTop:"1rem",...n},children:[(0,S.jsx)("h2",{style:{fontSize:"1.5rem",fontWeight:700,color:"var(--dsa-text)",margin:"0 0 1rem"},children:r}),e.map((d,g)=>(0,S.jsx)(ue,{item:d,collapsible:t,defaultOpen:a},g)),(0,S.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(m)}})]})}var F=require("react/jsx-runtime"),be={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 T({articles:e,title:t="Related Articles",limit:a=3,onArticleClick:s,className:r,theme:o="light"}){let n=(e??[]).slice(0,a);if(n.length===0)return null;let m=o!=="inherit"?be[o]:{};return(0,F.jsxs)("section",{className:r,style:{marginTop:"1rem",...m},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:n.map(d=>(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:()=>s?.(d.slug),role:"link",tabIndex:0,onKeyDown:g=>g.key==="Enter"&&s?.(d.slug),children:[d.featured_image_url&&(0,F.jsx)("img",{src:d.featured_image_url,alt:d.featured_image_alt||d.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:d.title}),d.excerpt&&(0,F.jsx)("p",{style:{fontSize:"0.8125rem",color:"var(--dsa-text-muted)",marginTop:"0.5rem",lineHeight:1.4},children:d.excerpt})]})]},d.id))})]})}var i=require("react/jsx-runtime"),he={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"}},ee="dsa-article-prose",ye=`
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 xe(e){te.default.useEffect(()=>{if(!e||typeof document>"u"||document.getElementById(ee))return;let t=document.createElement("style");t.id=ee,t.textContent=ye,document.head.appendChild(t)},[e])}function ve({headings:e}){return!e||e.length===0?null:(0,i.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,i.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,i.jsx)("ul",{style:{listStyle:"none",padding:0,margin:0},children:e.map((t,a)=>(0,i.jsx)("li",{style:{padding:"0.25rem 0",paddingLeft:`${(t.level-2)*1}rem`},children:(0,i.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,i.jsxs)("nav",{className:"dsa-toc","data-dsa-toc":"",children:[(0,i.jsx)("p",{className:"dsa-toc-title",children:"Table of Contents"}),(0,i.jsx)("ul",{className:"dsa-toc-list",children:e.map((t,a)=>(0,i.jsx)("li",{className:"dsa-toc-item",style:{paddingLeft:`${(t.level-2)*1}rem`},children:(0,i.jsx)("a",{href:`#${t.id}`,className:"dsa-toc-link",children:t.text})},a))})]})}function $({article:e,showFaq:t=!0,showTableOfContents:a=!0,showMeta:s=!0,showRelated:r=!1,relatedArticles:o,onRelatedClick:n,className:m,contentClassName:d,theme:g="light",disableProseStyles:_=!1,components:C}){let l=g==="inherit";xe(!l&&!_);let y=C?.H1||(l?({children:p})=>(0,i.jsx)("h1",{className:"dsa-h1",children:p}):({children:p})=>(0,i.jsx)("h1",{className:"dsa-h1",style:{fontSize:"2.25rem",fontWeight:700,lineHeight:1.2,color:"var(--dsa-text)",margin:"0 0 1rem"},children:p})),u=C?.Toc||(l?Se:ve),R=C?.Faq||q,I=l?{}:he[g],E=["dsa-article-body",d].filter(Boolean).join(" ");return(0,i.jsxs)("article",{className:m,"data-dsa-theme":g,style:l?void 0:{maxWidth:"48rem",margin:"0 auto",fontFamily:"system-ui, -apple-system, sans-serif",...I},children:[s&&(0,i.jsxs)("div",{className:"dsa-meta","data-dsa-meta":"",style:l?void 0:{display:"flex",gap:"1rem",flexWrap:"wrap",fontSize:"0.875rem",color:"var(--dsa-text-muted)",marginBottom:"1.5rem"},children:[e.pillar_name&&(0,i.jsx)("span",{className:"dsa-badge",style:l?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,i.jsx)("span",{className:"dsa-badge dsa-badge--alt",style:l?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,i.jsxs)("span",{className:"dsa-reading-time",children:[e.reading_time_minutes," min read"]}),e.published_at&&(0,i.jsx)("span",{className:"dsa-published-at",children:new Date(e.published_at).toLocaleDateString()})]}),(0,i.jsx)(y,{children:e.h1||e.title}),e.featured_image_url&&(0,i.jsx)("img",{className:"dsa-featured-image",src:e.featured_image_url,alt:e.featured_image_alt||e.title,style:l?void 0:{width:"100%",borderRadius:"0.75rem",marginBottom:"2rem"}}),a&&(e.headings??[]).length>0&&(0,i.jsx)(u,{headings:e.headings}),(0,i.jsx)("div",{className:E,"data-dsa-article-body":"",style:l?void 0:{lineHeight:1.75,color:"var(--dsa-content-text)",fontSize:"1.0625rem"},dangerouslySetInnerHTML:{__html:e.content_html}}),t&&(e.faq??[]).length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("hr",{className:"dsa-divider",style:l?void 0:{border:"none",borderTop:"1px solid var(--dsa-divider)",margin:"2.5rem 0"}}),(0,i.jsx)(R,{items:e.faq})]}),e.schema_json&&(0,i.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(e.schema_json)}}),r&&o&&o.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("hr",{className:"dsa-divider",style:l?void 0:{border:"none",borderTop:"1px solid var(--dsa-divider)",margin:"2.5rem 0"}}),(0,i.jsx)(T,{articles:o,onArticleClick:n,theme:g})]})]})}var ae=require("react/jsx-runtime");function H(e,t){let a=t?`${t.replace(/\/+$/,"")}/blog/${e.slug}`:void 0;return{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}}:{}}}function W({article:e,siteUrl:t}){let a=e.schema_json||{"@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}:{},...t?{url:`${t.replace(/\/+$/,"")}/blog/${e.slug}`}:{},...e.target_keyword?{keywords:[e.target_keyword,...e.secondary_keywords||[]].join(", ")}:{}};return(0,ae.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(a)}})}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 _e(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:s=["name","email"],leadMagnet:r,ctaText:o="Submit",thankYouMessage:n,theme:m="light",className:d,onSuccess:g,onError:_,sourceUrl:C,children:l}){let y=z({webhookUrl:e,projectSlug:t,webhookToken:a}),[u,R]=(0,oe.useState)({}),I=s.map(_e);if(l)return(0,c.jsx)(c.Fragment,{children:l({...y})});let E=async f=>{f.preventDefault();let P={email:u.email||"",name:u.name,phone:u.phone,company:u.company,website:u.website,message:u.message,city:u.city,country:u.country,source_url:C},k=await y.submit(P);k.ok?g?.(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 ${d||""}`,"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:n||"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 ${d||""}`,"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:E,className:"dsa-lead-form__form",noValidate:!0,children:[I.map(f=>(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:[f.label,f.required&&" *"]}),f.type==="textarea"?(0,c.jsx)("textarea",{name:f.name,placeholder:f.placeholder,required:f.required,value:u[f.name]||"",onChange:P=>R(k=>({...k,[f.name]:P.target.value})),className:"dsa-lead-form__textarea",style:p?void 0:v.textarea}):(0,c.jsx)("input",{type:f.type||"text",name:f.name,placeholder:f.placeholder,required:f.required,value:u[f.name]||"",onChange:P=>R(k=>({...k,[f.name]:P.target.value})),className:"dsa-lead-form__input",style:p?void 0:v.input})]},f.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...":o}),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});
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