import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{a as t}from"./vendor-html-parser-DOJ8foyv.js";import{n,t as r}from"./vendor-react-BREUBCH4.js";import{Lt as i,f as a,q as o,u as s}from"./errorBoundary-Dd5IQF9g.js";import{t as c}from"./striptags-BwxRt8hs.js";var l=r(),u=n(),d=(0,i.cn)(`Sponsored`),f=e=>{let t=(0,l.c)(19),{sponsorLogoUrl:n,sponsorUrl:r,campaignURL:i,alt:o,title:s,classNames:c,sponsorCount:f}=e,m=f===void 0?1:f,h=m>6?`ImageSmall`:`Image`,g=i||r||``,_=!!(s&&m>1),v=n||_,y;t[0]!==c||t[1]!==m?(y=d({},[c,m>6?`SponsoredSmallImage`:``]),t[0]=c,t[1]=m,t[2]=y):y=t[2];let b;t[3]!==m||t[4]!==s?(b=m===1&&(0,u.jsx)(`div`,{children:(0,u.jsx)(`p`,{className:d(`Text`),"data-testid":`sponsored-text`,children:s?.length?`Sponsored by ${s}`:`Sponsored Content`})}),t[3]=m,t[4]=s,t[5]=b):b=t[5];let x;t[6]!==o||t[7]!==h||t[8]!==v||t[9]!==_||t[10]!==m||t[11]!==n||t[12]!==s||t[13]!==g?(x=v&&(0,u.jsx)(`div`,{className:d(`ImageLinkWrapper`),children:g?(0,u.jsx)(a,{to:g,className:d(`ImageLink`),target:`_blank`,rel:`sponsored`,children:(0,u.jsx)(p,{imageClass:h,sponsorLogoUrl:n,alt:o,title:s,sponsorCount:m,showTitle:_})}):(0,u.jsx)(p,{imageClass:h,sponsorLogoUrl:n,alt:o,title:s,sponsorCount:m,showTitle:_})}),t[6]=o,t[7]=h,t[8]=v,t[9]=_,t[10]=m,t[11]=n,t[12]=s,t[13]=g,t[14]=x):x=t[14];let S;return t[15]!==y||t[16]!==b||t[17]!==x?(S=(0,u.jsxs)(`div`,{"data-component":`sponsored`,className:y,children:[b,x]}),t[15]=y,t[16]=b,t[17]=x,t[18]=S):S=t[18],S},p=e=>{let t=(0,l.c)(9),{imageClass:n,sponsorLogoUrl:r,alt:i,title:a,showTitle:o}=e,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=d(`SponsorContent`),t[0]=c):c=t[0];let f;t[1]!==i||t[2]!==n||t[3]!==o||t[4]!==r||t[5]!==a?(f=r?(0,u.jsx)(s,{fallback:`brand`,className:d(n),"data-testid":`sponsored-image`,src:r,alt:i??``,width:300}):o&&(0,u.jsx)(`p`,{className:d(`Text`),children:a}),t[1]=i,t[2]=n,t[3]=o,t[4]=r,t[5]=a,t[6]=f):f=t[6];let p;return t[7]===f?p=t[8]:(p=(0,u.jsx)(`div`,{className:c,children:f}),t[7]=f,t[8]=p),p},m=e(t()),h=(0,i.cn)(`MultiSponsorGrid`),g=e=>{let t=(0,l.c)(21),{title:n,campaignURL:r,sponsors:i,classNames:a}=e,o=n===void 0?`Sponsored by`:n;if(i.length===1){let e;return t[0]!==r||t[1]!==a||t[2]!==i[0]?(e=(0,u.jsx)(f,{...i[0],campaignURL:r,classNames:a}),t[0]=r,t[1]=a,t[2]=i[0],t[3]=e):e=t[3],e}let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=h(),t[4]=s):s=t[4];let c;t[5]===o?c=t[6]:(c=o&&(0,u.jsx)(`h2`,{className:h(`Title`),children:o}),t[5]=o,t[6]=c);let d;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(d=h(`GridWrapper`),t[7]=d):d=t[7];let p;if(t[8]!==r||t[9]!==a||t[10]!==i){let e;t[12]!==r||t[13]!==a||t[14]!==i.length?(e=(e,t)=>(e.sponsorLogoUrl||e.title)&&(0,u.jsx)(m.Fragment,{children:(0,u.jsx)(f,{...e,campaignURL:r,sponsorCount:i.length,classNames:a})},`multi-sponsor-grid${t}`),t[12]=r,t[13]=a,t[14]=i.length,t[15]=e):e=t[15],p=i.map(e),t[8]=r,t[9]=a,t[10]=i,t[11]=p}else p=t[11];let g;t[16]===p?g=t[17]:(g=(0,u.jsx)(`div`,{className:d,"data-testid":`multi-sponsor-grid-wrapper`,children:p}),t[16]=p,t[17]=g);let _;return t[18]!==c||t[19]!==g?(_=(0,u.jsxs)(`section`,{"data-module":`multi-sponsor-grid`,className:s,"data-testid":`multi-sponsor-grid`,children:[c,g]}),t[18]=c,t[19]=g,t[20]=_):_=t[20],_};function _(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n`u`?null:M(BigInt.prototype.toString),be=typeof Symbol>`u`?null:M(Symbol.prototype.toString),k=M(Object.prototype.hasOwnProperty),xe=M(Object.prototype.toString),A=M(RegExp.prototype.test),j=N(TypeError);function M(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return ae(e,t,n)}}function N(e){return function(){return oe(e,[...arguments])}}function P(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:de;if(te&&te(e,null),!O(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(ne(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Se(e){for(let t=0;t/g),Re=T(/\${[\w\W]*/g),ze=T(/^data-[\-\w.\u00B7-\uFFFF]+$/),Be=T(/^aria-[\-\w]+$/),Ve=T(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),He=T(/^(?:\w+script|data):/i),Ue=T(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),We=T(/^html$/i),Ge=T(/^[a-z][.\w]*(-[.\w]+)+$/i),Ke=T(/<[/\w!]/g),qe=t(/<[/\w]/g),je=t(/<\/no(script|embed|frames)/i),ye=t(/\/>/i),L={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Xe=function(){return typeof window>`u`?null:window},Ze=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},Qe=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},R=function(e,t,n,r){return k(e,t)&&O(e[t])?P(r.base?F(r.base):{},e[t],r.transform):n};function $e(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Xe(),t=e=>$e(e);if(t.version=`3.4.12`,t.removed=[],!e||!e.document||e.document.nodeType!==L.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=I(d,`cloneNode`),p=I(d,`remove`),m=I(d,`nextSibling`),h=I(d,`childNodes`),g=I(d,`parentNode`),_=I(d,`shadowRoot`),v=I(d,`attributes`),y=o&&o.prototype?I(o.prototype,`nodeType`):null,b=o&&o.prototype?I(o.prototype,`nodeName`):null;if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let x,S=``,te,ne=!1,C=0,re=function(){if(C>0)throw j(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},E=function(e){re(),C++;try{return x.createHTML(e)}finally{C--}},ae=function(e){re(),C++;try{return x.createScriptURL(e)}finally{C--}},oe=function(){return ne||=(te=Ze(u,i),!0),te},_e=n,ve=_e.implementation,ye=_e.createNodeIterator,be=_e.createDocumentFragment,xe=_e.getElementsByTagName,M=r.importNode,N=Qe();t.isSupported=typeof ee==`function`&&typeof g==`function`&&ve&&ve.createHTMLDocument!==void 0;let Se=Ie,et=Le,tt=Re,nt=ze,rt=Be,it=He,at=Ue,ot=Ge,st=Ve,z=null,ct=P({},[...Te,...Ee,...De,...ke,...je]),B=null,lt=P({},[...Me,...Ne,...Pe,...Fe]),V=Object.seal(ie(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ut=null,dt=null,H=Object.seal(ie(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),ft=!0,pt=!0,mt=!1,ht=!0,U=!1,W=!0,G=!1,gt=!1,_t=null,vt=null,yt=!1,K=!1,bt=!1,xt=!1,St=!0,Ct=!1,wt=`user-content-`,Tt=!0,Et=!1,q={},J=null,Dt=P({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Ot=null,kt=P({},[`audio`,`video`,`img`,`source`,`image`,`track`]),At=null,jt=P({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Mt=`http://www.w3.org/1998/Math/MathML`,Nt=`http://www.w3.org/2000/svg`,Y=`http://www.w3.org/1999/xhtml`,Pt=Y,Ft=!1,It=null,Lt=P({},[Mt,Nt,Y],fe),Rt=w([`mi`,`mo`,`mn`,`ms`,`mtext`]),zt=P({},Rt),Bt=w([`annotation-xml`]),Vt=P({},Bt),Ht=P({},[`title`,`style`,`font`,`a`,`script`]),Ut=null,Wt=[`application/xhtml+xml`,`text/html`],X=null,Gt=null,Kt=n.createElement(`form`),qt=function(e){return e instanceof RegExp||e instanceof Function},Jt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Gt&&Gt===e)return;(!e||typeof e!=`object`)&&(e={}),e=F(e),Ut=Wt.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,X=Ut===`application/xhtml+xml`?fe:de,z=R(e,`ALLOWED_TAGS`,ct,{transform:X}),B=R(e,`ALLOWED_ATTR`,lt,{transform:X}),It=R(e,`ALLOWED_NAMESPACES`,Lt,{transform:fe}),At=R(e,`ADD_URI_SAFE_ATTR`,jt,{transform:X,base:jt}),Ot=R(e,`ADD_DATA_URI_TAGS`,kt,{transform:X,base:kt}),J=R(e,`FORBID_CONTENTS`,Dt,{transform:X}),ut=R(e,`FORBID_TAGS`,F({}),{transform:X}),dt=R(e,`FORBID_ATTR`,F({}),{transform:X}),q=k(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?F(e.USE_PROFILES):e.USE_PROFILES:!1,ft=e.ALLOW_ARIA_ATTR!==!1,pt=e.ALLOW_DATA_ATTR!==!1,mt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ht=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,U=e.SAFE_FOR_TEMPLATES||!1,W=e.SAFE_FOR_XML!==!1,G=e.WHOLE_DOCUMENT||!1,K=e.RETURN_DOM||!1,bt=e.RETURN_DOM_FRAGMENT||!1,xt=e.RETURN_TRUSTED_TYPE||!1,yt=e.FORCE_BODY||!1,St=e.SANITIZE_DOM!==!1,Ct=e.SANITIZE_NAMED_PROPS||!1,Tt=e.KEEP_CONTENT!==!1,Et=e.IN_PLACE||!1,st=we(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Ve,Pt=typeof e.NAMESPACE==`string`?e.NAMESPACE:Y,zt=k(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?F(e.MATHML_TEXT_INTEGRATION_POINTS):P({},Rt),Vt=k(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?F(e.HTML_INTEGRATION_POINTS):P({},Bt);let t=k(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?F(e.CUSTOM_ELEMENT_HANDLING):ie(null);if(V=ie(null),k(t,`tagNameCheck`)&&qt(t.tagNameCheck)&&(V.tagNameCheck=t.tagNameCheck),k(t,`attributeNameCheck`)&&qt(t.attributeNameCheck)&&(V.attributeNameCheck=t.attributeNameCheck),k(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(V.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),T(V),U&&(pt=!1),bt&&(K=!0),q&&(z=P({},je),B=ie(null),q.html===!0&&(P(z,Te),P(B,Me)),q.svg===!0&&(P(z,Ee),P(B,Ne),P(B,Fe)),q.svgFilters===!0&&(P(z,De),P(B,Ne),P(B,Fe)),q.mathMl===!0&&(P(z,ke),P(B,Pe),P(B,Fe))),H.tagCheck=null,H.attributeCheck=null,k(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?H.tagCheck=e.ADD_TAGS:O(e.ADD_TAGS)&&(z===ct&&(z=F(z)),P(z,e.ADD_TAGS,X))),k(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?H.attributeCheck=e.ADD_ATTR:O(e.ADD_ATTR)&&(B===lt&&(B=F(B)),P(B,e.ADD_ATTR,X))),k(e,`ADD_URI_SAFE_ATTR`)&&O(e.ADD_URI_SAFE_ATTR)&&P(At,e.ADD_URI_SAFE_ATTR,X),k(e,`FORBID_CONTENTS`)&&O(e.FORBID_CONTENTS)&&(J===Dt&&(J=F(J)),P(J,e.FORBID_CONTENTS,X)),k(e,`ADD_FORBID_CONTENTS`)&&O(e.ADD_FORBID_CONTENTS)&&(J===Dt&&(J=F(J)),P(J,e.ADD_FORBID_CONTENTS,X)),Tt&&(z[`#text`]=!0),G&&P(z,[`html`,`head`,`body`]),z.table&&(P(z,[`tbody`]),delete ut.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw j(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw j(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=x;x=e.TRUSTED_TYPES_POLICY;try{S=E(``)}catch(e){throw x=t,e}}else e.TRUSTED_TYPES_POLICY===null?(x=void 0,S=``):(x===void 0&&(x=oe()),x&&typeof S==`string`&&(S=E(``)));w&&w(e),Gt=e},Yt=P({},[...Ee,...De,...Oe]),Xt=P({},[...ke,...Ae]),Zt=function(e,t,n){return t.namespaceURI===Y?e===`svg`:t.namespaceURI===Mt?e===`svg`&&(n===`annotation-xml`||zt[n]):!!Yt[e]},Qt=function(e,t,n){return t.namespaceURI===Y?e===`math`:t.namespaceURI===Nt?e===`math`&&Vt[n]:!!Xt[e]},$t=function(e,t,n){return t.namespaceURI===Nt&&!Vt[n]||t.namespaceURI===Mt&&!zt[n]?!1:!Xt[e]&&(Ht[e]||!Yt[e])},en=function(e){let t=g(e);(!t||!t.tagName)&&(t={namespaceURI:Pt,tagName:`template`});let n=de(e.tagName),r=de(t.tagName);return It[e.namespaceURI]?e.namespaceURI===Nt?Zt(n,t,r):e.namespaceURI===Mt?Qt(n,t,r):e.namespaceURI===Y?$t(n,t,r):!!(Ut===`application/xhtml+xml`&&It[e.namespaceURI]):!1},Z=function(e){le(t.removed,{element:e});try{g(e).removeChild(e)}catch{if(p(e),!g(e))throw j(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},tn=function(e){rn(e);let t=h(e);if(t){let e=[];D(t,t=>{le(e,t)}),D(e,e=>{try{p(e)}catch{}})}let n=v(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;if(typeof i==`string`)try{e.removeAttribute(i)}catch{}}},Q=function(e,n){try{le(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{le(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(K||bt)try{Z(n)}catch{}else try{n.setAttribute(e,``)}catch{}},nn=function(e){let t=v(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;if(!(typeof i!=`string`||B[X(i)]))try{e.removeAttribute(i)}catch{}}},rn=function(e){let t=[e];for(;t.length>0;){let e=t.pop();(y?y(e):e.nodeType)===L.element&&nn(e);let n=h(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},an=function(e){if(!W)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=y?y(e):e.nodeType;if(n===L.processingInstruction||n===L.comment&&A(qe,e.data)){try{p(e)}catch{}continue}if(n===L.element){let t=e,n=X(b?b(e):e.nodeName);try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&n!==`label`&&n!==`output`&&t.removeAttribute(`for`)}catch{}}let r=h(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},on=function(e){let t=null,r=null;if(yt)e=``+e;else{let t=pe(e,/^[\r\n\t ]+/);r=t&&t[0]}Ut===`application/xhtml+xml`&&Pt===Y&&(e=`
`+e+`

AltStyle によって変換されたページ (->オリジナル) /

`);let i=x?E(e):e;if(Pt===Y)try{t=new l().parseFromString(i,Ut)}catch{}if(!t||!t.documentElement){t=ve.createDocument(Pt,`template`,null);try{t.documentElement.innerHTML=Ft?S:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Pt===Y?xe.call(t,G?`html`:`body`)[0]:G?t.documentElement:a},sn=function(e){return ye.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},cn=function(e){return e=me(e,Se,` `),e=me(e,et,` `),e=me(e,tt,` `),e},ln=function(e){e.normalize();let t=ye.call(e.ownerDocument||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),n=t.nextNode();for(;n;)n.data=cn(n.data),n=t.nextNode();let r=e.querySelectorAll?.call(e,`template`);r&&D(r,e=>{dn(e.content)&&ln(e.content)})},un=function(e){let t=b?b(e):null;return typeof t!=`string`||X(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==v(e)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==y(e)||e.childNodes!==h(e)},dn=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return y(e)===L.documentFragment}catch{return!1}},fn=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return typeof y(e)==`number`}catch{return!1}};function $(e,n,r){e.length!==0&&D(e,e=>{e.call(t,n,r,Gt)})}let pn=function(e,t){return!!(W&&e.hasChildNodes()&&!fn(e.firstElementChild)&&A(Ke,e.textContent)&&A(Ke,e.innerHTML)||W&&e.namespaceURI===Y&&t===`style`&&fn(e.firstElementChild)||e.nodeType===L.processingInstruction||W&&e.nodeType===L.comment&&A(qe,e.data))},mn=function(e,t){if(!ut[t]&&vn(t)&&(V.tagNameCheck instanceof RegExp&&A(V.tagNameCheck,t)||V.tagNameCheck instanceof Function&&V.tagNameCheck(t)))return!1;if(Tt&&!J[t]){let t=g(e),n=h(e);if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=Et?n[i]:f(n[i],!0);t.insertBefore(r,m(e))}}}return Z(e),!0},hn=function(e,n){if($(N.beforeSanitizeElements,e,null),e!==n&&g(e)===null)return!0;if(un(e))return Z(e),!0;let r=X(b?b(e):e.nodeName);if($(N.uponSanitizeElement,e,{tagName:r,allowedTags:z}),e!==n&&g(e)===null)return!0;if(pn(e,r))return Z(e),!0;if(ut[r]||!(H.tagCheck instanceof Function&&H.tagCheck(r))&&!z[r]){let t=mn(e,r);return t===!1&&$(N.afterSanitizeElements,e,null),t}if((y?y(e):e.nodeType)===L.element&&!en(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&A(Je,e.innerHTML))return Z(e),!0;if(U&&e.nodeType===L.text){let n=cn(e.textContent);e.textContent!==n&&(le(t.removed,{element:e.cloneNode()}),e.textContent=n)}return $(N.afterSanitizeElements,e,null),!1},gn=function(e,t,r){if(dt[t]||W&&t===`patchsrc`||W&&t===`for`&&e!==`label`&&e!==`output`||St&&(t===`id`||t===`name`)&&(r in n||r in Kt))return!1;let i=B[t]||H.attributeCheck instanceof Function&&H.attributeCheck(t,e);if(!(pt&&A(nt,t))&&!(ft&&A(rt,t))){if(!i){if(!(vn(e)&&(V.tagNameCheck instanceof RegExp&&A(V.tagNameCheck,e)||V.tagNameCheck instanceof Function&&V.tagNameCheck(e))&&(V.attributeNameCheck instanceof RegExp&&A(V.attributeNameCheck,t)||V.attributeNameCheck instanceof Function&&V.attributeNameCheck(t,e))||t===`is`&&V.allowCustomizedBuiltInElements&&(V.tagNameCheck instanceof RegExp&&A(V.tagNameCheck,r)||V.tagNameCheck instanceof Function&&V.tagNameCheck(r))))return!1}else if(!At[t]&&!A(st,me(r,at,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&he(r,`data:`)===0&&Ot[e])&&!(mt&&!A(it,me(r,at,``)))&&r)return!1}return!0},_n=P({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),vn=function(e){return!_n[de(e)]&&A(ot,e)},yn=function(e,t,n,r){if(x&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return E(r);case`TrustedScriptURL`:return ae(r)}return r},bn=function(e,n,r,i){try{r?e.setAttributeNS(r,n,i):e.setAttribute(n,i),un(e)?Z(e):ce(t.removed)}catch{Q(n,e)}},xn=function(e){$(N.beforeSanitizeAttributes,e,null);let t=e.attributes;if(!t||un(e))return;let n={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:B,forceKeepAttr:void 0},r=t.length,i=X(e.nodeName);for(;r--;){let a=t[r],o=a.name,s=a.namespaceURI,c=a.value,l=X(o),u=c,d=o===`value`?u:ge(u);if(n.attrName=l,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,$(N.uponSanitizeAttribute,e,n),d=n.attrValue,Ct&&(l===`id`||l===`name`)&&he(d,wt)!==0&&(Q(o,e),d=wt+d),W&&A(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)){q(o,e);continue}if(l===`attributename`&&pe(d,`href`)){q(o,e);continue}if(!n.forcekeepattr){if(!n.keepattr){q(o,e);continue}if(!ht&&a(ye,d)){q(o,e);continue}if(u&&(d=cn(d)),!gn(i,l,d)){q(o,e);continue}d=yn(i,l,s,d),d!==u&&bn(e,o,s,d)}}$(n.aftersanitizeattributes,e,null)},sn=function(e){let t=null,n=sn(e);for($(N.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if($(N.uponSanitizeShadowNode,t,null),hn(t,e),xn(t),dn(t.content)&&Sn(t.content),(y?y(t):t.nodeType)===L.element){let e=_(t);dn(e)&&(Cn(e),Sn(e))}$(N.afterSanitizeShadowDOM,e,null)},Cn=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Sn(e.shadow);continue}let n=e.node,r=(y?y(n):n.nodeType)===L.element,i=h(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=b?b(n):null;if(typeof e==`string`&&X(e)===`template`){let e=n.content;dn(e)&&t.push({node:e,shadow:null})}}if(r){let e=_(n);dn(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Ft=!e,Ft&&(e=``),a=i.ownerDocument.importNode(e,!0),a.nodeType===L.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Cn(a);else{if(!K&&!U&&!G&&e.indexOf(`<`)===-1)return x&&xt?E(e):e;if(i=on(e),!i)return K?null:xt?S:``}i&&yt&&Z(i.firstChild);let l=c?e:i,u=sn(l);try{for(;o=u.nextNode();)hn(o,l),xn(o),dn(o.content)&&Sn(o.content)}catch(n){throw c&&(tn(e),D(t.removed,e=>{e.element&&rn(e.element)})),n}if(c)return D(t.removed,e=>{e.element&&rn(e.element)}),U&&ln(e),e;if(K){if(U&&ln(i),bt)for(s=be.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(B.shadowroot||B.shadowrootmode)&&(s=M.call(r,s,!0)),s}let d=G?i.outerHTML:i.innerHTML;return G&&z[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&A(We,i.ownerDocument.doctype.name)&&(d=` `+d),U&&(d=cn(d)),x&&xt?E(d):d},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Jt(e),gt=!0,_t=z,vt=B},t.clearConfig=function(){Gt=null,gt=!1,_t=null,vt=null,x=te,S=``},t.isValidAttribute=function(e,t,n){Gt||Jt({});let r=X(e),i=X(t);return gn(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&k(N,e)&&le(N[e],t)},t.removeHook=function(e,t){if(k(N,e)){if(t!==void 0){let n=se(N[e],t);return n===-1?void 0:ue(N[e],n,1)[0]}return ce(N[e])}},t.removeHooks=function(e){k(N,e)&&(N[e]=[])},t.removeAllHooks=function(){N=Qe()},t}var et=$e(),tt=e(c()),nt=(0,i.cn)(`CaptionedContent`),rt=e=>/<\w[^>]*>/.test(e),it=e=>e?typeof window>`u`?(0,tt.default)(e).trim():et.sanitize(e,{ALLOWED_TAGS:[`a`],ALLOWED_ATTR:[`href`,`target`,`rel`,`class`]}).replace(/]*)>/gi,(e,t)=>``):``,at=e=>{let t=(0,l.c)(18),{caption:n,creditTo:r,children:i,entryUid:a}=e,{visualExperienceEnabled:s}=o.useFeatureToggles(),c;t[0]!==a||t[1]!==s?(c=a&&s&&{"data-cslp":`article.${a}.en-us.featured_image_group.featured_image_caption`},t[0]=a,t[1]=s,t[2]=c):c=t[2];let d=c,f;t[3]!==a||t[4]!==s?(f=a&&s&&{"data-cslp":`article.${a}.en-us.featured_image_group.featured_image_credit`},t[3]=a,t[4]=s,t[5]=f):f=t[5];let p=f,m,h;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(m=nt(),h=nt(`Content`),t[6]=m,t[7]=h):(m=t[6],h=t[7]);let g;t[8]===i?g=t[9]:(g=(0,u.jsx)(`div`,{className:h,children:i}),t[8]=i,t[9]=g);let _;t[10]!==n||t[11]!==r||t[12]!==d||t[13]!==p?(_=(n||r)&&(0,u.jsxs)(`div`,{className:nt(`Caption`),"data-testid":`captioned-content-caption`,...d,children:[n&&(rt(n)?(0,u.jsx)(`span`,{dangerouslySetInnerHTML:{__html:it(n)}}):n),(0,u.jsx)(`span`,{className:nt(`CreditTo`),...p,children:r})]}),t[10]=n,t[11]=r,t[12]=d,t[13]=p,t[14]=_):_=t[14];let v;return t[15]!==g||t[16]!==_?(v=(0,u.jsxs)(`div`,{"data-component":`captioned-content`,className:m,children:[g,_]}),t[15]=g,t[16]=_,t[17]=v):v=t[17],v};export{et as n,g as r,at as t}; //# sourceMappingURL=src-Dd-dkmZg.js.map