@dsaplatform/content-sdk 1.3.0 → 1.5.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/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/dist/index.d.mts
CHANGED
|
@@ -175,6 +175,60 @@ interface UseCategoriesState {
|
|
|
175
175
|
loading: boolean;
|
|
176
176
|
error: Error | null;
|
|
177
177
|
}
|
|
178
|
+
/** Supported form field names */
|
|
179
|
+
type LeadFormFieldName = 'name' | 'email' | 'phone' | 'company' | 'website' | 'message' | 'city' | 'country';
|
|
180
|
+
/** Form field descriptor */
|
|
181
|
+
interface LeadFormField {
|
|
182
|
+
name: LeadFormFieldName;
|
|
183
|
+
label?: string;
|
|
184
|
+
placeholder?: string;
|
|
185
|
+
type?: 'text' | 'email' | 'tel' | 'url' | 'textarea';
|
|
186
|
+
required?: boolean;
|
|
187
|
+
}
|
|
188
|
+
/** Lead magnet config shown before/after form submission */
|
|
189
|
+
interface LeadMagnetConfig {
|
|
190
|
+
title: string;
|
|
191
|
+
description?: string;
|
|
192
|
+
/** URL to download the lead magnet after form submission */
|
|
193
|
+
downloadUrl?: string;
|
|
194
|
+
/** Image/cover URL for the lead magnet */
|
|
195
|
+
imageUrl?: string;
|
|
196
|
+
}
|
|
197
|
+
/** Configuration for DsaLeadForm component */
|
|
198
|
+
interface DsaLeadFormConfig {
|
|
199
|
+
/** DSA Orchestrator base URL (e.g. "https://api.example.com") */
|
|
200
|
+
webhookUrl: string;
|
|
201
|
+
/** Project slug in DSA */
|
|
202
|
+
projectSlug: string;
|
|
203
|
+
/** Form webhook secret token */
|
|
204
|
+
webhookToken: string;
|
|
205
|
+
}
|
|
206
|
+
/** Payload submitted to the DSA webhook */
|
|
207
|
+
interface LeadFormPayload {
|
|
208
|
+
email: string;
|
|
209
|
+
name?: string;
|
|
210
|
+
phone?: string;
|
|
211
|
+
company?: string;
|
|
212
|
+
website?: string;
|
|
213
|
+
message?: string;
|
|
214
|
+
city?: string;
|
|
215
|
+
country?: string;
|
|
216
|
+
source_url?: string;
|
|
217
|
+
}
|
|
218
|
+
/** Result of a form submission */
|
|
219
|
+
interface LeadFormSubmitResult {
|
|
220
|
+
ok: boolean;
|
|
221
|
+
message?: string;
|
|
222
|
+
error?: string;
|
|
223
|
+
}
|
|
224
|
+
/** Hook state for lead form */
|
|
225
|
+
interface UseLeadFormState {
|
|
226
|
+
submitting: boolean;
|
|
227
|
+
submitted: boolean;
|
|
228
|
+
error: Error | null;
|
|
229
|
+
submit: (data: LeadFormPayload) => Promise<LeadFormSubmitResult>;
|
|
230
|
+
reset: () => void;
|
|
231
|
+
}
|
|
178
232
|
|
|
179
233
|
/**
|
|
180
234
|
* ContentClient — HTTP client for DSA Content Engine Public API.
|
|
@@ -263,6 +317,25 @@ declare function useCategories(): UseCategoriesState & {
|
|
|
263
317
|
refetch: () => void;
|
|
264
318
|
};
|
|
265
319
|
|
|
320
|
+
/**
|
|
321
|
+
* Headless hook for lead capture — handles submission to DSA webhook.
|
|
322
|
+
* Use this when you want full control over form UI.
|
|
323
|
+
*
|
|
324
|
+
* ```tsx
|
|
325
|
+
* const { submitting, submitted, error, submit, reset } = useDsaLeadForm({
|
|
326
|
+
* webhookUrl: "https://api.example.com",
|
|
327
|
+
* projectSlug: "my-project",
|
|
328
|
+
* webhookToken: "abc123",
|
|
329
|
+
* });
|
|
330
|
+
*
|
|
331
|
+
* const handleSubmit = (e) => {
|
|
332
|
+
* e.preventDefault();
|
|
333
|
+
* submit({ email: "user@example.com", name: "John" });
|
|
334
|
+
* };
|
|
335
|
+
* ```
|
|
336
|
+
*/
|
|
337
|
+
declare function useDsaLeadForm(config: DsaLeadFormConfig): UseLeadFormState;
|
|
338
|
+
|
|
266
339
|
interface ArticleFeedProps {
|
|
267
340
|
articles: ArticleListItem[];
|
|
268
341
|
layout?: 'grid' | 'list';
|
|
@@ -410,4 +483,51 @@ declare function SeoMetaBridge({ article, siteUrl, }: {
|
|
|
410
483
|
siteUrl?: string;
|
|
411
484
|
}): react_jsx_runtime.JSX.Element;
|
|
412
485
|
|
|
413
|
-
|
|
486
|
+
/** Theme for the lead form */
|
|
487
|
+
type LeadFormTheme = 'light' | 'dark' | 'inherit';
|
|
488
|
+
interface DsaLeadFormProps extends DsaLeadFormConfig {
|
|
489
|
+
/** Form fields to display. Shorthand: pass an array of field names. */
|
|
490
|
+
fields?: (LeadFormFieldName | LeadFormField)[];
|
|
491
|
+
/** Lead magnet to promote above the form / show after submission */
|
|
492
|
+
leadMagnet?: LeadMagnetConfig;
|
|
493
|
+
/** CTA button text */
|
|
494
|
+
ctaText?: string;
|
|
495
|
+
/** Thank-you message shown after successful submission */
|
|
496
|
+
thankYouMessage?: string;
|
|
497
|
+
/** Theme: "light" | "dark" | "inherit" (no styles) */
|
|
498
|
+
theme?: LeadFormTheme;
|
|
499
|
+
/** Additional CSS class on the wrapper */
|
|
500
|
+
className?: string;
|
|
501
|
+
/** Called after successful submission */
|
|
502
|
+
onSuccess?: (data: LeadFormPayload) => void;
|
|
503
|
+
/** Called on submission error */
|
|
504
|
+
onError?: (error: Error) => void;
|
|
505
|
+
/** Override source_url (defaults to window.location.href) */
|
|
506
|
+
sourceUrl?: string;
|
|
507
|
+
/** Render prop for full custom rendering */
|
|
508
|
+
children?: (state: {
|
|
509
|
+
submitting: boolean;
|
|
510
|
+
submitted: boolean;
|
|
511
|
+
error: Error | null;
|
|
512
|
+
submit: (data: LeadFormPayload) => void;
|
|
513
|
+
reset: () => void;
|
|
514
|
+
}) => React.ReactNode;
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* Ready-to-use lead capture form with built-in DSA webhook integration.
|
|
518
|
+
*
|
|
519
|
+
* ```tsx
|
|
520
|
+
* <DsaLeadForm
|
|
521
|
+
* webhookUrl="https://api.example.com"
|
|
522
|
+
* projectSlug="my-project"
|
|
523
|
+
* webhookToken="abc123"
|
|
524
|
+
* fields={['name', 'email', 'company']}
|
|
525
|
+
* ctaText="Get Free Audit"
|
|
526
|
+
* leadMagnet={{ title: "SEO Audit Checklist", description: "47-point checklist" }}
|
|
527
|
+
* theme="dark"
|
|
528
|
+
* />
|
|
529
|
+
* ```
|
|
530
|
+
*/
|
|
531
|
+
declare function DsaLeadForm({ webhookUrl, projectSlug, webhookToken, fields, leadMagnet, ctaText, thankYouMessage, theme, className, onSuccess, onError, sourceUrl, children, }: DsaLeadFormProps): react_jsx_runtime.JSX.Element;
|
|
532
|
+
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -175,6 +175,60 @@ interface UseCategoriesState {
|
|
|
175
175
|
loading: boolean;
|
|
176
176
|
error: Error | null;
|
|
177
177
|
}
|
|
178
|
+
/** Supported form field names */
|
|
179
|
+
type LeadFormFieldName = 'name' | 'email' | 'phone' | 'company' | 'website' | 'message' | 'city' | 'country';
|
|
180
|
+
/** Form field descriptor */
|
|
181
|
+
interface LeadFormField {
|
|
182
|
+
name: LeadFormFieldName;
|
|
183
|
+
label?: string;
|
|
184
|
+
placeholder?: string;
|
|
185
|
+
type?: 'text' | 'email' | 'tel' | 'url' | 'textarea';
|
|
186
|
+
required?: boolean;
|
|
187
|
+
}
|
|
188
|
+
/** Lead magnet config shown before/after form submission */
|
|
189
|
+
interface LeadMagnetConfig {
|
|
190
|
+
title: string;
|
|
191
|
+
description?: string;
|
|
192
|
+
/** URL to download the lead magnet after form submission */
|
|
193
|
+
downloadUrl?: string;
|
|
194
|
+
/** Image/cover URL for the lead magnet */
|
|
195
|
+
imageUrl?: string;
|
|
196
|
+
}
|
|
197
|
+
/** Configuration for DsaLeadForm component */
|
|
198
|
+
interface DsaLeadFormConfig {
|
|
199
|
+
/** DSA Orchestrator base URL (e.g. "https://api.example.com") */
|
|
200
|
+
webhookUrl: string;
|
|
201
|
+
/** Project slug in DSA */
|
|
202
|
+
projectSlug: string;
|
|
203
|
+
/** Form webhook secret token */
|
|
204
|
+
webhookToken: string;
|
|
205
|
+
}
|
|
206
|
+
/** Payload submitted to the DSA webhook */
|
|
207
|
+
interface LeadFormPayload {
|
|
208
|
+
email: string;
|
|
209
|
+
name?: string;
|
|
210
|
+
phone?: string;
|
|
211
|
+
company?: string;
|
|
212
|
+
website?: string;
|
|
213
|
+
message?: string;
|
|
214
|
+
city?: string;
|
|
215
|
+
country?: string;
|
|
216
|
+
source_url?: string;
|
|
217
|
+
}
|
|
218
|
+
/** Result of a form submission */
|
|
219
|
+
interface LeadFormSubmitResult {
|
|
220
|
+
ok: boolean;
|
|
221
|
+
message?: string;
|
|
222
|
+
error?: string;
|
|
223
|
+
}
|
|
224
|
+
/** Hook state for lead form */
|
|
225
|
+
interface UseLeadFormState {
|
|
226
|
+
submitting: boolean;
|
|
227
|
+
submitted: boolean;
|
|
228
|
+
error: Error | null;
|
|
229
|
+
submit: (data: LeadFormPayload) => Promise<LeadFormSubmitResult>;
|
|
230
|
+
reset: () => void;
|
|
231
|
+
}
|
|
178
232
|
|
|
179
233
|
/**
|
|
180
234
|
* ContentClient — HTTP client for DSA Content Engine Public API.
|
|
@@ -263,6 +317,25 @@ declare function useCategories(): UseCategoriesState & {
|
|
|
263
317
|
refetch: () => void;
|
|
264
318
|
};
|
|
265
319
|
|
|
320
|
+
/**
|
|
321
|
+
* Headless hook for lead capture — handles submission to DSA webhook.
|
|
322
|
+
* Use this when you want full control over form UI.
|
|
323
|
+
*
|
|
324
|
+
* ```tsx
|
|
325
|
+
* const { submitting, submitted, error, submit, reset } = useDsaLeadForm({
|
|
326
|
+
* webhookUrl: "https://api.example.com",
|
|
327
|
+
* projectSlug: "my-project",
|
|
328
|
+
* webhookToken: "abc123",
|
|
329
|
+
* });
|
|
330
|
+
*
|
|
331
|
+
* const handleSubmit = (e) => {
|
|
332
|
+
* e.preventDefault();
|
|
333
|
+
* submit({ email: "user@example.com", name: "John" });
|
|
334
|
+
* };
|
|
335
|
+
* ```
|
|
336
|
+
*/
|
|
337
|
+
declare function useDsaLeadForm(config: DsaLeadFormConfig): UseLeadFormState;
|
|
338
|
+
|
|
266
339
|
interface ArticleFeedProps {
|
|
267
340
|
articles: ArticleListItem[];
|
|
268
341
|
layout?: 'grid' | 'list';
|
|
@@ -410,4 +483,51 @@ declare function SeoMetaBridge({ article, siteUrl, }: {
|
|
|
410
483
|
siteUrl?: string;
|
|
411
484
|
}): react_jsx_runtime.JSX.Element;
|
|
412
485
|
|
|
413
|
-
|
|
486
|
+
/** Theme for the lead form */
|
|
487
|
+
type LeadFormTheme = 'light' | 'dark' | 'inherit';
|
|
488
|
+
interface DsaLeadFormProps extends DsaLeadFormConfig {
|
|
489
|
+
/** Form fields to display. Shorthand: pass an array of field names. */
|
|
490
|
+
fields?: (LeadFormFieldName | LeadFormField)[];
|
|
491
|
+
/** Lead magnet to promote above the form / show after submission */
|
|
492
|
+
leadMagnet?: LeadMagnetConfig;
|
|
493
|
+
/** CTA button text */
|
|
494
|
+
ctaText?: string;
|
|
495
|
+
/** Thank-you message shown after successful submission */
|
|
496
|
+
thankYouMessage?: string;
|
|
497
|
+
/** Theme: "light" | "dark" | "inherit" (no styles) */
|
|
498
|
+
theme?: LeadFormTheme;
|
|
499
|
+
/** Additional CSS class on the wrapper */
|
|
500
|
+
className?: string;
|
|
501
|
+
/** Called after successful submission */
|
|
502
|
+
onSuccess?: (data: LeadFormPayload) => void;
|
|
503
|
+
/** Called on submission error */
|
|
504
|
+
onError?: (error: Error) => void;
|
|
505
|
+
/** Override source_url (defaults to window.location.href) */
|
|
506
|
+
sourceUrl?: string;
|
|
507
|
+
/** Render prop for full custom rendering */
|
|
508
|
+
children?: (state: {
|
|
509
|
+
submitting: boolean;
|
|
510
|
+
submitted: boolean;
|
|
511
|
+
error: Error | null;
|
|
512
|
+
submit: (data: LeadFormPayload) => void;
|
|
513
|
+
reset: () => void;
|
|
514
|
+
}) => React.ReactNode;
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* Ready-to-use lead capture form with built-in DSA webhook integration.
|
|
518
|
+
*
|
|
519
|
+
* ```tsx
|
|
520
|
+
* <DsaLeadForm
|
|
521
|
+
* webhookUrl="https://api.example.com"
|
|
522
|
+
* projectSlug="my-project"
|
|
523
|
+
* webhookToken="abc123"
|
|
524
|
+
* fields={['name', 'email', 'company']}
|
|
525
|
+
* ctaText="Get Free Audit"
|
|
526
|
+
* leadMagnet={{ title: "SEO Audit Checklist", description: "47-point checklist" }}
|
|
527
|
+
* theme="dark"
|
|
528
|
+
* />
|
|
529
|
+
* ```
|
|
530
|
+
*/
|
|
531
|
+
declare function DsaLeadForm({ webhookUrl, projectSlug, webhookToken, fields, leadMagnet, ctaText, thankYouMessage, theme, className, onSuccess, onError, sourceUrl, children, }: DsaLeadFormProps): react_jsx_runtime.JSX.Element;
|
|
532
|
+
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";var G=Object.create;var S=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames;var X=Object.getPrototypeOf,Y=Object.prototype.hasOwnProperty;var Z=(e,t)=>{for(var a in t)S(e,a,{get:t[a],enumerable:!0})},F=(e,t,a,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Q(t))!Y.call(e,o)&&o!==a&&S(e,o,{get:()=>t[o],enumerable:!(s=J(t,o))||s.enumerable});return e};var I=(e,t,a)=>(a=e!=null?G(X(e)):{},F(t||!e||!e.__esModule?S(a,"default",{value:e,enumerable:!0}):a,e)),ee=e=>F(S({},"__esModule",{value:!0}),e);var pe={};Z(pe,{ArticleFeed:()=>w,ArticlePage:()=>R,ContentClient:()=>b,DsaContentProvider:()=>N,FaqBlock:()=>_,RelatedArticles:()=>A,SeoMetaBridge:()=>q,generateArticleMetadata:()=>P,useArticle:()=>E,useArticles:()=>L,useCategories:()=>U,useDsaContent:()=>h,useRelatedArticles:()=>D});module.exports=ee(pe);var b=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 o={method:"GET",headers:{"X-API-Key":this.apiKey},cache:this.cacheStrategy};this.revalidateSeconds&&this.cacheStrategy!=="no-cache"&&(o.next={revalidate:this.revalidateSeconds});let r=await fetch(s.toString(),o);if(!r.ok){let n=await r.text().catch(()=>"");throw new Error(`DSA Content API error ${r.status}: ${n||r.statusText}`)}return r.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 y=require("react");var z=require("react/jsx-runtime"),T=(0,y.createContext)(null);function N({config:e,children:t}){let a=(0,y.useMemo)(()=>new b(e),[e.apiUrl,e.apiKey]);return(0,z.jsx)(T.Provider,{value:a,children:t})}function h(){let e=(0,y.useContext)(T);if(!e)throw new Error("useDsaContent() must be used inside <DsaContentProvider>");return e}var c=require("react");function L(e){let t=h(),[a,s]=(0,c.useState)({articles:[],loading:!0,error:null,pagination:{page:1,per_page:10,total:0,total_pages:0}}),o=(0,c.useCallback)(()=>{s(r=>({...r,loading:!0,error:null})),t.getArticles(e).then(r=>s({articles:r.items,loading:!1,error:null,pagination:{page:r.page,per_page:r.per_page,total:r.total,total_pages:r.total_pages}})).catch(r=>s(n=>({...n,loading:!1,error:r instanceof Error?r:new Error(String(r))})))},[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 E(e){let t=h(),[a,s]=(0,c.useState)({article:null,loading:!0,error:null}),o=(0,c.useCallback)(()=>{if(!e){s({article:null,loading:!1,error:null});return}s(r=>({...r,loading:!0,error:null})),t.getArticleBySlug(e).then(r=>s({article:r,loading:!1,error:null})).catch(r=>s({article:null,loading:!1,error:r instanceof Error?r:new Error(String(r))}))},[t,e]);return(0,c.useEffect)(()=>{o()},[o]),{...a,refetch:o}}function D(e,t=3){let a=h(),[s,o]=(0,c.useState)({articles:[],loading:!0,error:null}),r=(0,c.useCallback)(()=>{if(!e){o({articles:[],loading:!1,error:null});return}o(n=>({...n,loading:!0,error:null})),a.getRelatedArticles(e,t).then(n=>o({articles:n,loading:!1,error:null})).catch(n=>o({articles:[],loading:!1,error:n instanceof Error?n:new Error(String(n))}))},[a,e,t]);return(0,c.useEffect)(()=>{r()},[r]),{...s,refetch:r}}function U(){let e=h(),[t,a]=(0,c.useState)({categories:[],loading:!0,error:null}),s=(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)(()=>{s()},[s]),{...t,refetch:s}}var C=I(require("react")),p=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:s,showMeta:o,onClick:r}){let n=t==="grid",[m,d]=C.default.useState(!1),f={...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,p.jsxs)("article",{style:f,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onClick:r,role:"link",tabIndex:0,onKeyDown:x=>x.key==="Enter"&&r?.(),children:[s&&e.featured_image_url&&(0,p.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,p.jsxs)("div",{style:n?{padding:"1.25rem"}:{padding:"1.25rem",flex:1},children:[(0,p.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,p.jsx)("p",{style:{margin:"0 0 0.75rem",fontSize:"0.875rem",color:"var(--dsa-text-muted)",lineHeight:1.5},children:e.excerpt}),o&&(0,p.jsxs)("div",{style:{display:"flex",gap:"0.75rem",fontSize:"0.75rem",color:"var(--dsa-text-faint)",flexWrap:"wrap"},children:[e.pillar_name&&(0,p.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,p.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,p.jsxs)("span",{children:[e.reading_time_minutes," min read"]}),e.published_at&&(0,p.jsx)("span",{children:new Date(e.published_at).toLocaleDateString()})]})]})]})}function w({articles:e,layout:t="grid",columns:a=3,showExcerpt:s=!0,showImage:o=!0,showMeta:r=!0,onArticleClick:n,className:m,theme:d="light",renderArticle:f}){let x=t==="grid"?`repeat(${a}, 1fr)`:"1fr",v=d!=="inherit"?te[d]:{};return(0,p.jsx)("div",{className:m,style:{display:"grid",gap:"1.5rem",gridTemplateColumns:x,...v},children:(e??[]).map(l=>f?(0,p.jsx)(C.default.Fragment,{children:f(l)},l.id):(0,p.jsx)(ae,{article:l,layout:t,showExcerpt:s,showImage:o,showMeta:r,onClick:()=>n?.(l.slug)},l.id))})}var M=I(require("react"));var B=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 se({item:e,collapsible:t,defaultOpen:a}){let[s,o]=(0,B.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(!s),"aria-expanded":s,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:s?"rotate(180deg)":"rotate(0deg)"},children:"\u25BC"})]}),s&&(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 _({items:e,collapsible:t=!0,defaultOpen:a=!1,className:s,title:o="Frequently Asked Questions",theme:r="light"}){if(!e||e.length===0)return null;let n=r!=="inherit"?re[r]:{},m={"@context":"https://schema.org","@type":"FAQPage",mainEntity:e.map(d=>({"@type":"Question",name:d.question,acceptedAnswer:{"@type":"Answer",text:d.answer}}))};return(0,g.jsxs)("section",{className:s,style:{marginTop:"1rem",...n},children:[(0,g.jsx)("h2",{style:{fontSize:"1.5rem",fontWeight:700,color:"var(--dsa-text)",margin:"0 0 1rem"},children:o}),e.map((d,f)=>(0,g.jsx)(se,{item:d,collapsible:t,defaultOpen:a},f)),(0,g.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(m)}})]})}var u=require("react/jsx-runtime"),oe={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 A({articles:e,title:t="Related Articles",limit:a=3,onArticleClick:s,className:o,theme:r="light"}){let n=(e??[]).slice(0,a);if(n.length===0)return null;let m=r!=="inherit"?oe[r]:{};return(0,u.jsxs)("section",{className:o,style:{marginTop:"1rem",...m},children:[(0,u.jsx)("h3",{style:{fontSize:"1.25rem",fontWeight:700,color:"var(--dsa-text)",margin:"0 0 1rem"},children:t}),(0,u.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(250px, 1fr))",gap:"1rem"},children:n.map(d=>(0,u.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:f=>f.key==="Enter"&&s?.(d.slug),children:[d.featured_image_url&&(0,u.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,u.jsxs)("div",{style:{padding:"1rem"},children:[(0,u.jsx)("h4",{style:{fontSize:"0.9375rem",fontWeight:600,color:"var(--dsa-text)",margin:0,lineHeight:1.3},children:d.title}),d.excerpt&&(0,u.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"),ie={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"}},H="dsa-article-prose",ne=`
|
|
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=`
|
|
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){M.default.useEffect(()=>{if(!e||typeof document>"u"||document.getElementById(H))return;let t=document.createElement("style");t.id=H,t.textContent=ne,document.head.appendChild(t)},[e])}function le({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 ce({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 R({article:e,showFaq:t=!0,showTableOfContents:a=!0,showMeta:s=!0,showRelated:o=!1,relatedArticles:r,onRelatedClick:n,className:m,contentClassName:d,theme:f="light",disableProseStyles:x=!1,components:v}){let l=f==="inherit";de(!l&&!x);let j=v?.H1||(l?({children:k})=>(0,i.jsx)("h1",{className:"dsa-h1",children:k}):({children:k})=>(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:k})),O=v?.Toc||(l?ce:le),W=v?.Faq||_,K=l?{}:ie[f],V=["dsa-article-body",d].filter(Boolean).join(" ");return(0,i.jsxs)("article",{className:m,"data-dsa-theme":f,style:l?void 0:{maxWidth:"48rem",margin:"0 auto",fontFamily:"system-ui, -apple-system, sans-serif",...K},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)(j,{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)(O,{headings:e.headings}),(0,i.jsx)("div",{className:V,"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)(W,{items:e.faq})]}),e.schema_json&&(0,i.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(e.schema_json)}}),o&&r&&r.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)(A,{articles:r,onArticleClick:n,theme:f})]})]})}var $=require("react/jsx-runtime");function P(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 q({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,$.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(a)}})}0&&(module.exports={ArticleFeed,ArticlePage,ContentClient,DsaContentProvider,FaqBlock,RelatedArticles,SeoMetaBridge,generateArticleMetadata,useArticle,useArticles,useCategories,useDsaContent,useRelatedArticles});
|
|
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});
|
|
26
26
|
//# sourceMappingURL=index.js.map
|