import{l as D,a8 as q,V as H,B as P,m as y,q as G,v as O,aC as Q,a1 as X,aS as J,aT as m,z as x,aU as aa,aV as ra,aW as ea,aX as ia,g as sa,aY as ta,aZ as ua,Q as Y,a_ as fa,D as la,a$ as oa,b0 as ca,C as na,b1 as _a}from"./DOPisAOl.js";import{i as va,n as da,b as ba}from"./Xc3_nZLd.js";import{t as ha,c as Aa,s as ga}from"./eylS3834.js";function ya(a,e){var r=void 0,i;D(()=>{r!==(r=e())&&(i&&(q(i),i=null),r&&(i=H(()=>{P(()=>r(a))})))})}function M(a,e={},r,i){for(var s in r){var f=r[s];e[s]!==f&&(r[s]==null?a.style.removeProperty(s):a.style.setProperty(s,f,i))}}function Sa(a,e,r,i){var s=a.__style;if(y||s!==e){var f=ha(e,i);(!y||f!==a.getAttribute("style"))&&(f==null?a.removeAttribute("style"):a.style.cssText=f),a.__style=e}else i&&(Array.isArray(i)?(M(a,r==null?void 0:r[0],i[0]),M(a,r==null?void 0:r[1],i[1],"important")):M(a,r,i));return i}function L(a,e,r=!1){if(a.multiple){if(e==null)return;if(!X(e))return J();for(var i of a.options)i.selected=e.includes(w(i));return}for(i of a.options){var s=w(i);if(m(s,e)){i.selected=!0;return}}(!r||e!==void 0)&&(a.selectedIndex=-1)}function R(a){var e=new MutationObserver(()=>{L(a,a.__value)});e.observe(a,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Q(()=>{e.disconnect()})}function La(a,e,r=e){var i=new WeakSet,s=!0;G(a,"change",f=>{var v=f?"[selected]":":checked",b;if(a.multiple)b=[].map.call(a.querySelectorAll(v),w);else{var c=a.querySelector(v)??a.querySelector("option:not([disabled])");b=c&&w(c)}r(b),O!==null&&i.add(O)}),P(()=>{var f=e();if(a===document.activeElement){var v=x??O;if(i.has(v))return}if(L(a,f,s),s&&f===void 0){var b=a.querySelector(":checked");b!==null&&(f=w(b),r(f))}a.__value=f,s=!1}),R(a)}function w(a){return"__value"in a?a.__value:a.value}const N=Symbol("class"),E=Symbol("style"),j=Symbol("is custom element"),z=Symbol("is html");function Ta(a){if(y){var e=!1,r=()=>{if(!e){if(e=!0,a.hasAttribute("value")){var i=a.value;p(a,"value",null),a.value=i}if(a.hasAttribute("checked")){var s=a.checked;p(a,"checked",null),a.checked=s}}};a.__on_r=r,na(r),_a()}}function ka(a,e){e?a.hasAttribute("selected")||a.setAttribute("selected",""):a.removeAttribute("selected")}function p(a,e,r,i){var s=K(a);y&&(s[e]=a.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&a.nodeName==="LINK")||s[e]!==(s[e]=r)&&(e==="loading"&&(a[ra]=r),r==null?a.removeAttribute(e):typeof r!="string"&&W(a).includes(e)?a[e]=r:a.setAttribute(e,r))}function Na(a,e,r,i,s=!1,f=!1){if(y&&s&&a.tagName==="INPUT"){var v=a,b=v.type==="checkbox"?"defaultChecked":"defaultValue";b in r||Ta(v)}var c=K(a),h=c[j],I=!c[z];let S=y&&h;S&&Y(!1);var l=e||{},A=a.tagName==="OPTION";for(var T in e)T in r||(r[T]=null);r.class?r.class=Aa(r.class):(i||r[N])&&(r.class=null),r[E]&&(r.style??(r.style=null));var k=W(a);for(const t in r){let u=r[t];if(A&&t==="value"&&u==null){a.value=a.__value="",l[t]=u;continue}if(t==="class"){var d=a.namespaceURI==="http://www.w3.org/1999/xhtml";ga(a,d,u,i,e==null?void 0:e[N],r[N]),l[t]=u,l[N]=r[N];continue}if(t==="style"){Sa(a,u,e==null?void 0:e[E],r[E]),l[t]=u,l[E]=r[E];continue}var $=l[t];if(!(u===$&&!(u===void 0&&a.hasAttribute(t)))){l[t]=u;var U=t[0]+t[1];if(U!=="$$")if(U==="on"){const _={},g="$$"+t;let o=t.slice(2);var C=ba(o);if(va(o)&&(o=o.slice(0,-7),_.capture=!0),!C&&$){if(u!=null)continue;a.removeEventListener(o,l[g],_),l[g]=null}if(u!=null)if(C)a[`__${o}`]=u,la([o]);else{let Z=function(F){l[t].call(this,F)};l[g]=fa(o,a,Z,_)}else C&&(a[`__${o}`]=void 0)}else if(t==="style")p(a,t,u);else if(t==="autofocus")oa(a,!!u);else if(!h&&(t==="__value"||t==="value"&&u!=null))a.value=a.__value=u;else if(t==="selected"&&A)ka(a,u);else{var n=t;I||(n=da(n));var V=n==="defaultValue"||n==="defaultChecked";if(u==null&&!h&&!V)if(c[t]=null,n==="value"||n==="checked"){let _=a;const g=e===void 0;if(n==="value"){let o=_.defaultValue;_.removeAttribute(n),_.defaultValue=o,_.value=_.__value=g?o:null}else{let o=_.defaultChecked;_.removeAttribute(n),_.defaultChecked=o,_.checked=g?o:!1}}else a.removeAttribute(t);else V||k.includes(n)&&(h||typeof u!="string")?(a[n]=u,n in c&&(c[n]=ca)):typeof u!="function"&&p(a,n,u)}}}return S&&Y(!0),l}function pa(a,e,r=[],i=[],s,f=!1,v=!1){aa(r,i,b=>{var c=void 0,h={},I=a.nodeName==="SELECT",S=!1;if(D(()=>{var A=e(...b.map(sa)),T=Na(a,c,A,s,f,v);S&&I&&"value"in A&&L(a,A.value);for(let d of Object.getOwnPropertySymbols(h))A[d]||q(h[d]);for(let d of Object.getOwnPropertySymbols(A)){var k=A[d];d.description===ta&&(!c||k!==c[d])&&(h[d]&&q(h[d]),h[d]=H(()=>ya(a,()=>k))),T[d]=k}c=T}),I){var l=a;P(()=>{L(l,c.value,!0),R(l)})}S=!0})}function K(a){return a.__attributes??(a.__attributes={[j]:a.nodeName.includes("-"),[z]:a.namespaceURI===ea})}var B=new Map;function W(a){var e=a.getAttribute("is")||a.nodeName,r=B.get(e);if(r)return r;B.set(e,r=[]);for(var i,s=a,f=Element.prototype;f!==s;){i=ua(s);for(var v in i)i[v].set&&r.push(v);s=ia(s)}return r}export{pa as a,La as b,Sa as c,Ta as r,p as s};
