"use strict";/** * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const w=new Set(["children","localName","ref","style","className"]),p=new WeakMap,y=(r,l,a,i,d)=>{const f=d==null?void 0:d[l];f===void 0?(r[l]=a,a==null&&l in HTMLElement.prototype&&r.removeAttribute(l)):a!==i&&((u,c,o)=>{let s=p.get(u);s===void 0&&p.set(u,s=new Map);let t=s.get(c);o!==void 0?t===void 0?(s.set(c,t={handleEvent:o}),u.addEventListener(c,t)):t.handleEvent=o:t!==void 0&&(s.delete(c),u.removeEventListener(c,t))})(r,f,a)},h=({react:r,tagName:l,elementClass:a,events:i,displayName:d})=>{const f=new Set(Object.keys(i??{})),u=r.forwardRef((c,o)=>{const s=r.useRef(new Map),t=r.useRef(null),v={},m={};for(const[e,n]of Object.entries(c))w.has(e)?v[e==="className"?"class":e]=n:f.has(e)||e in a.prototype?m[e]=n:v[e]=n;return r.useLayoutEffect(()=>{if(t.current===null)return;const e=new Map;for(const n in m)y(t.current,n,c[n],s.current.get(n),i),s.current.delete(n),e.set(n,c[n]);for(const[n,E]of s.current)y(t.current,n,void 0,E,i);s.current=e}),r.useLayoutEffect(()=>{var e;(e=t.current)==null||e.removeAttribute("defer-hydration")},[]),v.suppressHydrationWarning=!0,r.createElement(l,{...v,ref:r.useCallback(e=>{t.current=e,typeof o=="function"?o(e):o!==null&&(o.current=e)},[o])})});return u.displayName=d??a.name,u};exports.o=h;