@domphy/ui 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core-theme-ui.global.js +1 -1
- package/dist/core-theme-ui.global.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
${r.join(" \u2192 ")}`),!0}_flushAll(){this._scheduled=!1;let e=this._pending;this._pending=new Map;for(let[t,{args:r,chain:o}]of e)Y=o,this._flush(t,r);Y=[]}_flush(e,t){if(!this._listeners)return;let r=this._listeners[e];if(r){Y.push([this,e]);for(let o of[...r])if(r.has(o))try{o(...t)}catch(i){console.error(i)}Y.pop()}}},Ke=class{constructor(e,t=typeof e){this.name=t,this._notifier=new se,this.initialValue=e,this._value=e}get(e){return e&&this.addListener(e),this._value}set(e){this._notifier&&(this._value=e,this._notifier.notify(this.name,e))}reset(){this.set(this.initialValue)}addListener(e){return this._notifier?this._notifier.addListener(this.name,e):()=>{}}removeListener(e){this._notifier&&this._notifier.removeListener(this.name,e)}_dispose(){this._notifier&&(this._notifier._dispose(),this._notifier=null)}};function k(e={},t={}){let r=["animation","transition","boxShadow","textShadow","background","fontFamily"],o=["class","rel","transform","acceptCharset","sandbox"],i=["content"];Object.prototype.toString.call(t)==="[object Object]"&&Object.getPrototypeOf(t)===Object.prototype&&(t=Z(t));for(let n in t){let a=t[n];if(!(a==null||a===""))if(typeof a=="object"&&!Array.isArray(a))typeof e[n]=="object"?e[n]=k(e[n],a):e[n]=a;else if(r.includes(n))if(typeof e[n]=="function"||typeof a=="function"){let c=e[n];e[n]=m=>{let u=typeof c=="function"?c(m):c,f=typeof a=="function"?a(m):a;return[u,f].filter(d=>d).join(", ")}}else e[n]=[e[n],a].filter(c=>c).join(", ");else if(i.includes(n))if(typeof e[n]=="function"||typeof a=="function"){let c=e[n];e[n]=m=>{let u=typeof c=="function"?c(m):c,f=typeof a=="function"?a(m):a;return[u,f].filter(d=>d).join("")}}else e[n]=[e[n],a].filter(c=>c).join("");else if(o.includes(n))if(typeof e[n]=="function"||typeof a=="function"){let c=e[n];e[n]=m=>{let u=typeof c=="function"?c(m):c,f=typeof a=="function"?a(m):a;return[u,f].filter(d=>d).join(" ")}}else e[n]=[e[n],a].filter(c=>c).join(" ");else if(n.startsWith("on")){let c=n.replace("on","").toLowerCase();$o(e,c,a)}else if(n.startsWith("_on")){let c=n.replace("_on","");Ro(e,c,a)}else e[n]=a}return e}function ce(e=""){let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=t*16777619>>>0;return String.fromCharCode(97+t%26)+t.toString(16)}function h(e,t){return e instanceof Ke?e:new Ke(e,t)}function Ro(e,t,r){let o=`_on${t}`,i=e[o];typeof i=="function"?e[o]=(...n)=>{i(...n),r(...n)}:e[o]=r}function $o(e,t,r){let o=Po[t];if(!o)throw Error(`invalid event name "${t}"`);let i=e[o];typeof i=="function"?e[o]=(n,a)=>{i(n,a),r(n,a)}:e[o]=r}function Z(e,t=new WeakMap){if(e===null||typeof e!="object"||typeof e=="function")return e;if(t.has(e))return t.get(e);let r=Object.getPrototypeOf(e);if(r!==Object.prototype&&!Array.isArray(e))return e;let o;if(Array.isArray(e)){o=[],t.set(e,o);for(let i of e)o.push(Z(i,t));return o}if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e);if(e instanceof Map){o=new Map,t.set(e,o);for(let[i,n]of e)o.set(Z(i,t),Z(n,t));return o}if(e instanceof Set){o=new Set,t.set(e,o);for(let i of e)o.add(Z(i,t));return o}if(ArrayBuffer.isView(e))return new e.constructor(e);if(e instanceof ArrayBuffer)return e.slice(0);o=Object.create(r),t.set(e,o);for(let i of Reflect.ownKeys(e))o[i]=Z(e[i],t);return o}function wt(e,t=!1){if(Object.prototype.toString.call(e)!=="[object Object]")throw Error(`typeof ${e} is invalid DomphyElement`);let r=Object.keys(e);for(let o=0;o<r.length;o++){let i=r[o],n=e[i];if(o==0&&!Ge.includes(i)&&!i.includes("-")&&!t)throw Error(`key ${i} is not valid HTML tag name`);if(i=="style"&&n&&Object.prototype.toString.call(n)!=="[object Object]")throw Error('"style" must be a object');if(i=="$")e.$.forEach(a=>wt(a,!0));else{if(i.startsWith("_on")&&typeof n!="function")throw Error(`hook ${i} value "${n}" must be a function `);if(i.startsWith("on")&&typeof n!="function")throw Error(`event ${i} value "${n}" must be a function `);if(i=="_portal"&&typeof n!="function")throw Error('"_portal" must be a function return HTMLElement');if(i=="_context"&&Object.prototype.toString.call(n)!=="[object Object]")throw Error('"_context" must be a object');if(i=="_metadata"&&Object.prototype.toString.call(n)!=="[object Object]")throw Error('"_metadata" must be a object');if(i=="_key"&&typeof n!="string"&&typeof n!="number")throw Error('"_key" must be a string or number')}}return!0}function Lo(e){return/<([a-z][\w-]*)(\s[^>]*)?>.*<\/\1>|<([a-z][\w-]*)(\s[^>]*)?\/>/i.test(e.trim())}function Ct(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Io(e){return Object.keys(e).find(t=>Ge.includes(t))}function Et(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function zo(e){if(e.indexOf("@")===0)return[e];for(var t=[],r=0,o=0,i="",n=0,a=e.length;n<a;n++){var c=e[n];if(c==="(")r+=1;else if(c===")")r-=1;else if(c==="[")o+=1;else if(c==="]")o-=1;else if(c===","&&!r&&!o){t.push(i.trim()),i="";continue}i+=c}return t.push(i.trim()),t}function kt(e){var t;let r=e.querySelector("#domphy-style");return r||(r=document.createElement("style"),r.id="domphy-style",e.appendChild(r)),r.dataset.domphyBase!=="true"&&((t=r.sheet)==null||t.insertRule("[hidden] { display: none !important; }",0),r.dataset.domphyBase="true"),r}var Tt=e=>{if(Array.isArray(e.$)){let t={};return e.$.forEach(r=>k(t,Tt(r))),delete e.$,k(t,e),t}else return e},Mo=["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"],_t=["svg","circle","path","rect","ellipse","line","polyline","polygon","g","defs","use","symbol","linearGradient","radialGradient","stop","clipPath","mask","filter","text","tspan","textPath","image","pattern","marker","animate","animateTransform","animateMotion","feGaussianBlur","feComposite","feColorMatrix","feMerge","feMergeNode","feOffset","feFlood","feBlend","foreignObject"],Ye=["allowFullScreen","async","autoFocus","autoPlay","checked","compact","contentEditable","controls","declare","default","defer","disabled","formNoValidate","hidden","isMap","itemScope","loop","multiple","muted","noHref","noShade","noValidate","open","playsInline","readonly","required","reversed","scoped","selected","sortable","trueSpeed","typeMustMatch","wmode","autoCapitalize","translate","spellCheck","inert","download","noModule","paused","autoPictureInPicture"],J={transform:["webkit","ms"],transition:["webkit","ms"],animation:["webkit"],userSelect:["webkit","ms"],flexDirection:["webkit","ms"],flexWrap:["webkit","ms"],justifyContent:["webkit","ms"],alignItems:["webkit","ms"],alignSelf:["webkit","ms"],order:["webkit","ms"],flexGrow:["webkit","ms"],flexShrink:["webkit","ms"],flexBasis:["webkit","ms"],columns:["webkit"],columnCount:["webkit"],columnGap:["webkit"],columnRule:["webkit"],columnWidth:["webkit"],boxSizing:["webkit"],appearance:["webkit","moz"],filter:["webkit"],backdropFilter:["webkit"],clipPath:["webkit"],mask:["webkit"],maskImage:["webkit"],textSizeAdjust:["webkit","ms"],hyphens:["webkit","ms"],writingMode:["webkit","ms"],gridTemplateColumns:["ms"],gridTemplateRows:["ms"],gridAutoColumns:["ms"],gridAutoRows:["ms"],gridColumn:["ms"],gridRow:["ms"],marginInlineStart:["webkit"],marginInlineEnd:["webkit"],paddingInlineStart:["webkit"],paddingInlineEnd:["webkit"],minInlineSize:["webkit"],maxInlineSize:["webkit"],minBlockSize:["webkit"],maxBlockSize:["webkit"],inlineSize:["webkit"],blockSize:["webkit"],tabSize:["moz"],overscrollBehavior:["webkit","ms"],touchAction:["ms"],resize:["webkit"],printColorAdjust:["webkit"],backgroundClip:["webkit"],boxDecorationBreak:["webkit"],overflowScrolling:["webkit"]},Ot=["viewBox","preserveAspectRatio","gradientTransform","gradientUnits","spreadMethod","markerStart","markerMid","markerEnd","markerHeight","markerWidth","markerUnits","refX","refY","patternContentUnits","patternTransform","patternUnits","filterUnits","primitiveUnits","kernelUnitLength","clipPathUnits","maskContentUnits","maskUnits"],Ao=class{constructor(e,t,r){this.parent=r,this.isBoolean=Ye.includes(e),Ot.includes(e)?this.name=e:this.name=Et(e),this.value=void 0,this.set(t)}render(){if(!this.parent||!this.parent.domElement)return;let e=this.parent.domElement,t=["value"];this.isBoolean?this.value===!1||this.value==null?e.removeAttribute(this.name):e.setAttribute(this.name,this.value===!0?"":this.value):this.value==null?e.removeAttribute(this.name):t.includes(this.name)?e[this.name]=this.value:e.setAttribute(this.name,this.value)}set(e){var t,r;if(e==null){this.value=null,this.render();return}if(typeof e=="string"&&/<\/?[a-z][\s\S]*>/i.test(e))this.value=Ct(e);else if(typeof e=="function"){let o=()=>{!this.parent||this.parent._disposed||(this.value=this.isBoolean?!!e():e(),this.render())};o.elementNode=this.parent,o.debug=`class:${(t=this.parent)==null?void 0:t.tagName}_${(r=this.parent)==null?void 0:r.nodeId} attribute:${this.name}`,o.onSubscribe=i=>{this.parent&&this.parent.addHook("BeforeRemove",()=>{i(),o=null})},this.value=this.isBoolean?!!e(o):e(o)}else this.value=this.isBoolean?!!e:e;this.render()}remove(){this.parent&&this.parent.attributes&&this.parent.attributes.remove(this.name),this._dispose()}_dispose(){this.value=null,this.parent=null}generateHTML(){let{name:e,value:t}=this;if(this.isBoolean)return t?`${e}`:"";{let r=Array.isArray(t)?JSON.stringify(t):t;return`${e}="${Ct(String(r))}"`}}},Pt=class{constructor(e){this._notifier=new se,this.items={},this.parent=e}generateHTML(){if(!this.items)return"";let e=Object.values(this.items).map(t=>t.generateHTML()).join(" ");return e?` ${e}`:""}get(e){var t;if(this.items)return(t=this.items[e])==null?void 0:t.value}set(e,t){!this.items||!this.parent||(this.items[e]?(this.items[e].set(t),this.parent.domElement&&this._notifier.notify(e,this.items[e].value)):this.items[e]=new Ao(e,t,this.parent))}addListener(e,t){var r;if(this.has(e)&&(r=this.parent)!=null&&r.domElement){let o=t;o.onSubscribe=i=>{var n;return(n=this.parent)==null?void 0:n.addHook("BeforeRemove",i)},this._notifier.addListener(e,o)}}has(e){return this.items?Object.prototype.hasOwnProperty.call(this.items,e):!1}remove(e){this.items&&(this.items[e]&&(this.items[e]._dispose(),delete this.items[e]),this.parent&&this.parent.domElement&&this.parent.domElement instanceof Element&&this.parent.domElement.removeAttribute(e))}_dispose(){if(this.items)for(let e in this.items)this.items[e]._dispose();this._notifier._dispose(),this.items=null,this.parent=null}toggle(e,t){if(!Ye.includes(e))throw Error(`${e} is not a boolean attribute`);t===!0?this.set(e,!0):t===!1?this.remove(e):this.has(e)?this.remove(e):this.set(e,!0)}addClass(e){if(!e||typeof e!="string")return;let t=(o,i)=>{let n=(o||"").split(" ").filter(a=>a);return!n.includes(i)&&n.push(e),n.join(" ")},r=this.get("class");typeof r=="function"?this.set("class",()=>t(r(),e)):this.set("class",t(r,e))}hasClass(e){return!e||typeof e!="string"?!1:(this.get("class")||"").split(" ").filter(t=>t).includes(e)}toggleClass(e){!e||typeof e!="string"||(this.hasClass(e)?this.removeClass(e):this.addClass(e))}removeClass(e){if(!e||typeof e!="string")return;let t=(this.get("class")||"").split(" ").filter(r=>r).filter(r=>r!==e);t.length>0?this.set("class",t.join(" ")):this.remove("class")}replaceClass(e,t){!e||!t||typeof e!="string"||typeof t!="string"||this.hasClass(e)&&(this.removeClass(e),this.addClass(t))}},Vo=class{constructor(e,t){this.type="TextNode",this.parent=t,this.text=e===""?"\u200B":String(e)}_createDOMNode(){let e;if(Lo(this.text)){let t=document.createElement("template");t.innerHTML=this.text.trim(),e=t.content.firstChild||document.createTextNode("")}else e=document.createTextNode(this.text);return this.domText=e,e}_dispose(){this.domText=void 0,this.text=""}generateHTML(){return this.text==="\u200B"?"​":this.text}render(e){let t=this._createDOMNode();e.appendChild(t)}},Rt=class{constructor(e){this.items=[],this._nextKey=0,this.owner=e}_createNode(e){return typeof e=="object"&&e!==null?new L(e,this.owner,this._nextKey++):new Vo(e==null?"":String(e),this.owner)}_moveDomElement(e,t){if(!this.owner||!this.owner.domElement)return;let r=this.owner.domElement,o=e instanceof L?e.domElement:e.domText;if(o){let i=r.childNodes[t]||null;o!==i&&r.insertBefore(o,i)}}_swapDomElement(e,t){if(!this.owner||!this.owner.domElement)return;let r=this.owner.domElement,o=e instanceof L?e.domElement:e.domText,i=t instanceof L?t.domElement:t.domText;if(!o||!i)return;let n=o.nextSibling,a=i.nextSibling;r.insertBefore(o,a),r.insertBefore(i,n)}update(e,t=!0,r=!1){var o,i,n,a;let c=this.items.slice(),m=new Map;for(let u of c)u instanceof L&&u.key!==null&&u.key!==void 0&&m.set(u.key,u);!r&&this.owner.domElement&&((i=(o=this.owner._hooks)==null?void 0:o.BeforeUpdate)==null||i.call(o,this.owner,e));for(let u=0;u<e.length;u++){let f=e[u],d=typeof f=="object"&&f!==null?f._key:void 0;if(d!==void 0){let y=m.get(d);if(y){m.delete(d);let b=this.items.indexOf(y);if(b!==u&&b>=0){let v=y instanceof L&&!!y._portal;this.move(b,u,v?!1:t,!0)}y.parent=this.owner;continue}}this.insert(f,u,t,!0)}for(;this.items.length>e.length;)this.remove(this.items[this.items.length-1],t,!0);m.forEach(u=>this.remove(u,t,!0)),r||(a=(n=this.owner._hooks)==null?void 0:n.Update)==null||a.call(n,this.owner)}insert(e,t,r=!0,o=!1){var i,n;let a=this.items.length,c=typeof t!="number"||isNaN(t)||t<0||t>a?a:t,m=this._createNode(e);if(this.items.splice(c,0,m),m instanceof L){m._hooks.Insert&&m._hooks.Insert(m);let u=this.owner.domElement;if(r&&u)if(m._portal){let f=m._portal(this.owner.getRoot());f&&m.render(f)}else{let f=m._createDOMNode(),d=(i=u.childNodes[c])!=null?i:null;u.insertBefore(f,d);let y=u.getRootNode(),b=y instanceof ShadowRoot?y:document.head,v=kt(b);m.styles.render(v),m._hooks.Mount&&m._hooks.Mount(m),m.children.items.forEach(x=>{if(x instanceof L&&x._portal){let S=x._portal(x.getRoot());S&&x.render(S)}else x.render(f)})}}else{let u=this.owner.domElement;if(r&&u){let f=m._createDOMNode(),d=(n=u.childNodes[c])!=null?n:null;u.insertBefore(f,d)}}return!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner),m}remove(e,t=!0,r=!1){let o=this.items.indexOf(e);if(!(o<0)){if(e instanceof L){let i=()=>{var n,a;let c=e.domElement;this.items.splice(o,1),t&&c&&c.remove(),(a=(n=e._hooks)==null?void 0:n.Remove)==null||a.call(n,e),e._dispose()};if(e._hooks.BeforeRemove&&e.domElement){let n=!1,a=()=>{n||(n=!0,i())};e._hooks.BeforeRemove(e,a),n||a()}else i()}else{let i=e.domText;this.items.splice(o,1),t&&i&&i.remove(),e._dispose()}!r&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}}clear(e=!0,t=!1){if(this.items.length===0)return;let r=this.items.slice();for(let o of r)this.remove(o,e,!0);!t&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}_dispose(){this.items.forEach(e=>e._dispose()),this.items=[]}swap(e,t,r=!0,o=!1){if(e<0||t<0||e>=this.items.length||t>=this.items.length||e===t)return;let i=this.items[e],n=this.items[t];this.items[e]=n,this.items[t]=i,r&&this._swapDomElement(i,n),!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}move(e,t,r=!0,o=!1){if(e<0||e>=this.items.length||t<0||t>=this.items.length||e===t)return;let i=this.items[e];this.items.splice(e,1),this.items.splice(t,0,i),r&&this._moveDomElement(i,t),!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}generateHTML(){let e="";for(let t of this.items)e+=t.generateHTML();return e}},No=class{constructor(e,t,r){this.value="",this.name=e,this.cssName=Et(e),this.parentRule=r,this.set(t)}_domUpdate(){if(!this.parentRule)return;let e=this.parentRule.domRule;if(e&&e.style){let t=e.style;t.setProperty(this.cssName,String(this.value)),J[this.name]&&J[this.name].forEach(r=>{t.setProperty(`-${r}-${this.cssName}`,String(this.value))})}}_dispose(){this.value="",this.parentRule=null}set(e){var t,r,o,i;if(typeof e=="function"){let n=()=>{var a;!this.parentRule||(a=this.parentRule.parentNode)!=null&&a._disposed||(this.value=e(n),this._domUpdate())};n.onSubscribe=a=>{var c;(c=this.parentRule.parentNode)==null||c.addHook("BeforeRemove",()=>{a(),n=null})},n.elementNode=this.parentRule.root,n.debug=`class:${(r=(t=this.parentRule)==null?void 0:t.root)==null?void 0:r.tagName}_${(i=(o=this.parentRule)==null?void 0:o.root)==null?void 0:i.nodeId} style:${this.name}`,this.value=e(n)}else this.value=e;this._domUpdate()}remove(){if(this.parentRule){if(this.parentRule.domRule instanceof CSSStyleRule){let e=this.parentRule.domRule.style;e.removeProperty(this.cssName),J[this.name]&&J[this.name].forEach(t=>{e.removeProperty(`-${t}-${this.cssName}`)})}delete this.parentRule.styleBlock[this.name],this._dispose()}}cssText(){let e=`${this.cssName}: ${this.value}`;return J[this.name]&&J[this.name].forEach(t=>{e+=`; -${t}-${this.cssName}: ${this.value}`}),e}},X=class qe{constructor(t,r){this.domRule=null,this.styleBlock={},this.selectorText=t,this.styleList=new $t(this),this.parent=r}_dispose(){if(this.styleBlock)for(let t of Object.values(this.styleBlock))t._dispose();this.styleList&&this.styleList._dispose(),this.styleBlock=null,this.styleList=null,this.domRule=null,this.parent=null}get root(){let t=this.parent;for(;t instanceof qe;)t=t.parent;return t}get parentNode(){let t=this.parent;for(;t&&t instanceof qe;)t=t.parent;return t}insertStyle(t,r){this.styleBlock&&(this.styleBlock[t]?this.styleBlock[t].set(r):this.styleBlock[t]=new No(t,r,this))}removeStyle(t){this.styleBlock&&this.styleBlock[t]&&this.styleBlock[t].remove()}cssText(){if(!this.styleBlock||!this.styleList)return"";let t=Object.values(this.styleBlock).map(o=>o.cssText()).join(";"),r=this.styleList.cssText();return`${this.selectorText} { ${t} ${r} } `}mount(t){!t||!this.styleList||(this.domRule=t,"cssRules"in t&&this.styleList.mount(t.cssRules))}remove(){if(this.domRule&&this.domRule.parentStyleSheet){let t=this.domRule.parentStyleSheet,r=t.cssRules;for(let o=0;o<r.length;o++)if(r[o]===this.domRule){t.deleteRule(o);break}}this._dispose()}render(t){if(!this.styleBlock||!this.styleList)return;let r=Object.values(this.styleBlock).map(o=>o.cssText()).join(";");try{if(this.selectorText.startsWith("@")){if(/^@(media|supports|container|layer)\b/.test(this.selectorText)){let o=t.insertRule(`${this.selectorText} {}`,t.cssRules.length),i=t.cssRules[o];"cssRules"in i&&(this.mount(i),this.styleList.render(i))}else if(this.selectorText.startsWith("@keyframes")||this.selectorText.startsWith("@font-face")){let o=this.cssText(),i=t.insertRule(o,t.cssRules.length),n=t.cssRules[i];this.mount(n)}}else{let o=`${this.selectorText} { ${r} }`,i=t.insertRule(o,t.cssRules.length),n=t.cssRules[i];n&&"selectorText"in n&&this.mount(n)}}catch(o){console.warn("Failed to insert rule:",this.selectorText,o)}}},$t=class{constructor(e){this.items=[],this.domStyle=null,this.parent=e}get parentNode(){let e=this.parent;for(;e&&e instanceof X;)e=e.parent;return e}addCSS(e,t=""){if(!this.items||!this.parent)return;let r={};function o(i,n){return i.startsWith("&")?`${n}${i.slice(1)}`:`${n} ${i}`}for(let i in e){let n=e[i],a=zo(i);for(let c of a){let m=o(c,t);if(/^@(container|layer|supports|media)\b/.test(c)){if(typeof n=="object"&&n!=null){let u=new X(c,this.parent);u.styleList.addCSS(n,t),this.items.push(u)}}else if(c.startsWith("@keyframes")){let u=new X(c,this.parent);u.styleList.addCSS(n,""),this.items.push(u)}else if(c.startsWith("@font-face")){let u=new X(c,this.parent);for(let f in n)u.insertStyle(f,n[f]);this.items.push(u)}else if(typeof n=="object"&&n!=null){let u=new X(m,this.parent);this.items.push(u);for(let[f,d]of Object.entries(n))if(typeof d=="object"&&d!=null){let y=o(f,m);f.startsWith("&")?this.addCSS(d,y):u.styleList.insertRule(y).styleList.addCSS(d,y)}else u.insertStyle(f,d)}else r[c]=n}}if(Object.keys(r).length){let i=new X(t,this.parent);for(let n in r)i.insertStyle(n,r[n]);this.items.push(i)}}cssText(){return this.items?this.items.map(e=>e.cssText()).join(""):""}insertRule(e){if(!this.items||!this.parent)return null;let t=this.items.find(r=>r.selectorText===e);return t||(t=new X(e,this.parent),this.items.push(t)),t}mount(e){if(!this.items)return;if(!e)throw Error("Require domRuleList argument");let t=0,r=o=>o.replace("(odd)","(2n+1)").replace("(even)","(2n)");this.items.forEach((o,i)=>{let n=i-t,a=e[n];a&&(o.selectorText.startsWith("@")&&a instanceof CSSKeyframesRule||"keyText"in a?o.mount(a):"selectorText"in a?a.selectorText!==r(o.selectorText)?t+=1:o.mount(a):"cssRules"in a&&o.mount(a))})}render(e){e instanceof HTMLStyleElement?(this.domStyle=e,this.items.forEach(t=>t.render(e.sheet))):e instanceof CSSGroupingRule&&this.items.forEach(t=>t.render(e))}_dispose(){if(this.items)for(let e=0;e<this.items.length;e++)this.items[e]._dispose();this.items=[],this.parent=null,this.domStyle=null}},L=class ge{constructor(t,r=null,o=0){this._disposed=!1,this.type="ElementNode",this.parent=null,this.children=new Rt(this),this.styles=new $t(this),this.attributes=new Pt(this),this.domElement=null,this._hooks={},this._events=null,this._context={},this._metadata={},this.key=null;var i,n;t=Z(t),wt(t),t.style=t.style||{},this.parent=r,this.tagName=Io(t),t=Tt(t),this.key=(i=t._key)!=null?i:null,this._context=t._context||{},this._metadata=t._metadata||{};let a=`${(n=this.parent)==null?void 0:n.nodeId}.${o}`,c=JSON.stringify(t.style||{},(u,f)=>typeof f=="function"?a:f);this.nodeId=ce(a+c),this.attributes.addClass(`${this.tagName}_${this.nodeId}`),t._onSchedule&&t._onSchedule(this,t),this.merge(t);let m=t[this.tagName];if(m!=null&&m!=null)if(typeof m=="function"){let u=()=>{if(this._disposed)return;let f=m(u);this.children.update(Array.isArray(f)?f:[f])};u.elementNode=this,u.debug=`class:${this.tagName}_${this.nodeId} children`,u.onSubscribe=f=>this.addHook("BeforeRemove",()=>{f(),u=null}),u&&u()}else this.children.update(Array.isArray(m)?m:[m]);this._hooks.Init&&this._hooks.Init(this)}_createDOMNode(){let t=_t.includes(this.tagName)?document.createElementNS("http://www.w3.org/2000/svg",this.tagName):document.createElement(this.tagName);if(this.domElement=t,this._events)for(let r in this._events){let o=r,i=this._events[o],n=a=>i(a,this);t.addEventListener(o,n),this.addHook("BeforeRemove",a=>{a.domElement.removeEventListener(o,n),n=null})}return this.attributes&&Object.values(this.attributes.items).forEach(r=>r.render()),t}_dispose(){this._disposed=!0,this.children&&this.children._dispose(),this.styles&&(this.styles.items.forEach(t=>t.remove()),this.styles._dispose()),this.attributes&&this.attributes._dispose(),this.domElement=null,this._hooks={},this._events=null,this._context={},this._metadata={},this.parent=null}merge(t){k(this._context,t._context),k(this._metadata,t._metadata);let r=Object.keys(t);for(let o=0;o<r.length;o++){let i=r[o],n=t[i];["$","_onSchedule","_key","_context","_metadata","style",this.tagName].includes(i)||(["_onInit","_onInsert","_onMount","_onBeforeUpdate","_onUpdate","_onBeforeRemove","_onRemove"].includes(i)?this.addHook(i.substring(3),n):i.startsWith("on")?this.addEvent(i.substring(2).toLowerCase(),n):i=="_portal"?this._portal=n:i=="class"&&typeof n=="string"?this.attributes.addClass(n):this.attributes.set(i,n))}t.style&&this.styles.addCSS(t.style||{},`.${`${this.tagName}_${this.nodeId}`}`)}addEvent(t,r){this._events=this._events||{};let o=this._events[t];typeof o=="function"?this._events[t]=(i,n)=>{o(i,n),r(i,n)}:this._events[t]=r}addHook(t,r){let o=this._hooks[t];typeof o=="function"?this._hooks[t]=((...i)=>{o(...i),r(...i)}):this._hooks[t]=r}getRoot(){let t=this;for(;t&&t instanceof ge&&t.parent;)t=t.parent;return t}getContext(t){let r=this;for(;r&&(!r._context||!Object.prototype.hasOwnProperty.call(r._context,t));)r=r.parent;return r&&r._context?r._context[t]:void 0}setContext(t,r){this._context=this._context||{},this._context[t]=r}getMetadata(t){return this._metadata?this._metadata[t]:void 0}setMetadata(t,r){this._metadata=this._metadata||{},this._metadata[t]=r}generateCSS(){if(!this.styles||!this.children)return"";let t=this.styles.cssText();return t+=this.children.items.map(r=>r instanceof ge?r.generateCSS():"").join(""),t}generateHTML(){if(!this.children||!this.attributes)return"";let t=this.children.generateHTML(),r=this.attributes.generateHTML();return`<${this.tagName}${r}>${t}</${this.tagName}>`}mount(t,r){if(!t)throw new Error("Missing dom node on bind");if(this.domElement=t,this._events)for(let o in this._events){let i=o,n=this._events[i],a=c=>n(c,this);t.addEventListener(i,a),this.addHook("BeforeRemove",c=>{c.domElement.removeEventListener(i,a),a=null})}this.children&&this.children.items.forEach((o,i)=>{let n=t.childNodes[i];n instanceof Node&&o instanceof ge&&o.mount(n,r)}),this._hooks.Mount&&this._hooks.Mount(this)}render(t){let r=this._createDOMNode();t.appendChild(r),this._hooks.Mount&&this._hooks.Mount(this);let o=this.getRoot().styles.domStyle,i=t.getRootNode(),n=i instanceof ShadowRoot?i:document.head;return o||(o=kt(n)),this.styles.render(o),this.children.items.forEach(a=>{if(a instanceof ge&&a._portal){let c=a._portal(this.getRoot());c&&a.render(c)}else a.render(r)}),r}remove(){var t;this.parent?this.parent.children.remove(this):((t=this.domElement)==null||t.remove(),this._dispose())}},Do=class{constructor(e){this._notifier=new se,this.initialRecord=xt({},e),this._record=xt({},e)}get(e,t){return t&&this._notifier.addListener(e,t),this._record[e]}set(e,t){this._record[e]=t,this._notifier.notify(e)}addListener(e,t){return this._notifier.addListener(e,t)}removeListener(e,t){this._notifier.removeListener(e,t)}reset(e){this.set(e,this.initialRecord[e])}_dispose(){this._notifier._dispose()}};var ze={};Re(ze,{createDark:()=>zt,getTheme:()=>be,setTheme:()=>jo,themeApply:()=>Uo,themeCSS:()=>Xe,themeColor:()=>l,themeDensity:()=>g,themeName:()=>et,themeSize:()=>p,themeSpacing:()=>s,themeTokens:()=>Wo,themeVars:()=>Ie});var Bo={direction:"darken",colors:{highlight:["#ffffff","#fff8cc","#fff197","#ffde2c","#f5c700","#e6af00","#d29500","#c18300","#af7400","#9e6600","#865500","#724800","#5d3b00","#4b2f00","#382300","#281900","#120b00","#000000"],warning:["#ffffff","#fff6e7","#ffeccf","#ffda9e","#ffc15e","#ffa213","#fc7d00","#e86a00","#d45b00","#c24e00","#a73e00","#903300","#762900","#5f2000","#491800","#341200","#190800","#000000"],error:["#ffffff","#fff6f5","#ffebe8","#ffd6d1","#ffbcb4","#ff9d91","#ff7665","#ff513d","#f03823","#d73220","#b72818","#9c2113","#811b0e","#68150a","#501006","#3b0b04","#1d0502","#000000"],danger:["#ffffff","#fff6f5","#ffebe8","#ffd6d1","#ffbcb4","#ff9d91","#ff7665","#ff513d","#f03823","#d73220","#b72818","#9c2113","#811b0e","#68150a","#501006","#3b0b04","#1d0502","#000000"],secondary:["#ffffff","#fff6fc","#ffe8f7","#ffd3f0","#ffb5e6","#ff94db","#ff67cc","#f24cb8","#e434a3","#ce2a92","#b01f7b","#981668","#800c55","#690344","#530035","#3e0027","#210015","#000000"],primary:["#ffffff","#f5f9ff","#e5f0fe","#cbe2fe","#accffd","#8eb9fc","#729efd","#5d89ff","#4b75ff","#3b63fb","#274dea","#1d3ecf","#1532ad","#10288c","#0c1f69","#0e1843","#070b1e","#000000"],info:["#ffffff","#eefafe","#d9f4fd","#b7e7fc","#8ad5ff","#5cc0ff","#30a7fe","#1d95e7","#1286cd","#0b78b3","#046691","#005779","#004762","#00394e","#002b3b","#001f2b","#000e14","#000000"],success:["#ffffff","#edfcf1","#d7f7e1","#adeec5","#6be3a2","#2bd17d","#12b867","#0ba45d","#079355","#05834e","#036e45","#025d3c","#014c34","#003d2c","#002e22","#002119","#000f0c","#000000"],neutral:["#ffffff","#f7f7f7","#efefef","#dfdfdf","#cccccc","#b7b7b7","#a0a0a0","#8f8f8f","#808080","#727272","#606060","#515151","#424242","#343434","#272727","#1c1c1c","#0c0c0c","#000000"]},baseTones:{highlight:5,warning:6,error:8,danger:8,secondary:8,primary:9,info:8,success:8,neutral:8},fontSizes:["0.75rem","0.875rem","1rem","1.25rem","1.5625rem","1.9375rem","2.4375rem","3.0625rem"],densities:[.75,1,1.5,2,2.5],custom:{}},ye=Bo,me={light:JSON.parse(JSON.stringify(ye)),dark:zt(ye)};function Qe(e){let t=Object.keys(e.colors)[0];return t?e.colors[t].length:0}function Ho(e){for(let t in e)if(!Object.keys(ye).includes(t))throw new Error(`Invalid key: ${t}`);if(e.fontSizes&&!Array.isArray(e.fontSizes))throw new Error("fontSize must be array of string");if(e.densities&&(!Array.isArray(e.densities)||e.densities.some(t=>typeof t!="number")))throw new Error("densities must be array of number");if("custom"in e){let t=e.custom;if(typeof t!="object"||t===null)throw new Error("Invalid custom property: must be an object")}}function It(e,t){var r;for(let o in t)t[o]&&typeof t[o]=="object"&&!Array.isArray(t[o])?((r=e[o])!=null||(e[o]={}),It(e[o],t[o])):e[o]=t[o]}function Fo(e,t){let r={},o=Qe(t);for(let n in t){let a=t[n];if(n==="colors")for(let c in t.colors)[...Array(o).keys()].forEach(m=>r[`--${c}-${m}`]=t.colors[c][m]);else if(n==="fontSizes")[...Array(8).keys()].forEach(c=>r[`--fontSize-${c}`]=t.fontSizes[c]);else{if(n==="densities")continue;if(typeof a=="object"&&a!==null)for(let c in a)r[`--${n}-${c.replace("/","_")}`]=a[c]}}let i="";for(let n in r)i+=` ${n}: ${r[n]};
|
|
3
3
|
`;return`[data-theme="${e}"] {
|
|
4
4
|
${i}}`}function be(e){if(!me[e])throw Error(`Theme "${e}" not found`);return me[e]}function jo(e,t){Ho(t),me[e]||(me[e]=structuredClone(ye)),It(me[e],t)}function zt(e){let t=structuredClone(e);t.direction="lighten";for(let r in t.colors)t.colors[r].reverse(),t.baseTones[r]=t.colors[r].length-1-t.baseTones[r];return t}function Wo(e){let t=be(e),r=Qe(t),o={};for(let i in t){let n=t[i];if(i==="colors")for(let a in t.colors){let c={};[...Array(r).keys()].forEach(m=>c[m]=t.colors[a][m]),o[a]=c}else if(i==="fontSizes")o.fontSizes=t.fontSizes;else if(i==="densities")o.densities=t.densities;else if(o[i]={},typeof n=="object"&&n!==null)for(let a in n)o[i][a]=n[a]}return o}function Ie(){let e=be("light"),t=Qe(e),r={};for(let o in e){let i=o,n=e[o];if(o==="colors")for(let a in e.colors){let c={};[...Array(t).keys()].forEach(m=>c[m]=`var(--${a}-${m})`),r[a]=c}else if(o==="fontSizes")r.fontSizes=[...Array(8).keys()].map(a=>`var(--fontSize-${a})`);else{if(o==="densities")continue;if(r[i]={},typeof n=="object"&&n!==null)for(let a in n)r[i][a]=`var(--${i}-${a.replace("/","_")})`}}return r}function Xe(){return Object.entries(me).map(([e,t])=>Fo(e,t)).join(`
|
|
5
|
-
`)}function Uo(e){var t;if(typeof document!="undefined")if(e){e.textContent=Xe();return}else e=(t=document.getElementById("domphy-themes"))!=null?t:Object.assign(document.createElement("style"),{id:"domphy-themes"}),e.textContent=Xe(),document.head.appendChild(e)}function s(e){return e/4+"em"}function et(e){let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataTheme"));)t=t.parent;let r="light";return t&&t.attributes&&t.attributes.has("dataTheme")&&(r=t.attributes.get("dataTheme"),typeof e=="function"&&t.attributes.addListener("dataTheme",e)),r}var Je=["inherit"];[...Array(8).keys()].forEach(e=>{Je.push(`decrease-${e}`),Je.push(`increase-${e}`)});function Mt(e,t="inherit"){if(!Je.includes(t))throw Error(`size name "${t}" invalid`);let r;if(t=="inherit")r=e;else if(t!=null&&t.startsWith("increase-")){let o=parseInt(t.replace("increase-",""),10);r=e+o}else if(t!=null&&t.startsWith("decrease-")){let o=parseInt(t.replace("decrease-",""),10);r=e-o}else r=e;return Math.max(0,Math.min(8,r))}function Ko(e){if(!e)return 2;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataSize"));)t=t.parent;let r=2;return t&&t.attributes&&t.attributes.has("dataSize")&&(r=Mt(r,t.attributes.get("dataSize")),typeof e=="function"&&t.attributes.addListener("dataSize",e)),r}function p(e,t="inherit"){let r=Mt(Ko(e),t);return Ie().fontSizes[r]}var Ze=["inherit"];[...Array(5).keys()].forEach(e=>{Ze.push(`decrease-${e}`),Ze.push(`increase-${e}`)});function qo(e,t="inherit"){if(!Ze.includes(t))throw Error(`density name "${t}" invalid`);let r;if(t=="inherit")r=e;else if(t!=null&&t.startsWith("increase-")){let o=parseInt(t.replace("increase-",""),10);r=e+o}else if(t!=null&&t.startsWith("decrease-")){let o=parseInt(t.replace("decrease-",""),10);r=e-o}else r=e;return Math.max(0,Math.min(4,r))}function Go(e){if(!e)return 2;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataDensity"));)t=t.parent;let r=2;return t&&t.attributes&&t.attributes.has("dataDensity")&&(r=qo(r,t.attributes.get("dataDensity")),typeof e=="function"&&t.attributes.addListener("dataDensity",e)),r}function g(e){let t=Go(e);return be(e?et(e):"light").densities[t]}var Q=ye.colors.neutral.length,Le=["inherit","base"];[...Array(Q).keys()].forEach(e=>{Le.push(`decrease-${e}`),Le.push(`increase-${e}`),Le.push(`shift-${e}`)});function Lt(e,t){if(e<0||e>Q-1)return e;let r=e+t;return r=Math.max(0,Math.min(Q-1,r)),r}function Yo(e,t){if(e<0||e>Q-1)return e;let r=Math.floor((Q-1)/2),o=e<=r?e+t:e-t;return o=o<0||o>Q-1?-o:o,o=Math.max(0,Math.min(Q-1,o)),o}function tt(e,t="inherit"){if(typeof t=="number")return t;if(t=="inherit")return e;if(!Le.includes(t))throw Error(`tone name "${t}" invalid`);if(t.startsWith("increase-")){let r=parseInt(t.replace("increase-",""),10);return Lt(e,r)}else if(t.startsWith("decrease-")){let r=parseInt(t.replace("decrease-",""),10);return Lt(e,-r)}else if(t.startsWith("shift-")){let r=parseInt(t.replace("shift-",""),10);return Yo(e,r)}else return e}function Xo(e){if(!e)return 0;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataTone"));)t=t.parent;let r=0;return t&&t.attributes&&t.attributes.has("dataTone")&&(r=tt(r,t.attributes.get("dataTone")),typeof e=="function"&&t.attributes.addListener("dataTone",e)),r}function Jo(e,t="inherit"){return tt(Xo(e),t)}function l(e,t="inherit",r="inherit"){let o=r=="inherit"?"neutral":r;if(!e)return Ie()[o][tt(0,t)];let i;return t=="base"?i=be(et(e)).baseTones[o]:i=Jo(e,t),Ie()[o][i]}var Fe={};Re(Fe,{FieldState:()=>_e,FormState:()=>ut,abbreviation:()=>Zo,alert:()=>mn,avatar:()=>un,badge:()=>fn,blockquote:()=>Fn,breadcrumb:()=>dn,breadcrumbEllipsis:()=>hn,button:()=>jn,buttonSwitch:()=>kr,card:()=>Qo,code:()=>Un,combobox:()=>Hn,command:()=>nn,commandItem:()=>an,commandSearch:()=>rn,descriptionList:()=>qn,details:()=>Kn,dialog:()=>Gn,divider:()=>Ar,drawer:()=>Nr,emphasis:()=>Yn,field:()=>Yr,figure:()=>Xn,form:()=>Gr,formGroup:()=>Jn,heading:()=>Qn,horizontalRule:()=>er,icon:()=>or,image:()=>tr,inputCheckbox:()=>Wn,inputColor:()=>nr,inputDateTime:()=>rr,inputFile:()=>ir,inputNumber:()=>cr,inputOTP:()=>cn,inputRadio:()=>yr,inputRange:()=>sr,inputSearch:()=>ar,inputSwitch:()=>Er,inputText:()=>lr,keyboard:()=>mr,label:()=>ur,link:()=>fr,mark:()=>dr,menu:()=>Kr,menuItem:()=>qr,orderedList:()=>Ir,pagination:()=>Mr,paragraph:()=>hr,popover:()=>Dr,popoverArrow:()=>ct,preformated:()=>pr,progress:()=>gr,select:()=>br,selectBox:()=>wr,selectItem:()=>Cr,selectList:()=>xr,skeleton:()=>vr,small:()=>Tr,spinner:()=>Sr,splitter:()=>en,splitterHandle:()=>on,splitterPanel:()=>tn,strong:()=>_r,subscript:()=>Or,superscript:()=>Pr,tab:()=>Wr,tabPanel:()=>Ur,table:()=>Rr,tabs:()=>jr,tag:()=>ve,textarea:()=>$r,toast:()=>Br,toggle:()=>ln,toggleGroup:()=>sn,tooltip:()=>Hr,transitionGroup:()=>Fr,unorderedList:()=>Lr});function Zo(e={}){var o,i;let t=h((o=e.color)!=null?o:"neutral","color"),r=h((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:n=>{n.tagName!="abbr"&&console.warn('"abbreviation" primitive patch must use abbr tag')},style:{fontSize:n=>p(n),backgroundColor:n=>l(n),color:n=>l(n,"shift-10",t.get(n)),textDecorationLine:"underline",textDecorationStyle:"dotted",textDecorationColor:n=>l(n,"shift-7",t.get(n)),textUnderlineOffset:s(.72),cursor:"help","&:hover":{color:n=>l(n,"shift-11",r.get(n)),textDecorationColor:n=>l(n,"shift-9",r.get(n))}}}}function Qo(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{style:{display:"grid",gridTemplateColumns:"1fr auto",gridTemplateAreas:'"image image" "title aside" "desc aside" "content content" "footer footer"',borderRadius:o=>s(g(o)*2),backgroundColor:o=>l(o,"inherit",t.get(o)),color:o=>l(o,"shift-10",t.get(o)),outline:o=>`1px solid ${l(o,"shift-4",t.get(o))}`,outlineOffset:"-1px",overflow:"hidden","& > img":{gridArea:"image",width:"100%",height:"auto",display:"block"},"& > :is(h1,h2,h3,h4,h5,h6)":{gridArea:"title",paddingBlock:o=>s(g(o)*2),paddingInline:o=>s(g(o)*4),fontWeight:"600",margin:0},"& > p":{gridArea:"desc",paddingInline:o=>s(g(o)*4),color:o=>l(o,"shift-9",t.get(o)),margin:0},"& > aside":{gridArea:"aside",alignSelf:"center",padding:o=>s(g(o)*2),height:"auto"},"& > div":{gridArea:"content",padding:o=>s(g(o)*4),color:o=>l(o,"shift-10",t.get(o))},"& > footer":{gridArea:"footer",display:"flex",gap:s(2),paddingBlock:o=>s(g(o)*2),paddingInline:o=>s(g(o)*4),borderTop:o=>`1px solid ${l(o,"shift-3",t.get(o))}`}}}}function en(e={}){let{direction:t="horizontal",defaultSize:r=50,min:o=10,max:i=90}=e;return{_onSchedule:(n,a)=>{k(a,{_context:{splitter:{direction:t,size:h(r),min:o,max:i}}})},style:{display:"flex",flexDirection:t==="horizontal"?"row":"column",overflow:"hidden"}}}function tn(){return{_onMount:e=>{let t=e.getContext("splitter"),r=e.domElement,o=t.direction==="horizontal"?"width":"height";r.style[o]=`${t.size.get()}%`,r.style.flexShrink="0",r.style.overflow="auto";let i=t.size.addListener(n=>{r.style[o]=`${n}%`});e.addHook("Remove",i)}}}function on(){return{_onMount:e=>{let t=e.getContext("splitter"),r=e.domElement,o=t.direction==="horizontal";r.style.cursor=o?"col-resize":"row-resize";let i=n=>{n.preventDefault();let a=r.parentElement,c=u=>{let f=a.getBoundingClientRect(),d=o?(u.clientX-f.left)/f.width*100:(u.clientY-f.top)/f.height*100;t.size.set(Math.min(Math.max(d,t.min),t.max))},m=()=>{document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",m)};document.addEventListener("mousemove",c),document.addEventListener("mouseup",m)};r.addEventListener("mousedown",i),e.addHook("Remove",()=>r.removeEventListener("mousedown",i))},style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:e=>l(e,"shift-2"),"&:hover":{backgroundColor:e=>l(e,"shift-3")},"&::after":{content:'""',borderRadius:s(999),backgroundColor:e=>l(e,"shift-4")}}}}function nn(){return{_onSchedule:(e,t)=>{k(t,{_context:{command:{query:h("")}}})},style:{display:"flex",flexDirection:"column",overflow:"hidden"}}}function rn(e={}){let{color:t="neutral",accentColor:r="primary"}=e;return{_onInsert:o=>{o.tagName!=="input"&&console.warn('"commandSearch" patch must use input tag')},_onMount:o=>{let i=o.getContext("command"),n=o.domElement,a=()=>i.query.set(n.value);n.addEventListener("input",a),o.addHook("Remove",()=>n.removeEventListener("input",a))},style:{fontFamily:"inherit",fontSize:o=>p(o,"inherit"),paddingInline:o=>s(g(o)*3),paddingBlock:o=>s(g(o)*2),border:"none",borderBottom:o=>`1px solid ${l(o,"shift-3",t)}`,outline:"none",color:o=>l(o,"shift-10",t),backgroundColor:o=>l(o,"inherit",t),"&::placeholder":{color:o=>l(o,"shift-7")},"&:focus-visible":{borderBottomColor:o=>l(o,"shift-6",r)}}}}function an(e={}){let{color:t="neutral",accentColor:r="primary"}=e;return{role:"option",_onMount:o=>{var m,u;let i=o.getContext("command"),n=o.domElement,a=(u=(m=n.textContent)==null?void 0:m.toLowerCase())!=null?u:"",c=i.query.addListener(f=>{n.hidden=f.length>0&&!a.includes(f.toLowerCase())});o.addHook("Remove",c)},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:o=>p(o,"inherit"),height:o=>s(6+g(o)*2),paddingInline:o=>s(g(o)*3),border:"none",outline:"none",color:o=>l(o,"shift-9",t),backgroundColor:o=>l(o,"inherit",t),"&:hover:not([disabled])":{backgroundColor:o=>l(o,"shift-2",t)},"&:focus-visible":{outline:o=>`${s(.5)} solid ${l(o,"shift-6",r)}`,outlineOffset:`-${s(.5)}`}}}}function ln(e={}){var o,i;let t=h((o=e.color)!=null?o:"neutral","color"),r=h((i=e.accentColor)!=null?i:"primary","accentColor");return{role:"button",_onInsert:n=>{var f;n.tagName!=="button"&&console.warn('"toggle" patch must use button tag');let a=n.getContext("toggleGroup"),m=((f=n.parent)==null?void 0:f.children.items).filter(d=>d.type==="ElementNode"&&d.attributes.get("role")==="button"),u=n.key!==void 0?String(n.key):String(m.findIndex(d=>d===n));n.attributes.set("ariaPressed",d=>{let y=a.value.get(d);return Array.isArray(y)?y.includes(u):y===u}),n.addEvent("click",()=>{let d=a.value.get();if(a.multiple){let y=Array.isArray(d)?[...d]:[];a.value.set(y.includes(u)?y.filter(b=>b!==u):[...y,u])}else a.value.set(d===u?"":u)})},style:{cursor:"pointer",fontSize:n=>p(n,"inherit"),height:s(6),paddingBlock:s(1),paddingInline:s(2),border:"none",borderRadius:s(1),color:n=>l(n,"shift-9",t.get(n)),backgroundColor:n=>l(n,"inherit",t.get(n)),transition:"background-color 300ms ease","&:hover:not([disabled])":{backgroundColor:n=>l(n,"shift-2",t.get(n))},"&[aria-pressed=true]":{backgroundColor:n=>l(n,"shift-3",r.get(n)),color:n=>l(n,"shift-12",r.get(n))},"&:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`,outlineOffset:`-${s(.5)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function sn(e={}){var o;let{multiple:t=!1,color:r="neutral"}=e;return{role:"group",_context:{toggleGroup:{value:h((o=e.value)!=null?o:t?[]:""),multiple:t}},style:{display:"flex",paddingBlock:s(1),paddingInline:s(1),gap:s(1),borderRadius:s(2),fontSize:i=>p(i,"inherit"),backgroundColor:i=>l(i,"inherit",r),outline:i=>`1px solid ${l(i,"shift-3",r)}`,outlineOffset:"-1px"}}}function cn(){return{style:{display:"flex",alignItems:"center",gap:s(2),"& > *":{minWidth:s(9)+"!important"}},_onMount:e=>{let t=e.domElement,r=()=>Array.from(t.querySelectorAll("input")),o=a=>{let c=r(),m=a.target,u=c.indexOf(m);m.value&&u<c.length-1&&c[u+1].focus()},i=a=>{let c=r(),m=a.target,u=c.indexOf(m);a.key==="Backspace"&&!m.value&&u>0&&c[u-1].focus(),a.key==="ArrowLeft"&&u>0&&c[u-1].focus(),a.key==="ArrowRight"&&u<c.length-1&&c[u+1].focus()},n=a=>{var d,y,b;a.preventDefault();let c=(y=(d=a.clipboardData)==null?void 0:d.getData("text"))!=null?y:"",m=r(),u=m.indexOf(a.target);[...c].forEach((v,x)=>{m[u+x]&&(m[u+x].value=v)});let f=Math.min(u+c.length-1,m.length-1);(b=m[f])==null||b.focus()};t.addEventListener("input",o),t.addEventListener("keydown",i),t.addEventListener("paste",n),e.addHook("Remove",()=>{t.removeEventListener("input",o),t.removeEventListener("keydown",i),t.removeEventListener("paste",n)})}}}function mn(e={}){var r;let t=h((r=e.color)!=null?r:"primary","color");return{role:"alert",dataTone:"shift-2",style:{display:"flex",alignItems:"flex-start",gap:s(3),paddingBlock:o=>s(g(o)*2),paddingInline:o=>s(g(o)*4),boxShadow:o=>`inset ${s(1)} 0 0 0 ${l(o,"shift-8",t.get(o))}`,backgroundColor:o=>l(o,"inherit",t.get(o)),color:o=>l(o,"shift-10",t.get(o)),fontSize:o=>p(o,"inherit")}}}function un(e={}){var r;let t=h((r=e.color)!=null?r:"primary","color");return{dataTone:"shift-2",style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",borderRadius:"50%",flexShrink:0,width:s(9),height:s(9),fontSize:o=>p(o,"inherit"),fontWeight:"600",userSelect:"none",backgroundColor:o=>l(o,"inherit",t.get(o)),color:o=>l(o,"shift-11",t.get(o)),"& img":{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}}}}function fn(e={}){var i;let{label:t=999}=e,r=h(t),o=h((i=e.color)!=null?i:"danger","color");return{style:{position:"relative","&::after":{content:n=>`"${r.get(n)}"`,position:"absolute",top:0,right:0,transform:"translate(50%,-50%)",paddingInline:s(1),minWidth:s(6),display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:n=>p(n,"decrease-1"),borderRadius:s(999),backgroundColor:n=>l(n,"shift-9",o.get(n)),color:n=>l(n,"shift-0",o.get(n))}}}}function dn(e={}){var o;let{separator:t="/"}=e,r=h((o=e.color)!=null?o:"neutral","color");return{_onInsert:i=>{i.tagName!=="nav"&&console.warn('"breadcrumb" patch must use nav tag')},ariaLabel:"breadcrumb",style:{display:"flex",alignItems:"center",flexWrap:"wrap",fontSize:i=>p(i,"inherit"),gap:s(1),color:i=>l(i,"shift-9",r.get(i)),backgroundColor:i=>l(i,"inherit",r.get(i)),"& > *":{display:"inline-flex",alignItems:"center",color:i=>l(i,"shift-8",r.get(i))},"& > *:not(:last-child)::after":{content:`"${t}"`,color:i=>l(i,"shift-4",r.get(i)),paddingInlineStart:s(1)},"& > [aria-current=page]":{color:i=>l(i,"shift-10",r.get(i)),pointerEvents:"none"}}}}function hn(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="button"&&console.warn('"breadcrumbEllipsis" patch must use button tag')},ariaLabel:"More breadcrumb items",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:o=>p(o,"inherit"),paddingInline:s(1),border:"none",background:"none",cursor:"pointer",color:o=>l(o,"shift-8",t.get(o)),borderRadius:s(1),"&:hover":{color:o=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"shift-2",t.get(o))},"&:focus-visible":{outline:o=>`${s(.5)} solid ${l(o,"shift-6",t.get(o))}`,outlineOffset:s(.5)}}}}var pn='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6.707 5.293l5.293 5.292l5.293 -5.292a1 1 0 0 1 1.414 1.414l-5.292 5.293l5.292 5.293a1 1 0 0 1 -1.414 1.414l-5.293 -5.292l-5.293 5.292a1 1 0 1 1 -1.414 -1.414l5.292 -5.293l-5.292 -5.293a1 1 0 0 1 1.414 -1.414" /></svg>';function ve(e={}){var o;let{removable:t=!1}=e,r=h((o=e.color)!=null?o:"neutral","color");return{dataTone:"shift-2",_onInit:i=>{let n={span:pn,onClick:a=>{a.stopPropagation(),i.remove()},style:{display:"inline-flex",alignItems:"center",cursor:"pointer",borderRadius:s(1),width:s(4),height:s(4),flexShrink:0,"&:hover":{backgroundColor:a=>l(a,"shift-4",r.get(a))}}};t&&i.children.insert(n)},style:{display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",userSelect:"none",height:s(6),paddingBlock:"0px",borderRadius:s(1),paddingInlineStart:s(2),paddingInlineEnd:t?s(1):s(2),gap:s(2),fontSize:i=>p(i,"inherit"),backgroundColor:i=>l(i,"inherit",r.get(i)),color:i=>l(i,"shift-9",r.get(i)),border:"none",outlineOffset:"-1px",outline:i=>`1px solid ${l(i,"shift-4",r.get(i))}`}}}var ue=Math.min,H=Math.max,xe=Math.round,Ce=Math.floor,V=e=>({x:e,y:e}),gn={left:"right",right:"left",bottom:"top",top:"bottom"};function ot(e,t,r){return H(e,ue(t,r))}function we(e,t){return typeof e=="function"?e(t):e}function U(e){return e.split("-")[0]}function Ee(e){return e.split("-")[1]}function nt(e){return e==="x"?"y":"x"}function rt(e){return e==="y"?"height":"width"}function F(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function it(e){return nt(F(e))}function Nt(e,t,r){r===void 0&&(r=!1);let o=Ee(e),i=it(e),n=rt(i),a=i==="x"?o===(r?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[n]>t.floating[n]&&(a=Se(a)),[a,Se(a)]}function Dt(e){let t=Se(e);return[Me(e),t,Me(t)]}function Me(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var At=["left","right"],Vt=["right","left"],yn=["top","bottom"],bn=["bottom","top"];function vn(e,t,r){switch(e){case"top":case"bottom":return r?t?Vt:At:t?At:Vt;case"left":case"right":return t?yn:bn;default:return[]}}function Bt(e,t,r,o){let i=Ee(e),n=vn(U(e),r==="start",o);return i&&(n=n.map(a=>a+"-"+i),t&&(n=n.concat(n.map(Me)))),n}function Se(e){let t=U(e);return gn[t]+e.slice(t.length)}function Sn(e){return P({top:0,right:0,bottom:0,left:0},e)}function Ht(e){return typeof e!="number"?Sn(e):{top:e,right:e,bottom:e,left:e}}function ee(e){let{x:t,y:r,width:o,height:i}=e;return{width:o,height:i,top:r,left:t,right:t+o,bottom:r+i,x:t,y:r}}function Ft(e,t,r){let{reference:o,floating:i}=e,n=F(t),a=it(t),c=rt(a),m=U(t),u=n==="y",f=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,y=o[c]/2-i[c]/2,b;switch(m){case"top":b={x:f,y:o.y-i.height};break;case"bottom":b={x:f,y:o.y+o.height};break;case"right":b={x:o.x+o.width,y:d};break;case"left":b={x:o.x-i.width,y:d};break;default:b={x:o.x,y:o.y}}switch(Ee(t)){case"start":b[a]-=y*(r&&u?-1:1);break;case"end":b[a]+=y*(r&&u?-1:1);break}return b}function jt(e,t){return B(this,null,function*(){var r;t===void 0&&(t={});let{x:o,y:i,platform:n,rects:a,elements:c,strategy:m}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:y=!1,padding:b=0}=we(t,e),v=Ht(b),S=c[y?d==="floating"?"reference":"floating":d],C=ee(yield n.getClippingRect({element:(r=yield n.isElement==null?void 0:n.isElement(S))==null||r?S:S.contextElement||(yield n.getDocumentElement==null?void 0:n.getDocumentElement(c.floating)),boundary:u,rootBoundary:f,strategy:m})),w=d==="floating"?{x:o,y:i,width:a.floating.width,height:a.floating.height}:a.reference,T=yield n.getOffsetParent==null?void 0:n.getOffsetParent(c.floating),E=(yield n.isElement==null?void 0:n.isElement(T))?(yield n.getScale==null?void 0:n.getScale(T))||{x:1,y:1}:{x:1,y:1},_=ee(n.convertOffsetParentRelativeRectToViewportRelativeRect?yield n.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:w,offsetParent:T,strategy:m}):w);return{top:(C.top-_.top+v.top)/E.y,bottom:(_.bottom-C.bottom+v.bottom)/E.y,left:(C.left-_.left+v.left)/E.x,right:(_.right-C.right+v.right)/E.x}})}var xn=50,Wt=(e,t,r)=>B(null,null,function*(){let{placement:o="bottom",strategy:i="absolute",middleware:n=[],platform:a}=r,c=a.detectOverflow?a:A(P({},a),{detectOverflow:jt}),m=yield a.isRTL==null?void 0:a.isRTL(t),u=yield a.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:d}=Ft(u,o,m),y=o,b=0,v={};for(let x=0;x<n.length;x++){let S=n[x];if(!S)continue;let{name:C,fn:w}=S,{x:T,y:E,data:_,reset:O}=yield w({x:f,y:d,initialPlacement:o,placement:y,strategy:i,middlewareData:v,rects:u,platform:c,elements:{reference:e,floating:t}});f=T!=null?T:f,d=E!=null?E:d,v[C]=P(P({},v[C]),_),O&&b<xn&&(b++,typeof O=="object"&&(O.placement&&(y=O.placement),O.rects&&(u=O.rects===!0?yield a.getElementRects({reference:e,floating:t,strategy:i}):O.rects),{x:f,y:d}=Ft(u,y,m)),x=-1)}return{x:f,y:d,placement:y,strategy:i,middlewareData:v}});var Ut=function(e){return e===void 0&&(e={}),{name:"flip",options:e,fn(r){return B(this,null,function*(){var o,i;let{placement:n,middlewareData:a,rects:c,initialPlacement:m,platform:u,elements:f}=r,gt=we(e,r),{mainAxis:d=!0,crossAxis:y=!0,fallbackPlacements:b,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:S=!0}=gt,C=Ue(gt,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((o=a.arrow)!=null&&o.alignmentOffset)return{};let w=U(n),T=F(m),E=U(m)===m,_=yield u.isRTL==null?void 0:u.isRTL(f.floating),O=b||(E||!S?[Se(m)]:Dt(m)),$=x!=="none";!b&&$&&O.push(...Bt(m,S,x,_));let ft=[m,...O],ie=yield u.detectOverflow(r,C),ae=[],le=((i=a.flip)==null?void 0:i.overflows)||[];if(d&&ae.push(ie[w]),y){let q=Nt(n,c,_);ae.push(ie[q[0]],ie[q[1]])}if(le=[...le,{placement:n,overflows:ae}],!ae.every(q=>q<=0)){var dt,ht;let q=(((dt=a.flip)==null?void 0:dt.index)||0)+1,je=ft[q];if(je&&(!(y==="alignment"?T!==F(je):!1)||le.every(M=>F(M.placement)===T?M.overflows[0]>0:!0)))return{data:{index:q,overflows:le},reset:{placement:je}};let pe=(ht=le.filter(G=>G.overflows[0]<=0).sort((G,M)=>G.overflows[1]-M.overflows[1])[0])==null?void 0:ht.placement;if(!pe)switch(v){case"bestFit":{var pt;let G=(pt=le.filter(M=>{if($){let W=F(M.placement);return W===T||W==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(W=>W>0).reduce((W,bo)=>W+bo,0)]).sort((M,W)=>M[1]-W[1])[0])==null?void 0:pt[0];G&&(pe=G);break}case"initialPlacement":pe=m;break}if(n!==pe)return{reset:{placement:pe}}}return{}})}}};var Cn=new Set(["left","top"]);function wn(e,t){return B(this,null,function*(){let{placement:r,platform:o,elements:i}=e,n=yield o.isRTL==null?void 0:o.isRTL(i.floating),a=U(r),c=Ee(r),m=F(r)==="y",u=Cn.has(a)?-1:1,f=n&&m?-1:1,d=we(t,e),{mainAxis:y,crossAxis:b,alignmentAxis:v}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return c&&typeof v=="number"&&(b=c==="end"?v*-1:v),m?{x:b*f,y:y*u}:{x:y*u,y:b*f}})}var Kt=function(e){return e===void 0&&(e=0),{name:"offset",options:e,fn(r){return B(this,null,function*(){var o,i;let{x:n,y:a,placement:c,middlewareData:m}=r,u=yield wn(r,e);return c===((o=m.offset)==null?void 0:o.placement)&&(i=m.arrow)!=null&&i.alignmentOffset?{}:{x:n+u.x,y:a+u.y,data:A(P({},u),{placement:c})}})}}},qt=function(e){return e===void 0&&(e={}),{name:"shift",options:e,fn(r){return B(this,null,function*(){let{x:o,y:i,placement:n,platform:a}=r,w=we(e,r),{mainAxis:c=!0,crossAxis:m=!1,limiter:u={fn:T=>{let{x:E,y:_}=T;return{x:E,y:_}}}}=w,f=Ue(w,["mainAxis","crossAxis","limiter"]),d={x:o,y:i},y=yield a.detectOverflow(r,f),b=F(U(n)),v=nt(b),x=d[v],S=d[b];if(c){let T=v==="y"?"top":"left",E=v==="y"?"bottom":"right",_=x+y[T],O=x-y[E];x=ot(_,x,O)}if(m){let T=b==="y"?"top":"left",E=b==="y"?"bottom":"right",_=S+y[T],O=S-y[E];S=ot(_,S,O)}let C=u.fn(A(P({},r),{[v]:x,[b]:S}));return A(P({},C),{data:{x:C.x-o,y:C.y-i,enabled:{[v]:c,[b]:m}}})})}}};function Ae(){return typeof window!="undefined"}function oe(e){return Yt(e)?(e.nodeName||"").toLowerCase():"#document"}function R(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function N(e){var t;return(t=(Yt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Yt(e){return Ae()?e instanceof Node||e instanceof R(e).Node:!1}function I(e){return Ae()?e instanceof Element||e instanceof R(e).Element:!1}function D(e){return Ae()?e instanceof HTMLElement||e instanceof R(e).HTMLElement:!1}function Gt(e){return!Ae()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof R(e).ShadowRoot}function de(e){let{overflow:t,overflowX:r,overflowY:o,display:i}=z(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+r)&&i!=="inline"&&i!=="contents"}function Xt(e){return/^(table|td|th)$/.test(oe(e))}function ke(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}var En=/transform|translate|scale|rotate|perspective|filter/,kn=/paint|layout|strict|content/,te=e=>!!e&&e!=="none",at;function Ve(e){let t=I(e)?z(e):e;return te(t.transform)||te(t.translate)||te(t.scale)||te(t.rotate)||te(t.perspective)||!Ne()&&(te(t.backdropFilter)||te(t.filter))||En.test(t.willChange||"")||kn.test(t.contain||"")}function Jt(e){let t=j(e);for(;D(t)&&!ne(t);){if(Ve(t))return t;if(ke(t))return null;t=j(t)}return null}function Ne(){return at==null&&(at=typeof CSS!="undefined"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),at}function ne(e){return/^(html|body|#document)$/.test(oe(e))}function z(e){return R(e).getComputedStyle(e)}function Te(e){return I(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function j(e){if(oe(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Gt(e)&&e.host||N(e);return Gt(t)?t.host:t}function Zt(e){let t=j(e);return ne(t)?e.ownerDocument?e.ownerDocument.body:e.body:D(t)&&de(t)?t:Zt(t)}function fe(e,t,r){var o;t===void 0&&(t=[]),r===void 0&&(r=!0);let i=Zt(e),n=i===((o=e.ownerDocument)==null?void 0:o.body),a=R(i);if(n){let c=De(a);return t.concat(a,a.visualViewport||[],de(i)?i:[],c&&r?fe(c):[])}else return t.concat(i,fe(i,[],r))}function De(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function oo(e){let t=z(e),r=parseFloat(t.width)||0,o=parseFloat(t.height)||0,i=D(e),n=i?e.offsetWidth:r,a=i?e.offsetHeight:o,c=xe(r)!==n||xe(o)!==a;return c&&(r=n,o=a),{width:r,height:o,$:c}}function st(e){return I(e)?e:e.contextElement}function he(e){let t=st(e);if(!D(t))return V(1);let r=t.getBoundingClientRect(),{width:o,height:i,$:n}=oo(t),a=(n?xe(r.width):r.width)/o,c=(n?xe(r.height):r.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}var Tn=V(0);function no(e){let t=R(e);return!Ne()||!t.visualViewport?Tn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _n(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==R(e)?!1:t}function re(e,t,r,o){t===void 0&&(t=!1),r===void 0&&(r=!1);let i=e.getBoundingClientRect(),n=st(e),a=V(1);t&&(o?I(o)&&(a=he(o)):a=he(e));let c=_n(n,r,o)?no(n):V(0),m=(i.left+c.x)/a.x,u=(i.top+c.y)/a.y,f=i.width/a.x,d=i.height/a.y;if(n){let y=R(n),b=o&&I(o)?R(o):o,v=y,x=De(v);for(;x&&o&&b!==v;){let S=he(x),C=x.getBoundingClientRect(),w=z(x),T=C.left+(x.clientLeft+parseFloat(w.paddingLeft))*S.x,E=C.top+(x.clientTop+parseFloat(w.paddingTop))*S.y;m*=S.x,u*=S.y,f*=S.x,d*=S.y,m+=T,u+=E,v=R(x),x=De(v)}}return ee({width:f,height:d,x:m,y:u})}function Be(e,t){let r=Te(e).scrollLeft;return t?t.left+r:re(N(e)).left+r}function ro(e,t){let r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-Be(e,r),i=r.top+t.scrollTop;return{x:o,y:i}}function On(e){let{elements:t,rect:r,offsetParent:o,strategy:i}=e,n=i==="fixed",a=N(o),c=t?ke(t.floating):!1;if(o===a||c&&n)return r;let m={scrollLeft:0,scrollTop:0},u=V(1),f=V(0),d=D(o);if((d||!d&&!n)&&((oe(o)!=="body"||de(a))&&(m=Te(o)),d)){let b=re(o);u=he(o),f.x=b.x+o.clientLeft,f.y=b.y+o.clientTop}let y=a&&!d&&!n?ro(a,m):V(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-m.scrollLeft*u.x+f.x+y.x,y:r.y*u.y-m.scrollTop*u.y+f.y+y.y}}function Pn(e){return Array.from(e.getClientRects())}function Rn(e){let t=N(e),r=Te(e),o=e.ownerDocument.body,i=H(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),n=H(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight),a=-r.scrollLeft+Be(e),c=-r.scrollTop;return z(o).direction==="rtl"&&(a+=H(t.clientWidth,o.clientWidth)-i),{width:i,height:n,x:a,y:c}}var Qt=25;function $n(e,t){let r=R(e),o=N(e),i=r.visualViewport,n=o.clientWidth,a=o.clientHeight,c=0,m=0;if(i){n=i.width,a=i.height;let f=Ne();(!f||f&&t==="fixed")&&(c=i.offsetLeft,m=i.offsetTop)}let u=Be(o);if(u<=0){let f=o.ownerDocument,d=f.body,y=getComputedStyle(d),b=f.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,v=Math.abs(o.clientWidth-d.clientWidth-b);v<=Qt&&(n-=v)}else u<=Qt&&(n+=u);return{width:n,height:a,x:c,y:m}}function Ln(e,t){let r=re(e,!0,t==="fixed"),o=r.top+e.clientTop,i=r.left+e.clientLeft,n=D(e)?he(e):V(1),a=e.clientWidth*n.x,c=e.clientHeight*n.y,m=i*n.x,u=o*n.y;return{width:a,height:c,x:m,y:u}}function eo(e,t,r){let o;if(t==="viewport")o=$n(e,r);else if(t==="document")o=Rn(N(e));else if(I(t))o=Ln(t,r);else{let i=no(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return ee(o)}function io(e,t){let r=j(e);return r===t||!I(r)||ne(r)?!1:z(r).position==="fixed"||io(r,t)}function In(e,t){let r=t.get(e);if(r)return r;let o=fe(e,[],!1).filter(c=>I(c)&&oe(c)!=="body"),i=null,n=z(e).position==="fixed",a=n?j(e):e;for(;I(a)&&!ne(a);){let c=z(a),m=Ve(a);!m&&c.position==="fixed"&&(i=null),(n?!m&&!i:!m&&c.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||de(a)&&!m&&io(e,a))?o=o.filter(f=>f!==a):i=c,a=j(a)}return t.set(e,o),o}function zn(e){let{element:t,boundary:r,rootBoundary:o,strategy:i}=e,a=[...r==="clippingAncestors"?ke(t)?[]:In(t,this._c):[].concat(r),o],c=eo(t,a[0],i),m=c.top,u=c.right,f=c.bottom,d=c.left;for(let y=1;y<a.length;y++){let b=eo(t,a[y],i);m=H(b.top,m),u=ue(b.right,u),f=ue(b.bottom,f),d=H(b.left,d)}return{width:u-d,height:f-m,x:d,y:m}}function Mn(e){let{width:t,height:r}=oo(e);return{width:t,height:r}}function An(e,t,r){let o=D(t),i=N(t),n=r==="fixed",a=re(e,!0,n,t),c={scrollLeft:0,scrollTop:0},m=V(0);function u(){m.x=Be(i)}if(o||!o&&!n)if((oe(t)!=="body"||de(i))&&(c=Te(t)),o){let b=re(t,!0,n,t);m.x=b.x+t.clientLeft,m.y=b.y+t.clientTop}else i&&u();n&&!o&&i&&u();let f=i&&!o&&!n?ro(i,c):V(0),d=a.left+c.scrollLeft-m.x-f.x,y=a.top+c.scrollTop-m.y-f.y;return{x:d,y,width:a.width,height:a.height}}function lt(e){return z(e).position==="static"}function to(e,t){if(!D(e)||z(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return N(e)===r&&(r=r.ownerDocument.body),r}function ao(e,t){let r=R(e);if(ke(e))return r;if(!D(e)){let i=j(e);for(;i&&!ne(i);){if(I(i)&&!lt(i))return i;i=j(i)}return r}let o=to(e,t);for(;o&&Xt(o)&<(o);)o=to(o,t);return o&&ne(o)&<(o)&&!Ve(o)?r:o||Jt(e)||r}var Vn=function(e){return B(this,null,function*(){let t=this.getOffsetParent||ao,r=this.getDimensions,o=yield r(e.floating);return{reference:An(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}})};function Nn(e){return z(e).direction==="rtl"}var Dn={convertOffsetParentRelativeRectToViewportRelativeRect:On,getDocumentElement:N,getClippingRect:zn,getOffsetParent:ao,getElementRects:Vn,getClientRects:Pn,getDimensions:Mn,getScale:he,isElement:I,isRTL:Nn};function lo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Bn(e,t){let r=null,o,i=N(e);function n(){var c;clearTimeout(o),(c=r)==null||c.disconnect(),r=null}function a(c,m){c===void 0&&(c=!1),m===void 0&&(m=1),n();let u=e.getBoundingClientRect(),{left:f,top:d,width:y,height:b}=u;if(c||t(),!y||!b)return;let v=Ce(d),x=Ce(i.clientWidth-(f+y)),S=Ce(i.clientHeight-(d+b)),C=Ce(f),T={rootMargin:-v+"px "+-x+"px "+-S+"px "+-C+"px",threshold:H(0,ue(1,m))||1},E=!0;function _(O){let $=O[0].intersectionRatio;if($!==m){if(!E)return a();$?a(!1,$):o=setTimeout(()=>{a(!1,1e-7)},1e3)}$===1&&!lo(u,e.getBoundingClientRect())&&a(),E=!1}try{r=new IntersectionObserver(_,A(P({},T),{root:i.ownerDocument}))}catch(O){r=new IntersectionObserver(_,T)}r.observe(e)}return a(!0),n}function so(e,t,r,o){o===void 0&&(o={});let{ancestorScroll:i=!0,ancestorResize:n=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:m=!1}=o,u=st(e),f=i||n?[...u?fe(u):[],...t?fe(t):[]]:[];f.forEach(C=>{i&&C.addEventListener("scroll",r,{passive:!0}),n&&C.addEventListener("resize",r)});let d=u&&c?Bn(u,r):null,y=-1,b=null;a&&(b=new ResizeObserver(C=>{let[w]=C;w&&w.target===u&&b&&t&&(b.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var T;(T=b)==null||T.observe(t)})),r()}),u&&!m&&b.observe(u),t&&b.observe(t));let v,x=m?re(e):null;m&&S();function S(){let C=re(e);x&&!lo(x,C)&&r(),x=C,v=requestAnimationFrame(S)}return r(),()=>{var C;f.forEach(w=>{i&&w.removeEventListener("scroll",r),n&&w.removeEventListener("resize",r)}),d==null||d(),(C=b)==null||C.disconnect(),b=null,m&&cancelAnimationFrame(v)}}var co=Kt;var mo=qt,uo=Ut;var fo=(e,t,r)=>{let o=new Map,i=P({platform:Dn},r),n=A(P({},i.platform),{_c:o});return Wt(e,t,A(P({},i),{platform:n}))};function K(e){let{open:t=!1,placement:r="bottom"}=e,o=null,i=null,n=null,a=null,c=h(t),m=h(r),u=()=>{n&&a&&(i&&i(),i=so(n,a,()=>{fo(n,a,{placement:m.get(),middleware:[co(12),uo(),mo()],strategy:"fixed"}).then(({x,y:S,placement:C})=>{var w;Object.assign(a.style,{left:`${x}px`,top:`${S}px`}),C!==m.get()&&m.set(C),(w=e.onPlacement)==null||w.call(e,n,a,C)})}),c.set(!0))},f=()=>{i&&i(),i=null,c.set(!1)},d=()=>{o&&clearTimeout(o),o=setTimeout(u,100)},y=()=>{o&&clearTimeout(o),o=setTimeout(f,100)},b={style:{position:"fixed",pointerEvents:"auto",visibility:x=>c.get(x)?"visible":"hidden"},_onMount:x=>a=x.domElement,_portal:x=>{let S=x.domElement.querySelector("#domphy-floating");if(!S){let C={div:[],id:"domphy-floating",style:{position:"fixed",inset:0,zIndex:20,pointerEvents:"none"}};S=x.children.insert(C).domElement}return S}};return k(e.content,b),{show:d,hide:y,anchorPartial:{onKeyDown:x=>x.key==="Escape"&&y(),_onSchedule:x=>{let S=null;x.getRoot().addHook("Init",C=>{S=C.children.insert(e.content)}),x.addHook("BeforeRemove",()=>{y(),o&&clearTimeout(o),S&&S.remove()})},_onMount:x=>{n=x.domElement;let S=C=>{if(!c.get()||!n||!a)return;let w=C.target;!n.contains(w)&&!a.contains(w)&&y()};x.getRoot().domElement.addEventListener("click",S),x.addHook("BeforeRemove",()=>x.getRoot().domElement.removeEventListener("click",S))}}}}function Hn(e){let{options:t=[],placement:r="bottom",color:o="neutral",open:i=!1,multiple:n=!1}=e,a=h(e.value),c=h(i),{show:m,hide:u,anchorPartial:f}=K({open:c,placement:r,content:e.content,onPlacement:e.onPlacement}),d={onClick:()=>!n&&u()};k(e.content,d);let y={border:"none",outline:"none",padding:0,margin:0,flex:1,height:s(6),marginInlineStart:s(2),fontSize:S=>p(S,"inherit"),color:S=>l(S,"shift-9",o),backgroundColor:S=>l(S,"inherit",o)},b;e.input?(k(e.input,{onFocus:()=>m(),style:y,_key:"combobox-input"}),b=e.input):b={input:null,onFocus:()=>m(),value:S=>(a.get(S),""),style:y,_key:"combobox-input"};let v={div:S=>{let C=a.get(S),w=Array.isArray(C)?C:[C],E=t.filter(_=>w.includes(_.value)).map(_=>({span:_.label,$:[ve({color:o,removable:!0})],_key:_.value,_onRemove:O=>{let $=a.get(),ie=(Array.isArray($)?$:[$]).filter(ae=>ae!==_.value);n?a.set(ie):a.set(ie[0])}}));return E.push(b),E},style:{display:"flex",flexWrap:"wrap",gap:s(1)}},x={_onInsert:S=>{S.tagName!="div"&&console.warn('"combobox" primitive patch must use div tag')},_onInit:S=>S.children.insert(v),style:{minWidth:s(32),outlineOffset:"-1px",outline:S=>`1px solid ${l(S,"shift-4","neutral")}`,paddingBlock:S=>s(g(S)*1),paddingInline:S=>s(g(S)*1),borderRadius:S=>s(g(S)*1),fontSize:S=>p(S,"inherit"),color:S=>l(S,"shift-9",o),backgroundColor:S=>l(S,"inherit",o)}};return k(f,x),f}function ct(e={}){let{placement:t="bottom-end",color:r="neutral",sideOffset:o=s(6),bordered:i=!0}=e,n=h(t),a={top:"bottom",bottom:"top",left:"right",right:"left","top-start":"bottom-end","top-end":"bottom-start","bottom-start":"top-end","bottom-end":"top-start","left-start":"right-end","left-end":"right-start","right-start":"left-end","right-end":"left-start"},c=h(a[n.get()]);n.addListener(f=>c.set(a[f]));let m=f=>f.includes("start")?o:f.includes("end")?"auto":"50%",u=f=>f.includes("end")?o:f.includes("start")?"auto":"50%";return{style:{fontSize:f=>p(f),backgroundColor:f=>l(f),color:f=>l(f,"shift-9",r),position:"relative","&::after":{content:'""',position:"absolute",width:s(1.5),height:s(1.5),backgroundColor:f=>l(f,"inherit",r),borderWidth:i?"0px":"1px",borderColor:f=>l(f,"inherit",r),borderTopStyle:f=>{let d=c.get(f);return d.includes("top")||d.includes("right")?"solid":"none"},borderBottomStyle:f=>{let d=c.get(f);return d.includes("bottom")||d.includes("left")?"solid":"none"},borderLeftStyle:f=>{let d=c.get(f);return d.includes("top")||d.includes("left")?"solid":"none"},borderRightStyle:f=>{let d=c.get(f);return d.includes("bottom")||d.includes("right")?"solid":"none"},top:f=>{let d=c.get(f);return d.includes("top")?0:d.includes("bottom")?"auto":m(d)},right:f=>{let d=c.get(f);return d.includes("right")?0:d.includes("left")?"auto":u(d)},bottom:f=>{let d=c.get(f);return d.includes("bottom")?0:d.includes("top")?"auto":u(d)},left:f=>{let d=c.get(f);return d.includes("left")?0:d.includes("right")?"auto":m(d)},transform:f=>{let d=c.get(f),y=d.includes("right")||d.includes("end")&&!d.includes("left")?"50%":"-50%",b=d.includes("bottom")||d.includes("end")&&!d.includes("top")?"50%":"-50%";return`translate(${y},${b}) rotate(45deg)`}}}}}function Fn(e={}){var r;let t=h((r=e.color)!=null?r:"inherit","color");return{_onInsert:o=>{o.tagName!="blockquote"&&console.warn('"blockquote" primitive patch must use blockquote tag')},dataTone:"shift-2",style:{fontSize:o=>p(o,"inherit"),backgroundColor:o=>l(o,"inherit",t.get(o)),boxShadow:o=>`inset ${s(1)} 0 0 0 ${l(o,"shift-4",t.get(o))}`,border:"none",paddingBlock:o=>s(g(o)*2),paddingInline:o=>s(g(o)*4),margin:0}}}function jn(e={}){var r;let t=h((r=e.color)!=null?r:"primary","color");return{_onInsert:o=>{o.tagName!="button"&&console.warn('"button" primitive patch must use button tag')},style:{appearance:"none",fontSize:o=>p(o,"inherit"),paddingBlock:o=>s(g(o)*1),paddingInline:o=>s(g(o)*3),borderRadius:o=>s(g(o)*1),width:"fit-content",display:"flex",justifyContent:"center",alignItems:"center",gap:o=>s(g(o)*1),userSelect:"none",fontFamily:"inherit",lineHeight:"inherit",border:"none",outlineOffset:"-1px",outlineWidth:"1px",outline:o=>`1px solid ${l(o,"shift-4",t.get(o))}`,color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),"&:hover:not([disabled]):not([aria-busy=true])":{color:o=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"shift-2",t.get(o))},"&:focus-visible":{boxShadow:o=>`inset 0 0 0 ${s(.5)} ${l(o,"shift-6",t.get(o))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:o=>l(o,"shift-2","neutral"),outline:o=>`1px solid ${l(o,"shift-4","neutral")}`,color:o=>l(o,"shift-8","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}}}function Wn(e={}){var o,i;let t=h((o=e.color)!=null?o:"neutral","color"),r=h((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"checkbox",_onInsert:n=>{n.tagName!=="input"&&console.warn('"inputCheckbox" primitive patch must use input tag')},style:{appearance:"none",fontSize:n=>p(n,"inherit"),display:"inline-flex",position:"relative",width:s(6),height:s(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:s(1),lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,color:n=>l(n,"shift-9",t.get(n)),width:s(4),height:s(4)},"&:hover::before":{backgroundColor:n=>l(n,"shift-2",t.get(n))},"&:checked::before":{outline:n=>`1px solid ${l(n,"shift-6",r.get(n))}`,backgroundColor:n=>l(n,"shift-8",r.get(n))},"&:checked:hover:not([disabled])::before":{backgroundColor:n=>l(n,"shift-7",r.get(n))},"&:checked::after":{content:'""',display:"block",position:"absolute",top:"25%",insetInlineStart:"37%",width:"20%",height:"30%",border:n=>`${s(.5)} solid ${l(n,"inherit",r.get(n))}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg)"},"&:indeterminate::before":{outline:n=>`1px solid ${l(n,"shift-6",r.get(n))}`,backgroundColor:n=>l(n,"shift-3",r.get(n))},"&:indeterminate::after":{content:'""',position:"absolute",inset:"30%",backgroundColor:n=>l(n,"shift-8",r.get(n))},"&:indeterminate:hover:not([disabled])::after":{backgroundColor:n=>l(n,"shift-7",r.get(n))},"&:focus-visible":{borderRadius:s(1.5),outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:n=>l(n,"shift-4","neutral"),pointerEvents:"none"}}}}function Un(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!="code"&&console.warn('"code" primitive patch must use code tag')},style:{display:"inline-flex",alignItems:"center",fontSize:o=>p(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),height:s(6),paddingInline:s(1.5),borderRadius:s(1)}}}function Kn(e={}){var i,n;let{duration:t=240}=e,r=h((i=e.color)!=null?i:"neutral","color"),o=h((n=e.accentColor)!=null?n:"primary","accentColor");return{_onInsert:a=>{a.tagName!="details"&&console.warn('"details" primitive patch must use details tag')},style:{fontSize:a=>p(a,"inherit"),color:a=>l(a,"shift-9",r.get(a)),backgroundColor:a=>l(a,"inherit",r.get(a)),overflow:"hidden","& > summary":{backgroundColor:a=>l(a,"shift-2",r.get(a)),color:a=>l(a,"shift-10",r.get(a)),fontSize:a=>p(a,"inherit"),listStyle:"none",display:"flex",justifyContent:"space-between",alignItems:"center",gap:s(2),cursor:"pointer",userSelect:"none",fontWeight:500,paddingInline:a=>s(g(a)*4),height:s(10)},"& > summary::-webkit-details-marker":{display:"none"},"& > summary::marker":{content:'""'},"& > summary::after":{content:'""',width:s(2),height:s(2),flexShrink:0,marginTop:`-${s(.5)}`,borderInlineEnd:a=>`${s(.5)} solid ${l(a,"shift-9",r.get(a))}`,borderBottom:a=>`${s(.5)} solid ${l(a,"shift-9",r.get(a))}`,transform:"rotate(45deg)",transition:`transform ${t}ms ease`},"&[open] > summary::after":{transform:"rotate(-135deg)"},"& > summary:hover":{backgroundColor:a=>l(a,"shift-3",r.get(a))},"& > summary:focus-visible":{borderRadius:a=>s(g(a)*2),outlineOffset:`-${s(.5)}`,outline:a=>`${s(.5)} solid ${l(a,"shift-6",o.get(a))}`},"& > :not(summary)":{maxHeight:"0px",opacity:0,overflow:"hidden",paddingInline:a=>s(g(a)*3),paddingTop:0,paddingBottom:0,transition:`max-height ${t}ms ease, opacity ${t}ms ease, padding ${t}ms ease`},"&[open] > :not(summary)":{maxHeight:s(250),opacity:1,paddingTop:a=>s(g(a)*1),paddingBottom:a=>s(g(a)*3)}}}}function qn(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="dl"&&console.warn('"descriptionList" primitive patch must use dl tag')},style:{display:"grid",gridTemplateColumns:`minmax(${s(24)}, max-content) 1fr`,columnGap:s(4),margin:0,"& dt":{margin:0,fontWeight:600,fontSize:o=>p(o,"inherit"),color:o=>l(o,"shift-10",t.get(o))},"& dd":{margin:0,fontSize:o=>p(o,"inherit"),color:o=>l(o,"shift-9",t.get(o))}}}}function Gn(e={}){let{color:t="neutral",open:r=!1}=e,o=h(r);return{_onInsert:i=>{i.tagName!="dialog"&&console.warn('"dialog" primitive patch must use dialog tag')},onClick:(i,n)=>{if(i.target!==n.domElement)return;let a=n.domElement.getBoundingClientRect();i.clientX>=a.left&&i.clientX<=a.right&&i.clientY>=a.top&&i.clientY<=a.bottom||o.set(!1)},onTransitionEnd:(i,n)=>{let a=n.domElement;a.style.opacity==="0"&&(a.close(),document.body.style.overflow="")},_onMount:i=>{let n=i.domElement,a=c=>{c?(n.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{n.style.opacity="1";let m=n.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');m==null||m.focus()})):n.style.opacity="0"};a(o.get()),o.addListener(a)},style:{opacity:"0",transition:"opacity 200ms ease",fontSize:i=>p(i,"inherit"),color:i=>l(i,"shift-10",t),backgroundColor:i=>l(i,"inherit",t),border:"none",padding:i=>s(g(i)*3),boxShadow:i=>`0 ${s(9)} ${s(16)} ${l(i,"shift-4","neutral")}`,"&::backdrop":{backgroundColor:i=>l(i,"shift-2","neutral"),opacity:.75}}}}function Yn(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="em"&&console.warn('"emphasis" primitive patch must use em tag')},style:{fontSize:o=>p(o,"inherit"),fontStyle:"italic",color:o=>l(o,"shift-10",t.get(o))}}}function Xn(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="figure"&&console.warn('"figure" primitive patch must use figure tag')},style:{display:"flex",flexDirection:"column",gap:s(2),marginInline:0,marginTop:s(3),marginBottom:s(3),color:o=>l(o,"shift-9",t.get(o)),"& img, & svg, & video, & canvas":{display:"block",maxWidth:"100%",borderRadius:s(2)},"& figcaption":{fontSize:o=>p(o,"decrease-1"),color:o=>l(o,"shift-8",t.get(o)),lineHeight:1.45}}}}function Jn(e={}){var i;let{layout:t="horizontal"}=e,r=h((i=e.color)!=null?i:"neutral","color"),o=t==="vertical";return{_onInsert:n=>{n.tagName!="fieldset"&&console.warn('"formGroup" patch must use fieldset tag')},style:{margin:0,paddingInline:n=>s(g(n)*3),paddingBlock:n=>s(g(n)*3),border:"none",borderRadius:n=>s(g(n)*2),fontSize:n=>p(n,"inherit"),backgroundColor:n=>l(n,"inherit",r.get(n)),display:"grid",gridTemplateColumns:o?"minmax(0, 1fr)":"max-content minmax(0, 1fr)",columnGap:s(4),rowGap:s(3),alignItems:"start","& > legend":{gridColumn:"1 / -1",margin:0,fontSize:n=>p(n,"inherit"),fontWeight:600,paddingBlock:n=>s(g(n)*1),borderRadius:n=>s(g(n)*2),color:n=>l(n,"shift-9",r.get(n)),backgroundColor:n=>l(n,"inherit",r.get(n))},"& > label":{gridColumn:"1",alignSelf:"start",margin:0,paddingBlock:n=>o?"0px":s(g(n)*1)},"& > label:has(+ :not(legend, label, p) + p)":{gridRow:o?"auto":"span 2"},"& > :not(legend, label, p)":{gridColumn:o?"1":"2",minWidth:0,width:"100%",boxSizing:"border-box"},"& > p":{gridColumn:o?"1":"2",minWidth:0,margin:0,marginBlockStart:`calc(${s(2)} * -1)`,fontSize:n=>p(n,"decrease-1"),color:n=>l(n,"shift-9",r.get(n))}}}}var Zn={h6:"decrease-1",h5:"inherit",h4:"increase-1",h3:"increase-2",h2:"increase-3",h1:"increase-4"};function Qn(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{["h1","h2","h3","h4","h5","h6"].includes(o.tagName)||console.warn('"heading" primitive patch must use heading tags [h1...h6]')},style:{color:o=>l(o,"shift-11",t.get(o)),marginTop:0,marginBottom:s(2),fontSize:o=>{let i=Zn[o.elementNode.tagName]||"inherit";return p(o,i)}}}}function er(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="hr"&&console.warn('"horizontalRule" primitive patch must use hr tag')},style:{border:0,height:"1px",marginInline:0,marginTop:s(3),marginBottom:s(3),backgroundColor:o=>l(o,"shift-4",t.get(o))}}}function tr(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!="img"&&console.warn('"image" primitive patch must use img tag')},style:{display:"block",width:"100%",maxWidth:"100%",height:"auto",objectFit:"cover",borderRadius:s(2),backgroundColor:o=>l(o,"inherit",t.get(o))}}}function or(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="span"&&console.warn('"icon" primitive patch should use span tag')},style:{display:"inline-flex",alignItems:"center",verticalAlign:`calc(-1 * ${s(.5)})`,width:"1em",height:"1em",flexShrink:"0",fontSize:o=>p(o),backgroundColor:"transparent",color:o=>l(o,"shift-9",t.get(o))}}}function nr(e={}){var o,i;let t=h((o=e.color)!=null?o:"neutral","color"),r=h((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"color",_onSchedule:(n,a)=>{n.tagName!="input"&&console.warn('"inputColor" primitive patch must use input tag'),a.type="color"},style:{appearance:"none",border:"none",cursor:"pointer",fontSize:n=>p(n,"inherit"),paddingBlock:n=>s(g(n)*1),paddingInline:n=>s(g(n)*1),blockSize:n=>s(6+g(n)*2),inlineSize:n=>s(6+g(n)*2),backgroundColor:"transparent","&::-webkit-color-swatch-wrapper":{margin:0,padding:0},"&::-webkit-color-swatch":{borderRadius:n=>s(g(n)*1)},"&:hover:not([disabled]), &:focus-visible":{},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:n=>l(n,"shift-2","neutral"),outline:n=>`1px solid ${l(n,"shift-4","neutral")}`}}}}function rr(e={}){var i,n;let{mode:t="datetime-local"}=e,r=h((i=e.color)!=null?i:"neutral","color"),o=h((n=e.accentColor)!=null?n:"primary","accentColor");return{type:t,_onSchedule:(a,c)=>{a.tagName!="input"&&console.warn('"inputDateTime" primitive patch must use input tag'),c.type=t},style:{fontFamily:"inherit",fontSize:a=>p(a,"inherit"),lineHeight:"inherit",color:a=>l(a,"shift-9",r.get(a)),backgroundColor:a=>l(a,"inherit",r.get(a)),border:"none",outlineOffset:"-1px",outline:a=>`1px solid ${l(a,"shift-4",r.get(a))}`,borderRadius:a=>s(g(a)*1),paddingInline:a=>s(g(a)*3),height:a=>s(6+g(a)*2),"&::-webkit-calendar-picker-indicator":{cursor:"pointer",opacity:.85},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:a=>`${s(.5)} solid ${l(a,"shift-6",o.get(a))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:a=>l(a,"shift-8","neutral"),backgroundColor:a=>l(a,"shift-2","neutral"),outline:a=>`1px solid ${l(a,"shift-4","neutral")}`},"&:invalid":{outline:a=>`${s(.5)} solid ${l(a,"shift-6","error")}`}}}}function ir(e={}){var o,i;let t=h((o=e.color)!=null?o:"neutral","color"),r=h((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"file",_onSchedule:(n,a)=>{n.tagName!="input"&&console.warn('"inputFile" primitive patch must use input tag'),a.type="file"},style:{fontFamily:"inherit",fontSize:n=>p(n,"inherit"),lineHeight:"inherit",color:n=>l(n,"shift-9",t.get(n)),backgroundColor:n=>l(n,"inherit",t.get(n)),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,borderRadius:n=>s(g(n)*1),height:n=>s(6+g(n)*2),paddingInline:n=>s(g(n)*1),"&::file-selector-button":{marginBlock:"auto",fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:s(1),height:s(6),paddingInline:s(2),cursor:"pointer",color:n=>l(n,"shift-10",r.get(n)),backgroundColor:n=>l(n,"shift-3",r.get(n))},"&::-webkit-file-upload-button":{marginTop:s(1),fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:s(1),height:s(6),paddingInline:s(2),cursor:"pointer",color:n=>l(n,"shift-10",t.get(n)),backgroundColor:n=>l(n,"shift-3",t.get(n))},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:n=>l(n,"shift-8","neutral"),outline:n=>`1px solid ${l(n,"shift-4","neutral")}`,backgroundColor:n=>l(n,"shift-2","neutral")},"&[disabled]::file-selector-button, &[disabled]::-webkit-file-upload-button":{cursor:"not-allowed",color:n=>l(n,"shift-8","neutral"),backgroundColor:n=>l(n,"shift-3","neutral")}}}}function ar(e={}){var o,i;let t=h((o=e.color)!=null?o:"neutral","color"),r=h((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"search",_onSchedule:(n,a)=>{n.tagName!="input"&&console.warn('"inputSearch" primitive patch must use input tag'),a.type="search"},style:{fontFamily:"inherit",fontSize:n=>p(n,"inherit"),lineHeight:"inherit",color:n=>l(n,"shift-9",t.get(n)),backgroundColor:n=>l(n,"inherit",t.get(n)),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,borderRadius:n=>s(g(n)*1),minWidth:s(32),paddingInline:n=>s(g(n)*3),paddingBlock:n=>s(g(n)*1),"&::placeholder":{color:n=>l(n,"shift-7",t.get(n))},"&::-webkit-search-decoration":{display:"none"},"&::-webkit-search-cancel-button":{cursor:"pointer"},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:n=>l(n,"shift-8","neutral"),backgroundColor:n=>l(n,"shift-2","neutral"),outline:n=>`1px solid ${l(n,"shift-4","neutral")}`}}}}function lr(e={}){var o,i;let t=h((o=e.color)!=null?o:"neutral","color"),r=h((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"text",_onSchedule:(n,a)=>{n.tagName!="input"&&console.warn('"inputText" primitive patch must use input tag and text type'),a.type="text"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:s(10),paddingInline:n=>s(g(n)*3),paddingBlock:n=>s(g(n)*1),borderRadius:n=>s(g(n)*1),fontSize:n=>p(n,"inherit"),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,color:n=>l(n,"shift-9",t.get(n)),backgroundColor:n=>l(n,"inherit",t.get(n)),"&::placeholder":{color:n=>l(n,"shift-7")},"&:not(:placeholder-shown)":{color:n=>l(n,"shift-10")},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:n=>l(n,"shift-2","neutral"),outline:n=>`1px solid ${l(n,"shift-4","neutral")}`,color:n=>l(n,"shift-8","neutral")},"&:invalid:not(:placeholder-shown)":{outline:n=>`${s(.5)} solid ${l(n,"shift-6","error")}`},"&[data-status=error]":{outline:n=>`${s(.5)} solid ${l(n,"shift-6","error")}`},"&[data-status=warning]":{outline:n=>`${s(.5)} solid ${l(n,"shift-6","warning")}`}}}}function sr(e={}){var o,i;let t=h((o=e.color)!=null?o:"neutral","color"),r=h((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"range",_onInsert:n=>{n.tagName!="input"&&console.warn('"inputRange" primitive patch must use input tag')},style:{appearance:"none",width:"100%",margin:0,padding:0,height:s(4),background:"transparent",cursor:"pointer","&::-webkit-slider-runnable-track":{height:s(1.5),borderRadius:s(999),backgroundColor:n=>l(n,"shift-3",t.get(n))},"&::-moz-range-track":{height:s(1.5),borderRadius:s(999),backgroundColor:n=>l(n,"shift-3",t.get(n))},"&::-webkit-slider-thumb":{appearance:"none",width:s(4),height:s(4),borderRadius:s(999),border:"none",marginTop:`calc((${s(1.5)} - ${s(4)}) / 2)`,backgroundColor:n=>l(n,"shift-9",r.get(n))},"&::-moz-range-thumb":{width:s(4),height:s(4),borderRadius:s(999),border:"none",backgroundColor:n=>l(n,"shift-9",r.get(n))},"&:hover:not([disabled])::-webkit-slider-thumb":{backgroundColor:n=>l(n,"shift-10",r.get(n))},"&:hover:not([disabled])::-moz-range-thumb":{backgroundColor:n=>l(n,"shift-10",r.get(n))},"&:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`,outlineOffset:s(1),borderRadius:s(2)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function cr(e={}){var o,i;let t=h((o=e.color)!=null?o:"neutral","color"),r=h((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"number",_onSchedule:(n,a)=>{n.tagName!="input"&&console.warn('"inputNumber" primitive patch must use input tag'),a.type="number"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:s(10),paddingInlineStart:n=>s(g(n)*3),paddingInlineEnd:n=>s(g(n)*1.5),paddingBlock:n=>s(g(n)*1),borderRadius:n=>s(g(n)*1),fontSize:n=>p(n,"inherit"),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,color:n=>l(n,"shift-9",t.get(n)),backgroundColor:n=>l(n,"inherit",t.get(n)),"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{opacity:1},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:n=>l(n,"shift-2","neutral"),outline:n=>`1px solid ${l(n,"shift-4","neutral")}`,color:n=>l(n,"shift-8","neutral")}}}}function mr(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="kbd"&&console.warn('"keyboard" primitive patch must use kbd tag')},style:{fontSize:o=>p(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),paddingBlock:s(.5),paddingInline:s(1.5),borderRadius:s(1),outline:o=>`1px solid ${l(o,"shift-4",t.get(o))}`}}}function ur(e={}){var o,i;let t=h((o=e.color)!=null?o:"neutral","color"),r=h((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:n=>{n.tagName!="label"&&console.warn('"label" primitive patch must use label tag')},style:{display:"inline-flex",alignItems:"center",gap:s(2),fontSize:n=>p(n,"inherit"),color:n=>l(n,"shift-9",t.get(n)),cursor:"pointer","&:focus-within":{color:n=>l(n,"shift-10",r.get(n))},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",color:n=>l(n,"shift-8","neutral")}}}}function fr(e={}){var o,i;let t=h((o=e.color)!=null?o:"primary","color"),r=h((i=e.accentColor)!=null?i:"secondary","accentColor");return{_onInsert:n=>{n.tagName!="a"&&console.warn('"link" primitive patch must use a tag')},style:{fontSize:n=>p(n,"inherit"),backgroundColor:n=>l(n),color:n=>l(n,"shift-9",t.get(n)),textDecoration:"none","&:visited":{color:n=>l(n,"shift-9",r.get(n))},"&:hover:not([disabled])":{color:n=>l(n,"shift-10",t.get(n)),textDecoration:"underline"},"&:focus-visible":{borderRadius:s(1),outlineOffset:s(1),outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:n=>l(n,"shift-8","neutral")}}}}function dr(e={}){var r;let t=h((r=e.accentColor)!=null?r:"highlight","accentColor");return{_onInsert:o=>{o.tagName!="mark"&&console.warn('"mark" primitive patch must use mark tag')},dataTone:"shift-2",style:{display:"inline-flex",alignItems:"center",fontSize:o=>p(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),height:s(6),borderRadius:s(1),paddingInline:s(1.5)}}}function hr(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="p"&&console.warn('"paragraph" primitive patch must use p tag')},style:{fontSize:o=>p(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),lineHeight:1.5,marginTop:0,marginBottom:0}}}function pr(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!="pre"&&console.warn('"preformated" primitive patch must use pre tag')},style:{fontSize:o=>p(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),border:"none",paddingBlock:o=>s(g(o)*2),paddingInline:o=>s(g(o)*3),borderRadius:o=>s(g(o)*2)}}}function gr(e={}){var o,i;let t=h((o=e.color)!=null?o:"neutral","color"),r=h((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:n=>{n.tagName!="progress"&&console.warn('"progress" primitive patch must use progress tag')},style:{appearance:"none",width:"100%",height:s(2),border:0,borderRadius:s(999),overflow:"hidden",backgroundColor:n=>l(n,"shift-3",t.get(n)),"&::-webkit-progress-bar":{backgroundColor:n=>l(n,"shift-3",t.get(n)),borderRadius:s(999)},"&::-webkit-progress-value":{backgroundColor:n=>l(n,"shift-9",r.get(n)),borderRadius:s(999),transition:"width 220ms ease"},"&::-moz-progress-bar":{backgroundColor:n=>l(n,"shift-9",r.get(n)),borderRadius:s(999)}}}}function yr(e={}){var o,i;let t=h((o=e.color)!=null?o:"neutral","color"),r=h((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"radio",_onInsert:n=>{if(n.tagName!="input"){console.warn('"inputRadio" primitive patch must use input tag and radio type');return}},style:{fontSize:n=>p(n,"inherit"),appearance:"none",display:"inline-flex",position:"relative",width:s(6),height:s(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:"50%",lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,color:n=>l(n,"shift-9",t.get(n)),width:s(4),height:s(4)},"&:hover::before":{backgroundColor:n=>l(n,"shift-2",t.get(n))},"&:checked::before":{outline:n=>`1px solid ${l(n,"shift-6",r.get(n))}`},"&:checked::after":{content:'""',position:"absolute",inset:"30%",borderRadius:"50%",backgroundColor:n=>l(n,"shift-8",r.get(n))},"&:checked:hover:not([disabled])::before":{backgroundColor:n=>l(n,"shift-7",r.get(n))},"&:focus-visible":{borderRadius:"50%",outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:n=>l(n,"shift-4","neutral"),pointerEvents:"none"}}}}function br(e={}){let{color:t="neutral",accentColor:r="primary"}=e;return{_onInsert:o=>{o.tagName!="select"&&console.warn('"select" primitive patch must use select tag')},style:{fontFamily:"inherit",fontSize:o=>p(o,"inherit"),lineHeight:"inherit",color:o=>l(o,"shift-9",t),backgroundColor:o=>l(o,"inherit",t),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${l(o,"shift-4",t)}`,borderRadius:o=>s(g(o)*1),paddingBlock:o=>s(g(o)*1),paddingLeft:o=>s(g(o)*3),paddingRight:o=>s(g(o)*1),"&:not([multiple])":{height:o=>s(6+g(o)*2)},"&:hover:not([disabled]):not([aria-busy=true])":{outline:o=>`${s(.5)} solid ${l(o,"shift-5",r)}`},"&:focus-visible":{outline:o=>`${s(.5)} solid ${l(o,"shift-6",r)}`},"& optgroup":{color:o=>l(o,"shift-11",t)},"& option[disabled]":{color:o=>l(o,"shift-7","neutral")},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>l(o,"shift-8","neutral"),outline:o=>`1px solid ${l(o,"shift-4","neutral")}`,backgroundColor:o=>l(o,"shift-2","neutral")}}}}function vr(e={}){var i;let t=h((i=e.color)!=null?i:"neutral","color"),r={"0%,100%":{opacity:1},"50%":{opacity:.4}},o=ce(JSON.stringify(r));return{ariaHidden:"true",dataTone:"shift-2",style:{fontSize:n=>p(n),color:n=>l(n,"shift-9",t.get(n)),height:s(6),display:"block",borderRadius:s(1),backgroundColor:n=>l(n,"inherit",t.get(n)),animation:`${o} 1.5s ease-in-out infinite`,[`@keyframes ${o}`]:r}}}var po={to:{transform:"rotate(360deg)"}},ho=ce(JSON.stringify(po));function Sr(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{role:"status",ariaLabel:"loading",_onInsert:o=>{o.tagName!="span"&&console.warn('"spinner" patch must use span tag')},style:{fontSize:o=>p(o),backgroundColor:o=>l(o),color:o=>l(o,"shift-9",t.get(o)),display:"inline-block",margin:0,flexShrink:0,width:s(6),height:s(6),borderRadius:"50%",border:o=>`${s(.5)} solid ${l(o,"shift-4",t.get(o))}`,borderTopColor:o=>l(o,"shift-9",t.get(o)),boxSizing:"border-box",padding:0,animation:`${ho} 0.7s linear infinite`,[`@keyframes ${ho}`]:po}}}function xr(e={}){var a;let{color:t="neutral",multiple:r=!1}=e,o=h((a=e.value)!=null?a:r?[]:null),i={div:c=>{let m=o.get(c);return(Array.isArray(m)?m:[m]).map(f=>({input:null,name:e.name,value:f||""}))},hidden:!0};return{dataTone:"shift-17",_context:{select:{value:o,multiple:r}},_onInit:c=>{c.tagName!="div"&&console.warn('"selectList" patch must use a div tag'),c.children.insert(i)},style:{display:"flex",flexDirection:"column",paddingBlock:c=>s(g(c)*2),paddingInline:c=>s(g(c)*2),fontSize:c=>p(c,"inherit"),backgroundColor:c=>l(c,"inherit",t)}}}function Cr(e={}){let{accentColor:t="primary",color:r="neutral",value:o=null}=e;return{role:"option",_onInit:n=>{n.tagName!="div"&&console.warn('"selectItem" patch must use div tag');let a=n.getContext("select");if(a){let c=a.value;n.attributes.set("ariaSelected",m=>{let u=c.get(m);return a.multiple?u.includes(o):u==o}),n.addEvent("click",()=>{let m=c.get();a.multiple?m.includes(o)?c.set(m.filter(u=>u!==o)):c.set(m.concat([o])):m!=o&&c.set(o)})}},style:{cursor:"pointer",display:"flex",alignItems:"center",fontSize:n=>p(n,"inherit"),height:n=>s(6+g(n)*2),paddingInline:n=>s(g(n)*3),border:"none",outline:"none",color:n=>l(n,"shift-9",r),backgroundColor:n=>l(n,"inherit",r),"&:hover:not([disabled]):not([aria-selected=true])":{backgroundColor:n=>l(n,"shift-2",r)},"&[aria-selected=true]":{backgroundColor:n=>l(n,"shift-6",t),color:n=>l(n,"shift-11")},"&:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",t)}`,outlineOffset:`-${s(.5)}`}}}}function wr(e){let{options:t=[],placement:r="bottom",color:o="neutral",open:i=!1,multiple:n=!1}=e,a=h(e.value),c=h(i),{show:m,hide:u,anchorPartial:f}=K({open:c,placement:r,content:e.content,onPlacement:e.onPlacement}),d={onClick:()=>!n&&u()};k(e.content,d);let y={div:v=>{let x=a.get(v),S=Array.isArray(x)?x:[x];return t.filter(w=>S.includes(w.value)).map(w=>({span:w.label,$:[ve({color:o,removable:n})],_key:w.value,_onRemove:T=>{let E=a.get(),O=(Array.isArray(E)?E:[E]).filter($=>$!==w.value);n?a.set(O):a.set(O[0])}}))},style:{display:"flex",flexWrap:"wrap",gap:s(1),flex:1}},b={_onInsert:v=>{v.tagName!="div"&&console.warn('"selectBox" patch must use div tag')},_onInit:v=>v.children.insert(y),onClick:()=>c.get()?u():m(),style:{cursor:"pointer",display:"flex",alignItems:"center",minHeight:v=>s(6+g(v)*2),minWidth:s(32),outlineOffset:"-1px",outline:v=>`1px solid ${l(v,"shift-4","neutral")}`,paddingInline:v=>s(g(v)*2),borderRadius:v=>s(g(v)*1),fontSize:v=>p(v,"inherit"),color:v=>l(v,"shift-9",o),backgroundColor:v=>l(v,"inherit",o)}};return k(f,b),f}function Er(e={}){var r;let t=h((r=e.accentColor)!=null?r:"primary","accentColor");return{dataTone:"shift-2",type:"checkbox",_onSchedule:o=>{if(o.tagName!="input"){console.warn('"inputSwitch" primitive patch must use input tag');return}},style:{fontSize:o=>p(o,"inherit"),appearance:"none",position:"relative",display:"inline-flex",width:s(9),height:s(6),cursor:"pointer",margin:"0",paddingBlock:s(1),"&:checked":{"&::before":{backgroundColor:o=>l(o,"increase-3",t.get(o))},"&::after":{left:`calc(100% - ${s(3.5)})`}},"&::after":{content:'""',aspectRatio:"1/1",position:"absolute",width:s(3),height:s(3),borderRadius:s(999),left:s(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",backgroundColor:o=>l(o,"decrease-3")},"&::before":{content:'""',width:"100%",borderRadius:s(999),display:"inline-block",fontSize:o=>p(o,"inherit"),lineHeight:1,backgroundColor:o=>l(o)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function kr(e={}){var n,a;let{checked:t=!1}=e,r=h(t),o=h((n=e.color)!=null?n:"neutral","color"),i=h((a=e.accentColor)!=null?a:"primary","accentColor");return{_onSchedule:c=>{c.tagName!="button"&&console.warn('"buttonSwitch" primitive patch must use button tag')},role:"switch",ariaChecked:c=>r.get(c),dataTone:"shift-2",onClick:()=>r.set(!r.get()),style:{position:"relative",display:"inline-flex",alignItems:"center",fontSize:c=>p(c),border:"none",outlineWidth:"1px",outline:c=>`1px solid ${l(c,"shift-3",o.get(c))}`,minWidth:s(12),minHeight:s(6),borderRadius:s(999),paddingLeft:s(7),paddingRight:s(2),transition:"padding-left 0.3s, padding-right 0.3s",backgroundColor:c=>l(c,"inherit",o.get(c)),"& > :first-child":{content:'""',position:"absolute",display:"inline-flex",alignItems:"center",left:s(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",width:s(5),height:s(5),borderRadius:s(999),color:c=>l(c,"shift-9"),backgroundColor:c=>l(c,"decrease-2",o.get(c))},"&[aria-checked=true]":{backgroundColor:c=>l(c,"increase-3",i.get(c)),outline:"none",color:c=>l(c,"decrease-2"),paddingLeft:s(2),paddingRight:s(7)},"&[aria-checked=true] > :first-child":{left:`calc(100% - ${s(5.5)})`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Tr(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{dataSize:"decrease-1",_onInsert:o=>{o.tagName!="small"&&console.warn('"small" primitive patch must use small tag')},style:{fontSize:o=>p(o,"inherit"),color:o=>l(o,"shift-9",t.get(o))}}}function _r(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="strong"&&console.warn('"strong" primitive patch must use strong tag')},style:{fontSize:o=>p(o,"inherit"),fontWeight:700,color:o=>l(o,"shift-11",t.get(o)),backgroundColor:o=>l(o)}}}function Or(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="sub"&&console.warn('"subscript" primitive patch must use sub tag')},style:{fontSize:o=>p(o,"decrease-1"),verticalAlign:"sub",lineHeight:0,color:o=>l(o,"shift-9",t.get(o))}}}function Pr(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="sup"&&console.warn('"superscript" primitive patch must use sup tag')},style:{fontSize:o=>p(o,"decrease-1"),verticalAlign:"super",lineHeight:0,color:o=>l(o,"shift-9",t.get(o))}}}function Rr(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="table"&&console.warn('"table" primitive patch must use table tag')},style:{fontSize:o=>p(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),width:"100%",borderCollapse:"collapse","& caption":{captionSide:"bottom"},"& th, & thead td":{textAlign:"left",fontWeight:500,paddingInline:o=>s(g(o)*3),paddingBlock:o=>s(g(o)*1),color:o=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"inherit")},"& td":{textAlign:"left",paddingInline:o=>s(g(o)*3),paddingBlock:o=>s(g(o)*1),color:o=>l(o,"shift-9",t.get(o)),boxShadow:o=>`inset 0 1px 0 ${l(o,"shift-4",t.get(o))}`,fontSize:o=>p(o,"inherit")},"& tfoot th, & tfoot td":{textAlign:"left",fontWeight:500,paddingInline:o=>s(g(o)*3),paddingBlock:o=>s(g(o)*1),color:o=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"inherit"),boxShadow:o=>`inset 0 -1px 0 ${l(o,"shift-4",t.get(o))}`},"& tr":{backgroundColor:o=>l(o,"inherit")},"& tbody tr:hover":{backgroundColor:o=>l(o,"shift-3")+"!important"}}}}function $r(e={}){var o,i;let t=h((o=e.color)!=null?o:"neutral","color"),r=h((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:n=>{n.tagName!="textarea"&&console.warn('"textarea" primitive patch must use textarea tag')},style:{fontFamily:"inherit",lineHeight:"inherit",resize:"vertical",paddingInline:n=>s(g(n)*4),paddingBlock:n=>s(g(n)*2),border:"none",borderRadius:n=>s(g(n)*2),fontSize:n=>p(n,"inherit"),color:n=>l(n,"shift-9",t.get(n)),outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,backgroundColor:n=>l(n,"inherit",t.get(n)),"&::placeholder":{color:n=>l(n,"shift-7")},"&:hover:not([disabled]):not([aria-busy=true])":{outline:n=>`${s(.5)} solid ${l(n,"shift-5",r.get(n))}`},"&:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&:invalid":{outline:n=>`${s(.5)} solid ${l(n,"shift-5","error")}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:n=>l(n,"shift-8","neutral"),outline:n=>`1px solid ${l(n,"shift-4","neutral")}`,backgroundColor:n=>l(n,"shift-2","neutral")}}}}function Lr(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="ul"&&console.warn('"unorderedList" primitive patch must use ul tag')},style:{fontSize:o=>p(o,"inherit"),backgroundColor:o=>l(o),color:o=>l(o,"shift-9",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:s(3),listStyleType:"disc",listStylePosition:"outside"}}}function Ir(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="ol"&&console.warn('"orderedList" primitive patch must use ol tag')},style:{fontSize:o=>p(o,"inherit"),backgroundColor:o=>l(o),color:o=>l(o,"shift-9",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:s(3),listStyleType:"decimal",listStylePosition:"outside"}}}function zr(e,t){if(t<=7)return Array.from({length:t},(n,a)=>a+1);let r=[1];e>3&&r.push("...");let o=Math.max(2,e-1),i=Math.min(t-1,e+1);for(let n=o;n<=i;n++)r.push(n);return e<t-2&&r.push("..."),r.push(t),r}function Mr(e){var c;let{total:t,color:r="neutral",accentColor:o="primary"}=e,i=h((c=e.value)!=null?c:1),n={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:m=>s(6+g(m)*2),height:m=>s(6+g(m)*2),paddingInline:m=>s(g(m)*2),borderRadius:m=>s(g(m)*1),border:"none",cursor:"pointer",fontSize:m=>p(m,"inherit"),backgroundColor:"transparent",color:m=>l(m,"shift-9",r),"&:hover:not([disabled])":{backgroundColor:m=>l(m,"shift-2",r)},"&[disabled]":{opacity:.4,cursor:"not-allowed"}},a=A(P({},n),{backgroundColor:m=>l(m,"shift-6",o),color:m=>l(m,"shift-11",o),fontWeight:"600",cursor:"default","&:hover:not([disabled])":{backgroundColor:m=>l(m,"shift-6",o)}});return{_onInsert:m=>{m.tagName!=="div"&&console.warn('"pagination" patch must use div tag')},_onInit:m=>{let u={div:f=>{let d=i.get(f),y=[];y.push({button:"\u2039",type:"button",ariaLabel:"Previous page",disabled:d<=1,onClick:()=>d>1&&i.set(d-1),style:n});for(let b of zr(d,t))if(b==="...")y.push({span:"\u2026",style:{display:"inline-flex",alignItems:"center",paddingInline:v=>s(g(v)*2),color:v=>l(v,"shift-7",r)}});else{let v=b===d;y.push({button:String(b),type:"button",ariaLabel:`Page ${b}`,ariaCurrent:v?"page":void 0,disabled:v,onClick:()=>i.set(b),style:v?a:n})}return y.push({button:"\u203A",type:"button",ariaLabel:"Next page",disabled:d>=t,onClick:()=>d<t&&i.set(d+1),style:n}),y},style:{display:"flex",alignItems:"center",gap:s(1)}};m.children.insert(u)},style:{display:"inline-flex"}}}function Ar(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{role:"separator",_onInsert:o=>{o.tagName!=="div"&&console.warn('"divider" patch should be used with <div>')},style:{display:"flex",justifyContent:"center",alignItems:"baseline",gap:s(2),fontSize:o=>p(o,"inherit"),backgroundColor:o=>l(o),color:o=>l(o,"shift-9",t.get(o)),minHeight:"1lh","&::before":{content:'""',flex:1,borderColor:o=>l(o,"shift-4",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"},"&::after":{content:'""',flex:1,borderColor:o=>l(o,"shift-4",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"}}}}var go={left:"translateX(-100%)",right:"translateX(100%)",top:"translateY(-100%)",bottom:"translateY(100%)"},Vr={left:"0 auto 0 0",right:"0 0 0 auto",top:"0 0 auto 0",bottom:"auto 0 0 0"},mt=e=>e==="left"||e==="right";function Nr(e={}){let{color:t="neutral",open:r=!1,placement:o="right",size:i}=e,n=h(r),a=mt(o)?s(80):s(64),c=i!=null?i:a;return{_onInsert:m=>{m.tagName!=="dialog"&&console.warn('"drawer" patch must use dialog tag')},onClick:(m,u)=>{m.target===u.domElement&&n.set(!1)},onTransitionEnd:(m,u)=>{let f=u.domElement;n.get()||(f.close(),document.body.style.overflow="")},_onMount:m=>{let u=m.domElement,f=d=>{d?(u.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{u.style.transform="translate(0, 0)"})):u.style.transform=go[o]};f(n.get()),n.addListener(f)},style:{transform:go[o],transition:"transform 0.25s ease",fontSize:m=>p(m,"inherit"),color:m=>l(m,"shift-10",t),backgroundColor:m=>l(m,"inherit",t),border:"none",padding:m=>s(g(m)*3),margin:Vr[o],width:mt(o)?c:"100dvw",height:mt(o)?"100dvh":c,maxWidth:"100dvw",maxHeight:"100dvh",boxShadow:m=>`0 ${s(4)} ${s(12)} ${l(m,"shift-4","neutral")}`,"&::backdrop":{backgroundColor:m=>l(m,"shift-2","neutral"),opacity:.75}}}}function Dr(e){let{open:t=!1,placement:r="bottom",openOn:o="click"}=e,i=null,n=h(t),{show:a,hide:c,anchorPartial:m}=K({open:n,placement:r,content:e.content,onPlacement:e.onPlacement}),u={role:"dialog",dataTone:"shift-17",onMouseEnter:()=>o==="hover"&&a(),onMouseLeave:()=>o==="hover"&&c(),_onInsert:d=>{let y=d.attributes.get("id");i=y||d.nodeId,!y&&d.attributes.set("id",i)}};return k(e.content,u),k(m,{ariaHaspopup:"dialog",ariaExpanded:d=>n.get(d),onMouseEnter:()=>o==="hover"&&a(),onMouseLeave:()=>o==="hover"&&c(),onClick:()=>o==="click"&&(n.get()?c():a()),onFocus:()=>a(),onBlur:()=>c(),_onMount:d=>i&&d.attributes.set("ariaControls",i)}),m}function Br(e={}){let{position:t="top-center",color:r="neutral"}=e,o=h(!1),i=t.startsWith("top"),n=t.endsWith("center"),a=t.endsWith("right"),c={div:[],id:`domphy-toast-${t}`,style:{position:"fixed",display:"flex",flexDirection:i?"column":"column-reverse",alignItems:n?"center":a?"end":"start",inset:0,gap:s(4),zIndex:30,padding:s(6),pointerEvents:"none"}};return{_portal:m=>{let u=m.domElement.querySelector(`#domphy-toast-${t}`);return u||(u=m.children.insert(c).domElement),u},role:"status",ariaAtomic:"true",dataTone:"shift-17",style:{minWidth:s(32),pointerEvents:"auto",paddingBlock:m=>s(g(m)*2),paddingInline:m=>s(g(m)*4),borderRadius:m=>s(g(m)*2),fontSize:m=>p(m,"inherit"),color:m=>l(m,"shift-9",r),backgroundColor:m=>l(m,"inherit",r),boxShadow:m=>`0 ${s(2)} ${s(9)} ${l(m,"shift-4","neutral")}`,opacity:m=>Number(o.get(m)),transform:m=>o.get(m)?"translateY(0)":i?"translateY(-100%)":"translateY(100%)",transition:"opacity 300ms ease, transform 300ms ease"},_onMount:()=>requestAnimationFrame(()=>o.set(!0)),_onBeforeRemove:(m,u)=>{let f=d=>{d.propertyName==="transform"&&(m.domElement.removeEventListener("transitionend",f),u())};m.domElement.addEventListener("transitionend",f),o.set(!1)}}}function Hr(e={}){let{open:t=!1,placement:r="top",content:o="Tooltip Content"}=e,i=null,n=h(r),a=typeof o=="string"?{span:o}:o,{show:c,hide:m,anchorPartial:u}=K({open:t,placement:r,content:a}),f={role:"tooltip",dataSize:"decrease-1",dataTone:"shift-17",_onInsert:y=>{let b=y.attributes.get("id");i=b||y.nodeId,!b&&y.attributes.set("id",i)},style:{paddingBlock:y=>s(g(y)*1),paddingInline:y=>s(g(y)*3),borderRadius:y=>s(g(y)*1),color:y=>l(y,"shift-9"),backgroundColor:y=>l(y),fontSize:y=>p(y,"inherit")},$:[ct({placement:r,bordered:!1})]};return a.$||(a.$=[]),a.$.push(f),k(u,{onMouseEnter:()=>c(),onMouseLeave:()=>m(),onFocus:()=>c(),onBlur:()=>m(),onKeyDown:y=>y.key==="Escape"&&m(),_onMount:y=>i&&y.attributes.set("ariaDescribedby",i)}),u}function yo(e,t){return e.key!==void 0&&e.key!==null?String(e.key):`index-${t}`}function Fr(e={}){let{duration:t=300,delay:r=0}=e,o=new Map;return{_onBeforeUpdate:i=>{o=new Map,i.children.items.forEach((n,a)=>{if(!(n instanceof L))return;let c=n.domElement;c&&o.set(yo(n,a),c.getBoundingClientRect())})},_onUpdate:i=>{i.children.items.forEach((n,a)=>{if(!(n instanceof L))return;let c=n.domElement;if(!c)return;let m=yo(n,a),u=o.get(m);if(!u)return;let f=c.getBoundingClientRect(),d=u.left-f.left,y=u.top-f.top;if(Math.abs(d)<.5&&Math.abs(y)<.5)return;let b=c.style.transition,v=c.style.transform;c.style.transition="none",c.style.transform=`translate(${d}px, ${y}px)`,c.getBoundingClientRect(),requestAnimationFrame(()=>{c.style.transition=`transform ${t}ms ease ${r}ms`,c.style.transform="translate(0px, 0px)"});let x=()=>{c.style.transition=b,c.style.transform=v,c.removeEventListener("transitionend",S)},S=C=>{C.propertyName==="transform"&&x()};c.addEventListener("transitionend",S),setTimeout(x,t+r+34)}),o.clear()}}}function jr(e={}){return{role:"tablist",_onSchedule:(r,o)=>{let i={_context:{tabs:{activeKey:h(e.activeKey||0)}}};k(o,i)}}}function Wr(e={}){let{accentColor:t="primary",color:r="neutral"}=e;return{role:"tab",_onInsert:i=>{var u;i.tagName!="button"&&console.warn('"tab" patch must use button tag');let n=i.getContext("tabs"),a=(u=i.parent)==null?void 0:u.children.items;a=a.filter(f=>f.type=="ElementNode"&&f.attributes.get("role")=="tab");let c=i.key||a.findIndex(f=>f==i),m={id:"tab"+i.parent.nodeId+c,ariaControls:"tabpanel"+i.parent.nodeId+c,ariaSelected:f=>n.activeKey.get(f)==c,onClick:()=>n.activeKey.set(c),onKeyDown:f=>{var S,C,w,T;let d=f.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(d))return;f.preventDefault();let y=((C=(S=i.parent)==null?void 0:S.children.items)!=null?C:[]).filter(E=>E.type==="ElementNode"&&E.attributes.get("role")==="tab"),b=y.findIndex(E=>E===i),v=b;d==="ArrowRight"?v=(b+1)%y.length:d==="ArrowLeft"?v=(b-1+y.length)%y.length:d==="Home"?v=0:d==="End"&&(v=y.length-1);let x=y[v];n.activeKey.set((w=x.key)!=null?w:v),(T=x.domElement)==null||T.focus()}};i.merge(m)},style:{cursor:"pointer",fontSize:i=>p(i,"inherit"),height:i=>s(6+g(i)*2),paddingInline:i=>s(g(i)*4),border:"none",outline:"none",color:i=>l(i,"shift-9"),backgroundColor:i=>l(i,"inherit"),boxShadow:i=>`inset 0 -${s(.5)} 0 0 ${l(i,"shift-1",r)}`,"&:hover:not([disabled])":{boxShadow:i=>`inset 0 -${s(.5)} 0 0 ${l(i,"shift-2",r)}`},"&[aria-selected=true]:not([disabled])":{boxShadow:i=>`inset 0 -${s(.5)} 0 0 ${l(i,"shift-6",t)}`},"&:focus-visible":{boxShadow:i=>`inset 0 -${s(.5)} 0 0 ${l(i,"shift-6",t)}`}}}}function Ur(){return{role:"tabpanel",style:{paddingBlock:t=>s(g(t)*2),paddingInline:t=>s(g(t)*2)},_onInsert:t=>{var a;let r=t.getContext("tabs"),o=(a=t.parent)==null?void 0:a.children.items;o=o.filter(c=>c.type=="ElementNode"&&c.attributes.get("role")=="tabpanel");let i=t.key||o.findIndex(c=>c==t),n={id:"tabpanel"+t.parent.nodeId+i,ariaLabelledby:"tab"+t.parent.nodeId+i,hidden:c=>r.activeKey.get(c)!=i};t.merge(n)}}}function Kr(e={}){let{color:t="neutral"}=e;return{role:"menu",dataTone:"shift-17",_onSchedule:(o,i)=>{let n={_context:{menu:{activeKey:h(e.activeKey||0)}}};k(i,n)},style:{display:"flex",flexDirection:"column",paddingBlock:o=>s(g(o)*2),paddingInline:o=>s(g(o)*2),fontSize:o=>p(o,"inherit"),backgroundColor:o=>l(o,"inherit",t)}}}function qr(e={}){let{accentColor:t="primary",color:r="neutral"}=e;return{role:"menuitem",_onInsert:i=>{var m;i.tagName!="button"&&console.warn('"menuItem" patch must use button tag');let n=i.getContext("menu"),a=(m=i.parent)==null?void 0:m.children.items;a=a.filter(u=>u.type=="ElementNode"&&u.attributes.get("role")=="menuitem");let c=i.key||a.findIndex(u=>u==i);i.attributes.set("ariaCurrent",u=>n.activeKey.get(u)==c||void 0),i.addEvent("click",()=>n.activeKey.set(c))},onKeyDown:(i,n)=>{var f,d,y;let a=i.key;if(!["ArrowDown","ArrowUp","Home","End"].includes(a))return;i.preventDefault();let c=((d=(f=n.parent)==null?void 0:f.children.items)!=null?d:[]).filter(b=>b.type==="ElementNode"&&b.attributes.get("role")==="menuitem"),m=c.findIndex(b=>b===n),u=m;a==="ArrowDown"?u=(m+1)%c.length:a==="ArrowUp"?u=(m-1+c.length)%c.length:a==="Home"?u=0:a==="End"&&(u=c.length-1),(y=c[u].domElement)==null||y.focus()},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:i=>p(i,"inherit"),height:i=>s(6+g(i)*2),paddingInline:i=>s(g(i)*3),border:"none",outline:"none",color:i=>l(i,"shift-9"),backgroundColor:i=>l(i,"inherit"),"&:hover:not([disabled]):not([aria-current=true])":{backgroundColor:i=>l(i,"shift-2")},"&[aria-current=true]":{backgroundColor:i=>l(i,"shift-3",t),color:i=>l(i,"shift-10")},"&:focus-visible":{outline:i=>`${s(.5)} solid ${l(i,"shift-6",t)}`,outlineOffset:`-${s(.5)}`}}}}function Gr(e){return{_onSchedule:(t,r)=>{k(r,{_context:{form:e}})}}}function Yr(e,t){return{_onInsert:r=>{let i=r.getContext("form").setField(e,void 0,t),n=r.tagName,a=r.attributes.get("type");["input","select","textarea"].includes(n)||console.warn('"field" patch must use input, select, or textarea tag');let c={onBlur:()=>i.setTouched(),ariaInvalid:m=>!!i.message("error",m)||void 0,dataStatus:m=>i.status(m)};n==="input"&&a==="checkbox"?(c.checked=i.value(),c.onChange=m=>i.setValue(m.target.checked)):n==="input"&&a==="radio"?c.onChange=m=>i.setValue(m.target.value):n==="select"?(c.value=i.value(),c.onChange=m=>i.setValue(m.target.value)):n==="textarea"?(c.value=i.value(),c.onInput=m=>i.setValue(m.target.value)):(c.value=i.value(),c.onInput=m=>i.setValue(m.target.value)),r.merge(c)}}}function Xr(e){return!!e&&typeof e.then=="function"}var _e=class{constructor(t,r){this._notifier=new se;this._messages={};this._touched=!1;this._pending=!1;this._validationToken=0;this._value=t,this._initValue=t,this._validator=r,r&&this.validate()}value(t){return t&&this._notifier.addListener("value",t),this._value}setValue(t){this._value=t,this._notifier.notify("value",t),this._notifier.notify("dirty",t!==this._initValue),this.validate()}dirty(t){return t&&this._notifier.addListener("dirty",t),this._value!==this._initValue}touched(t){return t&&this._notifier.addListener("touched",t),this._touched}setTouched(){this._touched||(this._touched=!0,this._notifier.notify("touched",!0))}configure(t,r){let o=!1;t!==void 0&&this._value===void 0&&this._initValue===void 0&&(this._value=t,this._initValue=t,this._notifier.notify("value",t),this._notifier.notify("dirty",!1),o=!0),r!==void 0&&r!==this._validator&&(this._validator=r,o=!0),o&&this.validate()}message(t,r){return r&&this._notifier.addListener(t,r),this._messages[t]}status(t){return t&&this._notifier.addListener("status",t),He(this._messages)}setMessages(t){let r=this._messages;this._messages=t;for(let o of["error","warning","success"])r[o]!==t[o]&&this._notifier.notify(o,t[o]);He(r)!==He(t)&&this._notifier.notify("status",He(t))}reset(){this._value=this._initValue,this._touched=!1,this._notifier.notify("value",this._value),this._notifier.notify("dirty",!1),this._notifier.notify("touched",!1),this.setMessages({}),this.validate()}validate(){let t=++this._validationToken;if(!this._validator){this._pending=!1,this.setMessages({});return}try{let r=this._validator(this._value);Xr(r)?(this._pending=!0,Promise.resolve(r).then(o=>{t===this._validationToken&&(this._pending=!1,this.setMessages(o!=null?o:{}))}).catch(o=>{t===this._validationToken&&(this._pending=!1,console.error(o))})):(this._pending=!1,this.setMessages(r!=null?r:{}))}catch(r){t===this._validationToken&&(this._pending=!1),console.error(r)}}_dispose(){this._validationToken+=1,this._pending=!1,this._notifier._dispose()}};function He(e){if(e.error)return"error";if(e.warning)return"warning";if(e.success)return"success"}var ut=class{constructor(){this.fields=new Map}setField(t,r,o){let i=this.fields.get(t);return i?i.configure(r,o):(i=new _e(r,o),this.fields.set(t,i)),i}getField(t){return this.setField(t)}removeField(t){var r;(r=this.fields.get(t))==null||r._dispose(),this.fields.delete(t)}get valid(){for(let t of this.fields.values())if(t._pending||t._messages.error)return!1;return!0}reset(){for(let t of this.fields.values())t.reset()}snapshot(){let t={};for(let[r,o]of this.fields)Jr(t,r,o._value);return t}_dispose(){for(let t of this.fields.values())t._dispose();this.fields.clear()}};function Jr(e,t,r){let o=t.split("."),i=e;for(let n=0;n<o.length-1;n++){let a=o[n];i[a]==null&&(i[a]=isNaN(Number(o[n+1]))?{}:[]),i=i[a]}i[o[o.length-1]]=r}return Eo(Zr);})();
|
|
5
|
+
`)}function Uo(e){var t;if(typeof document!="undefined")if(e){e.textContent=Xe();return}else e=(t=document.getElementById("domphy-themes"))!=null?t:Object.assign(document.createElement("style"),{id:"domphy-themes"}),e.textContent=Xe(),document.head.appendChild(e)}function s(e){return e/4+"em"}function et(e){let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataTheme"));)t=t.parent;let r="light";return t&&t.attributes&&t.attributes.has("dataTheme")&&(r=t.attributes.get("dataTheme"),typeof e=="function"&&t.attributes.addListener("dataTheme",e)),r}var Je=["inherit"];[...Array(8).keys()].forEach(e=>{Je.push(`decrease-${e}`),Je.push(`increase-${e}`)});function Mt(e,t="inherit"){if(!Je.includes(t))throw Error(`size name "${t}" invalid`);let r;if(t=="inherit")r=e;else if(t!=null&&t.startsWith("increase-")){let o=parseInt(t.replace("increase-",""),10);r=e+o}else if(t!=null&&t.startsWith("decrease-")){let o=parseInt(t.replace("decrease-",""),10);r=e-o}else r=e;return Math.max(0,Math.min(8,r))}function Ko(e){if(!e)return 2;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataSize"));)t=t.parent;let r=2;return t&&t.attributes&&t.attributes.has("dataSize")&&(r=Mt(r,t.attributes.get("dataSize")),typeof e=="function"&&t.attributes.addListener("dataSize",e)),r}function p(e,t="inherit"){let r=Mt(Ko(e),t);return Ie().fontSizes[r]}var Ze=["inherit"];[...Array(5).keys()].forEach(e=>{Ze.push(`decrease-${e}`),Ze.push(`increase-${e}`)});function qo(e,t="inherit"){if(!Ze.includes(t))throw Error(`density name "${t}" invalid`);let r;if(t=="inherit")r=e;else if(t!=null&&t.startsWith("increase-")){let o=parseInt(t.replace("increase-",""),10);r=e+o}else if(t!=null&&t.startsWith("decrease-")){let o=parseInt(t.replace("decrease-",""),10);r=e-o}else r=e;return Math.max(0,Math.min(4,r))}function Go(e){if(!e)return 2;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataDensity"));)t=t.parent;let r=2;return t&&t.attributes&&t.attributes.has("dataDensity")&&(r=qo(r,t.attributes.get("dataDensity")),typeof e=="function"&&t.attributes.addListener("dataDensity",e)),r}function g(e){let t=Go(e);return be(e?et(e):"light").densities[t]}var Q=ye.colors.neutral.length,Le=["inherit","base"];[...Array(Q).keys()].forEach(e=>{Le.push(`decrease-${e}`),Le.push(`increase-${e}`),Le.push(`shift-${e}`)});function Lt(e,t){if(e<0||e>Q-1)return e;let r=e+t;return r=Math.max(0,Math.min(Q-1,r)),r}function Yo(e,t){if(e<0||e>Q-1)return e;let r=Math.floor((Q-1)/2),o=e<=r?e+t:e-t;return o=o<0||o>Q-1?-o:o,o=Math.max(0,Math.min(Q-1,o)),o}function tt(e,t="inherit"){if(typeof t=="number")return t;if(t=="inherit")return e;if(!Le.includes(t))throw Error(`tone name "${t}" invalid`);if(t.startsWith("increase-")){let r=parseInt(t.replace("increase-",""),10);return Lt(e,r)}else if(t.startsWith("decrease-")){let r=parseInt(t.replace("decrease-",""),10);return Lt(e,-r)}else if(t.startsWith("shift-")){let r=parseInt(t.replace("shift-",""),10);return Yo(e,r)}else return e}function Xo(e){if(!e)return 0;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataTone"));)t=t.parent;let r=0;return t&&t.attributes&&t.attributes.has("dataTone")&&(r=tt(r,t.attributes.get("dataTone")),typeof e=="function"&&t.attributes.addListener("dataTone",e)),r}function Jo(e,t="inherit"){return tt(Xo(e),t)}function l(e,t="inherit",r="inherit"){let o=r=="inherit"?"neutral":r;if(!e)return Ie()[o][tt(0,t)];let i;return t=="base"?i=be(et(e)).baseTones[o]:i=Jo(e,t),Ie()[o][i]}var Fe={};Re(Fe,{FieldState:()=>_e,FormState:()=>ut,abbreviation:()=>Zo,alert:()=>mn,avatar:()=>un,badge:()=>fn,blockquote:()=>Fn,breadcrumb:()=>dn,breadcrumbEllipsis:()=>hn,button:()=>jn,buttonSwitch:()=>kr,card:()=>Qo,code:()=>Un,combobox:()=>Hn,command:()=>nn,commandItem:()=>an,commandSearch:()=>rn,descriptionList:()=>qn,details:()=>Kn,dialog:()=>Gn,divider:()=>Ar,drawer:()=>Nr,emphasis:()=>Yn,field:()=>Yr,figure:()=>Xn,form:()=>Gr,formGroup:()=>Jn,heading:()=>Qn,horizontalRule:()=>er,icon:()=>or,image:()=>tr,inputCheckbox:()=>Wn,inputColor:()=>nr,inputDateTime:()=>rr,inputFile:()=>ir,inputNumber:()=>cr,inputOTP:()=>cn,inputRadio:()=>yr,inputRange:()=>sr,inputSearch:()=>ar,inputSwitch:()=>Er,inputText:()=>lr,keyboard:()=>mr,label:()=>ur,link:()=>fr,mark:()=>dr,menu:()=>Kr,menuItem:()=>qr,orderedList:()=>Ir,pagination:()=>Mr,paragraph:()=>hr,popover:()=>Dr,popoverArrow:()=>ct,preformated:()=>pr,progress:()=>gr,select:()=>br,selectBox:()=>wr,selectItem:()=>Cr,selectList:()=>xr,skeleton:()=>vr,small:()=>Tr,spinner:()=>Sr,splitter:()=>en,splitterHandle:()=>on,splitterPanel:()=>tn,strong:()=>_r,subscript:()=>Or,superscript:()=>Pr,tab:()=>Wr,tabPanel:()=>Ur,table:()=>Rr,tabs:()=>jr,tag:()=>ve,textarea:()=>$r,toast:()=>Br,toggle:()=>ln,toggleGroup:()=>sn,tooltip:()=>Hr,transitionGroup:()=>Fr,unorderedList:()=>Lr});function Zo(e={}){var o,i;let t=h((o=e.color)!=null?o:"neutral","color"),r=h((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:n=>{n.tagName!="abbr"&&console.warn('"abbreviation" primitive patch must use abbr tag')},style:{fontSize:n=>p(n),backgroundColor:n=>l(n),color:n=>l(n,"shift-10",t.get(n)),textDecorationLine:"underline",textDecorationStyle:"dotted",textDecorationColor:n=>l(n,"shift-7",t.get(n)),textUnderlineOffset:s(.72),cursor:"help","&:hover":{color:n=>l(n,"shift-11",r.get(n)),textDecorationColor:n=>l(n,"shift-9",r.get(n))}}}}function Qo(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{style:{display:"grid",gridTemplateColumns:"1fr auto",gridTemplateAreas:'"image image" "title aside" "desc aside" "content content" "footer footer"',borderRadius:o=>s(g(o)*2),backgroundColor:o=>l(o,"inherit",t.get(o)),color:o=>l(o,"shift-10",t.get(o)),outline:o=>`1px solid ${l(o,"shift-4",t.get(o))}`,outlineOffset:"-1px",overflow:"hidden","& > img":{gridArea:"image",width:"100%",height:"auto",display:"block"},"& > :is(h1,h2,h3,h4,h5,h6)":{gridArea:"title",paddingBlock:o=>s(g(o)*2),paddingInline:o=>s(g(o)*4),fontWeight:"600",margin:0},"& > p":{gridArea:"desc",paddingInline:o=>s(g(o)*4),color:o=>l(o,"shift-9",t.get(o)),margin:0},"& > aside":{gridArea:"aside",alignSelf:"center",padding:o=>s(g(o)*2),height:"auto"},"& > div":{gridArea:"content",padding:o=>s(g(o)*4),color:o=>l(o,"shift-10",t.get(o))},"& > footer":{gridArea:"footer",display:"flex",gap:s(2),paddingBlock:o=>s(g(o)*2),paddingInline:o=>s(g(o)*4),borderTop:o=>`1px solid ${l(o,"shift-3",t.get(o))}`}}}}function en(e={}){let{direction:t="horizontal",defaultSize:r=50,min:o=10,max:i=90}=e;return{_onSchedule:(n,a)=>{k(a,{_context:{splitter:{direction:t,size:h(r),min:o,max:i}}})},style:{display:"flex",flexDirection:t==="horizontal"?"row":"column",overflow:"hidden"}}}function tn(){return{_onMount:e=>{let t=e.getContext("splitter"),r=e.domElement,o=t.direction==="horizontal"?"width":"height";r.style[o]=`${t.size.get()}%`,r.style.flexShrink="0",r.style.overflow="auto";let i=t.size.addListener(n=>{r.style[o]=`${n}%`});e.addHook("Remove",i)}}}function on(){return{_onMount:e=>{let t=e.getContext("splitter"),r=e.domElement,o=t.direction==="horizontal";r.style.cursor=o?"col-resize":"row-resize";let i=n=>{n.preventDefault();let a=r.parentElement,c=u=>{let f=a.getBoundingClientRect(),d=o?(u.clientX-f.left)/f.width*100:(u.clientY-f.top)/f.height*100;t.size.set(Math.min(Math.max(d,t.min),t.max))},m=()=>{document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",m)};document.addEventListener("mousemove",c),document.addEventListener("mouseup",m)};r.addEventListener("mousedown",i),e.addHook("Remove",()=>r.removeEventListener("mousedown",i))},style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:e=>l(e,"shift-2"),"&:hover":{backgroundColor:e=>l(e,"shift-3")},"&::after":{content:'""',borderRadius:s(999),backgroundColor:e=>l(e,"shift-4")}}}}function nn(){return{_onSchedule:(e,t)=>{k(t,{_context:{command:{query:h("")}}})},style:{display:"flex",flexDirection:"column",overflow:"hidden"}}}function rn(e={}){let{color:t="neutral",accentColor:r="primary"}=e;return{_onInsert:o=>{o.tagName!=="input"&&console.warn('"commandSearch" patch must use input tag')},_onMount:o=>{let i=o.getContext("command"),n=o.domElement,a=()=>i.query.set(n.value);n.addEventListener("input",a),o.addHook("Remove",()=>n.removeEventListener("input",a))},style:{fontFamily:"inherit",fontSize:o=>p(o,"inherit"),paddingInline:o=>s(g(o)*3),paddingBlock:o=>s(g(o)*2),border:"none",borderBottom:o=>`1px solid ${l(o,"shift-3",t)}`,outline:"none",color:o=>l(o,"shift-10",t),backgroundColor:o=>l(o,"inherit",t),"&::placeholder":{color:o=>l(o,"shift-7")},"&:focus-visible":{borderBottomColor:o=>l(o,"shift-6",r)}}}}function an(e={}){let{color:t="neutral",accentColor:r="primary"}=e;return{role:"option",_onMount:o=>{var m,u;let i=o.getContext("command"),n=o.domElement,a=(u=(m=n.textContent)==null?void 0:m.toLowerCase())!=null?u:"",c=i.query.addListener(f=>{n.hidden=f.length>0&&!a.includes(f.toLowerCase())});o.addHook("Remove",c)},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:o=>p(o,"inherit"),height:o=>s(6+g(o)*2),paddingInline:o=>s(g(o)*3),border:"none",outline:"none",color:o=>l(o,"shift-9",t),backgroundColor:o=>l(o,"inherit",t),"&:hover:not([disabled])":{backgroundColor:o=>l(o,"shift-2",t)},"&:focus-visible":{outline:o=>`${s(.5)} solid ${l(o,"shift-6",r)}`,outlineOffset:`-${s(.5)}`}}}}function ln(e={}){var o,i;let t=h((o=e.color)!=null?o:"neutral","color"),r=h((i=e.accentColor)!=null?i:"primary","accentColor");return{role:"button",_onInsert:n=>{var f;n.tagName!=="button"&&console.warn('"toggle" patch must use button tag');let a=n.getContext("toggleGroup"),m=((f=n.parent)==null?void 0:f.children.items).filter(d=>d.type==="ElementNode"&&d.attributes.get("role")==="button"),u=n.key!==void 0?String(n.key):String(m.findIndex(d=>d===n));n.attributes.set("ariaPressed",d=>{let y=a.value.get(d);return Array.isArray(y)?y.includes(u):y===u}),n.addEvent("click",()=>{let d=a.value.get();if(a.multiple){let y=Array.isArray(d)?[...d]:[];a.value.set(y.includes(u)?y.filter(b=>b!==u):[...y,u])}else a.value.set(d===u?"":u)})},style:{cursor:"pointer",fontSize:n=>p(n,"inherit"),height:s(6),paddingBlock:s(1),paddingInline:s(2),border:"none",borderRadius:s(1),color:n=>l(n,"shift-9",t.get(n)),backgroundColor:n=>l(n,"inherit",t.get(n)),transition:"background-color 300ms ease","&:hover:not([disabled])":{backgroundColor:n=>l(n,"shift-2",t.get(n))},"&[aria-pressed=true]":{backgroundColor:n=>l(n,"shift-3",r.get(n)),color:n=>l(n,"shift-12",r.get(n))},"&:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`,outlineOffset:`-${s(.5)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function sn(e={}){var o;let{multiple:t=!1,color:r="neutral"}=e;return{role:"group",_context:{toggleGroup:{value:h((o=e.value)!=null?o:t?[]:""),multiple:t}},style:{display:"flex",paddingBlock:s(1),paddingInline:s(1),gap:s(1),borderRadius:s(2),fontSize:i=>p(i,"inherit"),backgroundColor:i=>l(i,"inherit",r),outline:i=>`1px solid ${l(i,"shift-3",r)}`,outlineOffset:"-1px"}}}function cn(){return{style:{display:"flex",alignItems:"center",gap:s(2),"& > *":{minWidth:s(9)+"!important"}},_onMount:e=>{let t=e.domElement,r=()=>Array.from(t.querySelectorAll("input")),o=a=>{let c=r(),m=a.target,u=c.indexOf(m);m.value&&u<c.length-1&&c[u+1].focus()},i=a=>{let c=r(),m=a.target,u=c.indexOf(m);a.key==="Backspace"&&!m.value&&u>0&&c[u-1].focus(),a.key==="ArrowLeft"&&u>0&&c[u-1].focus(),a.key==="ArrowRight"&&u<c.length-1&&c[u+1].focus()},n=a=>{var d,y,b;a.preventDefault();let c=(y=(d=a.clipboardData)==null?void 0:d.getData("text"))!=null?y:"",m=r(),u=m.indexOf(a.target);[...c].forEach((v,x)=>{m[u+x]&&(m[u+x].value=v)});let f=Math.min(u+c.length-1,m.length-1);(b=m[f])==null||b.focus()};t.addEventListener("input",o),t.addEventListener("keydown",i),t.addEventListener("paste",n),e.addHook("Remove",()=>{t.removeEventListener("input",o),t.removeEventListener("keydown",i),t.removeEventListener("paste",n)})}}}function mn(e={}){var r;let t=h((r=e.color)!=null?r:"primary","color");return{role:"alert",dataTone:"shift-2",style:{display:"flex",alignItems:"flex-start",gap:s(3),paddingBlock:o=>s(g(o)*2),paddingInline:o=>s(g(o)*4),boxShadow:o=>`inset ${s(1)} 0 0 0 ${l(o,"shift-8",t.get(o))}`,backgroundColor:o=>l(o,"inherit",t.get(o)),color:o=>l(o,"shift-10",t.get(o)),fontSize:o=>p(o,"inherit")}}}function un(e={}){var r;let t=h((r=e.color)!=null?r:"primary","color");return{dataTone:"shift-2",style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",borderRadius:"50%",flexShrink:0,width:s(9),height:s(9),fontSize:o=>p(o,"inherit"),fontWeight:"600",userSelect:"none",backgroundColor:o=>l(o,"inherit",t.get(o)),color:o=>l(o,"shift-11",t.get(o)),"& img":{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}}}}function fn(e={}){var i;let{label:t=999}=e,r=h(t),o=h((i=e.color)!=null?i:"danger","color");return{style:{position:"relative","&::after":{content:n=>`"${r.get(n)}"`,position:"absolute",top:0,right:0,transform:"translate(50%,-50%)",paddingInline:s(1),minWidth:s(6),display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:n=>p(n,"decrease-1"),borderRadius:s(999),backgroundColor:n=>l(n,"shift-9",o.get(n)),color:n=>l(n,"shift-0",o.get(n))}}}}function dn(e={}){var o;let{separator:t="/"}=e,r=h((o=e.color)!=null?o:"neutral","color");return{_onInsert:i=>{i.tagName!=="nav"&&console.warn('"breadcrumb" patch must use nav tag')},ariaLabel:"breadcrumb",style:{display:"flex",alignItems:"center",flexWrap:"wrap",fontSize:i=>p(i,"inherit"),gap:s(1),color:i=>l(i,"shift-9",r.get(i)),backgroundColor:i=>l(i,"inherit",r.get(i)),"& > *":{display:"inline-flex",alignItems:"center",color:i=>l(i,"shift-8",r.get(i))},"& > *:not(:last-child)::after":{content:`"${t}"`,color:i=>l(i,"shift-4",r.get(i)),paddingInlineStart:s(1)},"& > [aria-current=page]":{color:i=>l(i,"shift-10",r.get(i)),pointerEvents:"none"}}}}function hn(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="button"&&console.warn('"breadcrumbEllipsis" patch must use button tag')},ariaLabel:"More breadcrumb items",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:o=>p(o,"inherit"),paddingInline:s(1),border:"none",background:"none",cursor:"pointer",color:o=>l(o,"shift-8",t.get(o)),borderRadius:s(1),"&:hover":{color:o=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"shift-2",t.get(o))},"&:focus-visible":{outline:o=>`${s(.5)} solid ${l(o,"shift-6",t.get(o))}`,outlineOffset:s(.5)}}}}var pn='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6.707 5.293l5.293 5.292l5.293 -5.292a1 1 0 0 1 1.414 1.414l-5.292 5.293l5.292 5.293a1 1 0 0 1 -1.414 1.414l-5.293 -5.292l-5.293 5.292a1 1 0 1 1 -1.414 -1.414l5.292 -5.293l-5.292 -5.293a1 1 0 0 1 1.414 -1.414" /></svg>';function ve(e={}){var o;let{removable:t=!1}=e,r=h((o=e.color)!=null?o:"neutral","color");return{dataTone:"shift-2",_onInit:i=>{let n={span:pn,onClick:a=>{a.stopPropagation(),i.remove()},style:{display:"inline-flex",alignItems:"center",cursor:"pointer",borderRadius:s(1),width:s(4),height:s(4),flexShrink:0,"&:hover":{backgroundColor:a=>l(a,"shift-4",r.get(a))}}};t&&i.children.insert(n)},style:{display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",userSelect:"none",height:s(6),paddingBlock:"0px",borderRadius:s(1),paddingInlineStart:s(2),paddingInlineEnd:t?s(1):s(2),gap:s(2),fontSize:i=>p(i,"inherit"),backgroundColor:i=>l(i,"inherit",r.get(i)),color:i=>l(i,"shift-9",r.get(i)),border:"none",outlineOffset:"-1px",outline:i=>`1px solid ${l(i,"shift-4",r.get(i))}`}}}var ue=Math.min,H=Math.max,xe=Math.round,Ce=Math.floor,V=e=>({x:e,y:e}),gn={left:"right",right:"left",bottom:"top",top:"bottom"};function ot(e,t,r){return H(e,ue(t,r))}function we(e,t){return typeof e=="function"?e(t):e}function U(e){return e.split("-")[0]}function Ee(e){return e.split("-")[1]}function nt(e){return e==="x"?"y":"x"}function rt(e){return e==="y"?"height":"width"}function F(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function it(e){return nt(F(e))}function Nt(e,t,r){r===void 0&&(r=!1);let o=Ee(e),i=it(e),n=rt(i),a=i==="x"?o===(r?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[n]>t.floating[n]&&(a=Se(a)),[a,Se(a)]}function Dt(e){let t=Se(e);return[Me(e),t,Me(t)]}function Me(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var At=["left","right"],Vt=["right","left"],yn=["top","bottom"],bn=["bottom","top"];function vn(e,t,r){switch(e){case"top":case"bottom":return r?t?Vt:At:t?At:Vt;case"left":case"right":return t?yn:bn;default:return[]}}function Bt(e,t,r,o){let i=Ee(e),n=vn(U(e),r==="start",o);return i&&(n=n.map(a=>a+"-"+i),t&&(n=n.concat(n.map(Me)))),n}function Se(e){let t=U(e);return gn[t]+e.slice(t.length)}function Sn(e){return P({top:0,right:0,bottom:0,left:0},e)}function Ht(e){return typeof e!="number"?Sn(e):{top:e,right:e,bottom:e,left:e}}function ee(e){let{x:t,y:r,width:o,height:i}=e;return{width:o,height:i,top:r,left:t,right:t+o,bottom:r+i,x:t,y:r}}function Ft(e,t,r){let{reference:o,floating:i}=e,n=F(t),a=it(t),c=rt(a),m=U(t),u=n==="y",f=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,y=o[c]/2-i[c]/2,b;switch(m){case"top":b={x:f,y:o.y-i.height};break;case"bottom":b={x:f,y:o.y+o.height};break;case"right":b={x:o.x+o.width,y:d};break;case"left":b={x:o.x-i.width,y:d};break;default:b={x:o.x,y:o.y}}switch(Ee(t)){case"start":b[a]-=y*(r&&u?-1:1);break;case"end":b[a]+=y*(r&&u?-1:1);break}return b}function jt(e,t){return B(this,null,function*(){var r;t===void 0&&(t={});let{x:o,y:i,platform:n,rects:a,elements:c,strategy:m}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:y=!1,padding:b=0}=we(t,e),v=Ht(b),S=c[y?d==="floating"?"reference":"floating":d],C=ee(yield n.getClippingRect({element:(r=yield n.isElement==null?void 0:n.isElement(S))==null||r?S:S.contextElement||(yield n.getDocumentElement==null?void 0:n.getDocumentElement(c.floating)),boundary:u,rootBoundary:f,strategy:m})),w=d==="floating"?{x:o,y:i,width:a.floating.width,height:a.floating.height}:a.reference,T=yield n.getOffsetParent==null?void 0:n.getOffsetParent(c.floating),E=(yield n.isElement==null?void 0:n.isElement(T))?(yield n.getScale==null?void 0:n.getScale(T))||{x:1,y:1}:{x:1,y:1},_=ee(n.convertOffsetParentRelativeRectToViewportRelativeRect?yield n.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:w,offsetParent:T,strategy:m}):w);return{top:(C.top-_.top+v.top)/E.y,bottom:(_.bottom-C.bottom+v.bottom)/E.y,left:(C.left-_.left+v.left)/E.x,right:(_.right-C.right+v.right)/E.x}})}var xn=50,Wt=(e,t,r)=>B(null,null,function*(){let{placement:o="bottom",strategy:i="absolute",middleware:n=[],platform:a}=r,c=a.detectOverflow?a:A(P({},a),{detectOverflow:jt}),m=yield a.isRTL==null?void 0:a.isRTL(t),u=yield a.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:d}=Ft(u,o,m),y=o,b=0,v={};for(let x=0;x<n.length;x++){let S=n[x];if(!S)continue;let{name:C,fn:w}=S,{x:T,y:E,data:_,reset:O}=yield w({x:f,y:d,initialPlacement:o,placement:y,strategy:i,middlewareData:v,rects:u,platform:c,elements:{reference:e,floating:t}});f=T!=null?T:f,d=E!=null?E:d,v[C]=P(P({},v[C]),_),O&&b<xn&&(b++,typeof O=="object"&&(O.placement&&(y=O.placement),O.rects&&(u=O.rects===!0?yield a.getElementRects({reference:e,floating:t,strategy:i}):O.rects),{x:f,y:d}=Ft(u,y,m)),x=-1)}return{x:f,y:d,placement:y,strategy:i,middlewareData:v}});var Ut=function(e){return e===void 0&&(e={}),{name:"flip",options:e,fn(r){return B(this,null,function*(){var o,i;let{placement:n,middlewareData:a,rects:c,initialPlacement:m,platform:u,elements:f}=r,gt=we(e,r),{mainAxis:d=!0,crossAxis:y=!0,fallbackPlacements:b,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:S=!0}=gt,C=Ue(gt,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((o=a.arrow)!=null&&o.alignmentOffset)return{};let w=U(n),T=F(m),E=U(m)===m,_=yield u.isRTL==null?void 0:u.isRTL(f.floating),O=b||(E||!S?[Se(m)]:Dt(m)),$=x!=="none";!b&&$&&O.push(...Bt(m,S,x,_));let ft=[m,...O],ie=yield u.detectOverflow(r,C),ae=[],le=((i=a.flip)==null?void 0:i.overflows)||[];if(d&&ae.push(ie[w]),y){let q=Nt(n,c,_);ae.push(ie[q[0]],ie[q[1]])}if(le=[...le,{placement:n,overflows:ae}],!ae.every(q=>q<=0)){var dt,ht;let q=(((dt=a.flip)==null?void 0:dt.index)||0)+1,je=ft[q];if(je&&(!(y==="alignment"?T!==F(je):!1)||le.every(M=>F(M.placement)===T?M.overflows[0]>0:!0)))return{data:{index:q,overflows:le},reset:{placement:je}};let pe=(ht=le.filter(G=>G.overflows[0]<=0).sort((G,M)=>G.overflows[1]-M.overflows[1])[0])==null?void 0:ht.placement;if(!pe)switch(v){case"bestFit":{var pt;let G=(pt=le.filter(M=>{if($){let W=F(M.placement);return W===T||W==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(W=>W>0).reduce((W,bo)=>W+bo,0)]).sort((M,W)=>M[1]-W[1])[0])==null?void 0:pt[0];G&&(pe=G);break}case"initialPlacement":pe=m;break}if(n!==pe)return{reset:{placement:pe}}}return{}})}}};var Cn=new Set(["left","top"]);function wn(e,t){return B(this,null,function*(){let{placement:r,platform:o,elements:i}=e,n=yield o.isRTL==null?void 0:o.isRTL(i.floating),a=U(r),c=Ee(r),m=F(r)==="y",u=Cn.has(a)?-1:1,f=n&&m?-1:1,d=we(t,e),{mainAxis:y,crossAxis:b,alignmentAxis:v}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return c&&typeof v=="number"&&(b=c==="end"?v*-1:v),m?{x:b*f,y:y*u}:{x:y*u,y:b*f}})}var Kt=function(e){return e===void 0&&(e=0),{name:"offset",options:e,fn(r){return B(this,null,function*(){var o,i;let{x:n,y:a,placement:c,middlewareData:m}=r,u=yield wn(r,e);return c===((o=m.offset)==null?void 0:o.placement)&&(i=m.arrow)!=null&&i.alignmentOffset?{}:{x:n+u.x,y:a+u.y,data:A(P({},u),{placement:c})}})}}},qt=function(e){return e===void 0&&(e={}),{name:"shift",options:e,fn(r){return B(this,null,function*(){let{x:o,y:i,placement:n,platform:a}=r,w=we(e,r),{mainAxis:c=!0,crossAxis:m=!1,limiter:u={fn:T=>{let{x:E,y:_}=T;return{x:E,y:_}}}}=w,f=Ue(w,["mainAxis","crossAxis","limiter"]),d={x:o,y:i},y=yield a.detectOverflow(r,f),b=F(U(n)),v=nt(b),x=d[v],S=d[b];if(c){let T=v==="y"?"top":"left",E=v==="y"?"bottom":"right",_=x+y[T],O=x-y[E];x=ot(_,x,O)}if(m){let T=b==="y"?"top":"left",E=b==="y"?"bottom":"right",_=S+y[T],O=S-y[E];S=ot(_,S,O)}let C=u.fn(A(P({},r),{[v]:x,[b]:S}));return A(P({},C),{data:{x:C.x-o,y:C.y-i,enabled:{[v]:c,[b]:m}}})})}}};function Ae(){return typeof window!="undefined"}function oe(e){return Yt(e)?(e.nodeName||"").toLowerCase():"#document"}function R(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function N(e){var t;return(t=(Yt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Yt(e){return Ae()?e instanceof Node||e instanceof R(e).Node:!1}function I(e){return Ae()?e instanceof Element||e instanceof R(e).Element:!1}function D(e){return Ae()?e instanceof HTMLElement||e instanceof R(e).HTMLElement:!1}function Gt(e){return!Ae()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof R(e).ShadowRoot}function de(e){let{overflow:t,overflowX:r,overflowY:o,display:i}=z(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+r)&&i!=="inline"&&i!=="contents"}function Xt(e){return/^(table|td|th)$/.test(oe(e))}function ke(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}var En=/transform|translate|scale|rotate|perspective|filter/,kn=/paint|layout|strict|content/,te=e=>!!e&&e!=="none",at;function Ve(e){let t=I(e)?z(e):e;return te(t.transform)||te(t.translate)||te(t.scale)||te(t.rotate)||te(t.perspective)||!Ne()&&(te(t.backdropFilter)||te(t.filter))||En.test(t.willChange||"")||kn.test(t.contain||"")}function Jt(e){let t=j(e);for(;D(t)&&!ne(t);){if(Ve(t))return t;if(ke(t))return null;t=j(t)}return null}function Ne(){return at==null&&(at=typeof CSS!="undefined"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),at}function ne(e){return/^(html|body|#document)$/.test(oe(e))}function z(e){return R(e).getComputedStyle(e)}function Te(e){return I(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function j(e){if(oe(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Gt(e)&&e.host||N(e);return Gt(t)?t.host:t}function Zt(e){let t=j(e);return ne(t)?e.ownerDocument?e.ownerDocument.body:e.body:D(t)&&de(t)?t:Zt(t)}function fe(e,t,r){var o;t===void 0&&(t=[]),r===void 0&&(r=!0);let i=Zt(e),n=i===((o=e.ownerDocument)==null?void 0:o.body),a=R(i);if(n){let c=De(a);return t.concat(a,a.visualViewport||[],de(i)?i:[],c&&r?fe(c):[])}else return t.concat(i,fe(i,[],r))}function De(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function oo(e){let t=z(e),r=parseFloat(t.width)||0,o=parseFloat(t.height)||0,i=D(e),n=i?e.offsetWidth:r,a=i?e.offsetHeight:o,c=xe(r)!==n||xe(o)!==a;return c&&(r=n,o=a),{width:r,height:o,$:c}}function st(e){return I(e)?e:e.contextElement}function he(e){let t=st(e);if(!D(t))return V(1);let r=t.getBoundingClientRect(),{width:o,height:i,$:n}=oo(t),a=(n?xe(r.width):r.width)/o,c=(n?xe(r.height):r.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}var Tn=V(0);function no(e){let t=R(e);return!Ne()||!t.visualViewport?Tn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _n(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==R(e)?!1:t}function re(e,t,r,o){t===void 0&&(t=!1),r===void 0&&(r=!1);let i=e.getBoundingClientRect(),n=st(e),a=V(1);t&&(o?I(o)&&(a=he(o)):a=he(e));let c=_n(n,r,o)?no(n):V(0),m=(i.left+c.x)/a.x,u=(i.top+c.y)/a.y,f=i.width/a.x,d=i.height/a.y;if(n){let y=R(n),b=o&&I(o)?R(o):o,v=y,x=De(v);for(;x&&o&&b!==v;){let S=he(x),C=x.getBoundingClientRect(),w=z(x),T=C.left+(x.clientLeft+parseFloat(w.paddingLeft))*S.x,E=C.top+(x.clientTop+parseFloat(w.paddingTop))*S.y;m*=S.x,u*=S.y,f*=S.x,d*=S.y,m+=T,u+=E,v=R(x),x=De(v)}}return ee({width:f,height:d,x:m,y:u})}function Be(e,t){let r=Te(e).scrollLeft;return t?t.left+r:re(N(e)).left+r}function ro(e,t){let r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-Be(e,r),i=r.top+t.scrollTop;return{x:o,y:i}}function On(e){let{elements:t,rect:r,offsetParent:o,strategy:i}=e,n=i==="fixed",a=N(o),c=t?ke(t.floating):!1;if(o===a||c&&n)return r;let m={scrollLeft:0,scrollTop:0},u=V(1),f=V(0),d=D(o);if((d||!d&&!n)&&((oe(o)!=="body"||de(a))&&(m=Te(o)),d)){let b=re(o);u=he(o),f.x=b.x+o.clientLeft,f.y=b.y+o.clientTop}let y=a&&!d&&!n?ro(a,m):V(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-m.scrollLeft*u.x+f.x+y.x,y:r.y*u.y-m.scrollTop*u.y+f.y+y.y}}function Pn(e){return Array.from(e.getClientRects())}function Rn(e){let t=N(e),r=Te(e),o=e.ownerDocument.body,i=H(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),n=H(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight),a=-r.scrollLeft+Be(e),c=-r.scrollTop;return z(o).direction==="rtl"&&(a+=H(t.clientWidth,o.clientWidth)-i),{width:i,height:n,x:a,y:c}}var Qt=25;function $n(e,t){let r=R(e),o=N(e),i=r.visualViewport,n=o.clientWidth,a=o.clientHeight,c=0,m=0;if(i){n=i.width,a=i.height;let f=Ne();(!f||f&&t==="fixed")&&(c=i.offsetLeft,m=i.offsetTop)}let u=Be(o);if(u<=0){let f=o.ownerDocument,d=f.body,y=getComputedStyle(d),b=f.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,v=Math.abs(o.clientWidth-d.clientWidth-b);v<=Qt&&(n-=v)}else u<=Qt&&(n+=u);return{width:n,height:a,x:c,y:m}}function Ln(e,t){let r=re(e,!0,t==="fixed"),o=r.top+e.clientTop,i=r.left+e.clientLeft,n=D(e)?he(e):V(1),a=e.clientWidth*n.x,c=e.clientHeight*n.y,m=i*n.x,u=o*n.y;return{width:a,height:c,x:m,y:u}}function eo(e,t,r){let o;if(t==="viewport")o=$n(e,r);else if(t==="document")o=Rn(N(e));else if(I(t))o=Ln(t,r);else{let i=no(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return ee(o)}function io(e,t){let r=j(e);return r===t||!I(r)||ne(r)?!1:z(r).position==="fixed"||io(r,t)}function In(e,t){let r=t.get(e);if(r)return r;let o=fe(e,[],!1).filter(c=>I(c)&&oe(c)!=="body"),i=null,n=z(e).position==="fixed",a=n?j(e):e;for(;I(a)&&!ne(a);){let c=z(a),m=Ve(a);!m&&c.position==="fixed"&&(i=null),(n?!m&&!i:!m&&c.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||de(a)&&!m&&io(e,a))?o=o.filter(f=>f!==a):i=c,a=j(a)}return t.set(e,o),o}function zn(e){let{element:t,boundary:r,rootBoundary:o,strategy:i}=e,a=[...r==="clippingAncestors"?ke(t)?[]:In(t,this._c):[].concat(r),o],c=eo(t,a[0],i),m=c.top,u=c.right,f=c.bottom,d=c.left;for(let y=1;y<a.length;y++){let b=eo(t,a[y],i);m=H(b.top,m),u=ue(b.right,u),f=ue(b.bottom,f),d=H(b.left,d)}return{width:u-d,height:f-m,x:d,y:m}}function Mn(e){let{width:t,height:r}=oo(e);return{width:t,height:r}}function An(e,t,r){let o=D(t),i=N(t),n=r==="fixed",a=re(e,!0,n,t),c={scrollLeft:0,scrollTop:0},m=V(0);function u(){m.x=Be(i)}if(o||!o&&!n)if((oe(t)!=="body"||de(i))&&(c=Te(t)),o){let b=re(t,!0,n,t);m.x=b.x+t.clientLeft,m.y=b.y+t.clientTop}else i&&u();n&&!o&&i&&u();let f=i&&!o&&!n?ro(i,c):V(0),d=a.left+c.scrollLeft-m.x-f.x,y=a.top+c.scrollTop-m.y-f.y;return{x:d,y,width:a.width,height:a.height}}function lt(e){return z(e).position==="static"}function to(e,t){if(!D(e)||z(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return N(e)===r&&(r=r.ownerDocument.body),r}function ao(e,t){let r=R(e);if(ke(e))return r;if(!D(e)){let i=j(e);for(;i&&!ne(i);){if(I(i)&&!lt(i))return i;i=j(i)}return r}let o=to(e,t);for(;o&&Xt(o)&<(o);)o=to(o,t);return o&&ne(o)&<(o)&&!Ve(o)?r:o||Jt(e)||r}var Vn=function(e){return B(this,null,function*(){let t=this.getOffsetParent||ao,r=this.getDimensions,o=yield r(e.floating);return{reference:An(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}})};function Nn(e){return z(e).direction==="rtl"}var Dn={convertOffsetParentRelativeRectToViewportRelativeRect:On,getDocumentElement:N,getClippingRect:zn,getOffsetParent:ao,getElementRects:Vn,getClientRects:Pn,getDimensions:Mn,getScale:he,isElement:I,isRTL:Nn};function lo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Bn(e,t){let r=null,o,i=N(e);function n(){var c;clearTimeout(o),(c=r)==null||c.disconnect(),r=null}function a(c,m){c===void 0&&(c=!1),m===void 0&&(m=1),n();let u=e.getBoundingClientRect(),{left:f,top:d,width:y,height:b}=u;if(c||t(),!y||!b)return;let v=Ce(d),x=Ce(i.clientWidth-(f+y)),S=Ce(i.clientHeight-(d+b)),C=Ce(f),T={rootMargin:-v+"px "+-x+"px "+-S+"px "+-C+"px",threshold:H(0,ue(1,m))||1},E=!0;function _(O){let $=O[0].intersectionRatio;if($!==m){if(!E)return a();$?a(!1,$):o=setTimeout(()=>{a(!1,1e-7)},1e3)}$===1&&!lo(u,e.getBoundingClientRect())&&a(),E=!1}try{r=new IntersectionObserver(_,A(P({},T),{root:i.ownerDocument}))}catch(O){r=new IntersectionObserver(_,T)}r.observe(e)}return a(!0),n}function so(e,t,r,o){o===void 0&&(o={});let{ancestorScroll:i=!0,ancestorResize:n=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:m=!1}=o,u=st(e),f=i||n?[...u?fe(u):[],...t?fe(t):[]]:[];f.forEach(C=>{i&&C.addEventListener("scroll",r,{passive:!0}),n&&C.addEventListener("resize",r)});let d=u&&c?Bn(u,r):null,y=-1,b=null;a&&(b=new ResizeObserver(C=>{let[w]=C;w&&w.target===u&&b&&t&&(b.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var T;(T=b)==null||T.observe(t)})),r()}),u&&!m&&b.observe(u),t&&b.observe(t));let v,x=m?re(e):null;m&&S();function S(){let C=re(e);x&&!lo(x,C)&&r(),x=C,v=requestAnimationFrame(S)}return r(),()=>{var C;f.forEach(w=>{i&&w.removeEventListener("scroll",r),n&&w.removeEventListener("resize",r)}),d==null||d(),(C=b)==null||C.disconnect(),b=null,m&&cancelAnimationFrame(v)}}var co=Kt;var mo=qt,uo=Ut;var fo=(e,t,r)=>{let o=new Map,i=P({platform:Dn},r),n=A(P({},i.platform),{_c:o});return Wt(e,t,A(P({},i),{platform:n}))};function K(e){let{open:t=!1,placement:r="bottom"}=e,o=null,i=null,n=null,a=null,c=h(t),m=h(r),u=()=>{n&&a&&(i&&i(),i=so(n,a,()=>{fo(n,a,{placement:m.get(),middleware:[co(12),uo(),mo()],strategy:"fixed"}).then(({x,y:S,placement:C})=>{var w;Object.assign(a.style,{left:`${x}px`,top:`${S}px`}),C!==m.get()&&m.set(C),(w=e.onPlacement)==null||w.call(e,n,a,C)})}),c.set(!0))},f=()=>{i&&i(),i=null,c.set(!1)},d=()=>{o&&clearTimeout(o),o=setTimeout(u,100)},y=()=>{o&&clearTimeout(o),o=setTimeout(f,100)},b={style:{position:"fixed",pointerEvents:"auto",visibility:x=>c.get(x)?"visible":"hidden"},_onMount:x=>a=x.domElement,_portal:x=>{let S=x.domElement.querySelector("#domphy-floating");if(!S){let C={div:[],id:"domphy-floating",style:{position:"fixed",inset:0,zIndex:20,pointerEvents:"none"}};S=x.children.insert(C).domElement}return S}};return k(e.content,b),{show:d,hide:y,anchorPartial:{onKeyDown:x=>x.key==="Escape"&&y(),_onSchedule:x=>{let S=null;x.getRoot().addHook("Init",C=>{S=C.children.insert(e.content)}),x.addHook("BeforeRemove",()=>{y(),o&&clearTimeout(o),S&&S.remove()})},_onMount:x=>{n=x.domElement;let S=C=>{if(!c.get()||!n||!a)return;let w=C.target;!n.contains(w)&&!a.contains(w)&&y()};x.getRoot().domElement.addEventListener("click",S),x.addHook("BeforeRemove",()=>x.getRoot().domElement.removeEventListener("click",S))}}}}function Hn(e){let{options:t=[],placement:r="bottom",color:o="neutral",open:i=!1,multiple:n=!1}=e,a=h(e.value),c=h(i),{show:m,hide:u,anchorPartial:f}=K({open:c,placement:r,content:e.content,onPlacement:e.onPlacement}),d={onClick:()=>!n&&u()};k(e.content,d);let y={border:"none",outline:"none",padding:0,margin:0,flex:1,height:s(6),marginInlineStart:s(2),fontSize:S=>p(S,"inherit"),color:S=>l(S,"shift-9",o),backgroundColor:S=>l(S,"inherit",o)},b;e.input?(k(e.input,{onFocus:()=>m(),style:y,_key:"combobox-input"}),b=e.input):b={input:null,onFocus:()=>m(),value:S=>(a.get(S),""),style:y,_key:"combobox-input"};let v={div:S=>{let C=a.get(S),w=Array.isArray(C)?C:[C],E=t.filter(_=>w.includes(_.value)).map(_=>({span:_.label,$:[ve({color:o,removable:!0})],_key:_.value,_onRemove:O=>{let $=a.get(),ie=(Array.isArray($)?$:[$]).filter(ae=>ae!==_.value);n?a.set(ie):a.set(ie[0])}}));return E.push(b),E},style:{display:"flex",flexWrap:"wrap",gap:s(1)}},x={_onInsert:S=>{S.tagName!="div"&&console.warn('"combobox" primitive patch must use div tag')},_onInit:S=>S.children.insert(v),style:{minWidth:s(32),outlineOffset:"-1px",outline:S=>`1px solid ${l(S,"shift-4","neutral")}`,paddingBlock:S=>s(g(S)*1),paddingInline:S=>s(g(S)*1),borderRadius:S=>s(g(S)*1),fontSize:S=>p(S,"inherit"),color:S=>l(S,"shift-9",o),backgroundColor:S=>l(S,"inherit",o)}};return k(f,x),f}function ct(e={}){let{placement:t="bottom-end",color:r="neutral",sideOffset:o=s(6),bordered:i=!0}=e,n=h(t),a={top:"bottom",bottom:"top",left:"right",right:"left","top-start":"bottom-end","top-end":"bottom-start","bottom-start":"top-end","bottom-end":"top-start","left-start":"right-end","left-end":"right-start","right-start":"left-end","right-end":"left-start"},c=h(a[n.get()]);n.addListener(f=>c.set(a[f]));let m=f=>f.includes("start")?o:f.includes("end")?"auto":"50%",u=f=>f.includes("end")?o:f.includes("start")?"auto":"50%";return{style:{fontSize:f=>p(f),backgroundColor:f=>l(f),color:f=>l(f,"shift-9",r),position:"relative","&::after":{content:'""',position:"absolute",width:s(1.5),height:s(1.5),backgroundColor:f=>l(f,"inherit",r),borderWidth:i?"0px":"1px",borderColor:f=>l(f,"inherit",r),borderTopStyle:f=>{let d=c.get(f);return d.includes("top")||d.includes("right")?"solid":"none"},borderBottomStyle:f=>{let d=c.get(f);return d.includes("bottom")||d.includes("left")?"solid":"none"},borderLeftStyle:f=>{let d=c.get(f);return d.includes("top")||d.includes("left")?"solid":"none"},borderRightStyle:f=>{let d=c.get(f);return d.includes("bottom")||d.includes("right")?"solid":"none"},top:f=>{let d=c.get(f);return d.includes("top")?0:d.includes("bottom")?"auto":m(d)},right:f=>{let d=c.get(f);return d.includes("right")?0:d.includes("left")?"auto":u(d)},bottom:f=>{let d=c.get(f);return d.includes("bottom")?0:d.includes("top")?"auto":u(d)},left:f=>{let d=c.get(f);return d.includes("left")?0:d.includes("right")?"auto":m(d)},transform:f=>{let d=c.get(f),y=d.includes("right")||d.includes("end")&&!d.includes("left")?"50%":"-50%",b=d.includes("bottom")||d.includes("end")&&!d.includes("top")?"50%":"-50%";return`translate(${y},${b}) rotate(45deg)`}}}}}function Fn(e={}){var r;let t=h((r=e.color)!=null?r:"inherit","color");return{_onInsert:o=>{o.tagName!="blockquote"&&console.warn('"blockquote" primitive patch must use blockquote tag')},dataTone:"shift-2",style:{fontSize:o=>p(o,"inherit"),backgroundColor:o=>l(o,"inherit",t.get(o)),boxShadow:o=>`inset ${s(1)} 0 0 0 ${l(o,"shift-4",t.get(o))}`,border:"none",paddingBlock:o=>s(g(o)*2),paddingInline:o=>s(g(o)*4),margin:0}}}function jn(e={}){var r;let t=h((r=e.color)!=null?r:"primary","color");return{_onInsert:o=>{o.tagName!="button"&&console.warn('"button" primitive patch must use button tag')},style:{appearance:"none",fontSize:o=>p(o,"inherit"),paddingBlock:o=>s(g(o)*1),paddingInline:o=>s(g(o)*3),borderRadius:o=>s(g(o)*1),width:"fit-content",display:"flex",justifyContent:"center",alignItems:"center",gap:o=>s(g(o)*1),userSelect:"none",fontFamily:"inherit",lineHeight:"inherit",border:"none",outlineOffset:"-1px",outlineWidth:"1px",outline:o=>`1px solid ${l(o,"shift-4",t.get(o))}`,color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),"&:hover:not([disabled]):not([aria-busy=true])":{color:o=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"shift-2",t.get(o))},"&:focus-visible":{boxShadow:o=>`inset 0 0 0 ${s(.5)} ${l(o,"shift-6",t.get(o))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:o=>l(o,"shift-2","neutral"),outline:o=>`1px solid ${l(o,"shift-4","neutral")}`,color:o=>l(o,"shift-8","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}}}function Wn(e={}){var o,i;let t=h((o=e.color)!=null?o:"neutral","color"),r=h((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"checkbox",_onInsert:n=>{n.tagName!=="input"&&console.warn('"inputCheckbox" primitive patch must use input tag')},style:{appearance:"none",fontSize:n=>p(n,"inherit"),display:"inline-flex",position:"relative",width:s(6),height:s(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:s(1),lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,color:n=>l(n,"shift-9",t.get(n)),width:s(4),height:s(4)},"&:hover::before":{backgroundColor:n=>l(n,"shift-2",t.get(n))},"&:checked::before":{outline:n=>`1px solid ${l(n,"shift-6",r.get(n))}`,backgroundColor:n=>l(n,"shift-8",r.get(n))},"&:checked:hover:not([disabled])::before":{backgroundColor:n=>l(n,"shift-7",r.get(n))},"&:checked::after":{content:'""',display:"block",position:"absolute",top:"25%",insetInlineStart:"37%",width:"20%",height:"30%",border:n=>`${s(.5)} solid ${l(n,"inherit",r.get(n))}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg)"},"&:indeterminate::before":{outline:n=>`1px solid ${l(n,"shift-6",r.get(n))}`,backgroundColor:n=>l(n,"shift-3",r.get(n))},"&:indeterminate::after":{content:'""',position:"absolute",inset:"30%",backgroundColor:n=>l(n,"shift-8",r.get(n))},"&:indeterminate:hover:not([disabled])::after":{backgroundColor:n=>l(n,"shift-7",r.get(n))},"&:focus-visible":{borderRadius:s(1.5),outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:n=>l(n,"shift-4","neutral"),pointerEvents:"none"}}}}function Un(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!="code"&&console.warn('"code" primitive patch must use code tag')},style:{display:"inline-flex",alignItems:"center",fontSize:o=>p(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),height:s(6),paddingInline:s(1.5),borderRadius:s(1)}}}function Kn(e={}){var i,n;let{duration:t=240}=e,r=h((i=e.color)!=null?i:"neutral","color"),o=h((n=e.accentColor)!=null?n:"primary","accentColor");return{_onInsert:a=>{a.tagName!="details"&&console.warn('"details" primitive patch must use details tag')},style:{fontSize:a=>p(a,"inherit"),color:a=>l(a,"shift-9",r.get(a)),backgroundColor:a=>l(a,"inherit",r.get(a)),overflow:"hidden","& > summary":{backgroundColor:a=>l(a,"shift-2",r.get(a)),color:a=>l(a,"shift-10",r.get(a)),fontSize:a=>p(a,"inherit"),listStyle:"none",display:"flex",justifyContent:"space-between",alignItems:"center",gap:s(2),cursor:"pointer",userSelect:"none",fontWeight:500,paddingInline:a=>s(g(a)*4),height:s(10)},"& > summary::-webkit-details-marker":{display:"none"},"& > summary::marker":{content:'""'},"& > summary::after":{content:'""',width:s(2),height:s(2),flexShrink:0,marginTop:`-${s(.5)}`,borderInlineEnd:a=>`${s(.5)} solid ${l(a,"shift-9",r.get(a))}`,borderBottom:a=>`${s(.5)} solid ${l(a,"shift-9",r.get(a))}`,transform:"rotate(45deg)",transition:`transform ${t}ms ease`},"&[open] > summary::after":{transform:"rotate(-135deg)"},"& > summary:hover":{backgroundColor:a=>l(a,"shift-3",r.get(a))},"& > summary:focus-visible":{borderRadius:a=>s(g(a)*2),outlineOffset:`-${s(.5)}`,outline:a=>`${s(.5)} solid ${l(a,"shift-6",o.get(a))}`},"& > :not(summary)":{maxHeight:"0px",opacity:0,overflow:"hidden",paddingInline:a=>s(g(a)*3),paddingTop:0,paddingBottom:0,transition:`max-height ${t}ms ease, opacity ${t}ms ease, padding ${t}ms ease`},"&[open] > :not(summary)":{maxHeight:s(250),opacity:1,paddingTop:a=>s(g(a)*1),paddingBottom:a=>s(g(a)*3)}}}}function qn(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="dl"&&console.warn('"descriptionList" primitive patch must use dl tag')},style:{display:"grid",gridTemplateColumns:`minmax(${s(24)}, max-content) 1fr`,columnGap:s(4),margin:0,"& dt":{margin:0,fontWeight:600,fontSize:o=>p(o,"inherit"),color:o=>l(o,"shift-10",t.get(o))},"& dd":{margin:0,fontSize:o=>p(o,"inherit"),color:o=>l(o,"shift-9",t.get(o))}}}}function Gn(e={}){let{color:t="neutral",open:r=!1}=e,o=h(r);return{_onInsert:i=>{i.tagName!="dialog"&&console.warn('"dialog" primitive patch must use dialog tag')},onClick:(i,n)=>{if(i.target!==n.domElement)return;let a=n.domElement.getBoundingClientRect();i.clientX>=a.left&&i.clientX<=a.right&&i.clientY>=a.top&&i.clientY<=a.bottom||o.set(!1)},onTransitionEnd:(i,n)=>{let a=n.domElement;a.style.opacity==="0"&&(a.close(),document.body.style.overflow="")},_onMount:i=>{let n=i.domElement,a=c=>{c?(n.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{n.style.opacity="1";let m=n.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');m==null||m.focus()})):n.style.opacity="0"};a(o.get()),o.addListener(a)},style:{opacity:"0",transition:"opacity 200ms ease",fontSize:i=>p(i,"inherit"),color:i=>l(i,"shift-10",t),backgroundColor:i=>l(i,"inherit",t),border:"none",padding:i=>s(g(i)*3),boxShadow:i=>`0 ${s(9)} ${s(16)} ${l(i,"shift-4","neutral")}`,"&::backdrop":{backgroundColor:i=>l(i,"shift-2","neutral"),opacity:.75}}}}function Yn(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="em"&&console.warn('"emphasis" primitive patch must use em tag')},style:{fontSize:o=>p(o,"inherit"),fontStyle:"italic",color:o=>l(o,"shift-10",t.get(o))}}}function Xn(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="figure"&&console.warn('"figure" primitive patch must use figure tag')},style:{display:"flex",flexDirection:"column",gap:s(2),marginInline:0,marginTop:s(3),marginBottom:s(3),color:o=>l(o,"shift-9",t.get(o)),"& img, & svg, & video, & canvas":{display:"block",maxWidth:"100%",borderRadius:s(2)},"& figcaption":{fontSize:o=>p(o,"decrease-1"),color:o=>l(o,"shift-8",t.get(o)),lineHeight:1.45}}}}function Jn(e={}){var i;let{layout:t="horizontal"}=e,r=h((i=e.color)!=null?i:"neutral","color"),o=t==="vertical";return{_onInsert:n=>{n.tagName!="fieldset"&&console.warn('"formGroup" patch must use fieldset tag')},style:{margin:0,paddingInline:n=>s(g(n)*3),paddingBlock:n=>s(g(n)*3),border:"none",borderRadius:n=>s(g(n)*2),fontSize:n=>p(n,"inherit"),backgroundColor:n=>l(n,"inherit",r.get(n)),display:"grid",gridTemplateColumns:o?"minmax(0, 1fr)":"max-content minmax(0, 1fr)",columnGap:s(4),rowGap:s(3),alignItems:"start","& > legend":{gridColumn:"1 / -1",margin:0,fontSize:n=>p(n,"inherit"),fontWeight:600,paddingBlock:n=>s(g(n)*1),borderRadius:n=>s(g(n)*2),color:n=>l(n,"shift-9",r.get(n)),backgroundColor:n=>l(n,"inherit",r.get(n))},"& > label":{gridColumn:"1",alignSelf:"start",margin:0,paddingBlock:n=>o?"0px":s(g(n)*1)},"& > label:has(+ :not(legend, label, p) + p)":{gridRow:o?"auto":"span 2"},"& > :not(legend, label, p)":{gridColumn:o?"1":"2",minWidth:0,width:"100%",boxSizing:"border-box"},"& > p":{gridColumn:o?"1":"2",minWidth:0,margin:0,marginBlockStart:`calc(${s(2)} * -1)`,fontSize:n=>p(n,"decrease-1"),color:n=>l(n,"shift-9",r.get(n))}}}}var Zn={h6:"decrease-1",h5:"inherit",h4:"increase-1",h3:"increase-2",h2:"increase-3",h1:"increase-4"};function Qn(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{["h1","h2","h3","h4","h5","h6"].includes(o.tagName)||console.warn('"heading" primitive patch must use heading tags [h1...h6]')},style:{color:o=>l(o,"shift-11",t.get(o)),marginTop:0,marginBottom:s(2),fontSize:o=>{let i=Zn[o.elementNode.tagName]||"inherit";return p(o,i)}}}}function er(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="hr"&&console.warn('"horizontalRule" primitive patch must use hr tag')},style:{border:0,height:"1px",marginInline:0,marginTop:s(3),marginBottom:s(3),backgroundColor:o=>l(o,"shift-4",t.get(o))}}}function tr(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!="img"&&console.warn('"image" primitive patch must use img tag')},style:{display:"block",width:"100%",maxWidth:"100%",height:"auto",objectFit:"cover",borderRadius:s(2),backgroundColor:o=>l(o,"inherit",t.get(o))}}}function or(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="span"&&console.warn('"icon" primitive patch should use span tag')},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",alignSelf:"center",justifySelf:"center",verticalAlign:"middle",width:s(4),height:s(4),flexShrink:"0",fontSize:o=>p(o),backgroundColor:"transparent",color:o=>l(o,"shift-9",t.get(o))}}}function nr(e={}){var o,i;let t=h((o=e.color)!=null?o:"neutral","color"),r=h((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"color",_onSchedule:(n,a)=>{n.tagName!="input"&&console.warn('"inputColor" primitive patch must use input tag'),a.type="color"},style:{appearance:"none",border:"none",cursor:"pointer",fontSize:n=>p(n,"inherit"),paddingBlock:n=>s(g(n)*1),paddingInline:n=>s(g(n)*1),blockSize:n=>s(6+g(n)*2),inlineSize:n=>s(6+g(n)*2),backgroundColor:"transparent","&::-webkit-color-swatch-wrapper":{margin:0,padding:0},"&::-webkit-color-swatch":{borderRadius:n=>s(g(n)*1)},"&:hover:not([disabled]), &:focus-visible":{},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:n=>l(n,"shift-2","neutral"),outline:n=>`1px solid ${l(n,"shift-4","neutral")}`}}}}function rr(e={}){var i,n;let{mode:t="datetime-local"}=e,r=h((i=e.color)!=null?i:"neutral","color"),o=h((n=e.accentColor)!=null?n:"primary","accentColor");return{type:t,_onSchedule:(a,c)=>{a.tagName!="input"&&console.warn('"inputDateTime" primitive patch must use input tag'),c.type=t},style:{fontFamily:"inherit",fontSize:a=>p(a,"inherit"),lineHeight:"inherit",color:a=>l(a,"shift-9",r.get(a)),backgroundColor:a=>l(a,"inherit",r.get(a)),border:"none",outlineOffset:"-1px",outline:a=>`1px solid ${l(a,"shift-4",r.get(a))}`,borderRadius:a=>s(g(a)*1),paddingInline:a=>s(g(a)*3),height:a=>s(6+g(a)*2),"&::-webkit-calendar-picker-indicator":{cursor:"pointer",opacity:.85},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:a=>`${s(.5)} solid ${l(a,"shift-6",o.get(a))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:a=>l(a,"shift-8","neutral"),backgroundColor:a=>l(a,"shift-2","neutral"),outline:a=>`1px solid ${l(a,"shift-4","neutral")}`},"&:invalid":{outline:a=>`${s(.5)} solid ${l(a,"shift-6","error")}`}}}}function ir(e={}){var o,i;let t=h((o=e.color)!=null?o:"neutral","color"),r=h((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"file",_onSchedule:(n,a)=>{n.tagName!="input"&&console.warn('"inputFile" primitive patch must use input tag'),a.type="file"},style:{fontFamily:"inherit",fontSize:n=>p(n,"inherit"),lineHeight:"inherit",color:n=>l(n,"shift-9",t.get(n)),backgroundColor:n=>l(n,"inherit",t.get(n)),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,borderRadius:n=>s(g(n)*1),height:n=>s(6+g(n)*2),paddingInline:n=>s(g(n)*1),"&::file-selector-button":{marginBlock:"auto",fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:s(1),height:s(6),paddingInline:s(2),cursor:"pointer",color:n=>l(n,"shift-10",r.get(n)),backgroundColor:n=>l(n,"shift-3",r.get(n))},"&::-webkit-file-upload-button":{marginTop:s(1),fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:s(1),height:s(6),paddingInline:s(2),cursor:"pointer",color:n=>l(n,"shift-10",t.get(n)),backgroundColor:n=>l(n,"shift-3",t.get(n))},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:n=>l(n,"shift-8","neutral"),outline:n=>`1px solid ${l(n,"shift-4","neutral")}`,backgroundColor:n=>l(n,"shift-2","neutral")},"&[disabled]::file-selector-button, &[disabled]::-webkit-file-upload-button":{cursor:"not-allowed",color:n=>l(n,"shift-8","neutral"),backgroundColor:n=>l(n,"shift-3","neutral")}}}}function ar(e={}){var o,i;let t=h((o=e.color)!=null?o:"neutral","color"),r=h((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"search",_onSchedule:(n,a)=>{n.tagName!="input"&&console.warn('"inputSearch" primitive patch must use input tag'),a.type="search"},style:{fontFamily:"inherit",fontSize:n=>p(n,"inherit"),lineHeight:"inherit",color:n=>l(n,"shift-9",t.get(n)),backgroundColor:n=>l(n,"inherit",t.get(n)),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,borderRadius:n=>s(g(n)*1),minWidth:s(32),paddingInline:n=>s(g(n)*3),paddingBlock:n=>s(g(n)*1),"&::placeholder":{color:n=>l(n,"shift-7",t.get(n))},"&::-webkit-search-decoration":{display:"none"},"&::-webkit-search-cancel-button":{cursor:"pointer"},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:n=>l(n,"shift-8","neutral"),backgroundColor:n=>l(n,"shift-2","neutral"),outline:n=>`1px solid ${l(n,"shift-4","neutral")}`}}}}function lr(e={}){var o,i;let t=h((o=e.color)!=null?o:"neutral","color"),r=h((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"text",_onSchedule:(n,a)=>{n.tagName!="input"&&console.warn('"inputText" primitive patch must use input tag and text type'),a.type="text"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:s(10),paddingInline:n=>s(g(n)*3),paddingBlock:n=>s(g(n)*1),borderRadius:n=>s(g(n)*1),fontSize:n=>p(n,"inherit"),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,color:n=>l(n,"shift-9",t.get(n)),backgroundColor:n=>l(n,"inherit",t.get(n)),"&::placeholder":{color:n=>l(n,"shift-7")},"&:not(:placeholder-shown)":{color:n=>l(n,"shift-10")},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:n=>l(n,"shift-2","neutral"),outline:n=>`1px solid ${l(n,"shift-4","neutral")}`,color:n=>l(n,"shift-8","neutral")},"&:invalid:not(:placeholder-shown)":{outline:n=>`${s(.5)} solid ${l(n,"shift-6","error")}`},"&[data-status=error]":{outline:n=>`${s(.5)} solid ${l(n,"shift-6","error")}`},"&[data-status=warning]":{outline:n=>`${s(.5)} solid ${l(n,"shift-6","warning")}`}}}}function sr(e={}){var o,i;let t=h((o=e.color)!=null?o:"neutral","color"),r=h((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"range",_onInsert:n=>{n.tagName!="input"&&console.warn('"inputRange" primitive patch must use input tag')},style:{appearance:"none",width:"100%",margin:0,padding:0,height:s(4),background:"transparent",cursor:"pointer","&::-webkit-slider-runnable-track":{height:s(1.5),borderRadius:s(999),backgroundColor:n=>l(n,"shift-3",t.get(n))},"&::-moz-range-track":{height:s(1.5),borderRadius:s(999),backgroundColor:n=>l(n,"shift-3",t.get(n))},"&::-webkit-slider-thumb":{appearance:"none",width:s(4),height:s(4),borderRadius:s(999),border:"none",marginTop:`calc((${s(1.5)} - ${s(4)}) / 2)`,backgroundColor:n=>l(n,"shift-9",r.get(n))},"&::-moz-range-thumb":{width:s(4),height:s(4),borderRadius:s(999),border:"none",backgroundColor:n=>l(n,"shift-9",r.get(n))},"&:hover:not([disabled])::-webkit-slider-thumb":{backgroundColor:n=>l(n,"shift-10",r.get(n))},"&:hover:not([disabled])::-moz-range-thumb":{backgroundColor:n=>l(n,"shift-10",r.get(n))},"&:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`,outlineOffset:s(1),borderRadius:s(2)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function cr(e={}){var o,i;let t=h((o=e.color)!=null?o:"neutral","color"),r=h((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"number",_onSchedule:(n,a)=>{n.tagName!="input"&&console.warn('"inputNumber" primitive patch must use input tag'),a.type="number"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:s(10),paddingInlineStart:n=>s(g(n)*3),paddingInlineEnd:n=>s(g(n)*1.5),paddingBlock:n=>s(g(n)*1),borderRadius:n=>s(g(n)*1),fontSize:n=>p(n,"inherit"),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,color:n=>l(n,"shift-9",t.get(n)),backgroundColor:n=>l(n,"inherit",t.get(n)),"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{opacity:1},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:n=>l(n,"shift-2","neutral"),outline:n=>`1px solid ${l(n,"shift-4","neutral")}`,color:n=>l(n,"shift-8","neutral")}}}}function mr(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="kbd"&&console.warn('"keyboard" primitive patch must use kbd tag')},style:{fontSize:o=>p(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),paddingBlock:s(.5),paddingInline:s(1.5),borderRadius:s(1),outline:o=>`1px solid ${l(o,"shift-4",t.get(o))}`}}}function ur(e={}){var o,i;let t=h((o=e.color)!=null?o:"neutral","color"),r=h((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:n=>{n.tagName!="label"&&console.warn('"label" primitive patch must use label tag')},style:{display:"inline-flex",alignItems:"center",gap:s(2),fontSize:n=>p(n,"inherit"),color:n=>l(n,"shift-9",t.get(n)),cursor:"pointer","&:focus-within":{color:n=>l(n,"shift-10",r.get(n))},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",color:n=>l(n,"shift-8","neutral")}}}}function fr(e={}){var o,i;let t=h((o=e.color)!=null?o:"primary","color"),r=h((i=e.accentColor)!=null?i:"secondary","accentColor");return{_onInsert:n=>{n.tagName!="a"&&console.warn('"link" primitive patch must use a tag')},style:{fontSize:n=>p(n,"inherit"),backgroundColor:n=>l(n),color:n=>l(n,"shift-9",t.get(n)),textDecoration:"none","&:visited":{color:n=>l(n,"shift-9",r.get(n))},"&:hover:not([disabled])":{color:n=>l(n,"shift-10",t.get(n)),textDecoration:"underline"},"&:focus-visible":{borderRadius:s(1),outlineOffset:s(1),outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:n=>l(n,"shift-8","neutral")}}}}function dr(e={}){var r;let t=h((r=e.accentColor)!=null?r:"highlight","accentColor");return{_onInsert:o=>{o.tagName!="mark"&&console.warn('"mark" primitive patch must use mark tag')},dataTone:"shift-2",style:{display:"inline-flex",alignItems:"center",fontSize:o=>p(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),height:s(6),borderRadius:s(1),paddingInline:s(1.5)}}}function hr(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="p"&&console.warn('"paragraph" primitive patch must use p tag')},style:{fontSize:o=>p(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),lineHeight:1.5,marginTop:0,marginBottom:0}}}function pr(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!="pre"&&console.warn('"preformated" primitive patch must use pre tag')},style:{fontSize:o=>p(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),border:"none",paddingBlock:o=>s(g(o)*2),paddingInline:o=>s(g(o)*3),borderRadius:o=>s(g(o)*2)}}}function gr(e={}){var o,i;let t=h((o=e.color)!=null?o:"neutral","color"),r=h((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:n=>{n.tagName!="progress"&&console.warn('"progress" primitive patch must use progress tag')},style:{appearance:"none",width:"100%",height:s(2),border:0,borderRadius:s(999),overflow:"hidden",backgroundColor:n=>l(n,"shift-3",t.get(n)),"&::-webkit-progress-bar":{backgroundColor:n=>l(n,"shift-3",t.get(n)),borderRadius:s(999)},"&::-webkit-progress-value":{backgroundColor:n=>l(n,"shift-9",r.get(n)),borderRadius:s(999),transition:"width 220ms ease"},"&::-moz-progress-bar":{backgroundColor:n=>l(n,"shift-9",r.get(n)),borderRadius:s(999)}}}}function yr(e={}){var o,i;let t=h((o=e.color)!=null?o:"neutral","color"),r=h((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"radio",_onInsert:n=>{if(n.tagName!="input"){console.warn('"inputRadio" primitive patch must use input tag and radio type');return}},style:{fontSize:n=>p(n,"inherit"),appearance:"none",display:"inline-flex",position:"relative",width:s(6),height:s(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:"50%",lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,color:n=>l(n,"shift-9",t.get(n)),width:s(4),height:s(4)},"&:hover::before":{backgroundColor:n=>l(n,"shift-2",t.get(n))},"&:checked::before":{outline:n=>`1px solid ${l(n,"shift-6",r.get(n))}`},"&:checked::after":{content:'""',position:"absolute",inset:"30%",borderRadius:"50%",backgroundColor:n=>l(n,"shift-8",r.get(n))},"&:checked:hover:not([disabled])::before":{backgroundColor:n=>l(n,"shift-7",r.get(n))},"&:focus-visible":{borderRadius:"50%",outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:n=>l(n,"shift-4","neutral"),pointerEvents:"none"}}}}function br(e={}){let{color:t="neutral",accentColor:r="primary"}=e;return{_onInsert:o=>{o.tagName!="select"&&console.warn('"select" primitive patch must use select tag')},style:{fontFamily:"inherit",fontSize:o=>p(o,"inherit"),lineHeight:"inherit",color:o=>l(o,"shift-9",t),backgroundColor:o=>l(o,"inherit",t),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${l(o,"shift-4",t)}`,borderRadius:o=>s(g(o)*1),paddingBlock:o=>s(g(o)*1),paddingLeft:o=>s(g(o)*3),paddingRight:o=>s(g(o)*1),"&:not([multiple])":{height:o=>s(6+g(o)*2)},"&:hover:not([disabled]):not([aria-busy=true])":{outline:o=>`${s(.5)} solid ${l(o,"shift-5",r)}`},"&:focus-visible":{outline:o=>`${s(.5)} solid ${l(o,"shift-6",r)}`},"& optgroup":{color:o=>l(o,"shift-11",t)},"& option[disabled]":{color:o=>l(o,"shift-7","neutral")},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>l(o,"shift-8","neutral"),outline:o=>`1px solid ${l(o,"shift-4","neutral")}`,backgroundColor:o=>l(o,"shift-2","neutral")}}}}function vr(e={}){var i;let t=h((i=e.color)!=null?i:"neutral","color"),r={"0%,100%":{opacity:1},"50%":{opacity:.4}},o=ce(JSON.stringify(r));return{ariaHidden:"true",dataTone:"shift-2",style:{fontSize:n=>p(n),color:n=>l(n,"shift-9",t.get(n)),height:s(6),display:"block",borderRadius:s(1),backgroundColor:n=>l(n,"inherit",t.get(n)),animation:`${o} 1.5s ease-in-out infinite`,[`@keyframes ${o}`]:r}}}var po={to:{transform:"rotate(360deg)"}},ho=ce(JSON.stringify(po));function Sr(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{role:"status",ariaLabel:"loading",_onInsert:o=>{o.tagName!="span"&&console.warn('"spinner" patch must use span tag')},style:{fontSize:o=>p(o),backgroundColor:o=>l(o),color:o=>l(o,"shift-9",t.get(o)),display:"inline-block",margin:0,flexShrink:0,width:s(6),height:s(6),borderRadius:"50%",border:o=>`${s(.5)} solid ${l(o,"shift-4",t.get(o))}`,borderTopColor:o=>l(o,"shift-9",t.get(o)),boxSizing:"border-box",padding:0,animation:`${ho} 0.7s linear infinite`,[`@keyframes ${ho}`]:po}}}function xr(e={}){var a;let{color:t="neutral",multiple:r=!1}=e,o=h((a=e.value)!=null?a:r?[]:null),i={div:c=>{let m=o.get(c);return(Array.isArray(m)?m:[m]).map(f=>({input:null,name:e.name,value:f||""}))},hidden:!0};return{dataTone:"shift-17",_context:{select:{value:o,multiple:r}},_onInit:c=>{c.tagName!="div"&&console.warn('"selectList" patch must use a div tag'),c.children.insert(i)},style:{display:"flex",flexDirection:"column",paddingBlock:c=>s(g(c)*2),paddingInline:c=>s(g(c)*2),fontSize:c=>p(c,"inherit"),backgroundColor:c=>l(c,"inherit",t)}}}function Cr(e={}){let{accentColor:t="primary",color:r="neutral",value:o=null}=e;return{role:"option",_onInit:n=>{n.tagName!="div"&&console.warn('"selectItem" patch must use div tag');let a=n.getContext("select");if(a){let c=a.value;n.attributes.set("ariaSelected",m=>{let u=c.get(m);return a.multiple?u.includes(o):u==o}),n.addEvent("click",()=>{let m=c.get();a.multiple?m.includes(o)?c.set(m.filter(u=>u!==o)):c.set(m.concat([o])):m!=o&&c.set(o)})}},style:{cursor:"pointer",display:"flex",alignItems:"center",fontSize:n=>p(n,"inherit"),height:n=>s(6+g(n)*2),paddingInline:n=>s(g(n)*3),border:"none",outline:"none",color:n=>l(n,"shift-9",r),backgroundColor:n=>l(n,"inherit",r),"&:hover:not([disabled]):not([aria-selected=true])":{backgroundColor:n=>l(n,"shift-2",r)},"&[aria-selected=true]":{backgroundColor:n=>l(n,"shift-6",t),color:n=>l(n,"shift-11")},"&:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",t)}`,outlineOffset:`-${s(.5)}`}}}}function wr(e){let{options:t=[],placement:r="bottom",color:o="neutral",open:i=!1,multiple:n=!1}=e,a=h(e.value),c=h(i),{show:m,hide:u,anchorPartial:f}=K({open:c,placement:r,content:e.content,onPlacement:e.onPlacement}),d={onClick:()=>!n&&u()};k(e.content,d);let y={div:v=>{let x=a.get(v),S=Array.isArray(x)?x:[x];return t.filter(w=>S.includes(w.value)).map(w=>({span:w.label,$:[ve({color:o,removable:n})],_key:w.value,_onRemove:T=>{let E=a.get(),O=(Array.isArray(E)?E:[E]).filter($=>$!==w.value);n?a.set(O):a.set(O[0])}}))},style:{display:"flex",flexWrap:"wrap",gap:s(1),flex:1}},b={_onInsert:v=>{v.tagName!="div"&&console.warn('"selectBox" patch must use div tag')},_onInit:v=>v.children.insert(y),onClick:()=>c.get()?u():m(),style:{cursor:"pointer",display:"flex",alignItems:"center",minHeight:v=>s(6+g(v)*2),minWidth:s(32),outlineOffset:"-1px",outline:v=>`1px solid ${l(v,"shift-4","neutral")}`,paddingInline:v=>s(g(v)*2),borderRadius:v=>s(g(v)*1),fontSize:v=>p(v,"inherit"),color:v=>l(v,"shift-9",o),backgroundColor:v=>l(v,"inherit",o)}};return k(f,b),f}function Er(e={}){var r;let t=h((r=e.accentColor)!=null?r:"primary","accentColor");return{dataTone:"shift-2",type:"checkbox",_onSchedule:o=>{if(o.tagName!="input"){console.warn('"inputSwitch" primitive patch must use input tag');return}},style:{fontSize:o=>p(o,"inherit"),appearance:"none",position:"relative",display:"inline-flex",width:s(9),height:s(6),cursor:"pointer",margin:"0",paddingBlock:s(1),"&:checked":{"&::before":{backgroundColor:o=>l(o,"increase-3",t.get(o))},"&::after":{left:`calc(100% - ${s(3.5)})`}},"&::after":{content:'""',aspectRatio:"1/1",position:"absolute",width:s(3),height:s(3),borderRadius:s(999),left:s(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",backgroundColor:o=>l(o,"decrease-3")},"&::before":{content:'""',width:"100%",borderRadius:s(999),display:"inline-block",fontSize:o=>p(o,"inherit"),lineHeight:1,backgroundColor:o=>l(o)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function kr(e={}){var n,a;let{checked:t=!1}=e,r=h(t),o=h((n=e.color)!=null?n:"neutral","color"),i=h((a=e.accentColor)!=null?a:"primary","accentColor");return{_onSchedule:c=>{c.tagName!="button"&&console.warn('"buttonSwitch" primitive patch must use button tag')},role:"switch",ariaChecked:c=>r.get(c),dataTone:"shift-2",onClick:()=>r.set(!r.get()),style:{position:"relative",display:"inline-flex",alignItems:"center",fontSize:c=>p(c),border:"none",outlineWidth:"1px",outline:c=>`1px solid ${l(c,"shift-3",o.get(c))}`,minWidth:s(12),minHeight:s(6),borderRadius:s(999),paddingLeft:s(7),paddingRight:s(2),transition:"padding-left 0.3s, padding-right 0.3s",backgroundColor:c=>l(c,"inherit",o.get(c)),"& > :first-child":{content:'""',position:"absolute",display:"inline-flex",alignItems:"center",left:s(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",width:s(5),height:s(5),borderRadius:s(999),color:c=>l(c,"shift-9"),backgroundColor:c=>l(c,"decrease-2",o.get(c))},"&[aria-checked=true]":{backgroundColor:c=>l(c,"increase-3",i.get(c)),outline:"none",color:c=>l(c,"decrease-2"),paddingLeft:s(2),paddingRight:s(7)},"&[aria-checked=true] > :first-child":{left:`calc(100% - ${s(5.5)})`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Tr(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{dataSize:"decrease-1",_onInsert:o=>{o.tagName!="small"&&console.warn('"small" primitive patch must use small tag')},style:{fontSize:o=>p(o,"inherit"),color:o=>l(o,"shift-9",t.get(o))}}}function _r(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="strong"&&console.warn('"strong" primitive patch must use strong tag')},style:{fontSize:o=>p(o,"inherit"),fontWeight:700,color:o=>l(o,"shift-11",t.get(o)),backgroundColor:o=>l(o)}}}function Or(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="sub"&&console.warn('"subscript" primitive patch must use sub tag')},style:{fontSize:o=>p(o,"decrease-1"),verticalAlign:"sub",lineHeight:0,color:o=>l(o,"shift-9",t.get(o))}}}function Pr(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="sup"&&console.warn('"superscript" primitive patch must use sup tag')},style:{fontSize:o=>p(o,"decrease-1"),verticalAlign:"super",lineHeight:0,color:o=>l(o,"shift-9",t.get(o))}}}function Rr(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="table"&&console.warn('"table" primitive patch must use table tag')},style:{fontSize:o=>p(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),width:"100%",borderCollapse:"collapse","& caption":{captionSide:"bottom"},"& th, & thead td":{textAlign:"left",fontWeight:500,paddingInline:o=>s(g(o)*3),paddingBlock:o=>s(g(o)*1),color:o=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"inherit")},"& td":{textAlign:"left",paddingInline:o=>s(g(o)*3),paddingBlock:o=>s(g(o)*1),color:o=>l(o,"shift-9",t.get(o)),boxShadow:o=>`inset 0 1px 0 ${l(o,"shift-4",t.get(o))}`,fontSize:o=>p(o,"inherit")},"& tfoot th, & tfoot td":{textAlign:"left",fontWeight:500,paddingInline:o=>s(g(o)*3),paddingBlock:o=>s(g(o)*1),color:o=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"inherit"),boxShadow:o=>`inset 0 -1px 0 ${l(o,"shift-4",t.get(o))}`},"& tr":{backgroundColor:o=>l(o,"inherit")},"& tbody tr:hover":{backgroundColor:o=>l(o,"shift-3")+"!important"}}}}function $r(e={}){var o,i;let t=h((o=e.color)!=null?o:"neutral","color"),r=h((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:n=>{n.tagName!="textarea"&&console.warn('"textarea" primitive patch must use textarea tag')},style:{fontFamily:"inherit",lineHeight:"inherit",resize:"vertical",paddingInline:n=>s(g(n)*4),paddingBlock:n=>s(g(n)*2),border:"none",borderRadius:n=>s(g(n)*2),fontSize:n=>p(n,"inherit"),color:n=>l(n,"shift-9",t.get(n)),outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,backgroundColor:n=>l(n,"inherit",t.get(n)),"&::placeholder":{color:n=>l(n,"shift-7")},"&:hover:not([disabled]):not([aria-busy=true])":{outline:n=>`${s(.5)} solid ${l(n,"shift-5",r.get(n))}`},"&:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&:invalid":{outline:n=>`${s(.5)} solid ${l(n,"shift-5","error")}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:n=>l(n,"shift-8","neutral"),outline:n=>`1px solid ${l(n,"shift-4","neutral")}`,backgroundColor:n=>l(n,"shift-2","neutral")}}}}function Lr(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="ul"&&console.warn('"unorderedList" primitive patch must use ul tag')},style:{fontSize:o=>p(o,"inherit"),backgroundColor:o=>l(o),color:o=>l(o,"shift-9",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:s(3),listStyleType:"disc",listStylePosition:"outside"}}}function Ir(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!="ol"&&console.warn('"orderedList" primitive patch must use ol tag')},style:{fontSize:o=>p(o,"inherit"),backgroundColor:o=>l(o),color:o=>l(o,"shift-9",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:s(3),listStyleType:"decimal",listStylePosition:"outside"}}}function zr(e,t){if(t<=7)return Array.from({length:t},(n,a)=>a+1);let r=[1];e>3&&r.push("...");let o=Math.max(2,e-1),i=Math.min(t-1,e+1);for(let n=o;n<=i;n++)r.push(n);return e<t-2&&r.push("..."),r.push(t),r}function Mr(e){var c;let{total:t,color:r="neutral",accentColor:o="primary"}=e,i=h((c=e.value)!=null?c:1),n={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:m=>s(6+g(m)*2),height:m=>s(6+g(m)*2),paddingInline:m=>s(g(m)*2),borderRadius:m=>s(g(m)*1),border:"none",cursor:"pointer",fontSize:m=>p(m,"inherit"),backgroundColor:"transparent",color:m=>l(m,"shift-9",r),"&:hover:not([disabled])":{backgroundColor:m=>l(m,"shift-2",r)},"&[disabled]":{opacity:.4,cursor:"not-allowed"}},a=A(P({},n),{backgroundColor:m=>l(m,"shift-6",o),color:m=>l(m,"shift-11",o),fontWeight:"600",cursor:"default","&:hover:not([disabled])":{backgroundColor:m=>l(m,"shift-6",o)}});return{_onInsert:m=>{m.tagName!=="div"&&console.warn('"pagination" patch must use div tag')},_onInit:m=>{let u={div:f=>{let d=i.get(f),y=[];y.push({button:"\u2039",type:"button",ariaLabel:"Previous page",disabled:d<=1,onClick:()=>d>1&&i.set(d-1),style:n});for(let b of zr(d,t))if(b==="...")y.push({span:"\u2026",style:{display:"inline-flex",alignItems:"center",paddingInline:v=>s(g(v)*2),color:v=>l(v,"shift-7",r)}});else{let v=b===d;y.push({button:String(b),type:"button",ariaLabel:`Page ${b}`,ariaCurrent:v?"page":void 0,disabled:v,onClick:()=>i.set(b),style:v?a:n})}return y.push({button:"\u203A",type:"button",ariaLabel:"Next page",disabled:d>=t,onClick:()=>d<t&&i.set(d+1),style:n}),y},style:{display:"flex",alignItems:"center",gap:s(1)}};m.children.insert(u)},style:{display:"inline-flex"}}}function Ar(e={}){var r;let t=h((r=e.color)!=null?r:"neutral","color");return{role:"separator",_onInsert:o=>{o.tagName!=="div"&&console.warn('"divider" patch should be used with <div>')},style:{display:"flex",justifyContent:"center",alignItems:"baseline",gap:s(2),fontSize:o=>p(o,"inherit"),backgroundColor:o=>l(o),color:o=>l(o,"shift-9",t.get(o)),minHeight:"1lh","&::before":{content:'""',flex:1,borderColor:o=>l(o,"shift-4",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"},"&::after":{content:'""',flex:1,borderColor:o=>l(o,"shift-4",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"}}}}var go={left:"translateX(-100%)",right:"translateX(100%)",top:"translateY(-100%)",bottom:"translateY(100%)"},Vr={left:"0 auto 0 0",right:"0 0 0 auto",top:"0 0 auto 0",bottom:"auto 0 0 0"},mt=e=>e==="left"||e==="right";function Nr(e={}){let{color:t="neutral",open:r=!1,placement:o="right",size:i}=e,n=h(r),a=mt(o)?s(80):s(64),c=i!=null?i:a;return{_onInsert:m=>{m.tagName!=="dialog"&&console.warn('"drawer" patch must use dialog tag')},onClick:(m,u)=>{m.target===u.domElement&&n.set(!1)},onTransitionEnd:(m,u)=>{let f=u.domElement;n.get()||(f.close(),document.body.style.overflow="")},_onMount:m=>{let u=m.domElement,f=d=>{d?(u.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{u.style.transform="translate(0, 0)"})):u.style.transform=go[o]};f(n.get()),n.addListener(f)},style:{transform:go[o],transition:"transform 0.25s ease",fontSize:m=>p(m,"inherit"),color:m=>l(m,"shift-10",t),backgroundColor:m=>l(m,"inherit",t),border:"none",padding:m=>s(g(m)*3),margin:Vr[o],width:mt(o)?c:"100dvw",height:mt(o)?"100dvh":c,maxWidth:"100dvw",maxHeight:"100dvh",boxShadow:m=>`0 ${s(4)} ${s(12)} ${l(m,"shift-4","neutral")}`,"&::backdrop":{backgroundColor:m=>l(m,"shift-2","neutral"),opacity:.75}}}}function Dr(e){let{open:t=!1,placement:r="bottom",openOn:o="click"}=e,i=null,n=h(t),{show:a,hide:c,anchorPartial:m}=K({open:n,placement:r,content:e.content,onPlacement:e.onPlacement}),u={role:"dialog",dataTone:"shift-17",onMouseEnter:()=>o==="hover"&&a(),onMouseLeave:()=>o==="hover"&&c(),_onInsert:d=>{let y=d.attributes.get("id");i=y||d.nodeId,!y&&d.attributes.set("id",i)}};return k(e.content,u),k(m,{ariaHaspopup:"dialog",ariaExpanded:d=>n.get(d),onMouseEnter:()=>o==="hover"&&a(),onMouseLeave:()=>o==="hover"&&c(),onClick:()=>o==="click"&&(n.get()?c():a()),onFocus:()=>a(),onBlur:()=>c(),_onMount:d=>i&&d.attributes.set("ariaControls",i)}),m}function Br(e={}){let{position:t="top-center",color:r="neutral"}=e,o=h(!1),i=t.startsWith("top"),n=t.endsWith("center"),a=t.endsWith("right"),c={div:[],id:`domphy-toast-${t}`,style:{position:"fixed",display:"flex",flexDirection:i?"column":"column-reverse",alignItems:n?"center":a?"end":"start",inset:0,gap:s(4),zIndex:30,padding:s(6),pointerEvents:"none"}};return{_portal:m=>{let u=m.domElement.querySelector(`#domphy-toast-${t}`);return u||(u=m.children.insert(c).domElement),u},role:"status",ariaAtomic:"true",dataTone:"shift-17",style:{minWidth:s(32),pointerEvents:"auto",paddingBlock:m=>s(g(m)*2),paddingInline:m=>s(g(m)*4),borderRadius:m=>s(g(m)*2),fontSize:m=>p(m,"inherit"),color:m=>l(m,"shift-9",r),backgroundColor:m=>l(m,"inherit",r),boxShadow:m=>`0 ${s(2)} ${s(9)} ${l(m,"shift-4","neutral")}`,opacity:m=>Number(o.get(m)),transform:m=>o.get(m)?"translateY(0)":i?"translateY(-100%)":"translateY(100%)",transition:"opacity 300ms ease, transform 300ms ease"},_onMount:()=>requestAnimationFrame(()=>o.set(!0)),_onBeforeRemove:(m,u)=>{let f=d=>{d.propertyName==="transform"&&(m.domElement.removeEventListener("transitionend",f),u())};m.domElement.addEventListener("transitionend",f),o.set(!1)}}}function Hr(e={}){let{open:t=!1,placement:r="top",content:o="Tooltip Content"}=e,i=null,n=h(r),a=typeof o=="string"?{span:o}:o,{show:c,hide:m,anchorPartial:u}=K({open:t,placement:r,content:a}),f={role:"tooltip",dataSize:"decrease-1",dataTone:"shift-17",_onInsert:y=>{let b=y.attributes.get("id");i=b||y.nodeId,!b&&y.attributes.set("id",i)},style:{paddingBlock:y=>s(g(y)*1),paddingInline:y=>s(g(y)*3),borderRadius:y=>s(g(y)*1),color:y=>l(y,"shift-9"),backgroundColor:y=>l(y),fontSize:y=>p(y,"inherit")},$:[ct({placement:r,bordered:!1})]};return a.$||(a.$=[]),a.$.push(f),k(u,{onMouseEnter:()=>c(),onMouseLeave:()=>m(),onFocus:()=>c(),onBlur:()=>m(),onKeyDown:y=>y.key==="Escape"&&m(),_onMount:y=>i&&y.attributes.set("ariaDescribedby",i)}),u}function yo(e,t){return e.key!==void 0&&e.key!==null?String(e.key):`index-${t}`}function Fr(e={}){let{duration:t=300,delay:r=0}=e,o=new Map;return{_onBeforeUpdate:i=>{o=new Map,i.children.items.forEach((n,a)=>{if(!(n instanceof L))return;let c=n.domElement;c&&o.set(yo(n,a),c.getBoundingClientRect())})},_onUpdate:i=>{i.children.items.forEach((n,a)=>{if(!(n instanceof L))return;let c=n.domElement;if(!c)return;let m=yo(n,a),u=o.get(m);if(!u)return;let f=c.getBoundingClientRect(),d=u.left-f.left,y=u.top-f.top;if(Math.abs(d)<.5&&Math.abs(y)<.5)return;let b=c.style.transition,v=c.style.transform;c.style.transition="none",c.style.transform=`translate(${d}px, ${y}px)`,c.getBoundingClientRect(),requestAnimationFrame(()=>{c.style.transition=`transform ${t}ms ease ${r}ms`,c.style.transform="translate(0px, 0px)"});let x=()=>{c.style.transition=b,c.style.transform=v,c.removeEventListener("transitionend",S)},S=C=>{C.propertyName==="transform"&&x()};c.addEventListener("transitionend",S),setTimeout(x,t+r+34)}),o.clear()}}}function jr(e={}){return{role:"tablist",_onSchedule:(r,o)=>{let i={_context:{tabs:{activeKey:h(e.activeKey||0)}}};k(o,i)}}}function Wr(e={}){let{accentColor:t="primary",color:r="neutral"}=e;return{role:"tab",_onInsert:i=>{var u;i.tagName!="button"&&console.warn('"tab" patch must use button tag');let n=i.getContext("tabs"),a=(u=i.parent)==null?void 0:u.children.items;a=a.filter(f=>f.type=="ElementNode"&&f.attributes.get("role")=="tab");let c=i.key||a.findIndex(f=>f==i),m={id:"tab"+i.parent.nodeId+c,ariaControls:"tabpanel"+i.parent.nodeId+c,ariaSelected:f=>n.activeKey.get(f)==c,onClick:()=>n.activeKey.set(c),onKeyDown:f=>{var S,C,w,T;let d=f.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(d))return;f.preventDefault();let y=((C=(S=i.parent)==null?void 0:S.children.items)!=null?C:[]).filter(E=>E.type==="ElementNode"&&E.attributes.get("role")==="tab"),b=y.findIndex(E=>E===i),v=b;d==="ArrowRight"?v=(b+1)%y.length:d==="ArrowLeft"?v=(b-1+y.length)%y.length:d==="Home"?v=0:d==="End"&&(v=y.length-1);let x=y[v];n.activeKey.set((w=x.key)!=null?w:v),(T=x.domElement)==null||T.focus()}};i.merge(m)},style:{cursor:"pointer",fontSize:i=>p(i,"inherit"),height:i=>s(6+g(i)*2),paddingInline:i=>s(g(i)*4),border:"none",outline:"none",color:i=>l(i,"shift-9"),backgroundColor:i=>l(i,"inherit"),boxShadow:i=>`inset 0 -${s(.5)} 0 0 ${l(i,"shift-1",r)}`,"&:hover:not([disabled])":{boxShadow:i=>`inset 0 -${s(.5)} 0 0 ${l(i,"shift-2",r)}`},"&[aria-selected=true]:not([disabled])":{boxShadow:i=>`inset 0 -${s(.5)} 0 0 ${l(i,"shift-6",t)}`},"&:focus-visible":{boxShadow:i=>`inset 0 -${s(.5)} 0 0 ${l(i,"shift-6",t)}`}}}}function Ur(){return{role:"tabpanel",style:{paddingBlock:t=>s(g(t)*2),paddingInline:t=>s(g(t)*2)},_onInsert:t=>{var a;let r=t.getContext("tabs"),o=(a=t.parent)==null?void 0:a.children.items;o=o.filter(c=>c.type=="ElementNode"&&c.attributes.get("role")=="tabpanel");let i=t.key||o.findIndex(c=>c==t),n={id:"tabpanel"+t.parent.nodeId+i,ariaLabelledby:"tab"+t.parent.nodeId+i,hidden:c=>r.activeKey.get(c)!=i};t.merge(n)}}}function Kr(e={}){let{color:t="neutral"}=e;return{role:"menu",dataTone:"shift-17",_onSchedule:(o,i)=>{let n={_context:{menu:{activeKey:h(e.activeKey||0)}}};k(i,n)},style:{display:"flex",flexDirection:"column",paddingBlock:o=>s(g(o)*2),paddingInline:o=>s(g(o)*2),fontSize:o=>p(o,"inherit"),backgroundColor:o=>l(o,"inherit",t)}}}function qr(e={}){let{accentColor:t="primary",color:r="neutral"}=e;return{role:"menuitem",_onInsert:i=>{var m;i.tagName!="button"&&console.warn('"menuItem" patch must use button tag');let n=i.getContext("menu"),a=(m=i.parent)==null?void 0:m.children.items;a=a.filter(u=>u.type=="ElementNode"&&u.attributes.get("role")=="menuitem");let c=i.key||a.findIndex(u=>u==i);i.attributes.set("ariaCurrent",u=>n.activeKey.get(u)==c||void 0),i.addEvent("click",()=>n.activeKey.set(c))},onKeyDown:(i,n)=>{var f,d,y;let a=i.key;if(!["ArrowDown","ArrowUp","Home","End"].includes(a))return;i.preventDefault();let c=((d=(f=n.parent)==null?void 0:f.children.items)!=null?d:[]).filter(b=>b.type==="ElementNode"&&b.attributes.get("role")==="menuitem"),m=c.findIndex(b=>b===n),u=m;a==="ArrowDown"?u=(m+1)%c.length:a==="ArrowUp"?u=(m-1+c.length)%c.length:a==="Home"?u=0:a==="End"&&(u=c.length-1),(y=c[u].domElement)==null||y.focus()},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:i=>p(i,"inherit"),height:i=>s(6+g(i)*2),paddingInline:i=>s(g(i)*3),border:"none",outline:"none",color:i=>l(i,"shift-9"),backgroundColor:i=>l(i,"inherit"),"&:hover:not([disabled]):not([aria-current=true])":{backgroundColor:i=>l(i,"shift-2")},"&[aria-current=true]":{backgroundColor:i=>l(i,"shift-3",t),color:i=>l(i,"shift-10")},"&:focus-visible":{outline:i=>`${s(.5)} solid ${l(i,"shift-6",t)}`,outlineOffset:`-${s(.5)}`}}}}function Gr(e){return{_onSchedule:(t,r)=>{k(r,{_context:{form:e}})}}}function Yr(e,t){return{_onInsert:r=>{let i=r.getContext("form").setField(e,void 0,t),n=r.tagName,a=r.attributes.get("type");["input","select","textarea"].includes(n)||console.warn('"field" patch must use input, select, or textarea tag');let c={onBlur:()=>i.setTouched(),ariaInvalid:m=>!!i.message("error",m)||void 0,dataStatus:m=>i.status(m)};n==="input"&&a==="checkbox"?(c.checked=i.value(),c.onChange=m=>i.setValue(m.target.checked)):n==="input"&&a==="radio"?c.onChange=m=>i.setValue(m.target.value):n==="select"?(c.value=i.value(),c.onChange=m=>i.setValue(m.target.value)):n==="textarea"?(c.value=i.value(),c.onInput=m=>i.setValue(m.target.value)):(c.value=i.value(),c.onInput=m=>i.setValue(m.target.value)),r.merge(c)}}}function Xr(e){return!!e&&typeof e.then=="function"}var _e=class{constructor(t,r){this._notifier=new se;this._messages={};this._touched=!1;this._pending=!1;this._validationToken=0;this._value=t,this._initValue=t,this._validator=r,r&&this.validate()}value(t){return t&&this._notifier.addListener("value",t),this._value}setValue(t){this._value=t,this._notifier.notify("value",t),this._notifier.notify("dirty",t!==this._initValue),this.validate()}dirty(t){return t&&this._notifier.addListener("dirty",t),this._value!==this._initValue}touched(t){return t&&this._notifier.addListener("touched",t),this._touched}setTouched(){this._touched||(this._touched=!0,this._notifier.notify("touched",!0))}configure(t,r){let o=!1;t!==void 0&&this._value===void 0&&this._initValue===void 0&&(this._value=t,this._initValue=t,this._notifier.notify("value",t),this._notifier.notify("dirty",!1),o=!0),r!==void 0&&r!==this._validator&&(this._validator=r,o=!0),o&&this.validate()}message(t,r){return r&&this._notifier.addListener(t,r),this._messages[t]}status(t){return t&&this._notifier.addListener("status",t),He(this._messages)}setMessages(t){let r=this._messages;this._messages=t;for(let o of["error","warning","success"])r[o]!==t[o]&&this._notifier.notify(o,t[o]);He(r)!==He(t)&&this._notifier.notify("status",He(t))}reset(){this._value=this._initValue,this._touched=!1,this._notifier.notify("value",this._value),this._notifier.notify("dirty",!1),this._notifier.notify("touched",!1),this.setMessages({}),this.validate()}validate(){let t=++this._validationToken;if(!this._validator){this._pending=!1,this.setMessages({});return}try{let r=this._validator(this._value);Xr(r)?(this._pending=!0,Promise.resolve(r).then(o=>{t===this._validationToken&&(this._pending=!1,this.setMessages(o!=null?o:{}))}).catch(o=>{t===this._validationToken&&(this._pending=!1,console.error(o))})):(this._pending=!1,this.setMessages(r!=null?r:{}))}catch(r){t===this._validationToken&&(this._pending=!1),console.error(r)}}_dispose(){this._validationToken+=1,this._pending=!1,this._notifier._dispose()}};function He(e){if(e.error)return"error";if(e.warning)return"warning";if(e.success)return"success"}var ut=class{constructor(){this.fields=new Map}setField(t,r,o){let i=this.fields.get(t);return i?i.configure(r,o):(i=new _e(r,o),this.fields.set(t,i)),i}getField(t){return this.setField(t)}removeField(t){var r;(r=this.fields.get(t))==null||r._dispose(),this.fields.delete(t)}get valid(){for(let t of this.fields.values())if(t._pending||t._messages.error)return!1;return!0}reset(){for(let t of this.fields.values())t.reset()}snapshot(){let t={};for(let[r,o]of this.fields)Jr(t,r,o._value);return t}_dispose(){for(let t of this.fields.values())t._dispose();this.fields.clear()}};function Jr(e,t,r){let o=t.split("."),i=e;for(let n=0;n<o.length-1;n++){let a=o[n];i[a]==null&&(i[a]=isNaN(Number(o[n+1]))?{}:[]),i=i[a]}i[o[o.length-1]]=r}return Eo(Zr);})();
|
|
6
6
|
//# sourceMappingURL=core-theme-ui.global.js.map
|