@c15t/react 2.0.0-rc.8 → 2.0.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.
Files changed (45) hide show
  1. package/README.md +3 -3
  2. package/dist/components/consent-banner/consent-banner.cjs +1 -1
  3. package/dist/components/consent-banner/consent-banner.js +1 -1
  4. package/dist/components/consent-dialog/atoms/card.cjs +1 -1
  5. package/dist/components/consent-dialog/atoms/card.js +1 -1
  6. package/dist/components/consent-widget/atoms/root.cjs +1 -1
  7. package/dist/components/consent-widget/atoms/root.js +1 -1
  8. package/dist/components/consent-widget/consent-widget.cjs +1 -1
  9. package/dist/components/consent-widget/consent-widget.js +1 -1
  10. package/dist/components/iab-consent-banner/iab-consent-banner.cjs +1 -1
  11. package/dist/components/iab-consent-banner/iab-consent-banner.js +1 -1
  12. package/dist/components/iab-consent-dialog/iab-consent-dialog.cjs +1 -1
  13. package/dist/components/iab-consent-dialog/iab-consent-dialog.js +1 -1
  14. package/dist/components/shared/ui/branding.cjs +1 -1
  15. package/dist/components/shared/ui/branding.js +1 -1
  16. package/dist/version.cjs +1 -1
  17. package/dist/version.js +1 -1
  18. package/dist-types/components/consent-dialog/atoms/card.d.ts +1 -0
  19. package/dist-types/components/consent-dialog/index.d.ts +2 -1
  20. package/dist-types/components/consent-widget/atoms/root.d.ts +0 -5
  21. package/dist-types/components/shared/ui/branding.d.ts +5 -1
  22. package/dist-types/types/consent-manager.d.ts +2 -2
  23. package/dist-types/version.d.ts +1 -1
  24. package/docs/building-headless-components.md +118 -16
  25. package/docs/components/consent-banner.md +1 -30
  26. package/docs/components/consent-dialog.md +4 -3
  27. package/docs/components/consent-manager-provider.md +11 -11
  28. package/docs/components/consent-widget.md +1 -28
  29. package/docs/concepts/client-modes.md +1 -1
  30. package/docs/concepts/policy-packs.md +1 -1
  31. package/docs/hooks/use-consent-manager/overview.md +18 -2
  32. package/docs/iab/consent-banner.md +6 -4
  33. package/docs/iab/consent-dialog.md +6 -4
  34. package/docs/iab/overview.md +12 -11
  35. package/docs/iab/use-gvl-data.md +9 -197
  36. package/docs/internationalization.md +1 -1
  37. package/docs/optimization.md +35 -1
  38. package/docs/policy-packs.md +1 -1
  39. package/docs/quickstart.md +11 -8
  40. package/docs/styling/color-scheme.md +1 -1
  41. package/docs/styling/css-variables.md +1 -1
  42. package/docs/styling/overview.md +11 -4
  43. package/docs/styling/slots.md +7 -3
  44. package/docs/styling/tokens.md +3 -1
  45. package/package.json +7 -8
package/README.md CHANGED
@@ -11,7 +11,7 @@
11
11
 
