"use strict";var DesignSystem;(globalThis.webpackChunkDesignSystem=globalThis.webpackChunkDesignSystem||[]).push([[541],{8198:(t,n,e)=>{e.d(n,{$:()=>u,A:()=>y});var a=e(2485),s=e.n(a),i=e(1293),o=e(2696),r=e(8716),l=e(5002),c=e(7402),d=e(5901);const u=t=>{const{analytics:n,analyticsLabelOverride:e,analyticsParentHeading:a,analyticsParentType:u,onAnalyticsEvent:y,children:f,className:p,inputRef:b,isAlternate:v,onClick:h,onDark:k,size:m,variation:A,...g}=t,{contentRef:N,sendButtonEvent:D}=function(t){let{analytics:n,analyticsLabelOverride:e,analyticsParentHeading:a,analyticsParentType:s,href:i,onAnalyticsEvent:d=(0,o.$W)().defaultAnalyticsFunction,type:u,variation:y}=t;const f=(0,c.useRef)();return{contentRef:f,sendButtonEvent:function(){if(!0!==n&&(!(0,o.$W)().buttonSendsAnalytics||!1===n))return;const t=e??(0,r.c)([f]),c=y??"default",p=u??"button",b=a??" ",v=s??" ";return d({event_name:"button_engagement",event_extension:l.TW,text:t,button_style:c,button_type:i?"link":p,parent_component_heading:b,parent_component_type:v,...i?{link_url:i}:{}})}}}(t),E=t.href?"a":"button",T=v&&"ds-c-button--alternate",_=k&&"ds-c-button--on-dark",O=m&&`ds-c-button--${m}`,S=A&&`ds-c-button--${A}`,C={...g,className:s()("ds-c-button",T,_,O,S,p)};function F(n){t.disabled||(D(),h&&h(n))}return"button"!==E&&(delete C.disabled,delete C.type,t.disabled&&(C.role="link",C["aria-disabled"]=!0,delete C.href)),(0,d.Y)(E,{ref:(0,i.A)([b,N]),onClick:F,onKeyPress:"a"===E?function(t){" "===t.key&&F(t)}:void 0,...C,children:f})};u.defaultProps={isAlternate:!1,onDark:!1,type:"button"};const y=u},8716:(t,n,e)=>{function a(t){return t.map((t=>t.nodeType===Node.TEXT_NODE?t.textContent:t.nodeType===Node.ELEMENT_NODE?"SLOT"===t.tagName?a(t.assignedNodes({flatten:!0})):a(Array.from(t.childNodes)):"")).join("")}function s(t){return t.map((t=>t.current?a(Array.from(t.current.childNodes)):void 0)).find((t=>t))}e.d(n,{A:()=>i,c:()=>s});const i=s},1293:(t,n,e)=>{function a(t){return n=>{t.forEach((t=>{"function"==typeof t?t(n):null!=t&&(t.current=n)}))}}e.d(n,{A:()=>a})},6335:(t,n,e)=>{e.d(n,{K:()=>s});var a=e(2696);const s=["onAnalyticsEvent",t=>{let n=!0;return setTimeout((()=>{n&&(0,a.$W)().defaultAnalyticsFunction(t)}),10),{detail:{event:t},preventDefault:function(){n=!1}}}]},5354:(t,n,e)=>{var a=e(7142),s=e(8198),i=e(6622),o=e(6335),r=e(5901);const l=["class-name","disabled","href","is-alternate","is-on-dark","size","type","variation","target",...i.x,...i.d],c=t=>{let{isAlternate:n,isOnDark:e,analytics:a,...i}=t;return(0,r.Y)(s.A,{...i,isAlternate:n&&Boolean(JSON.parse(n)),onDark:e&&Boolean(JSON.parse(e)),analytics:a&&Boolean(JSON.parse(a))})};(0,a.E)("ds-button",(()=>c),{attributes:l,events:["onClick",o.K],shadow:!0})},6622:(t,n,e)=>{e.d(n,{d:()=>s,x:()=>a});const a=["analytics","analytics-label-override"],s=["analytics-parent-heading","analytics-parent-type"]},5901:(t,n,e)=>{e.d(n,{FD:()=>a.FD,FK:()=>a.FK,Y:()=>a.Y}),e(7402);var a=e(201)}},t=>{var n=t(t.s=5354);DesignSystem=n}]);
//# sourceMappingURL=ds-button.js.map