@sonordev/site-kit 8.8.0 → 8.9.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/CHANGELOG.md +22 -0
- package/README.md +9 -0
- package/agent-manifest.json +8 -1
- package/dist/AnalyticsProvider-X7JJN3QL.js +19 -0
- package/dist/{ArticleViewTracker-PV2RD3P6.js → ArticleViewTracker-7Q6AMCKX.js} +11 -10
- package/dist/{BlocksPopup-NEEFV2L3.js → BlocksPopup-U5VIYEBA.js} +4 -5
- package/dist/ChatWidget-EAATOFCT.js +30 -0
- package/dist/{FileField-MJ3RCNFJ.js → FileField-YWMSK7RF.js} +1 -3
- package/dist/{FormSpotlight-NQPQFZS7.js → FormSpotlight-MAXDW3TK.js} +1 -1
- package/dist/{FormStage-4T5PJR5K.js → FormStage-VAHRVOIZ.js} +1 -1
- package/dist/ManagedForm-7IZT7ZII.js +29 -0
- package/dist/{ManagedNewsletterForm-TUYGN6O3.js → ManagedNewsletterForm-VVXZSEAL.js} +21 -11
- package/dist/{SignalCore-OW3YIH6M.js → SignalCore-HAN4O7QG.js} +90 -36
- package/dist/{SiteChat-XMKHBSEK.js → SiteChat-3JLCEL2N.js} +2 -2
- package/dist/{SiteDesignReporter-BRH7ORQS.js → SiteDesignReporter-6CCO645E.js} +5 -6
- package/dist/SitePopups-ZGHQNGGH.js +19 -0
- package/dist/SitemapSync-5LSYCBKS.js +7 -0
- package/dist/SitemapSync.d.ts +1 -1
- package/dist/_client/booking-widget.d.ts +1 -1
- package/dist/_client/booking-widget.js +6 -7
- package/dist/_client/reviewed-signal-experiment.d.ts +9 -0
- package/dist/_client/reviewed-signal-experiment.js +89 -0
- package/dist/_client/testimonial-section.d.ts +1 -1
- package/dist/admin-auth/index.d.ts +3 -3
- package/dist/affiliates/AffiliatesWidget.d.ts +1 -1
- package/dist/affiliates/api.d.ts +1 -1
- package/dist/affiliates/index.d.ts +6 -6
- package/dist/affiliates/index.js +1 -3
- package/dist/affiliates/useAffiliates.d.ts +1 -1
- package/dist/analytics/AnalyticsProvider.d.ts +1 -1
- package/dist/analytics/dispatch.d.ts +1 -1
- package/dist/analytics/index.d.ts +6 -6
- package/dist/analytics/index.js +22 -12
- package/dist/analytics/publication-cta.d.ts +1 -1
- package/dist/analytics/send-gate.d.ts +8 -4
- package/dist/articles/Article.d.ts +1 -1
- package/dist/articles/ArticleFAQ.d.ts +1 -1
- package/dist/articles/ArticleFaqSection.d.ts +1 -1
- package/dist/articles/ArticleList.d.ts +1 -1
- package/dist/articles/ArticleViewTracker.d.ts +1 -1
- package/dist/articles/AuthorCard.d.ts +1 -1
- package/dist/articles/AuthorPage.d.ts +1 -1
- package/dist/articles/ClusterLandingPage.d.ts +1 -1
- package/dist/articles/ClusterNavigation.d.ts +1 -1
- package/dist/articles/ManagedNewsletterForm.d.ts +2 -2
- package/dist/articles/NewsletterShell.d.ts +1 -1
- package/dist/articles/NewsletterWidget.d.ts +1 -1
- package/dist/articles/PublicationLayout.d.ts +1 -1
- package/dist/articles/PublicationSidebar.d.ts +1 -1
- package/dist/articles/RelatedPosts.d.ts +1 -1
- package/dist/articles/ServiceCallout.d.ts +1 -1
- package/dist/articles/TableOfContents.d.ts +1 -1
- package/dist/articles/article-photos.d.ts +1 -1
- package/dist/articles/article-styles.d.ts +1 -1
- package/dist/articles/article-tables.d.ts +1 -1
- package/dist/articles/artwork.d.ts +1 -1
- package/dist/articles/author-schema.d.ts +1 -1
- package/dist/articles/author-social.d.ts +1 -1
- package/dist/articles/excerpt.d.ts +1 -1
- package/dist/articles/index.d.ts +1 -1
- package/dist/articles/index.js +3 -3
- package/dist/articles/news-sitemap.d.ts +1 -1
- package/dist/articles/processArticleHtml.d.ts +1 -1
- package/dist/articles/public-reads.d.ts +1 -1
- package/dist/articles/reading-time.d.ts +1 -1
- package/dist/articles/routes.d.ts +1 -1
- package/dist/articles/server-core.d.ts +1 -1
- package/dist/articles/server-ui.d.ts +1 -1
- package/dist/articles/server-ui.js +6 -6
- package/dist/articles/server.d.ts +1 -1
- package/dist/articles/server.js +5 -5
- package/dist/articles/types.d.ts +1 -1
- package/dist/articles/widget-styles.d.ts +1 -1
- package/dist/brand/extract-brand-profile.d.ts +1 -1
- package/dist/chat/ChatWidget.d.ts +1 -1
- package/dist/chat/EchoUiActions.d.ts +1 -1
- package/dist/chat/SiteChat.d.ts +2 -2
- package/dist/chat/chat-messages.d.ts +1 -1
- package/dist/chat/index.d.ts +7 -7
- package/dist/chat/index.js +17 -9
- package/dist/chat/launcher-placement.d.ts +1 -1
- package/dist/{chunk-OPUY4RS6.js → chunk-2LBKIE2K.js} +2 -1
- package/dist/{chunk-XIDWNXZN.js → chunk-3W3MN6Z7.js} +2 -2
- package/dist/{chunk-UPFU63L4.js → chunk-55GFMOI6.js} +1 -1
- package/dist/chunk-5IVD6G77.js +37 -0
- package/dist/{chunk-URLTBVRX.js → chunk-6EDE7BOE.js} +3 -3
- package/dist/{chunk-DYROJGI2.js → chunk-6NLVHTYY.js} +1 -1
- package/dist/{chunk-ZQSCMYZO.js → chunk-7643MCD2.js} +6 -3
- package/dist/chunk-7IZUUXXO.js +1 -0
- package/dist/{chunk-C7TLGL3R.js → chunk-7VMA3KCN.js} +30 -4
- package/dist/{chunk-OWZWRP7Y.js → chunk-ADQ3VCKK.js} +2 -2
- package/dist/chunk-AG2RDHYZ.js +45 -0
- package/dist/chunk-AWLPFFPO.js +36 -0
- package/dist/{chunk-LNSNA3W4.js → chunk-C4XK472G.js} +4 -3
- package/dist/{chunk-TP32MRXV.js → chunk-CJ43K7RA.js} +2 -2
- package/dist/chunk-D4M5K6JN.js +25 -0
- package/dist/{chunk-F6WLHVMQ.js → chunk-DXE6SXWW.js} +1 -1
- package/dist/{chunk-YEX5RAEU.js → chunk-EBEM5BI5.js} +38 -27
- package/dist/chunk-F3RKFGRW.js +2 -0
- package/dist/chunk-FAY6MOLL.js +62 -0
- package/dist/chunk-FRY6PBT6.js +31 -0
- package/dist/{chunk-JYITKUUB.js → chunk-G5WUX7VE.js} +1 -1
- package/dist/chunk-HJD6KXKH.js +147 -0
- package/dist/{chunk-6BFQI3ZE.js → chunk-IO6BWRZ5.js} +2 -2
- package/dist/{chunk-THXELZTQ.js → chunk-ISMHDUBW.js} +1 -1
- package/dist/{chunk-SLFYTELD.js → chunk-J4LJE4NB.js} +1 -1
- package/dist/{chunk-LQJC5S2M.js → chunk-J6D3NEDE.js} +57 -0
- package/dist/chunk-JT7GHHMV.js +56 -0
- package/dist/{chunk-NFGAXWCN.js → chunk-KGIQYVQ2.js} +31 -13
- package/dist/chunk-KMNHNCVG.js +20 -0
- package/dist/chunk-KQKUXIUD.js +25 -0
- package/dist/{chunk-M5JIHQ42.js → chunk-L3S5WH4C.js} +2 -2
- package/dist/chunk-MDBXGN6W.js +13 -0
- package/dist/chunk-MOACHHOJ.js +20 -0
- package/dist/{chunk-6DXQHNZK.js → chunk-MP35JETP.js} +1 -1
- package/dist/chunk-NHDRA4Y5.js +6 -0
- package/dist/{chunk-AYQEIMGS.js → chunk-NZHECYLF.js} +103 -22
- package/dist/{chunk-EATJPSTS.js → chunk-O5LQUBBN.js} +1 -1
- package/dist/{chunk-Y6SHFILE.js → chunk-OEOSR5EG.js} +1 -1
- package/dist/{chunk-GQN4BGK6.js → chunk-OUD4RTBD.js} +1 -1
- package/dist/chunk-PMXQPO5Q.js +78 -0
- package/dist/chunk-PVY7X5UR.js +21 -0
- package/dist/{chunk-KG5IEV7I.js → chunk-QLJ2SC3T.js} +1 -1
- package/dist/{chunk-2WM4TNDF.js → chunk-QXAJPB6O.js} +1 -1
- package/dist/{chunk-2WDWQI7K.js → chunk-RYR6N4X4.js} +1 -1
- package/dist/{chunk-G7BRCSV6.js → chunk-S33CUULL.js} +3 -3
- package/dist/{chunk-YRQS7VAH.js → chunk-S63QY5XW.js} +2 -2
- package/dist/{chunk-GXWM5KNS.js → chunk-SO6RSRUP.js} +40 -45
- package/dist/{chunk-ODOV76VW.js → chunk-STIVFCWM.js} +1 -1
- package/dist/{chunk-SVHPILS3.js → chunk-T4A5J6SJ.js} +1 -1
- package/dist/chunk-TPHOIE4I.js +73 -0
- package/dist/{chunk-IWNJCRXW.js → chunk-UG53ZW7S.js} +125 -118
- package/dist/chunk-VXCUXHZO.js +9 -0
- package/dist/{chunk-SBPUFTMP.js → chunk-WHFWDK2H.js} +2 -2
- package/dist/chunk-WYNDBJG7.js +66 -0
- package/dist/{chunk-HN7GVGWC.js → chunk-XDH5B3PR.js} +3 -3
- package/dist/{chunk-PAYCK7FC.js → chunk-XJZLXUTG.js} +1 -1
- package/dist/{chunk-IDC5CVBR.js → chunk-YVEYO3OD.js} +1 -1
- package/dist/{chunk-PSS6M4CG.js → chunk-ZRSXCT4O.js} +2 -2
- package/dist/client/index.d.ts +8 -8
- package/dist/client/index.js +9 -8
- package/dist/config/index.d.ts +1 -1
- package/dist/contracts/broadcast-layouts.d.ts +8 -0
- package/dist/contracts/crm-disposition.d.ts +87 -0
- package/dist/contracts/decision-roles.d.ts +39 -0
- package/dist/contracts/entries.d.ts +1 -1
- package/dist/contracts/funnels.d.ts +85 -2
- package/dist/contracts/portfolio.d.ts +1 -1
- package/dist/contracts/publication-branding.d.ts +3 -3
- package/dist/contracts/resonance-constants.d.ts +4 -0
- package/dist/contracts/resonance.d.ts +8461 -0
- package/dist/contracts/signal-experiments.d.ts +219 -0
- package/dist/contracts/site-edit.d.ts +2 -2
- package/dist/contracts/sites.d.ts +1 -1
- package/dist/contracts/slots.d.ts +2 -2
- package/dist/contracts/wire-schema.d.ts +36 -0
- package/dist/cta-bar/CtaBar.d.ts +1 -1
- package/dist/cta-bar/client.js +3 -2
- package/dist/cta-bar/index.d.ts +4 -4
- package/dist/cta-bar/index.js +4 -3
- package/dist/fleet/FleetHeartbeat.d.ts +2 -2
- package/dist/fleet/contract.d.ts +1 -1
- package/dist/fleet/heartbeat.d.ts +2 -2
- package/dist/fleet/index.d.ts +6 -6
- package/dist/fleet/index.js +4 -5
- package/dist/forms/FileField.d.ts +1 -1
- package/dist/forms/FormClient.d.ts +2 -2
- package/dist/forms/FormEnhancer.d.ts +1 -1
- package/dist/forms/FormField.d.ts +1 -1
- package/dist/forms/FormSpotlight.d.ts +1 -1
- package/dist/forms/FormStage.d.ts +1 -1
- package/dist/forms/ManagedForm.d.ts +1 -1
- package/dist/forms/PrivateFileField.d.ts +1 -1
- package/dist/forms/ServerForm.d.ts +3 -3
- package/dist/forms/StaticForm.d.ts +1 -1
- package/dist/forms/contract.d.ts +1 -1
- package/dist/forms/experience-plan.d.ts +1 -1
- package/dist/forms/field-autocomplete.d.ts +1 -1
- package/dist/forms/field-controls.d.ts +1 -1
- package/dist/forms/field-rules.d.ts +1 -1
- package/dist/forms/form-dom-values.d.ts +1 -1
- package/dist/forms/index.d.ts +18 -18
- package/dist/forms/index.js +21 -11
- package/dist/forms/normalize-config.d.ts +1 -1
- package/dist/forms/server.d.ts +4 -4
- package/dist/forms/server.js +3 -3
- package/dist/forms/static.d.ts +2 -2
- package/dist/forms/submitForm.d.ts +2 -2
- package/dist/forms/tracking-session.d.ts +1 -1
- package/dist/forms/useForm.d.ts +2 -2
- package/dist/forms/webmcp.d.ts +2 -2
- package/dist/images/api.d.ts +1 -1
- package/dist/images/index.d.ts +6 -6
- package/dist/images/index.js +2 -4
- package/dist/images/server.d.ts +2 -2
- package/dist/index.d.ts +13 -13
- package/dist/index.js +1 -1
- package/dist/landing/contract.d.ts +1 -1
- package/dist/landing/contract.js +2 -1
- package/dist/landing/index.d.ts +3 -3
- package/dist/landing/index.js +3 -2
- package/dist/landing/managed-server.d.ts +2 -2
- package/dist/landing/managed.d.ts +10 -2
- package/dist/landing/server.d.ts +7 -7
- package/dist/landing/server.js +11 -6
- package/dist/layout/AiDiscoveryLinks.d.ts +1 -1
- package/dist/layout/SiteKitClientProviders.d.ts +1 -1
- package/dist/layout/SiteKitLayout.d.ts +2 -2
- package/dist/layout/client.d.ts +1 -1
- package/dist/layout/client.js +15 -11
- package/dist/layout/index.d.ts +5 -5
- package/dist/layout/index.js +17 -13
- package/dist/layout/types.d.ts +2 -2
- package/dist/llms/AEOComponents.d.ts +1 -1
- package/dist/llms/SpeakableSchema.d.ts +1 -1
- package/dist/llms/api.d.ts +1 -1
- package/dist/llms/client.d.ts +3 -3
- package/dist/llms/contract.d.ts +1 -1
- package/dist/llms/generateLLMsTxt.d.ts +1 -1
- package/dist/llms/handlers.d.ts +1 -1
- package/dist/llms/index.d.ts +21 -21
- package/dist/llms/index.js +5 -5
- package/dist/llms/merge.d.ts +1 -1
- package/dist/llms/sourcedFacts.d.ts +1 -1
- package/dist/llms/types.d.ts +5 -5
- package/dist/llms/writeLLMsTxt.d.ts +3 -3
- package/dist/maps/GoogleMap.d.ts +1 -1
- package/dist/maps/NeighborhoodMap.d.ts +1 -1
- package/dist/maps/api.d.ts +1 -1
- package/dist/maps/index.d.ts +5 -5
- package/dist/maps/index.js +1 -3
- package/dist/mcp/WebMcpTools.d.ts +1 -1
- package/dist/mcp/client.d.ts +2 -2
- package/dist/mcp/discovery.d.ts +2 -2
- package/dist/mcp/handlers.d.ts +4 -4
- package/dist/mcp/index.d.ts +12 -12
- package/dist/mcp/protocol.d.ts +1 -1
- package/dist/mcp/report.d.ts +1 -1
- package/dist/mcp/serverCard.d.ts +1 -1
- package/dist/mcp/sonor.d.ts +5 -5
- package/dist/mcp/sonor.js +10 -10
- package/dist/mcp/transport.d.ts +1 -1
- package/dist/motion/Parallax.d.ts +1 -1
- package/dist/motion/ScrollScene.d.ts +1 -1
- package/dist/motion/gsap.d.ts +2 -2
- package/dist/motion/index.d.ts +9 -9
- package/dist/motion/three.d.ts +1 -1
- package/dist/og/index.d.ts +5 -5
- package/dist/og/pages.d.ts +1 -1
- package/dist/og/route-fit.d.ts +17 -0
- package/dist/og/route.d.ts +8 -0
- package/dist/og/route.js +1 -1
- package/dist/og/template.d.ts +1 -1
- package/dist/portfolio/contract.d.ts +1 -1
- package/dist/press-kit/articles/Article.d.ts +2 -2
- package/dist/press-kit/articles/ArticleFaqSection.d.ts +1 -1
- package/dist/press-kit/articles/ArticleList.d.ts +2 -2
- package/dist/press-kit/articles/AuthorCard.d.ts +1 -1
- package/dist/press-kit/articles/AuthorPage.d.ts +1 -1
- package/dist/press-kit/articles/ClusterLandingPage.d.ts +2 -2
- package/dist/press-kit/articles/ClusterNavigation.d.ts +2 -2
- package/dist/press-kit/articles/ManagedNewsletterForm.d.ts +2 -2
- package/dist/press-kit/articles/PublicationLayout.d.ts +2 -2
- package/dist/press-kit/articles/PublicationSidebar.d.ts +1 -1
- package/dist/press-kit/articles/RelatedPosts.d.ts +2 -2
- package/dist/press-kit/articles/TableOfContents.d.ts +1 -1
- package/dist/press-kit/articles/article-body.d.ts +1 -1
- package/dist/press-kit/articles/article-headings.d.ts +1 -1
- package/dist/press-kit/articles/article-photos.d.ts +1 -1
- package/dist/press-kit/articles/artwork.d.ts +2 -2
- package/dist/press-kit/articles/author-schema.d.ts +2 -2
- package/dist/press-kit/articles/author-social.d.ts +1 -1
- package/dist/press-kit/articles/index.d.ts +23 -23
- package/dist/press-kit/articles/news-sitemap.d.ts +2 -2
- package/dist/press-kit/articles/public-reads.d.ts +1 -1
- package/dist/press-kit/articles/publication-reads.d.ts +2 -2
- package/dist/press-kit/articles/reading-time.d.ts +1 -1
- package/dist/press-kit/articles/server-core.d.ts +20 -20
- package/dist/press-kit/articles/server-ui.d.ts +20 -20
- package/dist/press-kit/articles/types.d.ts +1 -1
- package/dist/proxy/index.d.ts +5 -5
- package/dist/proxy/index.js +1 -1
- package/dist/reputation/TestimonialSection.d.ts +1 -1
- package/dist/reputation/VisualReviewCard.d.ts +1 -1
- package/dist/reputation/api.d.ts +1 -1
- package/dist/reputation/index.d.ts +4 -4
- package/dist/reputation/server.d.ts +3 -3
- package/dist/resonance/ResonanceRuntime.d.ts +7 -0
- package/dist/resonance/bridge.d.ts +16 -0
- package/dist/resonance/consent-adapter.d.ts +26 -0
- package/dist/resonance/controller-registry.d.ts +14 -0
- package/dist/resonance/controller.d.ts +103 -0
- package/dist/resonance/form-context.d.ts +5 -0
- package/dist/resonance/index.d.ts +4 -0
- package/dist/resonance/index.js +9 -0
- package/dist/resonance/meta-pixel.d.ts +67 -0
- package/dist/resonance/providers.d.ts +32 -0
- package/dist/resonance/runtime-core.d.ts +5 -0
- package/dist/revalidate/index.d.ts +3 -3
- package/dist/revalidate/index.js +2 -2
- package/dist/robots/index.d.ts +3 -3
- package/dist/robots/indexnow.js +2 -2
- package/dist/runtime/index.d.ts +7 -7
- package/dist/runtime/index.js +4 -5
- package/dist/runtime-core-WT7KKLWQ.js +2213 -0
- package/dist/seo/ManagedFAQ.d.ts +1 -1
- package/dist/seo/ManagedInternalLinks.d.ts +1 -1
- package/dist/seo/ManagedSchema.d.ts +1 -1
- package/dist/seo/ManagedScripts.d.ts +1 -1
- package/dist/seo/client.d.ts +1 -1
- package/dist/seo/client.js +3 -5
- package/dist/seo/entry-indexnow.d.ts +1 -1
- package/dist/seo/entry-llms-client.d.ts +1 -1
- package/dist/seo/entry-llms-contract.d.ts +1 -1
- package/dist/seo/entry-llms.d.ts +1 -1
- package/dist/seo/entry-meta-contract.d.ts +1 -1
- package/dist/seo/entry-og-route.d.ts +1 -1
- package/dist/seo/entry-og.d.ts +1 -1
- package/dist/seo/entry-pages-contract.d.ts +1 -1
- package/dist/seo/entry-redirects.d.ts +1 -1
- package/dist/seo/entry-robots.d.ts +1 -1
- package/dist/seo/entry-sitemap.d.ts +1 -1
- package/dist/seo/getManagedMetadata.d.ts +1 -1
- package/dist/seo/index.d.ts +12 -12
- package/dist/seo/index.js +9 -11
- package/dist/seo/indexnow.d.ts +1 -1
- package/dist/seo/indexnow.js +2 -2
- package/dist/seo/llms/client.d.ts +1 -1
- package/dist/seo/llms/contract.d.ts +1 -1
- package/dist/seo/llms.d.ts +1 -1
- package/dist/seo/llms.js +5 -5
- package/dist/seo/meta/contract.d.ts +1 -1
- package/dist/seo/og/route.d.ts +1 -1
- package/dist/seo/og/route.js +1 -1
- package/dist/seo/og.d.ts +1 -1
- package/dist/seo/pages/contract.d.ts +1 -1
- package/dist/seo/redirects.d.ts +1 -1
- package/dist/seo/register-sitemap-cli-impl.d.ts +1 -1
- package/dist/seo/register-sitemap-cli.js +1 -1
- package/dist/seo/robots.d.ts +1 -1
- package/dist/seo/routing.d.ts +1 -1
- package/dist/seo/server.d.ts +4 -4
- package/dist/seo/server.js +3 -3
- package/dist/seo/sitemap.d.ts +1 -1
- package/dist/seo/sitemap.js +3 -3
- package/dist/seo/types.d.ts +1 -1
- package/dist/seo-meta/contract.d.ts +1 -1
- package/dist/seo-pages/contract.d.ts +1 -1
- package/dist/server/index.d.ts +5 -5
- package/dist/server/index.js +3 -3
- package/dist/server/mint-site-token.d.ts +1 -1
- package/dist/server/server-fetch.d.ts +8 -0
- package/dist/{server-api-XIKDWSNO.js → server-api-A34TABT2.js} +2 -2
- package/dist/shared/build-entries.d.ts +3 -1
- package/dist/shared/color.d.ts +1 -1
- package/dist/shared/fetchWithRetry.d.ts +6 -0
- package/dist/shared/frame.d.ts +1 -1
- package/dist/shared/identity-storage.d.ts +6 -4
- package/dist/shared/identity.d.ts +1 -3
- package/dist/shared/index.d.ts +5 -5
- package/dist/shared/index.js +1 -1
- package/dist/shared/measurement-analytics.d.ts +1 -0
- package/dist/shared/measurement-policy.d.ts +6 -0
- package/dist/shared/measurement-proof.d.ts +5 -0
- package/dist/shared/measurement-store.d.ts +34 -0
- package/dist/shared/measurement-writer.d.ts +6 -0
- package/dist/shared/publishCredential.d.ts +1 -1
- package/dist/shared/reporting-gate.d.ts +3 -1
- package/dist/shared/site-token-claims.d.ts +18 -0
- package/dist/shared/site-token-configuration.d.ts +9 -0
- package/dist/shared/site-token-refresh.d.ts +7 -0
- package/dist/shared/site-token-state.d.ts +23 -0
- package/dist/shared/siteToken.d.ts +5 -39
- package/dist/shared/sonor-auth-state.d.ts +3 -0
- package/dist/shared/sonor-beacon.d.ts +13 -0
- package/dist/shared/sonor-fetch-runtime.d.ts +2 -0
- package/dist/shared/sonor-fetch.d.ts +7 -0
- package/dist/shared/sonorFetch.d.ts +4 -49
- package/dist/shared/version.d.ts +1 -1
- package/dist/signal/ReviewedSignalExperiment.d.ts +9 -0
- package/dist/signal/SignalBridge.d.ts +4 -4
- package/dist/signal/SignalCore.d.ts +2 -1
- package/dist/signal/SignalExperiment.d.ts +13 -5
- package/dist/signal/index.d.ts +3 -3
- package/dist/signal/index.js +4 -73
- package/dist/signal/store.d.ts +10 -7
- package/dist/signal/types.d.ts +4 -0
- package/dist/sitemap/index.d.ts +5 -5
- package/dist/sitemap/index.js +3 -3
- package/dist/sites/contract.d.ts +1 -1
- package/dist/sites/normalize.d.ts +1 -1
- package/dist/slots/ManagedLink.d.ts +2 -2
- package/dist/slots/ManagedList.d.ts +2 -2
- package/dist/slots/ManagedRichText.d.ts +1 -1
- package/dist/slots/ManagedSlot.d.ts +1 -1
- package/dist/slots/contract.d.ts +1 -1
- package/dist/slots/edit/locate.d.ts +1 -1
- package/dist/slots/index.d.ts +14 -14
- package/dist/slots/index.js +2 -2
- package/dist/slots/server-api.d.ts +1 -1
- package/dist/{chunk-FLOJUMFR.js → sonor-fetch-runtime-3PFGUXMF.js} +27 -36
- package/dist/sync/AddToCalendar.d.ts +1 -1
- package/dist/sync/BookingWidget.d.ts +1 -1
- package/dist/sync/MeetingFormatStep.d.ts +1 -1
- package/dist/sync/api.d.ts +2 -2
- package/dist/sync/booking-flow.d.ts +1 -1
- package/dist/sync/index.d.ts +3 -3
- package/dist/sync/index.js +6 -7
- package/dist/types.d.ts +6 -6
- package/dist/website/BlocksPopup.d.ts +1 -1
- package/dist/website/PopupBlocks.d.ts +1 -1
- package/dist/website/SiteDesignReporter.d.ts +2 -2
- package/dist/website/SitePopups.d.ts +1 -1
- package/dist/website/contract.d.ts +1 -1
- package/dist/website/cta-bar.d.ts +1 -1
- package/dist/website/cta-bar.js +4 -3
- package/dist/website/design.d.ts +2 -2
- package/dist/website/images/server.d.ts +1 -1
- package/dist/website/images-server.d.ts +1 -1
- package/dist/website/images.d.ts +1 -1
- package/dist/website/images.js +2 -4
- package/dist/website/index.d.ts +4 -4
- package/dist/website/index.js +5 -6
- package/dist/website/landing/server.d.ts +1 -1
- package/dist/website/landing/server.js +11 -6
- package/dist/website/landing-server.d.ts +1 -1
- package/dist/website/landing.d.ts +1 -1
- package/dist/website/landing.js +3 -2
- package/dist/website/popup-rules.d.ts +2 -2
- package/dist/website/popup-types.d.ts +1 -1
- package/dist/website/popups.d.ts +4 -4
- package/dist/website/popups.js +14 -8
- package/dist/website/slots/contract.d.ts +1 -1
- package/dist/website/slots-contract.d.ts +1 -1
- package/dist/website/slots.d.ts +2 -2
- package/dist/website/slots.js +2 -2
- package/dist/{writeLLMsTxt-4HHUAOA6.js → writeLLMsTxt-JUACXQKP.js} +2 -2
- package/docs.json +5 -0
- package/package.json +8 -2
- package/src/analytics/README.md +21 -0
- package/src/cta-bar/README.md +4 -0
- package/src/forms/README.md +29 -0
- package/src/landing/README.md +14 -0
- package/src/layout/README.md +3 -0
- package/src/og/README.md +28 -0
- package/src/resonance/README.md +273 -0
- package/src/runtime/README.md +6 -1
- package/src/signal/README.md +21 -0
- package/src/website/README.md +14 -2
- package/dist/AnalyticsProvider-7SBJ27SI.js +0 -13
- package/dist/ChatWidget-V46UBDOM.js +0 -20
- package/dist/ManagedForm-DDDVMKLJ.js +0 -19
- package/dist/SitePopups-VU2C3Z6B.js +0 -13
- package/dist/SitemapSync-C4H3HF3L.js +0 -9
- package/dist/chunk-5ROTTMBL.js +0 -19
- package/dist/chunk-5TM3WPCI.js +0 -7
- package/dist/chunk-7HW4TZB5.js +0 -148
- package/dist/chunk-IPQKQEWI.js +0 -52
- package/dist/chunk-LCDVPAMR.js +0 -24
- package/dist/chunk-SHAUX2MQ.js +0 -163
- /package/dist/{chunk-3MJNBOUO.js → chunk-2QPVU63T.js} +0 -0
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { DEFAULT_WIDGET_Z_INDEX } from './chunk-27FISYK4.js';
|
|
3
|
-
import { readAnalyticsIdentity } from './chunk-
|
|
4
|
-
import { getOrCreateVisitorId } from './chunk-
|
|
5
|
-
import { resolveAnalyticsTarget } from './chunk-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { readAnalyticsIdentity } from './chunk-PVY7X5UR.js';
|
|
4
|
+
import { getOrCreateVisitorId } from './chunk-JT7GHHMV.js';
|
|
5
|
+
import { resolveAnalyticsTarget as resolveAnalyticsTarget$1, analyticsSend } from './chunk-PMXQPO5Q.js';
|
|
6
|
+
import { resolveAnalyticsTarget } from './chunk-7643MCD2.js';
|
|
7
|
+
import { sonorFetch } from './chunk-VXCUXHZO.js';
|
|
8
|
+
import { subscribeMeasurementPolicy, measurementPolicySnapshot, serverMeasurementPolicySnapshot } from './chunk-FRY6PBT6.js';
|
|
9
|
+
import { useState, useEffect, useCallback, useSyncExternalStore, useRef } from 'react';
|
|
8
10
|
import ReactDOM from 'react-dom';
|
|
9
11
|
import dynamic from 'next/dynamic';
|
|
10
12
|
import { usePathname } from 'next/navigation';
|
|
@@ -161,7 +163,7 @@ function activatePopup(active, id, popups) {
|
|
|
161
163
|
return [...active, id];
|
|
162
164
|
}
|
|
163
165
|
var LazyBlocksPopup = dynamic(
|
|
164
|
-
() => import('./BlocksPopup-
|
|
166
|
+
() => import('./BlocksPopup-U5VIYEBA.js').then((m) => ({ default: m.BlocksPopup })),
|
|
165
167
|
{ ssr: false }
|
|
166
168
|
);
|
|
167
169
|
function SitePopups(props) {
|
|
@@ -173,7 +175,9 @@ function AllowedSitePopups({
|
|
|
173
175
|
apiUrl,
|
|
174
176
|
apiKey,
|
|
175
177
|
zIndex = DEFAULT_WIDGET_Z_INDEX,
|
|
176
|
-
debug = false
|
|
178
|
+
debug = false,
|
|
179
|
+
allowInFrame = false,
|
|
180
|
+
allowLocalhost = false
|
|
177
181
|
}) {
|
|
178
182
|
const pathname = usePathname();
|
|
179
183
|
const [popups, setPopups] = useState([]);
|
|
@@ -182,13 +186,19 @@ function AllowedSitePopups({
|
|
|
182
186
|
useEffect(() => {
|
|
183
187
|
let cancelled = false;
|
|
184
188
|
async function load() {
|
|
185
|
-
const
|
|
186
|
-
const
|
|
189
|
+
const epoch = measurementPolicySnapshot().collectionEpoch;
|
|
190
|
+
const endpoint = `${apiUrl.replace(/\/$/, "")}/engage/widget/elements`;
|
|
191
|
+
const requestUrl = () => {
|
|
192
|
+
const tracking = !!resolveAnalyticsTarget$1({ apiUrl, apiKey, allowInFrame, allowLocalhost, measurementEpoch: epoch });
|
|
193
|
+
const visitorId = tracking ? getOrCreateVisitorId() : "";
|
|
194
|
+
const url = typeof window !== "undefined" ? tracking ? window.location.href : window.location.origin + window.location.pathname : "";
|
|
195
|
+
return `${endpoint}?url=${encodeURIComponent(url)}&visitorId=${encodeURIComponent(visitorId)}&deviceType=${getDeviceType()}`;
|
|
196
|
+
};
|
|
187
197
|
try {
|
|
188
198
|
const response = await sonorFetch(
|
|
189
|
-
|
|
199
|
+
requestUrl(),
|
|
190
200
|
{},
|
|
191
|
-
{ apiKey }
|
|
201
|
+
{ apiKey, prepareUrl: requestUrl }
|
|
192
202
|
);
|
|
193
203
|
if (!response.ok) {
|
|
194
204
|
if (debug) console.error("[SitePopups] Error loading popups:", response.statusText);
|
|
@@ -207,7 +217,7 @@ function AllowedSitePopups({
|
|
|
207
217
|
return () => {
|
|
208
218
|
cancelled = true;
|
|
209
219
|
};
|
|
210
|
-
}, [apiUrl, apiKey, debug]);
|
|
220
|
+
}, [apiUrl, apiKey, debug, allowInFrame, allowLocalhost]);
|
|
211
221
|
useEffect(() => {
|
|
212
222
|
watchFormInput();
|
|
213
223
|
}, []);
|
|
@@ -290,7 +300,9 @@ function AllowedSitePopups({
|
|
|
290
300
|
onEngaged: () => recordSeen(popup.id),
|
|
291
301
|
zIndex,
|
|
292
302
|
apiUrl,
|
|
293
|
-
apiKey
|
|
303
|
+
apiKey,
|
|
304
|
+
allowInFrame,
|
|
305
|
+
allowLocalhost
|
|
294
306
|
},
|
|
295
307
|
popup.id
|
|
296
308
|
);
|
|
@@ -304,18 +316,22 @@ function PopupView({
|
|
|
304
316
|
onEngaged,
|
|
305
317
|
zIndex,
|
|
306
318
|
apiUrl,
|
|
307
|
-
apiKey
|
|
319
|
+
apiKey,
|
|
320
|
+
allowInFrame,
|
|
321
|
+
allowLocalhost
|
|
308
322
|
}) {
|
|
323
|
+
const policy = useSyncExternalStore(subscribeMeasurementPolicy, measurementPolicySnapshot, serverMeasurementPolicySnapshot);
|
|
324
|
+
const gate = { apiUrl: apiUrl.replace(/\/+$/, ""), apiKey, allowInFrame, allowLocalhost, measurementEpoch: policy.collectionEpoch };
|
|
309
325
|
const rootRef = useRef(null);
|
|
310
326
|
const counted = useRef(false);
|
|
311
327
|
useEffect(() => {
|
|
312
328
|
const el = rootRef.current;
|
|
313
|
-
if (!el || counted.current) return;
|
|
329
|
+
if (!el || counted.current || !resolveAnalyticsTarget$1(gate)) return;
|
|
314
330
|
const observer = new IntersectionObserver(
|
|
315
331
|
([entry]) => {
|
|
316
|
-
if (entry.isIntersecting && !counted.current) {
|
|
332
|
+
if (entry.isIntersecting && entry.intersectionRatio >= 0.5 && !counted.current && resolveAnalyticsTarget$1(gate)) {
|
|
317
333
|
counted.current = true;
|
|
318
|
-
trackPopupEvent(
|
|
334
|
+
trackPopupEvent("impression", { elementId: popup.id }, gate);
|
|
319
335
|
observer.disconnect();
|
|
320
336
|
}
|
|
321
337
|
},
|
|
@@ -323,7 +339,7 @@ function PopupView({
|
|
|
323
339
|
);
|
|
324
340
|
observer.observe(el);
|
|
325
341
|
return () => observer.disconnect();
|
|
326
|
-
}, [apiUrl, apiKey, popup.id]);
|
|
342
|
+
}, [apiUrl, apiKey, popup.id, allowInFrame, allowLocalhost, policy.collectionEpoch]);
|
|
327
343
|
const layout = popup.layout;
|
|
328
344
|
const position = layout?.corner ?? popup.config?.position;
|
|
329
345
|
const corner = position === "bottom-left" || position === "top-left" || position === "top-right" ? position : "bottom-right";
|
|
@@ -341,20 +357,15 @@ function PopupView({
|
|
|
341
357
|
onClose: onDismiss,
|
|
342
358
|
onButton: (url) => {
|
|
343
359
|
onEngaged();
|
|
344
|
-
trackPopupEvent(
|
|
360
|
+
trackPopupEvent("click", { elementId: popup.id, action: "navigate", url }, gate);
|
|
345
361
|
}
|
|
346
362
|
}
|
|
347
363
|
);
|
|
348
364
|
}
|
|
349
|
-
function trackPopupEvent(
|
|
365
|
+
function trackPopupEvent(endpoint, data, gate) {
|
|
366
|
+
if (!resolveAnalyticsTarget$1(gate)) return;
|
|
350
367
|
const { visitorId } = readAnalyticsIdentity();
|
|
351
|
-
|
|
352
|
-
method: "POST",
|
|
353
|
-
headers: { "Content-Type": "application/json" },
|
|
354
|
-
body: JSON.stringify({ ...data, visitorId, pageUrl: window.location.href }),
|
|
355
|
-
keepalive: true
|
|
356
|
-
}, { apiKey, retries: 0 }).catch(() => {
|
|
357
|
-
});
|
|
368
|
+
void analyticsSend(`/engage/widget/${endpoint}`, { ...data, visitorId, pageUrl: window.location.href }, { ...gate, keepalive: true });
|
|
358
369
|
}
|
|
359
370
|
function getDeviceType() {
|
|
360
371
|
if (typeof navigator === "undefined") return "desktop";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{useSignalExperiment as v,useSignalEvent as x}from"./chunk-HJD6KXKH.js";import{recordRenderedResonanceExposure as E}from"./chunk-MOACHHOJ.js";import{subscribeMeasurementPolicy as C,measurementPolicySnapshot as S,serverMeasurementPolicySnapshot as R}from"./chunk-FRY6PBT6.js";import k,{lazy as h,Suspense as w,useRef as j,useSyncExternalStore as P,useEffect as $}from"react";import{usePathname as b}from"next/navigation";import{jsx as o,Fragment as m}from"react/jsx-runtime";var K=h(()=>import("./_client/reviewed-signal-experiment.js"));function O(e){if(e.reviewedContext){const n=e.reviewedContext.controlVariantKey,c=e.children?e.children({variant:n,isControl:!0}):Object.prototype.hasOwnProperty.call(e.variants,n)&&e.variants[n]!==void 0?e.variants[n]:e.fallback||null;return o(w,{fallback:c,children:o(K,{...e,reviewedContext:e.reviewedContext})})}return o(M,{...e})}function M({experimentId:e,variants:n,fallback:c,trackImpression:a=!0,children:s}){const{assignment:i,variant:t,isControl:l}=v(e),f=x(),d=b(),p=j(""),r=P(C,S,R);if($(()=>{const _=!!s||!!t&&n[t]!==void 0;if(a&&t&&_){const u=r.config;if(u){if(!i?.assignment_id||!i.experiment_revision||i.site!==u.site)return;const g=`${i.assignment_id}:${i.experiment_revision}:${t}:${d}:${r.proof?.currentConsentRevision}`;if(g===p.current)return;E({projectId:u.projectId,site:u.site,experimentId:e,experimentRevision:i.experiment_revision,assignmentId:i.assignment_id,variantKey:t,occurredAt:new Date().toISOString()})&&(p.current=g);return}f({event_type:"experiment",event_name:"impression",event_data:{experiment_id:e,variant_key:t}})}},[e,t,i,d,a,f,s,n,r.config?.projectId,r.config?.site,r.config?.configRevision,r.config?.policyRevision,r.proof?.currentConsentRevision]),s)return o(m,{children:s({variant:t||"control",isControl:l})});const y=n[t||"control"];return y!==void 0?o(m,{children:y}):c?o(m,{children:c}):o(m,{children:n.control||null})}function V(e){return v(e)}function z({experimentId:e,outcomeType:n="click",value:c,children:a}){const s=x(),{variant:i}=v(e),t=()=>{s({event_type:"experiment",event_name:"conversion",event_data:{experiment_id:e,variant_key:i,outcome_type:n,value:c}})};return k.cloneElement(a,{onClick:l=>{t(),a.props.onClick&&a.props.onClick(l)}})}export{z as ExperimentConversion,O as SignalExperiment,V as useExperimentVariant};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { isSiteToken, configureSiteCredential, storeToken, tokenExp } from './chunk-TPHOIE4I.js';
|
|
2
|
+
import { siteTokenState } from './chunk-D4M5K6JN.js';
|
|
3
|
+
import { SITE_KIT_VERSION } from './chunk-DXE6SXWW.js';
|
|
4
|
+
|
|
5
|
+
// src/shared/site-token-refresh.ts
|
|
6
|
+
var REFRESH_SKEW_MS = 5 * 6e4;
|
|
7
|
+
var REFRESH_TIMEOUT_MS = 6e3;
|
|
8
|
+
function needsRefresh() {
|
|
9
|
+
if (!siteTokenState.isToken) return false;
|
|
10
|
+
if (!siteTokenState.token) return true;
|
|
11
|
+
return Date.now() >= tokenExp(siteTokenState.token) - REFRESH_SKEW_MS;
|
|
12
|
+
}
|
|
13
|
+
async function doRefresh() {
|
|
14
|
+
const current = siteTokenState.token;
|
|
15
|
+
if (!current) return null;
|
|
16
|
+
try {
|
|
17
|
+
const res = await fetch(`${siteTokenState.apiUrl}/api/public/site-token/refresh`, {
|
|
18
|
+
method: "POST",
|
|
19
|
+
headers: {
|
|
20
|
+
"content-type": "application/json",
|
|
21
|
+
"x-sitekit-version": SITE_KIT_VERSION,
|
|
22
|
+
// Send the current token as x-api-key too, so the server's key-scoped
|
|
23
|
+
// throttler buckets refreshes by token rather than by shared CDN IP.
|
|
24
|
+
"x-api-key": current
|
|
25
|
+
},
|
|
26
|
+
body: JSON.stringify({ token: current }),
|
|
27
|
+
signal: typeof AbortSignal !== "undefined" && AbortSignal.timeout ? AbortSignal.timeout(REFRESH_TIMEOUT_MS) : void 0
|
|
28
|
+
});
|
|
29
|
+
if (!res.ok) return null;
|
|
30
|
+
const data = await res.json().catch(() => null);
|
|
31
|
+
const next = data?.token;
|
|
32
|
+
if (typeof next === "string" && isSiteToken(next)) {
|
|
33
|
+
siteTokenState.token = next;
|
|
34
|
+
storeToken(next);
|
|
35
|
+
return next;
|
|
36
|
+
}
|
|
37
|
+
return null;
|
|
38
|
+
} catch {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function refreshSiteToken() {
|
|
43
|
+
if (!siteTokenState.isToken) return Promise.resolve(null);
|
|
44
|
+
if (siteTokenState.refreshing) return siteTokenState.refreshing;
|
|
45
|
+
siteTokenState.refreshing = doRefresh().finally(() => {
|
|
46
|
+
siteTokenState.refreshing = null;
|
|
47
|
+
});
|
|
48
|
+
return siteTokenState.refreshing;
|
|
49
|
+
}
|
|
50
|
+
async function getFreshCredential(seed) {
|
|
51
|
+
if (!siteTokenState.isToken && isSiteToken(seed)) {
|
|
52
|
+
configureSiteCredential({ credential: seed });
|
|
53
|
+
}
|
|
54
|
+
if (!siteTokenState.isToken) return seed ?? siteTokenState.seed;
|
|
55
|
+
if (needsRefresh()) {
|
|
56
|
+
const refreshed = await refreshSiteToken();
|
|
57
|
+
if (refreshed) return refreshed;
|
|
58
|
+
}
|
|
59
|
+
return siteTokenState.token ?? seed ?? siteTokenState.seed;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export { getFreshCredential, refreshSiteToken };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// src/shared/measurement-store.ts
|
|
2
|
+
var MEASUREMENT_PURPOSES = ["analytics_storage", "ad_storage", "ad_user_data", "ad_personalization"];
|
|
3
|
+
var unknownChoices = () => ({ analytics_storage: "unknown", ad_storage: "unknown", ad_user_data: "unknown", ad_personalization: "unknown" });
|
|
4
|
+
var initialMeasurementPolicy = { version: 0, collectionEpoch: 0, analyticsChoiceEpoch: 0, policy: "legacy_unconfigured", config: null, analyticsRequired: false, choices: unknownChoices(), cmpValid: false, preferencePending: false, proof: null, identityScope: null };
|
|
5
|
+
var makeStore = () => ({ current: initialMeasurementPolicy, primed: false, lastObservedAnalyticsChoice: "unknown", listeners: /* @__PURE__ */ new Set() });
|
|
6
|
+
var measurementStore = typeof window === "undefined" ? makeStore() : window.__SONOR_MEASUREMENT_POLICY_V1__ ?? (window.__SONOR_MEASUREMENT_POLICY_V1__ = makeStore());
|
|
7
|
+
function primeMeasurementPolicy() {
|
|
8
|
+
if (typeof window === "undefined" || measurementStore.primed) return;
|
|
9
|
+
measurementStore.primed = true;
|
|
10
|
+
if (!measurementStore.current.config) measurementStore.current = { ...measurementStore.current, policy: "resolving", collectionEpoch: measurementStore.current.collectionEpoch + 1, version: measurementStore.current.version + 1 };
|
|
11
|
+
}
|
|
12
|
+
var measurementPolicySnapshot = () => measurementStore.current;
|
|
13
|
+
var serverMeasurementPolicySnapshot = () => initialMeasurementPolicy;
|
|
14
|
+
var subscribeMeasurementPolicy = (listener) => {
|
|
15
|
+
measurementStore.listeners.add(listener);
|
|
16
|
+
return () => {
|
|
17
|
+
measurementStore.listeners.delete(listener);
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
// src/shared/measurement-analytics.ts
|
|
22
|
+
function analyticsPurposePermitted() {
|
|
23
|
+
const current = measurementPolicySnapshot();
|
|
24
|
+
const { choices, analyticsRequired, policy } = current;
|
|
25
|
+
if (choices.analytics_storage === "denied" || choices.analytics_storage === "withdrawn") return false;
|
|
26
|
+
if (policy === "resolving" || current.preferencePending || policy === "configured" && !!current.config && Date.parse(current.config.expiresAt) <= Date.now()) return false;
|
|
27
|
+
if (choices.analytics_storage === "granted") return true;
|
|
28
|
+
return !analyticsRequired;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { MEASUREMENT_PURPOSES, analyticsPurposePermitted, measurementPolicySnapshot, measurementStore, primeMeasurementPolicy, serverMeasurementPolicySnapshot, subscribeMeasurementPolicy, unknownChoices };
|
|
@@ -4,7 +4,7 @@ import { stripHtmlTags } from './chunk-IBHBEUZV.js';
|
|
|
4
4
|
import { resolveArticleUrl, createPublicationRoutes, resolvePublicationUrl, articleCategorySlug } from './chunk-4K735O3J.js';
|
|
5
5
|
import { withoutSchemaPlaceholders } from './chunk-VWWITFWM.js';
|
|
6
6
|
import { withSiteParam, withSiteBody } from './chunk-MJP63SSS.js';
|
|
7
|
-
import { resolveServerApiConfig } from './chunk-
|
|
7
|
+
import { resolveServerApiConfig } from './chunk-7VMA3KCN.js';
|
|
8
8
|
import 'server-only';
|
|
9
9
|
import { notFound } from 'next/navigation';
|
|
10
10
|
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { measurementPolicySnapshot, subscribeMeasurementPolicy, analyticsPurposePermitted, serverMeasurementPolicySnapshot } from './chunk-FRY6PBT6.js';
|
|
3
|
+
import { useSyncExternalStore, useEffect } from 'react';
|
|
4
|
+
import dynamic from 'next/dynamic';
|
|
5
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
var pendingEvents = [];
|
|
8
|
+
var pendingOutcomes = [];
|
|
9
|
+
var MAX_PENDING = 100;
|
|
10
|
+
var warnedNoBridge = false;
|
|
11
|
+
var core = null;
|
|
12
|
+
var queueEpoch = measurementPolicySnapshot().collectionEpoch;
|
|
13
|
+
subscribeMeasurementPolicy(() => {
|
|
14
|
+
const epoch = measurementPolicySnapshot().collectionEpoch;
|
|
15
|
+
if (!analyticsPurposePermitted() || epoch !== queueEpoch) {
|
|
16
|
+
pendingEvents.length = 0;
|
|
17
|
+
pendingOutcomes.length = 0;
|
|
18
|
+
}
|
|
19
|
+
queueEpoch = epoch;
|
|
20
|
+
});
|
|
21
|
+
function trackEvent(event) {
|
|
22
|
+
if (!analyticsPurposePermitted()) return;
|
|
23
|
+
if (core) {
|
|
24
|
+
core.trackEvent(event);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (pendingEvents.length < MAX_PENDING) pendingEvents.push(event);
|
|
28
|
+
else if (!warnedNoBridge) {
|
|
29
|
+
warnedNoBridge = true;
|
|
30
|
+
console.warn("[site-kit] Signal events are queuing but no SignalBridge has mounted \u2014 is signal enabled on SiteKitLayout?");
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function trackOutcome(outcome) {
|
|
34
|
+
if (!analyticsPurposePermitted()) return;
|
|
35
|
+
if (core) {
|
|
36
|
+
core.trackOutcome(outcome);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (pendingOutcomes.length < MAX_PENDING) pendingOutcomes.push(outcome);
|
|
40
|
+
}
|
|
41
|
+
var signalQueueApi = {
|
|
42
|
+
trackEvent,
|
|
43
|
+
trackOutcome,
|
|
44
|
+
getExperiment: (experimentId) => core?.getExperiment(experimentId) ?? null,
|
|
45
|
+
refreshConfig: async () => {
|
|
46
|
+
await core?.refreshConfig();
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
function registerSignalCore(api) {
|
|
50
|
+
core = api;
|
|
51
|
+
if (!api) return;
|
|
52
|
+
while (pendingEvents.length && analyticsPurposePermitted() && queueEpoch === measurementPolicySnapshot().collectionEpoch) api.trackEvent(pendingEvents.shift());
|
|
53
|
+
while (pendingOutcomes.length && analyticsPurposePermitted() && queueEpoch === measurementPolicySnapshot().collectionEpoch) api.trackOutcome(pendingOutcomes.shift());
|
|
54
|
+
}
|
|
55
|
+
var STUB = Object.freeze({ config: null, loading: true, error: null, ...signalQueueApi });
|
|
56
|
+
var current = STUB;
|
|
57
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
58
|
+
function emit() {
|
|
59
|
+
for (const listener of listeners) listener();
|
|
60
|
+
}
|
|
61
|
+
function publishSignal(value) {
|
|
62
|
+
current = value;
|
|
63
|
+
emit();
|
|
64
|
+
}
|
|
65
|
+
function publishSignalCoreState(state) {
|
|
66
|
+
publishSignal({ config: state.config, loading: state.loading, error: state.error, ...signalQueueApi });
|
|
67
|
+
}
|
|
68
|
+
function resetSignal() {
|
|
69
|
+
core = null;
|
|
70
|
+
pendingEvents.length = 0;
|
|
71
|
+
pendingOutcomes.length = 0;
|
|
72
|
+
current = STUB;
|
|
73
|
+
emit();
|
|
74
|
+
}
|
|
75
|
+
function subscribe(onChange) {
|
|
76
|
+
listeners.add(onChange);
|
|
77
|
+
return () => {
|
|
78
|
+
listeners.delete(onChange);
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
var getSnapshot = () => current;
|
|
82
|
+
var getServerSnapshot = () => STUB;
|
|
83
|
+
function useSignal() {
|
|
84
|
+
return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
85
|
+
}
|
|
86
|
+
var LazySignalCore = dynamic(
|
|
87
|
+
() => import('./SignalCore-HAN4O7QG.js').then((m) => ({ default: m.SignalCore })),
|
|
88
|
+
{ ssr: false }
|
|
89
|
+
);
|
|
90
|
+
function SignalBridge({
|
|
91
|
+
enabled = true,
|
|
92
|
+
realtime = true,
|
|
93
|
+
experiments = true,
|
|
94
|
+
behaviorTracking = true,
|
|
95
|
+
visitorId: externalVisitorId,
|
|
96
|
+
sessionId: externalSessionId,
|
|
97
|
+
pageMetadataRef,
|
|
98
|
+
children
|
|
99
|
+
}) {
|
|
100
|
+
useEffect(() => {
|
|
101
|
+
publishSignalCoreState({ config: null, loading: true, error: null });
|
|
102
|
+
return () => resetSignal();
|
|
103
|
+
}, []);
|
|
104
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
105
|
+
children,
|
|
106
|
+
enabled && /* @__PURE__ */ jsx(
|
|
107
|
+
LazySignalCore,
|
|
108
|
+
{
|
|
109
|
+
enabled,
|
|
110
|
+
realtime,
|
|
111
|
+
experiments,
|
|
112
|
+
behaviorTracking,
|
|
113
|
+
externalVisitorId,
|
|
114
|
+
externalSessionId,
|
|
115
|
+
pageMetadataRef,
|
|
116
|
+
onRegister: registerSignalCore,
|
|
117
|
+
onState: publishSignalCoreState
|
|
118
|
+
}
|
|
119
|
+
)
|
|
120
|
+
] });
|
|
121
|
+
}
|
|
122
|
+
function useSignalConfig() {
|
|
123
|
+
const { config } = useSignal();
|
|
124
|
+
return config;
|
|
125
|
+
}
|
|
126
|
+
function useSignalEvent() {
|
|
127
|
+
const { trackEvent: trackEvent2 } = useSignal();
|
|
128
|
+
return trackEvent2;
|
|
129
|
+
}
|
|
130
|
+
function useSignalOutcome() {
|
|
131
|
+
const { trackOutcome: trackOutcome2 } = useSignal();
|
|
132
|
+
return { trackOutcome: trackOutcome2 };
|
|
133
|
+
}
|
|
134
|
+
function useSignalExperiment(experimentId) {
|
|
135
|
+
const { getExperiment, config } = useSignal();
|
|
136
|
+
useSyncExternalStore(subscribeMeasurementPolicy, measurementPolicySnapshot, serverMeasurementPolicySnapshot);
|
|
137
|
+
const assignment = getExperiment(experimentId);
|
|
138
|
+
const experiment = config?.experiments?.find((e) => e.id === experimentId);
|
|
139
|
+
const isRunning = experiment?.status === "running";
|
|
140
|
+
return {
|
|
141
|
+
assignment: isRunning ? assignment : null,
|
|
142
|
+
variant: isRunning && assignment ? assignment.variant_key : null,
|
|
143
|
+
isControl: !isRunning || !assignment || assignment.variant_key === "control"
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export { SignalBridge, useSignal, useSignalConfig, useSignalEvent, useSignalExperiment, useSignalOutcome };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { getSiteDesignTokens, tokensForReport, shouldReportDesign, sendSiteDesign } from './chunk-
|
|
2
|
+
import { getSiteDesignTokens, tokensForReport, shouldReportDesign, sendSiteDesign } from './chunk-6EDE7BOE.js';
|
|
3
3
|
import { designTokensHash } from './chunk-XHYE24HU.js';
|
|
4
4
|
import { useDeferredActivation } from './chunk-YC7ELZS3.js';
|
|
5
|
-
import { resolveAnalyticsTarget } from './chunk-
|
|
5
|
+
import { resolveAnalyticsTarget } from './chunk-7643MCD2.js';
|
|
6
6
|
import { useRef, useEffect } from 'react';
|
|
7
7
|
|
|
8
8
|
var STAMP_KEY = (site) => `_sk_design_sent:${site}`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { secretsMatch, readCappedBody } from './chunk-XTRZGXB2.js';
|
|
2
|
-
import { SITE_KIT_VERSION } from './chunk-
|
|
2
|
+
import { SITE_KIT_VERSION } from './chunk-DXE6SXWW.js';
|
|
3
3
|
|
|
4
4
|
// src/llms/revalidate.ts
|
|
5
5
|
function createLlmsRevalidateHandler(secret, options) {
|
|
@@ -6,7 +6,7 @@ import { DEFAULT_HONEYPOT_FIELD } from './chunk-NJCTQH2P.js';
|
|
|
6
6
|
import React, { useRef, useEffect, useState, useMemo, useCallback } from 'react';
|
|
7
7
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
8
8
|
|
|
9
|
-
var loadInteractiveForm = () => import('./ManagedForm-
|
|
9
|
+
var loadInteractiveForm = () => import('./ManagedForm-7IZT7ZII.js').then((m) => m.ManagedForm);
|
|
10
10
|
var REPLAY_WAIT_MS = 8e3;
|
|
11
11
|
function FormEnhancer({
|
|
12
12
|
formId,
|
|
@@ -95,9 +95,38 @@ function fitRouteTitle(input) {
|
|
|
95
95
|
fits: false
|
|
96
96
|
};
|
|
97
97
|
}
|
|
98
|
+
var BRANDED_ROUTE_CARD = {
|
|
99
|
+
pad: 56,
|
|
100
|
+
photoWidth: 480,
|
|
101
|
+
logoHeight: 104,
|
|
102
|
+
titleHeight: 302,
|
|
103
|
+
titleLineHeight: 1.1,
|
|
104
|
+
titleMaxPx: 64,
|
|
105
|
+
titleMinPx: 36
|
|
106
|
+
};
|
|
107
|
+
function fitBrandedRouteTitle(title, photo) {
|
|
108
|
+
const c = BRANDED_ROUTE_CARD;
|
|
109
|
+
const width = OG_WIDTH - c.pad * 2 - (photo ? c.photoWidth : 0);
|
|
110
|
+
const fits = (text, px) => wrappedLines(text, width, (s) => uppercaseWidth(s, px)) * px * c.titleLineHeight <= c.titleHeight;
|
|
111
|
+
for (let px = c.titleMaxPx; px >= c.titleMinPx; px -= 2) {
|
|
112
|
+
if (fits(title, px)) return { title, titlePx: px, truncated: false };
|
|
113
|
+
}
|
|
114
|
+
const points = Array.from(title.trim());
|
|
115
|
+
let low = 0, high = points.length;
|
|
116
|
+
while (low < high) {
|
|
117
|
+
const middle = Math.ceil((low + high) / 2);
|
|
118
|
+
if (fits(`${points.slice(0, middle).join("").trimEnd()}\u2026`, c.titleMinPx)) low = middle;
|
|
119
|
+
else high = middle - 1;
|
|
120
|
+
}
|
|
121
|
+
let shortened = points.slice(0, low).join("").trimEnd();
|
|
122
|
+
const boundary = shortened.lastIndexOf(" ");
|
|
123
|
+
if (boundary > shortened.length * 0.6) shortened = shortened.slice(0, boundary);
|
|
124
|
+
return { title: `${shortened}\u2026`, titlePx: c.titleMinPx, truncated: true };
|
|
125
|
+
}
|
|
98
126
|
var size = { width: OG_WIDTH, height: OG_HEIGHT };
|
|
99
127
|
var contentType = "image/png";
|
|
100
128
|
function ogRouteElement(card) {
|
|
129
|
+
if (card.logo) return brandedRouteElement(card);
|
|
101
130
|
const { theme } = card;
|
|
102
131
|
const muted = theme.muted || theme.text;
|
|
103
132
|
const hasPhoto = !!card.photoUrl && /^(https?:|data:)/.test(card.photoUrl);
|
|
@@ -212,6 +241,34 @@ function ogRouteElement(card) {
|
|
|
212
241
|
}
|
|
213
242
|
);
|
|
214
243
|
}
|
|
244
|
+
function brandedRouteElement(card) {
|
|
245
|
+
const logo = card.logo;
|
|
246
|
+
let sourceAllowed = false;
|
|
247
|
+
try {
|
|
248
|
+
const url = new URL(logo.src);
|
|
249
|
+
sourceAllowed = (url.protocol === "https:" || url.protocol === "http:") && !url.username && !url.password || /^data:image\/(?:png|jpeg|webp|svg\+xml);base64,/i.test(logo.src);
|
|
250
|
+
} catch {
|
|
251
|
+
}
|
|
252
|
+
if (!sourceAllowed || !Number.isFinite(logo.width) || !Number.isFinite(logo.height) || logo.width <= 0 || logo.height <= 0 || typeof logo.alt !== "string") {
|
|
253
|
+
throw new TypeError("OG logo requires an absolute image source, positive intrinsic dimensions and alt text");
|
|
254
|
+
}
|
|
255
|
+
const c = BRANDED_ROUTE_CARD;
|
|
256
|
+
const photo = !!card.photoUrl && /^(https?:|data:)/.test(card.photoUrl);
|
|
257
|
+
const panelWidth = OG_WIDTH - (photo ? c.photoWidth : 0);
|
|
258
|
+
const scale = Math.min((panelWidth - c.pad * 2) / logo.width, c.logoHeight / logo.height);
|
|
259
|
+
const fit = fitBrandedRouteTitle(card.title, photo);
|
|
260
|
+
return /* @__PURE__ */ jsxs("div", { style: { display: "flex", width: "100%", height: "100%", backgroundColor: card.theme.bg, color: card.theme.text }, children: [
|
|
261
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", boxSizing: "border-box", flexShrink: 0, width: panelWidth, height: OG_HEIGHT, padding: c.pad, position: "relative" }, children: [
|
|
262
|
+
/* @__PURE__ */ jsx("div", { style: { display: "flex", alignItems: "flex-start", height: c.logoHeight }, children: /* @__PURE__ */ jsx("img", { src: logo.src, alt: logo.alt, width: logo.width * scale, height: logo.height * scale, style: { objectFit: "contain" } }) }),
|
|
263
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", marginTop: 32 }, children: [
|
|
264
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 16, height: 32, letterSpacing: 2, textTransform: "uppercase", overflow: "hidden", color: card.theme.muted || card.theme.text }, children: card.kicker || "" }),
|
|
265
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: fit.titlePx, fontWeight: 600, lineHeight: c.titleLineHeight, height: c.titleHeight, overflow: "hidden" }, children: fit.title })
|
|
266
|
+
] }),
|
|
267
|
+
/* @__PURE__ */ jsx("div", { style: { position: "absolute", display: "flex", bottom: c.pad, left: c.pad, width: panelWidth - c.pad * 2, fontSize: 16, height: 20, overflow: "hidden", color: card.theme.muted || card.theme.text }, children: card.bar || "" })
|
|
268
|
+
] }),
|
|
269
|
+
photo ? /* @__PURE__ */ jsx("img", { src: card.photoUrl, alt: "", width: c.photoWidth, height: OG_HEIGHT, style: { flexShrink: 0, objectFit: "cover", objectPosition: "50% 50%" } }) : null
|
|
270
|
+
] });
|
|
271
|
+
}
|
|
215
272
|
async function renderCard(card, options) {
|
|
216
273
|
if (!card) return new Response("Not found", { status: 404 });
|
|
217
274
|
const { ImageResponse } = await import('next/og');
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { uuid } from './chunk-GJWI74ZZ.js';
|
|
3
|
+
import { identityStorageKeys, memoryIdentity } from './chunk-5IVD6G77.js';
|
|
4
|
+
import { analyticsPurposePermitted, subscribeMeasurementPolicy, measurementPolicySnapshot, serverMeasurementPolicySnapshot } from './chunk-FRY6PBT6.js';
|
|
5
|
+
import { useSyncExternalStore, useState, useEffect } from 'react';
|
|
6
|
+
|
|
7
|
+
function getOrCreateVisitorId() {
|
|
8
|
+
var _a;
|
|
9
|
+
if (typeof window === "undefined" || !analyticsPurposePermitted()) return "";
|
|
10
|
+
const keys = identityStorageKeys();
|
|
11
|
+
let stored = null;
|
|
12
|
+
try {
|
|
13
|
+
stored = window.localStorage.getItem(keys.visitor);
|
|
14
|
+
const visitorId = stored || uuid();
|
|
15
|
+
window.localStorage.setItem(keys.visitor, visitorId);
|
|
16
|
+
return visitorId;
|
|
17
|
+
} catch {
|
|
18
|
+
return (_a = memoryIdentity).visitorId || (_a.visitorId = stored || uuid());
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function getOrCreateSessionId(timeoutMinutes = 30) {
|
|
22
|
+
var _a;
|
|
23
|
+
if (typeof window === "undefined" || !analyticsPurposePermitted()) return "";
|
|
24
|
+
const keys = identityStorageKeys();
|
|
25
|
+
const now = Date.now();
|
|
26
|
+
const timeoutMs = timeoutMinutes * 60 * 1e3;
|
|
27
|
+
let existingSession = null;
|
|
28
|
+
try {
|
|
29
|
+
existingSession = window.sessionStorage.getItem(keys.session);
|
|
30
|
+
const lastActivity = window.sessionStorage.getItem(keys.time);
|
|
31
|
+
if (existingSession && lastActivity) {
|
|
32
|
+
const elapsed = now - parseInt(lastActivity, 10);
|
|
33
|
+
if (elapsed < timeoutMs) {
|
|
34
|
+
window.sessionStorage.setItem(keys.time, now.toString());
|
|
35
|
+
window.sessionStorage.setItem(keys.session, existingSession);
|
|
36
|
+
return existingSession;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const newSession = uuid();
|
|
40
|
+
window.sessionStorage.setItem(keys.session, newSession);
|
|
41
|
+
window.sessionStorage.setItem(keys.time, now.toString());
|
|
42
|
+
return newSession;
|
|
43
|
+
} catch {
|
|
44
|
+
return (_a = memoryIdentity).sessionId || (_a.sessionId = existingSession || uuid());
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function useSiteKitIdentity() {
|
|
48
|
+
const policy = useSyncExternalStore(subscribeMeasurementPolicy, measurementPolicySnapshot, serverMeasurementPolicySnapshot);
|
|
49
|
+
const [identity, setIdentity] = useState({ visitorId: "", sessionId: "" });
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
setIdentity({ visitorId: getOrCreateVisitorId(), sessionId: getOrCreateSessionId() });
|
|
52
|
+
}, [policy.collectionEpoch]);
|
|
53
|
+
return analyticsPurposePermitted() ? identity : { visitorId: "", sessionId: "" };
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export { getOrCreateSessionId, getOrCreateVisitorId, useSiteKitIdentity };
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
import { setFirstPartyIdentityScope } from './chunk-KQKUXIUD.js';
|
|
2
3
|
import { SITE_EDIT_PARAM } from './chunk-6G43IRWR.js';
|
|
3
|
-
import { publishSiteCredential } from './chunk-
|
|
4
|
-
import {
|
|
4
|
+
import { publishSiteCredential } from './chunk-2LBKIE2K.js';
|
|
5
|
+
import { ResonanceRuntime } from './chunk-AWLPFFPO.js';
|
|
6
|
+
import { FleetHeartbeat } from './chunk-XDH5B3PR.js';
|
|
5
7
|
import { useDeferredActivation } from './chunk-YC7ELZS3.js';
|
|
6
8
|
import { resolveSiteHost } from './chunk-FESKKJAS.js';
|
|
7
|
-
import { getOrCreateVisitorId, getOrCreateSessionId } from './chunk-
|
|
8
|
-
import { announceFrameReady, isPrivatePreview, isCrossOriginFrame } from './chunk-
|
|
9
|
-
import { SignalBridge } from './chunk-
|
|
10
|
-
import
|
|
9
|
+
import { getOrCreateVisitorId, getOrCreateSessionId } from './chunk-JT7GHHMV.js';
|
|
10
|
+
import { resolveAnalyticsTarget, announceFrameReady, isPrivatePreview, isCrossOriginFrame } from './chunk-7643MCD2.js';
|
|
11
|
+
import { SignalBridge } from './chunk-HJD6KXKH.js';
|
|
12
|
+
import { primeMeasurementPolicy, subscribeMeasurementPolicy, measurementPolicySnapshot, serverMeasurementPolicySnapshot, analyticsPurposePermitted } from './chunk-FRY6PBT6.js';
|
|
13
|
+
import React, { useSyncExternalStore, useState, useEffect, useRef, useCallback, Suspense } from 'react';
|
|
11
14
|
import dynamic from 'next/dynamic';
|
|
12
15
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
13
16
|
|
|
@@ -33,23 +36,23 @@ function startEditBridge() {
|
|
|
33
36
|
};
|
|
34
37
|
}
|
|
35
38
|
var LazyAnalyticsProvider = dynamic(
|
|
36
|
-
() => import('./AnalyticsProvider-
|
|
39
|
+
() => import('./AnalyticsProvider-X7JJN3QL.js').then((m) => ({ default: m.AnalyticsProvider })),
|
|
37
40
|
{ ssr: false }
|
|
38
41
|
);
|
|
39
42
|
var LazySiteChat = dynamic(
|
|
40
|
-
() => import('./SiteChat-
|
|
43
|
+
() => import('./SiteChat-3JLCEL2N.js').then((m) => ({ default: m.SiteChat })),
|
|
41
44
|
{ ssr: false }
|
|
42
45
|
);
|
|
43
46
|
var LazySitePopups = dynamic(
|
|
44
|
-
() => import('./SitePopups-
|
|
47
|
+
() => import('./SitePopups-ZGHQNGGH.js').then((m) => ({ default: m.SitePopups })),
|
|
45
48
|
{ ssr: false }
|
|
46
49
|
);
|
|
47
50
|
var LazySiteDesignReporter = dynamic(
|
|
48
|
-
() => import('./SiteDesignReporter-
|
|
51
|
+
() => import('./SiteDesignReporter-6CCO645E.js').then((m) => ({ default: m.SiteDesignReporter })),
|
|
49
52
|
{ ssr: false }
|
|
50
53
|
);
|
|
51
54
|
var LazySitemapSync = dynamic(
|
|
52
|
-
() => import('./SitemapSync-
|
|
55
|
+
() => import('./SitemapSync-5LSYCBKS.js').then((m) => ({ default: m.SitemapSync })),
|
|
53
56
|
{ ssr: false }
|
|
54
57
|
);
|
|
55
58
|
function SiteKitClientProviders({
|
|
@@ -68,14 +71,28 @@ function SiteKitClientProviders({
|
|
|
68
71
|
defer = true,
|
|
69
72
|
debug = false
|
|
70
73
|
}) {
|
|
74
|
+
primeMeasurementPolicy();
|
|
71
75
|
const modulesReady = useDeferredActivation(defer);
|
|
72
76
|
const analyticsConfig = typeof analytics === "object" ? analytics : {};
|
|
73
77
|
const site = resolveSiteHost(analyticsConfig.site);
|
|
74
78
|
publishSiteCredential({ apiKey, apiUrl, site, debug });
|
|
75
79
|
const designConfig = design === false ? false : typeof design === "object" ? design : {};
|
|
76
80
|
if (typeof window !== "undefined") window.__SITE_KIT_DESIGN__ = designConfig;
|
|
77
|
-
const
|
|
78
|
-
const [
|
|
81
|
+
const policy = useSyncExternalStore(subscribeMeasurementPolicy, measurementPolicySnapshot, serverMeasurementPolicySnapshot);
|
|
82
|
+
const [visitorId, setVisitorId] = useState("");
|
|
83
|
+
const [sessionId, setSessionId] = useState("");
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
setFirstPartyIdentityScope(projectId, site);
|
|
86
|
+
}, [projectId, site]);
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
if (!(modulesReady || signal) || !analyticsPurposePermitted() || !resolveAnalyticsTarget({ apiKey, apiUrl, allowInFrame: analyticsConfig.allowInFrame, allowLocalhost: analyticsConfig.allowLocalhost })) {
|
|
89
|
+
setVisitorId("");
|
|
90
|
+
setSessionId("");
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
setVisitorId(getOrCreateVisitorId());
|
|
94
|
+
setSessionId(getOrCreateSessionId());
|
|
95
|
+
}, [modulesReady, signal, apiKey, apiUrl, policy.collectionEpoch, analyticsConfig.allowInFrame, analyticsConfig.allowLocalhost]);
|
|
79
96
|
const pageMetadataRef = useRef(null);
|
|
80
97
|
const onPageMetadata = useCallback((metadata) => {
|
|
81
98
|
pageMetadataRef.current = metadata;
|
|
@@ -84,6 +101,7 @@ function SiteKitClientProviders({
|
|
|
84
101
|
useEffect(() => startEditBridge(), []);
|
|
85
102
|
const siblings = [];
|
|
86
103
|
if (isPrivatePreview()) return /* @__PURE__ */ jsx(Fragment, { children });
|
|
104
|
+
siblings.push(/* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(ResonanceRuntime, { site, apiUrl, apiKey }) }, "sk-resonance"));
|
|
87
105
|
if (signal) {
|
|
88
106
|
const signalConfig = typeof signal === "object" ? signal : {};
|
|
89
107
|
siblings.push(
|