12
12
  [![GitHub stars](https://img.shields.io/github/stars/c15t/c15t?style=flat-square)](https://github.com/c15t/c15t)
13
13
  [![CI](https://img.shields.io/github/actions/workflow/status/c15t/c15t/ci.yml?style=flat-square)](https://github.com/c15t/c15t/actions/workflows/ci.yml)
14
- [![License](https://img.shields.io/badge/license-GPL--3.0-blue.svg?style=flat-square)](https://github.com/c15t/c15t/blob/main/LICENSE.md)
14
+ [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg?style=flat-square)](https://github.com/c15t/c15t/blob/main/LICENSE.md)
15
15
  [![Discord](https://img.shields.io/discord/1312171102268690493?style=flat-square)](https://c15t.link/discord)
16
16
  [![npm version](https://img.shields.io/npm/v/%40c15t%2Freact?style=flat-square)](https://www.npmjs.com/package/@c15t/react)
17
17
  [![Top Language](https://img.shields.io/github/languages/top/c15t/c15t?style=flat-square)](https://github.com/c15t/c15t)
@@ -131,8 +131,8 @@ Our preference is that you make use of GitHub's private vulnerability reporting
131
131
 
132
132
  ## License
133
133
 
134
- [GNU General Public License v3.0](https://github.com/c15t/c15t/blob/main/LICENSE.md)
134
+ [Apache License 2.0](https://github.com/c15t/c15t/blob/main/LICENSE.md)
135
135
 
136
136
  ---
137
137
 
138
- **Built with ❤️ by the [consent.io](https://www.consent.io?utm_source=github&utm_medium=repopage_%40c15t%2Freact) team**
138
+ **Built by [Inth](https://inth.com?utm_source=github&utm_medium=repopage_%40c15t%2Freact)**
@@ -1 +1 @@
1
- "use strict";const __rslib_import_meta_url__="u"<typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(n,{a:n}),n},__webpack_require__.d=(e,n)=>{for(var t in n)__webpack_require__.o(n,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},__webpack_require__.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),__webpack_require__.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{ConsentBanner:()=>ConsentBanner});const jsx_runtime_namespaceObject=require("react/jsx-runtime"),consent_banner_module_js_namespaceObject=require("@c15t/ui/styles/components/consent-banner.module.js");var consent_banner_module_js_default=__webpack_require__.n(consent_banner_module_js_namespaceObject);const utils_namespaceObject=require("@c15t/ui/utils"),external_react_namespaceObject=require("react"),branding_cjs_namespaceObject=require("../shared/ui/branding.cjs"),use_component_config_cjs_namespaceObject=require("../../hooks/use-component-config.cjs"),use_consent_manager_cjs_namespaceObject=require("../../hooks/use-consent-manager.cjs"),use_headless_consent_ui_cjs_namespaceObject=require("../../hooks/use-headless-consent-ui.cjs"),use_translations_cjs_namespaceObject=require("../../hooks/use-translations.cjs"),cn_cjs_namespaceObject=require("../../utils/cn.cjs"),root_cjs_namespaceObject=require("./atoms/root.cjs"),external_components_cjs_namespaceObject=require("./components.cjs"),external_error_boundary_cjs_namespaceObject=require("./error-boundary.cjs"),DEFAULT_LAYOUT=[["reject","accept"],"customize"],ConsentBanner=({noStyle:e,disableAnimation:n,scrollLock:t,trapFocus:s=!0,title:a,description:c,rejectButtonText:r,customizeButtonText:_,acceptButtonText:o,legalLinks:i,hideBranding:u=!1,layout:l,direction:j,primaryButton:m="customize",models:p,uiSource:b})=>{let{cookieBanner:d}=(0,use_translations_cjs_namespaceObject.useTranslations)(),{banner:x}=(0,use_headless_consent_ui_cjs_namespaceObject.useHeadlessConsentUI)(),{policyBanner:O}=(0,use_consent_manager_cjs_namespaceObject.useConsentManager)(),h=t??O.scrollLock??!1,f=(0,use_component_config_cjs_namespaceObject.useComponentConfig)({noStyle:e,disableAnimation:n,scrollLock:h,trapFocus:s}),k=new Set(x.orderedActions),y=x.primaryActions.length>0?x.primaryActions:m,g=l??((x.layout?.length??0)>0?x.actionGroups:DEFAULT_LAYOUT),w=j??x.direction??"row",B=g.map(e=>Array.isArray(e)?e.filter(e=>k.has(e)):k.has(e)?[e]:[]).filter(e=>e.length>0),q=(0,utils_namespaceObject.shouldFillPolicyActions)({uiProfile:x.uiProfile,actionGroups:B,direction:w}),C=(e,n)=>{if(!k.has(e))return null;let t=Array.isArray(y)?y.includes(e):e===y;switch(e){case"reject":return(0,jsx_runtime_namespaceObject.jsx)(external_components_cjs_namespaceObject.ConsentBannerRejectButton,{consentAction:"reject",isPrimary:t,className:n,"data-testid":"consent-banner-reject-button",children:r});case"accept":return(0,jsx_runtime_namespaceObject.jsx)(external_components_cjs_namespaceObject.ConsentBannerAcceptButton,{consentAction:"accept",isPrimary:t,className:n,"data-testid":"consent-banner-accept-button",children:o});case"customize":return(0,jsx_runtime_namespaceObject.jsx)(external_components_cjs_namespaceObject.ConsentBannerCustomizeButton,{consentAction:"customize",isPrimary:t,className:n,"data-testid":"consent-banner-customize-button",children:_});default:throw Error(`Unhandled consent banner button type: ${e}`)}};return(0,jsx_runtime_namespaceObject.jsx)(external_error_boundary_cjs_namespaceObject.ErrorBoundary,{fallback:(0,jsx_runtime_namespaceObject.jsx)("div",{children:"Something went wrong with the Consent Banner."}),children:(0,jsx_runtime_namespaceObject.jsx)(root_cjs_namespaceObject.ConsentBannerRoot,{...f,models:p,uiSource:b,children:(0,jsx_runtime_namespaceObject.jsxs)("div",{className:consent_banner_module_js_default().cardShell,children:[(0,jsx_runtime_namespaceObject.jsx)(branding_cjs_namespaceObject.BrandingLink,{hideBranding:u,variant:"banner-tag","data-testid":"consent-banner-branding"}),(0,jsx_runtime_namespaceObject.jsxs)(external_components_cjs_namespaceObject.ConsentBannerCard,{"aria-label":d.title,children:[(0,jsx_runtime_namespaceObject.jsxs)(external_components_cjs_namespaceObject.ConsentBannerHeader,{children:[(0,jsx_runtime_namespaceObject.jsx)(external_components_cjs_namespaceObject.ConsentBannerTitle,{children:a}),(0,jsx_runtime_namespaceObject.jsx)(external_components_cjs_namespaceObject.ConsentBannerDescription,{legalLinks:i,children:c})]}),(0,jsx_runtime_namespaceObject.jsx)(external_components_cjs_namespaceObject.ConsentBannerFooter,{className:(0,cn_cjs_namespaceObject.cnExt)(q&&consent_banner_module_js_default().footerFill,"column"===w&&consent_banner_module_js_default().footerColumn),children:g.map((e,n)=>{if(Array.isArray(e)){let t=e.filter(e=>k.has(e));if(0===t.length)return null;let s=e.join("-");return(0,jsx_runtime_namespaceObject.jsx)(external_components_cjs_namespaceObject.ConsentBannerFooterSubGroup,{className:(0,cn_cjs_namespaceObject.cnExt)(q&&consent_banner_module_js_default().footerSubGroupFill,"column"===w&&consent_banner_module_js_default().footerSubGroupColumn),children:t.map(e=>(0,jsx_runtime_namespaceObject.jsx)(external_react_namespaceObject.Fragment,{children:C(e,q?consent_banner_module_js_default().actionButtonFill:void 0)},e))},s?`group-${s}`:`group-${n}`)}return k.has(e)?(0,jsx_runtime_namespaceObject.jsx)(external_react_namespaceObject.Fragment,{children:C(e,q?consent_banner_module_js_default().actionButtonFill:void 0)},e):null})})]})]})})})};for(var __rspack_i in exports.ConsentBanner=__webpack_exports__.ConsentBanner,__webpack_exports__)-1===["ConsentBanner"].indexOf(__rspack_i)&&(exports[__rspack_i]=__webpack_exports__[__rspack_i]);Object.defineProperty(exports,"__esModule",{value:!0});
1
+ "use strict";const __rslib_import_meta_url__="u"<typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(n,{a:n}),n},__webpack_require__.d=(e,n)=>{for(var t in n)__webpack_require__.o(n,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},__webpack_require__.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),__webpack_require__.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{ConsentBanner:()=>ConsentBanner});const jsx_runtime_namespaceObject=require("react/jsx-runtime"),consent_banner_module_js_namespaceObject=require("@c15t/ui/styles/components/consent-banner.module.js");var consent_banner_module_js_default=__webpack_require__.n(consent_banner_module_js_namespaceObject);const utils_namespaceObject=require("@c15t/ui/utils"),external_react_namespaceObject=require("react"),branding_cjs_namespaceObject=require("../shared/ui/branding.cjs"),use_component_config_cjs_namespaceObject=require("../../hooks/use-component-config.cjs"),use_consent_manager_cjs_namespaceObject=require("../../hooks/use-consent-manager.cjs"),use_headless_consent_ui_cjs_namespaceObject=require("../../hooks/use-headless-consent-ui.cjs"),use_translations_cjs_namespaceObject=require("../../hooks/use-translations.cjs"),cn_cjs_namespaceObject=require("../../utils/cn.cjs"),root_cjs_namespaceObject=require("./atoms/root.cjs"),external_components_cjs_namespaceObject=require("./components.cjs"),external_error_boundary_cjs_namespaceObject=require("./error-boundary.cjs"),DEFAULT_LAYOUT=[["reject","accept"],"customize"],ConsentBanner=({noStyle:e,disableAnimation:n,scrollLock:t,trapFocus:s=!0,title:a,description:c,rejectButtonText:r,customizeButtonText:_,acceptButtonText:o,legalLinks:i,hideBranding:u=!1,layout:l,direction:j,primaryButton:m="customize",models:p,uiSource:b})=>{let{cookieBanner:d}=(0,use_translations_cjs_namespaceObject.useTranslations)(),{banner:x}=(0,use_headless_consent_ui_cjs_namespaceObject.useHeadlessConsentUI)(),{policyBanner:O}=(0,use_consent_manager_cjs_namespaceObject.useConsentManager)(),h=t??O.scrollLock??!1,f=(0,use_component_config_cjs_namespaceObject.useComponentConfig)({noStyle:e,disableAnimation:n,scrollLock:h,trapFocus:s}),y=new Set(x.orderedActions),g=x.primaryActions.length>0?x.primaryActions:m,k=l??((x.layout?.length??0)>0?x.actionGroups:DEFAULT_LAYOUT),w=j??x.direction??"row",B=k.map(e=>Array.isArray(e)?e.filter(e=>y.has(e)):y.has(e)?[e]:[]).filter(e=>e.length>0),q=(0,utils_namespaceObject.shouldFillPolicyActions)({uiProfile:x.uiProfile,actionGroups:B,direction:w}),C=(e,n)=>{if(!y.has(e))return null;let t=Array.isArray(g)?g.includes(e):e===g;switch(e){case"reject":return(0,jsx_runtime_namespaceObject.jsx)(external_components_cjs_namespaceObject.ConsentBannerRejectButton,{consentAction:"reject",isPrimary:t,className:n,"data-testid":"consent-banner-reject-button",children:r});case"accept":return(0,jsx_runtime_namespaceObject.jsx)(external_components_cjs_namespaceObject.ConsentBannerAcceptButton,{consentAction:"accept",isPrimary:t,className:n,"data-testid":"consent-banner-accept-button",children:o});case"customize":return(0,jsx_runtime_namespaceObject.jsx)(external_components_cjs_namespaceObject.ConsentBannerCustomizeButton,{consentAction:"customize",isPrimary:t,className:n,"data-testid":"consent-banner-customize-button",children:_});default:throw Error(`Unhandled consent banner button type: ${e}`)}};return(0,jsx_runtime_namespaceObject.jsx)(external_error_boundary_cjs_namespaceObject.ErrorBoundary,{fallback:(0,jsx_runtime_namespaceObject.jsx)("div",{children:"Something went wrong with the Consent Banner."}),children:(0,jsx_runtime_namespaceObject.jsx)(root_cjs_namespaceObject.ConsentBannerRoot,{...f,models:p,uiSource:b,children:(0,jsx_runtime_namespaceObject.jsxs)("div",{className:consent_banner_module_js_default().cardShell,children:[(0,jsx_runtime_namespaceObject.jsx)(branding_cjs_namespaceObject.BrandingLink,{hideBranding:u,variant:"banner-tag",themeKey:"consentBannerTag","data-testid":"consent-banner-branding"}),(0,jsx_runtime_namespaceObject.jsxs)(external_components_cjs_namespaceObject.ConsentBannerCard,{"aria-label":d.title,children:[(0,jsx_runtime_namespaceObject.jsxs)(external_components_cjs_namespaceObject.ConsentBannerHeader,{children:[(0,jsx_runtime_namespaceObject.jsx)(external_components_cjs_namespaceObject.ConsentBannerTitle,{children:a}),(0,jsx_runtime_namespaceObject.jsx)(external_components_cjs_namespaceObject.ConsentBannerDescription,{legalLinks:i,children:c})]}),(0,jsx_runtime_namespaceObject.jsx)(external_components_cjs_namespaceObject.ConsentBannerFooter,{className:(0,cn_cjs_namespaceObject.cnExt)(q&&consent_banner_module_js_default().footerFill,"column"===w&&consent_banner_module_js_default().footerColumn),children:k.map((e,n)=>{if(Array.isArray(e)){let t=e.filter(e=>y.has(e));if(0===t.length)return null;let s=e.join("-");return(0,jsx_runtime_namespaceObject.jsx)(external_components_cjs_namespaceObject.ConsentBannerFooterSubGroup,{className:(0,cn_cjs_namespaceObject.cnExt)(q&&consent_banner_module_js_default().footerSubGroupFill,"column"===w&&consent_banner_module_js_default().footerSubGroupColumn),children:t.map(e=>(0,jsx_runtime_namespaceObject.jsx)(external_react_namespaceObject.Fragment,{children:C(e,q?consent_banner_module_js_default().actionButtonFill:void 0)},e))},s?`group-${s}`:`group-${n}`)}return y.has(e)?(0,jsx_runtime_namespaceObject.jsx)(external_react_namespaceObject.Fragment,{children:C(e,q?consent_banner_module_js_default().actionButtonFill:void 0)},e):null})})]})]})})})};for(var __rspack_i in exports.ConsentBanner=__webpack_exports__.ConsentBanner,__webpack_exports__)-1===["ConsentBanner"].indexOf(__rspack_i)&&(exports[__rspack_i]=__webpack_exports__[__rspack_i]);Object.defineProperty(exports,"__esModule",{value:!0});
@@ -1 +1 @@
1
- import{jsx as r,jsxs as e}from"react/jsx-runtime";import t from"@c15t/ui/styles/components/consent-banner.module.js";import{shouldFillPolicyActions as n}from"@c15t/ui/utils";import{Fragment as o}from"react";import{BrandingLink as i}from"../shared/ui/branding.js";import{useComponentConfig as s}from"../../hooks/use-component-config.js";import{useConsentManager as a}from"../../hooks/use-consent-manager.js";import{useHeadlessConsentUI as c}from"../../hooks/use-headless-consent-ui.js";import{useTranslations as l}from"../../hooks/use-translations.js";import{cnExt as m}from"../../utils/cn.js";import{ConsentBannerRoot as u}from"./atoms/root.js";import{ConsentBannerAcceptButton as d,ConsentBannerCard as h,ConsentBannerCustomizeButton as p,ConsentBannerDescription as f,ConsentBannerFooter as b,ConsentBannerFooterSubGroup as y,ConsentBannerHeader as j,ConsentBannerRejectButton as g,ConsentBannerTitle as A}from"./components.js";import{ErrorBoundary as k}from"./error-boundary.js";let S=[["reject","accept"],"customize"],w=({noStyle:w,disableAnimation:B,scrollLock:F,trapFocus:N=!0,title:v,description:z,rejectButtonText:P,customizeButtonText:C,acceptButtonText:G,legalLinks:L,hideBranding:$=!1,layout:x,direction:E,primaryButton:U="customize",models:q,uiSource:D})=>{let{cookieBanner:H}=l(),{banner:I}=c(),{policyBanner:J}=a(),K=s({noStyle:w,disableAnimation:B,scrollLock:F??J.scrollLock??!1,trapFocus:N}),M=new Set(I.orderedActions),O=I.primaryActions.length>0?I.primaryActions:U,Q=x??((I.layout?.length??0)>0?I.actionGroups:S),R=E??I.direction??"row",T=Q.map(r=>Array.isArray(r)?r.filter(r=>M.has(r)):M.has(r)?[r]:[]).filter(r=>r.length>0),V=n({uiProfile:I.uiProfile,actionGroups:T,direction:R}),W=(e,t)=>{if(!M.has(e))return null;let n=Array.isArray(O)?O.includes(e):e===O;switch(e){case"reject":return r(g,{consentAction:"reject",isPrimary:n,className:t,"data-testid":"consent-banner-reject-button",children:P});case"accept":return r(d,{consentAction:"accept",isPrimary:n,className:t,"data-testid":"consent-banner-accept-button",children:G});case"customize":return r(p,{consentAction:"customize",isPrimary:n,className:t,"data-testid":"consent-banner-customize-button",children:C});default:throw Error(`Unhandled consent banner button type: ${e}`)}};return r(k,{fallback:r("div",{children:"Something went wrong with the Consent Banner."}),children:r(u,{...K,models:q,uiSource:D,children:e("div",{className:t.cardShell,children:[r(i,{hideBranding:$,variant:"banner-tag","data-testid":"consent-banner-branding"}),e(h,{"aria-label":H.title,children:[e(j,{children:[r(A,{children:v}),r(f,{legalLinks:L,children:z})]}),r(b,{className:m(V&&t.footerFill,"column"===R&&t.footerColumn),children:Q.map((e,n)=>{if(Array.isArray(e)){let i=e.filter(r=>M.has(r));if(0===i.length)return null;let s=e.join("-");return r(y,{className:m(V&&t.footerSubGroupFill,"column"===R&&t.footerSubGroupColumn),children:i.map(e=>r(o,{children:W(e,V?t.actionButtonFill:void 0)},e))},s?`group-${s}`:`group-${n}`)}return M.has(e)?r(o,{children:W(e,V?t.actionButtonFill:void 0)},e):null})})]})]})})})};export{w as ConsentBanner};
1
+ import{jsx as r,jsxs as e}from"react/jsx-runtime";import n from"@c15t/ui/styles/components/consent-banner.module.js";import{shouldFillPolicyActions as t}from"@c15t/ui/utils";import{Fragment as o}from"react";import{BrandingLink as i}from"../shared/ui/branding.js";import{useComponentConfig as s}from"../../hooks/use-component-config.js";import{useConsentManager as a}from"../../hooks/use-consent-manager.js";import{useHeadlessConsentUI as c}from"../../hooks/use-headless-consent-ui.js";import{useTranslations as l}from"../../hooks/use-translations.js";import{cnExt as m}from"../../utils/cn.js";import{ConsentBannerRoot as u}from"./atoms/root.js";import{ConsentBannerAcceptButton as d,ConsentBannerCard as h,ConsentBannerCustomizeButton as p,ConsentBannerDescription as f,ConsentBannerFooter as b,ConsentBannerFooterSubGroup as y,ConsentBannerHeader as g,ConsentBannerRejectButton as j,ConsentBannerTitle as A}from"./components.js";import{ErrorBoundary as k}from"./error-boundary.js";let S=[["reject","accept"],"customize"],w=({noStyle:w,disableAnimation:B,scrollLock:F,trapFocus:N=!0,title:v,description:z,rejectButtonText:P,customizeButtonText:C,acceptButtonText:G,legalLinks:L,hideBranding:$=!1,layout:x,direction:E,primaryButton:K="customize",models:T,uiSource:U})=>{let{cookieBanner:q}=l(),{banner:D}=c(),{policyBanner:H}=a(),I=s({noStyle:w,disableAnimation:B,scrollLock:F??H.scrollLock??!1,trapFocus:N}),J=new Set(D.orderedActions),M=D.primaryActions.length>0?D.primaryActions:K,O=x??((D.layout?.length??0)>0?D.actionGroups:S),Q=E??D.direction??"row",R=O.map(r=>Array.isArray(r)?r.filter(r=>J.has(r)):J.has(r)?[r]:[]).filter(r=>r.length>0),V=t({uiProfile:D.uiProfile,actionGroups:R,direction:Q}),W=(e,n)=>{if(!J.has(e))return null;let t=Array.isArray(M)?M.includes(e):e===M;switch(e){case"reject":return r(j,{consentAction:"reject",isPrimary:t,className:n,"data-testid":"consent-banner-reject-button",children:P});case"accept":return r(d,{consentAction:"accept",isPrimary:t,className:n,"data-testid":"consent-banner-accept-button",children:G});case"customize":return r(p,{consentAction:"customize",isPrimary:t,className:n,"data-testid":"consent-banner-customize-button",children:C});default:throw Error(`Unhandled consent banner button type: ${e}`)}};return r(k,{fallback:r("div",{children:"Something went wrong with the Consent Banner."}),children:r(u,{...I,models:T,uiSource:U,children:e("div",{className:n.cardShell,children:[r(i,{hideBranding:$,variant:"banner-tag",themeKey:"consentBannerTag","data-testid":"consent-banner-branding"}),e(h,{"aria-label":q.title,children:[e(g,{children:[r(A,{children:v}),r(f,{legalLinks:L,children:z})]}),r(b,{className:m(V&&n.footerFill,"column"===Q&&n.footerColumn),children:O.map((e,t)=>{if(Array.isArray(e)){let i=e.filter(r=>J.has(r));if(0===i.length)return null;let s=e.join("-");return r(y,{className:m(V&&n.footerSubGroupFill,"column"===Q&&n.footerSubGroupColumn),children:i.map(e=>r(o,{children:W(e,V?n.actionButtonFill:void 0)},e))},s?`group-${s}`:`group-${t}`)}return J.has(e)?r(o,{children:W(e,V?n.actionButtonFill:void 0)},e):null})})]})]})})})};export{w as ConsentBanner};
@@ -1 +1 @@
1
- "use strict";const __rslib_import_meta_url__="u"<typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Card:()=>Card,ConsentDialogHeaderDescription:()=>ConsentDialogHeaderDescription,ConsentDialogHeaderTitle:()=>ConsentDialogHeaderTitle,Content:()=>Content,Header:()=>Header,ConsentDialogHeader:()=>ConsentDialogHeader,ConsentDialogCard:()=>ConsentDialogCard,ConsentDialogFooter:()=>ConsentDialogFooter,Footer:()=>Footer,HeaderTitle:()=>HeaderTitle,HeaderDescription:()=>HeaderDescription,ConsentDialogContent:()=>ConsentDialogContent,ConsentCustomizationCard:()=>ConsentCustomizationCard,Branding:()=>Branding});const jsx_runtime_namespaceObject=require("react/jsx-runtime"),consent_dialog_module_js_namespaceObject=require("@c15t/ui/styles/components/consent-dialog.module.js");var consent_dialog_module_js_default=__webpack_require__.n(consent_dialog_module_js_namespaceObject);const external_react_namespaceObject=require("react"),consent_widget_cjs_namespaceObject=require("../../consent-widget/consent-widget.cjs"),box_cjs_namespaceObject=require("../../shared/primitives/box.cjs"),index_cjs_namespaceObject=require("../../shared/primitives/legal-links/index.cjs"),branding_cjs_namespaceObject=require("../../shared/ui/branding.cjs"),use_translations_cjs_namespaceObject=require("../../../hooks/use-translations.cjs"),cn_cjs_namespaceObject=require("../../../utils/cn.cjs"),ConsentDialogCard=(0,external_react_namespaceObject.forwardRef)(({children:e,...t},n)=>(0,jsx_runtime_namespaceObject.jsx)(box_cjs_namespaceObject.Box,{ref:n,baseClassName:consent_dialog_module_js_default().card,...t,themeKey:"consentDialogCard","data-testid":"consent-dialog-card",children:e})),ConsentDialogHeader=(0,external_react_namespaceObject.forwardRef)(({children:e,...t},n)=>(0,jsx_runtime_namespaceObject.jsx)(box_cjs_namespaceObject.Box,{ref:n,baseClassName:consent_dialog_module_js_default().header,...t,themeKey:"consentDialogHeader","data-testid":"consent-dialog-header",children:e})),ConsentDialogHeaderTitle=(0,external_react_namespaceObject.forwardRef)(({children:e,...t},n)=>{let{consentManagerDialog:a}=(0,use_translations_cjs_namespaceObject.useTranslations)();return(0,jsx_runtime_namespaceObject.jsx)(box_cjs_namespaceObject.Box,{ref:n,baseClassName:consent_dialog_module_js_default().title,themeKey:"consentDialogTitle",...t,id:"consent-dialog-title","data-testid":"consent-dialog-title",children:e??a.title})}),ConsentDialogHeaderDescription=(0,external_react_namespaceObject.forwardRef)(({children:e,legalLinks:t,asChild:n,...a},o)=>{let{consentManagerDialog:s}=(0,use_translations_cjs_namespaceObject.useTranslations)();return n?(0,jsx_runtime_namespaceObject.jsx)(box_cjs_namespaceObject.Box,{ref:o,baseClassName:consent_dialog_module_js_default().description,themeKey:"consentDialogDescription",asChild:n,...a,children:e??s.description}):(0,jsx_runtime_namespaceObject.jsxs)(box_cjs_namespaceObject.Box,{ref:o,baseClassName:consent_dialog_module_js_default().description,themeKey:"consentDialogDescription",asChild:n,...a,"data-testid":"consent-dialog-description",children:[e??s.description,(0,jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.InlineLegalLinks,{links:t,themeKey:"consentDialogContent",testIdPrefix:"consent-dialog-legal-link"})]})}),ConsentDialogContent=(0,external_react_namespaceObject.forwardRef)(({children:e,...t},n)=>(0,jsx_runtime_namespaceObject.jsx)(box_cjs_namespaceObject.Box,{ref:n,baseClassName:consent_dialog_module_js_default().content,themeKey:"consentDialogContent","data-testid":"consent-dialog-content",...t,children:e})),ConsentDialogFooter=(0,external_react_namespaceObject.forwardRef)(({children:e,themeKey:t,hideBranding:n,"data-testid":a,...o},s)=>(0,jsx_runtime_namespaceObject.jsx)(box_cjs_namespaceObject.Box,{ref:s,baseClassName:(0,cn_cjs_namespaceObject.cnExt)(consent_dialog_module_js_default().footer,null==e&&consent_dialog_module_js_default().brandingFooter),"data-testid":a??"consent-dialog-footer",...o,themeKey:t??"consentDialogFooter",children:e??(0,jsx_runtime_namespaceObject.jsx)(Branding,{hideBranding:n??!1,variant:"dialog-tag","data-testid":"consent-dialog-branding"})}));function Branding(e){return(0,jsx_runtime_namespaceObject.jsx)(branding_cjs_namespaceObject.BrandingLink,{...e})}const ConsentCustomizationCard=({noStyle:e,legalLinks:t,hideBranding:n})=>(0,jsx_runtime_namespaceObject.jsxs)(ConsentDialogCard,{children:[(0,jsx_runtime_namespaceObject.jsxs)(ConsentDialogHeader,{children:[(0,jsx_runtime_namespaceObject.jsx)(ConsentDialogHeaderTitle,{}),(0,jsx_runtime_namespaceObject.jsx)(ConsentDialogHeaderDescription,{legalLinks:t})]}),(0,jsx_runtime_namespaceObject.jsx)(ConsentDialogContent,{children:(0,jsx_runtime_namespaceObject.jsx)(consent_widget_cjs_namespaceObject.ConsentWidget,{hideBranding:!0,noStyle:e,useProvider:!0})}),(0,jsx_runtime_namespaceObject.jsx)(ConsentDialogFooter,{hideBranding:n})]}),Card=ConsentDialogCard,Header=ConsentDialogHeader,HeaderTitle=ConsentDialogHeaderTitle,HeaderDescription=ConsentDialogHeaderDescription,Content=ConsentDialogContent,Footer=ConsentDialogFooter;for(var __rspack_i in exports.Branding=__webpack_exports__.Branding,exports.Card=__webpack_exports__.Card,exports.ConsentCustomizationCard=__webpack_exports__.ConsentCustomizationCard,exports.ConsentDialogCard=__webpack_exports__.ConsentDialogCard,exports.ConsentDialogContent=__webpack_exports__.ConsentDialogContent,exports.ConsentDialogFooter=__webpack_exports__.ConsentDialogFooter,exports.ConsentDialogHeader=__webpack_exports__.ConsentDialogHeader,exports.ConsentDialogHeaderDescription=__webpack_exports__.ConsentDialogHeaderDescription,exports.ConsentDialogHeaderTitle=__webpack_exports__.ConsentDialogHeaderTitle,exports.Content=__webpack_exports__.Content,exports.Footer=__webpack_exports__.Footer,exports.Header=__webpack_exports__.Header,exports.HeaderDescription=__webpack_exports__.HeaderDescription,exports.HeaderTitle=__webpack_exports__.HeaderTitle,__webpack_exports__)-1===["Branding","Card","ConsentCustomizationCard","ConsentDialogCard","ConsentDialogContent","ConsentDialogFooter","ConsentDialogHeader","ConsentDialogHeaderDescription","ConsentDialogHeaderTitle","Content","Footer","Header","HeaderDescription","HeaderTitle"].indexOf(__rspack_i)&&(exports[__rspack_i]=__webpack_exports__[__rspack_i]);Object.defineProperty(exports,"__esModule",{value:!0});
1
+ "use strict";const __rslib_import_meta_url__="u"<typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Card:()=>Card,ConsentDialogHeaderDescription:()=>ConsentDialogHeaderDescription,ConsentDialogHeaderTitle:()=>ConsentDialogHeaderTitle,Content:()=>Content,Header:()=>Header,ConsentDialogHeader:()=>ConsentDialogHeader,ConsentDialogCard:()=>ConsentDialogCard,ConsentDialogFooter:()=>ConsentDialogFooter,Footer:()=>Footer,HeaderTitle:()=>HeaderTitle,HeaderDescription:()=>HeaderDescription,ConsentDialogContent:()=>ConsentDialogContent,ConsentCustomizationCard:()=>ConsentCustomizationCard,Branding:()=>Branding});const jsx_runtime_namespaceObject=require("react/jsx-runtime"),consent_dialog_module_js_namespaceObject=require("@c15t/ui/styles/components/consent-dialog.module.js");var consent_dialog_module_js_default=__webpack_require__.n(consent_dialog_module_js_namespaceObject);const external_react_namespaceObject=require("react"),consent_widget_cjs_namespaceObject=require("../../consent-widget/consent-widget.cjs"),box_cjs_namespaceObject=require("../../shared/primitives/box.cjs"),index_cjs_namespaceObject=require("../../shared/primitives/legal-links/index.cjs"),branding_cjs_namespaceObject=require("../../shared/ui/branding.cjs"),use_translations_cjs_namespaceObject=require("../../../hooks/use-translations.cjs"),cn_cjs_namespaceObject=require("../../../utils/cn.cjs"),ConsentDialogCard=(0,external_react_namespaceObject.forwardRef)(({children:e,...t},n)=>(0,jsx_runtime_namespaceObject.jsx)(box_cjs_namespaceObject.Box,{ref:n,baseClassName:consent_dialog_module_js_default().card,...t,themeKey:"consentDialogCard","data-testid":"consent-dialog-card",children:e})),ConsentDialogHeader=(0,external_react_namespaceObject.forwardRef)(({children:e,...t},n)=>(0,jsx_runtime_namespaceObject.jsx)(box_cjs_namespaceObject.Box,{ref:n,baseClassName:consent_dialog_module_js_default().header,...t,themeKey:"consentDialogHeader","data-testid":"consent-dialog-header",children:e})),ConsentDialogHeaderTitle=(0,external_react_namespaceObject.forwardRef)(({children:e,...t},n)=>{let{consentManagerDialog:a}=(0,use_translations_cjs_namespaceObject.useTranslations)();return(0,jsx_runtime_namespaceObject.jsx)(box_cjs_namespaceObject.Box,{ref:n,baseClassName:consent_dialog_module_js_default().title,themeKey:"consentDialogTitle",...t,id:"consent-dialog-title","data-testid":"consent-dialog-title",children:e??a.title})}),ConsentDialogHeaderDescription=(0,external_react_namespaceObject.forwardRef)(({children:e,legalLinks:t,asChild:n,...a},o)=>{let{consentManagerDialog:s}=(0,use_translations_cjs_namespaceObject.useTranslations)();return n?(0,jsx_runtime_namespaceObject.jsx)(box_cjs_namespaceObject.Box,{ref:o,baseClassName:consent_dialog_module_js_default().description,themeKey:"consentDialogDescription",asChild:n,...a,children:e??s.description}):(0,jsx_runtime_namespaceObject.jsxs)(box_cjs_namespaceObject.Box,{ref:o,baseClassName:consent_dialog_module_js_default().description,themeKey:"consentDialogDescription",asChild:n,...a,"data-testid":"consent-dialog-description",children:[e??s.description,(0,jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.InlineLegalLinks,{links:t,themeKey:"consentDialogContent",testIdPrefix:"consent-dialog-legal-link"})]})}),ConsentDialogContent=(0,external_react_namespaceObject.forwardRef)(({children:e,...t},n)=>(0,jsx_runtime_namespaceObject.jsx)(box_cjs_namespaceObject.Box,{ref:n,baseClassName:consent_dialog_module_js_default().content,themeKey:"consentDialogContent","data-testid":"consent-dialog-content",...t,children:e})),ConsentDialogFooter=(0,external_react_namespaceObject.forwardRef)(({children:e,themeKey:t,hideBranding:n,"data-testid":a,...o},s)=>(0,jsx_runtime_namespaceObject.jsx)(box_cjs_namespaceObject.Box,{ref:s,baseClassName:(0,cn_cjs_namespaceObject.cnExt)(consent_dialog_module_js_default().footer,null==e&&!n&&consent_dialog_module_js_default().brandingFooter),"data-testid":a??"consent-dialog-footer",...o,themeKey:t??"consentDialogFooter",children:e??(0,jsx_runtime_namespaceObject.jsx)(Branding,{hideBranding:n??!1,variant:"dialog-tag",themeKey:"consentDialogTag","data-testid":"consent-dialog-branding"})}));function Branding(e){return(0,jsx_runtime_namespaceObject.jsx)(branding_cjs_namespaceObject.BrandingLink,{...e})}const ConsentCustomizationCard=({noStyle:e,legalLinks:t,hideBranding:n})=>(0,jsx_runtime_namespaceObject.jsxs)(ConsentDialogCard,{children:[(0,jsx_runtime_namespaceObject.jsxs)(ConsentDialogHeader,{children:[(0,jsx_runtime_namespaceObject.jsx)(ConsentDialogHeaderTitle,{}),(0,jsx_runtime_namespaceObject.jsx)(ConsentDialogHeaderDescription,{legalLinks:t})]}),(0,jsx_runtime_namespaceObject.jsx)(ConsentDialogContent,{children:(0,jsx_runtime_namespaceObject.jsx)(consent_widget_cjs_namespaceObject.ConsentWidget,{hideBranding:!0,noStyle:e,useProvider:!0})}),(0,jsx_runtime_namespaceObject.jsx)(Branding,{hideBranding:n??!1,variant:"dialog-tag",themeKey:"consentDialogTag","data-testid":"consent-dialog-branding"})]}),Card=ConsentDialogCard,Header=ConsentDialogHeader,HeaderTitle=ConsentDialogHeaderTitle,HeaderDescription=ConsentDialogHeaderDescription,Content=ConsentDialogContent,Footer=ConsentDialogFooter;for(var __rspack_i in exports.Branding=__webpack_exports__.Branding,exports.Card=__webpack_exports__.Card,exports.ConsentCustomizationCard=__webpack_exports__.ConsentCustomizationCard,exports.ConsentDialogCard=__webpack_exports__.ConsentDialogCard,exports.ConsentDialogContent=__webpack_exports__.ConsentDialogContent,exports.ConsentDialogFooter=__webpack_exports__.ConsentDialogFooter,exports.ConsentDialogHeader=__webpack_exports__.ConsentDialogHeader,exports.ConsentDialogHeaderDescription=__webpack_exports__.ConsentDialogHeaderDescription,exports.ConsentDialogHeaderTitle=__webpack_exports__.ConsentDialogHeaderTitle,exports.Content=__webpack_exports__.Content,exports.Footer=__webpack_exports__.Footer,exports.Header=__webpack_exports__.Header,exports.HeaderDescription=__webpack_exports__.HeaderDescription,exports.HeaderTitle=__webpack_exports__.HeaderTitle,__webpack_exports__)-1===["Branding","Card","ConsentCustomizationCard","ConsentDialogCard","ConsentDialogContent","ConsentDialogFooter","ConsentDialogHeader","ConsentDialogHeaderDescription","ConsentDialogHeaderTitle","Content","Footer","Header","HeaderDescription","HeaderTitle"].indexOf(__rspack_i)&&(exports[__rspack_i]=__webpack_exports__[__rspack_i]);Object.defineProperty(exports,"__esModule",{value:!0});
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import n from"@c15t/ui/styles/components/consent-dialog.module.js";import{forwardRef as i}from"react";import{ConsentWidget as o}from"../../consent-widget/consent-widget.js";import{Box as a}from"../../shared/primitives/box.js";import{InlineLegalLinks as s}from"../../shared/primitives/legal-links/index.js";import{BrandingLink as r}from"../../shared/ui/branding.js";import{useTranslations as d}from"../../../hooks/use-translations.js";import{cnExt as l}from"../../../utils/cn.js";let c=i(({children:t,...i},o)=>e(a,{ref:o,baseClassName:n.card,...i,themeKey:"consentDialogCard","data-testid":"consent-dialog-card",children:t})),g=i(({children:t,...i},o)=>e(a,{ref:o,baseClassName:n.header,...i,themeKey:"consentDialogHeader","data-testid":"consent-dialog-header",children:t})),m=i(({children:t,...i},o)=>{let{consentManagerDialog:s}=d();return e(a,{ref:o,baseClassName:n.title,themeKey:"consentDialogTitle",...i,id:"consent-dialog-title","data-testid":"consent-dialog-title",children:t??s.title})}),h=i(({children:i,legalLinks:o,asChild:r,...l},c)=>{let{consentManagerDialog:g}=d();return r?e(a,{ref:c,baseClassName:n.description,themeKey:"consentDialogDescription",asChild:r,...l,children:i??g.description}):t(a,{ref:c,baseClassName:n.description,themeKey:"consentDialogDescription",asChild:r,...l,"data-testid":"consent-dialog-description",children:[i??g.description,e(s,{links:o,themeKey:"consentDialogContent",testIdPrefix:"consent-dialog-legal-link"})]})}),C=i(({children:t,...i},o)=>e(a,{ref:o,baseClassName:n.content,themeKey:"consentDialogContent","data-testid":"consent-dialog-content",...i,children:t})),p=i(({children:t,themeKey:i,hideBranding:o,"data-testid":s,...r},d)=>e(a,{ref:d,baseClassName:l(n.footer,null==t&&n.brandingFooter),"data-testid":s??"consent-dialog-footer",...r,themeKey:i??"consentDialogFooter",children:t??e(f,{hideBranding:o??!1,variant:"dialog-tag","data-testid":"consent-dialog-branding"})}));function f(t){return e(r,{...t})}let D=({noStyle:n,legalLinks:i,hideBranding:a})=>t(c,{children:[t(g,{children:[e(m,{}),e(h,{legalLinks:i})]}),e(C,{children:e(o,{hideBranding:!0,noStyle:n,useProvider:!0})}),e(p,{hideBranding:a})]}),u=c,b=g,y=m,j=h,K=C,H=p;export{f as Branding,u as Card,D as ConsentCustomizationCard,c as ConsentDialogCard,C as ConsentDialogContent,p as ConsentDialogFooter,g as ConsentDialogHeader,h as ConsentDialogHeaderDescription,m as ConsentDialogHeaderTitle,K as Content,H as Footer,b as Header,j as HeaderDescription,y as HeaderTitle};
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import n from"@c15t/ui/styles/components/consent-dialog.module.js";import{forwardRef as i}from"react";import{ConsentWidget as o}from"../../consent-widget/consent-widget.js";import{Box as a}from"../../shared/primitives/box.js";import{InlineLegalLinks as s}from"../../shared/primitives/legal-links/index.js";import{BrandingLink as r}from"../../shared/ui/branding.js";import{useTranslations as d}from"../../../hooks/use-translations.js";import{cnExt as l}from"../../../utils/cn.js";let c=i(({children:t,...i},o)=>e(a,{ref:o,baseClassName:n.card,...i,themeKey:"consentDialogCard","data-testid":"consent-dialog-card",children:t})),g=i(({children:t,...i},o)=>e(a,{ref:o,baseClassName:n.header,...i,themeKey:"consentDialogHeader","data-testid":"consent-dialog-header",children:t})),m=i(({children:t,...i},o)=>{let{consentManagerDialog:s}=d();return e(a,{ref:o,baseClassName:n.title,themeKey:"consentDialogTitle",...i,id:"consent-dialog-title","data-testid":"consent-dialog-title",children:t??s.title})}),h=i(({children:i,legalLinks:o,asChild:r,...l},c)=>{let{consentManagerDialog:g}=d();return r?e(a,{ref:c,baseClassName:n.description,themeKey:"consentDialogDescription",asChild:r,...l,children:i??g.description}):t(a,{ref:c,baseClassName:n.description,themeKey:"consentDialogDescription",asChild:r,...l,"data-testid":"consent-dialog-description",children:[i??g.description,e(s,{links:o,themeKey:"consentDialogContent",testIdPrefix:"consent-dialog-legal-link"})]})}),C=i(({children:t,...i},o)=>e(a,{ref:o,baseClassName:n.content,themeKey:"consentDialogContent","data-testid":"consent-dialog-content",...i,children:t})),p=i(({children:t,themeKey:i,hideBranding:o,"data-testid":s,...r},d)=>e(a,{ref:d,baseClassName:l(n.footer,null==t&&!o&&n.brandingFooter),"data-testid":s??"consent-dialog-footer",...r,themeKey:i??"consentDialogFooter",children:t??e(D,{hideBranding:o??!1,variant:"dialog-tag",themeKey:"consentDialogTag","data-testid":"consent-dialog-branding"})}));function D(t){return e(r,{...t})}let f=({noStyle:n,legalLinks:i,hideBranding:a})=>t(c,{children:[t(g,{children:[e(m,{}),e(h,{legalLinks:i})]}),e(C,{children:e(o,{hideBranding:!0,noStyle:n,useProvider:!0})}),e(D,{hideBranding:a??!1,variant:"dialog-tag",themeKey:"consentDialogTag","data-testid":"consent-dialog-branding"})]}),u=c,b=g,y=m,K=h,j=C,H=p;export{D as Branding,u as Card,f as ConsentCustomizationCard,c as ConsentDialogCard,C as ConsentDialogContent,p as ConsentDialogFooter,g as ConsentDialogHeader,h as ConsentDialogHeaderDescription,m as ConsentDialogHeaderTitle,j as Content,H as Footer,b as Header,K as HeaderDescription,y as HeaderTitle};
@@ -1 +1 @@
1
- "use strict";const __rslib_import_meta_url__="u"<typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=(e,t)=>{for(var _ in t)__webpack_require__.o(t,_)&&!__webpack_require__.o(e,_)&&Object.defineProperty(e,_,{enumerable:!0,get:t[_]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{ConsentWidgetRoot:()=>ConsentWidgetRoot,Root:()=>Root});const jsx_runtime_namespaceObject=require("react/jsx-runtime"),box_cjs_namespaceObject=require("../../shared/primitives/box.cjs"),consent_tracking_context_cjs_namespaceObject=require("../../../context/consent-tracking-context.cjs"),theme_context_cjs_namespaceObject=require("../../../context/theme-context.cjs"),use_consent_manager_cjs_namespaceObject=require("../../../hooks/use-consent-manager.cjs"),use_text_direction_cjs_namespaceObject=require("../../../hooks/use-text-direction.cjs"),ConsentWidgetRoot=({children:e,noStyle:t=!1,disableAnimation:_=!1,useProvider:c=!0,uiSource:r})=>{let{translationConfig:n}=(0,use_consent_manager_cjs_namespaceObject.useConsentManager)(),o=(0,use_text_direction_cjs_namespaceObject.useTextDirection)(n.defaultLanguage),s=(0,consent_tracking_context_cjs_namespaceObject.useConsentTracking)(),a=r??s.uiSource??"widget",i=(0,jsx_runtime_namespaceObject.jsx)(box_cjs_namespaceObject.Box,{"data-testid":"consent-widget-root",themeKey:"consentWidget",dir:o,children:e});return c?(0,jsx_runtime_namespaceObject.jsx)(consent_tracking_context_cjs_namespaceObject.ConsentTrackingContext.Provider,{value:{uiSource:a},children:(0,jsx_runtime_namespaceObject.jsx)(theme_context_cjs_namespaceObject.LocalThemeContext.Provider,{value:{disableAnimation:_,noStyle:t},children:i})}):(0,jsx_runtime_namespaceObject.jsx)(consent_tracking_context_cjs_namespaceObject.ConsentTrackingContext.Provider,{value:{uiSource:a},children:i})},Root=ConsentWidgetRoot;for(var __rspack_i in exports.ConsentWidgetRoot=__webpack_exports__.ConsentWidgetRoot,exports.Root=__webpack_exports__.Root,__webpack_exports__)-1===["ConsentWidgetRoot","Root"].indexOf(__rspack_i)&&(exports[__rspack_i]=__webpack_exports__[__rspack_i]);Object.defineProperty(exports,"__esModule",{value:!0});
1
+ "use strict";const __rslib_import_meta_url__="u"<typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var _ in t)__webpack_require__.o(t,_)&&!__webpack_require__.o(e,_)&&Object.defineProperty(e,_,{enumerable:!0,get:t[_]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{ConsentWidgetRoot:()=>ConsentWidgetRoot,Root:()=>Root});const jsx_runtime_namespaceObject=require("react/jsx-runtime"),consent_widget_module_js_namespaceObject=require("@c15t/ui/styles/components/consent-widget.module.js");var consent_widget_module_js_default=__webpack_require__.n(consent_widget_module_js_namespaceObject);const box_cjs_namespaceObject=require("../../shared/primitives/box.cjs"),consent_tracking_context_cjs_namespaceObject=require("../../../context/consent-tracking-context.cjs"),theme_context_cjs_namespaceObject=require("../../../context/theme-context.cjs"),use_consent_manager_cjs_namespaceObject=require("../../../hooks/use-consent-manager.cjs"),use_text_direction_cjs_namespaceObject=require("../../../hooks/use-text-direction.cjs"),ConsentWidgetRoot=({children:e,noStyle:t=!1,disableAnimation:_=!1,useProvider:c=!0,uiSource:n})=>{let{translationConfig:r}=(0,use_consent_manager_cjs_namespaceObject.useConsentManager)(),o=(0,use_text_direction_cjs_namespaceObject.useTextDirection)(r.defaultLanguage),s=(0,consent_tracking_context_cjs_namespaceObject.useConsentTracking)(),a=n??s.uiSource??"widget",i=(0,jsx_runtime_namespaceObject.jsx)(box_cjs_namespaceObject.Box,{baseClassName:consent_widget_module_js_default().widget,"data-testid":"consent-widget-root",themeKey:"consentWidget",dir:o,children:e});return c?(0,jsx_runtime_namespaceObject.jsx)(consent_tracking_context_cjs_namespaceObject.ConsentTrackingContext.Provider,{value:{uiSource:a},children:(0,jsx_runtime_namespaceObject.jsx)(theme_context_cjs_namespaceObject.LocalThemeContext.Provider,{value:{disableAnimation:_,noStyle:t},children:i})}):(0,jsx_runtime_namespaceObject.jsx)(consent_tracking_context_cjs_namespaceObject.ConsentTrackingContext.Provider,{value:{uiSource:a},children:i})},Root=ConsentWidgetRoot;for(var __rspack_i in exports.ConsentWidgetRoot=__webpack_exports__.ConsentWidgetRoot,exports.Root=__webpack_exports__.Root,__webpack_exports__)-1===["ConsentWidgetRoot","Root"].indexOf(__rspack_i)&&(exports[__rspack_i]=__webpack_exports__[__rspack_i]);Object.defineProperty(exports,"__esModule",{value:!0});
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{Box as t}from"../../shared/primitives/box.js";import{ConsentTrackingContext as o,useConsentTracking as r}from"../../../context/consent-tracking-context.js";import{LocalThemeContext as i}from"../../../context/theme-context.js";import{useConsentManager as n}from"../../../hooks/use-consent-manager.js";import{useTextDirection as c}from"../../../hooks/use-text-direction.js";let s=({children:s,noStyle:d=!1,disableAnimation:m=!1,useProvider:u=!0,uiSource:a})=>{let{translationConfig:l}=n(),h=c(l.defaultLanguage),g=r(),p=a??g.uiSource??"widget",x=e(t,{"data-testid":"consent-widget-root",themeKey:"consentWidget",dir:h,children:s});return u?e(o.Provider,{value:{uiSource:p},children:e(i.Provider,{value:{disableAnimation:m,noStyle:d},children:x})}):e(o.Provider,{value:{uiSource:p},children:x})},d=s;export{s as ConsentWidgetRoot,d as Root};
1
+ import{jsx as e}from"react/jsx-runtime";import t from"@c15t/ui/styles/components/consent-widget.module.js";import{Box as o}from"../../shared/primitives/box.js";import{ConsentTrackingContext as r,useConsentTracking as i}from"../../../context/consent-tracking-context.js";import{LocalThemeContext as n}from"../../../context/theme-context.js";import{useConsentManager as s}from"../../../hooks/use-consent-manager.js";import{useTextDirection as m}from"../../../hooks/use-text-direction.js";let c=({children:c,noStyle:d=!1,disableAnimation:u=!1,useProvider:a=!0,uiSource:l})=>{let{translationConfig:g}=s(),p=m(g.defaultLanguage),h=i(),f=l??h.uiSource??"widget",x=e(o,{baseClassName:t.widget,"data-testid":"consent-widget-root",themeKey:"consentWidget",dir:p,children:c});return a?e(r.Provider,{value:{uiSource:f},children:e(n.Provider,{value:{disableAnimation:u,noStyle:d},children:x})}):e(r.Provider,{value:{uiSource:f},children:x})},d=c;export{c as ConsentWidgetRoot,d as Root};
@@ -1 +1 @@
1
- "use strict";const __rslib_import_meta_url__="u"<typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=(e,_)=>{for(var t in _)__webpack_require__.o(_,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:_[t]})},__webpack_require__.o=(e,_)=>Object.prototype.hasOwnProperty.call(e,_),__webpack_require__.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{ConsentWidget:()=>ConsentWidget});const jsx_runtime_namespaceObject=require("react/jsx-runtime"),external_react_namespaceObject=require("react"),use_theme_cjs_namespaceObject=require("../../hooks/use-theme.cjs"),card_cjs_namespaceObject=require("../consent-dialog/atoms/card.cjs"),accordion_cjs_namespaceObject=require("./atoms/accordion.cjs"),root_cjs_namespaceObject=require("./atoms/root.cjs"),external_policy_actions_cjs_namespaceObject=require("./policy-actions.cjs"),ConsentWidget=({hideBranding:e,noStyle:_,disableAnimation:t,scrollLock:c,trapFocus:r,...a})=>{let[n,s]=(0,external_react_namespaceObject.useState)(""),o=(0,use_theme_cjs_namespaceObject.useTheme)(),i={noStyle:_??o.noStyle,disableAnimation:t??o.disableAnimation,scrollLock:c??o.scrollLock,trapFocus:r??o.trapFocus,...a};return(0,jsx_runtime_namespaceObject.jsxs)(root_cjs_namespaceObject.ConsentWidgetRoot,{...i,children:[(0,jsx_runtime_namespaceObject.jsx)(accordion_cjs_namespaceObject.ConsentWidgetAccordion,{type:"single",value:n,onValueChange:e=>{s(Array.isArray(e)?e[0]??"":e??"")},children:(0,jsx_runtime_namespaceObject.jsx)(accordion_cjs_namespaceObject.ConsentWidgetAccordionItems,{})}),(0,jsx_runtime_namespaceObject.jsx)(external_policy_actions_cjs_namespaceObject.ConsentWidgetPolicyActions,{}),(0,jsx_runtime_namespaceObject.jsx)(card_cjs_namespaceObject.ConsentDialogFooter,{themeKey:"consentWidgetBranding",hideBranding:e??!0,"data-testid":"consent-widget-branding"})]})};for(var __rspack_i in exports.ConsentWidget=__webpack_exports__.ConsentWidget,__webpack_exports__)-1===["ConsentWidget"].indexOf(__rspack_i)&&(exports[__rspack_i]=__webpack_exports__[__rspack_i]);Object.defineProperty(exports,"__esModule",{value:!0});
1
+ "use strict";const __rslib_import_meta_url__="u"<typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=(e,_)=>{for(var t in _)__webpack_require__.o(_,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:_[t]})},__webpack_require__.o=(e,_)=>Object.prototype.hasOwnProperty.call(e,_),__webpack_require__.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{ConsentWidget:()=>ConsentWidget});const jsx_runtime_namespaceObject=require("react/jsx-runtime"),external_react_namespaceObject=require("react"),branding_cjs_namespaceObject=require("../shared/ui/branding.cjs"),use_theme_cjs_namespaceObject=require("../../hooks/use-theme.cjs"),accordion_cjs_namespaceObject=require("./atoms/accordion.cjs"),root_cjs_namespaceObject=require("./atoms/root.cjs"),external_policy_actions_cjs_namespaceObject=require("./policy-actions.cjs"),ConsentWidget=({hideBranding:e,noStyle:_,disableAnimation:t,scrollLock:c,trapFocus:r,...a})=>{let[n,s]=(0,external_react_namespaceObject.useState)(""),o=(0,use_theme_cjs_namespaceObject.useTheme)(),i={noStyle:_??o.noStyle,disableAnimation:t??o.disableAnimation,scrollLock:c??o.scrollLock,trapFocus:r??o.trapFocus,...a};return(0,jsx_runtime_namespaceObject.jsxs)(root_cjs_namespaceObject.ConsentWidgetRoot,{...i,children:[(0,jsx_runtime_namespaceObject.jsx)(accordion_cjs_namespaceObject.ConsentWidgetAccordion,{type:"single",value:n,onValueChange:e=>{s(Array.isArray(e)?e[0]??"":e??"")},children:(0,jsx_runtime_namespaceObject.jsx)(accordion_cjs_namespaceObject.ConsentWidgetAccordionItems,{})}),(0,jsx_runtime_namespaceObject.jsx)(external_policy_actions_cjs_namespaceObject.ConsentWidgetPolicyActions,{}),(0,jsx_runtime_namespaceObject.jsx)(branding_cjs_namespaceObject.BrandingLink,{hideBranding:e??!0,variant:"dialog-tag",themeKey:"consentWidgetTag","data-testid":"consent-widget-branding"})]})};for(var __rspack_i in exports.ConsentWidget=__webpack_exports__.ConsentWidget,__webpack_exports__)-1===["ConsentWidget"].indexOf(__rspack_i)&&(exports[__rspack_i]=__webpack_exports__[__rspack_i]);Object.defineProperty(exports,"__esModule",{value:!0});
@@ -1 +1 @@
1
- import{jsx as o,jsxs as t}from"react/jsx-runtime";import{useState as r}from"react";import{useTheme as e}from"../../hooks/use-theme.js";import{ConsentDialogFooter as i}from"../consent-dialog/atoms/card.js";import{ConsentWidgetAccordion as n,ConsentWidgetAccordionItems as a}from"./atoms/accordion.js";import{ConsentWidgetRoot as s}from"./atoms/root.js";import{ConsentWidgetPolicyActions as m}from"./policy-actions.js";let c=({hideBranding:c,noStyle:l,disableAnimation:d,scrollLock:p,trapFocus:g,...u})=>{let[y,f]=r(""),h=e();return t(s,{...{noStyle:l??h.noStyle,disableAnimation:d??h.disableAnimation,scrollLock:p??h.scrollLock,trapFocus:g??h.trapFocus,...u},children:[o(n,{type:"single",value:y,onValueChange:o=>{f(Array.isArray(o)?o[0]??"":o??"")},children:o(a,{})}),o(m,{}),o(i,{themeKey:"consentWidgetBranding",hideBranding:c??!0,"data-testid":"consent-widget-branding"})]})};export{c as ConsentWidget};
1
+ import{jsx as o,jsxs as t}from"react/jsx-runtime";import{useState as r}from"react";import{BrandingLink as e}from"../shared/ui/branding.js";import{useTheme as i}from"../../hooks/use-theme.js";import{ConsentWidgetAccordion as a,ConsentWidgetAccordionItems as n}from"./atoms/accordion.js";import{ConsentWidgetRoot as s}from"./atoms/root.js";import{ConsentWidgetPolicyActions as m}from"./policy-actions.js";let l=({hideBranding:l,noStyle:c,disableAnimation:d,scrollLock:p,trapFocus:g,...u})=>{let[h,y]=r(""),f=i();return t(s,{...{noStyle:c??f.noStyle,disableAnimation:d??f.disableAnimation,scrollLock:p??f.scrollLock,trapFocus:g??f.trapFocus,...u},children:[o(a,{type:"single",value:h,onValueChange:o=>{y(Array.isArray(o)?o[0]??"":o??"")},children:o(n,{})}),o(m,{}),o(e,{hideBranding:l??!0,variant:"dialog-tag",themeKey:"consentWidgetTag","data-testid":"consent-widget-branding"})]})};export{l as ConsentWidget};
@@ -1 +1 @@
1
- "use strict";const __rslib_import_meta_url__="u"<typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(n,{a:n}),n},__webpack_require__.d=(e,n)=>{for(var a in n)__webpack_require__.o(n,a)&&!__webpack_require__.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:n[a]})},__webpack_require__.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),__webpack_require__.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{IABConsentBanner:()=>IABConsentBanner});const jsx_runtime_namespaceObject=require("react/jsx-runtime"),iab_consent_banner_module_js_namespaceObject=require("@c15t/ui/styles/components/iab-consent-banner.module.js");var iab_consent_banner_module_js_default=__webpack_require__.n(iab_consent_banner_module_js_namespaceObject);const external_react_namespaceObject=require("react"),box_cjs_namespaceObject=require("../shared/primitives/box.cjs"),branding_cjs_namespaceObject=require("../shared/ui/branding.cjs"),index_cjs_namespaceObject=require("../shared/ui/button/index.cjs"),use_component_config_cjs_namespaceObject=require("../../hooks/use-component-config.cjs"),use_consent_manager_cjs_namespaceObject=require("../../hooks/use-consent-manager.cjs"),use_focus_trap_cjs_namespaceObject=require("../../hooks/use-focus-trap.cjs"),use_headless_iab_consent_ui_cjs_namespaceObject=require("../../hooks/use-headless-iab-consent-ui.cjs"),use_iab_translations_cjs_namespaceObject=require("../iab-consent-dialog/use-iab-translations.cjs"),root_cjs_namespaceObject=require("./atoms/root.cjs"),IABConsentBanner=({noStyle:e,disableAnimation:n,scrollLock:a,trapFocus:s=!0,primaryButton:t="customize",models:_,uiSource:c})=>{let r=(0,use_iab_translations_cjs_namespaceObject.useIABTranslations)(),{iab:o,banner:i,openVendorsDialog:u,performBannerAction:b}=(0,use_headless_iab_consent_ui_cjs_namespaceObject.useHeadlessIABConsentUI)(),{policyBanner:l}=(0,use_consent_manager_cjs_namespaceObject.useConsentManager)(),m=a??l.scrollLock??!0,j=(0,external_react_namespaceObject.useRef)(null),p=(0,use_component_config_cjs_namespaceObject.useComponentConfig)({noStyle:e,disableAnimation:n,scrollLock:m,trapFocus:s});if((0,use_focus_trap_cjs_namespaceObject.useFocusTrap)(!!p.trapFocus,j),!o?.config.enabled||!i.isReady)return null;let d=r.banner.description.replace("{partnerCount}",String(i.vendorCount)),x=r.banner.partnersLink.replace("{count}",String(i.vendorCount)),O=r.banner.scopeServiceSpecific;return(0,jsx_runtime_namespaceObject.jsx)(root_cjs_namespaceObject.IABConsentBannerRoot,{...p,models:_,uiSource:c,children:(0,jsx_runtime_namespaceObject.jsxs)(box_cjs_namespaceObject.Box,{baseClassName:iab_consent_banner_module_js_default().cardShell,children:[(0,jsx_runtime_namespaceObject.jsx)(branding_cjs_namespaceObject.BrandingLink,{hideBranding:!1,variant:"banner-tag","data-testid":"iab-consent-banner-branding"}),(0,jsx_runtime_namespaceObject.jsxs)(box_cjs_namespaceObject.Box,{ref:j,baseClassName:iab_consent_banner_module_js_default().card,themeKey:"iabConsentBannerCard",tabIndex:0,role:"dialog","aria-modal":p.trapFocus?"true":void 0,"aria-label":r.banner.title,"data-testid":"iab-consent-banner-card",children:[(0,jsx_runtime_namespaceObject.jsxs)(box_cjs_namespaceObject.Box,{baseClassName:iab_consent_banner_module_js_default().header,themeKey:"iabConsentBannerHeader","data-testid":"iab-consent-banner-header",children:[(0,jsx_runtime_namespaceObject.jsx)("h2",{className:iab_consent_banner_module_js_default().title,children:r.banner.title}),(0,jsx_runtime_namespaceObject.jsxs)("p",{className:iab_consent_banner_module_js_default().description,children:[d.split(x)[0],(0,jsx_runtime_namespaceObject.jsx)("button",{type:"button",className:iab_consent_banner_module_js_default().partnersLink,onClick:()=>{u()},onMouseEnter:()=>{},children:x}),d.split(x)[1]]}),(0,jsx_runtime_namespaceObject.jsxs)("ul",{className:iab_consent_banner_module_js_default().purposeList,children:[i.displayItems.map((e,n)=>(0,jsx_runtime_namespaceObject.jsx)("li",{children:e},n)),i.remainingCount>0&&(0,jsx_runtime_namespaceObject.jsx)("li",{className:iab_consent_banner_module_js_default().purposeMore,children:r.banner.andMore.replace("{count}",String(i.remainingCount))})]}),(0,jsx_runtime_namespaceObject.jsxs)("p",{className:iab_consent_banner_module_js_default().legitimateInterestNotice,children:[r.banner.legitimateInterestNotice," ",O]})]}),(0,jsx_runtime_namespaceObject.jsxs)(box_cjs_namespaceObject.Box,{baseClassName:iab_consent_banner_module_js_default().footer,themeKey:"iabConsentBannerFooter","data-testid":"iab-consent-banner-footer",children:[(0,jsx_runtime_namespaceObject.jsxs)("div",{className:iab_consent_banner_module_js_default().footerButtonGroup,children:[(0,jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.Root,{variant:"reject"===t?"primary":"neutral",mode:"stroke",size:"small",onClick:()=>{b("reject")},className:iab_consent_banner_module_js_default().rejectButton,"data-testid":"iab-consent-banner-reject-button",children:r.common.rejectAll}),(0,jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.Root,{variant:"accept"===t?"primary":"neutral",mode:"accept"===t?"filled":"stroke",size:"small",onClick:()=>{b("accept")},className:iab_consent_banner_module_js_default().acceptButton,"data-testid":"iab-consent-banner-accept-button",children:r.common.acceptAll})]}),(0,jsx_runtime_namespaceObject.jsx)("div",{className:iab_consent_banner_module_js_default().footerSpacer}),(0,jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.Root,{variant:"customize"===t?"primary":"neutral",mode:"customize"===t?"filled":"stroke",size:"small",onClick:()=>{b("customize")},className:iab_consent_banner_module_js_default().customizeButton,"data-testid":"iab-consent-banner-customize-button",children:r.common.customize})]})]})]})})};for(var __rspack_i in exports.IABConsentBanner=__webpack_exports__.IABConsentBanner,__webpack_exports__)-1===["IABConsentBanner"].indexOf(__rspack_i)&&(exports[__rspack_i]=__webpack_exports__[__rspack_i]);Object.defineProperty(exports,"__esModule",{value:!0});
1
+ "use strict";const __rslib_import_meta_url__="u"<typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(n,{a:n}),n},__webpack_require__.d=(e,n)=>{for(var a in n)__webpack_require__.o(n,a)&&!__webpack_require__.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:n[a]})},__webpack_require__.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),__webpack_require__.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{IABConsentBanner:()=>IABConsentBanner});const jsx_runtime_namespaceObject=require("react/jsx-runtime"),iab_consent_banner_module_js_namespaceObject=require("@c15t/ui/styles/components/iab-consent-banner.module.js");var iab_consent_banner_module_js_default=__webpack_require__.n(iab_consent_banner_module_js_namespaceObject);const external_react_namespaceObject=require("react"),box_cjs_namespaceObject=require("../shared/primitives/box.cjs"),branding_cjs_namespaceObject=require("../shared/ui/branding.cjs"),index_cjs_namespaceObject=require("../shared/ui/button/index.cjs"),use_component_config_cjs_namespaceObject=require("../../hooks/use-component-config.cjs"),use_consent_manager_cjs_namespaceObject=require("../../hooks/use-consent-manager.cjs"),use_focus_trap_cjs_namespaceObject=require("../../hooks/use-focus-trap.cjs"),use_headless_iab_consent_ui_cjs_namespaceObject=require("../../hooks/use-headless-iab-consent-ui.cjs"),use_iab_translations_cjs_namespaceObject=require("../iab-consent-dialog/use-iab-translations.cjs"),root_cjs_namespaceObject=require("./atoms/root.cjs"),IABConsentBanner=({noStyle:e,disableAnimation:n,scrollLock:a,trapFocus:s=!0,primaryButton:t="customize",models:_,uiSource:c})=>{let r=(0,use_iab_translations_cjs_namespaceObject.useIABTranslations)(),{iab:o,banner:i,openVendorsDialog:u,performBannerAction:b}=(0,use_headless_iab_consent_ui_cjs_namespaceObject.useHeadlessIABConsentUI)(),{policyBanner:l}=(0,use_consent_manager_cjs_namespaceObject.useConsentManager)(),m=a??l.scrollLock??!0,j=(0,external_react_namespaceObject.useRef)(null),p=(0,use_component_config_cjs_namespaceObject.useComponentConfig)({noStyle:e,disableAnimation:n,scrollLock:m,trapFocus:s});if((0,use_focus_trap_cjs_namespaceObject.useFocusTrap)(!!p.trapFocus,j),!o?.config.enabled||!i.isReady)return null;let d=r.banner.description.replace("{partnerCount}",String(i.vendorCount)),x=r.banner.partnersLink.replace("{count}",String(i.vendorCount)),O=r.banner.scopeServiceSpecific;return(0,jsx_runtime_namespaceObject.jsx)(root_cjs_namespaceObject.IABConsentBannerRoot,{...p,models:_,uiSource:c,children:(0,jsx_runtime_namespaceObject.jsxs)(box_cjs_namespaceObject.Box,{baseClassName:iab_consent_banner_module_js_default().cardShell,children:[(0,jsx_runtime_namespaceObject.jsx)(branding_cjs_namespaceObject.BrandingLink,{hideBranding:!1,variant:"banner-tag",themeKey:"iabConsentBannerTag","data-testid":"iab-consent-banner-branding"}),(0,jsx_runtime_namespaceObject.jsxs)(box_cjs_namespaceObject.Box,{ref:j,baseClassName:iab_consent_banner_module_js_default().card,themeKey:"iabConsentBannerCard",tabIndex:0,role:"dialog","aria-modal":p.trapFocus?"true":void 0,"aria-label":r.banner.title,"data-testid":"iab-consent-banner-card",children:[(0,jsx_runtime_namespaceObject.jsxs)(box_cjs_namespaceObject.Box,{baseClassName:iab_consent_banner_module_js_default().header,themeKey:"iabConsentBannerHeader","data-testid":"iab-consent-banner-header",children:[(0,jsx_runtime_namespaceObject.jsx)("h2",{className:iab_consent_banner_module_js_default().title,children:r.banner.title}),(0,jsx_runtime_namespaceObject.jsxs)("p",{className:iab_consent_banner_module_js_default().description,children:[d.split(x)[0],(0,jsx_runtime_namespaceObject.jsx)("button",{type:"button",className:iab_consent_banner_module_js_default().partnersLink,onClick:()=>{u()},onMouseEnter:()=>{},children:x}),d.split(x)[1]]}),(0,jsx_runtime_namespaceObject.jsxs)("ul",{className:iab_consent_banner_module_js_default().purposeList,children:[i.displayItems.map((e,n)=>(0,jsx_runtime_namespaceObject.jsx)("li",{children:e},n)),i.remainingCount>0&&(0,jsx_runtime_namespaceObject.jsx)("li",{className:iab_consent_banner_module_js_default().purposeMore,children:r.banner.andMore.replace("{count}",String(i.remainingCount))})]}),(0,jsx_runtime_namespaceObject.jsxs)("p",{className:iab_consent_banner_module_js_default().legitimateInterestNotice,children:[r.banner.legitimateInterestNotice," ",O]})]}),(0,jsx_runtime_namespaceObject.jsxs)(box_cjs_namespaceObject.Box,{baseClassName:iab_consent_banner_module_js_default().footer,themeKey:"iabConsentBannerFooter","data-testid":"iab-consent-banner-footer",children:[(0,jsx_runtime_namespaceObject.jsxs)("div",{className:iab_consent_banner_module_js_default().footerButtonGroup,children:[(0,jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.Root,{variant:"reject"===t?"primary":"neutral",mode:"stroke",size:"small",onClick:()=>{b("reject")},className:iab_consent_banner_module_js_default().rejectButton,"data-testid":"iab-consent-banner-reject-button",children:r.common.rejectAll}),(0,jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.Root,{variant:"accept"===t?"primary":"neutral",mode:"accept"===t?"filled":"stroke",size:"small",onClick:()=>{b("accept")},className:iab_consent_banner_module_js_default().acceptButton,"data-testid":"iab-consent-banner-accept-button",children:r.common.acceptAll})]}),(0,jsx_runtime_namespaceObject.jsx)("div",{className:iab_consent_banner_module_js_default().footerSpacer}),(0,jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.Root,{variant:"customize"===t?"primary":"neutral",mode:"customize"===t?"filled":"stroke",size:"small",onClick:()=>{b("customize")},className:iab_consent_banner_module_js_default().customizeButton,"data-testid":"iab-consent-banner-customize-button",children:r.common.customize})]})]})]})})};for(var __rspack_i in exports.IABConsentBanner=__webpack_exports__.IABConsentBanner,__webpack_exports__)-1===["IABConsentBanner"].indexOf(__rspack_i)&&(exports[__rspack_i]=__webpack_exports__[__rspack_i]);Object.defineProperty(exports,"__esModule",{value:!0});
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import n from"@c15t/ui/styles/components/iab-consent-banner.module.js";import{useRef as a}from"react";import{Box as r}from"../shared/primitives/box.js";import{BrandingLink as o}from"../shared/ui/branding.js";import{useComponentConfig as i}from"../../hooks/use-component-config.js";import{useConsentManager as s}from"../../hooks/use-consent-manager.js";import{useFocusTrap as c}from"../../hooks/use-focus-trap.js";import{useHeadlessIABConsentUI as l}from"../../hooks/use-headless-iab-consent-ui.js";import{useIABTranslations as m}from"../iab-consent-dialog/use-iab-translations.js";import{IABConsentBannerRoot as d}from"./atoms/root.js";import*as u from"../shared/ui/button/index.js";let p=({noStyle:p,disableAnimation:b,scrollLock:h,trapFocus:f=!0,primaryButton:C="customize",models:N,uiSource:g})=>{let j=m(),{iab:k,banner:y,openVendorsDialog:v,performBannerAction:z}=l(),{policyBanner:B}=s(),S=h??B.scrollLock??!0,L=a(null),x=i({noStyle:p,disableAnimation:b,scrollLock:S,trapFocus:f});if(c(!!x.trapFocus,L),!k?.config.enabled||!y.isReady)return null;let A=j.banner.description.replace("{partnerCount}",String(y.vendorCount)),F=j.banner.partnersLink.replace("{count}",String(y.vendorCount)),I=j.banner.scopeServiceSpecific;return e(d,{...x,models:N,uiSource:g,children:t(r,{baseClassName:n.cardShell,children:[e(o,{hideBranding:!1,variant:"banner-tag","data-testid":"iab-consent-banner-branding"}),t(r,{ref:L,baseClassName:n.card,themeKey:"iabConsentBannerCard",tabIndex:0,role:"dialog","aria-modal":x.trapFocus?"true":void 0,"aria-label":j.banner.title,"data-testid":"iab-consent-banner-card",children:[t(r,{baseClassName:n.header,themeKey:"iabConsentBannerHeader","data-testid":"iab-consent-banner-header",children:[e("h2",{className:n.title,children:j.banner.title}),t("p",{className:n.description,children:[A.split(F)[0],e("button",{type:"button",className:n.partnersLink,onClick:()=>{v()},onMouseEnter:()=>{},children:F}),A.split(F)[1]]}),t("ul",{className:n.purposeList,children:[y.displayItems.map((t,n)=>e("li",{children:t},n)),y.remainingCount>0&&e("li",{className:n.purposeMore,children:j.banner.andMore.replace("{count}",String(y.remainingCount))})]}),t("p",{className:n.legitimateInterestNotice,children:[j.banner.legitimateInterestNotice," ",I]})]}),t(r,{baseClassName:n.footer,themeKey:"iabConsentBannerFooter","data-testid":"iab-consent-banner-footer",children:[t("div",{className:n.footerButtonGroup,children:[e(u.Root,{variant:"reject"===C?"primary":"neutral",mode:"stroke",size:"small",onClick:()=>{z("reject")},className:n.rejectButton,"data-testid":"iab-consent-banner-reject-button",children:j.common.rejectAll}),e(u.Root,{variant:"accept"===C?"primary":"neutral",mode:"accept"===C?"filled":"stroke",size:"small",onClick:()=>{z("accept")},className:n.acceptButton,"data-testid":"iab-consent-banner-accept-button",children:j.common.acceptAll})]}),e("div",{className:n.footerSpacer}),e(u.Root,{variant:"customize"===C?"primary":"neutral",mode:"customize"===C?"filled":"stroke",size:"small",onClick:()=>{z("customize")},className:n.customizeButton,"data-testid":"iab-consent-banner-customize-button",children:j.common.customize})]})]})]})})};export{p as IABConsentBanner};
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import n from"@c15t/ui/styles/components/iab-consent-banner.module.js";import{useRef as a}from"react";import{Box as r}from"../shared/primitives/box.js";import{BrandingLink as o}from"../shared/ui/branding.js";import{useComponentConfig as i}from"../../hooks/use-component-config.js";import{useConsentManager as s}from"../../hooks/use-consent-manager.js";import{useFocusTrap as c}from"../../hooks/use-focus-trap.js";import{useHeadlessIABConsentUI as l}from"../../hooks/use-headless-iab-consent-ui.js";import{useIABTranslations as m}from"../iab-consent-dialog/use-iab-translations.js";import{IABConsentBannerRoot as d}from"./atoms/root.js";import*as u from"../shared/ui/button/index.js";let p=({noStyle:p,disableAnimation:b,scrollLock:h,trapFocus:f=!0,primaryButton:C="customize",models:g,uiSource:N})=>{let j=m(),{iab:k,banner:y,openVendorsDialog:v,performBannerAction:B}=l(),{policyBanner:z}=s(),S=h??z.scrollLock??!0,L=a(null),x=i({noStyle:p,disableAnimation:b,scrollLock:S,trapFocus:f});if(c(!!x.trapFocus,L),!k?.config.enabled||!y.isReady)return null;let A=j.banner.description.replace("{partnerCount}",String(y.vendorCount)),F=j.banner.partnersLink.replace("{count}",String(y.vendorCount)),I=j.banner.scopeServiceSpecific;return e(d,{...x,models:g,uiSource:N,children:t(r,{baseClassName:n.cardShell,children:[e(o,{hideBranding:!1,variant:"banner-tag",themeKey:"iabConsentBannerTag","data-testid":"iab-consent-banner-branding"}),t(r,{ref:L,baseClassName:n.card,themeKey:"iabConsentBannerCard",tabIndex:0,role:"dialog","aria-modal":x.trapFocus?"true":void 0,"aria-label":j.banner.title,"data-testid":"iab-consent-banner-card",children:[t(r,{baseClassName:n.header,themeKey:"iabConsentBannerHeader","data-testid":"iab-consent-banner-header",children:[e("h2",{className:n.title,children:j.banner.title}),t("p",{className:n.description,children:[A.split(F)[0],e("button",{type:"button",className:n.partnersLink,onClick:()=>{v()},onMouseEnter:()=>{},children:F}),A.split(F)[1]]}),t("ul",{className:n.purposeList,children:[y.displayItems.map((t,n)=>e("li",{children:t},n)),y.remainingCount>0&&e("li",{className:n.purposeMore,children:j.banner.andMore.replace("{count}",String(y.remainingCount))})]}),t("p",{className:n.legitimateInterestNotice,children:[j.banner.legitimateInterestNotice," ",I]})]}),t(r,{baseClassName:n.footer,themeKey:"iabConsentBannerFooter","data-testid":"iab-consent-banner-footer",children:[t("div",{className:n.footerButtonGroup,children:[e(u.Root,{variant:"reject"===C?"primary":"neutral",mode:"stroke",size:"small",onClick:()=>{B("reject")},className:n.rejectButton,"data-testid":"iab-consent-banner-reject-button",children:j.common.rejectAll}),e(u.Root,{variant:"accept"===C?"primary":"neutral",mode:"accept"===C?"filled":"stroke",size:"small",onClick:()=>{B("accept")},className:n.acceptButton,"data-testid":"iab-consent-banner-accept-button",children:j.common.acceptAll})]}),e("div",{className:n.footerSpacer}),e(u.Root,{variant:"customize"===C?"primary":"neutral",mode:"customize"===C?"filled":"stroke",size:"small",onClick:()=>{B("customize")},className:n.customizeButton,"data-testid":"iab-consent-banner-customize-button",children:j.common.customize})]})]})]})})};export{p as IABConsentBanner};
@@ -1 +1 @@
1
- "use strict";const __rslib_import_meta_url__="u"<typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.n=e=>{var s=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(s,{a:s}),s},__webpack_require__.d=(e,s)=>{for(var t in s)__webpack_require__.o(s,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:s[t]})},__webpack_require__.o=(e,s)=>Object.prototype.hasOwnProperty.call(e,s),__webpack_require__.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{IABConsentDialog:()=>IABConsentDialog});const jsx_runtime_namespaceObject=require("react/jsx-runtime"),iab_consent_dialog_module_js_namespaceObject=require("@c15t/ui/styles/components/iab-consent-dialog.module.js");var iab_consent_dialog_module_js_default=__webpack_require__.n(iab_consent_dialog_module_js_namespaceObject);const external_react_namespaceObject=require("react"),external_react_dom_namespaceObject=require("react-dom"),card_cjs_namespaceObject=require("../consent-dialog/atoms/card.cjs"),index_cjs_namespaceObject=require("../consent-dialog-trigger/index.cjs"),button_index_cjs_namespaceObject=require("../shared/ui/button/index.cjs"),tabs_index_cjs_namespaceObject=require("../shared/ui/tabs/index.cjs"),consent_tracking_context_cjs_namespaceObject=require("../../context/consent-tracking-context.cjs"),use_component_config_cjs_namespaceObject=require("../../hooks/use-component-config.cjs"),use_consent_manager_cjs_namespaceObject=require("../../hooks/use-consent-manager.cjs"),use_focus_trap_cjs_namespaceObject=require("../../hooks/use-focus-trap.cjs"),use_headless_iab_consent_ui_cjs_namespaceObject=require("../../hooks/use-headless-iab-consent-ui.cjs"),use_scroll_lock_cjs_namespaceObject=require("../../hooks/use-scroll-lock.cjs"),use_text_direction_cjs_namespaceObject=require("../../hooks/use-text-direction.cjs"),use_translations_cjs_namespaceObject=require("../../hooks/use-translations.cjs"),overlay_cjs_namespaceObject=require("./atoms/overlay.cjs"),purpose_item_cjs_namespaceObject=require("./atoms/purpose-item.cjs"),stack_item_cjs_namespaceObject=require("./atoms/stack-item.cjs"),vendor_list_cjs_namespaceObject=require("./atoms/vendor-list.cjs"),external_use_iab_translations_cjs_namespaceObject=require("./use-iab-translations.cjs"),IABConsentDialog=({open:e,noStyle:s,disableAnimation:t,scrollLock:n,trapFocus:a=!0,hideBranding:r,showTrigger:c=!1,models:o=["iab"],uiSource:i})=>{let l=(0,external_use_iab_translations_cjs_namespaceObject.useIABTranslations)(),{common:_}=(0,use_translations_cjs_namespaceObject.useTranslations)(),{iab:u,activeUI:d,policyDialog:m,translationConfig:p,model:j}=(0,use_consent_manager_cjs_namespaceObject.useConsentManager)(),{closeUI:b,openDialog:g,performDialogAction:x}=(0,use_headless_iab_consent_ui_cjs_namespaceObject.useHeadlessIABConsentUI)(),f=n??m.scrollLock??!0,O=(0,use_text_direction_cjs_namespaceObject.useTextDirection)(p.defaultLanguage),v=(0,external_react_namespaceObject.useRef)(null),h=(0,external_react_namespaceObject.useRef)(null),k=(0,external_react_namespaceObject.useRef)(null),[C,I]=(0,external_react_namespaceObject.useState)(u?.preferenceCenterTab??"purposes"),[y,N]=(0,external_react_namespaceObject.useState)(null),[L,P]=(0,external_react_namespaceObject.useState)(!1),[S,T]=(0,external_react_namespaceObject.useState)(!1),[q,w]=(0,external_react_namespaceObject.useState)(!1),A=e??("dialog"===d&&o.includes(j)),V=(0,use_component_config_cjs_namespaceObject.useComponentConfig)({noStyle:s,disableAnimation:t,scrollLock:f,trapFocus:a}),{purposes:B,specialPurposes:F,specialFeatures:M,features:R,stacks:D,standalonePurposes:U}=(0,external_react_namespaceObject.useMemo)(()=>{if(!u?.gvl)return{purposes:[],specialPurposes:[],specialFeatures:[],features:[],stacks:[],standalonePurposes:[]};let e=u.gvl,s=u.nonIABVendors||[],t=(e,s,t)=>({id:Number(e),name:s.name,policyUrl:s.policyUrl??"",usesNonCookieAccess:s.usesNonCookieAccess,deviceStorageDisclosureUrl:s.deviceStorageDisclosureUrl??null,usesCookies:s.usesCookies,cookieMaxAgeSeconds:s.cookieMaxAgeSeconds,cookieRefresh:s.cookieRefresh,legitimateInterestUrl:s.urls?.find(e=>e.legIntClaim)?.legIntClaim??null,specialPurposes:s.specialPurposes||[],specialFeatures:s.specialFeatures||[],features:s.features||[],purposes:s.purposes||[],legIntPurposes:s.legIntPurposes||[],usesLegitimateInterest:!!t&&(s.legIntPurposes?.includes(t)??!1),dataRetention:s.dataRetention,isCustom:!1}),n=Object.entries(e.purposes).map(([n,a])=>{let r=Object.entries(e.vendors).filter(([,e])=>e.purposes?.includes(Number(n))||e.legIntPurposes?.includes(Number(n))).map(([e,s])=>t(e,s,Number(n))),c=s.filter(e=>e.purposes?.includes(Number(n))||e.legIntPurposes?.includes(Number(n))).map(e=>{let s;return s=Number(n),{id:e.id,name:e.name,policyUrl:e.privacyPolicyUrl,usesNonCookieAccess:e.usesNonCookieAccess??!1,deviceStorageDisclosureUrl:null,usesCookies:e.usesCookies??!1,cookieMaxAgeSeconds:e.cookieMaxAgeSeconds??null,cookieRefresh:void 0,legitimateInterestUrl:null,specialPurposes:[],specialFeatures:e.specialFeatures||[],features:e.features||[],purposes:e.purposes||[],legIntPurposes:e.legIntPurposes||[],usesLegitimateInterest:!!s&&(e.legIntPurposes?.includes(s)??!1),dataRetention:void 0,isCustom:!0}});return{id:Number(n),name:a.name,description:a.description,descriptionLegal:a.descriptionLegal,illustrations:a.illustrations||[],vendors:[...r,...c]}}).filter(e=>e.vendors.length>0),a=Object.entries(e.specialPurposes||{}).map(([s,n])=>{let a=Object.entries(e.vendors).filter(([,e])=>e.specialPurposes?.includes(Number(s))).map(([e,s])=>t(e,s));return{id:Number(s),name:n.name,description:n.description,descriptionLegal:n.descriptionLegal,illustrations:n.illustrations||[],vendors:a,isSpecialPurpose:!0}}).filter(e=>e.vendors.length>0),r=Object.entries(e.specialFeatures||{}).map(([s,n])=>{let a=Object.entries(e.vendors).filter(([,e])=>e.specialFeatures?.includes(Number(s))).map(([e,s])=>t(e,s));return{id:Number(s),name:n.name,description:n.description,descriptionLegal:n.descriptionLegal,illustrations:n.illustrations||[],vendors:a}}).filter(e=>e.vendors.length>0),c=Object.entries(e.features||{}).map(([s,n])=>{let a=Object.entries(e.vendors).filter(([,e])=>e.features?.includes(Number(s))).map(([e,s])=>t(e,s));return{id:Number(s),name:n.name,description:n.description,descriptionLegal:n.descriptionLegal,illustrations:n.illustrations||[],vendors:a}}).filter(e=>e.vendors.length>0),o=n.find(e=>1===e.id),i=n.filter(e=>1!==e.id),l=new Set(i.map(e=>e.id)),_=e.stacks||{},d=[];for(let[e,s]of Object.entries(_)){let t=Number(e),n=s.purposes.filter(e=>l.has(e));n.length>=2&&d.push({stackId:t,stack:s,coveredPurposeIds:n,score:n.length})}d.sort((e,s)=>s.score-e.score);let m=[],p=new Set;for(let{stackId:e,stack:s,coveredPurposeIds:t}of d){let n=t.filter(e=>!p.has(e));if(n.length>=2){let t=i.filter(e=>n.includes(e.id));for(let a of(m.push({id:e,name:s.name,description:s.description,purposes:t}),n))p.add(a)}}let j=i.filter(e=>!p.has(e.id));return{purposes:n,specialPurposes:a,specialFeatures:r,features:c,stacks:m,standalonePurposes:o?[o,...j]:j}},[u?.gvl,u?.nonIABVendors]),$=(0,external_react_namespaceObject.useMemo)(()=>u?.gvl?Object.keys(u.gvl.vendors).length+(u.nonIABVendors?.length??0):0,[u?.gvl,u?.nonIABVendors]),E=(0,external_react_namespaceObject.useCallback)((e,s)=>{u?.setPurposeConsent(e,s)},[u]),z=(0,external_react_namespaceObject.useCallback)((e,s)=>{u?.setSpecialFeatureOptIn(e,s)},[u]),H=(0,external_react_namespaceObject.useCallback)((e,s)=>{u?.setVendorConsent(e,s)},[u]),W=(0,external_react_namespaceObject.useCallback)((e,s)=>{u?.setVendorLegitimateInterest(e,s)},[u]),G=(0,external_react_namespaceObject.useCallback)((e,s)=>{u?.setPurposeLegitimateInterest(e,s)},[u]),J=e=>{N(e),I("vendors"),g({tab:"vendors"})};(0,use_focus_trap_cjs_namespaceObject.useFocusTrap)(!!(A&&V.trapFocus),v),(0,use_scroll_lock_cjs_namespaceObject.useScrollLock)(!!(A&&V.scrollLock)),(0,external_react_namespaceObject.useEffect)(()=>{T(!0)},[]),(0,external_react_namespaceObject.useEffect)(()=>{if(A)w(!0);else if(V.disableAnimation)w(!1);else{let e=setTimeout(()=>{w(!1)},150);return()=>clearTimeout(e)}},[A,V.disableAnimation]),(0,external_react_namespaceObject.useEffect)(()=>{A&&u?.preferenceCenterTab&&I(u.preferenceCenterTab)},[A,u?.preferenceCenterTab]),(0,external_react_namespaceObject.useLayoutEffect)(()=>{let e,s,t=h.current;if(!t||null===k.current)return;let n=k.current;if(k.current=null,!window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.style.height=`${n}px`,t.style.overflow="hidden",t.style.transition="none",e=requestAnimationFrame(()=>{s=requestAnimationFrame(()=>{if(!t)return;t.style.height="auto";let e=t.getBoundingClientRect().height;if(t.style.height=`${n}px`,1>Math.abs(n-e)){t.style.height="",t.style.overflow="",t.style.transition="";return}t.offsetHeight,t.style.transition="height 180ms cubic-bezier(0.33, 1, 0.68, 1)",t.style.height=`${e}px`,t.addEventListener("transitionend",e=>{"height"===e.propertyName&&(t.style.height="",t.style.overflow="",t.style.transition="")},{once:!0})})}),()=>{cancelAnimationFrame(e),cancelAnimationFrame(s)}},[C]);let K=(0,external_react_namespaceObject.useCallback)(e=>{h.current&&(k.current=h.current.offsetHeight),I(e),g({tab:e})},[g]);if(!S||!u?.config.enabled)return null;let Q=u.isLoadingGVL||!u.gvl,X=(0,jsx_runtime_namespaceObject.jsxs)(consent_tracking_context_cjs_namespaceObject.ConsentTrackingContext.Provider,{value:{uiSource:i??"iab_dialog"},children:[(0,jsx_runtime_namespaceObject.jsx)(overlay_cjs_namespaceObject.IABConsentDialogOverlay,{isOpen:A}),(0,jsx_runtime_namespaceObject.jsx)("div",{className:`${iab_consent_dialog_module_js_default().root} ${q?iab_consent_dialog_module_js_default().dialogVisible:iab_consent_dialog_module_js_default().dialogHidden}`,"data-testid":"iab-consent-dialog-root",dir:O,children:(0,jsx_runtime_namespaceObject.jsxs)("div",{ref:v,className:`${iab_consent_dialog_module_js_default().card} ${q?iab_consent_dialog_module_js_default().contentVisible:iab_consent_dialog_module_js_default().contentHidden}`,role:"dialog","aria-modal":V.trapFocus?"true":void 0,"aria-label":l.preferenceCenter.title,tabIndex:0,"data-testid":"iab-consent-dialog-card",children:[(0,jsx_runtime_namespaceObject.jsxs)("div",{className:iab_consent_dialog_module_js_default().header,children:[(0,jsx_runtime_namespaceObject.jsxs)("div",{className:iab_consent_dialog_module_js_default().headerContent,children:[(0,jsx_runtime_namespaceObject.jsx)("h2",{className:iab_consent_dialog_module_js_default().title,children:l.preferenceCenter.title}),(0,jsx_runtime_namespaceObject.jsx)("p",{className:iab_consent_dialog_module_js_default().description,children:l.preferenceCenter.description})]}),(0,jsx_runtime_namespaceObject.jsx)("button",{type:"button",onClick:()=>{b()},className:iab_consent_dialog_module_js_default().closeButton,"aria-label":_.close,children:(0,jsx_runtime_namespaceObject.jsxs)("svg",{style:{width:"1rem",height:"1rem"},viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,jsx_runtime_namespaceObject.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,jsx_runtime_namespaceObject.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),(0,jsx_runtime_namespaceObject.jsxs)(tabs_index_cjs_namespaceObject.Root,{className:iab_consent_dialog_module_js_default().body,noStyle:!0,onValueChange:e=>K(e),value:C,children:[(0,jsx_runtime_namespaceObject.jsx)("div",{className:iab_consent_dialog_module_js_default().tabsContainer,children:(0,jsx_runtime_namespaceObject.jsxs)(tabs_index_cjs_namespaceObject.List,{className:iab_consent_dialog_module_js_default().tabsList,noStyle:!0,children:[(0,jsx_runtime_namespaceObject.jsxs)(tabs_index_cjs_namespaceObject.Trigger,{className:iab_consent_dialog_module_js_default().tabButton,noStyle:!0,value:"purposes",children:[l.preferenceCenter.tabs.purposes,!Q&&` (${B.length+F.length+M.length+R.length})`]}),(0,jsx_runtime_namespaceObject.jsxs)(tabs_index_cjs_namespaceObject.Trigger,{className:iab_consent_dialog_module_js_default().tabButton,noStyle:!0,value:"vendors",children:[l.preferenceCenter.tabs.vendors,!Q&&` (${$})`]}),(0,jsx_runtime_namespaceObject.jsx)("div",{"aria-hidden":"true",className:iab_consent_dialog_module_js_default().tabIndicator,"data-active-tab":C})]})}),(0,jsx_runtime_namespaceObject.jsx)("div",{ref:h,className:iab_consent_dialog_module_js_default().content,children:Q?(0,jsx_runtime_namespaceObject.jsxs)("div",{className:iab_consent_dialog_module_js_default().loadingContainer,children:[(0,jsx_runtime_namespaceObject.jsx)("div",{className:iab_consent_dialog_module_js_default().loadingSpinner}),(0,jsx_runtime_namespaceObject.jsx)("p",{className:iab_consent_dialog_module_js_default().loadingText,children:l.common.loading})]}):(0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment,{children:[(0,jsx_runtime_namespaceObject.jsxs)(tabs_index_cjs_namespaceObject.Content,{className:iab_consent_dialog_module_js_default().tabPanel,forceMount:!0,noStyle:!0,value:"purposes",children:[U.map(e=>(0,jsx_runtime_namespaceObject.jsx)(purpose_item_cjs_namespaceObject.PurposeItem,{purpose:e,isEnabled:u.purposeConsents[e.id]??!1,onToggle:s=>E(e.id,s),vendorConsents:u.vendorConsents,onVendorToggle:H,onVendorClick:J,vendorLegitimateInterests:u.vendorLegitimateInterests,onVendorLegitimateInterestToggle:W,purposeLegitimateInterests:u.purposeLegitimateInterests,onPurposeLegitimateInterestToggle:G},e.id)),D.map(e=>(0,jsx_runtime_namespaceObject.jsx)(stack_item_cjs_namespaceObject.StackItem,{stack:e,consents:u.purposeConsents,onToggle:E,vendorConsents:u.vendorConsents,onVendorToggle:H,onVendorClick:J,vendorLegitimateInterests:u.vendorLegitimateInterests,onVendorLegitimateInterestToggle:W,purposeLegitimateInterests:u.purposeLegitimateInterests,onPurposeLegitimateInterestToggle:G},e.id)),M.map(e=>(0,jsx_runtime_namespaceObject.jsx)(purpose_item_cjs_namespaceObject.PurposeItem,{purpose:{id:e.id,name:e.name,description:e.description,illustrations:e.illustrations,vendors:e.vendors},isEnabled:u.specialFeatureOptIns[e.id]??!1,onToggle:s=>z(e.id,s),vendorConsents:u.vendorConsents,onVendorToggle:H,onVendorClick:J,vendorLegitimateInterests:u.vendorLegitimateInterests,onVendorLegitimateInterestToggle:W},`feature-${e.id}`)),(F.length>0||R.length>0)&&(0,jsx_runtime_namespaceObject.jsxs)("div",{className:iab_consent_dialog_module_js_default().specialPurposesSection,children:[(0,jsx_runtime_namespaceObject.jsxs)("div",{className:iab_consent_dialog_module_js_default().specialPurposesHeader,children:[(0,jsx_runtime_namespaceObject.jsxs)("button",{type:"button",onClick:()=>P(!L),className:iab_consent_dialog_module_js_default().purposeTrigger,children:[(0,jsx_runtime_namespaceObject.jsx)("svg",{className:iab_consent_dialog_module_js_default().purposeArrow,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:L?(0,jsx_runtime_namespaceObject.jsx)("path",{d:"M19 9l-7 7-7-7"}):(0,jsx_runtime_namespaceObject.jsx)("path",{d:"M9 5l7 7-7 7"})}),(0,jsx_runtime_namespaceObject.jsxs)("div",{className:iab_consent_dialog_module_js_default().purposeInfo,children:[(0,jsx_runtime_namespaceObject.jsxs)("h3",{className:iab_consent_dialog_module_js_default().specialPurposesTitle,children:[l.preferenceCenter.specialPurposes.title,(0,jsx_runtime_namespaceObject.jsxs)("svg",{className:iab_consent_dialog_module_js_default().lockIcon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,jsx_runtime_namespaceObject.jsx)("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),(0,jsx_runtime_namespaceObject.jsx)("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})]}),(0,jsx_runtime_namespaceObject.jsxs)("p",{className:iab_consent_dialog_module_js_default().purposeMeta,children:[new Set([...F.flatMap(e=>e.vendors.map(e=>e.id)),...R.flatMap(e=>e.vendors.map(e=>e.id))]).size," ","partners"]})]})]}),(0,jsx_runtime_namespaceObject.jsx)("div",{style:{position:"relative"},children:(0,jsx_runtime_namespaceObject.jsxs)("svg",{className:iab_consent_dialog_module_js_default().infoIcon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-label":l.preferenceCenter.specialPurposes.tooltip,children:[(0,jsx_runtime_namespaceObject.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,jsx_runtime_namespaceObject.jsx)("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),(0,jsx_runtime_namespaceObject.jsx)("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})})]}),L&&(0,jsx_runtime_namespaceObject.jsxs)("div",{style:{padding:"0.75rem"},children:[F.map(e=>(0,jsx_runtime_namespaceObject.jsx)(purpose_item_cjs_namespaceObject.PurposeItem,{purpose:e,isEnabled:!0,onToggle:()=>{},vendorConsents:u.vendorConsents,onVendorToggle:H,onVendorClick:J,isLocked:!0},`special-${e.id}`)),R.map(e=>(0,jsx_runtime_namespaceObject.jsx)(purpose_item_cjs_namespaceObject.PurposeItem,{purpose:{id:e.id,name:e.name,description:e.description,illustrations:e.illustrations,vendors:e.vendors},isEnabled:!0,onToggle:()=>{},vendorConsents:u.vendorConsents,onVendorToggle:H,onVendorClick:J,isLocked:!0},`feature-${e.id}`))]})]}),(0,jsx_runtime_namespaceObject.jsx)("div",{className:iab_consent_dialog_module_js_default().consentNotice,children:(0,jsx_runtime_namespaceObject.jsx)("p",{className:iab_consent_dialog_module_js_default().consentNoticeText,children:l.preferenceCenter.footer.consentStorage})})]}),(0,jsx_runtime_namespaceObject.jsx)(tabs_index_cjs_namespaceObject.Content,{className:iab_consent_dialog_module_js_default().tabPanel,forceMount:!0,noStyle:!0,value:"vendors",children:(0,jsx_runtime_namespaceObject.jsx)(vendor_list_cjs_namespaceObject.VendorList,{vendorData:u.gvl,purposes:B,vendorConsents:u.vendorConsents,onVendorToggle:H,selectedVendorId:y,onClearSelection:()=>N(null),customVendors:u.nonIABVendors,vendorLegitimateInterests:u.vendorLegitimateInterests,onVendorLegitimateInterestToggle:W})})]})})]}),(0,jsx_runtime_namespaceObject.jsxs)("div",{className:iab_consent_dialog_module_js_default().footer,children:[(0,jsx_runtime_namespaceObject.jsxs)("div",{className:iab_consent_dialog_module_js_default().footerButtons,children:[(0,jsx_runtime_namespaceObject.jsx)(button_index_cjs_namespaceObject.Root,{variant:"neutral",mode:"stroke",size:"small",onClick:()=>{x("reject")},disabled:Q,children:l.common.rejectAll}),(0,jsx_runtime_namespaceObject.jsx)(button_index_cjs_namespaceObject.Root,{variant:"neutral",mode:"stroke",size:"small",onClick:()=>{x("accept")},disabled:Q,children:l.common.acceptAll})]}),(0,jsx_runtime_namespaceObject.jsx)("div",{className:iab_consent_dialog_module_js_default().footerSpacer}),(0,jsx_runtime_namespaceObject.jsx)(button_index_cjs_namespaceObject.Root,{variant:"primary",mode:"filled",size:"small",onClick:()=>{x("customize")},disabled:Q,children:l.common.saveSettings})]}),(0,jsx_runtime_namespaceObject.jsx)(card_cjs_namespaceObject.Branding,{hideBranding:r??!1,variant:"dialog-tag","data-testid":"iab-consent-dialog-branding"})]})})]}),Y=!0===c?{}:!1===c?null:c,Z=Y?(0,jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.ConsentDialogTrigger,{...Y}):null;return A||q?(0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment,{children:[Z,(0,external_react_dom_namespaceObject.createPortal)(X,document.body)]}):Z};for(var __rspack_i in exports.IABConsentDialog=__webpack_exports__.IABConsentDialog,__webpack_exports__)-1===["IABConsentDialog"].indexOf(__rspack_i)&&(exports[__rspack_i]=__webpack_exports__[__rspack_i]);Object.defineProperty(exports,"__esModule",{value:!0});
1
+ "use strict";const __rslib_import_meta_url__="u"<typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.n=e=>{var s=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(s,{a:s}),s},__webpack_require__.d=(e,s)=>{for(var t in s)__webpack_require__.o(s,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:s[t]})},__webpack_require__.o=(e,s)=>Object.prototype.hasOwnProperty.call(e,s),__webpack_require__.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{IABConsentDialog:()=>IABConsentDialog});const jsx_runtime_namespaceObject=require("react/jsx-runtime"),iab_consent_dialog_module_js_namespaceObject=require("@c15t/ui/styles/components/iab-consent-dialog.module.js");var iab_consent_dialog_module_js_default=__webpack_require__.n(iab_consent_dialog_module_js_namespaceObject);const external_react_namespaceObject=require("react"),external_react_dom_namespaceObject=require("react-dom"),card_cjs_namespaceObject=require("../consent-dialog/atoms/card.cjs"),index_cjs_namespaceObject=require("../consent-dialog-trigger/index.cjs"),button_index_cjs_namespaceObject=require("../shared/ui/button/index.cjs"),tabs_index_cjs_namespaceObject=require("../shared/ui/tabs/index.cjs"),consent_tracking_context_cjs_namespaceObject=require("../../context/consent-tracking-context.cjs"),use_component_config_cjs_namespaceObject=require("../../hooks/use-component-config.cjs"),use_consent_manager_cjs_namespaceObject=require("../../hooks/use-consent-manager.cjs"),use_focus_trap_cjs_namespaceObject=require("../../hooks/use-focus-trap.cjs"),use_headless_iab_consent_ui_cjs_namespaceObject=require("../../hooks/use-headless-iab-consent-ui.cjs"),use_scroll_lock_cjs_namespaceObject=require("../../hooks/use-scroll-lock.cjs"),use_text_direction_cjs_namespaceObject=require("../../hooks/use-text-direction.cjs"),use_translations_cjs_namespaceObject=require("../../hooks/use-translations.cjs"),overlay_cjs_namespaceObject=require("./atoms/overlay.cjs"),purpose_item_cjs_namespaceObject=require("./atoms/purpose-item.cjs"),stack_item_cjs_namespaceObject=require("./atoms/stack-item.cjs"),vendor_list_cjs_namespaceObject=require("./atoms/vendor-list.cjs"),external_use_iab_translations_cjs_namespaceObject=require("./use-iab-translations.cjs"),IABConsentDialog=({open:e,noStyle:s,disableAnimation:t,scrollLock:n,trapFocus:a=!0,hideBranding:r,showTrigger:c=!1,models:o=["iab"],uiSource:i})=>{let l=(0,external_use_iab_translations_cjs_namespaceObject.useIABTranslations)(),{common:_}=(0,use_translations_cjs_namespaceObject.useTranslations)(),{iab:u,activeUI:d,policyDialog:m,translationConfig:p,model:j}=(0,use_consent_manager_cjs_namespaceObject.useConsentManager)(),{closeUI:b,openDialog:g,performDialogAction:x}=(0,use_headless_iab_consent_ui_cjs_namespaceObject.useHeadlessIABConsentUI)(),f=n??m.scrollLock??!0,O=(0,use_text_direction_cjs_namespaceObject.useTextDirection)(p.defaultLanguage),v=(0,external_react_namespaceObject.useRef)(null),h=(0,external_react_namespaceObject.useRef)(null),k=(0,external_react_namespaceObject.useRef)(null),[C,y]=(0,external_react_namespaceObject.useState)(u?.preferenceCenterTab??"purposes"),[I,N]=(0,external_react_namespaceObject.useState)(null),[L,P]=(0,external_react_namespaceObject.useState)(!1),[S,T]=(0,external_react_namespaceObject.useState)(!1),[q,w]=(0,external_react_namespaceObject.useState)(!1),A=e??("dialog"===d&&o.includes(j)),V=(0,use_component_config_cjs_namespaceObject.useComponentConfig)({noStyle:s,disableAnimation:t,scrollLock:f,trapFocus:a}),{purposes:B,specialPurposes:F,specialFeatures:M,features:R,stacks:D,standalonePurposes:U}=(0,external_react_namespaceObject.useMemo)(()=>{if(!u?.gvl)return{purposes:[],specialPurposes:[],specialFeatures:[],features:[],stacks:[],standalonePurposes:[]};let e=u.gvl,s=u.nonIABVendors||[],t=(e,s,t)=>({id:Number(e),name:s.name,policyUrl:s.policyUrl??"",usesNonCookieAccess:s.usesNonCookieAccess,deviceStorageDisclosureUrl:s.deviceStorageDisclosureUrl??null,usesCookies:s.usesCookies,cookieMaxAgeSeconds:s.cookieMaxAgeSeconds,cookieRefresh:s.cookieRefresh,legitimateInterestUrl:s.urls?.find(e=>e.legIntClaim)?.legIntClaim??null,specialPurposes:s.specialPurposes||[],specialFeatures:s.specialFeatures||[],features:s.features||[],purposes:s.purposes||[],legIntPurposes:s.legIntPurposes||[],usesLegitimateInterest:!!t&&(s.legIntPurposes?.includes(t)??!1),dataRetention:s.dataRetention,isCustom:!1}),n=Object.entries(e.purposes).map(([n,a])=>{let r=Object.entries(e.vendors).filter(([,e])=>e.purposes?.includes(Number(n))||e.legIntPurposes?.includes(Number(n))).map(([e,s])=>t(e,s,Number(n))),c=s.filter(e=>e.purposes?.includes(Number(n))||e.legIntPurposes?.includes(Number(n))).map(e=>{let s;return s=Number(n),{id:e.id,name:e.name,policyUrl:e.privacyPolicyUrl,usesNonCookieAccess:e.usesNonCookieAccess??!1,deviceStorageDisclosureUrl:null,usesCookies:e.usesCookies??!1,cookieMaxAgeSeconds:e.cookieMaxAgeSeconds??null,cookieRefresh:void 0,legitimateInterestUrl:null,specialPurposes:[],specialFeatures:e.specialFeatures||[],features:e.features||[],purposes:e.purposes||[],legIntPurposes:e.legIntPurposes||[],usesLegitimateInterest:!!s&&(e.legIntPurposes?.includes(s)??!1),dataRetention:void 0,isCustom:!0}});return{id:Number(n),name:a.name,description:a.description,descriptionLegal:a.descriptionLegal,illustrations:a.illustrations||[],vendors:[...r,...c]}}).filter(e=>e.vendors.length>0),a=Object.entries(e.specialPurposes||{}).map(([s,n])=>{let a=Object.entries(e.vendors).filter(([,e])=>e.specialPurposes?.includes(Number(s))).map(([e,s])=>t(e,s));return{id:Number(s),name:n.name,description:n.description,descriptionLegal:n.descriptionLegal,illustrations:n.illustrations||[],vendors:a,isSpecialPurpose:!0}}).filter(e=>e.vendors.length>0),r=Object.entries(e.specialFeatures||{}).map(([s,n])=>{let a=Object.entries(e.vendors).filter(([,e])=>e.specialFeatures?.includes(Number(s))).map(([e,s])=>t(e,s));return{id:Number(s),name:n.name,description:n.description,descriptionLegal:n.descriptionLegal,illustrations:n.illustrations||[],vendors:a}}).filter(e=>e.vendors.length>0),c=Object.entries(e.features||{}).map(([s,n])=>{let a=Object.entries(e.vendors).filter(([,e])=>e.features?.includes(Number(s))).map(([e,s])=>t(e,s));return{id:Number(s),name:n.name,description:n.description,descriptionLegal:n.descriptionLegal,illustrations:n.illustrations||[],vendors:a}}).filter(e=>e.vendors.length>0),o=n.find(e=>1===e.id),i=n.filter(e=>1!==e.id),l=new Set(i.map(e=>e.id)),_=e.stacks||{},d=[];for(let[e,s]of Object.entries(_)){let t=Number(e),n=s.purposes.filter(e=>l.has(e));n.length>=2&&d.push({stackId:t,stack:s,coveredPurposeIds:n,score:n.length})}d.sort((e,s)=>s.score-e.score);let m=[],p=new Set;for(let{stackId:e,stack:s,coveredPurposeIds:t}of d){let n=t.filter(e=>!p.has(e));if(n.length>=2){let t=i.filter(e=>n.includes(e.id));for(let a of(m.push({id:e,name:s.name,description:s.description,purposes:t}),n))p.add(a)}}let j=i.filter(e=>!p.has(e.id));return{purposes:n,specialPurposes:a,specialFeatures:r,features:c,stacks:m,standalonePurposes:o?[o,...j]:j}},[u?.gvl,u?.nonIABVendors]),$=(0,external_react_namespaceObject.useMemo)(()=>u?.gvl?Object.keys(u.gvl.vendors).length+(u.nonIABVendors?.length??0):0,[u?.gvl,u?.nonIABVendors]),E=(0,external_react_namespaceObject.useCallback)((e,s)=>{u?.setPurposeConsent(e,s)},[u]),z=(0,external_react_namespaceObject.useCallback)((e,s)=>{u?.setSpecialFeatureOptIn(e,s)},[u]),H=(0,external_react_namespaceObject.useCallback)((e,s)=>{u?.setVendorConsent(e,s)},[u]),W=(0,external_react_namespaceObject.useCallback)((e,s)=>{u?.setVendorLegitimateInterest(e,s)},[u]),G=(0,external_react_namespaceObject.useCallback)((e,s)=>{u?.setPurposeLegitimateInterest(e,s)},[u]),K=e=>{N(e),y("vendors"),g({tab:"vendors"})};(0,use_focus_trap_cjs_namespaceObject.useFocusTrap)(!!(A&&V.trapFocus),v),(0,use_scroll_lock_cjs_namespaceObject.useScrollLock)(!!(A&&V.scrollLock)),(0,external_react_namespaceObject.useEffect)(()=>{T(!0)},[]),(0,external_react_namespaceObject.useEffect)(()=>{if(A)w(!0);else if(V.disableAnimation)w(!1);else{let e=setTimeout(()=>{w(!1)},150);return()=>clearTimeout(e)}},[A,V.disableAnimation]),(0,external_react_namespaceObject.useEffect)(()=>{A&&u?.preferenceCenterTab&&y(u.preferenceCenterTab)},[A,u?.preferenceCenterTab]),(0,external_react_namespaceObject.useLayoutEffect)(()=>{let e,s,t=h.current;if(!t||null===k.current)return;let n=k.current;if(k.current=null,!window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.style.height=`${n}px`,t.style.overflow="hidden",t.style.transition="none",e=requestAnimationFrame(()=>{s=requestAnimationFrame(()=>{if(!t)return;t.style.height="auto";let e=t.getBoundingClientRect().height;if(t.style.height=`${n}px`,1>Math.abs(n-e)){t.style.height="",t.style.overflow="",t.style.transition="";return}t.offsetHeight,t.style.transition="height 180ms cubic-bezier(0.33, 1, 0.68, 1)",t.style.height=`${e}px`,t.addEventListener("transitionend",e=>{"height"===e.propertyName&&(t.style.height="",t.style.overflow="",t.style.transition="")},{once:!0})})}),()=>{cancelAnimationFrame(e),cancelAnimationFrame(s)}},[C]);let J=(0,external_react_namespaceObject.useCallback)(e=>{h.current&&(k.current=h.current.offsetHeight),y(e),g({tab:e})},[g]);if(!S||!u?.config.enabled)return null;let Q=u.isLoadingGVL||!u.gvl,X=(0,jsx_runtime_namespaceObject.jsxs)(consent_tracking_context_cjs_namespaceObject.ConsentTrackingContext.Provider,{value:{uiSource:i??"iab_dialog"},children:[(0,jsx_runtime_namespaceObject.jsx)(overlay_cjs_namespaceObject.IABConsentDialogOverlay,{isOpen:A}),(0,jsx_runtime_namespaceObject.jsx)("div",{className:`${iab_consent_dialog_module_js_default().root} ${q?iab_consent_dialog_module_js_default().dialogVisible:iab_consent_dialog_module_js_default().dialogHidden}`,"data-testid":"iab-consent-dialog-root",dir:O,children:(0,jsx_runtime_namespaceObject.jsxs)("div",{ref:v,className:`${iab_consent_dialog_module_js_default().card} ${q?iab_consent_dialog_module_js_default().contentVisible:iab_consent_dialog_module_js_default().contentHidden}`,role:"dialog","aria-modal":V.trapFocus?"true":void 0,"aria-label":l.preferenceCenter.title,tabIndex:0,"data-testid":"iab-consent-dialog-card",children:[(0,jsx_runtime_namespaceObject.jsxs)("div",{className:iab_consent_dialog_module_js_default().header,children:[(0,jsx_runtime_namespaceObject.jsxs)("div",{className:iab_consent_dialog_module_js_default().headerContent,children:[(0,jsx_runtime_namespaceObject.jsx)("h2",{className:iab_consent_dialog_module_js_default().title,children:l.preferenceCenter.title}),(0,jsx_runtime_namespaceObject.jsx)("p",{className:iab_consent_dialog_module_js_default().description,children:l.preferenceCenter.description})]}),(0,jsx_runtime_namespaceObject.jsx)("button",{type:"button",onClick:()=>{b()},className:iab_consent_dialog_module_js_default().closeButton,"aria-label":_.close,children:(0,jsx_runtime_namespaceObject.jsxs)("svg",{style:{width:"1rem",height:"1rem"},viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,jsx_runtime_namespaceObject.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,jsx_runtime_namespaceObject.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),(0,jsx_runtime_namespaceObject.jsxs)(tabs_index_cjs_namespaceObject.Root,{className:iab_consent_dialog_module_js_default().body,noStyle:!0,onValueChange:e=>J(e),value:C,children:[(0,jsx_runtime_namespaceObject.jsx)("div",{className:iab_consent_dialog_module_js_default().tabsContainer,children:(0,jsx_runtime_namespaceObject.jsxs)(tabs_index_cjs_namespaceObject.List,{className:iab_consent_dialog_module_js_default().tabsList,noStyle:!0,children:[(0,jsx_runtime_namespaceObject.jsxs)(tabs_index_cjs_namespaceObject.Trigger,{className:iab_consent_dialog_module_js_default().tabButton,noStyle:!0,value:"purposes",children:[l.preferenceCenter.tabs.purposes,!Q&&` (${B.length+F.length+M.length+R.length})`]}),(0,jsx_runtime_namespaceObject.jsxs)(tabs_index_cjs_namespaceObject.Trigger,{className:iab_consent_dialog_module_js_default().tabButton,noStyle:!0,value:"vendors",children:[l.preferenceCenter.tabs.vendors,!Q&&` (${$})`]}),(0,jsx_runtime_namespaceObject.jsx)("div",{"aria-hidden":"true",className:iab_consent_dialog_module_js_default().tabIndicator,"data-active-tab":C})]})}),(0,jsx_runtime_namespaceObject.jsx)("div",{ref:h,className:iab_consent_dialog_module_js_default().content,children:Q?(0,jsx_runtime_namespaceObject.jsxs)("div",{className:iab_consent_dialog_module_js_default().loadingContainer,children:[(0,jsx_runtime_namespaceObject.jsx)("div",{className:iab_consent_dialog_module_js_default().loadingSpinner}),(0,jsx_runtime_namespaceObject.jsx)("p",{className:iab_consent_dialog_module_js_default().loadingText,children:l.common.loading})]}):(0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment,{children:[(0,jsx_runtime_namespaceObject.jsxs)(tabs_index_cjs_namespaceObject.Content,{className:iab_consent_dialog_module_js_default().tabPanel,forceMount:!0,noStyle:!0,value:"purposes",children:[U.map(e=>(0,jsx_runtime_namespaceObject.jsx)(purpose_item_cjs_namespaceObject.PurposeItem,{purpose:e,isEnabled:u.purposeConsents[e.id]??!1,onToggle:s=>E(e.id,s),vendorConsents:u.vendorConsents,onVendorToggle:H,onVendorClick:K,vendorLegitimateInterests:u.vendorLegitimateInterests,onVendorLegitimateInterestToggle:W,purposeLegitimateInterests:u.purposeLegitimateInterests,onPurposeLegitimateInterestToggle:G},e.id)),D.map(e=>(0,jsx_runtime_namespaceObject.jsx)(stack_item_cjs_namespaceObject.StackItem,{stack:e,consents:u.purposeConsents,onToggle:E,vendorConsents:u.vendorConsents,onVendorToggle:H,onVendorClick:K,vendorLegitimateInterests:u.vendorLegitimateInterests,onVendorLegitimateInterestToggle:W,purposeLegitimateInterests:u.purposeLegitimateInterests,onPurposeLegitimateInterestToggle:G},e.id)),M.map(e=>(0,jsx_runtime_namespaceObject.jsx)(purpose_item_cjs_namespaceObject.PurposeItem,{purpose:{id:e.id,name:e.name,description:e.description,illustrations:e.illustrations,vendors:e.vendors},isEnabled:u.specialFeatureOptIns[e.id]??!1,onToggle:s=>z(e.id,s),vendorConsents:u.vendorConsents,onVendorToggle:H,onVendorClick:K,vendorLegitimateInterests:u.vendorLegitimateInterests,onVendorLegitimateInterestToggle:W},`feature-${e.id}`)),(F.length>0||R.length>0)&&(0,jsx_runtime_namespaceObject.jsxs)("div",{className:iab_consent_dialog_module_js_default().specialPurposesSection,children:[(0,jsx_runtime_namespaceObject.jsxs)("div",{className:iab_consent_dialog_module_js_default().specialPurposesHeader,children:[(0,jsx_runtime_namespaceObject.jsxs)("button",{type:"button",onClick:()=>P(!L),className:iab_consent_dialog_module_js_default().purposeTrigger,children:[(0,jsx_runtime_namespaceObject.jsx)("svg",{className:iab_consent_dialog_module_js_default().purposeArrow,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:L?(0,jsx_runtime_namespaceObject.jsx)("path",{d:"M19 9l-7 7-7-7"}):(0,jsx_runtime_namespaceObject.jsx)("path",{d:"M9 5l7 7-7 7"})}),(0,jsx_runtime_namespaceObject.jsxs)("div",{className:iab_consent_dialog_module_js_default().purposeInfo,children:[(0,jsx_runtime_namespaceObject.jsxs)("h3",{className:iab_consent_dialog_module_js_default().specialPurposesTitle,children:[l.preferenceCenter.specialPurposes.title,(0,jsx_runtime_namespaceObject.jsxs)("svg",{className:iab_consent_dialog_module_js_default().lockIcon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,jsx_runtime_namespaceObject.jsx)("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),(0,jsx_runtime_namespaceObject.jsx)("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})]}),(0,jsx_runtime_namespaceObject.jsxs)("p",{className:iab_consent_dialog_module_js_default().purposeMeta,children:[new Set([...F.flatMap(e=>e.vendors.map(e=>e.id)),...R.flatMap(e=>e.vendors.map(e=>e.id))]).size," ","partners"]})]})]}),(0,jsx_runtime_namespaceObject.jsx)("div",{style:{position:"relative"},children:(0,jsx_runtime_namespaceObject.jsxs)("svg",{className:iab_consent_dialog_module_js_default().infoIcon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-label":l.preferenceCenter.specialPurposes.tooltip,children:[(0,jsx_runtime_namespaceObject.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,jsx_runtime_namespaceObject.jsx)("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),(0,jsx_runtime_namespaceObject.jsx)("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})})]}),L&&(0,jsx_runtime_namespaceObject.jsxs)("div",{style:{padding:"0.75rem"},children:[F.map(e=>(0,jsx_runtime_namespaceObject.jsx)(purpose_item_cjs_namespaceObject.PurposeItem,{purpose:e,isEnabled:!0,onToggle:()=>{},vendorConsents:u.vendorConsents,onVendorToggle:H,onVendorClick:K,isLocked:!0},`special-${e.id}`)),R.map(e=>(0,jsx_runtime_namespaceObject.jsx)(purpose_item_cjs_namespaceObject.PurposeItem,{purpose:{id:e.id,name:e.name,description:e.description,illustrations:e.illustrations,vendors:e.vendors},isEnabled:!0,onToggle:()=>{},vendorConsents:u.vendorConsents,onVendorToggle:H,onVendorClick:K,isLocked:!0},`feature-${e.id}`))]})]}),(0,jsx_runtime_namespaceObject.jsx)("div",{className:iab_consent_dialog_module_js_default().consentNotice,children:(0,jsx_runtime_namespaceObject.jsx)("p",{className:iab_consent_dialog_module_js_default().consentNoticeText,children:l.preferenceCenter.footer.consentStorage})})]}),(0,jsx_runtime_namespaceObject.jsx)(tabs_index_cjs_namespaceObject.Content,{className:iab_consent_dialog_module_js_default().tabPanel,forceMount:!0,noStyle:!0,value:"vendors",children:(0,jsx_runtime_namespaceObject.jsx)(vendor_list_cjs_namespaceObject.VendorList,{vendorData:u.gvl,purposes:B,vendorConsents:u.vendorConsents,onVendorToggle:H,selectedVendorId:I,onClearSelection:()=>N(null),customVendors:u.nonIABVendors,vendorLegitimateInterests:u.vendorLegitimateInterests,onVendorLegitimateInterestToggle:W})})]})})]}),(0,jsx_runtime_namespaceObject.jsxs)("div",{className:iab_consent_dialog_module_js_default().footer,children:[(0,jsx_runtime_namespaceObject.jsxs)("div",{className:iab_consent_dialog_module_js_default().footerButtons,children:[(0,jsx_runtime_namespaceObject.jsx)(button_index_cjs_namespaceObject.Root,{variant:"neutral",mode:"stroke",size:"small",onClick:()=>{x("reject")},disabled:Q,children:l.common.rejectAll}),(0,jsx_runtime_namespaceObject.jsx)(button_index_cjs_namespaceObject.Root,{variant:"neutral",mode:"stroke",size:"small",onClick:()=>{x("accept")},disabled:Q,children:l.common.acceptAll})]}),(0,jsx_runtime_namespaceObject.jsx)("div",{className:iab_consent_dialog_module_js_default().footerSpacer}),(0,jsx_runtime_namespaceObject.jsx)(button_index_cjs_namespaceObject.Root,{variant:"primary",mode:"filled",size:"small",onClick:()=>{x("customize")},disabled:Q,children:l.common.saveSettings})]}),(0,jsx_runtime_namespaceObject.jsx)(card_cjs_namespaceObject.Branding,{hideBranding:r??!1,variant:"dialog-tag",themeKey:"iabConsentDialogTag","data-testid":"iab-consent-dialog-branding"})]})})]}),Y=!0===c?{}:!1===c?null:c,Z=Y?(0,jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.ConsentDialogTrigger,{...Y}):null;return A||q?(0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment,{children:[Z,(0,external_react_dom_namespaceObject.createPortal)(X,document.body)]}):Z};for(var __rspack_i in exports.IABConsentDialog=__webpack_exports__.IABConsentDialog,__webpack_exports__)-1===["IABConsentDialog"].indexOf(__rspack_i)&&(exports[__rspack_i]=__webpack_exports__[__rspack_i]);Object.defineProperty(exports,"__esModule",{value:!0});
@@ -1 +1 @@
1
- import{Fragment as e,jsx as s,jsxs as t}from"react/jsx-runtime";import n from"@c15t/ui/styles/components/iab-consent-dialog.module.js";import{useCallback as o,useEffect as r,useLayoutEffect as i,useMemo as l,useRef as a,useState as d}from"react";import{createPortal as c}from"react-dom";import{Branding as u}from"../consent-dialog/atoms/card.js";import{ConsentDialogTrigger as p}from"../consent-dialog-trigger/index.js";import{ConsentTrackingContext as m}from"../../context/consent-tracking-context.js";import{useComponentConfig as g}from"../../hooks/use-component-config.js";import{useConsentManager as h}from"../../hooks/use-consent-manager.js";import{useFocusTrap as v}from"../../hooks/use-focus-trap.js";import{useHeadlessIABConsentUI as f}from"../../hooks/use-headless-iab-consent-ui.js";import{useScrollLock as b}from"../../hooks/use-scroll-lock.js";import{useTextDirection as C}from"../../hooks/use-text-direction.js";import{useTranslations as k}from"../../hooks/use-translations.js";import{IABConsentDialogOverlay as N}from"./atoms/overlay.js";import{PurposeItem as I}from"./atoms/purpose-item.js";import{StackItem as y}from"./atoms/stack-item.js";import{VendorList as L}from"./atoms/vendor-list.js";import{useIABTranslations as x}from"./use-iab-translations.js";import*as P from"../shared/ui/button/index.js";import*as j from"../shared/ui/tabs/index.js";let T=({open:T,noStyle:V,disableAnimation:S,scrollLock:A,trapFocus:F=!0,hideBranding:B,showTrigger:w=!1,models:M=["iab"],uiSource:O})=>{let $=x(),{common:R}=k(),{iab:U,activeUI:z,policyDialog:D,translationConfig:E,model:H}=h(),{closeUI:W,openDialog:q,performDialogAction:G}=f(),_=A??D.scrollLock??!0,J=C(E.defaultLanguage),K=a(null),Q=a(null),X=a(null),[Y,Z]=d(U?.preferenceCenterTab??"purposes"),[ee,es]=d(null),[et,en]=d(!1),[eo,er]=d(!1),[ei,el]=d(!1),ea=T??("dialog"===z&&M.includes(H)),ed=g({noStyle:V,disableAnimation:S,scrollLock:_,trapFocus:F}),{purposes:ec,specialPurposes:eu,specialFeatures:ep,features:em,stacks:eg,standalonePurposes:eh}=l(()=>{if(!U?.gvl)return{purposes:[],specialPurposes:[],specialFeatures:[],features:[],stacks:[],standalonePurposes:[]};let e=U.gvl,s=U.nonIABVendors||[],t=(e,s,t)=>({id:Number(e),name:s.name,policyUrl:s.policyUrl??"",usesNonCookieAccess:s.usesNonCookieAccess,deviceStorageDisclosureUrl:s.deviceStorageDisclosureUrl??null,usesCookies:s.usesCookies,cookieMaxAgeSeconds:s.cookieMaxAgeSeconds,cookieRefresh:s.cookieRefresh,legitimateInterestUrl:s.urls?.find(e=>e.legIntClaim)?.legIntClaim??null,specialPurposes:s.specialPurposes||[],specialFeatures:s.specialFeatures||[],features:s.features||[],purposes:s.purposes||[],legIntPurposes:s.legIntPurposes||[],usesLegitimateInterest:!!t&&(s.legIntPurposes?.includes(t)??!1),dataRetention:s.dataRetention,isCustom:!1}),n=Object.entries(e.purposes).map(([n,o])=>{let r=Object.entries(e.vendors).filter(([,e])=>e.purposes?.includes(Number(n))||e.legIntPurposes?.includes(Number(n))).map(([e,s])=>t(e,s,Number(n))),i=s.filter(e=>e.purposes?.includes(Number(n))||e.legIntPurposes?.includes(Number(n))).map(e=>{let s;return s=Number(n),{id:e.id,name:e.name,policyUrl:e.privacyPolicyUrl,usesNonCookieAccess:e.usesNonCookieAccess??!1,deviceStorageDisclosureUrl:null,usesCookies:e.usesCookies??!1,cookieMaxAgeSeconds:e.cookieMaxAgeSeconds??null,cookieRefresh:void 0,legitimateInterestUrl:null,specialPurposes:[],specialFeatures:e.specialFeatures||[],features:e.features||[],purposes:e.purposes||[],legIntPurposes:e.legIntPurposes||[],usesLegitimateInterest:!!s&&(e.legIntPurposes?.includes(s)??!1),dataRetention:void 0,isCustom:!0}});return{id:Number(n),name:o.name,description:o.description,descriptionLegal:o.descriptionLegal,illustrations:o.illustrations||[],vendors:[...r,...i]}}).filter(e=>e.vendors.length>0),o=Object.entries(e.specialPurposes||{}).map(([s,n])=>{let o=Object.entries(e.vendors).filter(([,e])=>e.specialPurposes?.includes(Number(s))).map(([e,s])=>t(e,s));return{id:Number(s),name:n.name,description:n.description,descriptionLegal:n.descriptionLegal,illustrations:n.illustrations||[],vendors:o,isSpecialPurpose:!0}}).filter(e=>e.vendors.length>0),r=Object.entries(e.specialFeatures||{}).map(([s,n])=>{let o=Object.entries(e.vendors).filter(([,e])=>e.specialFeatures?.includes(Number(s))).map(([e,s])=>t(e,s));return{id:Number(s),name:n.name,description:n.description,descriptionLegal:n.descriptionLegal,illustrations:n.illustrations||[],vendors:o}}).filter(e=>e.vendors.length>0),i=Object.entries(e.features||{}).map(([s,n])=>{let o=Object.entries(e.vendors).filter(([,e])=>e.features?.includes(Number(s))).map(([e,s])=>t(e,s));return{id:Number(s),name:n.name,description:n.description,descriptionLegal:n.descriptionLegal,illustrations:n.illustrations||[],vendors:o}}).filter(e=>e.vendors.length>0),l=n.find(e=>1===e.id),a=n.filter(e=>1!==e.id),d=new Set(a.map(e=>e.id)),c=e.stacks||{},u=[];for(let[e,s]of Object.entries(c)){let t=Number(e),n=s.purposes.filter(e=>d.has(e));n.length>=2&&u.push({stackId:t,stack:s,coveredPurposeIds:n,score:n.length})}u.sort((e,s)=>s.score-e.score);let p=[],m=new Set;for(let{stackId:e,stack:s,coveredPurposeIds:t}of u){let n=t.filter(e=>!m.has(e));if(n.length>=2){let t=a.filter(e=>n.includes(e.id));for(let o of(p.push({id:e,name:s.name,description:s.description,purposes:t}),n))m.add(o)}}let g=a.filter(e=>!m.has(e.id));return{purposes:n,specialPurposes:o,specialFeatures:r,features:i,stacks:p,standalonePurposes:l?[l,...g]:g}},[U?.gvl,U?.nonIABVendors]),ev=l(()=>U?.gvl?Object.keys(U.gvl.vendors).length+(U.nonIABVendors?.length??0):0,[U?.gvl,U?.nonIABVendors]),ef=o((e,s)=>{U?.setPurposeConsent(e,s)},[U]),eb=o((e,s)=>{U?.setSpecialFeatureOptIn(e,s)},[U]),eC=o((e,s)=>{U?.setVendorConsent(e,s)},[U]),ek=o((e,s)=>{U?.setVendorLegitimateInterest(e,s)},[U]),eN=o((e,s)=>{U?.setPurposeLegitimateInterest(e,s)},[U]),eI=e=>{es(e),Z("vendors"),q({tab:"vendors"})};v(!!(ea&&ed.trapFocus),K),b(!!(ea&&ed.scrollLock)),r(()=>{er(!0)},[]),r(()=>{if(ea)el(!0);else if(ed.disableAnimation)el(!1);else{let e=setTimeout(()=>{el(!1)},150);return()=>clearTimeout(e)}},[ea,ed.disableAnimation]),r(()=>{ea&&U?.preferenceCenterTab&&Z(U.preferenceCenterTab)},[ea,U?.preferenceCenterTab]),i(()=>{let e,s,t=Q.current;if(!t||null===X.current)return;let n=X.current;if(X.current=null,!window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.style.height=`${n}px`,t.style.overflow="hidden",t.style.transition="none",e=requestAnimationFrame(()=>{s=requestAnimationFrame(()=>{if(!t)return;t.style.height="auto";let e=t.getBoundingClientRect().height;if(t.style.height=`${n}px`,1>Math.abs(n-e)){t.style.height="",t.style.overflow="",t.style.transition="";return}t.offsetHeight,t.style.transition="height 180ms cubic-bezier(0.33, 1, 0.68, 1)",t.style.height=`${e}px`,t.addEventListener("transitionend",e=>{"height"===e.propertyName&&(t.style.height="",t.style.overflow="",t.style.transition="")},{once:!0})})}),()=>{cancelAnimationFrame(e),cancelAnimationFrame(s)}},[Y]);let ey=o(e=>{Q.current&&(X.current=Q.current.offsetHeight),Z(e),q({tab:e})},[q]);if(!eo||!U?.config.enabled)return null;let eL=U.isLoadingGVL||!U.gvl,ex=t(m.Provider,{value:{uiSource:O??"iab_dialog"},children:[s(N,{isOpen:ea}),s("div",{className:`${n.root} ${ei?n.dialogVisible:n.dialogHidden}`,"data-testid":"iab-consent-dialog-root",dir:J,children:t("div",{ref:K,className:`${n.card} ${ei?n.contentVisible:n.contentHidden}`,role:"dialog","aria-modal":ed.trapFocus?"true":void 0,"aria-label":$.preferenceCenter.title,tabIndex:0,"data-testid":"iab-consent-dialog-card",children:[t("div",{className:n.header,children:[t("div",{className:n.headerContent,children:[s("h2",{className:n.title,children:$.preferenceCenter.title}),s("p",{className:n.description,children:$.preferenceCenter.description})]}),s("button",{type:"button",onClick:()=>{W()},className:n.closeButton,"aria-label":R.close,children:t("svg",{style:{width:"1rem",height:"1rem"},viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[s("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),s("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),t(j.Root,{className:n.body,noStyle:!0,onValueChange:e=>ey(e),value:Y,children:[s("div",{className:n.tabsContainer,children:t(j.List,{className:n.tabsList,noStyle:!0,children:[t(j.Trigger,{className:n.tabButton,noStyle:!0,value:"purposes",children:[$.preferenceCenter.tabs.purposes,!eL&&` (${ec.length+eu.length+ep.length+em.length})`]}),t(j.Trigger,{className:n.tabButton,noStyle:!0,value:"vendors",children:[$.preferenceCenter.tabs.vendors,!eL&&` (${ev})`]}),s("div",{"aria-hidden":"true",className:n.tabIndicator,"data-active-tab":Y})]})}),s("div",{ref:Q,className:n.content,children:eL?t("div",{className:n.loadingContainer,children:[s("div",{className:n.loadingSpinner}),s("p",{className:n.loadingText,children:$.common.loading})]}):t(e,{children:[t(j.Content,{className:n.tabPanel,forceMount:!0,noStyle:!0,value:"purposes",children:[eh.map(e=>s(I,{purpose:e,isEnabled:U.purposeConsents[e.id]??!1,onToggle:s=>ef(e.id,s),vendorConsents:U.vendorConsents,onVendorToggle:eC,onVendorClick:eI,vendorLegitimateInterests:U.vendorLegitimateInterests,onVendorLegitimateInterestToggle:ek,purposeLegitimateInterests:U.purposeLegitimateInterests,onPurposeLegitimateInterestToggle:eN},e.id)),eg.map(e=>s(y,{stack:e,consents:U.purposeConsents,onToggle:ef,vendorConsents:U.vendorConsents,onVendorToggle:eC,onVendorClick:eI,vendorLegitimateInterests:U.vendorLegitimateInterests,onVendorLegitimateInterestToggle:ek,purposeLegitimateInterests:U.purposeLegitimateInterests,onPurposeLegitimateInterestToggle:eN},e.id)),ep.map(e=>s(I,{purpose:{id:e.id,name:e.name,description:e.description,illustrations:e.illustrations,vendors:e.vendors},isEnabled:U.specialFeatureOptIns[e.id]??!1,onToggle:s=>eb(e.id,s),vendorConsents:U.vendorConsents,onVendorToggle:eC,onVendorClick:eI,vendorLegitimateInterests:U.vendorLegitimateInterests,onVendorLegitimateInterestToggle:ek},`feature-${e.id}`)),(eu.length>0||em.length>0)&&t("div",{className:n.specialPurposesSection,children:[t("div",{className:n.specialPurposesHeader,children:[t("button",{type:"button",onClick:()=>en(!et),className:n.purposeTrigger,children:[s("svg",{className:n.purposeArrow,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:et?s("path",{d:"M19 9l-7 7-7-7"}):s("path",{d:"M9 5l7 7-7 7"})}),t("div",{className:n.purposeInfo,children:[t("h3",{className:n.specialPurposesTitle,children:[$.preferenceCenter.specialPurposes.title,t("svg",{className:n.lockIcon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[s("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),s("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})]}),t("p",{className:n.purposeMeta,children:[new Set([...eu.flatMap(e=>e.vendors.map(e=>e.id)),...em.flatMap(e=>e.vendors.map(e=>e.id))]).size," ","partners"]})]})]}),s("div",{style:{position:"relative"},children:t("svg",{className:n.infoIcon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-label":$.preferenceCenter.specialPurposes.tooltip,children:[s("circle",{cx:"12",cy:"12",r:"10"}),s("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),s("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})})]}),et&&t("div",{style:{padding:"0.75rem"},children:[eu.map(e=>s(I,{purpose:e,isEnabled:!0,onToggle:()=>{},vendorConsents:U.vendorConsents,onVendorToggle:eC,onVendorClick:eI,isLocked:!0},`special-${e.id}`)),em.map(e=>s(I,{purpose:{id:e.id,name:e.name,description:e.description,illustrations:e.illustrations,vendors:e.vendors},isEnabled:!0,onToggle:()=>{},vendorConsents:U.vendorConsents,onVendorToggle:eC,onVendorClick:eI,isLocked:!0},`feature-${e.id}`))]})]}),s("div",{className:n.consentNotice,children:s("p",{className:n.consentNoticeText,children:$.preferenceCenter.footer.consentStorage})})]}),s(j.Content,{className:n.tabPanel,forceMount:!0,noStyle:!0,value:"vendors",children:s(L,{vendorData:U.gvl,purposes:ec,vendorConsents:U.vendorConsents,onVendorToggle:eC,selectedVendorId:ee,onClearSelection:()=>es(null),customVendors:U.nonIABVendors,vendorLegitimateInterests:U.vendorLegitimateInterests,onVendorLegitimateInterestToggle:ek})})]})})]}),t("div",{className:n.footer,children:[t("div",{className:n.footerButtons,children:[s(P.Root,{variant:"neutral",mode:"stroke",size:"small",onClick:()=>{G("reject")},disabled:eL,children:$.common.rejectAll}),s(P.Root,{variant:"neutral",mode:"stroke",size:"small",onClick:()=>{G("accept")},disabled:eL,children:$.common.acceptAll})]}),s("div",{className:n.footerSpacer}),s(P.Root,{variant:"primary",mode:"filled",size:"small",onClick:()=>{G("customize")},disabled:eL,children:$.common.saveSettings})]}),s(u,{hideBranding:B??!1,variant:"dialog-tag","data-testid":"iab-consent-dialog-branding"})]})})]}),eP=!0===w?{}:!1===w?null:w,ej=eP?s(p,{...eP}):null;return ea||ei?t(e,{children:[ej,c(ex,document.body)]}):ej};export{T as IABConsentDialog};
1
+ import{Fragment as e,jsx as s,jsxs as t}from"react/jsx-runtime";import n from"@c15t/ui/styles/components/iab-consent-dialog.module.js";import{useCallback as o,useEffect as r,useLayoutEffect as i,useMemo as l,useRef as a,useState as d}from"react";import{createPortal as c}from"react-dom";import{Branding as u}from"../consent-dialog/atoms/card.js";import{ConsentDialogTrigger as p}from"../consent-dialog-trigger/index.js";import{ConsentTrackingContext as m}from"../../context/consent-tracking-context.js";import{useComponentConfig as g}from"../../hooks/use-component-config.js";import{useConsentManager as h}from"../../hooks/use-consent-manager.js";import{useFocusTrap as v}from"../../hooks/use-focus-trap.js";import{useHeadlessIABConsentUI as f}from"../../hooks/use-headless-iab-consent-ui.js";import{useScrollLock as b}from"../../hooks/use-scroll-lock.js";import{useTextDirection as C}from"../../hooks/use-text-direction.js";import{useTranslations as k}from"../../hooks/use-translations.js";import{IABConsentDialogOverlay as N}from"./atoms/overlay.js";import{PurposeItem as y}from"./atoms/purpose-item.js";import{StackItem as I}from"./atoms/stack-item.js";import{VendorList as L}from"./atoms/vendor-list.js";import{useIABTranslations as x}from"./use-iab-translations.js";import*as P from"../shared/ui/button/index.js";import*as j from"../shared/ui/tabs/index.js";let T=({open:T,noStyle:V,disableAnimation:S,scrollLock:A,trapFocus:F=!0,hideBranding:B,showTrigger:w=!1,models:M=["iab"],uiSource:O})=>{let $=x(),{common:R}=k(),{iab:U,activeUI:z,policyDialog:D,translationConfig:E,model:H}=h(),{closeUI:W,openDialog:q,performDialogAction:G}=f(),K=A??D.scrollLock??!0,_=C(E.defaultLanguage),J=a(null),Q=a(null),X=a(null),[Y,Z]=d(U?.preferenceCenterTab??"purposes"),[ee,es]=d(null),[et,en]=d(!1),[eo,er]=d(!1),[ei,el]=d(!1),ea=T??("dialog"===z&&M.includes(H)),ed=g({noStyle:V,disableAnimation:S,scrollLock:K,trapFocus:F}),{purposes:ec,specialPurposes:eu,specialFeatures:ep,features:em,stacks:eg,standalonePurposes:eh}=l(()=>{if(!U?.gvl)return{purposes:[],specialPurposes:[],specialFeatures:[],features:[],stacks:[],standalonePurposes:[]};let e=U.gvl,s=U.nonIABVendors||[],t=(e,s,t)=>({id:Number(e),name:s.name,policyUrl:s.policyUrl??"",usesNonCookieAccess:s.usesNonCookieAccess,deviceStorageDisclosureUrl:s.deviceStorageDisclosureUrl??null,usesCookies:s.usesCookies,cookieMaxAgeSeconds:s.cookieMaxAgeSeconds,cookieRefresh:s.cookieRefresh,legitimateInterestUrl:s.urls?.find(e=>e.legIntClaim)?.legIntClaim??null,specialPurposes:s.specialPurposes||[],specialFeatures:s.specialFeatures||[],features:s.features||[],purposes:s.purposes||[],legIntPurposes:s.legIntPurposes||[],usesLegitimateInterest:!!t&&(s.legIntPurposes?.includes(t)??!1),dataRetention:s.dataRetention,isCustom:!1}),n=Object.entries(e.purposes).map(([n,o])=>{let r=Object.entries(e.vendors).filter(([,e])=>e.purposes?.includes(Number(n))||e.legIntPurposes?.includes(Number(n))).map(([e,s])=>t(e,s,Number(n))),i=s.filter(e=>e.purposes?.includes(Number(n))||e.legIntPurposes?.includes(Number(n))).map(e=>{let s;return s=Number(n),{id:e.id,name:e.name,policyUrl:e.privacyPolicyUrl,usesNonCookieAccess:e.usesNonCookieAccess??!1,deviceStorageDisclosureUrl:null,usesCookies:e.usesCookies??!1,cookieMaxAgeSeconds:e.cookieMaxAgeSeconds??null,cookieRefresh:void 0,legitimateInterestUrl:null,specialPurposes:[],specialFeatures:e.specialFeatures||[],features:e.features||[],purposes:e.purposes||[],legIntPurposes:e.legIntPurposes||[],usesLegitimateInterest:!!s&&(e.legIntPurposes?.includes(s)??!1),dataRetention:void 0,isCustom:!0}});return{id:Number(n),name:o.name,description:o.description,descriptionLegal:o.descriptionLegal,illustrations:o.illustrations||[],vendors:[...r,...i]}}).filter(e=>e.vendors.length>0),o=Object.entries(e.specialPurposes||{}).map(([s,n])=>{let o=Object.entries(e.vendors).filter(([,e])=>e.specialPurposes?.includes(Number(s))).map(([e,s])=>t(e,s));return{id:Number(s),name:n.name,description:n.description,descriptionLegal:n.descriptionLegal,illustrations:n.illustrations||[],vendors:o,isSpecialPurpose:!0}}).filter(e=>e.vendors.length>0),r=Object.entries(e.specialFeatures||{}).map(([s,n])=>{let o=Object.entries(e.vendors).filter(([,e])=>e.specialFeatures?.includes(Number(s))).map(([e,s])=>t(e,s));return{id:Number(s),name:n.name,description:n.description,descriptionLegal:n.descriptionLegal,illustrations:n.illustrations||[],vendors:o}}).filter(e=>e.vendors.length>0),i=Object.entries(e.features||{}).map(([s,n])=>{let o=Object.entries(e.vendors).filter(([,e])=>e.features?.includes(Number(s))).map(([e,s])=>t(e,s));return{id:Number(s),name:n.name,description:n.description,descriptionLegal:n.descriptionLegal,illustrations:n.illustrations||[],vendors:o}}).filter(e=>e.vendors.length>0),l=n.find(e=>1===e.id),a=n.filter(e=>1!==e.id),d=new Set(a.map(e=>e.id)),c=e.stacks||{},u=[];for(let[e,s]of Object.entries(c)){let t=Number(e),n=s.purposes.filter(e=>d.has(e));n.length>=2&&u.push({stackId:t,stack:s,coveredPurposeIds:n,score:n.length})}u.sort((e,s)=>s.score-e.score);let p=[],m=new Set;for(let{stackId:e,stack:s,coveredPurposeIds:t}of u){let n=t.filter(e=>!m.has(e));if(n.length>=2){let t=a.filter(e=>n.includes(e.id));for(let o of(p.push({id:e,name:s.name,description:s.description,purposes:t}),n))m.add(o)}}let g=a.filter(e=>!m.has(e.id));return{purposes:n,specialPurposes:o,specialFeatures:r,features:i,stacks:p,standalonePurposes:l?[l,...g]:g}},[U?.gvl,U?.nonIABVendors]),ev=l(()=>U?.gvl?Object.keys(U.gvl.vendors).length+(U.nonIABVendors?.length??0):0,[U?.gvl,U?.nonIABVendors]),ef=o((e,s)=>{U?.setPurposeConsent(e,s)},[U]),eb=o((e,s)=>{U?.setSpecialFeatureOptIn(e,s)},[U]),eC=o((e,s)=>{U?.setVendorConsent(e,s)},[U]),ek=o((e,s)=>{U?.setVendorLegitimateInterest(e,s)},[U]),eN=o((e,s)=>{U?.setPurposeLegitimateInterest(e,s)},[U]),ey=e=>{es(e),Z("vendors"),q({tab:"vendors"})};v(!!(ea&&ed.trapFocus),J),b(!!(ea&&ed.scrollLock)),r(()=>{er(!0)},[]),r(()=>{if(ea)el(!0);else if(ed.disableAnimation)el(!1);else{let e=setTimeout(()=>{el(!1)},150);return()=>clearTimeout(e)}},[ea,ed.disableAnimation]),r(()=>{ea&&U?.preferenceCenterTab&&Z(U.preferenceCenterTab)},[ea,U?.preferenceCenterTab]),i(()=>{let e,s,t=Q.current;if(!t||null===X.current)return;let n=X.current;if(X.current=null,!window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.style.height=`${n}px`,t.style.overflow="hidden",t.style.transition="none",e=requestAnimationFrame(()=>{s=requestAnimationFrame(()=>{if(!t)return;t.style.height="auto";let e=t.getBoundingClientRect().height;if(t.style.height=`${n}px`,1>Math.abs(n-e)){t.style.height="",t.style.overflow="",t.style.transition="";return}t.offsetHeight,t.style.transition="height 180ms cubic-bezier(0.33, 1, 0.68, 1)",t.style.height=`${e}px`,t.addEventListener("transitionend",e=>{"height"===e.propertyName&&(t.style.height="",t.style.overflow="",t.style.transition="")},{once:!0})})}),()=>{cancelAnimationFrame(e),cancelAnimationFrame(s)}},[Y]);let eI=o(e=>{Q.current&&(X.current=Q.current.offsetHeight),Z(e),q({tab:e})},[q]);if(!eo||!U?.config.enabled)return null;let eL=U.isLoadingGVL||!U.gvl,ex=t(m.Provider,{value:{uiSource:O??"iab_dialog"},children:[s(N,{isOpen:ea}),s("div",{className:`${n.root} ${ei?n.dialogVisible:n.dialogHidden}`,"data-testid":"iab-consent-dialog-root",dir:_,children:t("div",{ref:J,className:`${n.card} ${ei?n.contentVisible:n.contentHidden}`,role:"dialog","aria-modal":ed.trapFocus?"true":void 0,"aria-label":$.preferenceCenter.title,tabIndex:0,"data-testid":"iab-consent-dialog-card",children:[t("div",{className:n.header,children:[t("div",{className:n.headerContent,children:[s("h2",{className:n.title,children:$.preferenceCenter.title}),s("p",{className:n.description,children:$.preferenceCenter.description})]}),s("button",{type:"button",onClick:()=>{W()},className:n.closeButton,"aria-label":R.close,children:t("svg",{style:{width:"1rem",height:"1rem"},viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[s("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),s("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),t(j.Root,{className:n.body,noStyle:!0,onValueChange:e=>eI(e),value:Y,children:[s("div",{className:n.tabsContainer,children:t(j.List,{className:n.tabsList,noStyle:!0,children:[t(j.Trigger,{className:n.tabButton,noStyle:!0,value:"purposes",children:[$.preferenceCenter.tabs.purposes,!eL&&` (${ec.length+eu.length+ep.length+em.length})`]}),t(j.Trigger,{className:n.tabButton,noStyle:!0,value:"vendors",children:[$.preferenceCenter.tabs.vendors,!eL&&` (${ev})`]}),s("div",{"aria-hidden":"true",className:n.tabIndicator,"data-active-tab":Y})]})}),s("div",{ref:Q,className:n.content,children:eL?t("div",{className:n.loadingContainer,children:[s("div",{className:n.loadingSpinner}),s("p",{className:n.loadingText,children:$.common.loading})]}):t(e,{children:[t(j.Content,{className:n.tabPanel,forceMount:!0,noStyle:!0,value:"purposes",children:[eh.map(e=>s(y,{purpose:e,isEnabled:U.purposeConsents[e.id]??!1,onToggle:s=>ef(e.id,s),vendorConsents:U.vendorConsents,onVendorToggle:eC,onVendorClick:ey,vendorLegitimateInterests:U.vendorLegitimateInterests,onVendorLegitimateInterestToggle:ek,purposeLegitimateInterests:U.purposeLegitimateInterests,onPurposeLegitimateInterestToggle:eN},e.id)),eg.map(e=>s(I,{stack:e,consents:U.purposeConsents,onToggle:ef,vendorConsents:U.vendorConsents,onVendorToggle:eC,onVendorClick:ey,vendorLegitimateInterests:U.vendorLegitimateInterests,onVendorLegitimateInterestToggle:ek,purposeLegitimateInterests:U.purposeLegitimateInterests,onPurposeLegitimateInterestToggle:eN},e.id)),ep.map(e=>s(y,{purpose:{id:e.id,name:e.name,description:e.description,illustrations:e.illustrations,vendors:e.vendors},isEnabled:U.specialFeatureOptIns[e.id]??!1,onToggle:s=>eb(e.id,s),vendorConsents:U.vendorConsents,onVendorToggle:eC,onVendorClick:ey,vendorLegitimateInterests:U.vendorLegitimateInterests,onVendorLegitimateInterestToggle:ek},`feature-${e.id}`)),(eu.length>0||em.length>0)&&t("div",{className:n.specialPurposesSection,children:[t("div",{className:n.specialPurposesHeader,children:[t("button",{type:"button",onClick:()=>en(!et),className:n.purposeTrigger,children:[s("svg",{className:n.purposeArrow,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:et?s("path",{d:"M19 9l-7 7-7-7"}):s("path",{d:"M9 5l7 7-7 7"})}),t("div",{className:n.purposeInfo,children:[t("h3",{className:n.specialPurposesTitle,children:[$.preferenceCenter.specialPurposes.title,t("svg",{className:n.lockIcon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[s("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),s("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})]}),t("p",{className:n.purposeMeta,children:[new Set([...eu.flatMap(e=>e.vendors.map(e=>e.id)),...em.flatMap(e=>e.vendors.map(e=>e.id))]).size," ","partners"]})]})]}),s("div",{style:{position:"relative"},children:t("svg",{className:n.infoIcon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-label":$.preferenceCenter.specialPurposes.tooltip,children:[s("circle",{cx:"12",cy:"12",r:"10"}),s("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),s("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})})]}),et&&t("div",{style:{padding:"0.75rem"},children:[eu.map(e=>s(y,{purpose:e,isEnabled:!0,onToggle:()=>{},vendorConsents:U.vendorConsents,onVendorToggle:eC,onVendorClick:ey,isLocked:!0},`special-${e.id}`)),em.map(e=>s(y,{purpose:{id:e.id,name:e.name,description:e.description,illustrations:e.illustrations,vendors:e.vendors},isEnabled:!0,onToggle:()=>{},vendorConsents:U.vendorConsents,onVendorToggle:eC,onVendorClick:ey,isLocked:!0},`feature-${e.id}`))]})]}),s("div",{className:n.consentNotice,children:s("p",{className:n.consentNoticeText,children:$.preferenceCenter.footer.consentStorage})})]}),s(j.Content,{className:n.tabPanel,forceMount:!0,noStyle:!0,value:"vendors",children:s(L,{vendorData:U.gvl,purposes:ec,vendorConsents:U.vendorConsents,onVendorToggle:eC,selectedVendorId:ee,onClearSelection:()=>es(null),customVendors:U.nonIABVendors,vendorLegitimateInterests:U.vendorLegitimateInterests,onVendorLegitimateInterestToggle:ek})})]})})]}),t("div",{className:n.footer,children:[t("div",{className:n.footerButtons,children:[s(P.Root,{variant:"neutral",mode:"stroke",size:"small",onClick:()=>{G("reject")},disabled:eL,children:$.common.rejectAll}),s(P.Root,{variant:"neutral",mode:"stroke",size:"small",onClick:()=>{G("accept")},disabled:eL,children:$.common.acceptAll})]}),s("div",{className:n.footerSpacer}),s(P.Root,{variant:"primary",mode:"filled",size:"small",onClick:()=>{G("customize")},disabled:eL,children:$.common.saveSettings})]}),s(u,{hideBranding:B??!1,variant:"dialog-tag",themeKey:"iabConsentDialogTag","data-testid":"iab-consent-dialog-branding"})]})})]}),eP=!0===w?{}:!1===w?null:w,ej=eP?s(p,{...eP}):null;return ea||ei?t(e,{children:[ej,c(ex,document.body)]}):ej};export{T as IABConsentDialog};
@@ -1 +1 @@
1
- "use strict";const __rslib_import_meta_url__="u"<typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(n,{a:n}),n},__webpack_require__.d=(e,n)=>{for(var a in n)__webpack_require__.o(n,a)&&!__webpack_require__.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:n[a]})},__webpack_require__.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),__webpack_require__.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{getBrandingHref:()=>getBrandingHref,BrandingFullLogo:()=>BrandingFullLogo,resolveBranding:()=>resolveBranding,BrandingCompactLogo:()=>BrandingCompactLogo,BrandingLink:()=>BrandingLink});const jsx_runtime_namespaceObject=require("react/jsx-runtime"),consent_dialog_module_js_namespaceObject=require("@c15t/ui/styles/components/consent-dialog.module.js");var consent_dialog_module_js_default=__webpack_require__.n(consent_dialog_module_js_namespaceObject);const use_consent_manager_cjs_namespaceObject=require("../../../hooks/use-consent-manager.cjs"),use_translations_cjs_namespaceObject=require("../../../hooks/use-translations.cjs"),cn_cjs_namespaceObject=require("../../../utils/cn.cjs"),external_logo_cjs_namespaceObject=require("./logo.cjs");function resolveBranding(e){return"none"===e?"none":"inth"===e||"consent"===e?"inth":"c15t"}function getBrandingHref(e,n=""){return"inth"===resolveBranding(e)?`https://inth.com${n}`:`https://c15t.com${n}`}function BrandingFullLogo({branding:e,className:n}){return"inth"===resolveBranding(e)?(0,jsx_runtime_namespaceObject.jsx)(external_logo_cjs_namespaceObject.InthLogo,{className:n}):(0,jsx_runtime_namespaceObject.jsxs)("span",{dir:"ltr",className:(0,cn_cjs_namespaceObject.cnExt)(consent_dialog_module_js_default().brandingWordmark,n),children:[(0,jsx_runtime_namespaceObject.jsx)(external_logo_cjs_namespaceObject.C15TIconOnly,{className:consent_dialog_module_js_default().brandingC15TMark,"aria-hidden":"true"}),(0,jsx_runtime_namespaceObject.jsx)("span",{className:consent_dialog_module_js_default().brandingWordmarkLabel,children:"c15t"})]})}function BrandingCompactLogo({branding:e,...n}){let a="inth"===resolveBranding(e)?external_logo_cjs_namespaceObject.InthIconOnly:external_logo_cjs_namespaceObject.C15TIconOnly;return(0,jsx_runtime_namespaceObject.jsx)(a,{...n})}function BrandingLink({hideBranding:e,variant:n="footer",className:a,"data-testid":_}){let{branding:r}=(0,use_consent_manager_cjs_namespaceObject.useConsentManager)(),{common:t}=(0,use_translations_cjs_namespaceObject.useTranslations)(),o=resolveBranding(r);if("none"===o||e)return null;let s="u">typeof window?`?ref=${window.location.hostname}`:"";return(0,jsx_runtime_namespaceObject.jsxs)("a",{className:(0,cn_cjs_namespaceObject.cnExt)(consent_dialog_module_js_default().branding,"footer"!==n&&consent_dialog_module_js_default().brandingTag,"dialog-tag"===n&&consent_dialog_module_js_default().brandingTagDialog,"banner-tag"===n&&consent_dialog_module_js_default().brandingTagBanner,a),href:getBrandingHref(r,s),"data-branding":o,"data-variant":n,"data-testid":_,children:[(0,jsx_runtime_namespaceObject.jsx)("span",{className:consent_dialog_module_js_default().brandingCopy,children:(0,jsx_runtime_namespaceObject.jsx)("span",{className:consent_dialog_module_js_default().brandingText,children:t.securedBy})}),(0,jsx_runtime_namespaceObject.jsx)(BrandingFullLogo,{branding:r,className:"inth"===o?consent_dialog_module_js_default().brandingInth:consent_dialog_module_js_default().brandingC15T})]})}for(var __rspack_i in exports.BrandingCompactLogo=__webpack_exports__.BrandingCompactLogo,exports.BrandingFullLogo=__webpack_exports__.BrandingFullLogo,exports.BrandingLink=__webpack_exports__.BrandingLink,exports.getBrandingHref=__webpack_exports__.getBrandingHref,exports.resolveBranding=__webpack_exports__.resolveBranding,__webpack_exports__)-1===["BrandingCompactLogo","BrandingFullLogo","BrandingLink","getBrandingHref","resolveBranding"].indexOf(__rspack_i)&&(exports[__rspack_i]=__webpack_exports__[__rspack_i]);Object.defineProperty(exports,"__esModule",{value:!0});
1
+ "use strict";const __rslib_import_meta_url__="u"<typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(n,{a:n}),n},__webpack_require__.d=(e,n)=>{for(var a in n)__webpack_require__.o(n,a)&&!__webpack_require__.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:n[a]})},__webpack_require__.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),__webpack_require__.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{getBrandingHref:()=>getBrandingHref,BrandingFullLogo:()=>BrandingFullLogo,resolveBranding:()=>resolveBranding,BrandingCompactLogo:()=>BrandingCompactLogo,BrandingLink:()=>BrandingLink});const jsx_runtime_namespaceObject=require("react/jsx-runtime"),consent_dialog_module_js_namespaceObject=require("@c15t/ui/styles/components/consent-dialog.module.js");var consent_dialog_module_js_default=__webpack_require__.n(consent_dialog_module_js_namespaceObject);const utils_namespaceObject=require("@c15t/ui/utils"),external_react_namespaceObject=require("react"),use_consent_manager_cjs_namespaceObject=require("../../../hooks/use-consent-manager.cjs"),use_theme_cjs_namespaceObject=require("../../../hooks/use-theme.cjs"),use_translations_cjs_namespaceObject=require("../../../hooks/use-translations.cjs"),cn_cjs_namespaceObject=require("../../../utils/cn.cjs"),merge_styles_cjs_namespaceObject=require("../../../utils/merge-styles.cjs"),external_logo_cjs_namespaceObject=require("./logo.cjs");function resolveBranding(e){return"none"===e?"none":"inth"===e||"consent"===e?"inth":"c15t"}function getBrandingHref(e,n=""){return"inth"===resolveBranding(e)?`https://inth.com${n}`:`https://c15t.com${n}`}function BrandingFullLogo({branding:e,className:n}){return"inth"===resolveBranding(e)?(0,jsx_runtime_namespaceObject.jsx)("span",{dir:"ltr",className:(0,cn_cjs_namespaceObject.cnExt)(consent_dialog_module_js_default().brandingWordmark,n),children:(0,jsx_runtime_namespaceObject.jsx)(external_logo_cjs_namespaceObject.InthLogo,{"aria-hidden":"true"})}):(0,jsx_runtime_namespaceObject.jsxs)("span",{dir:"ltr",className:(0,cn_cjs_namespaceObject.cnExt)(consent_dialog_module_js_default().brandingWordmark,n),children:[(0,jsx_runtime_namespaceObject.jsx)("span",{className:consent_dialog_module_js_default().brandingC15TMark,children:(0,jsx_runtime_namespaceObject.jsx)(external_logo_cjs_namespaceObject.C15TIconOnly,{"aria-hidden":"true"})}),(0,jsx_runtime_namespaceObject.jsx)("span",{className:consent_dialog_module_js_default().brandingWordmarkLabel,children:"c15t"})]})}function BrandingCompactLogo({branding:e,...n}){let a="inth"===resolveBranding(e)?external_logo_cjs_namespaceObject.InthIconOnly:external_logo_cjs_namespaceObject.C15TIconOnly;return(0,jsx_runtime_namespaceObject.jsx)(a,{...n})}function BrandingLink({hideBranding:e,variant:n="footer",themeKey:a,className:_,style:r,"data-testid":t}){let{branding:s}=(0,use_consent_manager_cjs_namespaceObject.useConsentManager)(),{noStyle:c,theme:o}=(0,use_theme_cjs_namespaceObject.useTheme)(),{common:i}=(0,use_translations_cjs_namespaceObject.useTranslations)(),l=resolveBranding(s),d="u">typeof window?`?ref=${window.location.hostname}`:"",u=(0,external_react_namespaceObject.useMemo)(()=>{let e={baseClassName:(0,cn_cjs_namespaceObject.cnExt)(consent_dialog_module_js_default().branding,"footer"!==n&&consent_dialog_module_js_default().brandingTag,"dialog-tag"===n&&consent_dialog_module_js_default().brandingTagDialog,"banner-tag"===n&&consent_dialog_module_js_default().brandingTagBanner),className:_,style:r};return a&&o?.slots&&a in o.slots?(0,utils_namespaceObject.resolveStyles)(a,o,e,c):(0,merge_styles_cjs_namespaceObject.mergeStyles)({},e)},[_,c,r,o,a,n]),g=(0,utils_namespaceObject.sanitizeDOMStyleProps)(u);return"none"===l||e?null:(0,jsx_runtime_namespaceObject.jsxs)("a",{...g,href:getBrandingHref(s,d),"data-branding":l,"data-variant":n,"data-testid":t,children:[(0,jsx_runtime_namespaceObject.jsx)("span",{className:consent_dialog_module_js_default().brandingCopy,children:(0,jsx_runtime_namespaceObject.jsx)("span",{className:consent_dialog_module_js_default().brandingText,children:i.securedBy})}),(0,jsx_runtime_namespaceObject.jsx)(BrandingFullLogo,{branding:s,className:"inth"===l?consent_dialog_module_js_default().brandingInth:consent_dialog_module_js_default().brandingC15T})]})}for(var __rspack_i in exports.BrandingCompactLogo=__webpack_exports__.BrandingCompactLogo,exports.BrandingFullLogo=__webpack_exports__.BrandingFullLogo,exports.BrandingLink=__webpack_exports__.BrandingLink,exports.getBrandingHref=__webpack_exports__.getBrandingHref,exports.resolveBranding=__webpack_exports__.resolveBranding,__webpack_exports__)-1===["BrandingCompactLogo","BrandingFullLogo","BrandingLink","getBrandingHref","resolveBranding"].indexOf(__rspack_i)&&(exports[__rspack_i]=__webpack_exports__[__rspack_i]);Object.defineProperty(exports,"__esModule",{value:!0});
@@ -1 +1 @@
1
- import{jsx as n,jsxs as a}from"react/jsx-runtime";import r from"@c15t/ui/styles/components/consent-dialog.module.js";import{useConsentManager as t}from"../../../hooks/use-consent-manager.js";import{useTranslations as i}from"../../../hooks/use-translations.js";import{cnExt as o}from"../../../utils/cn.js";import{C15TIconOnly as e,InthIconOnly as s,InthLogo as d}from"./logo.js";function c(n){return"none"===n?"none":"inth"===n||"consent"===n?"inth":"c15t"}function g(n,a=""){return"inth"===c(n)?`https://inth.com${a}`:`https://c15t.com${a}`}function l({branding:t,className:i}){return"inth"===c(t)?n(d,{className:i}):a("span",{dir:"ltr",className:o(r.brandingWordmark,i),children:[n(e,{className:r.brandingC15TMark,"aria-hidden":"true"}),n("span",{className:r.brandingWordmarkLabel,children:"c15t"})]})}function m({branding:a,...r}){return n("inth"===c(a)?s:e,{...r})}function u({hideBranding:e,variant:s="footer",className:d,"data-testid":m}){let{branding:h}=t(),{common:f}=i(),p=c(h);if("none"===p||e)return null;let b="u">typeof window?`?ref=${window.location.hostname}`:"";return a("a",{className:o(r.branding,"footer"!==s&&r.brandingTag,"dialog-tag"===s&&r.brandingTagDialog,"banner-tag"===s&&r.brandingTagBanner,d),href:g(h,b),"data-branding":p,"data-variant":s,"data-testid":m,children:[n("span",{className:r.brandingCopy,children:n("span",{className:r.brandingText,children:f.securedBy})}),n(l,{branding:h,className:"inth"===p?r.brandingInth:r.brandingC15T})]})}export{m as BrandingCompactLogo,l as BrandingFullLogo,u as BrandingLink,g as getBrandingHref,c as resolveBranding};
1
+ import{jsx as n,jsxs as r}from"react/jsx-runtime";import t from"@c15t/ui/styles/components/consent-dialog.module.js";import{resolveStyles as a,sanitizeDOMStyleProps as i}from"@c15t/ui/utils";import{useMemo as o}from"react";import{useConsentManager as e}from"../../../hooks/use-consent-manager.js";import{useTheme as s}from"../../../hooks/use-theme.js";import{useTranslations as d}from"../../../hooks/use-translations.js";import{cnExt as m}from"../../../utils/cn.js";import{mergeStyles as l}from"../../../utils/merge-styles.js";import{C15TIconOnly as c,InthIconOnly as g,InthLogo as u}from"./logo.js";function h(n){return"none"===n?"none":"inth"===n||"consent"===n?"inth":"c15t"}function p(n,r=""){return"inth"===h(n)?`https://inth.com${r}`:`https://c15t.com${r}`}function f({branding:a,className:i}){return"inth"===h(a)?n("span",{dir:"ltr",className:m(t.brandingWordmark,i),children:n(u,{"aria-hidden":"true"})}):r("span",{dir:"ltr",className:m(t.brandingWordmark,i),children:[n("span",{className:t.brandingC15TMark,children:n(c,{"aria-hidden":"true"})}),n("span",{className:t.brandingWordmarkLabel,children:"c15t"})]})}function b({branding:r,...t}){return n("inth"===h(r)?g:c,{...t})}function j({hideBranding:c,variant:g="footer",themeKey:u,className:b,style:k,"data-testid":N}){let{branding:B}=e(),{noStyle:y,theme:T}=s(),{common:C}=d(),w=h(B),L="u">typeof window?`?ref=${window.location.hostname}`:"",x=i(o(()=>{let n={baseClassName:m(t.branding,"footer"!==g&&t.brandingTag,"dialog-tag"===g&&t.brandingTagDialog,"banner-tag"===g&&t.brandingTagBanner),className:b,style:k};return u&&T?.slots&&u in T.slots?a(u,T,n,y):l({},n)},[b,y,k,T,u,g]));return"none"===w||c?null:r("a",{...x,href:p(B,L),"data-branding":w,"data-variant":g,"data-testid":N,children:[n("span",{className:t.brandingCopy,children:n("span",{className:t.brandingText,children:C.securedBy})}),n(f,{branding:B,className:"inth"===w?t.brandingInth:t.brandingC15T})]})}export{b as BrandingCompactLogo,f as BrandingFullLogo,j as BrandingLink,p as getBrandingHref,h as resolveBranding};
package/dist/version.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const __rslib_import_meta_url__="u"<typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=(e,_)=>{for(var r in _)__webpack_require__.o(_,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:_[r]})},__webpack_require__.o=(e,_)=>Object.prototype.hasOwnProperty.call(e,_),__webpack_require__.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{version:()=>version});const version="2.0.0-rc.8";for(var __rspack_i in exports.version=__webpack_exports__.version,__webpack_exports__)-1===["version"].indexOf(__rspack_i)&&(exports[__rspack_i]=__webpack_exports__[__rspack_i]);Object.defineProperty(exports,"__esModule",{value:!0});
1
+ "use strict";const __rslib_import_meta_url__="u"<typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=(e,_)=>{for(var r in _)__webpack_require__.o(_,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:_[r]})},__webpack_require__.o=(e,_)=>Object.prototype.hasOwnProperty.call(e,_),__webpack_require__.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{version:()=>version});const version="2.0.0";for(var __rspack_i in exports.version=__webpack_exports__.version,__webpack_exports__)-1===["version"].indexOf(__rspack_i)&&(exports[__rspack_i]=__webpack_exports__[__rspack_i]);Object.defineProperty(exports,"__esModule",{value:!0});
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- let e="2.0.0-rc.8";export{e as version};
1
+ let e="2.0.0";export{e as version};
@@ -61,6 +61,7 @@ declare const ConsentDialogFooter: import("react").ForwardRefExoticComponent<Box
61
61
  type BrandingProps = {
62
62
  hideBranding: boolean;
63
63
  variant?: BrandingVariant;
64
+ themeKey?: import('../../shared/ui/branding').BrandingThemeKey;
64
65
  className?: string;
65
66
  'data-testid'?: string;
66
67
  };
@@ -60,7 +60,8 @@ export interface ConsentDialogCompoundComponent extends FC<ConsentDialogProps> {
60
60
  * theme: {
61
61
  * slots: {
62
62
  * consentDialogCard: 'rounded-3xl shadow-xl',
63
- * consentDialogFooter: 'border-t border-black/10',
63
+ * consentWidgetFooter: 'gap-3 pt-6',
64
+ * consentDialogTag: 'shadow-none',
64
65
  * },
65
66
  * },
66
67
  * }}
@@ -1,8 +1,3 @@
1
- /**
2
- * @packageDocumentation
3
- * Provides the root component for the consent management interface.
4
- * Implements context provider pattern with theme support and state management.
5
- */
6
1
  import type { FC, ReactNode } from 'react';
7
2
  import { type ThemeContextValue } from '../../../context/theme-context';
8
3
  /**
@@ -1,11 +1,15 @@
1
1
  import type { Branding } from 'c15t';
2
2
  import type { SVGProps } from 'react';
3
+ import type { CSSPropertiesWithVars } from '../../../types/theme';
3
4
  export type ResolvedBranding = 'c15t' | 'inth' | 'none';
4
5
  export type BrandingVariant = 'footer' | 'dialog-tag' | 'banner-tag';
6
+ export type BrandingThemeKey = 'consentBannerTag' | 'consentDialogTag' | 'consentWidgetTag' | 'iabConsentBannerTag' | 'iabConsentDialogTag';
5
7
  type BrandingProps = {
6
8
  hideBranding: boolean;
7
9
  variant?: BrandingVariant;
10
+ themeKey?: BrandingThemeKey;
8
11
  className?: string;
12
+ style?: CSSPropertiesWithVars;
9
13
  'data-testid'?: string;
10
14
  };
11
15
  type BrandingFullLogoProps = {
@@ -19,5 +23,5 @@ export declare function resolveBranding(branding: Branding | string): ResolvedBr
19
23
  export declare function getBrandingHref(branding: Branding | string, refParam?: string): string;
20
24
  export declare function BrandingFullLogo({ branding, className, }: BrandingFullLogoProps): import("react/jsx-runtime").JSX.Element;
21
25
  export declare function BrandingCompactLogo({ branding, ...props }: BrandingCompactLogoProps): import("react/jsx-runtime").JSX.Element;
22
- export declare function BrandingLink({ hideBranding, variant, className, 'data-testid': testId, }: BrandingProps): import("react/jsx-runtime").JSX.Element | null;
26
+ export declare function BrandingLink({ hideBranding, variant, themeKey, className, style, 'data-testid': testId, }: BrandingProps): import("react/jsx-runtime").JSX.Element | null;
23
27
  export {};
@@ -16,7 +16,7 @@ export interface ReactUIOptions extends UIOptions {
16
16
  * In offline mode this also includes `offlinePolicy` configuration for
17
17
  * local policy previews.
18
18
  *
19
- * @see {@link https://v2.c15t.com/docs/frameworks/react/policy-packs}
19
+ * @see {@link https://c15t.com/docs/frameworks/react/policy-packs}
20
20
  */
21
21
  export type ConsentManagerOptions = BaseConsentManagerOptions & ReactUIOptions;
22
22
  /**
@@ -33,7 +33,7 @@ export interface ConsentManagerProviderProps {
33
33
  * Configuration options for the consent manager.
34
34
  * This includes core, React, store, and translation settings.
35
35
  *
36
- * @see {@link https://v2.c15t.com/docs/frameworks/react/components/consent-manager-provider}
36
+ * @see {@link https://c15t.com/docs/frameworks/react/components/consent-manager-provider}
37
37
  */
38
38
  options: ConsentManagerOptions;
39
39
  }
@@ -1 +1 @@
1
- export declare const version = "2.0.0-rc.8";
1
+ export declare const version = "2.0.0";