1import{o as e}from"./chunk-CMxvf4Kt.js";import{n as t}from"./jsx-runtime-SsSjplwM.js";import{t as n}from"./defineProperty-ClgyJMzY.js";var r=e(t(),1),i=new Set([`link`,`style`,`script`,`noscript`]),a=new Set([`title`,`titleTemplate`,`script`,`style`,`noscript`]),o=new Set([`base`,`meta`,`link`,`style`,`script`,`noscript`]),s=new Set([`title`,`base`,`htmlAttrs`,`bodyAttrs`,`meta`,`link`,`style`,`script`,`noscript`]),c=new Set([`base`,`title`,`titleTemplate`,`bodyAttrs`,`htmlAttrs`,`templateParams`]),l=new Set([`key`,`tagPosition`,`tagPriority`,`tagDuplicateStrategy`,`innerHTML`,`textContent`,`processTemplateParams`]),u=new Set([`templateParams`,`htmlAttrs`,`bodyAttrs`]),d=new Set([`theme-color`,`google-site-verification`,`og`,`article`,`book`,`profile`,`twitter`,`author`]);function f(e,t,n,r){for(let i=n;i<e.length;i+=1)try{let n=r?r.run(()=>e[i](...t)):e[i](...t);if(n&&typeof n.then==`function`)return Promise.resolve(n).then(()=>f(e,t,i+1,r))}catch(e){return Promise.reject(e)}}var p=class{constructor(){n(this,`_hooks`,void 0),this._hooks={}}hook(e,t){return!e||typeof t!=`function`?()=>{}:(this._hooks[e]=this._hooks[e]||[],this._hooks[e].push(t),()=>{t&&=(this.removeHook(e,t),void 0)})}removeHook(e,t){let n=this._hooks[e];if(n){let r=n.indexOf(t);r!==-1&&n.splice(r,1),n.length===0&&(this._hooks[e]=void 0)}}callHook(e,...t){let n=this._hooks[e];if(!(!n||n.length===0))return f(n,t,0)}};function m(e){let t=new p;for(let n in e||{})t.hook(n,e[n]);return t}function h(e,t,n){return e.hooks?.callHook(t,n)}var g=/^(?:viewport|description|keywords|robots)$/;function _(e){return d.has(e.split(`:`)[1])}function v(e){let{props:t,tag:n,key:r}=e;if(c.has(n))return n;if(n===`link`&&t.rel===`canonical`)return`canonical`;if(n===`link`&&t.rel===`alternate`){if(t.hreflang)return`alternate:${t.hreflang}`;if(t.type)return`alternate:${t.type}:${t.href||``}`}if(t.charset)return`charset`;if(n===`meta`)for(let e of[`name`,`property`,`http-equiv`]){let n=t[e];if(n!==void 0)return`meta:${n}${(typeof n!=`string`||!n.includes(`:`))&&!g.test(n)&&r?`:key:${r}`:``}`}return r?`${n}:key:${r}`:t.id?`${n}:id:${t.id}`:n===`link`&&t.rel===`alternate`?`alternate:${t.href||``}`:a.has(n)&&(e.textContent||e.innerHTML)?`${n}:content:${e.textContent||e.innerHTML}`:void 0}function y(e){return e._h||e._d||e.textContent||e.innerHTML||`${e.tag}:${Object.entries(e.props).map(([e,t])=>`${e}:${String(t)}`).join()}`}function b(e,t,n){if(n===`_resolver`)return e;typeof e==`function`&&(!n||n!==`titleTemplate`&&!n.startsWith(`on`))&&(e=e());let r=t?t(n,e):e;if(Array.isArray(r))return r.map(e=>b(e,t));if(r?.constructor===Object){let e={};for(let n in r)n===`__proto__`||n===`constructor`||n===`prototype`||(e[n]=b(r[n],t,n));return e}return r}function x(e,t){let n=e===`style`,r=n?new Map:new Set,i=e=>{if(e)if(n){let t=e.indexOf(`:`);t>0&&r.set(e.slice(0,t).trim(),e.slice(t+1).trim())}else e.split(` `).forEach(e=>e&&r.add(e))};if(typeof t==`string`)(n?t.split(`;`):[t]).forEach(i);else if(Array.isArray(t))t.forEach(i);else if(t&&typeof t==`object`)for(let e in t){let a=t[e];a&&a!==`false`&&(n?r.set(e.trim(),String(a)):i(e))}return r}function S(e,t){if(e.props=e.props||{},!t)return e;if(e.tag===`templateParams`)return e.props=t,e;let n=o.has(e.tag)||e.tag===`htmlAttrs`||e.tag===`bodyAttrs`;for(let r in t){if(r===`__proto__`||r===`constructor`||r===`prototype`)continue;let i=t[r];if(i===null)e.props[r]=null;else if(r===`class`||r===`style`)e.props[r]=x(r,i);else if(l.has(r))if((r===`textContent`||r===`innerHTML`)&&typeof i==`object`){let n=t.type||`application/json`;(n.endsWith(`json`)||n===`speculationrules`||n===`importmap`)&&(e.props.type=t.type=n,e[r]=JSON.stringify(i))}else e[r]=i;else if(i!==void 0){let t=r.startsWith(`data-`),a=n&&!t?r.toLowerCase():r,o=String(i),s=e.tag===`meta`&&a===`content`;e.props[a]=o===`true`||o===``?t||s?o:!0:!i&&t&&o===`false`?`false`:i}}return e}function C(e,t){let n=S({tag:e,props:{}},typeof t==`object`&&typeof t!=`function`?t:{[e===`script`||e===`noscript`||e===`style`?`innerHTML`:`textContent`]:t});return n.key&&i.has(n.tag)&&(n.props[`data-hid`]=n._h=n.key),n.tag===`script`&&typeof n.innerHTML==`object`&&(n.innerHTML=JSON.stringify(n.innerHTML),n.props.type=n.props.type||`application/json`),Array.isArray(n.props.content)?n.props.content.map(e=>({...n,props:{...n.props,content:e}})):n}function w(e,t){if(!e)return[];typeof e==`function`&&(e=e());let n=(e,n)=>{for(let r of t)n=r(e,n);return n};e=b(n(void 0,e),n);let r=[];for(let t in e){let n=e[t];if(n!==void 0)for(let e of Array.isArray(n)?n:[n])r.push(C(t,e))}return r.flat()}var T=/</g,E=/<\/script/g,D=(e,t)=>e._w===t._w?e._p-t._p:e._w-t._w;function O(e){let t=!1;for(let n of e.tags.sort(D)){let r=n._d||y(n),i=e.tagMap.get(r);if(!i){e.tagMap.set(r,n);continue}if((n.tagDuplicateStrategy||(u.has(n.tag)?`merge`:null)||(n.key&&n.key===i.key?`merge`:null))===`merge`){let t={...i.props};for(let e in n.props)t[e]=e===`style`?new Map([...i.props.style||new Map,...n.props[e]]):e===`class`?new Set([...i.props.class||[],...n.props[e]]):n.props[e];e.tagMap.set(r,{...n,props:t})}else n._p>>10==i._p>>10&&n.tag===`meta`&&_(r)?(e.tagMap.set(r,Object.assign([...Array.isArray(i)?i:[i],n],n)),t=!0):(n._w===i._w?n._p>i._p:n._w<i._w)&&e.tagMap.set(r,n)}return t}function k(e,t){let n=e.tagMap.get(`title`),r=e.tagMap.get(`titleTemplate`);if(t._title=n?.textContent,!r)return;let i=r.textContent;if(t._titleTemplate=i,!i)return;let a=typeof i==`function`?i(n?.textContent):i;typeof a==`string`&&!t.plugins.has(`template-params`)&&(a=a.replace(`%s`,n?.textContent||``)),n?a===null?e.tagMap.delete(`title`):e.tagMap.set(`title`,{...n,textContent:a}):e.tagMap.set(`titleTemplate`,{...r,tag:`title`,textContent:a})}function A(e){return e.filter(e=>{let{innerHTML:t,tag:n,props:r}=e;if(!s.has(n)||!Object.keys(r).length&&!t&&!e.textContent||n===`meta`&&!r.content&&!r[`http-equiv`]&&!r.charset)return!1;if(n===`script`&&(t||e.textContent)){let n=String(r.type),i=n.endsWith(`json`)||n===`importmap`||n===`speculationrules`,a=e=>i?(typeof e==`string`?e:JSON.stringify(e)).replace(T,`\\u003C`):typeof e==`string`?e.replace(E,`<\\/script`):e;t&&(e.innerHTML=a(t)),e.textContent&&=a(e.textContent),e._d=v(e)}return!0})}function j(e,t){let n=t?.tagWeight??e.resolvedOptions._tagWeight??(()=>100),r={tagMap:new Map,tags:[]},i=[...e.entries.values()];for(let e of i)e._pending!==void 0&&(e.input=e._pending,delete e._pending,delete e._tags);
1h(e,`entries:resolve`,{entries:i,...r});for(let t of i)if(!t._tags){let r={tags:w(t.input,e.resolvedOptions.propResolvers||[]).map(e=>Object.assign(e,t.options)),entry:t};h(e,`entries:normalize`,r),t._tags=r.tags.map((e,r)=>(e._w=n(e),e._p=(t._i<<10)+r,e._d=v(e),e._d||(e._h=y(e)),e))}r.tags=i.flatMap(e=>(e._tags||[]).map(e=>({...e,props:{...e.props}})));let a=O(r);return k(r,e),r.tags=[...r.tagMap.values()],a&&(r.tags=r.tags.flat().sort(D)),h(e,`tags:beforeResolve`,r),h(e,`tags:resolve`,r),h(e,`tags:afterResolve`,r),A(r.tags)}var M=/\s+/;function N(e={}){return t=>P(t,e)}function P(e,t={}){let n=t.document||e.resolvedOptions.document;if(!n||!e.dirty&&![...e.entries.values()].some(e=>e._pending!==void 0))return!1;let r={shouldRender:!0,tags:[]};if(h(e,`dom:beforeRender`,r),!r.shouldRender||e._du)return!1;e._du=!0;let i=e._dom;if(i)i._p={...i._s};else{i={_t:n.title,_e:new Map([[`htmlAttrs`,n.documentElement],[`bodyAttrs`,n.body]]),_p:{},_s:{}};for(let e of[...n.body.children,...n.head.children]){let t=e.tagName.toLowerCase();if(!o.has(t))continue;let n={innerHTML:e.innerHTML};for(let t of e.getAttributeNames())n[t]=e.getAttribute(t);let r=S({tag:t,props:{}},n);r.key=e.getAttribute(`data-hid`)||void 0;let a=r._d=v(r)||y(r),s=1;for(;i._e.has(a);)a=`${r._d}:${s++}`;i._e.set(a,e)}for(let t of e.entries.values())if(t._o!==void 0){let e=t._o;for(let t of[`bodyAttrs`,`htmlAttrs`]){let n=e[t]?.class;if(typeof n==`string`){let e=i._e.get(t);for(let r of n.split(M))r&&(i._p[`${t}:attr:class:${r}`]=()=>e.classList.remove(r))}}delete t._o}}i._s={};function a(e,t,n){let r=`${e}:${t}`;i._s[r]=n,delete i._p[r]}function s({id:e,$el:t,tag:r}){let o=r.tag.endsWith(`Attrs`);i._e.set(e,t),o||(r.textContent&&r.textContent!==t.textContent&&(t.textContent=r.textContent),r.innerHTML&&r.innerHTML!==t.innerHTML&&(t.innerHTML=r.innerHTML),a(e,`el`,()=>{t?.remove(),i._e.delete(e)}));for(let i in r.props){let s=r.props[i];if(i[0]===`o`&&i[1]===`n`&&typeof s==`function`){let e=i.slice(2);t?.dataset?.[`${i}fired`]&&s.call(t,new Event(e)),t.getAttribute(`data-${i}`)!==``&&((r.tag===`bodyAttrs`?n.defaultView:t).addEventListener(e,s.bind(t)),t.setAttribute(`data-${i}`,``));continue}let c=`attr:${i}`;if(i===`class`&&s)for(let n of s)o&&a(e,`${c}:${n}`,()=>t.classList.remove(n)),t.classList.contains(n)||t.classList.add(n);else if(i===`style`&&s)for(let[n,r]of s)a(e,`${c}:${n}`,()=>t.style.removeProperty(n)),t.style.setProperty(n,r);else s!==!1&&s!==null&&(t.getAttribute(i)!==s&&t.setAttribute(i,s===!0?``:String(s)),o&&a(e,c,()=>t.removeAttribute(i)))}}let c=[],l={},u=j(e,t.tagWeight?{tagWeight:t.tagWeight}:void 0),d=[],f=new Map;for(let e of u){let t=f.get(e._d)||0,r=(t?`${e._d}:${t}`:e._d)||e._h,l={tag:e,id:r,shouldRender:!0};if(e._d&&_(e._d)&&f.set(e._d,t+1),d.push(l),e.tag===`title`){n.title=e.textContent,a(`title`,``,()=>n.title=i._t);continue}l.$el=i._e.get(r),l.$el?s(l):o.has(e.tag)&&c.push(l)}for(let e of c)e.$el=n.createElement(e.tag.tag),s(e),(l[e.tag.tagPosition||`head`]??=n.createDocumentFragment()).appendChild(e.$el);l.head&&n.head.appendChild(l.head),l.bodyOpen&&n.body.insertBefore(l.bodyOpen,n.body.firstChild),l.bodyClose&&n.body.appendChild(l.bodyClose);for(let e in i._p)i._p[e]();return e._dom=i,h(e,`dom:rendered`,{renders:d}),e._du=!1,e.dirty=!1,!0}function F(e,t){let n=typeof t==`function`?t(e):t,r=n.key||String(e.plugins.size+1);if(!e.plugins.get(r)){e.plugins.set(r,n);for(let t in n.hooks||{})e.hooks?.hook(t,n.hooks[t])}}function I(e,t={}){let n=!t.document,r=new Map,i={_entryCount:1,plugins:new Map,resolvedOptions:t,ssr:n,entries:r,render:()=>e(i),use:e=>F(i,e),push(e,t){let a=t?._index??i._entryCount++,o=t?{...t}:{};delete o.head,delete o.onRendered;let s={_i:a,input:e,options:o};return r.set(a,s),{_i:a,dispose(){r.delete(a)},patch(e){n?(s.input=e,delete s._tags):s._pending=e,r.has(a)||r.set(a,s)}}}};return t.init?.forEach(e=>e&&i.push(e)),i}var L={critical:-8,high:-1,low:2},R=e=>typeof e.tagPriority==`number`?e.tagPriority:100+(L[e.tagPriority]||0);function z(e={}){e.document=e.document||(typeof window<`u`?document:void 0);let t=e.render||N({document:e.document}),n=e.document?.head.querySelector(`script[id="unhead:payload"]`)?.innerHTML||!1,r=I(t,{document:e.document,propResolvers:e.propResolvers,_tagWeight:R,init:[]}),i=m(e.hooks),a=!1,o={...r,ssr:!1,hooks:i,use:e=>F(o,e),get dirty(){return a},set dirty(e){a=e},render:()=>t(o),invalidate(){for(let e of r.entries.values())delete e._tags;a=!0,i.callHook(`entries:updated`,o)},push(e,t){let n=t?.onRendered,s=n?i.hook(`dom:rendered`,n):void 0,c=r.push(e,t);return r.entries.get(c._i)._o=e,a=!0,i.callHook(`entries:updated`,o),{_i:c._i,patch(e){c.patch(e),a=!0,i.callHook(`entries:updated`,o)},dispose(){s?.(),r.entries.has(c._i)&&(c.dispose(),o.invalidate())}}}};return i.hook(`entries:updated`,()=>{t(o)}
1),e.plugins?.forEach(e=>F(o,e)),n&&o.push(JSON.parse(n)),e.init?.forEach(e=>e&&o.push(e)),o}function B(e,t){let n=0;return()=>{let r=++n;t(()=>{n===r&&e()})}}var V=(0,r.createContext)(null),H=null;function U(){let e=(0,r.useContext)(V);if(e)return e;if(!H){if(typeof window>`u`)throw TypeError(`Helmet requires UnheadProvider on the server. Wrap your app with <UnheadProvider>.`);let e=N(),t;t=z({render:B(()=>e(t),e=>setTimeout(e,0))}),H=t}return H}var W=({children:e,defaultTitle:t,titleTemplate:n,onChangeClientState:i,title:c,base:l,meta:u,link:d,script:f,style:p,noscript:m,htmlAttributes:h,bodyAttributes:g,encodeSpecialCharacters:_,defer:v})=>{let y=U(),b=(0,r.useMemo)(()=>r.Children.toArray(e).filter(r.isValidElement),[e]),x=(0,r.useCallback)(()=>{let e={};n&&(e.titleTemplate=n),c!=null&&(e.title=c),l&&(e.base=l),u&&(e.meta=[...u]),d&&(e.link=[...d]),f&&(e.script=[...f]),p&&(e.style=[...p]),m&&(e.noscript=[...m]),h&&(e.htmlAttrs=h),g&&(e.bodyAttrs=g);let r=!!c;for(let t of b){let{type:n,props:i}=t,c=String(n);if(c===`html`?c=`htmlAttrs`:c===`body`&&(c=`bodyAttrs`),!s.has(c))continue;let l={...typeof i==`object`?i:{}};if(a.has(c)&&l.children!=null){let e=c===`script`?`innerHTML`:`textContent`;l[e]=Array.isArray(l.children)?l.children.map(String).join(``):String(l.children)}if(delete l.children,c===`title`&&(r=!0),o.has(c)){let t=c;Array.isArray(e[t])||(e[t]=[]),e[t].push(l)}else e[c]=l}return!r&&t&&(e.title=t),t&&(e.templateParams={...e.templateParams,defaultTitle:t}),e},[b,n,t,c,l,u,d,f,p,m,h,g]),S=(0,r.useRef)(null),C=(0,r.useRef)(i);return C.current=i,y.ssr&&!S.current&&(S.current=y.push(x())),(0,r.useEffect)(()=>(S.current=y.push(x(),{onRendered:()=>{let e=C.current;if(!e)return;let t={title:document.querySelector(`title`)?.textContent||``};for(let e of[`meta`,`link`,`script`,`style`,`base`])t[`${e}Tags`]=Array.from(document.querySelectorAll(`head ${e}`));e(t,{},{})}}),()=>{S.current?.dispose(),S.current=null}),[y]),(0,r.useEffect)(()=>{S.current?.patch(x())},[x]),null};export{W as t}; 2//# sourceMappingURL=helmet-DcyqcM0_.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.